@vxe-ui/core 4.0.23 → 4.0.25
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/LICENSE +21 -21
- package/README.en.md +31 -31
- package/README.md +31 -31
- package/README.zh-TW.md +31 -31
- package/es/src/core.js +1 -1
- package/es/src/log.js +1 -1
- package/lib/index.umd.js +932 -137
- package/lib/index.umd.min.js +1 -1
- package/lib/src/clipboard.min.js +1 -1
- package/lib/src/commands.min.js +1 -1
- package/lib/src/config.min.js +1 -1
- package/lib/src/configStore.min.js +1 -1
- package/lib/src/core.js +1 -1
- package/lib/src/core.min.js +1 -1
- package/lib/src/dataStore.min.js +1 -1
- package/lib/src/event.min.js +1 -1
- package/lib/src/formats.min.js +1 -1
- package/lib/src/hooks.min.js +1 -1
- package/lib/src/i18n.min.js +1 -1
- package/lib/src/i18nStore.min.js +1 -1
- package/lib/src/icon.min.js +1 -1
- package/lib/src/iconStore.min.js +1 -1
- package/lib/src/interceptor.min.js +1 -1
- package/lib/src/log.js +1 -1
- package/lib/src/log.min.js +1 -1
- package/lib/src/menus.min.js +1 -1
- package/lib/src/permission.min.js +1 -1
- package/lib/src/renderer.min.js +1 -1
- package/lib/src/resize.min.js +1 -1
- package/lib/src/store.min.js +1 -1
- package/lib/src/theme.min.js +1 -1
- package/lib/src/themeStore.min.js +1 -1
- package/lib/src/useFns.min.js +1 -1
- package/lib/src/validators.min.js +1 -1
- package/package.json +79 -79
- package/packages/index.ts +117 -117
- package/packages/src/clipboard.ts +53 -53
- package/packages/src/commands.ts +62 -62
- package/packages/src/config.ts +30 -30
- package/packages/src/configStore.ts +8 -8
- package/packages/src/core.ts +9 -9
- package/packages/src/dataStore.ts +4 -4
- package/packages/src/event.ts +127 -127
- package/packages/src/formats.ts +62 -62
- package/packages/src/hooks.ts +5 -5
- package/packages/src/i18n.ts +43 -43
- package/packages/src/i18nStore.ts +11 -11
- package/packages/src/icon.ts +16 -16
- package/packages/src/iconStore.ts +3 -3
- package/packages/src/interceptor.ts +65 -65
- package/packages/src/log.ts +19 -19
- package/packages/src/menus.ts +62 -62
- package/packages/src/permission.ts +61 -61
- package/packages/src/renderer.ts +50 -50
- package/packages/src/resize.ts +89 -89
- package/packages/src/store.ts +49 -49
- package/packages/src/theme.ts +20 -20
- package/packages/src/themeStore.ts +7 -7
- package/packages/src/useFns.ts +34 -34
- package/packages/src/validators.ts +9 -9
- package/types/core/clipboard.d.ts +13 -13
- package/types/core/commands.d.ts +19 -19
- package/types/core/components.d.ts +4 -4
- package/types/core/formats.d.ts +19 -19
- package/types/core/global-config.d.ts +62 -62
- package/types/core/global-data.d.ts +7 -7
- package/types/core/global-event.d.ts +39 -39
- package/types/core/global-icon.d.ts +6 -6
- package/types/core/global-lang.d.ts +22 -22
- package/types/core/global-resize.d.ts +3 -3
- package/types/core/global-theme.d.ts +1 -1
- package/types/core/hooks.d.ts +14 -14
- package/types/core/index.d.ts +255 -255
- package/types/core/interceptor.d.ts +22 -22
- package/types/core/log.d.ts +8 -8
- package/types/core/menus.d.ts +19 -19
- package/types/core/permission.d.ts +10 -10
- package/types/core/renderer.d.ts +14 -14
- package/types/core/useFn.d.ts +27 -27
- package/types/core/validators.d.ts +19 -19
- package/types/index.d.ts +13 -13
- package/types/tool/common.d.ts +111 -111
- package/types/tool/index.d.ts +2 -2
- package/types/tool/util.d.ts +4 -4
package/packages/src/theme.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { VxeCore } from './core'
|
|
2
|
-
import { themeConfigStore } from './themeStore'
|
|
3
|
-
|
|
4
|
-
import { VxeGlobalThemeName } from '../../types'
|
|
5
|
-
|
|
6
|
-
export function setTheme (name?: VxeGlobalThemeName) {
|
|
7
|
-
const theme = !name || name === 'default' ? 'light' : name
|
|
8
|
-
themeConfigStore.theme = theme
|
|
9
|
-
if (typeof document !== 'undefined') {
|
|
10
|
-
const documentElement = document.documentElement
|
|
11
|
-
if (documentElement) {
|
|
12
|
-
documentElement.setAttribute('data-vxe-ui-theme', theme)
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
return VxeCore
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function getTheme () {
|
|
19
|
-
return themeConfigStore.theme
|
|
20
|
-
}
|
|
1
|
+
import { VxeCore } from './core'
|
|
2
|
+
import { themeConfigStore } from './themeStore'
|
|
3
|
+
|
|
4
|
+
import { VxeGlobalThemeName } from '../../types'
|
|
5
|
+
|
|
6
|
+
export function setTheme (name?: VxeGlobalThemeName) {
|
|
7
|
+
const theme = !name || name === 'default' ? 'light' : name
|
|
8
|
+
themeConfigStore.theme = theme
|
|
9
|
+
if (typeof document !== 'undefined') {
|
|
10
|
+
const documentElement = document.documentElement
|
|
11
|
+
if (documentElement) {
|
|
12
|
+
documentElement.setAttribute('data-vxe-ui-theme', theme)
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return VxeCore
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function getTheme () {
|
|
19
|
+
return themeConfigStore.theme
|
|
20
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { VxeGlobalThemeName } from '../../types'
|
|
2
|
-
|
|
3
|
-
export const themeConfigStore: {
|
|
4
|
-
theme: VxeGlobalThemeName
|
|
5
|
-
} = {
|
|
6
|
-
theme: ''
|
|
7
|
-
}
|
|
1
|
+
import { VxeGlobalThemeName } from '../../types'
|
|
2
|
+
|
|
3
|
+
export const themeConfigStore: {
|
|
4
|
+
theme: VxeGlobalThemeName
|
|
5
|
+
} = {
|
|
6
|
+
theme: ''
|
|
7
|
+
}
|
package/packages/src/useFns.ts
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { computed, inject, provide, ComputedRef } from 'vue'
|
|
2
|
-
import { handleCheckInfo } from './permission'
|
|
3
|
-
|
|
4
|
-
import type { VxeComponentSizeType, VxeComponentPermissionCodeType, VxeComponentPermissionMethod } from '../../types'
|
|
5
|
-
|
|
6
|
-
export function useSize (props: {
|
|
7
|
-
size?: VxeComponentSizeType
|
|
8
|
-
}) {
|
|
9
|
-
// 组件尺寸上下文
|
|
10
|
-
const xeSizeInfo = inject('xeSizeInfo', null as ComputedRef<VxeComponentSizeType> | null)
|
|
11
|
-
const computeSize = computed(() => {
|
|
12
|
-
return props.size || (xeSizeInfo ? xeSizeInfo.value : null)
|
|
13
|
-
})
|
|
14
|
-
provide('xeSizeInfo', computeSize)
|
|
15
|
-
|
|
16
|
-
return { computeSize }
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function usePermission (props: {
|
|
20
|
-
permissionCode?: VxeComponentPermissionCodeType
|
|
21
|
-
permissionMethod?: VxeComponentPermissionMethod
|
|
22
|
-
}) {
|
|
23
|
-
const computePermissionInfo = computed(() => {
|
|
24
|
-
return handleCheckInfo(props.permissionCode, props.permissionMethod)
|
|
25
|
-
})
|
|
26
|
-
return {
|
|
27
|
-
computePermissionInfo
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export const useFns = {
|
|
32
|
-
useSize,
|
|
33
|
-
usePermission
|
|
34
|
-
}
|
|
1
|
+
import { computed, inject, provide, ComputedRef } from 'vue'
|
|
2
|
+
import { handleCheckInfo } from './permission'
|
|
3
|
+
|
|
4
|
+
import type { VxeComponentSizeType, VxeComponentPermissionCodeType, VxeComponentPermissionMethod } from '../../types'
|
|
5
|
+
|
|
6
|
+
export function useSize (props: {
|
|
7
|
+
size?: VxeComponentSizeType
|
|
8
|
+
}) {
|
|
9
|
+
// 组件尺寸上下文
|
|
10
|
+
const xeSizeInfo = inject('xeSizeInfo', null as ComputedRef<VxeComponentSizeType> | null)
|
|
11
|
+
const computeSize = computed(() => {
|
|
12
|
+
return props.size || (xeSizeInfo ? xeSizeInfo.value : null)
|
|
13
|
+
})
|
|
14
|
+
provide('xeSizeInfo', computeSize)
|
|
15
|
+
|
|
16
|
+
return { computeSize }
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function usePermission (props: {
|
|
20
|
+
permissionCode?: VxeComponentPermissionCodeType
|
|
21
|
+
permissionMethod?: VxeComponentPermissionMethod
|
|
22
|
+
}) {
|
|
23
|
+
const computePermissionInfo = computed(() => {
|
|
24
|
+
return handleCheckInfo(props.permissionCode, props.permissionMethod)
|
|
25
|
+
})
|
|
26
|
+
return {
|
|
27
|
+
computePermissionInfo
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const useFns = {
|
|
32
|
+
useSize,
|
|
33
|
+
usePermission
|
|
34
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import VXEStore from './store'
|
|
2
|
-
|
|
3
|
-
import { VxeGlobalValidators } from '../../types'
|
|
4
|
-
|
|
5
|
-
export const validators = new VXEStore() as VxeGlobalValidators
|
|
6
|
-
|
|
7
|
-
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
8
|
-
Object.assign(validators, { _name: 'Validators' })
|
|
9
|
-
}
|
|
1
|
+
import VXEStore from './store'
|
|
2
|
+
|
|
3
|
+
import { VxeGlobalValidators } from '../../types'
|
|
4
|
+
|
|
5
|
+
export const validators = new VXEStore() as VxeGlobalValidators
|
|
6
|
+
|
|
7
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
8
|
+
Object.assign(validators, { _name: 'Validators' })
|
|
9
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
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
|
-
copy(content: string | number | VxeGlobalClipboardCopyObj): boolean
|
|
13
|
-
}
|
|
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
|
+
copy(content: string | number | VxeGlobalClipboardCopyObj): boolean
|
|
13
|
+
}
|
package/types/core/commands.d.ts
CHANGED
|
@@ -1,19 +1,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: {
|
|
12
|
-
[name: string]: VxeGlobalCommandsHandles.CommandsOptions | ((params: any, ...args: any[]) => void)
|
|
13
|
-
}): VxeGlobalCommands
|
|
14
|
-
has(name: string): boolean
|
|
15
|
-
get(name: string): VxeGlobalCommandsHandles.CommandsOptions
|
|
16
|
-
add(name: string, options: VxeGlobalCommandsHandles.CommandsOptions | ((params: any, ...args: any[]) => void)): VxeGlobalCommands
|
|
17
|
-
delete(name: string): void
|
|
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: {
|
|
12
|
+
[name: string]: VxeGlobalCommandsHandles.CommandsOptions | ((params: any, ...args: any[]) => void)
|
|
13
|
+
}): VxeGlobalCommands
|
|
14
|
+
has(name: string): boolean
|
|
15
|
+
get(name: string): VxeGlobalCommandsHandles.CommandsOptions
|
|
16
|
+
add(name: string, options: VxeGlobalCommandsHandles.CommandsOptions | ((params: any, ...args: any[]) => void)): VxeGlobalCommands
|
|
17
|
+
delete(name: string): void
|
|
18
|
+
forEach(callback: (options: VxeGlobalCommandsHandles.CommandsOptions, name: string) => void): void
|
|
19
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export interface VxeGlobalComponents {}
|
|
2
|
-
|
|
3
|
-
export type VxeGlobalComponentMethod = (comp: any) => void
|
|
4
|
-
export type VxeGlobalGetComponentMethod = <T = any>(name: keyof VxeGlobalComponents) => T
|
|
1
|
+
export interface VxeGlobalComponents {}
|
|
2
|
+
|
|
3
|
+
export type VxeGlobalComponentMethod = (comp: any) => void
|
|
4
|
+
export type VxeGlobalGetComponentMethod = <T = any>(name: keyof VxeGlobalComponents) => T
|
package/types/core/formats.d.ts
CHANGED
|
@@ -1,19 +1,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: {
|
|
12
|
-
[name: string]: VxeGlobalFormatsHandles.FormatsOptions | ((params: any, ...args: any[]) => string | number)
|
|
13
|
-
}): VxeGlobalFormats
|
|
14
|
-
has(name: string): boolean
|
|
15
|
-
get(name: string): VxeGlobalFormatsHandles.FormatsOptions
|
|
16
|
-
add(name: string, options: VxeGlobalFormatsHandles.FormatsOptions | ((params: any, ...args: any[]) => string | number)): VxeGlobalFormats
|
|
17
|
-
delete(name: string): void
|
|
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: {
|
|
12
|
+
[name: string]: VxeGlobalFormatsHandles.FormatsOptions | ((params: any, ...args: any[]) => string | number)
|
|
13
|
+
}): VxeGlobalFormats
|
|
14
|
+
has(name: string): boolean
|
|
15
|
+
get(name: string): VxeGlobalFormatsHandles.FormatsOptions
|
|
16
|
+
add(name: string, options: VxeGlobalFormatsHandles.FormatsOptions | ((params: any, ...args: any[]) => string | number)): VxeGlobalFormats
|
|
17
|
+
delete(name: string): void
|
|
18
|
+
forEach(callback: (options: VxeGlobalFormatsHandles.FormatsOptions, name: string) => void): void
|
|
19
|
+
}
|
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
import { VxeComponentSizeType } 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
|
-
status: boolean
|
|
22
|
-
code: number
|
|
23
|
-
msg: string
|
|
24
|
-
}): void
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* 权限码全局判断方法
|
|
28
|
-
*/
|
|
29
|
-
permissionMethod?:(params: {
|
|
30
|
-
code: VxeComponentPermissionCodeType
|
|
31
|
-
}) => VxeComponentPermissionResult
|
|
32
|
-
/**
|
|
33
|
-
* 全局默认 z-index
|
|
34
|
-
*/
|
|
35
|
-
zIndex?: number
|
|
36
|
-
/**
|
|
37
|
-
* 全局组件尺寸
|
|
38
|
-
*/
|
|
39
|
-
size?: VxeComponentSizeType
|
|
40
|
-
version?: string | number
|
|
41
|
-
resizeInterval?: number
|
|
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
|
-
* 已废弃,请使用 setTheme('dark')
|
|
59
|
-
* @deprecated
|
|
60
|
-
*/
|
|
61
|
-
theme?: VxeGlobalThemeName
|
|
62
|
-
}
|
|
1
|
+
import { VxeComponentSizeType } 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
|
+
status: boolean
|
|
22
|
+
code: number
|
|
23
|
+
msg: string
|
|
24
|
+
}): void
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* 权限码全局判断方法
|
|
28
|
+
*/
|
|
29
|
+
permissionMethod?:(params: {
|
|
30
|
+
code: VxeComponentPermissionCodeType
|
|
31
|
+
}) => VxeComponentPermissionResult
|
|
32
|
+
/**
|
|
33
|
+
* 全局默认 z-index
|
|
34
|
+
*/
|
|
35
|
+
zIndex?: number
|
|
36
|
+
/**
|
|
37
|
+
* 全局组件尺寸
|
|
38
|
+
*/
|
|
39
|
+
size?: VxeComponentSizeType
|
|
40
|
+
version?: string | number
|
|
41
|
+
resizeInterval?: number
|
|
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
|
+
* 已废弃,请使用 setTheme('dark')
|
|
59
|
+
* @deprecated
|
|
60
|
+
*/
|
|
61
|
+
theme?: VxeGlobalThemeName
|
|
62
|
+
}
|
|
@@ -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,39 +1,39 @@
|
|
|
1
|
-
import { VxeComponentBaseOptions, VxeComponentEvent } from '../tool'
|
|
2
|
-
|
|
3
|
-
export type VxeGlobalEventType = 'copy' | 'cut' | 'paste' | 'keydown' | 'contextmenu' | 'mousedown' | 'blur' | 'resize' | 'mousewheel'
|
|
4
|
-
|
|
5
|
-
export type VxeGlobalEventKey = {
|
|
6
|
-
F2: 'F2'
|
|
7
|
-
ESCAPE: 'Escape'
|
|
8
|
-
ENTER: 'Enter'
|
|
9
|
-
TAB: 'Tab'
|
|
10
|
-
DELETE: 'Delete'
|
|
11
|
-
BACKSPACE: 'Backspace'
|
|
12
|
-
SPACEBAR: ' '
|
|
13
|
-
CONTEXT_MENU: 'ContextMenu'
|
|
14
|
-
ARROW_UP: 'ArrowUp'
|
|
15
|
-
ARROW_DOWN: 'ArrowDown'
|
|
16
|
-
ARROW_LEFT: 'ArrowLeft'
|
|
17
|
-
ARROW_RIGHT: 'ArrowRight'
|
|
18
|
-
PAGE_UP: 'PageUp'
|
|
19
|
-
PAGE_DOWN: 'PageDown'
|
|
20
|
-
R: 'R'
|
|
21
|
-
P: 'P'
|
|
22
|
-
Z: 'Z'
|
|
23
|
-
X: 'X'
|
|
24
|
-
C: 'C'
|
|
25
|
-
V: 'V'
|
|
26
|
-
M: 'M'
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export const GLOBAL_EVENT_KEYS: VxeGlobalEventKey
|
|
30
|
-
|
|
31
|
-
export type VxeGlobalCreateEventMethod = (evnt: Event | null, params1: any, params2?: any) => VxeComponentEvent
|
|
32
|
-
|
|
33
|
-
export const createEvent: VxeGlobalCreateEventMethod
|
|
34
|
-
|
|
35
|
-
export interface VxeGlobalEvents {
|
|
36
|
-
on (comp: VxeComponentBaseOptions, type: VxeGlobalEventType, cb: (evnt: any) => void): void
|
|
37
|
-
off (comp: VxeComponentBaseOptions, type: VxeGlobalEventType): void
|
|
38
|
-
hasKey(evnt: KeyboardEvent, targetKey: string): boolean,
|
|
39
|
-
}
|
|
1
|
+
import { VxeComponentBaseOptions, VxeComponentEvent } from '../tool'
|
|
2
|
+
|
|
3
|
+
export type VxeGlobalEventType = 'copy' | 'cut' | 'paste' | 'keydown' | 'contextmenu' | 'mousedown' | 'blur' | 'resize' | 'mousewheel'
|
|
4
|
+
|
|
5
|
+
export type VxeGlobalEventKey = {
|
|
6
|
+
F2: 'F2'
|
|
7
|
+
ESCAPE: 'Escape'
|
|
8
|
+
ENTER: 'Enter'
|
|
9
|
+
TAB: 'Tab'
|
|
10
|
+
DELETE: 'Delete'
|
|
11
|
+
BACKSPACE: 'Backspace'
|
|
12
|
+
SPACEBAR: ' '
|
|
13
|
+
CONTEXT_MENU: 'ContextMenu'
|
|
14
|
+
ARROW_UP: 'ArrowUp'
|
|
15
|
+
ARROW_DOWN: 'ArrowDown'
|
|
16
|
+
ARROW_LEFT: 'ArrowLeft'
|
|
17
|
+
ARROW_RIGHT: 'ArrowRight'
|
|
18
|
+
PAGE_UP: 'PageUp'
|
|
19
|
+
PAGE_DOWN: 'PageDown'
|
|
20
|
+
R: 'R'
|
|
21
|
+
P: 'P'
|
|
22
|
+
Z: 'Z'
|
|
23
|
+
X: 'X'
|
|
24
|
+
C: 'C'
|
|
25
|
+
V: 'V'
|
|
26
|
+
M: 'M'
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const GLOBAL_EVENT_KEYS: VxeGlobalEventKey
|
|
30
|
+
|
|
31
|
+
export type VxeGlobalCreateEventMethod = (evnt: Event | null, params1: any, params2?: any) => VxeComponentEvent
|
|
32
|
+
|
|
33
|
+
export const createEvent: VxeGlobalCreateEventMethod
|
|
34
|
+
|
|
35
|
+
export interface VxeGlobalEvents {
|
|
36
|
+
on (comp: VxeComponentBaseOptions, type: VxeGlobalEventType, cb: (evnt: any) => void): void
|
|
37
|
+
off (comp: VxeComponentBaseOptions, type: VxeGlobalEventType): void
|
|
38
|
+
hasKey(evnt: KeyboardEvent, targetKey: string): boolean,
|
|
39
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 全局图标参数
|
|
3
|
-
*/
|
|
4
|
-
export interface VxeGlobalIcon {
|
|
5
|
-
LOGO?: string
|
|
6
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* 全局图标参数
|
|
3
|
+
*/
|
|
4
|
+
export interface VxeGlobalIcon {
|
|
5
|
+
LOGO?: string
|
|
6
|
+
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
export type VxeGlobalI18nLocale = '' |
|
|
2
|
-
'zh-CN' | // 中文(简体)
|
|
3
|
-
'zh-CHT' | // 中文(繁体)
|
|
4
|
-
'zh-HK' | // 中文(香港)
|
|
5
|
-
'zh-MO' | // 中文(澳门)
|
|
6
|
-
'zh-TW' | // 中文(繁体)
|
|
7
|
-
'zh-TC' | // !!!已废弃!!!
|
|
8
|
-
'en-US' | // 英语(美国)
|
|
9
|
-
'ja-JP' | // 日语
|
|
10
|
-
'es-ES' | // 西班牙语(国际)
|
|
11
|
-
'pt-BR' | // 葡萄牙语
|
|
12
|
-
'vi-VN' | // 越南语
|
|
13
|
-
'ru-RU' | // 俄语
|
|
14
|
-
'ko-KR' | // 朝鲜语
|
|
15
|
-
'hu-HU' | // 匈牙利语
|
|
16
|
-
'ug-CN' | // 维吾尔语
|
|
17
|
-
'uz-UZ' | // 乌兹别克语(西里尔文)
|
|
18
|
-
'nb-NO' | // 挪威语(伯克梅尔)(挪威)
|
|
19
|
-
'hy-AM' | // 亚美尼亚语
|
|
20
|
-
'fr-FR' | // 法语(法国)
|
|
21
|
-
'de-DE' | // 德语(德国)
|
|
22
|
-
'ar-EG' // 阿拉伯语(埃及)
|
|
1
|
+
export type VxeGlobalI18nLocale = '' |
|
|
2
|
+
'zh-CN' | // 中文(简体)
|
|
3
|
+
'zh-CHT' | // 中文(繁体)
|
|
4
|
+
'zh-HK' | // 中文(香港)
|
|
5
|
+
'zh-MO' | // 中文(澳门)
|
|
6
|
+
'zh-TW' | // 中文(繁体)
|
|
7
|
+
'zh-TC' | // !!!已废弃!!!
|
|
8
|
+
'en-US' | // 英语(美国)
|
|
9
|
+
'ja-JP' | // 日语
|
|
10
|
+
'es-ES' | // 西班牙语(国际)
|
|
11
|
+
'pt-BR' | // 葡萄牙语
|
|
12
|
+
'vi-VN' | // 越南语
|
|
13
|
+
'ru-RU' | // 俄语
|
|
14
|
+
'ko-KR' | // 朝鲜语
|
|
15
|
+
'hu-HU' | // 匈牙利语
|
|
16
|
+
'ug-CN' | // 维吾尔语
|
|
17
|
+
'uz-UZ' | // 乌兹别克语(西里尔文)
|
|
18
|
+
'nb-NO' | // 挪威语(伯克梅尔)(挪威)
|
|
19
|
+
'hy-AM' | // 亚美尼亚语
|
|
20
|
+
'fr-FR' | // 法语(法国)
|
|
21
|
+
'de-DE' | // 德语(德国)
|
|
22
|
+
'ar-EG' // 阿拉伯语(埃及)
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export interface VxeGlobalResize {
|
|
2
|
-
create (callback: (...args: any[]) => void): ResizeObserver
|
|
3
|
-
}
|
|
1
|
+
export interface VxeGlobalResize {
|
|
2
|
+
create (callback: (...args: any[]) => void): ResizeObserver
|
|
3
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type VxeGlobalThemeName = null | '' | 'default' | 'light' | 'dark'
|
|
1
|
+
export type VxeGlobalThemeName = null | '' | 'default' | 'light' | 'dark'
|
package/types/core/hooks.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export namespace VxeGlobalHooksHandles {
|
|
2
|
-
export interface HookOptions {}
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
export interface VxeGlobalHooks {
|
|
6
|
-
mixin(options: {
|
|
7
|
-
[type: string]: VxeGlobalHooksHandles.HookOptions
|
|
8
|
-
}): VxeGlobalHooks
|
|
9
|
-
has(type: string): boolean
|
|
10
|
-
get(type: string): VxeGlobalHooksHandles.HookOptions
|
|
11
|
-
add(type: string, options: VxeGlobalHooksHandles.HookOptions): VxeGlobalHooks
|
|
12
|
-
delete(type: string): void
|
|
13
|
-
forEach(callback: (options: VxeGlobalHooksHandles.HookOptions, type: string) => void): void
|
|
14
|
-
}
|
|
1
|
+
export namespace VxeGlobalHooksHandles {
|
|
2
|
+
export interface HookOptions {}
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export interface VxeGlobalHooks {
|
|
6
|
+
mixin(options: {
|
|
7
|
+
[type: string]: VxeGlobalHooksHandles.HookOptions
|
|
8
|
+
}): VxeGlobalHooks
|
|
9
|
+
has(type: string): boolean
|
|
10
|
+
get(type: string): VxeGlobalHooksHandles.HookOptions
|
|
11
|
+
add(type: string, options: VxeGlobalHooksHandles.HookOptions): VxeGlobalHooks
|
|
12
|
+
delete(type: string): void
|
|
13
|
+
forEach(callback: (options: VxeGlobalHooksHandles.HookOptions, type: string) => void): void
|
|
14
|
+
}
|