@vxe-ui/core 4.4.42 → 4.5.1
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.
- package/dist/all.esm.js +1594 -1389
- package/dist/all.esm.min.js +1 -0
- package/es/index.d.ts +138 -0
- package/es/index.esm.js +138 -125
- package/es/index.js +150 -0
- package/es/src/base-utils.d.ts +2 -0
- package/es/src/base-utils.js +40 -37
- package/es/src/clipboard.d.ts +2 -0
- package/es/src/clipboard.js +48 -45
- package/es/src/commands.d.ts +2 -0
- package/es/src/commands.js +47 -48
- package/es/src/config.d.ts +13 -0
- package/es/src/config.js +21 -23
- package/es/src/configStore.d.ts +2 -0
- package/es/src/configStore.js +8 -5
- package/es/src/core.d.ts +3 -0
- package/es/src/core.js +11 -7
- package/es/src/dataStore.d.ts +2 -0
- package/es/src/dataStore.js +4 -1
- package/es/src/db-utils.d.ts +2 -0
- package/es/src/db-utils.js +234 -0
- package/es/src/dom-utils.d.ts +2 -0
- package/es/src/dom-utils.js +65 -68
- package/es/src/event.d.ts +4 -0
- package/es/src/event.js +133 -147
- package/es/src/formats.d.ts +2 -0
- package/es/src/formats.js +47 -48
- package/es/src/hooks.d.ts +2 -0
- package/es/src/hooks.js +5 -2
- package/es/src/i18n.d.ts +6 -0
- package/es/src/i18n.js +51 -44
- package/es/src/i18nStore.d.ts +5 -0
- package/es/src/i18nStore.js +7 -4
- package/es/src/icon.d.ts +9 -0
- package/es/src/icon.js +28 -22
- package/es/src/iconStore.d.ts +2 -0
- package/es/src/iconStore.js +4 -1
- package/es/src/interceptor.d.ts +2 -0
- package/es/src/interceptor.js +52 -54
- package/es/src/log.d.ts +2 -0
- package/es/src/log.js +14 -11
- package/es/src/menus.d.ts +2 -0
- package/es/src/menus.js +47 -48
- package/es/src/permission.d.ts +3 -0
- package/es/src/permission.js +57 -55
- package/es/src/popper-utils.d.ts +2 -0
- package/es/src/popper-utils.js +159 -179
- package/es/src/renderer.d.ts +5 -0
- package/es/src/renderer.js +37 -42
- package/es/src/resize.d.ts +2 -0
- package/es/src/resize.js +60 -70
- package/es/src/scrollbar-utils.d.ts +2 -0
- package/es/src/scrollbar-utils.js +57 -54
- package/es/src/store.d.ts +13 -0
- package/es/src/store.js +43 -45
- package/es/src/theme.d.ts +3 -0
- package/es/src/theme.js +17 -13
- package/es/src/themeStore.d.ts +4 -0
- package/es/src/themeStore.js +5 -2
- package/es/src/useFns.d.ts +40 -0
- package/es/src/useFns.js +212 -231
- package/es/src/validators.d.ts +2 -0
- package/es/src/validators.js +6 -3
- package/es/src/vm.d.ts +2 -0
- package/es/src/vm.js +9 -6
- package/es/src/z-index.d.ts +2 -0
- package/es/src/z-index.js +29 -26
- package/lib/index.common.js +136 -365
- package/lib/index.js +181 -0
- package/lib/index.umd.js +819 -3343
- package/lib/index.umd.min.js +1 -1
- package/lib/src/base-utils.js +39 -13
- package/lib/src/clipboard.js +50 -23
- package/lib/src/commands.js +46 -27
- package/lib/src/config.js +43 -23
- package/lib/src/configStore.js +24 -7
- package/lib/src/core.js +29 -11
- package/lib/src/dataStore.js +22 -5
- package/lib/src/db-utils.js +263 -0
- package/lib/src/dom-utils.js +40 -20
- package/lib/src/event.js +95 -102
- package/lib/src/formats.js +46 -27
- package/lib/src/hooks.js +33 -7
- package/lib/src/i18n.js +53 -38
- package/lib/src/i18nStore.js +25 -8
- package/lib/src/icon.js +46 -22
- package/lib/src/iconStore.js +22 -5
- package/lib/src/interceptor.js +40 -18
- package/lib/src/log.js +29 -12
- package/lib/src/menus.js +46 -27
- package/lib/src/permission.js +40 -17
- package/lib/src/popper-utils.js +71 -71
- package/lib/src/renderer.js +40 -21
- package/lib/src/resize.js +48 -42
- package/lib/src/scrollbar-utils.js +23 -6
- package/lib/src/store.js +44 -25
- package/lib/src/theme.js +31 -14
- package/lib/src/themeStore.js +24 -7
- package/lib/src/useFns.js +87 -124
- package/lib/src/validators.js +34 -10
- package/lib/src/vm.js +34 -8
- package/lib/src/z-index.js +38 -12
- package/package.json +14 -3
- package/packages/index.ts +171 -168
- package/packages/src/base-utils.ts +42 -43
- package/packages/src/clipboard.ts +56 -56
- package/packages/src/commands.ts +56 -56
- package/packages/src/config.ts +30 -30
- package/packages/src/configStore.ts +8 -8
- package/packages/src/core.ts +11 -11
- package/packages/src/dataStore.ts +3 -4
- package/packages/src/db-utils.ts +267 -0
- package/packages/src/dom-utils.ts +86 -87
- package/packages/src/event.ts +161 -161
- package/packages/src/formats.ts +56 -56
- package/packages/src/hooks.ts +5 -5
- package/packages/src/i18n.ts +63 -63
- package/packages/src/i18nStore.ts +11 -11
- package/packages/src/icon.ts +32 -32
- package/packages/src/iconStore.ts +3 -3
- package/packages/src/interceptor.ts +64 -64
- package/packages/src/log.ts +19 -19
- package/packages/src/menus.ts +56 -56
- package/packages/src/permission.ts +61 -61
- package/packages/src/popper-utils.ts +197 -194
- package/packages/src/renderer.ts +50 -50
- package/packages/src/resize.ts +89 -89
- package/packages/src/scrollbar-utils.ts +58 -58
- package/packages/src/store.ts +47 -47
- package/packages/src/theme.ts +20 -20
- package/packages/src/themeStore.ts +7 -7
- package/packages/src/useFns.ts +270 -275
- package/packages/src/validators.ts +7 -7
- package/packages/src/vm.ts +10 -10
- package/packages/src/z-index.ts +30 -30
- package/types/core/base-utils.d.ts +39 -40
- package/types/core/clipboard.d.ts +22 -22
- package/types/core/commands.d.ts +17 -19
- package/types/core/components.d.ts +5 -5
- package/types/core/db-utils.d.ts +44 -0
- package/types/core/dom-utils.d.ts +36 -37
- package/types/core/formats.d.ts +17 -19
- package/types/core/global-config.d.ts +67 -74
- package/types/core/global-data.d.ts +7 -7
- package/types/core/global-event.d.ts +48 -48
- package/types/core/global-icon.d.ts +10 -10
- package/types/core/global-lang.d.ts +28 -27
- package/types/core/global-resize.d.ts +3 -3
- package/types/core/global-theme.d.ts +1 -1
- package/types/core/hooks.d.ts +12 -14
- package/types/core/index.d.ts +343 -336
- package/types/core/interceptor.d.ts +20 -22
- package/types/core/log.d.ts +8 -8
- package/types/core/menus.d.ts +17 -19
- package/types/core/permission.d.ts +10 -10
- package/types/core/popper-utils.d.ts +44 -44
- package/types/core/renderer.d.ts +14 -14
- package/types/core/scrollbar-utils.d.ts +37 -38
- package/types/core/useFn.d.ts +121 -126
- package/types/core/validators.d.ts +17 -19
- package/types/core/z-index.d.ts +18 -18
- package/types/index.d.ts +13 -13
- package/types/tool/common.d.ts +146 -155
- package/types/tool/index.d.ts +2 -2
- package/types/tool/util.d.ts +4 -4
- package/lib/src/base-utils.min.js +0 -1
- package/lib/src/clipboard.min.js +0 -1
- package/lib/src/commands.min.js +0 -1
- package/lib/src/config.min.js +0 -1
- package/lib/src/configStore.min.js +0 -1
- package/lib/src/core.min.js +0 -1
- package/lib/src/dataStore.min.js +0 -1
- package/lib/src/dom-utils.min.js +0 -1
- package/lib/src/event.min.js +0 -1
- package/lib/src/formats.min.js +0 -1
- package/lib/src/hooks.min.js +0 -1
- package/lib/src/i18n.min.js +0 -1
- package/lib/src/i18nStore.min.js +0 -1
- package/lib/src/icon.min.js +0 -1
- package/lib/src/iconStore.min.js +0 -1
- package/lib/src/interceptor.min.js +0 -1
- package/lib/src/log.min.js +0 -1
- package/lib/src/menus.min.js +0 -1
- package/lib/src/permission.min.js +0 -1
- package/lib/src/popper-utils.min.js +0 -1
- package/lib/src/renderer.min.js +0 -1
- package/lib/src/resize.min.js +0 -1
- package/lib/src/scrollbar-utils.min.js +0 -1
- package/lib/src/store.min.js +0 -1
- package/lib/src/theme.min.js +0 -1
- package/lib/src/themeStore.min.js +0 -1
- package/lib/src/useFns.min.js +0 -1
- package/lib/src/validators.min.js +0 -1
- package/lib/src/vm.min.js +0 -1
- package/lib/src/z-index.min.js +0 -1
|
@@ -1,40 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
type
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
*
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
*
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
*
|
|
22
|
-
* @param
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
*
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
* @param
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
1
|
+
type Nullish = null | undefined
|
|
2
|
+
export type VxeBaseEmptyValue = '' | Nullish
|
|
3
|
+
|
|
4
|
+
interface EnableConfOptions {
|
|
5
|
+
enabled?: boolean
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface VxeBaseUtils {
|
|
9
|
+
/**
|
|
10
|
+
* 转成字符串
|
|
11
|
+
* @param value
|
|
12
|
+
*/
|
|
13
|
+
toString(value: string | number | boolean | null | undefined): string
|
|
14
|
+
/**
|
|
15
|
+
* 判断值为:'' | null | undefined 时都属于空值
|
|
16
|
+
* @param value
|
|
17
|
+
*/
|
|
18
|
+
isEmpty(value: any): value is VxeBaseEmptyValue
|
|
19
|
+
/**
|
|
20
|
+
* 获取配置值,如果存在则返回,如果不存在则使用默认值
|
|
21
|
+
* @param value
|
|
22
|
+
* @param defVal
|
|
23
|
+
*/
|
|
24
|
+
getDefVal<T = any, D = any>(value: T, defVal: D): T | D
|
|
25
|
+
/**
|
|
26
|
+
* 判断配置项是否启用
|
|
27
|
+
* @param conf
|
|
28
|
+
*/
|
|
29
|
+
isEnabled(conf: EnableConfOptions): boolean
|
|
30
|
+
/**
|
|
31
|
+
* 用于判断开关类型的配置项
|
|
32
|
+
* 局部启用规则:conf={}
|
|
33
|
+
* 局部禁用规则:conf={enabled:false}
|
|
34
|
+
* 全局默认启用规则:conf.enabled=true
|
|
35
|
+
* @param conf
|
|
36
|
+
* @param opts
|
|
37
|
+
*/
|
|
38
|
+
hasEnableConf(conf: EnableConfOptions, opts: EnableConfOptions): boolean
|
|
39
|
+
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
export interface VxeGlobalClipboardCopyObj {
|
|
2
|
-
text: string
|
|
3
|
-
html: string
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* 全局剪贴板
|
|
8
|
-
*/
|
|
9
|
-
export interface VxeGlobalClipboard {
|
|
10
|
-
getStore(): VxeGlobalClipboardCopyObj
|
|
11
|
-
setStore(data: VxeGlobalClipboardCopyObj): void
|
|
12
|
-
/**
|
|
13
|
-
* 将字符串内容复制到剪贴板
|
|
14
|
-
* @param content
|
|
15
|
-
*/
|
|
16
|
-
copy(content: string | number | VxeGlobalClipboardCopyObj): boolean
|
|
17
|
-
/**
|
|
18
|
-
* 获取已已复制到剪贴板的内容
|
|
19
|
-
* @param content
|
|
20
|
-
*/
|
|
21
|
-
getText(): string
|
|
22
|
-
}
|
|
1
|
+
export interface VxeGlobalClipboardCopyObj {
|
|
2
|
+
text: string
|
|
3
|
+
html: string
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 全局剪贴板
|
|
8
|
+
*/
|
|
9
|
+
export interface VxeGlobalClipboard {
|
|
10
|
+
getStore(): VxeGlobalClipboardCopyObj
|
|
11
|
+
setStore(data: VxeGlobalClipboardCopyObj): void
|
|
12
|
+
/**
|
|
13
|
+
* 将字符串内容复制到剪贴板
|
|
14
|
+
* @param content
|
|
15
|
+
*/
|
|
16
|
+
copy(content: string | number | VxeGlobalClipboardCopyObj): boolean
|
|
17
|
+
/**
|
|
18
|
+
* 获取已已复制到剪贴板的内容
|
|
19
|
+
* @param content
|
|
20
|
+
*/
|
|
21
|
+
getText(): string
|
|
22
|
+
}
|
package/types/core/commands.d.ts
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
/* eslint-disable no-use-before-define */
|
|
2
|
-
|
|
3
|
-
export namespace VxeGlobalCommandsHandles {
|
|
4
|
-
export interface CommandsOptions {}
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* 全局格式化
|
|
9
|
-
*/
|
|
10
|
-
export interface VxeGlobalCommands {
|
|
11
|
-
mixin(opts: {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
forEach(callback: (options: VxeGlobalCommandsHandles.CommandsOptions, name: string) => void): void
|
|
19
|
-
}
|
|
1
|
+
/* eslint-disable no-use-before-define */
|
|
2
|
+
|
|
3
|
+
export namespace VxeGlobalCommandsHandles {
|
|
4
|
+
export interface CommandsOptions {}
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 全局格式化
|
|
9
|
+
*/
|
|
10
|
+
export interface VxeGlobalCommands {
|
|
11
|
+
mixin(opts: { [name: string]: VxeGlobalCommandsHandles.CommandsOptions | ((params: any, ...args: any[]) => void) }): VxeGlobalCommands
|
|
12
|
+
has(name: string | null | undefined): boolean
|
|
13
|
+
get(name: string | null | undefined): VxeGlobalCommandsHandles.CommandsOptions
|
|
14
|
+
add(name: string, options: VxeGlobalCommandsHandles.CommandsOptions | ((params: any, ...args: any[]) => void)): VxeGlobalCommands
|
|
15
|
+
delete(name: string | null | undefined): void
|
|
16
|
+
forEach(callback: (options: VxeGlobalCommandsHandles.CommandsOptions, name: string) => void): void
|
|
17
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export interface VxeGlobalComponents {}
|
|
2
|
-
|
|
3
|
-
export type VxeGlobalComponentMethod = (comp: any) => void
|
|
4
|
-
export type VxeGlobalGetComponentMethod = <K extends keyof VxeGlobalComponents>(name: K) => VxeGlobalComponents[K]
|
|
5
|
-
export type VxeGlobalHasComponentMethod = (name: keyof VxeGlobalComponents) => boolean
|
|
1
|
+
export interface VxeGlobalComponents {}
|
|
2
|
+
|
|
3
|
+
export type VxeGlobalComponentMethod = (comp: any) => void
|
|
4
|
+
export type VxeGlobalGetComponentMethod = <K extends keyof VxeGlobalComponents>(name: K) => VxeGlobalComponents[K]
|
|
5
|
+
export type VxeGlobalHasComponentMethod = (name: keyof VxeGlobalComponents) => boolean
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export interface VxeDBStore<T = any> {
|
|
2
|
+
/**
|
|
3
|
+
* 根据 ID 获取数据
|
|
4
|
+
* @param id
|
|
5
|
+
*/
|
|
6
|
+
getById(id: string): Promise<{ id: string; data: T } | undefined>
|
|
7
|
+
/**
|
|
8
|
+
* 获取所有数据
|
|
9
|
+
*/
|
|
10
|
+
getAll(): Promise<{ id: string; data: T }[]>
|
|
11
|
+
/**
|
|
12
|
+
* 根据 ID 更新数据
|
|
13
|
+
* @param id
|
|
14
|
+
*/
|
|
15
|
+
updateById(id: string, data: T): Promise<void>
|
|
16
|
+
/**
|
|
17
|
+
* 根据 ID 删除数据
|
|
18
|
+
* @param id
|
|
19
|
+
*/
|
|
20
|
+
deleteById(id: string): Promise<void>
|
|
21
|
+
/**
|
|
22
|
+
* 清空当前存储的数据
|
|
23
|
+
*/
|
|
24
|
+
clear(): Promise<void>
|
|
25
|
+
/**
|
|
26
|
+
* 清理旧版本数据
|
|
27
|
+
*/
|
|
28
|
+
cleanupOldDBs(): Promise<void>
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface VxeDBOptions {
|
|
32
|
+
version?: string | number
|
|
33
|
+
driver?: 'indexedDB' | 'localStorage' | '' | null
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface VxeDBUtils {
|
|
37
|
+
/**
|
|
38
|
+
* 创建存储实例
|
|
39
|
+
* - driver = 'indexedDB' 且环境支持 => IdbStore
|
|
40
|
+
* @param key
|
|
41
|
+
* @param options
|
|
42
|
+
*/
|
|
43
|
+
createStore<T = any>(key: string, options?: VxeDBOptions): VxeDBStore<T>
|
|
44
|
+
}
|
|
@@ -1,37 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
*
|
|
15
|
-
* @param
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
*
|
|
21
|
-
* @param
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
*
|
|
27
|
-
* @param
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
*
|
|
33
|
-
* @param
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
1
|
+
export interface VxeDomUtils {
|
|
2
|
+
/**
|
|
3
|
+
* 判断是否像素px单位 '100px' | 100
|
|
4
|
+
* @param val
|
|
5
|
+
*/
|
|
6
|
+
isPx(val: any): boolean
|
|
7
|
+
/**
|
|
8
|
+
* 判断是否百分比%单位 '100%'
|
|
9
|
+
* @param val
|
|
10
|
+
*/
|
|
11
|
+
isScale(val: any): boolean
|
|
12
|
+
/**
|
|
13
|
+
* 判断元素是否包含 class
|
|
14
|
+
* @param elem
|
|
15
|
+
* @param cls
|
|
16
|
+
*/
|
|
17
|
+
hasClass(elem: HTMLElement, cls: string): boolean
|
|
18
|
+
/**
|
|
19
|
+
* 给元素删除 class
|
|
20
|
+
* @param elem
|
|
21
|
+
* @param cls
|
|
22
|
+
*/
|
|
23
|
+
removeClass(elem: HTMLElement, cls: string): void
|
|
24
|
+
/**
|
|
25
|
+
* 给元素增加 class
|
|
26
|
+
* @param elem
|
|
27
|
+
* @param cls
|
|
28
|
+
*/
|
|
29
|
+
addClass(elem: HTMLElement, cls: string): void
|
|
30
|
+
/**
|
|
31
|
+
* 生成 className
|
|
32
|
+
* @param staticClassNames
|
|
33
|
+
* @param mapClassName
|
|
34
|
+
*/
|
|
35
|
+
buildClass(staticClassNames: (string | number | null | undefined)[] | null | undefined, mapClassName?: Record<string, boolean | string | number | null | undefined>): string
|
|
36
|
+
}
|
package/types/core/formats.d.ts
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
/* eslint-disable no-use-before-define */
|
|
2
|
-
|
|
3
|
-
export namespace VxeGlobalFormatsHandles {
|
|
4
|
-
export interface FormatsOptions {}
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* 全局格式化
|
|
9
|
-
*/
|
|
10
|
-
export interface VxeGlobalFormats {
|
|
11
|
-
mixin(opts: {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
forEach(callback: (options: VxeGlobalFormatsHandles.FormatsOptions, name: string) => void): void
|
|
19
|
-
}
|
|
1
|
+
/* eslint-disable no-use-before-define */
|
|
2
|
+
|
|
3
|
+
export namespace VxeGlobalFormatsHandles {
|
|
4
|
+
export interface FormatsOptions {}
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 全局格式化
|
|
9
|
+
*/
|
|
10
|
+
export interface VxeGlobalFormats {
|
|
11
|
+
mixin(opts: { [name: string]: VxeGlobalFormatsHandles.FormatsOptions | ((params: any, ...args: any[]) => string | number) }): VxeGlobalFormats
|
|
12
|
+
has(name: string | null | undefined): boolean
|
|
13
|
+
get(name: string | null | undefined): VxeGlobalFormatsHandles.FormatsOptions
|
|
14
|
+
add(name: string, options: VxeGlobalFormatsHandles.FormatsOptions | ((params: any, ...args: any[]) => string | number)): VxeGlobalFormats
|
|
15
|
+
delete(name: string | null | undefined): void
|
|
16
|
+
forEach(callback: (options: VxeGlobalFormatsHandles.FormatsOptions, name: string) => void): void
|
|
17
|
+
}
|
|
@@ -1,74 +1,67 @@
|
|
|
1
|
-
import { VxeComponentSizeType, VxeComponentIsVScrollbar } from '../tool'
|
|
2
|
-
|
|
3
|
-
import { VxeGlobalThemeName, VxeComponentPermissionCodeType, VxeComponentPermissionResult } from '../../types'
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* 全局参数对象
|
|
7
|
-
*/
|
|
8
|
-
export interface VxeGlobalConfig {
|
|
9
|
-
/**
|
|
10
|
-
* 企业版 - 设置授权 ID
|
|
11
|
-
*/
|
|
12
|
-
authId?: string
|
|
13
|
-
/**
|
|
14
|
-
* 企业版 - 是否在控制台打印授权信息
|
|
15
|
-
*/
|
|
16
|
-
showAuthLog?: boolean
|
|
17
|
-
/**
|
|
18
|
-
* 企业版 - 授权状态监听
|
|
19
|
-
*/
|
|
20
|
-
onAuth?(params: {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
*
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
*
|
|
46
|
-
* @
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
*
|
|
53
|
-
* @
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
version?: string | number
|
|
69
|
-
/**
|
|
70
|
-
* 已废弃,请使用 VxeUI.setTheme('dark')
|
|
71
|
-
* @deprecated
|
|
72
|
-
*/
|
|
73
|
-
theme?: VxeGlobalThemeName
|
|
74
|
-
}
|
|
1
|
+
import { VxeComponentSizeType, VxeComponentIsVScrollbar } from '../tool'
|
|
2
|
+
|
|
3
|
+
import { VxeGlobalThemeName, VxeComponentPermissionCodeType, VxeComponentPermissionResult } from '../../types'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 全局参数对象
|
|
7
|
+
*/
|
|
8
|
+
export interface VxeGlobalConfig {
|
|
9
|
+
/**
|
|
10
|
+
* 企业版 - 设置授权 ID
|
|
11
|
+
*/
|
|
12
|
+
authId?: string
|
|
13
|
+
/**
|
|
14
|
+
* 企业版 - 是否在控制台打印授权信息
|
|
15
|
+
*/
|
|
16
|
+
showAuthLog?: boolean
|
|
17
|
+
/**
|
|
18
|
+
* 企业版 - 授权状态监听
|
|
19
|
+
*/
|
|
20
|
+
onAuth?(params: { status: boolean; code: number; msg: string }): void
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* 权限码全局判断方法,返回 { visible, disabled }
|
|
24
|
+
*/
|
|
25
|
+
permissionMethod?: (params: { code: VxeComponentPermissionCodeType }) => VxeComponentPermissionResult
|
|
26
|
+
/**
|
|
27
|
+
* 全局默认 z-index
|
|
28
|
+
*/
|
|
29
|
+
zIndex?: number
|
|
30
|
+
/**
|
|
31
|
+
* 全局版本号,对于某些带数据缓存的功能有用到,上升版本号可以用于重置组件保存的数据
|
|
32
|
+
*/
|
|
33
|
+
version?: string | number
|
|
34
|
+
/**
|
|
35
|
+
* 全局组件尺寸
|
|
36
|
+
*/
|
|
37
|
+
size?: VxeComponentSizeType
|
|
38
|
+
/**
|
|
39
|
+
* 全局启用虚拟滚动条
|
|
40
|
+
*/
|
|
41
|
+
useScrollbar?: VxeComponentIsVScrollbar
|
|
42
|
+
/**
|
|
43
|
+
* 支持对组件中特定的字段进行翻译
|
|
44
|
+
* @param key
|
|
45
|
+
* @param args
|
|
46
|
+
* @returns string
|
|
47
|
+
*/
|
|
48
|
+
translate?: (key: string, args?: any) => string
|
|
49
|
+
/**
|
|
50
|
+
* 自定义方式对组件内置的语言进行翻译
|
|
51
|
+
* @param key
|
|
52
|
+
* @param args
|
|
53
|
+
* @returns string
|
|
54
|
+
*/
|
|
55
|
+
i18n?: (key: string, args?: any) => string | number
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* 已废弃,请使用 VxeUI.setConfig({ table: { resizeInterval: 300 } })
|
|
59
|
+
* @deprecated
|
|
60
|
+
*/
|
|
61
|
+
resizeInterval?: number
|
|
62
|
+
/**
|
|
63
|
+
* 已废弃,请使用 VxeUI.setTheme('dark')
|
|
64
|
+
* @deprecated
|
|
65
|
+
*/
|
|
66
|
+
theme?: VxeGlobalThemeName
|
|
67
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export interface VxeGlobalData {
|
|
2
|
-
[key: string]: any
|
|
3
|
-
clipboard?: {
|
|
4
|
-
text: string
|
|
5
|
-
html: string
|
|
6
|
-
}
|
|
7
|
-
}
|
|
1
|
+
export interface VxeGlobalData {
|
|
2
|
+
[key: string]: any
|
|
3
|
+
clipboard?: {
|
|
4
|
+
text: string
|
|
5
|
+
html: string
|
|
6
|
+
}
|
|
7
|
+
}
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import { VxeComponentBaseOptions, VxeComponentEvent } from '../tool'
|
|
2
|
-
|
|
3
|
-
export type VxeGlobalEventType = 'copy' | 'cut' | 'paste' | 'keydown' | 'contextmenu' | 'mousedown' | 'click' | 'blur' | 'resize' | 'mousewheel' | 'scroll'
|
|
4
|
-
|
|
5
|
-
export type VxeGlobalEventKey = {
|
|
6
|
-
F2: 'F2'
|
|
7
|
-
F10: 'F10'
|
|
8
|
-
TAB: 'Tab'
|
|
9
|
-
ESCAPE: 'Escape'
|
|
10
|
-
ENTER: 'Enter'
|
|
11
|
-
DELETE: 'Delete'
|
|
12
|
-
BACKSPACE: 'Backspace'
|
|
13
|
-
SPACEBAR: ' '
|
|
14
|
-
CONTEXT_MENU: 'ContextMenu'
|
|
15
|
-
ARROW_UP: 'ArrowUp'
|
|
16
|
-
ARROW_DOWN: 'ArrowDown'
|
|
17
|
-
ARROW_LEFT: 'ArrowLeft'
|
|
18
|
-
ARROW_RIGHT: 'ArrowRight'
|
|
19
|
-
PAGE_UP: 'PageUp'
|
|
20
|
-
PAGE_DOWN: 'PageDown'
|
|
21
|
-
HOME: 'Home'
|
|
22
|
-
END: 'End'
|
|
23
|
-
PROCESS: 'Process'
|
|
24
|
-
A: 'A'
|
|
25
|
-
X: 'X'
|
|
26
|
-
C: 'C'
|
|
27
|
-
V: 'V'
|
|
28
|
-
D: 'D'
|
|
29
|
-
F: 'F'
|
|
30
|
-
H: 'H'
|
|
31
|
-
M: 'M'
|
|
32
|
-
Y: 'Y'
|
|
33
|
-
Z: 'Z'
|
|
34
|
-
R: 'R'
|
|
35
|
-
P: 'P'
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export const GLOBAL_EVENT_KEYS: VxeGlobalEventKey
|
|
39
|
-
|
|
40
|
-
export type VxeGlobalCreateEventMethod = (evnt: Event | null, params1: any, params2?: any) => VxeComponentEvent
|
|
41
|
-
|
|
42
|
-
export const createEvent: VxeGlobalCreateEventMethod
|
|
43
|
-
|
|
44
|
-
export interface VxeGlobalEvents {
|
|
45
|
-
on
|
|
46
|
-
off
|
|
47
|
-
hasKey(evnt: KeyboardEvent, targetKey: string): boolean
|
|
48
|
-
}
|
|
1
|
+
import { VxeComponentBaseOptions, VxeComponentEvent } from '../tool'
|
|
2
|
+
|
|
3
|
+
export type VxeGlobalEventType = 'copy' | 'cut' | 'paste' | 'keydown' | 'contextmenu' | 'mousedown' | 'click' | 'blur' | 'resize' | 'mousewheel' | 'scroll'
|
|
4
|
+
|
|
5
|
+
export type VxeGlobalEventKey = {
|
|
6
|
+
F2: 'F2'
|
|
7
|
+
F10: 'F10'
|
|
8
|
+
TAB: 'Tab'
|
|
9
|
+
ESCAPE: 'Escape'
|
|
10
|
+
ENTER: 'Enter'
|
|
11
|
+
DELETE: 'Delete'
|
|
12
|
+
BACKSPACE: 'Backspace'
|
|
13
|
+
SPACEBAR: ' '
|
|
14
|
+
CONTEXT_MENU: 'ContextMenu'
|
|
15
|
+
ARROW_UP: 'ArrowUp'
|
|
16
|
+
ARROW_DOWN: 'ArrowDown'
|
|
17
|
+
ARROW_LEFT: 'ArrowLeft'
|
|
18
|
+
ARROW_RIGHT: 'ArrowRight'
|
|
19
|
+
PAGE_UP: 'PageUp'
|
|
20
|
+
PAGE_DOWN: 'PageDown'
|
|
21
|
+
HOME: 'Home'
|
|
22
|
+
END: 'End'
|
|
23
|
+
PROCESS: 'Process'
|
|
24
|
+
A: 'A'
|
|
25
|
+
X: 'X'
|
|
26
|
+
C: 'C'
|
|
27
|
+
V: 'V'
|
|
28
|
+
D: 'D'
|
|
29
|
+
F: 'F'
|
|
30
|
+
H: 'H'
|
|
31
|
+
M: 'M'
|
|
32
|
+
Y: 'Y'
|
|
33
|
+
Z: 'Z'
|
|
34
|
+
R: 'R'
|
|
35
|
+
P: 'P'
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const GLOBAL_EVENT_KEYS: VxeGlobalEventKey
|
|
39
|
+
|
|
40
|
+
export type VxeGlobalCreateEventMethod = (evnt: Event | null, params1: any, params2?: any) => VxeComponentEvent
|
|
41
|
+
|
|
42
|
+
export const createEvent: VxeGlobalCreateEventMethod
|
|
43
|
+
|
|
44
|
+
export interface VxeGlobalEvents {
|
|
45
|
+
on(comp: VxeComponentBaseOptions, type: VxeGlobalEventType, cb: (evnt: any) => void): void
|
|
46
|
+
off(comp: VxeComponentBaseOptions, type: VxeGlobalEventType): void
|
|
47
|
+
hasKey(evnt: KeyboardEvent, targetKey: string): boolean
|
|
48
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { VNode } from 'vue'
|
|
2
|
-
|
|
3
|
-
export type VxeGlobalIconConfig = string | ((params: { name: string }) => VNode | string)
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* 全局图标参数
|
|
7
|
-
*/
|
|
8
|
-
export interface VxeGlobalIcon {
|
|
9
|
-
LOGO?: VxeGlobalIconConfig
|
|
10
|
-
}
|
|
1
|
+
import { VNode } from 'vue'
|
|
2
|
+
|
|
3
|
+
export type VxeGlobalIconConfig = string | ((params: { name: string }) => VNode | string)
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 全局图标参数
|
|
7
|
+
*/
|
|
8
|
+
export interface VxeGlobalIcon {
|
|
9
|
+
LOGO?: VxeGlobalIconConfig
|
|
10
|
+
}
|