@vxe-ui/core 1.0.12 → 3.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +29 -31
- package/es/src/core.js +4 -4
- package/es/src/i18nStore.js +2 -3
- package/es/src/log.js +1 -1
- package/es/src/mixins.js +35 -0
- package/es/src/permission.js +36 -14
- package/lib/index.umd.js +187 -132
- package/lib/index.umd.min.js +1 -1
- package/lib/src/core.js +6 -6
- package/lib/src/core.min.js +1 -1
- package/lib/src/i18n.min.js +1 -1
- package/lib/src/i18nStore.js +2 -3
- package/lib/src/i18nStore.min.js +1 -1
- package/lib/src/log.js +1 -1
- package/lib/src/log.min.js +1 -1
- package/lib/src/mixins.js +44 -0
- package/lib/src/mixins.min.js +1 -0
- package/lib/src/permission.js +37 -15
- package/lib/src/permission.min.js +1 -1
- package/lib/src/resize.min.js +1 -1
- package/package.json +77 -78
- package/packages/index.ts +4 -4
- package/packages/src/clipboard.ts +53 -53
- package/packages/src/commands.ts +62 -62
- package/packages/src/core.ts +167 -167
- package/packages/src/event.ts +113 -113
- package/packages/src/formats.ts +62 -62
- package/packages/src/globalStore.ts +8 -8
- package/packages/src/hooks.ts +5 -5
- package/packages/src/i18n.ts +19 -19
- package/packages/src/i18nStore.ts +9 -11
- 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/mixins.ts +38 -0
- package/packages/src/permission.ts +61 -39
- package/packages/src/renderer.ts +50 -50
- package/packages/src/resize.ts +89 -89
- package/packages/src/store.ts +49 -49
- package/packages/src/themeStore.ts +7 -7
- 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 +55 -55
- 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 +14 -1
- 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 +224 -224
- 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/mixins.d.ts +7 -0
- package/types/core/permission.d.ts +10 -10
- package/types/core/renderer.d.ts +14 -14
- package/types/core/validators.d.ts +19 -19
- package/types/index.d.ts +10 -10
- package/types/tool/common.d.ts +99 -99
- package/types/tool/index.d.ts +2 -2
- package/types/tool/util.d.ts +4 -4
- package/README.en.md +0 -31
- package/README.zh-TW.md +0 -31
- package/es/src/useFns.js +0 -23
- package/lib/src/useFns.js +0 -33
- package/lib/src/useFns.min.js +0 -1
- package/packages/src/useFns.ts +0 -34
- package/types/core/useFn.d.ts +0 -27
package/types/tool/common.d.ts
CHANGED
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 定义组件
|
|
5
|
-
*/
|
|
6
|
-
export type defineVxeComponent<
|
|
7
|
-
P = { [key: string]: any },
|
|
8
|
-
E = { [key: string]: any },
|
|
9
|
-
S = { [key: string]: (...args: any[]) => any }
|
|
10
|
-
> = ({
|
|
11
|
-
new (): {
|
|
12
|
-
$props: P & E,
|
|
13
|
-
$slots: S
|
|
14
|
-
}
|
|
15
|
-
} & {
|
|
16
|
-
install(app:
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* 组件通用的基础参数
|
|
21
|
-
*/
|
|
22
|
-
export interface VxeComponentBaseOptions {
|
|
23
|
-
xID: string
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* 组件事件参数
|
|
28
|
-
*/
|
|
29
|
-
export interface VxeComponentEventParams {
|
|
30
|
-
$event: Event
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* 全局事件默认参数
|
|
35
|
-
*/
|
|
36
|
-
export interface VxeComponentEvent<E = Event> {
|
|
37
|
-
$event: E
|
|
38
|
-
stopPropagation(): void
|
|
39
|
-
preventDefault(): void
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* 组件尺寸类型
|
|
44
|
-
*/
|
|
45
|
-
export type VxeComponentSizeType = null | '' | 'medium' | 'small' | 'mini'
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* 组件对齐方式
|
|
49
|
-
*/
|
|
50
|
-
export type VxeComponentAlignType = null | '' | 'left' | 'right' | 'center'
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* 组件状态
|
|
54
|
-
*/
|
|
55
|
-
export type VxeComponentStatusType = null | '' | 'primary' | 'success' | 'info' | 'warning' | 'danger' | 'error' | 'perfect'
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* 组件样式类型
|
|
59
|
-
*/
|
|
60
|
-
export type VxeComponentStyleType = Record<string, string | number>
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* 组件 className 类型
|
|
64
|
-
*/
|
|
65
|
-
export type VxeComponentClassNameType = Record<string, boolean>
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* 组件插槽类型
|
|
69
|
-
*/
|
|
70
|
-
export type VxeComponentSlotType = VNode | string | number
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* 权限码类型
|
|
74
|
-
*/
|
|
75
|
-
export type VxeComponentPermissionCodeType = string | number
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* 权限码判断结果
|
|
79
|
-
*/
|
|
80
|
-
export type VxeComponentPermissionResult = boolean | {
|
|
81
|
-
visible: boolean
|
|
82
|
-
disabled: boolean
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* 权限码判断方法
|
|
87
|
-
*/
|
|
88
|
-
export type VxeComponentPermissionMethod = (params: {
|
|
89
|
-
code: VxeComponentPermissionCodeType
|
|
90
|
-
}) => VxeComponentPermissionResult
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* 权限码信息
|
|
94
|
-
*/
|
|
95
|
-
export interface VxeComponentPermissionInfo {
|
|
96
|
-
code?: VxeComponentPermissionCodeType
|
|
97
|
-
visible: boolean
|
|
98
|
-
disabled: boolean
|
|
99
|
-
}
|
|
1
|
+
import { VueConstructor, VNode } from 'vue'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 定义组件
|
|
5
|
+
*/
|
|
6
|
+
export type defineVxeComponent<
|
|
7
|
+
P = { [key: string]: any },
|
|
8
|
+
E = { [key: string]: any },
|
|
9
|
+
S = { [key: string]: (...args: any[]) => any }
|
|
10
|
+
> = ({
|
|
11
|
+
new (): {
|
|
12
|
+
$props: P & E,
|
|
13
|
+
$slots: S
|
|
14
|
+
}
|
|
15
|
+
} & {
|
|
16
|
+
install(app: VueConstructor): void
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* 组件通用的基础参数
|
|
21
|
+
*/
|
|
22
|
+
export interface VxeComponentBaseOptions {
|
|
23
|
+
xID: string
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* 组件事件参数
|
|
28
|
+
*/
|
|
29
|
+
export interface VxeComponentEventParams {
|
|
30
|
+
$event: Event
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* 全局事件默认参数
|
|
35
|
+
*/
|
|
36
|
+
export interface VxeComponentEvent<E = Event> {
|
|
37
|
+
$event: E
|
|
38
|
+
stopPropagation(): void
|
|
39
|
+
preventDefault(): void
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* 组件尺寸类型
|
|
44
|
+
*/
|
|
45
|
+
export type VxeComponentSizeType = null | '' | 'medium' | 'small' | 'mini'
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* 组件对齐方式
|
|
49
|
+
*/
|
|
50
|
+
export type VxeComponentAlignType = null | '' | 'left' | 'right' | 'center'
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* 组件状态
|
|
54
|
+
*/
|
|
55
|
+
export type VxeComponentStatusType = null | '' | 'primary' | 'success' | 'info' | 'warning' | 'danger' | 'error' | 'perfect'
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* 组件样式类型
|
|
59
|
+
*/
|
|
60
|
+
export type VxeComponentStyleType = Record<string, string | number>
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* 组件 className 类型
|
|
64
|
+
*/
|
|
65
|
+
export type VxeComponentClassNameType = Record<string, boolean>
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* 组件插槽类型
|
|
69
|
+
*/
|
|
70
|
+
export type VxeComponentSlotType = VNode | string | number
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* 权限码类型
|
|
74
|
+
*/
|
|
75
|
+
export type VxeComponentPermissionCodeType = string | number
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* 权限码判断结果
|
|
79
|
+
*/
|
|
80
|
+
export type VxeComponentPermissionResult = boolean | {
|
|
81
|
+
visible: boolean
|
|
82
|
+
disabled: boolean
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* 权限码判断方法
|
|
87
|
+
*/
|
|
88
|
+
export type VxeComponentPermissionMethod = (params: {
|
|
89
|
+
code: VxeComponentPermissionCodeType
|
|
90
|
+
}) => VxeComponentPermissionResult
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* 权限码信息
|
|
94
|
+
*/
|
|
95
|
+
export interface VxeComponentPermissionInfo {
|
|
96
|
+
code?: VxeComponentPermissionCodeType
|
|
97
|
+
visible: boolean
|
|
98
|
+
disabled: boolean
|
|
99
|
+
}
|
package/types/tool/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './util'
|
|
2
|
-
export * from './common'
|
|
1
|
+
export * from './util'
|
|
2
|
+
export * from './common'
|
package/types/tool/util.d.ts
CHANGED
|
@@ -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]
|
package/README.en.md
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
# vxe-core
|
|
2
|
-
|
|
3
|
-
[简体中文](README.md) | [繁體中文](README.zh-TW.md) | English
|
|
4
|
-
|
|
5
|
-
Vxe UI core library.
|
|
6
|
-
|
|
7
|
-
## Install
|
|
8
|
-
|
|
9
|
-
```shell
|
|
10
|
-
npm install @vxe-ui/core
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
```javascript
|
|
14
|
-
// ...
|
|
15
|
-
import VxeCore from '@vxe-ui/core'
|
|
16
|
-
// ...
|
|
17
|
-
|
|
18
|
-
VxeCore.setConfig({
|
|
19
|
-
// ...
|
|
20
|
-
})
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Contributors
|
|
24
|
-
|
|
25
|
-
Thank you to everyone who contributed to this project.
|
|
26
|
-
|
|
27
|
-
[](https://github.com/x-extends/vxe-core/graphs/contributors)
|
|
28
|
-
|
|
29
|
-
## License
|
|
30
|
-
|
|
31
|
-
[MIT](LICENSE) © 2019-present, Xu Liangzhan
|
package/README.zh-TW.md
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
# vxe-core
|
|
2
|
-
|
|
3
|
-
[简体中文](README.md) | 繁體中文 | [English](README.en.md)
|
|
4
|
-
|
|
5
|
-
Vxe UI core library.
|
|
6
|
-
|
|
7
|
-
## 使用
|
|
8
|
-
|
|
9
|
-
```shell
|
|
10
|
-
npm install @vxe-ui/core
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
```javascript
|
|
14
|
-
// ...
|
|
15
|
-
import VxeCore from '@vxe-ui/core'
|
|
16
|
-
// ...
|
|
17
|
-
|
|
18
|
-
VxeCore.setConfig({
|
|
19
|
-
// ...
|
|
20
|
-
})
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Contributors
|
|
24
|
-
|
|
25
|
-
Thank you to everyone who contributed to this project.
|
|
26
|
-
|
|
27
|
-
[](https://github.com/x-extends/vxe-core/graphs/contributors)
|
|
28
|
-
|
|
29
|
-
## License
|
|
30
|
-
|
|
31
|
-
[MIT](LICENSE) © 2019-present, Xu Liangzhan
|
package/es/src/useFns.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { computed, inject, provide } from 'vue';
|
|
2
|
-
import { handleCheckInfo } from './permission';
|
|
3
|
-
export function useSize(props) {
|
|
4
|
-
// 组件尺寸上下文
|
|
5
|
-
const xeSizeInfo = inject('xeSizeInfo', null);
|
|
6
|
-
const computeSize = computed(() => {
|
|
7
|
-
return props.size || (xeSizeInfo ? xeSizeInfo.value : null);
|
|
8
|
-
});
|
|
9
|
-
provide('xeSizeInfo', computeSize);
|
|
10
|
-
return { computeSize };
|
|
11
|
-
}
|
|
12
|
-
export function usePermission(props) {
|
|
13
|
-
const computePermissionInfo = computed(() => {
|
|
14
|
-
return handleCheckInfo(props.permissionCode, props.permissionMethod);
|
|
15
|
-
});
|
|
16
|
-
return {
|
|
17
|
-
computePermissionInfo
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
export const useFns = {
|
|
21
|
-
useSize,
|
|
22
|
-
usePermission
|
|
23
|
-
};
|
package/lib/src/useFns.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.useFns = void 0;
|
|
7
|
-
exports.usePermission = usePermission;
|
|
8
|
-
exports.useSize = useSize;
|
|
9
|
-
var _vue = require("vue");
|
|
10
|
-
var _permission = require("./permission");
|
|
11
|
-
function useSize(props) {
|
|
12
|
-
// 组件尺寸上下文
|
|
13
|
-
const xeSizeInfo = (0, _vue.inject)('xeSizeInfo', null);
|
|
14
|
-
const computeSize = (0, _vue.computed)(() => {
|
|
15
|
-
return props.size || (xeSizeInfo ? xeSizeInfo.value : null);
|
|
16
|
-
});
|
|
17
|
-
(0, _vue.provide)('xeSizeInfo', computeSize);
|
|
18
|
-
return {
|
|
19
|
-
computeSize
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
function usePermission(props) {
|
|
23
|
-
const computePermissionInfo = (0, _vue.computed)(() => {
|
|
24
|
-
return (0, _permission.handleCheckInfo)(props.permissionCode, props.permissionMethod);
|
|
25
|
-
});
|
|
26
|
-
return {
|
|
27
|
-
computePermissionInfo
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
const useFns = exports.useFns = {
|
|
31
|
-
useSize,
|
|
32
|
-
usePermission
|
|
33
|
-
};
|
package/lib/src/useFns.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.useFns=void 0,exports.usePermission=usePermission,exports.useSize=useSize;var _vue=require("vue"),_permission=require("./permission");function useSize(e){let s=(0,_vue.inject)("xeSizeInfo",null);var i=(0,_vue.computed)(()=>e.size||(s?s.value:null));return(0,_vue.provide)("xeSizeInfo",i),{computeSize:i}}function usePermission(e){return{computePermissionInfo:(0,_vue.computed)(()=>(0,_permission.handleCheckInfo)(e.permissionCode,e.permissionMethod))}}let useFns=exports.useFns={useSize:useSize,usePermission:usePermission};
|
package/packages/src/useFns.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
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
|
-
}
|
package/types/core/useFn.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
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
|
-
}
|