st-comp 0.0.136 → 0.0.137
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 +2 -2
- package/es/Dialog.cjs +1 -1
- package/es/Dialog.js +11 -11
- package/es/FactorWarning.cjs +1 -1
- package/es/FactorWarning.js +89 -89
- package/es/Kline.cjs +1 -1
- package/es/Kline.js +13 -13
- package/es/KlineBasic.cjs +1 -1
- package/es/KlineBasic.js +22 -22
- package/es/KlineNew.cjs +1 -1
- package/es/KlineNew.js +11 -11
- package/es/Pagination.cjs +1 -1
- package/es/Pagination.js +73 -73
- package/es/Table.cjs +1 -1
- package/es/Table.js +24 -24
- package/es/TreeMap.cjs +1 -2
- package/es/TreeMap.js +1 -163
- package/es/User.cjs +1 -1
- package/es/User.js +32 -32
- package/es/VarietySearch.cjs +1 -1
- package/es/VarietySearch.js +421 -422
- package/es/VirtualTable.cjs +2 -2
- package/es/VirtualTable.js +10 -10
- package/es/{base-3ecbc734.js → base-7ecff73f.js} +68 -68
- package/es/{base-ec05f348.cjs → base-b384d332.cjs} +1 -1
- package/es/{castArray-a45823fe.cjs → castArray-21cb8c6a.cjs} +1 -1
- package/es/{castArray-7d3fc921.js → castArray-d87e6d83.js} +1 -1
- package/es/{config-provider-7cdfca4d.cjs → config-provider-08c54ec3.cjs} +1 -1
- package/es/{config-provider-83904b4d.js → config-provider-c6d33ae0.js} +3 -3
- package/es/{debounce-7344b088.js → debounce-24a2e3ec.js} +25 -25
- package/es/debounce-2ecf2d1f.cjs +1 -0
- package/es/{dropdown-9a974876.cjs → dropdown-1de99dc2.cjs} +1 -1
- package/es/{dropdown-7da44c8f.js → dropdown-6f212b92.js} +4 -4
- package/es/{el-button-24f79286.js → el-button-26f1342d.js} +11 -11
- package/es/{el-button-196807af.cjs → el-button-d234707c.cjs} +1 -1
- package/es/{el-empty-19ea04f4.cjs → el-empty-2d7a61d4.cjs} +1 -1
- package/es/{el-empty-79c5f7a8.js → el-empty-aa6a8f05.js} +1 -1
- package/es/{el-form-item-7d32befa.cjs → el-form-item-466b1601.cjs} +2 -2
- package/es/{el-form-item-afc3dcf2.js → el-form-item-f7a1de00.js} +107 -107
- package/es/{el-input-ee7db655.js → el-input-d0f5c98c.js} +46 -46
- package/es/el-input-fd2b3a26.cjs +1 -0
- package/es/el-input-number-509152ff.cjs +1 -0
- package/es/{el-input-number-63c21037.js → el-input-number-944a4ee2.js} +25 -25
- package/es/{el-menu-item-0d92e7dc.js → el-menu-item-726bb0bc.js} +112 -112
- package/es/el-menu-item-83e9739a.cjs +1 -0
- package/es/{el-message-562e923d.cjs → el-message-67684e35.cjs} +1 -1
- package/es/{el-message-71aa42ca.js → el-message-8149ff2d.js} +38 -38
- package/es/{el-overlay-6056c89a.js → el-overlay-7abe3c16.js} +96 -96
- package/es/{el-overlay-891dcc40.cjs → el-overlay-7d8307c8.cjs} +1 -1
- package/es/{el-popover-8735b1fa.cjs → el-popover-129a9692.cjs} +1 -1
- package/es/{el-popover-c8b2456c.js → el-popover-73df49b7.js} +20 -20
- package/es/el-popper-3d8f2656.cjs +1 -0
- package/es/{el-popper-d3eef7ed.js → el-popper-92dc6e44.js} +134 -134
- package/es/{el-scrollbar-66f3bb72.js → el-scrollbar-9f1b83f8.js} +10 -10
- package/es/el-scrollbar-a01fea99.cjs +1 -0
- package/es/{el-select-5fb7d469.js → el-select-1b3092ab.js} +10 -10
- package/es/el-select-d3f8b31c.cjs +1 -0
- package/es/el-table-column-1319b1ba.cjs +14 -0
- package/es/{el-table-column-560db3aa.js → el-table-column-a781f780.js} +117 -117
- package/es/{el-tag-6a31c968.js → el-tag-4323606a.js} +93 -93
- package/es/{el-tag-3b03d13e.cjs → el-tag-6d45f0b2.cjs} +1 -1
- package/es/{index-a1ecf26c.js → index-0d6776f7.js} +21 -21
- package/es/{index-80a2b137.cjs → index-2d697ae8.cjs} +1 -1
- package/es/{index-fa07a823.js → index-81702fc3.js} +13 -13
- package/es/{index-68ee64fa.js → index-bc7c8ad4.js} +27 -27
- package/es/{index-8a0b1c53.cjs → index-cb665c76.cjs} +1 -1
- package/es/{index-e1e83173.cjs → index-e0fa2f71.cjs} +1 -1
- package/es/{raf-377cf8f5.js → raf-196eee8e.js} +1 -1
- package/es/{raf-8fc301fd.cjs → raf-930895a1.cjs} +1 -1
- package/es/{refs-d00b710b.cjs → refs-4b61ff18.cjs} +1 -1
- package/es/refs-de750cc1.js +9 -0
- package/es/{scroll-41224831.cjs → scroll-495227b0.cjs} +1 -1
- package/es/{scroll-1efa8148.js → scroll-8e2a4c8b.js} +1 -1
- package/es/style.css +1 -1
- package/es/{use-form-common-props-9c0363ac.js → use-form-common-props-1075088e.js} +74 -74
- package/es/{use-form-common-props-1b84d8f4.cjs → use-form-common-props-41091f5f.cjs} +2 -2
- package/es/{vnode-7fbc61e1.cjs → vnode-44ebae3f.cjs} +1 -1
- package/es/{vnode-cfcdab70.js → vnode-85a8ebd8.js} +1 -1
- package/es/{zh-cn-4a476dc8.js → zh-cn-3d9d6ecf.js} +2 -2
- package/es/{zh-cn-ab9a583d.cjs → zh-cn-44d71e6d.cjs} +1 -1
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +1 -1
- package/lib/{index-73a5840c.js → index-4926b969.js} +7 -8
- package/lib/{python-bb104d23.js → python-26e17fc9.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/VarietySearch/index.vue +6 -1
- package/es/debounce-b2ff12bd.cjs +0 -1
- package/es/el-input-6c6f5bda.cjs +0 -1
- package/es/el-input-number-0524d787.cjs +0 -1
- package/es/el-menu-item-dc904a35.cjs +0 -1
- package/es/el-popper-f62316cd.cjs +0 -1
- package/es/el-scrollbar-d1c3e7f7.cjs +0 -1
- package/es/el-select-928f8c19.cjs +0 -1
- package/es/el-table-column-dd8b62aa.cjs +0 -14
- package/es/refs-46cf8186.js +0 -9
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { computed as p, getCurrentInstance as
|
|
2
|
-
import { a as
|
|
3
|
-
import { u as
|
|
4
|
-
import {
|
|
1
|
+
import { computed as p, getCurrentInstance as Ke, defineComponent as ze, useAttrs as je, useSlots as We, shallowRef as q, ref as G, watch as J, nextTick as L, onMounted as Ue, toRef as Ye, openBlock as c, createElementBlock as b, normalizeClass as m, unref as t, normalizeStyle as be, createCommentVNode as f, Fragment as Q, renderSlot as K, createElementVNode as k, createBlock as S, withCtx as M, resolveDynamicComponent as j, mergeProps as xe, withModifiers as Xe, createVNode as Ze, toDisplayString as W } from "vue";
|
|
2
|
+
import { a as _e } from "./el-scrollbar-9f1b83f8.js";
|
|
3
|
+
import { u as qe, i as we, b as Ge, o as Je, c as Qe, d as et, V as tt, v as ot, r as nt, E as B, s as at } from "./use-form-common-props-1075088e.js";
|
|
4
|
+
import { b as Pe, o as Se, d as st, e as ee, x as te, s as U, H as lt, l as Ce, p as rt, N as it, _ as ut, I as Ie, w as dt } from "./base-7ecff73f.js";
|
|
5
5
|
import { m as ct } from "./typescript-7ae59c4c.js";
|
|
6
|
-
import {
|
|
6
|
+
import { b as pt } from "./el-popper-92dc6e44.js";
|
|
7
7
|
import { U as oe } from "./event-09e37cc8.js";
|
|
8
|
-
import { u as ft, a as vt } from "./index-
|
|
8
|
+
import { u as ft, a as vt } from "./index-0d6776f7.js";
|
|
9
9
|
const mt = () => Pe && /firefox/i.test(window.navigator.userAgent);
|
|
10
10
|
let g;
|
|
11
11
|
const ht = {
|
|
@@ -44,7 +44,7 @@ function Ee(n, v = 1, i) {
|
|
|
44
44
|
var o;
|
|
45
45
|
g || (g = document.createElement("textarea"), document.body.appendChild(g));
|
|
46
46
|
const { paddingSize: r, borderSize: u, boxSizing: l, contextStyle: x } = gt(n);
|
|
47
|
-
x.forEach(([y,
|
|
47
|
+
x.forEach(([y, F]) => g == null ? void 0 : g.style.setProperty(y, F)), Object.entries(ht).forEach(([y, F]) => g == null ? void 0 : g.style.setProperty(y, F, "important")), g.value = n.value || n.placeholder || "";
|
|
48
48
|
let d = g.scrollHeight;
|
|
49
49
|
const C = {};
|
|
50
50
|
l === "border-box" ? d = d + u : l === "content-box" && (d = d - r), g.value = "";
|
|
@@ -64,7 +64,7 @@ const bt = st({
|
|
|
64
64
|
type: String,
|
|
65
65
|
default: void 0
|
|
66
66
|
},
|
|
67
|
-
size:
|
|
67
|
+
size: qe,
|
|
68
68
|
disabled: Boolean,
|
|
69
69
|
modelValue: {
|
|
70
70
|
type: ee([
|
|
@@ -154,7 +154,7 @@ const bt = st({
|
|
|
154
154
|
compositionupdate: (n) => n instanceof CompositionEvent,
|
|
155
155
|
compositionend: (n) => n instanceof CompositionEvent
|
|
156
156
|
}, wt = ["class", "style"], St = /^on[A-Z]/, Ct = (n = {}) => {
|
|
157
|
-
const { excludeListeners: v = !1, excludeKeys: i } = n, o = p(() => ((i == null ? void 0 : i.value) || []).concat(wt)), r =
|
|
157
|
+
const { excludeListeners: v = !1, excludeKeys: i } = n, o = p(() => ((i == null ? void 0 : i.value) || []).concat(wt)), r = Ke();
|
|
158
158
|
return r ? p(() => {
|
|
159
159
|
var u;
|
|
160
160
|
return lt(Object.entries((u = r.proxy) == null ? void 0 : u.$attrs).filter(([l]) => !o.value.includes(l) && !(v && St.test(l))));
|
|
@@ -204,9 +204,9 @@ const Et = ze({
|
|
|
204
204
|
props: bt,
|
|
205
205
|
emits: xt,
|
|
206
206
|
setup(n, { expose: v, emit: i }) {
|
|
207
|
-
const o = n, r =
|
|
207
|
+
const o = n, r = je(), u = Ct(), l = We(), x = p(() => [
|
|
208
208
|
o.type === "textarea" ? ne.b() : a.b(),
|
|
209
|
-
a.m(
|
|
209
|
+
a.m(F.value),
|
|
210
210
|
a.is("disabled", E.value),
|
|
211
211
|
a.is("exceed", Re.value),
|
|
212
212
|
{
|
|
@@ -220,9 +220,9 @@ const Et = ze({
|
|
|
220
220
|
]), d = p(() => [
|
|
221
221
|
a.e("wrapper"),
|
|
222
222
|
a.is("focus", A.value)
|
|
223
|
-
]), { form: C, formItem: h } =
|
|
223
|
+
]), { form: C, formItem: h } = Ge(), { inputId: y } = Je(o, {
|
|
224
224
|
formItemContext: h
|
|
225
|
-
}),
|
|
225
|
+
}), F = Qe(), E = et(), a = Ce("input"), ne = Ce("textarea"), H = q(), w = q(), Y = G(!1), O = G(!1), ae = G(), $ = q(o.inputStyle), z = p(() => H.value || w.value), { wrapperRef: Ne, isFocused: A, handleFocus: ke, handleBlur: Fe } = ft(z, {
|
|
226
226
|
beforeFocus() {
|
|
227
227
|
return E.value;
|
|
228
228
|
},
|
|
@@ -239,20 +239,20 @@ const Et = ze({
|
|
|
239
239
|
o.inputStyle,
|
|
240
240
|
$.value,
|
|
241
241
|
{ resize: o.resize }
|
|
242
|
-
]), I = p(() => rt(o.modelValue) ? "" : String(o.modelValue)), D = p(() => o.clearable && !E.value && !o.readonly && !!I.value && (A.value || Y.value)), X = p(() => o.showPassword && !E.value && !!I.value && (!!I.value || A.value)), P = p(() => o.showWordLimit && !!o.maxlength && (o.type === "text" || o.type === "textarea") && !E.value && !o.readonly && !o.showPassword),
|
|
243
|
-
|
|
242
|
+
]), I = p(() => rt(o.modelValue) ? "" : String(o.modelValue)), D = p(() => o.clearable && !E.value && !o.readonly && !!I.value && (A.value || Y.value)), X = p(() => o.showPassword && !E.value && !!I.value && (!!I.value || A.value)), P = p(() => o.showWordLimit && !!o.maxlength && (o.type === "text" || o.type === "textarea") && !E.value && !o.readonly && !o.showPassword), Z = p(() => I.value.length), Re = p(() => !!P.value && Z.value > Number(o.maxlength)), Le = p(() => !!l.suffix || !!o.suffixIcon || D.value || o.showPassword || P.value || !!V.value && se.value), [ie, ue] = It(H);
|
|
243
|
+
_e(w, (e) => {
|
|
244
244
|
if (Me(), !P.value || o.resize !== "both")
|
|
245
245
|
return;
|
|
246
|
-
const s = e[0], { width:
|
|
246
|
+
const s = e[0], { width: N } = s.contentRect;
|
|
247
247
|
ae.value = {
|
|
248
|
-
right: `calc(100% - ${
|
|
248
|
+
right: `calc(100% - ${N + 15 + 6}px)`
|
|
249
249
|
};
|
|
250
250
|
});
|
|
251
251
|
const T = () => {
|
|
252
252
|
const { type: e, autosize: s } = o;
|
|
253
253
|
if (!(!Pe || e !== "textarea" || !w.value))
|
|
254
254
|
if (s) {
|
|
255
|
-
const
|
|
255
|
+
const N = Ie(s) ? s.minRows : void 0, ye = Ie(s) ? s.maxRows : void 0, ge = Ee(w.value, N, ye);
|
|
256
256
|
$.value = {
|
|
257
257
|
overflowY: "hidden",
|
|
258
258
|
...ge
|
|
@@ -266,15 +266,15 @@ const Et = ze({
|
|
|
266
266
|
}, Me = ((e) => {
|
|
267
267
|
let s = !1;
|
|
268
268
|
return () => {
|
|
269
|
-
var
|
|
269
|
+
var N;
|
|
270
270
|
if (s || !o.autosize)
|
|
271
271
|
return;
|
|
272
|
-
((
|
|
272
|
+
((N = w.value) == null ? void 0 : N.offsetParent) === null || (e(), s = !0);
|
|
273
273
|
};
|
|
274
274
|
})(T), R = () => {
|
|
275
275
|
const e = z.value, s = o.formatter ? o.formatter(I.value) : I.value;
|
|
276
276
|
!e || e.value === s || (e.value = s);
|
|
277
|
-
},
|
|
277
|
+
}, _ = async (e) => {
|
|
278
278
|
ie();
|
|
279
279
|
let { value: s } = e.target;
|
|
280
280
|
if (o.formatter && (s = o.parser ? o.parser(s) : s), !ce.value) {
|
|
@@ -291,7 +291,7 @@ const Et = ze({
|
|
|
291
291
|
handleCompositionStart: pe,
|
|
292
292
|
handleCompositionUpdate: fe,
|
|
293
293
|
handleCompositionEnd: ve
|
|
294
|
-
} = vt({ emit: i, afterComposition:
|
|
294
|
+
} = vt({ emit: i, afterComposition: _ }), Be = () => {
|
|
295
295
|
ie(), O.value = !O.value, setTimeout(ue);
|
|
296
296
|
}, He = () => {
|
|
297
297
|
var e;
|
|
@@ -311,10 +311,10 @@ const Et = ze({
|
|
|
311
311
|
}, he = () => {
|
|
312
312
|
i(oe, ""), i("change", ""), i("clear"), i("input", "");
|
|
313
313
|
};
|
|
314
|
-
return
|
|
314
|
+
return J(() => o.modelValue, () => {
|
|
315
315
|
var e;
|
|
316
316
|
L(() => T()), o.validateEvent && ((e = h == null ? void 0 : h.validate) == null || e.call(h, "change").catch((s) => U(s)));
|
|
317
|
-
}),
|
|
317
|
+
}), J(I, () => R()), J(() => o.type, async () => {
|
|
318
318
|
await L(), R(), T();
|
|
319
319
|
}), Ue(() => {
|
|
320
320
|
!o.formatter && o.parser && U("ElInput", "If you set the parser, you also need to set the formatter."), R(), L(T);
|
|
@@ -349,11 +349,11 @@ const Et = ze({
|
|
|
349
349
|
key: 0,
|
|
350
350
|
class: m(t(a).be("group", "prepend"))
|
|
351
351
|
}, [
|
|
352
|
-
|
|
352
|
+
K(e.$slots, "prepend")
|
|
353
353
|
], 2)) : f("v-if", !0),
|
|
354
|
-
|
|
354
|
+
k("div", {
|
|
355
355
|
ref_key: "wrapperRef",
|
|
356
|
-
ref:
|
|
356
|
+
ref: Ne,
|
|
357
357
|
class: m(t(d))
|
|
358
358
|
}, [
|
|
359
359
|
f(" prefix slot "),
|
|
@@ -361,22 +361,22 @@ const Et = ze({
|
|
|
361
361
|
key: 0,
|
|
362
362
|
class: m(t(a).e("prefix"))
|
|
363
363
|
}, [
|
|
364
|
-
|
|
364
|
+
k("span", {
|
|
365
365
|
class: m(t(a).e("prefix-inner"))
|
|
366
366
|
}, [
|
|
367
|
-
|
|
367
|
+
K(e.$slots, "prefix"),
|
|
368
368
|
e.prefixIcon ? (c(), S(t(B), {
|
|
369
369
|
key: 0,
|
|
370
370
|
class: m(t(a).e("icon"))
|
|
371
371
|
}, {
|
|
372
372
|
default: M(() => [
|
|
373
|
-
(c(), S(
|
|
373
|
+
(c(), S(j(e.prefixIcon)))
|
|
374
374
|
]),
|
|
375
375
|
_: 1
|
|
376
376
|
}, 8, ["class"])) : f("v-if", !0)
|
|
377
377
|
], 2)
|
|
378
378
|
], 2)) : f("v-if", !0),
|
|
379
|
-
|
|
379
|
+
k("input", xe({
|
|
380
380
|
id: t(y),
|
|
381
381
|
ref_key: "input",
|
|
382
382
|
ref: H,
|
|
@@ -398,7 +398,7 @@ const Et = ze({
|
|
|
398
398
|
onCompositionstart: t(pe),
|
|
399
399
|
onCompositionupdate: t(fe),
|
|
400
400
|
onCompositionend: t(ve),
|
|
401
|
-
onInput:
|
|
401
|
+
onInput: _,
|
|
402
402
|
onChange: de,
|
|
403
403
|
onKeydown: me
|
|
404
404
|
}), null, 16, ["id", "minlength", "maxlength", "type", "disabled", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form", "autofocus", "role", "onCompositionstart", "onCompositionupdate", "onCompositionend"]),
|
|
@@ -407,17 +407,17 @@ const Et = ze({
|
|
|
407
407
|
key: 1,
|
|
408
408
|
class: m(t(a).e("suffix"))
|
|
409
409
|
}, [
|
|
410
|
-
|
|
410
|
+
k("span", {
|
|
411
411
|
class: m(t(a).e("suffix-inner"))
|
|
412
412
|
}, [
|
|
413
413
|
!t(D) || !t(X) || !t(P) ? (c(), b(Q, { key: 0 }, [
|
|
414
|
-
|
|
414
|
+
K(e.$slots, "suffix"),
|
|
415
415
|
e.suffixIcon ? (c(), S(t(B), {
|
|
416
416
|
key: 0,
|
|
417
417
|
class: m(t(a).e("icon"))
|
|
418
418
|
}, {
|
|
419
419
|
default: M(() => [
|
|
420
|
-
(c(), S(
|
|
420
|
+
(c(), S(j(e.suffixIcon)))
|
|
421
421
|
]),
|
|
422
422
|
_: 1
|
|
423
423
|
}, 8, ["class"])) : f("v-if", !0)
|
|
@@ -429,7 +429,7 @@ const Et = ze({
|
|
|
429
429
|
onClick: he
|
|
430
430
|
}, {
|
|
431
431
|
default: M(() => [
|
|
432
|
-
|
|
432
|
+
Ze(t(at))
|
|
433
433
|
]),
|
|
434
434
|
_: 1
|
|
435
435
|
}, 8, ["class", "onMousedown"])) : f("v-if", !0),
|
|
@@ -439,7 +439,7 @@ const Et = ze({
|
|
|
439
439
|
onClick: Be
|
|
440
440
|
}, {
|
|
441
441
|
default: M(() => [
|
|
442
|
-
(c(), S(
|
|
442
|
+
(c(), S(j(t(Ve))))
|
|
443
443
|
]),
|
|
444
444
|
_: 1
|
|
445
445
|
}, 8, ["class"])) : f("v-if", !0),
|
|
@@ -447,9 +447,9 @@ const Et = ze({
|
|
|
447
447
|
key: 3,
|
|
448
448
|
class: m(t(a).e("count"))
|
|
449
449
|
}, [
|
|
450
|
-
|
|
450
|
+
k("span", {
|
|
451
451
|
class: m(t(a).e("count-inner"))
|
|
452
|
-
}, W(t(
|
|
452
|
+
}, W(t(Z)) + " / " + W(e.maxlength), 3)
|
|
453
453
|
], 2)) : f("v-if", !0),
|
|
454
454
|
t(V) && t(le) && t(se) ? (c(), S(t(B), {
|
|
455
455
|
key: 4,
|
|
@@ -460,7 +460,7 @@ const Et = ze({
|
|
|
460
460
|
])
|
|
461
461
|
}, {
|
|
462
462
|
default: M(() => [
|
|
463
|
-
(c(), S(
|
|
463
|
+
(c(), S(j(t(le))))
|
|
464
464
|
]),
|
|
465
465
|
_: 1
|
|
466
466
|
}, 8, ["class"])) : f("v-if", !0)
|
|
@@ -472,11 +472,11 @@ const Et = ze({
|
|
|
472
472
|
key: 1,
|
|
473
473
|
class: m(t(a).be("group", "append"))
|
|
474
474
|
}, [
|
|
475
|
-
|
|
475
|
+
K(e.$slots, "append")
|
|
476
476
|
], 2)) : f("v-if", !0)
|
|
477
477
|
], 64)) : (c(), b(Q, { key: 1 }, [
|
|
478
478
|
f(" textarea "),
|
|
479
|
-
|
|
479
|
+
k("textarea", xe({
|
|
480
480
|
id: t(y),
|
|
481
481
|
ref_key: "textarea",
|
|
482
482
|
ref: w,
|
|
@@ -498,9 +498,9 @@ const Et = ze({
|
|
|
498
498
|
onCompositionstart: t(pe),
|
|
499
499
|
onCompositionupdate: t(fe),
|
|
500
500
|
onCompositionend: t(ve),
|
|
501
|
-
onInput:
|
|
502
|
-
onFocus: t(
|
|
503
|
-
onBlur: t(
|
|
501
|
+
onInput: _,
|
|
502
|
+
onFocus: t(ke),
|
|
503
|
+
onBlur: t(Fe),
|
|
504
504
|
onChange: de,
|
|
505
505
|
onKeydown: me
|
|
506
506
|
}), null, 16, ["id", "minlength", "maxlength", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form", "autofocus", "rows", "role", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onFocus", "onBlur"]),
|
|
@@ -508,7 +508,7 @@ const Et = ze({
|
|
|
508
508
|
key: 0,
|
|
509
509
|
style: be(ae.value),
|
|
510
510
|
class: m(t(a).e("count"))
|
|
511
|
-
}, W(t(
|
|
511
|
+
}, W(t(Z)) + " / " + W(e.maxlength), 7)) : f("v-if", !0)
|
|
512
512
|
], 64))
|
|
513
513
|
], 38));
|
|
514
514
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),ge=require("./el-scrollbar-a01fea99.cjs"),f=require("./use-form-common-props-41091f5f.cjs"),s=require("./base-b384d332.cjs"),be=require("./typescript-b63f8e83.cjs"),Ce=require("./el-popper-3d8f2656.cjs"),$=require("./event-61f49698.cjs"),te=require("./index-2d697ae8.cjs"),ne=()=>s.isClient&&/firefox/i.test(window.navigator.userAgent);let h;const xe={height:"0",visibility:"hidden",overflow:ne()?"":"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},we=["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"];function Ee(n){const p=window.getComputedStyle(n),u=p.getPropertyValue("box-sizing"),o=Number.parseFloat(p.getPropertyValue("padding-bottom"))+Number.parseFloat(p.getPropertyValue("padding-top")),i=Number.parseFloat(p.getPropertyValue("border-bottom-width"))+Number.parseFloat(p.getPropertyValue("border-top-width"));return{contextStyle:we.map(l=>[l,p.getPropertyValue(l)]),paddingSize:o,borderSize:i,boxSizing:u}}function oe(n,p=1,u){var o;h||(h=document.createElement("textarea"),document.body.appendChild(h));const{paddingSize:i,borderSize:c,boxSizing:l,contextStyle:y}=Ee(n);y.forEach(([v,S])=>h==null?void 0:h.style.setProperty(v,S)),Object.entries(xe).forEach(([v,S])=>h==null?void 0:h.style.setProperty(v,S,"important")),h.value=n.value||n.placeholder||"";let d=h.scrollHeight;const b={};l==="border-box"?d=d+c:l==="content-box"&&(d=d-i),h.value="";const m=h.scrollHeight-i;if(s.isNumber(p)){let v=m*p;l==="border-box"&&(v=v+i+c),d=Math.max(v,d),b.minHeight=`${v}px`}if(s.isNumber(u)){let v=m*u;l==="border-box"&&(v=v+i+c),d=Math.min(v,d)}return b.height=`${d}px`,(o=h.parentNode)==null||o.removeChild(h),h=void 0,b}const ke=s.buildProps({id:{type:String,default:void 0},size:f.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:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,showPassword:Boolean,showWordLimit:Boolean,suffixIcon:{type:f.iconPropType},prefixIcon:{type:f.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},...Ce.useAriaProps(["ariaLabel"])}),Se={[$.UPDATE_MODEL_EVENT]:n=>s.isString$1(n),input:n=>s.isString$1(n),change:n=>s.isString$1(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},Ie=["class","style"],Be=/^on[A-Z]/,Ne=(n={})=>{const{excludeListeners:p=!1,excludeKeys:u}=n,o=e.computed(()=>((u==null?void 0:u.value)||[]).concat(Ie)),i=e.getCurrentInstance();return i?e.computed(()=>{var c;return s.fromPairs(Object.entries((c=i.proxy)==null?void 0:c.$attrs).filter(([l])=>!o.value.includes(l)&&!(p&&Be.test(l))))}):(s.debugWarn("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),e.computed(()=>({})))};function ze(n){let p;function u(){if(n.value==null)return;const{selectionStart:i,selectionEnd:c,value:l}=n.value;if(i==null||c==null)return;const y=l.slice(0,Math.max(0,i)),d=l.slice(Math.max(0,c));p={selectionStart:i,selectionEnd:c,value:l,beforeTxt:y,afterTxt:d}}function o(){if(n.value==null||p==null)return;const{value:i}=n.value,{beforeTxt:c,afterTxt:l,selectionStart:y}=p;if(c==null||l==null||y==null)return;let d=i.length;if(i.endsWith(l))d=i.length-l.length;else if(i.startsWith(c))d=c.length;else{const b=c[y-1],m=i.indexOf(b,y-1);m!==-1&&(d=m+1)}n.value.setSelectionRange(d,d)}return[u,o]}const Ve=e.defineComponent({name:"ElInput",inheritAttrs:!1}),Pe=e.defineComponent({...Ve,props:ke,emits:Se,setup(n,{expose:p,emit:u}){const o=n,i=e.useAttrs(),c=Ne(),l=e.useSlots(),y=e.computed(()=>[o.type==="textarea"?O.b():r.b(),r.m(S.value),r.is("disabled",x.value),r.is("exceed",ue.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")]:F.value&&R.value,[r.b("hidden")]:o.type==="hidden"},i.class]),d=e.computed(()=>[r.e("wrapper"),r.is("focus",T.value)]),{form:b,formItem:m}=f.useFormItem(),{inputId:v}=f.useFormItemInputId(o,{formItemContext:m}),S=f.useFormSize(),x=f.useFormDisabled(),r=s.useNamespace("input"),O=s.useNamespace("textarea"),z=e.shallowRef(),g=e.shallowRef(),D=e.ref(!1),V=e.ref(!1),A=e.ref(),P=e.shallowRef(o.inputStyle),w=e.computed(()=>z.value||g.value),{wrapperRef:re,isFocused:T,handleFocus:ae,handleBlur:le}=te.useFocusController(w,{beforeFocus(){return x.value},afterBlur(){var t;o.validateEvent&&((t=m==null?void 0:m.validate)==null||t.call(m,"blur").catch(a=>s.debugWarn(a)))}}),H=e.computed(()=>{var t;return(t=b==null?void 0:b.statusIcon)!=null?t:!1}),I=e.computed(()=>(m==null?void 0:m.validateState)||""),W=e.computed(()=>I.value&&f.ValidateComponentsMap[I.value]),se=e.computed(()=>V.value?f.view_default:f.hide_default),ie=e.computed(()=>[i.style]),q=e.computed(()=>[o.inputStyle,P.value,{resize:o.resize}]),C=e.computed(()=>s.isNil(o.modelValue)?"":String(o.modelValue)),F=e.computed(()=>o.clearable&&!x.value&&!o.readonly&&!!C.value&&(T.value||D.value)),R=e.computed(()=>o.showPassword&&!x.value&&!!C.value&&(!!C.value||T.value)),E=e.computed(()=>o.showWordLimit&&!!o.maxlength&&(o.type==="text"||o.type==="textarea")&&!x.value&&!o.readonly&&!o.showPassword),L=e.computed(()=>C.value.length),ue=e.computed(()=>!!E.value&&L.value>Number(o.maxlength)),ce=e.computed(()=>!!l.suffix||!!o.suffixIcon||F.value||o.showPassword||E.value||!!I.value&&H.value),[K,j]=ze(z);ge.useResizeObserver(g,t=>{if(de(),!E.value||o.resize!=="both")return;const a=t[0],{width:k}=a.contentRect;A.value={right:`calc(100% - ${k+15+6}px)`}});const B=()=>{const{type:t,autosize:a}=o;if(!(!s.isClient||t!=="textarea"||!g.value))if(a){const k=s.isObject$1(a)?a.minRows:void 0,Q=s.isObject$1(a)?a.maxRows:void 0,ee=oe(g.value,k,Q);P.value={overflowY:"hidden",...ee},e.nextTick(()=>{g.value.offsetHeight,P.value=ee})}else P.value={minHeight:oe(g.value).minHeight}},de=(t=>{let a=!1;return()=>{var k;if(a||!o.autosize)return;((k=g.value)==null?void 0:k.offsetParent)===null||(t(),a=!0)}})(B),N=()=>{const t=w.value,a=o.formatter?o.formatter(C.value):C.value;!t||t.value===a||(t.value=a)},M=async t=>{K();let{value:a}=t.target;if(o.formatter&&(a=o.parser?o.parser(a):a),!Y.value){if(a===C.value){N();return}u($.UPDATE_MODEL_EVENT,a),u("input",a),await e.nextTick(),N(),j()}},U=t=>{u("change",t.target.value)},{isComposing:Y,handleCompositionStart:_,handleCompositionUpdate:X,handleCompositionEnd:Z}=te.useComposition({emit:u,afterComposition:M}),pe=()=>{K(),V.value=!V.value,setTimeout(j)},fe=()=>{var t;return(t=w.value)==null?void 0:t.focus()},me=()=>{var t;return(t=w.value)==null?void 0:t.blur()},ve=t=>{D.value=!1,u("mouseleave",t)},he=t=>{D.value=!0,u("mouseenter",t)},G=t=>{u("keydown",t)},ye=()=>{var t;(t=w.value)==null||t.select()},J=()=>{u($.UPDATE_MODEL_EVENT,""),u("change",""),u("clear"),u("input","")};return e.watch(()=>o.modelValue,()=>{var t;e.nextTick(()=>B()),o.validateEvent&&((t=m==null?void 0:m.validate)==null||t.call(m,"change").catch(a=>s.debugWarn(a)))}),e.watch(C,()=>N()),e.watch(()=>o.type,async()=>{await e.nextTick(),N(),B()}),e.onMounted(()=>{!o.formatter&&o.parser&&s.debugWarn("ElInput","If you set the parser, you also need to set the formatter."),N(),e.nextTick(B)}),p({input:z,textarea:g,ref:w,textareaStyle:q,autosize:e.toRef(o,"autosize"),isComposing:Y,focus:fe,blur:me,select:ye,clear:J,resizeTextarea:B}),(t,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(y),{[e.unref(r).bm("group","append")]:t.$slots.append,[e.unref(r).bm("group","prepend")]:t.$slots.prepend}]),style:e.normalizeStyle(e.unref(ie)),onMouseenter:he,onMouseleave:ve},[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:re,class:e.normalizeClass(e.unref(d))},[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(f.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(v),ref_key:"input",ref:z,class:e.unref(r).e("inner")},e.unref(c),{minlength:t.minlength,maxlength:t.maxlength,type:t.showPassword?V.value?"text":"password":t.type,disabled:e.unref(x),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,onCompositionstart:e.unref(_),onCompositionupdate:e.unref(X),onCompositionend:e.unref(Z),onInput:M,onChange:U,onKeydown:G}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","role","onCompositionstart","onCompositionupdate","onCompositionend"]),e.createCommentVNode(" suffix slot "),e.unref(ce)?(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(F)||!e.unref(R)||!e.unref(E)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.renderSlot(t.$slots,"suffix"),t.suffixIcon?(e.openBlock(),e.createBlock(e.unref(f.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(F)?(e.openBlock(),e.createBlock(e.unref(f.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:J},{default:e.withCtx(()=>[e.createVNode(e.unref(f.circle_close_default))]),_:1},8,["class","onMousedown"])):e.createCommentVNode("v-if",!0),e.unref(R)?(e.openBlock(),e.createBlock(e.unref(f.ElIcon),{key:2,class:e.normalizeClass([e.unref(r).e("icon"),e.unref(r).e("password")]),onClick:pe},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(se))))]),_:1},8,["class"])):e.createCommentVNode("v-if",!0),e.unref(E)?(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(I)&&e.unref(W)&&e.unref(H)?(e.openBlock(),e.createBlock(e.unref(f.ElIcon),{key:4,class:e.normalizeClass([e.unref(r).e("icon"),e.unref(r).e("validateIcon"),e.unref(r).is("loading",e.unref(I)==="validating")])},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(W))))]),_: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(v),ref_key:"textarea",ref:g,class:[e.unref(O).e("inner"),e.unref(r).is("focus",e.unref(T))]},e.unref(c),{minlength:t.minlength,maxlength:t.maxlength,tabindex:t.tabindex,disabled:e.unref(x),readonly:t.readonly,autocomplete:t.autocomplete,style:e.unref(q),"aria-label":t.ariaLabel,placeholder:t.placeholder,form:t.form,autofocus:t.autofocus,rows:t.rows,role:t.containerRole,onCompositionstart:e.unref(_),onCompositionupdate:e.unref(X),onCompositionend:e.unref(Z),onInput:M,onFocus:e.unref(ae),onBlur:e.unref(le),onChange:U,onKeydown:G}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","role","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),e.unref(E)?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(A.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.isFirefox=ne;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),U=require("./el-input-fd2b3a26.cjs"),N=require("./use-form-common-props-41091f5f.cjs"),u=require("./base-b384d332.cjs"),G=require("./el-popper-3d8f2656.cjs"),p=require("./event-61f49698.cjs"),Y=100,H=600,x={beforeMount(o,E){const c=E.value,{interval:l=Y,delay:h=H}=u.isFunction(c)?{}:c;let d,m;const i=()=>u.isFunction(c)?c():c.handler(),v=()=>{m&&(clearTimeout(m),m=void 0),d&&(clearInterval(d),d=void 0)};o.addEventListener("mousedown",I=>{I.button===0&&(v(),i(),document.addEventListener("mouseup",()=>v(),{once:!0}),m=setTimeout(()=>{d=setInterval(()=>{i()},l)},h))})}},j=u.buildProps({id:{type:String,default:void 0},step:{type:Number,default:1},stepStrictly:Boolean,max:{type:Number,default:Number.POSITIVE_INFINITY},min:{type:Number,default:Number.NEGATIVE_INFINITY},modelValue:Number,readonly:Boolean,disabled:Boolean,size:N.useSizeProp,controls:{type:Boolean,default:!0},controlsPosition:{type:String,default:"",values:["","right"]},valueOnClear:{type:[String,Number,null],validator:o=>o===null||u.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},...G.useAriaProps(["ariaLabel"])}),J={[p.CHANGE_EVENT]:(o,E)=>E!==o,blur:o=>o instanceof FocusEvent,focus:o=>o instanceof FocusEvent,[p.INPUT_EVENT]:o=>u.isNumber(o)||u.isNil(o),[p.UPDATE_MODEL_EVENT]:o=>u.isNumber(o)||u.isNil(o)},Q=e.defineComponent({name:"ElInputNumber"}),X=e.defineComponent({...Q,props:j,emits:J,setup(o,{expose:E,emit:c}){const l=o,{t:h}=u.useLocale(),d=u.useNamespace("input-number"),m=e.ref(),i=e.reactive({currentValue:l.modelValue,userInput:null}),{formItem:v}=N.useFormItem(),I=e.computed(()=>u.isNumber(l.modelValue)&&l.modelValue<=l.min),D=e.computed(()=>u.isNumber(l.modelValue)&&l.modelValue>=l.max),L=e.computed(()=>{const n=C(l.step);return u.isUndefined(l.precision)?Math.max(C(l.modelValue),n):(n>l.precision&&u.debugWarn("InputNumber","precision should not be less than the decimal places of step"),l.precision)}),T=e.computed(()=>l.controls&&l.controlsPosition==="right"),B=N.useFormSize(),V=N.useFormDisabled(),g=e.computed(()=>{if(i.userInput!==null)return i.userInput;let n=i.currentValue;if(u.isNil(n))return"";if(u.isNumber(n)){if(Number.isNaN(n))return"";u.isUndefined(l.precision)||(n=n.toFixed(l.precision))}return n}),P=(n,t)=>{if(u.isUndefined(t)&&(t=L.value),t===0)return Math.round(n);let r=String(n);const a=r.indexOf(".");if(a===-1||!r.replace(".","").split("")[a+t])return n;const w=r.length;return r.charAt(w-1)==="5"&&(r=`${r.slice(0,Math.max(0,w-1))}6`),Number.parseFloat(Number(r).toFixed(t))},C=n=>{if(u.isNil(n))return 0;const t=n.toString(),r=t.indexOf(".");let a=0;return r!==-1&&(a=t.length-r-1),a},F=(n,t=1)=>u.isNumber(n)?P(n+l.step*t):i.currentValue,A=()=>{if(l.readonly||V.value||D.value)return;const n=Number(g.value)||0,t=F(n);y(t),c(p.INPUT_EVENT,i.currentValue),k()},S=()=>{if(l.readonly||V.value||I.value)return;const n=Number(g.value)||0,t=F(n,-1);y(t),c(p.INPUT_EVENT,i.currentValue),k()},M=(n,t)=>{const{max:r,min:a,step:s,precision:b,stepStrictly:w,valueOnClear:_}=l;r<a&&u.throwError("InputNumber","min should not be greater than max.");let f=Number(n);if(u.isNil(n)||Number.isNaN(f))return null;if(n===""){if(_===null)return null;f=u.isString$1(_)?{min:a,max:r}[_]:_}return w&&(f=P(Math.round(f/s)*s,b),f!==n&&t&&c(p.UPDATE_MODEL_EVENT,f)),u.isUndefined(b)||(f=P(f,b)),(f>r||f<a)&&(f=f>r?r:a,t&&c(p.UPDATE_MODEL_EVENT,f)),f},y=(n,t=!0)=>{var r;const a=i.currentValue,s=M(n);if(!t){c(p.UPDATE_MODEL_EVENT,s);return}a===s&&n||(i.userInput=null,c(p.UPDATE_MODEL_EVENT,s),a!==s&&c(p.CHANGE_EVENT,s,a),l.validateEvent&&((r=v==null?void 0:v.validate)==null||r.call(v,"change").catch(b=>u.debugWarn(b))),i.currentValue=s)},O=n=>{i.userInput=n;const t=n===""?null:Number(n);c(p.INPUT_EVENT,t),y(t,!1)},K=n=>{const t=n!==""?Number(n):"";(u.isNumber(t)&&!Number.isNaN(t)||n==="")&&y(t),k(),i.userInput=null},$=()=>{var n,t;(t=(n=m.value)==null?void 0:n.focus)==null||t.call(n)},z=()=>{var n,t;(t=(n=m.value)==null?void 0:n.blur)==null||t.call(n)},q=n=>{c("focus",n)},R=n=>{var t,r;i.userInput=null,U.isFirefox()&&i.currentValue===null&&((t=m.value)!=null&&t.input)&&(m.value.input.value=""),c("blur",n),l.validateEvent&&((r=v==null?void 0:v.validate)==null||r.call(v,"blur").catch(a=>u.debugWarn(a)))},k=()=>{i.currentValue!==l.modelValue&&(i.currentValue=l.modelValue)},W=n=>{document.activeElement===n.target&&n.preventDefault()};return e.watch(()=>l.modelValue,(n,t)=>{const r=M(n,!0);i.userInput===null&&r!==t&&(i.currentValue=r)},{immediate:!0}),e.onMounted(()=>{var n;const{min:t,max:r,modelValue:a}=l,s=(n=m.value)==null?void 0:n.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)),!u.isNumber(a)&&a!=null){let b=Number(a);Number.isNaN(b)&&(b=null),c(p.UPDATE_MODEL_EVENT,b)}s.addEventListener("wheel",W,{passive:!1})}),e.onUpdated(()=>{var n,t;const r=(n=m.value)==null?void 0:n.input;r==null||r.setAttribute("aria-valuenow",`${(t=i.currentValue)!=null?t:""}`)}),E({focus:$,blur:z}),(n,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(d).b(),e.unref(d).m(e.unref(B)),e.unref(d).is("disabled",e.unref(V)),e.unref(d).is("without-controls",!n.controls),e.unref(d).is("controls-right",e.unref(T))]),onDragstart:e.withModifiers(()=>{},["prevent"])},[n.controls?e.withDirectives((e.openBlock(),e.createElementBlock("span",{key:0,role:"button","aria-label":e.unref(h)("el.inputNumber.decrease"),class:e.normalizeClass([e.unref(d).e("decrease"),e.unref(d).is("disabled",e.unref(I))]),onKeydown:e.withKeys(S,["enter"])},[e.renderSlot(n.$slots,"decrease-icon",{},()=>[e.createVNode(e.unref(N.ElIcon),null,{default:e.withCtx(()=>[e.unref(T)?(e.openBlock(),e.createBlock(e.unref(N.arrow_down_default),{key:0})):(e.openBlock(),e.createBlock(e.unref(N.minus_default),{key:1}))]),_:1})])],42,["aria-label","onKeydown"])),[[e.unref(x),S]]):e.createCommentVNode("v-if",!0),n.controls?e.withDirectives((e.openBlock(),e.createElementBlock("span",{key:1,role:"button","aria-label":e.unref(h)("el.inputNumber.increase"),class:e.normalizeClass([e.unref(d).e("increase"),e.unref(d).is("disabled",e.unref(D))]),onKeydown:e.withKeys(A,["enter"])},[e.renderSlot(n.$slots,"increase-icon",{},()=>[e.createVNode(e.unref(N.ElIcon),null,{default:e.withCtx(()=>[e.unref(T)?(e.openBlock(),e.createBlock(e.unref(N.arrow_up_default),{key:0})):(e.openBlock(),e.createBlock(e.unref(N.plus_default),{key:1}))]),_:1})])],42,["aria-label","onKeydown"])),[[e.unref(x),A]]):e.createCommentVNode("v-if",!0),e.createVNode(e.unref(U.ElInput),{id:n.id,ref_key:"input",ref:m,type:"number",step:n.step,"model-value":e.unref(g),placeholder:n.placeholder,readonly:n.readonly,disabled:e.unref(V),size:e.unref(B),max:n.max,min:n.min,name:n.name,"aria-label":n.ariaLabel,"validate-event":!1,onKeydown:[e.withKeys(e.withModifiers(A,["prevent"]),["up"]),e.withKeys(e.withModifiers(S,["prevent"]),["down"])],onBlur:R,onFocus:q,onInput:O,onChange:K},e.createSlots({_:2},[n.$slots.prefix?{name:"prefix",fn:e.withCtx(()=>[e.renderSlot(n.$slots,"prefix")])}:void 0,n.$slots.suffix?{name:"suffix",fn:e.withCtx(()=>[e.renderSlot(n.$slots,"suffix")])}:void 0]),1032,["id","step","model-value","placeholder","readonly","disabled","size","max","min","name","aria-label","onKeydown"])],42,["onDragstart"]))}});var Z=u._export_sfc(X,[["__file","input-number.vue"]]);const ee=u.withInstall(Z);exports.ElInputNumber=ee;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { defineComponent as ee, ref as ce, reactive as de, computed as I, watch as me, onMounted as pe, onUpdated as fe, openBlock as v, createElementBlock as z, normalizeClass as K, unref as r, withModifiers as O, withDirectives as j, withKeys as A, renderSlot as P, createVNode as R, withCtx as F, createBlock as T, createCommentVNode as J, createSlots as be } from "vue";
|
|
2
|
-
import { E as ve, i as Ne } from "./el-input-
|
|
3
|
-
import { u as Ve,
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { E as ve, i as Ne } from "./el-input-d0f5c98c.js";
|
|
3
|
+
import { u as Ve, b as he, c as Ie, d as Ee, E as Q, e as ye, m as we, f as ge, p as _e } from "./use-form-common-props-1075088e.js";
|
|
4
|
+
import { a as X, d as Se, o as b, p as E, u as Ae, l as Pe, q as x, s as U, _ as Fe, v as Te, x as xe, w as Ce } from "./base-7ecff73f.js";
|
|
5
|
+
import { b as ke } from "./el-popper-92dc6e44.js";
|
|
6
6
|
import { C as ne, I as C, U as N } from "./event-09e37cc8.js";
|
|
7
|
-
const
|
|
7
|
+
const De = 100, Be = 600, Z = {
|
|
8
8
|
beforeMount(u, V) {
|
|
9
|
-
const i = V.value, { interval: a =
|
|
9
|
+
const i = V.value, { interval: a = De, delay: y = Be } = X(i) ? {} : i;
|
|
10
10
|
let c, m;
|
|
11
11
|
const l = () => X(i) ? i() : i.handler(), f = () => {
|
|
12
12
|
m && (clearTimeout(m), m = void 0), c && (clearInterval(c), c = void 0);
|
|
13
13
|
};
|
|
14
|
-
u.addEventListener("mousedown", (
|
|
15
|
-
|
|
14
|
+
u.addEventListener("mousedown", (w) => {
|
|
15
|
+
w.button === 0 && (f(), l(), document.addEventListener("mouseup", () => f(), {
|
|
16
16
|
once: !0
|
|
17
17
|
}), m = setTimeout(() => {
|
|
18
18
|
c = setInterval(() => {
|
|
@@ -84,10 +84,10 @@ const Be = 100, De = 600, Z = {
|
|
|
84
84
|
const a = u, { t: y } = Ae(), c = Pe("input-number"), m = ce(), l = de({
|
|
85
85
|
currentValue: a.modelValue,
|
|
86
86
|
userInput: null
|
|
87
|
-
}), { formItem: f } = he(),
|
|
87
|
+
}), { formItem: f } = he(), w = I(() => b(a.modelValue) && a.modelValue <= a.min), Y = I(() => b(a.modelValue) && a.modelValue >= a.max), te = I(() => {
|
|
88
88
|
const e = W(a.step);
|
|
89
89
|
return x(a.precision) ? Math.max(W(a.modelValue), e) : (e > a.precision && U("InputNumber", "precision should not be less than the decimal places of step"), a.precision);
|
|
90
|
-
}), k = I(() => a.controls && a.controlsPosition === "right"), G = Ie(), h = Ee(),
|
|
90
|
+
}), k = I(() => a.controls && a.controlsPosition === "right"), G = Ie(), h = Ee(), D = I(() => {
|
|
91
91
|
if (l.userInput !== null)
|
|
92
92
|
return l.userInput;
|
|
93
93
|
let e = l.currentValue;
|
|
@@ -99,7 +99,7 @@ const Be = 100, De = 600, Z = {
|
|
|
99
99
|
x(a.precision) || (e = e.toFixed(a.precision));
|
|
100
100
|
}
|
|
101
101
|
return e;
|
|
102
|
-
}),
|
|
102
|
+
}), B = (e, n) => {
|
|
103
103
|
if (x(n) && (n = te.value), n === 0)
|
|
104
104
|
return Math.round(e);
|
|
105
105
|
let t = String(e);
|
|
@@ -114,16 +114,16 @@ const Be = 100, De = 600, Z = {
|
|
|
114
114
|
const n = e.toString(), t = n.indexOf(".");
|
|
115
115
|
let o = 0;
|
|
116
116
|
return t !== -1 && (o = n.length - t - 1), o;
|
|
117
|
-
}, q = (e, n = 1) => b(e) ?
|
|
117
|
+
}, q = (e, n = 1) => b(e) ? B(e + a.step * n) : l.currentValue, L = () => {
|
|
118
118
|
if (a.readonly || h.value || Y.value)
|
|
119
119
|
return;
|
|
120
|
-
const e = Number(
|
|
121
|
-
|
|
120
|
+
const e = Number(D.value) || 0, n = q(e);
|
|
121
|
+
g(n), i(C, l.currentValue), $();
|
|
122
122
|
}, M = () => {
|
|
123
|
-
if (a.readonly || h.value ||
|
|
123
|
+
if (a.readonly || h.value || w.value)
|
|
124
124
|
return;
|
|
125
|
-
const e = Number(
|
|
126
|
-
|
|
125
|
+
const e = Number(D.value) || 0, n = q(e, -1);
|
|
126
|
+
g(n), i(C, l.currentValue), $();
|
|
127
127
|
}, H = (e, n) => {
|
|
128
128
|
const { max: t, min: o, step: s, precision: p, stepStrictly: _, valueOnClear: S } = a;
|
|
129
129
|
t < o && Te("InputNumber", "min should not be greater than max.");
|
|
@@ -135,8 +135,8 @@ const Be = 100, De = 600, Z = {
|
|
|
135
135
|
return null;
|
|
136
136
|
d = xe(S) ? { min: o, max: t }[S] : S;
|
|
137
137
|
}
|
|
138
|
-
return _ && (d =
|
|
139
|
-
},
|
|
138
|
+
return _ && (d = B(Math.round(d / s) * s, p), d !== e && n && i(N, d)), x(p) || (d = B(d, p)), (d > t || d < o) && (d = d > t ? t : o, n && i(N, d)), d;
|
|
139
|
+
}, g = (e, n = !0) => {
|
|
140
140
|
var t;
|
|
141
141
|
const o = l.currentValue, s = H(e);
|
|
142
142
|
if (!n) {
|
|
@@ -147,10 +147,10 @@ const Be = 100, De = 600, Z = {
|
|
|
147
147
|
}, re = (e) => {
|
|
148
148
|
l.userInput = e;
|
|
149
149
|
const n = e === "" ? null : Number(e);
|
|
150
|
-
i(C, n),
|
|
150
|
+
i(C, n), g(n, !1);
|
|
151
151
|
}, ae = (e) => {
|
|
152
152
|
const n = e !== "" ? Number(e) : "";
|
|
153
|
-
(b(n) && !Number.isNaN(n) || e === "") &&
|
|
153
|
+
(b(n) && !Number.isNaN(n) || e === "") && g(n), $(), l.userInput = null;
|
|
154
154
|
}, le = () => {
|
|
155
155
|
var e, n;
|
|
156
156
|
(n = (e = m.value) == null ? void 0 : e.focus) == null || n.call(e);
|
|
@@ -200,13 +200,13 @@ const Be = 100, De = 600, Z = {
|
|
|
200
200
|
key: 0,
|
|
201
201
|
role: "button",
|
|
202
202
|
"aria-label": r(y)("el.inputNumber.decrease"),
|
|
203
|
-
class: K([r(c).e("decrease"), r(c).is("disabled", r(
|
|
203
|
+
class: K([r(c).e("decrease"), r(c).is("disabled", r(w))]),
|
|
204
204
|
onKeydown: A(M, ["enter"])
|
|
205
205
|
}, [
|
|
206
206
|
P(e.$slots, "decrease-icon", {}, () => [
|
|
207
207
|
R(r(Q), null, {
|
|
208
208
|
default: F(() => [
|
|
209
|
-
r(k) ? (v(), T(r(ye), { key: 0 })) : (v(), T(r(
|
|
209
|
+
r(k) ? (v(), T(r(ye), { key: 0 })) : (v(), T(r(we), { key: 1 }))
|
|
210
210
|
]),
|
|
211
211
|
_: 1
|
|
212
212
|
})
|
|
@@ -224,7 +224,7 @@ const Be = 100, De = 600, Z = {
|
|
|
224
224
|
P(e.$slots, "increase-icon", {}, () => [
|
|
225
225
|
R(r(Q), null, {
|
|
226
226
|
default: F(() => [
|
|
227
|
-
r(k) ? (v(), T(r(
|
|
227
|
+
r(k) ? (v(), T(r(ge), { key: 0 })) : (v(), T(r(_e), { key: 1 }))
|
|
228
228
|
]),
|
|
229
229
|
_: 1
|
|
230
230
|
})
|
|
@@ -238,7 +238,7 @@ const Be = 100, De = 600, Z = {
|
|
|
238
238
|
ref: m,
|
|
239
239
|
type: "number",
|
|
240
240
|
step: e.step,
|
|
241
|
-
"model-value": r(
|
|
241
|
+
"model-value": r(D),
|
|
242
242
|
placeholder: e.placeholder,
|
|
243
243
|
readonly: e.readonly,
|
|
244
244
|
disabled: r(h),
|