@vxe-ui/core 4.4.42 → 4.5.1
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/dist/all.esm.js +1594 -1389
- package/dist/all.esm.min.js +1 -0
- package/es/index.d.ts +138 -0
- package/es/index.esm.js +138 -125
- package/es/index.js +150 -0
- package/es/src/base-utils.d.ts +2 -0
- package/es/src/base-utils.js +40 -37
- package/es/src/clipboard.d.ts +2 -0
- package/es/src/clipboard.js +48 -45
- package/es/src/commands.d.ts +2 -0
- package/es/src/commands.js +47 -48
- package/es/src/config.d.ts +13 -0
- package/es/src/config.js +21 -23
- package/es/src/configStore.d.ts +2 -0
- package/es/src/configStore.js +8 -5
- package/es/src/core.d.ts +3 -0
- package/es/src/core.js +11 -7
- package/es/src/dataStore.d.ts +2 -0
- package/es/src/dataStore.js +4 -1
- package/es/src/db-utils.d.ts +2 -0
- package/es/src/db-utils.js +234 -0
- package/es/src/dom-utils.d.ts +2 -0
- package/es/src/dom-utils.js +65 -68
- package/es/src/event.d.ts +4 -0
- package/es/src/event.js +133 -147
- package/es/src/formats.d.ts +2 -0
- package/es/src/formats.js +47 -48
- package/es/src/hooks.d.ts +2 -0
- package/es/src/hooks.js +5 -2
- package/es/src/i18n.d.ts +6 -0
- package/es/src/i18n.js +51 -44
- package/es/src/i18nStore.d.ts +5 -0
- package/es/src/i18nStore.js +7 -4
- package/es/src/icon.d.ts +9 -0
- package/es/src/icon.js +28 -22
- package/es/src/iconStore.d.ts +2 -0
- package/es/src/iconStore.js +4 -1
- package/es/src/interceptor.d.ts +2 -0
- package/es/src/interceptor.js +52 -54
- package/es/src/log.d.ts +2 -0
- package/es/src/log.js +14 -11
- package/es/src/menus.d.ts +2 -0
- package/es/src/menus.js +47 -48
- package/es/src/permission.d.ts +3 -0
- package/es/src/permission.js +57 -55
- package/es/src/popper-utils.d.ts +2 -0
- package/es/src/popper-utils.js +159 -179
- package/es/src/renderer.d.ts +5 -0
- package/es/src/renderer.js +37 -42
- package/es/src/resize.d.ts +2 -0
- package/es/src/resize.js +60 -70
- package/es/src/scrollbar-utils.d.ts +2 -0
- package/es/src/scrollbar-utils.js +57 -54
- package/es/src/store.d.ts +13 -0
- package/es/src/store.js +43 -45
- package/es/src/theme.d.ts +3 -0
- package/es/src/theme.js +17 -13
- package/es/src/themeStore.d.ts +4 -0
- package/es/src/themeStore.js +5 -2
- package/es/src/useFns.d.ts +40 -0
- package/es/src/useFns.js +212 -231
- package/es/src/validators.d.ts +2 -0
- package/es/src/validators.js +6 -3
- package/es/src/vm.d.ts +2 -0
- package/es/src/vm.js +9 -6
- package/es/src/z-index.d.ts +2 -0
- package/es/src/z-index.js +29 -26
- package/lib/index.common.js +136 -365
- package/lib/index.js +181 -0
- package/lib/index.umd.js +819 -3343
- package/lib/index.umd.min.js +1 -1
- package/lib/src/base-utils.js +39 -13
- package/lib/src/clipboard.js +50 -23
- package/lib/src/commands.js +46 -27
- package/lib/src/config.js +43 -23
- package/lib/src/configStore.js +24 -7
- package/lib/src/core.js +29 -11
- package/lib/src/dataStore.js +22 -5
- package/lib/src/db-utils.js +263 -0
- package/lib/src/dom-utils.js +40 -20
- package/lib/src/event.js +95 -102
- package/lib/src/formats.js +46 -27
- package/lib/src/hooks.js +33 -7
- package/lib/src/i18n.js +53 -38
- package/lib/src/i18nStore.js +25 -8
- package/lib/src/icon.js +46 -22
- package/lib/src/iconStore.js +22 -5
- package/lib/src/interceptor.js +40 -18
- package/lib/src/log.js +29 -12
- package/lib/src/menus.js +46 -27
- package/lib/src/permission.js +40 -17
- package/lib/src/popper-utils.js +71 -71
- package/lib/src/renderer.js +40 -21
- package/lib/src/resize.js +48 -42
- package/lib/src/scrollbar-utils.js +23 -6
- package/lib/src/store.js +44 -25
- package/lib/src/theme.js +31 -14
- package/lib/src/themeStore.js +24 -7
- package/lib/src/useFns.js +87 -124
- package/lib/src/validators.js +34 -10
- package/lib/src/vm.js +34 -8
- package/lib/src/z-index.js +38 -12
- package/package.json +14 -3
- package/packages/index.ts +171 -168
- package/packages/src/base-utils.ts +42 -43
- 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 +3 -4
- package/packages/src/db-utils.ts +267 -0
- package/packages/src/dom-utils.ts +86 -87
- package/packages/src/event.ts +161 -161
- 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/popper-utils.ts +197 -194
- package/packages/src/renderer.ts +50 -50
- package/packages/src/resize.ts +89 -89
- package/packages/src/scrollbar-utils.ts +58 -58
- 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 +270 -275
- package/packages/src/validators.ts +7 -7
- package/packages/src/vm.ts +10 -10
- package/packages/src/z-index.ts +30 -30
- package/types/core/base-utils.d.ts +39 -40
- package/types/core/clipboard.d.ts +22 -22
- package/types/core/commands.d.ts +17 -19
- package/types/core/components.d.ts +5 -5
- package/types/core/db-utils.d.ts +44 -0
- package/types/core/dom-utils.d.ts +36 -37
- package/types/core/formats.d.ts +17 -19
- package/types/core/global-config.d.ts +67 -74
- package/types/core/global-data.d.ts +7 -7
- package/types/core/global-event.d.ts +48 -48
- package/types/core/global-icon.d.ts +10 -10
- package/types/core/global-lang.d.ts +28 -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 +12 -14
- package/types/core/index.d.ts +343 -336
- package/types/core/interceptor.d.ts +20 -22
- package/types/core/log.d.ts +8 -8
- package/types/core/menus.d.ts +17 -19
- package/types/core/permission.d.ts +10 -10
- package/types/core/popper-utils.d.ts +44 -44
- package/types/core/renderer.d.ts +14 -14
- package/types/core/scrollbar-utils.d.ts +37 -38
- package/types/core/useFn.d.ts +121 -126
- package/types/core/validators.d.ts +17 -19
- package/types/core/z-index.d.ts +18 -18
- package/types/index.d.ts +13 -13
- package/types/tool/common.d.ts +146 -155
- package/types/tool/index.d.ts +2 -2
- package/types/tool/util.d.ts +4 -4
- package/lib/src/base-utils.min.js +0 -1
- package/lib/src/clipboard.min.js +0 -1
- package/lib/src/commands.min.js +0 -1
- package/lib/src/config.min.js +0 -1
- package/lib/src/configStore.min.js +0 -1
- package/lib/src/core.min.js +0 -1
- package/lib/src/dataStore.min.js +0 -1
- package/lib/src/dom-utils.min.js +0 -1
- package/lib/src/event.min.js +0 -1
- package/lib/src/formats.min.js +0 -1
- package/lib/src/hooks.min.js +0 -1
- package/lib/src/i18n.min.js +0 -1
- package/lib/src/i18nStore.min.js +0 -1
- package/lib/src/icon.min.js +0 -1
- package/lib/src/iconStore.min.js +0 -1
- package/lib/src/interceptor.min.js +0 -1
- package/lib/src/log.min.js +0 -1
- package/lib/src/menus.min.js +0 -1
- package/lib/src/permission.min.js +0 -1
- package/lib/src/popper-utils.min.js +0 -1
- package/lib/src/renderer.min.js +0 -1
- package/lib/src/resize.min.js +0 -1
- package/lib/src/scrollbar-utils.min.js +0 -1
- package/lib/src/store.min.js +0 -1
- package/lib/src/theme.min.js +0 -1
- package/lib/src/themeStore.min.js +0 -1
- package/lib/src/useFns.min.js +0 -1
- package/lib/src/validators.min.js +0 -1
- package/lib/src/vm.min.js +0 -1
- package/lib/src/z-index.min.js +0 -1
package/lib/src/z-index.js
CHANGED
|
@@ -1,34 +1,60 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty
|
|
4
|
-
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var z_index_exports = {};
|
|
30
|
+
__export(z_index_exports, {
|
|
31
|
+
zIndex: () => zIndex
|
|
5
32
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
const zIndex = exports.zIndex = {
|
|
33
|
+
module.exports = __toCommonJS(z_index_exports);
|
|
34
|
+
var import_dom_zindex = __toESM(require("dom-zindex"));
|
|
35
|
+
const zIndex = {
|
|
10
36
|
/**
|
|
11
37
|
* 获取主层级下一个 z-index
|
|
12
38
|
*/
|
|
13
39
|
next() {
|
|
14
|
-
return
|
|
40
|
+
return import_dom_zindex.default.getNext();
|
|
15
41
|
},
|
|
16
42
|
/**
|
|
17
43
|
* 获取主层级最后一个 z-index
|
|
18
44
|
*/
|
|
19
45
|
getLast() {
|
|
20
|
-
return
|
|
46
|
+
return import_dom_zindex.default.getCurrent();
|
|
21
47
|
},
|
|
22
48
|
/**
|
|
23
49
|
* 获取子层级的下一个 z-index
|
|
24
50
|
*/
|
|
25
51
|
nextSub() {
|
|
26
|
-
return
|
|
52
|
+
return import_dom_zindex.default.getSubNext();
|
|
27
53
|
},
|
|
28
54
|
/**
|
|
29
55
|
* 获取子层级的最后一个 z-index
|
|
30
56
|
*/
|
|
31
57
|
getSubLast() {
|
|
32
|
-
return
|
|
58
|
+
return import_dom_zindex.default.getSubCurrent();
|
|
33
59
|
}
|
|
34
|
-
};
|
|
60
|
+
};
|
package/package.json
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vxe-ui/core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.1",
|
|
4
4
|
"description": "Vxe UI core library",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"update": "npm install --legacy-peer-deps",
|
|
7
|
+
"lint": "vue-cli-service lint",
|
|
8
|
+
"lint:es": "eslint packages/** types/**",
|
|
9
|
+
"lint:ox": "oxfmt --check packages/** types/**",
|
|
10
|
+
"esfix": "eslint --fix packages/** types/**",
|
|
11
|
+
"oxfix": "oxfmt packages/** types/** --write",
|
|
7
12
|
"lib:pack": "vue-cli-service build --target lib --name index --dest lib_temp packages/index.ts",
|
|
8
13
|
"lib:modules": "gulp build",
|
|
9
|
-
"lib": "npm run lib:pack && npm run lib:modules"
|
|
14
|
+
"lib:old": "npm run lib:pack && npm run lib:modules",
|
|
15
|
+
"lib:new": "node scripts/build-modules.js",
|
|
16
|
+
"lib": "npm run lib:new"
|
|
10
17
|
},
|
|
11
18
|
"files": [
|
|
12
19
|
"dist",
|
|
@@ -25,7 +32,7 @@
|
|
|
25
32
|
"vue": "^3.2.0"
|
|
26
33
|
},
|
|
27
34
|
"dependencies": {
|
|
28
|
-
"dom-zindex": "^1.0.
|
|
35
|
+
"dom-zindex": "^1.0.8",
|
|
29
36
|
"xe-utils": "^4.1.3"
|
|
30
37
|
},
|
|
31
38
|
"devDependencies": {
|
|
@@ -58,7 +65,11 @@
|
|
|
58
65
|
"gulp-sourcemaps": "^3.0.0",
|
|
59
66
|
"gulp-typescript": "^5.0.1",
|
|
60
67
|
"gulp-uglify": "^3.0.2",
|
|
68
|
+
"oxfmt": "~0.51.0",
|
|
61
69
|
"postcss": "^8.4.38",
|
|
70
|
+
"sass": "~1.101.7",
|
|
71
|
+
"sass-loader": "^14.2.1",
|
|
72
|
+
"sass-embedded": "^1.106.1",
|
|
62
73
|
"rollup": "^4.53.3",
|
|
63
74
|
"typescript": "~5.9.3",
|
|
64
75
|
"vue": "3.4.27"
|
package/packages/index.ts
CHANGED
|
@@ -1,168 +1,171 @@
|
|
|
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 { zIndex } from './src/z-index'
|
|
19
|
-
import { baseUtils } from './src/base-utils'
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
components[
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
export * from './src/
|
|
140
|
-
|
|
141
|
-
export * from './src/
|
|
142
|
-
|
|
143
|
-
export * from './src/
|
|
144
|
-
export * from './src/
|
|
145
|
-
export * from './src/
|
|
146
|
-
export * from './src/
|
|
147
|
-
export * from './src/
|
|
148
|
-
export * from './src/
|
|
149
|
-
export * from './src/
|
|
150
|
-
export * from './src/
|
|
151
|
-
export * from './src/
|
|
152
|
-
export * from './src/
|
|
153
|
-
|
|
154
|
-
export * from './src/
|
|
155
|
-
|
|
156
|
-
export * from './src/
|
|
157
|
-
|
|
158
|
-
export * from './src/
|
|
159
|
-
export * from './src/
|
|
160
|
-
|
|
161
|
-
export * from './src/
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
export * from './src/
|
|
165
|
-
|
|
166
|
-
export * from './src/
|
|
167
|
-
|
|
168
|
-
export
|
|
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 { zIndex } from './src/z-index'
|
|
19
|
+
import { baseUtils } from './src/base-utils'
|
|
20
|
+
import { dbUtils } from './src/db-utils'
|
|
21
|
+
import { domUtils } from './src/dom-utils'
|
|
22
|
+
import { scrollbarUtils } from './src/scrollbar-utils'
|
|
23
|
+
import { popperUtils } from './src/popper-utils'
|
|
24
|
+
import { log } from './src/log'
|
|
25
|
+
import { hooks } from './src/hooks'
|
|
26
|
+
import { useFns } from './src/useFns'
|
|
27
|
+
import { getSlotVNs } from './src/vm'
|
|
28
|
+
import XEUtils from 'xe-utils'
|
|
29
|
+
|
|
30
|
+
import { VxeGlobalComponents, VxeUIPluginObject } from '../types'
|
|
31
|
+
|
|
32
|
+
const installedPlugins: VxeUIPluginObject[] = []
|
|
33
|
+
|
|
34
|
+
export function use(Plugin: VxeUIPluginObject, options: any[]) {
|
|
35
|
+
if (Plugin && Plugin.install) {
|
|
36
|
+
if (installedPlugins.indexOf(Plugin) === -1) {
|
|
37
|
+
Plugin.install(VxeUI, options)
|
|
38
|
+
installedPlugins.push(Plugin)
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return VxeUI
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const components: Record<string, any> = {}
|
|
45
|
+
|
|
46
|
+
export function getComponent(name: keyof VxeGlobalComponents) {
|
|
47
|
+
return components[name] || null
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function hasComponent(name: keyof VxeGlobalComponents) {
|
|
51
|
+
return !!components[name]
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function component(comp: any) {
|
|
55
|
+
if (comp && comp.name) {
|
|
56
|
+
components[comp.name] = comp
|
|
57
|
+
components[XEUtils.kebabCase(comp.name)] = comp
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function renderEmptyElement() {
|
|
62
|
+
return createCommentVNode()
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function checkVersion(version: string, pVersion: number, sVersion?: number) {
|
|
66
|
+
if (version) {
|
|
67
|
+
const vRest = `${version}`.match(/(\d+).(\d+).(\d+)/)
|
|
68
|
+
if (vRest) {
|
|
69
|
+
const pV = XEUtils.toNumber(vRest[1])
|
|
70
|
+
if (sVersion) {
|
|
71
|
+
const sV = XEUtils.toNumber(vRest[2])
|
|
72
|
+
return pV >= pVersion && sV >= sVersion
|
|
73
|
+
}
|
|
74
|
+
return pV >= pVersion
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return false
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export const VxeUI = Object.assign(VxeCore, {
|
|
81
|
+
renderEmptyElement,
|
|
82
|
+
|
|
83
|
+
setTheme,
|
|
84
|
+
getTheme,
|
|
85
|
+
setConfig,
|
|
86
|
+
getConfig: getConfig as any,
|
|
87
|
+
|
|
88
|
+
setIcon,
|
|
89
|
+
getIcon: getIcon as any,
|
|
90
|
+
renderGlobalIcon,
|
|
91
|
+
renderCustomIcon,
|
|
92
|
+
|
|
93
|
+
setLanguage,
|
|
94
|
+
hasLanguage,
|
|
95
|
+
getLanguage,
|
|
96
|
+
setI18n,
|
|
97
|
+
getI18n,
|
|
98
|
+
|
|
99
|
+
globalEvents,
|
|
100
|
+
GLOBAL_EVENT_KEYS,
|
|
101
|
+
createEvent,
|
|
102
|
+
|
|
103
|
+
globalResize,
|
|
104
|
+
renderer,
|
|
105
|
+
validators,
|
|
106
|
+
menus,
|
|
107
|
+
formats,
|
|
108
|
+
commands,
|
|
109
|
+
interceptor,
|
|
110
|
+
clipboard,
|
|
111
|
+
log,
|
|
112
|
+
permission,
|
|
113
|
+
|
|
114
|
+
zIndex,
|
|
115
|
+
|
|
116
|
+
baseUtils,
|
|
117
|
+
dbUtils,
|
|
118
|
+
domUtils,
|
|
119
|
+
scrollbarUtils,
|
|
120
|
+
popperUtils,
|
|
121
|
+
|
|
122
|
+
globalStore,
|
|
123
|
+
|
|
124
|
+
hooks,
|
|
125
|
+
component,
|
|
126
|
+
getComponent,
|
|
127
|
+
hasComponent,
|
|
128
|
+
|
|
129
|
+
useFns,
|
|
130
|
+
getSlotVNs,
|
|
131
|
+
|
|
132
|
+
checkVersion,
|
|
133
|
+
|
|
134
|
+
use
|
|
135
|
+
})
|
|
136
|
+
|
|
137
|
+
setTheme()
|
|
138
|
+
|
|
139
|
+
export * from './src/core'
|
|
140
|
+
export * from './src/event'
|
|
141
|
+
export * from './src/resize'
|
|
142
|
+
|
|
143
|
+
export * from './src/config'
|
|
144
|
+
export * from './src/i18n'
|
|
145
|
+
export * from './src/icon'
|
|
146
|
+
export * from './src/theme'
|
|
147
|
+
export * from './src/renderer'
|
|
148
|
+
export * from './src/validators'
|
|
149
|
+
export * from './src/menus'
|
|
150
|
+
export * from './src/formats'
|
|
151
|
+
export * from './src/commands'
|
|
152
|
+
export * from './src/interceptor'
|
|
153
|
+
export * from './src/clipboard'
|
|
154
|
+
export * from './src/permission'
|
|
155
|
+
|
|
156
|
+
export * from './src/z-index'
|
|
157
|
+
|
|
158
|
+
export * from './src/base-utils'
|
|
159
|
+
export * from './src/db-utils'
|
|
160
|
+
export * from './src/dom-utils'
|
|
161
|
+
export * from './src/scrollbar-utils'
|
|
162
|
+
export * from './src/popper-utils'
|
|
163
|
+
|
|
164
|
+
export * from './src/dataStore'
|
|
165
|
+
|
|
166
|
+
export * from './src/useFns'
|
|
167
|
+
export * from './src/vm'
|
|
168
|
+
export * from './src/log'
|
|
169
|
+
export * from './src/hooks'
|
|
170
|
+
|
|
171
|
+
export default VxeUI
|
|
@@ -1,43 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
*
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
1
|
+
import XEUtils from 'xe-utils'
|
|
2
|
+
|
|
3
|
+
import { VxeBaseUtils, VxeBaseEmptyValue } from '../../types'
|
|
4
|
+
|
|
5
|
+
export const baseUtils: VxeBaseUtils = {
|
|
6
|
+
/**
|
|
7
|
+
* 转成字符串
|
|
8
|
+
*/
|
|
9
|
+
toString(content) {
|
|
10
|
+
if (XEUtils.eqNull(content)) {
|
|
11
|
+
return ''
|
|
12
|
+
}
|
|
13
|
+
return '' + content
|
|
14
|
+
},
|
|
15
|
+
/**
|
|
16
|
+
* 判断值为:'' | null | undefined 时都属于空值
|
|
17
|
+
*/
|
|
18
|
+
isEmpty(value): value is VxeBaseEmptyValue {
|
|
19
|
+
return value === null || value === undefined || value === ''
|
|
20
|
+
},
|
|
21
|
+
/**
|
|
22
|
+
* 获取配置值,如果存在则返回,如果不存在则使用默认值
|
|
23
|
+
*/
|
|
24
|
+
getDefVal(value, defVal) {
|
|
25
|
+
return XEUtils.eqNull(value) ? defVal : value
|
|
26
|
+
},
|
|
27
|
+
/**
|
|
28
|
+
* 判断是否启用
|
|
29
|
+
*/
|
|
30
|
+
isEnabled(conf: any) {
|
|
31
|
+
return !!(conf && conf.enabled !== false)
|
|
32
|
+
},
|
|
33
|
+
/**
|
|
34
|
+
* 用于开关类型的配置项
|
|
35
|
+
* 局部启用规则:conf={}
|
|
36
|
+
* 局部禁用规则:conf={enabled:false}
|
|
37
|
+
* 全局默认启用规则:conf.enabled=true
|
|
38
|
+
*/
|
|
39
|
+
hasEnableConf(conf, opts) {
|
|
40
|
+
return !!(opts && (conf ? opts.enabled !== false : opts.enabled))
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -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
|
|
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
|
|
32
|
-
Object.assign(clipStore, data || {})
|
|
33
|
-
},
|
|
34
|
-
/**
|
|
35
|
-
* 复制内容到剪贴板
|
|
36
|
-
*
|
|
37
|
-
* @param {String} content Text 内容
|
|
38
|
-
*/
|
|
39
|
-
copy
|
|
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
|
+
}
|