@vxe-ui/core 4.4.11 → 4.4.13

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 (64) hide show
  1. package/LICENSE +21 -21
  2. package/README.en.md +43 -43
  3. package/README.md +43 -43
  4. package/README.zh-TW.md +43 -43
  5. package/dist/all.esm.js +920 -0
  6. package/es/src/core.js +1 -1
  7. package/es/src/log.js +1 -1
  8. package/lib/index.umd.js +173 -73
  9. package/lib/index.umd.min.js +1 -1
  10. package/lib/src/core.js +1 -1
  11. package/lib/src/core.min.js +1 -1
  12. package/lib/src/log.js +1 -1
  13. package/lib/src/log.min.js +1 -1
  14. package/package.json +82 -79
  15. package/packages/index.ts +149 -149
  16. package/packages/src/clipboard.ts +56 -56
  17. package/packages/src/commands.ts +56 -56
  18. package/packages/src/config.ts +30 -30
  19. package/packages/src/configStore.ts +8 -8
  20. package/packages/src/core.ts +11 -11
  21. package/packages/src/dataStore.ts +4 -4
  22. package/packages/src/event.ts +160 -160
  23. package/packages/src/formats.ts +56 -56
  24. package/packages/src/hooks.ts +5 -5
  25. package/packages/src/i18n.ts +63 -63
  26. package/packages/src/i18nStore.ts +11 -11
  27. package/packages/src/icon.ts +32 -32
  28. package/packages/src/iconStore.ts +3 -3
  29. package/packages/src/interceptor.ts +64 -64
  30. package/packages/src/log.ts +19 -19
  31. package/packages/src/menus.ts +56 -56
  32. package/packages/src/permission.ts +61 -61
  33. package/packages/src/renderer.ts +48 -48
  34. package/packages/src/resize.ts +89 -89
  35. package/packages/src/store.ts +47 -47
  36. package/packages/src/theme.ts +20 -20
  37. package/packages/src/themeStore.ts +7 -7
  38. package/packages/src/useFns.ts +34 -34
  39. package/packages/src/validators.ts +7 -7
  40. package/packages/src/vm.ts +10 -10
  41. package/types/core/clipboard.d.ts +22 -22
  42. package/types/core/commands.d.ts +19 -19
  43. package/types/core/components.d.ts +5 -5
  44. package/types/core/formats.d.ts +19 -19
  45. package/types/core/global-config.d.ts +70 -70
  46. package/types/core/global-data.d.ts +7 -7
  47. package/types/core/global-event.d.ts +47 -47
  48. package/types/core/global-icon.d.ts +10 -10
  49. package/types/core/global-lang.d.ts +27 -27
  50. package/types/core/global-resize.d.ts +3 -3
  51. package/types/core/global-theme.d.ts +1 -1
  52. package/types/core/hooks.d.ts +14 -14
  53. package/types/core/index.d.ts +294 -294
  54. package/types/core/interceptor.d.ts +22 -22
  55. package/types/core/log.d.ts +8 -8
  56. package/types/core/menus.d.ts +19 -19
  57. package/types/core/permission.d.ts +10 -10
  58. package/types/core/renderer.d.ts +14 -14
  59. package/types/core/useFn.d.ts +27 -27
  60. package/types/core/validators.d.ts +19 -19
  61. package/types/index.d.ts +13 -13
  62. package/types/tool/common.d.ts +150 -150
  63. package/types/tool/index.d.ts +2 -2
  64. package/types/tool/util.d.ts +4 -4
@@ -1,19 +1,19 @@
1
- /* eslint-disable no-use-before-define */
2
-
3
- export namespace VxeGlobalMenusHandles {
4
- export interface MenusOption {}
5
- }
6
-
7
- /**
8
- * 全局快捷菜单
9
- */
10
- export interface VxeGlobalMenus {
11
- mixin(opts: {
12
- [code: string]: VxeGlobalMenusHandles.MenusOption | ((params: any, event: Event) => any)
13
- }): VxeGlobalMenus
14
- has(code: string | null | undefined): boolean
15
- get(code: string | null | undefined): VxeGlobalMenusHandles.MenusOption
16
- add(code: string, options: VxeGlobalMenusHandles.MenusOption | ((params: any, event: Event) => any)): VxeGlobalMenus
17
- delete(code: string | null | undefined): void
18
- forEach(callback: (options: VxeGlobalMenusHandles.MenusOption, code: string) => void): void
19
- }
1
+ /* eslint-disable no-use-before-define */
2
+
3
+ export namespace VxeGlobalMenusHandles {
4
+ export interface MenusOption {}
5
+ }
6
+
7
+ /**
8
+ * 全局快捷菜单
9
+ */
10
+ export interface VxeGlobalMenus {
11
+ mixin(opts: {
12
+ [code: string]: VxeGlobalMenusHandles.MenusOption | ((params: any, event: Event) => any)
13
+ }): VxeGlobalMenus
14
+ has(code: string | null | undefined): boolean
15
+ get(code: string | null | undefined): VxeGlobalMenusHandles.MenusOption
16
+ add(code: string, options: VxeGlobalMenusHandles.MenusOption | ((params: any, event: Event) => any)): VxeGlobalMenus
17
+ delete(code: string | null | undefined): void
18
+ forEach(callback: (options: VxeGlobalMenusHandles.MenusOption, code: string) => void): void
19
+ }
@@ -1,10 +1,10 @@
1
- import { VxeComponentPermissionCodeType, VxeComponentPermissionInfo } from '../tool'
2
-
3
- /**
4
- * 全局权限控制
5
- */
6
- export interface VxeGlobalPermission {
7
- getCheckInfo (code: VxeComponentPermissionCodeType): VxeComponentPermissionInfo
8
- checkVisible (code: VxeComponentPermissionCodeType): boolean
9
- checkDisable (code: VxeComponentPermissionCodeType): boolean
10
- }
1
+ import { VxeComponentPermissionCodeType, VxeComponentPermissionInfo } from '../tool'
2
+
3
+ /**
4
+ * 全局权限控制
5
+ */
6
+ export interface VxeGlobalPermission {
7
+ getCheckInfo (code: VxeComponentPermissionCodeType): VxeComponentPermissionInfo
8
+ checkVisible (code: VxeComponentPermissionCodeType): boolean
9
+ checkDisable (code: VxeComponentPermissionCodeType): boolean
10
+ }
@@ -1,14 +1,14 @@
1
- export interface VxeGlobalRendererOptions {}
2
-
3
- export namespace VxeGlobalRendererHandles {}
4
-
5
- /**
6
- * 渲染器
7
- */
8
- export interface VxeGlobalRenderer {
9
- mixin(options: Record<string, VxeGlobalRendererOptions>): VxeGlobalRenderer
10
- get(name: string | null | undefined): VxeGlobalRendererOptions
11
- add(name: string, options: VxeGlobalRendererOptions): VxeGlobalRenderer
12
- forEach(callback: (item: VxeGlobalRendererOptions, name: string, renderMap: Record<string, VxeGlobalRendererOptions>) => void): VxeGlobalRenderer
13
- delete(name: string | null | undefined): void
14
- }
1
+ export interface VxeGlobalRendererOptions {}
2
+
3
+ export namespace VxeGlobalRendererHandles {}
4
+
5
+ /**
6
+ * 渲染器
7
+ */
8
+ export interface VxeGlobalRenderer {
9
+ mixin(options: Record<string, VxeGlobalRendererOptions>): VxeGlobalRenderer
10
+ get(name: string | null | undefined): VxeGlobalRendererOptions
11
+ add(name: string, options: VxeGlobalRendererOptions): VxeGlobalRenderer
12
+ forEach(callback: (item: VxeGlobalRendererOptions, name: string, renderMap: Record<string, VxeGlobalRendererOptions>) => void): VxeGlobalRenderer
13
+ delete(name: string | null | undefined): void
14
+ }
@@ -1,27 +1,27 @@
1
- import { ComputedRef } from 'vue'
2
- import { VxeComponentSizeType, VxeComponentPermissionCodeType, VxeComponentPermissionMethod, VxeComponentPermissionInfo } from '../tool'
3
-
4
- export type VxeUseFnUseSize = (props: {
5
- size?: VxeComponentSizeType;
6
- }) => {
7
- computeSize: ComputedRef<VxeComponentSizeType>;
8
- }
9
-
10
- export const useSize: VxeUseFnUseSize
11
-
12
- export type VxeUsePermission = (props: {
13
- permissionCode?: VxeComponentPermissionCodeType
14
- permissionMethod?: VxeComponentPermissionMethod
15
- }) => {
16
- computePermissionInfo: ComputedRef<VxeComponentPermissionInfo>;
17
- }
18
-
19
- export const usePermission: VxeUsePermission
20
-
21
- /**
22
- * 通用方法
23
- */
24
- export interface VxeGlobalUseFns {
25
- useSize: VxeUseFnUseSize
26
- usePermission: VxeUsePermission
27
- }
1
+ import { ComputedRef } from 'vue'
2
+ import { VxeComponentSizeType, VxeComponentPermissionCodeType, VxeComponentPermissionMethod, VxeComponentPermissionInfo } from '../tool'
3
+
4
+ export type VxeUseFnUseSize = (props: {
5
+ size?: VxeComponentSizeType;
6
+ }) => {
7
+ computeSize: ComputedRef<VxeComponentSizeType>;
8
+ }
9
+
10
+ export const useSize: VxeUseFnUseSize
11
+
12
+ export type VxeUsePermission = (props: {
13
+ permissionCode?: VxeComponentPermissionCodeType
14
+ permissionMethod?: VxeComponentPermissionMethod
15
+ }) => {
16
+ computePermissionInfo: ComputedRef<VxeComponentPermissionInfo>;
17
+ }
18
+
19
+ export const usePermission: VxeUsePermission
20
+
21
+ /**
22
+ * 通用方法
23
+ */
24
+ export interface VxeGlobalUseFns {
25
+ useSize: VxeUseFnUseSize
26
+ usePermission: VxeUsePermission
27
+ }
@@ -1,19 +1,19 @@
1
- /* eslint-disable no-use-before-define */
2
-
3
- export namespace VxeGlobalValidatorsHandles {
4
- export interface ValidatorsOptions {}
5
- }
6
-
7
- /**
8
- * 全局快捷菜单
9
- */
10
- export interface VxeGlobalValidators {
11
- mixin(options: {
12
- [code: string]: VxeGlobalValidatorsHandles.ValidatorsOptions
13
- }): VxeGlobalValidators
14
- has(code: string): boolean
15
- get(code: string): VxeGlobalValidatorsHandles.ValidatorsOptions
16
- add(code: string, callback: VxeGlobalValidatorsHandles.ValidatorsOptions): VxeGlobalValidators
17
- delete(code: string): void
18
- forEach(callback: (options: VxeGlobalValidatorsHandles.ValidatorsOptions, code: string) => void): void
19
- }
1
+ /* eslint-disable no-use-before-define */
2
+
3
+ export namespace VxeGlobalValidatorsHandles {
4
+ export interface ValidatorsOptions {}
5
+ }
6
+
7
+ /**
8
+ * 全局快捷菜单
9
+ */
10
+ export interface VxeGlobalValidators {
11
+ mixin(options: {
12
+ [code: string]: VxeGlobalValidatorsHandles.ValidatorsOptions
13
+ }): VxeGlobalValidators
14
+ has(code: string): boolean
15
+ get(code: string): VxeGlobalValidatorsHandles.ValidatorsOptions
16
+ add(code: string, callback: VxeGlobalValidatorsHandles.ValidatorsOptions): VxeGlobalValidators
17
+ delete(code: string): void
18
+ forEach(callback: (options: VxeGlobalValidatorsHandles.ValidatorsOptions, code: string) => void): void
19
+ }
package/types/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
- import { VxeUIExport } from './core'
2
-
3
- declare global {
4
- interface Window {
5
- /**
6
- * Vxe UI core library
7
- */
8
- VxeUI: VxeUIExport;
9
- }
10
- }
11
-
12
- export * from './tool'
13
- export * from './core'
1
+ import { VxeUIExport } from './core'
2
+
3
+ declare global {
4
+ interface Window {
5
+ /**
6
+ * Vxe UI core library
7
+ */
8
+ VxeUI: VxeUIExport;
9
+ }
10
+ }
11
+
12
+ export * from './tool'
13
+ export * from './core'
@@ -1,150 +1,150 @@
1
- import { App, VNode, ComponentPublicInstance, DefineComponent, Prop } from 'vue'
2
-
3
- /* eslint-disable no-use-before-define,@typescript-eslint/ban-types */
4
-
5
- type SafeProp<T> = {
6
- [K in keyof T]: T[K] extends string ? T[K] : Prop<T[K]>
7
- }
8
-
9
- /**
10
- * 组件类型
11
- */
12
- export type DefineVxeComponentApp<
13
- P = { [key: string]: any },
14
- E = { [key: string]: any },
15
- S = { [key: string]: (...args: any[]) => any },
16
- M = { [key: string]: any }
17
- > = ({
18
- new (): M & {
19
- $props: P & E,
20
- $slots: S
21
- }
22
- } & {
23
- props: SafeProp<Required<P>>
24
- install(app: App): void
25
- })
26
-
27
- /**
28
- * 全局组件
29
- */
30
- export type DefineVxeGlobalComponent<
31
- P = { [key: string]: any },
32
- E = { [key: string]: any },
33
- S = { [key: string]: (...args: any[]) => any },
34
- > = ({
35
- new (): {
36
- $props: P & E,
37
- $slots: S
38
- }
39
- } & {
40
- install(app: App): void
41
- })
42
-
43
- /**
44
- * 组件配置
45
- */
46
- export type DefineVxeComponentOptions<P, E> = DefineComponent<P & E>
47
-
48
- /**
49
- * 组件实例
50
- */
51
- export type DefineVxeComponentInstance<P, M> = ComponentPublicInstance<P, M>
52
-
53
- /**
54
- * 组件通用的基础参数
55
- */
56
- export interface VxeComponentBaseOptions {
57
- xID: string
58
- }
59
-
60
- /**
61
- * 组件事件参数
62
- */
63
- export interface VxeComponentEventParams {
64
- $event: Event
65
- }
66
-
67
- /**
68
- * 全局事件默认参数
69
- */
70
- export interface VxeComponentEvent<E = Event> {
71
- $event: E
72
- stopPropagation(): void
73
- preventDefault(): void
74
- }
75
-
76
- /**
77
- * 组件尺寸类型
78
- */
79
- export type VxeComponentSizeType = null | '' | 'large' | 'medium' | 'small' | 'mini'
80
-
81
- /**
82
- * 组件对齐方式
83
- */
84
- export type VxeComponentAlignType = null | '' | 'left' | 'right' | 'center'
85
-
86
- /**
87
- * 组件状态
88
- */
89
- export type VxeComponentStatusType = null | '' | 'primary' | 'success' | 'info' | 'warning' | 'danger' | 'error' | 'perfect'
90
-
91
- /**
92
- * 组件样式类型
93
- */
94
- export type VxeComponentStyleType = Record<string, string | number>
95
-
96
- /**
97
- * 组件 className 类型
98
- */
99
- export type VxeComponentClassNameType = Record<string, boolean>
100
-
101
- /**
102
- * 组件插槽类型
103
- */
104
- export type VxeComponentSlotType = VNode | string
105
-
106
- /**
107
- * 权限码类型
108
- */
109
- export type VxeComponentPermissionCodeType = string | number
110
-
111
- /**
112
- * 权限码判断结果
113
- */
114
- export type VxeComponentPermissionResult = boolean | {
115
- visible: boolean
116
- disabled: boolean
117
- }
118
-
119
- /**
120
- * 权限码判断方法
121
- */
122
- export type VxeComponentPermissionMethod = (params: {
123
- code: VxeComponentPermissionCodeType
124
- }) => VxeComponentPermissionResult
125
-
126
- /**
127
- * 权限码信息
128
- */
129
- export interface VxeComponentPermissionInfo {
130
- code?: VxeComponentPermissionCodeType
131
- visible: boolean
132
- disabled: boolean
133
- }
134
-
135
- type CamelToKebabRest<S extends string> = S extends `${infer First}${infer Rest}`? `${First extends Lowercase<First> ? '' : '-'}${Lowercase<First>}${CamelToKebabRest<Rest>}`: S
136
- type CamelToKebab<S extends string> = S extends `${infer First}${infer Rest}`? `${Lowercase<First>}${CamelToKebabRest<Rest>}`: S
137
-
138
- /**
139
- * 将带驼峰字符串转成字符串,例如: ProjectName 转为 project-name
140
- */
141
- export type VxeComponentKebabCaseKeys<T> = {
142
- [K in keyof T as K extends string ? CamelToKebab<K> : K]: T[K]
143
- }
144
-
145
- /**
146
- * 将指定的属性设置为必选类型
147
- */
148
- export type VxeWithRequired<T, K extends keyof T> = T & {
149
- [P in K]-?: T[P]
150
- }
1
+ import { App, VNode, ComponentPublicInstance, DefineComponent, Prop } from 'vue'
2
+
3
+ /* eslint-disable no-use-before-define,@typescript-eslint/ban-types */
4
+
5
+ type SafeProp<T> = {
6
+ [K in keyof T]: T[K] extends string ? T[K] : Prop<T[K]>
7
+ }
8
+
9
+ /**
10
+ * 组件类型
11
+ */
12
+ export type DefineVxeComponentApp<
13
+ P = { [key: string]: any },
14
+ E = { [key: string]: any },
15
+ S = { [key: string]: (...args: any[]) => any },
16
+ M = { [key: string]: any }
17
+ > = ({
18
+ new (): M & {
19
+ $props: P & E,
20
+ $slots: S
21
+ }
22
+ } & {
23
+ props: SafeProp<Required<P>>
24
+ install(app: App): void
25
+ })
26
+
27
+ /**
28
+ * 全局组件
29
+ */
30
+ export type DefineVxeGlobalComponent<
31
+ P = { [key: string]: any },
32
+ E = { [key: string]: any },
33
+ S = { [key: string]: (...args: any[]) => any },
34
+ > = ({
35
+ new (): {
36
+ $props: P & E,
37
+ $slots: S
38
+ }
39
+ } & {
40
+ install(app: App): void
41
+ })
42
+
43
+ /**
44
+ * 组件配置
45
+ */
46
+ export type DefineVxeComponentOptions<P, E> = DefineComponent<P & E>
47
+
48
+ /**
49
+ * 组件实例
50
+ */
51
+ export type DefineVxeComponentInstance<P, M> = ComponentPublicInstance<P, M>
52
+
53
+ /**
54
+ * 组件通用的基础参数
55
+ */
56
+ export interface VxeComponentBaseOptions {
57
+ xID: string
58
+ }
59
+
60
+ /**
61
+ * 组件事件参数
62
+ */
63
+ export interface VxeComponentEventParams {
64
+ $event: Event
65
+ }
66
+
67
+ /**
68
+ * 全局事件默认参数
69
+ */
70
+ export interface VxeComponentEvent<E = Event> {
71
+ $event: E
72
+ stopPropagation(): void
73
+ preventDefault(): void
74
+ }
75
+
76
+ /**
77
+ * 组件尺寸类型
78
+ */
79
+ export type VxeComponentSizeType = null | '' | 'large' | 'medium' | 'small' | 'mini'
80
+
81
+ /**
82
+ * 组件对齐方式
83
+ */
84
+ export type VxeComponentAlignType = null | '' | 'left' | 'right' | 'center'
85
+
86
+ /**
87
+ * 组件状态
88
+ */
89
+ export type VxeComponentStatusType = null | '' | 'primary' | 'success' | 'info' | 'warning' | 'danger' | 'error' | 'perfect'
90
+
91
+ /**
92
+ * 组件样式类型
93
+ */
94
+ export type VxeComponentStyleType = Record<string, string | number>
95
+
96
+ /**
97
+ * 组件 className 类型
98
+ */
99
+ export type VxeComponentClassNameType = Record<string, boolean>
100
+
101
+ /**
102
+ * 组件插槽类型
103
+ */
104
+ export type VxeComponentSlotType = VNode | string
105
+
106
+ /**
107
+ * 权限码类型
108
+ */
109
+ export type VxeComponentPermissionCodeType = string | number
110
+
111
+ /**
112
+ * 权限码判断结果
113
+ */
114
+ export type VxeComponentPermissionResult = boolean | {
115
+ visible: boolean
116
+ disabled: boolean
117
+ }
118
+
119
+ /**
120
+ * 权限码判断方法
121
+ */
122
+ export type VxeComponentPermissionMethod = (params: {
123
+ code: VxeComponentPermissionCodeType
124
+ }) => VxeComponentPermissionResult
125
+
126
+ /**
127
+ * 权限码信息
128
+ */
129
+ export interface VxeComponentPermissionInfo {
130
+ code?: VxeComponentPermissionCodeType
131
+ visible: boolean
132
+ disabled: boolean
133
+ }
134
+
135
+ type CamelToKebabRest<S extends string> = S extends `${infer First}${infer Rest}`? `${First extends Lowercase<First> ? '' : '-'}${Lowercase<First>}${CamelToKebabRest<Rest>}`: S
136
+ type CamelToKebab<S extends string> = S extends `${infer First}${infer Rest}`? `${Lowercase<First>}${CamelToKebabRest<Rest>}`: S
137
+
138
+ /**
139
+ * 将带驼峰字符串转成字符串,例如: ProjectName 转为 project-name
140
+ */
141
+ export type VxeComponentKebabCaseKeys<T> = {
142
+ [K in keyof T as K extends string ? CamelToKebab<K> : K]: T[K]
143
+ }
144
+
145
+ /**
146
+ * 将指定的属性设置为必选类型
147
+ */
148
+ export type VxeWithRequired<T, K extends keyof T> = T & {
149
+ [P in K]-?: T[P]
150
+ }
@@ -1,2 +1,2 @@
1
- export * from './util'
2
- export * from './common'
1
+ export * from './util'
2
+ export * from './common'
@@ -1,4 +1,4 @@
1
- /**
2
- * 取出对象值类型
3
- */
4
- export type ValueOf<T> = T extends any[] ? T[number] : T[keyof T]
1
+ /**
2
+ * 取出对象值类型
3
+ */
4
+ export type ValueOf<T> = T extends any[] ? T[number] : T[keyof T]