@element-plus/nightly 0.0.20220227 → 0.0.20220228
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/README.md +8 -0
- package/dist/index.full.js +5 -5
- package/dist/index.full.min.js +2 -2
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +2 -2
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +5 -5
- 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 +23 -116
- package/es/components/affix/src/affix.mjs.map +1 -1
- package/es/components/affix/src/affix2.mjs +116 -23
- 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 +36 -88
- package/es/components/alert/src/alert.mjs.map +1 -1
- package/es/components/alert/src/alert2.mjs +88 -36
- 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 +17 -52
- package/es/components/badge/src/badge.mjs.map +1 -1
- package/es/components/badge/src/badge2.mjs +52 -17
- package/es/components/badge/src/badge2.mjs.map +1 -1
- package/es/components/button/src/button2.mjs +3 -3
- package/es/components/button/src/button2.mjs.map +1 -1
- package/es/components/index.mjs +3 -3
- package/es/index.mjs +3 -3
- 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 +24 -116
- package/lib/components/affix/src/affix.js.map +1 -1
- package/lib/components/affix/src/affix2.js +116 -24
- 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 +37 -87
- package/lib/components/alert/src/alert.js.map +1 -1
- package/lib/components/alert/src/alert2.js +87 -37
- 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 +17 -52
- package/lib/components/badge/src/badge.js.map +1 -1
- package/lib/components/badge/src/badge2.js +52 -17
- package/lib/components/badge/src/badge2.js.map +1 -1
- package/lib/components/button/src/button2.js +3 -3
- package/lib/components/button/src/button2.js.map +1 -1
- package/lib/components/index.js +3 -3
- package/lib/index.js +3 -3
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +5 -5
- package/web-types.json +1 -1
|
@@ -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=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.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;;;;;;"}
|
|
@@ -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('./alert.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=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.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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -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/badge2.js');
|
|
7
|
+
var badge = require('./src/badge.js');
|
|
8
8
|
var install = require('../../utils/vue/install.js');
|
|
9
9
|
|
|
10
10
|
const ElBadge = install.withInstall(badge$1["default"]);
|
|
@@ -2,61 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var vue = require('vue');
|
|
6
|
-
require('../../../hooks/index.js');
|
|
7
5
|
require('../../../utils/index.js');
|
|
8
|
-
var
|
|
9
|
-
var index = require('../../../hooks/use-namespace/index.js');
|
|
10
|
-
var core = require('@vueuse/core');
|
|
6
|
+
var props = require('../../../utils/vue/props.js');
|
|
11
7
|
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
};
|
|
8
|
+
const badgeProps = props.buildProps({
|
|
9
|
+
value: {
|
|
10
|
+
type: [String, Number],
|
|
11
|
+
default: ""
|
|
12
|
+
},
|
|
13
|
+
max: {
|
|
14
|
+
type: Number,
|
|
15
|
+
default: 99
|
|
16
|
+
},
|
|
17
|
+
isDot: Boolean,
|
|
18
|
+
hidden: Boolean,
|
|
19
|
+
type: {
|
|
20
|
+
type: String,
|
|
21
|
+
values: ["primary", "success", "warning", "info", "danger"],
|
|
22
|
+
default: "danger"
|
|
58
23
|
}
|
|
59
24
|
});
|
|
60
25
|
|
|
61
|
-
exports
|
|
26
|
+
exports.badgeProps = badgeProps;
|
|
62
27
|
//# 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.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type Badge from './badge.vue'\n\nexport const badgeProps = buildProps({\n value: {\n type: [String, Number],\n default: '',\n },\n max: {\n type: Number,\n default: 99,\n },\n isDot: Boolean,\n hidden: Boolean,\n type: {\n type: String,\n values: ['primary', 'success', 'warning', 'info', 'danger'],\n default: 'danger',\n },\n} as const)\nexport type BadgeProps = ExtractPropTypes<typeof badgeProps>\n\nexport type BadgeInstance = InstanceType<typeof Badge>\n"],"names":["buildProps"],"mappings":";;;;;;;AACY,MAAC,UAAU,GAAGA,gBAAU,CAAC;AACrC,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,KAAK,EAAE,OAAO;AAChB,EAAE,MAAM,EAAE,OAAO;AACjB,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC;AAC/D,IAAI,OAAO,EAAE,QAAQ;AACrB,GAAG;AACH,CAAC;;;;"}
|
|
@@ -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('./badge.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=badge2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge2.js","sources":["../../../../../../packages/components/badge/src/badge.
|
|
1
|
+
{"version":3,"file":"badge2.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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -128,11 +128,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
128
128
|
]),
|
|
129
129
|
_: 1
|
|
130
130
|
}, 8, ["class"]))
|
|
131
|
-
], 2112)) : _ctx.icon ? (vue.openBlock(), vue.createBlock(vue.unref(index$4.ElIcon), { key: 1 }, {
|
|
131
|
+
], 2112)) : _ctx.icon || _ctx.$slots.icon ? (vue.openBlock(), vue.createBlock(vue.unref(index$4.ElIcon), { key: 1 }, {
|
|
132
132
|
default: vue.withCtx(() => [
|
|
133
|
-
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.icon)))
|
|
133
|
+
_ctx.icon ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.icon), { key: 0 })) : vue.renderSlot(_ctx.$slots, "icon", { key: 1 })
|
|
134
134
|
]),
|
|
135
|
-
_:
|
|
135
|
+
_: 3
|
|
136
136
|
})) : vue.createCommentVNode("v-if", true),
|
|
137
137
|
_ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
138
138
|
key: 2,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button2.js","sources":["../../../../../../packages/components/button/src/button.vue"],"sourcesContent":["<template>\n <button\n ref=\"_ref\"\n :class=\"[\n ns.b(),\n ns.m(_type),\n ns.m(_size),\n ns.is('disabled', _disabled),\n ns.is('loading', loading),\n ns.is('plain', plain),\n ns.is('round', round),\n ns.is('circle', circle),\n ]\"\n :disabled=\"_disabled || loading\"\n :autofocus=\"autofocus\"\n :type=\"nativeType\"\n :style=\"buttonStyle\"\n @click=\"handleClick\"\n >\n <template v-if=\"loading\">\n <slot v-if=\"$slots.loading\" name=\"loading\"></slot>\n <el-icon v-else :class=\"ns.is('loading')\">\n <component :is=\"loadingIcon\" />\n </el-icon>\n </template>\n <el-icon v-else-if=\"icon\">\n <component :is=\"icon\" />\n </el-icon>\n <span\n v-if=\"$slots.default\"\n :class=\"{ [ns.em('text', 'expand')]: shouldAddSpace }\"\n >\n <slot></slot>\n </span>\n </button>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, inject, Text, ref, useSlots } from 'vue'\nimport { TinyColor } from '@ctrl/tinycolor'\nimport { ElIcon } from '@element-plus/components/icon'\nimport {\n useDisabled,\n useFormItem,\n useGlobalConfig,\n useNamespace,\n useSize,\n} from '@element-plus/hooks'\nimport { buttonGroupContextKey } from '@element-plus/tokens'\nimport { buttonEmits, buttonProps } from './button'\n\ndefineOptions({\n name: 'ElButton',\n})\n\nconst props = defineProps(buttonProps)\nconst emit = defineEmits(buttonEmits)\nconst slots = useSlots()\n\nconst buttonGroupContext = inject(buttonGroupContextKey, undefined)\nconst globalConfig = useGlobalConfig('button')\nconst ns = useNamespace('button')\nconst { form } = useFormItem()\nconst _size = useSize(computed(() => buttonGroupContext?.size))\nconst _disabled = useDisabled()\nconst _ref = ref<HTMLButtonElement>()\n\nconst _type = computed(() => props.type || buttonGroupContext?.type || '')\nconst autoInsertSpace = computed(\n () => props.autoInsertSpace ?? globalConfig.value?.autoInsertSpace ?? false\n)\n\n// add space between two characters in Chinese\nconst shouldAddSpace = computed(() => {\n const defaultSlot = slots.default?.()\n if (autoInsertSpace.value && defaultSlot?.length === 1) {\n const slot = defaultSlot[0]\n if (slot?.type === Text) {\n const text = slot.children\n return /^\\p{Unified_Ideograph}{2}$/u.test(text as string)\n }\n }\n return false\n})\n\n// calculate hover & active color by custom color\n// only work when custom color\nconst buttonStyle = computed(() => {\n let styles: Record<string, string> = {}\n\n const buttonColor = props.color\n\n if (buttonColor) {\n const color = new TinyColor(buttonColor)\n const shadeBgColor = color.shade(20).toString()\n if (props.plain) {\n styles = {\n '--el-button-bg-color': color.tint(90).toString(),\n '--el-button-text-color': buttonColor,\n '--el-button-hover-text-color': 'var(--el-color-white)',\n '--el-button-hover-bg-color': buttonColor,\n '--el-button-hover-border-color': buttonColor,\n '--el-button-active-bg-color': shadeBgColor,\n '--el-button-active-text-color': 'var(--el-color-white)',\n '--el-button-active-border-color': shadeBgColor,\n }\n } else {\n const tintBgColor = color.tint(30).toString()\n styles = {\n '--el-button-bg-color': buttonColor,\n '--el-button-border-color': buttonColor,\n '--el-button-hover-bg-color': tintBgColor,\n '--el-button-hover-border-color': tintBgColor,\n '--el-button-active-bg-color': shadeBgColor,\n '--el-button-active-border-color': shadeBgColor,\n }\n }\n\n if (_disabled.value) {\n const disabledButtonColor = color.tint(50).toString()\n styles['--el-button-disabled-bg-color'] = disabledButtonColor\n styles['--el-button-disabled-border-color'] = disabledButtonColor\n }\n }\n\n return styles\n})\n\nconst handleClick = (evt: MouseEvent) => {\n if (props.nativeType === 'reset') {\n form?.resetFields()\n }\n emit('click', evt)\n}\n\ndefineExpose({\n /** @description button html element */\n ref: _ref,\n /** @description button size */\n size: _size,\n /** @description button type */\n type: _type,\n /** @description button disabled */\n disabled: _disabled,\n /** @description whether adding space */\n shouldAddSpace,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"button2.js","sources":["../../../../../../packages/components/button/src/button.vue"],"sourcesContent":["<template>\n <button\n ref=\"_ref\"\n :class=\"[\n ns.b(),\n ns.m(_type),\n ns.m(_size),\n ns.is('disabled', _disabled),\n ns.is('loading', loading),\n ns.is('plain', plain),\n ns.is('round', round),\n ns.is('circle', circle),\n ]\"\n :disabled=\"_disabled || loading\"\n :autofocus=\"autofocus\"\n :type=\"nativeType\"\n :style=\"buttonStyle\"\n @click=\"handleClick\"\n >\n <template v-if=\"loading\">\n <slot v-if=\"$slots.loading\" name=\"loading\"></slot>\n <el-icon v-else :class=\"ns.is('loading')\">\n <component :is=\"loadingIcon\" />\n </el-icon>\n </template>\n <el-icon v-else-if=\"icon || $slots.icon\">\n <component :is=\"icon\" v-if=\"icon\" />\n <slot v-else name=\"icon\" />\n </el-icon>\n <span\n v-if=\"$slots.default\"\n :class=\"{ [ns.em('text', 'expand')]: shouldAddSpace }\"\n >\n <slot></slot>\n </span>\n </button>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, inject, Text, ref, useSlots } from 'vue'\nimport { TinyColor } from '@ctrl/tinycolor'\nimport { ElIcon } from '@element-plus/components/icon'\nimport {\n useDisabled,\n useFormItem,\n useGlobalConfig,\n useNamespace,\n useSize,\n} from '@element-plus/hooks'\nimport { buttonGroupContextKey } from '@element-plus/tokens'\nimport { buttonEmits, buttonProps } from './button'\n\ndefineOptions({\n name: 'ElButton',\n})\n\nconst props = defineProps(buttonProps)\nconst emit = defineEmits(buttonEmits)\nconst slots = useSlots()\n\nconst buttonGroupContext = inject(buttonGroupContextKey, undefined)\nconst globalConfig = useGlobalConfig('button')\nconst ns = useNamespace('button')\nconst { form } = useFormItem()\nconst _size = useSize(computed(() => buttonGroupContext?.size))\nconst _disabled = useDisabled()\nconst _ref = ref<HTMLButtonElement>()\n\nconst _type = computed(() => props.type || buttonGroupContext?.type || '')\nconst autoInsertSpace = computed(\n () => props.autoInsertSpace ?? globalConfig.value?.autoInsertSpace ?? false\n)\n\n// add space between two characters in Chinese\nconst shouldAddSpace = computed(() => {\n const defaultSlot = slots.default?.()\n if (autoInsertSpace.value && defaultSlot?.length === 1) {\n const slot = defaultSlot[0]\n if (slot?.type === Text) {\n const text = slot.children\n return /^\\p{Unified_Ideograph}{2}$/u.test(text as string)\n }\n }\n return false\n})\n\n// calculate hover & active color by custom color\n// only work when custom color\nconst buttonStyle = computed(() => {\n let styles: Record<string, string> = {}\n\n const buttonColor = props.color\n\n if (buttonColor) {\n const color = new TinyColor(buttonColor)\n const shadeBgColor = color.shade(20).toString()\n if (props.plain) {\n styles = {\n '--el-button-bg-color': color.tint(90).toString(),\n '--el-button-text-color': buttonColor,\n '--el-button-hover-text-color': 'var(--el-color-white)',\n '--el-button-hover-bg-color': buttonColor,\n '--el-button-hover-border-color': buttonColor,\n '--el-button-active-bg-color': shadeBgColor,\n '--el-button-active-text-color': 'var(--el-color-white)',\n '--el-button-active-border-color': shadeBgColor,\n }\n } else {\n const tintBgColor = color.tint(30).toString()\n styles = {\n '--el-button-bg-color': buttonColor,\n '--el-button-border-color': buttonColor,\n '--el-button-hover-bg-color': tintBgColor,\n '--el-button-hover-border-color': tintBgColor,\n '--el-button-active-bg-color': shadeBgColor,\n '--el-button-active-border-color': shadeBgColor,\n }\n }\n\n if (_disabled.value) {\n const disabledButtonColor = color.tint(50).toString()\n styles['--el-button-disabled-bg-color'] = disabledButtonColor\n styles['--el-button-disabled-border-color'] = disabledButtonColor\n }\n }\n\n return styles\n})\n\nconst handleClick = (evt: MouseEvent) => {\n if (props.nativeType === 'reset') {\n form?.resetFields()\n }\n emit('click', evt)\n}\n\ndefineExpose({\n /** @description button html element */\n ref: _ref,\n /** @description button size */\n size: _size,\n /** @description button type */\n type: _type,\n /** @description button disabled */\n disabled: _disabled,\n /** @description whether adding space */\n shouldAddSpace,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0DA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAKA;;;;;;;;;;;AAcA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA;;;;;;AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/lib/components/index.js
CHANGED
|
@@ -74,11 +74,11 @@ var index$13 = require('./message/index.js');
|
|
|
74
74
|
var index$14 = require('./message-box/index.js');
|
|
75
75
|
var index$15 = require('./notification/index.js');
|
|
76
76
|
var index$16 = require('./popover/index.js');
|
|
77
|
-
var affix = require('./affix/src/
|
|
78
|
-
var alert = require('./alert/src/
|
|
77
|
+
var affix = require('./affix/src/affix.js');
|
|
78
|
+
var alert = require('./alert/src/alert.js');
|
|
79
79
|
var avatar = require('./avatar/src/avatar.js');
|
|
80
80
|
var backtop = require('./backtop/src/backtop.js');
|
|
81
|
-
var badge = require('./badge/src/
|
|
81
|
+
var badge = require('./badge/src/badge.js');
|
|
82
82
|
var breadcrumb = require('./breadcrumb/src/breadcrumb.js');
|
|
83
83
|
var breadcrumbItem = require('./breadcrumb/src/breadcrumb-item.js');
|
|
84
84
|
var button = require('./button/src/button.js');
|
package/lib/index.js
CHANGED
|
@@ -8,16 +8,16 @@ require('./directives/index.js');
|
|
|
8
8
|
require('./hooks/index.js');
|
|
9
9
|
require('./tokens/index.js');
|
|
10
10
|
var makeInstaller = require('./make-installer.js');
|
|
11
|
-
var affix = require('./components/affix/src/
|
|
11
|
+
var affix = require('./components/affix/src/affix.js');
|
|
12
12
|
var index = require('./components/affix/index.js');
|
|
13
|
-
var alert = require('./components/alert/src/
|
|
13
|
+
var alert = require('./components/alert/src/alert.js');
|
|
14
14
|
var index$1 = require('./components/alert/index.js');
|
|
15
15
|
var index$2 = require('./components/autocomplete/index.js');
|
|
16
16
|
var avatar = require('./components/avatar/src/avatar.js');
|
|
17
17
|
var index$3 = require('./components/avatar/index.js');
|
|
18
18
|
var backtop = require('./components/backtop/src/backtop.js');
|
|
19
19
|
var index$4 = require('./components/backtop/index.js');
|
|
20
|
-
var badge = require('./components/badge/src/
|
|
20
|
+
var badge = require('./components/badge/src/badge.js');
|
|
21
21
|
var index$5 = require('./components/badge/index.js');
|
|
22
22
|
var breadcrumb = require('./components/breadcrumb/src/breadcrumb.js');
|
|
23
23
|
var breadcrumbItem = require('./components/breadcrumb/src/breadcrumb-item.js');
|
package/lib/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.0.
|
|
1
|
+
export declare const version = "0.0.20220228";
|
package/lib/version.js
CHANGED
package/lib/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.
|
|
1
|
+
{"version":3,"file":"version.js","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.20220228'\n"],"names":[],"mappings":";;;;AAAY,MAAC,OAAO,GAAG;;;;"}
|