@vxe-ui/core 4.4.41 → 4.5.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.
- package/dist/all.esm.js +1364 -1390
- package/es/index.d.ts +135 -0
- package/es/index.esm.js +135 -125
- package/es/index.js +147 -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/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 +133 -365
- package/lib/index.js +178 -0
- package/lib/index.umd.js +588 -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/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 +168 -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/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/dom-utils.d.ts +36 -37
- package/types/core/formats.d.ts +17 -19
- package/types/core/global-config.d.ts +68 -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 +336 -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/es/index.d.ts
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { setConfig } from './src/config';
|
|
2
|
+
import { setIcon, renderGlobalIcon, renderCustomIcon } from './src/icon';
|
|
3
|
+
import { setTheme, getTheme } from './src/theme';
|
|
4
|
+
import { getI18n, setI18n, setLanguage, hasLanguage, getLanguage } from './src/i18n';
|
|
5
|
+
import { getSlotVNs } from './src/vm';
|
|
6
|
+
import { VxeGlobalComponents, VxeUIPluginObject } from '../types';
|
|
7
|
+
export declare function use(Plugin: VxeUIPluginObject, options: any[]): import("../types").VxeUIExport & {
|
|
8
|
+
renderEmptyElement: typeof renderEmptyElement;
|
|
9
|
+
setTheme: typeof setTheme;
|
|
10
|
+
getTheme: typeof getTheme;
|
|
11
|
+
setConfig: typeof setConfig;
|
|
12
|
+
getConfig: any;
|
|
13
|
+
setIcon: typeof setIcon;
|
|
14
|
+
getIcon: any;
|
|
15
|
+
renderGlobalIcon: typeof renderGlobalIcon;
|
|
16
|
+
renderCustomIcon: typeof renderCustomIcon;
|
|
17
|
+
setLanguage: typeof setLanguage;
|
|
18
|
+
hasLanguage: typeof hasLanguage;
|
|
19
|
+
getLanguage: typeof getLanguage;
|
|
20
|
+
setI18n: typeof setI18n;
|
|
21
|
+
getI18n: typeof getI18n;
|
|
22
|
+
globalEvents: import("../types").VxeGlobalEvents;
|
|
23
|
+
GLOBAL_EVENT_KEYS: import("../types").VxeGlobalEventKey;
|
|
24
|
+
createEvent: import("../types").VxeGlobalCreateEventMethod;
|
|
25
|
+
globalResize: import("../types").VxeGlobalResize;
|
|
26
|
+
renderer: import("../types").VxeGlobalRenderer;
|
|
27
|
+
validators: import("../types").VxeGlobalValidators;
|
|
28
|
+
menus: import("../types").VxeGlobalMenus;
|
|
29
|
+
formats: import("../types").VxeGlobalFormats;
|
|
30
|
+
commands: import("../types").VxeGlobalCommands;
|
|
31
|
+
interceptor: import("../types").VxeGlobalInterceptor;
|
|
32
|
+
clipboard: import("../types").VxeGlobalClipboard;
|
|
33
|
+
log: import("../types").VxeGlobalLog;
|
|
34
|
+
permission: import("../types").VxeGlobalPermission;
|
|
35
|
+
zIndex: import("../types").VxeZIndex;
|
|
36
|
+
baseUtils: import("../types").VxeBaseUtils;
|
|
37
|
+
domUtils: import("../types").VxeDomUtils;
|
|
38
|
+
scrollbarUtils: import("../types").VxeScrollbarUtils;
|
|
39
|
+
popperUtils: import("../types").VxePopperUtils;
|
|
40
|
+
globalStore: import("../types").VxeGlobalData;
|
|
41
|
+
hooks: import("../types").VxeGlobalHooks;
|
|
42
|
+
component: typeof component;
|
|
43
|
+
getComponent: typeof getComponent;
|
|
44
|
+
hasComponent: typeof hasComponent;
|
|
45
|
+
useFns: {
|
|
46
|
+
useSize: typeof import(".").useSize;
|
|
47
|
+
useVScrollbar: typeof import(".").useVScrollbar;
|
|
48
|
+
usePermission: typeof import(".").usePermission;
|
|
49
|
+
useInitVScrollbar: import("../types").VxeUseInitVScrollbar;
|
|
50
|
+
};
|
|
51
|
+
getSlotVNs: typeof getSlotVNs;
|
|
52
|
+
checkVersion: typeof checkVersion;
|
|
53
|
+
use: typeof use;
|
|
54
|
+
};
|
|
55
|
+
export declare function getComponent(name: keyof VxeGlobalComponents): any;
|
|
56
|
+
export declare function hasComponent(name: keyof VxeGlobalComponents): boolean;
|
|
57
|
+
export declare function component(comp: any): void;
|
|
58
|
+
export declare function renderEmptyElement(): import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
59
|
+
[key: string]: any;
|
|
60
|
+
}>;
|
|
61
|
+
export declare function checkVersion(version: string, pVersion: number, sVersion?: number): boolean;
|
|
62
|
+
export declare const VxeUI: import("../types").VxeUIExport & {
|
|
63
|
+
renderEmptyElement: typeof renderEmptyElement;
|
|
64
|
+
setTheme: typeof setTheme;
|
|
65
|
+
getTheme: typeof getTheme;
|
|
66
|
+
setConfig: typeof setConfig;
|
|
67
|
+
getConfig: any;
|
|
68
|
+
setIcon: typeof setIcon;
|
|
69
|
+
getIcon: any;
|
|
70
|
+
renderGlobalIcon: typeof renderGlobalIcon;
|
|
71
|
+
renderCustomIcon: typeof renderCustomIcon;
|
|
72
|
+
setLanguage: typeof setLanguage;
|
|
73
|
+
hasLanguage: typeof hasLanguage;
|
|
74
|
+
getLanguage: typeof getLanguage;
|
|
75
|
+
setI18n: typeof setI18n;
|
|
76
|
+
getI18n: typeof getI18n;
|
|
77
|
+
globalEvents: import("../types").VxeGlobalEvents;
|
|
78
|
+
GLOBAL_EVENT_KEYS: import("../types").VxeGlobalEventKey;
|
|
79
|
+
createEvent: import("../types").VxeGlobalCreateEventMethod;
|
|
80
|
+
globalResize: import("../types").VxeGlobalResize;
|
|
81
|
+
renderer: import("../types").VxeGlobalRenderer;
|
|
82
|
+
validators: import("../types").VxeGlobalValidators;
|
|
83
|
+
menus: import("../types").VxeGlobalMenus;
|
|
84
|
+
formats: import("../types").VxeGlobalFormats;
|
|
85
|
+
commands: import("../types").VxeGlobalCommands;
|
|
86
|
+
interceptor: import("../types").VxeGlobalInterceptor;
|
|
87
|
+
clipboard: import("../types").VxeGlobalClipboard;
|
|
88
|
+
log: import("../types").VxeGlobalLog;
|
|
89
|
+
permission: import("../types").VxeGlobalPermission;
|
|
90
|
+
zIndex: import("../types").VxeZIndex;
|
|
91
|
+
baseUtils: import("../types").VxeBaseUtils;
|
|
92
|
+
domUtils: import("../types").VxeDomUtils;
|
|
93
|
+
scrollbarUtils: import("../types").VxeScrollbarUtils;
|
|
94
|
+
popperUtils: import("../types").VxePopperUtils;
|
|
95
|
+
globalStore: import("../types").VxeGlobalData;
|
|
96
|
+
hooks: import("../types").VxeGlobalHooks;
|
|
97
|
+
component: typeof component;
|
|
98
|
+
getComponent: typeof getComponent;
|
|
99
|
+
hasComponent: typeof hasComponent;
|
|
100
|
+
useFns: {
|
|
101
|
+
useSize: typeof import(".").useSize;
|
|
102
|
+
useVScrollbar: typeof import(".").useVScrollbar;
|
|
103
|
+
usePermission: typeof import(".").usePermission;
|
|
104
|
+
useInitVScrollbar: import("../types").VxeUseInitVScrollbar;
|
|
105
|
+
};
|
|
106
|
+
getSlotVNs: typeof getSlotVNs;
|
|
107
|
+
checkVersion: typeof checkVersion;
|
|
108
|
+
use: typeof use;
|
|
109
|
+
};
|
|
110
|
+
export * from './src/core';
|
|
111
|
+
export * from './src/event';
|
|
112
|
+
export * from './src/resize';
|
|
113
|
+
export * from './src/config';
|
|
114
|
+
export * from './src/i18n';
|
|
115
|
+
export * from './src/icon';
|
|
116
|
+
export * from './src/theme';
|
|
117
|
+
export * from './src/renderer';
|
|
118
|
+
export * from './src/validators';
|
|
119
|
+
export * from './src/menus';
|
|
120
|
+
export * from './src/formats';
|
|
121
|
+
export * from './src/commands';
|
|
122
|
+
export * from './src/interceptor';
|
|
123
|
+
export * from './src/clipboard';
|
|
124
|
+
export * from './src/permission';
|
|
125
|
+
export * from './src/z-index';
|
|
126
|
+
export * from './src/base-utils';
|
|
127
|
+
export * from './src/dom-utils';
|
|
128
|
+
export * from './src/scrollbar-utils';
|
|
129
|
+
export * from './src/popper-utils';
|
|
130
|
+
export * from './src/dataStore';
|
|
131
|
+
export * from './src/useFns';
|
|
132
|
+
export * from './src/vm';
|
|
133
|
+
export * from './src/log';
|
|
134
|
+
export * from './src/hooks';
|
|
135
|
+
export default VxeUI;
|
package/es/index.esm.js
CHANGED
|
@@ -1,137 +1,147 @@
|
|
|
1
|
-
import { VxeCore } from
|
|
2
|
-
import { createCommentVNode } from
|
|
3
|
-
import { setConfig, getConfig } from
|
|
4
|
-
import { globalStore } from
|
|
5
|
-
import { setIcon, getIcon, renderGlobalIcon, renderCustomIcon } from
|
|
6
|
-
import { setTheme, getTheme } from
|
|
7
|
-
import { globalEvents, GLOBAL_EVENT_KEYS, createEvent } from
|
|
8
|
-
import { globalResize } from
|
|
9
|
-
import { getI18n, setI18n, setLanguage, hasLanguage, getLanguage } from
|
|
10
|
-
import { renderer } from
|
|
11
|
-
import { validators } from
|
|
12
|
-
import { menus } from
|
|
13
|
-
import { formats } from
|
|
14
|
-
import { commands } from
|
|
15
|
-
import { interceptor } from
|
|
16
|
-
import { clipboard } from
|
|
17
|
-
import { permission } from
|
|
18
|
-
import { zIndex } from
|
|
19
|
-
import { baseUtils } from
|
|
20
|
-
import { domUtils } from
|
|
21
|
-
import { scrollbarUtils } from
|
|
22
|
-
import { popperUtils } from
|
|
23
|
-
import { log } from
|
|
24
|
-
import { hooks } from
|
|
25
|
-
import { useFns } from
|
|
26
|
-
import { getSlotVNs } from
|
|
27
|
-
import XEUtils from
|
|
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 { domUtils } from "./src/dom-utils";
|
|
21
|
+
import { scrollbarUtils } from "./src/scrollbar-utils";
|
|
22
|
+
import { popperUtils } from "./src/popper-utils";
|
|
23
|
+
import { log } from "./src/log";
|
|
24
|
+
import { hooks } from "./src/hooks";
|
|
25
|
+
import { useFns } from "./src/useFns";
|
|
26
|
+
import { getSlotVNs } from "./src/vm";
|
|
27
|
+
import XEUtils from "xe-utils";
|
|
28
28
|
const installedPlugins = [];
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
29
|
+
function use(Plugin, options) {
|
|
30
|
+
if (Plugin && Plugin.install) {
|
|
31
|
+
if (installedPlugins.indexOf(Plugin) === -1) {
|
|
32
|
+
Plugin.install(VxeUI, options);
|
|
33
|
+
installedPlugins.push(Plugin);
|
|
35
34
|
}
|
|
36
|
-
|
|
35
|
+
}
|
|
36
|
+
return VxeUI;
|
|
37
37
|
}
|
|
38
38
|
const components = {};
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
function getComponent(name) {
|
|
40
|
+
return components[name] || null;
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
function hasComponent(name) {
|
|
43
|
+
return !!components[name];
|
|
44
44
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
function component(comp) {
|
|
46
|
+
if (comp && comp.name) {
|
|
47
|
+
components[comp.name] = comp;
|
|
48
|
+
components[XEUtils.kebabCase(comp.name)] = comp;
|
|
49
|
+
}
|
|
50
50
|
}
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
function renderEmptyElement() {
|
|
52
|
+
return createCommentVNode();
|
|
53
53
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
54
|
+
function checkVersion(version, pVersion, sVersion) {
|
|
55
|
+
if (version) {
|
|
56
|
+
const vRest = `${version}`.match(/(\d+).(\d+).(\d+)/);
|
|
57
|
+
if (vRest) {
|
|
58
|
+
const pV = XEUtils.toNumber(vRest[1]);
|
|
59
|
+
if (sVersion) {
|
|
60
|
+
const sV = XEUtils.toNumber(vRest[2]);
|
|
61
|
+
return pV >= pVersion && sV >= sVersion;
|
|
62
|
+
}
|
|
63
|
+
return pV >= pVersion;
|
|
65
64
|
}
|
|
66
|
-
|
|
65
|
+
}
|
|
66
|
+
return false;
|
|
67
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
|
-
|
|
68
|
+
const VxeUI = Object.assign(VxeCore, {
|
|
69
|
+
renderEmptyElement,
|
|
70
|
+
setTheme,
|
|
71
|
+
getTheme,
|
|
72
|
+
setConfig,
|
|
73
|
+
getConfig,
|
|
74
|
+
setIcon,
|
|
75
|
+
getIcon,
|
|
76
|
+
renderGlobalIcon,
|
|
77
|
+
renderCustomIcon,
|
|
78
|
+
setLanguage,
|
|
79
|
+
hasLanguage,
|
|
80
|
+
getLanguage,
|
|
81
|
+
setI18n,
|
|
82
|
+
getI18n,
|
|
83
|
+
globalEvents,
|
|
84
|
+
GLOBAL_EVENT_KEYS,
|
|
85
|
+
createEvent,
|
|
86
|
+
globalResize,
|
|
87
|
+
renderer,
|
|
88
|
+
validators,
|
|
89
|
+
menus,
|
|
90
|
+
formats,
|
|
91
|
+
commands,
|
|
92
|
+
interceptor,
|
|
93
|
+
clipboard,
|
|
94
|
+
log,
|
|
95
|
+
permission,
|
|
96
|
+
zIndex,
|
|
97
|
+
baseUtils,
|
|
98
|
+
domUtils,
|
|
99
|
+
scrollbarUtils,
|
|
100
|
+
popperUtils,
|
|
101
|
+
globalStore,
|
|
102
|
+
hooks,
|
|
103
|
+
component,
|
|
104
|
+
getComponent,
|
|
105
|
+
hasComponent,
|
|
106
|
+
useFns,
|
|
107
|
+
getSlotVNs,
|
|
108
|
+
checkVersion,
|
|
109
|
+
use
|
|
110
110
|
});
|
|
111
111
|
setTheme();
|
|
112
|
-
export * from
|
|
113
|
-
export * from
|
|
114
|
-
export * from
|
|
115
|
-
export * from
|
|
116
|
-
export * from
|
|
117
|
-
export * from
|
|
118
|
-
export * from
|
|
119
|
-
export * from
|
|
120
|
-
export * from
|
|
121
|
-
export * from
|
|
122
|
-
export * from
|
|
123
|
-
export * from
|
|
124
|
-
export * from
|
|
125
|
-
export * from
|
|
126
|
-
export * from
|
|
127
|
-
export * from
|
|
128
|
-
export * from
|
|
129
|
-
export * from
|
|
130
|
-
export * from
|
|
131
|
-
export * from
|
|
132
|
-
export * from
|
|
133
|
-
export * from
|
|
134
|
-
export * from
|
|
135
|
-
export * from
|
|
136
|
-
export * from
|
|
137
|
-
|
|
112
|
+
export * from "./src/core";
|
|
113
|
+
export * from "./src/event";
|
|
114
|
+
export * from "./src/resize";
|
|
115
|
+
export * from "./src/config";
|
|
116
|
+
export * from "./src/i18n";
|
|
117
|
+
export * from "./src/icon";
|
|
118
|
+
export * from "./src/theme";
|
|
119
|
+
export * from "./src/renderer";
|
|
120
|
+
export * from "./src/validators";
|
|
121
|
+
export * from "./src/menus";
|
|
122
|
+
export * from "./src/formats";
|
|
123
|
+
export * from "./src/commands";
|
|
124
|
+
export * from "./src/interceptor";
|
|
125
|
+
export * from "./src/clipboard";
|
|
126
|
+
export * from "./src/permission";
|
|
127
|
+
export * from "./src/z-index";
|
|
128
|
+
export * from "./src/base-utils";
|
|
129
|
+
export * from "./src/dom-utils";
|
|
130
|
+
export * from "./src/scrollbar-utils";
|
|
131
|
+
export * from "./src/popper-utils";
|
|
132
|
+
export * from "./src/dataStore";
|
|
133
|
+
export * from "./src/useFns";
|
|
134
|
+
export * from "./src/vm";
|
|
135
|
+
export * from "./src/log";
|
|
136
|
+
export * from "./src/hooks";
|
|
137
|
+
var index_default = VxeUI;
|
|
138
|
+
export {
|
|
139
|
+
VxeUI,
|
|
140
|
+
checkVersion,
|
|
141
|
+
component,
|
|
142
|
+
index_default as default,
|
|
143
|
+
getComponent,
|
|
144
|
+
hasComponent,
|
|
145
|
+
renderEmptyElement,
|
|
146
|
+
use
|
|
147
|
+
};
|
package/es/index.js
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
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 { domUtils } from "./src/dom-utils";
|
|
21
|
+
import { scrollbarUtils } from "./src/scrollbar-utils";
|
|
22
|
+
import { popperUtils } from "./src/popper-utils";
|
|
23
|
+
import { log } from "./src/log";
|
|
24
|
+
import { hooks } from "./src/hooks";
|
|
25
|
+
import { useFns } from "./src/useFns";
|
|
26
|
+
import { getSlotVNs } from "./src/vm";
|
|
27
|
+
import XEUtils from "xe-utils";
|
|
28
|
+
const installedPlugins = [];
|
|
29
|
+
function use(Plugin, options) {
|
|
30
|
+
if (Plugin && Plugin.install) {
|
|
31
|
+
if (installedPlugins.indexOf(Plugin) === -1) {
|
|
32
|
+
Plugin.install(VxeUI, options);
|
|
33
|
+
installedPlugins.push(Plugin);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return VxeUI;
|
|
37
|
+
}
|
|
38
|
+
const components = {};
|
|
39
|
+
function getComponent(name) {
|
|
40
|
+
return components[name] || null;
|
|
41
|
+
}
|
|
42
|
+
function hasComponent(name) {
|
|
43
|
+
return !!components[name];
|
|
44
|
+
}
|
|
45
|
+
function component(comp) {
|
|
46
|
+
if (comp && comp.name) {
|
|
47
|
+
components[comp.name] = comp;
|
|
48
|
+
components[XEUtils.kebabCase(comp.name)] = comp;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function renderEmptyElement() {
|
|
52
|
+
return createCommentVNode();
|
|
53
|
+
}
|
|
54
|
+
function checkVersion(version, pVersion, sVersion) {
|
|
55
|
+
if (version) {
|
|
56
|
+
const vRest = `${version}`.match(/(\d+).(\d+).(\d+)/);
|
|
57
|
+
if (vRest) {
|
|
58
|
+
const pV = XEUtils.toNumber(vRest[1]);
|
|
59
|
+
if (sVersion) {
|
|
60
|
+
const sV = XEUtils.toNumber(vRest[2]);
|
|
61
|
+
return pV >= pVersion && sV >= sVersion;
|
|
62
|
+
}
|
|
63
|
+
return pV >= pVersion;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
const VxeUI = Object.assign(VxeCore, {
|
|
69
|
+
renderEmptyElement,
|
|
70
|
+
setTheme,
|
|
71
|
+
getTheme,
|
|
72
|
+
setConfig,
|
|
73
|
+
getConfig,
|
|
74
|
+
setIcon,
|
|
75
|
+
getIcon,
|
|
76
|
+
renderGlobalIcon,
|
|
77
|
+
renderCustomIcon,
|
|
78
|
+
setLanguage,
|
|
79
|
+
hasLanguage,
|
|
80
|
+
getLanguage,
|
|
81
|
+
setI18n,
|
|
82
|
+
getI18n,
|
|
83
|
+
globalEvents,
|
|
84
|
+
GLOBAL_EVENT_KEYS,
|
|
85
|
+
createEvent,
|
|
86
|
+
globalResize,
|
|
87
|
+
renderer,
|
|
88
|
+
validators,
|
|
89
|
+
menus,
|
|
90
|
+
formats,
|
|
91
|
+
commands,
|
|
92
|
+
interceptor,
|
|
93
|
+
clipboard,
|
|
94
|
+
log,
|
|
95
|
+
permission,
|
|
96
|
+
zIndex,
|
|
97
|
+
baseUtils,
|
|
98
|
+
domUtils,
|
|
99
|
+
scrollbarUtils,
|
|
100
|
+
popperUtils,
|
|
101
|
+
globalStore,
|
|
102
|
+
hooks,
|
|
103
|
+
component,
|
|
104
|
+
getComponent,
|
|
105
|
+
hasComponent,
|
|
106
|
+
useFns,
|
|
107
|
+
getSlotVNs,
|
|
108
|
+
checkVersion,
|
|
109
|
+
use
|
|
110
|
+
});
|
|
111
|
+
setTheme();
|
|
112
|
+
export * from "./src/core";
|
|
113
|
+
export * from "./src/event";
|
|
114
|
+
export * from "./src/resize";
|
|
115
|
+
export * from "./src/config";
|
|
116
|
+
export * from "./src/i18n";
|
|
117
|
+
export * from "./src/icon";
|
|
118
|
+
export * from "./src/theme";
|
|
119
|
+
export * from "./src/renderer";
|
|
120
|
+
export * from "./src/validators";
|
|
121
|
+
export * from "./src/menus";
|
|
122
|
+
export * from "./src/formats";
|
|
123
|
+
export * from "./src/commands";
|
|
124
|
+
export * from "./src/interceptor";
|
|
125
|
+
export * from "./src/clipboard";
|
|
126
|
+
export * from "./src/permission";
|
|
127
|
+
export * from "./src/z-index";
|
|
128
|
+
export * from "./src/base-utils";
|
|
129
|
+
export * from "./src/dom-utils";
|
|
130
|
+
export * from "./src/scrollbar-utils";
|
|
131
|
+
export * from "./src/popper-utils";
|
|
132
|
+
export * from "./src/dataStore";
|
|
133
|
+
export * from "./src/useFns";
|
|
134
|
+
export * from "./src/vm";
|
|
135
|
+
export * from "./src/log";
|
|
136
|
+
export * from "./src/hooks";
|
|
137
|
+
var index_default = VxeUI;
|
|
138
|
+
export {
|
|
139
|
+
VxeUI,
|
|
140
|
+
checkVersion,
|
|
141
|
+
component,
|
|
142
|
+
index_default as default,
|
|
143
|
+
getComponent,
|
|
144
|
+
hasComponent,
|
|
145
|
+
renderEmptyElement,
|
|
146
|
+
use
|
|
147
|
+
};
|
package/es/src/base-utils.js
CHANGED
|
@@ -1,39 +1,42 @@
|
|
|
1
|
-
import XEUtils from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
return '' + content;
|
|
11
|
-
},
|
|
12
|
-
/**
|
|
13
|
-
* 判断值为:'' | null | undefined 时都属于空值
|
|
14
|
-
*/
|
|
15
|
-
isEmpty(value) {
|
|
16
|
-
return value === null || value === undefined || value === '';
|
|
17
|
-
},
|
|
18
|
-
/**
|
|
19
|
-
* 获取配置值,如果存在则返回,如果不存在则使用默认值
|
|
20
|
-
*/
|
|
21
|
-
getDefVal(value, defVal) {
|
|
22
|
-
return XEUtils.eqNull(value) ? defVal : value;
|
|
23
|
-
},
|
|
24
|
-
/**
|
|
25
|
-
* 判断是否启用
|
|
26
|
-
*/
|
|
27
|
-
isEnabled(conf) {
|
|
28
|
-
return !!(conf && conf.enabled !== false);
|
|
29
|
-
},
|
|
30
|
-
/**
|
|
31
|
-
* 用于开关类型的配置项
|
|
32
|
-
* 局部启用规则:conf={}
|
|
33
|
-
* 局部禁用规则:conf={enabled:false}
|
|
34
|
-
* 全局默认启用规则:conf.enabled=true
|
|
35
|
-
*/
|
|
36
|
-
hasEnableConf(conf, opts) {
|
|
37
|
-
return !!(opts && (conf ? opts.enabled !== false : opts.enabled));
|
|
1
|
+
import XEUtils from "xe-utils";
|
|
2
|
+
const baseUtils = {
|
|
3
|
+
/**
|
|
4
|
+
* 转成字符串
|
|
5
|
+
*/
|
|
6
|
+
toString(content) {
|
|
7
|
+
if (XEUtils.eqNull(content)) {
|
|
8
|
+
return "";
|
|
38
9
|
}
|
|
10
|
+
return "" + content;
|
|
11
|
+
},
|
|
12
|
+
/**
|
|
13
|
+
* 判断值为:'' | null | undefined 时都属于空值
|
|
14
|
+
*/
|
|
15
|
+
isEmpty(value) {
|
|
16
|
+
return value === null || value === void 0 || value === "";
|
|
17
|
+
},
|
|
18
|
+
/**
|
|
19
|
+
* 获取配置值,如果存在则返回,如果不存在则使用默认值
|
|
20
|
+
*/
|
|
21
|
+
getDefVal(value, defVal) {
|
|
22
|
+
return XEUtils.eqNull(value) ? defVal : value;
|
|
23
|
+
},
|
|
24
|
+
/**
|
|
25
|
+
* 判断是否启用
|
|
26
|
+
*/
|
|
27
|
+
isEnabled(conf) {
|
|
28
|
+
return !!(conf && conf.enabled !== false);
|
|
29
|
+
},
|
|
30
|
+
/**
|
|
31
|
+
* 用于开关类型的配置项
|
|
32
|
+
* 局部启用规则:conf={}
|
|
33
|
+
* 局部禁用规则:conf={enabled:false}
|
|
34
|
+
* 全局默认启用规则:conf.enabled=true
|
|
35
|
+
*/
|
|
36
|
+
hasEnableConf(conf, opts) {
|
|
37
|
+
return !!(opts && (conf ? opts.enabled !== false : opts.enabled));
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
export {
|
|
41
|
+
baseUtils
|
|
39
42
|
};
|