st-comp 0.0.186 → 0.0.188
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/ChartLayout.cjs +1 -1
- package/es/ChartLayout.js +14 -13
- package/es/CustomFunction.cjs +1 -1
- package/es/CustomFunction.js +104 -91
- package/es/FactorWarning.cjs +1 -1
- package/es/FactorWarning.js +31 -28
- package/es/Kline.cjs +1 -1
- package/es/Kline.js +17 -14
- package/es/KlineBasic.cjs +1 -1
- package/es/KlineBasic.js +26 -23
- package/es/KlineConfig.cjs +1 -1
- package/es/KlineConfig.js +22 -19
- package/es/KlineNew.cjs +1 -1
- package/es/KlineNew.js +16 -13
- package/es/KlinePlus.cjs +1 -1
- package/es/KlinePlus.js +19 -16
- package/es/Pagination.cjs +1 -1
- package/es/Pagination.js +88 -85
- package/es/PasswordPrompt.cjs +1 -1
- package/es/PasswordPrompt.js +3 -3
- package/es/Table.cjs +1 -1
- package/es/Table.js +34 -32
- package/es/TreeMap.cjs +1 -2
- package/es/TreeMap.js +1 -163
- package/es/User.cjs +1 -1
- package/es/User.js +53 -50
- package/es/VarSelectDialog.cjs +3 -3
- package/es/VarSelectDialog.js +166 -479
- package/es/VarietyAutoComplete.cjs +1 -0
- package/es/VarietyAutoComplete.js +84 -0
- package/es/VarietySearch.cjs +6 -6
- package/es/VarietySearch.js +50 -47
- package/es/VirtualTable.cjs +1 -1
- package/es/VirtualTable.js +33 -31
- package/es/{_initCloneObject-00cee14a.js → _initCloneObject-25087817.js} +24 -23
- package/es/_initCloneObject-95a1fe6e.cjs +1 -0
- package/es/{base-62a70f61.js → base-f5b11441.js} +40 -40
- package/es/config-provider-79c2df1b.cjs +1 -0
- package/es/{config-provider-89aba243.js → config-provider-95d27ce2.js} +9 -8
- package/es/{debounce-5f2ec4be.js → debounce-06f59c68.js} +10 -10
- package/es/{debounce-0b77a317.cjs → debounce-62f5b6e8.cjs} +1 -1
- package/es/{dropdown-0fd8bdbd.js → dropdown-7a853d45.js} +9 -9
- package/es/{dropdown-babf55db.cjs → dropdown-c2ef9062.cjs} +1 -1
- package/es/el-autocomplete-b7bcfb25.cjs +1 -0
- package/es/el-autocomplete-e74d589c.js +328 -0
- package/es/{el-button-338a49b7.cjs → el-button-5973d99c.cjs} +1 -1
- package/es/{el-button-f44cb2cf.js → el-button-5a260464.js} +33 -33
- package/es/{el-dialog-c2451c86.js → el-dialog-8d8f6443.js} +17 -17
- package/es/{el-dialog-45250561.cjs → el-dialog-a24f4f8f.cjs} +1 -1
- package/es/{el-divider-2f300113.js → el-divider-4e1c0fb8.js} +1 -1
- package/es/el-empty-1697ded8.cjs +1 -0
- package/es/{el-empty-87a86f30.js → el-empty-deee6b39.js} +10 -9
- package/es/{el-form-item-64c14a64.js → el-form-item-3167d76a.js} +74 -73
- package/es/el-form-item-8dc6aec8.cjs +12 -0
- package/es/{el-input-ef6edbf3.js → el-input-03aad76d.js} +33 -33
- package/es/{el-input-c663697a.cjs → el-input-06243b61.cjs} +1 -1
- package/es/{el-input-number-cda5c4e1.js → el-input-number-12c09ac3.js} +70 -70
- package/es/{el-input-number-5fda0890.cjs → el-input-number-854b2066.cjs} +1 -1
- package/es/{el-loading-1be77e7c.js → el-loading-86fdef94.js} +5 -5
- package/es/{el-loading-8c3379d5.cjs → el-loading-a536daf8.cjs} +1 -1
- package/es/{el-menu-item-84a4b594.js → el-menu-item-1172154b.js} +22 -22
- package/es/{el-menu-item-cf9e0e36.cjs → el-menu-item-6522d54c.cjs} +1 -1
- package/es/{el-message-c500161d.cjs → el-message-0aeea1a3.cjs} +1 -1
- package/es/{el-message-ba131b90.js → el-message-35d4e3ac.js} +23 -23
- package/es/{el-message-box-743c461a.cjs → el-message-box-2e7304ce.cjs} +1 -1
- package/es/{el-message-box-38779ab9.js → el-message-box-f43b6e7a.js} +20 -20
- package/es/{el-overlay-a6f43919.js → el-overlay-04659660.js} +41 -41
- package/es/{el-overlay-39e2e96f.cjs → el-overlay-ef92f51f.cjs} +1 -1
- package/es/{el-popconfirm-16597a41.js → el-popconfirm-29d538b6.js} +20 -20
- package/es/{el-popconfirm-08b4221f.cjs → el-popconfirm-58a1b946.cjs} +1 -1
- package/es/{el-popper-dca2de0d.cjs → el-popper-c9e0136d.cjs} +1 -1
- package/es/{el-popper-05a8f271.js → el-popper-ee1f8186.js} +79 -79
- package/es/el-scrollbar-05815cf5.cjs +1 -0
- package/es/el-scrollbar-09769d9e.js +395 -0
- package/es/{el-segmented-d68dfe31.js → el-segmented-916b982a.js} +8 -8
- package/es/{el-segmented-c2952e4c.cjs → el-segmented-d454a924.cjs} +1 -1
- package/es/el-select-6d813c15.cjs +1 -0
- package/es/{el-select-7846f331.js → el-select-8cb88e3c.js} +364 -361
- package/es/{el-table-column-cd63e722.js → el-table-column-0c899664.js} +147 -145
- package/es/el-table-column-762a20e0.cjs +14 -0
- package/es/{el-tag-914c96a9.js → el-tag-554c333b.js} +27 -26
- package/es/el-tag-fe492a6d.cjs +1 -0
- package/es/index-34048a1d.js +314 -0
- package/es/{index-b132c1b1.js → index-384ed4b0.js} +3 -3
- package/es/index-5b62ea0e.js +375 -0
- package/es/{index-1c409d46.cjs → index-62573d45.cjs} +1 -1
- package/es/{index-14c322b1.js → index-69a9bd75.js} +2 -2
- package/es/{index-2bf6214c.cjs → index-77f4746b.cjs} +1 -1
- package/es/index-7e4e0bd3.cjs +1 -0
- package/es/index-9780a537.cjs +1 -0
- package/es/{index-e6deec5d.cjs → index-a9d4ef0f.cjs} +1 -1
- package/es/{index-35129268.js → index-b07f58c9.js} +76 -61
- package/es/index-b7fd560c.js +60 -0
- package/es/index-bb833443.cjs +1 -0
- package/es/index-ca7dbd47.cjs +1 -0
- package/es/index-cfeda35a.js +204 -0
- package/es/{index-20749652.js → index-df06f32a.js} +15 -15
- package/es/index-eab8a286.cjs +1 -0
- package/es/raf-fa761d02.js +6 -0
- package/es/{scroll-7d352c1f.js → scroll-9e2dd92b.js} +5 -5
- package/es/style.css +1 -1
- package/es/use-global-config-1923bb6f.js +72 -0
- package/es/use-global-config-c2c5ca8f.cjs +1 -0
- package/es/{validator-f66b0f34.cjs → validator-866ea0bb.cjs} +1 -1
- package/es/{validator-90d3e848.js → validator-fd32f925.js} +1 -1
- package/es/vnode-b906ae6d.cjs +1 -0
- package/es/vnode-f9752526.js +14 -0
- package/es/{zh-cn-de7ae601.cjs → zh-cn-0fa1aa6d.cjs} +1 -1
- package/es/{zh-cn-530f1ed1.js → zh-cn-d667062d.js} +2 -2
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +139 -139
- package/lib/{index-26fab3e5.js → index-02706357.js} +14643 -14551
- package/lib/{python-c34eeb40.js → python-42146c31.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/CustomFunction/index.vue +11 -2
- package/packages/VarietyAutoComplete/index.ts +8 -0
- package/packages/VarietyAutoComplete/index.vue +89 -0
- package/packages/index.ts +2 -0
- package/src/pages/VarietyAutoComplete/index.vue +19 -0
- package/src/router/routes.ts +5 -0
- package/es/_initCloneObject-4dd3c9a4.cjs +0 -1
- package/es/config-provider-d82ea78c.cjs +0 -1
- package/es/el-empty-bb2b0235.cjs +0 -1
- package/es/el-form-item-b5f6081b.cjs +0 -12
- package/es/el-scrollbar-31d72626.js +0 -763
- package/es/el-scrollbar-802d874d.cjs +0 -1
- package/es/el-select-8337856d.cjs +0 -1
- package/es/el-table-column-34f080b5.cjs +0 -14
- package/es/el-tag-a2e99294.cjs +0 -1
- package/es/index-34592e82.js +0 -513
- package/es/index-3a74eae4.cjs +0 -1
- package/es/index-8feed26f.cjs +0 -1
- package/es/raf-41aed4d4.js +0 -6
- package/es/use-global-config-53be2b7d.js +0 -71
- package/es/use-global-config-f3664595.cjs +0 -1
- package/es/vnode-6d51e502.cjs +0 -1
- package/es/vnode-8ddc4f78.js +0 -70
|
@@ -1,11 +1,11 @@
|
|
|
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 {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { computed as c, getCurrentInstance as Ue, defineComponent as Pe, useAttrs as We, useSlots as Ye, shallowRef as Z, ref as q, watch as J, nextTick as R, onMounted as Xe, toRef as _e, openBlock as d, createElementBlock as S, normalizeClass as m, unref as t, normalizeStyle as be, createCommentVNode as p, Fragment as Q, renderSlot as j, createElementVNode as k, createBlock as C, withCtx as L, resolveDynamicComponent as O, mergeProps as we, withModifiers as Ge, toDisplayString as U } from "vue";
|
|
2
|
+
import { u as Ze, i as ee, e as qe, f as Je, a as Qe, d as et, V as tt, h as ot } from "./el-scrollbar-09769d9e.js";
|
|
3
|
+
import { j as nt, v as at, k as st, E as B } from "./index-b07f58c9.js";
|
|
4
|
+
import { a as ke, f as xe, b as lt, d as H, e as te, t as rt, u as Se, s as it, N as ut, _ as dt, h as Ce, w as ct } from "./base-f5b11441.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 "./el-popper-
|
|
7
|
-
import {
|
|
8
|
-
const ht = () =>
|
|
6
|
+
import { u as ft, U as oe, d as Ie, I as Ee, C as Ne } from "./el-popper-ee1f8186.js";
|
|
7
|
+
import { u as vt, a as mt } from "./index-b7fd560c.js";
|
|
8
|
+
const ht = () => ke && /firefox/i.test(window.navigator.userAgent);
|
|
9
9
|
let g;
|
|
10
10
|
const yt = {
|
|
11
11
|
height: "0",
|
|
@@ -48,13 +48,13 @@ function ze(n, f = 1, r) {
|
|
|
48
48
|
let h = g.scrollHeight;
|
|
49
49
|
const v = {};
|
|
50
50
|
b === "border-box" ? h = h + l : b === "content-box" && (h = h - u), g.value = "";
|
|
51
|
-
const
|
|
51
|
+
const T = g.scrollHeight - u;
|
|
52
52
|
if (xe(f)) {
|
|
53
|
-
let y =
|
|
53
|
+
let y = T * f;
|
|
54
54
|
b === "border-box" && (y = y + u + l), h = Math.max(y, h), v.minHeight = `${y}px`;
|
|
55
55
|
}
|
|
56
56
|
if (xe(r)) {
|
|
57
|
-
let y =
|
|
57
|
+
let y = T * r;
|
|
58
58
|
b === "border-box" && (y = y + u + l), h = Math.min(y, h);
|
|
59
59
|
}
|
|
60
60
|
return v.height = `${h}px`, (i = g.parentNode) == null || i.removeChild(g), g = void 0, v;
|
|
@@ -229,9 +229,9 @@ const Nt = "ElInput", zt = Pe({
|
|
|
229
229
|
]), w = c(() => [
|
|
230
230
|
a.e("wrapper"),
|
|
231
231
|
a.is("focus", Y.value)
|
|
232
|
-
]), { form: h, formItem: v } = qe(), { inputId:
|
|
232
|
+
]), { form: h, formItem: v } = qe(), { inputId: T } = Je(o, {
|
|
233
233
|
formItemContext: v
|
|
234
|
-
}), y = Qe(), x = et(), a = Se("input"), ne = Se("textarea"), $ = Z(), I = Z(), W = q(!1), A = q(!1), ae = q(), D = Z(o.inputStyle), N = c(() => $.value || I.value), { wrapperRef:
|
|
234
|
+
}), y = Qe(), x = et(), a = Se("input"), ne = Se("textarea"), $ = Z(), I = Z(), W = q(!1), A = q(!1), ae = q(), D = Z(o.inputStyle), N = c(() => $.value || I.value), { wrapperRef: Te, isFocused: Y, handleFocus: Ve, handleBlur: Fe } = vt(N, {
|
|
235
235
|
disabled: x,
|
|
236
236
|
afterBlur() {
|
|
237
237
|
var e;
|
|
@@ -246,7 +246,7 @@ 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), _ = c(() => E.value.length), Le = c(() => !!z.value && _.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
251
|
if (Be(), !z.value || o.resize !== "both")
|
|
252
252
|
return;
|
|
@@ -257,7 +257,7 @@ const Nt = "ElInput", zt = Pe({
|
|
|
257
257
|
});
|
|
258
258
|
const F = () => {
|
|
259
259
|
const { type: e, autosize: s } = o;
|
|
260
|
-
if (!(!
|
|
260
|
+
if (!(!ke || e !== "textarea" || !I.value))
|
|
261
261
|
if (s) {
|
|
262
262
|
const P = Ce(s) ? s.minRows : void 0, ye = Ce(s) ? s.maxRows : void 0, ge = ze(I.value, P, ye);
|
|
263
263
|
D.value = {
|
|
@@ -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
|
+
}, G = 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: G }), 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: _e(o, "autosize"),
|
|
335
335
|
isComposing: ce,
|
|
336
336
|
focus: $e,
|
|
337
337
|
blur: Ae,
|
|
@@ -359,9 +359,9 @@ const Nt = "ElInput", zt = Pe({
|
|
|
359
359
|
}, [
|
|
360
360
|
j(e.$slots, "prepend")
|
|
361
361
|
], 2)) : p("v-if", !0),
|
|
362
|
-
|
|
362
|
+
k("div", {
|
|
363
363
|
ref_key: "wrapperRef",
|
|
364
|
-
ref:
|
|
364
|
+
ref: Te,
|
|
365
365
|
class: m(t(w))
|
|
366
366
|
}, [
|
|
367
367
|
p(" prefix slot "),
|
|
@@ -369,7 +369,7 @@ const Nt = "ElInput", zt = Pe({
|
|
|
369
369
|
key: 0,
|
|
370
370
|
class: m(t(a).e("prefix"))
|
|
371
371
|
}, [
|
|
372
|
-
|
|
372
|
+
k("span", {
|
|
373
373
|
class: m(t(a).e("prefix-inner"))
|
|
374
374
|
}, [
|
|
375
375
|
j(e.$slots, "prefix"),
|
|
@@ -384,8 +384,8 @@ const Nt = "ElInput", zt = Pe({
|
|
|
384
384
|
}, 8, ["class"])) : p("v-if", !0)
|
|
385
385
|
], 2)
|
|
386
386
|
], 2)) : p("v-if", !0),
|
|
387
|
-
|
|
388
|
-
id: t(
|
|
387
|
+
k("input", we({
|
|
388
|
+
id: t(T),
|
|
389
389
|
ref_key: "input",
|
|
390
390
|
ref: $,
|
|
391
391
|
class: t(a).e("inner")
|
|
@@ -408,7 +408,7 @@ const Nt = "ElInput", zt = Pe({
|
|
|
408
408
|
onCompositionstart: t(pe),
|
|
409
409
|
onCompositionupdate: t(fe),
|
|
410
410
|
onCompositionend: t(ve),
|
|
411
|
-
onInput:
|
|
411
|
+
onInput: G,
|
|
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"]),
|
|
@@ -417,7 +417,7 @@ const Nt = "ElInput", zt = Pe({
|
|
|
417
417
|
key: 1,
|
|
418
418
|
class: m(t(a).e("suffix"))
|
|
419
419
|
}, [
|
|
420
|
-
|
|
420
|
+
k("span", {
|
|
421
421
|
class: m(t(a).e("suffix-inner"))
|
|
422
422
|
}, [
|
|
423
423
|
!t(K) || !t(X) || !t(z) ? (d(), S(Q, { key: 0 }, [
|
|
@@ -435,7 +435,7 @@ const Nt = "ElInput", zt = Pe({
|
|
|
435
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: Ge(t(ut), ["prevent"]),
|
|
439
439
|
onClick: he
|
|
440
440
|
}, {
|
|
441
441
|
default: L(() => [
|
|
@@ -457,9 +457,9 @@ const Nt = "ElInput", zt = Pe({
|
|
|
457
457
|
key: 3,
|
|
458
458
|
class: m(t(a).e("count"))
|
|
459
459
|
}, [
|
|
460
|
-
|
|
460
|
+
k("span", {
|
|
461
461
|
class: m(t(a).e("count-inner"))
|
|
462
|
-
}, U(t(
|
|
462
|
+
}, U(t(_)) + " / " + U(e.maxlength), 3)
|
|
463
463
|
], 2)) : p("v-if", !0),
|
|
464
464
|
t(V) && t(le) && t(se) ? (d(), C(t(B), {
|
|
465
465
|
key: 4,
|
|
@@ -486,8 +486,8 @@ const Nt = "ElInput", zt = Pe({
|
|
|
486
486
|
], 2)) : p("v-if", !0)
|
|
487
487
|
], 64)) : (d(), S(Q, { key: 1 }, [
|
|
488
488
|
p(" textarea "),
|
|
489
|
-
|
|
490
|
-
id: t(
|
|
489
|
+
k("textarea", we({
|
|
490
|
+
id: t(T),
|
|
491
491
|
ref_key: "textarea",
|
|
492
492
|
ref: I,
|
|
493
493
|
class: [t(ne).e("inner"), t(a).is("focus", t(Y))]
|
|
@@ -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: G,
|
|
512
512
|
onFocus: t(Ve),
|
|
513
513
|
onBlur: t(Fe),
|
|
514
514
|
onChange: de,
|
|
@@ -518,13 +518,13 @@ 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(_)) + " / " + U(e.maxlength), 7)) : p("v-if", !0)
|
|
522
522
|
], 64))
|
|
523
523
|
], 38));
|
|
524
524
|
}
|
|
525
525
|
});
|
|
526
|
-
var
|
|
527
|
-
const Ht = ct(
|
|
526
|
+
var kt = /* @__PURE__ */ dt(Pt, [["__file", "input.vue"]]);
|
|
527
|
+
const Ht = ct(kt);
|
|
528
528
|
export {
|
|
529
529
|
Ht as E,
|
|
530
530
|
wt as i
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),C=require("./el-scrollbar-802d874d.cjs"),x=require("./index-8feed26f.cjs"),s=require("./base-ef747d02.cjs"),be=require("./typescript-b63f8e83.cjs"),b=require("./el-popper-dca2de0d.cjs"),oe=require("./vnode-6d51e502.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("./el-scrollbar-05815cf5.cjs"),x=require("./index-eab8a286.cjs"),s=require("./base-ef747d02.cjs"),be=require("./typescript-b63f8e83.cjs"),b=require("./el-popper-c9e0136d.cjs"),oe=require("./index-7e4e0bd3.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,28 +1,28 @@
|
|
|
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
|
|
2
|
-
import { E as Ve } from "./el-input-
|
|
3
|
-
import { E as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { u as Ce, C as re, I as D, U as N,
|
|
7
|
-
import { u as Be } from "./index-
|
|
8
|
-
const
|
|
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 x, normalizeClass as z, unref as l, withModifiers as Ne, withDirectives as X, withKeys as q, renderSlot as A, createVNode as K, withCtx as P, createBlock as F, createCommentVNode as Y, createSlots as Ee } from "vue";
|
|
2
|
+
import { E as Ve } from "./el-input-03aad76d.js";
|
|
3
|
+
import { E as j, f as he, g as ye, h as Ie, p as ge } from "./index-b07f58c9.js";
|
|
4
|
+
import { c as J, b as we, f as b, d as Q, s as y, u as _e, q as T, _ as Se, e as Ae, w as Pe } from "./base-f5b11441.js";
|
|
5
|
+
import { u as Fe, e as Te, a as De, d as ke } from "./el-scrollbar-09769d9e.js";
|
|
6
|
+
import { u as Ce, C as re, I as D, U as N, t as Me, d as Z, e as ee } from "./el-popper-ee1f8186.js";
|
|
7
|
+
import { u as Be } from "./index-cfeda35a.js";
|
|
8
|
+
const Le = 100, Re = 600, ne = {
|
|
9
9
|
beforeMount(u, E) {
|
|
10
|
-
const s = E.value, { interval: r =
|
|
10
|
+
const s = E.value, { interval: r = Le, delay: I = Re } = J(s) ? {} : s;
|
|
11
11
|
let d, m;
|
|
12
|
-
const
|
|
12
|
+
const a = () => J(s) ? s() : s.handler(), p = () => {
|
|
13
13
|
m && (clearTimeout(m), m = void 0), d && (clearInterval(d), d = void 0);
|
|
14
14
|
};
|
|
15
15
|
u.addEventListener("mousedown", (g) => {
|
|
16
|
-
g.button === 0 && (p(),
|
|
16
|
+
g.button === 0 && (p(), a(), document.addEventListener("mouseup", () => p(), {
|
|
17
17
|
once: !0
|
|
18
18
|
}), m = setTimeout(() => {
|
|
19
19
|
d = setInterval(() => {
|
|
20
|
-
|
|
20
|
+
a();
|
|
21
21
|
}, r);
|
|
22
22
|
}, I));
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
},
|
|
25
|
+
}, $e = we({
|
|
26
26
|
id: {
|
|
27
27
|
type: String,
|
|
28
28
|
default: void 0
|
|
@@ -80,7 +80,7 @@ const xe = 100, Le = 600, ne = {
|
|
|
80
80
|
default: "center"
|
|
81
81
|
},
|
|
82
82
|
disabledScientific: Boolean
|
|
83
|
-
}),
|
|
83
|
+
}), xe = {
|
|
84
84
|
[re]: (u, E) => E !== u,
|
|
85
85
|
blur: (u) => u instanceof FocusEvent,
|
|
86
86
|
focus: (u) => u instanceof FocusEvent,
|
|
@@ -90,19 +90,19 @@ const xe = 100, Le = 600, ne = {
|
|
|
90
90
|
name: "ElInputNumber"
|
|
91
91
|
}), Ke = /* @__PURE__ */ te({
|
|
92
92
|
...ze,
|
|
93
|
-
props:
|
|
94
|
-
emits:
|
|
93
|
+
props: $e,
|
|
94
|
+
emits: xe,
|
|
95
95
|
setup(u, { expose: E, emit: s }) {
|
|
96
|
-
const r = u, { t: I } = Be(), d = _e("input-number"), m = pe(),
|
|
96
|
+
const r = u, { t: I } = Be(), d = _e("input-number"), m = pe(), a = fe({
|
|
97
97
|
currentValue: r.modelValue,
|
|
98
98
|
userInput: null
|
|
99
|
-
}), { formItem: p } = Te(), g = h(() => b(r.modelValue) && r.modelValue <= r.min), O = h(() => b(r.modelValue) && r.modelValue >= r.max),
|
|
99
|
+
}), { formItem: p } = Te(), g = h(() => b(r.modelValue) && r.modelValue <= r.min), O = h(() => b(r.modelValue) && r.modelValue >= r.max), le = h(() => {
|
|
100
100
|
const e = U(r.step);
|
|
101
101
|
return T(r.precision) ? Math.max(U(r.modelValue), e) : (e > r.precision, r.precision);
|
|
102
102
|
}), k = h(() => r.controls && r.controlsPosition === "right"), G = De(), V = ke(), C = h(() => {
|
|
103
|
-
if (
|
|
104
|
-
return
|
|
105
|
-
let e =
|
|
103
|
+
if (a.userInput !== null)
|
|
104
|
+
return a.userInput;
|
|
105
|
+
let e = a.currentValue;
|
|
106
106
|
if (y(e))
|
|
107
107
|
return "";
|
|
108
108
|
if (b(e)) {
|
|
@@ -112,7 +112,7 @@ const xe = 100, Le = 600, ne = {
|
|
|
112
112
|
}
|
|
113
113
|
return e;
|
|
114
114
|
}), M = (e, n) => {
|
|
115
|
-
if (T(n) && (n =
|
|
115
|
+
if (T(n) && (n = le.value), n === 0)
|
|
116
116
|
return Math.round(e);
|
|
117
117
|
let t = String(e);
|
|
118
118
|
const i = t.indexOf(".");
|
|
@@ -126,7 +126,7 @@ const xe = 100, Le = 600, ne = {
|
|
|
126
126
|
const n = e.toString(), t = n.indexOf(".");
|
|
127
127
|
let i = 0;
|
|
128
128
|
return t !== -1 && (i = n.length - t - 1), i;
|
|
129
|
-
}, H = (e, n = 1) => b(e) ? e >= Number.MAX_SAFE_INTEGER && n === 1 || e <= Number.MIN_SAFE_INTEGER && n === -1 ? e : M(e + r.step * n) :
|
|
129
|
+
}, H = (e, n = 1) => b(e) ? e >= Number.MAX_SAFE_INTEGER && n === 1 || e <= Number.MIN_SAFE_INTEGER && n === -1 ? e : M(e + r.step * n) : a.currentValue, ae = (e) => {
|
|
130
130
|
var n;
|
|
131
131
|
const t = e;
|
|
132
132
|
if (r.disabledScientific && ["e", "E"].includes(t.key)) {
|
|
@@ -138,7 +138,7 @@ const xe = 100, Le = 600, ne = {
|
|
|
138
138
|
t.preventDefault(), B();
|
|
139
139
|
},
|
|
140
140
|
[ee.down]: () => {
|
|
141
|
-
t.preventDefault(),
|
|
141
|
+
t.preventDefault(), L();
|
|
142
142
|
}
|
|
143
143
|
};
|
|
144
144
|
(n = i[t.key]) == null || n.call(i);
|
|
@@ -146,13 +146,13 @@ const xe = 100, Le = 600, ne = {
|
|
|
146
146
|
if (r.readonly || V.value || O.value)
|
|
147
147
|
return;
|
|
148
148
|
const e = Number(C.value) || 0, n = H(e);
|
|
149
|
-
w(n), s(D,
|
|
150
|
-
},
|
|
149
|
+
w(n), s(D, a.currentValue), $();
|
|
150
|
+
}, L = () => {
|
|
151
151
|
if (r.readonly || V.value || g.value)
|
|
152
152
|
return;
|
|
153
153
|
const e = Number(C.value) || 0, n = H(e, -1);
|
|
154
|
-
w(n), s(D,
|
|
155
|
-
},
|
|
154
|
+
w(n), s(D, a.currentValue), $();
|
|
155
|
+
}, R = (e, n) => {
|
|
156
156
|
const { max: t, min: i, step: o, precision: f, stepStrictly: _, valueOnClear: S } = r;
|
|
157
157
|
t < i && Me("InputNumber", "min should not be greater than max.");
|
|
158
158
|
let c = Number(e);
|
|
@@ -166,19 +166,19 @@ const xe = 100, Le = 600, ne = {
|
|
|
166
166
|
return _ && (c = M(Math.round(c / o) * o, f), c !== e && n && s(N, c)), T(f) || (c = M(c, f)), (c > t || c < i) && (c = c > t ? t : i, n && s(N, c)), c;
|
|
167
167
|
}, w = (e, n = !0) => {
|
|
168
168
|
var t;
|
|
169
|
-
const i =
|
|
169
|
+
const i = a.currentValue, o = R(e);
|
|
170
170
|
if (!n) {
|
|
171
171
|
s(N, o);
|
|
172
172
|
return;
|
|
173
173
|
}
|
|
174
|
-
i === o && e || (
|
|
174
|
+
i === o && e || (a.userInput = null, s(N, o), i !== o && s(re, o, i), r.validateEvent && ((t = p == null ? void 0 : p.validate) == null || t.call(p, "change").catch((f) => Z())), a.currentValue = o);
|
|
175
175
|
}, ue = (e) => {
|
|
176
|
-
|
|
176
|
+
a.userInput = e;
|
|
177
177
|
const n = e === "" ? null : Number(e);
|
|
178
178
|
s(D, n), w(n, !1);
|
|
179
179
|
}, ie = (e) => {
|
|
180
180
|
const n = e !== "" ? Number(e) : "";
|
|
181
|
-
(b(n) && !Number.isNaN(n) || e === "") && w(n),
|
|
181
|
+
(b(n) && !Number.isNaN(n) || e === "") && w(n), $(), a.userInput = null;
|
|
182
182
|
}, oe = () => {
|
|
183
183
|
var e, n;
|
|
184
184
|
(n = (e = m.value) == null ? void 0 : e.focus) == null || n.call(e);
|
|
@@ -189,21 +189,21 @@ const xe = 100, Le = 600, ne = {
|
|
|
189
189
|
s("focus", e);
|
|
190
190
|
}, ce = (e) => {
|
|
191
191
|
var n, t;
|
|
192
|
-
|
|
193
|
-
},
|
|
194
|
-
|
|
192
|
+
a.userInput = null, a.currentValue === null && ((n = m.value) != null && n.input) && (m.value.input.value = ""), s("blur", e), r.validateEvent && ((t = p == null ? void 0 : p.validate) == null || t.call(p, "blur").catch((i) => Z()));
|
|
193
|
+
}, $ = () => {
|
|
194
|
+
a.currentValue !== r.modelValue && (a.currentValue = r.modelValue);
|
|
195
195
|
}, me = (e) => {
|
|
196
196
|
document.activeElement === e.target && e.preventDefault();
|
|
197
197
|
};
|
|
198
198
|
return W(() => r.modelValue, (e, n) => {
|
|
199
|
-
const t =
|
|
200
|
-
|
|
199
|
+
const t = R(e, !0);
|
|
200
|
+
a.userInput === null && t !== n && (a.currentValue = t);
|
|
201
201
|
}, { immediate: !0 }), W(() => r.precision, () => {
|
|
202
|
-
|
|
202
|
+
a.currentValue = R(r.modelValue);
|
|
203
203
|
}), be(() => {
|
|
204
204
|
var e;
|
|
205
205
|
const { min: n, max: t, modelValue: i } = r, o = (e = m.value) == null ? void 0 : e.input;
|
|
206
|
-
if (o.setAttribute("role", "spinbutton"), Number.isFinite(t) ? o.setAttribute("aria-valuemax", String(t)) : o.removeAttribute("aria-valuemax"), Number.isFinite(n) ? o.setAttribute("aria-valuemin", String(n)) : o.removeAttribute("aria-valuemin"), o.setAttribute("aria-valuenow",
|
|
206
|
+
if (o.setAttribute("role", "spinbutton"), Number.isFinite(t) ? o.setAttribute("aria-valuemax", String(t)) : o.removeAttribute("aria-valuemax"), Number.isFinite(n) ? o.setAttribute("aria-valuemin", String(n)) : o.removeAttribute("aria-valuemin"), o.setAttribute("aria-valuenow", a.currentValue || a.currentValue === 0 ? String(a.currentValue) : ""), o.setAttribute("aria-disabled", String(V.value)), !b(i) && i != null) {
|
|
207
207
|
let f = Number(i);
|
|
208
208
|
Number.isNaN(f) && (f = null), s(N, f);
|
|
209
209
|
}
|
|
@@ -211,76 +211,76 @@ const xe = 100, Le = 600, ne = {
|
|
|
211
211
|
}), ve(() => {
|
|
212
212
|
var e, n;
|
|
213
213
|
const t = (e = m.value) == null ? void 0 : e.input;
|
|
214
|
-
t == null || t.setAttribute("aria-valuenow", `${(n =
|
|
214
|
+
t == null || t.setAttribute("aria-valuenow", `${(n = a.currentValue) != null ? n : ""}`);
|
|
215
215
|
}), E({
|
|
216
216
|
focus: oe,
|
|
217
217
|
blur: se
|
|
218
|
-
}), (e, n) => (v(),
|
|
218
|
+
}), (e, n) => (v(), x("div", {
|
|
219
219
|
class: z([
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
220
|
+
l(d).b(),
|
|
221
|
+
l(d).m(l(G)),
|
|
222
|
+
l(d).is("disabled", l(V)),
|
|
223
|
+
l(d).is("without-controls", !e.controls),
|
|
224
|
+
l(d).is("controls-right", l(k)),
|
|
225
|
+
l(d).is(e.align, !!e.align)
|
|
226
226
|
]),
|
|
227
227
|
onDragstart: Ne(() => {
|
|
228
228
|
}, ["prevent"])
|
|
229
229
|
}, [
|
|
230
|
-
e.controls ? X((v(),
|
|
230
|
+
e.controls ? X((v(), x("span", {
|
|
231
231
|
key: 0,
|
|
232
232
|
role: "button",
|
|
233
|
-
"aria-label":
|
|
234
|
-
class: z([
|
|
235
|
-
onKeydown:
|
|
233
|
+
"aria-label": l(I)("el.inputNumber.decrease"),
|
|
234
|
+
class: z([l(d).e("decrease"), l(d).is("disabled", l(g))]),
|
|
235
|
+
onKeydown: q(L, ["enter"])
|
|
236
236
|
}, [
|
|
237
237
|
A(e.$slots, "decrease-icon", {}, () => [
|
|
238
|
-
K(
|
|
238
|
+
K(l(j), null, {
|
|
239
239
|
default: P(() => [
|
|
240
|
-
|
|
240
|
+
l(k) ? (v(), F(l(he), { key: 0 })) : (v(), F(l(ye), { key: 1 }))
|
|
241
241
|
]),
|
|
242
242
|
_: 1
|
|
243
243
|
})
|
|
244
244
|
])
|
|
245
245
|
], 42, ["aria-label", "onKeydown"])), [
|
|
246
|
-
[
|
|
247
|
-
]) :
|
|
248
|
-
e.controls ? X((v(),
|
|
246
|
+
[l(ne), L]
|
|
247
|
+
]) : Y("v-if", !0),
|
|
248
|
+
e.controls ? X((v(), x("span", {
|
|
249
249
|
key: 1,
|
|
250
250
|
role: "button",
|
|
251
|
-
"aria-label":
|
|
252
|
-
class: z([
|
|
253
|
-
onKeydown:
|
|
251
|
+
"aria-label": l(I)("el.inputNumber.increase"),
|
|
252
|
+
class: z([l(d).e("increase"), l(d).is("disabled", l(O))]),
|
|
253
|
+
onKeydown: q(B, ["enter"])
|
|
254
254
|
}, [
|
|
255
255
|
A(e.$slots, "increase-icon", {}, () => [
|
|
256
|
-
K(
|
|
256
|
+
K(l(j), null, {
|
|
257
257
|
default: P(() => [
|
|
258
|
-
|
|
258
|
+
l(k) ? (v(), F(l(Ie), { key: 0 })) : (v(), F(l(ge), { key: 1 }))
|
|
259
259
|
]),
|
|
260
260
|
_: 1
|
|
261
261
|
})
|
|
262
262
|
])
|
|
263
263
|
], 42, ["aria-label", "onKeydown"])), [
|
|
264
|
-
[
|
|
265
|
-
]) :
|
|
266
|
-
K(
|
|
264
|
+
[l(ne), B]
|
|
265
|
+
]) : Y("v-if", !0),
|
|
266
|
+
K(l(Ve), {
|
|
267
267
|
id: e.id,
|
|
268
268
|
ref_key: "input",
|
|
269
269
|
ref: m,
|
|
270
270
|
type: "number",
|
|
271
271
|
step: e.step,
|
|
272
|
-
"model-value":
|
|
272
|
+
"model-value": l(C),
|
|
273
273
|
placeholder: e.placeholder,
|
|
274
274
|
readonly: e.readonly,
|
|
275
|
-
disabled:
|
|
276
|
-
size:
|
|
275
|
+
disabled: l(V),
|
|
276
|
+
size: l(G),
|
|
277
277
|
max: e.max,
|
|
278
278
|
min: e.min,
|
|
279
279
|
name: e.name,
|
|
280
280
|
"aria-label": e.ariaLabel,
|
|
281
281
|
"validate-event": !1,
|
|
282
282
|
inputmode: e.inputmode,
|
|
283
|
-
onKeydown:
|
|
283
|
+
onKeydown: ae,
|
|
284
284
|
onBlur: ce,
|
|
285
285
|
onFocus: de,
|
|
286
286
|
onInput: ue,
|
|
@@ -305,7 +305,7 @@ const xe = 100, Le = 600, ne = {
|
|
|
305
305
|
}
|
|
306
306
|
});
|
|
307
307
|
var Oe = /* @__PURE__ */ Se(Ke, [["__file", "input-number.vue"]]);
|
|
308
|
-
const
|
|
308
|
+
const je = Pe(Oe);
|
|
309
309
|
export {
|
|
310
|
-
|
|
310
|
+
je as E
|
|
311
311
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=require("vue"),W=require("./el-input-
|
|
1
|
+
"use strict";const n=require("vue"),W=require("./el-input-06243b61.cjs"),E=require("./index-eab8a286.cjs"),l=require("./base-ef747d02.cjs"),g=require("./el-scrollbar-05815cf5.cjs"),c=require("./el-popper-c9e0136d.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),C=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,r)=>{if(l.isUndefined(r)&&(r=x.value),r===0)return Math.round(e);let t=String(e);const a=t.indexOf(".");if(a===-1||!t.replace(".","").split("")[a+r])return e;const I=t.length;return t.charAt(I-1)==="5"&&(t=`${t.slice(0,Math.max(0,I-1))}6`),Number.parseFloat(Number(t).toFixed(r))},M=e=>{if(l.isNil(e))return 0;const r=e.toString(),t=r.indexOf(".");let a=0;return t!==-1&&(a=r.length-t-1),a},U=(e,r=1)=>l.isNumber(e)?e>=Number.MAX_SAFE_INTEGER&&r===1||e<=Number.MIN_SAFE_INTEGER&&r===-1?e:A(e+u.step*r):i.currentValue,O=e=>{var r;const t=e;if(u.disabledScientific&&["e","E"].includes(t.key)){t.preventDefault();return}const a={[c.EVENT_CODE.up]:()=>{t.preventDefault(),P()},[c.EVENT_CODE.down]:()=>{t.preventDefault(),D()}};(r=a[t.key])==null||r.call(a)},P=()=>{if(u.readonly||V.value||C.value)return;const e=Number(S.value)||0,r=U(e);_(r),d(c.INPUT_EVENT,i.currentValue),B()},D=()=>{if(u.readonly||V.value||y.value)return;const e=Number(S.value)||0,r=U(e,-1);_(r),d(c.INPUT_EVENT,i.currentValue),B()},k=(e,r)=>{const{max:t,min:a,step:s,precision:N,stepStrictly:I,valueOnClear:T}=u;t<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:t}[T]:T}return I&&(m=A(Math.round(m/s)*s,N),m!==e&&r&&d(c.UPDATE_MODEL_EVENT,m)),l.isUndefined(N)||(m=A(m,N)),(m>t||m<a)&&(m=m>t?t:a,r&&d(c.UPDATE_MODEL_EVENT,m)),m},_=(e,r=!0)=>{var t;const a=i.currentValue,s=k(e);if(!r){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&&((t=b==null?void 0:b.validate)==null||t.call(b,"change").catch(N=>c.debugWarn())),i.currentValue=s)},$=e=>{i.userInput=e;const r=e===""?null:Number(e);d(c.INPUT_EVENT,r),_(r,!1)},z=e=>{const r=e!==""?Number(e):"";(l.isNumber(r)&&!Number.isNaN(r)||e==="")&&_(r),B(),i.userInput=null},R=()=>{var e,r;(r=(e=p.value)==null?void 0:e.focus)==null||r.call(e)},K=()=>{var e,r;(r=(e=p.value)==null?void 0:e.blur)==null||r.call(e)},q=e=>{d("focus",e)},G=e=>{var r,t;i.userInput=null,i.currentValue===null&&((r=p.value)!=null&&r.input)&&(p.value.input.value=""),d("blur",e),u.validateEvent&&((t=b==null?void 0:b.validate)==null||t.call(b,"blur").catch(a=>c.debugWarn()))},B=()=>{i.currentValue!==u.modelValue&&(i.currentValue=u.modelValue)},H=e=>{document.activeElement===e.target&&e.preventDefault()};return n.watch(()=>u.modelValue,(e,r)=>{const t=k(e,!0);i.userInput===null&&t!==r&&(i.currentValue=t)},{immediate:!0}),n.watch(()=>u.precision,()=>{i.currentValue=k(u.modelValue)}),n.onMounted(()=>{var e;const{min:r,max:t,modelValue:a}=u,s=(e=p.value)==null?void 0:e.input;if(s.setAttribute("role","spinbutton"),Number.isFinite(t)?s.setAttribute("aria-valuemax",String(t)):s.removeAttribute("aria-valuemax"),Number.isFinite(r)?s.setAttribute("aria-valuemin",String(r)):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,r;const t=(e=p.value)==null?void 0:e.input;t==null||t.setAttribute("aria-valuenow",`${(r=i.currentValue)!=null?r:""}`)}),v({focus:R,blur:K}),(e,r)=>(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(C))]),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 re=l.withInstall(ne);exports.ElInputNumber=re;
|