@vxe-ui/core 3.4.11 → 3.4.13

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 (59) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +29 -29
  3. package/es/src/core.js +1 -1
  4. package/es/src/log.js +1 -1
  5. package/lib/index.umd.js +173 -73
  6. package/lib/index.umd.min.js +1 -1
  7. package/lib/src/core.js +1 -1
  8. package/lib/src/core.min.js +1 -1
  9. package/lib/src/log.js +1 -1
  10. package/lib/src/log.min.js +1 -1
  11. package/package.json +80 -80
  12. package/packages/index.ts +147 -147
  13. package/packages/src/clipboard.ts +56 -56
  14. package/packages/src/commands.ts +56 -56
  15. package/packages/src/config.ts +30 -30
  16. package/packages/src/configStore.ts +8 -8
  17. package/packages/src/core.ts +11 -11
  18. package/packages/src/dataStore.ts +4 -4
  19. package/packages/src/event.ts +160 -160
  20. package/packages/src/formats.ts +56 -56
  21. package/packages/src/i18n.ts +66 -66
  22. package/packages/src/i18nStore.ts +16 -16
  23. package/packages/src/icon.ts +32 -32
  24. package/packages/src/iconStore.ts +3 -3
  25. package/packages/src/interceptor.ts +64 -64
  26. package/packages/src/log.ts +19 -19
  27. package/packages/src/menus.ts +56 -56
  28. package/packages/src/mixins.ts +39 -39
  29. package/packages/src/permission.ts +61 -61
  30. package/packages/src/renderer.ts +48 -48
  31. package/packages/src/resize.ts +89 -89
  32. package/packages/src/store.ts +47 -47
  33. package/packages/src/theme.ts +20 -20
  34. package/packages/src/themeStore.ts +7 -7
  35. package/packages/src/validators.ts +7 -7
  36. package/packages/src/vm.ts +10 -10
  37. package/types/core/clipboard.d.ts +22 -22
  38. package/types/core/commands.d.ts +19 -19
  39. package/types/core/components.d.ts +7 -7
  40. package/types/core/formats.d.ts +19 -19
  41. package/types/core/global-config.d.ts +70 -70
  42. package/types/core/global-data.d.ts +7 -7
  43. package/types/core/global-event.d.ts +47 -47
  44. package/types/core/global-icon.d.ts +10 -10
  45. package/types/core/global-lang.d.ts +27 -27
  46. package/types/core/global-resize.d.ts +3 -3
  47. package/types/core/global-theme.d.ts +1 -1
  48. package/types/core/index.d.ts +286 -286
  49. package/types/core/interceptor.d.ts +22 -22
  50. package/types/core/log.d.ts +8 -8
  51. package/types/core/menus.d.ts +19 -19
  52. package/types/core/mixins.d.ts +16 -16
  53. package/types/core/permission.d.ts +10 -10
  54. package/types/core/renderer.d.ts +14 -14
  55. package/types/core/validators.d.ts +19 -19
  56. package/types/index.d.ts +13 -13
  57. package/types/tool/common.d.ts +143 -143
  58. package/types/tool/index.d.ts +2 -2
  59. package/types/tool/util.d.ts +4 -4
package/packages/index.ts CHANGED
@@ -1,147 +1,147 @@
1
- import { VNode } from 'vue'
2
- import { VxeCore } from './src/core'
3
- import { setConfig, getConfig } from './src/config'
4
- import { globalStore } from './src/dataStore'
5
- import { setIcon, getIcon, renderGlobalIcon, renderCustomIcon } from './src/icon'
6
- import { setTheme, getTheme } from './src/theme'
7
- import { globalEvents, GLOBAL_EVENT_KEYS, createEvent } from './src/event'
8
- import { globalResize } from './src/resize'
9
- import { getI18n, setI18n, setLanguage, hasLanguage, getLanguage } from './src/i18n'
10
- import { renderer } from './src/renderer'
11
- import { validators } from './src/validators'
12
- import { menus } from './src/menus'
13
- import { formats } from './src/formats'
14
- import { commands } from './src/commands'
15
- import { interceptor } from './src/interceptor'
16
- import { clipboard } from './src/clipboard'
17
- import { permission } from './src/permission'
18
- import { log } from './src/log'
19
- import { globalMixins } from './src/mixins'
20
- import { getSlotVNs } from './src/vm'
21
- import XEUtils from 'xe-utils'
22
-
23
- import { VxeGlobalComponents, VxeUIPluginObject } from '../types'
24
-
25
- const installedPlugins: VxeUIPluginObject[] = []
26
-
27
- export function use (Plugin: VxeUIPluginObject, options: any[]) {
28
- if (Plugin && Plugin.install) {
29
- if (installedPlugins.indexOf(Plugin) === -1) {
30
- Plugin.install(VxeUI, options)
31
- installedPlugins.push(Plugin)
32
- }
33
- }
34
- return VxeUI
35
- }
36
-
37
- const components: Record<string, any> = {}
38
-
39
- export function getComponent (name: keyof VxeGlobalComponents) {
40
- return components[name] || null
41
- }
42
-
43
- export function component (comp: any) {
44
- if (comp && comp.name) {
45
- components[comp.name] = comp
46
- components[XEUtils.kebabCase(comp.name)] = comp
47
- }
48
- }
49
-
50
- export function hasComponent (name: keyof VxeGlobalComponents) {
51
- return !!components[name]
52
- }
53
-
54
- export function renderEmptyElement (_vm: any): VNode {
55
- const { _e } = _vm
56
- return _e()
57
- }
58
-
59
- export function checkVersion (version: string, pVersion: number, sVersion?: number) {
60
- if (version) {
61
- const vRest = `${version}`.match(/(\d+).(\d+).(\d+)/)
62
- if (vRest) {
63
- const pV = XEUtils.toNumber(vRest[1])
64
- if (sVersion) {
65
- const sV = XEUtils.toNumber(vRest[2])
66
- return pV >= pVersion && sV >= sVersion
67
- }
68
- return pV >= pVersion
69
- }
70
- }
71
- return false
72
- }
73
-
74
- export const VxeUI = Object.assign(VxeCore, {
75
- renderEmptyElement,
76
-
77
- setTheme,
78
- getTheme,
79
- setConfig,
80
- getConfig: getConfig as any,
81
-
82
- setIcon,
83
- getIcon: getIcon as any,
84
- renderGlobalIcon,
85
- renderCustomIcon,
86
-
87
- setLanguage,
88
- hasLanguage,
89
- getLanguage,
90
- setI18n,
91
- getI18n,
92
-
93
- globalEvents,
94
- GLOBAL_EVENT_KEYS,
95
- createEvent,
96
-
97
- globalResize,
98
- renderer,
99
- validators,
100
- menus,
101
- formats,
102
- commands,
103
- interceptor,
104
- clipboard,
105
- log,
106
- permission,
107
-
108
- globalStore,
109
-
110
- component,
111
- getComponent,
112
- hasComponent,
113
-
114
- globalMixins,
115
- getSlotVNs,
116
-
117
- checkVersion,
118
-
119
- use
120
- })
121
-
122
- setTheme()
123
-
124
- export * from './src/core'
125
- export * from './src/event'
126
- export * from './src/resize'
127
-
128
- export * from './src/config'
129
- export * from './src/i18n'
130
- export * from './src/icon'
131
- export * from './src/theme'
132
- export * from './src/renderer'
133
- export * from './src/validators'
134
- export * from './src/menus'
135
- export * from './src/formats'
136
- export * from './src/commands'
137
- export * from './src/interceptor'
138
- export * from './src/clipboard'
139
- export * from './src/permission'
140
-
141
- export * from './src/dataStore'
142
-
143
- export * from './src/mixins'
144
- export * from './src/vm'
145
- export * from './src/log'
146
-
147
- export default VxeUI
1
+ import { VNode } from 'vue'
2
+ import { VxeCore } from './src/core'
3
+ import { setConfig, getConfig } from './src/config'
4
+ import { globalStore } from './src/dataStore'
5
+ import { setIcon, getIcon, renderGlobalIcon, renderCustomIcon } from './src/icon'
6
+ import { setTheme, getTheme } from './src/theme'
7
+ import { globalEvents, GLOBAL_EVENT_KEYS, createEvent } from './src/event'
8
+ import { globalResize } from './src/resize'
9
+ import { getI18n, setI18n, setLanguage, hasLanguage, getLanguage } from './src/i18n'
10
+ import { renderer } from './src/renderer'
11
+ import { validators } from './src/validators'
12
+ import { menus } from './src/menus'
13
+ import { formats } from './src/formats'
14
+ import { commands } from './src/commands'
15
+ import { interceptor } from './src/interceptor'
16
+ import { clipboard } from './src/clipboard'
17
+ import { permission } from './src/permission'
18
+ import { log } from './src/log'
19
+ import { globalMixins } from './src/mixins'
20
+ import { getSlotVNs } from './src/vm'
21
+ import XEUtils from 'xe-utils'
22
+
23
+ import { VxeGlobalComponents, VxeUIPluginObject } from '../types'
24
+
25
+ const installedPlugins: VxeUIPluginObject[] = []
26
+
27
+ export function use (Plugin: VxeUIPluginObject, options: any[]) {
28
+ if (Plugin && Plugin.install) {
29
+ if (installedPlugins.indexOf(Plugin) === -1) {
30
+ Plugin.install(VxeUI, options)
31
+ installedPlugins.push(Plugin)
32
+ }
33
+ }
34
+ return VxeUI
35
+ }
36
+
37
+ const components: Record<string, any> = {}
38
+
39
+ export function getComponent (name: keyof VxeGlobalComponents) {
40
+ return components[name] || null
41
+ }
42
+
43
+ export function component (comp: any) {
44
+ if (comp && comp.name) {
45
+ components[comp.name] = comp
46
+ components[XEUtils.kebabCase(comp.name)] = comp
47
+ }
48
+ }
49
+
50
+ export function hasComponent (name: keyof VxeGlobalComponents) {
51
+ return !!components[name]
52
+ }
53
+
54
+ export function renderEmptyElement (_vm: any): VNode {
55
+ const { _e } = _vm
56
+ return _e()
57
+ }
58
+
59
+ export function checkVersion (version: string, pVersion: number, sVersion?: number) {
60
+ if (version) {
61
+ const vRest = `${version}`.match(/(\d+).(\d+).(\d+)/)
62
+ if (vRest) {
63
+ const pV = XEUtils.toNumber(vRest[1])
64
+ if (sVersion) {
65
+ const sV = XEUtils.toNumber(vRest[2])
66
+ return pV >= pVersion && sV >= sVersion
67
+ }
68
+ return pV >= pVersion
69
+ }
70
+ }
71
+ return false
72
+ }
73
+
74
+ export const VxeUI = Object.assign(VxeCore, {
75
+ renderEmptyElement,
76
+
77
+ setTheme,
78
+ getTheme,
79
+ setConfig,
80
+ getConfig: getConfig as any,
81
+
82
+ setIcon,
83
+ getIcon: getIcon as any,
84
+ renderGlobalIcon,
85
+ renderCustomIcon,
86
+
87
+ setLanguage,
88
+ hasLanguage,
89
+ getLanguage,
90
+ setI18n,
91
+ getI18n,
92
+
93
+ globalEvents,
94
+ GLOBAL_EVENT_KEYS,
95
+ createEvent,
96
+
97
+ globalResize,
98
+ renderer,
99
+ validators,
100
+ menus,
101
+ formats,
102
+ commands,
103
+ interceptor,
104
+ clipboard,
105
+ log,
106
+ permission,
107
+
108
+ globalStore,
109
+
110
+ component,
111
+ getComponent,
112
+ hasComponent,
113
+
114
+ globalMixins,
115
+ getSlotVNs,
116
+
117
+ checkVersion,
118
+
119
+ use
120
+ })
121
+
122
+ setTheme()
123
+
124
+ export * from './src/core'
125
+ export * from './src/event'
126
+ export * from './src/resize'
127
+
128
+ export * from './src/config'
129
+ export * from './src/i18n'
130
+ export * from './src/icon'
131
+ export * from './src/theme'
132
+ export * from './src/renderer'
133
+ export * from './src/validators'
134
+ export * from './src/menus'
135
+ export * from './src/formats'
136
+ export * from './src/commands'
137
+ export * from './src/interceptor'
138
+ export * from './src/clipboard'
139
+ export * from './src/permission'
140
+
141
+ export * from './src/dataStore'
142
+
143
+ export * from './src/mixins'
144
+ export * from './src/vm'
145
+ export * from './src/log'
146
+
147
+ export default VxeUI
@@ -1,56 +1,56 @@
1
- import XEUtils from 'xe-utils'
2
-
3
- import { VxeGlobalClipboard } from '../../types'
4
-
5
- let copyElem: HTMLTextAreaElement
6
- const clipStore = {
7
- text: '',
8
- html: ''
9
- }
10
-
11
- function handleText (text: string) {
12
- if (!copyElem) {
13
- copyElem = document.createElement('textarea')
14
- copyElem.id = '$VxeCopy'
15
- const styles = copyElem.style
16
- styles.width = '48px'
17
- styles.height = '24px'
18
- styles.position = 'fixed'
19
- styles.zIndex = '0'
20
- styles.left = '-500px'
21
- styles.top = '-500px'
22
- document.body.appendChild(copyElem)
23
- }
24
- copyElem.value = text
25
- }
26
-
27
- export const clipboard: VxeGlobalClipboard = {
28
- getStore () {
29
- return clipStore
30
- },
31
- setStore (data) {
32
- Object.assign(clipStore, data || {})
33
- },
34
- /**
35
- * 复制内容到剪贴板
36
- *
37
- * @param {String} content Text 内容
38
- */
39
- copy (content) {
40
- let result = false
41
- try {
42
- const text = XEUtils.toValueString(content)
43
- handleText(text)
44
- copyElem.select()
45
- copyElem.setSelectionRange(0, copyElem.value.length)
46
- result = document.execCommand('copy')
47
- copyElem.blur()
48
- clipStore.text = text
49
- clipStore.html = ''
50
- } catch (e) {}
51
- return result
52
- },
53
- getText () {
54
- return clipStore.text || ''
55
- }
56
- }
1
+ import XEUtils from 'xe-utils'
2
+
3
+ import { VxeGlobalClipboard } from '../../types'
4
+
5
+ let copyElem: HTMLTextAreaElement
6
+ const clipStore = {
7
+ text: '',
8
+ html: ''
9
+ }
10
+
11
+ function handleText (text: string) {
12
+ if (!copyElem) {
13
+ copyElem = document.createElement('textarea')
14
+ copyElem.id = '$VxeCopy'
15
+ const styles = copyElem.style
16
+ styles.width = '48px'
17
+ styles.height = '24px'
18
+ styles.position = 'fixed'
19
+ styles.zIndex = '0'
20
+ styles.left = '-500px'
21
+ styles.top = '-500px'
22
+ document.body.appendChild(copyElem)
23
+ }
24
+ copyElem.value = text
25
+ }
26
+
27
+ export const clipboard: VxeGlobalClipboard = {
28
+ getStore () {
29
+ return clipStore
30
+ },
31
+ setStore (data) {
32
+ Object.assign(clipStore, data || {})
33
+ },
34
+ /**
35
+ * 复制内容到剪贴板
36
+ *
37
+ * @param {String} content Text 内容
38
+ */
39
+ copy (content) {
40
+ let result = false
41
+ try {
42
+ const text = XEUtils.toValueString(content)
43
+ handleText(text)
44
+ copyElem.select()
45
+ copyElem.setSelectionRange(0, copyElem.value.length)
46
+ result = document.execCommand('copy')
47
+ copyElem.blur()
48
+ clipStore.text = text
49
+ clipStore.html = ''
50
+ } catch (e) {}
51
+ return result
52
+ },
53
+ getText () {
54
+ return clipStore.text || ''
55
+ }
56
+ }
@@ -1,56 +1,56 @@
1
- import XEUtils from 'xe-utils'
2
- import { log } from './log'
3
-
4
- import { VxeGlobalCommands } from '../../types'
5
-
6
- class VXECommandsStore {
7
- private store: any = {}
8
-
9
- mixin (options: any): VXECommandsStore {
10
- XEUtils.each(options, (item, key) => {
11
- this.add(key, item)
12
- })
13
- return this
14
- }
15
-
16
- has (name: string): boolean {
17
- return !!this.get(name)
18
- }
19
-
20
- get (name: string): any {
21
- return this.store[name]
22
- }
23
-
24
- add (name: string, render: any): VXECommandsStore {
25
- const conf = this.store[name]
26
- // 兼容
27
- if (XEUtils.isFunction(render)) {
28
- log.warn('vxe.error.delProp', ['commands -> callback', 'commandMethod'])
29
- render = {
30
- commandMethod: render
31
- }
32
- }
33
-
34
- // 检测是否覆盖
35
- const confKeys = XEUtils.keys(conf)
36
- XEUtils.each(render, (item, key) => {
37
- if (confKeys.includes(key)) {
38
- log.warn('vxe.error.coverProp', [name, key])
39
- }
40
- })
41
- this.store[name] = conf ? XEUtils.merge(conf, render) : render
42
- return this
43
- }
44
-
45
- delete (name: string): void {
46
- delete this.store[name]
47
- }
48
-
49
- forEach (callback: any): void {
50
- XEUtils.objectEach(this.store, callback)
51
- }
52
- }
53
-
54
- export const commands = new VXECommandsStore() as VxeGlobalCommands
55
-
56
- Object.assign(commands, { _name: 'Commands' })
1
+ import XEUtils from 'xe-utils'
2
+ import { log } from './log'
3
+
4
+ import { VxeGlobalCommands } from '../../types'
5
+
6
+ class VXECommandsStore {
7
+ private store: any = {}
8
+
9
+ mixin (options: any): VXECommandsStore {
10
+ XEUtils.each(options, (item, key) => {
11
+ this.add(key, item)
12
+ })
13
+ return this
14
+ }
15
+
16
+ has (name: string): boolean {
17
+ return !!this.get(name)
18
+ }
19
+
20
+ get (name: string): any {
21
+ return this.store[name]
22
+ }
23
+
24
+ add (name: string, render: any): VXECommandsStore {
25
+ const conf = this.store[name]
26
+ // 兼容
27
+ if (XEUtils.isFunction(render)) {
28
+ log.warn('vxe.error.delProp', ['commands -> callback', 'commandMethod'])
29
+ render = {
30
+ commandMethod: render
31
+ }
32
+ }
33
+
34
+ // 检测是否覆盖
35
+ const confKeys = XEUtils.keys(conf)
36
+ XEUtils.each(render, (item, key) => {
37
+ if (confKeys.includes(key)) {
38
+ log.warn('vxe.error.coverProp', [name, key])
39
+ }
40
+ })
41
+ this.store[name] = conf ? XEUtils.merge(conf, render) : render
42
+ return this
43
+ }
44
+
45
+ delete (name: string): void {
46
+ delete this.store[name]
47
+ }
48
+
49
+ forEach (callback: any): void {
50
+ XEUtils.objectEach(this.store, callback)
51
+ }
52
+ }
53
+
54
+ export const commands = new VXECommandsStore() as VxeGlobalCommands
55
+
56
+ Object.assign(commands, { _name: 'Commands' })
@@ -1,30 +1,30 @@
1
- import XEUtils from 'xe-utils'
2
- import DomZIndex from 'dom-zindex'
3
- import { VxeCore } from './core'
4
- import { globalConfigStore } from './configStore'
5
- import { setTheme } from './theme'
6
-
7
- import { VxeGlobalConfig } from '../../types'
8
-
9
- /**
10
- * 全局参数设置
11
- */
12
- export function setConfig (options?: VxeGlobalConfig) {
13
- if (options) {
14
- if (options.zIndex) {
15
- DomZIndex.setCurrent(options.zIndex)
16
- }
17
- if (options.theme) {
18
- setTheme(options.theme)
19
- }
20
- XEUtils.merge(globalConfigStore, options)
21
- }
22
- return VxeCore
23
- }
24
-
25
- /**
26
- * 获取全局参数
27
- */
28
- export function getConfig (key: keyof VxeGlobalConfig, defaultValue?: any) {
29
- return arguments.length ? XEUtils.get(globalConfigStore, key, defaultValue) : globalConfigStore
30
- }
1
+ import XEUtils from 'xe-utils'
2
+ import DomZIndex from 'dom-zindex'
3
+ import { VxeCore } from './core'
4
+ import { globalConfigStore } from './configStore'
5
+ import { setTheme } from './theme'
6
+
7
+ import { VxeGlobalConfig } from '../../types'
8
+
9
+ /**
10
+ * 全局参数设置
11
+ */
12
+ export function setConfig (options?: VxeGlobalConfig) {
13
+ if (options) {
14
+ if (options.zIndex) {
15
+ DomZIndex.setCurrent(options.zIndex)
16
+ }
17
+ if (options.theme) {
18
+ setTheme(options.theme)
19
+ }
20
+ XEUtils.merge(globalConfigStore, options)
21
+ }
22
+ return VxeCore
23
+ }
24
+
25
+ /**
26
+ * 获取全局参数
27
+ */
28
+ export function getConfig (key: keyof VxeGlobalConfig, defaultValue?: any) {
29
+ return arguments.length ? XEUtils.get(globalConfigStore, key, defaultValue) : globalConfigStore
30
+ }
@@ -1,8 +1,8 @@
1
- import { VxeGlobalConfig } from '../../types'
2
-
3
- export const globalConfigStore: VxeGlobalConfig = {
4
- size: '',
5
- version: 1,
6
- zIndex: 999,
7
- resizeInterval: 500
8
- }
1
+ import { VxeGlobalConfig } from '../../types'
2
+
3
+ export const globalConfigStore: VxeGlobalConfig = {
4
+ size: '',
5
+ version: 1,
6
+ zIndex: 999,
7
+ resizeInterval: 500
8
+ }
@@ -1,11 +1,11 @@
1
- import { VxeUIExport } from '../../types'
2
-
3
- export const coreVersion = process.env.VUE_APP_VXE_VERSION as string
4
-
5
- export const VxeCore = {
6
- coreVersion,
7
- uiVersion: '',
8
- tableVersion: '',
9
- designVersion: '',
10
- ganttVersion: ''
11
- } as VxeUIExport
1
+ import { VxeUIExport } from '../../types'
2
+
3
+ export const coreVersion = process.env.VUE_APP_VXE_VERSION as string
4
+
5
+ export const VxeCore = {
6
+ coreVersion,
7
+ uiVersion: '',
8
+ tableVersion: '',
9
+ designVersion: '',
10
+ ganttVersion: ''
11
+ } as VxeUIExport
@@ -1,4 +1,4 @@
1
- import { VxeGlobalData } from '../../types'
2
-
3
- export const globalStore: VxeGlobalData = {
4
- }
1
+ import { VxeGlobalData } from '../../types'
2
+
3
+ export const globalStore: VxeGlobalData = {
4
+ }