@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,22 +1,20 @@
|
|
|
1
|
-
/* eslint-disable no-use-before-define */
|
|
2
|
-
|
|
3
|
-
export namespace VxeGlobalInterceptorHandles {
|
|
4
|
-
export interface InterceptorOptions {
|
|
5
|
-
tableInterceptorMethod?: (params: any) => any
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export type InterceptorCallback = (params: any) => any
|
|
9
|
-
export interface InterceptorParams {}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* 全局事件拦截器
|
|
14
|
-
*/
|
|
15
|
-
export interface VxeGlobalInterceptor {
|
|
16
|
-
mixin(options: {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
delete(type: string | null | undefined, callback?: VxeGlobalInterceptorHandles.InterceptorOptions | VxeGlobalInterceptorHandles.InterceptorCallback): void
|
|
22
|
-
}
|
|
1
|
+
/* eslint-disable no-use-before-define */
|
|
2
|
+
|
|
3
|
+
export namespace VxeGlobalInterceptorHandles {
|
|
4
|
+
export interface InterceptorOptions {
|
|
5
|
+
tableInterceptorMethod?: (params: any) => any
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export type InterceptorCallback = (params: any) => any
|
|
9
|
+
export interface InterceptorParams {}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* 全局事件拦截器
|
|
14
|
+
*/
|
|
15
|
+
export interface VxeGlobalInterceptor {
|
|
16
|
+
mixin(options: { [type: string]: VxeGlobalInterceptorHandles.InterceptorOptions | VxeGlobalInterceptorHandles.InterceptorCallback }): VxeGlobalInterceptor
|
|
17
|
+
get(type: string | null | undefined): VxeGlobalInterceptorHandles.InterceptorCallback[]
|
|
18
|
+
add(type: string, callback: VxeGlobalInterceptorHandles.InterceptorOptions | VxeGlobalInterceptorHandles.InterceptorCallback): VxeGlobalInterceptor
|
|
19
|
+
delete(type: string | null | undefined, callback?: VxeGlobalInterceptorHandles.InterceptorOptions | VxeGlobalInterceptorHandles.InterceptorCallback): void
|
|
20
|
+
}
|
package/types/core/log.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export function warnLog(): string
|
|
2
|
-
export function errLog(): string
|
|
3
|
-
|
|
4
|
-
export interface VxeGlobalLog {
|
|
5
|
-
create
|
|
6
|
-
warn(key: string, args?: any): string
|
|
7
|
-
err(key: string, args?: any): string
|
|
8
|
-
}
|
|
1
|
+
export function warnLog(): string
|
|
2
|
+
export function errLog(): string
|
|
3
|
+
|
|
4
|
+
export interface VxeGlobalLog {
|
|
5
|
+
create(type: 'log' | 'warn' | 'error', name?: string): (key: string, args?: any) => string
|
|
6
|
+
warn(key: string, args?: any): string
|
|
7
|
+
err(key: string, args?: any): string
|
|
8
|
+
}
|
package/types/core/menus.d.ts
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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: { [code: string]: VxeGlobalMenusHandles.MenusOption | ((params: any, event: Event) => any) }): VxeGlobalMenus
|
|
12
|
+
has(code: string | null | undefined): boolean
|
|
13
|
+
get(code: string | null | undefined): VxeGlobalMenusHandles.MenusOption
|
|
14
|
+
add(code: string, options: VxeGlobalMenusHandles.MenusOption | ((params: any, event: Event) => any)): VxeGlobalMenus
|
|
15
|
+
delete(code: string | null | undefined): void
|
|
16
|
+
forEach(callback: (options: VxeGlobalMenusHandles.MenusOption, code: string) => void): void
|
|
17
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { VxeComponentPermissionCodeType, VxeComponentPermissionInfo } from '../tool'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 全局权限控制
|
|
5
|
-
*/
|
|
6
|
-
export interface VxeGlobalPermission {
|
|
7
|
-
getCheckInfo
|
|
8
|
-
checkVisible
|
|
9
|
-
checkDisable
|
|
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,44 +1,44 @@
|
|
|
1
|
-
export interface VxePopperOptions {
|
|
2
|
-
defaultTop?: number
|
|
3
|
-
defaultLeft?: number
|
|
4
|
-
placement?: '' | 'top' | 'bottom' | null
|
|
5
|
-
defaultPlacement?: '' | 'top' | 'bottom' | null
|
|
6
|
-
appendTo?: string | HTMLElement | ((params: any) => string | HTMLElement)
|
|
7
|
-
teleportTo?: boolean
|
|
8
|
-
marginSize?: number
|
|
9
|
-
isMinWidth?: boolean
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface VxePopperPlacementResult {
|
|
13
|
-
top: number
|
|
14
|
-
bottom: number
|
|
15
|
-
left: number
|
|
16
|
-
arrowLeft: number
|
|
17
|
-
style: Record<string, string>
|
|
18
|
-
placement: 'top' | 'bottom'
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface VxePopperUtils {
|
|
22
|
-
/**
|
|
23
|
-
* 更新位置
|
|
24
|
-
* @param targetElem
|
|
25
|
-
* @param panelElem
|
|
26
|
-
* @param options
|
|
27
|
-
*/
|
|
28
|
-
updatePlacement
|
|
29
|
-
/**
|
|
30
|
-
* 获取包裹容器的元素
|
|
31
|
-
* @param panelElem
|
|
32
|
-
*/
|
|
33
|
-
getWrapperElement
|
|
34
|
-
/**
|
|
35
|
-
* 获取插入到指定容器的元素或字符串
|
|
36
|
-
* @param appendTo
|
|
37
|
-
*/
|
|
38
|
-
getAppendSelector
|
|
39
|
-
/**
|
|
40
|
-
* 获取插入到指定容器的元素
|
|
41
|
-
* @param appendTo
|
|
42
|
-
*/
|
|
43
|
-
getAppendElement
|
|
44
|
-
}
|
|
1
|
+
export interface VxePopperOptions {
|
|
2
|
+
defaultTop?: number
|
|
3
|
+
defaultLeft?: number
|
|
4
|
+
placement?: '' | 'top' | 'bottom' | null
|
|
5
|
+
defaultPlacement?: '' | 'top' | 'bottom' | null
|
|
6
|
+
appendTo?: string | HTMLElement | ((params: any) => string | HTMLElement)
|
|
7
|
+
teleportTo?: boolean
|
|
8
|
+
marginSize?: number
|
|
9
|
+
isMinWidth?: boolean
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface VxePopperPlacementResult {
|
|
13
|
+
top: number
|
|
14
|
+
bottom: number
|
|
15
|
+
left: number
|
|
16
|
+
arrowLeft: number
|
|
17
|
+
style: Record<string, string>
|
|
18
|
+
placement: 'top' | 'bottom'
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface VxePopperUtils {
|
|
22
|
+
/**
|
|
23
|
+
* 更新位置
|
|
24
|
+
* @param targetElem
|
|
25
|
+
* @param panelElem
|
|
26
|
+
* @param options
|
|
27
|
+
*/
|
|
28
|
+
updatePlacement(targetElem: HTMLElement | null | undefined, panelElem: HTMLElement | null | undefined, options: VxePopperOptions): VxePopperPlacementResult
|
|
29
|
+
/**
|
|
30
|
+
* 获取包裹容器的元素
|
|
31
|
+
* @param panelElem
|
|
32
|
+
*/
|
|
33
|
+
getWrapperElement(panelElem: HTMLElement | null | undefined): HTMLElement | null
|
|
34
|
+
/**
|
|
35
|
+
* 获取插入到指定容器的元素或字符串
|
|
36
|
+
* @param appendTo
|
|
37
|
+
*/
|
|
38
|
+
getAppendSelector(appendTo: string | HTMLElement | ((params: any) => string | HTMLElement) | undefined): HTMLElement | string
|
|
39
|
+
/**
|
|
40
|
+
* 获取插入到指定容器的元素
|
|
41
|
+
* @param appendTo
|
|
42
|
+
*/
|
|
43
|
+
getAppendElement(appendTo: string | HTMLElement | ((params: any) => string | HTMLElement) | undefined): HTMLElement | null
|
|
44
|
+
}
|
package/types/core/renderer.d.ts
CHANGED
|
@@ -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,38 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
* @param
|
|
6
|
-
* @param
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
*
|
|
12
|
-
* @param
|
|
13
|
-
* @param
|
|
14
|
-
* @param
|
|
15
|
-
* @param
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
*
|
|
21
|
-
* @param
|
|
22
|
-
* @param
|
|
23
|
-
* @param
|
|
24
|
-
* @param
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
*
|
|
30
|
-
* @param
|
|
31
|
-
* @param
|
|
32
|
-
* @param
|
|
33
|
-
* @param
|
|
34
|
-
* @param
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
1
|
+
export interface VxeScrollbarUtils {
|
|
2
|
+
/**
|
|
3
|
+
* 计算滚动条滑块的长度
|
|
4
|
+
* @param viewportSize
|
|
5
|
+
* @param contentSize
|
|
6
|
+
* @param trackSize
|
|
7
|
+
*/
|
|
8
|
+
getThumbSize(viewportSize: number, contentSize: number, trackSize: number): number
|
|
9
|
+
/**
|
|
10
|
+
* 计算滚动条滑块的偏移位置
|
|
11
|
+
* @param offsetSize
|
|
12
|
+
* @param viewportSize
|
|
13
|
+
* @param contentSize
|
|
14
|
+
* @param trackSize
|
|
15
|
+
* @param thumbSize
|
|
16
|
+
*/
|
|
17
|
+
getThumbOffsetSize(offsetSize: number, viewportSize: number, contentSize: number, trackSize: number, thumbSize: number): number
|
|
18
|
+
/**
|
|
19
|
+
* 根据点击轨道的位置,计算滑块的偏移位置
|
|
20
|
+
* @param clickPosition
|
|
21
|
+
* @param viewportSize
|
|
22
|
+
* @param contentSize
|
|
23
|
+
* @param trackSize
|
|
24
|
+
* @param thumbSize
|
|
25
|
+
*/
|
|
26
|
+
getScrollFromClick(clickPosition: number, viewportSize: number, contentSize: number, trackSize: number, thumbSize: number): number
|
|
27
|
+
/**
|
|
28
|
+
* 拖拽 thumb 时,根据鼠标位置计算滑块的偏移位置
|
|
29
|
+
* @param pointerPosition
|
|
30
|
+
* @param dragOffset
|
|
31
|
+
* @param viewportSize
|
|
32
|
+
* @param contentSize
|
|
33
|
+
* @param trackSize
|
|
34
|
+
* @param thumbSize
|
|
35
|
+
*/
|
|
36
|
+
getScrollFromDrag(pointerPosition: number, dragOffset: number, viewportSize: number, contentSize: number, trackSize: number, thumbSize: number): number
|
|
37
|
+
}
|
package/types/core/useFn.d.ts
CHANGED
|
@@ -1,126 +1,121 @@
|
|
|
1
|
-
import { ComputedRef, Ref } from 'vue'
|
|
2
|
-
import { VxeComponentBaseOptions } from '../tool/common'
|
|
3
|
-
import { VxeComponentSizeType, VxeComponentIsVScrollbar, VxeComponentPermissionCodeType, VxeComponentPermissionMethod, VxeComponentPermissionInfo } from '../tool'
|
|
4
|
-
|
|
5
|
-
export interface VxeUseSizeResult {
|
|
6
|
-
computeSize: ComputedRef<VxeComponentSizeType>
|
|
7
|
-
}
|
|
8
|
-
export type VxeUseSize = (props: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
export
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
export
|
|
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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
*
|
|
115
|
-
*/
|
|
116
|
-
export
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
useSize: VxeUseSize
|
|
123
|
-
useVScrollbar: VxeUseVScrollbar
|
|
124
|
-
usePermission: VxeUsePermission
|
|
125
|
-
useInitVScrollbar: VxeUseInitVScrollbar
|
|
126
|
-
}
|
|
1
|
+
import { ComputedRef, Ref } from 'vue'
|
|
2
|
+
import { VxeComponentBaseOptions } from '../tool/common'
|
|
3
|
+
import { VxeComponentSizeType, VxeComponentIsVScrollbar, VxeComponentPermissionCodeType, VxeComponentPermissionMethod, VxeComponentPermissionInfo } from '../tool'
|
|
4
|
+
|
|
5
|
+
export interface VxeUseSizeResult {
|
|
6
|
+
computeSize: ComputedRef<VxeComponentSizeType>
|
|
7
|
+
}
|
|
8
|
+
export type VxeUseSize = (props: { size?: VxeComponentSizeType }) => VxeUseSizeResult
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* 组件尺寸上下文
|
|
12
|
+
*/
|
|
13
|
+
export const useSize: VxeUseSize
|
|
14
|
+
|
|
15
|
+
export interface VxeUsePermissionResult {
|
|
16
|
+
computePermissionInfo: ComputedRef<VxeComponentPermissionInfo>
|
|
17
|
+
}
|
|
18
|
+
export type VxeUsePermission = (props: { permissionCode?: VxeComponentPermissionCodeType; permissionMethod?: VxeComponentPermissionMethod }) => VxeUsePermissionResult
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* 权限码处理
|
|
22
|
+
*/
|
|
23
|
+
export const usePermission: VxeUsePermission
|
|
24
|
+
|
|
25
|
+
export interface VxeUseVScrollbarResult {
|
|
26
|
+
computeIsVScrollbar: ComputedRef<VxeComponentIsVScrollbar>
|
|
27
|
+
}
|
|
28
|
+
export type VxeUseVScrollbar = (props: { useScrollbar?: VxeComponentIsVScrollbar }) => VxeUseVScrollbarResult
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* 虚拟滚动条是否启用
|
|
32
|
+
*/
|
|
33
|
+
export const useVScrollbar: VxeUseVScrollbar
|
|
34
|
+
|
|
35
|
+
export interface VxeUseInitVScrollbarReactData {
|
|
36
|
+
yThumbHeight: number
|
|
37
|
+
xThumbWidth: number
|
|
38
|
+
}
|
|
39
|
+
export interface VxeUseInitVScrollbarInternalData {
|
|
40
|
+
scrollObserver?: ResizeObserver
|
|
41
|
+
isThumbDrag?: boolean
|
|
42
|
+
thumbDragOffset: number
|
|
43
|
+
yThumbTop: number
|
|
44
|
+
xThumbLeft: number
|
|
45
|
+
lastScrollTop: number
|
|
46
|
+
lastScrollLeft: number
|
|
47
|
+
}
|
|
48
|
+
export interface VxeUseInitVScrollbarResult {
|
|
49
|
+
/**
|
|
50
|
+
* 内部方法
|
|
51
|
+
* @private
|
|
52
|
+
*/
|
|
53
|
+
updateThumbSize(): void
|
|
54
|
+
/**
|
|
55
|
+
* 内部方法
|
|
56
|
+
* @private
|
|
57
|
+
*/
|
|
58
|
+
updateThumbOffset(): void
|
|
59
|
+
/**
|
|
60
|
+
* 内部方法
|
|
61
|
+
* @private
|
|
62
|
+
*/
|
|
63
|
+
clickTrackXEvent(evnt: MouseEvent): void
|
|
64
|
+
/**
|
|
65
|
+
* 内部方法
|
|
66
|
+
* @private
|
|
67
|
+
*/
|
|
68
|
+
clickTrackYEvent(evnt: MouseEvent): void
|
|
69
|
+
/**
|
|
70
|
+
* 内部方法
|
|
71
|
+
* @private
|
|
72
|
+
*/
|
|
73
|
+
pointerdownThumbXEvent(evnt: PointerEvent): void
|
|
74
|
+
/**
|
|
75
|
+
* 内部方法
|
|
76
|
+
* @private
|
|
77
|
+
*/
|
|
78
|
+
pointermoveThumbXEvent(evnt: PointerEvent): void
|
|
79
|
+
/**
|
|
80
|
+
* 内部方法
|
|
81
|
+
* @private
|
|
82
|
+
*/
|
|
83
|
+
cleatPointerThumbEvent(evnt: PointerEvent): void
|
|
84
|
+
/**
|
|
85
|
+
* 内部方法
|
|
86
|
+
* @private
|
|
87
|
+
*/
|
|
88
|
+
pointerdownThumbYEvent(evnt: PointerEvent): void
|
|
89
|
+
/**
|
|
90
|
+
* 内部方法
|
|
91
|
+
* @private
|
|
92
|
+
*/
|
|
93
|
+
pointermoveThumbYEvent(evnt: PointerEvent): void
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export type VxeUseInitVScrollbar = (
|
|
97
|
+
$xeVM: VxeComponentBaseOptions & {
|
|
98
|
+
reactData: VxeUseInitVScrollbarReactData
|
|
99
|
+
internalData: VxeUseInitVScrollbarInternalData
|
|
100
|
+
getScrollViewElem(): HTMLElement | null | undefined
|
|
101
|
+
}
|
|
102
|
+
) => VxeUseInitVScrollbarResult & {
|
|
103
|
+
refTrackXElem: Ref<HTMLDivElement | undefined>
|
|
104
|
+
refTrackYElem: Ref<HTMLDivElement | undefined>
|
|
105
|
+
refThumbXElem: Ref<HTMLDivElement | undefined>
|
|
106
|
+
refThumbYElem: Ref<HTMLDivElement | undefined>
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* 初始化虚拟滚动条
|
|
110
|
+
*/
|
|
111
|
+
export const useInitVScrollbar: VxeUseInitVScrollbar
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* 通用方法
|
|
115
|
+
*/
|
|
116
|
+
export interface VxeGlobalUseFns {
|
|
117
|
+
useSize: VxeUseSize
|
|
118
|
+
useVScrollbar: VxeUseVScrollbar
|
|
119
|
+
usePermission: VxeUsePermission
|
|
120
|
+
useInitVScrollbar: VxeUseInitVScrollbar
|
|
121
|
+
}
|
|
@@ -1,19 +1,17 @@
|
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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: { [code: string]: VxeGlobalValidatorsHandles.ValidatorsOptions }): VxeGlobalValidators
|
|
12
|
+
has(code: string): boolean
|
|
13
|
+
get(code: string): VxeGlobalValidatorsHandles.ValidatorsOptions
|
|
14
|
+
add(code: string, callback: VxeGlobalValidatorsHandles.ValidatorsOptions): VxeGlobalValidators
|
|
15
|
+
delete(code: string): void
|
|
16
|
+
forEach(callback: (options: VxeGlobalValidatorsHandles.ValidatorsOptions, code: string) => void): void
|
|
17
|
+
}
|
package/types/core/z-index.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export interface VxeZIndex {
|
|
2
|
-
/**
|
|
3
|
-
* 获取主层级下一个 z-index
|
|
4
|
-
*/
|
|
5
|
-
next
|
|
6
|
-
/**
|
|
7
|
-
* 获取主层级最后一个 z-index
|
|
8
|
-
*/
|
|
9
|
-
getLast
|
|
10
|
-
/**
|
|
11
|
-
* 获取子层级下一个 z-index
|
|
12
|
-
*/
|
|
13
|
-
nextSub
|
|
14
|
-
/**
|
|
15
|
-
* 获取子层级最后一个 z-index
|
|
16
|
-
*/
|
|
17
|
-
getSubLast
|
|
18
|
-
}
|
|
1
|
+
export interface VxeZIndex {
|
|
2
|
+
/**
|
|
3
|
+
* 获取主层级下一个 z-index
|
|
4
|
+
*/
|
|
5
|
+
next(): number
|
|
6
|
+
/**
|
|
7
|
+
* 获取主层级最后一个 z-index
|
|
8
|
+
*/
|
|
9
|
+
getLast(): number
|
|
10
|
+
/**
|
|
11
|
+
* 获取子层级下一个 z-index
|
|
12
|
+
*/
|
|
13
|
+
nextSub(): number
|
|
14
|
+
/**
|
|
15
|
+
* 获取子层级最后一个 z-index
|
|
16
|
+
*/
|
|
17
|
+
getSubLast(): number
|
|
18
|
+
}
|