cosey 0.1.1 → 0.1.3

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 (213) hide show
  1. package/components/audio-card/audio-card.vue.js +1 -1
  2. package/components/close/close.vue.js +1 -1
  3. package/components/components.d.ts +98 -44
  4. package/components/config-provider/config-provider.js +1 -3
  5. package/components/config-provider/config-provider.vue.d.ts +2 -7
  6. package/components/config-provider/index.d.ts +1 -1
  7. package/components/context-menu/content.vue.js +1 -1
  8. package/components/context-menu/context-menu.vue.js +2 -2
  9. package/components/copy/copy.vue.js +1 -1
  10. package/components/cssinjs/parser.js +8 -25
  11. package/components/dnd-sort/dnd-sort-item.vue.js +2 -3
  12. package/components/dnd-sort/dnd-sort.vue.js +1 -2
  13. package/components/dnd-sort/index.d.ts +1 -1
  14. package/components/editor/components/button-group.vue.d.ts +2 -7
  15. package/components/editor/components/button.vue.d.ts +2 -7
  16. package/components/editor/components/color-picker/color-picker.vue.d.ts +2 -43
  17. package/components/editor/components/color-picker/color-picker.vue.js +14 -11
  18. package/components/editor/components/picker/picker.vue.d.ts +2 -15
  19. package/components/editor/components/resize/resize.js +4 -4
  20. package/components/editor/components/resize/resize.style.js +9 -32
  21. package/components/editor/components/resize/resize.vue.js +21 -14
  22. package/components/editor/components/select-button.vue.d.ts +2 -9
  23. package/components/editor/components/select-button.vue.js +1 -1
  24. package/components/editor/components/split-button.vue.d.ts +2 -19
  25. package/components/editor/components/split-button.vue.js +1 -1
  26. package/components/editor/components/table-toolbar/table-toolbar.vue.js +9 -9
  27. package/components/editor/components/toolbar/formats/align.vue.js +4 -4
  28. package/components/editor/components/toolbar/formats/blockquote.vue.js +1 -1
  29. package/components/editor/components/toolbar/formats/bold.vue.js +1 -1
  30. package/components/editor/components/toolbar/formats/clean.vue.js +1 -1
  31. package/components/editor/components/toolbar/formats/code-block.vue.js +1 -1
  32. package/components/editor/components/toolbar/formats/code.vue.js +1 -1
  33. package/components/editor/components/toolbar/formats/formula.vue.js +4 -3
  34. package/components/editor/components/toolbar/formats/image.vue.js +1 -1
  35. package/components/editor/components/toolbar/formats/indent.vue.js +2 -2
  36. package/components/editor/components/toolbar/formats/italic.vue.js +1 -1
  37. package/components/editor/components/toolbar/formats/link.vue.js +15 -13
  38. package/components/editor/components/toolbar/formats/list.vue.js +3 -3
  39. package/components/editor/components/toolbar/formats/script.vue.js +2 -2
  40. package/components/editor/components/toolbar/formats/size-delta.vue.js +2 -2
  41. package/components/editor/components/toolbar/formats/strike.vue.js +1 -1
  42. package/components/editor/components/toolbar/formats/table.vue.js +1 -1
  43. package/components/editor/components/toolbar/formats/underline.vue.js +1 -1
  44. package/components/editor/components/toolbar/formats/video.vue.js +1 -1
  45. package/components/editor/components/toolbar/toolbar.d.ts +1 -2
  46. package/components/editor/components/toolbar/toolbar.js +17 -21
  47. package/components/editor/components/toolbar/toolbarContext.js +1 -3
  48. package/components/editor/formats/image.d.ts +13 -0
  49. package/components/editor/formats/image.js +46 -0
  50. package/components/editor/formats/indent.d.ts +2 -0
  51. package/components/editor/formats/indent.js +12 -7
  52. package/components/editor/formats/link.js +1 -5
  53. package/components/editor/formats/list.d.ts +0 -4
  54. package/components/editor/formats/list.js +10 -5
  55. package/components/editor/formats/video.js +6 -9
  56. package/components/editor/modules/custom-list.js +1 -6
  57. package/components/editor/modules/image-uploader/formats/image-loading.style.js +3 -3
  58. package/components/editor/modules/image-uploader/image-uploader.js +1 -3
  59. package/components/editor/quill.js +7 -4
  60. package/components/editor/quillContext.js +1 -3
  61. package/components/editor/style/index.js +1 -5
  62. package/components/field/components/checkbox-group/panel.vue.d.ts +2 -20
  63. package/components/field/components/checkbox-group/panel.vue.js +2 -2
  64. package/components/field/components/tree-select/tree-select.d.ts +1 -2
  65. package/components/field/components/tree-select/tree-select.js +69 -0
  66. package/components/file-card/file-card.vue.js +1 -1
  67. package/components/form/form-item.vue.js +1 -1
  68. package/components/form/useFormItemWidth.js +1 -1
  69. package/components/form/useFormTemplate.js +2 -10
  70. package/components/form-dialog/form-dialog.vue.d.ts +0 -1
  71. package/components/form-dialog/form-dialog.vue.js +1 -1
  72. package/components/form-dialog/index.d.ts +0 -3
  73. package/components/form-group/form-group.vue.js +1 -1
  74. package/components/form-list/form-list.js +1 -6
  75. package/components/form-list/form-list.vue.js +2 -2
  76. package/components/form-query/form-query.vue.js +5 -5
  77. package/components/horizontal-tree/horizontal-tree.vue.js +16 -12
  78. package/components/iconify-icon/iconify-icon.d.ts +3 -0
  79. package/components/iconify-icon/iconify-icon.js +9 -0
  80. package/components/iconify-icon/iconify-icon.vue.js +2 -5
  81. package/components/iconify-icon/index.js +1 -0
  82. package/components/index.js +3 -2
  83. package/components/media-card-group/media-card-group.vue.js +4 -3
  84. package/components/scroll-view/scroll-view.vue.js +1 -2
  85. package/components/snug-menu/snug-menu.vue.js +1 -2
  86. package/components/style/animation.d.ts +5 -0
  87. package/components/style/animation.js +33 -0
  88. package/components/style/index.d.ts +1 -1
  89. package/components/style/index.js +2 -2
  90. package/components/style/mixins.d.ts +2 -0
  91. package/components/style/mixins.js +10 -1
  92. package/components/table/index.d.ts +0 -8
  93. package/components/table/style/index.js +2 -2
  94. package/components/table/table-column/renderer.js +22 -18
  95. package/components/table/table-column-editor/item.vue.js +4 -7
  96. package/components/table/table-column-editor/table-column-editor.vue.d.ts +2 -246
  97. package/components/table/table-column-editor/table-column-editor.vue.js +9 -9
  98. package/components/table/table-export/table-export.vue.js +2 -2
  99. package/components/table/table-query/table-query.d.ts +0 -4
  100. package/components/table/table-query/table-query.js +0 -4
  101. package/components/table/table-query/table-query.vue.d.ts +0 -9
  102. package/components/table/table-query/table-query.vue.js +14 -12
  103. package/components/table/table.js +1 -3
  104. package/components/table/table.vue.js +22 -24
  105. package/components/table/useTable.js +1 -4
  106. package/components/table/utils.js +1 -3
  107. package/components/table-action/item.vue.js +5 -5
  108. package/components/table-action/table-action.vue.js +4 -3
  109. package/components/theme/StyleContext.js +1 -3
  110. package/components/theme/createCacheToken.js +1 -4
  111. package/components/theme/getGlobalStyleHook.js +2 -5
  112. package/components/theme/getSimpleStyleHook.js +1 -4
  113. package/components/theme/getStyleHook.js +1 -4
  114. package/components/theme/interface/index.d.ts +1 -1
  115. package/components/theme/themes/shared/genColorMapToken.js +1 -4
  116. package/components/theme/useStyleRegister.js +1 -3
  117. package/components/theme/util/alias.js +4 -16
  118. package/components/theme/util/getAlphaColor.js +1 -6
  119. package/components/theme/util/normalizeStyle.js +1 -1
  120. package/components/theme/util/statistic.js +4 -1
  121. package/components/theme/util/useToken.js +1 -4
  122. package/components/toggle/toggle.vue.js +1 -1
  123. package/components/transition/transition.vue.js +1 -2
  124. package/components/upload/upload-item.vue.js +8 -8
  125. package/components/upload/upload.vue.js +1 -1
  126. package/components/video-card/video-card.vue.js +1 -1
  127. package/config/index.d.ts +1 -0
  128. package/config/index.js +2 -7
  129. package/config/layout.d.ts +36 -0
  130. package/config/layout.js +37 -1
  131. package/config/nprogress.style.d.ts +2 -0
  132. package/config/nprogress.style.js +51 -0
  133. package/config/root-config-provider.vue.d.ts +2 -20
  134. package/config/root-config-provider.vue.js +2 -0
  135. package/hooks/useColorScheme.js +5 -9
  136. package/hooks/useEcharts.js +2 -4
  137. package/hooks/useFetch.d.ts +1 -1
  138. package/hooks/useFetch.js +1 -7
  139. package/hooks/useFullPage.js +7 -9
  140. package/hooks/useLocale.js +1 -3
  141. package/hooks/useLockscreenObserver.js +1 -1
  142. package/hooks/usePersist.js +1 -3
  143. package/hooks/useTreeCheck.js +13 -26
  144. package/hooks/useUpsert.d.ts +3 -3
  145. package/index.d.ts +1 -0
  146. package/index.js +5 -4
  147. package/layout/index.js +2 -2
  148. package/layout/layout-aside/layout-aside.vue.js +2 -1
  149. package/layout/layout-base/layout-base.vue.js +1 -1
  150. package/layout/layout-change-password/layout-change-password.vue.js +8 -8
  151. package/layout/layout-change-password/style/index.js +1 -1
  152. package/layout/layout-color-scheme/layout-color-scheme.vue.js +8 -14
  153. package/layout/layout-color-scheme/style/index.d.ts +0 -3
  154. package/layout/layout-color-scheme/style/index.js +26 -44
  155. package/layout/layout-content/layout-content.vue.d.ts +2 -13
  156. package/layout/layout-forbidden/layout-forbidden.vue.js +2 -2
  157. package/layout/layout-header/layout-header.vue.d.ts +2 -14
  158. package/layout/layout-internal-server-error/layout-internal-server-error.vue.js +2 -2
  159. package/layout/layout-login/layout-login.vue.js +5 -5
  160. package/layout/layout-login/style/index.js +1 -1
  161. package/layout/layout-mask/style/index.js +1 -1
  162. package/layout/layout-not-found/layout-not-found.vue.js +2 -2
  163. package/layout/layout-search/layout-search.vue.js +37 -34
  164. package/layout/layout-sidebar/layout-sidebar.vue.d.ts +2 -15
  165. package/layout/layout-sidebar/style/index.js +1 -1
  166. package/layout/layout-switch-effect/layout-switch-effect.vue.d.ts +2 -7
  167. package/layout/layout-tabbar/layout-tabbar.vue.js +2 -2
  168. package/layout/layout-tabbar/reload.vue.js +1 -1
  169. package/layout/layout-tabbar/style/index.js +2 -2
  170. package/layout/layout-toggle/layout-toggle.vue.js +1 -1
  171. package/layout/layout-top-snug-menu/layout-top-snug-menu.vue.js +4 -3
  172. package/layout/layout-topbar/layout-topbar.vue.d.ts +2 -1217
  173. package/layout/layout-user-menu/index.d.ts +1 -0
  174. package/layout/layout-user-menu/index.js +1 -0
  175. package/layout/{layout-user/layout-user.vue.js → layout-user-menu/layout-user-menu.vue.js} +18 -13
  176. package/layout/{layout-user → layout-user-menu}/style/index.js +9 -5
  177. package/layout/layout.d.ts +1 -1
  178. package/layout/layout.js +1 -1
  179. package/layout/merged/index.d.ts +1 -1
  180. package/layout/merged/index.js +1 -1
  181. package/layout/merged/{layout-user.js → layout-user-menu.js} +1 -1
  182. package/layout/utils.js +1 -4
  183. package/package.json +16 -6
  184. package/request/useRequest.js +1 -1
  185. package/router/guard/auth.js +2 -5
  186. package/router/guard/index.js +0 -2
  187. package/router/guard/progress.js +11 -1
  188. package/router/index.d.ts +22 -0
  189. package/store/layout.d.ts +2 -8
  190. package/store/layout.js +19 -31
  191. package/store/user.d.ts +1 -1
  192. package/store/user.js +1 -1
  193. package/utils/array.js +3 -0
  194. package/utils/excel/index.js +1 -3
  195. package/utils/excel/utils.js +1 -5
  196. package/utils/file.js +1 -3
  197. package/utils/object.js +1 -3
  198. package/utils/tree.js +2 -11
  199. package/utils/vue.js +1 -1
  200. package/components/global.d.js +0 -1
  201. package/components/style/motion/index.d.ts +0 -1
  202. package/components/style/motion/index.js +0 -1
  203. package/components/style/motion/loading.d.ts +0 -3
  204. package/components/style/motion/loading.js +0 -23
  205. package/layout/layout-user/index.d.ts +0 -1
  206. package/layout/layout-user/index.js +0 -1
  207. package/router/guard/popup.d.ts +0 -2
  208. package/router/guard/popup.js +0 -6
  209. package/types/vue-router.d.js +0 -1
  210. package/types/vue.d.js +0 -1
  211. /package/layout/{layout-user/layout-user.vue.d.ts → layout-user-menu/layout-user-menu.vue.d.ts} +0 -0
  212. /package/layout/{layout-user → layout-user-menu}/style/index.d.ts +0 -0
  213. /package/layout/merged/{layout-user.d.ts → layout-user-menu.d.ts} +0 -0
package/config/layout.js CHANGED
@@ -6,7 +6,43 @@ const defaultLayoutConfig = {
6
6
  /**
7
7
  * 是否启用标签页缓存
8
8
  */
9
- keepAlive: true
9
+ keepAlive: true,
10
+ /**
11
+ * 是否默认显示侧边栏
12
+ */
13
+ sidebarVisible: true,
14
+ /**
15
+ * 是否默认折叠收起垂直菜单
16
+ */
17
+ collapse: false,
18
+ /**
19
+ * 菜单类型
20
+ */
21
+ menuType: "vertical",
22
+ /**
23
+ * 是否显示标签页
24
+ */
25
+ tabbarVisible: true,
26
+ /**
27
+ * 侧边菜单宽度
28
+ */
29
+ asideWidth: 220,
30
+ /**
31
+ * 折叠时侧边栏菜单宽度
32
+ */
33
+ collapsedAsideWidth: 64,
34
+ /**
35
+ * 紧凑侧边菜单宽度
36
+ */
37
+ snugAsideWidth: 85,
38
+ /**
39
+ * 顶部栏高度
40
+ */
41
+ topbarHeight: 48,
42
+ /**
43
+ * 标签栏高度
44
+ */
45
+ tabbarHeight: 41
10
46
  };
11
47
 
12
48
  export { defaultLayoutConfig };
@@ -0,0 +1,2 @@
1
+ declare const _default: (theme?: import("vue").ComputedRef<import("../components").ThemeConfig | undefined>) => void;
2
+ export default _default;
@@ -0,0 +1,51 @@
1
+ import { rotation } from '../components/style/animation.js';
2
+ import { getGlobalStyleHook } from '../components/theme/getGlobalStyleHook.js';
3
+
4
+ var stdin_default = getGlobalStyleHook("co-editor-image-loading", (token) => {
5
+ return {
6
+ "#nprogress": {
7
+ pointerEvents: "none",
8
+ ".bar": {
9
+ position: "fixed",
10
+ top: 0,
11
+ left: 0,
12
+ zIndex: 1030,
13
+ width: "100%",
14
+ height: "2px",
15
+ background: token.colorPrimary
16
+ },
17
+ ".peg": {
18
+ display: "block",
19
+ position: "absolute",
20
+ right: 0,
21
+ width: 100,
22
+ height: "100%",
23
+ boxShadow: `0 0 10px ${token.colorPrimary}, 0 0 5px ${token.colorPrimary}`,
24
+ opacity: 1,
25
+ transform: `rotate(3deg) translate(0px, -4px)`
26
+ },
27
+ ".spinner": {
28
+ position: "fixed",
29
+ top: 15,
30
+ right: 15,
31
+ zIndex: 1030,
32
+ display: "block"
33
+ },
34
+ ".spinner-icon": {
35
+ width: 18,
36
+ height: 18,
37
+ boxSizing: "border-box",
38
+ border: `solid 2px transparent`,
39
+ borderTopColor: token.colorPrimary,
40
+ borderLeftColor: token.colorPrimary,
41
+ borderRadius: "50%",
42
+ animationName: rotation,
43
+ animationDuration: "0.4s",
44
+ animationTimingFunction: "linear",
45
+ animationIterationCount: "infinite"
46
+ }
47
+ }
48
+ };
49
+ });
50
+
51
+ export { stdin_default as default };
@@ -1,28 +1,10 @@
1
1
  import { RootConfigProviderProps } from './root-config-provider';
2
- import { ConfigProvider } from '../components';
3
2
  import 'element-plus/dist/index.css';
4
3
  import 'element-plus/theme-chalk/dark/css-vars.css';
5
- declare const mergedConfigProviderProps: import("vue").ComputedRef<{
6
- theme: {
7
- algorithm: import("../components/theme/theme-context").MappingAlgorithm | import("../components/theme/theme-context").MappingAlgorithm[];
8
- token?: Partial<import("../components").AliasToken>;
9
- components?: import("../components/theme/interface").OverrideToken;
10
- inherit?: boolean;
11
- };
12
- prefixCls: string;
13
- table: import("../components").TableConfig;
14
- }>;
15
- declare const locale: import("vue").Ref<any, any>;
16
- declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
17
4
  declare var __VLS_10: {};
18
- type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
5
+ type __VLS_Slots = {} & {
19
6
  default?: (props: typeof __VLS_10) => any;
20
- }>;
21
- declare const __VLS_self: import("vue").DefineComponent<RootConfigProviderProps, {
22
- ConfigProvider: typeof ConfigProvider;
23
- mergedConfigProviderProps: typeof mergedConfigProviderProps;
24
- locale: typeof locale;
25
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<RootConfigProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
+ };
26
8
  declare const __VLS_component: import("vue").DefineComponent<RootConfigProviderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<RootConfigProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
9
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
28
10
  export default _default;
@@ -2,6 +2,7 @@ import { defineComponent, computed, provide, reactive, resolveComponent, createB
2
2
  import { getAlgorithm } from './root-config-provider.js';
3
3
  import { useLayoutStore } from '../store/layout.js';
4
4
  import { useGlobalConfig } from './index.js';
5
+ import stdin_default$1 from './nprogress.style.js';
5
6
  import 'element-plus/dist/index.css';
6
7
  import 'element-plus/theme-chalk/dark/css-vars.css';
7
8
  import { useColorSchemeProvide } from '../hooks/useColorScheme.js';
@@ -31,6 +32,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
31
32
  },
32
33
  setup(__props) {
33
34
  const props = __props;
35
+ stdin_default$1();
34
36
  const {
35
37
  appliedColorScheme
36
38
  } = useColorSchemeProvide();
@@ -5,9 +5,9 @@ import { isClient } from '../utils/env.js';
5
5
  const colorSchemeContextSymbol = Symbol("colorScheme");
6
6
  const colorSchemeKey = "colorScheme";
7
7
  const colorSchemeOptions = [
8
- { label: "\u8DDF\u968F\u7CFB\u7EDF", icon: "mdi:circle-half-full", value: "auto" },
9
- { label: "\u6D45\u8272", icon: "mdi:white-balance-sunny", value: "light" },
10
- { label: "\u6DF1\u8272", icon: "mdi:weather-night", value: "dark" }
8
+ { label: "\u8DDF\u968F\u7CFB\u7EDF", icon: "co:circle-half-full", value: "auto" },
9
+ { label: "\u6D45\u8272", icon: "co:sun", value: "light" },
10
+ { label: "\u6DF1\u8272", icon: "co:moon", value: "dark" }
11
11
  ];
12
12
  function useColorSchemeProvide() {
13
13
  const persist = usePersist();
@@ -15,9 +15,7 @@ function useColorSchemeProvide() {
15
15
  const colorScheme = ref(defaultColorScheme);
16
16
  const appliedColorScheme = ref("light");
17
17
  const colorSchemeOption = computed(() => {
18
- return colorSchemeOptions.find(
19
- (option) => option.value === colorScheme.value
20
- );
18
+ return colorSchemeOptions.find((option) => option.value === colorScheme.value);
21
19
  });
22
20
  const mediaQueryList = window.matchMedia("(prefers-color-scheme: dark)");
23
21
  const handleChange = (event) => {
@@ -70,9 +68,7 @@ function useColorSchemeProvide() {
70
68
  return context;
71
69
  }
72
70
  function useColorScheme() {
73
- return inject(
74
- colorSchemeContextSymbol
75
- );
71
+ return inject(colorSchemeContextSymbol);
76
72
  }
77
73
 
78
74
  export { colorSchemeOptions, useColorScheme, useColorSchemeProvide };
@@ -14,16 +14,14 @@ function useEcharts(elRef, options = {}) {
14
14
  onBeforeUnmount(() => {
15
15
  dispose();
16
16
  });
17
- const optionQueue = ref(
18
- options.option ? [[options.option]] : []
19
- );
17
+ const optionQueue = ref(options.option ? [[options.option]] : []);
20
18
  const setOption = (...args) => {
21
19
  optionQueue.value = [...optionQueue.value, args];
22
20
  };
23
21
  const doSetOption = () => {
24
22
  if (chart && optionQueue.value.length) {
25
23
  for (const option of optionQueue.value) {
26
- chart.setOption.apply(chart, option);
24
+ chart.setOption(...option);
27
25
  }
28
26
  optionQueue.value = [];
29
27
  }
@@ -5,7 +5,7 @@ export interface UseFetchOptions<T> {
5
5
  immediate?: boolean;
6
6
  initialData?: T;
7
7
  }
8
- export declare function useFetch<T = unknown, U = unknown>(fetcher: (params: U) => Promise<any> | any, options?: UseFetchOptions<T>): {
8
+ export declare function useFetch<T = any, U = any>(fetcher: (params: U) => Promise<any> | any, options?: UseFetchOptions<T>): {
9
9
  isFetching: import("vue").ShallowRef<boolean, boolean>;
10
10
  data: import("vue").Ref<any, any> extends T | undefined ? import("vue").ShallowRef<undefined, undefined> | (T extends T & import("vue").Ref<any, any> ? import("@vue/shared").IfAny<T, import("vue").ShallowRef<T, T>, T> : import("vue").ShallowRef<T, T>) : import("vue").ShallowRef<T | undefined, T | undefined>;
11
11
  error: import("vue").ShallowRef<any, any>;
package/hooks/useFetch.js CHANGED
@@ -1,13 +1,7 @@
1
1
  import { shallowRef } from 'vue';
2
2
 
3
3
  function useFetch(fetcher, options = {}) {
4
- const {
5
- immediate = true,
6
- initialData,
7
- onSuccess,
8
- onError,
9
- onFinally
10
- } = options;
4
+ const { immediate = true, initialData, onSuccess, onError, onFinally } = options;
11
5
  const isFetching = shallowRef(false);
12
6
  const data = shallowRef(initialData);
13
7
  const error = shallowRef();
@@ -11,16 +11,10 @@ function useFullPage(options = {}) {
11
11
  };
12
12
  onMounted(() => {
13
13
  target.value = document.documentElement;
14
- document.documentElement.addEventListener(
15
- "fullscreenchange",
16
- onFullscreenChange
17
- );
14
+ document.documentElement.addEventListener("fullscreenchange", onFullscreenChange);
18
15
  });
19
16
  onBeforeUnmount(() => {
20
- document.documentElement.removeEventListener(
21
- "fullscreenchange",
22
- onFullscreenChange
23
- );
17
+ document.documentElement.removeEventListener("fullscreenchange", onFullscreenChange);
24
18
  });
25
19
  const isFullPage = ref(false);
26
20
  const enter = () => {
@@ -40,7 +34,11 @@ function useFullPage(options = {}) {
40
34
  }
41
35
  };
42
36
  const toggle = () => {
43
- isFullPage.value ? exit() : enter();
37
+ if (isFullPage.value) {
38
+ exit();
39
+ } else {
40
+ enter();
41
+ }
44
42
  };
45
43
  return {
46
44
  isFullPage,
@@ -32,9 +32,7 @@ function useLocaleProvide() {
32
32
  return context;
33
33
  }
34
34
  function useLocale() {
35
- return inject(
36
- localeContextSymbol
37
- );
35
+ return inject(localeContextSymbol);
38
36
  }
39
37
 
40
38
  export { useLocale, useLocaleProvide };
@@ -6,7 +6,7 @@ function useLockscreenObserver() {
6
6
  let observer;
7
7
  onMounted(() => {
8
8
  observer = new MutationObserver((mutationsList) => {
9
- for (let mutation of mutationsList) {
9
+ for (const mutation of mutationsList) {
10
10
  if (mutation.type === "attributes" && mutation.attributeName === "class") {
11
11
  locked.value = document.body.classList.contains(hiddenCls);
12
12
  }
@@ -1,9 +1,7 @@
1
1
  import Persist from '@gunny/persist';
2
2
  import { inject } from 'vue';
3
3
 
4
- const persistContextKey = Symbol(
5
- "persistContext"
6
- );
4
+ const persistContextKey = Symbol("persistContext");
7
5
  const createPersist = (name, type) => {
8
6
  return new Persist(name, { type });
9
7
  };
@@ -1,25 +1,16 @@
1
1
  import { ref, shallowReactive, computed, provide, inject } from 'vue';
2
2
  import { walkTreeNode, mapTree, mapTreeExtra, walkAncestor } from '../utils/tree.js';
3
3
 
4
- const treeCheckContextKey = Symbol(
5
- "treeCheckContext"
6
- );
4
+ const treeCheckContextKey = Symbol("treeCheckContext");
7
5
  function useTreeCheck(options) {
8
- const {
9
- childrenKey = "children",
10
- initialChecked,
11
- mergeLast,
12
- checkStrictly
13
- } = options || {};
6
+ const { childrenKey = "children", initialChecked, mergeLast, checkStrictly } = options || {};
14
7
  const initialCheckedStatus = initialChecked ? "checked" : "unchecked";
15
8
  const tree = ref([]);
16
9
  const rootNode = shallowReactive({
17
10
  checkedStatus: initialCheckedStatus
18
11
  });
19
12
  const checkAllValue = computed(() => rootNode.checkedStatus === "checked");
20
- const checkAllIndeterminate = computed(
21
- () => rootNode.checkedStatus === "indeterminate"
22
- );
13
+ const checkAllIndeterminate = computed(() => rootNode.checkedStatus === "indeterminate");
23
14
  const updateAncestorChecked = (node) => {
24
15
  walkAncestor(node, "parent", (node2) => {
25
16
  const children = node2.children || [];
@@ -43,21 +34,17 @@ function useTreeCheck(options) {
43
34
  setCheckedByNode(rootNode, !!value);
44
35
  };
45
36
  const initialize = (rawTree) => {
46
- rootNode.children = tree.value = mapTreeExtra(
47
- rawTree,
48
- (rawNode) => rawNode,
49
- {
50
- childrenKey,
51
- parent: rootNode,
52
- mergeLast,
53
- customNode(node) {
54
- return shallowReactive({
55
- ...node,
56
- checkedStatus: initialCheckedStatus
57
- });
58
- }
37
+ rootNode.children = tree.value = mapTreeExtra(rawTree, (rawNode) => rawNode, {
38
+ childrenKey,
39
+ parent: rootNode,
40
+ mergeLast,
41
+ customNode(node) {
42
+ return shallowReactive({
43
+ ...node,
44
+ checkedStatus: initialCheckedStatus
45
+ });
59
46
  }
60
- );
47
+ });
61
48
  rootNode.checkedStatus = initialCheckedStatus;
62
49
  };
63
50
  const getRawTree = () => {
@@ -1,7 +1,7 @@
1
1
  export interface UseUpsertExposeOptions {
2
2
  success?: () => any;
3
3
  }
4
- export interface UseUpsertExpose<Row extends Record<string, any>, Data extends unknown> {
4
+ export interface UseUpsertExpose<Row extends Record<string, any>, Data> {
5
5
  edit: (row: Row) => any;
6
6
  add: () => any;
7
7
  setData: (data: Data) => UseUpsertExpose<Row, Data>;
@@ -22,7 +22,7 @@ export interface UseUpsertOptions<Model, Row = Model, Data = Model> {
22
22
  addSuccessText?: string;
23
23
  editSuccessText?: string;
24
24
  }
25
- export declare function useUpsert<Model extends Record<string, any>, Row extends Record<string, any> = Model, Data extends unknown = unknown>(options: UseUpsertOptions<Model, Row>): {
25
+ export declare function useUpsert<Model extends Record<string, any>, Row extends Record<string, any> = Model, Data = any>(options: UseUpsertOptions<Model, Row>): {
26
26
  expose: UseUpsertExpose<Row, Data>;
27
27
  edit: (row: Row) => any;
28
28
  add: () => any;
@@ -44,7 +44,7 @@ export declare function useUpsert<Model extends Record<string, any>, Row extends
44
44
  export interface UseExternalUpsertOptions {
45
45
  success?: () => any;
46
46
  }
47
- export declare function useOuterUpsert<Row extends Record<string, any>, Data extends unknown>(options: UseExternalUpsertOptions): {
47
+ export declare function useOuterUpsert<Row extends Record<string, any>, Data>(options: UseExternalUpsertOptions): {
48
48
  add: () => void;
49
49
  edit: (row: Row) => void;
50
50
  setData: (data: Data) => /*elided*/ any;
package/index.d.ts CHANGED
@@ -12,4 +12,5 @@ export interface CoseyApp<HostElement> extends App<HostElement> {
12
12
  export declare const createCosey: (options?: CoseyOptions) => {
13
13
  install(app: App): void;
14
14
  store: import("pinia").Pinia;
15
+ router: import("vue-router").Router;
15
16
  };
package/index.js CHANGED
@@ -40,7 +40,7 @@ export { default as LayoutTabbar } from './layout/layout-tabbar/layout-tabbar.vu
40
40
  export { default as LayoutToggle } from './layout/layout-toggle/layout-toggle.vue.js';
41
41
  export { default as LayoutTopSnugMenu } from './layout/layout-top-snug-menu/layout-top-snug-menu.vue.js';
42
42
  export { default as LayoutTopbar } from './layout/layout-topbar/layout-topbar.vue.js';
43
- export { default as LayoutUser } from './layout/layout-user/layout-user.vue.js';
43
+ export { default as LayoutUserMenu } from './layout/layout-user-menu/layout-user-menu.vue.js';
44
44
  export { default as MergedLayoutAside } from './layout/merged/layout-aside.js';
45
45
  export { default as MergedLayoutAuth } from './layout/merged/layout-auth.js';
46
46
  export { default as MergedLayoutBase } from './layout/merged/layout-base.js';
@@ -69,22 +69,23 @@ export { default as MergedLayoutTabbar } from './layout/merged/layout-tabbar.js'
69
69
  export { default as MergedLayoutToggle } from './layout/merged/layout-toggle.js';
70
70
  export { default as MergedLayoutTopSnugMenu } from './layout/merged/layout-top-snug-menu.js';
71
71
  export { default as MergedLayoutTopbar } from './layout/merged/layout-topbar.js';
72
- export { default as MergedLayoutUser } from './layout/merged/layout-user.js';
72
+ export { default as MergedLayoutUserMenu } from './layout/merged/layout-user-menu.js';
73
73
  export { defineRoute, defineRoutes, mergeRouteModules } from './router/utils.js';
74
74
  export { getBreadcrumbRoutes, getMenuPathKeys, getMenus, getMenusMap } from './router/menus/index.js';
75
75
 
76
76
  const createCosey = (options = {}) => {
77
77
  const store = createStore();
78
+ const router = createCoseyRouter(options.router);
78
79
  return {
79
80
  install(app) {
80
81
  provideGlobalConfig(app, options);
81
- const router = createCoseyRouter(options.router);
82
82
  app.use(router);
83
83
  registerRouterGuard(router);
84
84
  app.use(store);
85
85
  registerGlobalComponents(app);
86
86
  },
87
- store
87
+ store,
88
+ router
88
89
  };
89
90
  };
90
91
 
package/layout/index.js CHANGED
@@ -28,7 +28,7 @@ export { default as LayoutTabbar } from './layout-tabbar/layout-tabbar.vue.js';
28
28
  export { default as LayoutToggle } from './layout-toggle/layout-toggle.vue.js';
29
29
  export { default as LayoutTopSnugMenu } from './layout-top-snug-menu/layout-top-snug-menu.vue.js';
30
30
  export { default as LayoutTopbar } from './layout-topbar/layout-topbar.vue.js';
31
- export { default as LayoutUser } from './layout-user/layout-user.vue.js';
31
+ export { default as LayoutUserMenu } from './layout-user-menu/layout-user-menu.vue.js';
32
32
  export { default as MergedLayoutAside } from './merged/layout-aside.js';
33
33
  export { default as MergedLayoutAuth } from './merged/layout-auth.js';
34
34
  export { default as MergedLayoutBase } from './merged/layout-base.js';
@@ -57,7 +57,7 @@ export { default as MergedLayoutTabbar } from './merged/layout-tabbar.js';
57
57
  export { default as MergedLayoutToggle } from './merged/layout-toggle.js';
58
58
  export { default as MergedLayoutTopSnugMenu } from './merged/layout-top-snug-menu.js';
59
59
  export { default as MergedLayoutTopbar } from './merged/layout-topbar.js';
60
- export { default as MergedLayoutUser } from './merged/layout-user.js';
60
+ export { default as MergedLayoutUserMenu } from './merged/layout-user-menu.js';
61
61
 
62
62
  function registerGlobalComponents(app) {
63
63
  app.use(ElementPlus);
@@ -57,7 +57,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
57
57
  onClick: _cache[0] || (_cache[0] = $event => unref(layoutStore).collapse = !unref(layoutStore).collapse)
58
58
  }, {
59
59
  default: withCtx(() => [createVNode(unref(_Icon), {
60
- name: unref(layoutStore).collapse ? "mdi:chevron-double-right" : "mdi:chevron-double-left"
60
+ size: "lg",
61
+ name: unref(layoutStore).collapse ? "co:chevron-right" : "co:chevron-left"
61
62
  }, null, 8, ["name"])]),
62
63
  _: 1
63
64
  /* STABLE */
@@ -15,7 +15,7 @@ import stdin_default$e 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';
18
- import stdin_default$b from '../merged/layout-user.js';
18
+ import stdin_default$b from '../merged/layout-user-menu.js';
19
19
  import stdin_default$1 from './style/index.js';
20
20
  import { useLayoutStore } from '../../store/layout.js';
21
21
  import { useGlobalConfig } from '../../config/index.js';
@@ -52,7 +52,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
52
52
  ref_key: "formRef",
53
53
  ref: formRef,
54
54
  model: formState,
55
- onKeyup: withKeys(withModifiers(onSubmit, ["prevent"]), ["enter", "native"])
55
+ onKeyup: withKeys(withModifiers(onSubmit, ["prevent"]), ["enter"])
56
56
  }, {
57
57
  default: withCtx(() => [createVNode(_component_el_form_item, {
58
58
  prop: "oldPassword",
@@ -70,7 +70,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
70
70
  placeholder: "\u539F\u5BC6\u7801"
71
71
  }, {
72
72
  prefix: withCtx(() => [createVNode(_component_co_icon, {
73
- name: "mdi:shield-key-outline",
73
+ name: "co:password",
74
74
  class: normalizeClass(`${unref(prefixCls)}-icon`)
75
75
  }, null, 8, ["class"])]),
76
76
  _: 1
@@ -94,7 +94,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
94
94
  placeholder: "\u65B0\u5BC6\u7801"
95
95
  }, {
96
96
  prefix: withCtx(() => [createVNode(_component_co_icon, {
97
- name: "mdi:shield-key-outline",
97
+ name: "co:password",
98
98
  class: normalizeClass(`${unref(prefixCls)}-icon`)
99
99
  }, null, 8, ["class"])]),
100
100
  _: 1
@@ -124,7 +124,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
124
124
  placeholder: "\u786E\u8BA4\u5BC6\u7801"
125
125
  }, {
126
126
  prefix: withCtx(() => [createVNode(_component_co_icon, {
127
- name: "mdi:shield-key-outline",
127
+ name: "co:password",
128
128
  class: normalizeClass(`${unref(prefixCls)}-icon`)
129
129
  }, null, 8, ["class"])]),
130
130
  _: 1
@@ -141,8 +141,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
141
141
  onClick: onSubmit
142
142
  }, {
143
143
  default: withCtx(() => _cache[4] || (_cache[4] = [createTextVNode(" \u4FEE\u6539\u5BC6\u7801 ")])),
144
- _: 1
145
- /* STABLE */
144
+ _: 1,
145
+ __: [4]
146
146
  }, 8, ["class", "loading"])]),
147
147
  _: 1
148
148
  /* STABLE */
@@ -153,8 +153,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
153
153
  onClick: _cache[3] || (_cache[3] = $event => unref(router).back())
154
154
  }, {
155
155
  default: withCtx(() => _cache[5] || (_cache[5] = [createTextVNode(" \u8FD4\u56DE ")])),
156
- _: 1
157
- /* STABLE */
156
+ _: 1,
157
+ __: [5]
158
158
  }, 8, ["class"])]),
159
159
  _: 1
160
160
  /* STABLE */
@@ -5,7 +5,7 @@ var stdin_default = getSimpleStyleHook("LayoutChangePassword", (token) => {
5
5
  return {
6
6
  [componentCls]: {
7
7
  [`${componentCls}-title`]: {
8
- marginBlockEnd: token.marginLG,
8
+ marginBlockEnd: token.marginXL,
9
9
  textAlign: "center",
10
10
  fontSize: token.fontSizeHeading2,
11
11
  lineHeight: token.lineHeightHeading2,
@@ -1,4 +1,4 @@
1
- import { defineComponent, computed, useTemplateRef, createElementBlock, openBlock, createVNode, unref, normalizeClass, withCtx, createBlock, nextTick } from 'vue';
1
+ import { defineComponent, computed, useTemplateRef, createElementBlock, openBlock, createVNode, unref, normalizeClass, withCtx, nextTick } from 'vue';
2
2
  import stdin_default$1, { useGlobalStyle } from './style/index.js';
3
3
  import { ElButton } from 'element-plus';
4
4
  import { useColorScheme } from '../../hooks/useColorScheme.js';
@@ -32,9 +32,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
32
32
  await nextTick();
33
33
  };
34
34
  const startViewTransition = el => {
35
- const isAppearanceTransition =
36
- // @ts-expect-error
37
- document.startViewTransition && !window.matchMedia("(prefers-reduced-motion: reduce)").matches;
35
+ const isAppearanceTransition = !!document.startViewTransition && !window.matchMedia("(prefers-reduced-motion: reduce)").matches;
38
36
  if (!isAppearanceTransition) {
39
37
  updateCallback();
40
38
  return;
@@ -67,17 +65,13 @@ var stdin_default = /* @__PURE__ */defineComponent({
67
65
  class: normalizeClass([unref(hashId), unref(prefixCls)]),
68
66
  onClick
69
67
  }, {
70
- default: withCtx(() => [isDark.value ? (openBlock(), createBlock(unref(_Icon), {
71
- key: 0,
72
- class: normalizeClass([`${unref(prefixCls)}-icon`, `${unref(prefixCls)}-icon-night`]),
73
- name: "mdi:weather-night",
68
+ default: withCtx(() => [createVNode(unref(_Icon), {
69
+ class: normalizeClass([`${unref(prefixCls)}-icon`, {
70
+ ["is-light"]: !isDark.value
71
+ }]),
72
+ name: `${isDark.value ? "co:moon" : "co:sun"}`,
74
73
  size: "xl"
75
- }, null, 8, ["class"])) : (openBlock(), createBlock(unref(_Icon), {
76
- key: 1,
77
- class: normalizeClass([`${unref(prefixCls)}-icon`, `${unref(prefixCls)}-icon-sunny`]),
78
- name: "mdi:white-balance-sunny",
79
- size: "xl"
80
- }, null, 8, ["class"]))]),
74
+ }, null, 8, ["class", "name"])]),
81
75
  _: 1
82
76
  /* STABLE */
83
77
  }, 8, ["class"])]);
@@ -1,6 +1,3 @@
1
- import { Keyframes } from '../../../components';
2
- export declare const sunnyIn: Keyframes;
3
- export declare const sunnyOut: Keyframes;
4
1
  export declare const useGlobalStyle: (theme?: import("vue").ComputedRef<import("../../../components").ThemeConfig | undefined>) => void;
5
2
  declare const _default: (_prefixCls?: import("vue").ComputedRef<string> | string, theme?: import("vue").ComputedRef<import("../../../components").ThemeConfig | undefined>) => {
6
3
  hashId: import("vue").Ref<string, string>;