element-plus 2.2.33 → 2.2.34
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/index.full.js +65 -29
- package/dist/index.full.min.js +19 -19
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +19 -19
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +64 -30
- package/dist/locale/af.js +1 -1
- package/dist/locale/af.min.js +1 -1
- package/dist/locale/af.min.mjs +1 -1
- package/dist/locale/af.mjs +1 -1
- package/dist/locale/ar.js +1 -1
- package/dist/locale/ar.min.js +1 -1
- package/dist/locale/ar.min.mjs +1 -1
- package/dist/locale/ar.mjs +1 -1
- package/dist/locale/az.js +1 -1
- package/dist/locale/az.min.js +1 -1
- package/dist/locale/az.min.mjs +1 -1
- package/dist/locale/az.mjs +1 -1
- package/dist/locale/bg.js +1 -1
- package/dist/locale/bg.min.js +1 -1
- package/dist/locale/bg.min.mjs +1 -1
- package/dist/locale/bg.mjs +1 -1
- package/dist/locale/bn.js +1 -1
- package/dist/locale/bn.min.js +1 -1
- package/dist/locale/bn.min.mjs +1 -1
- package/dist/locale/bn.mjs +1 -1
- package/dist/locale/ca.js +1 -1
- package/dist/locale/ca.min.js +1 -1
- package/dist/locale/ca.min.mjs +1 -1
- package/dist/locale/ca.mjs +1 -1
- package/dist/locale/ckb.js +1 -1
- package/dist/locale/ckb.min.js +1 -1
- package/dist/locale/ckb.min.mjs +1 -1
- package/dist/locale/ckb.mjs +1 -1
- package/dist/locale/cs.js +1 -1
- package/dist/locale/cs.min.js +1 -1
- package/dist/locale/cs.min.mjs +1 -1
- package/dist/locale/cs.mjs +1 -1
- package/dist/locale/da.js +1 -1
- package/dist/locale/da.min.js +1 -1
- package/dist/locale/da.min.mjs +1 -1
- package/dist/locale/da.mjs +1 -1
- package/dist/locale/de.js +1 -1
- package/dist/locale/de.min.js +1 -1
- package/dist/locale/de.min.mjs +1 -1
- package/dist/locale/de.mjs +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/el.min.js +1 -1
- package/dist/locale/el.min.mjs +1 -1
- package/dist/locale/el.mjs +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/eo.js +1 -1
- package/dist/locale/eo.min.js +1 -1
- package/dist/locale/eo.min.mjs +1 -1
- package/dist/locale/eo.mjs +1 -1
- package/dist/locale/es.js +1 -1
- package/dist/locale/es.min.js +1 -1
- package/dist/locale/es.min.mjs +1 -1
- package/dist/locale/es.mjs +1 -1
- package/dist/locale/et.js +1 -1
- package/dist/locale/et.min.js +1 -1
- package/dist/locale/et.min.mjs +1 -1
- package/dist/locale/et.mjs +1 -1
- package/dist/locale/eu.js +1 -1
- package/dist/locale/eu.min.js +1 -1
- package/dist/locale/eu.min.mjs +1 -1
- package/dist/locale/eu.mjs +1 -1
- package/dist/locale/fa.js +1 -1
- package/dist/locale/fa.min.js +1 -1
- package/dist/locale/fa.min.mjs +1 -1
- package/dist/locale/fa.mjs +1 -1
- package/dist/locale/fi.js +1 -1
- package/dist/locale/fi.min.js +1 -1
- package/dist/locale/fi.min.mjs +1 -1
- package/dist/locale/fi.mjs +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/fr.min.js +1 -1
- package/dist/locale/fr.min.mjs +1 -1
- package/dist/locale/fr.mjs +1 -1
- package/dist/locale/he.js +1 -1
- package/dist/locale/he.min.js +1 -1
- package/dist/locale/he.min.mjs +1 -1
- package/dist/locale/he.mjs +1 -1
- package/dist/locale/hr.js +1 -1
- package/dist/locale/hr.min.js +1 -1
- package/dist/locale/hr.min.mjs +1 -1
- package/dist/locale/hr.mjs +1 -1
- package/dist/locale/hu.js +1 -1
- package/dist/locale/hu.min.js +1 -1
- package/dist/locale/hu.min.mjs +1 -1
- package/dist/locale/hu.mjs +1 -1
- package/dist/locale/hy-am.js +1 -1
- package/dist/locale/hy-am.min.js +1 -1
- package/dist/locale/hy-am.min.mjs +1 -1
- package/dist/locale/hy-am.mjs +1 -1
- package/dist/locale/id.js +1 -1
- package/dist/locale/id.min.js +1 -1
- package/dist/locale/id.min.mjs +1 -1
- package/dist/locale/id.mjs +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/it.min.js +1 -1
- package/dist/locale/it.min.mjs +1 -1
- package/dist/locale/it.mjs +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ja.min.js +1 -1
- package/dist/locale/ja.min.mjs +1 -1
- package/dist/locale/ja.mjs +1 -1
- package/dist/locale/kk.js +1 -1
- package/dist/locale/kk.min.js +1 -1
- package/dist/locale/kk.min.mjs +1 -1
- package/dist/locale/kk.mjs +1 -1
- package/dist/locale/km.js +1 -1
- package/dist/locale/km.min.js +1 -1
- package/dist/locale/km.min.mjs +1 -1
- package/dist/locale/km.mjs +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ko.min.js +1 -1
- package/dist/locale/ko.min.mjs +1 -1
- package/dist/locale/ko.mjs +1 -1
- package/dist/locale/ku.js +1 -1
- package/dist/locale/ku.min.js +1 -1
- package/dist/locale/ku.min.mjs +1 -1
- package/dist/locale/ku.mjs +1 -1
- package/dist/locale/ky.js +1 -1
- package/dist/locale/ky.min.js +1 -1
- package/dist/locale/ky.min.mjs +1 -1
- package/dist/locale/ky.mjs +1 -1
- package/dist/locale/lt.js +1 -1
- package/dist/locale/lt.min.js +1 -1
- package/dist/locale/lt.min.mjs +1 -1
- package/dist/locale/lt.mjs +1 -1
- package/dist/locale/lv.js +1 -1
- package/dist/locale/lv.min.js +1 -1
- package/dist/locale/lv.min.mjs +1 -1
- package/dist/locale/lv.mjs +1 -1
- package/dist/locale/mg.js +1 -1
- package/dist/locale/mg.min.js +1 -1
- package/dist/locale/mg.min.mjs +1 -1
- package/dist/locale/mg.mjs +1 -1
- package/dist/locale/mn.js +1 -1
- package/dist/locale/mn.min.js +1 -1
- package/dist/locale/mn.min.mjs +1 -1
- package/dist/locale/mn.mjs +1 -1
- package/dist/locale/nb-no.js +1 -1
- package/dist/locale/nb-no.min.js +1 -1
- package/dist/locale/nb-no.min.mjs +1 -1
- package/dist/locale/nb-no.mjs +1 -1
- package/dist/locale/nl.js +1 -1
- package/dist/locale/nl.min.js +1 -1
- package/dist/locale/nl.min.mjs +1 -1
- package/dist/locale/nl.mjs +1 -1
- package/dist/locale/pa.js +1 -1
- package/dist/locale/pa.min.js +1 -1
- package/dist/locale/pa.min.mjs +1 -1
- package/dist/locale/pa.mjs +1 -1
- package/dist/locale/pl.js +1 -1
- package/dist/locale/pl.min.js +1 -1
- package/dist/locale/pl.min.mjs +1 -1
- package/dist/locale/pl.mjs +1 -1
- package/dist/locale/pt-br.js +1 -1
- package/dist/locale/pt-br.min.js +1 -1
- package/dist/locale/pt-br.min.mjs +1 -1
- package/dist/locale/pt-br.mjs +1 -1
- package/dist/locale/pt.js +1 -1
- package/dist/locale/pt.min.js +1 -1
- package/dist/locale/pt.min.mjs +1 -1
- package/dist/locale/pt.mjs +1 -1
- package/dist/locale/ro.js +1 -1
- package/dist/locale/ro.min.js +1 -1
- package/dist/locale/ro.min.mjs +1 -1
- package/dist/locale/ro.mjs +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/ru.min.js +1 -1
- package/dist/locale/ru.min.mjs +1 -1
- package/dist/locale/ru.mjs +1 -1
- package/dist/locale/sk.js +1 -1
- package/dist/locale/sk.min.js +1 -1
- package/dist/locale/sk.min.mjs +1 -1
- package/dist/locale/sk.mjs +1 -1
- package/dist/locale/sl.js +1 -1
- package/dist/locale/sl.min.js +1 -1
- package/dist/locale/sl.min.mjs +1 -1
- package/dist/locale/sl.mjs +1 -1
- package/dist/locale/sr.js +1 -1
- package/dist/locale/sr.min.js +1 -1
- package/dist/locale/sr.min.mjs +1 -1
- package/dist/locale/sr.mjs +1 -1
- package/dist/locale/sv.js +1 -1
- package/dist/locale/sv.min.js +1 -1
- package/dist/locale/sv.min.mjs +1 -1
- package/dist/locale/sv.mjs +1 -1
- package/dist/locale/ta.js +1 -1
- package/dist/locale/ta.min.js +1 -1
- package/dist/locale/ta.min.mjs +1 -1
- package/dist/locale/ta.mjs +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/th.min.js +1 -1
- package/dist/locale/th.min.mjs +1 -1
- package/dist/locale/th.mjs +1 -1
- package/dist/locale/tk.js +1 -1
- package/dist/locale/tk.min.js +1 -1
- package/dist/locale/tk.min.mjs +1 -1
- package/dist/locale/tk.mjs +1 -1
- package/dist/locale/tr.js +1 -1
- package/dist/locale/tr.min.js +1 -1
- package/dist/locale/tr.min.mjs +1 -1
- package/dist/locale/tr.mjs +1 -1
- package/dist/locale/ug-cn.js +1 -1
- package/dist/locale/ug-cn.min.js +1 -1
- package/dist/locale/ug-cn.min.mjs +1 -1
- package/dist/locale/ug-cn.mjs +1 -1
- package/dist/locale/uk.js +1 -1
- package/dist/locale/uk.min.js +1 -1
- package/dist/locale/uk.min.mjs +1 -1
- package/dist/locale/uk.mjs +1 -1
- package/dist/locale/uz-uz.js +1 -1
- package/dist/locale/uz-uz.min.js +1 -1
- package/dist/locale/uz-uz.min.mjs +1 -1
- package/dist/locale/uz-uz.mjs +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/vi.min.js +1 -1
- package/dist/locale/vi.min.mjs +1 -1
- package/dist/locale/vi.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/dist/locale/zh-tw.js +1 -1
- package/dist/locale/zh-tw.min.js +1 -1
- package/dist/locale/zh-tw.min.mjs +1 -1
- package/dist/locale/zh-tw.mjs +1 -1
- package/es/components/config-provider/index.mjs +1 -1
- package/es/components/config-provider/src/hooks/use-global-config.d.ts +26 -0
- package/es/components/config-provider/src/hooks/use-global-config.mjs +24 -4
- package/es/components/config-provider/src/hooks/use-global-config.mjs.map +1 -1
- package/es/components/index.mjs +1 -1
- package/es/components/loading/src/loading.mjs +13 -6
- package/es/components/loading/src/loading.mjs.map +1 -1
- package/es/components/loading/src/service.mjs +2 -5
- package/es/components/loading/src/service.mjs.map +1 -1
- package/es/components/message/src/message.vue.d.ts +5 -0
- package/es/components/message/src/message2.mjs +4 -5
- package/es/components/message/src/message2.mjs.map +1 -1
- package/es/components/message-box/src/index.mjs +5 -6
- package/es/components/message-box/src/index.mjs.map +1 -1
- package/es/components/message-box/src/index.vue.d.ts +2 -1852
- package/es/components/notification/src/notification.vue.d.ts +7 -0
- package/es/components/notification/src/notification2.mjs +6 -4
- package/es/components/notification/src/notification2.mjs.map +1 -1
- package/es/components/notification/src/notify.mjs +0 -4
- package/es/components/notification/src/notify.mjs.map +1 -1
- package/es/components/table-v2/src/renderers/cell.mjs +1 -1
- package/es/components/table-v2/src/renderers/cell.mjs.map +1 -1
- package/es/components/tooltip/src/tooltip.vue.d.ts +9 -12
- package/es/components/tree-select/src/cache-options.mjs +6 -2
- package/es/components/tree-select/src/cache-options.mjs.map +1 -1
- package/es/hooks/index.mjs +1 -1
- package/es/hooks/use-locale/index.d.ts +1 -1
- package/es/hooks/use-locale/index.mjs +2 -2
- package/es/hooks/use-locale/index.mjs.map +1 -1
- package/es/hooks/use-namespace/index.d.ts +2 -2
- package/es/hooks/use-namespace/index.mjs +4 -4
- package/es/hooks/use-namespace/index.mjs.map +1 -1
- package/es/hooks/use-popper-container/index.d.ts +4 -1
- package/es/hooks/use-popper-container/index.mjs +5 -1
- package/es/hooks/use-popper-container/index.mjs.map +1 -1
- package/es/hooks/use-z-index/index.d.ts +3 -1
- package/es/hooks/use-z-index/index.mjs +3 -3
- package/es/hooks/use-z-index/index.mjs.map +1 -1
- package/es/index.mjs +2 -2
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/config-provider/index.js +1 -0
- package/lib/components/config-provider/index.js.map +1 -1
- package/lib/components/config-provider/src/hooks/use-global-config.d.ts +26 -0
- package/lib/components/config-provider/src/hooks/use-global-config.js +26 -5
- package/lib/components/config-provider/src/hooks/use-global-config.js.map +1 -1
- package/lib/components/index.js +1 -0
- package/lib/components/index.js.map +1 -1
- package/lib/components/loading/src/loading.js +12 -5
- package/lib/components/loading/src/loading.js.map +1 -1
- package/lib/components/loading/src/service.js +2 -5
- package/lib/components/loading/src/service.js.map +1 -1
- package/lib/components/message/src/message.vue.d.ts +5 -0
- package/lib/components/message/src/message2.js +9 -10
- package/lib/components/message/src/message2.js.map +1 -1
- package/lib/components/message-box/src/index.js +16 -17
- package/lib/components/message-box/src/index.js.map +1 -1
- package/lib/components/message-box/src/index.vue.d.ts +2 -1852
- package/lib/components/notification/src/notification.vue.d.ts +7 -0
- package/lib/components/notification/src/notification2.js +9 -7
- package/lib/components/notification/src/notification2.js.map +1 -1
- package/lib/components/notification/src/notify.js +0 -4
- package/lib/components/notification/src/notify.js.map +1 -1
- package/lib/components/table-v2/src/renderers/cell.js +1 -1
- package/lib/components/table-v2/src/renderers/cell.js.map +1 -1
- package/lib/components/tooltip/src/tooltip.vue.d.ts +9 -12
- package/lib/components/tree-select/src/cache-options.js +6 -2
- package/lib/components/tree-select/src/cache-options.js.map +1 -1
- package/lib/hooks/index.js +1 -0
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/use-locale/index.d.ts +1 -1
- package/lib/hooks/use-locale/index.js +2 -2
- package/lib/hooks/use-locale/index.js.map +1 -1
- package/lib/hooks/use-namespace/index.d.ts +2 -2
- package/lib/hooks/use-namespace/index.js +4 -4
- package/lib/hooks/use-namespace/index.js.map +1 -1
- package/lib/hooks/use-popper-container/index.d.ts +4 -1
- package/lib/hooks/use-popper-container/index.js +5 -1
- package/lib/hooks/use-popper-container/index.js.map +1 -1
- package/lib/hooks/use-z-index/index.d.ts +3 -1
- package/lib/hooks/use-z-index/index.js +3 -2
- package/lib/hooks/use-z-index/index.js.map +1 -1
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/web-types.json +1 -1
|
@@ -3,4 +3,30 @@ import type { App, Ref } from 'vue';
|
|
|
3
3
|
import type { ConfigProviderContext } from '../constants';
|
|
4
4
|
export declare function useGlobalConfig<K extends keyof ConfigProviderContext, D extends ConfigProviderContext[K]>(key: K, defaultValue?: D): Ref<Exclude<ConfigProviderContext[K], undefined> | D>;
|
|
5
5
|
export declare function useGlobalConfig(): Ref<ConfigProviderContext>;
|
|
6
|
+
export declare function useGlobalComponentSettings(block: string): {
|
|
7
|
+
ns: {
|
|
8
|
+
namespace: import("vue").ComputedRef<string>;
|
|
9
|
+
b: (blockSuffix?: string) => string;
|
|
10
|
+
e: (element?: string | undefined) => string;
|
|
11
|
+
m: (modifier?: string | undefined) => string;
|
|
12
|
+
be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
|
|
13
|
+
em: (element?: string | undefined, modifier?: string | undefined) => string;
|
|
14
|
+
bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
|
|
15
|
+
bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
|
|
16
|
+
is: {
|
|
17
|
+
(name: string, state: boolean | undefined): string;
|
|
18
|
+
(name: string): string;
|
|
19
|
+
};
|
|
20
|
+
cssVar: (object: Record<string, string>) => Record<string, string>;
|
|
21
|
+
cssVarName: (name: string) => string;
|
|
22
|
+
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
23
|
+
cssVarBlockName: (name: string) => string;
|
|
24
|
+
};
|
|
25
|
+
locale: import("element-plus/es/hooks").LocaleContext;
|
|
26
|
+
zIndex: {
|
|
27
|
+
initialZIndex: import("vue").ComputedRef<number>;
|
|
28
|
+
currentZIndex: import("vue").ComputedRef<number>;
|
|
29
|
+
nextZIndex: () => number;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
6
32
|
export declare const provideGlobalConfig: (config: MaybeRef<ConfigProviderContext>, app?: App<any> | undefined, global?: boolean) => import("vue").ComputedRef<Partial<import("../config-provider-props").ConfigProviderProps>> | undefined;
|
|
@@ -6,10 +6,10 @@ var vue = require('vue');
|
|
|
6
6
|
require('../../../../utils/index.js');
|
|
7
7
|
require('../../../../hooks/index.js');
|
|
8
8
|
var constants = require('../constants.js');
|
|
9
|
-
var
|
|
10
|
-
var index = require('../../../../hooks/use-locale/index.js');
|
|
11
|
-
var index$1 = require('../../../../hooks/use-namespace/index.js');
|
|
9
|
+
var index = require('../../../../hooks/use-namespace/index.js');
|
|
10
|
+
var index$1 = require('../../../../hooks/use-locale/index.js');
|
|
12
11
|
var index$2 = require('../../../../hooks/use-z-index/index.js');
|
|
12
|
+
var error = require('../../../../utils/error.js');
|
|
13
13
|
var index$3 = require('../../../../hooks/use-size/index.js');
|
|
14
14
|
var objects = require('../../../../utils/objects.js');
|
|
15
15
|
|
|
@@ -25,6 +25,26 @@ function useGlobalConfig(key, defaultValue = void 0) {
|
|
|
25
25
|
return config;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
+
function useGlobalComponentSettings(block) {
|
|
29
|
+
const config = useGlobalConfig();
|
|
30
|
+
const ns = index.useNamespace(block, vue.computed(() => {
|
|
31
|
+
var _a;
|
|
32
|
+
return ((_a = config.value) == null ? void 0 : _a.namespace) || index.defaultNamespace;
|
|
33
|
+
}));
|
|
34
|
+
const locale = index$1.useLocale(vue.computed(() => {
|
|
35
|
+
var _a;
|
|
36
|
+
return (_a = config.value) == null ? void 0 : _a.locale;
|
|
37
|
+
}));
|
|
38
|
+
const zIndex = index$2.useZIndex(vue.computed(() => {
|
|
39
|
+
var _a;
|
|
40
|
+
return ((_a = config.value) == null ? void 0 : _a.zIndex) || index$2.defaultInitialZIndex;
|
|
41
|
+
}));
|
|
42
|
+
return {
|
|
43
|
+
ns,
|
|
44
|
+
locale,
|
|
45
|
+
zIndex
|
|
46
|
+
};
|
|
47
|
+
}
|
|
28
48
|
const provideGlobalConfig = (config, app, global = false) => {
|
|
29
49
|
var _a;
|
|
30
50
|
const inSetup = !!vue.getCurrentInstance();
|
|
@@ -41,8 +61,8 @@ const provideGlobalConfig = (config, app, global = false) => {
|
|
|
41
61
|
return mergeConfig(oldConfig.value, cfg);
|
|
42
62
|
});
|
|
43
63
|
provideFn(constants.configProviderContextKey, context);
|
|
44
|
-
provideFn(index.localeContextKey, vue.computed(() => context.value.locale));
|
|
45
|
-
provideFn(index
|
|
64
|
+
provideFn(index$1.localeContextKey, vue.computed(() => context.value.locale));
|
|
65
|
+
provideFn(index.namespaceContextKey, vue.computed(() => context.value.namespace));
|
|
46
66
|
provideFn(index$2.zIndexContextKey, vue.computed(() => context.value.zIndex));
|
|
47
67
|
provideFn(index$3.SIZE_INJECTION_KEY, {
|
|
48
68
|
size: vue.computed(() => context.value.size || "")
|
|
@@ -63,5 +83,6 @@ const mergeConfig = (a, b) => {
|
|
|
63
83
|
};
|
|
64
84
|
|
|
65
85
|
exports.provideGlobalConfig = provideGlobalConfig;
|
|
86
|
+
exports.useGlobalComponentSettings = useGlobalComponentSettings;
|
|
66
87
|
exports.useGlobalConfig = useGlobalConfig;
|
|
67
88
|
//# sourceMappingURL=use-global-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-global-config.js","sources":["../../../../../../../packages/components/config-provider/src/hooks/use-global-config.ts"],"sourcesContent":["import { computed, getCurrentInstance, inject, provide, ref, unref } from 'vue'\nimport { debugWarn, keysOf } from '@element-plus/utils'\nimport {\n SIZE_INJECTION_KEY,\n localeContextKey,\n namespaceContextKey,\n zIndexContextKey,\n} from '@element-plus/hooks'\nimport { configProviderContextKey } from '../constants'\n\nimport type { MaybeRef } from '@vueuse/core'\nimport type { App, Ref } from 'vue'\nimport type { ConfigProviderContext } from '../constants'\n\n// this is meant to fix global methods like `ElMessage(opts)`, this way we can inject current locale\n// into the component as default injection value.\n// refer to: https://github.com/element-plus/element-plus/issues/2610#issuecomment-887965266\nconst globalConfig = ref<ConfigProviderContext>()\n\nexport function useGlobalConfig<\n K extends keyof ConfigProviderContext,\n D extends ConfigProviderContext[K]\n>(\n key: K,\n defaultValue?: D\n): Ref<Exclude<ConfigProviderContext[K], undefined> | D>\nexport function useGlobalConfig(): Ref<ConfigProviderContext>\nexport function useGlobalConfig(\n key?: keyof ConfigProviderContext,\n defaultValue = undefined\n) {\n const config = getCurrentInstance()\n ? inject(configProviderContextKey, globalConfig)\n : globalConfig\n if (key) {\n return computed(() => config.value?.[key] ?? defaultValue)\n } else {\n return config\n }\n}\n\nexport const provideGlobalConfig = (\n config: MaybeRef<ConfigProviderContext>,\n app?: App,\n global = false\n) => {\n const inSetup = !!getCurrentInstance()\n const oldConfig = inSetup ? useGlobalConfig() : undefined\n\n const provideFn = app?.provide ?? (inSetup ? provide : undefined)\n if (!provideFn) {\n debugWarn(\n 'provideGlobalConfig',\n 'provideGlobalConfig() can only be used inside setup().'\n )\n return\n }\n\n const context = computed(() => {\n const cfg = unref(config)\n if (!oldConfig?.value) return cfg\n return mergeConfig(oldConfig.value, cfg)\n })\n provideFn(configProviderContextKey, context)\n provideFn(\n localeContextKey,\n computed(() => context.value.locale)\n )\n provideFn(\n namespaceContextKey,\n computed(() => context.value.namespace)\n )\n provideFn(\n zIndexContextKey,\n computed(() => context.value.zIndex)\n )\n\n provideFn(SIZE_INJECTION_KEY, {\n size: computed(() => context.value.size || ''),\n })\n\n if (global || !globalConfig.value) {\n globalConfig.value = context.value\n }\n return context\n}\n\nconst mergeConfig = (\n a: ConfigProviderContext,\n b: ConfigProviderContext\n): ConfigProviderContext => {\n const keys = [...new Set([...keysOf(a), ...keysOf(b)])]\n const obj: Record<string, any> = {}\n for (const key of keys) {\n obj[key] = b[key] ?? a[key]\n }\n return obj\n}\n"],"names":["ref","getCurrentInstance","inject","configProviderContextKey","computed","provide","debugWarn","unref","localeContextKey","namespaceContextKey","zIndexContextKey","SIZE_INJECTION_KEY","keysOf"],"mappings":";;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"use-global-config.js","sources":["../../../../../../../packages/components/config-provider/src/hooks/use-global-config.ts"],"sourcesContent":["import { computed, getCurrentInstance, inject, provide, ref, unref } from 'vue'\nimport { debugWarn, keysOf } from '@element-plus/utils'\nimport {\n SIZE_INJECTION_KEY,\n defaultInitialZIndex,\n defaultNamespace,\n localeContextKey,\n namespaceContextKey,\n useLocale,\n useNamespace,\n useZIndex,\n zIndexContextKey,\n} from '@element-plus/hooks'\nimport { configProviderContextKey } from '../constants'\n\nimport type { MaybeRef } from '@vueuse/core'\nimport type { App, Ref } from 'vue'\nimport type { ConfigProviderContext } from '../constants'\n\n// this is meant to fix global methods like `ElMessage(opts)`, this way we can inject current locale\n// into the component as default injection value.\n// refer to: https://github.com/element-plus/element-plus/issues/2610#issuecomment-887965266\nconst globalConfig = ref<ConfigProviderContext>()\n\nexport function useGlobalConfig<\n K extends keyof ConfigProviderContext,\n D extends ConfigProviderContext[K]\n>(\n key: K,\n defaultValue?: D\n): Ref<Exclude<ConfigProviderContext[K], undefined> | D>\nexport function useGlobalConfig(): Ref<ConfigProviderContext>\nexport function useGlobalConfig(\n key?: keyof ConfigProviderContext,\n defaultValue = undefined\n) {\n const config = getCurrentInstance()\n ? inject(configProviderContextKey, globalConfig)\n : globalConfig\n if (key) {\n return computed(() => config.value?.[key] ?? defaultValue)\n } else {\n return config\n }\n}\n\n// for components like `ElMessage` `ElNotification` `ElMessageBox`.\nexport function useGlobalComponentSettings(block: string) {\n const config = useGlobalConfig()\n\n const ns = useNamespace(\n block,\n computed(() => config.value?.namespace || defaultNamespace)\n )\n\n const locale = useLocale(computed(() => config.value?.locale))\n const zIndex = useZIndex(\n computed(() => config.value?.zIndex || defaultInitialZIndex)\n )\n\n return {\n ns,\n locale,\n zIndex,\n }\n}\n\nexport const provideGlobalConfig = (\n config: MaybeRef<ConfigProviderContext>,\n app?: App,\n global = false\n) => {\n const inSetup = !!getCurrentInstance()\n const oldConfig = inSetup ? useGlobalConfig() : undefined\n\n const provideFn = app?.provide ?? (inSetup ? provide : undefined)\n if (!provideFn) {\n debugWarn(\n 'provideGlobalConfig',\n 'provideGlobalConfig() can only be used inside setup().'\n )\n return\n }\n\n const context = computed(() => {\n const cfg = unref(config)\n if (!oldConfig?.value) return cfg\n return mergeConfig(oldConfig.value, cfg)\n })\n provideFn(configProviderContextKey, context)\n provideFn(\n localeContextKey,\n computed(() => context.value.locale)\n )\n provideFn(\n namespaceContextKey,\n computed(() => context.value.namespace)\n )\n provideFn(\n zIndexContextKey,\n computed(() => context.value.zIndex)\n )\n\n provideFn(SIZE_INJECTION_KEY, {\n size: computed(() => context.value.size || ''),\n })\n\n if (global || !globalConfig.value) {\n globalConfig.value = context.value\n }\n return context\n}\n\nconst mergeConfig = (\n a: ConfigProviderContext,\n b: ConfigProviderContext\n): ConfigProviderContext => {\n const keys = [...new Set([...keysOf(a), ...keysOf(b)])]\n const obj: Record<string, any> = {}\n for (const key of keys) {\n obj[key] = b[key] ?? a[key]\n }\n return obj\n}\n"],"names":["ref","getCurrentInstance","inject","configProviderContextKey","computed","useNamespace","defaultNamespace","useLocale","useZIndex","defaultInitialZIndex","provide","debugWarn","unref","localeContextKey","namespaceContextKey","zIndexContextKey","SIZE_INJECTION_KEY","keysOf"],"mappings":";;;;;;;;;;;;;;;AAcA,MAAM,YAAY,GAAGA,OAAG,EAAE,CAAC;AACpB,SAAS,eAAe,CAAC,GAAG,EAAE,YAAY,GAAG,KAAK,CAAC,EAAE;AAC5D,EAAE,MAAM,MAAM,GAAGC,sBAAkB,EAAE,GAAGC,UAAM,CAACC,kCAAwB,EAAE,YAAY,CAAC,GAAG,YAAY,CAAC;AACtG,EAAE,IAAI,GAAG,EAAE;AACX,IAAI,OAAOC,YAAQ,CAAC,MAAM;AAC1B,MAAM,IAAI,EAAE,EAAE,EAAE,CAAC;AACjB,MAAM,OAAO,CAAC,EAAE,GAAG,CAAC,EAAE,GAA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,EAAE;AAChC,IAAI,IAAI,EAAEZ,YAAQ,CAAC,MAAM,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC;AAClD,GAAG,CAAC,CAAC;AACL,EAAE,IAAI,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE;AACrC,IAAI,YAAY,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;AACvC,GAAG;AACH,EAAE,OAAO,OAAO,CAAC;AACjB,EAAE;AACF,MAAM,WAAW,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK;AAC9B,EAAE,IAAI,EAAE,CAAC;AACT,EAAE,MAAM,IAAI,GAAG,CAAC,mBAAmB,IAAI,GAAG,CAAC,CAAC,GAAGa,cAAM,CAAC,CAAC,CAAC,EAAE,GAAGA,cAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1E,EAAE,MAAM,GAAG,GAAG,EAAE,CAAC;AACjB,EAAE,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;AAC1B,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;AACnD,GAAG;AACH,EAAE,OAAO,GAAG,CAAC;AACb,CAAC;;;;;;"}
|
package/lib/components/index.js
CHANGED
|
@@ -371,6 +371,7 @@ exports.messageConfig = configProvider.messageConfig;
|
|
|
371
371
|
exports.configProviderProps = configProviderProps.configProviderProps;
|
|
372
372
|
exports.configProviderContextKey = constants$5.configProviderContextKey;
|
|
373
373
|
exports.provideGlobalConfig = useGlobalConfig.provideGlobalConfig;
|
|
374
|
+
exports.useGlobalComponentSettings = useGlobalConfig.useGlobalComponentSettings;
|
|
374
375
|
exports.useGlobalConfig = useGlobalConfig.useGlobalConfig;
|
|
375
376
|
exports.countdownEmits = countdown.countdownEmits;
|
|
376
377
|
exports.countdownProps = countdown.countdownProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -5,12 +5,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var vue = require('vue');
|
|
6
6
|
require('../../../hooks/index.js');
|
|
7
7
|
require('../../../utils/index.js');
|
|
8
|
-
var index = require('../../../hooks/use-namespace/index.js');
|
|
9
8
|
var style = require('../../../utils/dom/style.js');
|
|
9
|
+
var index = require('../../../hooks/use-namespace/index.js');
|
|
10
|
+
var index$1 = require('../../../hooks/use-z-index/index.js');
|
|
10
11
|
|
|
11
12
|
function createLoadingComponent(options) {
|
|
12
13
|
let afterLeaveTimer;
|
|
13
|
-
const ns = index.useNamespace("loading");
|
|
14
14
|
const afterLeaveFlag = vue.ref(false);
|
|
15
15
|
const data = vue.reactive({
|
|
16
16
|
...options,
|
|
@@ -23,6 +23,7 @@ function createLoadingComponent(options) {
|
|
|
23
23
|
}
|
|
24
24
|
function destroySelf() {
|
|
25
25
|
const target = data.parent;
|
|
26
|
+
const ns = vm.ns;
|
|
26
27
|
if (!target.vLoadingAddClassList) {
|
|
27
28
|
let loadingNumber = target.getAttribute("loading-number");
|
|
28
29
|
loadingNumber = Number.parseInt(loadingNumber) - 1;
|
|
@@ -59,9 +60,15 @@ function createLoadingComponent(options) {
|
|
|
59
60
|
target.vLoadingAddClassList = void 0;
|
|
60
61
|
destroySelf();
|
|
61
62
|
}
|
|
62
|
-
const elLoadingComponent = {
|
|
63
|
+
const elLoadingComponent = vue.defineComponent({
|
|
63
64
|
name: "ElLoading",
|
|
64
|
-
setup() {
|
|
65
|
+
setup(_, { expose }) {
|
|
66
|
+
const ns = index.useNamespace("loading");
|
|
67
|
+
const zIndex = index$1.useZIndex();
|
|
68
|
+
expose({
|
|
69
|
+
ns,
|
|
70
|
+
zIndex
|
|
71
|
+
});
|
|
65
72
|
return () => {
|
|
66
73
|
const svg = data.spinner || data.svg;
|
|
67
74
|
const spinner = vue.h("svg", {
|
|
@@ -101,7 +108,7 @@ function createLoadingComponent(options) {
|
|
|
101
108
|
});
|
|
102
109
|
};
|
|
103
110
|
}
|
|
104
|
-
};
|
|
111
|
+
});
|
|
105
112
|
const loadingInstance = vue.createApp(elLoadingComponent);
|
|
106
113
|
const vm = loadingInstance.mount(document.createElement("div"));
|
|
107
114
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loading.js","sources":["../../../../../../packages/components/loading/src/loading.ts"],"sourcesContent":["import {\n Transition,\n createApp,\n createVNode,\n h,\n reactive,\n ref,\n toRefs,\n vShow,\n withCtx,\n withDirectives,\n} from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { removeClass } from '@element-plus/utils'\n\nimport type { LoadingOptionsResolved } from './types'\n\nexport function createLoadingComponent(options: LoadingOptionsResolved) {\n let afterLeaveTimer: number\n\n
|
|
1
|
+
{"version":3,"file":"loading.js","sources":["../../../../../../packages/components/loading/src/loading.ts"],"sourcesContent":["import {\n Transition,\n createApp,\n createVNode,\n defineComponent,\n h,\n reactive,\n ref,\n toRefs,\n vShow,\n withCtx,\n withDirectives,\n} from 'vue'\nimport { useNamespace, useZIndex } from '@element-plus/hooks'\nimport { removeClass } from '@element-plus/utils'\n\nimport type { UseNamespaceReturn } from '@element-plus/hooks'\nimport type { LoadingOptionsResolved } from './types'\n\nexport function createLoadingComponent(options: LoadingOptionsResolved) {\n let afterLeaveTimer: number\n // IMPORTANT NOTE: this is only a hacking way to expose the injections on an\n // instance, DO NOT FOLLOW this pattern in your own code.\n const afterLeaveFlag = ref(false)\n const data = reactive({\n ...options,\n originalPosition: '',\n originalOverflow: '',\n visible: false,\n })\n\n function setText(text: string) {\n data.text = text\n }\n\n function destroySelf() {\n const target = data.parent\n const ns = (vm as any).ns as UseNamespaceReturn\n if (!target.vLoadingAddClassList) {\n let loadingNumber: number | string | null =\n target.getAttribute('loading-number')\n loadingNumber = Number.parseInt(loadingNumber as any) - 1\n if (!loadingNumber) {\n removeClass(target, ns.bm('parent', 'relative'))\n target.removeAttribute('loading-number')\n } else {\n target.setAttribute('loading-number', loadingNumber.toString())\n }\n removeClass(target, ns.bm('parent', 'hidden'))\n }\n removeElLoadingChild()\n loadingInstance.unmount()\n }\n function removeElLoadingChild(): void {\n vm.$el?.parentNode?.removeChild(vm.$el)\n }\n function close() {\n if (options.beforeClose && !options.beforeClose()) return\n\n afterLeaveFlag.value = true\n clearTimeout(afterLeaveTimer)\n\n afterLeaveTimer = window.setTimeout(handleAfterLeave, 400)\n data.visible = false\n\n options.closed?.()\n }\n\n function handleAfterLeave() {\n if (!afterLeaveFlag.value) return\n const target = data.parent\n afterLeaveFlag.value = false\n target.vLoadingAddClassList = undefined\n destroySelf()\n }\n\n const elLoadingComponent = defineComponent({\n name: 'ElLoading',\n setup(_, { expose }) {\n const ns = useNamespace('loading')\n const zIndex = useZIndex()\n\n expose({\n ns,\n zIndex,\n })\n\n return () => {\n const svg = data.spinner || data.svg\n const spinner = h(\n 'svg',\n {\n class: 'circular',\n viewBox: data.svgViewBox ? data.svgViewBox : '0 0 50 50',\n ...(svg ? { innerHTML: svg } : {}),\n },\n [\n h('circle', {\n class: 'path',\n cx: '25',\n cy: '25',\n r: '20',\n fill: 'none',\n }),\n ]\n )\n\n const spinnerText = data.text\n ? h('p', { class: ns.b('text') }, [data.text])\n : undefined\n\n return h(\n Transition,\n {\n name: ns.b('fade'),\n onAfterLeave: handleAfterLeave,\n },\n {\n default: withCtx(() => [\n withDirectives(\n createVNode(\n 'div',\n {\n style: {\n backgroundColor: data.background || '',\n },\n class: [\n ns.b('mask'),\n data.customClass,\n data.fullscreen ? 'is-fullscreen' : '',\n ],\n },\n [\n h(\n 'div',\n {\n class: ns.b('spinner'),\n },\n [spinner, spinnerText]\n ),\n ]\n ),\n [[vShow, data.visible]]\n ),\n ]),\n }\n )\n }\n },\n })\n\n const loadingInstance = createApp(elLoadingComponent)\n const vm = loadingInstance.mount(document.createElement('div'))\n\n return {\n ...toRefs(data),\n setText,\n removeElLoadingChild,\n close,\n handleAfterLeave,\n vm,\n get $el(): HTMLElement {\n return vm.$el\n },\n }\n}\n\nexport type LoadingInstance = ReturnType<typeof createLoadingComponent>\n"],"names":["ref","reactive","removeClass","defineComponent","useNamespace","useZIndex","h","Transition","withCtx","withDirectives","createVNode","vShow","createApp","toRefs"],"mappings":";;;;;;;;;;;AAeO,SAAS,sBAAsB,CAAC,OAAO,EAAE;AAChD,EAAE,IAAI,eAAe,CAAC;AACtB,EAAE,MAAM,cAAc,GAAGA,OAAG,CAAC,KAAK,CAAC,CAAC;AACpC,EAAE,MAAM,IAAI,GAAGC,YAAQ,CAAC;AACxB,IAAI,GAAG,OAAO;AACd,IAAI,gBAAgB,EAAE,EAAE;AACxB,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,IAAI,CAAC,WAAW;AAChC,gBAAgB,IAAI,CAAC,UAAU,GAAG,eAAe,GAAG,EAAE;AACtD,eAAe;AACf,aAAa,EAAE;AACf,cAAcJ,KAAC,CAAC,KAAK,EAAE;AACvB,gBAAgB,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AACtC,eAAe,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;AACxC,aAAa,CAAC,EAAE,CAAC,CAACK,SAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;AACxC,WAAW,CAAC;AACZ,SAAS,CAAC,CAAC;AACX,OAAO,CAAC;AACR,KAAK;AACL,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,eAAe,GAAGC,aAAS,CAAC,kBAAkB,CAAC,CAAC;AACxD,EAAE,MAAM,EAAE,GAAG,eAAe,CAAC,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;AAClE,EAAE,OAAO;AACT,IAAI,GAAGC,UAAM,CAAC,IAAI,CAAC;AACnB,IAAI,OAAO;AACX,IAAI,oBAAoB;AACxB,IAAI,KAAK;AACT,IAAI,gBAAgB;AACpB,IAAI,EAAE;AACN,IAAI,IAAI,GAAG,GAAG;AACd,MAAM,OAAO,EAAE,CAAC,GAAG,CAAC;AACpB,KAAK;AACL,GAAG,CAAC;AACJ;;;;"}
|
|
@@ -6,11 +6,8 @@ var vue = require('vue');
|
|
|
6
6
|
var shared = require('@vue/shared');
|
|
7
7
|
var core = require('@vueuse/core');
|
|
8
8
|
require('../../../utils/index.js');
|
|
9
|
-
require('../../../hooks/index.js');
|
|
10
9
|
var loading = require('./loading.js');
|
|
11
|
-
var index = require('../../../hooks/use-z-index/index.js');
|
|
12
10
|
var style = require('../../../utils/dom/style.js');
|
|
13
|
-
var index$1 = require('../../../hooks/use-namespace/index.js');
|
|
14
11
|
|
|
15
12
|
let fullscreenInstance = void 0;
|
|
16
13
|
const Loading = function(options = {}) {
|
|
@@ -69,7 +66,7 @@ const resolveOptions = (options) => {
|
|
|
69
66
|
};
|
|
70
67
|
};
|
|
71
68
|
const addStyle = async (options, parent, instance) => {
|
|
72
|
-
const { nextZIndex } =
|
|
69
|
+
const { nextZIndex } = instance.vm.zIndex;
|
|
73
70
|
const maskStyle = {};
|
|
74
71
|
if (options.fullscreen) {
|
|
75
72
|
instance.originalPosition.value = style.getStyle(document.body, "position");
|
|
@@ -93,7 +90,7 @@ const addStyle = async (options, parent, instance) => {
|
|
|
93
90
|
}
|
|
94
91
|
};
|
|
95
92
|
const addClassList = (options, parent, instance) => {
|
|
96
|
-
const ns =
|
|
93
|
+
const ns = instance.vm.ns;
|
|
97
94
|
if (!["absolute", "fixed", "sticky"].includes(instance.originalPosition.value)) {
|
|
98
95
|
style.addClass(parent, ns.bm("parent", "relative"));
|
|
99
96
|
} else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sources":["../../../../../../packages/components/loading/src/service.ts"],"sourcesContent":["// @ts-nocheck\nimport { nextTick } from 'vue'\nimport { isString } from '@vue/shared'\nimport { isClient } from '@vueuse/core'\nimport { addClass, getStyle, removeClass } from '@element-plus/utils'\nimport {
|
|
1
|
+
{"version":3,"file":"service.js","sources":["../../../../../../packages/components/loading/src/service.ts"],"sourcesContent":["// @ts-nocheck\nimport { nextTick } from 'vue'\nimport { isString } from '@vue/shared'\nimport { isClient } from '@vueuse/core'\nimport { addClass, getStyle, removeClass } from '@element-plus/utils'\nimport { createLoadingComponent } from './loading'\n\nimport type { UseNamespaceReturn, UseZIndexReturn } from '@element-plus/hooks'\nimport type { LoadingInstance } from './loading'\nimport type { LoadingOptionsResolved } from '..'\nimport type { LoadingOptions } from './types'\nimport type { CSSProperties } from 'vue'\n\nlet fullscreenInstance: LoadingInstance | undefined = undefined\n\nexport const Loading = function (\n options: LoadingOptions = {}\n): LoadingInstance {\n if (!isClient) return undefined as any\n\n const resolved = resolveOptions(options)\n\n if (resolved.fullscreen && fullscreenInstance) {\n return fullscreenInstance\n }\n\n const instance = createLoadingComponent({\n ...resolved,\n closed: () => {\n resolved.closed?.()\n if (resolved.fullscreen) fullscreenInstance = undefined\n },\n })\n\n addStyle(resolved, resolved.parent, instance)\n addClassList(resolved, resolved.parent, instance)\n\n resolved.parent.vLoadingAddClassList = () =>\n addClassList(resolved, resolved.parent, instance)\n\n /**\n * add loading-number to parent.\n * because if a fullscreen loading is triggered when somewhere\n * a v-loading.body was triggered before and it's parent is\n * document.body which with a margin , the fullscreen loading's\n * destroySelf function will remove 'el-loading-parent--relative',\n * and then the position of v-loading.body will be error.\n */\n let loadingNumber: string | null =\n resolved.parent.getAttribute('loading-number')\n if (!loadingNumber) {\n loadingNumber = '1'\n } else {\n loadingNumber = `${Number.parseInt(loadingNumber) + 1}`\n }\n resolved.parent.setAttribute('loading-number', loadingNumber)\n\n resolved.parent.appendChild(instance.$el)\n\n // after instance render, then modify visible to trigger transition\n nextTick(() => (instance.visible.value = resolved.visible))\n\n if (resolved.fullscreen) {\n fullscreenInstance = instance\n }\n return instance\n}\n\nconst resolveOptions = (options: LoadingOptions): LoadingOptionsResolved => {\n let target: HTMLElement\n if (isString(options.target)) {\n target =\n document.querySelector<HTMLElement>(options.target) ?? document.body\n } else {\n target = options.target || document.body\n }\n return {\n parent: target === document.body || options.body ? document.body : target,\n background: options.background || '',\n svg: options.svg || '',\n svgViewBox: options.svgViewBox || '',\n spinner: options.spinner || false,\n text: options.text || '',\n fullscreen: target === document.body && (options.fullscreen ?? true),\n lock: options.lock ?? false,\n customClass: options.customClass || '',\n visible: options.visible ?? true,\n target,\n }\n}\n\nconst addStyle = async (\n options: LoadingOptionsResolved,\n parent: HTMLElement,\n instance: LoadingInstance\n) => {\n const { nextZIndex } = (instance.vm as any).zIndex as UseZIndexReturn\n\n const maskStyle: CSSProperties = {}\n if (options.fullscreen) {\n instance.originalPosition.value = getStyle(document.body, 'position')\n instance.originalOverflow.value = getStyle(document.body, 'overflow')\n maskStyle.zIndex = nextZIndex()\n } else if (options.parent === document.body) {\n instance.originalPosition.value = getStyle(document.body, 'position')\n /**\n * await dom render when visible is true in init,\n * because some component's height maybe 0.\n * e.g. el-table.\n */\n await nextTick()\n for (const property of ['top', 'left']) {\n const scroll = property === 'top' ? 'scrollTop' : 'scrollLeft'\n maskStyle[property] = `${\n (options.target as HTMLElement).getBoundingClientRect()[property] +\n document.body[scroll] +\n document.documentElement[scroll] -\n Number.parseInt(getStyle(document.body, `margin-${property}`), 10)\n }px`\n }\n for (const property of ['height', 'width']) {\n maskStyle[property] = `${\n (options.target as HTMLElement).getBoundingClientRect()[property]\n }px`\n }\n } else {\n instance.originalPosition.value = getStyle(parent, 'position')\n }\n for (const [key, value] of Object.entries(maskStyle)) {\n instance.$el.style[key] = value\n }\n}\n\nconst addClassList = (\n options: LoadingOptions,\n parent: HTMLElement,\n instance: LoadingInstance\n) => {\n const ns = (instance.vm as any).ns as UseNamespaceReturn\n\n if (\n !['absolute', 'fixed', 'sticky'].includes(instance.originalPosition.value)\n ) {\n addClass(parent, ns.bm('parent', 'relative'))\n } else {\n removeClass(parent, ns.bm('parent', 'relative'))\n }\n if (options.fullscreen && options.lock) {\n addClass(parent, ns.bm('parent', 'hidden'))\n } else {\n removeClass(parent, ns.bm('parent', 'hidden'))\n }\n}\n"],"names":["isClient","createLoadingComponent","nextTick","isString","getStyle","addClass","removeClass"],"mappings":";;;;;;;;;;;AAKA,IAAI,kBAAkB,GAAG,KAAK,CAAC,CAAC;AACpB,MAAC,OAAO,GAAG,SAAS,OAAO,GAAG,EAAE,EAAE;AAC9C,EAAE,IAAI,CAACA,aAAQ;AACf,IAAI,OAAO,KAAK,CAAC,CAAC;AAClB,EAAE,MAAM,QAAQ,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;AAC3C,EAAE,IAAI,QAAQ,CAAC,UAAU,IAAI,kBAAkB,EAAE;AACjD,IAAI,OAAO,kBAAkB,CAAC;AAC9B,GAAG;AACH,EAAE,MAAM,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AAC,CAAC;AACrD,GAAG;AACH,EAAE,IAAI,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,IAAI,EAAE;AAC1C,IAAID,cAAQ,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AAChD,GAAG,MAAM;AACT,IAAIC,iBAAW,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AACnD,GAAG;AACH,CAAC;;;;"}
|
|
@@ -94,6 +94,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
94
94
|
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
95
95
|
cssVarBlockName: (name: string) => string;
|
|
96
96
|
};
|
|
97
|
+
zIndex: {
|
|
98
|
+
initialZIndex: import("vue").ComputedRef<number>;
|
|
99
|
+
currentZIndex: import("vue").ComputedRef<number>;
|
|
100
|
+
nextZIndex: () => number;
|
|
101
|
+
};
|
|
97
102
|
currentZIndex: import("vue").ComputedRef<number>;
|
|
98
103
|
nextZIndex: () => number;
|
|
99
104
|
messageRef: import("vue").Ref<HTMLDivElement | undefined>;
|
|
@@ -6,15 +6,14 @@ var vue = require('vue');
|
|
|
6
6
|
var core = require('@vueuse/core');
|
|
7
7
|
require('../../../utils/index.js');
|
|
8
8
|
require('../../../constants/index.js');
|
|
9
|
-
var index
|
|
10
|
-
|
|
11
|
-
require('
|
|
9
|
+
var index = require('../../badge/index.js');
|
|
10
|
+
require('../../config-provider/index.js');
|
|
11
|
+
var index$1 = require('../../icon/index.js');
|
|
12
12
|
var message = require('./message.js');
|
|
13
13
|
var instance = require('./instance.js');
|
|
14
14
|
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
15
15
|
var icon = require('../../../utils/vue/icon.js');
|
|
16
|
-
var
|
|
17
|
-
var index$1 = require('../../../hooks/use-z-index/index.js');
|
|
16
|
+
var useGlobalConfig = require('../../config-provider/src/hooks/use-global-config.js');
|
|
18
17
|
var aria = require('../../../constants/aria.js');
|
|
19
18
|
|
|
20
19
|
const _hoisted_1 = ["id"];
|
|
@@ -29,8 +28,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
29
28
|
setup(__props, { expose }) {
|
|
30
29
|
const props = __props;
|
|
31
30
|
const { Close } = icon.TypeComponents;
|
|
32
|
-
const ns =
|
|
33
|
-
const { currentZIndex, nextZIndex } =
|
|
31
|
+
const { ns, zIndex } = useGlobalConfig.useGlobalComponentSettings("message");
|
|
32
|
+
const { currentZIndex, nextZIndex } = zIndex;
|
|
34
33
|
const messageRef = vue.ref();
|
|
35
34
|
const visible = vue.ref(false);
|
|
36
35
|
const height = vue.ref(0);
|
|
@@ -108,13 +107,13 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
108
107
|
onMouseenter: clearTimer,
|
|
109
108
|
onMouseleave: startTimer
|
|
110
109
|
}, [
|
|
111
|
-
_ctx.repeatNum > 1 ? (vue.openBlock(), vue.createBlock(vue.unref(index
|
|
110
|
+
_ctx.repeatNum > 1 ? (vue.openBlock(), vue.createBlock(vue.unref(index.ElBadge), {
|
|
112
111
|
key: 0,
|
|
113
112
|
value: _ctx.repeatNum,
|
|
114
113
|
type: vue.unref(badgeType),
|
|
115
114
|
class: vue.normalizeClass(vue.unref(ns).e("badge"))
|
|
116
115
|
}, null, 8, ["value", "type", "class"])) : vue.createCommentVNode("v-if", true),
|
|
117
|
-
vue.unref(iconComponent) ? (vue.openBlock(), vue.createBlock(vue.unref(index$
|
|
116
|
+
vue.unref(iconComponent) ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.ElIcon), {
|
|
118
117
|
key: 1,
|
|
119
118
|
class: vue.normalizeClass([vue.unref(ns).e("icon"), vue.unref(typeClass)])
|
|
120
119
|
}, {
|
|
@@ -135,7 +134,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
135
134
|
}, null, 10, _hoisted_2)
|
|
136
135
|
], 2112))
|
|
137
136
|
]),
|
|
138
|
-
_ctx.showClose ? (vue.openBlock(), vue.createBlock(vue.unref(index$
|
|
137
|
+
_ctx.showClose ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.ElIcon), {
|
|
139
138
|
key: 2,
|
|
140
139
|
class: vue.normalizeClass(vue.unref(ns).e("closeBtn")),
|
|
141
140
|
onClick: vue.withModifiers(close, ["stop"])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message2.js","sources":["../../../../../../packages/components/message/src/message.vue"],"sourcesContent":["<template>\n <transition\n :name=\"ns.b('fade')\"\n @before-leave=\"onClose\"\n @after-leave=\"$emit('destroy')\"\n >\n <div\n v-show=\"visible\"\n :id=\"id\"\n ref=\"messageRef\"\n :class=\"[\n ns.b(),\n { [ns.m(type)]: type && !icon },\n ns.is('center', center),\n ns.is('closable', showClose),\n customClass,\n ]\"\n :style=\"customStyle\"\n role=\"alert\"\n @mouseenter=\"clearTimer\"\n @mouseleave=\"startTimer\"\n >\n <el-badge\n v-if=\"repeatNum > 1\"\n :value=\"repeatNum\"\n :type=\"badgeType\"\n :class=\"ns.e('badge')\"\n />\n <el-icon v-if=\"iconComponent\" :class=\"[ns.e('icon'), typeClass]\">\n <component :is=\"iconComponent\" />\n </el-icon>\n <slot>\n <p v-if=\"!dangerouslyUseHTMLString\" :class=\"ns.e('content')\">\n {{ message }}\n </p>\n <!-- Caution here, message could've been compromised, never use user's input as message -->\n <p v-else :class=\"ns.e('content')\" v-html=\"message\" />\n </slot>\n <el-icon v-if=\"showClose\" :class=\"ns.e('closeBtn')\" @click.stop=\"close\">\n <Close />\n </el-icon>\n </div>\n </transition>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, onMounted, ref, watch } from 'vue'\nimport { useEventListener, useResizeObserver, useTimeoutFn } from '@vueuse/core'\nimport { TypeComponents, TypeComponentsMap } from '@element-plus/utils'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport ElBadge from '@element-plus/components/badge'\nimport {
|
|
1
|
+
{"version":3,"file":"message2.js","sources":["../../../../../../packages/components/message/src/message.vue"],"sourcesContent":["<template>\n <transition\n :name=\"ns.b('fade')\"\n @before-leave=\"onClose\"\n @after-leave=\"$emit('destroy')\"\n >\n <div\n v-show=\"visible\"\n :id=\"id\"\n ref=\"messageRef\"\n :class=\"[\n ns.b(),\n { [ns.m(type)]: type && !icon },\n ns.is('center', center),\n ns.is('closable', showClose),\n customClass,\n ]\"\n :style=\"customStyle\"\n role=\"alert\"\n @mouseenter=\"clearTimer\"\n @mouseleave=\"startTimer\"\n >\n <el-badge\n v-if=\"repeatNum > 1\"\n :value=\"repeatNum\"\n :type=\"badgeType\"\n :class=\"ns.e('badge')\"\n />\n <el-icon v-if=\"iconComponent\" :class=\"[ns.e('icon'), typeClass]\">\n <component :is=\"iconComponent\" />\n </el-icon>\n <slot>\n <p v-if=\"!dangerouslyUseHTMLString\" :class=\"ns.e('content')\">\n {{ message }}\n </p>\n <!-- Caution here, message could've been compromised, never use user's input as message -->\n <p v-else :class=\"ns.e('content')\" v-html=\"message\" />\n </slot>\n <el-icon v-if=\"showClose\" :class=\"ns.e('closeBtn')\" @click.stop=\"close\">\n <Close />\n </el-icon>\n </div>\n </transition>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, onMounted, ref, watch } from 'vue'\nimport { useEventListener, useResizeObserver, useTimeoutFn } from '@vueuse/core'\nimport { TypeComponents, TypeComponentsMap } from '@element-plus/utils'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport ElBadge from '@element-plus/components/badge'\nimport { useGlobalComponentSettings } from '@element-plus/components/config-provider'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { messageEmits, messageProps } from './message'\nimport { getLastOffset, getOffsetOrSpace } from './instance'\nimport type { BadgeProps } from '@element-plus/components/badge'\nimport type { CSSProperties } from 'vue'\n\nconst { Close } = TypeComponents\n\ndefineOptions({\n name: 'ElMessage',\n})\n\nconst props = defineProps(messageProps)\ndefineEmits(messageEmits)\n\nconst { ns, zIndex } = useGlobalComponentSettings('message')\nconst { currentZIndex, nextZIndex } = zIndex\n\nconst messageRef = ref<HTMLDivElement>()\nconst visible = ref(false)\nconst height = ref(0)\n\nlet stopTimer: (() => void) | undefined = undefined\n\nconst badgeType = computed<BadgeProps['type']>(() =>\n props.type ? (props.type === 'error' ? 'danger' : props.type) : 'info'\n)\nconst typeClass = computed(() => {\n const type = props.type\n return { [ns.bm('icon', type)]: type && TypeComponentsMap[type] }\n})\nconst iconComponent = computed(\n () => props.icon || TypeComponentsMap[props.type] || ''\n)\n\nconst lastOffset = computed(() => getLastOffset(props.id))\nconst offset = computed(\n () => getOffsetOrSpace(props.id, props.offset) + lastOffset.value\n)\nconst bottom = computed((): number => height.value + offset.value)\nconst customStyle = computed<CSSProperties>(() => ({\n top: `${offset.value}px`,\n zIndex: currentZIndex.value,\n}))\n\nfunction startTimer() {\n if (props.duration === 0) return\n ;({ stop: stopTimer } = useTimeoutFn(() => {\n close()\n }, props.duration))\n}\n\nfunction clearTimer() {\n stopTimer?.()\n}\n\nfunction close() {\n visible.value = false\n}\n\nfunction keydown({ code }: KeyboardEvent) {\n if (code === EVENT_CODE.esc) {\n // press esc to close the message\n close()\n }\n}\n\nonMounted(() => {\n startTimer()\n nextZIndex()\n visible.value = true\n})\n\nwatch(\n () => props.repeatNum,\n () => {\n clearTimer()\n startTimer()\n }\n)\n\nuseEventListener(document, 'keydown', keydown)\n\nuseResizeObserver(messageRef, () => {\n height.value = messageRef.value!.getBoundingClientRect().height\n})\n\ndefineExpose({\n visible,\n bottom,\n close,\n})\n</script>\n"],"names":["TypeComponents","useGlobalComponentSettings","ref","computed","TypeComponentsMap","getLastOffset","getOffsetOrSpace","useTimeoutFn","EVENT_CODE","onMounted","watch","useEventListener","useResizeObserver"],"mappings":";;;;;;;;;;;;;;;;;;;;uCA4Dc,CAAA;AAAA,EACZ,IAAM,EAAA,WAAA;AACR,CAAA,CAAA,CAAA;;;;;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AAClC,MAAA,MAAA,CAAO,KAAQ,GAAA,UAAA,CAAW,KAAO,CAAA,qBAAA,EAAwB,CAAA,MAAA,CAAA;AAAA,KAC1D,CAAA,CAAA;AAED,IAAa,MAAA,CAAA;AAAA,MACX,OAAA;AAAA,MACA,MAAA;AAAA,MACA,KAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -12,20 +12,19 @@ var index$3 = require('../../overlay/index.js');
|
|
|
12
12
|
require('../../../utils/index.js');
|
|
13
13
|
var index$4 = require('../../icon/index.js');
|
|
14
14
|
require('../../focus-trap/index.js');
|
|
15
|
+
require('../../config-provider/index.js');
|
|
15
16
|
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
16
17
|
var index = require('../../../directives/trap-focus/index.js');
|
|
17
18
|
var focusTrap = require('../../focus-trap/src/focus-trap.js');
|
|
18
19
|
var icon = require('../../../utils/vue/icon.js');
|
|
19
20
|
var validator = require('../../../utils/vue/validator.js');
|
|
20
|
-
var
|
|
21
|
-
var index$
|
|
22
|
-
var index$7 = require('../../../hooks/use-z-index/index.js');
|
|
23
|
-
var index$8 = require('../../../hooks/use-id/index.js');
|
|
21
|
+
var useGlobalConfig = require('../../config-provider/src/hooks/use-global-config.js');
|
|
22
|
+
var index$5 = require('../../../hooks/use-id/index.js');
|
|
24
23
|
var useFormCommonProps = require('../../form/src/hooks/use-form-common-props.js');
|
|
25
|
-
var index$
|
|
26
|
-
var index$
|
|
27
|
-
var index$
|
|
28
|
-
var index$
|
|
24
|
+
var index$6 = require('../../../hooks/use-draggable/index.js');
|
|
25
|
+
var index$7 = require('../../../hooks/use-same-target/index.js');
|
|
26
|
+
var index$8 = require('../../../hooks/use-lockscreen/index.js');
|
|
27
|
+
var index$9 = require('../../../hooks/use-restore-active/index.js');
|
|
29
28
|
|
|
30
29
|
const _sfc_main = vue.defineComponent({
|
|
31
30
|
name: "ElMessageBox",
|
|
@@ -87,10 +86,10 @@ const _sfc_main = vue.defineComponent({
|
|
|
87
86
|
},
|
|
88
87
|
emits: ["vanish", "action"],
|
|
89
88
|
setup(props, { emit }) {
|
|
90
|
-
const {
|
|
91
|
-
const
|
|
89
|
+
const { locale, zIndex, ns } = useGlobalConfig.useGlobalComponentSettings("message-box");
|
|
90
|
+
const { t } = locale;
|
|
91
|
+
const { nextZIndex } = zIndex;
|
|
92
92
|
const visible = vue.ref(false);
|
|
93
|
-
const { nextZIndex } = index$7.useZIndex();
|
|
94
93
|
const state = vue.reactive({
|
|
95
94
|
autofocus: true,
|
|
96
95
|
beforeClose: null,
|
|
@@ -130,8 +129,8 @@ const _sfc_main = vue.defineComponent({
|
|
|
130
129
|
const type = state.type;
|
|
131
130
|
return { [ns.bm("icon", type)]: type && icon.TypeComponentsMap[type] };
|
|
132
131
|
});
|
|
133
|
-
const contentId = index$
|
|
134
|
-
const inputId = index$
|
|
132
|
+
const contentId = index$5.useId();
|
|
133
|
+
const inputId = index$5.useId();
|
|
135
134
|
const btnSize = useFormCommonProps.useFormSize(vue.computed(() => props.buttonSize), { prop: true, form: true, formItem: true });
|
|
136
135
|
const iconComponent = vue.computed(() => state.icon || icon.TypeComponentsMap[state.type] || "");
|
|
137
136
|
const hasMessage = vue.computed(() => !!state.message);
|
|
@@ -178,7 +177,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
178
177
|
}
|
|
179
178
|
});
|
|
180
179
|
const draggable = vue.computed(() => props.draggable);
|
|
181
|
-
index$
|
|
180
|
+
index$6.useDraggable(rootRef, headerRef, draggable);
|
|
182
181
|
vue.onMounted(async () => {
|
|
183
182
|
await vue.nextTick();
|
|
184
183
|
if (props.closeOnHashChange) {
|
|
@@ -204,7 +203,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
204
203
|
handleAction(state.distinguishCancelAndClose ? "close" : "cancel");
|
|
205
204
|
}
|
|
206
205
|
};
|
|
207
|
-
const overlayEvent = index$
|
|
206
|
+
const overlayEvent = index$7.useSameTarget(handleWrapperClick);
|
|
208
207
|
const handleInputEnter = (e) => {
|
|
209
208
|
if (state.inputType !== "textarea") {
|
|
210
209
|
e.preventDefault();
|
|
@@ -263,9 +262,9 @@ const _sfc_main = vue.defineComponent({
|
|
|
263
262
|
}
|
|
264
263
|
};
|
|
265
264
|
if (props.lockScroll) {
|
|
266
|
-
index$
|
|
265
|
+
index$8.useLockscreen(visible);
|
|
267
266
|
}
|
|
268
|
-
index$
|
|
267
|
+
index$9.useRestoreActive(visible);
|
|
269
268
|
return {
|
|
270
269
|
...vue.toRefs(state),
|
|
271
270
|
ns,
|