@element-plus/nightly 0.0.20220723 → 0.0.20220724
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 +2 -2
- 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 +2 -2
- package/dist/locale/af.js +1 -1
- package/dist/locale/af.min.js +1 -1
- package/dist/locale/af.min.mjs +1 -1
- package/dist/locale/af.mjs +1 -1
- package/dist/locale/ar.js +1 -1
- package/dist/locale/ar.min.js +1 -1
- package/dist/locale/ar.min.mjs +1 -1
- package/dist/locale/ar.mjs +1 -1
- package/dist/locale/az.js +1 -1
- package/dist/locale/az.min.js +1 -1
- package/dist/locale/az.min.mjs +1 -1
- package/dist/locale/az.mjs +1 -1
- package/dist/locale/bg.js +1 -1
- package/dist/locale/bg.min.js +1 -1
- package/dist/locale/bg.min.mjs +1 -1
- package/dist/locale/bg.mjs +1 -1
- package/dist/locale/bn.js +1 -1
- package/dist/locale/bn.min.js +1 -1
- package/dist/locale/bn.min.mjs +1 -1
- package/dist/locale/bn.mjs +1 -1
- package/dist/locale/ca.js +1 -1
- package/dist/locale/ca.min.js +1 -1
- package/dist/locale/ca.min.mjs +1 -1
- package/dist/locale/ca.mjs +1 -1
- package/dist/locale/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/index.mjs +4 -4
- package/es/components/message/index.mjs +1 -1
- package/es/components/message/src/message.mjs +87 -147
- package/es/components/message/src/message.mjs.map +1 -1
- package/es/components/message/src/message2.mjs +147 -87
- package/es/components/message/src/message2.mjs.map +1 -1
- package/es/components/message/src/method.mjs +2 -2
- package/es/components/popper/index.mjs +2 -2
- package/es/components/popper/src/trigger.mjs +120 -16
- package/es/components/popper/src/trigger.mjs.map +1 -1
- package/es/components/popper/src/trigger2.mjs +16 -120
- package/es/components/popper/src/trigger2.mjs.map +1 -1
- package/es/components/progress/index.mjs +2 -2
- package/es/components/progress/src/progress.mjs +202 -57
- package/es/components/progress/src/progress.mjs.map +1 -1
- package/es/components/progress/src/progress2.mjs +57 -202
- package/es/components/progress/src/progress2.mjs.map +1 -1
- package/es/components/tooltip/src/tooltip.mjs +1 -1
- package/es/components/tooltip/src/trigger.mjs +1 -1
- package/es/index.mjs +4 -4
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/index.js +4 -4
- package/lib/components/message/index.js +1 -1
- package/lib/components/message/src/message.js +88 -145
- package/lib/components/message/src/message.js.map +1 -1
- package/lib/components/message/src/message2.js +145 -88
- package/lib/components/message/src/message2.js.map +1 -1
- package/lib/components/message/src/method.js +2 -2
- package/lib/components/popper/index.js +2 -2
- package/lib/components/popper/src/trigger.js +120 -16
- package/lib/components/popper/src/trigger.js.map +1 -1
- package/lib/components/popper/src/trigger2.js +16 -120
- package/lib/components/popper/src/trigger2.js.map +1 -1
- package/lib/components/progress/index.js +2 -2
- package/lib/components/progress/src/progress.js +202 -57
- package/lib/components/progress/src/progress.js.map +1 -1
- package/lib/components/progress/src/progress2.js +57 -202
- package/lib/components/progress/src/progress2.js.map +1 -1
- package/lib/components/tooltip/src/tooltip.js +1 -1
- package/lib/components/tooltip/src/trigger.js +1 -1
- package/lib/index.js +4 -4
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +1 -1
- package/web-types.json +1 -1
|
@@ -5,10 +5,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
require('../../utils/index.js');
|
|
6
6
|
var popper$1 = require('./src/popper2.js');
|
|
7
7
|
var arrow = require('./src/arrow2.js');
|
|
8
|
-
var trigger = require('./src/
|
|
8
|
+
var trigger = require('./src/trigger.js');
|
|
9
9
|
var content = require('./src/content2.js');
|
|
10
10
|
var popper = require('./src/popper.js');
|
|
11
|
-
var trigger$1 = require('./src/
|
|
11
|
+
var trigger$1 = require('./src/trigger2.js');
|
|
12
12
|
var content$1 = require('./src/content.js');
|
|
13
13
|
var arrow$1 = require('./src/arrow.js');
|
|
14
14
|
var install = require('../../utils/vue/install.js');
|
|
@@ -2,24 +2,128 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var lodashUnified = require('lodash-unified');
|
|
7
|
+
var core = require('@vueuse/core');
|
|
8
|
+
require('../../slot/index.js');
|
|
9
|
+
require('../../../hooks/index.js');
|
|
10
|
+
require('../../../tokens/index.js');
|
|
5
11
|
require('../../../utils/index.js');
|
|
6
|
-
var
|
|
12
|
+
var trigger = require('./trigger2.js');
|
|
13
|
+
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
14
|
+
var popper = require('../../../tokens/popper.js');
|
|
15
|
+
var index = require('../../../hooks/use-forward-ref/index.js');
|
|
16
|
+
var types = require('../../../utils/types.js');
|
|
17
|
+
var onlyChild = require('../../slot/src/only-child.js');
|
|
7
18
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
const __default__ = {
|
|
20
|
+
name: "ElPopperTrigger",
|
|
21
|
+
inheritAttrs: false
|
|
22
|
+
};
|
|
23
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
24
|
+
...__default__,
|
|
25
|
+
props: trigger.usePopperTriggerProps,
|
|
26
|
+
setup(__props, { expose }) {
|
|
27
|
+
const props = __props;
|
|
28
|
+
const { role, triggerRef } = vue.inject(popper.POPPER_INJECTION_KEY, void 0);
|
|
29
|
+
index.useForwardRef(triggerRef);
|
|
30
|
+
const ariaControls = vue.computed(() => {
|
|
31
|
+
return ariaHaspopup.value ? props.id : void 0;
|
|
32
|
+
});
|
|
33
|
+
const ariaDescribedby = vue.computed(() => {
|
|
34
|
+
if (role && role.value === "tooltip") {
|
|
35
|
+
return props.open && props.id ? props.id : void 0;
|
|
36
|
+
}
|
|
37
|
+
return void 0;
|
|
38
|
+
});
|
|
39
|
+
const ariaHaspopup = vue.computed(() => {
|
|
40
|
+
if (role && role.value !== "tooltip") {
|
|
41
|
+
return role.value;
|
|
42
|
+
}
|
|
43
|
+
return void 0;
|
|
44
|
+
});
|
|
45
|
+
const ariaExpanded = vue.computed(() => {
|
|
46
|
+
return ariaHaspopup.value ? `${props.open}` : void 0;
|
|
47
|
+
});
|
|
48
|
+
let virtualTriggerAriaStopWatch = void 0;
|
|
49
|
+
vue.onMounted(() => {
|
|
50
|
+
vue.watch(() => props.virtualRef, (virtualEl) => {
|
|
51
|
+
if (virtualEl) {
|
|
52
|
+
triggerRef.value = core.unrefElement(virtualEl);
|
|
53
|
+
}
|
|
54
|
+
}, {
|
|
55
|
+
immediate: true
|
|
56
|
+
});
|
|
57
|
+
vue.watch(() => triggerRef.value, (el, prevEl) => {
|
|
58
|
+
virtualTriggerAriaStopWatch == null ? void 0 : virtualTriggerAriaStopWatch();
|
|
59
|
+
virtualTriggerAriaStopWatch = void 0;
|
|
60
|
+
if (types.isElement(el)) {
|
|
61
|
+
;
|
|
62
|
+
[
|
|
63
|
+
"onMouseenter",
|
|
64
|
+
"onMouseleave",
|
|
65
|
+
"onClick",
|
|
66
|
+
"onKeydown",
|
|
67
|
+
"onFocus",
|
|
68
|
+
"onBlur",
|
|
69
|
+
"onContextmenu"
|
|
70
|
+
].forEach((eventName) => {
|
|
71
|
+
var _a;
|
|
72
|
+
const handler = props[eventName];
|
|
73
|
+
if (handler) {
|
|
74
|
+
;
|
|
75
|
+
el.addEventListener(eventName.slice(2).toLowerCase(), handler);
|
|
76
|
+
(_a = prevEl == null ? void 0 : prevEl.removeEventListener) == null ? void 0 : _a.call(prevEl, eventName.slice(2).toLowerCase(), handler);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
virtualTriggerAriaStopWatch = vue.watch([ariaControls, ariaDescribedby, ariaHaspopup, ariaExpanded], (watches) => {
|
|
80
|
+
;
|
|
81
|
+
[
|
|
82
|
+
"aria-controls",
|
|
83
|
+
"aria-describedby",
|
|
84
|
+
"aria-haspopup",
|
|
85
|
+
"aria-expanded"
|
|
86
|
+
].forEach((key, idx) => {
|
|
87
|
+
lodashUnified.isNil(watches[idx]) ? el.removeAttribute(key) : el.setAttribute(key, watches[idx]);
|
|
88
|
+
});
|
|
89
|
+
}, { immediate: true });
|
|
90
|
+
}
|
|
91
|
+
if (types.isElement(prevEl)) {
|
|
92
|
+
;
|
|
93
|
+
[
|
|
94
|
+
"aria-controls",
|
|
95
|
+
"aria-describedby",
|
|
96
|
+
"aria-haspopup",
|
|
97
|
+
"aria-expanded"
|
|
98
|
+
].forEach((key) => prevEl.removeAttribute(key));
|
|
99
|
+
}
|
|
100
|
+
}, {
|
|
101
|
+
immediate: true
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
vue.onBeforeUnmount(() => {
|
|
105
|
+
virtualTriggerAriaStopWatch == null ? void 0 : virtualTriggerAriaStopWatch();
|
|
106
|
+
virtualTriggerAriaStopWatch = void 0;
|
|
107
|
+
});
|
|
108
|
+
expose({
|
|
109
|
+
triggerRef
|
|
110
|
+
});
|
|
111
|
+
return (_ctx, _cache) => {
|
|
112
|
+
return !_ctx.virtualTriggering ? (vue.openBlock(), vue.createBlock(vue.unref(onlyChild.OnlyChild), vue.mergeProps({ key: 0 }, _ctx.$attrs, {
|
|
113
|
+
"aria-controls": vue.unref(ariaControls),
|
|
114
|
+
"aria-describedby": vue.unref(ariaDescribedby),
|
|
115
|
+
"aria-expanded": vue.unref(ariaExpanded),
|
|
116
|
+
"aria-haspopup": vue.unref(ariaHaspopup)
|
|
117
|
+
}), {
|
|
118
|
+
default: vue.withCtx(() => [
|
|
119
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
120
|
+
]),
|
|
121
|
+
_: 3
|
|
122
|
+
}, 16, ["aria-controls", "aria-describedby", "aria-expanded", "aria-haspopup"])) : vue.createCommentVNode("v-if", true);
|
|
123
|
+
};
|
|
124
|
+
}
|
|
22
125
|
});
|
|
126
|
+
var ElPopperTrigger = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/popper/src/trigger.vue"]]);
|
|
23
127
|
|
|
24
|
-
exports
|
|
128
|
+
exports["default"] = ElPopperTrigger;
|
|
25
129
|
//# sourceMappingURL=trigger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigger.js","sources":["../../../../../../packages/components/popper/src/trigger.
|
|
1
|
+
{"version":3,"file":"trigger.js","sources":["../../../../../../packages/components/popper/src/trigger.vue"],"sourcesContent":["<template>\n <el-only-child\n v-if=\"!virtualTriggering\"\n v-bind=\"$attrs\"\n :aria-controls=\"ariaControls\"\n :aria-describedby=\"ariaDescribedby\"\n :aria-expanded=\"ariaExpanded\"\n :aria-haspopup=\"ariaHaspopup\"\n >\n <slot />\n </el-only-child>\n</template>\n\n<script lang=\"ts\" setup>\n// @ts-nocheck\nimport { computed, inject, onBeforeUnmount, onMounted, watch } from 'vue'\nimport { isNil } from 'lodash-unified'\nimport { unrefElement } from '@vueuse/core'\nimport { ElOnlyChild } from '@element-plus/components/slot'\nimport { useForwardRef } from '@element-plus/hooks'\nimport { POPPER_INJECTION_KEY } from '@element-plus/tokens'\nimport { isElement } from '@element-plus/utils'\nimport { usePopperTriggerProps } from './trigger'\n\nimport type { WatchStopHandle } from 'vue'\n\ndefineOptions({\n name: 'ElPopperTrigger',\n inheritAttrs: false,\n})\n\nconst props = defineProps(usePopperTriggerProps)\n\nconst { role, triggerRef } = inject(POPPER_INJECTION_KEY, undefined)!\n\nuseForwardRef(triggerRef)\n\nconst ariaControls = computed<string | undefined>(() => {\n return ariaHaspopup.value ? props.id : undefined\n})\n\nconst ariaDescribedby = computed<string | undefined>(() => {\n if (role && role.value === 'tooltip') {\n return props.open && props.id ? props.id : undefined\n }\n return undefined\n})\n\nconst ariaHaspopup = computed<string | undefined>(() => {\n if (role && role.value !== 'tooltip') {\n return role.value\n }\n return undefined\n})\n\nconst ariaExpanded = computed<string | undefined>(() => {\n return ariaHaspopup.value ? `${props.open}` : undefined\n})\n\nlet virtualTriggerAriaStopWatch: WatchStopHandle | undefined = undefined\n\nonMounted(() => {\n watch(\n () => props.virtualRef,\n (virtualEl) => {\n if (virtualEl) {\n triggerRef.value = unrefElement(virtualEl as HTMLElement)\n }\n },\n {\n immediate: true,\n }\n )\n\n watch(\n () => triggerRef.value,\n (el, prevEl) => {\n virtualTriggerAriaStopWatch?.()\n virtualTriggerAriaStopWatch = undefined\n if (isElement(el)) {\n ;[\n 'onMouseenter',\n 'onMouseleave',\n 'onClick',\n 'onKeydown',\n 'onFocus',\n 'onBlur',\n 'onContextmenu',\n ].forEach((eventName) => {\n const handler = props[eventName]\n if (handler) {\n ;(el as HTMLElement).addEventListener(\n eventName.slice(2).toLowerCase(),\n handler\n )\n ;(prevEl as HTMLElement)?.removeEventListener?.(\n eventName.slice(2).toLowerCase(),\n handler\n )\n }\n })\n virtualTriggerAriaStopWatch = watch(\n [ariaControls, ariaDescribedby, ariaHaspopup, ariaExpanded],\n (watches) => {\n ;[\n 'aria-controls',\n 'aria-describedby',\n 'aria-haspopup',\n 'aria-expanded',\n ].forEach((key, idx) => {\n isNil(watches[idx])\n ? el.removeAttribute(key)\n : el.setAttribute(key, watches[idx])\n })\n },\n { immediate: true }\n )\n }\n if (isElement(prevEl)) {\n ;[\n 'aria-controls',\n 'aria-describedby',\n 'aria-haspopup',\n 'aria-expanded',\n ].forEach((key) => prevEl.removeAttribute(key))\n }\n },\n {\n immediate: true,\n }\n )\n})\n\nonBeforeUnmount(() => {\n virtualTriggerAriaStopWatch?.()\n virtualTriggerAriaStopWatch = undefined\n})\n\ndefineExpose({\n /**\n * @description trigger element\n */\n triggerRef,\n})\n</script>\n"],"names":["inject","POPPER_INJECTION_KEY","useForwardRef","computed","onMounted","watch","unrefElement","isElement","isNil","onBeforeUnmount"],"mappings":"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"}
|
|
@@ -2,128 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var vue = require('vue');
|
|
6
|
-
var lodashUnified = require('lodash-unified');
|
|
7
|
-
var core = require('@vueuse/core');
|
|
8
|
-
require('../../slot/index.js');
|
|
9
|
-
require('../../../hooks/index.js');
|
|
10
|
-
require('../../../tokens/index.js');
|
|
11
5
|
require('../../../utils/index.js');
|
|
12
|
-
var
|
|
13
|
-
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
14
|
-
var popper = require('../../../tokens/popper.js');
|
|
15
|
-
var index = require('../../../hooks/use-forward-ref/index.js');
|
|
16
|
-
var types = require('../../../utils/types.js');
|
|
17
|
-
var onlyChild = require('../../slot/src/only-child.js');
|
|
6
|
+
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
18
7
|
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const ariaDescribedby = vue.computed(() => {
|
|
34
|
-
if (role && role.value === "tooltip") {
|
|
35
|
-
return props.open && props.id ? props.id : void 0;
|
|
36
|
-
}
|
|
37
|
-
return void 0;
|
|
38
|
-
});
|
|
39
|
-
const ariaHaspopup = vue.computed(() => {
|
|
40
|
-
if (role && role.value !== "tooltip") {
|
|
41
|
-
return role.value;
|
|
42
|
-
}
|
|
43
|
-
return void 0;
|
|
44
|
-
});
|
|
45
|
-
const ariaExpanded = vue.computed(() => {
|
|
46
|
-
return ariaHaspopup.value ? `${props.open}` : void 0;
|
|
47
|
-
});
|
|
48
|
-
let virtualTriggerAriaStopWatch = void 0;
|
|
49
|
-
vue.onMounted(() => {
|
|
50
|
-
vue.watch(() => props.virtualRef, (virtualEl) => {
|
|
51
|
-
if (virtualEl) {
|
|
52
|
-
triggerRef.value = core.unrefElement(virtualEl);
|
|
53
|
-
}
|
|
54
|
-
}, {
|
|
55
|
-
immediate: true
|
|
56
|
-
});
|
|
57
|
-
vue.watch(() => triggerRef.value, (el, prevEl) => {
|
|
58
|
-
virtualTriggerAriaStopWatch == null ? void 0 : virtualTriggerAriaStopWatch();
|
|
59
|
-
virtualTriggerAriaStopWatch = void 0;
|
|
60
|
-
if (types.isElement(el)) {
|
|
61
|
-
;
|
|
62
|
-
[
|
|
63
|
-
"onMouseenter",
|
|
64
|
-
"onMouseleave",
|
|
65
|
-
"onClick",
|
|
66
|
-
"onKeydown",
|
|
67
|
-
"onFocus",
|
|
68
|
-
"onBlur",
|
|
69
|
-
"onContextmenu"
|
|
70
|
-
].forEach((eventName) => {
|
|
71
|
-
var _a;
|
|
72
|
-
const handler = props[eventName];
|
|
73
|
-
if (handler) {
|
|
74
|
-
;
|
|
75
|
-
el.addEventListener(eventName.slice(2).toLowerCase(), handler);
|
|
76
|
-
(_a = prevEl == null ? void 0 : prevEl.removeEventListener) == null ? void 0 : _a.call(prevEl, eventName.slice(2).toLowerCase(), handler);
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
virtualTriggerAriaStopWatch = vue.watch([ariaControls, ariaDescribedby, ariaHaspopup, ariaExpanded], (watches) => {
|
|
80
|
-
;
|
|
81
|
-
[
|
|
82
|
-
"aria-controls",
|
|
83
|
-
"aria-describedby",
|
|
84
|
-
"aria-haspopup",
|
|
85
|
-
"aria-expanded"
|
|
86
|
-
].forEach((key, idx) => {
|
|
87
|
-
lodashUnified.isNil(watches[idx]) ? el.removeAttribute(key) : el.setAttribute(key, watches[idx]);
|
|
88
|
-
});
|
|
89
|
-
}, { immediate: true });
|
|
90
|
-
}
|
|
91
|
-
if (types.isElement(prevEl)) {
|
|
92
|
-
;
|
|
93
|
-
[
|
|
94
|
-
"aria-controls",
|
|
95
|
-
"aria-describedby",
|
|
96
|
-
"aria-haspopup",
|
|
97
|
-
"aria-expanded"
|
|
98
|
-
].forEach((key) => prevEl.removeAttribute(key));
|
|
99
|
-
}
|
|
100
|
-
}, {
|
|
101
|
-
immediate: true
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
|
-
vue.onBeforeUnmount(() => {
|
|
105
|
-
virtualTriggerAriaStopWatch == null ? void 0 : virtualTriggerAriaStopWatch();
|
|
106
|
-
virtualTriggerAriaStopWatch = void 0;
|
|
107
|
-
});
|
|
108
|
-
expose({
|
|
109
|
-
triggerRef
|
|
110
|
-
});
|
|
111
|
-
return (_ctx, _cache) => {
|
|
112
|
-
return !_ctx.virtualTriggering ? (vue.openBlock(), vue.createBlock(vue.unref(onlyChild.OnlyChild), vue.mergeProps({ key: 0 }, _ctx.$attrs, {
|
|
113
|
-
"aria-controls": vue.unref(ariaControls),
|
|
114
|
-
"aria-describedby": vue.unref(ariaDescribedby),
|
|
115
|
-
"aria-expanded": vue.unref(ariaExpanded),
|
|
116
|
-
"aria-haspopup": vue.unref(ariaHaspopup)
|
|
117
|
-
}), {
|
|
118
|
-
default: vue.withCtx(() => [
|
|
119
|
-
vue.renderSlot(_ctx.$slots, "default")
|
|
120
|
-
]),
|
|
121
|
-
_: 3
|
|
122
|
-
}, 16, ["aria-controls", "aria-describedby", "aria-expanded", "aria-haspopup"])) : vue.createCommentVNode("v-if", true);
|
|
123
|
-
};
|
|
124
|
-
}
|
|
8
|
+
const usePopperTriggerProps = runtime.buildProps({
|
|
9
|
+
virtualRef: {
|
|
10
|
+
type: runtime.definePropType(Object)
|
|
11
|
+
},
|
|
12
|
+
virtualTriggering: Boolean,
|
|
13
|
+
onMouseenter: Function,
|
|
14
|
+
onMouseleave: Function,
|
|
15
|
+
onClick: Function,
|
|
16
|
+
onKeydown: Function,
|
|
17
|
+
onFocus: Function,
|
|
18
|
+
onBlur: Function,
|
|
19
|
+
onContextmenu: Function,
|
|
20
|
+
id: String,
|
|
21
|
+
open: Boolean
|
|
125
22
|
});
|
|
126
|
-
var ElPopperTrigger = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/popper/src/trigger.vue"]]);
|
|
127
23
|
|
|
128
|
-
exports
|
|
24
|
+
exports.usePopperTriggerProps = usePopperTriggerProps;
|
|
129
25
|
//# sourceMappingURL=trigger2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigger2.js","sources":["../../../../../../packages/components/popper/src/trigger.
|
|
1
|
+
{"version":3,"file":"trigger2.js","sources":["../../../../../../packages/components/popper/src/trigger.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\nimport type { Measurable } from '@element-plus/tokens'\n\nexport const usePopperTriggerProps = buildProps({\n virtualRef: {\n type: definePropType<Measurable>(Object),\n },\n virtualTriggering: Boolean,\n onMouseenter: Function,\n onMouseleave: Function,\n onClick: Function,\n onKeydown: Function,\n onFocus: Function,\n onBlur: Function,\n onContextmenu: Function,\n id: String,\n open: Boolean,\n} as const)\n\nexport type PopperTriggerProps = typeof usePopperTriggerProps\n"],"names":["buildProps","definePropType"],"mappings":";;;;;;;AACY,MAAC,qBAAqB,GAAGA,kBAAU,CAAC;AAChD,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAEC,sBAAc,CAAC,MAAM,CAAC;AAChC,GAAG;AACH,EAAE,iBAAiB,EAAE,OAAO;AAC5B,EAAE,YAAY,EAAE,QAAQ;AACxB,EAAE,YAAY,EAAE,QAAQ;AACxB,EAAE,OAAO,EAAE,QAAQ;AACnB,EAAE,SAAS,EAAE,QAAQ;AACrB,EAAE,OAAO,EAAE,QAAQ;AACnB,EAAE,MAAM,EAAE,QAAQ;AAClB,EAAE,aAAa,EAAE,QAAQ;AACzB,EAAE,EAAE,EAAE,MAAM;AACZ,EAAE,IAAI,EAAE,OAAO;AACf,CAAC;;;;"}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
require('../../utils/index.js');
|
|
6
|
-
var progress$1 = require('./src/
|
|
7
|
-
var progress = require('./src/
|
|
6
|
+
var progress$1 = require('./src/progress.js');
|
|
7
|
+
var progress = require('./src/progress2.js');
|
|
8
8
|
var install = require('../../utils/vue/install.js');
|
|
9
9
|
|
|
10
10
|
const ElProgress = install.withInstall(progress$1["default"]);
|
|
@@ -2,66 +2,211 @@
|
|
|
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
|
+
var iconsVue = require('@element-plus/icons-vue');
|
|
8
|
+
require('../../../hooks/index.js');
|
|
5
9
|
require('../../../utils/index.js');
|
|
6
|
-
var
|
|
10
|
+
var progress = require('./progress2.js');
|
|
11
|
+
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
12
|
+
var index = require('../../../hooks/use-namespace/index.js');
|
|
13
|
+
var shared = require('@vue/shared');
|
|
7
14
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
15
|
+
const _hoisted_1 = ["aria-valuenow"];
|
|
16
|
+
const _hoisted_2 = { viewBox: "0 0 100 100" };
|
|
17
|
+
const _hoisted_3 = ["d", "stroke", "stroke-width"];
|
|
18
|
+
const _hoisted_4 = ["d", "stroke", "opacity", "stroke-linecap", "stroke-width"];
|
|
19
|
+
const _hoisted_5 = { key: 0 };
|
|
20
|
+
const __default__ = {
|
|
21
|
+
name: "ElProgress"
|
|
22
|
+
};
|
|
23
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
24
|
+
...__default__,
|
|
25
|
+
props: progress.progressProps,
|
|
26
|
+
setup(__props) {
|
|
27
|
+
const props = __props;
|
|
28
|
+
const STATUS_COLOR_MAP = {
|
|
29
|
+
success: "#13ce66",
|
|
30
|
+
exception: "#ff4949",
|
|
31
|
+
warning: "#e6a23c",
|
|
32
|
+
default: "#20a0ff"
|
|
33
|
+
};
|
|
34
|
+
const ns = index.useNamespace("progress");
|
|
35
|
+
const barStyle = vue.computed(() => ({
|
|
36
|
+
width: `${props.percentage}%`,
|
|
37
|
+
animationDuration: `${props.duration}s`,
|
|
38
|
+
backgroundColor: getCurrentColor(props.percentage)
|
|
39
|
+
}));
|
|
40
|
+
const relativeStrokeWidth = vue.computed(() => (props.strokeWidth / props.width * 100).toFixed(1));
|
|
41
|
+
const radius = vue.computed(() => {
|
|
42
|
+
if (["circle", "dashboard"].includes(props.type)) {
|
|
43
|
+
return Number.parseInt(`${50 - Number.parseFloat(relativeStrokeWidth.value) / 2}`, 10);
|
|
44
|
+
}
|
|
45
|
+
return 0;
|
|
46
|
+
});
|
|
47
|
+
const trackPath = vue.computed(() => {
|
|
48
|
+
const r = radius.value;
|
|
49
|
+
const isDashboard = props.type === "dashboard";
|
|
50
|
+
return `
|
|
51
|
+
M 50 50
|
|
52
|
+
m 0 ${isDashboard ? "" : "-"}${r}
|
|
53
|
+
a ${r} ${r} 0 1 1 0 ${isDashboard ? "-" : ""}${r * 2}
|
|
54
|
+
a ${r} ${r} 0 1 1 0 ${isDashboard ? "" : "-"}${r * 2}
|
|
55
|
+
`;
|
|
56
|
+
});
|
|
57
|
+
const perimeter = vue.computed(() => 2 * Math.PI * radius.value);
|
|
58
|
+
const rate = vue.computed(() => props.type === "dashboard" ? 0.75 : 1);
|
|
59
|
+
const strokeDashoffset = vue.computed(() => {
|
|
60
|
+
const offset = -1 * perimeter.value * (1 - rate.value) / 2;
|
|
61
|
+
return `${offset}px`;
|
|
62
|
+
});
|
|
63
|
+
const trailPathStyle = vue.computed(() => ({
|
|
64
|
+
strokeDasharray: `${perimeter.value * rate.value}px, ${perimeter.value}px`,
|
|
65
|
+
strokeDashoffset: strokeDashoffset.value
|
|
66
|
+
}));
|
|
67
|
+
const circlePathStyle = vue.computed(() => ({
|
|
68
|
+
strokeDasharray: `${perimeter.value * rate.value * (props.percentage / 100)}px, ${perimeter.value}px`,
|
|
69
|
+
strokeDashoffset: strokeDashoffset.value,
|
|
70
|
+
transition: "stroke-dasharray 0.6s ease 0s, stroke 0.6s ease, opacity ease 0.6s"
|
|
71
|
+
}));
|
|
72
|
+
const stroke = vue.computed(() => {
|
|
73
|
+
let ret;
|
|
74
|
+
if (props.color) {
|
|
75
|
+
ret = getCurrentColor(props.percentage);
|
|
76
|
+
} else {
|
|
77
|
+
ret = STATUS_COLOR_MAP[props.status] || STATUS_COLOR_MAP.default;
|
|
78
|
+
}
|
|
79
|
+
return ret;
|
|
80
|
+
});
|
|
81
|
+
const statusIcon = vue.computed(() => {
|
|
82
|
+
if (props.status === "warning") {
|
|
83
|
+
return iconsVue.WarningFilled;
|
|
84
|
+
}
|
|
85
|
+
if (props.type === "line") {
|
|
86
|
+
return props.status === "success" ? iconsVue.CircleCheck : iconsVue.CircleClose;
|
|
87
|
+
} else {
|
|
88
|
+
return props.status === "success" ? iconsVue.Check : iconsVue.Close;
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
const progressTextSize = vue.computed(() => {
|
|
92
|
+
return props.type === "line" ? 12 + props.strokeWidth * 0.4 : props.width * 0.111111 + 2;
|
|
93
|
+
});
|
|
94
|
+
const content = vue.computed(() => props.format(props.percentage));
|
|
95
|
+
function getColors(color) {
|
|
96
|
+
const span = 100 / color.length;
|
|
97
|
+
const seriesColors = color.map((seriesColor, index) => {
|
|
98
|
+
if (shared.isString(seriesColor)) {
|
|
99
|
+
return {
|
|
100
|
+
color: seriesColor,
|
|
101
|
+
percentage: (index + 1) * span
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
return seriesColor;
|
|
105
|
+
});
|
|
106
|
+
return seriesColors.sort((a, b) => a.percentage - b.percentage);
|
|
107
|
+
}
|
|
108
|
+
const getCurrentColor = (percentage) => {
|
|
109
|
+
var _a;
|
|
110
|
+
const { color } = props;
|
|
111
|
+
if (shared.isFunction(color)) {
|
|
112
|
+
return color(percentage);
|
|
113
|
+
} else if (shared.isString(color)) {
|
|
114
|
+
return color;
|
|
115
|
+
} else {
|
|
116
|
+
const colors = getColors(color);
|
|
117
|
+
for (const color2 of colors) {
|
|
118
|
+
if (color2.percentage > percentage)
|
|
119
|
+
return color2.color;
|
|
120
|
+
}
|
|
121
|
+
return (_a = colors[colors.length - 1]) == null ? void 0 : _a.color;
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
return (_ctx, _cache) => {
|
|
125
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
126
|
+
class: vue.normalizeClass([
|
|
127
|
+
vue.unref(ns).b(),
|
|
128
|
+
vue.unref(ns).m(_ctx.type),
|
|
129
|
+
vue.unref(ns).is(_ctx.status),
|
|
130
|
+
{
|
|
131
|
+
[vue.unref(ns).m("without-text")]: !_ctx.showText,
|
|
132
|
+
[vue.unref(ns).m("text-inside")]: _ctx.textInside
|
|
133
|
+
}
|
|
134
|
+
]),
|
|
135
|
+
role: "progressbar",
|
|
136
|
+
"aria-valuenow": _ctx.percentage,
|
|
137
|
+
"aria-valuemin": "0",
|
|
138
|
+
"aria-valuemax": "100"
|
|
139
|
+
}, [
|
|
140
|
+
_ctx.type === "line" ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
141
|
+
key: 0,
|
|
142
|
+
class: vue.normalizeClass(vue.unref(ns).b("bar"))
|
|
143
|
+
}, [
|
|
144
|
+
vue.createElementVNode("div", {
|
|
145
|
+
class: vue.normalizeClass(vue.unref(ns).be("bar", "outer")),
|
|
146
|
+
style: vue.normalizeStyle({ height: `${_ctx.strokeWidth}px` })
|
|
147
|
+
}, [
|
|
148
|
+
vue.createElementVNode("div", {
|
|
149
|
+
class: vue.normalizeClass([
|
|
150
|
+
vue.unref(ns).be("bar", "inner"),
|
|
151
|
+
{ [vue.unref(ns).bem("bar", "inner", "indeterminate")]: _ctx.indeterminate }
|
|
152
|
+
]),
|
|
153
|
+
style: vue.normalizeStyle(vue.unref(barStyle))
|
|
154
|
+
}, [
|
|
155
|
+
(_ctx.showText || _ctx.$slots.default) && _ctx.textInside ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
156
|
+
key: 0,
|
|
157
|
+
class: vue.normalizeClass(vue.unref(ns).be("bar", "innerText"))
|
|
158
|
+
}, [
|
|
159
|
+
vue.renderSlot(_ctx.$slots, "default", { percentage: _ctx.percentage }, () => [
|
|
160
|
+
vue.createElementVNode("span", null, vue.toDisplayString(vue.unref(content)), 1)
|
|
161
|
+
])
|
|
162
|
+
], 2)) : vue.createCommentVNode("v-if", true)
|
|
163
|
+
], 6)
|
|
164
|
+
], 6)
|
|
165
|
+
], 2)) : (vue.openBlock(), vue.createElementBlock("div", {
|
|
166
|
+
key: 1,
|
|
167
|
+
class: vue.normalizeClass(vue.unref(ns).b("circle")),
|
|
168
|
+
style: vue.normalizeStyle({ height: `${_ctx.width}px`, width: `${_ctx.width}px` })
|
|
169
|
+
}, [
|
|
170
|
+
(vue.openBlock(), vue.createElementBlock("svg", _hoisted_2, [
|
|
171
|
+
vue.createElementVNode("path", {
|
|
172
|
+
class: vue.normalizeClass(vue.unref(ns).be("circle", "track")),
|
|
173
|
+
d: vue.unref(trackPath),
|
|
174
|
+
stroke: `var(${vue.unref(ns).cssVarName("fill-color-light")}, #e5e9f2)`,
|
|
175
|
+
"stroke-width": vue.unref(relativeStrokeWidth),
|
|
176
|
+
fill: "none",
|
|
177
|
+
style: vue.normalizeStyle(vue.unref(trailPathStyle))
|
|
178
|
+
}, null, 14, _hoisted_3),
|
|
179
|
+
vue.createElementVNode("path", {
|
|
180
|
+
class: vue.normalizeClass(vue.unref(ns).be("circle", "path")),
|
|
181
|
+
d: vue.unref(trackPath),
|
|
182
|
+
stroke: vue.unref(stroke),
|
|
183
|
+
fill: "none",
|
|
184
|
+
opacity: _ctx.percentage ? 1 : 0,
|
|
185
|
+
"stroke-linecap": _ctx.strokeLinecap,
|
|
186
|
+
"stroke-width": vue.unref(relativeStrokeWidth),
|
|
187
|
+
style: vue.normalizeStyle(vue.unref(circlePathStyle))
|
|
188
|
+
}, null, 14, _hoisted_4)
|
|
189
|
+
]))
|
|
190
|
+
], 6)),
|
|
191
|
+
(_ctx.showText || _ctx.$slots.default) && !_ctx.textInside ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
192
|
+
key: 2,
|
|
193
|
+
class: vue.normalizeClass(vue.unref(ns).e("text")),
|
|
194
|
+
style: vue.normalizeStyle({ fontSize: `${vue.unref(progressTextSize)}px` })
|
|
195
|
+
}, [
|
|
196
|
+
vue.renderSlot(_ctx.$slots, "default", { percentage: _ctx.percentage }, () => [
|
|
197
|
+
!_ctx.status ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_5, vue.toDisplayString(vue.unref(content)), 1)) : (vue.openBlock(), vue.createBlock(vue.unref(index$1.ElIcon), { key: 1 }, {
|
|
198
|
+
default: vue.withCtx(() => [
|
|
199
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(statusIcon))))
|
|
200
|
+
]),
|
|
201
|
+
_: 1
|
|
202
|
+
}))
|
|
203
|
+
])
|
|
204
|
+
], 6)) : vue.createCommentVNode("v-if", true)
|
|
205
|
+
], 10, _hoisted_1);
|
|
206
|
+
};
|
|
63
207
|
}
|
|
64
208
|
});
|
|
209
|
+
var Progress = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/progress/src/progress.vue"]]);
|
|
65
210
|
|
|
66
|
-
exports
|
|
211
|
+
exports["default"] = Progress;
|
|
67
212
|
//# sourceMappingURL=progress.js.map
|