st-comp 0.0.164 → 0.0.166
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/components.d.ts +3 -0
- package/es/ChartLayout.cjs +1 -1
- package/es/ChartLayout.js +3 -3
- package/es/Dialog.cjs +1 -1
- package/es/Dialog.js +16 -14
- package/es/FactorWarning.cjs +1 -1
- package/es/FactorWarning.js +492 -614
- package/es/Kline.cjs +1 -1
- package/es/Kline.js +16 -16
- package/es/KlineBasic.cjs +1 -1
- package/es/KlineBasic.js +477 -766
- package/es/KlineConfig.cjs +1 -0
- package/es/KlineConfig.js +703 -0
- package/es/KlineNew.cjs +1 -1
- package/es/KlineNew.js +14 -14
- package/es/KlinePlus.cjs +6 -0
- package/es/KlinePlus.js +1212 -0
- package/es/Pagination.cjs +1 -1
- package/es/Pagination.js +21 -20
- package/es/PasswordPrompt.cjs +1 -1
- package/es/PasswordPrompt.js +3 -3
- package/es/Table.cjs +1 -1
- package/es/Table.js +100 -279
- package/es/User.cjs +1 -1
- package/es/User.js +41 -39
- package/es/VarSelectDialog.cjs +1 -1
- package/es/VarSelectDialog.js +23 -22
- package/es/VarietySearch.cjs +1 -1
- package/es/VarietySearch.js +34 -32
- package/es/VirtualTable.cjs +5 -5
- package/es/VirtualTable.js +1018 -1056
- package/es/{_initCloneObject-47814efa.cjs → _initCloneObject-9ccbb113.cjs} +1 -1
- package/es/{_initCloneObject-c939f3af.js → _initCloneObject-a9305c1e.js} +3 -3
- package/es/base-4bcd2756.js +304 -0
- package/es/base-bdc10baa.cjs +5 -0
- package/es/{castArray-a78ae889.cjs → castArray-37eb9980.cjs} +1 -1
- package/es/{castArray-2440268f.js → castArray-681d750b.js} +1 -1
- package/es/{config-provider-722dca36.js → config-provider-93846ae3.js} +9 -9
- package/es/config-provider-ec6b09df.cjs +1 -0
- package/es/dayjs.min-19fb125f.cjs +1 -0
- package/es/dayjs.min-54a4e095.js +296 -0
- package/es/{debounce-82e23c4b.js → debounce-51046b06.js} +1 -1
- package/es/{debounce-cf26af24.cjs → debounce-9e323221.cjs} +1 -1
- package/es/{dropdown-6f8379f0.js → dropdown-65e74de8.js} +6 -6
- package/es/{dropdown-790d31ea.cjs → dropdown-b2dab5bb.cjs} +1 -1
- package/es/{el-autocomplete-75762ef9.js → el-autocomplete-5064d466.js} +9 -9
- package/es/{el-autocomplete-84de99ba.cjs → el-autocomplete-814993af.cjs} +1 -1
- package/es/el-button-960edd49.cjs +1 -0
- package/es/{el-button-2e878325.js → el-button-d39472d3.js} +37 -36
- package/es/{el-checkbox-group-45247bbf.cjs → el-checkbox-group-020b49f5.cjs} +1 -1
- package/es/{el-checkbox-group-5e4f32f0.js → el-checkbox-group-779f353a.js} +2 -2
- package/es/el-dialog-cd484c1f.cjs +1 -0
- package/es/el-dialog-f45ec2a1.js +267 -0
- package/es/el-divider-40c50ce7.cjs +1 -0
- package/es/el-divider-7cf13678.js +45 -0
- package/es/{el-empty-2ece1134.cjs → el-empty-627ec09e.cjs} +1 -1
- package/es/{el-empty-7f8acbdc.js → el-empty-64b2ea8a.js} +2 -2
- package/es/{el-form-item-45ba08ff.js → el-form-item-b31e7a98.js} +8 -8
- package/es/{el-form-item-47e255d4.cjs → el-form-item-e1c3104b.cjs} +2 -2
- package/es/{el-input-1323afd2.js → el-input-42315ac4.js} +48 -48
- package/es/{el-input-cb340042.cjs → el-input-5163bda3.cjs} +1 -1
- package/es/{el-input-number-0f194f3f.cjs → el-input-number-eb54cde4.cjs} +1 -1
- package/es/{el-input-number-991f8bfc.js → el-input-number-ebd64e22.js} +19 -19
- package/es/el-loading-15a5501c.cjs +1 -0
- package/es/el-loading-5d29f26d.js +187 -0
- package/es/{el-menu-item-4c9eb7ad.cjs → el-menu-item-ac89e804.cjs} +1 -1
- package/es/{el-menu-item-dbbcd01a.js → el-menu-item-d62e0a3f.js} +32 -32
- package/es/el-message-ad87b9dd.cjs +1 -0
- package/es/{el-message-03e6f342.js → el-message-bd1d2c82.js} +17 -17
- package/es/el-overlay-690b50aa.js +269 -0
- package/es/el-overlay-e5d318c3.cjs +1 -0
- package/es/{el-popconfirm-8372cd13.js → el-popconfirm-88bbd066.js} +13 -13
- package/es/{el-popconfirm-86503f8a.cjs → el-popconfirm-a497b279.cjs} +1 -1
- package/es/{el-popper-7adbf1c6.cjs → el-popper-14a9d493.cjs} +1 -1
- package/es/{el-popper-b5315f5b.js → el-popper-85365d5b.js} +63 -63
- package/es/{el-scrollbar-ac525239.cjs → el-scrollbar-8bf765f2.cjs} +1 -1
- package/es/{el-scrollbar-4dc1493a.js → el-scrollbar-bcf29780.js} +21 -21
- package/es/el-segmented-84707138.js +136 -0
- package/es/el-segmented-bccd9f2a.cjs +1 -0
- package/es/{el-select-31f8ac8a.cjs → el-select-1d2309a1.cjs} +1 -1
- package/es/{el-select-a4ad7c8b.js → el-select-d3bce4d1.js} +13 -13
- package/es/{el-table-column-2e7132b3.js → el-table-column-9691b26d.js} +19 -18
- package/es/el-table-column-be9a76bb.cjs +14 -0
- package/es/{el-tag-a79385c6.js → el-tag-6036f51c.js} +39 -39
- package/es/{el-tag-9732314f.cjs → el-tag-8d49d4d2.cjs} +1 -1
- package/es/{index-375e8de4.cjs → index-02ca0096.cjs} +1 -1
- package/es/{index-afc88a4b.cjs → index-19fa1fcf.cjs} +1 -1
- package/es/{index-733cd68a.js → index-21fb27eb.js} +17 -17
- package/es/{index-e5fe37a4.js → index-3425f2f0.js} +10 -10
- package/es/{index-1d85ba4b.cjs → index-5b81f4da.cjs} +1 -1
- package/es/index-8d3c5e96.cjs +3 -0
- package/es/{index-97d24ab7.js → index-8ee89b40.js} +16 -16
- package/es/{index-9e6e8d03.cjs → index-a99a5307.cjs} +1 -1
- package/es/{index-58521b9e.cjs → index-b90c746b.cjs} +1 -1
- package/es/index-c45ac024.js +14 -0
- package/es/{index-f5b9b211.js → index-cb8157f2.js} +2 -2
- package/es/{index-e6a36e09.js → index-d3c37134.js} +7 -7
- package/es/{index-65b4113e.cjs → index-d94bae37.cjs} +1 -1
- package/es/{index-2d9c78d4.cjs → index-e348d5e8.cjs} +1 -1
- package/es/{index-57a7323a.js → index-ef7c4392.js} +11 -11
- package/es/{index-e3353eeb.js → index-fbe85773.js} +13 -13
- package/es/{raf-f46caea0.cjs → raf-07cb6953.cjs} +1 -1
- package/es/{raf-c817c3f7.js → raf-36faa519.js} +1 -1
- package/es/{scroll-4fe7a76f.js → scroll-0277d145.js} +1 -1
- package/es/{scroll-339681d4.cjs → scroll-4769a65d.cjs} +1 -1
- package/es/style.css +1 -1
- package/es/{use-form-common-props-04fb0752.js → use-form-common-props-54c31983.js} +40 -40
- package/es/{use-form-common-props-74a96df2.cjs → use-form-common-props-592797e2.cjs} +1 -1
- package/es/use-global-config-584b62f1.cjs +1 -0
- package/es/use-global-config-946f61a4.js +73 -0
- package/es/{vnode-b15eb11b.cjs → vnode-1b827c99.cjs} +1 -1
- package/es/{vnode-0fd3003d.js → vnode-dfc92f20.js} +1 -1
- package/es/{zh-cn-cac8283b.js → zh-cn-5066f5e9.js} +2 -2
- package/es/{zh-cn-36f34912.cjs → zh-cn-b24a7dc9.cjs} +1 -1
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +217 -212
- package/lib/{index-5f63dc2e.js → index-80531492.js} +39042 -37182
- package/lib/{python-5918f7d5.js → python-20a1a5fc.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/KlineConfig/config.js +39 -0
- package/packages/KlineConfig/index.ts +8 -0
- package/packages/KlineConfig/index.vue +315 -0
- package/packages/KlinePlus/components/SliderChart.vue +218 -0
- package/packages/KlinePlus/components/Tips.vue +36 -0
- package/packages/KlinePlus/images/buy.svg +1 -0
- package/packages/KlinePlus/images/sell.svg +1 -0
- package/packages/KlinePlus/images/t.svg +1 -0
- package/packages/KlinePlus/index.ts +8 -0
- package/packages/KlinePlus/index.vue +880 -0
- package/packages/KlinePlus/utils.js +705 -0
- package/packages/index.ts +4 -0
- package/src/pages/KlineConfig/index.vue +20 -0
- package/src/pages/KlinePlus/index.vue +180 -0
- package/src/router/routes.ts +10 -0
- package/es/base-0ca7c43a.cjs +0 -5
- package/es/base-b56cf478.js +0 -303
- package/es/config-provider-cfbb9cd8.cjs +0 -1
- package/es/el-button-62966947.cjs +0 -1
- package/es/el-message-d5ed7a4f.cjs +0 -1
- package/es/el-overlay-41994f67.cjs +0 -1
- package/es/el-overlay-47b665a0.js +0 -521
- package/es/el-table-column-bdc46568.cjs +0 -14
- package/es/index-0baeaec7.js +0 -82
- package/es/index-2f958e56.cjs +0 -3
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { defineComponent as ee, ref as ce, reactive as de, computed as I, watch as me, onMounted as pe, onUpdated as fe, openBlock as v, createElementBlock as z, normalizeClass as K, unref as r, withModifiers as O, withDirectives as q, withKeys as A, renderSlot as P, createVNode as R, withCtx as F, createBlock as T, createCommentVNode as J, createSlots as be } from "vue";
|
|
2
|
-
import { E as ve, i as Ne } from "./el-input-
|
|
3
|
-
import { E as Q, a as Ve, k as he, n as Ie, p as Ee } from "./index-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { u as Ce } from "./el-popper-
|
|
7
|
-
import { C as ne, I as C, U as N } from "./index-
|
|
8
|
-
import { a as xe } from "./index-
|
|
2
|
+
import { E as ve, i as Ne } from "./el-input-42315ac4.js";
|
|
3
|
+
import { E as Q, a as Ve, k as he, n as Ie, p as Ee } from "./index-3425f2f0.js";
|
|
4
|
+
import { i as X, k as ye, v as b, n as E, u as we, d as k, f as U, _ as ge, t as _e, a as Se, w as Ae } from "./base-4bcd2756.js";
|
|
5
|
+
import { f as Pe, u as Fe, b as Te, d as ke } from "./use-form-common-props-54c31983.js";
|
|
6
|
+
import { u as Ce } from "./el-popper-85365d5b.js";
|
|
7
|
+
import { C as ne, I as C, U as N } from "./index-21fb27eb.js";
|
|
8
|
+
import { a as xe } from "./index-ef7c4392.js";
|
|
9
9
|
const De = 100, Be = 600, Z = {
|
|
10
10
|
beforeMount(u, V) {
|
|
11
11
|
const s = V.value, { interval: a = De, delay: y = Be } = X(s) ? {} : s;
|
|
@@ -13,8 +13,8 @@ const De = 100, Be = 600, Z = {
|
|
|
13
13
|
const l = () => X(s) ? s() : s.handler(), f = () => {
|
|
14
14
|
m && (clearTimeout(m), m = void 0), c && (clearInterval(c), c = void 0);
|
|
15
15
|
};
|
|
16
|
-
u.addEventListener("mousedown", (
|
|
17
|
-
|
|
16
|
+
u.addEventListener("mousedown", (w) => {
|
|
17
|
+
w.button === 0 && (f(), l(), document.addEventListener("mouseup", () => f(), {
|
|
18
18
|
once: !0
|
|
19
19
|
}), m = setTimeout(() => {
|
|
20
20
|
c = setInterval(() => {
|
|
@@ -83,10 +83,10 @@ const De = 100, Be = 600, Z = {
|
|
|
83
83
|
props: Le,
|
|
84
84
|
emits: Me,
|
|
85
85
|
setup(u, { expose: V, emit: s }) {
|
|
86
|
-
const a = u, { t: y } = xe(), c =
|
|
86
|
+
const a = u, { t: y } = xe(), c = we("input-number"), m = ce(), l = de({
|
|
87
87
|
currentValue: a.modelValue,
|
|
88
88
|
userInput: null
|
|
89
|
-
}), { formItem: f } = Fe(),
|
|
89
|
+
}), { formItem: f } = Fe(), w = I(() => b(a.modelValue) && a.modelValue <= a.min), Y = I(() => b(a.modelValue) && a.modelValue >= a.max), te = I(() => {
|
|
90
90
|
const e = W(a.step);
|
|
91
91
|
return k(a.precision) ? Math.max(W(a.modelValue), e) : (e > a.precision && U("InputNumber", "precision should not be less than the decimal places of step"), a.precision);
|
|
92
92
|
}), x = I(() => a.controls && a.controlsPosition === "right"), G = Te(), h = ke(), D = I(() => {
|
|
@@ -120,12 +120,12 @@ const De = 100, Be = 600, Z = {
|
|
|
120
120
|
if (a.readonly || h.value || Y.value)
|
|
121
121
|
return;
|
|
122
122
|
const e = Number(D.value) || 0, n = H(e);
|
|
123
|
-
|
|
123
|
+
g(n), s(C, l.currentValue), $();
|
|
124
124
|
}, M = () => {
|
|
125
|
-
if (a.readonly || h.value ||
|
|
125
|
+
if (a.readonly || h.value || w.value)
|
|
126
126
|
return;
|
|
127
127
|
const e = Number(D.value) || 0, n = H(e, -1);
|
|
128
|
-
|
|
128
|
+
g(n), s(C, l.currentValue), $();
|
|
129
129
|
}, j = (e, n) => {
|
|
130
130
|
const { max: t, min: o, step: i, precision: p, stepStrictly: _, valueOnClear: S } = a;
|
|
131
131
|
t < o && _e("InputNumber", "min should not be greater than max.");
|
|
@@ -138,7 +138,7 @@ const De = 100, Be = 600, Z = {
|
|
|
138
138
|
d = Se(S) ? { min: o, max: t }[S] : S;
|
|
139
139
|
}
|
|
140
140
|
return _ && (d = B(Math.round(d / i) * i, p), d !== e && n && s(N, d)), k(p) || (d = B(d, p)), (d > t || d < o) && (d = d > t ? t : o, n && s(N, d)), d;
|
|
141
|
-
},
|
|
141
|
+
}, g = (e, n = !0) => {
|
|
142
142
|
var t;
|
|
143
143
|
const o = l.currentValue, i = j(e);
|
|
144
144
|
if (!n) {
|
|
@@ -149,10 +149,10 @@ const De = 100, Be = 600, Z = {
|
|
|
149
149
|
}, re = (e) => {
|
|
150
150
|
l.userInput = e;
|
|
151
151
|
const n = e === "" ? null : Number(e);
|
|
152
|
-
s(C, n),
|
|
152
|
+
s(C, n), g(n, !1);
|
|
153
153
|
}, ae = (e) => {
|
|
154
154
|
const n = e !== "" ? Number(e) : "";
|
|
155
|
-
(b(n) && !Number.isNaN(n) || e === "") &&
|
|
155
|
+
(b(n) && !Number.isNaN(n) || e === "") && g(n), $(), l.userInput = null;
|
|
156
156
|
}, le = () => {
|
|
157
157
|
var e, n;
|
|
158
158
|
(n = (e = m.value) == null ? void 0 : e.focus) == null || n.call(e);
|
|
@@ -202,7 +202,7 @@ const De = 100, Be = 600, Z = {
|
|
|
202
202
|
key: 0,
|
|
203
203
|
role: "button",
|
|
204
204
|
"aria-label": r(y)("el.inputNumber.decrease"),
|
|
205
|
-
class: K([r(c).e("decrease"), r(c).is("disabled", r(
|
|
205
|
+
class: K([r(c).e("decrease"), r(c).is("disabled", r(w))]),
|
|
206
206
|
onKeydown: A(M, ["enter"])
|
|
207
207
|
}, [
|
|
208
208
|
P(e.$slots, "decrease-icon", {}, () => [
|
|
@@ -277,7 +277,7 @@ const De = 100, Be = 600, Z = {
|
|
|
277
277
|
], 42, ["onDragstart"]));
|
|
278
278
|
}
|
|
279
279
|
});
|
|
280
|
-
var Ke = /* @__PURE__ */
|
|
280
|
+
var Ke = /* @__PURE__ */ ge(ze, [["__file", "input-number.vue"]]);
|
|
281
281
|
const qe = Ae(Ke);
|
|
282
282
|
export {
|
|
283
283
|
qe as E
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const r=require("vue"),S=require("./use-global-config-584b62f1.cjs"),a=require("./base-bdc10baa.cjs");function w(t){let e;const l=r.ref(!1),n=r.reactive({...t,originalPosition:"",originalOverflow:"",visible:!1});function i(o){n.text=o}function s(){const o=n.parent,c=f.ns;if(!o.vLoadingAddClassList){let d=o.getAttribute("loading-number");d=Number.parseInt(d)-1,d?o.setAttribute("loading-number",d.toString()):(a.removeClass(o,c.bm("parent","relative")),o.removeAttribute("loading-number")),a.removeClass(o,c.bm("parent","hidden"))}u(),b.unmount()}function u(){var o,c;(c=(o=f.$el)==null?void 0:o.parentNode)==null||c.removeChild(f.$el)}function m(){var o;t.beforeClose&&!t.beforeClose()||(l.value=!0,clearTimeout(e),e=setTimeout(g,400),n.visible=!1,(o=t.closed)==null||o.call(t))}function g(){if(!l.value)return;const o=n.parent;l.value=!1,o.vLoadingAddClassList=void 0,s()}const v=r.defineComponent({name:"ElLoading",setup(o,{expose:c}){const{ns:d,zIndex:h}=S.useGlobalComponentSettings("loading");return c({ns:d,zIndex:h}),()=>{const x=n.spinner||n.svg,k=r.h("svg",{class:"circular",viewBox:n.svgViewBox?n.svgViewBox:"0 0 50 50",...x?{innerHTML:x}:{}},[r.h("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),_=n.text?r.h("p",{class:d.b("text")},[n.text]):void 0;return r.h(r.Transition,{name:d.b("fade"),onAfterLeave:g},{default:r.withCtx(()=>[r.withDirectives(r.createVNode("div",{style:{backgroundColor:n.background||""},class:[d.b("mask"),n.customClass,n.fullscreen?"is-fullscreen":""]},[r.h("div",{class:d.b("spinner")},[k,_])]),[[r.vShow,n.visible]])])})}}}),b=r.createApp(v),f=b.mount(document.createElement("div"));return{...r.toRefs(n),setText:i,removeElLoadingChild:u,close:m,handleAfterLeave:g,vm:f,get $el(){return f.$el}}}let p;const A=function(t={}){if(!a.isClient)return;const e=I(t);if(e.fullscreen&&p)return p;const l=w({...e,closed:()=>{var i;(i=e.closed)==null||i.call(e),e.fullscreen&&(p=void 0)}});T(e,e.parent,l),C(e,e.parent,l),e.parent.vLoadingAddClassList=()=>C(e,e.parent,l);let n=e.parent.getAttribute("loading-number");return n?n=`${Number.parseInt(n)+1}`:n="1",e.parent.setAttribute("loading-number",n),e.parent.appendChild(l.$el),r.nextTick(()=>l.visible.value=e.visible),e.fullscreen&&(p=l),l},I=t=>{var e,l,n,i;let s;return a.isString(t.target)?s=(e=document.querySelector(t.target))!=null?e:document.body:s=t.target||document.body,{parent:s===document.body||t.body?document.body:s,background:t.background||"",svg:t.svg||"",svgViewBox:t.svgViewBox||"",spinner:t.spinner||!1,text:t.text||"",fullscreen:s===document.body&&((l=t.fullscreen)!=null?l:!0),lock:(n=t.lock)!=null?n:!1,customClass:t.customClass||"",visible:(i=t.visible)!=null?i:!0,beforeClose:t.beforeClose,closed:t.closed,target:s}},T=async(t,e,l)=>{const{nextZIndex:n}=l.vm.zIndex||l.vm._.exposed.zIndex,i={};if(t.fullscreen)l.originalPosition.value=a.getStyle(document.body,"position"),l.originalOverflow.value=a.getStyle(document.body,"overflow"),i.zIndex=n();else if(t.parent===document.body){l.originalPosition.value=a.getStyle(document.body,"position"),await r.nextTick();for(const s of["top","left"]){const u=s==="top"?"scrollTop":"scrollLeft";i[s]=`${t.target.getBoundingClientRect()[s]+document.body[u]+document.documentElement[u]-Number.parseInt(a.getStyle(document.body,`margin-${s}`),10)}px`}for(const s of["height","width"])i[s]=`${t.target.getBoundingClientRect()[s]}px`}else l.originalPosition.value=a.getStyle(e,"position");for(const[s,u]of Object.entries(i))l.$el.style[s]=u},C=(t,e,l)=>{const n=l.vm.ns||l.vm._.exposed.ns;["absolute","fixed","sticky"].includes(l.originalPosition.value)?a.removeClass(e,n.bm("parent","relative")):a.addClass(e,n.bm("parent","relative")),t.fullscreen&&t.lock?a.addClass(e,n.bm("parent","hidden")):a.removeClass(e,n.bm("parent","hidden"))},y=Symbol("ElLoading"),L=(t,e)=>{var l,n,i,s;const u=e.instance,m=o=>a.isObject(e.value)?e.value[o]:void 0,g=o=>{const c=a.isString(o)&&(u==null?void 0:u[o])||o;return c&&r.ref(c)},v=o=>g(m(o)||t.getAttribute(`element-loading-${a.hyphenate(o)}`)),b=(l=m("fullscreen"))!=null?l:e.modifiers.fullscreen,f={text:v("text"),svg:v("svg"),svgViewBox:v("svgViewBox"),spinner:v("spinner"),background:v("background"),customClass:v("customClass"),fullscreen:b,target:(n=m("target"))!=null?n:b?void 0:t,body:(i=m("body"))!=null?i:e.modifiers.body,lock:(s=m("lock"))!=null?s:e.modifiers.lock};t[y]={options:f,instance:A(f)}},$=(t,e)=>{for(const l of Object.keys(e))r.isRef(e[l])&&(e[l].value=t[l])},B={mounted(t,e){e.value&&L(t,e)},updated(t,e){const l=t[y];e.oldValue!==e.value&&(e.value&&!e.oldValue?L(t,e):e.value&&e.oldValue?a.isObject(e.value)&&$(e.value,l.options):l==null||l.instance.close())},unmounted(t){var e;(e=t[y])==null||e.instance.close(),t[y]=null}};exports.vLoading=B;
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { ref as _, reactive as T, defineComponent as V, h as g, Transition as N, withCtx as E, withDirectives as P, createVNode as z, vShow as O, createApp as R, toRefs as j, nextTick as w, isRef as q } from "vue";
|
|
2
|
+
import { u as D } from "./use-global-config-946f61a4.js";
|
|
3
|
+
import { r as y, b as F, a as A, y as b, g as L, c as I, z as G } from "./base-4bcd2756.js";
|
|
4
|
+
function H(t) {
|
|
5
|
+
let e;
|
|
6
|
+
const l = _(!1), o = T({
|
|
7
|
+
...t,
|
|
8
|
+
originalPosition: "",
|
|
9
|
+
originalOverflow: "",
|
|
10
|
+
visible: !1
|
|
11
|
+
});
|
|
12
|
+
function r(n) {
|
|
13
|
+
o.text = n;
|
|
14
|
+
}
|
|
15
|
+
function s() {
|
|
16
|
+
const n = o.parent, a = d.ns;
|
|
17
|
+
if (!n.vLoadingAddClassList) {
|
|
18
|
+
let c = n.getAttribute("loading-number");
|
|
19
|
+
c = Number.parseInt(c) - 1, c ? n.setAttribute("loading-number", c.toString()) : (y(n, a.bm("parent", "relative")), n.removeAttribute("loading-number")), y(n, a.bm("parent", "hidden"));
|
|
20
|
+
}
|
|
21
|
+
i(), m.unmount();
|
|
22
|
+
}
|
|
23
|
+
function i() {
|
|
24
|
+
var n, a;
|
|
25
|
+
(a = (n = d.$el) == null ? void 0 : n.parentNode) == null || a.removeChild(d.$el);
|
|
26
|
+
}
|
|
27
|
+
function v() {
|
|
28
|
+
var n;
|
|
29
|
+
t.beforeClose && !t.beforeClose() || (l.value = !0, clearTimeout(e), e = setTimeout(f, 400), o.visible = !1, (n = t.closed) == null || n.call(t));
|
|
30
|
+
}
|
|
31
|
+
function f() {
|
|
32
|
+
if (!l.value)
|
|
33
|
+
return;
|
|
34
|
+
const n = o.parent;
|
|
35
|
+
l.value = !1, n.vLoadingAddClassList = void 0, s();
|
|
36
|
+
}
|
|
37
|
+
const u = V({
|
|
38
|
+
name: "ElLoading",
|
|
39
|
+
setup(n, { expose: a }) {
|
|
40
|
+
const { ns: c, zIndex: S } = D("loading");
|
|
41
|
+
return a({
|
|
42
|
+
ns: c,
|
|
43
|
+
zIndex: S
|
|
44
|
+
}), () => {
|
|
45
|
+
const C = o.spinner || o.svg, $ = g("svg", {
|
|
46
|
+
class: "circular",
|
|
47
|
+
viewBox: o.svgViewBox ? o.svgViewBox : "0 0 50 50",
|
|
48
|
+
...C ? { innerHTML: C } : {}
|
|
49
|
+
}, [
|
|
50
|
+
g("circle", {
|
|
51
|
+
class: "path",
|
|
52
|
+
cx: "25",
|
|
53
|
+
cy: "25",
|
|
54
|
+
r: "20",
|
|
55
|
+
fill: "none"
|
|
56
|
+
})
|
|
57
|
+
]), B = o.text ? g("p", { class: c.b("text") }, [o.text]) : void 0;
|
|
58
|
+
return g(N, {
|
|
59
|
+
name: c.b("fade"),
|
|
60
|
+
onAfterLeave: f
|
|
61
|
+
}, {
|
|
62
|
+
default: E(() => [
|
|
63
|
+
P(z("div", {
|
|
64
|
+
style: {
|
|
65
|
+
backgroundColor: o.background || ""
|
|
66
|
+
},
|
|
67
|
+
class: [
|
|
68
|
+
c.b("mask"),
|
|
69
|
+
o.customClass,
|
|
70
|
+
o.fullscreen ? "is-fullscreen" : ""
|
|
71
|
+
]
|
|
72
|
+
}, [
|
|
73
|
+
g("div", {
|
|
74
|
+
class: c.b("spinner")
|
|
75
|
+
}, [$, B])
|
|
76
|
+
]), [[O, o.visible]])
|
|
77
|
+
])
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
}), m = R(u), d = m.mount(document.createElement("div"));
|
|
82
|
+
return {
|
|
83
|
+
...j(o),
|
|
84
|
+
setText: r,
|
|
85
|
+
removeElLoadingChild: i,
|
|
86
|
+
close: v,
|
|
87
|
+
handleAfterLeave: f,
|
|
88
|
+
vm: d,
|
|
89
|
+
get $el() {
|
|
90
|
+
return d.$el;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
let p;
|
|
95
|
+
const K = function(t = {}) {
|
|
96
|
+
if (!F)
|
|
97
|
+
return;
|
|
98
|
+
const e = M(t);
|
|
99
|
+
if (e.fullscreen && p)
|
|
100
|
+
return p;
|
|
101
|
+
const l = H({
|
|
102
|
+
...e,
|
|
103
|
+
closed: () => {
|
|
104
|
+
var r;
|
|
105
|
+
(r = e.closed) == null || r.call(e), e.fullscreen && (p = void 0);
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
Y(e, e.parent, l), h(e, e.parent, l), e.parent.vLoadingAddClassList = () => h(e, e.parent, l);
|
|
109
|
+
let o = e.parent.getAttribute("loading-number");
|
|
110
|
+
return o ? o = `${Number.parseInt(o) + 1}` : o = "1", e.parent.setAttribute("loading-number", o), e.parent.appendChild(l.$el), w(() => l.visible.value = e.visible), e.fullscreen && (p = l), l;
|
|
111
|
+
}, M = (t) => {
|
|
112
|
+
var e, l, o, r;
|
|
113
|
+
let s;
|
|
114
|
+
return A(t.target) ? s = (e = document.querySelector(t.target)) != null ? e : document.body : s = t.target || document.body, {
|
|
115
|
+
parent: s === document.body || t.body ? document.body : s,
|
|
116
|
+
background: t.background || "",
|
|
117
|
+
svg: t.svg || "",
|
|
118
|
+
svgViewBox: t.svgViewBox || "",
|
|
119
|
+
spinner: t.spinner || !1,
|
|
120
|
+
text: t.text || "",
|
|
121
|
+
fullscreen: s === document.body && ((l = t.fullscreen) != null ? l : !0),
|
|
122
|
+
lock: (o = t.lock) != null ? o : !1,
|
|
123
|
+
customClass: t.customClass || "",
|
|
124
|
+
visible: (r = t.visible) != null ? r : !0,
|
|
125
|
+
beforeClose: t.beforeClose,
|
|
126
|
+
closed: t.closed,
|
|
127
|
+
target: s
|
|
128
|
+
};
|
|
129
|
+
}, Y = async (t, e, l) => {
|
|
130
|
+
const { nextZIndex: o } = l.vm.zIndex || l.vm._.exposed.zIndex, r = {};
|
|
131
|
+
if (t.fullscreen)
|
|
132
|
+
l.originalPosition.value = b(document.body, "position"), l.originalOverflow.value = b(document.body, "overflow"), r.zIndex = o();
|
|
133
|
+
else if (t.parent === document.body) {
|
|
134
|
+
l.originalPosition.value = b(document.body, "position"), await w();
|
|
135
|
+
for (const s of ["top", "left"]) {
|
|
136
|
+
const i = s === "top" ? "scrollTop" : "scrollLeft";
|
|
137
|
+
r[s] = `${t.target.getBoundingClientRect()[s] + document.body[i] + document.documentElement[i] - Number.parseInt(b(document.body, `margin-${s}`), 10)}px`;
|
|
138
|
+
}
|
|
139
|
+
for (const s of ["height", "width"])
|
|
140
|
+
r[s] = `${t.target.getBoundingClientRect()[s]}px`;
|
|
141
|
+
} else
|
|
142
|
+
l.originalPosition.value = b(e, "position");
|
|
143
|
+
for (const [s, i] of Object.entries(r))
|
|
144
|
+
l.$el.style[s] = i;
|
|
145
|
+
}, h = (t, e, l) => {
|
|
146
|
+
const o = l.vm.ns || l.vm._.exposed.ns;
|
|
147
|
+
["absolute", "fixed", "sticky"].includes(l.originalPosition.value) ? y(e, o.bm("parent", "relative")) : L(e, o.bm("parent", "relative")), t.fullscreen && t.lock ? L(e, o.bm("parent", "hidden")) : y(e, o.bm("parent", "hidden"));
|
|
148
|
+
}, x = Symbol("ElLoading"), k = (t, e) => {
|
|
149
|
+
var l, o, r, s;
|
|
150
|
+
const i = e.instance, v = (n) => I(e.value) ? e.value[n] : void 0, f = (n) => {
|
|
151
|
+
const a = A(n) && (i == null ? void 0 : i[n]) || n;
|
|
152
|
+
return a && _(a);
|
|
153
|
+
}, u = (n) => f(v(n) || t.getAttribute(`element-loading-${G(n)}`)), m = (l = v("fullscreen")) != null ? l : e.modifiers.fullscreen, d = {
|
|
154
|
+
text: u("text"),
|
|
155
|
+
svg: u("svg"),
|
|
156
|
+
svgViewBox: u("svgViewBox"),
|
|
157
|
+
spinner: u("spinner"),
|
|
158
|
+
background: u("background"),
|
|
159
|
+
customClass: u("customClass"),
|
|
160
|
+
fullscreen: m,
|
|
161
|
+
target: (o = v("target")) != null ? o : m ? void 0 : t,
|
|
162
|
+
body: (r = v("body")) != null ? r : e.modifiers.body,
|
|
163
|
+
lock: (s = v("lock")) != null ? s : e.modifiers.lock
|
|
164
|
+
};
|
|
165
|
+
t[x] = {
|
|
166
|
+
options: d,
|
|
167
|
+
instance: K(d)
|
|
168
|
+
};
|
|
169
|
+
}, Z = (t, e) => {
|
|
170
|
+
for (const l of Object.keys(e))
|
|
171
|
+
q(e[l]) && (e[l].value = t[l]);
|
|
172
|
+
}, W = {
|
|
173
|
+
mounted(t, e) {
|
|
174
|
+
e.value && k(t, e);
|
|
175
|
+
},
|
|
176
|
+
updated(t, e) {
|
|
177
|
+
const l = t[x];
|
|
178
|
+
e.oldValue !== e.value && (e.value && !e.oldValue ? k(t, e) : e.value && e.oldValue ? I(e.value) && Z(e.value, l.options) : l == null || l.instance.close());
|
|
179
|
+
},
|
|
180
|
+
unmounted(t) {
|
|
181
|
+
var e;
|
|
182
|
+
(e = t[x]) == null || e.instance.close(), t[x] = null;
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
export {
|
|
186
|
+
W as v
|
|
187
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),oe=require("./el-scrollbar-ac525239.cjs"),H=require("./index-afc88a4b.cjs"),y=require("./index-65b4113e.cjs"),l=require("./base-0ca7c43a.cjs"),Q=require("./el-popper-7adbf1c6.cjs"),se=require("./index-eea0bcb3.cjs"),V=require("./use-form-common-props-74a96df2.cjs"),le=require("./el-tag-9732314f.cjs"),ae=require("./typescript-b63f8e83.cjs"),ue=require("./vnode-b15eb11b.cjs"),re=e.defineComponent({name:"ElCollapseTransition"}),ie=e.defineComponent({...re,setup(t){const s=l.useNamespace("collapse-transition"),o=n=>{n.style.maxHeight="",n.style.overflow=n.dataset.oldOverflow,n.style.paddingTop=n.dataset.oldPaddingTop,n.style.paddingBottom=n.dataset.oldPaddingBottom},d={beforeEnter(n){n.dataset||(n.dataset={}),n.dataset.oldPaddingTop=n.style.paddingTop,n.dataset.oldPaddingBottom=n.style.paddingBottom,n.style.height&&(n.dataset.elExistsHeight=n.style.height),n.style.maxHeight=0,n.style.paddingTop=0,n.style.paddingBottom=0},enter(n){requestAnimationFrame(()=>{n.dataset.oldOverflow=n.style.overflow,n.dataset.elExistsHeight?n.style.maxHeight=n.dataset.elExistsHeight:n.scrollHeight!==0?n.style.maxHeight=`${n.scrollHeight}px`:n.style.maxHeight=0,n.style.paddingTop=n.dataset.oldPaddingTop,n.style.paddingBottom=n.dataset.oldPaddingBottom,n.style.overflow="hidden"})},afterEnter(n){n.style.maxHeight="",n.style.overflow=n.dataset.oldOverflow},enterCancelled(n){o(n)},beforeLeave(n){n.dataset||(n.dataset={}),n.dataset.oldPaddingTop=n.style.paddingTop,n.dataset.oldPaddingBottom=n.style.paddingBottom,n.dataset.oldOverflow=n.style.overflow,n.style.maxHeight=`${n.scrollHeight}px`,n.style.overflow="hidden"},leave(n){n.scrollHeight!==0&&(n.style.maxHeight=0,n.style.paddingTop=0,n.style.paddingBottom=0)},afterLeave(n){o(n)},leaveCancelled(n){o(n)}};return(n,C)=>(e.openBlock(),e.createBlock(e.Transition,e.mergeProps({name:e.unref(s).b()},e.toHandlers(d)),{default:e.withCtx(()=>[e.renderSlot(n.$slots,"default")]),_:3},16,["name"]))}});var ce=l._export_sfc(ie,[["__file","collapse-transition.vue"]]);const de=l.withInstall(ce);let pe=class{constructor(s,o){this.parent=s,this.domNode=o,this.subIndex=0,this.subIndex=0,this.init()}init(){this.subMenuItems=this.domNode.querySelectorAll("li"),this.addListeners()}gotoSubIndex(s){s===this.subMenuItems.length?s=0:s<0&&(s=this.subMenuItems.length-1),this.subMenuItems[s].focus(),this.subIndex=s}addListeners(){const s=this.parent.domNode;Array.prototype.forEach.call(this.subMenuItems,o=>{o.addEventListener("keydown",d=>{let n=!1;switch(d.code){case y.EVENT_CODE.down:{this.gotoSubIndex(this.subIndex+1),n=!0;break}case y.EVENT_CODE.up:{this.gotoSubIndex(this.subIndex-1),n=!0;break}case y.EVENT_CODE.tab:{y.triggerEvent(s,"mouseleave");break}case y.EVENT_CODE.enter:case y.EVENT_CODE.numpadEnter:case y.EVENT_CODE.space:{n=!0,d.currentTarget.click();break}}return n&&(d.preventDefault(),d.stopPropagation()),!1})})}},me=class{constructor(s,o){this.domNode=s,this.submenu=null,this.submenu=null,this.init(o)}init(s){this.domNode.setAttribute("tabindex","0");const o=this.domNode.querySelector(`.${s}-menu`);o&&(this.submenu=new pe(this,o)),this.addListeners()}addListeners(){this.domNode.addEventListener("keydown",s=>{let o=!1;switch(s.code){case y.EVENT_CODE.down:{y.triggerEvent(s.currentTarget,"mouseenter"),this.submenu&&this.submenu.gotoSubIndex(0),o=!0;break}case y.EVENT_CODE.up:{y.triggerEvent(s.currentTarget,"mouseenter"),this.submenu&&this.submenu.gotoSubIndex(this.submenu.subMenuItems.length-1),o=!0;break}case y.EVENT_CODE.tab:{y.triggerEvent(s.currentTarget,"mouseleave");break}case y.EVENT_CODE.enter:case y.EVENT_CODE.numpadEnter:case y.EVENT_CODE.space:{o=!0,s.currentTarget.click();break}}o&&s.preventDefault()})}},ve=class{constructor(s,o){this.domNode=s,this.init(o)}init(s){const o=this.domNode.childNodes;Array.from(o).forEach(d=>{d.nodeType===1&&new me(d,s)})}};const fe=e.defineComponent({name:"ElMenuCollapseTransition",setup(){const t=l.useNamespace("menu");return{listeners:{onBeforeEnter:o=>o.style.opacity="0.2",onEnter(o,d){l.addClass(o,`${t.namespace.value}-opacity-transition`),o.style.opacity="1",d()},onAfterEnter(o){l.removeClass(o,`${t.namespace.value}-opacity-transition`),o.style.opacity=""},onBeforeLeave(o){o.dataset||(o.dataset={}),l.hasClass(o,t.m("collapse"))?(l.removeClass(o,t.m("collapse")),o.dataset.oldOverflow=o.style.overflow,o.dataset.scrollWidth=o.clientWidth.toString(),l.addClass(o,t.m("collapse"))):(l.addClass(o,t.m("collapse")),o.dataset.oldOverflow=o.style.overflow,o.dataset.scrollWidth=o.clientWidth.toString(),l.removeClass(o,t.m("collapse"))),o.style.width=`${o.scrollWidth}px`,o.style.overflow="hidden"},onLeave(o){l.addClass(o,"horizontal-collapse-transition"),o.style.width=`${o.dataset.scrollWidth}px`}}}}});function he(t,s,o,d,n,C){return e.openBlock(),e.createBlock(e.Transition,e.mergeProps({mode:"out-in"},t.listeners),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16)}var ge=l._export_sfc(fe,[["render",he],["__file","menu-collapse-transition.vue"]]);function X(t,s){const o=e.computed(()=>{let n=t.parent;const C=[s.value];for(;n.type.name!=="ElMenu";)n.props.index&&C.unshift(n.props.index),n=n.parent;return C});return{parentMenu:e.computed(()=>{let n=t.parent;for(;n&&!["ElMenu","ElSubMenu"].includes(n.type.name);)n=n.parent;return n}),indexPath:o}}function be(t){return e.computed(()=>{const o=t.backgroundColor;return o?new se.TinyColor(o).shade(20).toString():""})}const Y=(t,s)=>{const o=l.useNamespace("menu");return e.computed(()=>o.cssVarBlock({"text-color":t.textColor||"","hover-text-color":t.textColor||"","bg-color":t.backgroundColor||"","hover-bg-color":be(t).value||"","active-color":t.activeTextColor||"",level:`${s}`}))},Me=l.buildProps({index:{type:String,required:!0},showTimeout:Number,hideTimeout:Number,popperClass:String,disabled:Boolean,teleported:{type:Boolean,default:void 0},popperOffset:Number,expandCloseIcon:{type:V.iconPropType},expandOpenIcon:{type:V.iconPropType},collapseCloseIcon:{type:V.iconPropType},collapseOpenIcon:{type:V.iconPropType}}),U="ElSubMenu";var K=e.defineComponent({name:U,props:Me,setup(t,{slots:s,expose:o}){const d=e.getCurrentInstance(),{indexPath:n,parentMenu:C}=X(d,e.computed(()=>t.index)),v=l.useNamespace("menu"),E=l.useNamespace("sub-menu"),i=e.inject("rootMenu");i||l.throwError(U,"can not inject root menu");const m=e.inject(`subMenu:${C.value.uid}`);m||l.throwError(U,"can not inject sub menu");const f=e.ref({}),b=e.ref({});let I;const S=e.ref(!1),W=e.ref(),q=e.ref(null),N=e.computed(()=>_.value==="horizontal"&&w.value?"bottom-start":"right-start"),O=e.computed(()=>_.value==="horizontal"&&w.value||_.value==="vertical"&&!i.props.collapse?t.expandCloseIcon&&t.expandOpenIcon?x.value?t.expandOpenIcon:t.expandCloseIcon:H.arrow_down_default:t.collapseCloseIcon&&t.collapseOpenIcon?x.value?t.collapseOpenIcon:t.collapseCloseIcon:H.arrow_right_default),w=e.computed(()=>m.level===0),z=e.computed(()=>{const r=t.teleported;return r===void 0?w.value:r}),F=e.computed(()=>i.props.collapse?`${v.namespace.value}-zoom-in-left`:`${v.namespace.value}-zoom-in-top`),R=e.computed(()=>_.value==="horizontal"&&w.value?["bottom-start","bottom-end","top-start","top-end","right-start","left-start"]:["right-start","right","right-end","left-start","bottom-start","bottom-end","top-start","top-end"]),x=e.computed(()=>i.openedMenus.includes(t.index)),P=e.computed(()=>{let r=!1;return Object.values(f.value).forEach(p=>{p.active&&(r=!0)}),Object.values(b.value).forEach(p=>{p.active&&(r=!0)}),r}),_=e.computed(()=>i.props.mode),$=e.reactive({index:t.index,indexPath:n,active:P}),D=Y(i.props,m.level+1),L=e.computed(()=>{var r;return(r=t.popperOffset)!=null?r:i.props.popperOffset}),B=e.computed(()=>{var r;return(r=t.popperClass)!=null?r:i.props.popperClass}),j=e.computed(()=>{var r;return(r=t.showTimeout)!=null?r:i.props.showTimeout}),G=e.computed(()=>{var r;return(r=t.hideTimeout)!=null?r:i.props.hideTimeout}),a=()=>{var r,p,M;return(M=(p=(r=q.value)==null?void 0:r.popperRef)==null?void 0:p.popperInstanceRef)==null?void 0:M.destroy()},u=r=>{r||a()},c=()=>{i.props.menuTrigger==="hover"&&i.props.mode==="horizontal"||i.props.collapse&&i.props.mode==="vertical"||t.disabled||i.handleSubMenuClick({index:t.index,indexPath:n.value,active:P.value})},h=(r,p=j.value)=>{var M;if(r.type!=="focus"){if(i.props.menuTrigger==="click"&&i.props.mode==="horizontal"||!i.props.collapse&&i.props.mode==="vertical"||t.disabled){m.mouseInChild.value=!0;return}m.mouseInChild.value=!0,I==null||I(),{stop:I}=l.useTimeoutFn(()=>{i.openMenu(t.index,n.value)},p),z.value&&((M=C.value.vnode.el)==null||M.dispatchEvent(new MouseEvent("mouseenter")))}},g=(r=!1)=>{var p;if(i.props.menuTrigger==="click"&&i.props.mode==="horizontal"||!i.props.collapse&&i.props.mode==="vertical"){m.mouseInChild.value=!1;return}I==null||I(),m.mouseInChild.value=!1,{stop:I}=l.useTimeoutFn(()=>!S.value&&i.closeMenu(t.index,n.value),G.value),z.value&&r&&((p=m.handleMouseleave)==null||p.call(m,!0))};e.watch(()=>i.props.collapse,r=>u(!!r));{const r=M=>{b.value[M.index]=M},p=M=>{delete b.value[M.index]};e.provide(`subMenu:${d.uid}`,{addSubMenu:r,removeSubMenu:p,handleMouseleave:g,mouseInChild:S,level:m.level+1})}return o({opened:x}),e.onMounted(()=>{i.addSubMenu($),m.addSubMenu($)}),e.onBeforeUnmount(()=>{m.removeSubMenu($),i.removeSubMenu($)}),()=>{var r;const p=[(r=s.title)==null?void 0:r.call(s),e.h(H.ElIcon,{class:E.e("icon-arrow"),style:{transform:x.value?t.expandCloseIcon&&t.expandOpenIcon||t.collapseCloseIcon&&t.collapseOpenIcon&&i.props.collapse?"none":"rotateZ(180deg)":"none"}},{default:()=>l.isString(O.value)?e.h(d.appContext.components[O.value]):e.h(O.value)})],M=i.isMenuPopup?e.h(Q.ElTooltip,{ref:q,visible:x.value,effect:"light",pure:!0,offset:L.value,showArrow:!1,persistent:!0,popperClass:B.value,placement:N.value,teleported:z.value,fallbackPlacements:R.value,transition:F.value,gpuAcceleration:!1},{content:()=>{var T;return e.h("div",{class:[v.m(_.value),v.m("popup-container"),B.value],onMouseenter:k=>h(k,100),onMouseleave:()=>g(!0),onFocus:k=>h(k,100)},[e.h("ul",{class:[v.b(),v.m("popup"),v.m(`popup-${N.value}`)],style:D.value},[(T=s.default)==null?void 0:T.call(s)])])},default:()=>e.h("div",{class:E.e("title"),onClick:c},p)}):e.h(e.Fragment,{},[e.h("div",{class:E.e("title"),ref:W,onClick:c},p),e.h(de,{},{default:()=>{var T;return e.withDirectives(e.h("ul",{role:"menu",class:[v.b(),v.m("inline")],style:D.value},[(T=s.default)==null?void 0:T.call(s)]),[[e.vShow,x.value]])}})]);return e.h("li",{class:[E.b(),E.is("active",P.value),E.is("opened",x.value),E.is("disabled",t.disabled)],role:"menuitem",ariaHaspopup:!0,ariaExpanded:x.value,onMouseenter:h,onMouseleave:()=>g(),onFocus:h},[M])}}});const ye=l.buildProps({mode:{type:String,values:["horizontal","vertical"],default:"vertical"},defaultActive:{type:String,default:""},defaultOpeneds:{type:l.definePropType(Array),default:()=>ae.mutable([])},uniqueOpened:Boolean,router:Boolean,menuTrigger:{type:String,values:["hover","click"],default:"hover"},collapse:Boolean,backgroundColor:String,textColor:String,activeTextColor:String,closeOnClickOutside:Boolean,collapseTransition:{type:Boolean,default:!0},ellipsis:{type:Boolean,default:!0},popperOffset:{type:Number,default:6},ellipsisIcon:{type:V.iconPropType,default:()=>H.more_default},popperEffect:{type:l.definePropType(String),default:"dark"},popperClass:String,showTimeout:{type:Number,default:300},hideTimeout:{type:Number,default:300}}),Z=t=>l.isArray(t)&&t.every(s=>l.isString(s)),Ee={close:(t,s)=>l.isString(t)&&Z(s),open:(t,s)=>l.isString(t)&&Z(s),select:(t,s,o,d)=>l.isString(t)&&Z(s)&&l.isObject(o)&&(d===void 0||d instanceof Promise)};var Ce=e.defineComponent({name:"ElMenu",props:ye,emits:Ee,setup(t,{emit:s,slots:o,expose:d}){const n=e.getCurrentInstance(),C=n.appContext.config.globalProperties.$router,v=e.ref(),E=l.useNamespace("menu"),i=l.useNamespace("sub-menu"),m=e.ref(-1),f=e.ref(t.defaultOpeneds&&!t.collapse?t.defaultOpeneds.slice(0):[]),b=e.ref(t.defaultActive),I=e.ref({}),S=e.ref({}),W=e.computed(()=>t.mode==="horizontal"||t.mode==="vertical"&&t.collapse),q=()=>{const a=b.value&&I.value[b.value];if(!a||t.mode==="horizontal"||t.collapse)return;a.indexPath.forEach(c=>{const h=S.value[c];h&&N(c,h.indexPath)})},N=(a,u)=>{f.value.includes(a)||(t.uniqueOpened&&(f.value=f.value.filter(c=>u.includes(c))),f.value.push(a),s("open",a,u))},O=a=>{const u=f.value.indexOf(a);u!==-1&&f.value.splice(u,1)},w=(a,u)=>{O(a),s("close",a,u)},z=({index:a,indexPath:u})=>{f.value.includes(a)?w(a,u):N(a,u)},F=a=>{(t.mode==="horizontal"||t.collapse)&&(f.value=[]);const{index:u,indexPath:c}=a;if(!(l.isNil(u)||l.isNil(c)))if(t.router&&C){const h=a.route||u,g=C.push(h).then(r=>(r||(b.value=u),r));s("select",u,c,{index:u,indexPath:c,route:h},g)}else b.value=u,s("select",u,c,{index:u,indexPath:c})},R=a=>{const u=I.value,c=u[a]||b.value&&u[b.value]||u[t.defaultActive];c?b.value=c.index:b.value=a},x=a=>{const u=getComputedStyle(a),c=Number.parseInt(u.marginLeft,10),h=Number.parseInt(u.marginRight,10);return a.offsetWidth+c+h||0},P=()=>{var a,u;if(!v.value)return-1;const c=Array.from((u=(a=v.value)==null?void 0:a.childNodes)!=null?u:[]).filter(A=>A.nodeName!=="#text"||A.nodeValue),h=64,g=getComputedStyle(v.value),r=Number.parseInt(g.paddingLeft,10),p=Number.parseInt(g.paddingRight,10),M=v.value.clientWidth-r-p;let T=0,k=0;return c.forEach((A,ne)=>{A.nodeName!=="#comment"&&(T+=x(A),T<=M-h&&(k=ne+1))}),k===c.length?-1:k},_=a=>S.value[a].indexPath,$=(a,u=33.34)=>{let c;return()=>{c&&clearTimeout(c),c=setTimeout(()=>{a()},u)}};let D=!0;const L=()=>{if(m.value===P())return;const a=()=>{m.value=-1,e.nextTick(()=>{m.value=P()})};D?a():$(a)(),D=!1};e.watch(()=>t.defaultActive,a=>{I.value[a]||(b.value=""),R(a)}),e.watch(()=>t.collapse,a=>{a&&(f.value=[])}),e.watch(I.value,q);let B;e.watchEffect(()=>{t.mode==="horizontal"&&t.ellipsis?B=oe.useResizeObserver(v,L).stop:B==null||B()});const j=e.ref(!1);{const a=g=>{S.value[g.index]=g},u=g=>{delete S.value[g.index]},c=g=>{I.value[g.index]=g},h=g=>{delete I.value[g.index]};e.provide("rootMenu",e.reactive({props:t,openedMenus:f,items:I,subMenus:S,activeIndex:b,isMenuPopup:W,addMenuItem:c,removeMenuItem:h,addSubMenu:a,removeSubMenu:u,openMenu:N,closeMenu:w,handleMenuItemClick:F,handleSubMenuClick:z})),e.provide(`subMenu:${n.uid}`,{addSubMenu:a,removeSubMenu:u,mouseInChild:j,level:0})}e.onMounted(()=>{t.mode==="horizontal"&&new ve(n.vnode.el,E.namespace.value)}),d({open:u=>{const{indexPath:c}=S.value[u];c.forEach(h=>N(h,c))},close:O,handleResize:L});const G=Y(t,0);return()=>{var a,u;let c=(u=(a=o.default)==null?void 0:a.call(o))!=null?u:[];const h=[];if(t.mode==="horizontal"&&v.value){const p=ue.flattedChildren(c),M=m.value===-1?p:p.slice(0,m.value),T=m.value===-1?[]:p.slice(m.value);T!=null&&T.length&&t.ellipsis&&(c=M,h.push(e.h(K,{index:"sub-menu-more",class:i.e("hide-arrow"),popperOffset:t.popperOffset},{title:()=>e.h(H.ElIcon,{class:i.e("icon-more")},{default:()=>e.h(t.ellipsisIcon)}),default:()=>T})))}const g=t.closeOnClickOutside?[[le.ClickOutside,()=>{f.value.length&&(j.value||(f.value.forEach(p=>s("close",p,_(p))),f.value=[]))}]]:[],r=e.withDirectives(e.h("ul",{key:String(t.collapse),role:"menubar",ref:v,style:G.value,class:{[E.b()]:!0,[E.m(t.mode)]:!0,[E.m("collapse")]:t.collapse}},[...c,...h]),g);return t.collapseTransition&&t.mode==="vertical"?e.h(ge,()=>r):r}}});const Ie=l.buildProps({index:{type:l.definePropType([String,null]),default:null},route:{type:l.definePropType([String,Object])},disabled:Boolean}),Te={click:t=>l.isString(t.index)&&l.isArray(t.indexPath)},J="ElMenuItem",xe=e.defineComponent({name:J,components:{ElTooltip:Q.ElTooltip},props:Ie,emits:Te,setup(t,{emit:s}){const o=e.getCurrentInstance(),d=e.inject("rootMenu"),n=l.useNamespace("menu"),C=l.useNamespace("menu-item");d||l.throwError(J,"can not inject root menu");const{parentMenu:v,indexPath:E}=X(o,e.toRef(t,"index")),i=e.inject(`subMenu:${v.value.uid}`);i||l.throwError(J,"can not inject sub menu");const m=e.computed(()=>t.index===d.activeIndex),f=e.reactive({index:t.index,indexPath:E,active:m}),b=()=>{t.disabled||(d.handleMenuItemClick({index:t.index,indexPath:E.value,route:t.route}),s("click",f))};return e.onMounted(()=>{i.addSubMenu(f),d.addMenuItem(f)}),e.onBeforeUnmount(()=>{i.removeSubMenu(f),d.removeMenuItem(f)}),{parentMenu:v,rootMenu:d,active:m,nsMenu:n,nsMenuItem:C,handleClick:b}}});function Se(t,s,o,d,n,C){const v=e.resolveComponent("el-tooltip");return e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass([t.nsMenuItem.b(),t.nsMenuItem.is("active",t.active),t.nsMenuItem.is("disabled",t.disabled)]),role:"menuitem",tabindex:"-1",onClick:t.handleClick},[t.parentMenu.type.name==="ElMenu"&&t.rootMenu.props.collapse&&t.$slots.title?(e.openBlock(),e.createBlock(v,{key:0,effect:t.rootMenu.props.popperEffect,placement:"right","fallback-placements":["left"],persistent:""},{content:e.withCtx(()=>[e.renderSlot(t.$slots,"title")]),default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(t.nsMenu.be("tooltip","trigger"))},[e.renderSlot(t.$slots,"default")],2)]),_:3},8,["effect"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.renderSlot(t.$slots,"default"),e.renderSlot(t.$slots,"title")],64))],10,["onClick"])}var ee=l._export_sfc(xe,[["render",Se],["__file","menu-item.vue"]]);const Ne={title:String},we="ElMenuItemGroup",_e=e.defineComponent({name:we,props:Ne,setup(){return{ns:l.useNamespace("menu-item-group")}}});function ke(t,s,o,d,n,C){return e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(t.ns.b())},[e.createElementVNode("div",{class:e.normalizeClass(t.ns.e("title"))},[t.$slots.title?e.renderSlot(t.$slots,"title",{key:1}):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(t.title),1)],64))],2),e.createElementVNode("ul",null,[e.renderSlot(t.$slots,"default")])],2)}var te=l._export_sfc(_e,[["render",ke],["__file","menu-item-group.vue"]]);const Oe=l.withInstall(Ce,{MenuItem:ee,MenuItemGroup:te,SubMenu:K}),Pe=l.withNoopInstall(ee);l.withNoopInstall(te);l.withNoopInstall(K);exports.ElMenu=Oe;exports.ElMenuItem=Pe;
|
|
1
|
+
"use strict";const e=require("vue"),oe=require("./el-scrollbar-8bf765f2.cjs"),H=require("./index-19fa1fcf.cjs"),y=require("./index-d94bae37.cjs"),l=require("./base-bdc10baa.cjs"),Q=require("./el-popper-14a9d493.cjs"),se=require("./index-eea0bcb3.cjs"),V=require("./use-form-common-props-592797e2.cjs"),le=require("./el-tag-8d49d4d2.cjs"),ae=require("./typescript-b63f8e83.cjs"),ue=require("./vnode-1b827c99.cjs"),re=e.defineComponent({name:"ElCollapseTransition"}),ie=e.defineComponent({...re,setup(t){const s=l.useNamespace("collapse-transition"),o=n=>{n.style.maxHeight="",n.style.overflow=n.dataset.oldOverflow,n.style.paddingTop=n.dataset.oldPaddingTop,n.style.paddingBottom=n.dataset.oldPaddingBottom},d={beforeEnter(n){n.dataset||(n.dataset={}),n.dataset.oldPaddingTop=n.style.paddingTop,n.dataset.oldPaddingBottom=n.style.paddingBottom,n.style.height&&(n.dataset.elExistsHeight=n.style.height),n.style.maxHeight=0,n.style.paddingTop=0,n.style.paddingBottom=0},enter(n){requestAnimationFrame(()=>{n.dataset.oldOverflow=n.style.overflow,n.dataset.elExistsHeight?n.style.maxHeight=n.dataset.elExistsHeight:n.scrollHeight!==0?n.style.maxHeight=`${n.scrollHeight}px`:n.style.maxHeight=0,n.style.paddingTop=n.dataset.oldPaddingTop,n.style.paddingBottom=n.dataset.oldPaddingBottom,n.style.overflow="hidden"})},afterEnter(n){n.style.maxHeight="",n.style.overflow=n.dataset.oldOverflow},enterCancelled(n){o(n)},beforeLeave(n){n.dataset||(n.dataset={}),n.dataset.oldPaddingTop=n.style.paddingTop,n.dataset.oldPaddingBottom=n.style.paddingBottom,n.dataset.oldOverflow=n.style.overflow,n.style.maxHeight=`${n.scrollHeight}px`,n.style.overflow="hidden"},leave(n){n.scrollHeight!==0&&(n.style.maxHeight=0,n.style.paddingTop=0,n.style.paddingBottom=0)},afterLeave(n){o(n)},leaveCancelled(n){o(n)}};return(n,C)=>(e.openBlock(),e.createBlock(e.Transition,e.mergeProps({name:e.unref(s).b()},e.toHandlers(d)),{default:e.withCtx(()=>[e.renderSlot(n.$slots,"default")]),_:3},16,["name"]))}});var ce=l._export_sfc(ie,[["__file","collapse-transition.vue"]]);const de=l.withInstall(ce);let pe=class{constructor(s,o){this.parent=s,this.domNode=o,this.subIndex=0,this.subIndex=0,this.init()}init(){this.subMenuItems=this.domNode.querySelectorAll("li"),this.addListeners()}gotoSubIndex(s){s===this.subMenuItems.length?s=0:s<0&&(s=this.subMenuItems.length-1),this.subMenuItems[s].focus(),this.subIndex=s}addListeners(){const s=this.parent.domNode;Array.prototype.forEach.call(this.subMenuItems,o=>{o.addEventListener("keydown",d=>{let n=!1;switch(d.code){case y.EVENT_CODE.down:{this.gotoSubIndex(this.subIndex+1),n=!0;break}case y.EVENT_CODE.up:{this.gotoSubIndex(this.subIndex-1),n=!0;break}case y.EVENT_CODE.tab:{y.triggerEvent(s,"mouseleave");break}case y.EVENT_CODE.enter:case y.EVENT_CODE.numpadEnter:case y.EVENT_CODE.space:{n=!0,d.currentTarget.click();break}}return n&&(d.preventDefault(),d.stopPropagation()),!1})})}},me=class{constructor(s,o){this.domNode=s,this.submenu=null,this.submenu=null,this.init(o)}init(s){this.domNode.setAttribute("tabindex","0");const o=this.domNode.querySelector(`.${s}-menu`);o&&(this.submenu=new pe(this,o)),this.addListeners()}addListeners(){this.domNode.addEventListener("keydown",s=>{let o=!1;switch(s.code){case y.EVENT_CODE.down:{y.triggerEvent(s.currentTarget,"mouseenter"),this.submenu&&this.submenu.gotoSubIndex(0),o=!0;break}case y.EVENT_CODE.up:{y.triggerEvent(s.currentTarget,"mouseenter"),this.submenu&&this.submenu.gotoSubIndex(this.submenu.subMenuItems.length-1),o=!0;break}case y.EVENT_CODE.tab:{y.triggerEvent(s.currentTarget,"mouseleave");break}case y.EVENT_CODE.enter:case y.EVENT_CODE.numpadEnter:case y.EVENT_CODE.space:{o=!0,s.currentTarget.click();break}}o&&s.preventDefault()})}},ve=class{constructor(s,o){this.domNode=s,this.init(o)}init(s){const o=this.domNode.childNodes;Array.from(o).forEach(d=>{d.nodeType===1&&new me(d,s)})}};const fe=e.defineComponent({name:"ElMenuCollapseTransition",setup(){const t=l.useNamespace("menu");return{listeners:{onBeforeEnter:o=>o.style.opacity="0.2",onEnter(o,d){l.addClass(o,`${t.namespace.value}-opacity-transition`),o.style.opacity="1",d()},onAfterEnter(o){l.removeClass(o,`${t.namespace.value}-opacity-transition`),o.style.opacity=""},onBeforeLeave(o){o.dataset||(o.dataset={}),l.hasClass(o,t.m("collapse"))?(l.removeClass(o,t.m("collapse")),o.dataset.oldOverflow=o.style.overflow,o.dataset.scrollWidth=o.clientWidth.toString(),l.addClass(o,t.m("collapse"))):(l.addClass(o,t.m("collapse")),o.dataset.oldOverflow=o.style.overflow,o.dataset.scrollWidth=o.clientWidth.toString(),l.removeClass(o,t.m("collapse"))),o.style.width=`${o.scrollWidth}px`,o.style.overflow="hidden"},onLeave(o){l.addClass(o,"horizontal-collapse-transition"),o.style.width=`${o.dataset.scrollWidth}px`}}}}});function he(t,s,o,d,n,C){return e.openBlock(),e.createBlock(e.Transition,e.mergeProps({mode:"out-in"},t.listeners),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16)}var ge=l._export_sfc(fe,[["render",he],["__file","menu-collapse-transition.vue"]]);function X(t,s){const o=e.computed(()=>{let n=t.parent;const C=[s.value];for(;n.type.name!=="ElMenu";)n.props.index&&C.unshift(n.props.index),n=n.parent;return C});return{parentMenu:e.computed(()=>{let n=t.parent;for(;n&&!["ElMenu","ElSubMenu"].includes(n.type.name);)n=n.parent;return n}),indexPath:o}}function be(t){return e.computed(()=>{const o=t.backgroundColor;return o?new se.TinyColor(o).shade(20).toString():""})}const Y=(t,s)=>{const o=l.useNamespace("menu");return e.computed(()=>o.cssVarBlock({"text-color":t.textColor||"","hover-text-color":t.textColor||"","bg-color":t.backgroundColor||"","hover-bg-color":be(t).value||"","active-color":t.activeTextColor||"",level:`${s}`}))},Me=l.buildProps({index:{type:String,required:!0},showTimeout:Number,hideTimeout:Number,popperClass:String,disabled:Boolean,teleported:{type:Boolean,default:void 0},popperOffset:Number,expandCloseIcon:{type:V.iconPropType},expandOpenIcon:{type:V.iconPropType},collapseCloseIcon:{type:V.iconPropType},collapseOpenIcon:{type:V.iconPropType}}),U="ElSubMenu";var K=e.defineComponent({name:U,props:Me,setup(t,{slots:s,expose:o}){const d=e.getCurrentInstance(),{indexPath:n,parentMenu:C}=X(d,e.computed(()=>t.index)),v=l.useNamespace("menu"),E=l.useNamespace("sub-menu"),i=e.inject("rootMenu");i||l.throwError(U,"can not inject root menu");const m=e.inject(`subMenu:${C.value.uid}`);m||l.throwError(U,"can not inject sub menu");const f=e.ref({}),b=e.ref({});let I;const S=e.ref(!1),W=e.ref(),q=e.ref(null),N=e.computed(()=>_.value==="horizontal"&&w.value?"bottom-start":"right-start"),O=e.computed(()=>_.value==="horizontal"&&w.value||_.value==="vertical"&&!i.props.collapse?t.expandCloseIcon&&t.expandOpenIcon?x.value?t.expandOpenIcon:t.expandCloseIcon:H.arrow_down_default:t.collapseCloseIcon&&t.collapseOpenIcon?x.value?t.collapseOpenIcon:t.collapseCloseIcon:H.arrow_right_default),w=e.computed(()=>m.level===0),z=e.computed(()=>{const r=t.teleported;return r===void 0?w.value:r}),F=e.computed(()=>i.props.collapse?`${v.namespace.value}-zoom-in-left`:`${v.namespace.value}-zoom-in-top`),R=e.computed(()=>_.value==="horizontal"&&w.value?["bottom-start","bottom-end","top-start","top-end","right-start","left-start"]:["right-start","right","right-end","left-start","bottom-start","bottom-end","top-start","top-end"]),x=e.computed(()=>i.openedMenus.includes(t.index)),P=e.computed(()=>{let r=!1;return Object.values(f.value).forEach(p=>{p.active&&(r=!0)}),Object.values(b.value).forEach(p=>{p.active&&(r=!0)}),r}),_=e.computed(()=>i.props.mode),$=e.reactive({index:t.index,indexPath:n,active:P}),D=Y(i.props,m.level+1),L=e.computed(()=>{var r;return(r=t.popperOffset)!=null?r:i.props.popperOffset}),B=e.computed(()=>{var r;return(r=t.popperClass)!=null?r:i.props.popperClass}),j=e.computed(()=>{var r;return(r=t.showTimeout)!=null?r:i.props.showTimeout}),G=e.computed(()=>{var r;return(r=t.hideTimeout)!=null?r:i.props.hideTimeout}),a=()=>{var r,p,M;return(M=(p=(r=q.value)==null?void 0:r.popperRef)==null?void 0:p.popperInstanceRef)==null?void 0:M.destroy()},u=r=>{r||a()},c=()=>{i.props.menuTrigger==="hover"&&i.props.mode==="horizontal"||i.props.collapse&&i.props.mode==="vertical"||t.disabled||i.handleSubMenuClick({index:t.index,indexPath:n.value,active:P.value})},h=(r,p=j.value)=>{var M;if(r.type!=="focus"){if(i.props.menuTrigger==="click"&&i.props.mode==="horizontal"||!i.props.collapse&&i.props.mode==="vertical"||t.disabled){m.mouseInChild.value=!0;return}m.mouseInChild.value=!0,I==null||I(),{stop:I}=l.useTimeoutFn(()=>{i.openMenu(t.index,n.value)},p),z.value&&((M=C.value.vnode.el)==null||M.dispatchEvent(new MouseEvent("mouseenter")))}},g=(r=!1)=>{var p;if(i.props.menuTrigger==="click"&&i.props.mode==="horizontal"||!i.props.collapse&&i.props.mode==="vertical"){m.mouseInChild.value=!1;return}I==null||I(),m.mouseInChild.value=!1,{stop:I}=l.useTimeoutFn(()=>!S.value&&i.closeMenu(t.index,n.value),G.value),z.value&&r&&((p=m.handleMouseleave)==null||p.call(m,!0))};e.watch(()=>i.props.collapse,r=>u(!!r));{const r=M=>{b.value[M.index]=M},p=M=>{delete b.value[M.index]};e.provide(`subMenu:${d.uid}`,{addSubMenu:r,removeSubMenu:p,handleMouseleave:g,mouseInChild:S,level:m.level+1})}return o({opened:x}),e.onMounted(()=>{i.addSubMenu($),m.addSubMenu($)}),e.onBeforeUnmount(()=>{m.removeSubMenu($),i.removeSubMenu($)}),()=>{var r;const p=[(r=s.title)==null?void 0:r.call(s),e.h(H.ElIcon,{class:E.e("icon-arrow"),style:{transform:x.value?t.expandCloseIcon&&t.expandOpenIcon||t.collapseCloseIcon&&t.collapseOpenIcon&&i.props.collapse?"none":"rotateZ(180deg)":"none"}},{default:()=>l.isString(O.value)?e.h(d.appContext.components[O.value]):e.h(O.value)})],M=i.isMenuPopup?e.h(Q.ElTooltip,{ref:q,visible:x.value,effect:"light",pure:!0,offset:L.value,showArrow:!1,persistent:!0,popperClass:B.value,placement:N.value,teleported:z.value,fallbackPlacements:R.value,transition:F.value,gpuAcceleration:!1},{content:()=>{var T;return e.h("div",{class:[v.m(_.value),v.m("popup-container"),B.value],onMouseenter:k=>h(k,100),onMouseleave:()=>g(!0),onFocus:k=>h(k,100)},[e.h("ul",{class:[v.b(),v.m("popup"),v.m(`popup-${N.value}`)],style:D.value},[(T=s.default)==null?void 0:T.call(s)])])},default:()=>e.h("div",{class:E.e("title"),onClick:c},p)}):e.h(e.Fragment,{},[e.h("div",{class:E.e("title"),ref:W,onClick:c},p),e.h(de,{},{default:()=>{var T;return e.withDirectives(e.h("ul",{role:"menu",class:[v.b(),v.m("inline")],style:D.value},[(T=s.default)==null?void 0:T.call(s)]),[[e.vShow,x.value]])}})]);return e.h("li",{class:[E.b(),E.is("active",P.value),E.is("opened",x.value),E.is("disabled",t.disabled)],role:"menuitem",ariaHaspopup:!0,ariaExpanded:x.value,onMouseenter:h,onMouseleave:()=>g(),onFocus:h},[M])}}});const ye=l.buildProps({mode:{type:String,values:["horizontal","vertical"],default:"vertical"},defaultActive:{type:String,default:""},defaultOpeneds:{type:l.definePropType(Array),default:()=>ae.mutable([])},uniqueOpened:Boolean,router:Boolean,menuTrigger:{type:String,values:["hover","click"],default:"hover"},collapse:Boolean,backgroundColor:String,textColor:String,activeTextColor:String,closeOnClickOutside:Boolean,collapseTransition:{type:Boolean,default:!0},ellipsis:{type:Boolean,default:!0},popperOffset:{type:Number,default:6},ellipsisIcon:{type:V.iconPropType,default:()=>H.more_default},popperEffect:{type:l.definePropType(String),default:"dark"},popperClass:String,showTimeout:{type:Number,default:300},hideTimeout:{type:Number,default:300}}),Z=t=>l.isArray(t)&&t.every(s=>l.isString(s)),Ee={close:(t,s)=>l.isString(t)&&Z(s),open:(t,s)=>l.isString(t)&&Z(s),select:(t,s,o,d)=>l.isString(t)&&Z(s)&&l.isObject(o)&&(d===void 0||d instanceof Promise)};var Ce=e.defineComponent({name:"ElMenu",props:ye,emits:Ee,setup(t,{emit:s,slots:o,expose:d}){const n=e.getCurrentInstance(),C=n.appContext.config.globalProperties.$router,v=e.ref(),E=l.useNamespace("menu"),i=l.useNamespace("sub-menu"),m=e.ref(-1),f=e.ref(t.defaultOpeneds&&!t.collapse?t.defaultOpeneds.slice(0):[]),b=e.ref(t.defaultActive),I=e.ref({}),S=e.ref({}),W=e.computed(()=>t.mode==="horizontal"||t.mode==="vertical"&&t.collapse),q=()=>{const a=b.value&&I.value[b.value];if(!a||t.mode==="horizontal"||t.collapse)return;a.indexPath.forEach(c=>{const h=S.value[c];h&&N(c,h.indexPath)})},N=(a,u)=>{f.value.includes(a)||(t.uniqueOpened&&(f.value=f.value.filter(c=>u.includes(c))),f.value.push(a),s("open",a,u))},O=a=>{const u=f.value.indexOf(a);u!==-1&&f.value.splice(u,1)},w=(a,u)=>{O(a),s("close",a,u)},z=({index:a,indexPath:u})=>{f.value.includes(a)?w(a,u):N(a,u)},F=a=>{(t.mode==="horizontal"||t.collapse)&&(f.value=[]);const{index:u,indexPath:c}=a;if(!(l.isNil(u)||l.isNil(c)))if(t.router&&C){const h=a.route||u,g=C.push(h).then(r=>(r||(b.value=u),r));s("select",u,c,{index:u,indexPath:c,route:h},g)}else b.value=u,s("select",u,c,{index:u,indexPath:c})},R=a=>{const u=I.value,c=u[a]||b.value&&u[b.value]||u[t.defaultActive];c?b.value=c.index:b.value=a},x=a=>{const u=getComputedStyle(a),c=Number.parseInt(u.marginLeft,10),h=Number.parseInt(u.marginRight,10);return a.offsetWidth+c+h||0},P=()=>{var a,u;if(!v.value)return-1;const c=Array.from((u=(a=v.value)==null?void 0:a.childNodes)!=null?u:[]).filter(A=>A.nodeName!=="#text"||A.nodeValue),h=64,g=getComputedStyle(v.value),r=Number.parseInt(g.paddingLeft,10),p=Number.parseInt(g.paddingRight,10),M=v.value.clientWidth-r-p;let T=0,k=0;return c.forEach((A,ne)=>{A.nodeName!=="#comment"&&(T+=x(A),T<=M-h&&(k=ne+1))}),k===c.length?-1:k},_=a=>S.value[a].indexPath,$=(a,u=33.34)=>{let c;return()=>{c&&clearTimeout(c),c=setTimeout(()=>{a()},u)}};let D=!0;const L=()=>{if(m.value===P())return;const a=()=>{m.value=-1,e.nextTick(()=>{m.value=P()})};D?a():$(a)(),D=!1};e.watch(()=>t.defaultActive,a=>{I.value[a]||(b.value=""),R(a)}),e.watch(()=>t.collapse,a=>{a&&(f.value=[])}),e.watch(I.value,q);let B;e.watchEffect(()=>{t.mode==="horizontal"&&t.ellipsis?B=oe.useResizeObserver(v,L).stop:B==null||B()});const j=e.ref(!1);{const a=g=>{S.value[g.index]=g},u=g=>{delete S.value[g.index]},c=g=>{I.value[g.index]=g},h=g=>{delete I.value[g.index]};e.provide("rootMenu",e.reactive({props:t,openedMenus:f,items:I,subMenus:S,activeIndex:b,isMenuPopup:W,addMenuItem:c,removeMenuItem:h,addSubMenu:a,removeSubMenu:u,openMenu:N,closeMenu:w,handleMenuItemClick:F,handleSubMenuClick:z})),e.provide(`subMenu:${n.uid}`,{addSubMenu:a,removeSubMenu:u,mouseInChild:j,level:0})}e.onMounted(()=>{t.mode==="horizontal"&&new ve(n.vnode.el,E.namespace.value)}),d({open:u=>{const{indexPath:c}=S.value[u];c.forEach(h=>N(h,c))},close:O,handleResize:L});const G=Y(t,0);return()=>{var a,u;let c=(u=(a=o.default)==null?void 0:a.call(o))!=null?u:[];const h=[];if(t.mode==="horizontal"&&v.value){const p=ue.flattedChildren(c),M=m.value===-1?p:p.slice(0,m.value),T=m.value===-1?[]:p.slice(m.value);T!=null&&T.length&&t.ellipsis&&(c=M,h.push(e.h(K,{index:"sub-menu-more",class:i.e("hide-arrow"),popperOffset:t.popperOffset},{title:()=>e.h(H.ElIcon,{class:i.e("icon-more")},{default:()=>e.h(t.ellipsisIcon)}),default:()=>T})))}const g=t.closeOnClickOutside?[[le.ClickOutside,()=>{f.value.length&&(j.value||(f.value.forEach(p=>s("close",p,_(p))),f.value=[]))}]]:[],r=e.withDirectives(e.h("ul",{key:String(t.collapse),role:"menubar",ref:v,style:G.value,class:{[E.b()]:!0,[E.m(t.mode)]:!0,[E.m("collapse")]:t.collapse}},[...c,...h]),g);return t.collapseTransition&&t.mode==="vertical"?e.h(ge,()=>r):r}}});const Ie=l.buildProps({index:{type:l.definePropType([String,null]),default:null},route:{type:l.definePropType([String,Object])},disabled:Boolean}),Te={click:t=>l.isString(t.index)&&l.isArray(t.indexPath)},J="ElMenuItem",xe=e.defineComponent({name:J,components:{ElTooltip:Q.ElTooltip},props:Ie,emits:Te,setup(t,{emit:s}){const o=e.getCurrentInstance(),d=e.inject("rootMenu"),n=l.useNamespace("menu"),C=l.useNamespace("menu-item");d||l.throwError(J,"can not inject root menu");const{parentMenu:v,indexPath:E}=X(o,e.toRef(t,"index")),i=e.inject(`subMenu:${v.value.uid}`);i||l.throwError(J,"can not inject sub menu");const m=e.computed(()=>t.index===d.activeIndex),f=e.reactive({index:t.index,indexPath:E,active:m}),b=()=>{t.disabled||(d.handleMenuItemClick({index:t.index,indexPath:E.value,route:t.route}),s("click",f))};return e.onMounted(()=>{i.addSubMenu(f),d.addMenuItem(f)}),e.onBeforeUnmount(()=>{i.removeSubMenu(f),d.removeMenuItem(f)}),{parentMenu:v,rootMenu:d,active:m,nsMenu:n,nsMenuItem:C,handleClick:b}}});function Se(t,s,o,d,n,C){const v=e.resolveComponent("el-tooltip");return e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass([t.nsMenuItem.b(),t.nsMenuItem.is("active",t.active),t.nsMenuItem.is("disabled",t.disabled)]),role:"menuitem",tabindex:"-1",onClick:t.handleClick},[t.parentMenu.type.name==="ElMenu"&&t.rootMenu.props.collapse&&t.$slots.title?(e.openBlock(),e.createBlock(v,{key:0,effect:t.rootMenu.props.popperEffect,placement:"right","fallback-placements":["left"],persistent:""},{content:e.withCtx(()=>[e.renderSlot(t.$slots,"title")]),default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(t.nsMenu.be("tooltip","trigger"))},[e.renderSlot(t.$slots,"default")],2)]),_:3},8,["effect"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.renderSlot(t.$slots,"default"),e.renderSlot(t.$slots,"title")],64))],10,["onClick"])}var ee=l._export_sfc(xe,[["render",Se],["__file","menu-item.vue"]]);const Ne={title:String},we="ElMenuItemGroup",_e=e.defineComponent({name:we,props:Ne,setup(){return{ns:l.useNamespace("menu-item-group")}}});function ke(t,s,o,d,n,C){return e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(t.ns.b())},[e.createElementVNode("div",{class:e.normalizeClass(t.ns.e("title"))},[t.$slots.title?e.renderSlot(t.$slots,"title",{key:1}):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(t.title),1)],64))],2),e.createElementVNode("ul",null,[e.renderSlot(t.$slots,"default")])],2)}var te=l._export_sfc(_e,[["render",ke],["__file","menu-item-group.vue"]]);const Oe=l.withInstall(Ce,{MenuItem:ee,MenuItemGroup:te,SubMenu:K}),Pe=l.withNoopInstall(ee);l.withNoopInstall(te);l.withNoopInstall(K);exports.ElMenu=Oe;exports.ElMenuItem=Pe;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as z, openBlock as B, createBlock as ve, Transition as Ee, mergeProps as Te, unref as He, toHandlers as Le, withCtx as Q, renderSlot as $, computed as h, getCurrentInstance as fe, inject as X, ref as E, reactive as he, watch as J, provide as me, onMounted as be, onBeforeUnmount as Se, h as b, Fragment as ge, withDirectives as we, vShow as We, watchEffect as Re, nextTick as
|
|
2
|
-
import {
|
|
3
|
-
import { a as Ue, b as Ze, E as ke, m as Je } from "./index-
|
|
4
|
-
import { E as T, t as K } from "./index-
|
|
5
|
-
import { u as w, _ as oe, w as $e,
|
|
6
|
-
import { E as _e } from "./el-popper-
|
|
1
|
+
import { defineComponent as z, openBlock as B, createBlock as ve, Transition as Ee, mergeProps as Te, unref as He, toHandlers as Le, withCtx as Q, renderSlot as $, computed as h, getCurrentInstance as fe, inject as X, ref as E, reactive as he, watch as J, provide as me, onMounted as be, onBeforeUnmount as Se, h as b, Fragment as ge, withDirectives as we, vShow as We, watchEffect as Re, nextTick as je, toRef as De, resolveComponent as Fe, createElementBlock as Y, normalizeClass as ee, createElementVNode as pe, createTextVNode as qe, toDisplayString as Ve } from "vue";
|
|
2
|
+
import { u as Ge } from "./el-scrollbar-bcf29780.js";
|
|
3
|
+
import { a as Ue, b as Ze, E as ke, m as Je } from "./index-3425f2f0.js";
|
|
4
|
+
import { E as T, t as K } from "./index-21fb27eb.js";
|
|
5
|
+
import { u as w, _ as oe, w as $e, g as Z, r as ie, j as Ke, k as Me, t as te, a as R, l as Ce, m as ne, c as Qe, n as xe, o as Oe, p as ye } from "./base-4bcd2756.js";
|
|
6
|
+
import { E as _e } from "./el-popper-85365d5b.js";
|
|
7
7
|
import { T as Xe } from "./index-657047bb.js";
|
|
8
|
-
import { i as
|
|
9
|
-
import { C as Ye } from "./el-tag-
|
|
8
|
+
import { i as q } from "./use-form-common-props-54c31983.js";
|
|
9
|
+
import { C as Ye } from "./el-tag-6036f51c.js";
|
|
10
10
|
import { m as et } from "./typescript-7ae59c4c.js";
|
|
11
|
-
import { f as tt } from "./vnode-
|
|
11
|
+
import { f as tt } from "./vnode-dfc92f20.js";
|
|
12
12
|
const nt = z({
|
|
13
13
|
name: "ElCollapseTransition"
|
|
14
14
|
}), ot = /* @__PURE__ */ z({
|
|
@@ -222,16 +222,16 @@ const Ne = (e, o) => {
|
|
|
222
222
|
},
|
|
223
223
|
popperOffset: Number,
|
|
224
224
|
expandCloseIcon: {
|
|
225
|
-
type:
|
|
225
|
+
type: q
|
|
226
226
|
},
|
|
227
227
|
expandOpenIcon: {
|
|
228
|
-
type:
|
|
228
|
+
type: q
|
|
229
229
|
},
|
|
230
230
|
collapseCloseIcon: {
|
|
231
|
-
type:
|
|
231
|
+
type: q
|
|
232
232
|
},
|
|
233
233
|
collapseOpenIcon: {
|
|
234
|
-
type:
|
|
234
|
+
type: q
|
|
235
235
|
}
|
|
236
236
|
}), re = "ElSubMenu";
|
|
237
237
|
var Ie = z({
|
|
@@ -244,7 +244,7 @@ var Ie = z({
|
|
|
244
244
|
d || te(re, "can not inject sub menu");
|
|
245
245
|
const p = E({}), g = E({});
|
|
246
246
|
let C;
|
|
247
|
-
const k = E(!1), ae = E(), V = E(null), O = h(() => P.value === "horizontal" && _.value ? "bottom-start" : "right-start"), A = h(() => P.value === "horizontal" && _.value || P.value === "vertical" && !u.props.collapse ? e.expandCloseIcon && e.expandOpenIcon ? S.value ? e.expandOpenIcon : e.expandCloseIcon : Ue : e.collapseCloseIcon && e.collapseOpenIcon ? S.value ? e.collapseOpenIcon : e.collapseCloseIcon : Ze), _ = h(() => d.level === 0),
|
|
247
|
+
const k = E(!1), ae = E(), V = E(null), O = h(() => P.value === "horizontal" && _.value ? "bottom-start" : "right-start"), A = h(() => P.value === "horizontal" && _.value || P.value === "vertical" && !u.props.collapse ? e.expandCloseIcon && e.expandOpenIcon ? S.value ? e.expandOpenIcon : e.expandCloseIcon : Ue : e.collapseCloseIcon && e.collapseOpenIcon ? S.value ? e.collapseOpenIcon : e.collapseCloseIcon : Ze), _ = h(() => d.level === 0), j = h(() => {
|
|
248
248
|
const l = e.teleported;
|
|
249
249
|
return l === void 0 ? _.value : l;
|
|
250
250
|
}), se = h(() => u.props.collapse ? `${m.namespace.value}-zoom-in-left` : `${m.namespace.value}-zoom-in-top`), le = h(() => P.value === "horizontal" && _.value ? [
|
|
@@ -274,7 +274,7 @@ var Ie = z({
|
|
|
274
274
|
index: e.index,
|
|
275
275
|
indexPath: t,
|
|
276
276
|
active: H
|
|
277
|
-
}),
|
|
277
|
+
}), D = Ne(u.props, d.level + 1), G = h(() => {
|
|
278
278
|
var l;
|
|
279
279
|
return (l = e.popperOffset) != null ? l : u.props.popperOffset;
|
|
280
280
|
}), W = h(() => {
|
|
@@ -306,7 +306,7 @@ var Ie = z({
|
|
|
306
306
|
}
|
|
307
307
|
d.mouseInChild.value = !0, C == null || C(), { stop: C } = Ce(() => {
|
|
308
308
|
u.openMenu(e.index, t.value);
|
|
309
|
-
}, c),
|
|
309
|
+
}, c), j.value && ((M = I.value.vnode.el) == null || M.dispatchEvent(new MouseEvent("mouseenter")));
|
|
310
310
|
}
|
|
311
311
|
}, f = (l = !1) => {
|
|
312
312
|
var c;
|
|
@@ -314,7 +314,7 @@ var Ie = z({
|
|
|
314
314
|
d.mouseInChild.value = !1;
|
|
315
315
|
return;
|
|
316
316
|
}
|
|
317
|
-
C == null || C(), d.mouseInChild.value = !1, { stop: C } = Ce(() => !k.value && u.closeMenu(e.index, t.value), ue.value),
|
|
317
|
+
C == null || C(), d.mouseInChild.value = !1, { stop: C } = Ce(() => !k.value && u.closeMenu(e.index, t.value), ue.value), j.value && l && ((c = d.handleMouseleave) == null || c.call(d, !0));
|
|
318
318
|
};
|
|
319
319
|
J(() => u.props.collapse, (l) => s(!!l));
|
|
320
320
|
{
|
|
@@ -359,7 +359,7 @@ var Ie = z({
|
|
|
359
359
|
persistent: !0,
|
|
360
360
|
popperClass: W.value,
|
|
361
361
|
placement: O.value,
|
|
362
|
-
teleported:
|
|
362
|
+
teleported: j.value,
|
|
363
363
|
fallbackPlacements: le.value,
|
|
364
364
|
transition: se.value,
|
|
365
365
|
gpuAcceleration: !1
|
|
@@ -382,7 +382,7 @@ var Ie = z({
|
|
|
382
382
|
m.m("popup"),
|
|
383
383
|
m.m(`popup-${O.value}`)
|
|
384
384
|
],
|
|
385
|
-
style:
|
|
385
|
+
style: D.value
|
|
386
386
|
}, [(x = o.default) == null ? void 0 : x.call(o)])
|
|
387
387
|
]);
|
|
388
388
|
},
|
|
@@ -402,7 +402,7 @@ var Ie = z({
|
|
|
402
402
|
return we(b("ul", {
|
|
403
403
|
role: "menu",
|
|
404
404
|
class: [m.b(), m.m("inline")],
|
|
405
|
-
style:
|
|
405
|
+
style: D.value
|
|
406
406
|
}, [(x = o.default) == null ? void 0 : x.call(o)]), [[We, S.value]]);
|
|
407
407
|
}
|
|
408
408
|
})
|
|
@@ -463,7 +463,7 @@ const vt = Me({
|
|
|
463
463
|
default: 6
|
|
464
464
|
},
|
|
465
465
|
ellipsisIcon: {
|
|
466
|
-
type:
|
|
466
|
+
type: q,
|
|
467
467
|
default: () => Je
|
|
468
468
|
},
|
|
469
469
|
popperEffect: {
|
|
@@ -504,7 +504,7 @@ var ht = z({
|
|
|
504
504
|
s !== -1 && p.value.splice(s, 1);
|
|
505
505
|
}, _ = (a, s) => {
|
|
506
506
|
A(a), o("close", a, s);
|
|
507
|
-
},
|
|
507
|
+
}, j = ({
|
|
508
508
|
index: a,
|
|
509
509
|
indexPath: s
|
|
510
510
|
}) => {
|
|
@@ -528,10 +528,10 @@ var ht = z({
|
|
|
528
528
|
var a, s;
|
|
529
529
|
if (!m.value)
|
|
530
530
|
return -1;
|
|
531
|
-
const i = Array.from((s = (a = m.value) == null ? void 0 : a.childNodes) != null ? s : []).filter((
|
|
531
|
+
const i = Array.from((s = (a = m.value) == null ? void 0 : a.childNodes) != null ? s : []).filter((F) => F.nodeName !== "#text" || F.nodeValue), v = 64, f = getComputedStyle(m.value), l = Number.parseInt(f.paddingLeft, 10), c = Number.parseInt(f.paddingRight, 10), M = m.value.clientWidth - l - c;
|
|
532
532
|
let x = 0, N = 0;
|
|
533
|
-
return i.forEach((
|
|
534
|
-
|
|
533
|
+
return i.forEach((F, Ae) => {
|
|
534
|
+
F.nodeName !== "#comment" && (x += S(F), x <= M - v && (N = Ae + 1));
|
|
535
535
|
}), N === i.length ? -1 : N;
|
|
536
536
|
}, P = (a) => k.value[a].indexPath, L = (a, s = 33.34) => {
|
|
537
537
|
let i;
|
|
@@ -541,16 +541,16 @@ var ht = z({
|
|
|
541
541
|
}, s);
|
|
542
542
|
};
|
|
543
543
|
};
|
|
544
|
-
let
|
|
544
|
+
let D = !0;
|
|
545
545
|
const G = () => {
|
|
546
546
|
if (d.value === H())
|
|
547
547
|
return;
|
|
548
548
|
const a = () => {
|
|
549
|
-
d.value = -1,
|
|
549
|
+
d.value = -1, je(() => {
|
|
550
550
|
d.value = H();
|
|
551
551
|
});
|
|
552
552
|
};
|
|
553
|
-
|
|
553
|
+
D ? a() : L(a)(), D = !1;
|
|
554
554
|
};
|
|
555
555
|
J(() => e.defaultActive, (a) => {
|
|
556
556
|
C.value[a] || (g.value = ""), le(a);
|
|
@@ -586,7 +586,7 @@ var ht = z({
|
|
|
586
586
|
openMenu: O,
|
|
587
587
|
closeMenu: _,
|
|
588
588
|
handleMenuItemClick: se,
|
|
589
|
-
handleSubMenuClick:
|
|
589
|
+
handleSubMenuClick: j
|
|
590
590
|
})), me(`subMenu:${t.uid}`, {
|
|
591
591
|
addSubMenu: a,
|
|
592
592
|
removeSubMenu: s,
|
|
@@ -667,7 +667,7 @@ const bt = Me({
|
|
|
667
667
|
setup(e, { emit: o }) {
|
|
668
668
|
const n = fe(), r = X("rootMenu"), t = w("menu"), I = w("menu-item");
|
|
669
669
|
r || te(de, "can not inject root menu");
|
|
670
|
-
const { parentMenu: m, indexPath: y } = Pe(n,
|
|
670
|
+
const { parentMenu: m, indexPath: y } = Pe(n, De(e, "index")), u = X(`subMenu:${m.value.uid}`);
|
|
671
671
|
u || te(de, "can not inject sub menu");
|
|
672
672
|
const d = h(() => e.index === r.activeIndex), p = he({
|
|
673
673
|
index: e.index,
|
|
@@ -695,7 +695,7 @@ const bt = Me({
|
|
|
695
695
|
}
|
|
696
696
|
});
|
|
697
697
|
function yt(e, o, n, r, t, I) {
|
|
698
|
-
const m =
|
|
698
|
+
const m = Fe("el-tooltip");
|
|
699
699
|
return B(), Y("li", {
|
|
700
700
|
class: ee([
|
|
701
701
|
e.nsMenuItem.b(),
|
|
@@ -750,7 +750,7 @@ function Et(e, o, n, r, t, I) {
|
|
|
750
750
|
class: ee(e.ns.e("title"))
|
|
751
751
|
}, [
|
|
752
752
|
e.$slots.title ? $(e.$slots, "title", { key: 1 }) : (B(), Y(ge, { key: 0 }, [
|
|
753
|
-
|
|
753
|
+
qe(Ve(e.title), 1)
|
|
754
754
|
], 64))
|
|
755
755
|
], 2),
|
|
756
756
|
pe("ul", null, [
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),k=require("./el-scrollbar-8bf765f2.cjs"),o=require("./base-bdc10baa.cjs"),w=require("./index-19fa1fcf.cjs"),b=require("./use-form-common-props-592797e2.cjs"),_=require("./typescript-b63f8e83.cjs"),D=require("./use-global-config-584b62f1.cjs"),O=require("./index-d94bae37.cjs"),p=require("./config-provider-ec6b09df.cjs"),P=o.buildProps({value:{type:[String,Number],default:""},max:{type:Number,default:99},isDot:Boolean,hidden:Boolean,type:{type:String,values:["primary","success","warning","info","danger"],default:"danger"},showZero:{type:Boolean,default:!0},color:String,badgeStyle:{type:o.definePropType([String,Object,Array])},offset:{type:o.definePropType(Array),default:[0,0]},badgeClass:{type:String}}),q=e.defineComponent({name:"ElBadge"}),F=e.defineComponent({...q,props:P,setup(s,{expose:t}){const n=s,a=o.useNamespace("badge"),r=e.computed(()=>n.isDot?"":o.isNumber(n.value)&&o.isNumber(n.max)?n.max<n.value?`${n.max}+`:`${n.value}`:`${n.value}`),f=e.computed(()=>{var l,c,m,g,y;return[{backgroundColor:n.color,marginRight:o.addUnit(-((c=(l=n.offset)==null?void 0:l[0])!=null?c:0)),marginTop:o.addUnit((g=(m=n.offset)==null?void 0:m[1])!=null?g:0)},(y=n.badgeStyle)!=null?y:{}]});return t({content:r}),(l,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(a).b())},[e.renderSlot(l.$slots,"default"),e.createVNode(e.Transition,{name:`${e.unref(a).namespace.value}-zoom-in-center`,persisted:""},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("sup",{class:e.normalizeClass([e.unref(a).e("content"),e.unref(a).em("content",l.type),e.unref(a).is("fixed",!!l.$slots.default),e.unref(a).is("dot",l.isDot),e.unref(a).is("hide-zero",!l.showZero&&n.value===0),l.badgeClass]),style:e.normalizeStyle(e.unref(f))},[e.renderSlot(l.$slots,"content",{value:e.unref(r)},()=>[e.createTextVNode(e.toDisplayString(e.unref(r)),1)])],6),[[e.vShow,!l.hidden&&(e.unref(r)||l.isDot||l.$slots.content)]])]),_:3},8,["name"])],2))}});var H=o._export_sfc(F,[["__file","badge.vue"]]);const A=o.withInstall(H),E=["success","info","warning","error"],u=_.mutable({customClass:"",center:!1,dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",plain:!1,offset:16,zIndex:0,grouping:!1,repeatNum:1,appendTo:o.isClient?document.body:void 0}),R=o.buildProps({customClass:{type:String,default:u.customClass},center:{type:Boolean,default:u.center},dangerouslyUseHTMLString:{type:Boolean,default:u.dangerouslyUseHTMLString},duration:{type:Number,default:u.duration},icon:{type:b.iconPropType,default:u.icon},id:{type:String,default:u.id},message:{type:o.definePropType([String,Object,Function]),default:u.message},onClose:{type:o.definePropType(Function),default:u.onClose},showClose:{type:Boolean,default:u.showClose},type:{type:String,values:E,default:u.type},plain:{type:Boolean,default:u.plain},offset:{type:Number,default:u.offset},zIndex:{type:Number,default:u.zIndex},grouping:{type:Boolean,default:u.grouping},repeatNum:{type:Number,default:u.repeatNum}}),U={destroy:()=>!0},d=e.shallowReactive([]),Z=s=>{const t=d.findIndex(r=>r.id===s),n=d[t];let a;return t>0&&(a=d[t-1]),{current:n,prev:a}},j=s=>{const{prev:t}=Z(s);return t?t.vm.exposed.bottom.value:0},G=(s,t)=>d.findIndex(a=>a.id===s)>0?16:t,W=e.defineComponent({name:"ElMessage"}),J=e.defineComponent({...W,props:R,emits:U,setup(s,{expose:t}){const n=s,{Close:a}=b.TypeComponents,{ns:r,zIndex:f}=D.useGlobalComponentSettings("message"),{currentZIndex:l,nextZIndex:c}=f,m=e.ref(),g=e.ref(!1),y=e.ref(0);let h;const M=e.computed(()=>n.type?n.type==="error"?"danger":n.type:"info"),$=e.computed(()=>{const i=n.type;return{[r.bm("icon",i)]:i&&b.TypeComponentsMap[i]}}),T=e.computed(()=>n.icon||b.TypeComponentsMap[n.type]||""),I=e.computed(()=>j(n.id)),N=e.computed(()=>G(n.id,n.offset)+I.value),V=e.computed(()=>y.value+N.value),x=e.computed(()=>({top:`${N.value}px`,zIndex:l.value}));function B(){n.duration!==0&&({stop:h}=o.useTimeoutFn(()=>{v()},n.duration))}function S(){h==null||h()}function v(){g.value=!1}function L({code:i}){i===O.EVENT_CODE.esc&&v()}return e.onMounted(()=>{B(),c(),g.value=!0}),e.watch(()=>n.repeatNum,()=>{S(),B()}),k.useEventListener(document,"keydown",L),k.useResizeObserver(m,()=>{y.value=m.value.getBoundingClientRect().height}),t({visible:g,bottom:V,close:v}),(i,oe)=>(e.openBlock(),e.createBlock(e.Transition,{name:e.unref(r).b("fade"),onBeforeLeave:i.onClose,onAfterLeave:se=>i.$emit("destroy"),persisted:""},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{id:i.id,ref_key:"messageRef",ref:m,class:e.normalizeClass([e.unref(r).b(),{[e.unref(r).m(i.type)]:i.type},e.unref(r).is("center",i.center),e.unref(r).is("closable",i.showClose),e.unref(r).is("plain",i.plain),i.customClass]),style:e.normalizeStyle(e.unref(x)),role:"alert",onMouseenter:S,onMouseleave:B},[i.repeatNum>1?(e.openBlock(),e.createBlock(e.unref(A),{key:0,value:i.repeatNum,type:e.unref(M),class:e.normalizeClass(e.unref(r).e("badge"))},null,8,["value","type","class"])):e.createCommentVNode("v-if",!0),e.unref(T)?(e.openBlock(),e.createBlock(e.unref(w.ElIcon),{key:1,class:e.normalizeClass([e.unref(r).e("icon"),e.unref($)])},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(T))))]),_:1},8,["class"])):e.createCommentVNode("v-if",!0),e.renderSlot(i.$slots,"default",{},()=>[i.dangerouslyUseHTMLString?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),e.createElementVNode("p",{class:e.normalizeClass(e.unref(r).e("content")),innerHTML:i.message},null,10,["innerHTML"])],2112)):(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass(e.unref(r).e("content"))},e.toDisplayString(i.message),3))]),i.showClose?(e.openBlock(),e.createBlock(e.unref(w.ElIcon),{key:2,class:e.normalizeClass(e.unref(r).e("closeBtn")),onClick:e.withModifiers(v,["stop"])},{default:e.withCtx(()=>[e.createVNode(e.unref(a))]),_:1},8,["class","onClick"])):e.createCommentVNode("v-if",!0)],46,["id"]),[[e.vShow,g.value]])]),_:3},8,["name","onBeforeLeave","onAfterLeave"]))}});var K=o._export_sfc(J,[["__file","message.vue"]]);let Q=1;const z=s=>{const t=!s||o.isString(s)||e.isVNode(s)||o.isFunction(s)?{message:s}:s,n={...u,...t};if(!n.appendTo)n.appendTo=document.body;else if(o.isString(n.appendTo)){let a=document.querySelector(n.appendTo);o.isElement(a)||(o.debugWarn("ElMessage","the appendTo option is not an HTMLElement. Falling back to document.body."),a=document.body),n.appendTo=a}return o.isBoolean(p.messageConfig.grouping)&&!n.grouping&&(n.grouping=p.messageConfig.grouping),o.isNumber(p.messageConfig.duration)&&n.duration===3e3&&(n.duration=p.messageConfig.duration),o.isNumber(p.messageConfig.offset)&&n.offset===16&&(n.offset=p.messageConfig.offset),o.isBoolean(p.messageConfig.showClose)&&!n.showClose&&(n.showClose=p.messageConfig.showClose),n},X=s=>{const t=d.indexOf(s);if(t===-1)return;d.splice(t,1);const{handler:n}=s;n.close()},Y=({appendTo:s,...t},n)=>{const a=`message_${Q++}`,r=t.onClose,f=document.createElement("div"),l={...t,id:a,onClose:()=>{r==null||r(),X(y)},onDestroy:()=>{e.render(null,f)}},c=e.createVNode(K,l,o.isFunction(l.message)||e.isVNode(l.message)?{default:o.isFunction(l.message)?l.message:()=>l.message}:null);c.appContext=n||C._context,e.render(c,f),s.appendChild(f.firstElementChild);const m=c.component,y={id:a,vnode:c,vm:m,handler:{close:()=>{m.exposed.visible.value=!1}},props:c.component.props};return y},C=(s={},t)=>{if(!o.isClient)return{close:()=>{}};const n=z(s);if(n.grouping&&d.length){const r=d.find(({vnode:f})=>{var l;return((l=f.props)==null?void 0:l.message)===n.message});if(r)return r.props.repeatNum+=1,r.props.type=n.type,r.handler}if(o.isNumber(p.messageConfig.max)&&d.length>=p.messageConfig.max)return{close:()=>{}};const a=Y(n,t);return d.push(a),a.handler};E.forEach(s=>{C[s]=(t={},n)=>{const a=z(t);return C({...a,type:s},n)}});function ee(s){for(const t of d)(!s||s===t.props.type)&&t.handler.close()}C.closeAll=ee;C._context=null;const ne=o.withInstallFunction(C,"$message");exports.ElMessage=ne;
|