@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.
Files changed (73) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +29 -31
  3. package/es/src/core.js +4 -4
  4. package/es/src/i18nStore.js +2 -3
  5. package/es/src/log.js +1 -1
  6. package/es/src/mixins.js +35 -0
  7. package/es/src/permission.js +36 -14
  8. package/lib/index.umd.js +187 -132
  9. package/lib/index.umd.min.js +1 -1
  10. package/lib/src/core.js +6 -6
  11. package/lib/src/core.min.js +1 -1
  12. package/lib/src/i18n.min.js +1 -1
  13. package/lib/src/i18nStore.js +2 -3
  14. package/lib/src/i18nStore.min.js +1 -1
  15. package/lib/src/log.js +1 -1
  16. package/lib/src/log.min.js +1 -1
  17. package/lib/src/mixins.js +44 -0
  18. package/lib/src/mixins.min.js +1 -0
  19. package/lib/src/permission.js +37 -15
  20. package/lib/src/permission.min.js +1 -1
  21. package/lib/src/resize.min.js +1 -1
  22. package/package.json +77 -78
  23. package/packages/index.ts +4 -4
  24. package/packages/src/clipboard.ts +53 -53
  25. package/packages/src/commands.ts +62 -62
  26. package/packages/src/core.ts +167 -167
  27. package/packages/src/event.ts +113 -113
  28. package/packages/src/formats.ts +62 -62
  29. package/packages/src/globalStore.ts +8 -8
  30. package/packages/src/hooks.ts +5 -5
  31. package/packages/src/i18n.ts +19 -19
  32. package/packages/src/i18nStore.ts +9 -11
  33. package/packages/src/iconStore.ts +3 -3
  34. package/packages/src/interceptor.ts +65 -65
  35. package/packages/src/log.ts +19 -19
  36. package/packages/src/menus.ts +62 -62
  37. package/packages/src/mixins.ts +38 -0
  38. package/packages/src/permission.ts +61 -39
  39. package/packages/src/renderer.ts +50 -50
  40. package/packages/src/resize.ts +89 -89
  41. package/packages/src/store.ts +49 -49
  42. package/packages/src/themeStore.ts +7 -7
  43. package/packages/src/validators.ts +9 -9
  44. package/types/core/clipboard.d.ts +13 -13
  45. package/types/core/commands.d.ts +19 -19
  46. package/types/core/components.d.ts +4 -4
  47. package/types/core/formats.d.ts +19 -19
  48. package/types/core/global-config.d.ts +55 -55
  49. package/types/core/global-event.d.ts +39 -39
  50. package/types/core/global-icon.d.ts +6 -6
  51. package/types/core/global-lang.d.ts +14 -1
  52. package/types/core/global-resize.d.ts +3 -3
  53. package/types/core/global-theme.d.ts +1 -1
  54. package/types/core/hooks.d.ts +14 -14
  55. package/types/core/index.d.ts +224 -224
  56. package/types/core/interceptor.d.ts +22 -22
  57. package/types/core/log.d.ts +8 -8
  58. package/types/core/menus.d.ts +19 -19
  59. package/types/core/mixins.d.ts +7 -0
  60. package/types/core/permission.d.ts +10 -10
  61. package/types/core/renderer.d.ts +14 -14
  62. package/types/core/validators.d.ts +19 -19
  63. package/types/index.d.ts +10 -10
  64. package/types/tool/common.d.ts +99 -99
  65. package/types/tool/index.d.ts +2 -2
  66. package/types/tool/util.d.ts +4 -4
  67. package/README.en.md +0 -31
  68. package/README.zh-TW.md +0 -31
  69. package/es/src/useFns.js +0 -23
  70. package/lib/src/useFns.js +0 -33
  71. package/lib/src/useFns.min.js +0 -1
  72. package/packages/src/useFns.ts +0 -34
  73. package/types/core/useFn.d.ts +0 -27
@@ -1,99 +1,99 @@
1
- import { App, 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: App): 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
- }
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
+ }
@@ -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]
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
- [![vxe-core](https://contrib.rocks/image?repo=x-extends/vxe-core)](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
- [![vxe-core](https://contrib.rocks/image?repo=x-extends/vxe-core)](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
- };
@@ -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};
@@ -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
- }
@@ -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
- }