st-comp 0.0.262 → 0.0.266
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.js +4 -4
- package/es/CustomFunction.cjs +1 -1
- package/es/CustomFunction.js +31 -31
- package/es/FactorWarning.cjs +1 -1
- package/es/FactorWarning.js +37 -36
- package/es/Kline.cjs +1 -1
- package/es/Kline.js +839 -1593
- package/es/KlineBasic.cjs +1 -1
- package/es/KlineBasic.js +1198 -1
- package/es/KlineConfig.cjs +1 -1
- package/es/KlineConfig.js +89 -89
- package/es/KlineNew.cjs +1 -1
- package/es/KlineNew.js +17 -17
- package/es/KlinePlus.cjs +1 -1
- package/es/KlinePlus.js +20 -20
- package/es/MonacoEditor.cjs +1 -1
- package/es/MonacoEditor.js +25 -25
- package/es/Pagination.cjs +1 -1
- package/es/Pagination.js +113 -113
- package/es/PasswordPrompt.cjs +1 -1
- package/es/PasswordPrompt.js +3 -3
- package/es/Table.cjs +1 -1
- package/es/Table.js +29 -29
- package/es/User.cjs +1 -1
- package/es/User.js +25 -25
- package/es/VarSelectDialog.cjs +1 -1
- package/es/VarSelectDialog.js +27 -27
- package/es/VarietyAiHelper.cjs +3 -3
- package/es/VarietyAiHelper.js +324 -283
- package/es/VarietyAutoComplete.cjs +1 -1
- package/es/VarietyAutoComplete.js +11 -11
- package/es/VarietySearch.cjs +1 -1
- package/es/VarietySearch.js +56 -55
- package/es/{VarietySelect-faef4799.js → VarietySelect-1ac10ec2.js} +4 -4
- package/es/{VarietySelect-5c845562.cjs → VarietySelect-639a8d9a.cjs} +1 -1
- package/es/VarietyTextCopy.cjs +1 -1
- package/es/VarietyTextCopy.js +13 -13
- package/es/VirtualTable.cjs +1 -1
- package/es/VirtualTable.js +14 -14
- package/es/{_initCloneObject-009eedf8.js → _initCloneObject-6b8c230e.js} +7 -7
- package/es/{_initCloneObject-2b82e9f7.cjs → _initCloneObject-9eddcb0c.cjs} +1 -1
- package/es/aiTools-6c9c58bd.cjs +4 -0
- package/es/aiTools-ab67ffa0.js +149 -0
- package/es/aiTools.js +92 -1
- package/es/{base-7ff209fc.js → base-29f73b05.js} +40 -40
- package/es/{castArray-b9f1609f.js → castArray-609a313e.js} +1 -1
- package/es/{config-provider-071b8bec.js → config-provider-56193d47.js} +6 -6
- package/es/{config-provider-2ae47cc8.cjs → config-provider-ea286661.cjs} +1 -1
- package/es/{debounce-23c2f7e1.js → debounce-a09ce9a3.js} +1 -1
- package/es/{dropdown-9941f401.js → dropdown-4e541d60.js} +4 -4
- package/es/{dropdown-eba9eaf5.cjs → dropdown-f30148cc.cjs} +1 -1
- package/es/{el-autocomplete-b59eb529.cjs → el-autocomplete-3949e68c.cjs} +1 -1
- package/es/{el-autocomplete-43f205b0.js → el-autocomplete-4b521c83.js} +17 -17
- package/es/{el-button-7f58608d.js → el-button-4f201000.js} +33 -33
- package/es/{el-button-974ff9e9.cjs → el-button-dd065de0.cjs} +1 -1
- package/es/{el-checkbox-08185353.cjs → el-checkbox-02ce40f0.cjs} +1 -1
- package/es/{el-checkbox-40664b27.js → el-checkbox-33cb73db.js} +17 -17
- package/es/el-checkbox-group-0ea8fbf8.cjs +1 -0
- package/es/el-checkbox-group-4ed993c7.js +1 -0
- package/es/{el-dialog-2f10a2f4.js → el-dialog-1939f7c5.js} +15 -15
- package/es/{el-dialog-1b185570.cjs → el-dialog-6501a151.cjs} +1 -1
- package/es/{el-divider-4e66c835.js → el-divider-523e5874.js} +1 -1
- package/es/{el-empty-e0d826de.js → el-empty-f5a1607a.js} +5 -5
- package/es/{el-form-item-c997b4fa.cjs → el-form-item-316b35d8.cjs} +1 -1
- package/es/{el-form-item-2b68cdf5.js → el-form-item-ea11211d.js} +36 -36
- package/es/{el-input-fa18ef84.cjs → el-input-094afbe2.cjs} +1 -1
- package/es/{el-input-31a818d4.js → el-input-58786d42.js} +43 -43
- package/es/{el-checkbox-group-f775e73f.cjs → el-input-number-a609a5e3.cjs} +1 -1
- package/es/{el-checkbox-group-3ddad0d7.js → el-input-number-a7971697.js} +30 -30
- package/es/{el-loading-969a79ca.cjs → el-loading-d171ce64.cjs} +1 -1
- package/es/{el-loading-3e350f5e.js → el-loading-f3815921.js} +5 -5
- package/es/el-menu-item-3d1e0aff.cjs +1 -0
- package/es/el-menu-item-a166b997.js +769 -0
- package/es/{el-message-box-31e0aa98.cjs → el-message-box-b8ffcf34.cjs} +1 -1
- package/es/{el-message-box-a3aa9b89.js → el-message-box-f2b667e9.js} +11 -11
- package/es/{el-overlay-4e9a99e0.js → el-overlay-1dfe3675.js} +59 -59
- package/es/{el-overlay-ea65cb05.cjs → el-overlay-a94f8a98.cjs} +1 -1
- package/es/{el-popconfirm-9e232436.cjs → el-popconfirm-70e2849c.cjs} +1 -1
- package/es/{el-popconfirm-c2896741.js → el-popconfirm-ca31ceea.js} +12 -12
- package/es/{el-popper-2d3914e4.cjs → el-popper-ce575c12.cjs} +1 -1
- package/es/{el-popper-003b3af7.js → el-popper-db6c599f.js} +177 -177
- package/es/{el-segmented-140ac042.cjs → el-segmented-4d50b63f.cjs} +1 -1
- package/es/{el-segmented-4ae54e6a.js → el-segmented-741f2252.js} +8 -8
- package/es/{el-select-19ee0e79.js → el-select-086bcb6c.js} +65 -65
- package/es/{el-select-a11f33e8.cjs → el-select-2ebc8380.cjs} +1 -1
- package/es/{el-table-column-98570a4d.cjs → el-table-column-2f07fbdb.cjs} +1 -1
- package/es/{el-table-column-3be856d7.js → el-table-column-8a15378a.js} +16 -16
- package/es/{el-tag-19cc5b59.js → el-tag-65a99986.js} +14 -14
- package/es/{el-tag-6d8e653e.cjs → el-tag-f48b1190.cjs} +1 -1
- package/es/{el-text-a18106cb.cjs → el-text-33359f44.cjs} +1 -1
- package/es/{el-text-9a7a4f0f.js → el-text-cbb693f2.js} +2 -2
- package/es/{index-99abf4ff.js → index-072c4a65.js} +17 -17
- package/es/{index-299ee017.cjs → index-0f767104.cjs} +1 -1
- package/es/{index-eb99b188.cjs → index-18565979.cjs} +1 -1
- package/es/{index-19ac550e.js → index-1955f23d.js} +49 -49
- package/es/{index-6917da9d.js → index-1e91e986.js} +43 -43
- package/es/{index-6ca95c8a.cjs → index-21e8d2bc.cjs} +1 -1
- package/es/{index-33f80550.cjs → index-3792552a.cjs} +1 -1
- package/es/{index-7dce9f59.cjs → index-4f900527.cjs} +1 -1
- package/es/{index-308aab33.js → index-57d82da0.js} +34 -34
- package/es/{index-e8eeea22.cjs → index-5b546f7d.cjs} +1 -1
- package/es/{index-808db9b4.js → index-7db02db7.js} +11 -11
- package/es/{index-37b8d3c6.cjs → index-7eb88616.cjs} +1 -1
- package/es/{index-d898531c.js → index-8391a3df.js} +37 -37
- package/es/{index-6b99def3.cjs → index-8439d2f9.cjs} +1 -1
- package/es/{index-40f05e2c.cjs → index-8b055879.cjs} +2 -2
- package/es/{index-f3799536.js → index-a4e252a0.js} +2 -2
- package/es/{index-b56d81e8.js → index-b51915a2.js} +3 -3
- package/es/{index-28e03bad.cjs → index-bf98dd03.cjs} +1 -1
- package/es/{index-e17987ac.js → index-ca91ac68.js} +83 -68
- package/es/{index-41dd5a1c.js → index-d857270a.js} +10 -10
- package/es/{index-f402d1da.js → index-de24705f.js} +1 -1
- package/es/{index-6d530e54.js → index-ff26b1a6.js} +13 -13
- package/es/{python-02c3937a.cjs → python-5b5c9c58.cjs} +1 -1
- package/es/{python-be79c7c1.js → python-ad9239f9.js} +25 -25
- package/es/raf-744cf95a.js +6 -0
- package/es/{scroll-8642151c.js → scroll-6799bafc.js} +5 -5
- package/es/style.css +1 -1
- package/es/{use-form-common-props-d3ed62c6.cjs → use-form-common-props-00ec25ac.cjs} +1 -1
- package/es/{use-form-common-props-d170ccfd.js → use-form-common-props-c14990b9.js} +65 -65
- package/es/{use-global-config-c80f33a4.cjs → use-global-config-28efb416.cjs} +1 -1
- package/es/{use-global-config-74436b92.js → use-global-config-a01b5ce1.js} +14 -14
- package/es/{validator-07160325.cjs → validator-119fdaf4.cjs} +1 -1
- package/es/{validator-672bad4a.js → validator-65de1caf.js} +1 -1
- package/es/{vnode-6d2615f0.js → vnode-a83e6de8.js} +1 -1
- package/es/{zh-cn-6a0f844c.cjs → zh-cn-9fb29a39.cjs} +1 -1
- package/es/{zh-cn-ed10eeb1.js → zh-cn-c1c28e70.js} +2 -2
- package/lib/aiTools.js +92 -1
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +182 -181
- package/lib/{index-c3ddbee7.js → index-53b3465c.js} +18966 -18852
- package/lib/{python-da8fd227.js → python-4a270481.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/KlineBasic/index.vue +1 -1
- package/packages/VarietyAiHelper/index.vue +271 -290
- package/public/aiTools.js +92 -1
- package/es/aiTools-2e1f92d2.cjs +0 -3
- package/es/aiTools-faa0a14d.js +0 -90
- package/es/raf-ba3dfafe.js +0 -6
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { computed as c, getCurrentInstance as Ue, defineComponent as Pe, useAttrs as We, useSlots as Ye, shallowRef as Z, ref as q, watch as J, nextTick as R, onMounted as Xe, toRef as _e, openBlock as d, createElementBlock as S, normalizeClass as m, unref as t, normalizeStyle as be, createCommentVNode as p, Fragment as Q, renderSlot as j, createElementVNode as T, createBlock as C, withCtx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { computed as c, getCurrentInstance as Ue, defineComponent as Pe, useAttrs as We, useSlots as Ye, shallowRef as Z, ref as q, watch as J, nextTick as R, onMounted as Xe, toRef as _e, openBlock as d, createElementBlock as S, normalizeClass as m, unref as t, normalizeStyle as be, createCommentVNode as p, Fragment as Q, renderSlot as j, createElementVNode as T, createBlock as C, withCtx as B, resolveDynamicComponent as L, mergeProps as we, withModifiers as Ge, toDisplayString as U } from "vue";
|
|
2
|
+
import { h as Ze, i as ee, d as qe, f as Je, e as Qe, g as et, V as tt, u as ot } from "./use-form-common-props-c14990b9.js";
|
|
3
|
+
import { B as nt, C as at, D as st, E as O } from "./index-ca91ac68.js";
|
|
4
|
+
import { s as Te, p as xe, b as lt, e as H, c as te, H as rt, u as Se, g as it, N as ut, _ as dt, f as Ce, w as ct } from "./base-29f73b05.js";
|
|
5
5
|
import { m as pt } from "./typescript-7ae59c4c.js";
|
|
6
|
-
import { u as ft, U as oe, d as Ie, I as Ee, C as
|
|
7
|
-
import {
|
|
6
|
+
import { u as ft, U as oe, d as Ie, I as Ee, C as Ne } from "./index-1955f23d.js";
|
|
7
|
+
import { a as vt, u as mt } from "./index-7db02db7.js";
|
|
8
8
|
const ht = () => Te && /firefox/i.test(window.navigator.userAgent);
|
|
9
9
|
let g;
|
|
10
10
|
const yt = {
|
|
@@ -40,7 +40,7 @@ function bt(n) {
|
|
|
40
40
|
f.getPropertyValue(l)
|
|
41
41
|
]), paddingSize: o, borderSize: i, boxSizing: r };
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function ze(n, f = 1, r) {
|
|
44
44
|
var o, i;
|
|
45
45
|
g || (g = document.createElement("textarea"), ((o = n.parentNode) != null ? o : document.body).appendChild(g));
|
|
46
46
|
const { paddingSize: u, borderSize: l, boxSizing: b, contextStyle: w } = bt(n);
|
|
@@ -205,11 +205,11 @@ function Et(n) {
|
|
|
205
205
|
}
|
|
206
206
|
return [r, o];
|
|
207
207
|
}
|
|
208
|
-
const
|
|
209
|
-
name:
|
|
208
|
+
const Nt = "ElInput", zt = Pe({
|
|
209
|
+
name: Nt,
|
|
210
210
|
inheritAttrs: !1
|
|
211
211
|
}), Pt = /* @__PURE__ */ Pe({
|
|
212
|
-
...
|
|
212
|
+
...zt,
|
|
213
213
|
props: wt,
|
|
214
214
|
emits: xt,
|
|
215
215
|
setup(n, { expose: f, emit: r }) {
|
|
@@ -217,7 +217,7 @@ const zt = "ElInput", Nt = Pe({
|
|
|
217
217
|
o.type === "textarea" ? ne.b() : a.b(),
|
|
218
218
|
a.m(y.value),
|
|
219
219
|
a.is("disabled", x.value),
|
|
220
|
-
a.is("exceed",
|
|
220
|
+
a.is("exceed", Be.value),
|
|
221
221
|
{
|
|
222
222
|
[a.b("group")]: l.prepend || l.append,
|
|
223
223
|
[a.m("prefix")]: l.prefix || o.prefixIcon,
|
|
@@ -231,7 +231,7 @@ const zt = "ElInput", Nt = Pe({
|
|
|
231
231
|
a.is("focus", Y.value)
|
|
232
232
|
]), { form: h, formItem: v } = qe(), { inputId: k } = Je(o, {
|
|
233
233
|
formItemContext: v
|
|
234
|
-
}), y = Qe(), x = et(), a = Se("input"), ne = Se("textarea"), $ = Z(), I = Z(), W = q(!1), A = q(!1), ae = q(), D = Z(o.inputStyle),
|
|
234
|
+
}), y = Qe(), x = et(), a = Se("input"), ne = Se("textarea"), $ = Z(), I = Z(), W = q(!1), A = q(!1), ae = q(), D = Z(o.inputStyle), N = c(() => $.value || I.value), { wrapperRef: ke, isFocused: Y, handleFocus: Ve, handleBlur: Fe } = vt(N, {
|
|
235
235
|
disabled: x,
|
|
236
236
|
afterBlur() {
|
|
237
237
|
var e;
|
|
@@ -246,9 +246,9 @@ const zt = "ElInput", Nt = Pe({
|
|
|
246
246
|
o.inputStyle,
|
|
247
247
|
D.value,
|
|
248
248
|
{ resize: o.resize }
|
|
249
|
-
]), E = c(() => it(o.modelValue) ? "" : String(o.modelValue)), K = c(() => o.clearable && !x.value && !o.readonly && !!E.value && (Y.value || W.value)), X = c(() => o.showPassword && !x.value && !!E.value),
|
|
249
|
+
]), E = c(() => it(o.modelValue) ? "" : String(o.modelValue)), K = c(() => o.clearable && !x.value && !o.readonly && !!E.value && (Y.value || W.value)), X = c(() => o.showPassword && !x.value && !!E.value), z = c(() => o.showWordLimit && !!o.maxlength && (o.type === "text" || o.type === "textarea") && !x.value && !o.readonly && !o.showPassword), _ = c(() => E.value.length), Be = c(() => !!z.value && _.value > Number(o.maxlength)), Le = c(() => !!l.suffix || !!o.suffixIcon || K.value || o.showPassword || z.value || !!V.value && se.value), [ie, ue] = Et($);
|
|
250
250
|
ot(I, (e) => {
|
|
251
|
-
if (
|
|
251
|
+
if (Oe(), !z.value || o.resize !== "both")
|
|
252
252
|
return;
|
|
253
253
|
const s = e[0], { width: P } = s.contentRect;
|
|
254
254
|
ae.value = {
|
|
@@ -259,7 +259,7 @@ const zt = "ElInput", Nt = Pe({
|
|
|
259
259
|
const { type: e, autosize: s } = o;
|
|
260
260
|
if (!(!Te || e !== "textarea" || !I.value))
|
|
261
261
|
if (s) {
|
|
262
|
-
const P = Ce(s) ? s.minRows : void 0, ye = Ce(s) ? s.maxRows : void 0, ge =
|
|
262
|
+
const P = Ce(s) ? s.minRows : void 0, ye = Ce(s) ? s.maxRows : void 0, ge = ze(I.value, P, ye);
|
|
263
263
|
D.value = {
|
|
264
264
|
overflowY: "hidden",
|
|
265
265
|
...ge
|
|
@@ -268,9 +268,9 @@ const zt = "ElInput", Nt = Pe({
|
|
|
268
268
|
});
|
|
269
269
|
} else
|
|
270
270
|
D.value = {
|
|
271
|
-
minHeight:
|
|
271
|
+
minHeight: ze(I.value).minHeight
|
|
272
272
|
};
|
|
273
|
-
},
|
|
273
|
+
}, Oe = ((e) => {
|
|
274
274
|
let s = !1;
|
|
275
275
|
return () => {
|
|
276
276
|
var P;
|
|
@@ -279,7 +279,7 @@ const zt = "ElInput", Nt = Pe({
|
|
|
279
279
|
((P = I.value) == null ? void 0 : P.offsetParent) === null || (setTimeout(e), s = !0);
|
|
280
280
|
};
|
|
281
281
|
})(F), M = () => {
|
|
282
|
-
const e =
|
|
282
|
+
const e = N.value, s = o.formatter ? o.formatter(E.value) : E.value;
|
|
283
283
|
!e || e.value === s || (e.value = s);
|
|
284
284
|
}, G = async (e) => {
|
|
285
285
|
ie();
|
|
@@ -293,7 +293,7 @@ const zt = "ElInput", Nt = Pe({
|
|
|
293
293
|
}
|
|
294
294
|
}, de = (e) => {
|
|
295
295
|
let { value: s } = e.target;
|
|
296
|
-
o.formatter && o.parser && (s = o.parser(s)), r(
|
|
296
|
+
o.formatter && o.parser && (s = o.parser(s)), r(Ne, s);
|
|
297
297
|
}, {
|
|
298
298
|
isComposing: ce,
|
|
299
299
|
handleCompositionStart: pe,
|
|
@@ -303,10 +303,10 @@ const zt = "ElInput", Nt = Pe({
|
|
|
303
303
|
ie(), A.value = !A.value, setTimeout(ue);
|
|
304
304
|
}, $e = () => {
|
|
305
305
|
var e;
|
|
306
|
-
return (e =
|
|
306
|
+
return (e = N.value) == null ? void 0 : e.focus();
|
|
307
307
|
}, Ae = () => {
|
|
308
308
|
var e;
|
|
309
|
-
return (e =
|
|
309
|
+
return (e = N.value) == null ? void 0 : e.blur();
|
|
310
310
|
}, De = (e) => {
|
|
311
311
|
W.value = !1, r("mouseleave", e);
|
|
312
312
|
}, Ke = (e) => {
|
|
@@ -315,9 +315,9 @@ const zt = "ElInput", Nt = Pe({
|
|
|
315
315
|
r("keydown", e);
|
|
316
316
|
}, je = () => {
|
|
317
317
|
var e;
|
|
318
|
-
(e =
|
|
318
|
+
(e = N.value) == null || e.select();
|
|
319
319
|
}, he = () => {
|
|
320
|
-
r(oe, ""), r(
|
|
320
|
+
r(oe, ""), r(Ne, ""), r("clear"), r(Ee, "");
|
|
321
321
|
};
|
|
322
322
|
return J(() => o.modelValue, () => {
|
|
323
323
|
var e;
|
|
@@ -329,7 +329,7 @@ const zt = "ElInput", Nt = Pe({
|
|
|
329
329
|
}), f({
|
|
330
330
|
input: $,
|
|
331
331
|
textarea: I,
|
|
332
|
-
ref:
|
|
332
|
+
ref: N,
|
|
333
333
|
textareaStyle: re,
|
|
334
334
|
autosize: _e(o, "autosize"),
|
|
335
335
|
isComposing: ce,
|
|
@@ -373,12 +373,12 @@ const zt = "ElInput", Nt = Pe({
|
|
|
373
373
|
class: m(t(a).e("prefix-inner"))
|
|
374
374
|
}, [
|
|
375
375
|
j(e.$slots, "prefix"),
|
|
376
|
-
e.prefixIcon ? (d(), C(t(
|
|
376
|
+
e.prefixIcon ? (d(), C(t(O), {
|
|
377
377
|
key: 0,
|
|
378
378
|
class: m(t(a).e("icon"))
|
|
379
379
|
}, {
|
|
380
|
-
default:
|
|
381
|
-
(d(), C(
|
|
380
|
+
default: B(() => [
|
|
381
|
+
(d(), C(L(e.prefixIcon)))
|
|
382
382
|
]),
|
|
383
383
|
_: 1
|
|
384
384
|
}, 8, ["class"])) : p("v-if", !0)
|
|
@@ -413,47 +413,47 @@ const zt = "ElInput", Nt = Pe({
|
|
|
413
413
|
onKeydown: me
|
|
414
414
|
}), null, 16, ["id", "name", "minlength", "maxlength", "type", "disabled", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form", "autofocus", "role", "inputmode", "onCompositionstart", "onCompositionupdate", "onCompositionend"]),
|
|
415
415
|
p(" suffix slot "),
|
|
416
|
-
t(
|
|
416
|
+
t(Le) ? (d(), S("span", {
|
|
417
417
|
key: 1,
|
|
418
418
|
class: m(t(a).e("suffix"))
|
|
419
419
|
}, [
|
|
420
420
|
T("span", {
|
|
421
421
|
class: m(t(a).e("suffix-inner"))
|
|
422
422
|
}, [
|
|
423
|
-
!t(K) || !t(X) || !t(
|
|
423
|
+
!t(K) || !t(X) || !t(z) ? (d(), S(Q, { key: 0 }, [
|
|
424
424
|
j(e.$slots, "suffix"),
|
|
425
|
-
e.suffixIcon ? (d(), C(t(
|
|
425
|
+
e.suffixIcon ? (d(), C(t(O), {
|
|
426
426
|
key: 0,
|
|
427
427
|
class: m(t(a).e("icon"))
|
|
428
428
|
}, {
|
|
429
|
-
default:
|
|
430
|
-
(d(), C(
|
|
429
|
+
default: B(() => [
|
|
430
|
+
(d(), C(L(e.suffixIcon)))
|
|
431
431
|
]),
|
|
432
432
|
_: 1
|
|
433
433
|
}, 8, ["class"])) : p("v-if", !0)
|
|
434
434
|
], 64)) : p("v-if", !0),
|
|
435
|
-
t(K) ? (d(), C(t(
|
|
435
|
+
t(K) ? (d(), C(t(O), {
|
|
436
436
|
key: 1,
|
|
437
437
|
class: m([t(a).e("icon"), t(a).e("clear")]),
|
|
438
438
|
onMousedown: Ge(t(ut), ["prevent"]),
|
|
439
439
|
onClick: he
|
|
440
440
|
}, {
|
|
441
|
-
default:
|
|
442
|
-
(d(), C(
|
|
441
|
+
default: B(() => [
|
|
442
|
+
(d(), C(L(e.clearIcon)))
|
|
443
443
|
]),
|
|
444
444
|
_: 1
|
|
445
445
|
}, 8, ["class", "onMousedown"])) : p("v-if", !0),
|
|
446
|
-
t(X) ? (d(), C(t(
|
|
446
|
+
t(X) ? (d(), C(t(O), {
|
|
447
447
|
key: 2,
|
|
448
448
|
class: m([t(a).e("icon"), t(a).e("password")]),
|
|
449
449
|
onClick: He
|
|
450
450
|
}, {
|
|
451
|
-
default:
|
|
452
|
-
(d(), C(
|
|
451
|
+
default: B(() => [
|
|
452
|
+
(d(), C(L(t(Me))))
|
|
453
453
|
]),
|
|
454
454
|
_: 1
|
|
455
455
|
}, 8, ["class"])) : p("v-if", !0),
|
|
456
|
-
t(
|
|
456
|
+
t(z) ? (d(), S("span", {
|
|
457
457
|
key: 3,
|
|
458
458
|
class: m(t(a).e("count"))
|
|
459
459
|
}, [
|
|
@@ -461,7 +461,7 @@ const zt = "ElInput", Nt = Pe({
|
|
|
461
461
|
class: m(t(a).e("count-inner"))
|
|
462
462
|
}, U(t(_)) + " / " + U(e.maxlength), 3)
|
|
463
463
|
], 2)) : p("v-if", !0),
|
|
464
|
-
t(V) && t(le) && t(se) ? (d(), C(t(
|
|
464
|
+
t(V) && t(le) && t(se) ? (d(), C(t(O), {
|
|
465
465
|
key: 4,
|
|
466
466
|
class: m([
|
|
467
467
|
t(a).e("icon"),
|
|
@@ -469,8 +469,8 @@ const zt = "ElInput", Nt = Pe({
|
|
|
469
469
|
t(a).is("loading", t(V) === "validating")
|
|
470
470
|
])
|
|
471
471
|
}, {
|
|
472
|
-
default:
|
|
473
|
-
(d(), C(
|
|
472
|
+
default: B(() => [
|
|
473
|
+
(d(), C(L(t(le))))
|
|
474
474
|
]),
|
|
475
475
|
_: 1
|
|
476
476
|
}, 8, ["class"])) : p("v-if", !0)
|
|
@@ -514,7 +514,7 @@ const zt = "ElInput", Nt = Pe({
|
|
|
514
514
|
onChange: de,
|
|
515
515
|
onKeydown: me
|
|
516
516
|
}), null, 16, ["id", "minlength", "maxlength", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form", "autofocus", "rows", "role", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onFocus", "onBlur"]),
|
|
517
|
-
t(
|
|
517
|
+
t(z) ? (d(), S("span", {
|
|
518
518
|
key: 0,
|
|
519
519
|
style: be(ae.value),
|
|
520
520
|
class: m(t(a).e("count"))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=require("vue"),W=require("./el-input-
|
|
1
|
+
"use strict";const n=require("vue"),W=require("./el-input-094afbe2.cjs"),E=require("./index-3792552a.cjs"),l=require("./base-ef747d02.cjs"),g=require("./use-form-common-props-00ec25ac.cjs"),c=require("./index-bf98dd03.cjs"),X=require("./index-bb833443.cjs"),Y=100,j=600,L={beforeMount(o,v){const d=v.value,{interval:u=Y,delay:h=j}=l.isFunction(d)?{}:d;let f,p;const i=()=>l.isFunction(d)?d():d.handler(),b=()=>{p&&(clearTimeout(p),p=void 0),f&&(clearInterval(f),f=void 0)};o.addEventListener("mousedown",y=>{y.button===0&&(b(),i(),document.addEventListener("mouseup",()=>b(),{once:!0}),p=setTimeout(()=>{f=setInterval(()=>{i()},u)},h))})}},J=l.buildProps({id:{type:String,default:void 0},step:{type:Number,default:1},stepStrictly:Boolean,max:{type:Number,default:Number.MAX_SAFE_INTEGER},min:{type:Number,default:Number.MIN_SAFE_INTEGER},modelValue:{type:[Number,null]},readonly:Boolean,disabled:Boolean,size:g.useSizeProp,controls:{type:Boolean,default:!0},controlsPosition:{type:String,default:"",values:["","right"]},valueOnClear:{type:[String,Number,null],validator:o=>o===null||l.isNumber(o)||["min","max"].includes(o),default:null},name:String,placeholder:String,precision:{type:Number,validator:o=>o>=0&&o===Number.parseInt(`${o}`,10)},validateEvent:{type:Boolean,default:!0},...c.useAriaProps(["ariaLabel"]),inputmode:{type:l.definePropType(String),default:void 0},align:{type:l.definePropType(String),default:"center"},disabledScientific:Boolean}),Q={[c.CHANGE_EVENT]:(o,v)=>v!==o,blur:o=>o instanceof FocusEvent,focus:o=>o instanceof FocusEvent,[c.INPUT_EVENT]:o=>l.isNumber(o)||l.isNil(o),[c.UPDATE_MODEL_EVENT]:o=>l.isNumber(o)||l.isNil(o)},Z=n.defineComponent({name:"ElInputNumber"}),ee=n.defineComponent({...Z,props:J,emits:Q,setup(o,{expose:v,emit:d}){const u=o,{t:h}=X.useLocale(),f=l.useNamespace("input-number"),p=n.ref(),i=n.reactive({currentValue:u.modelValue,userInput:null}),{formItem:b}=g.useFormItem(),y=n.computed(()=>l.isNumber(u.modelValue)&&u.modelValue<=u.min),B=n.computed(()=>l.isNumber(u.modelValue)&&u.modelValue>=u.max),x=n.computed(()=>{const e=M(u.step);return l.isUndefined(u.precision)?Math.max(M(u.modelValue),e):(e>u.precision,u.precision)}),w=n.computed(()=>u.controls&&u.controlsPosition==="right"),F=g.useFormSize(),V=g.useFormDisabled(),S=n.computed(()=>{if(i.userInput!==null)return i.userInput;let e=i.currentValue;if(l.isNil(e))return"";if(l.isNumber(e)){if(Number.isNaN(e))return"";l.isUndefined(u.precision)||(e=e.toFixed(u.precision))}return e}),A=(e,t)=>{if(l.isUndefined(t)&&(t=x.value),t===0)return Math.round(e);let r=String(e);const a=r.indexOf(".");if(a===-1||!r.replace(".","").split("")[a+t])return e;const I=r.length;return r.charAt(I-1)==="5"&&(r=`${r.slice(0,Math.max(0,I-1))}6`),Number.parseFloat(Number(r).toFixed(t))},M=e=>{if(l.isNil(e))return 0;const t=e.toString(),r=t.indexOf(".");let a=0;return r!==-1&&(a=t.length-r-1),a},U=(e,t=1)=>l.isNumber(e)?e>=Number.MAX_SAFE_INTEGER&&t===1||e<=Number.MIN_SAFE_INTEGER&&t===-1?e:A(e+u.step*t):i.currentValue,O=e=>{var t;const r=e;if(u.disabledScientific&&["e","E"].includes(r.key)){r.preventDefault();return}const a={[c.EVENT_CODE.up]:()=>{r.preventDefault(),P()},[c.EVENT_CODE.down]:()=>{r.preventDefault(),D()}};(t=a[r.key])==null||t.call(a)},P=()=>{if(u.readonly||V.value||B.value)return;const e=Number(S.value)||0,t=U(e);_(t),d(c.INPUT_EVENT,i.currentValue),C()},D=()=>{if(u.readonly||V.value||y.value)return;const e=Number(S.value)||0,t=U(e,-1);_(t),d(c.INPUT_EVENT,i.currentValue),C()},k=(e,t)=>{const{max:r,min:a,step:s,precision:N,stepStrictly:I,valueOnClear:T}=u;r<a&&c.throwError("InputNumber","min should not be greater than max.");let m=Number(e);if(l.isNil(e)||Number.isNaN(m))return null;if(e===""){if(T===null)return null;m=l.isString(T)?{min:a,max:r}[T]:T}return I&&(m=A(Math.round(m/s)*s,N),m!==e&&t&&d(c.UPDATE_MODEL_EVENT,m)),l.isUndefined(N)||(m=A(m,N)),(m>r||m<a)&&(m=m>r?r:a,t&&d(c.UPDATE_MODEL_EVENT,m)),m},_=(e,t=!0)=>{var r;const a=i.currentValue,s=k(e);if(!t){d(c.UPDATE_MODEL_EVENT,s);return}a===s&&e||(i.userInput=null,d(c.UPDATE_MODEL_EVENT,s),a!==s&&d(c.CHANGE_EVENT,s,a),u.validateEvent&&((r=b==null?void 0:b.validate)==null||r.call(b,"change").catch(N=>c.debugWarn())),i.currentValue=s)},$=e=>{i.userInput=e;const t=e===""?null:Number(e);d(c.INPUT_EVENT,t),_(t,!1)},z=e=>{const t=e!==""?Number(e):"";(l.isNumber(t)&&!Number.isNaN(t)||e==="")&&_(t),C(),i.userInput=null},R=()=>{var e,t;(t=(e=p.value)==null?void 0:e.focus)==null||t.call(e)},K=()=>{var e,t;(t=(e=p.value)==null?void 0:e.blur)==null||t.call(e)},q=e=>{d("focus",e)},G=e=>{var t,r;i.userInput=null,i.currentValue===null&&((t=p.value)!=null&&t.input)&&(p.value.input.value=""),d("blur",e),u.validateEvent&&((r=b==null?void 0:b.validate)==null||r.call(b,"blur").catch(a=>c.debugWarn()))},C=()=>{i.currentValue!==u.modelValue&&(i.currentValue=u.modelValue)},H=e=>{document.activeElement===e.target&&e.preventDefault()};return n.watch(()=>u.modelValue,(e,t)=>{const r=k(e,!0);i.userInput===null&&r!==t&&(i.currentValue=r)},{immediate:!0}),n.watch(()=>u.precision,()=>{i.currentValue=k(u.modelValue)}),n.onMounted(()=>{var e;const{min:t,max:r,modelValue:a}=u,s=(e=p.value)==null?void 0:e.input;if(s.setAttribute("role","spinbutton"),Number.isFinite(r)?s.setAttribute("aria-valuemax",String(r)):s.removeAttribute("aria-valuemax"),Number.isFinite(t)?s.setAttribute("aria-valuemin",String(t)):s.removeAttribute("aria-valuemin"),s.setAttribute("aria-valuenow",i.currentValue||i.currentValue===0?String(i.currentValue):""),s.setAttribute("aria-disabled",String(V.value)),!l.isNumber(a)&&a!=null){let N=Number(a);Number.isNaN(N)&&(N=null),d(c.UPDATE_MODEL_EVENT,N)}s.addEventListener("wheel",H,{passive:!1})}),n.onUpdated(()=>{var e,t;const r=(e=p.value)==null?void 0:e.input;r==null||r.setAttribute("aria-valuenow",`${(t=i.currentValue)!=null?t:""}`)}),v({focus:R,blur:K}),(e,t)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass([n.unref(f).b(),n.unref(f).m(n.unref(F)),n.unref(f).is("disabled",n.unref(V)),n.unref(f).is("without-controls",!e.controls),n.unref(f).is("controls-right",n.unref(w)),n.unref(f).is(e.align,!!e.align)]),onDragstart:n.withModifiers(()=>{},["prevent"])},[e.controls?n.withDirectives((n.openBlock(),n.createElementBlock("span",{key:0,role:"button","aria-label":n.unref(h)("el.inputNumber.decrease"),class:n.normalizeClass([n.unref(f).e("decrease"),n.unref(f).is("disabled",n.unref(y))]),onKeydown:n.withKeys(D,["enter"])},[n.renderSlot(e.$slots,"decrease-icon",{},()=>[n.createVNode(n.unref(E.ElIcon),null,{default:n.withCtx(()=>[n.unref(w)?(n.openBlock(),n.createBlock(n.unref(E.arrow_down_default),{key:0})):(n.openBlock(),n.createBlock(n.unref(E.minus_default),{key:1}))]),_:1})])],42,["aria-label","onKeydown"])),[[n.unref(L),D]]):n.createCommentVNode("v-if",!0),e.controls?n.withDirectives((n.openBlock(),n.createElementBlock("span",{key:1,role:"button","aria-label":n.unref(h)("el.inputNumber.increase"),class:n.normalizeClass([n.unref(f).e("increase"),n.unref(f).is("disabled",n.unref(B))]),onKeydown:n.withKeys(P,["enter"])},[n.renderSlot(e.$slots,"increase-icon",{},()=>[n.createVNode(n.unref(E.ElIcon),null,{default:n.withCtx(()=>[n.unref(w)?(n.openBlock(),n.createBlock(n.unref(E.arrow_up_default),{key:0})):(n.openBlock(),n.createBlock(n.unref(E.plus_default),{key:1}))]),_:1})])],42,["aria-label","onKeydown"])),[[n.unref(L),P]]):n.createCommentVNode("v-if",!0),n.createVNode(n.unref(W.ElInput),{id:e.id,ref_key:"input",ref:p,type:"number",step:e.step,"model-value":n.unref(S),placeholder:e.placeholder,readonly:e.readonly,disabled:n.unref(V),size:n.unref(F),max:e.max,min:e.min,name:e.name,"aria-label":e.ariaLabel,"validate-event":!1,inputmode:e.inputmode,onKeydown:O,onBlur:G,onFocus:q,onInput:$,onChange:z},n.createSlots({_:2},[e.$slots.prefix?{name:"prefix",fn:n.withCtx(()=>[n.renderSlot(e.$slots,"prefix")])}:void 0,e.$slots.suffix?{name:"suffix",fn:n.withCtx(()=>[n.renderSlot(e.$slots,"suffix")])}:void 0]),1032,["id","step","model-value","placeholder","readonly","disabled","size","max","min","name","aria-label","inputmode"])],42,["onDragstart"]))}});var ne=l._export_sfc(ee,[["__file","input-number.vue"]]);const te=l.withInstall(ne);exports.ElInputNumber=te;
|
|
@@ -1,10 +1,10 @@
|
|
|
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
|
|
2
|
-
import { E as Ve } from "./el-input-
|
|
3
|
-
import { E as q,
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { u as
|
|
7
|
-
import { u as Be } from "./index-
|
|
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-58786d42.js";
|
|
3
|
+
import { E as q, f as he, z as ye, A as Ie, x as ge } from "./index-ca91ac68.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-29f73b05.js";
|
|
5
|
+
import { h as Fe, d as Te, e as De, g as ke } from "./use-form-common-props-c14990b9.js";
|
|
6
|
+
import { u as Ce, C as re, I as D, U as N, a as Me, d as Z, E as ee } from "./index-1955f23d.js";
|
|
7
|
+
import { u as Be } from "./index-de24705f.js";
|
|
8
8
|
const xe = 100, Le = 600, ne = {
|
|
9
9
|
beforeMount(u, E) {
|
|
10
10
|
const s = E.value, { interval: r = xe, delay: I = Le } = J(s) ? {} : s;
|
|
@@ -70,7 +70,7 @@ const xe = 100, Le = 600, ne = {
|
|
|
70
70
|
type: Boolean,
|
|
71
71
|
default: !0
|
|
72
72
|
},
|
|
73
|
-
...
|
|
73
|
+
...Ce(["ariaLabel"]),
|
|
74
74
|
inputmode: {
|
|
75
75
|
type: Q(String),
|
|
76
76
|
default: void 0
|
|
@@ -84,7 +84,7 @@ const xe = 100, Le = 600, ne = {
|
|
|
84
84
|
[re]: (u, E) => E !== u,
|
|
85
85
|
blur: (u) => u instanceof FocusEvent,
|
|
86
86
|
focus: (u) => u instanceof FocusEvent,
|
|
87
|
-
[
|
|
87
|
+
[D]: (u) => b(u) || y(u),
|
|
88
88
|
[N]: (u) => b(u) || y(u)
|
|
89
89
|
}, ze = te({
|
|
90
90
|
name: "ElInputNumber"
|
|
@@ -96,10 +96,10 @@ const xe = 100, Le = 600, ne = {
|
|
|
96
96
|
const r = u, { t: I } = Be(), d = _e("input-number"), m = pe(), a = fe({
|
|
97
97
|
currentValue: r.modelValue,
|
|
98
98
|
userInput: null
|
|
99
|
-
}), { formItem: p } = Te(), g = h(() => b(r.modelValue) && r.modelValue <= r.min),
|
|
99
|
+
}), { formItem: p } = Te(), g = h(() => b(r.modelValue) && r.modelValue <= r.min), O = h(() => b(r.modelValue) && r.modelValue >= r.max), le = h(() => {
|
|
100
100
|
const e = U(r.step);
|
|
101
101
|
return T(r.precision) ? Math.max(U(r.modelValue), e) : (e > r.precision, r.precision);
|
|
102
|
-
}),
|
|
102
|
+
}), k = h(() => r.controls && r.controlsPosition === "right"), G = De(), V = ke(), C = h(() => {
|
|
103
103
|
if (a.userInput !== null)
|
|
104
104
|
return a.userInput;
|
|
105
105
|
let e = a.currentValue;
|
|
@@ -143,15 +143,15 @@ const xe = 100, Le = 600, ne = {
|
|
|
143
143
|
};
|
|
144
144
|
(n = i[t.key]) == null || n.call(i);
|
|
145
145
|
}, B = () => {
|
|
146
|
-
if (r.readonly || V.value ||
|
|
146
|
+
if (r.readonly || V.value || O.value)
|
|
147
147
|
return;
|
|
148
|
-
const e = Number(
|
|
149
|
-
w(n), s(
|
|
148
|
+
const e = Number(C.value) || 0, n = H(e);
|
|
149
|
+
w(n), s(D, a.currentValue), R();
|
|
150
150
|
}, x = () => {
|
|
151
151
|
if (r.readonly || V.value || g.value)
|
|
152
152
|
return;
|
|
153
|
-
const e = Number(
|
|
154
|
-
w(n), s(
|
|
153
|
+
const e = Number(C.value) || 0, n = H(e, -1);
|
|
154
|
+
w(n), s(D, a.currentValue), R();
|
|
155
155
|
}, L = (e, n) => {
|
|
156
156
|
const { max: t, min: i, step: o, precision: f, stepStrictly: _, valueOnClear: S } = r;
|
|
157
157
|
t < i && Me("InputNumber", "min should not be greater than max.");
|
|
@@ -175,7 +175,7 @@ const xe = 100, Le = 600, ne = {
|
|
|
175
175
|
}, ue = (e) => {
|
|
176
176
|
a.userInput = e;
|
|
177
177
|
const n = e === "" ? null : Number(e);
|
|
178
|
-
s(
|
|
178
|
+
s(D, n), w(n, !1);
|
|
179
179
|
}, ie = (e) => {
|
|
180
180
|
const n = e !== "" ? Number(e) : "";
|
|
181
181
|
(b(n) && !Number.isNaN(n) || e === "") && w(n), R(), a.userInput = null;
|
|
@@ -218,10 +218,10 @@ const xe = 100, Le = 600, ne = {
|
|
|
218
218
|
}), (e, n) => (v(), $("div", {
|
|
219
219
|
class: z([
|
|
220
220
|
l(d).b(),
|
|
221
|
-
l(d).m(l(
|
|
221
|
+
l(d).m(l(G)),
|
|
222
222
|
l(d).is("disabled", l(V)),
|
|
223
223
|
l(d).is("without-controls", !e.controls),
|
|
224
|
-
l(d).is("controls-right", l(
|
|
224
|
+
l(d).is("controls-right", l(k)),
|
|
225
225
|
l(d).is(e.align, !!e.align)
|
|
226
226
|
]),
|
|
227
227
|
onDragstart: Ne(() => {
|
|
@@ -232,48 +232,48 @@ const xe = 100, Le = 600, ne = {
|
|
|
232
232
|
role: "button",
|
|
233
233
|
"aria-label": l(I)("el.inputNumber.decrease"),
|
|
234
234
|
class: z([l(d).e("decrease"), l(d).is("disabled", l(g))]),
|
|
235
|
-
onKeydown:
|
|
235
|
+
onKeydown: Y(x, ["enter"])
|
|
236
236
|
}, [
|
|
237
237
|
A(e.$slots, "decrease-icon", {}, () => [
|
|
238
238
|
K(l(q), null, {
|
|
239
239
|
default: P(() => [
|
|
240
|
-
l(
|
|
240
|
+
l(k) ? (v(), F(l(he), { key: 0 })) : (v(), F(l(ye), { key: 1 }))
|
|
241
241
|
]),
|
|
242
242
|
_: 1
|
|
243
243
|
})
|
|
244
244
|
])
|
|
245
245
|
], 42, ["aria-label", "onKeydown"])), [
|
|
246
246
|
[l(ne), x]
|
|
247
|
-
]) :
|
|
247
|
+
]) : j("v-if", !0),
|
|
248
248
|
e.controls ? X((v(), $("span", {
|
|
249
249
|
key: 1,
|
|
250
250
|
role: "button",
|
|
251
251
|
"aria-label": l(I)("el.inputNumber.increase"),
|
|
252
|
-
class: z([l(d).e("increase"), l(d).is("disabled", l(
|
|
253
|
-
onKeydown:
|
|
252
|
+
class: z([l(d).e("increase"), l(d).is("disabled", l(O))]),
|
|
253
|
+
onKeydown: Y(B, ["enter"])
|
|
254
254
|
}, [
|
|
255
255
|
A(e.$slots, "increase-icon", {}, () => [
|
|
256
256
|
K(l(q), null, {
|
|
257
257
|
default: P(() => [
|
|
258
|
-
l(
|
|
258
|
+
l(k) ? (v(), F(l(Ie), { key: 0 })) : (v(), F(l(ge), { key: 1 }))
|
|
259
259
|
]),
|
|
260
260
|
_: 1
|
|
261
261
|
})
|
|
262
262
|
])
|
|
263
263
|
], 42, ["aria-label", "onKeydown"])), [
|
|
264
264
|
[l(ne), B]
|
|
265
|
-
]) :
|
|
265
|
+
]) : j("v-if", !0),
|
|
266
266
|
K(l(Ve), {
|
|
267
267
|
id: e.id,
|
|
268
268
|
ref_key: "input",
|
|
269
269
|
ref: m,
|
|
270
270
|
type: "number",
|
|
271
271
|
step: e.step,
|
|
272
|
-
"model-value": l(
|
|
272
|
+
"model-value": l(C),
|
|
273
273
|
placeholder: e.placeholder,
|
|
274
274
|
readonly: e.readonly,
|
|
275
275
|
disabled: l(V),
|
|
276
|
-
size: l(
|
|
276
|
+
size: l(G),
|
|
277
277
|
max: e.max,
|
|
278
278
|
min: e.min,
|
|
279
279
|
name: e.name,
|
|
@@ -304,8 +304,8 @@ const xe = 100, Le = 600, ne = {
|
|
|
304
304
|
], 42, ["onDragstart"]));
|
|
305
305
|
}
|
|
306
306
|
});
|
|
307
|
-
var
|
|
308
|
-
const qe = Pe(
|
|
307
|
+
var Oe = /* @__PURE__ */ Se(Ke, [["__file", "input-number.vue"]]);
|
|
308
|
+
const qe = Pe(Oe);
|
|
309
309
|
export {
|
|
310
310
|
qe as E
|
|
311
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-28efb416.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 { r as C,
|
|
2
|
+
import { u as K } from "./use-global-config-a01b5ce1.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-29f73b05.js";
|
|
4
4
|
function Z(e, t) {
|
|
5
5
|
let n;
|
|
6
6
|
const s = B(!1), o = P({
|
|
@@ -42,10 +42,10 @@ function Z(e, t) {
|
|
|
42
42
|
ns: i,
|
|
43
43
|
zIndex: T
|
|
44
44
|
}), () => {
|
|
45
|
-
const
|
|
45
|
+
const A = o.spinner || o.svg, V = m("svg", {
|
|
46
46
|
class: "circular",
|
|
47
47
|
viewBox: o.svgViewBox ? o.svgViewBox : "0 0 50 50",
|
|
48
|
-
...
|
|
48
|
+
...A ? { innerHTML: A } : {}
|
|
49
49
|
}, [
|
|
50
50
|
m("circle", {
|
|
51
51
|
class: "path",
|
|
@@ -146,7 +146,7 @@ const L = function(e = {}) {
|
|
|
146
146
|
n.$el.style[r] = c;
|
|
147
147
|
}, h = (e, t, n) => {
|
|
148
148
|
const s = n.vm.ns || n.vm._.exposed.ns;
|
|
149
|
-
["absolute", "fixed", "sticky"].includes(n.originalPosition.value) ? C(t, s.bm("parent", "relative")) :
|
|
149
|
+
["absolute", "fixed", "sticky"].includes(n.originalPosition.value) ? C(t, s.bm("parent", "relative")) : k(t, s.bm("parent", "relative")), e.fullscreen && e.lock ? k(t, s.bm("parent", "hidden")) : C(t, s.bm("parent", "hidden"));
|
|
150
150
|
};
|
|
151
151
|
L._context = null;
|
|
152
152
|
const x = Symbol("ElLoading"), f = (e) => `element-loading-${Y(e)}`, w = (e, t) => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),P=require("./use-form-common-props-00ec25ac.cjs"),H=require("./index-3792552a.cjs"),f=require("./index-bf98dd03.cjs"),a=require("./base-ef747d02.cjs"),ee=require("./el-popper-ce575c12.cjs"),ae=require("./index-eea0bcb3.cjs"),ue=require("./el-tag-f48b1190.cjs"),re=require("./typescript-b63f8e83.cjs"),ie=require("./vnode-b906ae6d.cjs"),ce=e.defineComponent({name:"ElCollapseTransition"}),de=e.defineComponent({...ce,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 pe=a._export_sfc(de,[["__file","collapse-transition.vue"]]);const me=a.withInstall(pe);let fe=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})})}},ve=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 fe(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()})}},he=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 ve(s,o)})}};const ge=e.defineComponent({name:"ElMenuCollapseTransition"}),be=e.defineComponent({...ge,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 Ee=a._export_sfc(be,[["__file","menu-collapse-transition.vue"]]);function te(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 Me(n){return e.computed(()=>{const i=n.backgroundColor;return i?new ae.TinyColor(i).shade(20).toString():""})}const ne=(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":Me(n).value||"","active-color":n.activeTextColor||"",level:`${o}`}))},Q="rootMenu",U="subMenu:",ye=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:ye,setup(n,{slots:o,expose:i}){const s=e.getCurrentInstance(),{indexPath:t,parentMenu:b}=te(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=ne(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(ee.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(me,{},{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 Ce=a.buildProps({mode:{type:String,values:["horizontal","vertical"],default:"vertical"},defaultActive:{type:String,default:""},defaultOpeneds:{type:a.definePropType(Array),default:()=>re.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)),xe={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 Ie=e.defineComponent({name:"ElMenu",props:Ce,emits:xe,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,le)=>{S+=k(O),S<=v-N&&(I=le+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 he(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=ne(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=ie.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?[[ue.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(Ee,()=>g):g}}});const _e=a.buildProps({index:{type:a.definePropType([String,null]),default:null},route:{type:a.definePropType([String,Object])},disabled:Boolean}),Te={click:n=>a.isString(n.index)&&a.isArray(n.indexPath)},Z="ElMenuItem",Se=e.defineComponent({name:Z}),Ne=e.defineComponent({...Se,props:_e,emits:Te,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}=te(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(ee.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 oe=a._export_sfc(Ne,[["__file","menu-item.vue"]]);const we={title:String},ke=e.defineComponent({name:"ElMenuItemGroup"}),Oe=e.defineComponent({...ke,props:we,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 se=a._export_sfc(Oe,[["__file","menu-item-group.vue"]]);const Pe=a.withInstall(Ie,{MenuItem:oe,MenuItemGroup:se,SubMenu:X}),Be=a.withNoopInstall(oe);a.withNoopInstall(se);a.withNoopInstall(X);exports.ElMenu=Pe;exports.ElMenuItem=Be;
|