@vxe-ui/core 4.4.12 → 4.4.14
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 +43 -43
- package/README.md +43 -43
- package/README.zh-TW.md +43 -43
- package/dist/all.esm.js +920 -0
- package/es/src/core.js +1 -1
- package/es/src/log.js +1 -1
- package/lib/index.umd.js +173 -73
- package/lib/index.umd.min.js +1 -1
- package/lib/src/core.js +1 -1
- package/lib/src/core.min.js +1 -1
- package/lib/src/log.js +1 -1
- package/lib/src/log.min.js +1 -1
- package/package.json +82 -79
- package/packages/index.ts +149 -149
- 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 +4 -4
- package/packages/src/event.ts +160 -160
- 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/renderer.ts +48 -48
- package/packages/src/resize.ts +89 -89
- 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 +34 -34
- package/packages/src/validators.ts +7 -7
- package/packages/src/vm.ts +10 -10
- package/types/core/clipboard.d.ts +22 -22
- package/types/core/commands.d.ts +19 -19
- package/types/core/components.d.ts +5 -5
- package/types/core/formats.d.ts +19 -19
- package/types/core/global-config.d.ts +70 -70
- package/types/core/global-data.d.ts +7 -7
- package/types/core/global-event.d.ts +47 -47
- package/types/core/global-icon.d.ts +10 -10
- package/types/core/global-lang.d.ts +27 -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 +14 -14
- package/types/core/index.d.ts +294 -294
- 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 +150 -150
- package/types/tool/index.d.ts +2 -2
- package/types/tool/util.d.ts +4 -4
package/lib/src/core.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.coreVersion = exports.VxeCore = void 0;
|
|
7
|
-
const coreVersion = exports.coreVersion = "4.4.
|
|
7
|
+
const coreVersion = exports.coreVersion = "4.4.14";
|
|
8
8
|
const VxeCore = exports.VxeCore = {
|
|
9
9
|
coreVersion,
|
|
10
10
|
uiVersion: '',
|
package/lib/src/core.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.coreVersion=exports.VxeCore=void 0;let coreVersion=exports.coreVersion="4.4.
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.coreVersion=exports.VxeCore=void 0;let coreVersion=exports.coreVersion="4.4.14",VxeCore=exports.VxeCore={coreVersion:coreVersion,uiVersion:"",tableVersion:"",designVersion:"",ganttVersion:""};
|
package/lib/src/log.js
CHANGED
package/lib/src/log.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.log=void 0;var _i18n=require("./i18n");function createLog(o,n){return function(e,r){e=`[vxe ${n||""}] `+(0,_i18n.getI18n)(e,r);return console[o](e),e}}let version="4.4.
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.log=void 0;var _i18n=require("./i18n");function createLog(o,n){return function(e,r){e=`[vxe ${n||""}] `+(0,_i18n.getI18n)(e,r);return console[o](e),e}}let version="4.4.14",log=exports.log={create:createLog,warn:createLog("warn","v"+version),err:createLog("error","v"+version)};
|
package/package.json
CHANGED
|
@@ -1,79 +1,82 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@vxe-ui/core",
|
|
3
|
-
"version": "4.4.
|
|
4
|
-
"description": "Vxe UI core library",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"update": "npm install --legacy-peer-deps",
|
|
7
|
-
"lib:pack": "vue-cli-service build --target lib --name index --dest lib_temp packages/index.ts",
|
|
8
|
-
"lib:modules": "gulp build",
|
|
9
|
-
"lib": "npm run lib:pack && npm run lib:modules"
|
|
10
|
-
},
|
|
11
|
-
"files": [
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"@
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
35
|
-
"@
|
|
36
|
-
"@
|
|
37
|
-
"@vue/cli-plugin-
|
|
38
|
-
"@vue/cli-
|
|
39
|
-
"@vue/
|
|
40
|
-
"@vue/
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"eslint
|
|
46
|
-
"eslint-plugin-
|
|
47
|
-
"eslint-plugin-
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"gulp
|
|
51
|
-
"gulp-
|
|
52
|
-
"gulp-
|
|
53
|
-
"gulp-
|
|
54
|
-
"gulp-
|
|
55
|
-
"gulp-
|
|
56
|
-
"gulp-
|
|
57
|
-
"gulp-
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
"vxe"
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
"
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@vxe-ui/core",
|
|
3
|
+
"version": "4.4.14",
|
|
4
|
+
"description": "Vxe UI core library",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"update": "npm install --legacy-peer-deps",
|
|
7
|
+
"lib:pack": "vue-cli-service build --target lib --name index --dest lib_temp packages/index.ts",
|
|
8
|
+
"lib:modules": "gulp build",
|
|
9
|
+
"lib": "npm run lib:pack && npm run lib:modules"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"lib",
|
|
14
|
+
"es",
|
|
15
|
+
"src",
|
|
16
|
+
"types",
|
|
17
|
+
"packages"
|
|
18
|
+
],
|
|
19
|
+
"main": "lib/index.common.js",
|
|
20
|
+
"module": "es/index.esm.js",
|
|
21
|
+
"unpkg": "lib/index.umd.js",
|
|
22
|
+
"jsdelivr": "lib/index.umd.js",
|
|
23
|
+
"typings": "types/index.d.ts",
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"vue": "^3.2.0"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"dom-zindex": "^1.0.7",
|
|
29
|
+
"xe-utils": "^4.0.9"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@rollup/plugin-commonjs": "^29.0.0",
|
|
33
|
+
"@types/node": "^20.12.12",
|
|
34
|
+
"@types/resize-observer-browser": "^0.1.11",
|
|
35
|
+
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
36
|
+
"@typescript-eslint/parser": "^6.21.0",
|
|
37
|
+
"@vue/cli-plugin-babel": "~5.0.0",
|
|
38
|
+
"@vue/cli-plugin-eslint": "~5.0.0",
|
|
39
|
+
"@vue/cli-plugin-typescript": "~5.0.0",
|
|
40
|
+
"@vue/cli-service": "~5.0.0",
|
|
41
|
+
"@vue/eslint-config-standard": "^6.1.0",
|
|
42
|
+
"@vue/eslint-config-typescript": "^9.1.0",
|
|
43
|
+
"core-js": "^3.8.3",
|
|
44
|
+
"del": "^6.1.1",
|
|
45
|
+
"eslint": "^7.32.0",
|
|
46
|
+
"eslint-plugin-import": "^2.29.1",
|
|
47
|
+
"eslint-plugin-node": "^11.1.0",
|
|
48
|
+
"eslint-plugin-promise": "^6.1.1",
|
|
49
|
+
"eslint-plugin-vue": "^8.0.3",
|
|
50
|
+
"gulp": "^4.0.2",
|
|
51
|
+
"gulp-autoprefixer": "^8.0.0",
|
|
52
|
+
"gulp-babel": "^8.0.0",
|
|
53
|
+
"gulp-clean-css": "^4.3.0",
|
|
54
|
+
"gulp-concat": "^2.6.1",
|
|
55
|
+
"gulp-rename": "^2.0.0",
|
|
56
|
+
"gulp-replace": "^1.1.4",
|
|
57
|
+
"gulp-sourcemaps": "^3.0.0",
|
|
58
|
+
"gulp-typescript": "^5.0.1",
|
|
59
|
+
"gulp-uglify": "^3.0.2",
|
|
60
|
+
"postcss": "^8.4.38",
|
|
61
|
+
"rollup": "^4.53.3",
|
|
62
|
+
"typescript": "~4.7.4",
|
|
63
|
+
"vue": "3.4.27"
|
|
64
|
+
},
|
|
65
|
+
"repository": {
|
|
66
|
+
"type": "git",
|
|
67
|
+
"url": "git+https://github.com/x-extends/vxe-core.git"
|
|
68
|
+
},
|
|
69
|
+
"keywords": [
|
|
70
|
+
"vxe",
|
|
71
|
+
"vxe-core",
|
|
72
|
+
"vxe-ui"
|
|
73
|
+
],
|
|
74
|
+
"author": {
|
|
75
|
+
"name": "Xu Liangzhan",
|
|
76
|
+
"email": "xu_liangzhan@163.com"
|
|
77
|
+
},
|
|
78
|
+
"license": "MIT",
|
|
79
|
+
"bugs": {
|
|
80
|
+
"url": "https://github.com/x-extends/vxe-core/issues"
|
|
81
|
+
}
|
|
82
|
+
}
|
package/packages/index.ts
CHANGED
|
@@ -1,149 +1,149 @@
|
|
|
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, 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 { hooks } from './src/hooks'
|
|
20
|
-
import { useFns } from './src/useFns'
|
|
21
|
-
import { getSlotVNs } from './src/vm'
|
|
22
|
-
import XEUtils from 'xe-utils'
|
|
23
|
-
|
|
24
|
-
import { VxeGlobalComponents, VxeUIPluginObject } from '../types'
|
|
25
|
-
|
|
26
|
-
const installedPlugins: VxeUIPluginObject[] = []
|
|
27
|
-
|
|
28
|
-
export function use (Plugin: VxeUIPluginObject, options: any[]) {
|
|
29
|
-
if (Plugin && Plugin.install) {
|
|
30
|
-
if (installedPlugins.indexOf(Plugin) === -1) {
|
|
31
|
-
Plugin.install(VxeUI, options)
|
|
32
|
-
installedPlugins.push(Plugin)
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return VxeUI
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const components: Record<string, any> = {}
|
|
39
|
-
|
|
40
|
-
export function getComponent (name: keyof VxeGlobalComponents) {
|
|
41
|
-
return components[name] || null
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export function hasComponent (name: keyof VxeGlobalComponents) {
|
|
45
|
-
return !!components[name]
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export function component (comp: any) {
|
|
49
|
-
if (comp && comp.name) {
|
|
50
|
-
components[comp.name] = comp
|
|
51
|
-
components[XEUtils.kebabCase(comp.name)] = comp
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export function renderEmptyElement () {
|
|
56
|
-
return createCommentVNode()
|
|
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
|
-
hooks,
|
|
111
|
-
component,
|
|
112
|
-
getComponent,
|
|
113
|
-
hasComponent,
|
|
114
|
-
|
|
115
|
-
useFns,
|
|
116
|
-
getSlotVNs,
|
|
117
|
-
|
|
118
|
-
checkVersion,
|
|
119
|
-
|
|
120
|
-
use
|
|
121
|
-
})
|
|
122
|
-
|
|
123
|
-
setTheme()
|
|
124
|
-
|
|
125
|
-
export * from './src/core'
|
|
126
|
-
export * from './src/event'
|
|
127
|
-
export * from './src/resize'
|
|
128
|
-
|
|
129
|
-
export * from './src/config'
|
|
130
|
-
export * from './src/i18n'
|
|
131
|
-
export * from './src/icon'
|
|
132
|
-
export * from './src/theme'
|
|
133
|
-
export * from './src/renderer'
|
|
134
|
-
export * from './src/validators'
|
|
135
|
-
export * from './src/menus'
|
|
136
|
-
export * from './src/formats'
|
|
137
|
-
export * from './src/commands'
|
|
138
|
-
export * from './src/interceptor'
|
|
139
|
-
export * from './src/clipboard'
|
|
140
|
-
export * from './src/permission'
|
|
141
|
-
|
|
142
|
-
export * from './src/dataStore'
|
|
143
|
-
|
|
144
|
-
export * from './src/useFns'
|
|
145
|
-
export * from './src/vm'
|
|
146
|
-
export * from './src/log'
|
|
147
|
-
export * from './src/hooks'
|
|
148
|
-
|
|
149
|
-
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, 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 { hooks } from './src/hooks'
|
|
20
|
+
import { useFns } from './src/useFns'
|
|
21
|
+
import { getSlotVNs } from './src/vm'
|
|
22
|
+
import XEUtils from 'xe-utils'
|
|
23
|
+
|
|
24
|
+
import { VxeGlobalComponents, VxeUIPluginObject } from '../types'
|
|
25
|
+
|
|
26
|
+
const installedPlugins: VxeUIPluginObject[] = []
|
|
27
|
+
|
|
28
|
+
export function use (Plugin: VxeUIPluginObject, options: any[]) {
|
|
29
|
+
if (Plugin && Plugin.install) {
|
|
30
|
+
if (installedPlugins.indexOf(Plugin) === -1) {
|
|
31
|
+
Plugin.install(VxeUI, options)
|
|
32
|
+
installedPlugins.push(Plugin)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return VxeUI
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const components: Record<string, any> = {}
|
|
39
|
+
|
|
40
|
+
export function getComponent (name: keyof VxeGlobalComponents) {
|
|
41
|
+
return components[name] || null
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function hasComponent (name: keyof VxeGlobalComponents) {
|
|
45
|
+
return !!components[name]
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function component (comp: any) {
|
|
49
|
+
if (comp && comp.name) {
|
|
50
|
+
components[comp.name] = comp
|
|
51
|
+
components[XEUtils.kebabCase(comp.name)] = comp
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function renderEmptyElement () {
|
|
56
|
+
return createCommentVNode()
|
|
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
|
+
hooks,
|
|
111
|
+
component,
|
|
112
|
+
getComponent,
|
|
113
|
+
hasComponent,
|
|
114
|
+
|
|
115
|
+
useFns,
|
|
116
|
+
getSlotVNs,
|
|
117
|
+
|
|
118
|
+
checkVersion,
|
|
119
|
+
|
|
120
|
+
use
|
|
121
|
+
})
|
|
122
|
+
|
|
123
|
+
setTheme()
|
|
124
|
+
|
|
125
|
+
export * from './src/core'
|
|
126
|
+
export * from './src/event'
|
|
127
|
+
export * from './src/resize'
|
|
128
|
+
|
|
129
|
+
export * from './src/config'
|
|
130
|
+
export * from './src/i18n'
|
|
131
|
+
export * from './src/icon'
|
|
132
|
+
export * from './src/theme'
|
|
133
|
+
export * from './src/renderer'
|
|
134
|
+
export * from './src/validators'
|
|
135
|
+
export * from './src/menus'
|
|
136
|
+
export * from './src/formats'
|
|
137
|
+
export * from './src/commands'
|
|
138
|
+
export * from './src/interceptor'
|
|
139
|
+
export * from './src/clipboard'
|
|
140
|
+
export * from './src/permission'
|
|
141
|
+
|
|
142
|
+
export * from './src/dataStore'
|
|
143
|
+
|
|
144
|
+
export * from './src/useFns'
|
|
145
|
+
export * from './src/vm'
|
|
146
|
+
export * from './src/log'
|
|
147
|
+
export * from './src/hooks'
|
|
148
|
+
|
|
149
|
+
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
|
+
}
|