st-comp 0.0.267 → 0.0.269
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components.d.ts +1 -0
- package/es/CustomFunction.cjs +1 -1
- package/es/CustomFunction.js +22 -22
- package/es/FactorWarning.cjs +1 -1
- package/es/FactorWarning.js +26 -26
- package/es/Kline.cjs +1 -1
- package/es/Kline.js +11 -11
- package/es/KlineBasic.cjs +1 -1
- package/es/KlineBasic.js +19 -19
- package/es/KlineConfig.cjs +1 -1
- package/es/KlineConfig.js +16 -16
- package/es/KlineNew.cjs +1 -1
- package/es/KlineNew.js +10 -10
- package/es/KlinePlus.cjs +1 -1
- package/es/KlinePlus.js +12 -12
- package/es/MonacoEditor.cjs +1 -1
- package/es/MonacoEditor.js +18 -18
- package/es/Pagination.cjs +1 -1
- package/es/Pagination.js +14 -14
- package/es/PasswordPrompt.cjs +1 -1
- package/es/PasswordPrompt.js +2 -2
- package/es/Table.cjs +1 -1
- package/es/Table.js +18 -18
- package/es/User.cjs +1 -1
- package/es/User.js +19 -19
- package/es/VarSelectDialog.cjs +1 -1
- package/es/VarSelectDialog.js +19 -19
- package/es/VarietyAiHelper.cjs +8 -3
- package/es/VarietyAiHelper.js +485 -306
- package/es/VarietyAutoComplete.cjs +1 -1
- package/es/VarietyAutoComplete.js +8 -8
- package/es/VarietySearch.cjs +1 -1
- package/es/VarietySearch.js +31 -31
- package/es/{VarietySelect-639a8d9a.cjs → VarietySelect-7da473c5.cjs} +1 -1
- package/es/{VarietySelect-1ac10ec2.js → VarietySelect-b01281d3.js} +3 -3
- package/es/VarietyTextCopy.cjs +1 -1
- package/es/VarietyTextCopy.js +10 -10
- package/es/VirtualTable.cjs +1 -1
- package/es/VirtualTable.js +66 -66
- package/es/{_initCloneObject-6b8c230e.js → _initCloneObject-6243b839.js} +2 -2
- package/es/{_initCloneObject-9eddcb0c.cjs → _initCloneObject-76e116d0.cjs} +1 -1
- package/es/aiTools-275c9799.cjs +4 -0
- package/es/aiTools-9c59a74a.js +149 -0
- package/es/aiTools.js +121 -27
- package/es/{config-provider-56193d47.js → config-provider-20b05e99.js} +3 -3
- package/es/{config-provider-ea286661.cjs → config-provider-4c784baf.cjs} +1 -1
- package/es/{dropdown-f30148cc.cjs → dropdown-33c19e56.cjs} +1 -1
- package/es/{dropdown-4e541d60.js → dropdown-f8d9fe56.js} +3 -3
- package/es/{el-autocomplete-4b521c83.js → el-autocomplete-3f34a1c3.js} +6 -6
- package/es/{el-autocomplete-3949e68c.cjs → el-autocomplete-525ca867.cjs} +1 -1
- package/es/{el-button-dd065de0.cjs → el-button-13dc915f.cjs} +1 -1
- package/es/{el-button-4f201000.js → el-button-cd144ee1.js} +3 -3
- package/es/{el-checkbox-02ce40f0.cjs → el-checkbox-95325acd.cjs} +1 -1
- package/es/{el-checkbox-33cb73db.js → el-checkbox-d6c883f4.js} +3 -3
- package/es/{el-dialog-6501a151.cjs → el-dialog-4056070b.cjs} +1 -1
- package/es/{el-dialog-1939f7c5.js → el-dialog-59a23c2b.js} +4 -4
- package/es/{el-form-item-316b35d8.cjs → el-form-item-3475aaad.cjs} +1 -1
- package/es/{el-form-item-ea11211d.js → el-form-item-a9556441.js} +5 -5
- package/es/{el-input-58786d42.js → el-input-1f14a6e2.js} +33 -33
- package/es/{el-input-094afbe2.cjs → el-input-c7bf8e44.cjs} +1 -1
- package/es/{el-input-number-a7971697.js → el-input-number-411ac93d.js} +12 -12
- package/es/{el-input-number-a609a5e3.cjs → el-input-number-9d810842.cjs} +1 -1
- package/es/{el-loading-d171ce64.cjs → el-loading-84dde1a8.cjs} +1 -1
- package/es/{el-loading-f3815921.js → el-loading-cbeb3b86.js} +1 -1
- package/es/{el-menu-item-3d1e0aff.cjs → el-menu-item-18d7d869.cjs} +1 -1
- package/es/{el-menu-item-a166b997.js → el-menu-item-77152904.js} +5 -5
- package/es/{el-message-box-f2b667e9.js → el-message-box-a26e3ed4.js} +9 -9
- package/es/{el-message-box-b8ffcf34.cjs → el-message-box-e4b8cc99.cjs} +1 -1
- package/es/{el-overlay-1dfe3675.js → el-overlay-465cd11e.js} +3 -3
- package/es/{el-overlay-a94f8a98.cjs → el-overlay-d26a1b98.cjs} +1 -1
- package/es/{el-popconfirm-70e2849c.cjs → el-popconfirm-12f6f35c.cjs} +1 -1
- package/es/{el-popconfirm-ca31ceea.js → el-popconfirm-289b3e89.js} +5 -5
- package/es/{el-popper-ce575c12.cjs → el-popper-c7648df6.cjs} +1 -1
- package/es/{el-popper-db6c599f.js → el-popper-f96fc206.js} +2 -2
- package/es/{el-segmented-741f2252.js → el-segmented-598b92b0.js} +2 -2
- package/es/{el-segmented-4d50b63f.cjs → el-segmented-f0bce6f2.cjs} +1 -1
- package/es/{el-select-086bcb6c.js → el-select-d47b5923.js} +9 -9
- package/es/{el-select-2ebc8380.cjs → el-select-f3cc464f.cjs} +1 -1
- package/es/{el-table-column-2f07fbdb.cjs → el-table-column-220ae131.cjs} +1 -1
- package/es/{el-table-column-8a15378a.js → el-table-column-f1017e75.js} +10 -10
- package/es/{el-tag-65a99986.js → el-tag-0a4197f5.js} +2 -2
- package/es/{el-tag-f48b1190.cjs → el-tag-51bd491c.cjs} +1 -1
- package/es/{el-text-33359f44.cjs → el-text-abf10fdf.cjs} +1 -1
- package/es/{el-text-cbb693f2.js → el-text-c3ee80fe.js} +1 -1
- package/es/{index-18565979.cjs → index-0986e373.cjs} +1 -1
- package/es/{index-4f900527.cjs → index-09ce1753.cjs} +1 -1
- package/es/{index-8b055879.cjs → index-0ff5fe69.cjs} +2 -2
- package/es/{index-ca91ac68.js → index-1b97095f.js} +83 -68
- package/es/{index-ff26b1a6.js → index-3301d870.js} +2 -2
- package/es/{index-1e91e986.js → index-33430c9f.js} +1 -1
- package/es/{index-0f767104.cjs → index-3ed7914e.cjs} +1 -1
- package/es/index-476c4459.cjs +1 -0
- package/es/{index-072c4a65.js → index-499cf989.js} +5 -5
- package/es/{index-21e8d2bc.cjs → index-4b95bae1.cjs} +1 -1
- package/es/{index-8439d2f9.cjs → index-60c69dd1.cjs} +1 -1
- package/es/{index-57d82da0.js → index-67180968.js} +2 -2
- package/es/{index-bf98dd03.cjs → index-68798830.cjs} +1 -1
- package/es/{index-d857270a.js → index-89cc0265.js} +9 -9
- package/es/{index-1955f23d.js → index-8e88a0bd.js} +1 -1
- package/es/{index-a4e252a0.js → index-a17c90c5.js} +1 -1
- package/es/{index-b51915a2.js → index-afc4a1e5.js} +2 -2
- package/es/{index-7eb88616.cjs → index-cfcd60ca.cjs} +1 -1
- package/es/{index-5b546f7d.cjs → index-d2cfd4a3.cjs} +1 -1
- package/es/{index-7db02db7.js → index-d3e9a6f2.js} +2 -2
- package/es/{python-ad9239f9.js → python-c00abcbd.js} +18 -18
- package/es/{python-5b5c9c58.cjs → python-e528f42b.cjs} +1 -1
- package/es/style.css +1 -1
- package/es/{use-form-common-props-00ec25ac.cjs → use-form-common-props-02be4928.cjs} +1 -1
- package/es/{use-form-common-props-c14990b9.js → use-form-common-props-dd9617de.js} +12 -12
- package/es/{use-global-config-28efb416.cjs → use-global-config-31b3ec57.cjs} +1 -1
- package/es/{use-global-config-a01b5ce1.js → use-global-config-4dfc7236.js} +2 -2
- package/es/{validator-65de1caf.js → validator-029bfc98.js} +1 -1
- package/es/{validator-119fdaf4.cjs → validator-ea292506.cjs} +1 -1
- package/es/{zh-cn-9fb29a39.cjs → zh-cn-0edc7234.cjs} +1 -1
- package/es/{zh-cn-c1c28e70.js → zh-cn-89e434f9.js} +1 -1
- package/lib/aiTools.js +121 -27
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +217 -212
- package/lib/{index-7279dacd.js → index-8ba1607b.js} +22647 -22454
- package/lib/{python-60bc2922.js → python-16c6e601.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/VarietyAiHelper/index.vue +326 -292
- package/public/aiTools.js +121 -27
- package/src/App.vue +14 -0
- package/es/aiTools-822859d6.cjs +0 -4
- package/es/aiTools-9a9c997f.js +0 -149
- package/es/index-3792552a.cjs +0 -1
|
@@ -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
|
|
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-
|
|
3
|
-
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 Ge, 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 L, resolveDynamicComponent as O, mergeProps as we, withModifiers as _e, 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-dd9617de.js";
|
|
3
|
+
import { p as nt, F as at, G as st, E as B } from "./index-1b97095f.js";
|
|
4
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 Ne } from "./index-
|
|
7
|
-
import { a as vt, u as mt } from "./index-
|
|
6
|
+
import { u as ft, U as oe, d as Ie, I as Ee, C as Ne } from "./index-8e88a0bd.js";
|
|
7
|
+
import { a as vt, u as mt } from "./index-d3e9a6f2.js";
|
|
8
8
|
const ht = () => Te && /firefox/i.test(window.navigator.userAgent);
|
|
9
9
|
let g;
|
|
10
10
|
const yt = {
|
|
@@ -217,7 +217,7 @@ const Nt = "ElInput", zt = 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", Le.value),
|
|
221
221
|
{
|
|
222
222
|
[a.b("group")]: l.prepend || l.append,
|
|
223
223
|
[a.m("prefix")]: l.prefix || o.prefixIcon,
|
|
@@ -246,9 +246,9 @@ const Nt = "ElInput", zt = 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), z = c(() => o.showWordLimit && !!o.maxlength && (o.type === "text" || o.type === "textarea") && !x.value && !o.readonly && !o.showPassword),
|
|
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), G = c(() => E.value.length), Le = c(() => !!z.value && G.value > Number(o.maxlength)), Oe = 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 (Be(), !z.value || o.resize !== "both")
|
|
252
252
|
return;
|
|
253
253
|
const s = e[0], { width: P } = s.contentRect;
|
|
254
254
|
ae.value = {
|
|
@@ -270,7 +270,7 @@ const Nt = "ElInput", zt = Pe({
|
|
|
270
270
|
D.value = {
|
|
271
271
|
minHeight: ze(I.value).minHeight
|
|
272
272
|
};
|
|
273
|
-
},
|
|
273
|
+
}, Be = ((e) => {
|
|
274
274
|
let s = !1;
|
|
275
275
|
return () => {
|
|
276
276
|
var P;
|
|
@@ -281,7 +281,7 @@ const Nt = "ElInput", zt = Pe({
|
|
|
281
281
|
})(F), M = () => {
|
|
282
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
|
+
}, _ = async (e) => {
|
|
285
285
|
ie();
|
|
286
286
|
let { value: s } = e.target;
|
|
287
287
|
if (o.formatter && o.parser && (s = o.parser(s)), !ce.value) {
|
|
@@ -299,7 +299,7 @@ const Nt = "ElInput", zt = Pe({
|
|
|
299
299
|
handleCompositionStart: pe,
|
|
300
300
|
handleCompositionUpdate: fe,
|
|
301
301
|
handleCompositionEnd: ve
|
|
302
|
-
} = mt({ emit: r, afterComposition:
|
|
302
|
+
} = mt({ emit: r, afterComposition: _ }), He = () => {
|
|
303
303
|
ie(), A.value = !A.value, setTimeout(ue);
|
|
304
304
|
}, $e = () => {
|
|
305
305
|
var e;
|
|
@@ -331,7 +331,7 @@ const Nt = "ElInput", zt = Pe({
|
|
|
331
331
|
textarea: I,
|
|
332
332
|
ref: N,
|
|
333
333
|
textareaStyle: re,
|
|
334
|
-
autosize:
|
|
334
|
+
autosize: Ge(o, "autosize"),
|
|
335
335
|
isComposing: ce,
|
|
336
336
|
focus: $e,
|
|
337
337
|
blur: Ae,
|
|
@@ -373,12 +373,12 @@ const Nt = "ElInput", zt = 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(B), {
|
|
377
377
|
key: 0,
|
|
378
378
|
class: m(t(a).e("icon"))
|
|
379
379
|
}, {
|
|
380
|
-
default:
|
|
381
|
-
(d(), C(
|
|
380
|
+
default: L(() => [
|
|
381
|
+
(d(), C(O(e.prefixIcon)))
|
|
382
382
|
]),
|
|
383
383
|
_: 1
|
|
384
384
|
}, 8, ["class"])) : p("v-if", !0)
|
|
@@ -408,12 +408,12 @@ const Nt = "ElInput", zt = Pe({
|
|
|
408
408
|
onCompositionstart: t(pe),
|
|
409
409
|
onCompositionupdate: t(fe),
|
|
410
410
|
onCompositionend: t(ve),
|
|
411
|
-
onInput:
|
|
411
|
+
onInput: _,
|
|
412
412
|
onChange: de,
|
|
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(Oe) ? (d(), S("span", {
|
|
417
417
|
key: 1,
|
|
418
418
|
class: m(t(a).e("suffix"))
|
|
419
419
|
}, [
|
|
@@ -422,34 +422,34 @@ const Nt = "ElInput", zt = Pe({
|
|
|
422
422
|
}, [
|
|
423
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(B), {
|
|
426
426
|
key: 0,
|
|
427
427
|
class: m(t(a).e("icon"))
|
|
428
428
|
}, {
|
|
429
|
-
default:
|
|
430
|
-
(d(), C(
|
|
429
|
+
default: L(() => [
|
|
430
|
+
(d(), C(O(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(B), {
|
|
436
436
|
key: 1,
|
|
437
437
|
class: m([t(a).e("icon"), t(a).e("clear")]),
|
|
438
|
-
onMousedown:
|
|
438
|
+
onMousedown: _e(t(ut), ["prevent"]),
|
|
439
439
|
onClick: he
|
|
440
440
|
}, {
|
|
441
|
-
default:
|
|
442
|
-
(d(), C(
|
|
441
|
+
default: L(() => [
|
|
442
|
+
(d(), C(O(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(B), {
|
|
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: L(() => [
|
|
452
|
+
(d(), C(O(t(Me))))
|
|
453
453
|
]),
|
|
454
454
|
_: 1
|
|
455
455
|
}, 8, ["class"])) : p("v-if", !0),
|
|
@@ -459,9 +459,9 @@ const Nt = "ElInput", zt = Pe({
|
|
|
459
459
|
}, [
|
|
460
460
|
T("span", {
|
|
461
461
|
class: m(t(a).e("count-inner"))
|
|
462
|
-
}, U(t(
|
|
462
|
+
}, U(t(G)) + " / " + 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(B), {
|
|
465
465
|
key: 4,
|
|
466
466
|
class: m([
|
|
467
467
|
t(a).e("icon"),
|
|
@@ -469,8 +469,8 @@ const Nt = "ElInput", zt = Pe({
|
|
|
469
469
|
t(a).is("loading", t(V) === "validating")
|
|
470
470
|
])
|
|
471
471
|
}, {
|
|
472
|
-
default:
|
|
473
|
-
(d(), C(
|
|
472
|
+
default: L(() => [
|
|
473
|
+
(d(), C(O(t(le))))
|
|
474
474
|
]),
|
|
475
475
|
_: 1
|
|
476
476
|
}, 8, ["class"])) : p("v-if", !0)
|
|
@@ -508,7 +508,7 @@ const Nt = "ElInput", zt = Pe({
|
|
|
508
508
|
onCompositionstart: t(pe),
|
|
509
509
|
onCompositionupdate: t(fe),
|
|
510
510
|
onCompositionend: t(ve),
|
|
511
|
-
onInput:
|
|
511
|
+
onInput: _,
|
|
512
512
|
onFocus: t(Ve),
|
|
513
513
|
onBlur: t(Fe),
|
|
514
514
|
onChange: de,
|
|
@@ -518,7 +518,7 @@ const Nt = "ElInput", zt = Pe({
|
|
|
518
518
|
key: 0,
|
|
519
519
|
style: be(ae.value),
|
|
520
520
|
class: m(t(a).e("count"))
|
|
521
|
-
}, U(t(
|
|
521
|
+
}, U(t(G)) + " / " + U(e.maxlength), 7)) : p("v-if", !0)
|
|
522
522
|
], 64))
|
|
523
523
|
], 38));
|
|
524
524
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),C=require("./use-form-common-props-00ec25ac.cjs"),x=require("./index-3792552a.cjs"),s=require("./base-ef747d02.cjs"),be=require("./typescript-b63f8e83.cjs"),b=require("./index-bf98dd03.cjs"),oe=require("./index-4f900527.cjs"),Ce=()=>s.isClient&&/firefox/i.test(window.navigator.userAgent);let v;const Ee={height:"0",visibility:"hidden",overflow:Ce()?"":"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},xe=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"];function we(n){const d=window.getComputedStyle(n),i=d.getPropertyValue("box-sizing"),o=Number.parseFloat(d.getPropertyValue("padding-bottom"))+Number.parseFloat(d.getPropertyValue("padding-top")),u=Number.parseFloat(d.getPropertyValue("border-bottom-width"))+Number.parseFloat(d.getPropertyValue("border-top-width"));return{contextStyle:xe.map(l=>[l,d.getPropertyValue(l)]),paddingSize:o,borderSize:u,boxSizing:i}}function ne(n,d=1,i){var o,u;v||(v=document.createElement("textarea"),((o=n.parentNode)!=null?o:document.body).appendChild(v));const{paddingSize:c,borderSize:l,boxSizing:h,contextStyle:y}=we(n);y.forEach(([m,g])=>v==null?void 0:v.style.setProperty(m,g)),Object.entries(Ee).forEach(([m,g])=>v==null?void 0:v.style.setProperty(m,g,"important")),v.value=n.value||n.placeholder||"";let f=v.scrollHeight;const p={};h==="border-box"?f=f+l:h==="content-box"&&(f=f-c),v.value="";const I=v.scrollHeight-c;if(s.isNumber(d)){let m=I*d;h==="border-box"&&(m=m+c+l),f=Math.max(m,f),p.minHeight=`${m}px`}if(s.isNumber(i)){let m=I*i;h==="border-box"&&(m=m+c+l),f=Math.min(m,f)}return p.height=`${f}px`,(u=v.parentNode)==null||u.removeChild(v),v=void 0,p}const re=s.buildProps({id:{type:String,default:void 0},size:C.useSizeProp,disabled:Boolean,modelValue:{type:s.definePropType([String,Number,Object]),default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:s.definePropType([Boolean,Object]),default:!1},autocomplete:{type:s.definePropType(String),default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,clearIcon:{type:C.iconPropType,default:x.circle_close_default},showPassword:Boolean,showWordLimit:Boolean,suffixIcon:{type:C.iconPropType},prefixIcon:{type:C.iconPropType},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:s.definePropType([Object,Array,String]),default:()=>be.mutable({})},autofocus:Boolean,rows:{type:Number,default:2},...b.useAriaProps(["ariaLabel"]),inputmode:{type:s.definePropType(String),default:void 0},name:String}),ke={[b.UPDATE_MODEL_EVENT]:n=>s.isString(n),input:n=>s.isString(n),change:n=>s.isString(n),focus:n=>n instanceof FocusEvent,blur:n=>n instanceof FocusEvent,clear:()=>!0,mouseleave:n=>n instanceof MouseEvent,mouseenter:n=>n instanceof MouseEvent,keydown:n=>n instanceof Event,compositionstart:n=>n instanceof CompositionEvent,compositionupdate:n=>n instanceof CompositionEvent,compositionend:n=>n instanceof CompositionEvent},Se=["class","style"],Ne=/^on[A-Z]/,Ie=(n={})=>{const{excludeListeners:d=!1,excludeKeys:i}=n,o=e.computed(()=>((i==null?void 0:i.value)||[]).concat(Se)),u=e.getCurrentInstance();return u?e.computed(()=>{var c;return s.fromPairs(Object.entries((c=u.proxy)==null?void 0:c.$attrs).filter(([l])=>!o.value.includes(l)&&!(d&&Ne.test(l))))}):e.computed(()=>({}))};function Be(n){let d;function i(){if(n.value==null)return;const{selectionStart:u,selectionEnd:c,value:l}=n.value;if(u==null||c==null)return;const h=l.slice(0,Math.max(0,u)),y=l.slice(Math.max(0,c));d={selectionStart:u,selectionEnd:c,value:l,beforeTxt:h,afterTxt:y}}function o(){if(n.value==null||d==null)return;const{value:u}=n.value,{beforeTxt:c,afterTxt:l,selectionStart:h}=d;if(c==null||l==null||h==null)return;let y=u.length;if(u.endsWith(l))y=u.length-l.length;else if(u.startsWith(c))y=c.length;else{const f=c[h-1],p=u.indexOf(f,h-1);p!==-1&&(y=p+1)}n.value.setSelectionRange(y,y)}return[i,o]}const Ve="ElInput",ze=e.defineComponent({name:Ve,inheritAttrs:!1}),Pe=e.defineComponent({...ze,props:re,emits:ke,setup(n,{expose:d,emit:i}){const o=n,u=e.useAttrs(),c=Ie(),l=e.useSlots(),h=e.computed(()=>[o.type==="textarea"?H.b():r.b(),r.m(m.value),r.is("disabled",g.value),r.is("exceed",ce.value),{[r.b("group")]:l.prepend||l.append,[r.m("prefix")]:l.prefix||o.prefixIcon,[r.m("suffix")]:l.suffix||o.suffixIcon||o.clearable||o.showPassword,[r.bm("suffix","password-clear")]:D.value&&R.value,[r.b("hidden")]:o.type==="hidden"},u.class]),y=e.computed(()=>[r.e("wrapper"),r.is("focus",O.value)]),{form:f,formItem:p}=C.useFormItem(),{inputId:I}=C.useFormItemInputId(o,{formItemContext:p}),m=C.useFormSize(),g=C.useFormDisabled(),r=s.useNamespace("input"),H=s.useNamespace("textarea"),P=e.shallowRef(),E=e.shallowRef(),M=e.ref(!1),T=e.ref(!1),$=e.ref(),F=e.shallowRef(o.inputStyle),k=e.computed(()=>P.value||E.value),{wrapperRef:ae,isFocused:O,handleFocus:le,handleBlur:se}=oe.useFocusController(k,{disabled:g,afterBlur(){var t;o.validateEvent&&((t=p==null?void 0:p.validate)==null||t.call(p,"blur").catch(a=>b.debugWarn()))}}),K=e.computed(()=>{var t;return(t=f==null?void 0:f.statusIcon)!=null?t:!1}),B=e.computed(()=>(p==null?void 0:p.validateState)||""),U=e.computed(()=>B.value&&C.ValidateComponentsMap[B.value]),ie=e.computed(()=>T.value?x.view_default:x.hide_default),ue=e.computed(()=>[u.style]),j=e.computed(()=>[o.inputStyle,F.value,{resize:o.resize}]),w=e.computed(()=>s.isNil(o.modelValue)?"":String(o.modelValue)),D=e.computed(()=>o.clearable&&!g.value&&!o.readonly&&!!w.value&&(O.value||M.value)),R=e.computed(()=>o.showPassword&&!g.value&&!!w.value),S=e.computed(()=>o.showWordLimit&&!!o.maxlength&&(o.type==="text"||o.type==="textarea")&&!g.value&&!o.readonly&&!o.showPassword),L=e.computed(()=>w.value.length),ce=e.computed(()=>!!S.value&&L.value>Number(o.maxlength)),de=e.computed(()=>!!l.suffix||!!o.suffixIcon||D.value||o.showPassword||S.value||!!B.value&&K.value),[q,W]=Be(P);C.useResizeObserver(E,t=>{if(pe(),!S.value||o.resize!=="both")return;const a=t[0],{width:N}=a.contentRect;$.value={right:`calc(100% - ${N+15+6}px)`}});const V=()=>{const{type:t,autosize:a}=o;if(!(!s.isClient||t!=="textarea"||!E.value))if(a){const N=s.isObject(a)?a.minRows:void 0,ee=s.isObject(a)?a.maxRows:void 0,te=ne(E.value,N,ee);F.value={overflowY:"hidden",...te},e.nextTick(()=>{E.value.offsetHeight,F.value=te})}else F.value={minHeight:ne(E.value).minHeight}},pe=(t=>{let a=!1;return()=>{var N;if(a||!o.autosize)return;((N=E.value)==null?void 0:N.offsetParent)===null||(setTimeout(t),a=!0)}})(V),z=()=>{const t=k.value,a=o.formatter?o.formatter(w.value):w.value;!t||t.value===a||(t.value=a)},A=async t=>{q();let{value:a}=t.target;if(o.formatter&&o.parser&&(a=o.parser(a)),!Y.value){if(a===w.value){z();return}i(b.UPDATE_MODEL_EVENT,a),i(b.INPUT_EVENT,a),await e.nextTick(),z(),W()}},_=t=>{let{value:a}=t.target;o.formatter&&o.parser&&(a=o.parser(a)),i(b.CHANGE_EVENT,a)},{isComposing:Y,handleCompositionStart:X,handleCompositionUpdate:G,handleCompositionEnd:Z}=oe.useComposition({emit:i,afterComposition:A}),fe=()=>{q(),T.value=!T.value,setTimeout(W)},me=()=>{var t;return(t=k.value)==null?void 0:t.focus()},ve=()=>{var t;return(t=k.value)==null?void 0:t.blur()},he=t=>{M.value=!1,i("mouseleave",t)},ye=t=>{M.value=!0,i("mouseenter",t)},J=t=>{i("keydown",t)},ge=()=>{var t;(t=k.value)==null||t.select()},Q=()=>{i(b.UPDATE_MODEL_EVENT,""),i(b.CHANGE_EVENT,""),i("clear"),i(b.INPUT_EVENT,"")};return e.watch(()=>o.modelValue,()=>{var t;e.nextTick(()=>V()),o.validateEvent&&((t=p==null?void 0:p.validate)==null||t.call(p,"change").catch(a=>b.debugWarn()))}),e.watch(w,()=>z()),e.watch(()=>o.type,async()=>{await e.nextTick(),z(),V()}),e.onMounted(()=>{!o.formatter&&o.parser,z(),e.nextTick(V)}),d({input:P,textarea:E,ref:k,textareaStyle:j,autosize:e.toRef(o,"autosize"),isComposing:Y,focus:me,blur:ve,select:ge,clear:Q,resizeTextarea:V}),(t,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(h),{[e.unref(r).bm("group","append")]:t.$slots.append,[e.unref(r).bm("group","prepend")]:t.$slots.prepend}]),style:e.normalizeStyle(e.unref(ue)),onMouseenter:ye,onMouseleave:he},[e.createCommentVNode(" input "),t.type!=="textarea"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createCommentVNode(" prepend slot "),t.$slots.prepend?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(r).be("group","prepend"))},[e.renderSlot(t.$slots,"prepend")],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{ref_key:"wrapperRef",ref:ae,class:e.normalizeClass(e.unref(y))},[e.createCommentVNode(" prefix slot "),t.$slots.prefix||t.prefixIcon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(r).e("prefix"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(r).e("prefix-inner"))},[e.renderSlot(t.$slots,"prefix"),t.prefixIcon?(e.openBlock(),e.createBlock(e.unref(x.ElIcon),{key:0,class:e.normalizeClass(e.unref(r).e("icon"))},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.prefixIcon)))]),_:1},8,["class"])):e.createCommentVNode("v-if",!0)],2)],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("input",e.mergeProps({id:e.unref(I),ref_key:"input",ref:P,class:e.unref(r).e("inner")},e.unref(c),{name:t.name,minlength:t.minlength,maxlength:t.maxlength,type:t.showPassword?T.value?"text":"password":t.type,disabled:e.unref(g),readonly:t.readonly,autocomplete:t.autocomplete,tabindex:t.tabindex,"aria-label":t.ariaLabel,placeholder:t.placeholder,style:t.inputStyle,form:t.form,autofocus:t.autofocus,role:t.containerRole,inputmode:t.inputmode,onCompositionstart:e.unref(X),onCompositionupdate:e.unref(G),onCompositionend:e.unref(Z),onInput:A,onChange:_,onKeydown:J}),null,16,["id","name","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","role","inputmode","onCompositionstart","onCompositionupdate","onCompositionend"]),e.createCommentVNode(" suffix slot "),e.unref(de)?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(r).e("suffix"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(r).e("suffix-inner"))},[!e.unref(D)||!e.unref(R)||!e.unref(S)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.renderSlot(t.$slots,"suffix"),t.suffixIcon?(e.openBlock(),e.createBlock(e.unref(x.ElIcon),{key:0,class:e.normalizeClass(e.unref(r).e("icon"))},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.suffixIcon)))]),_:1},8,["class"])):e.createCommentVNode("v-if",!0)],64)):e.createCommentVNode("v-if",!0),e.unref(D)?(e.openBlock(),e.createBlock(e.unref(x.ElIcon),{key:1,class:e.normalizeClass([e.unref(r).e("icon"),e.unref(r).e("clear")]),onMousedown:e.withModifiers(e.unref(s.NOOP),["prevent"]),onClick:Q},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.clearIcon)))]),_:1},8,["class","onMousedown"])):e.createCommentVNode("v-if",!0),e.unref(R)?(e.openBlock(),e.createBlock(e.unref(x.ElIcon),{key:2,class:e.normalizeClass([e.unref(r).e("icon"),e.unref(r).e("password")]),onClick:fe},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(ie))))]),_:1},8,["class"])):e.createCommentVNode("v-if",!0),e.unref(S)?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(e.unref(r).e("count"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(r).e("count-inner"))},e.toDisplayString(e.unref(L))+" / "+e.toDisplayString(t.maxlength),3)],2)):e.createCommentVNode("v-if",!0),e.unref(B)&&e.unref(U)&&e.unref(K)?(e.openBlock(),e.createBlock(e.unref(x.ElIcon),{key:4,class:e.normalizeClass([e.unref(r).e("icon"),e.unref(r).e("validateIcon"),e.unref(r).is("loading",e.unref(B)==="validating")])},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(U))))]),_:1},8,["class"])):e.createCommentVNode("v-if",!0)],2)],2)):e.createCommentVNode("v-if",!0)],2),e.createCommentVNode(" append slot "),t.$slots.append?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(r).be("group","append"))},[e.renderSlot(t.$slots,"append")],2)):e.createCommentVNode("v-if",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createCommentVNode(" textarea "),e.createElementVNode("textarea",e.mergeProps({id:e.unref(I),ref_key:"textarea",ref:E,class:[e.unref(H).e("inner"),e.unref(r).is("focus",e.unref(O))]},e.unref(c),{minlength:t.minlength,maxlength:t.maxlength,tabindex:t.tabindex,disabled:e.unref(g),readonly:t.readonly,autocomplete:t.autocomplete,style:e.unref(j),"aria-label":t.ariaLabel,placeholder:t.placeholder,form:t.form,autofocus:t.autofocus,rows:t.rows,role:t.containerRole,onCompositionstart:e.unref(X),onCompositionupdate:e.unref(G),onCompositionend:e.unref(Z),onInput:A,onFocus:e.unref(le),onBlur:e.unref(se),onChange:_,onKeydown:J}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","role","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),e.unref(S)?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle($.value),class:e.normalizeClass(e.unref(r).e("count"))},e.toDisplayString(e.unref(L))+" / "+e.toDisplayString(t.maxlength),7)):e.createCommentVNode("v-if",!0)],64))],38))}});var Te=s._export_sfc(Pe,[["__file","input.vue"]]);const Fe=s.withInstall(Te);exports.ElInput=Fe;exports.inputProps=re;
|
|
1
|
+
"use strict";const e=require("vue"),C=require("./use-form-common-props-02be4928.cjs"),x=require("./index-476c4459.cjs"),s=require("./base-ef747d02.cjs"),be=require("./typescript-b63f8e83.cjs"),b=require("./index-68798830.cjs"),oe=require("./index-09ce1753.cjs"),Ce=()=>s.isClient&&/firefox/i.test(window.navigator.userAgent);let v;const Ee={height:"0",visibility:"hidden",overflow:Ce()?"":"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},xe=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"];function we(n){const d=window.getComputedStyle(n),i=d.getPropertyValue("box-sizing"),o=Number.parseFloat(d.getPropertyValue("padding-bottom"))+Number.parseFloat(d.getPropertyValue("padding-top")),u=Number.parseFloat(d.getPropertyValue("border-bottom-width"))+Number.parseFloat(d.getPropertyValue("border-top-width"));return{contextStyle:xe.map(l=>[l,d.getPropertyValue(l)]),paddingSize:o,borderSize:u,boxSizing:i}}function ne(n,d=1,i){var o,u;v||(v=document.createElement("textarea"),((o=n.parentNode)!=null?o:document.body).appendChild(v));const{paddingSize:c,borderSize:l,boxSizing:h,contextStyle:y}=we(n);y.forEach(([m,g])=>v==null?void 0:v.style.setProperty(m,g)),Object.entries(Ee).forEach(([m,g])=>v==null?void 0:v.style.setProperty(m,g,"important")),v.value=n.value||n.placeholder||"";let f=v.scrollHeight;const p={};h==="border-box"?f=f+l:h==="content-box"&&(f=f-c),v.value="";const I=v.scrollHeight-c;if(s.isNumber(d)){let m=I*d;h==="border-box"&&(m=m+c+l),f=Math.max(m,f),p.minHeight=`${m}px`}if(s.isNumber(i)){let m=I*i;h==="border-box"&&(m=m+c+l),f=Math.min(m,f)}return p.height=`${f}px`,(u=v.parentNode)==null||u.removeChild(v),v=void 0,p}const re=s.buildProps({id:{type:String,default:void 0},size:C.useSizeProp,disabled:Boolean,modelValue:{type:s.definePropType([String,Number,Object]),default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:s.definePropType([Boolean,Object]),default:!1},autocomplete:{type:s.definePropType(String),default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,clearIcon:{type:C.iconPropType,default:x.circle_close_default},showPassword:Boolean,showWordLimit:Boolean,suffixIcon:{type:C.iconPropType},prefixIcon:{type:C.iconPropType},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:s.definePropType([Object,Array,String]),default:()=>be.mutable({})},autofocus:Boolean,rows:{type:Number,default:2},...b.useAriaProps(["ariaLabel"]),inputmode:{type:s.definePropType(String),default:void 0},name:String}),ke={[b.UPDATE_MODEL_EVENT]:n=>s.isString(n),input:n=>s.isString(n),change:n=>s.isString(n),focus:n=>n instanceof FocusEvent,blur:n=>n instanceof FocusEvent,clear:()=>!0,mouseleave:n=>n instanceof MouseEvent,mouseenter:n=>n instanceof MouseEvent,keydown:n=>n instanceof Event,compositionstart:n=>n instanceof CompositionEvent,compositionupdate:n=>n instanceof CompositionEvent,compositionend:n=>n instanceof CompositionEvent},Se=["class","style"],Ne=/^on[A-Z]/,Ie=(n={})=>{const{excludeListeners:d=!1,excludeKeys:i}=n,o=e.computed(()=>((i==null?void 0:i.value)||[]).concat(Se)),u=e.getCurrentInstance();return u?e.computed(()=>{var c;return s.fromPairs(Object.entries((c=u.proxy)==null?void 0:c.$attrs).filter(([l])=>!o.value.includes(l)&&!(d&&Ne.test(l))))}):e.computed(()=>({}))};function Be(n){let d;function i(){if(n.value==null)return;const{selectionStart:u,selectionEnd:c,value:l}=n.value;if(u==null||c==null)return;const h=l.slice(0,Math.max(0,u)),y=l.slice(Math.max(0,c));d={selectionStart:u,selectionEnd:c,value:l,beforeTxt:h,afterTxt:y}}function o(){if(n.value==null||d==null)return;const{value:u}=n.value,{beforeTxt:c,afterTxt:l,selectionStart:h}=d;if(c==null||l==null||h==null)return;let y=u.length;if(u.endsWith(l))y=u.length-l.length;else if(u.startsWith(c))y=c.length;else{const f=c[h-1],p=u.indexOf(f,h-1);p!==-1&&(y=p+1)}n.value.setSelectionRange(y,y)}return[i,o]}const Ve="ElInput",ze=e.defineComponent({name:Ve,inheritAttrs:!1}),Pe=e.defineComponent({...ze,props:re,emits:ke,setup(n,{expose:d,emit:i}){const o=n,u=e.useAttrs(),c=Ie(),l=e.useSlots(),h=e.computed(()=>[o.type==="textarea"?H.b():r.b(),r.m(m.value),r.is("disabled",g.value),r.is("exceed",ce.value),{[r.b("group")]:l.prepend||l.append,[r.m("prefix")]:l.prefix||o.prefixIcon,[r.m("suffix")]:l.suffix||o.suffixIcon||o.clearable||o.showPassword,[r.bm("suffix","password-clear")]:D.value&&R.value,[r.b("hidden")]:o.type==="hidden"},u.class]),y=e.computed(()=>[r.e("wrapper"),r.is("focus",O.value)]),{form:f,formItem:p}=C.useFormItem(),{inputId:I}=C.useFormItemInputId(o,{formItemContext:p}),m=C.useFormSize(),g=C.useFormDisabled(),r=s.useNamespace("input"),H=s.useNamespace("textarea"),P=e.shallowRef(),E=e.shallowRef(),M=e.ref(!1),T=e.ref(!1),$=e.ref(),F=e.shallowRef(o.inputStyle),k=e.computed(()=>P.value||E.value),{wrapperRef:ae,isFocused:O,handleFocus:le,handleBlur:se}=oe.useFocusController(k,{disabled:g,afterBlur(){var t;o.validateEvent&&((t=p==null?void 0:p.validate)==null||t.call(p,"blur").catch(a=>b.debugWarn()))}}),K=e.computed(()=>{var t;return(t=f==null?void 0:f.statusIcon)!=null?t:!1}),B=e.computed(()=>(p==null?void 0:p.validateState)||""),U=e.computed(()=>B.value&&C.ValidateComponentsMap[B.value]),ie=e.computed(()=>T.value?x.view_default:x.hide_default),ue=e.computed(()=>[u.style]),j=e.computed(()=>[o.inputStyle,F.value,{resize:o.resize}]),w=e.computed(()=>s.isNil(o.modelValue)?"":String(o.modelValue)),D=e.computed(()=>o.clearable&&!g.value&&!o.readonly&&!!w.value&&(O.value||M.value)),R=e.computed(()=>o.showPassword&&!g.value&&!!w.value),S=e.computed(()=>o.showWordLimit&&!!o.maxlength&&(o.type==="text"||o.type==="textarea")&&!g.value&&!o.readonly&&!o.showPassword),L=e.computed(()=>w.value.length),ce=e.computed(()=>!!S.value&&L.value>Number(o.maxlength)),de=e.computed(()=>!!l.suffix||!!o.suffixIcon||D.value||o.showPassword||S.value||!!B.value&&K.value),[q,W]=Be(P);C.useResizeObserver(E,t=>{if(pe(),!S.value||o.resize!=="both")return;const a=t[0],{width:N}=a.contentRect;$.value={right:`calc(100% - ${N+15+6}px)`}});const V=()=>{const{type:t,autosize:a}=o;if(!(!s.isClient||t!=="textarea"||!E.value))if(a){const N=s.isObject(a)?a.minRows:void 0,ee=s.isObject(a)?a.maxRows:void 0,te=ne(E.value,N,ee);F.value={overflowY:"hidden",...te},e.nextTick(()=>{E.value.offsetHeight,F.value=te})}else F.value={minHeight:ne(E.value).minHeight}},pe=(t=>{let a=!1;return()=>{var N;if(a||!o.autosize)return;((N=E.value)==null?void 0:N.offsetParent)===null||(setTimeout(t),a=!0)}})(V),z=()=>{const t=k.value,a=o.formatter?o.formatter(w.value):w.value;!t||t.value===a||(t.value=a)},A=async t=>{q();let{value:a}=t.target;if(o.formatter&&o.parser&&(a=o.parser(a)),!Y.value){if(a===w.value){z();return}i(b.UPDATE_MODEL_EVENT,a),i(b.INPUT_EVENT,a),await e.nextTick(),z(),W()}},_=t=>{let{value:a}=t.target;o.formatter&&o.parser&&(a=o.parser(a)),i(b.CHANGE_EVENT,a)},{isComposing:Y,handleCompositionStart:X,handleCompositionUpdate:G,handleCompositionEnd:Z}=oe.useComposition({emit:i,afterComposition:A}),fe=()=>{q(),T.value=!T.value,setTimeout(W)},me=()=>{var t;return(t=k.value)==null?void 0:t.focus()},ve=()=>{var t;return(t=k.value)==null?void 0:t.blur()},he=t=>{M.value=!1,i("mouseleave",t)},ye=t=>{M.value=!0,i("mouseenter",t)},J=t=>{i("keydown",t)},ge=()=>{var t;(t=k.value)==null||t.select()},Q=()=>{i(b.UPDATE_MODEL_EVENT,""),i(b.CHANGE_EVENT,""),i("clear"),i(b.INPUT_EVENT,"")};return e.watch(()=>o.modelValue,()=>{var t;e.nextTick(()=>V()),o.validateEvent&&((t=p==null?void 0:p.validate)==null||t.call(p,"change").catch(a=>b.debugWarn()))}),e.watch(w,()=>z()),e.watch(()=>o.type,async()=>{await e.nextTick(),z(),V()}),e.onMounted(()=>{!o.formatter&&o.parser,z(),e.nextTick(V)}),d({input:P,textarea:E,ref:k,textareaStyle:j,autosize:e.toRef(o,"autosize"),isComposing:Y,focus:me,blur:ve,select:ge,clear:Q,resizeTextarea:V}),(t,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(h),{[e.unref(r).bm("group","append")]:t.$slots.append,[e.unref(r).bm("group","prepend")]:t.$slots.prepend}]),style:e.normalizeStyle(e.unref(ue)),onMouseenter:ye,onMouseleave:he},[e.createCommentVNode(" input "),t.type!=="textarea"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createCommentVNode(" prepend slot "),t.$slots.prepend?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(r).be("group","prepend"))},[e.renderSlot(t.$slots,"prepend")],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{ref_key:"wrapperRef",ref:ae,class:e.normalizeClass(e.unref(y))},[e.createCommentVNode(" prefix slot "),t.$slots.prefix||t.prefixIcon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(r).e("prefix"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(r).e("prefix-inner"))},[e.renderSlot(t.$slots,"prefix"),t.prefixIcon?(e.openBlock(),e.createBlock(e.unref(x.ElIcon),{key:0,class:e.normalizeClass(e.unref(r).e("icon"))},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.prefixIcon)))]),_:1},8,["class"])):e.createCommentVNode("v-if",!0)],2)],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("input",e.mergeProps({id:e.unref(I),ref_key:"input",ref:P,class:e.unref(r).e("inner")},e.unref(c),{name:t.name,minlength:t.minlength,maxlength:t.maxlength,type:t.showPassword?T.value?"text":"password":t.type,disabled:e.unref(g),readonly:t.readonly,autocomplete:t.autocomplete,tabindex:t.tabindex,"aria-label":t.ariaLabel,placeholder:t.placeholder,style:t.inputStyle,form:t.form,autofocus:t.autofocus,role:t.containerRole,inputmode:t.inputmode,onCompositionstart:e.unref(X),onCompositionupdate:e.unref(G),onCompositionend:e.unref(Z),onInput:A,onChange:_,onKeydown:J}),null,16,["id","name","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","role","inputmode","onCompositionstart","onCompositionupdate","onCompositionend"]),e.createCommentVNode(" suffix slot "),e.unref(de)?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(r).e("suffix"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(r).e("suffix-inner"))},[!e.unref(D)||!e.unref(R)||!e.unref(S)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.renderSlot(t.$slots,"suffix"),t.suffixIcon?(e.openBlock(),e.createBlock(e.unref(x.ElIcon),{key:0,class:e.normalizeClass(e.unref(r).e("icon"))},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.suffixIcon)))]),_:1},8,["class"])):e.createCommentVNode("v-if",!0)],64)):e.createCommentVNode("v-if",!0),e.unref(D)?(e.openBlock(),e.createBlock(e.unref(x.ElIcon),{key:1,class:e.normalizeClass([e.unref(r).e("icon"),e.unref(r).e("clear")]),onMousedown:e.withModifiers(e.unref(s.NOOP),["prevent"]),onClick:Q},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.clearIcon)))]),_:1},8,["class","onMousedown"])):e.createCommentVNode("v-if",!0),e.unref(R)?(e.openBlock(),e.createBlock(e.unref(x.ElIcon),{key:2,class:e.normalizeClass([e.unref(r).e("icon"),e.unref(r).e("password")]),onClick:fe},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(ie))))]),_:1},8,["class"])):e.createCommentVNode("v-if",!0),e.unref(S)?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(e.unref(r).e("count"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(r).e("count-inner"))},e.toDisplayString(e.unref(L))+" / "+e.toDisplayString(t.maxlength),3)],2)):e.createCommentVNode("v-if",!0),e.unref(B)&&e.unref(U)&&e.unref(K)?(e.openBlock(),e.createBlock(e.unref(x.ElIcon),{key:4,class:e.normalizeClass([e.unref(r).e("icon"),e.unref(r).e("validateIcon"),e.unref(r).is("loading",e.unref(B)==="validating")])},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(U))))]),_:1},8,["class"])):e.createCommentVNode("v-if",!0)],2)],2)):e.createCommentVNode("v-if",!0)],2),e.createCommentVNode(" append slot "),t.$slots.append?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(r).be("group","append"))},[e.renderSlot(t.$slots,"append")],2)):e.createCommentVNode("v-if",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createCommentVNode(" textarea "),e.createElementVNode("textarea",e.mergeProps({id:e.unref(I),ref_key:"textarea",ref:E,class:[e.unref(H).e("inner"),e.unref(r).is("focus",e.unref(O))]},e.unref(c),{minlength:t.minlength,maxlength:t.maxlength,tabindex:t.tabindex,disabled:e.unref(g),readonly:t.readonly,autocomplete:t.autocomplete,style:e.unref(j),"aria-label":t.ariaLabel,placeholder:t.placeholder,form:t.form,autofocus:t.autofocus,rows:t.rows,role:t.containerRole,onCompositionstart:e.unref(X),onCompositionupdate:e.unref(G),onCompositionend:e.unref(Z),onInput:A,onFocus:e.unref(le),onBlur:e.unref(se),onChange:_,onKeydown:J}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","role","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),e.unref(S)?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle($.value),class:e.normalizeClass(e.unref(r).e("count"))},e.toDisplayString(e.unref(L))+" / "+e.toDisplayString(t.maxlength),7)):e.createCommentVNode("v-if",!0)],64))],38))}});var Te=s._export_sfc(Pe,[["__file","input.vue"]]);const Fe=s.withInstall(Te);exports.ElInput=Fe;exports.inputProps=re;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
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-
|
|
3
|
-
import { E as q, f as he,
|
|
2
|
+
import { E as Ve } from "./el-input-1f14a6e2.js";
|
|
3
|
+
import { E as q, f as he, C as ye, D as Ie, A as ge } from "./index-1b97095f.js";
|
|
4
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
|
|
6
|
-
import { u as
|
|
5
|
+
import { h as Fe, d as Te, e as De, g as Ce } from "./use-form-common-props-dd9617de.js";
|
|
6
|
+
import { u as ke, C as re, I as D, U as N, a as Me, d as Z, E as ee } from "./index-8e88a0bd.js";
|
|
7
7
|
import { u as Be } from "./index-de24705f.js";
|
|
8
8
|
const xe = 100, Le = 600, ne = {
|
|
9
9
|
beforeMount(u, E) {
|
|
@@ -70,7 +70,7 @@ const xe = 100, Le = 600, ne = {
|
|
|
70
70
|
type: Boolean,
|
|
71
71
|
default: !0
|
|
72
72
|
},
|
|
73
|
-
...
|
|
73
|
+
...ke(["ariaLabel"]),
|
|
74
74
|
inputmode: {
|
|
75
75
|
type: Q(String),
|
|
76
76
|
default: void 0
|
|
@@ -99,7 +99,7 @@ const xe = 100, Le = 600, ne = {
|
|
|
99
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
|
+
}), C = h(() => r.controls && r.controlsPosition === "right"), G = De(), V = Ce(), k = h(() => {
|
|
103
103
|
if (a.userInput !== null)
|
|
104
104
|
return a.userInput;
|
|
105
105
|
let e = a.currentValue;
|
|
@@ -145,12 +145,12 @@ const xe = 100, Le = 600, ne = {
|
|
|
145
145
|
}, B = () => {
|
|
146
146
|
if (r.readonly || V.value || O.value)
|
|
147
147
|
return;
|
|
148
|
-
const e = Number(
|
|
148
|
+
const e = Number(k.value) || 0, n = H(e);
|
|
149
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(
|
|
153
|
+
const e = Number(k.value) || 0, n = H(e, -1);
|
|
154
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;
|
|
@@ -221,7 +221,7 @@ const xe = 100, Le = 600, ne = {
|
|
|
221
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(C)),
|
|
225
225
|
l(d).is(e.align, !!e.align)
|
|
226
226
|
]),
|
|
227
227
|
onDragstart: Ne(() => {
|
|
@@ -237,7 +237,7 @@ const xe = 100, Le = 600, ne = {
|
|
|
237
237
|
A(e.$slots, "decrease-icon", {}, () => [
|
|
238
238
|
K(l(q), null, {
|
|
239
239
|
default: P(() => [
|
|
240
|
-
l(
|
|
240
|
+
l(C) ? (v(), F(l(he), { key: 0 })) : (v(), F(l(ye), { key: 1 }))
|
|
241
241
|
]),
|
|
242
242
|
_: 1
|
|
243
243
|
})
|
|
@@ -255,7 +255,7 @@ const xe = 100, Le = 600, ne = {
|
|
|
255
255
|
A(e.$slots, "increase-icon", {}, () => [
|
|
256
256
|
K(l(q), null, {
|
|
257
257
|
default: P(() => [
|
|
258
|
-
l(
|
|
258
|
+
l(C) ? (v(), F(l(Ie), { key: 0 })) : (v(), F(l(ge), { key: 1 }))
|
|
259
259
|
]),
|
|
260
260
|
_: 1
|
|
261
261
|
})
|
|
@@ -269,7 +269,7 @@ const xe = 100, Le = 600, ne = {
|
|
|
269
269
|
ref: m,
|
|
270
270
|
type: "number",
|
|
271
271
|
step: e.step,
|
|
272
|
-
"model-value": l(
|
|
272
|
+
"model-value": l(k),
|
|
273
273
|
placeholder: e.placeholder,
|
|
274
274
|
readonly: e.readonly,
|
|
275
275
|
disabled: l(V),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=require("vue"),W=require("./el-input-
|
|
1
|
+
"use strict";const n=require("vue"),W=require("./el-input-c7bf8e44.cjs"),E=require("./index-476c4459.cjs"),l=require("./base-ef747d02.cjs"),g=require("./use-form-common-props-02be4928.cjs"),c=require("./index-68798830.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 +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-31b3ec57.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,5 +1,5 @@
|
|
|
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-
|
|
2
|
+
import { u as K } from "./use-global-config-4dfc7236.js";
|
|
3
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;
|
|
@@ -1 +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;
|
|
1
|
+
"use strict";const e=require("vue"),P=require("./use-form-common-props-02be4928.cjs"),H=require("./index-476c4459.cjs"),f=require("./index-68798830.cjs"),a=require("./base-ef747d02.cjs"),ee=require("./el-popper-c7648df6.cjs"),ae=require("./index-eea0bcb3.cjs"),ue=require("./el-tag-51bd491c.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;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { defineComponent as N, openBlock as H, createBlock as be, Transition as we, mergeProps as ke, unref as C, toHandlers as Fe, withCtx as te, renderSlot as A, computed as m, getCurrentInstance as ge, inject as ne, ref as _, reactive as Me, watch as X, provide as ve, onMounted as ye, onBeforeUnmount as Oe, h as g, Fragment as Ie, withDirectives as Ne, vShow as qe, nextTick as Pe, watchEffect as Ve, toRef as Ue, createElementBlock as oe, normalizeClass as se, createElementVNode as fe, createTextVNode as Ge, toDisplayString as Je } from "vue";
|
|
2
|
-
import { i as V, u as Ke, a as Ye } from "./use-form-common-props-
|
|
3
|
-
import { f as Ze, g as Qe, E as $e, m as Xe } from "./index-
|
|
4
|
-
import { E, t as ee, a as ae, f as et, d as tt } from "./index-
|
|
2
|
+
import { i as V, u as Ke, a as Ye } from "./use-form-common-props-dd9617de.js";
|
|
3
|
+
import { f as Ze, g as Qe, E as $e, m as Xe } from "./index-1b97095f.js";
|
|
4
|
+
import { E, t as ee, a as ae, f as et, d as tt } from "./index-8e88a0bd.js";
|
|
5
5
|
import { u as O, _ as ie, w as Be, a as Q, r as de, h as nt, b as xe, i as ze, c as D, d as Te, e as le, f as ot, g as Se, j as Ae, k as st, l as Ce } from "./base-29f73b05.js";
|
|
6
|
-
import { E as He } from "./el-popper-
|
|
6
|
+
import { E as He } from "./el-popper-f96fc206.js";
|
|
7
7
|
import { T as at } from "./index-657047bb.js";
|
|
8
|
-
import { C as lt } from "./el-tag-
|
|
8
|
+
import { C as lt } from "./el-tag-0a4197f5.js";
|
|
9
9
|
import { m as ut } from "./typescript-7ae59c4c.js";
|
|
10
10
|
import { f as it } from "./vnode-a83e6de8.js";
|
|
11
11
|
const rt = N({
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { nextTick as V, defineComponent as Be, computed as b, ref as w, reactive as we, markRaw as N, watch as _, onMounted as Me, onBeforeUnmount as ke, toRefs as Ie, resolveComponent as A, openBlock as u, createBlock as g, Transition as Te, withCtx as C, withDirectives as K, createVNode as k, createElementVNode as v, normalizeClass as r, normalizeStyle as x, withModifiers as D, createElementBlock as U, resolveDynamicComponent as L, createCommentVNode as M, toDisplayString as R, withKeys as P, renderSlot as Se, vShow as H, createTextVNode as ee, isVNode as ie, render as ue } from "vue";
|
|
2
|
-
import { E as Ae } from "./el-button-
|
|
3
|
-
import { E as Le } from "./el-input-
|
|
4
|
-
import { E as Re, b as Ve, c as $e } from "./el-overlay-
|
|
5
|
-
import { E as Oe, l as ne } from "./index-
|
|
6
|
-
import { o as oe, E as ze, c as De } from "./index-
|
|
2
|
+
import { E as Ae } from "./el-button-cd144ee1.js";
|
|
3
|
+
import { E as Le } from "./el-input-1f14a6e2.js";
|
|
4
|
+
import { E as Re, b as Ve, c as $e } from "./el-overlay-465cd11e.js";
|
|
5
|
+
import { E as Oe, l as ne } from "./index-1b97095f.js";
|
|
6
|
+
import { o as oe, E as ze, c as De } from "./index-8e88a0bd.js";
|
|
7
7
|
import { x as j, c as G, _ as Pe, s as Fe, y as se, f as ce, i as Ke, z as te } from "./base-29f73b05.js";
|
|
8
|
-
import { T as Ue, m as ae } from "./use-form-common-props-
|
|
9
|
-
import { i as He } from "./validator-
|
|
10
|
-
import { u as Ne } from "./use-global-config-
|
|
8
|
+
import { T as Ue, m as ae } from "./use-form-common-props-dd9617de.js";
|
|
9
|
+
import { i as He } from "./validator-029bfc98.js";
|
|
10
|
+
import { u as Ne } from "./use-global-config-4dfc7236.js";
|
|
11
11
|
import { u as le } from "./index-8391a3df.js";
|
|
12
|
-
import { u as je } from "./el-dialog-
|
|
12
|
+
import { u as je } from "./el-dialog-59a23c2b.js";
|
|
13
13
|
const q = "_trap-focus-children", E = [], re = (e) => {
|
|
14
14
|
if (E.length === 0)
|
|
15
15
|
return;
|