@vxe-ui/core 4.0.22 → 4.0.24
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/event.js +10 -8
- package/es/src/log.js +1 -1
- package/lib/index.umd.js +942 -145
- 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.js +10 -8
- 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 -125
- 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/index.ts
CHANGED
|
@@ -1,117 +1,117 @@
|
|
|
1
|
-
import { VxeCore } from './src/core'
|
|
2
|
-
import { createCommentVNode } from 'vue'
|
|
3
|
-
import { setConfig, getConfig } from './src/config'
|
|
4
|
-
import { globalStore } from './src/dataStore'
|
|
5
|
-
import { setIcon, getIcon } 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 { hooks } from './src/hooks'
|
|
20
|
-
import { useFns } from './src/useFns'
|
|
21
|
-
|
|
22
|
-
import { VxeGlobalComponents, VxeUIPluginObject } from '../types'
|
|
23
|
-
|
|
24
|
-
const installedPlugins: VxeUIPluginObject[] = []
|
|
25
|
-
|
|
26
|
-
export function use (Plugin: VxeUIPluginObject, options: any[]) {
|
|
27
|
-
if (Plugin && Plugin.install) {
|
|
28
|
-
if (installedPlugins.indexOf(Plugin) === -1) {
|
|
29
|
-
Plugin.install(VxeUI, options)
|
|
30
|
-
installedPlugins.push(Plugin)
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return VxeUI
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const components: Record<string, any> = {}
|
|
37
|
-
|
|
38
|
-
export function getComponent (name: keyof VxeGlobalComponents) {
|
|
39
|
-
return components[name] || null
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export function component (comp: any) {
|
|
43
|
-
if (comp && comp.name) {
|
|
44
|
-
components[comp.name] = comp
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export function renderEmptyElement () {
|
|
49
|
-
return createCommentVNode()
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export const VxeUI = Object.assign(VxeCore, {
|
|
53
|
-
renderEmptyElement,
|
|
54
|
-
|
|
55
|
-
setTheme,
|
|
56
|
-
getTheme,
|
|
57
|
-
setConfig,
|
|
58
|
-
getConfig: getConfig as any,
|
|
59
|
-
setIcon,
|
|
60
|
-
getIcon: getIcon as any,
|
|
61
|
-
setLanguage,
|
|
62
|
-
hasLanguage,
|
|
63
|
-
getLanguage,
|
|
64
|
-
setI18n,
|
|
65
|
-
getI18n,
|
|
66
|
-
|
|
67
|
-
globalEvents,
|
|
68
|
-
GLOBAL_EVENT_KEYS,
|
|
69
|
-
createEvent,
|
|
70
|
-
|
|
71
|
-
globalResize,
|
|
72
|
-
renderer,
|
|
73
|
-
validators,
|
|
74
|
-
menus,
|
|
75
|
-
formats,
|
|
76
|
-
commands,
|
|
77
|
-
interceptor,
|
|
78
|
-
clipboard,
|
|
79
|
-
log,
|
|
80
|
-
permission,
|
|
81
|
-
|
|
82
|
-
globalStore,
|
|
83
|
-
|
|
84
|
-
hooks,
|
|
85
|
-
component,
|
|
86
|
-
getComponent,
|
|
87
|
-
useFns,
|
|
88
|
-
|
|
89
|
-
use
|
|
90
|
-
})
|
|
91
|
-
|
|
92
|
-
setTheme()
|
|
93
|
-
|
|
94
|
-
export * from './src/core'
|
|
95
|
-
export * from './src/event'
|
|
96
|
-
export * from './src/resize'
|
|
97
|
-
|
|
98
|
-
export * from './src/config'
|
|
99
|
-
export * from './src/i18n'
|
|
100
|
-
export * from './src/icon'
|
|
101
|
-
export * from './src/theme'
|
|
102
|
-
export * from './src/renderer'
|
|
103
|
-
export * from './src/validators'
|
|
104
|
-
export * from './src/menus'
|
|
105
|
-
export * from './src/formats'
|
|
106
|
-
export * from './src/commands'
|
|
107
|
-
export * from './src/interceptor'
|
|
108
|
-
export * from './src/clipboard'
|
|
109
|
-
export * from './src/permission'
|
|
110
|
-
|
|
111
|
-
export * from './src/dataStore'
|
|
112
|
-
|
|
113
|
-
export * from './src/useFns'
|
|
114
|
-
export * from './src/log'
|
|
115
|
-
export * from './src/hooks'
|
|
116
|
-
|
|
117
|
-
export default VxeUI
|
|
1
|
+
import { VxeCore } from './src/core'
|
|
2
|
+
import { createCommentVNode } from 'vue'
|
|
3
|
+
import { setConfig, getConfig } from './src/config'
|
|
4
|
+
import { globalStore } from './src/dataStore'
|
|
5
|
+
import { setIcon, getIcon } 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 { hooks } from './src/hooks'
|
|
20
|
+
import { useFns } from './src/useFns'
|
|
21
|
+
|
|
22
|
+
import { VxeGlobalComponents, VxeUIPluginObject } from '../types'
|
|
23
|
+
|
|
24
|
+
const installedPlugins: VxeUIPluginObject[] = []
|
|
25
|
+
|
|
26
|
+
export function use (Plugin: VxeUIPluginObject, options: any[]) {
|
|
27
|
+
if (Plugin && Plugin.install) {
|
|
28
|
+
if (installedPlugins.indexOf(Plugin) === -1) {
|
|
29
|
+
Plugin.install(VxeUI, options)
|
|
30
|
+
installedPlugins.push(Plugin)
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return VxeUI
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const components: Record<string, any> = {}
|
|
37
|
+
|
|
38
|
+
export function getComponent (name: keyof VxeGlobalComponents) {
|
|
39
|
+
return components[name] || null
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function component (comp: any) {
|
|
43
|
+
if (comp && comp.name) {
|
|
44
|
+
components[comp.name] = comp
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function renderEmptyElement () {
|
|
49
|
+
return createCommentVNode()
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export const VxeUI = Object.assign(VxeCore, {
|
|
53
|
+
renderEmptyElement,
|
|
54
|
+
|
|
55
|
+
setTheme,
|
|
56
|
+
getTheme,
|
|
57
|
+
setConfig,
|
|
58
|
+
getConfig: getConfig as any,
|
|
59
|
+
setIcon,
|
|
60
|
+
getIcon: getIcon as any,
|
|
61
|
+
setLanguage,
|
|
62
|
+
hasLanguage,
|
|
63
|
+
getLanguage,
|
|
64
|
+
setI18n,
|
|
65
|
+
getI18n,
|
|
66
|
+
|
|
67
|
+
globalEvents,
|
|
68
|
+
GLOBAL_EVENT_KEYS,
|
|
69
|
+
createEvent,
|
|
70
|
+
|
|
71
|
+
globalResize,
|
|
72
|
+
renderer,
|
|
73
|
+
validators,
|
|
74
|
+
menus,
|
|
75
|
+
formats,
|
|
76
|
+
commands,
|
|
77
|
+
interceptor,
|
|
78
|
+
clipboard,
|
|
79
|
+
log,
|
|
80
|
+
permission,
|
|
81
|
+
|
|
82
|
+
globalStore,
|
|
83
|
+
|
|
84
|
+
hooks,
|
|
85
|
+
component,
|
|
86
|
+
getComponent,
|
|
87
|
+
useFns,
|
|
88
|
+
|
|
89
|
+
use
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
setTheme()
|
|
93
|
+
|
|
94
|
+
export * from './src/core'
|
|
95
|
+
export * from './src/event'
|
|
96
|
+
export * from './src/resize'
|
|
97
|
+
|
|
98
|
+
export * from './src/config'
|
|
99
|
+
export * from './src/i18n'
|
|
100
|
+
export * from './src/icon'
|
|
101
|
+
export * from './src/theme'
|
|
102
|
+
export * from './src/renderer'
|
|
103
|
+
export * from './src/validators'
|
|
104
|
+
export * from './src/menus'
|
|
105
|
+
export * from './src/formats'
|
|
106
|
+
export * from './src/commands'
|
|
107
|
+
export * from './src/interceptor'
|
|
108
|
+
export * from './src/clipboard'
|
|
109
|
+
export * from './src/permission'
|
|
110
|
+
|
|
111
|
+
export * from './src/dataStore'
|
|
112
|
+
|
|
113
|
+
export * from './src/useFns'
|
|
114
|
+
export * from './src/log'
|
|
115
|
+
export * from './src/hooks'
|
|
116
|
+
|
|
117
|
+
export default VxeUI
|
|
@@ -1,53 +1,53 @@
|
|
|
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
|
-
}
|
|
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
|
+
}
|
package/packages/src/commands.ts
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
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
|
-
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
29
|
-
log.warn('vxe.error.delProp', ['commands -> callback', 'commandMethod'])
|
|
30
|
-
}
|
|
31
|
-
render = {
|
|
32
|
-
commandMethod: render
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// 检测是否覆盖
|
|
37
|
-
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
38
|
-
const confKeys = XEUtils.keys(conf)
|
|
39
|
-
XEUtils.each(render, (item, key) => {
|
|
40
|
-
if (confKeys.includes(key)) {
|
|
41
|
-
log.warn('vxe.error.coverProp', [name, key])
|
|
42
|
-
}
|
|
43
|
-
})
|
|
44
|
-
}
|
|
45
|
-
this.store[name] = conf ? XEUtils.merge(conf, render) : render
|
|
46
|
-
return this
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
delete (name: string): void {
|
|
50
|
-
delete this.store[name]
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
forEach (callback: any): void {
|
|
54
|
-
XEUtils.objectEach(this.store, callback)
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export const commands = new VXECommandsStore() as VxeGlobalCommands
|
|
59
|
-
|
|
60
|
-
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
61
|
-
Object.assign(commands, { _name: 'Commands' })
|
|
62
|
-
}
|
|
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
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
29
|
+
log.warn('vxe.error.delProp', ['commands -> callback', 'commandMethod'])
|
|
30
|
+
}
|
|
31
|
+
render = {
|
|
32
|
+
commandMethod: render
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// 检测是否覆盖
|
|
37
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
38
|
+
const confKeys = XEUtils.keys(conf)
|
|
39
|
+
XEUtils.each(render, (item, key) => {
|
|
40
|
+
if (confKeys.includes(key)) {
|
|
41
|
+
log.warn('vxe.error.coverProp', [name, key])
|
|
42
|
+
}
|
|
43
|
+
})
|
|
44
|
+
}
|
|
45
|
+
this.store[name] = conf ? XEUtils.merge(conf, render) : render
|
|
46
|
+
return this
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
delete (name: string): void {
|
|
50
|
+
delete this.store[name]
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
forEach (callback: any): void {
|
|
54
|
+
XEUtils.objectEach(this.store, callback)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export const commands = new VXECommandsStore() as VxeGlobalCommands
|
|
59
|
+
|
|
60
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
61
|
+
Object.assign(commands, { _name: 'Commands' })
|
|
62
|
+
}
|
package/packages/src/config.ts
CHANGED
|
@@ -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
|
+
}
|
package/packages/src/core.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
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
|
-
} 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
|
+
} 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
|
+
}
|