@element-plus/nightly 0.0.20220224 → 0.0.20220227
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 +235 -240
- package/dist/index.full.min.js +6 -6
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +6 -6
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +235 -240
- 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/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/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/affix/index.mjs +2 -2
- package/es/components/affix/src/affix.mjs +116 -23
- package/es/components/affix/src/affix.mjs.map +1 -1
- package/es/components/affix/src/affix2.mjs +23 -116
- package/es/components/affix/src/affix2.mjs.map +1 -1
- package/es/components/alert/index.mjs +2 -2
- package/es/components/alert/src/alert.mjs +88 -36
- package/es/components/alert/src/alert.mjs.map +1 -1
- package/es/components/alert/src/alert2.mjs +36 -88
- package/es/components/alert/src/alert2.mjs.map +1 -1
- package/es/components/badge/index.mjs +2 -2
- package/es/components/badge/src/badge.mjs +52 -17
- package/es/components/badge/src/badge.mjs.map +1 -1
- package/es/components/badge/src/badge2.mjs +17 -52
- package/es/components/badge/src/badge2.mjs.map +1 -1
- package/es/components/image/src/image2.mjs +2 -2
- package/es/components/image/src/image2.mjs.map +1 -1
- package/es/components/index.mjs +3 -3
- package/es/components/message/src/message-method.mjs +3 -2
- package/es/components/message/src/message-method.mjs.map +1 -1
- package/es/components/notification/src/notify.mjs +5 -3
- package/es/components/notification/src/notify.mjs.map +1 -1
- package/es/components/popper/src/trigger.mjs +3 -1
- package/es/components/popper/src/trigger.mjs.map +1 -1
- package/es/components/popper/src/trigger.vue.d.ts +5 -5
- package/es/components/popper/src/utils.d.ts +2 -2
- package/es/components/popper/src/utils.mjs +4 -1
- package/es/components/popper/src/utils.mjs.map +1 -1
- package/es/components/tag/index.d.ts +47 -0
- package/es/components/tag/index.mjs +2 -2
- package/es/components/tag/index.mjs.map +1 -1
- package/es/components/tag/src/tag.d.ts +2 -0
- package/es/components/tag/src/tag.mjs.map +1 -1
- package/es/components/tag/src/tag.vue.d.ts +47 -0
- package/es/components/tag/src/tag2.mjs +52 -59
- package/es/components/tag/src/tag2.mjs.map +1 -1
- package/es/directives/click-outside/index.mjs +4 -4
- package/es/directives/click-outside/index.mjs.map +1 -1
- package/es/index.mjs +3 -3
- package/es/utils/index.mjs +1 -1
- package/es/utils/types.d.ts +1 -0
- package/es/utils/types.mjs +2 -1
- package/es/utils/types.mjs.map +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/affix/index.js +2 -2
- package/lib/components/affix/src/affix.js +116 -24
- package/lib/components/affix/src/affix.js.map +1 -1
- package/lib/components/affix/src/affix2.js +24 -116
- package/lib/components/affix/src/affix2.js.map +1 -1
- package/lib/components/alert/index.js +2 -2
- package/lib/components/alert/src/alert.js +87 -37
- package/lib/components/alert/src/alert.js.map +1 -1
- package/lib/components/alert/src/alert2.js +37 -87
- package/lib/components/alert/src/alert2.js.map +1 -1
- package/lib/components/badge/index.js +2 -2
- package/lib/components/badge/src/badge.js +52 -17
- package/lib/components/badge/src/badge.js.map +1 -1
- package/lib/components/badge/src/badge2.js +17 -52
- package/lib/components/badge/src/badge2.js.map +1 -1
- package/lib/components/image/src/image2.js +2 -2
- package/lib/components/image/src/image2.js.map +1 -1
- package/lib/components/index.js +3 -3
- package/lib/components/message/src/message-method.js +3 -2
- package/lib/components/message/src/message-method.js.map +1 -1
- package/lib/components/notification/src/notify.js +5 -3
- package/lib/components/notification/src/notify.js.map +1 -1
- package/lib/components/popper/src/trigger.js +3 -1
- package/lib/components/popper/src/trigger.js.map +1 -1
- package/lib/components/popper/src/trigger.vue.d.ts +5 -5
- package/lib/components/popper/src/utils.d.ts +2 -2
- package/lib/components/popper/src/utils.js +4 -1
- package/lib/components/popper/src/utils.js.map +1 -1
- package/lib/components/tag/index.d.ts +47 -0
- package/lib/components/tag/src/tag.d.ts +2 -0
- package/lib/components/tag/src/tag.js.map +1 -1
- package/lib/components/tag/src/tag.vue.d.ts +47 -0
- package/lib/components/tag/src/tag2.js +56 -63
- package/lib/components/tag/src/tag2.js.map +1 -1
- package/lib/directives/click-outside/index.js +4 -4
- package/lib/directives/click-outside/index.js.map +1 -1
- package/lib/index.js +3 -3
- package/lib/utils/index.js +1 -0
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/types.d.ts +1 -0
- package/lib/utils/types.js +2 -0
- package/lib/utils/types.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
|
@@ -7,6 +7,20 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
7
7
|
readonly size: import("../../../utils").BuildPropReturn<StringConstructor, unknown, unknown, "default" | "small" | "large", unknown>;
|
|
8
8
|
readonly effect: import("../../../utils").BuildPropReturn<StringConstructor, "light", unknown, "plain" | "light" | "dark", unknown>;
|
|
9
9
|
}, {
|
|
10
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
11
|
+
readonly closable: BooleanConstructor;
|
|
12
|
+
readonly type: import("../../../utils").BuildPropReturn<StringConstructor, "", unknown, "" | "success" | "warning" | "info" | "danger", unknown>;
|
|
13
|
+
readonly hit: BooleanConstructor;
|
|
14
|
+
readonly disableTransitions: BooleanConstructor;
|
|
15
|
+
readonly color: import("../../../utils").BuildPropReturn<StringConstructor, "", unknown, unknown, unknown>;
|
|
16
|
+
readonly size: import("../../../utils").BuildPropReturn<StringConstructor, unknown, unknown, "default" | "small" | "large", unknown>;
|
|
17
|
+
readonly effect: import("../../../utils").BuildPropReturn<StringConstructor, "light", unknown, "plain" | "light" | "dark", unknown>;
|
|
18
|
+
}>> & {
|
|
19
|
+
onClose?: ((evt: MouseEvent) => any) | undefined;
|
|
20
|
+
onClick?: ((evt: MouseEvent) => any) | undefined;
|
|
21
|
+
}>>;
|
|
22
|
+
emit: ((event: "close", evt: MouseEvent) => void) & ((event: "click", evt: MouseEvent) => void);
|
|
23
|
+
tagSize: import("vue").ComputedRef<"default" | "small" | "large">;
|
|
10
24
|
ns: {
|
|
11
25
|
namespace: import("vue").ComputedRef<string>;
|
|
12
26
|
b: (blockSuffix?: string) => string;
|
|
@@ -24,6 +38,39 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
24
38
|
classes: import("vue").ComputedRef<string[]>;
|
|
25
39
|
handleClose: (event: MouseEvent) => void;
|
|
26
40
|
handleClick: (event: MouseEvent) => void;
|
|
41
|
+
ElIcon: import("../../../utils").SFCWithInstall<import("vue").DefineComponent<{
|
|
42
|
+
readonly size: import("../../../utils").BuildPropReturn<import("../../../utils").PropWrapper<string | number>, unknown, unknown, unknown, unknown>;
|
|
43
|
+
readonly color: import("../../../utils").BuildPropReturn<StringConstructor, unknown, unknown, unknown, unknown>;
|
|
44
|
+
}, {
|
|
45
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
46
|
+
readonly size: import("../../../utils").BuildPropReturn<import("../../../utils").PropWrapper<string | number>, unknown, unknown, unknown, unknown>;
|
|
47
|
+
readonly color: import("../../../utils").BuildPropReturn<StringConstructor, unknown, unknown, unknown, unknown>;
|
|
48
|
+
}>> & {
|
|
49
|
+
[x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
|
|
50
|
+
}>>;
|
|
51
|
+
ns: {
|
|
52
|
+
namespace: import("vue").ComputedRef<string>;
|
|
53
|
+
b: (blockSuffix?: string) => string;
|
|
54
|
+
e: (element?: string | undefined) => string;
|
|
55
|
+
m: (modifier?: string | undefined) => string;
|
|
56
|
+
be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
|
|
57
|
+
em: (element?: string | undefined, modifier?: string | undefined) => string;
|
|
58
|
+
bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
|
|
59
|
+
bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
|
|
60
|
+
is: {
|
|
61
|
+
(name: string, state: boolean | undefined): string;
|
|
62
|
+
(name: string): string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
style: import("vue").ComputedRef<import("vue").CSSProperties>;
|
|
66
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
67
|
+
readonly size: import("../../../utils").BuildPropReturn<import("../../../utils").PropWrapper<string | number>, unknown, unknown, unknown, unknown>;
|
|
68
|
+
readonly color: import("../../../utils").BuildPropReturn<StringConstructor, unknown, unknown, unknown, unknown>;
|
|
69
|
+
}>>, {
|
|
70
|
+
size: import("../../../utils").BuildPropType<import("../../../utils").PropWrapper<string | number>, unknown, unknown>;
|
|
71
|
+
color: string;
|
|
72
|
+
}>> & Record<string, any>;
|
|
73
|
+
Close: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
27
74
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
28
75
|
close: (evt: MouseEvent) => boolean;
|
|
29
76
|
click: (evt: MouseEvent) => boolean;
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import { defineComponent, computed,
|
|
1
|
+
import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle, createElementVNode, renderSlot, createBlock, withCtx, createVNode, createCommentVNode, Transition } from 'vue';
|
|
2
2
|
import { ElIcon } from '../../icon/index.mjs';
|
|
3
3
|
import { Close } from '@element-plus/icons-vue';
|
|
4
4
|
import '../../../hooks/index.mjs';
|
|
5
5
|
import { tagProps, tagEmits } from './tag.mjs';
|
|
6
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
7
6
|
import { useSize } from '../../../hooks/use-common-props/index.mjs';
|
|
8
7
|
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
9
8
|
|
|
10
|
-
const
|
|
11
|
-
name: "ElTag"
|
|
12
|
-
|
|
9
|
+
const __default__ = {
|
|
10
|
+
name: "ElTag"
|
|
11
|
+
};
|
|
12
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
13
|
+
...__default__,
|
|
13
14
|
props: tagProps,
|
|
14
15
|
emits: tagEmits,
|
|
15
|
-
setup(
|
|
16
|
+
setup(__props, { emit }) {
|
|
17
|
+
const props = __props;
|
|
16
18
|
const tagSize = useSize();
|
|
17
19
|
const ns = useNamespace("tag");
|
|
18
20
|
const classes = computed(() => {
|
|
@@ -33,69 +35,60 @@ const _sfc_main = defineComponent({
|
|
|
33
35
|
const handleClick = (event) => {
|
|
34
36
|
emit("click", event);
|
|
35
37
|
};
|
|
36
|
-
return {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
handleClick
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
45
|
-
const _component_close = resolveComponent("close");
|
|
46
|
-
const _component_el_icon = resolveComponent("el-icon");
|
|
47
|
-
return !_ctx.disableTransitions ? (openBlock(), createElementBlock("span", {
|
|
48
|
-
key: 0,
|
|
49
|
-
class: normalizeClass(_ctx.classes),
|
|
50
|
-
style: normalizeStyle({ backgroundColor: _ctx.color }),
|
|
51
|
-
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
|
|
52
|
-
}, [
|
|
53
|
-
createElementVNode("span", {
|
|
54
|
-
class: normalizeClass(_ctx.ns.e("content"))
|
|
55
|
-
}, [
|
|
56
|
-
renderSlot(_ctx.$slots, "default")
|
|
57
|
-
], 2),
|
|
58
|
-
_ctx.closable ? (openBlock(), createBlock(_component_el_icon, {
|
|
59
|
-
key: 0,
|
|
60
|
-
class: normalizeClass(_ctx.ns.e("close")),
|
|
61
|
-
onClick: _ctx.handleClose
|
|
62
|
-
}, {
|
|
63
|
-
default: withCtx(() => [
|
|
64
|
-
createVNode(_component_close)
|
|
65
|
-
]),
|
|
66
|
-
_: 1
|
|
67
|
-
}, 8, ["class", "onClick"])) : createCommentVNode("v-if", true)
|
|
68
|
-
], 6)) : (openBlock(), createBlock(Transition, {
|
|
69
|
-
key: 1,
|
|
70
|
-
name: `${_ctx.ns.namespace.value}-zoom-in-center`
|
|
71
|
-
}, {
|
|
72
|
-
default: withCtx(() => [
|
|
73
|
-
createElementVNode("span", {
|
|
74
|
-
class: normalizeClass(_ctx.classes),
|
|
38
|
+
return (_ctx, _cache) => {
|
|
39
|
+
return !_ctx.disableTransitions ? (openBlock(), createElementBlock("span", {
|
|
40
|
+
key: 0,
|
|
41
|
+
class: normalizeClass(unref(classes)),
|
|
75
42
|
style: normalizeStyle({ backgroundColor: _ctx.color }),
|
|
76
|
-
onClick:
|
|
43
|
+
onClick: handleClick
|
|
77
44
|
}, [
|
|
78
45
|
createElementVNode("span", {
|
|
79
|
-
class: normalizeClass(
|
|
46
|
+
class: normalizeClass(unref(ns).e("content"))
|
|
80
47
|
}, [
|
|
81
48
|
renderSlot(_ctx.$slots, "default")
|
|
82
49
|
], 2),
|
|
83
|
-
_ctx.closable ? (openBlock(), createBlock(
|
|
50
|
+
_ctx.closable ? (openBlock(), createBlock(unref(ElIcon), {
|
|
84
51
|
key: 0,
|
|
85
|
-
class: normalizeClass(
|
|
86
|
-
onClick:
|
|
52
|
+
class: normalizeClass(unref(ns).e("close")),
|
|
53
|
+
onClick: handleClose
|
|
87
54
|
}, {
|
|
88
55
|
default: withCtx(() => [
|
|
89
|
-
createVNode(
|
|
56
|
+
createVNode(unref(Close))
|
|
90
57
|
]),
|
|
91
58
|
_: 1
|
|
92
|
-
}, 8, ["class"
|
|
93
|
-
], 6)
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
59
|
+
}, 8, ["class"])) : createCommentVNode("v-if", true)
|
|
60
|
+
], 6)) : (openBlock(), createBlock(Transition, {
|
|
61
|
+
key: 1,
|
|
62
|
+
name: `${unref(ns).namespace.value}-zoom-in-center`
|
|
63
|
+
}, {
|
|
64
|
+
default: withCtx(() => [
|
|
65
|
+
createElementVNode("span", {
|
|
66
|
+
class: normalizeClass(unref(classes)),
|
|
67
|
+
style: normalizeStyle({ backgroundColor: _ctx.color }),
|
|
68
|
+
onClick: handleClick
|
|
69
|
+
}, [
|
|
70
|
+
createElementVNode("span", {
|
|
71
|
+
class: normalizeClass(unref(ns).e("content"))
|
|
72
|
+
}, [
|
|
73
|
+
renderSlot(_ctx.$slots, "default")
|
|
74
|
+
], 2),
|
|
75
|
+
_ctx.closable ? (openBlock(), createBlock(unref(ElIcon), {
|
|
76
|
+
key: 0,
|
|
77
|
+
class: normalizeClass(unref(ns).e("close")),
|
|
78
|
+
onClick: handleClose
|
|
79
|
+
}, {
|
|
80
|
+
default: withCtx(() => [
|
|
81
|
+
createVNode(unref(Close))
|
|
82
|
+
]),
|
|
83
|
+
_: 1
|
|
84
|
+
}, 8, ["class"])) : createCommentVNode("v-if", true)
|
|
85
|
+
], 6)
|
|
86
|
+
]),
|
|
87
|
+
_: 3
|
|
88
|
+
}, 8, ["name"]));
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
});
|
|
99
92
|
|
|
100
|
-
export {
|
|
93
|
+
export { _sfc_main as default };
|
|
101
94
|
//# sourceMappingURL=tag2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag2.mjs","sources":["../../../../../../packages/components/tag/src/tag.vue"],"sourcesContent":["<template>\n <span\n v-if=\"!disableTransitions\"\n :class=\"classes\"\n :style=\"{ backgroundColor: color }\"\n @click=\"handleClick\"\n >\n <span :class=\"ns.e('content')\">\n <slot></slot>\n </span>\n <el-icon v-if=\"closable\" :class=\"ns.e('close')\" @click=\"handleClose\">\n <
|
|
1
|
+
{"version":3,"file":"tag2.mjs","sources":["../../../../../../packages/components/tag/src/tag.vue"],"sourcesContent":["<template>\n <span\n v-if=\"!disableTransitions\"\n :class=\"classes\"\n :style=\"{ backgroundColor: color }\"\n @click=\"handleClick\"\n >\n <span :class=\"ns.e('content')\">\n <slot></slot>\n </span>\n <el-icon v-if=\"closable\" :class=\"ns.e('close')\" @click=\"handleClose\">\n <Close />\n </el-icon>\n </span>\n <transition v-else :name=\"`${ns.namespace.value}-zoom-in-center`\">\n <span\n :class=\"classes\"\n :style=\"{ backgroundColor: color }\"\n @click=\"handleClick\"\n >\n <span :class=\"ns.e('content')\">\n <slot></slot>\n </span>\n <el-icon v-if=\"closable\" :class=\"ns.e('close')\" @click=\"handleClose\">\n <Close />\n </el-icon>\n </span>\n </transition>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport ElIcon from '@element-plus/components/icon'\nimport { Close } from '@element-plus/icons-vue'\n\nimport { useSize, useNamespace } from '@element-plus/hooks'\nimport { tagProps, tagEmits } from './tag'\n\ndefineOptions({\n name: 'ElTag',\n})\nconst props = defineProps(tagProps)\nconst emit = defineEmits(tagEmits)\n\nconst tagSize = useSize()\nconst ns = useNamespace('tag')\nconst classes = computed(() => {\n const { type, hit, effect, closable } = props\n return [\n ns.b(),\n ns.is('closable', closable),\n ns.m(type),\n ns.m(tagSize.value),\n ns.m(effect),\n ns.is('hit', hit),\n ]\n})\n\n// methods\nconst handleClose = (event: MouseEvent) => {\n event.stopPropagation()\n emit('close', event)\n}\n\nconst handleClick = (event: MouseEvent) => {\n emit('click', event)\n}\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AA4CA;AACA;AACA;;;;;;;;;;;AAaA;;;;AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { isClient } from '@vueuse/core';
|
|
2
2
|
import '../../utils/index.mjs';
|
|
3
|
-
import {
|
|
3
|
+
import { isElement } from '../../utils/types.mjs';
|
|
4
4
|
|
|
5
5
|
const nodeList = /* @__PURE__ */ new Map();
|
|
6
6
|
let startClick;
|
|
7
7
|
if (isClient) {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
document.addEventListener("mousedown", (e) => startClick = e);
|
|
9
|
+
document.addEventListener("mouseup", (e) => {
|
|
10
10
|
for (const handlers of nodeList.values()) {
|
|
11
11
|
for (const { documentHandler } of handlers) {
|
|
12
12
|
documentHandler(e, startClick);
|
|
@@ -18,7 +18,7 @@ function createDocumentHandler(el, binding) {
|
|
|
18
18
|
let excludes = [];
|
|
19
19
|
if (Array.isArray(binding.arg)) {
|
|
20
20
|
excludes = binding.arg;
|
|
21
|
-
} else if (binding.arg
|
|
21
|
+
} else if (isElement(binding.arg)) {
|
|
22
22
|
excludes.push(binding.arg);
|
|
23
23
|
}
|
|
24
24
|
return function(mouseup, mousedown) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../../packages/directives/click-outside/index.ts"],"sourcesContent":["import { isClient } from '@vueuse/core'\nimport {
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../packages/directives/click-outside/index.ts"],"sourcesContent":["import { isClient } from '@vueuse/core'\nimport { isElement } from '@element-plus/utils'\n\nimport type {\n ComponentPublicInstance,\n DirectiveBinding,\n ObjectDirective,\n} from 'vue'\nimport type { Nullable } from '@element-plus/utils'\n\ntype DocumentHandler = <T extends MouseEvent>(mouseup: T, mousedown: T) => void\ntype FlushList = Map<\n HTMLElement,\n {\n documentHandler: DocumentHandler\n bindingFn: (...args: unknown[]) => unknown\n }[]\n>\n\nconst nodeList: FlushList = new Map()\n\nlet startClick: MouseEvent\n\nif (isClient) {\n document.addEventListener('mousedown', (e: MouseEvent) => (startClick = e))\n document.addEventListener('mouseup', (e: MouseEvent) => {\n for (const handlers of nodeList.values()) {\n for (const { documentHandler } of handlers) {\n documentHandler(e as MouseEvent, startClick)\n }\n }\n })\n}\n\nfunction createDocumentHandler(\n el: HTMLElement,\n binding: DirectiveBinding\n): DocumentHandler {\n let excludes: HTMLElement[] = []\n if (Array.isArray(binding.arg)) {\n excludes = binding.arg\n } else if (isElement(binding.arg)) {\n // due to current implementation on binding type is wrong the type casting is necessary here\n excludes.push(binding.arg as unknown as HTMLElement)\n }\n return function (mouseup, mousedown) {\n const popperRef = (\n binding.instance as ComponentPublicInstance<{\n popperRef: Nullable<HTMLElement>\n }>\n ).popperRef\n const mouseUpTarget = mouseup.target as Node\n const mouseDownTarget = mousedown?.target as Node\n const isBound = !binding || !binding.instance\n const isTargetExists = !mouseUpTarget || !mouseDownTarget\n const isContainedByEl =\n el.contains(mouseUpTarget) || el.contains(mouseDownTarget)\n const isSelf = el === mouseUpTarget\n\n const isTargetExcluded =\n (excludes.length &&\n excludes.some((item) => item?.contains(mouseUpTarget))) ||\n (excludes.length && excludes.includes(mouseDownTarget as HTMLElement))\n const isContainedByPopper =\n popperRef &&\n (popperRef.contains(mouseUpTarget) || popperRef.contains(mouseDownTarget))\n if (\n isBound ||\n isTargetExists ||\n isContainedByEl ||\n isSelf ||\n isTargetExcluded ||\n isContainedByPopper\n ) {\n return\n }\n binding.value(mouseup, mousedown)\n }\n}\n\nconst ClickOutside: ObjectDirective = {\n beforeMount(el: HTMLElement, binding: DirectiveBinding) {\n // there could be multiple handlers on the element\n if (!nodeList.has(el)) {\n nodeList.set(el, [])\n }\n\n nodeList.get(el).push({\n documentHandler: createDocumentHandler(el, binding),\n bindingFn: binding.value,\n })\n },\n updated(el: HTMLElement, binding: DirectiveBinding) {\n if (!nodeList.has(el)) {\n nodeList.set(el, [])\n }\n\n const handlers = nodeList.get(el)\n const oldHandlerIndex = handlers.findIndex(\n (item) => item.bindingFn === binding.oldValue\n )\n const newHandler = {\n documentHandler: createDocumentHandler(el, binding),\n bindingFn: binding.value,\n }\n\n if (oldHandlerIndex >= 0) {\n // replace the old handler to the new handler\n handlers.splice(oldHandlerIndex, 1, newHandler)\n } else {\n handlers.push(newHandler)\n }\n },\n unmounted(el: HTMLElement) {\n // remove all listeners when a component unmounted\n nodeList.delete(el)\n },\n}\n\nexport default ClickOutside\n"],"names":[],"mappings":"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"}
|
package/es/index.mjs
CHANGED
|
@@ -5,16 +5,16 @@ import './directives/index.mjs';
|
|
|
5
5
|
import './hooks/index.mjs';
|
|
6
6
|
import './tokens/index.mjs';
|
|
7
7
|
export { makeInstaller } from './make-installer.mjs';
|
|
8
|
-
export { affixEmits, affixProps } from './components/affix/src/
|
|
8
|
+
export { affixEmits, affixProps } from './components/affix/src/affix2.mjs';
|
|
9
9
|
export { ElAffix } from './components/affix/index.mjs';
|
|
10
|
-
export { alertEffects, alertEmits, alertProps } from './components/alert/src/
|
|
10
|
+
export { alertEffects, alertEmits, alertProps } from './components/alert/src/alert2.mjs';
|
|
11
11
|
export { ElAlert } from './components/alert/index.mjs';
|
|
12
12
|
export { ElAutocomplete } from './components/autocomplete/index.mjs';
|
|
13
13
|
export { avatarEmits, avatarProps } from './components/avatar/src/avatar.mjs';
|
|
14
14
|
export { ElAvatar } from './components/avatar/index.mjs';
|
|
15
15
|
export { backtopEmits, backtopProps } from './components/backtop/src/backtop.mjs';
|
|
16
16
|
export { ElBacktop } from './components/backtop/index.mjs';
|
|
17
|
-
export { badgeProps } from './components/badge/src/
|
|
17
|
+
export { badgeProps } from './components/badge/src/badge2.mjs';
|
|
18
18
|
export { ElBadge } from './components/badge/index.mjs';
|
|
19
19
|
export { breadcrumbProps } from './components/breadcrumb/src/breadcrumb.mjs';
|
|
20
20
|
export { breadcrumbItemProps } from './components/breadcrumb/src/breadcrumb-item.mjs';
|
package/es/utils/index.mjs
CHANGED
|
@@ -9,7 +9,7 @@ export { entriesOf, getPropByPath, keysOf } from './objects.mjs';
|
|
|
9
9
|
export { cAF, rAF } from './raf.mjs';
|
|
10
10
|
export { generateId, getRandomInt } from './rand.mjs';
|
|
11
11
|
export { escapeStringRegexp } from './strings.mjs';
|
|
12
|
-
export { isEmpty, isUndefined } from './types.mjs';
|
|
12
|
+
export { isElement, isEmpty, isUndefined } from './types.mjs';
|
|
13
13
|
export { mutable } from './typescript.mjs';
|
|
14
14
|
export { attemptFocus, focusNode, getSibling, isFocusable, isLeaf, isVisible, obtainAllFocusableElements, triggerEvent } from './dom/aria.mjs';
|
|
15
15
|
export { composeEventHandlers, off, on, once, whenMouse } from './dom/event.mjs';
|
package/es/utils/types.d.ts
CHANGED
package/es/utils/types.mjs
CHANGED
|
@@ -5,6 +5,7 @@ export { isVNode } from 'vue';
|
|
|
5
5
|
|
|
6
6
|
const isUndefined = (val) => val === void 0;
|
|
7
7
|
const isEmpty = (val) => !val && val !== 0 || isArray(val) && val.length === 0 || isObject(val) && !Object.keys(val).length;
|
|
8
|
+
const isElement = (e) => e instanceof Element;
|
|
8
9
|
|
|
9
|
-
export { isEmpty, isUndefined };
|
|
10
|
+
export { isElement, isEmpty, isUndefined };
|
|
10
11
|
//# sourceMappingURL=types.mjs.map
|
package/es/utils/types.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.mjs","sources":["../../../../packages/utils/types.ts"],"sourcesContent":["import { isArray, isObject } from '@vue/shared'\n\nexport {\n isArray,\n isFunction,\n isObject,\n isString,\n isDate,\n isPromise,\n isSymbol,\n} from '@vue/shared'\nexport { isBoolean, isNumber } from '@vueuse/core'\nexport { isVNode } from 'vue'\n\nexport const isUndefined = (val: any): val is undefined => val === undefined\n\nexport const isEmpty = (val: unknown) =>\n (!val && val !== 0) ||\n (isArray(val) && val.length === 0) ||\n (isObject(val) && !Object.keys(val).length)\n"],"names":[],"mappings":";;;;;AAYY,MAAC,WAAW,GAAG,CAAC,GAAG,KAAK,GAAG,KAAK,KAAK,EAAE;AACvC,MAAC,OAAO,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"types.mjs","sources":["../../../../packages/utils/types.ts"],"sourcesContent":["import { isArray, isObject } from '@vue/shared'\n\nexport {\n isArray,\n isFunction,\n isObject,\n isString,\n isDate,\n isPromise,\n isSymbol,\n} from '@vue/shared'\nexport { isBoolean, isNumber } from '@vueuse/core'\nexport { isVNode } from 'vue'\n\nexport const isUndefined = (val: any): val is undefined => val === undefined\n\nexport const isEmpty = (val: unknown) =>\n (!val && val !== 0) ||\n (isArray(val) && val.length === 0) ||\n (isObject(val) && !Object.keys(val).length)\n\nexport const isElement = (e: unknown): e is Element => e instanceof Element\n"],"names":[],"mappings":";;;;;AAYY,MAAC,WAAW,GAAG,CAAC,GAAG,KAAK,GAAG,KAAK,KAAK,EAAE;AACvC,MAAC,OAAO,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO;AACvH,MAAC,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,YAAY;;;;"}
|
package/es/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.0.
|
|
1
|
+
export declare const version = "0.0.20220227";
|
package/es/version.mjs
CHANGED
package/es/version.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.
|
|
1
|
+
{"version":3,"file":"version.mjs","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.20220227'\n"],"names":[],"mappings":"AAAY,MAAC,OAAO,GAAG;;;;"}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
require('../../utils/index.js');
|
|
6
|
-
var affix$1 = require('./src/
|
|
7
|
-
var affix = require('./src/
|
|
6
|
+
var affix$1 = require('./src/affix.js');
|
|
7
|
+
var affix = require('./src/affix2.js');
|
|
8
8
|
var install = require('../../utils/vue/install.js');
|
|
9
9
|
|
|
10
10
|
const ElAffix = install.withInstall(affix$1["default"]);
|
|
@@ -2,33 +2,125 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var core = require('@vueuse/core');
|
|
5
7
|
require('../../../utils/index.js');
|
|
6
|
-
|
|
8
|
+
require('../../../hooks/index.js');
|
|
9
|
+
var affix = require('./affix2.js');
|
|
10
|
+
var index = require('../../../hooks/use-namespace/index.js');
|
|
11
|
+
var scroll = require('../../../utils/dom/scroll.js');
|
|
7
12
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
const __default__ = {
|
|
14
|
+
name: "ElAffix"
|
|
15
|
+
};
|
|
16
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
17
|
+
...__default__,
|
|
18
|
+
props: affix.affixProps,
|
|
19
|
+
emits: affix.affixEmits,
|
|
20
|
+
setup(__props, { expose, emit }) {
|
|
21
|
+
const props = __props;
|
|
22
|
+
const ns = index.useNamespace("affix");
|
|
23
|
+
const target = vue.shallowRef();
|
|
24
|
+
const root = vue.shallowRef();
|
|
25
|
+
const scrollContainer = vue.shallowRef();
|
|
26
|
+
const fixed = vue.ref(false);
|
|
27
|
+
const height = vue.ref(0);
|
|
28
|
+
const width = vue.ref(0);
|
|
29
|
+
const scrollTop = vue.ref(0);
|
|
30
|
+
const clientHeight = vue.ref(0);
|
|
31
|
+
const transform = vue.ref(0);
|
|
32
|
+
const rootStyle = vue.computed(() => {
|
|
33
|
+
return {
|
|
34
|
+
height: fixed.value ? `${height.value}px` : "",
|
|
35
|
+
width: fixed.value ? `${width.value}px` : ""
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
const affixStyle = vue.computed(() => {
|
|
39
|
+
if (!fixed.value)
|
|
40
|
+
return;
|
|
41
|
+
const offset = props.offset ? `${props.offset}px` : 0;
|
|
42
|
+
const _transform = transform.value ? `translateY(${transform.value}px)` : "";
|
|
43
|
+
return {
|
|
44
|
+
height: `${height.value}px`,
|
|
45
|
+
width: `${width.value}px`,
|
|
46
|
+
top: props.position === "top" ? offset : "",
|
|
47
|
+
bottom: props.position === "bottom" ? offset : "",
|
|
48
|
+
transform: _transform,
|
|
49
|
+
zIndex: props.zIndex
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
const update = () => {
|
|
53
|
+
if (!root.value || !target.value || !scrollContainer.value)
|
|
54
|
+
return;
|
|
55
|
+
const rootRect = root.value.getBoundingClientRect();
|
|
56
|
+
const targetRect = target.value.getBoundingClientRect();
|
|
57
|
+
height.value = rootRect.height;
|
|
58
|
+
width.value = rootRect.width;
|
|
59
|
+
scrollTop.value = scrollContainer.value instanceof Window ? document.documentElement.scrollTop : scrollContainer.value.scrollTop || 0;
|
|
60
|
+
clientHeight.value = document.documentElement.clientHeight;
|
|
61
|
+
if (props.position === "top") {
|
|
62
|
+
if (props.target) {
|
|
63
|
+
const difference = targetRect.bottom - props.offset - height.value;
|
|
64
|
+
fixed.value = props.offset > rootRect.top && targetRect.bottom > 0;
|
|
65
|
+
transform.value = difference < 0 ? difference : 0;
|
|
66
|
+
} else {
|
|
67
|
+
fixed.value = props.offset > rootRect.top;
|
|
68
|
+
}
|
|
69
|
+
} else {
|
|
70
|
+
if (props.target) {
|
|
71
|
+
const difference = clientHeight.value - targetRect.top - props.offset - height.value;
|
|
72
|
+
fixed.value = clientHeight.value - props.offset < rootRect.bottom && clientHeight.value > targetRect.top;
|
|
73
|
+
transform.value = difference < 0 ? -difference : 0;
|
|
74
|
+
} else {
|
|
75
|
+
fixed.value = clientHeight.value - props.offset < rootRect.bottom;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
const onScroll = () => {
|
|
80
|
+
update();
|
|
81
|
+
emit("scroll", {
|
|
82
|
+
scrollTop: scrollTop.value,
|
|
83
|
+
fixed: fixed.value
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
vue.watch(fixed, (fixed2) => {
|
|
87
|
+
emit("change", fixed2);
|
|
88
|
+
});
|
|
89
|
+
vue.onMounted(() => {
|
|
90
|
+
var _a;
|
|
91
|
+
if (props.target) {
|
|
92
|
+
target.value = (_a = document.querySelector(props.target)) != null ? _a : void 0;
|
|
93
|
+
if (!target.value) {
|
|
94
|
+
throw new Error(`Target is not existed: ${props.target}`);
|
|
95
|
+
}
|
|
96
|
+
} else {
|
|
97
|
+
target.value = document.documentElement;
|
|
98
|
+
}
|
|
99
|
+
scrollContainer.value = scroll.getScrollContainer(root.value, true);
|
|
100
|
+
});
|
|
101
|
+
core.useEventListener(scrollContainer, "scroll", onScroll);
|
|
102
|
+
core.useResizeObserver(root, () => update());
|
|
103
|
+
core.useResizeObserver(target, () => update());
|
|
104
|
+
expose({
|
|
105
|
+
update
|
|
106
|
+
});
|
|
107
|
+
return (_ctx, _cache) => {
|
|
108
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
109
|
+
ref_key: "root",
|
|
110
|
+
ref: root,
|
|
111
|
+
class: vue.normalizeClass(vue.unref(ns).b()),
|
|
112
|
+
style: vue.normalizeStyle(vue.unref(rootStyle))
|
|
113
|
+
}, [
|
|
114
|
+
vue.createElementVNode("div", {
|
|
115
|
+
class: vue.normalizeClass({ [vue.unref(ns).m("fixed")]: fixed.value }),
|
|
116
|
+
style: vue.normalizeStyle(vue.unref(affixStyle))
|
|
117
|
+
}, [
|
|
118
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
119
|
+
], 6)
|
|
120
|
+
], 6);
|
|
121
|
+
};
|
|
25
122
|
}
|
|
26
123
|
});
|
|
27
|
-
const affixEmits = {
|
|
28
|
-
scroll: ({ scrollTop, fixed }) => typeof scrollTop === "number" && typeof fixed === "boolean",
|
|
29
|
-
change: (fixed) => typeof fixed === "boolean"
|
|
30
|
-
};
|
|
31
124
|
|
|
32
|
-
exports
|
|
33
|
-
exports.affixProps = affixProps;
|
|
125
|
+
exports["default"] = _sfc_main;
|
|
34
126
|
//# sourceMappingURL=affix.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"affix.js","sources":["../../../../../../packages/components/affix/src/affix.
|
|
1
|
+
{"version":3,"file":"affix.js","sources":["../../../../../../packages/components/affix/src/affix.vue"],"sourcesContent":["<template>\n <div ref=\"root\" :class=\"ns.b()\" :style=\"rootStyle\">\n <div :class=\"{ [ns.m('fixed')]: fixed }\" :style=\"affixStyle\">\n <slot></slot>\n </div>\n </div>\n</template>\n<script lang=\"ts\" setup>\nimport { computed, onMounted, ref, shallowRef, watch } from 'vue'\nimport { useEventListener, useResizeObserver } from '@vueuse/core'\nimport { getScrollContainer } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport { affixEmits, affixProps } from './affix'\n\nimport type { CSSProperties } from 'vue'\n\ndefineOptions({\n name: 'ElAffix',\n})\n\nconst props = defineProps(affixProps)\nconst emit = defineEmits(affixEmits)\n\nconst ns = useNamespace('affix')\n\nconst target = shallowRef<HTMLElement>()\nconst root = shallowRef<HTMLDivElement>()\nconst scrollContainer = shallowRef<HTMLElement | Window>()\n\nconst fixed = ref(false)\nconst height = ref(0) // height of root\nconst width = ref(0) // width of root\nconst scrollTop = ref(0) // scrollTop of documentElement\nconst clientHeight = ref(0) // clientHeight of documentElement\nconst transform = ref(0)\n\nconst rootStyle = computed<CSSProperties>(() => {\n return {\n height: fixed.value ? `${height.value}px` : '',\n width: fixed.value ? `${width.value}px` : '',\n }\n})\n\nconst affixStyle = computed<CSSProperties | undefined>(() => {\n if (!fixed.value) return\n\n const offset = props.offset ? `${props.offset}px` : 0\n const _transform = transform.value ? `translateY(${transform.value}px)` : ''\n\n return {\n height: `${height.value}px`,\n width: `${width.value}px`,\n top: props.position === 'top' ? offset : '',\n bottom: props.position === 'bottom' ? offset : '',\n transform: _transform,\n zIndex: props.zIndex,\n }\n})\n\nconst update = () => {\n if (!root.value || !target.value || !scrollContainer.value) return\n\n const rootRect = root.value.getBoundingClientRect()\n const targetRect = target.value.getBoundingClientRect()\n height.value = rootRect.height\n width.value = rootRect.width\n scrollTop.value =\n scrollContainer.value instanceof Window\n ? document.documentElement.scrollTop\n : scrollContainer.value.scrollTop || 0\n clientHeight.value = document.documentElement.clientHeight\n\n if (props.position === 'top') {\n if (props.target) {\n const difference = targetRect.bottom - props.offset - height.value\n fixed.value = props.offset > rootRect.top && targetRect.bottom > 0\n transform.value = difference < 0 ? difference : 0\n } else {\n fixed.value = props.offset > rootRect.top\n }\n } else {\n if (props.target) {\n const difference =\n clientHeight.value - targetRect.top - props.offset - height.value\n fixed.value =\n clientHeight.value - props.offset < rootRect.bottom &&\n clientHeight.value > targetRect.top\n transform.value = difference < 0 ? -difference : 0\n } else {\n fixed.value = clientHeight.value - props.offset < rootRect.bottom\n }\n }\n}\n\nconst onScroll = () => {\n update()\n\n emit('scroll', {\n scrollTop: scrollTop.value,\n fixed: fixed.value,\n })\n}\n\nwatch(fixed, (fixed) => {\n emit('change', fixed)\n})\n\nonMounted(() => {\n if (props.target) {\n target.value =\n document.querySelector<HTMLElement>(props.target) ?? undefined\n if (!target.value) {\n throw new Error(`Target is not existed: ${props.target}`)\n }\n } else {\n target.value = document.documentElement\n }\n scrollContainer.value = getScrollContainer(root.value!, true)\n})\n\nuseEventListener(scrollContainer, 'scroll', onScroll)\nuseResizeObserver(root, () => update())\nuseResizeObserver(target, () => update())\n\ndefineExpose({\n /** @description update affix status */\n update,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAuBA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;AAOA;;;;;;;;;;;;;;AAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA;;;;;;;AASA;;;AAIA;;;;;;;;;;;AAaA;AACA;AACA;AAEA;;;;;;;;;;;;;;;;;;;;;;;;"}
|