@cloudcome/utils-vue 1.13.2 → 1.14.0

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 (46) hide show
  1. package/README.md +72 -73
  2. package/dist/async.cjs +65 -65
  3. package/dist/async.cjs.map +1 -1
  4. package/dist/async.mjs +66 -67
  5. package/dist/async.mjs.map +1 -1
  6. package/dist/component/self.d.ts +4 -4
  7. package/dist/component.cjs +110 -13
  8. package/dist/component.cjs.map +1 -1
  9. package/dist/component.d.ts +1 -1
  10. package/dist/component.mjs +108 -17
  11. package/dist/component.mjs.map +1 -1
  12. package/dist/event.cjs +39 -32
  13. package/dist/event.cjs.map +1 -1
  14. package/dist/event.mjs +39 -33
  15. package/dist/event.mjs.map +1 -1
  16. package/dist/index.cjs +8 -3
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.mjs +9 -5
  19. package/dist/index.mjs.map +1 -1
  20. package/dist/request.cjs +72 -74
  21. package/dist/request.cjs.map +1 -1
  22. package/dist/request.d.ts +1 -1
  23. package/dist/request.mjs +71 -74
  24. package/dist/request.mjs.map +1 -1
  25. package/dist/shared.cjs +87 -26
  26. package/dist/shared.cjs.map +1 -1
  27. package/dist/shared.d.ts +1 -1
  28. package/dist/shared.mjs +87 -28
  29. package/dist/shared.mjs.map +1 -1
  30. package/dist/state.cjs +26 -25
  31. package/dist/state.cjs.map +1 -1
  32. package/dist/state.mjs +27 -27
  33. package/dist/state.mjs.map +1 -1
  34. package/dist/time.cjs +45 -35
  35. package/dist/time.cjs.map +1 -1
  36. package/dist/time.mjs +45 -37
  37. package/dist/time.mjs.map +1 -1
  38. package/dist/types.cjs +0 -2
  39. package/dist/types.mjs +0 -2
  40. package/package.json +47 -48
  41. package/dist/life.cjs +0 -16
  42. package/dist/life.cjs.map +0 -1
  43. package/dist/life.mjs +0 -17
  44. package/dist/life.mjs.map +0 -1
  45. package/dist/types.cjs.map +0 -1
  46. package/dist/types.mjs.map +0 -1
@@ -1,20 +1,117 @@
1
- "use strict";
2
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const vue = require("vue");
4
- const life = require("./life.cjs");
5
- function useExpose(Comp) {
6
- return vue.ref(null);
2
+ const require_shared = require("./shared.cjs");
3
+ let vue = require("vue");
4
+ //#region src/component/life.ts
5
+ /**
6
+ * 页面挂载前生命周期钩子
7
+ *
8
+ * @param beforeMount - 在组件挂载前执行的回调函数,可以返回一个清理函数
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * useMount(() => {
13
+ * console.log('组件即将挂载');
14
+ * // 可以返回一个清理函数,在组件卸载前执行
15
+ * return () => {
16
+ * console.log('组件即将卸载');
17
+ * };
18
+ * });
19
+ * ```
20
+ */
21
+ function useMount(beforeMount) {
22
+ require_shared._runLifeHook(vue.onBeforeMount, vue.onBeforeUnmount, beforeMount);
7
23
  }
8
- function useEmit(Comp, event, listener) {
9
- return listener;
24
+ /**
25
+ * 页面挂载后生命周期钩子
26
+ *
27
+ * @param mounted - 在组件挂载后执行的回调函数,可以返回一个清理函数
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * useMounted(() => {
32
+ * console.log('组件已挂载');
33
+ * // 可以返回一个清理函数,在组件卸载前执行
34
+ * return () => {
35
+ * console.log('组件即将卸载');
36
+ * };
37
+ * });
38
+ * ```
39
+ */
40
+ function useMounted(mounted) {
41
+ require_shared._runLifeHook(vue.onMounted, vue.onUnmounted, mounted);
10
42
  }
11
- function useMethod(Comp, name, method) {
12
- return method;
43
+ /**
44
+ * 页面激活时生命周期钩子
45
+ *
46
+ * @param activated - 在组件被激活时执行的回调函数,可以返回一个清理函数
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * useActivated(() => {
51
+ * console.log('组件已激活');
52
+ * // 可以返回一个清理函数,在组件失活前执行
53
+ * return () => {
54
+ * console.log('组件即将失活');
55
+ * };
56
+ * });
57
+ * ```
58
+ */
59
+ function useActivated(activated) {
60
+ require_shared._runLifeHook(vue.onActivated, vue.onDeactivated, activated);
13
61
  }
14
- exports.useActivated = life.useActivated;
15
- exports.useMount = life.useMount;
16
- exports.useMounted = life.useMounted;
62
+ //#endregion
63
+ //#region src/component/self.ts
64
+ /**
65
+ * 创建一个响应式引用,用于暴露组件实例
66
+ * @template T 组件类型
67
+ * @param {T} Comp 组件定义
68
+ * @returns 返回一个可响应式访问的组件实例引用
69
+ * @example
70
+ * const compRef = useExpose(MyComponent)
71
+ */
72
+ function useExpose(_Comp) {
73
+ return (0, vue.ref)(null);
74
+ }
75
+ /**
76
+ * 创建一个组件emit事件监听器
77
+ * @template T 组件类型
78
+ * @template E 从组件props中提取的事件类型
79
+ * @template K 事件名
80
+ * @param {T} Comp 组件定义
81
+ * @param {K} event 事件名称
82
+ * @param {E[K]} listener 事件监听函数
83
+ * @returns {E[K]} 返回传入的事件监听函数
84
+ * @example
85
+ * const handleClick = useEmit(MyComponent, 'click', (payload) => {
86
+ * console.log('click event', payload)
87
+ * })
88
+ */
89
+ function useEmit(_Comp, _event, listener) {
90
+ return listener;
91
+ }
92
+ /**
93
+ * 从组件props中提取方法并返回指定方法
94
+ * @template T 组件类型
95
+ * @template M 从组件props中提取的方法类型
96
+ * @template K 方法名类型
97
+ * @param {T} Comp 组件定义
98
+ * @param {K} name 方法名称
99
+ * @param {M[K]} method 要返回的方法
100
+ * @returns {M[K]} 返回传入的方法
101
+ * @example
102
+ * const handleUpdate = useMethod(MyComponent, 'update', (value) => {
103
+ * console.log('update value', value)
104
+ * })
105
+ */
106
+ function useMethod(_Comp, _name, method) {
107
+ return method;
108
+ }
109
+ //#endregion
110
+ exports.useActivated = useActivated;
17
111
  exports.useEmit = useEmit;
18
112
  exports.useExpose = useExpose;
19
113
  exports.useMethod = useMethod;
20
- //# sourceMappingURL=component.cjs.map
114
+ exports.useMount = useMount;
115
+ exports.useMounted = useMounted;
116
+
117
+ //# sourceMappingURL=component.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.cjs","sources":["../src/component/self.ts"],"sourcesContent":["import { type Ref, ref } from 'vue';\nimport type { ComponentExposed, ComponentProps } from 'vue-component-type-helpers';\n\n/**\n * 创建一个响应式引用,用于暴露组件实例\n * @template T 组件类型\n * @param {T} Comp 组件定义\n * @returns 返回一个可响应式访问的组件实例引用\n * @example\n * const compRef = useExpose(MyComponent)\n */\nexport function useExpose<T>(Comp: T) {\n // 这里必须类型断言,否则构建会失败\n return ref<ComponentExposed<T> | null>(null) as Ref<ComponentExposed<T> | null>;\n}\n\n/**\n * 将字符串的首字母转换为小写\n * @template S 字符串类型\n * @typedef {S extends `${infer First}${infer Rest}` ? `${Lowercase<First>}${Rest}` : S} LowercaseFirst\n */\ntype LowercaseFirst<S extends string> = S extends `${infer First}${infer Rest}` ? `${Lowercase<First>}${Rest}` : S;\n\n/**\n * 从组件props中提取事件类型\n * @template T 组件props类型\n * @typedef {Object} PickEmits\n * @property {Object} [K in keyof T as K extends `on${infer Rest}`...] 转换后的emit事件名\n * - @property {Function} [...args: P] 事件回调函数\n */\ntype PickEmits<T> = {\n [K in keyof T as K extends `on${infer Rest}`\n ? // biome-ignore lint/suspicious/noExplicitAny: <explanation>\n T[K] extends (...args: any[]) => any\n ? LowercaseFirst<Rest>\n : never\n : // biome-ignore lint/suspicious/noExplicitAny: <explanation>\n never]: T[K] extends (...args: infer P) => any ? (...args: P) => unknown : never;\n};\n\n/**\n * 创建一个组件emit事件监听器\n * @template T 组件类型\n * @template E 从组件props中提取的事件类型\n * @template K 事件名\n * @param {T} Comp 组件定义\n * @param {K} event 事件名称\n * @param {E[K]} listener 事件监听函数\n * @returns {E[K]} 返回传入的事件监听函数\n * @example\n * const handleClick = useEmit(MyComponent, 'click', (payload) => {\n * console.log('click event', payload)\n * })\n */\nexport function useEmit<T, E extends PickEmits<Required<ComponentProps<T>>>, K extends keyof E>(\n Comp: T,\n event: K,\n listener: E[K],\n) {\n return listener;\n}\n\ntype PickMethods<T> = {\n // biome-ignore lint/suspicious/noExplicitAny: <explanation>\n [K in keyof T]: T[K] extends (...args: infer P) => any ? T[K] : never;\n};\n\n/**\n * 从组件props中提取方法并返回指定方法\n * @template T 组件类型\n * @template M 从组件props中提取的方法类型\n * @template K 方法名类型\n * @param {T} Comp 组件定义\n * @param {K} name 方法名称\n * @param {M[K]} method 要返回的方法\n * @returns {M[K]} 返回传入的方法\n * @example\n * const handleUpdate = useMethod(MyComponent, 'update', (value) => {\n * console.log('update value', value)\n * })\n */\nexport function useMethod<T, M extends PickMethods<Required<ComponentProps<T>>>, K extends keyof M>(\n Comp: T,\n name: K,\n method: M[K],\n) {\n return method;\n}\n"],"names":["ref"],"mappings":";;;;AAWO,SAAS,UAAa,MAAS;AAEpC,SAAOA,IAAAA,IAAgC,IAAI;AAC7C;AAwCgB,SAAA,QACd,MACA,OACA,UACA;AACO,SAAA;AACT;AAqBgB,SAAA,UACd,MACA,MACA,QACA;AACO,SAAA;AACT;;;;;;;"}
1
+ {"version":3,"file":"component.cjs","names":[],"sources":["../src/component/life.ts","../src/component/self.ts"],"sourcesContent":["import type { MaybePromise } from '@cloudcome/utils-core/types';\nimport { onActivated, onBeforeMount, onBeforeUnmount, onDeactivated, onMounted, onUnmounted } from 'vue';\nimport { _runLifeHook } from '@/shared';\n\nexport type HookListener = () => MaybePromise<unknown>;\nexport type HookListenerWithDispose = () => MaybePromise<undefined | HookListener>;\n\n/**\n * 页面挂载前生命周期钩子\n *\n * @param beforeMount - 在组件挂载前执行的回调函数,可以返回一个清理函数\n *\n * @example\n * ```ts\n * useMount(() => {\n * console.log('组件即将挂载');\n * // 可以返回一个清理函数,在组件卸载前执行\n * return () => {\n * console.log('组件即将卸载');\n * };\n * });\n * ```\n */\nexport function useMount(beforeMount: HookListenerWithDispose) {\n _runLifeHook(onBeforeMount, onBeforeUnmount, beforeMount);\n}\n\n/**\n * 页面挂载后生命周期钩子\n *\n * @param mounted - 在组件挂载后执行的回调函数,可以返回一个清理函数\n *\n * @example\n * ```ts\n * useMounted(() => {\n * console.log('组件已挂载');\n * // 可以返回一个清理函数,在组件卸载前执行\n * return () => {\n * console.log('组件即将卸载');\n * };\n * });\n * ```\n */\nexport function useMounted(mounted: HookListenerWithDispose) {\n _runLifeHook(onMounted, onUnmounted, mounted);\n}\n\n/**\n * 页面激活时生命周期钩子\n *\n * @param activated - 在组件被激活时执行的回调函数,可以返回一个清理函数\n *\n * @example\n * ```ts\n * useActivated(() => {\n * console.log('组件已激活');\n * // 可以返回一个清理函数,在组件失活前执行\n * return () => {\n * console.log('组件即将失活');\n * };\n * });\n * ```\n */\nexport function useActivated(activated: HookListenerWithDispose) {\n _runLifeHook(onActivated, onDeactivated, activated);\n}\n","import { type Ref, ref } from 'vue';\nimport type { ComponentExposed, ComponentProps } from 'vue-component-type-helpers';\n\n/**\n * 创建一个响应式引用,用于暴露组件实例\n * @template T 组件类型\n * @param {T} Comp 组件定义\n * @returns 返回一个可响应式访问的组件实例引用\n * @example\n * const compRef = useExpose(MyComponent)\n */\nexport function useExpose<T>(_Comp: T) {\n // 这里必须类型断言,否则构建会失败\n return ref<ComponentExposed<T> | null>(null) as Ref<ComponentExposed<T> | null>;\n}\n\n/**\n * 将字符串的首字母转换为小写\n * @template S 字符串类型\n * @typedef {S extends `${infer First}${infer Rest}` ? `${Lowercase<First>}${Rest}` : S} LowercaseFirst\n */\ntype LowercaseFirst<S extends string> = S extends `${infer First}${infer Rest}` ? `${Lowercase<First>}${Rest}` : S;\n\n/**\n * 从组件props中提取事件类型\n * @template T 组件props类型\n * @typedef {Object} PickEmits\n * @property {Object} [K in keyof T as K extends `on${infer Rest}`...] 转换后的emit事件名\n * - @property {Function} [...args: P] 事件回调函数\n */\ntype PickEmits<T> = {\n [K in keyof T as K extends `on${infer Rest}`\n ? // biome-ignore lint/suspicious/noExplicitAny: 必须使用 any\n T[K] extends (...args: any[]) => any\n ? LowercaseFirst<Rest>\n : never\n : // biome-ignore lint/suspicious/noExplicitAny: 必须使用 any\n never]: T[K] extends (...args: infer P) => any ? (...args: P) => unknown : never;\n};\n\n/**\n * 创建一个组件emit事件监听器\n * @template T 组件类型\n * @template E 从组件props中提取的事件类型\n * @template K 事件名\n * @param {T} Comp 组件定义\n * @param {K} event 事件名称\n * @param {E[K]} listener 事件监听函数\n * @returns {E[K]} 返回传入的事件监听函数\n * @example\n * const handleClick = useEmit(MyComponent, 'click', (payload) => {\n * console.log('click event', payload)\n * })\n */\nexport function useEmit<T, E extends PickEmits<Required<ComponentProps<T>>>, K extends keyof E>(\n _Comp: T,\n _event: K,\n listener: E[K],\n) {\n return listener;\n}\n\ntype PickMethods<T> = {\n // biome-ignore lint/suspicious/noExplicitAny: 必须使用 any\n [K in keyof T]: T[K] extends (...args: unknown[]) => any ? T[K] : never;\n};\n\n/**\n * 从组件props中提取方法并返回指定方法\n * @template T 组件类型\n * @template M 从组件props中提取的方法类型\n * @template K 方法名类型\n * @param {T} Comp 组件定义\n * @param {K} name 方法名称\n * @param {M[K]} method 要返回的方法\n * @returns {M[K]} 返回传入的方法\n * @example\n * const handleUpdate = useMethod(MyComponent, 'update', (value) => {\n * console.log('update value', value)\n * })\n */\nexport function useMethod<T, M extends PickMethods<Required<ComponentProps<T>>>, K extends keyof M>(\n _Comp: T,\n _name: K,\n method: M[K],\n) {\n return method;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAuBA,SAAgB,SAAS,aAAsC;CAC7D,eAAA,aAAa,IAAA,eAAe,IAAA,iBAAiB,YAAY;;;;;;;;;;;;;;;;;;AAmB3D,SAAgB,WAAW,SAAkC;CAC3D,eAAA,aAAa,IAAA,WAAW,IAAA,aAAa,QAAQ;;;;;;;;;;;;;;;;;;AAmB/C,SAAgB,aAAa,WAAoC;CAC/D,eAAA,aAAa,IAAA,aAAa,IAAA,eAAe,UAAU;;;;;;;;;;;;ACrDrD,SAAgB,UAAa,OAAU;CAErC,QAAA,GAAA,IAAA,KAAuC,KAAK;;;;;;;;;;;;;;;;AAyC9C,SAAgB,QACd,OACA,QACA,UACA;CACA,OAAO;;;;;;;;;;;;;;;;AAsBT,SAAgB,UACd,OACA,OACA,QACA;CACA,OAAO"}
@@ -1,2 +1,2 @@
1
- export * from './component/self';
2
1
  export * from './component/life';
2
+ export * from './component/self';
@@ -1,20 +1,111 @@
1
- import { ref } from "vue";
2
- import { b, u, a } from "./life.mjs";
3
- function useExpose(Comp) {
4
- return ref(null);
1
+ import { _runLifeHook } from "./shared.mjs";
2
+ import { onActivated, onBeforeMount, onBeforeUnmount, onDeactivated, onMounted, onUnmounted, ref } from "vue";
3
+ //#region src/component/life.ts
4
+ /**
5
+ * 页面挂载前生命周期钩子
6
+ *
7
+ * @param beforeMount - 在组件挂载前执行的回调函数,可以返回一个清理函数
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * useMount(() => {
12
+ * console.log('组件即将挂载');
13
+ * // 可以返回一个清理函数,在组件卸载前执行
14
+ * return () => {
15
+ * console.log('组件即将卸载');
16
+ * };
17
+ * });
18
+ * ```
19
+ */
20
+ function useMount(beforeMount) {
21
+ _runLifeHook(onBeforeMount, onBeforeUnmount, beforeMount);
5
22
  }
6
- function useEmit(Comp, event, listener) {
7
- return listener;
23
+ /**
24
+ * 页面挂载后生命周期钩子
25
+ *
26
+ * @param mounted - 在组件挂载后执行的回调函数,可以返回一个清理函数
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * useMounted(() => {
31
+ * console.log('组件已挂载');
32
+ * // 可以返回一个清理函数,在组件卸载前执行
33
+ * return () => {
34
+ * console.log('组件即将卸载');
35
+ * };
36
+ * });
37
+ * ```
38
+ */
39
+ function useMounted(mounted) {
40
+ _runLifeHook(onMounted, onUnmounted, mounted);
8
41
  }
9
- function useMethod(Comp, name, method) {
10
- return method;
42
+ /**
43
+ * 页面激活时生命周期钩子
44
+ *
45
+ * @param activated - 在组件被激活时执行的回调函数,可以返回一个清理函数
46
+ *
47
+ * @example
48
+ * ```ts
49
+ * useActivated(() => {
50
+ * console.log('组件已激活');
51
+ * // 可以返回一个清理函数,在组件失活前执行
52
+ * return () => {
53
+ * console.log('组件即将失活');
54
+ * };
55
+ * });
56
+ * ```
57
+ */
58
+ function useActivated(activated) {
59
+ _runLifeHook(onActivated, onDeactivated, activated);
11
60
  }
12
- export {
13
- b as useActivated,
14
- useEmit,
15
- useExpose,
16
- useMethod,
17
- u as useMount,
18
- a as useMounted
19
- };
20
- //# sourceMappingURL=component.mjs.map
61
+ //#endregion
62
+ //#region src/component/self.ts
63
+ /**
64
+ * 创建一个响应式引用,用于暴露组件实例
65
+ * @template T 组件类型
66
+ * @param {T} Comp 组件定义
67
+ * @returns 返回一个可响应式访问的组件实例引用
68
+ * @example
69
+ * const compRef = useExpose(MyComponent)
70
+ */
71
+ function useExpose(_Comp) {
72
+ return ref(null);
73
+ }
74
+ /**
75
+ * 创建一个组件emit事件监听器
76
+ * @template T 组件类型
77
+ * @template E 从组件props中提取的事件类型
78
+ * @template K 事件名
79
+ * @param {T} Comp 组件定义
80
+ * @param {K} event 事件名称
81
+ * @param {E[K]} listener 事件监听函数
82
+ * @returns {E[K]} 返回传入的事件监听函数
83
+ * @example
84
+ * const handleClick = useEmit(MyComponent, 'click', (payload) => {
85
+ * console.log('click event', payload)
86
+ * })
87
+ */
88
+ function useEmit(_Comp, _event, listener) {
89
+ return listener;
90
+ }
91
+ /**
92
+ * 从组件props中提取方法并返回指定方法
93
+ * @template T 组件类型
94
+ * @template M 从组件props中提取的方法类型
95
+ * @template K 方法名类型
96
+ * @param {T} Comp 组件定义
97
+ * @param {K} name 方法名称
98
+ * @param {M[K]} method 要返回的方法
99
+ * @returns {M[K]} 返回传入的方法
100
+ * @example
101
+ * const handleUpdate = useMethod(MyComponent, 'update', (value) => {
102
+ * console.log('update value', value)
103
+ * })
104
+ */
105
+ function useMethod(_Comp, _name, method) {
106
+ return method;
107
+ }
108
+ //#endregion
109
+ export { useActivated, useEmit, useExpose, useMethod, useMount, useMounted };
110
+
111
+ //# sourceMappingURL=component.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.mjs","sources":["../src/component/self.ts"],"sourcesContent":["import { type Ref, ref } from 'vue';\nimport type { ComponentExposed, ComponentProps } from 'vue-component-type-helpers';\n\n/**\n * 创建一个响应式引用,用于暴露组件实例\n * @template T 组件类型\n * @param {T} Comp 组件定义\n * @returns 返回一个可响应式访问的组件实例引用\n * @example\n * const compRef = useExpose(MyComponent)\n */\nexport function useExpose<T>(Comp: T) {\n // 这里必须类型断言,否则构建会失败\n return ref<ComponentExposed<T> | null>(null) as Ref<ComponentExposed<T> | null>;\n}\n\n/**\n * 将字符串的首字母转换为小写\n * @template S 字符串类型\n * @typedef {S extends `${infer First}${infer Rest}` ? `${Lowercase<First>}${Rest}` : S} LowercaseFirst\n */\ntype LowercaseFirst<S extends string> = S extends `${infer First}${infer Rest}` ? `${Lowercase<First>}${Rest}` : S;\n\n/**\n * 从组件props中提取事件类型\n * @template T 组件props类型\n * @typedef {Object} PickEmits\n * @property {Object} [K in keyof T as K extends `on${infer Rest}`...] 转换后的emit事件名\n * - @property {Function} [...args: P] 事件回调函数\n */\ntype PickEmits<T> = {\n [K in keyof T as K extends `on${infer Rest}`\n ? // biome-ignore lint/suspicious/noExplicitAny: <explanation>\n T[K] extends (...args: any[]) => any\n ? LowercaseFirst<Rest>\n : never\n : // biome-ignore lint/suspicious/noExplicitAny: <explanation>\n never]: T[K] extends (...args: infer P) => any ? (...args: P) => unknown : never;\n};\n\n/**\n * 创建一个组件emit事件监听器\n * @template T 组件类型\n * @template E 从组件props中提取的事件类型\n * @template K 事件名\n * @param {T} Comp 组件定义\n * @param {K} event 事件名称\n * @param {E[K]} listener 事件监听函数\n * @returns {E[K]} 返回传入的事件监听函数\n * @example\n * const handleClick = useEmit(MyComponent, 'click', (payload) => {\n * console.log('click event', payload)\n * })\n */\nexport function useEmit<T, E extends PickEmits<Required<ComponentProps<T>>>, K extends keyof E>(\n Comp: T,\n event: K,\n listener: E[K],\n) {\n return listener;\n}\n\ntype PickMethods<T> = {\n // biome-ignore lint/suspicious/noExplicitAny: <explanation>\n [K in keyof T]: T[K] extends (...args: infer P) => any ? T[K] : never;\n};\n\n/**\n * 从组件props中提取方法并返回指定方法\n * @template T 组件类型\n * @template M 从组件props中提取的方法类型\n * @template K 方法名类型\n * @param {T} Comp 组件定义\n * @param {K} name 方法名称\n * @param {M[K]} method 要返回的方法\n * @returns {M[K]} 返回传入的方法\n * @example\n * const handleUpdate = useMethod(MyComponent, 'update', (value) => {\n * console.log('update value', value)\n * })\n */\nexport function useMethod<T, M extends PickMethods<Required<ComponentProps<T>>>, K extends keyof M>(\n Comp: T,\n name: K,\n method: M[K],\n) {\n return method;\n}\n"],"names":[],"mappings":";;AAWO,SAAS,UAAa,MAAS;AAEpC,SAAO,IAAgC,IAAI;AAC7C;AAwCgB,SAAA,QACd,MACA,OACA,UACA;AACO,SAAA;AACT;AAqBgB,SAAA,UACd,MACA,MACA,QACA;AACO,SAAA;AACT;"}
1
+ {"version":3,"file":"component.mjs","names":[],"sources":["../src/component/life.ts","../src/component/self.ts"],"sourcesContent":["import type { MaybePromise } from '@cloudcome/utils-core/types';\nimport { onActivated, onBeforeMount, onBeforeUnmount, onDeactivated, onMounted, onUnmounted } from 'vue';\nimport { _runLifeHook } from '@/shared';\n\nexport type HookListener = () => MaybePromise<unknown>;\nexport type HookListenerWithDispose = () => MaybePromise<undefined | HookListener>;\n\n/**\n * 页面挂载前生命周期钩子\n *\n * @param beforeMount - 在组件挂载前执行的回调函数,可以返回一个清理函数\n *\n * @example\n * ```ts\n * useMount(() => {\n * console.log('组件即将挂载');\n * // 可以返回一个清理函数,在组件卸载前执行\n * return () => {\n * console.log('组件即将卸载');\n * };\n * });\n * ```\n */\nexport function useMount(beforeMount: HookListenerWithDispose) {\n _runLifeHook(onBeforeMount, onBeforeUnmount, beforeMount);\n}\n\n/**\n * 页面挂载后生命周期钩子\n *\n * @param mounted - 在组件挂载后执行的回调函数,可以返回一个清理函数\n *\n * @example\n * ```ts\n * useMounted(() => {\n * console.log('组件已挂载');\n * // 可以返回一个清理函数,在组件卸载前执行\n * return () => {\n * console.log('组件即将卸载');\n * };\n * });\n * ```\n */\nexport function useMounted(mounted: HookListenerWithDispose) {\n _runLifeHook(onMounted, onUnmounted, mounted);\n}\n\n/**\n * 页面激活时生命周期钩子\n *\n * @param activated - 在组件被激活时执行的回调函数,可以返回一个清理函数\n *\n * @example\n * ```ts\n * useActivated(() => {\n * console.log('组件已激活');\n * // 可以返回一个清理函数,在组件失活前执行\n * return () => {\n * console.log('组件即将失活');\n * };\n * });\n * ```\n */\nexport function useActivated(activated: HookListenerWithDispose) {\n _runLifeHook(onActivated, onDeactivated, activated);\n}\n","import { type Ref, ref } from 'vue';\nimport type { ComponentExposed, ComponentProps } from 'vue-component-type-helpers';\n\n/**\n * 创建一个响应式引用,用于暴露组件实例\n * @template T 组件类型\n * @param {T} Comp 组件定义\n * @returns 返回一个可响应式访问的组件实例引用\n * @example\n * const compRef = useExpose(MyComponent)\n */\nexport function useExpose<T>(_Comp: T) {\n // 这里必须类型断言,否则构建会失败\n return ref<ComponentExposed<T> | null>(null) as Ref<ComponentExposed<T> | null>;\n}\n\n/**\n * 将字符串的首字母转换为小写\n * @template S 字符串类型\n * @typedef {S extends `${infer First}${infer Rest}` ? `${Lowercase<First>}${Rest}` : S} LowercaseFirst\n */\ntype LowercaseFirst<S extends string> = S extends `${infer First}${infer Rest}` ? `${Lowercase<First>}${Rest}` : S;\n\n/**\n * 从组件props中提取事件类型\n * @template T 组件props类型\n * @typedef {Object} PickEmits\n * @property {Object} [K in keyof T as K extends `on${infer Rest}`...] 转换后的emit事件名\n * - @property {Function} [...args: P] 事件回调函数\n */\ntype PickEmits<T> = {\n [K in keyof T as K extends `on${infer Rest}`\n ? // biome-ignore lint/suspicious/noExplicitAny: 必须使用 any\n T[K] extends (...args: any[]) => any\n ? LowercaseFirst<Rest>\n : never\n : // biome-ignore lint/suspicious/noExplicitAny: 必须使用 any\n never]: T[K] extends (...args: infer P) => any ? (...args: P) => unknown : never;\n};\n\n/**\n * 创建一个组件emit事件监听器\n * @template T 组件类型\n * @template E 从组件props中提取的事件类型\n * @template K 事件名\n * @param {T} Comp 组件定义\n * @param {K} event 事件名称\n * @param {E[K]} listener 事件监听函数\n * @returns {E[K]} 返回传入的事件监听函数\n * @example\n * const handleClick = useEmit(MyComponent, 'click', (payload) => {\n * console.log('click event', payload)\n * })\n */\nexport function useEmit<T, E extends PickEmits<Required<ComponentProps<T>>>, K extends keyof E>(\n _Comp: T,\n _event: K,\n listener: E[K],\n) {\n return listener;\n}\n\ntype PickMethods<T> = {\n // biome-ignore lint/suspicious/noExplicitAny: 必须使用 any\n [K in keyof T]: T[K] extends (...args: unknown[]) => any ? T[K] : never;\n};\n\n/**\n * 从组件props中提取方法并返回指定方法\n * @template T 组件类型\n * @template M 从组件props中提取的方法类型\n * @template K 方法名类型\n * @param {T} Comp 组件定义\n * @param {K} name 方法名称\n * @param {M[K]} method 要返回的方法\n * @returns {M[K]} 返回传入的方法\n * @example\n * const handleUpdate = useMethod(MyComponent, 'update', (value) => {\n * console.log('update value', value)\n * })\n */\nexport function useMethod<T, M extends PickMethods<Required<ComponentProps<T>>>, K extends keyof M>(\n _Comp: T,\n _name: K,\n method: M[K],\n) {\n return method;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAuBA,SAAgB,SAAS,aAAsC;CAC7D,aAAa,eAAe,iBAAiB,YAAY;;;;;;;;;;;;;;;;;;AAmB3D,SAAgB,WAAW,SAAkC;CAC3D,aAAa,WAAW,aAAa,QAAQ;;;;;;;;;;;;;;;;;;AAmB/C,SAAgB,aAAa,WAAoC;CAC/D,aAAa,aAAa,eAAe,UAAU;;;;;;;;;;;;ACrDrD,SAAgB,UAAa,OAAU;CAErC,OAAO,IAAgC,KAAK;;;;;;;;;;;;;;;;AAyC9C,SAAgB,QACd,OACA,QACA,UACA;CACA,OAAO;;;;;;;;;;;;;;;;AAsBT,SAAgB,UACd,OACA,OACA,QACA;CACA,OAAO"}
package/dist/event.cjs CHANGED
@@ -1,36 +1,43 @@
1
- "use strict";
2
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const emitter = require("@cloudcome/utils-core/emitter");
4
- const vue = require("vue");
2
+ let vue = require("vue");
3
+ let _cloudcome_utils_core_emitter = require("@cloudcome/utils-core/emitter");
4
+ //#region src/event.ts
5
5
  function createEventHook(options = {}) {
6
- const emitter$1 = options.emitter || new emitter.Emitter();
7
- const on = (event, listener) => {
8
- emitter$1.on(event, listener);
9
- };
10
- const off = (event, listener) => {
11
- emitter$1.off(event, listener);
12
- };
13
- const emit = (event, ...payloads) => {
14
- emitter$1.emit(event, ...payloads);
15
- };
16
- const useEvent = (event, fn) => {
17
- if (options.stage === "mounted") {
18
- vue.onMounted(() => {
19
- on(event, fn);
20
- });
21
- vue.onUnmounted(() => {
22
- off(event, fn);
23
- });
24
- } else {
25
- vue.onBeforeMount(() => {
26
- on(event, fn);
27
- });
28
- vue.onBeforeUnmount(() => {
29
- off(event, fn);
30
- });
31
- }
32
- };
33
- return { on, off, emit, useEvent };
6
+ const emitter = options.emitter || new _cloudcome_utils_core_emitter.Emitter();
7
+ const on = (event, listener) => {
8
+ emitter.on(event, listener);
9
+ };
10
+ const off = (event, listener) => {
11
+ emitter.off(event, listener);
12
+ };
13
+ const emit = (event, ...payloads) => {
14
+ emitter.emit(event, ...payloads);
15
+ };
16
+ const useEvent = (event, fn) => {
17
+ if (options.stage === "mounted") {
18
+ (0, vue.onMounted)(() => {
19
+ on(event, fn);
20
+ });
21
+ (0, vue.onUnmounted)(() => {
22
+ off(event, fn);
23
+ });
24
+ } else {
25
+ (0, vue.onBeforeMount)(() => {
26
+ on(event, fn);
27
+ });
28
+ (0, vue.onBeforeUnmount)(() => {
29
+ off(event, fn);
30
+ });
31
+ }
32
+ };
33
+ return {
34
+ on,
35
+ off,
36
+ emit,
37
+ useEvent
38
+ };
34
39
  }
40
+ //#endregion
35
41
  exports.createEventHook = createEventHook;
36
- //# sourceMappingURL=event.cjs.map
42
+
43
+ //# sourceMappingURL=event.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"event.cjs","sources":["../src/event.ts"],"sourcesContent":["import { Emitter, type EmitterListener, type EmitterMap } from '@cloudcome/utils-core/emitter';\nimport { onBeforeMount, onBeforeUnmount, onMounted, onUnmounted } from 'vue';\n\nexport type EventEmitter = {\n on: (event: string, listener: (...payloads: unknown[]) => unknown) => unknown;\n off: (event: string, listener: (...payloads: unknown[]) => unknown) => unknown;\n emit: (event: string, ...payloads: unknown[]) => unknown;\n};\n\nexport type CreateEventCenterOptions = {\n emitter?: EventEmitter;\n stage?: 'mount' | 'mounted';\n};\n\nexport function createEventHook<E extends EmitterMap>(options: CreateEventCenterOptions = {}) {\n const emitter = options.emitter || new Emitter();\n\n const on = <K extends keyof E>(event: K, listener: EmitterListener<E, K>) => {\n // @ts-ignore\n emitter.on(event as string, listener);\n };\n\n const off = <K extends keyof E>(event: K, listener: EmitterListener<E, K>) => {\n // @ts-ignore\n emitter.off(event as string, listener);\n };\n\n const emit = <K extends keyof E>(event: K, ...payloads: E[K]) => {\n emitter.emit(event as string, ...payloads);\n };\n\n const useEvent = <K extends keyof E>(event: K, fn: (...payloads: E[K]) => unknown) => {\n if (options.stage === 'mounted') {\n onMounted(() => {\n on(event, fn);\n });\n onUnmounted(() => {\n off(event, fn);\n });\n } else {\n onBeforeMount(() => {\n on(event, fn);\n });\n onBeforeUnmount(() => {\n off(event, fn);\n });\n }\n };\n\n return { on, off, emit, useEvent };\n}\n"],"names":["emitter","Emitter","onMounted","onUnmounted","onBeforeMount","onBeforeUnmount"],"mappings":";;;;AAcgB,SAAA,gBAAsC,UAAoC,IAAI;AAC5F,QAAMA,YAAU,QAAQ,WAAW,IAAIC,QAAAA,QAAQ;AAEzC,QAAA,KAAK,CAAoB,OAAU,aAAoC;AAEnED,cAAA,GAAG,OAAiB,QAAQ;AAAA,EACtC;AAEM,QAAA,MAAM,CAAoB,OAAU,aAAoC;AAEpEA,cAAA,IAAI,OAAiB,QAAQ;AAAA,EACvC;AAEM,QAAA,OAAO,CAAoB,UAAa,aAAmB;AACvDA,cAAA,KAAK,OAAiB,GAAG,QAAQ;AAAA,EAC3C;AAEM,QAAA,WAAW,CAAoB,OAAU,OAAuC;AAChF,QAAA,QAAQ,UAAU,WAAW;AAC/BE,UAAAA,UAAU,MAAM;AACd,WAAG,OAAO,EAAE;AAAA,MAAA,CACb;AACDC,UAAAA,YAAY,MAAM;AAChB,YAAI,OAAO,EAAE;AAAA,MAAA,CACd;AAAA,IAAA,OACI;AACLC,UAAAA,cAAc,MAAM;AAClB,WAAG,OAAO,EAAE;AAAA,MAAA,CACb;AACDC,UAAAA,gBAAgB,MAAM;AACpB,YAAI,OAAO,EAAE;AAAA,MAAA,CACd;AAAA,IAAA;AAAA,EAEL;AAEA,SAAO,EAAE,IAAI,KAAK,MAAM,SAAS;AACnC;;"}
1
+ {"version":3,"file":"event.cjs","names":[],"sources":["../src/event.ts"],"sourcesContent":["import { Emitter, type EmitterListener, type EmitterMap } from '@cloudcome/utils-core/emitter';\nimport { onBeforeMount, onBeforeUnmount, onMounted, onUnmounted } from 'vue';\n\nexport type EventEmitter = {\n on: (event: string, listener: (...payloads: unknown[]) => unknown) => unknown;\n off: (event: string, listener: (...payloads: unknown[]) => unknown) => unknown;\n emit: (event: string, ...payloads: unknown[]) => unknown;\n};\n\nexport type CreateEventCenterOptions = {\n emitter?: EventEmitter;\n stage?: 'mount' | 'mounted';\n};\n\nexport function createEventHook<E extends EmitterMap>(options: CreateEventCenterOptions = {}) {\n const emitter = options.emitter || new Emitter();\n\n const on = <K extends keyof E>(event: K, listener: EmitterListener<E, K>) => {\n // @ts-expect-error\n emitter.on(event as string, listener);\n };\n\n const off = <K extends keyof E>(event: K, listener: EmitterListener<E, K>) => {\n // @ts-expect-error\n emitter.off(event as string, listener);\n };\n\n const emit = <K extends keyof E>(event: K, ...payloads: E[K]) => {\n emitter.emit(event as string, ...payloads);\n };\n\n const useEvent = <K extends keyof E>(event: K, fn: (...payloads: E[K]) => unknown) => {\n if (options.stage === 'mounted') {\n onMounted(() => {\n on(event, fn);\n });\n onUnmounted(() => {\n off(event, fn);\n });\n } else {\n onBeforeMount(() => {\n on(event, fn);\n });\n onBeforeUnmount(() => {\n off(event, fn);\n });\n }\n };\n\n return { on, off, emit, useEvent };\n}\n"],"mappings":";;;;AAcA,SAAgB,gBAAsC,UAAoC,EAAE,EAAE;CAC5F,MAAM,UAAU,QAAQ,WAAW,IAAI,8BAAA,SAAS;CAEhD,MAAM,MAAyB,OAAU,aAAoC;EAE3E,QAAQ,GAAG,OAAiB,SAAS;;CAGvC,MAAM,OAA0B,OAAU,aAAoC;EAE5E,QAAQ,IAAI,OAAiB,SAAS;;CAGxC,MAAM,QAA2B,OAAU,GAAG,aAAmB;EAC/D,QAAQ,KAAK,OAAiB,GAAG,SAAS;;CAG5C,MAAM,YAA+B,OAAU,OAAuC;EACpF,IAAI,QAAQ,UAAU,WAAW;GAC/B,CAAA,GAAA,IAAA,iBAAgB;IACd,GAAG,OAAO,GAAG;KACb;GACF,CAAA,GAAA,IAAA,mBAAkB;IAChB,IAAI,OAAO,GAAG;KACd;SACG;GACL,CAAA,GAAA,IAAA,qBAAoB;IAClB,GAAG,OAAO,GAAG;KACb;GACF,CAAA,GAAA,IAAA,uBAAsB;IACpB,IAAI,OAAO,GAAG;KACd;;;CAIN,OAAO;EAAE;EAAI;EAAK;EAAM;EAAU"}
package/dist/event.mjs CHANGED
@@ -1,36 +1,42 @@
1
+ import { onBeforeMount, onBeforeUnmount, onMounted, onUnmounted } from "vue";
1
2
  import { Emitter } from "@cloudcome/utils-core/emitter";
2
- import { onMounted, onUnmounted, onBeforeMount, onBeforeUnmount } from "vue";
3
+ //#region src/event.ts
3
4
  function createEventHook(options = {}) {
4
- const emitter = options.emitter || new Emitter();
5
- const on = (event, listener) => {
6
- emitter.on(event, listener);
7
- };
8
- const off = (event, listener) => {
9
- emitter.off(event, listener);
10
- };
11
- const emit = (event, ...payloads) => {
12
- emitter.emit(event, ...payloads);
13
- };
14
- const useEvent = (event, fn) => {
15
- if (options.stage === "mounted") {
16
- onMounted(() => {
17
- on(event, fn);
18
- });
19
- onUnmounted(() => {
20
- off(event, fn);
21
- });
22
- } else {
23
- onBeforeMount(() => {
24
- on(event, fn);
25
- });
26
- onBeforeUnmount(() => {
27
- off(event, fn);
28
- });
29
- }
30
- };
31
- return { on, off, emit, useEvent };
5
+ const emitter = options.emitter || new Emitter();
6
+ const on = (event, listener) => {
7
+ emitter.on(event, listener);
8
+ };
9
+ const off = (event, listener) => {
10
+ emitter.off(event, listener);
11
+ };
12
+ const emit = (event, ...payloads) => {
13
+ emitter.emit(event, ...payloads);
14
+ };
15
+ const useEvent = (event, fn) => {
16
+ if (options.stage === "mounted") {
17
+ onMounted(() => {
18
+ on(event, fn);
19
+ });
20
+ onUnmounted(() => {
21
+ off(event, fn);
22
+ });
23
+ } else {
24
+ onBeforeMount(() => {
25
+ on(event, fn);
26
+ });
27
+ onBeforeUnmount(() => {
28
+ off(event, fn);
29
+ });
30
+ }
31
+ };
32
+ return {
33
+ on,
34
+ off,
35
+ emit,
36
+ useEvent
37
+ };
32
38
  }
33
- export {
34
- createEventHook
35
- };
36
- //# sourceMappingURL=event.mjs.map
39
+ //#endregion
40
+ export { createEventHook };
41
+
42
+ //# sourceMappingURL=event.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"event.mjs","sources":["../src/event.ts"],"sourcesContent":["import { Emitter, type EmitterListener, type EmitterMap } from '@cloudcome/utils-core/emitter';\nimport { onBeforeMount, onBeforeUnmount, onMounted, onUnmounted } from 'vue';\n\nexport type EventEmitter = {\n on: (event: string, listener: (...payloads: unknown[]) => unknown) => unknown;\n off: (event: string, listener: (...payloads: unknown[]) => unknown) => unknown;\n emit: (event: string, ...payloads: unknown[]) => unknown;\n};\n\nexport type CreateEventCenterOptions = {\n emitter?: EventEmitter;\n stage?: 'mount' | 'mounted';\n};\n\nexport function createEventHook<E extends EmitterMap>(options: CreateEventCenterOptions = {}) {\n const emitter = options.emitter || new Emitter();\n\n const on = <K extends keyof E>(event: K, listener: EmitterListener<E, K>) => {\n // @ts-ignore\n emitter.on(event as string, listener);\n };\n\n const off = <K extends keyof E>(event: K, listener: EmitterListener<E, K>) => {\n // @ts-ignore\n emitter.off(event as string, listener);\n };\n\n const emit = <K extends keyof E>(event: K, ...payloads: E[K]) => {\n emitter.emit(event as string, ...payloads);\n };\n\n const useEvent = <K extends keyof E>(event: K, fn: (...payloads: E[K]) => unknown) => {\n if (options.stage === 'mounted') {\n onMounted(() => {\n on(event, fn);\n });\n onUnmounted(() => {\n off(event, fn);\n });\n } else {\n onBeforeMount(() => {\n on(event, fn);\n });\n onBeforeUnmount(() => {\n off(event, fn);\n });\n }\n };\n\n return { on, off, emit, useEvent };\n}\n"],"names":[],"mappings":";;AAcgB,SAAA,gBAAsC,UAAoC,IAAI;AAC5F,QAAM,UAAU,QAAQ,WAAW,IAAI,QAAQ;AAEzC,QAAA,KAAK,CAAoB,OAAU,aAAoC;AAEnE,YAAA,GAAG,OAAiB,QAAQ;AAAA,EACtC;AAEM,QAAA,MAAM,CAAoB,OAAU,aAAoC;AAEpE,YAAA,IAAI,OAAiB,QAAQ;AAAA,EACvC;AAEM,QAAA,OAAO,CAAoB,UAAa,aAAmB;AACvD,YAAA,KAAK,OAAiB,GAAG,QAAQ;AAAA,EAC3C;AAEM,QAAA,WAAW,CAAoB,OAAU,OAAuC;AAChF,QAAA,QAAQ,UAAU,WAAW;AAC/B,gBAAU,MAAM;AACd,WAAG,OAAO,EAAE;AAAA,MAAA,CACb;AACD,kBAAY,MAAM;AAChB,YAAI,OAAO,EAAE;AAAA,MAAA,CACd;AAAA,IAAA,OACI;AACL,oBAAc,MAAM;AAClB,WAAG,OAAO,EAAE;AAAA,MAAA,CACb;AACD,sBAAgB,MAAM;AACpB,YAAI,OAAO,EAAE;AAAA,MAAA,CACd;AAAA,IAAA;AAAA,EAEL;AAEA,SAAO,EAAE,IAAI,KAAK,MAAM,SAAS;AACnC;"}
1
+ {"version":3,"file":"event.mjs","names":[],"sources":["../src/event.ts"],"sourcesContent":["import { Emitter, type EmitterListener, type EmitterMap } from '@cloudcome/utils-core/emitter';\nimport { onBeforeMount, onBeforeUnmount, onMounted, onUnmounted } from 'vue';\n\nexport type EventEmitter = {\n on: (event: string, listener: (...payloads: unknown[]) => unknown) => unknown;\n off: (event: string, listener: (...payloads: unknown[]) => unknown) => unknown;\n emit: (event: string, ...payloads: unknown[]) => unknown;\n};\n\nexport type CreateEventCenterOptions = {\n emitter?: EventEmitter;\n stage?: 'mount' | 'mounted';\n};\n\nexport function createEventHook<E extends EmitterMap>(options: CreateEventCenterOptions = {}) {\n const emitter = options.emitter || new Emitter();\n\n const on = <K extends keyof E>(event: K, listener: EmitterListener<E, K>) => {\n // @ts-expect-error\n emitter.on(event as string, listener);\n };\n\n const off = <K extends keyof E>(event: K, listener: EmitterListener<E, K>) => {\n // @ts-expect-error\n emitter.off(event as string, listener);\n };\n\n const emit = <K extends keyof E>(event: K, ...payloads: E[K]) => {\n emitter.emit(event as string, ...payloads);\n };\n\n const useEvent = <K extends keyof E>(event: K, fn: (...payloads: E[K]) => unknown) => {\n if (options.stage === 'mounted') {\n onMounted(() => {\n on(event, fn);\n });\n onUnmounted(() => {\n off(event, fn);\n });\n } else {\n onBeforeMount(() => {\n on(event, fn);\n });\n onBeforeUnmount(() => {\n off(event, fn);\n });\n }\n };\n\n return { on, off, emit, useEvent };\n}\n"],"mappings":";;;AAcA,SAAgB,gBAAsC,UAAoC,EAAE,EAAE;CAC5F,MAAM,UAAU,QAAQ,WAAW,IAAI,SAAS;CAEhD,MAAM,MAAyB,OAAU,aAAoC;EAE3E,QAAQ,GAAG,OAAiB,SAAS;;CAGvC,MAAM,OAA0B,OAAU,aAAoC;EAE5E,QAAQ,IAAI,OAAiB,SAAS;;CAGxC,MAAM,QAA2B,OAAU,GAAG,aAAmB;EAC/D,QAAQ,KAAK,OAAiB,GAAG,SAAS;;CAG5C,MAAM,YAA+B,OAAU,OAAuC;EACpF,IAAI,QAAQ,UAAU,WAAW;GAC/B,gBAAgB;IACd,GAAG,OAAO,GAAG;KACb;GACF,kBAAkB;IAChB,IAAI,OAAO,GAAG;KACd;SACG;GACL,oBAAoB;IAClB,GAAG,OAAO,GAAG;KACb;GACF,sBAAsB;IACpB,IAAI,OAAO,GAAG;KACd;;;CAIN,OAAO;EAAE;EAAI;EAAK;EAAM;EAAU"}
package/dist/index.cjs CHANGED
@@ -1,5 +1,10 @@
1
- "use strict";
2
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const VERSION = "1.13.1";
2
+ //#region src/index.ts
3
+ /**
4
+ * `@cloudcome/utils-vue` 版本号
5
+ */
6
+ var VERSION = "1.14.0";
7
+ //#endregion
4
8
  exports.VERSION = VERSION;
5
- //# sourceMappingURL=index.cjs.map
9
+
10
+ //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/index.ts"],"sourcesContent":["/**\n * `@cloudcome/utils-vue` 版本号\n */\nexport const VERSION = PKG_VERSION;\n"],"names":[],"mappings":";;AAGO,MAAM,UAAU;;"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/**\n * `@cloudcome/utils-vue` 版本号\n */\nexport const VERSION = PKG_VERSION;\n"],"mappings":";;;;;AAGA,IAAa,UAAA"}
package/dist/index.mjs CHANGED
@@ -1,5 +1,9 @@
1
- const VERSION = "1.13.1";
2
- export {
3
- VERSION
4
- };
5
- //# sourceMappingURL=index.mjs.map
1
+ //#region src/index.ts
2
+ /**
3
+ * `@cloudcome/utils-vue` 版本号
4
+ */
5
+ var VERSION = "1.14.0";
6
+ //#endregion
7
+ export { VERSION };
8
+
9
+ //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../src/index.ts"],"sourcesContent":["/**\n * `@cloudcome/utils-vue` 版本号\n */\nexport const VERSION = PKG_VERSION;\n"],"names":[],"mappings":"AAGO,MAAM,UAAU;"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/**\n * `@cloudcome/utils-vue` 版本号\n */\nexport const VERSION = PKG_VERSION;\n"],"mappings":";;;;AAGA,IAAa,UAAA"}