st-comp 0.0.208 → 0.0.209
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/es/ChartLayout.cjs +1 -1
- package/es/ChartLayout.js +74 -1
- package/es/CustomFunction.cjs +1 -1
- package/es/CustomFunction.js +56 -53
- package/es/FactorWarning.cjs +1 -1
- package/es/FactorWarning.js +48 -45
- package/es/HeatMap.cjs +1 -1
- package/es/HeatMap.js +118 -1
- package/es/Kline.cjs +1 -1
- package/es/Kline.js +90 -87
- package/es/KlineBasic.cjs +1 -1
- package/es/KlineBasic.js +28 -25
- package/es/KlineConfig.cjs +1 -1
- package/es/KlineConfig.js +164 -161
- package/es/KlineNew.cjs +1 -1
- package/es/KlineNew.js +114 -111
- package/es/KlinePlus.cjs +2 -2
- package/es/KlinePlus.js +183 -180
- package/es/Pagination.cjs +1 -1
- package/es/Pagination.js +143 -140
- package/es/PasswordPrompt.cjs +1 -1
- package/es/PasswordPrompt.js +3 -2
- package/es/Table.cjs +1 -1
- package/es/Table.js +58 -55
- package/es/User.cjs +1 -1
- package/es/User.js +88 -85
- package/es/VarSelectDialog.cjs +2 -2
- package/es/VarSelectDialog.js +56 -53
- package/es/VarietyAutoComplete.cjs +1 -1
- package/es/VarietyAutoComplete.js +17 -15
- package/es/VarietySearch.cjs +10 -10
- package/es/VarietySearch.js +56 -53
- package/es/VarietyTextCopy.cjs +3 -3
- package/es/VarietyTextCopy.js +34 -31
- package/es/VirtualTable.cjs +1 -1
- package/es/VirtualTable.js +106 -103
- package/es/_initCloneObject-52b6a510.cjs +1 -0
- package/es/{_initCloneObject-c477c74d.js → _initCloneObject-eaef9418.js} +26 -25
- package/es/base-a5af3db3.js +288 -0
- package/es/base-ef747d02.cjs +5 -0
- package/es/castArray-35947698.cjs +1 -0
- package/es/{castArray-1eb17278.js → castArray-7741a212.js} +1 -1
- package/es/{config-provider-18c0a68a.cjs → config-provider-a584d81e.cjs} +1 -1
- package/es/{config-provider-49c17381.js → config-provider-b16efd62.js} +6 -6
- package/es/debounce-62f5b6e8.cjs +1 -0
- package/es/{debounce-33406a0d.js → debounce-8d53f4dd.js} +9 -9
- package/es/{dropdown-3f1fe325.cjs → dropdown-071c5d7e.cjs} +1 -1
- package/es/{dropdown-6e7b1df0.js → dropdown-a59bba73.js} +15 -15
- package/es/el-autocomplete-a07e9439.cjs +1 -0
- package/es/{el-autocomplete-87b7f461.js → el-autocomplete-ba808eb6.js} +53 -51
- package/es/{el-button-56624e61.js → el-button-c95adb85.js} +46 -45
- package/es/el-button-eec58cff.cjs +1 -0
- package/es/{el-checkbox-f13560e9.js → el-checkbox-7421ccd3.js} +40 -40
- package/es/{el-checkbox-09f3b57f.cjs → el-checkbox-c25236a6.cjs} +1 -1
- package/es/{el-dialog-1d5f5877.js → el-dialog-41ab8417.js} +10 -9
- package/es/el-dialog-ae86edb8.cjs +1 -0
- package/es/{el-divider-8a4c87e3.cjs → el-divider-4713d74c.cjs} +1 -1
- package/es/{el-divider-1cda1783.js → el-divider-4e059794.js} +1 -1
- package/es/el-empty-1697ded8.cjs +1 -0
- package/es/{el-empty-04682b5d.js → el-empty-33cb66f1.js} +3 -3
- package/es/el-form-item-c3fe189b.cjs +12 -0
- package/es/{el-form-item-505c0b70.js → el-form-item-c53c374d.js} +76 -75
- package/es/{el-input-262851e8.js → el-input-2f75c4ba.js} +85 -84
- package/es/el-input-7fd293af.cjs +1 -0
- package/es/el-input-number-22e21d16.cjs +1 -0
- package/es/{el-input-number-fdac2b86.js → el-input-number-5193fe6d.js} +83 -82
- package/es/{el-loading-3cf7b796.cjs → el-loading-cfd86c15.cjs} +1 -1
- package/es/{el-loading-7440dc64.js → el-loading-f6022062.js} +2 -2
- package/es/el-menu-item-17dc717e.cjs +1 -0
- package/es/{el-menu-item-36c3004c.js → el-menu-item-7e881203.js} +54 -53
- package/es/el-message-5e6a6be9.cjs +1 -0
- package/es/{el-message-box-8f5e34ca.js → el-message-box-a93d2f6a.js} +22 -20
- package/es/el-message-box-c10adb52.cjs +1 -0
- package/es/{el-message-416bd265.js → el-message-e544a8f5.js} +29 -28
- package/es/{el-overlay-04426e36.js → el-overlay-09ad71cd.js} +53 -52
- package/es/el-overlay-9e34965f.cjs +1 -0
- package/es/el-popconfirm-70a976bf.cjs +1 -0
- package/es/{el-popconfirm-3790cda2.js → el-popconfirm-81dcd202.js} +39 -38
- package/es/{el-popper-49152708.js → el-popper-b4f97157.js} +192 -191
- package/es/el-popper-b6c99b28.cjs +1 -0
- package/es/{el-segmented-05509f9d.js → el-segmented-b868d074.js} +13 -12
- package/es/el-segmented-f8fce9ac.cjs +1 -0
- package/es/{el-select-700f3686.js → el-select-95627997.js} +295 -292
- package/es/el-select-d8d91db1.cjs +1 -0
- package/es/{el-table-column-44360700.js → el-table-column-376cd907.js} +57 -54
- package/es/el-table-column-c974cb96.cjs +14 -0
- package/es/{el-tag-55a172c9.js → el-tag-66cab138.js} +31 -30
- package/es/el-tag-a33c4b22.cjs +1 -0
- package/es/{el-text-ab6bfc40.js → el-text-ac60d0f2.js} +4 -4
- package/es/{el-text-5bcaffb6.cjs → el-text-c20a9f48.cjs} +1 -1
- package/es/index-098c2447.cjs +1 -0
- package/es/{index-d8294b1a.cjs → index-11547a0c.cjs} +1 -1
- package/es/{index-0afedcbd.js → index-1f7d4f70.js} +12 -11
- package/es/{index-ae6c9d97.cjs → index-298075cf.cjs} +1 -1
- package/es/{index-4e46f96c.js → index-57672682.js} +13 -12
- package/es/{index-66ad0d6a.js → index-844bdd85.js} +34 -34
- package/es/{index-29418a8d.js → index-88546436.js} +18 -18
- package/es/index-960806da.js +314 -0
- package/es/index-9780a537.cjs +1 -0
- package/es/index-9b9ef5dd.cjs +1 -0
- package/es/{base-aa512893.js → index-a871c3eb.js} +171 -454
- package/es/index-bb833443.cjs +1 -0
- package/es/index-c108567d.cjs +1 -0
- package/es/index-d77a7336.js +204 -0
- package/es/{index-cbbd78b4.js → index-d91dc23f.js} +12 -12
- package/es/index-e5566b94.js +368 -0
- package/es/index-f3562b52.cjs +1 -0
- package/es/{index-882d77d3.cjs → index-f967d6c1.cjs} +1 -1
- package/es/raf-80ef0c0a.js +6 -0
- package/es/{raf-336ef01e.cjs → raf-8249652f.cjs} +1 -1
- package/es/{scroll-0a48995c.js → scroll-679bd6bf.js} +5 -5
- package/es/{scroll-19533c53.cjs → scroll-b108dabd.cjs} +1 -1
- package/es/style.css +1 -1
- package/es/use-form-common-props-815d48a6.js +364 -0
- package/es/use-form-common-props-fd9b61a0.cjs +1 -0
- package/es/use-global-config-30d7d8ce.cjs +1 -0
- package/es/use-global-config-b5e9d3d5.js +72 -0
- package/es/{validator-28b22907.cjs → validator-1b8a6128.cjs} +1 -1
- package/es/{validator-e35f7978.js → validator-764a9db0.js} +1 -1
- package/es/{vnode-b62d0045.js → vnode-5ddb7ed1.js} +1 -1
- package/es/{vnode-8cb31692.cjs → vnode-b906ae6d.cjs} +1 -1
- package/es/{zh-cn-7c8640bb.cjs → zh-cn-90317f62.cjs} +1 -1
- package/es/{zh-cn-346f3a73.js → zh-cn-e963c628.js} +2 -2
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +105 -105
- package/lib/{index-da0f2951.js → index-e158c3d6.js} +1529 -1529
- package/lib/{python-c0a1e4ef.js → python-57033756.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/Kline/componentsNew/KlineTips/index.vue +4 -4
- package/packages/Kline/index.vue +4 -4
- package/packages/KlineNew/components/KlineTips/index.vue +8 -8
- package/packages/KlinePlus/index.vue +4 -4
- package/src/pages/KlineBasic/api.js +1 -1
- package/es/_initCloneObject-e660897e.cjs +0 -1
- package/es/base-7ba08794.cjs +0 -5
- package/es/castArray-efa457a5.cjs +0 -1
- package/es/debounce-4aa22feb.cjs +0 -1
- package/es/el-autocomplete-609ac86d.cjs +0 -1
- package/es/el-button-08310c06.cjs +0 -1
- package/es/el-dialog-ea480083.cjs +0 -1
- package/es/el-empty-b40fa7ea.cjs +0 -1
- package/es/el-form-item-338ea2f7.cjs +0 -12
- package/es/el-input-b04b5bfc.cjs +0 -1
- package/es/el-input-number-7242c8b5.cjs +0 -1
- package/es/el-menu-item-7aca344e.cjs +0 -1
- package/es/el-message-05cd85bf.cjs +0 -1
- package/es/el-message-box-b7e9917e.cjs +0 -1
- package/es/el-overlay-60bc5a02.cjs +0 -1
- package/es/el-popconfirm-24b622c5.cjs +0 -1
- package/es/el-popper-1dd8f5b4.cjs +0 -1
- package/es/el-segmented-a928d89b.cjs +0 -1
- package/es/el-select-5fd77a96.cjs +0 -1
- package/es/el-table-column-bf3ab2a6.cjs +0 -14
- package/es/el-tag-d59f3463.cjs +0 -1
- package/es/index-3d0bc5da.js +0 -566
- package/es/index-a206f6eb.cjs +0 -1
- package/es/index-b4700d83.cjs +0 -1
- package/es/index-c30cf7f9.cjs +0 -1
- package/es/raf-d8c44079.js +0 -6
- package/es/use-form-common-props-41182853.cjs +0 -1
- package/es/use-form-common-props-4cdda474.js +0 -671
- package/es/use-global-config-7bfbe48c.js +0 -71
- package/es/use-global-config-dc5527e8.cjs +0 -1
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import { defineComponent as te, ref as pe, reactive as fe, computed as
|
|
2
|
-
import { E as Ve } from "./el-input-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { a as
|
|
7
|
-
|
|
1
|
+
import { defineComponent as te, ref as pe, reactive as fe, computed as h, watch as W, onMounted as be, onUpdated as ve, openBlock as v, createElementBlock as $, normalizeClass as z, unref as l, withModifiers as Ne, withDirectives as X, withKeys as Y, renderSlot as A, createVNode as K, withCtx as P, createBlock as F, createCommentVNode as j, createSlots as Ee } from "vue";
|
|
2
|
+
import { E as Ve } from "./el-input-2f75c4ba.js";
|
|
3
|
+
import { E as q, f as he, t as ye, v as Ie, p as ge } from "./index-a871c3eb.js";
|
|
4
|
+
import { x as J, b as we, p as b, e as Q, g as y, u as _e, i as T, _ as Se, c as Ae, w as Pe } from "./base-a5af3db3.js";
|
|
5
|
+
import { h as Fe, d as Te, e as De, g as ke } from "./use-form-common-props-815d48a6.js";
|
|
6
|
+
import { u as Ce, C as re, I as D, U as N, b as Me, d as Z, a as ee } from "./el-popper-b4f97157.js";
|
|
7
|
+
import { u as Be } from "./index-d77a7336.js";
|
|
8
|
+
const xe = 100, Le = 600, ne = {
|
|
8
9
|
beforeMount(u, E) {
|
|
9
|
-
const s = E.value, { interval: r =
|
|
10
|
+
const s = E.value, { interval: r = xe, delay: I = Le } = J(s) ? {} : s;
|
|
10
11
|
let d, m;
|
|
11
|
-
const
|
|
12
|
+
const a = () => J(s) ? s() : s.handler(), p = () => {
|
|
12
13
|
m && (clearTimeout(m), m = void 0), d && (clearInterval(d), d = void 0);
|
|
13
14
|
};
|
|
14
15
|
u.addEventListener("mousedown", (g) => {
|
|
15
|
-
g.button === 0 && (p(),
|
|
16
|
+
g.button === 0 && (p(), a(), document.addEventListener("mouseup", () => p(), {
|
|
16
17
|
once: !0
|
|
17
18
|
}), m = setTimeout(() => {
|
|
18
19
|
d = setInterval(() => {
|
|
19
|
-
|
|
20
|
+
a();
|
|
20
21
|
}, r);
|
|
21
22
|
}, I));
|
|
22
23
|
});
|
|
23
24
|
}
|
|
24
|
-
},
|
|
25
|
+
}, Re = we({
|
|
25
26
|
id: {
|
|
26
27
|
type: String,
|
|
27
28
|
default: void 0
|
|
@@ -71,38 +72,38 @@ const Le = 100, Re = 600, ne = {
|
|
|
71
72
|
},
|
|
72
73
|
...Ce(["ariaLabel"]),
|
|
73
74
|
inputmode: {
|
|
74
|
-
type:
|
|
75
|
+
type: Q(String),
|
|
75
76
|
default: void 0
|
|
76
77
|
},
|
|
77
78
|
align: {
|
|
78
|
-
type:
|
|
79
|
+
type: Q(String),
|
|
79
80
|
default: "center"
|
|
80
81
|
},
|
|
81
82
|
disabledScientific: Boolean
|
|
82
|
-
}),
|
|
83
|
+
}), $e = {
|
|
83
84
|
[re]: (u, E) => E !== u,
|
|
84
85
|
blur: (u) => u instanceof FocusEvent,
|
|
85
86
|
focus: (u) => u instanceof FocusEvent,
|
|
86
|
-
[D]: (u) => b(u) ||
|
|
87
|
-
[N]: (u) => b(u) ||
|
|
88
|
-
},
|
|
87
|
+
[D]: (u) => b(u) || y(u),
|
|
88
|
+
[N]: (u) => b(u) || y(u)
|
|
89
|
+
}, ze = te({
|
|
89
90
|
name: "ElInputNumber"
|
|
90
|
-
}),
|
|
91
|
-
...
|
|
92
|
-
props:
|
|
93
|
-
emits:
|
|
91
|
+
}), Ke = /* @__PURE__ */ te({
|
|
92
|
+
...ze,
|
|
93
|
+
props: Re,
|
|
94
|
+
emits: $e,
|
|
94
95
|
setup(u, { expose: E, emit: s }) {
|
|
95
|
-
const r = u, { t: I } = Be(), d =
|
|
96
|
+
const r = u, { t: I } = Be(), d = _e("input-number"), m = pe(), a = fe({
|
|
96
97
|
currentValue: r.modelValue,
|
|
97
98
|
userInput: null
|
|
98
|
-
}), { formItem: p } = Te(), g =
|
|
99
|
+
}), { formItem: p } = Te(), g = h(() => b(r.modelValue) && r.modelValue <= r.min), O = h(() => b(r.modelValue) && r.modelValue >= r.max), le = h(() => {
|
|
99
100
|
const e = U(r.step);
|
|
100
101
|
return T(r.precision) ? Math.max(U(r.modelValue), e) : (e > r.precision, r.precision);
|
|
101
|
-
}), k =
|
|
102
|
-
if (
|
|
103
|
-
return
|
|
104
|
-
let e =
|
|
105
|
-
if (
|
|
102
|
+
}), k = h(() => r.controls && r.controlsPosition === "right"), G = De(), V = ke(), C = h(() => {
|
|
103
|
+
if (a.userInput !== null)
|
|
104
|
+
return a.userInput;
|
|
105
|
+
let e = a.currentValue;
|
|
106
|
+
if (y(e))
|
|
106
107
|
return "";
|
|
107
108
|
if (b(e)) {
|
|
108
109
|
if (Number.isNaN(e))
|
|
@@ -111,7 +112,7 @@ const Le = 100, Re = 600, ne = {
|
|
|
111
112
|
}
|
|
112
113
|
return e;
|
|
113
114
|
}), M = (e, n) => {
|
|
114
|
-
if (T(n) && (n =
|
|
115
|
+
if (T(n) && (n = le.value), n === 0)
|
|
115
116
|
return Math.round(e);
|
|
116
117
|
let t = String(e);
|
|
117
118
|
const i = t.indexOf(".");
|
|
@@ -120,12 +121,12 @@ const Le = 100, Re = 600, ne = {
|
|
|
120
121
|
const _ = t.length;
|
|
121
122
|
return t.charAt(_ - 1) === "5" && (t = `${t.slice(0, Math.max(0, _ - 1))}6`), Number.parseFloat(Number(t).toFixed(n));
|
|
122
123
|
}, U = (e) => {
|
|
123
|
-
if (
|
|
124
|
+
if (y(e))
|
|
124
125
|
return 0;
|
|
125
126
|
const n = e.toString(), t = n.indexOf(".");
|
|
126
127
|
let i = 0;
|
|
127
128
|
return t !== -1 && (i = n.length - t - 1), i;
|
|
128
|
-
}, H = (e, n = 1) => b(e) ? e >= Number.MAX_SAFE_INTEGER && n === 1 || e <= Number.MIN_SAFE_INTEGER && n === -1 ? e : M(e + r.step * n) :
|
|
129
|
+
}, H = (e, n = 1) => b(e) ? e >= Number.MAX_SAFE_INTEGER && n === 1 || e <= Number.MIN_SAFE_INTEGER && n === -1 ? e : M(e + r.step * n) : a.currentValue, ae = (e) => {
|
|
129
130
|
var n;
|
|
130
131
|
const t = e;
|
|
131
132
|
if (r.disabledScientific && ["e", "E"].includes(t.key)) {
|
|
@@ -137,7 +138,7 @@ const Le = 100, Re = 600, ne = {
|
|
|
137
138
|
t.preventDefault(), B();
|
|
138
139
|
},
|
|
139
140
|
[ee.down]: () => {
|
|
140
|
-
t.preventDefault(),
|
|
141
|
+
t.preventDefault(), x();
|
|
141
142
|
}
|
|
142
143
|
};
|
|
143
144
|
(n = i[t.key]) == null || n.call(i);
|
|
@@ -145,17 +146,17 @@ const Le = 100, Re = 600, ne = {
|
|
|
145
146
|
if (r.readonly || V.value || O.value)
|
|
146
147
|
return;
|
|
147
148
|
const e = Number(C.value) || 0, n = H(e);
|
|
148
|
-
w(n), s(D,
|
|
149
|
-
},
|
|
149
|
+
w(n), s(D, a.currentValue), R();
|
|
150
|
+
}, x = () => {
|
|
150
151
|
if (r.readonly || V.value || g.value)
|
|
151
152
|
return;
|
|
152
153
|
const e = Number(C.value) || 0, n = H(e, -1);
|
|
153
|
-
w(n), s(D,
|
|
154
|
-
},
|
|
154
|
+
w(n), s(D, a.currentValue), R();
|
|
155
|
+
}, L = (e, n) => {
|
|
155
156
|
const { max: t, min: i, step: o, precision: f, stepStrictly: _, valueOnClear: S } = r;
|
|
156
157
|
t < i && Me("InputNumber", "min should not be greater than max.");
|
|
157
158
|
let c = Number(e);
|
|
158
|
-
if (
|
|
159
|
+
if (y(e) || Number.isNaN(c))
|
|
159
160
|
return null;
|
|
160
161
|
if (e === "") {
|
|
161
162
|
if (S === null)
|
|
@@ -165,19 +166,19 @@ const Le = 100, Re = 600, ne = {
|
|
|
165
166
|
return _ && (c = M(Math.round(c / o) * o, f), c !== e && n && s(N, c)), T(f) || (c = M(c, f)), (c > t || c < i) && (c = c > t ? t : i, n && s(N, c)), c;
|
|
166
167
|
}, w = (e, n = !0) => {
|
|
167
168
|
var t;
|
|
168
|
-
const i =
|
|
169
|
+
const i = a.currentValue, o = L(e);
|
|
169
170
|
if (!n) {
|
|
170
171
|
s(N, o);
|
|
171
172
|
return;
|
|
172
173
|
}
|
|
173
|
-
i === o && e || (
|
|
174
|
+
i === o && e || (a.userInput = null, s(N, o), i !== o && s(re, o, i), r.validateEvent && ((t = p == null ? void 0 : p.validate) == null || t.call(p, "change").catch((f) => Z())), a.currentValue = o);
|
|
174
175
|
}, ue = (e) => {
|
|
175
|
-
|
|
176
|
+
a.userInput = e;
|
|
176
177
|
const n = e === "" ? null : Number(e);
|
|
177
178
|
s(D, n), w(n, !1);
|
|
178
179
|
}, ie = (e) => {
|
|
179
180
|
const n = e !== "" ? Number(e) : "";
|
|
180
|
-
(b(n) && !Number.isNaN(n) || e === "") && w(n),
|
|
181
|
+
(b(n) && !Number.isNaN(n) || e === "") && w(n), R(), a.userInput = null;
|
|
181
182
|
}, oe = () => {
|
|
182
183
|
var e, n;
|
|
183
184
|
(n = (e = m.value) == null ? void 0 : e.focus) == null || n.call(e);
|
|
@@ -188,21 +189,21 @@ const Le = 100, Re = 600, ne = {
|
|
|
188
189
|
s("focus", e);
|
|
189
190
|
}, ce = (e) => {
|
|
190
191
|
var n, t;
|
|
191
|
-
|
|
192
|
-
},
|
|
193
|
-
|
|
192
|
+
a.userInput = null, a.currentValue === null && ((n = m.value) != null && n.input) && (m.value.input.value = ""), s("blur", e), r.validateEvent && ((t = p == null ? void 0 : p.validate) == null || t.call(p, "blur").catch((i) => Z()));
|
|
193
|
+
}, R = () => {
|
|
194
|
+
a.currentValue !== r.modelValue && (a.currentValue = r.modelValue);
|
|
194
195
|
}, me = (e) => {
|
|
195
196
|
document.activeElement === e.target && e.preventDefault();
|
|
196
197
|
};
|
|
197
198
|
return W(() => r.modelValue, (e, n) => {
|
|
198
|
-
const t =
|
|
199
|
-
|
|
199
|
+
const t = L(e, !0);
|
|
200
|
+
a.userInput === null && t !== n && (a.currentValue = t);
|
|
200
201
|
}, { immediate: !0 }), W(() => r.precision, () => {
|
|
201
|
-
|
|
202
|
+
a.currentValue = L(r.modelValue);
|
|
202
203
|
}), be(() => {
|
|
203
204
|
var e;
|
|
204
205
|
const { min: n, max: t, modelValue: i } = r, o = (e = m.value) == null ? void 0 : e.input;
|
|
205
|
-
if (o.setAttribute("role", "spinbutton"), Number.isFinite(t) ? o.setAttribute("aria-valuemax", String(t)) : o.removeAttribute("aria-valuemax"), Number.isFinite(n) ? o.setAttribute("aria-valuemin", String(n)) : o.removeAttribute("aria-valuemin"), o.setAttribute("aria-valuenow",
|
|
206
|
+
if (o.setAttribute("role", "spinbutton"), Number.isFinite(t) ? o.setAttribute("aria-valuemax", String(t)) : o.removeAttribute("aria-valuemax"), Number.isFinite(n) ? o.setAttribute("aria-valuemin", String(n)) : o.removeAttribute("aria-valuemin"), o.setAttribute("aria-valuenow", a.currentValue || a.currentValue === 0 ? String(a.currentValue) : ""), o.setAttribute("aria-disabled", String(V.value)), !b(i) && i != null) {
|
|
206
207
|
let f = Number(i);
|
|
207
208
|
Number.isNaN(f) && (f = null), s(N, f);
|
|
208
209
|
}
|
|
@@ -210,76 +211,76 @@ const Le = 100, Re = 600, ne = {
|
|
|
210
211
|
}), ve(() => {
|
|
211
212
|
var e, n;
|
|
212
213
|
const t = (e = m.value) == null ? void 0 : e.input;
|
|
213
|
-
t == null || t.setAttribute("aria-valuenow", `${(n =
|
|
214
|
+
t == null || t.setAttribute("aria-valuenow", `${(n = a.currentValue) != null ? n : ""}`);
|
|
214
215
|
}), E({
|
|
215
216
|
focus: oe,
|
|
216
217
|
blur: se
|
|
217
|
-
}), (e, n) => (v(),
|
|
218
|
-
class:
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
218
|
+
}), (e, n) => (v(), $("div", {
|
|
219
|
+
class: z([
|
|
220
|
+
l(d).b(),
|
|
221
|
+
l(d).m(l(G)),
|
|
222
|
+
l(d).is("disabled", l(V)),
|
|
223
|
+
l(d).is("without-controls", !e.controls),
|
|
224
|
+
l(d).is("controls-right", l(k)),
|
|
225
|
+
l(d).is(e.align, !!e.align)
|
|
225
226
|
]),
|
|
226
227
|
onDragstart: Ne(() => {
|
|
227
228
|
}, ["prevent"])
|
|
228
229
|
}, [
|
|
229
|
-
e.controls ? X((v(),
|
|
230
|
+
e.controls ? X((v(), $("span", {
|
|
230
231
|
key: 0,
|
|
231
232
|
role: "button",
|
|
232
|
-
"aria-label":
|
|
233
|
-
class:
|
|
234
|
-
onKeydown:
|
|
233
|
+
"aria-label": l(I)("el.inputNumber.decrease"),
|
|
234
|
+
class: z([l(d).e("decrease"), l(d).is("disabled", l(g))]),
|
|
235
|
+
onKeydown: Y(x, ["enter"])
|
|
235
236
|
}, [
|
|
236
237
|
A(e.$slots, "decrease-icon", {}, () => [
|
|
237
|
-
|
|
238
|
+
K(l(q), null, {
|
|
238
239
|
default: P(() => [
|
|
239
|
-
|
|
240
|
+
l(k) ? (v(), F(l(he), { key: 0 })) : (v(), F(l(ye), { key: 1 }))
|
|
240
241
|
]),
|
|
241
242
|
_: 1
|
|
242
243
|
})
|
|
243
244
|
])
|
|
244
245
|
], 42, ["aria-label", "onKeydown"])), [
|
|
245
|
-
[
|
|
246
|
-
]) :
|
|
247
|
-
e.controls ? X((v(),
|
|
246
|
+
[l(ne), x]
|
|
247
|
+
]) : j("v-if", !0),
|
|
248
|
+
e.controls ? X((v(), $("span", {
|
|
248
249
|
key: 1,
|
|
249
250
|
role: "button",
|
|
250
|
-
"aria-label":
|
|
251
|
-
class:
|
|
252
|
-
onKeydown:
|
|
251
|
+
"aria-label": l(I)("el.inputNumber.increase"),
|
|
252
|
+
class: z([l(d).e("increase"), l(d).is("disabled", l(O))]),
|
|
253
|
+
onKeydown: Y(B, ["enter"])
|
|
253
254
|
}, [
|
|
254
255
|
A(e.$slots, "increase-icon", {}, () => [
|
|
255
|
-
|
|
256
|
+
K(l(q), null, {
|
|
256
257
|
default: P(() => [
|
|
257
|
-
|
|
258
|
+
l(k) ? (v(), F(l(Ie), { key: 0 })) : (v(), F(l(ge), { key: 1 }))
|
|
258
259
|
]),
|
|
259
260
|
_: 1
|
|
260
261
|
})
|
|
261
262
|
])
|
|
262
263
|
], 42, ["aria-label", "onKeydown"])), [
|
|
263
|
-
[
|
|
264
|
-
]) :
|
|
265
|
-
|
|
264
|
+
[l(ne), B]
|
|
265
|
+
]) : j("v-if", !0),
|
|
266
|
+
K(l(Ve), {
|
|
266
267
|
id: e.id,
|
|
267
268
|
ref_key: "input",
|
|
268
269
|
ref: m,
|
|
269
270
|
type: "number",
|
|
270
271
|
step: e.step,
|
|
271
|
-
"model-value":
|
|
272
|
+
"model-value": l(C),
|
|
272
273
|
placeholder: e.placeholder,
|
|
273
274
|
readonly: e.readonly,
|
|
274
|
-
disabled:
|
|
275
|
-
size:
|
|
275
|
+
disabled: l(V),
|
|
276
|
+
size: l(G),
|
|
276
277
|
max: e.max,
|
|
277
278
|
min: e.min,
|
|
278
279
|
name: e.name,
|
|
279
280
|
"aria-label": e.ariaLabel,
|
|
280
281
|
"validate-event": !1,
|
|
281
282
|
inputmode: e.inputmode,
|
|
282
|
-
onKeydown:
|
|
283
|
+
onKeydown: ae,
|
|
283
284
|
onBlur: ce,
|
|
284
285
|
onFocus: de,
|
|
285
286
|
onInput: ue,
|
|
@@ -303,8 +304,8 @@ const Le = 100, Re = 600, ne = {
|
|
|
303
304
|
], 42, ["onDragstart"]));
|
|
304
305
|
}
|
|
305
306
|
});
|
|
306
|
-
var Oe = /* @__PURE__ */ Se(
|
|
307
|
-
const
|
|
307
|
+
var Oe = /* @__PURE__ */ Se(Ke, [["__file", "input-number.vue"]]);
|
|
308
|
+
const qe = Pe(Oe);
|
|
308
309
|
export {
|
|
309
|
-
|
|
310
|
+
qe as E
|
|
310
311
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const a=require("vue"),I=require("./use-global-config-
|
|
1
|
+
"use strict";const a=require("vue"),I=require("./use-global-config-30d7d8ce.cjs"),i=require("./base-ef747d02.cjs");function T(e,t){let n;const s=a.ref(!1),l=a.reactive({...e,originalPosition:"",originalOverflow:"",visible:!1});function r(o){l.text=o}function d(){const o=l.parent,v=f.ns;if(!o.vLoadingAddClassList){let u=o.getAttribute("loading-number");u=Number.parseInt(u)-1,u?o.setAttribute("loading-number",u.toString()):(i.removeClass(o,v.bm("parent","relative")),o.removeAttribute("loading-number")),i.removeClass(o,v.bm("parent","hidden"))}g(),b.unmount()}function g(){var o,v;(v=(o=f.$el)==null?void 0:o.parentNode)==null||v.removeChild(f.$el)}function C(){var o;e.beforeClose&&!e.beforeClose()||(s.value=!0,clearTimeout(n),n=setTimeout(c,400),l.visible=!1,(o=e.closed)==null||o.call(e))}function c(){if(!s.value)return;const o=l.parent;s.value=!1,o.vLoadingAddClassList=void 0,d()}const p=a.defineComponent({name:"ElLoading",setup(o,{expose:v}){const{ns:u,zIndex:w}=I.useGlobalComponentSettings("loading");return v({ns:u,zIndex:w}),()=>{const h=l.spinner||l.svg,S=a.h("svg",{class:"circular",viewBox:l.svgViewBox?l.svgViewBox:"0 0 50 50",...h?{innerHTML:h}:{}},[a.h("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),B=l.text?a.h("p",{class:u.b("text")},[l.text]):void 0;return a.h(a.Transition,{name:u.b("fade"),onAfterLeave:c},{default:a.withCtx(()=>[a.withDirectives(a.createVNode("div",{style:{backgroundColor:l.background||""},class:[u.b("mask"),l.customClass,l.fullscreen?"is-fullscreen":""]},[a.h("div",{class:u.b("spinner")},[S,B])]),[[a.vShow,l.visible]])])})}}}),b=a.createApp(p);Object.assign(b._context,t??{});const f=b.mount(document.createElement("div"));return{...a.toRefs(l),setText:r,removeElLoadingChild:g,close:C,handleAfterLeave:c,vm:f,get $el(){return f.$el}}}let y;const _=function(e={}){if(!i.isClient)return;const t=$(e);if(t.fullscreen&&y)return y;const n=T({...t,closed:()=>{var l;(l=t.closed)==null||l.call(t),t.fullscreen&&(y=void 0)}},_._context);N(t,t.parent,n),k(t,t.parent,n),t.parent.vLoadingAddClassList=()=>k(t,t.parent,n);let s=t.parent.getAttribute("loading-number");return s?s=`${Number.parseInt(s)+1}`:s="1",t.parent.setAttribute("loading-number",s),t.parent.appendChild(n.$el),a.nextTick(()=>n.visible.value=t.visible),t.fullscreen&&(y=n),n},$=e=>{var t,n,s,l;let r;return i.isString(e.target)?r=(t=document.querySelector(e.target))!=null?t:document.body:r=e.target||document.body,{parent:r===document.body||e.body?document.body:r,background:e.background||"",svg:e.svg||"",svgViewBox:e.svgViewBox||"",spinner:e.spinner||!1,text:e.text||"",fullscreen:r===document.body&&((n=e.fullscreen)!=null?n:!0),lock:(s=e.lock)!=null?s:!1,customClass:e.customClass||"",visible:(l=e.visible)!=null?l:!0,beforeClose:e.beforeClose,closed:e.closed,target:r}},N=async(e,t,n)=>{const{nextZIndex:s}=n.vm.zIndex||n.vm._.exposed.zIndex,l={};if(e.fullscreen)n.originalPosition.value=i.getStyle(document.body,"position"),n.originalOverflow.value=i.getStyle(document.body,"overflow"),l.zIndex=s();else if(e.parent===document.body){n.originalPosition.value=i.getStyle(document.body,"position"),await a.nextTick();for(const r of["top","left"]){const d=r==="top"?"scrollTop":"scrollLeft";l[r]=`${e.target.getBoundingClientRect()[r]+document.body[d]+document.documentElement[d]-Number.parseInt(i.getStyle(document.body,`margin-${r}`),10)}px`}for(const r of["height","width"])l[r]=`${e.target.getBoundingClientRect()[r]}px`}else n.originalPosition.value=i.getStyle(t,"position");for(const[r,d]of Object.entries(l))n.$el.style[r]=d},k=(e,t,n)=>{const s=n.vm.ns||n.vm._.exposed.ns;["absolute","fixed","sticky"].includes(n.originalPosition.value)?i.removeClass(t,s.bm("parent","relative")):i.addClass(t,s.bm("parent","relative")),e.fullscreen&&e.lock?i.addClass(t,s.bm("parent","hidden")):i.removeClass(t,s.bm("parent","hidden"))};_._context=null;const x=Symbol("ElLoading"),m=e=>`element-loading-${i.hyphenate(e)}`,A=(e,t)=>{var n,s,l,r;const d=t.instance,g=o=>i.isObject(t.value)?t.value[o]:void 0,C=o=>{const v=i.isString(o)&&(d==null?void 0:d[o])||o;return a.ref(v)},c=o=>C(g(o)||e.getAttribute(m(o))),p=(n=g("fullscreen"))!=null?n:t.modifiers.fullscreen,b={text:c("text"),svg:c("svg"),svgViewBox:c("svgViewBox"),spinner:c("spinner"),background:c("background"),customClass:c("customClass"),fullscreen:p,target:(s=g("target"))!=null?s:p?void 0:e,body:(l=g("body"))!=null?l:t.modifiers.body,lock:(r=g("lock"))!=null?r:t.modifiers.lock},f=_(b);f._context=L._context,e[x]={options:b,instance:f}},V=(e,t)=>{for(const n of Object.keys(e))a.isRef(e[n])&&(e[n].value=t[n])},L={mounted(e,t){t.value&&A(e,t)},updated(e,t){const n=e[x];if(!t.value){n==null||n.instance.close(),e[x]=null;return}n?V(n.options,i.isObject(t.value)?t.value:{text:e.getAttribute(m("text")),svg:e.getAttribute(m("svg")),svgViewBox:e.getAttribute(m("svgViewBox")),spinner:e.getAttribute(m("spinner")),background:e.getAttribute(m("background")),customClass:e.getAttribute(m("customClass"))}):A(e,t)},unmounted(e){var t;(t=e[x])==null||t.instance.close(),e[x]=null}};L._context=null;exports.vLoading=L;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref as B, reactive as P, defineComponent as O, h as m, Transition as j, withCtx as z, withDirectives as R, createVNode as q, vShow as D, createApp as F, toRefs as G, nextTick as I, isRef as H } from "vue";
|
|
2
|
-
import { u as K } from "./use-global-config-
|
|
3
|
-
import {
|
|
2
|
+
import { u as K } from "./use-global-config-b5e9d3d5.js";
|
|
3
|
+
import { r as C, s as M, c as S, t as b, a as k, f as $, v as Y } from "./base-a5af3db3.js";
|
|
4
4
|
function Z(e, t) {
|
|
5
5
|
let n;
|
|
6
6
|
const s = B(!1), o = P({
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),P=require("./use-form-common-props-fd9b61a0.cjs"),H=require("./index-098c2447.cjs"),f=require("./el-popper-b6c99b28.cjs"),a=require("./base-ef747d02.cjs"),le=require("./index-eea0bcb3.cjs"),ae=require("./el-tag-a33c4b22.cjs"),ue=require("./typescript-b63f8e83.cjs"),re=require("./vnode-b906ae6d.cjs"),ie=e.defineComponent({name:"ElCollapseTransition"}),ce=e.defineComponent({...ie,setup(n){const o=a.useNamespace("collapse-transition"),i=t=>{t.style.maxHeight="",t.style.overflow=t.dataset.oldOverflow,t.style.paddingTop=t.dataset.oldPaddingTop,t.style.paddingBottom=t.dataset.oldPaddingBottom},s={beforeEnter(t){t.dataset||(t.dataset={}),t.dataset.oldPaddingTop=t.style.paddingTop,t.dataset.oldPaddingBottom=t.style.paddingBottom,t.style.height&&(t.dataset.elExistsHeight=t.style.height),t.style.maxHeight=0,t.style.paddingTop=0,t.style.paddingBottom=0},enter(t){requestAnimationFrame(()=>{t.dataset.oldOverflow=t.style.overflow,t.dataset.elExistsHeight?t.style.maxHeight=t.dataset.elExistsHeight:t.scrollHeight!==0?t.style.maxHeight=`${t.scrollHeight}px`:t.style.maxHeight=0,t.style.paddingTop=t.dataset.oldPaddingTop,t.style.paddingBottom=t.dataset.oldPaddingBottom,t.style.overflow="hidden"})},afterEnter(t){t.style.maxHeight="",t.style.overflow=t.dataset.oldOverflow},enterCancelled(t){i(t)},beforeLeave(t){t.dataset||(t.dataset={}),t.dataset.oldPaddingTop=t.style.paddingTop,t.dataset.oldPaddingBottom=t.style.paddingBottom,t.dataset.oldOverflow=t.style.overflow,t.style.maxHeight=`${t.scrollHeight}px`,t.style.overflow="hidden"},leave(t){t.scrollHeight!==0&&(t.style.maxHeight=0,t.style.paddingTop=0,t.style.paddingBottom=0)},afterLeave(t){i(t)},leaveCancelled(t){i(t)}};return(t,b)=>(e.openBlock(),e.createBlock(e.Transition,e.mergeProps({name:e.unref(o).b()},e.toHandlers(s)),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16,["name"]))}});var de=a._export_sfc(ce,[["__file","collapse-transition.vue"]]);const pe=a.withInstall(de);let me=class{constructor(o,i){this.parent=o,this.domNode=i,this.subIndex=0,this.subIndex=0,this.init()}init(){this.subMenuItems=this.domNode.querySelectorAll("li"),this.addListeners()}gotoSubIndex(o){o===this.subMenuItems.length?o=0:o<0&&(o=this.subMenuItems.length-1),this.subMenuItems[o].focus(),this.subIndex=o}addListeners(){const o=this.parent.domNode;Array.prototype.forEach.call(this.subMenuItems,i=>{i.addEventListener("keydown",s=>{let t=!1;switch(s.code){case f.EVENT_CODE.down:{this.gotoSubIndex(this.subIndex+1),t=!0;break}case f.EVENT_CODE.up:{this.gotoSubIndex(this.subIndex-1),t=!0;break}case f.EVENT_CODE.tab:{f.triggerEvent(o,"mouseleave");break}case f.EVENT_CODE.enter:case f.EVENT_CODE.numpadEnter:case f.EVENT_CODE.space:{t=!0,s.currentTarget.click();break}}return t&&(s.preventDefault(),s.stopPropagation()),!1})})}},fe=class{constructor(o,i){this.domNode=o,this.submenu=null,this.submenu=null,this.init(i)}init(o){this.domNode.setAttribute("tabindex","0");const i=this.domNode.querySelector(`.${o}-menu`);i&&(this.submenu=new me(this,i)),this.addListeners()}addListeners(){this.domNode.addEventListener("keydown",o=>{let i=!1;switch(o.code){case f.EVENT_CODE.down:{f.triggerEvent(o.currentTarget,"mouseenter"),this.submenu&&this.submenu.gotoSubIndex(0),i=!0;break}case f.EVENT_CODE.up:{f.triggerEvent(o.currentTarget,"mouseenter"),this.submenu&&this.submenu.gotoSubIndex(this.submenu.subMenuItems.length-1),i=!0;break}case f.EVENT_CODE.tab:{f.triggerEvent(o.currentTarget,"mouseleave");break}case f.EVENT_CODE.enter:case f.EVENT_CODE.numpadEnter:case f.EVENT_CODE.space:{i=!0,o.currentTarget.click();break}}i&&o.preventDefault()})}},ve=class{constructor(o,i){this.domNode=o,this.init(i)}init(o){const i=this.domNode.childNodes;Array.from(i).forEach(s=>{s.nodeType===1&&new fe(s,o)})}};const he=e.defineComponent({name:"ElMenuCollapseTransition"}),ge=e.defineComponent({...he,setup(n){const o=a.useNamespace("menu"),i={onBeforeEnter:s=>s.style.opacity="0.2",onEnter(s,t){a.addClass(s,`${o.namespace.value}-opacity-transition`),s.style.opacity="1",t()},onAfterEnter(s){a.removeClass(s,`${o.namespace.value}-opacity-transition`),s.style.opacity=""},onBeforeLeave(s){s.dataset||(s.dataset={}),a.hasClass(s,o.m("collapse"))?(a.removeClass(s,o.m("collapse")),s.dataset.oldOverflow=s.style.overflow,s.dataset.scrollWidth=s.clientWidth.toString(),a.addClass(s,o.m("collapse"))):(a.addClass(s,o.m("collapse")),s.dataset.oldOverflow=s.style.overflow,s.dataset.scrollWidth=s.clientWidth.toString(),a.removeClass(s,o.m("collapse"))),s.style.width=`${s.scrollWidth}px`,s.style.overflow="hidden"},onLeave(s){a.addClass(s,"horizontal-collapse-transition"),s.style.width=`${s.dataset.scrollWidth}px`}};return(s,t)=>(e.openBlock(),e.createBlock(e.Transition,e.mergeProps({mode:"out-in"},e.unref(i)),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}});var be=a._export_sfc(ge,[["__file","menu-collapse-transition.vue"]]);function ee(n,o){const i=e.computed(()=>{let t=n.parent;const b=[o.value];for(;t.type.name!=="ElMenu";)t.props.index&&b.unshift(t.props.index),t=t.parent;return b});return{parentMenu:e.computed(()=>{let t=n.parent;for(;t&&!["ElMenu","ElSubMenu"].includes(t.type.name);)t=t.parent;return t}),indexPath:i}}function Ee(n){return e.computed(()=>{const i=n.backgroundColor;return i?new le.TinyColor(i).shade(20).toString():""})}const te=(n,o)=>{const i=a.useNamespace("menu");return e.computed(()=>i.cssVarBlock({"text-color":n.textColor||"","hover-text-color":n.textColor||"","bg-color":n.backgroundColor||"","hover-bg-color":Ee(n).value||"","active-color":n.activeTextColor||"",level:`${o}`}))},Q="rootMenu",U="subMenu:",Me=a.buildProps({index:{type:String,required:!0},showTimeout:Number,hideTimeout:Number,popperClass:String,disabled:Boolean,teleported:{type:Boolean,default:void 0},popperOffset:Number,expandCloseIcon:{type:P.iconPropType},expandOpenIcon:{type:P.iconPropType},collapseCloseIcon:{type:P.iconPropType},collapseOpenIcon:{type:P.iconPropType}}),K="ElSubMenu";var X=e.defineComponent({name:K,props:Me,setup(n,{slots:o,expose:i}){const s=e.getCurrentInstance(),{indexPath:t,parentMenu:b}=ee(s,e.computed(()=>n.index)),h=a.useNamespace("menu"),y=a.useNamespace("sub-menu"),c=e.inject(Q);c||f.throwError(K,"can not inject root menu");const E=e.inject(`${U}${b.value.uid}`);E||f.throwError(K,"can not inject sub menu");const N=e.ref({}),C=e.ref({});let p;const x=e.ref(!1),M=e.ref(),_=e.ref(),B=e.computed(()=>E.level===0),q=e.computed(()=>k.value==="horizontal"&&B.value?"bottom-start":"right-start"),w=e.computed(()=>k.value==="horizontal"&&B.value||k.value==="vertical"&&!c.props.collapse?n.expandCloseIcon&&n.expandOpenIcon?T.value?n.expandOpenIcon:n.expandCloseIcon:H.arrow_down_default:n.collapseCloseIcon&&n.collapseOpenIcon?T.value?n.collapseOpenIcon:n.collapseCloseIcon:H.arrow_right_default),$=e.computed(()=>{const l=n.teleported;return a.isUndefined(l)?B.value:l}),L=e.computed(()=>c.props.collapse?`${h.namespace.value}-zoom-in-left`:`${h.namespace.value}-zoom-in-top`),G=e.computed(()=>k.value==="horizontal"&&B.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"]),T=e.computed(()=>c.openedMenus.includes(n.index)),z=e.computed(()=>[...Object.values(N.value),...Object.values(C.value)].some(({active:l})=>l)),k=e.computed(()=>c.props.mode),W=e.computed(()=>c.props.persistent),D=e.reactive({index:n.index,indexPath:t,active:z}),j=te(c.props,E.level+1),F=e.computed(()=>{var l;return(l=n.popperOffset)!=null?l:c.props.popperOffset}),A=e.computed(()=>{var l;return(l=n.popperClass)!=null?l:c.props.popperClass}),V=e.computed(()=>{var l;return(l=n.showTimeout)!=null?l:c.props.showTimeout}),R=e.computed(()=>{var l;return(l=n.hideTimeout)!=null?l:c.props.hideTimeout}),J=()=>{var l,g,v;return(v=(g=(l=_.value)==null?void 0:l.popperRef)==null?void 0:g.popperInstanceRef)==null?void 0:v.destroy()},u=l=>{l||J()},r=()=>{c.props.menuTrigger==="hover"&&c.props.mode==="horizontal"||c.props.collapse&&c.props.mode==="vertical"||n.disabled||c.handleSubMenuClick({index:n.index,indexPath:t.value,active:z.value})},d=(l,g=V.value)=>{var v;if(l.type!=="focus"){if(c.props.menuTrigger==="click"&&c.props.mode==="horizontal"||!c.props.collapse&&c.props.mode==="vertical"||n.disabled){E.mouseInChild.value=!0;return}E.mouseInChild.value=!0,p==null||p(),{stop:p}=a.useTimeoutFn(()=>{c.openMenu(n.index,t.value)},g),$.value&&((v=b.value.vnode.el)==null||v.dispatchEvent(new MouseEvent("mouseenter"))),l.type==="mouseenter"&&l.target&&e.nextTick(()=>{f.focusElement(l.target,{preventScroll:!0})})}},m=(l=!1)=>{var g;if(c.props.menuTrigger==="click"&&c.props.mode==="horizontal"||!c.props.collapse&&c.props.mode==="vertical"){E.mouseInChild.value=!1;return}p==null||p(),E.mouseInChild.value=!1,{stop:p}=a.useTimeoutFn(()=>!x.value&&c.closeMenu(n.index,t.value),R.value),$.value&&l&&((g=E.handleMouseleave)==null||g.call(E,!0))};e.watch(()=>c.props.collapse,l=>u(!!l));{const l=v=>{C.value[v.index]=v},g=v=>{delete C.value[v.index]};e.provide(`${U}${s.uid}`,{addSubMenu:l,removeSubMenu:g,handleMouseleave:m,mouseInChild:x,level:E.level+1})}return i({opened:T}),e.onMounted(()=>{c.addSubMenu(D),E.addSubMenu(D)}),e.onBeforeUnmount(()=>{E.removeSubMenu(D),c.removeSubMenu(D)}),()=>{var l;const g=[(l=o.title)==null?void 0:l.call(o),e.h(H.ElIcon,{class:y.e("icon-arrow"),style:{transform:T.value?n.expandCloseIcon&&n.expandOpenIcon||n.collapseCloseIcon&&n.collapseOpenIcon&&c.props.collapse?"none":"rotateZ(180deg)":"none"}},{default:()=>a.isString(w.value)?e.h(s.appContext.components[w.value]):e.h(w.value)})],v=c.isMenuPopup?e.h(f.ElTooltip,{ref:_,visible:T.value,effect:"light",pure:!0,offset:F.value,showArrow:!1,persistent:W.value,popperClass:A.value,placement:q.value,teleported:$.value,fallbackPlacements:G.value,transition:L.value,gpuAcceleration:!1},{content:()=>{var S;return e.h("div",{class:[h.m(k.value),h.m("popup-container"),A.value],onMouseenter:I=>d(I,100),onMouseleave:()=>m(!0),onFocus:I=>d(I,100)},[e.h("ul",{class:[h.b(),h.m("popup"),h.m(`popup-${q.value}`)],style:j.value},[(S=o.default)==null?void 0:S.call(o)])])},default:()=>e.h("div",{class:y.e("title"),onClick:r},g)}):e.h(e.Fragment,{},[e.h("div",{class:y.e("title"),ref:M,onClick:r},g),e.h(pe,{},{default:()=>{var S;return e.withDirectives(e.h("ul",{role:"menu",class:[h.b(),h.m("inline")],style:j.value},[(S=o.default)==null?void 0:S.call(o)]),[[e.vShow,T.value]])}})]);return e.h("li",{class:[y.b(),y.is("active",z.value),y.is("opened",T.value),y.is("disabled",n.disabled)],role:"menuitem",ariaHaspopup:!0,ariaExpanded:T.value,onMouseenter:d,onMouseleave:()=>m(),onFocus:d},[v])}}});const ye=a.buildProps({mode:{type:String,values:["horizontal","vertical"],default:"vertical"},defaultActive:{type:String,default:""},defaultOpeneds:{type:a.definePropType(Array),default:()=>ue.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:P.iconPropType,default:()=>H.more_default},popperEffect:{type:a.definePropType(String),default:"dark"},popperClass:String,showTimeout:{type:Number,default:300},hideTimeout:{type:Number,default:300},persistent:{type:Boolean,default:!0}}),Y=n=>a.isArray(n)&&n.every(o=>a.isString(o)),Ce={close:(n,o)=>a.isString(n)&&Y(o),open:(n,o)=>a.isString(n)&&Y(o),select:(n,o,i,s)=>a.isString(n)&&Y(o)&&a.isObject(i)&&(a.isUndefined(s)||s instanceof Promise)};var xe=e.defineComponent({name:"ElMenu",props:ye,emits:Ce,setup(n,{emit:o,slots:i,expose:s}){const t=e.getCurrentInstance(),b=t.appContext.config.globalProperties.$router,h=e.ref(),y=e.ref(),c=a.useNamespace("menu"),E=a.useNamespace("sub-menu");let N=64;const C=e.ref(-1),p=e.ref(n.defaultOpeneds&&!n.collapse?n.defaultOpeneds.slice(0):[]),x=e.ref(n.defaultActive),M=e.ref({}),_=e.ref({}),B=e.computed(()=>n.mode==="horizontal"||n.mode==="vertical"&&n.collapse),q=()=>{const u=x.value&&M.value[x.value];if(!u||n.mode==="horizontal"||n.collapse)return;u.indexPath.forEach(d=>{const m=_.value[d];m&&w(d,m.indexPath)})},w=(u,r)=>{p.value.includes(u)||(n.uniqueOpened&&(p.value=p.value.filter(d=>r.includes(d))),p.value.push(u),o("open",u,r))},$=u=>{const r=p.value.indexOf(u);r!==-1&&p.value.splice(r,1)},L=(u,r)=>{$(u),o("close",u,r)},G=({index:u,indexPath:r})=>{p.value.includes(u)?L(u,r):w(u,r)},T=u=>{(n.mode==="horizontal"||n.collapse)&&(p.value=[]);const{index:r,indexPath:d}=u;if(!(a.isNil(r)||a.isNil(d)))if(n.router&&b){const m=u.route||r,l=b.push(m).then(g=>(g||(x.value=r),g));o("select",r,d,{index:r,indexPath:d,route:m},l)}else x.value=r,o("select",r,d,{index:r,indexPath:d})},z=u=>{var r;const d=M.value,m=d[u]||x.value&&d[x.value]||d[n.defaultActive];x.value=(r=m==null?void 0:m.index)!=null?r:u},k=u=>{const r=getComputedStyle(u),d=Number.parseInt(r.marginLeft,10),m=Number.parseInt(r.marginRight,10);return u.offsetWidth+d+m||0},W=()=>{var u,r;if(!h.value)return-1;const d=Array.from((r=(u=h.value)==null?void 0:u.childNodes)!=null?r:[]).filter(O=>O.nodeName!=="#comment"&&(O.nodeName!=="#text"||O.nodeValue)),m=getComputedStyle(h.value),l=Number.parseInt(m.paddingLeft,10),g=Number.parseInt(m.paddingRight,10),v=h.value.clientWidth-l-g;let S=0,I=0;return d.forEach((O,se)=>{S+=k(O),S<=v-N&&(I=se+1)}),I===d.length?-1:I},D=u=>_.value[u].indexPath,j=(u,r=33.34)=>{let d;return()=>{d&&clearTimeout(d),d=setTimeout(()=>{u()},r)}};let F=!0;const A=()=>{const u=P.unrefElement(y);if(u&&(N=k(u)||64),C.value===W())return;const r=()=>{C.value=-1,e.nextTick(()=>{C.value=W()})};F?r():j(r)(),F=!1};e.watch(()=>n.defaultActive,u=>{M.value[u]||(x.value=""),z(u)}),e.watch(()=>n.collapse,u=>{u&&(p.value=[])}),e.watch(M.value,q);let V;e.watchEffect(()=>{n.mode==="horizontal"&&n.ellipsis?V=P.useResizeObserver(h,A).stop:V==null||V()});const R=e.ref(!1);{const u=l=>{_.value[l.index]=l},r=l=>{delete _.value[l.index]},d=l=>{M.value[l.index]=l},m=l=>{delete M.value[l.index]};e.provide(Q,e.reactive({props:n,openedMenus:p,items:M,subMenus:_,activeIndex:x,isMenuPopup:B,addMenuItem:d,removeMenuItem:m,addSubMenu:u,removeSubMenu:r,openMenu:w,closeMenu:L,handleMenuItemClick:T,handleSubMenuClick:G})),e.provide(`${U}${t.uid}`,{addSubMenu:u,removeSubMenu:r,mouseInChild:R,level:0})}e.onMounted(()=>{n.mode==="horizontal"&&new ve(t.vnode.el,c.namespace.value)}),s({open:r=>{const{indexPath:d}=_.value[r];d.forEach(m=>w(m,d))},close:$,updateActiveIndex:z,handleResize:A});const J=te(n,0);return()=>{var u,r;let d=(r=(u=i.default)==null?void 0:u.call(i))!=null?r:[];const m=[];if(n.mode==="horizontal"&&h.value){const v=re.flattedChildren(d).filter(O=>(O==null?void 0:O.shapeFlag)!==8),S=C.value===-1?v:v.slice(0,C.value),I=C.value===-1?[]:v.slice(C.value);I!=null&&I.length&&n.ellipsis&&(d=S,m.push(e.h(X,{ref:y,index:"sub-menu-more",class:E.e("hide-arrow"),popperOffset:n.popperOffset},{title:()=>e.h(H.ElIcon,{class:E.e("icon-more")},{default:()=>e.h(n.ellipsisIcon)}),default:()=>I})))}const l=n.closeOnClickOutside?[[ae.ClickOutside,()=>{p.value.length&&(R.value||(p.value.forEach(v=>o("close",v,D(v))),p.value=[]))}]]:[],g=e.withDirectives(e.h("ul",{key:String(n.collapse),role:"menubar",ref:h,style:J.value,class:{[c.b()]:!0,[c.m(n.mode)]:!0,[c.m("collapse")]:n.collapse}},[...d,...m]),l);return n.collapseTransition&&n.mode==="vertical"?e.h(be,()=>g):g}}});const Ie=a.buildProps({index:{type:a.definePropType([String,null]),default:null},route:{type:a.definePropType([String,Object])},disabled:Boolean}),_e={click:n=>a.isString(n.index)&&a.isArray(n.indexPath)},Z="ElMenuItem",Te=e.defineComponent({name:Z}),Se=e.defineComponent({...Te,props:Ie,emits:_e,setup(n,{expose:o,emit:i}){const s=n;a.isPropAbsent(s.index)&&f.debugWarn();const t=e.getCurrentInstance(),b=e.inject(Q),h=a.useNamespace("menu"),y=a.useNamespace("menu-item");b||f.throwError(Z,"can not inject root menu");const{parentMenu:c,indexPath:E}=ee(t,e.toRef(s,"index")),N=e.inject(`${U}${c.value.uid}`);N||f.throwError(Z,"can not inject sub menu");const C=e.computed(()=>s.index===b.activeIndex),p=e.reactive({index:s.index,indexPath:E,active:C}),x=()=>{s.disabled||(b.handleMenuItemClick({index:s.index,indexPath:E.value,route:s.route}),i("click",p))};return e.onMounted(()=>{N.addSubMenu(p),b.addMenuItem(p)}),e.onBeforeUnmount(()=>{N.removeSubMenu(p),b.removeMenuItem(p)}),o({parentMenu:c,rootMenu:b,active:C,nsMenu:h,nsMenuItem:y,handleClick:x}),(M,_)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass([e.unref(y).b(),e.unref(y).is("active",e.unref(C)),e.unref(y).is("disabled",M.disabled)]),role:"menuitem",tabindex:"-1",onClick:x},[e.unref(c).type.name==="ElMenu"&&e.unref(b).props.collapse&&M.$slots.title?(e.openBlock(),e.createBlock(e.unref(f.ElTooltip),{key:0,effect:e.unref(b).props.popperEffect,placement:"right","fallback-placements":["left"],persistent:e.unref(b).props.persistent,"focus-on-target":""},{content:e.withCtx(()=>[e.renderSlot(M.$slots,"title")]),default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(h).be("tooltip","trigger"))},[e.renderSlot(M.$slots,"default")],2)]),_:3},8,["effect","persistent"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.renderSlot(M.$slots,"default"),e.renderSlot(M.$slots,"title")],64))],2))}});var ne=a._export_sfc(Se,[["__file","menu-item.vue"]]);const Ne={title:String},we=e.defineComponent({name:"ElMenuItemGroup"}),ke=e.defineComponent({...we,props:Ne,setup(n){const o=a.useNamespace("menu-item-group");return(i,s)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(e.unref(o).b())},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(o).e("title"))},[i.$slots.title?e.renderSlot(i.$slots,"title",{key:1}):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(i.title),1)],64))],2),e.createElementVNode("ul",null,[e.renderSlot(i.$slots,"default")])],2))}});var oe=a._export_sfc(ke,[["__file","menu-item-group.vue"]]);const Oe=a.withInstall(xe,{MenuItem:ne,MenuItemGroup:oe,SubMenu:X}),Pe=a.withNoopInstall(ne);a.withNoopInstall(oe);a.withNoopInstall(X);exports.ElMenu=Oe;exports.ElMenuItem=Pe;
|