@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
|
@@ -2,125 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var vue = require('vue');
|
|
6
|
-
var core = require('@vueuse/core');
|
|
7
5
|
require('../../../utils/index.js');
|
|
8
|
-
require('../../../
|
|
9
|
-
var affix = require('./affix.js');
|
|
10
|
-
var index = require('../../../hooks/use-namespace/index.js');
|
|
11
|
-
var scroll = require('../../../utils/dom/scroll.js');
|
|
6
|
+
var props = require('../../../utils/vue/props.js');
|
|
12
7
|
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
};
|
|
8
|
+
const affixProps = props.buildProps({
|
|
9
|
+
zIndex: {
|
|
10
|
+
type: props.definePropType([Number, String]),
|
|
11
|
+
default: 100
|
|
12
|
+
},
|
|
13
|
+
target: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: ""
|
|
16
|
+
},
|
|
17
|
+
offset: {
|
|
18
|
+
type: Number,
|
|
19
|
+
default: 0
|
|
20
|
+
},
|
|
21
|
+
position: {
|
|
22
|
+
type: String,
|
|
23
|
+
values: ["top", "bottom"],
|
|
24
|
+
default: "top"
|
|
122
25
|
}
|
|
123
26
|
});
|
|
27
|
+
const affixEmits = {
|
|
28
|
+
scroll: ({ scrollTop, fixed }) => typeof scrollTop === "number" && typeof fixed === "boolean",
|
|
29
|
+
change: (fixed) => typeof fixed === "boolean"
|
|
30
|
+
};
|
|
124
31
|
|
|
125
|
-
exports
|
|
32
|
+
exports.affixEmits = affixEmits;
|
|
33
|
+
exports.affixProps = affixProps;
|
|
126
34
|
//# sourceMappingURL=affix2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"affix2.js","sources":["../../../../../../packages/components/affix/src/affix.
|
|
1
|
+
{"version":3,"file":"affix2.js","sources":["../../../../../../packages/components/affix/src/affix.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type { ZIndexProperty } from 'csstype'\nimport type Affix from './affix.vue'\n\nexport const affixProps = buildProps({\n zIndex: {\n type: definePropType<ZIndexProperty>([Number, String]),\n default: 100,\n },\n target: {\n type: String,\n default: '',\n },\n offset: {\n type: Number,\n default: 0,\n },\n position: {\n type: String,\n values: ['top', 'bottom'],\n default: 'top',\n },\n} as const)\nexport type AffixProps = ExtractPropTypes<typeof affixProps>\n\nexport const affixEmits = {\n scroll: ({ scrollTop, fixed }: { scrollTop: number; fixed: boolean }) =>\n typeof scrollTop === 'number' && typeof fixed === 'boolean',\n change: (fixed: boolean) => typeof fixed === 'boolean',\n}\nexport type AffixEmits = typeof affixEmits\n\nexport type AffixInstance = InstanceType<typeof Affix>\n"],"names":["buildProps","definePropType"],"mappings":";;;;;;;AACY,MAAC,UAAU,GAAGA,gBAAU,CAAC;AACrC,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAEC,oBAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC;AAC7B,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,UAAU,GAAG;AAC1B,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,OAAO,SAAS,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,SAAS;AAC/F,EAAE,MAAM,EAAE,CAAC,KAAK,KAAK,OAAO,KAAK,KAAK,SAAS;AAC/C;;;;;"}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
require('../../utils/index.js');
|
|
6
|
-
var alert$1 = require('./src/
|
|
7
|
-
var alert = require('./src/
|
|
6
|
+
var alert$1 = require('./src/alert.js');
|
|
7
|
+
var alert = require('./src/alert2.js');
|
|
8
8
|
var install = require('../../utils/vue/install.js');
|
|
9
9
|
|
|
10
10
|
const ElAlert = install.withInstall(alert$1["default"]);
|
|
@@ -2,47 +2,97 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var index$1 = require('../../icon/index.js');
|
|
5
7
|
require('../../../utils/index.js');
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
+
require('../../../hooks/index.js');
|
|
9
|
+
var alert = require('./alert2.js');
|
|
8
10
|
var icon = require('../../../utils/vue/icon.js');
|
|
11
|
+
var index = require('../../../hooks/use-namespace/index.js');
|
|
9
12
|
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
13
|
+
const __default__ = {
|
|
14
|
+
name: "ElAlert"
|
|
15
|
+
};
|
|
16
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
17
|
+
...__default__,
|
|
18
|
+
props: alert.alertProps,
|
|
19
|
+
emits: alert.alertEmits,
|
|
20
|
+
setup(__props, { emit }) {
|
|
21
|
+
const props = __props;
|
|
22
|
+
const { Close } = icon.TypeComponents;
|
|
23
|
+
const slots = vue.useSlots();
|
|
24
|
+
const ns = index.useNamespace("alert");
|
|
25
|
+
const visible = vue.ref(true);
|
|
26
|
+
const iconComponent = vue.computed(() => icon.TypeComponentsMap[props.type] || icon.TypeComponentsMap["info"]);
|
|
27
|
+
const isBigIcon = vue.computed(() => props.description || { [ns.is("big")]: slots.default });
|
|
28
|
+
const isBoldTitle = vue.computed(() => props.description || { [ns.is("bold")]: slots.default });
|
|
29
|
+
const close = (evt) => {
|
|
30
|
+
visible.value = false;
|
|
31
|
+
emit("close", evt);
|
|
32
|
+
};
|
|
33
|
+
return (_ctx, _cache) => {
|
|
34
|
+
return vue.openBlock(), vue.createBlock(vue.Transition, {
|
|
35
|
+
name: vue.unref(ns).b("fade")
|
|
36
|
+
}, {
|
|
37
|
+
default: vue.withCtx(() => [
|
|
38
|
+
vue.withDirectives(vue.createElementVNode("div", {
|
|
39
|
+
class: vue.normalizeClass([vue.unref(ns).b(), vue.unref(ns).m(_ctx.type), vue.unref(ns).is("center", _ctx.center), vue.unref(ns).is(_ctx.effect)]),
|
|
40
|
+
role: "alert"
|
|
41
|
+
}, [
|
|
42
|
+
_ctx.showIcon && vue.unref(iconComponent) ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.ElIcon), {
|
|
43
|
+
key: 0,
|
|
44
|
+
class: vue.normalizeClass([vue.unref(ns).e("icon"), vue.unref(isBigIcon)])
|
|
45
|
+
}, {
|
|
46
|
+
default: vue.withCtx(() => [
|
|
47
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(iconComponent))))
|
|
48
|
+
]),
|
|
49
|
+
_: 1
|
|
50
|
+
}, 8, ["class"])) : vue.createCommentVNode("v-if", true),
|
|
51
|
+
vue.createElementVNode("div", {
|
|
52
|
+
class: vue.normalizeClass(vue.unref(ns).e("content"))
|
|
53
|
+
}, [
|
|
54
|
+
_ctx.title || _ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
55
|
+
key: 0,
|
|
56
|
+
class: vue.normalizeClass([vue.unref(ns).e("title"), vue.unref(isBoldTitle)])
|
|
57
|
+
}, [
|
|
58
|
+
vue.renderSlot(_ctx.$slots, "title", {}, () => [
|
|
59
|
+
vue.createTextVNode(vue.toDisplayString(_ctx.title), 1)
|
|
60
|
+
])
|
|
61
|
+
], 2)) : vue.createCommentVNode("v-if", true),
|
|
62
|
+
_ctx.$slots.default || _ctx.description ? (vue.openBlock(), vue.createElementBlock("p", {
|
|
63
|
+
key: 1,
|
|
64
|
+
class: vue.normalizeClass(vue.unref(ns).e("description"))
|
|
65
|
+
}, [
|
|
66
|
+
vue.renderSlot(_ctx.$slots, "default", {}, () => [
|
|
67
|
+
vue.createTextVNode(vue.toDisplayString(_ctx.description), 1)
|
|
68
|
+
])
|
|
69
|
+
], 2)) : vue.createCommentVNode("v-if", true),
|
|
70
|
+
_ctx.closable ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
|
|
71
|
+
_ctx.closeText ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
72
|
+
key: 0,
|
|
73
|
+
class: vue.normalizeClass([vue.unref(ns).e("close-btn"), vue.unref(ns).is("customed")]),
|
|
74
|
+
onClick: close
|
|
75
|
+
}, vue.toDisplayString(_ctx.closeText), 3)) : (vue.openBlock(), vue.createBlock(vue.unref(index$1.ElIcon), {
|
|
76
|
+
key: 1,
|
|
77
|
+
class: vue.normalizeClass(vue.unref(ns).e("close-btn")),
|
|
78
|
+
onClick: close
|
|
79
|
+
}, {
|
|
80
|
+
default: vue.withCtx(() => [
|
|
81
|
+
vue.createVNode(vue.unref(Close))
|
|
82
|
+
]),
|
|
83
|
+
_: 1
|
|
84
|
+
}, 8, ["class"]))
|
|
85
|
+
], 2112)) : vue.createCommentVNode("v-if", true)
|
|
86
|
+
], 2)
|
|
87
|
+
], 2), [
|
|
88
|
+
[vue.vShow, visible.value]
|
|
89
|
+
])
|
|
90
|
+
]),
|
|
91
|
+
_: 3
|
|
92
|
+
}, 8, ["name"]);
|
|
93
|
+
};
|
|
39
94
|
}
|
|
40
95
|
});
|
|
41
|
-
const alertEmits = {
|
|
42
|
-
close: (evt) => evt instanceof MouseEvent
|
|
43
|
-
};
|
|
44
96
|
|
|
45
|
-
exports
|
|
46
|
-
exports.alertEmits = alertEmits;
|
|
47
|
-
exports.alertProps = alertProps;
|
|
97
|
+
exports["default"] = _sfc_main;
|
|
48
98
|
//# sourceMappingURL=alert.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.js","sources":["../../../../../../packages/components/alert/src/alert.
|
|
1
|
+
{"version":3,"file":"alert.js","sources":["../../../../../../packages/components/alert/src/alert.vue"],"sourcesContent":["<template>\n <transition :name=\"ns.b('fade')\">\n <div\n v-show=\"visible\"\n :class=\"[ns.b(), ns.m(type), ns.is('center', center), ns.is(effect)]\"\n role=\"alert\"\n >\n <el-icon\n v-if=\"showIcon && iconComponent\"\n :class=\"[ns.e('icon'), isBigIcon]\"\n >\n <component :is=\"iconComponent\" />\n </el-icon>\n <div :class=\"ns.e('content')\">\n <span\n v-if=\"title || $slots.title\"\n :class=\"[ns.e('title'), isBoldTitle]\"\n >\n <slot name=\"title\">{{ title }}</slot>\n </span>\n <p v-if=\"$slots.default || description\" :class=\"ns.e('description')\">\n <slot>\n {{ description }}\n </slot>\n </p>\n <template v-if=\"closable\">\n <div\n v-if=\"closeText\"\n :class=\"[ns.e('close-btn'), ns.is('customed')]\"\n @click=\"close\"\n >\n {{ closeText }}\n </div>\n <el-icon v-else :class=\"ns.e('close-btn')\" @click=\"close\">\n <Close />\n </el-icon>\n </template>\n </div>\n </div>\n </transition>\n</template>\n<script lang=\"ts\" setup>\nimport { computed, ref, useSlots } from 'vue'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { TypeComponents, TypeComponentsMap } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport { alertProps, alertEmits } from './alert'\n\nconst { Close } = TypeComponents\n\ndefineOptions({\n name: 'ElAlert',\n})\n\nconst props = defineProps(alertProps)\nconst emit = defineEmits(alertEmits)\nconst slots = useSlots()\n\nconst ns = useNamespace('alert')\n\n// state\nconst visible = ref(true)\n\n// computed\nconst iconComponent = computed(\n () => TypeComponentsMap[props.type] || TypeComponentsMap['info']\n)\nconst isBigIcon = computed(\n () => props.description || { [ns.is('big')]: slots.default }\n)\nconst isBoldTitle = computed(\n () => props.description || { [ns.is('bold')]: slots.default }\n)\n\n// methods\nconst close = (evt: MouseEvent) => {\n visible.value = false\n emit('close', evt)\n}\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAgDA;AAQA;AAEA;AAGA;AAGA;AAGA;AAGA;AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -2,97 +2,47 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var vue = require('vue');
|
|
6
|
-
var index$1 = require('../../icon/index.js');
|
|
7
5
|
require('../../../utils/index.js');
|
|
8
|
-
require('../../../
|
|
9
|
-
var
|
|
6
|
+
var props = require('../../../utils/vue/props.js');
|
|
7
|
+
var objects = require('../../../utils/objects.js');
|
|
10
8
|
var icon = require('../../../utils/vue/icon.js');
|
|
11
|
-
var index = require('../../../hooks/use-namespace/index.js');
|
|
12
9
|
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
_ctx.showIcon && vue.unref(iconComponent) ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.ElIcon), {
|
|
43
|
-
key: 0,
|
|
44
|
-
class: vue.normalizeClass([vue.unref(ns).e("icon"), vue.unref(isBigIcon)])
|
|
45
|
-
}, {
|
|
46
|
-
default: vue.withCtx(() => [
|
|
47
|
-
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(iconComponent))))
|
|
48
|
-
]),
|
|
49
|
-
_: 1
|
|
50
|
-
}, 8, ["class"])) : vue.createCommentVNode("v-if", true),
|
|
51
|
-
vue.createElementVNode("div", {
|
|
52
|
-
class: vue.normalizeClass(vue.unref(ns).e("content"))
|
|
53
|
-
}, [
|
|
54
|
-
_ctx.title || _ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
55
|
-
key: 0,
|
|
56
|
-
class: vue.normalizeClass([vue.unref(ns).e("title"), vue.unref(isBoldTitle)])
|
|
57
|
-
}, [
|
|
58
|
-
vue.renderSlot(_ctx.$slots, "title", {}, () => [
|
|
59
|
-
vue.createTextVNode(vue.toDisplayString(_ctx.title), 1)
|
|
60
|
-
])
|
|
61
|
-
], 2)) : vue.createCommentVNode("v-if", true),
|
|
62
|
-
_ctx.$slots.default || _ctx.description ? (vue.openBlock(), vue.createElementBlock("p", {
|
|
63
|
-
key: 1,
|
|
64
|
-
class: vue.normalizeClass(vue.unref(ns).e("description"))
|
|
65
|
-
}, [
|
|
66
|
-
vue.renderSlot(_ctx.$slots, "default", {}, () => [
|
|
67
|
-
vue.createTextVNode(vue.toDisplayString(_ctx.description), 1)
|
|
68
|
-
])
|
|
69
|
-
], 2)) : vue.createCommentVNode("v-if", true),
|
|
70
|
-
_ctx.closable ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
|
|
71
|
-
_ctx.closeText ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
72
|
-
key: 0,
|
|
73
|
-
class: vue.normalizeClass([vue.unref(ns).e("close-btn"), vue.unref(ns).is("customed")]),
|
|
74
|
-
onClick: close
|
|
75
|
-
}, vue.toDisplayString(_ctx.closeText), 3)) : (vue.openBlock(), vue.createBlock(vue.unref(index$1.ElIcon), {
|
|
76
|
-
key: 1,
|
|
77
|
-
class: vue.normalizeClass(vue.unref(ns).e("close-btn")),
|
|
78
|
-
onClick: close
|
|
79
|
-
}, {
|
|
80
|
-
default: vue.withCtx(() => [
|
|
81
|
-
vue.createVNode(vue.unref(Close))
|
|
82
|
-
]),
|
|
83
|
-
_: 1
|
|
84
|
-
}, 8, ["class"]))
|
|
85
|
-
], 2112)) : vue.createCommentVNode("v-if", true)
|
|
86
|
-
], 2)
|
|
87
|
-
], 2), [
|
|
88
|
-
[vue.vShow, visible.value]
|
|
89
|
-
])
|
|
90
|
-
]),
|
|
91
|
-
_: 3
|
|
92
|
-
}, 8, ["name"]);
|
|
93
|
-
};
|
|
10
|
+
const alertEffects = ["light", "dark"];
|
|
11
|
+
const alertProps = props.buildProps({
|
|
12
|
+
title: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: ""
|
|
15
|
+
},
|
|
16
|
+
description: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: ""
|
|
19
|
+
},
|
|
20
|
+
type: {
|
|
21
|
+
type: String,
|
|
22
|
+
values: objects.keysOf(icon.TypeComponentsMap),
|
|
23
|
+
default: "info"
|
|
24
|
+
},
|
|
25
|
+
closable: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: true
|
|
28
|
+
},
|
|
29
|
+
closeText: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: ""
|
|
32
|
+
},
|
|
33
|
+
showIcon: Boolean,
|
|
34
|
+
center: Boolean,
|
|
35
|
+
effect: {
|
|
36
|
+
type: String,
|
|
37
|
+
values: alertEffects,
|
|
38
|
+
default: "light"
|
|
94
39
|
}
|
|
95
40
|
});
|
|
41
|
+
const alertEmits = {
|
|
42
|
+
close: (evt) => evt instanceof MouseEvent
|
|
43
|
+
};
|
|
96
44
|
|
|
97
|
-
exports
|
|
45
|
+
exports.alertEffects = alertEffects;
|
|
46
|
+
exports.alertEmits = alertEmits;
|
|
47
|
+
exports.alertProps = alertProps;
|
|
98
48
|
//# sourceMappingURL=alert2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert2.js","sources":["../../../../../../packages/components/alert/src/alert.
|
|
1
|
+
{"version":3,"file":"alert2.js","sources":["../../../../../../packages/components/alert/src/alert.ts"],"sourcesContent":["import { TypeComponentsMap, buildProps, keysOf } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type Alert from './alert.vue'\n\nexport const alertEffects = ['light', 'dark'] as const\n\nexport const alertProps = buildProps({\n title: {\n type: String,\n default: '',\n },\n description: {\n type: String,\n default: '',\n },\n type: {\n type: String,\n values: keysOf(TypeComponentsMap),\n default: 'info',\n },\n closable: {\n type: Boolean,\n default: true,\n },\n closeText: {\n type: String,\n default: '',\n },\n showIcon: Boolean,\n center: Boolean,\n effect: {\n type: String,\n values: alertEffects,\n default: 'light',\n },\n} as const)\nexport type AlertProps = ExtractPropTypes<typeof alertProps>\n\nexport const alertEmits = {\n close: (evt: MouseEvent) => evt instanceof MouseEvent,\n}\nexport type AlertEmits = typeof alertEmits\n\nexport type AlertInstance = InstanceType<typeof Alert>\n"],"names":["buildProps","keysOf","TypeComponentsMap"],"mappings":";;;;;;;;;AACY,MAAC,YAAY,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE;AAClC,MAAC,UAAU,GAAGA,gBAAU,CAAC;AACrC,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAEC,cAAM,CAACC,sBAAiB,CAAC;AACrC,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,MAAM,EAAE,OAAO;AACjB,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,YAAY;AACxB,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,UAAU,GAAG;AAC1B,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,GAAG,YAAY,UAAU;AAC3C;;;;;;"}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
require('../../utils/index.js');
|
|
6
|
-
var badge$1 = require('./src/
|
|
7
|
-
var badge = require('./src/
|
|
6
|
+
var badge$1 = require('./src/badge.js');
|
|
7
|
+
var badge = require('./src/badge2.js');
|
|
8
8
|
var install = require('../../utils/vue/install.js');
|
|
9
9
|
|
|
10
10
|
const ElBadge = install.withInstall(badge$1["default"]);
|
|
@@ -2,26 +2,61 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
require('../../../hooks/index.js');
|
|
5
7
|
require('../../../utils/index.js');
|
|
6
|
-
var
|
|
8
|
+
var badge = require('./badge2.js');
|
|
9
|
+
var index = require('../../../hooks/use-namespace/index.js');
|
|
10
|
+
var core = require('@vueuse/core');
|
|
7
11
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
12
|
+
const _hoisted_1 = ["textContent"];
|
|
13
|
+
const __default__ = {
|
|
14
|
+
name: "ElBadge"
|
|
15
|
+
};
|
|
16
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
17
|
+
...__default__,
|
|
18
|
+
props: badge.badgeProps,
|
|
19
|
+
setup(__props, { expose }) {
|
|
20
|
+
const props = __props;
|
|
21
|
+
const ns = index.useNamespace("badge");
|
|
22
|
+
const content = vue.computed(() => {
|
|
23
|
+
if (props.isDot)
|
|
24
|
+
return "";
|
|
25
|
+
if (core.isNumber(props.value) && core.isNumber(props.max)) {
|
|
26
|
+
return props.max < props.value ? `${props.max}+` : `${props.value}`;
|
|
27
|
+
}
|
|
28
|
+
return `${props.value}`;
|
|
29
|
+
});
|
|
30
|
+
expose({
|
|
31
|
+
content
|
|
32
|
+
});
|
|
33
|
+
return (_ctx, _cache) => {
|
|
34
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
35
|
+
class: vue.normalizeClass(vue.unref(ns).b())
|
|
36
|
+
}, [
|
|
37
|
+
vue.renderSlot(_ctx.$slots, "default"),
|
|
38
|
+
vue.createVNode(vue.Transition, {
|
|
39
|
+
name: `${vue.unref(ns).namespace.value}-zoom-in-center`
|
|
40
|
+
}, {
|
|
41
|
+
default: vue.withCtx(() => [
|
|
42
|
+
vue.withDirectives(vue.createElementVNode("sup", {
|
|
43
|
+
class: vue.normalizeClass([
|
|
44
|
+
vue.unref(ns).e("content"),
|
|
45
|
+
vue.unref(ns).em("content", _ctx.type),
|
|
46
|
+
vue.unref(ns).is("fixed", !!_ctx.$slots.default),
|
|
47
|
+
vue.unref(ns).is("dot", _ctx.isDot)
|
|
48
|
+
]),
|
|
49
|
+
textContent: vue.toDisplayString(vue.unref(content))
|
|
50
|
+
}, null, 10, _hoisted_1), [
|
|
51
|
+
[vue.vShow, !_ctx.hidden && (vue.unref(content) || vue.unref(content) === "0" || _ctx.isDot)]
|
|
52
|
+
])
|
|
53
|
+
]),
|
|
54
|
+
_: 1
|
|
55
|
+
}, 8, ["name"])
|
|
56
|
+
], 2);
|
|
57
|
+
};
|
|
23
58
|
}
|
|
24
59
|
});
|
|
25
60
|
|
|
26
|
-
exports
|
|
61
|
+
exports["default"] = _sfc_main;
|
|
27
62
|
//# sourceMappingURL=badge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.js","sources":["../../../../../../packages/components/badge/src/badge.
|
|
1
|
+
{"version":3,"file":"badge.js","sources":["../../../../../../packages/components/badge/src/badge.vue"],"sourcesContent":["<template>\n <div :class=\"ns.b()\">\n <slot></slot>\n <transition :name=\"`${ns.namespace.value}-zoom-in-center`\">\n <sup\n v-show=\"!hidden && (content || content === '0' || isDot)\"\n :class=\"[\n ns.e('content'),\n ns.em('content', type),\n ns.is('fixed', !!$slots.default),\n ns.is('dot', isDot),\n ]\"\n v-text=\"content\"\n >\n </sup>\n </transition>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { isNumber } from '@element-plus/utils'\nimport { badgeProps } from './badge'\n\ndefineOptions({\n name: 'ElBadge',\n})\n\nconst props = defineProps(badgeProps)\n\nconst ns = useNamespace('badge')\n\nconst content = computed<string>(() => {\n if (props.isDot) return ''\n\n if (isNumber(props.value) && isNumber(props.max)) {\n return props.max < props.value ? `${props.max}+` : `${props.value}`\n }\n return `${props.value}`\n})\n\ndefineExpose({\n /** @description badge content */\n content,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AA+BA;AAEA;;;;;;;;AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|