st-comp 0.0.146 → 0.0.147
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components.d.ts +0 -3
- package/es/ChartLayout.cjs +1 -1
- package/es/ChartLayout.js +2 -2
- package/es/Dialog.cjs +1 -1
- package/es/Dialog.js +22 -26
- package/es/FactorWarning.cjs +1 -1
- package/es/FactorWarning.js +103 -112
- package/es/KlineBasic.cjs +1 -1
- package/es/KlineBasic.js +1426 -671
- package/es/KlineNew.cjs +3 -1
- package/es/KlineNew.js +2736 -314
- package/es/Pagination.cjs +1 -1
- package/es/Pagination.js +96 -102
- package/es/Table.cjs +1 -1
- package/es/Table.js +60 -66
- package/es/User.cjs +1 -1
- package/es/User.js +96 -103
- package/es/VarietySearch.cjs +1 -1
- package/es/VarietySearch.js +32 -41
- package/es/VirtualTable.cjs +1 -13
- package/es/VirtualTable.js +1 -2801
- package/es/_initCloneObject-7493ecd5.cjs +1 -0
- package/es/{_initCloneObject-14b53c6f.js → _initCloneObject-a8dcd058.js} +26 -26
- package/es/{base-ec05f348.cjs → base-00ce90ec.cjs} +3 -3
- package/es/{base-437d17f3.js → base-674a354a.js} +63 -64
- package/es/config-provider-419ffbf2.js +120 -0
- package/es/config-provider-68414290.cjs +3 -0
- package/es/dropdown-127a8c0d.cjs +1 -0
- package/es/{dropdown-634b5e27.js → dropdown-ce30ada6.js} +30 -31
- package/es/el-button-7b9f5933.js +745 -0
- package/es/el-button-c00975e1.cjs +1 -0
- package/es/{el-checkbox-group-e8fece80.js → el-checkbox-group-0554b352.js} +10 -10
- package/es/el-checkbox-group-7a313d34.cjs +1 -0
- package/es/{el-empty-bacc6613.js → el-empty-39b3aed7.js} +5 -5
- package/es/{el-empty-19ea04f4.cjs → el-empty-87154b6d.cjs} +1 -1
- package/es/el-form-item-7867f64d.cjs +12 -0
- package/es/{el-form-item-af1855f0.js → el-form-item-fc6f80ab.js} +78 -79
- package/es/el-input-2ff1628c.cjs +1 -0
- package/es/{el-input-4961b99f.js → el-input-d249ac86.js} +82 -84
- package/es/{el-input-number-610fc8ba.js → el-input-number-2066fbb7.js} +35 -36
- package/es/el-input-number-d6801a5c.cjs +1 -0
- package/es/{el-message-c3b3ac96.js → el-message-9859835d.js} +79 -81
- package/es/el-message-ffcf690c.cjs +1 -0
- package/es/el-overlay-91784be2.cjs +1 -0
- package/es/el-overlay-f0757cc4.js +525 -0
- package/es/el-popover-4db657e2.cjs +1 -0
- package/es/{el-popover-0aa071f2.js → el-popover-b7b43c1f.js} +18 -18
- package/es/el-scrollbar-35bac6b3.js +2452 -0
- package/es/el-scrollbar-ec09bbd3.cjs +1 -0
- package/es/el-select-0785c35a.cjs +1 -0
- package/es/{el-select-9381b156.js → el-select-bcbb7e55.js} +329 -333
- package/es/el-table-column-2478adf8.cjs +14 -0
- package/es/{el-table-column-55bffba5.js → el-table-column-c1e1a206.js} +346 -350
- package/es/el-tag-13ee17b3.cjs +1 -0
- package/es/el-tag-73372c6c.js +359 -0
- package/es/index-07b61d12.cjs +1 -0
- package/es/{index-39ec9741.js → index-45de4a12.js} +7 -7
- package/es/index-65b719a4.cjs +1 -0
- package/es/index-8b5fbc11.js +66 -0
- package/es/index-8c85d7c5.js +858 -0
- package/es/index-a49f4743.cjs +2 -0
- package/es/{scroll-387fcfdb.js → scroll-cb696ed2.js} +1 -1
- package/es/{scroll-41224831.cjs → scroll-cca17da0.cjs} +1 -1
- package/es/style.css +1 -1
- package/es/{zh-cn-ab9a583d.cjs → zh-cn-37af467d.cjs} +1 -1
- package/es/{zh-cn-eb9c2820.js → zh-cn-ef7d7220.js} +2 -2
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +206 -206
- package/lib/{index-9b8ff62a.js → index-24f8572c.js} +31450 -33319
- package/lib/{python-a9c3d9e5.js → python-2143eee4.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/KlineBasic/components/KlineSub/index.vue +17 -3
- package/packages/KlineBasic/index.vue +2 -1
- package/packages/KlineBasic/utils.js +20 -2
- package/packages/index.ts +0 -2
- package/src/pages/KlineBasic/api.js +1 -1
- package/src/router/routes.ts +0 -5
- package/es/Kline.cjs +0 -1
- package/es/Kline.js +0 -1901
- package/es/_initCloneObject-441db749.cjs +0 -1
- package/es/castArray-4251bbe4.js +0 -10
- package/es/castArray-a45823fe.cjs +0 -1
- package/es/config-provider-55482a43.js +0 -47
- package/es/config-provider-7cdfca4d.cjs +0 -1
- package/es/debounce-ac30be50.js +0 -83
- package/es/debounce-b2ff12bd.cjs +0 -1
- package/es/dropdown-d7c59a21.cjs +0 -1
- package/es/el-button-196807af.cjs +0 -1
- package/es/el-button-e1665717.js +0 -235
- package/es/el-checkbox-group-492b95cc.cjs +0 -1
- package/es/el-form-item-5bdffd07.cjs +0 -12
- package/es/el-input-23e2bac3.cjs +0 -1
- package/es/el-input-number-40a81eb5.cjs +0 -1
- package/es/el-menu-item-78b858f2.cjs +0 -1
- package/es/el-menu-item-7d04c11a.js +0 -771
- package/es/el-message-d4df8136.cjs +0 -1
- package/es/el-overlay-12dd9b35.js +0 -519
- package/es/el-overlay-bc0790a2.cjs +0 -1
- package/es/el-popover-8a77e015.cjs +0 -1
- package/es/el-popper-50100766.js +0 -2262
- package/es/el-popper-746070ba.cjs +0 -1
- package/es/el-scrollbar-562d0595.js +0 -201
- package/es/el-scrollbar-d1c3e7f7.cjs +0 -1
- package/es/el-select-b162dffc.cjs +0 -1
- package/es/el-table-column-6d761fce.cjs +0 -14
- package/es/el-tag-985d9aff.js +0 -279
- package/es/el-tag-c51a6490.cjs +0 -1
- package/es/index-09e01b1d.js +0 -81
- package/es/index-0cb48e01.js +0 -306
- package/es/index-3bf8d597.cjs +0 -1
- package/es/index-657047bb.js +0 -513
- package/es/index-8a0b1c53.cjs +0 -3
- package/es/index-a387515d.cjs +0 -1
- package/es/index-a902a0d9.js +0 -59
- package/es/index-deb8de52.cjs +0 -1
- package/es/index-eea0bcb3.cjs +0 -1
- package/es/index.esm-8d9a2abe.js +0 -2432
- package/es/index.esm-94a95a2a.cjs +0 -3
- package/es/raf-8fc301fd.cjs +0 -1
- package/es/raf-b128c7b7.js +0 -6
- package/es/typescript-7ae59c4c.js +0 -4
- package/es/typescript-b63f8e83.cjs +0 -1
- package/es/use-form-common-props-1b84d8f4.cjs +0 -2
- package/es/use-form-common-props-f377e500.js +0 -587
- package/es/vnode-7dfd4ed5.js +0 -14
- package/es/vnode-7fbc61e1.cjs +0 -1
- package/packages/Kline/components/Contextmenu/index.vue +0 -110
- package/packages/Kline/components/Tips/index.vue +0 -40
- package/packages/Kline/componentsNew/KlineSlide/index.vue +0 -155
- package/packages/Kline/componentsNew/KlineSub/index.vue +0 -297
- package/packages/Kline/componentsNew/KlineTips/index.vue +0 -66
- package/packages/Kline/componentsNew/KlineUtils/index.vue +0 -84
- package/packages/Kline/componentsNew/Tips/index.vue +0 -33
- package/packages/Kline/formatKlineData.ts +0 -109
- package/packages/Kline/images/buy.svg +0 -1
- package/packages/Kline/images/pen.png +0 -0
- package/packages/Kline/images/sell.svg +0 -1
- package/packages/Kline/images/t.svg +0 -1
- package/packages/Kline/index.ts +0 -16
- package/packages/Kline/index.vue +0 -891
- package/packages/Kline/option.ts +0 -539
- package/packages/Kline/type.d.ts +0 -219
- package/packages/Kline/utils.ts +0 -682
- package/src/pages/Kline/api.ts +0 -127
- package/src/pages/Kline/components/MultiCycleSingleVariety.vue +0 -701
- package/src/pages/Kline/components/SingleCycleSingleVariety.vue +0 -924
- package/src/pages/Kline/index.vue +0 -90
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
import { computed as p, getCurrentInstance as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import { U as oe } from "./index-0cb48e01.js";
|
|
8
|
-
import { a as ft, u as vt } from "./index-a902a0d9.js";
|
|
9
|
-
const mt = () => Pe && /firefox/i.test(window.navigator.userAgent);
|
|
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 N, 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 { c as _e, d as qe } from "./el-scrollbar-35bac6b3.js";
|
|
3
|
+
import { d as Ge, i as we, U as oe, e as Je, r as Qe, u as et, f as tt, V as ot, v as nt, s as at, E as B, t as st } from "./index-8c85d7c5.js";
|
|
4
|
+
import { i as Pe, k as Se, b as lt, d as ee, n as te, m as U, s as rt, u as Ce, l as it, N as ut, _ as dt, v as Ie, w as ct } from "./base-674a354a.js";
|
|
5
|
+
import { u as pt, a as ft } from "./index-8b5fbc11.js";
|
|
6
|
+
const vt = () => Pe && /firefox/i.test(window.navigator.userAgent);
|
|
10
7
|
let g;
|
|
11
|
-
const
|
|
8
|
+
const mt = {
|
|
12
9
|
height: "0",
|
|
13
10
|
visibility: "hidden",
|
|
14
|
-
overflow:
|
|
11
|
+
overflow: vt() ? "" : "hidden",
|
|
15
12
|
position: "absolute",
|
|
16
13
|
"z-index": "-1000",
|
|
17
14
|
top: "0",
|
|
18
15
|
right: "0"
|
|
19
|
-
},
|
|
16
|
+
}, ht = [
|
|
20
17
|
"letter-spacing",
|
|
21
18
|
"line-height",
|
|
22
19
|
"padding-top",
|
|
@@ -33,9 +30,9 @@ const ht = {
|
|
|
33
30
|
"border-width",
|
|
34
31
|
"box-sizing"
|
|
35
32
|
];
|
|
36
|
-
function
|
|
33
|
+
function yt(n) {
|
|
37
34
|
const v = window.getComputedStyle(n), i = v.getPropertyValue("box-sizing"), o = Number.parseFloat(v.getPropertyValue("padding-bottom")) + Number.parseFloat(v.getPropertyValue("padding-top")), r = Number.parseFloat(v.getPropertyValue("border-bottom-width")) + Number.parseFloat(v.getPropertyValue("border-top-width"));
|
|
38
|
-
return { contextStyle:
|
|
35
|
+
return { contextStyle: ht.map((l) => [
|
|
39
36
|
l,
|
|
40
37
|
v.getPropertyValue(l)
|
|
41
38
|
]), paddingSize: o, borderSize: r, boxSizing: i };
|
|
@@ -43,8 +40,8 @@ function gt(n) {
|
|
|
43
40
|
function Ee(n, v = 1, i) {
|
|
44
41
|
var o;
|
|
45
42
|
g || (g = document.createElement("textarea"), document.body.appendChild(g));
|
|
46
|
-
const { paddingSize: r, borderSize: u, boxSizing: l, contextStyle: x } =
|
|
47
|
-
x.forEach(([y,
|
|
43
|
+
const { paddingSize: r, borderSize: u, boxSizing: l, contextStyle: x } = yt(n);
|
|
44
|
+
x.forEach(([y, F]) => g == null ? void 0 : g.style.setProperty(y, F)), Object.entries(mt).forEach(([y, F]) => g == null ? void 0 : g.style.setProperty(y, F, "important")), g.value = n.value || n.placeholder || "";
|
|
48
45
|
let d = g.scrollHeight;
|
|
49
46
|
const C = {};
|
|
50
47
|
l === "border-box" ? d = d + u : l === "content-box" && (d = d - r), g.value = "";
|
|
@@ -59,12 +56,12 @@ function Ee(n, v = 1, i) {
|
|
|
59
56
|
}
|
|
60
57
|
return C.height = `${d}px`, (o = g.parentNode) == null || o.removeChild(g), g = void 0, C;
|
|
61
58
|
}
|
|
62
|
-
const bt =
|
|
59
|
+
const gt = (n) => n, bt = lt({
|
|
63
60
|
id: {
|
|
64
61
|
type: String,
|
|
65
62
|
default: void 0
|
|
66
63
|
},
|
|
67
|
-
size:
|
|
64
|
+
size: Ge,
|
|
68
65
|
disabled: Boolean,
|
|
69
66
|
modelValue: {
|
|
70
67
|
type: ee([
|
|
@@ -132,14 +129,14 @@ const bt = st({
|
|
|
132
129
|
},
|
|
133
130
|
inputStyle: {
|
|
134
131
|
type: ee([Object, Array, String]),
|
|
135
|
-
default: () =>
|
|
132
|
+
default: () => gt({})
|
|
136
133
|
},
|
|
137
134
|
autofocus: Boolean,
|
|
138
135
|
rows: {
|
|
139
136
|
type: Number,
|
|
140
137
|
default: 2
|
|
141
138
|
},
|
|
142
|
-
...
|
|
139
|
+
..._e(["ariaLabel"])
|
|
143
140
|
}), xt = {
|
|
144
141
|
[oe]: (n) => te(n),
|
|
145
142
|
input: (n) => te(n),
|
|
@@ -154,10 +151,10 @@ const bt = st({
|
|
|
154
151
|
compositionupdate: (n) => n instanceof CompositionEvent,
|
|
155
152
|
compositionend: (n) => n instanceof CompositionEvent
|
|
156
153
|
}, 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 =
|
|
154
|
+
const { excludeListeners: v = !1, excludeKeys: i } = n, o = p(() => ((i == null ? void 0 : i.value) || []).concat(wt)), r = Ke();
|
|
158
155
|
return r ? p(() => {
|
|
159
156
|
var u;
|
|
160
|
-
return
|
|
157
|
+
return rt(Object.entries((u = r.proxy) == null ? void 0 : u.$attrs).filter(([l]) => !o.value.includes(l) && !(v && St.test(l))));
|
|
161
158
|
}) : (U("use-attrs", "getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"), p(() => ({})));
|
|
162
159
|
};
|
|
163
160
|
function It(n) {
|
|
@@ -204,11 +201,11 @@ const Et = ze({
|
|
|
204
201
|
props: bt,
|
|
205
202
|
emits: xt,
|
|
206
203
|
setup(n, { expose: v, emit: i }) {
|
|
207
|
-
const o = n, r =
|
|
204
|
+
const o = n, r = je(), u = Ct(), l = We(), x = p(() => [
|
|
208
205
|
o.type === "textarea" ? ne.b() : a.b(),
|
|
209
|
-
a.m(
|
|
206
|
+
a.m(F.value),
|
|
210
207
|
a.is("disabled", E.value),
|
|
211
|
-
a.is("exceed",
|
|
208
|
+
a.is("exceed", Re.value),
|
|
212
209
|
{
|
|
213
210
|
[a.b("group")]: l.prepend || l.append,
|
|
214
211
|
[a.m("prefix")]: l.prefix || o.prefixIcon,
|
|
@@ -219,10 +216,10 @@ const Et = ze({
|
|
|
219
216
|
r.class
|
|
220
217
|
]), d = p(() => [
|
|
221
218
|
a.e("wrapper"),
|
|
222
|
-
a.is("focus",
|
|
223
|
-
]), { form: C, formItem: h } =
|
|
219
|
+
a.is("focus", A.value)
|
|
220
|
+
]), { form: C, formItem: h } = Je(), { inputId: y } = Qe(o, {
|
|
224
221
|
formItemContext: h
|
|
225
|
-
}),
|
|
222
|
+
}), F = et(), E = tt(), a = Ce("input"), ne = Ce("textarea"), O = q(), w = q(), Y = G(!1), $ = G(!1), ae = G(), H = q(o.inputStyle), z = p(() => O.value || w.value), { wrapperRef: ke, isFocused: A, handleFocus: Ne, handleBlur: Fe } = pt(z, {
|
|
226
223
|
beforeFocus() {
|
|
227
224
|
return E.value;
|
|
228
225
|
},
|
|
@@ -233,15 +230,15 @@ const Et = ze({
|
|
|
233
230
|
}), se = p(() => {
|
|
234
231
|
var e;
|
|
235
232
|
return (e = C == null ? void 0 : C.statusIcon) != null ? e : !1;
|
|
236
|
-
}), V = p(() => (h == null ? void 0 : h.validateState) || ""), le = p(() => V.value &&
|
|
233
|
+
}), V = p(() => (h == null ? void 0 : h.validateState) || ""), le = p(() => V.value && ot[V.value]), Ve = p(() => $.value ? nt : at), Te = p(() => [
|
|
237
234
|
r.style
|
|
238
235
|
]), re = p(() => [
|
|
239
236
|
o.inputStyle,
|
|
240
|
-
|
|
237
|
+
H.value,
|
|
241
238
|
{ resize: o.resize }
|
|
242
|
-
]), I = p(() =>
|
|
243
|
-
|
|
244
|
-
if (
|
|
239
|
+
]), I = p(() => it(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(O);
|
|
240
|
+
qe(w, (e) => {
|
|
241
|
+
if (Me(), !P.value || o.resize !== "both")
|
|
245
242
|
return;
|
|
246
243
|
const s = e[0], { width: k } = s.contentRect;
|
|
247
244
|
ae.value = {
|
|
@@ -253,17 +250,17 @@ const Et = ze({
|
|
|
253
250
|
if (!(!Pe || e !== "textarea" || !w.value))
|
|
254
251
|
if (s) {
|
|
255
252
|
const k = Ie(s) ? s.minRows : void 0, ye = Ie(s) ? s.maxRows : void 0, ge = Ee(w.value, k, ye);
|
|
256
|
-
|
|
253
|
+
H.value = {
|
|
257
254
|
overflowY: "hidden",
|
|
258
255
|
...ge
|
|
259
|
-
},
|
|
260
|
-
w.value.offsetHeight,
|
|
256
|
+
}, L(() => {
|
|
257
|
+
w.value.offsetHeight, H.value = ge;
|
|
261
258
|
});
|
|
262
259
|
} else
|
|
263
|
-
|
|
260
|
+
H.value = {
|
|
264
261
|
minHeight: Ee(w.value).minHeight
|
|
265
262
|
};
|
|
266
|
-
},
|
|
263
|
+
}, Me = ((e) => {
|
|
267
264
|
let s = !1;
|
|
268
265
|
return () => {
|
|
269
266
|
var k;
|
|
@@ -271,18 +268,18 @@ const Et = ze({
|
|
|
271
268
|
return;
|
|
272
269
|
((k = w.value) == null ? void 0 : k.offsetParent) === null || (e(), s = !0);
|
|
273
270
|
};
|
|
274
|
-
})(T),
|
|
271
|
+
})(T), R = () => {
|
|
275
272
|
const e = z.value, s = o.formatter ? o.formatter(I.value) : I.value;
|
|
276
273
|
!e || e.value === s || (e.value = s);
|
|
277
|
-
},
|
|
274
|
+
}, _ = async (e) => {
|
|
278
275
|
ie();
|
|
279
276
|
let { value: s } = e.target;
|
|
280
277
|
if (o.formatter && (s = o.parser ? o.parser(s) : s), !ce.value) {
|
|
281
278
|
if (s === I.value) {
|
|
282
|
-
|
|
279
|
+
R();
|
|
283
280
|
return;
|
|
284
281
|
}
|
|
285
|
-
i(oe, s), i("input", s), await
|
|
282
|
+
i(oe, s), i("input", s), await L(), R(), ue();
|
|
286
283
|
}
|
|
287
284
|
}, de = (e) => {
|
|
288
285
|
i("change", e.target.value);
|
|
@@ -291,7 +288,7 @@ const Et = ze({
|
|
|
291
288
|
handleCompositionStart: pe,
|
|
292
289
|
handleCompositionUpdate: fe,
|
|
293
290
|
handleCompositionEnd: ve
|
|
294
|
-
} =
|
|
291
|
+
} = ft({ emit: i, afterComposition: _ }), Be = () => {
|
|
295
292
|
ie(), $.value = !$.value, setTimeout(ue);
|
|
296
293
|
}, Oe = () => {
|
|
297
294
|
var e;
|
|
@@ -299,9 +296,9 @@ const Et = ze({
|
|
|
299
296
|
}, $e = () => {
|
|
300
297
|
var e;
|
|
301
298
|
return (e = z.value) == null ? void 0 : e.blur();
|
|
302
|
-
}, Ae = (e) => {
|
|
303
|
-
Y.value = !1, i("mouseleave", e);
|
|
304
299
|
}, He = (e) => {
|
|
300
|
+
Y.value = !1, i("mouseleave", e);
|
|
301
|
+
}, Ae = (e) => {
|
|
305
302
|
Y.value = !0, i("mouseenter", e);
|
|
306
303
|
}, me = (e) => {
|
|
307
304
|
i("keydown", e);
|
|
@@ -313,11 +310,11 @@ const Et = ze({
|
|
|
313
310
|
};
|
|
314
311
|
return J(() => o.modelValue, () => {
|
|
315
312
|
var e;
|
|
316
|
-
|
|
317
|
-
}), J(I, () =>
|
|
318
|
-
await
|
|
313
|
+
L(() => T()), o.validateEvent && ((e = h == null ? void 0 : h.validate) == null || e.call(h, "change").catch((s) => U(s)));
|
|
314
|
+
}), J(I, () => R()), J(() => o.type, async () => {
|
|
315
|
+
await L(), R(), T();
|
|
319
316
|
}), Ue(() => {
|
|
320
|
-
!o.formatter && o.parser && U("ElInput", "If you set the parser, you also need to set the formatter."),
|
|
317
|
+
!o.formatter && o.parser && U("ElInput", "If you set the parser, you also need to set the formatter."), R(), L(T);
|
|
321
318
|
}), v({
|
|
322
319
|
input: O,
|
|
323
320
|
textarea: w,
|
|
@@ -339,8 +336,8 @@ const Et = ze({
|
|
|
339
336
|
}
|
|
340
337
|
]),
|
|
341
338
|
style: be(t(Te)),
|
|
342
|
-
onMouseenter:
|
|
343
|
-
onMouseleave:
|
|
339
|
+
onMouseenter: Ae,
|
|
340
|
+
onMouseleave: He
|
|
344
341
|
}, [
|
|
345
342
|
f(" input "),
|
|
346
343
|
e.type !== "textarea" ? (c(), b(Q, { key: 0 }, [
|
|
@@ -349,9 +346,9 @@ const Et = ze({
|
|
|
349
346
|
key: 0,
|
|
350
347
|
class: m(t(a).be("group", "prepend"))
|
|
351
348
|
}, [
|
|
352
|
-
|
|
349
|
+
K(e.$slots, "prepend")
|
|
353
350
|
], 2)) : f("v-if", !0),
|
|
354
|
-
|
|
351
|
+
N("div", {
|
|
355
352
|
ref_key: "wrapperRef",
|
|
356
353
|
ref: ke,
|
|
357
354
|
class: m(t(d))
|
|
@@ -361,22 +358,22 @@ const Et = ze({
|
|
|
361
358
|
key: 0,
|
|
362
359
|
class: m(t(a).e("prefix"))
|
|
363
360
|
}, [
|
|
364
|
-
|
|
361
|
+
N("span", {
|
|
365
362
|
class: m(t(a).e("prefix-inner"))
|
|
366
363
|
}, [
|
|
367
|
-
|
|
364
|
+
K(e.$slots, "prefix"),
|
|
368
365
|
e.prefixIcon ? (c(), S(t(B), {
|
|
369
366
|
key: 0,
|
|
370
367
|
class: m(t(a).e("icon"))
|
|
371
368
|
}, {
|
|
372
|
-
default:
|
|
373
|
-
(c(), S(
|
|
369
|
+
default: M(() => [
|
|
370
|
+
(c(), S(j(e.prefixIcon)))
|
|
374
371
|
]),
|
|
375
372
|
_: 1
|
|
376
373
|
}, 8, ["class"])) : f("v-if", !0)
|
|
377
374
|
], 2)
|
|
378
375
|
], 2)) : f("v-if", !0),
|
|
379
|
-
|
|
376
|
+
N("input", xe({
|
|
380
377
|
id: t(y),
|
|
381
378
|
ref_key: "input",
|
|
382
379
|
ref: O,
|
|
@@ -398,26 +395,26 @@ const Et = ze({
|
|
|
398
395
|
onCompositionstart: t(pe),
|
|
399
396
|
onCompositionupdate: t(fe),
|
|
400
397
|
onCompositionend: t(ve),
|
|
401
|
-
onInput:
|
|
398
|
+
onInput: _,
|
|
402
399
|
onChange: de,
|
|
403
400
|
onKeydown: me
|
|
404
401
|
}), null, 16, ["id", "minlength", "maxlength", "type", "disabled", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form", "autofocus", "role", "onCompositionstart", "onCompositionupdate", "onCompositionend"]),
|
|
405
402
|
f(" suffix slot "),
|
|
406
|
-
t(
|
|
403
|
+
t(Le) ? (c(), b("span", {
|
|
407
404
|
key: 1,
|
|
408
405
|
class: m(t(a).e("suffix"))
|
|
409
406
|
}, [
|
|
410
|
-
|
|
407
|
+
N("span", {
|
|
411
408
|
class: m(t(a).e("suffix-inner"))
|
|
412
409
|
}, [
|
|
413
410
|
!t(D) || !t(X) || !t(P) ? (c(), b(Q, { key: 0 }, [
|
|
414
|
-
|
|
411
|
+
K(e.$slots, "suffix"),
|
|
415
412
|
e.suffixIcon ? (c(), S(t(B), {
|
|
416
413
|
key: 0,
|
|
417
414
|
class: m(t(a).e("icon"))
|
|
418
415
|
}, {
|
|
419
|
-
default:
|
|
420
|
-
(c(), S(
|
|
416
|
+
default: M(() => [
|
|
417
|
+
(c(), S(j(e.suffixIcon)))
|
|
421
418
|
]),
|
|
422
419
|
_: 1
|
|
423
420
|
}, 8, ["class"])) : f("v-if", !0)
|
|
@@ -425,11 +422,11 @@ const Et = ze({
|
|
|
425
422
|
t(D) ? (c(), S(t(B), {
|
|
426
423
|
key: 1,
|
|
427
424
|
class: m([t(a).e("icon"), t(a).e("clear")]),
|
|
428
|
-
onMousedown: Xe(t(
|
|
425
|
+
onMousedown: Xe(t(ut), ["prevent"]),
|
|
429
426
|
onClick: he
|
|
430
427
|
}, {
|
|
431
|
-
default:
|
|
432
|
-
|
|
428
|
+
default: M(() => [
|
|
429
|
+
Ze(t(st))
|
|
433
430
|
]),
|
|
434
431
|
_: 1
|
|
435
432
|
}, 8, ["class", "onMousedown"])) : f("v-if", !0),
|
|
@@ -438,8 +435,8 @@ const Et = ze({
|
|
|
438
435
|
class: m([t(a).e("icon"), t(a).e("password")]),
|
|
439
436
|
onClick: Be
|
|
440
437
|
}, {
|
|
441
|
-
default:
|
|
442
|
-
(c(), S(
|
|
438
|
+
default: M(() => [
|
|
439
|
+
(c(), S(j(t(Ve))))
|
|
443
440
|
]),
|
|
444
441
|
_: 1
|
|
445
442
|
}, 8, ["class"])) : f("v-if", !0),
|
|
@@ -447,9 +444,9 @@ const Et = ze({
|
|
|
447
444
|
key: 3,
|
|
448
445
|
class: m(t(a).e("count"))
|
|
449
446
|
}, [
|
|
450
|
-
|
|
447
|
+
N("span", {
|
|
451
448
|
class: m(t(a).e("count-inner"))
|
|
452
|
-
}, W(t(
|
|
449
|
+
}, W(t(Z)) + " / " + W(e.maxlength), 3)
|
|
453
450
|
], 2)) : f("v-if", !0),
|
|
454
451
|
t(V) && t(le) && t(se) ? (c(), S(t(B), {
|
|
455
452
|
key: 4,
|
|
@@ -459,8 +456,8 @@ const Et = ze({
|
|
|
459
456
|
t(a).is("loading", t(V) === "validating")
|
|
460
457
|
])
|
|
461
458
|
}, {
|
|
462
|
-
default:
|
|
463
|
-
(c(), S(
|
|
459
|
+
default: M(() => [
|
|
460
|
+
(c(), S(j(t(le))))
|
|
464
461
|
]),
|
|
465
462
|
_: 1
|
|
466
463
|
}, 8, ["class"])) : f("v-if", !0)
|
|
@@ -472,15 +469,15 @@ const Et = ze({
|
|
|
472
469
|
key: 1,
|
|
473
470
|
class: m(t(a).be("group", "append"))
|
|
474
471
|
}, [
|
|
475
|
-
|
|
472
|
+
K(e.$slots, "append")
|
|
476
473
|
], 2)) : f("v-if", !0)
|
|
477
474
|
], 64)) : (c(), b(Q, { key: 1 }, [
|
|
478
475
|
f(" textarea "),
|
|
479
|
-
|
|
476
|
+
N("textarea", xe({
|
|
480
477
|
id: t(y),
|
|
481
478
|
ref_key: "textarea",
|
|
482
479
|
ref: w,
|
|
483
|
-
class: [t(ne).e("inner"), t(a).is("focus", t(
|
|
480
|
+
class: [t(ne).e("inner"), t(a).is("focus", t(A))]
|
|
484
481
|
}, t(u), {
|
|
485
482
|
minlength: e.minlength,
|
|
486
483
|
maxlength: e.maxlength,
|
|
@@ -498,9 +495,9 @@ const Et = ze({
|
|
|
498
495
|
onCompositionstart: t(pe),
|
|
499
496
|
onCompositionupdate: t(fe),
|
|
500
497
|
onCompositionend: t(ve),
|
|
501
|
-
onInput:
|
|
502
|
-
onFocus: t(
|
|
503
|
-
onBlur: t(
|
|
498
|
+
onInput: _,
|
|
499
|
+
onFocus: t(Ne),
|
|
500
|
+
onBlur: t(Fe),
|
|
504
501
|
onChange: de,
|
|
505
502
|
onKeydown: me
|
|
506
503
|
}), null, 16, ["id", "minlength", "maxlength", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form", "autofocus", "rows", "role", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onFocus", "onBlur"]),
|
|
@@ -508,14 +505,15 @@ const Et = ze({
|
|
|
508
505
|
key: 0,
|
|
509
506
|
style: be(ae.value),
|
|
510
507
|
class: m(t(a).e("count"))
|
|
511
|
-
}, W(t(
|
|
508
|
+
}, W(t(Z)) + " / " + W(e.maxlength), 7)) : f("v-if", !0)
|
|
512
509
|
], 64))
|
|
513
510
|
], 38));
|
|
514
511
|
}
|
|
515
512
|
});
|
|
516
|
-
var Pt = /* @__PURE__ */
|
|
517
|
-
const
|
|
513
|
+
var Pt = /* @__PURE__ */ dt(zt, [["__file", "input.vue"]]);
|
|
514
|
+
const Lt = ct(Pt);
|
|
518
515
|
export {
|
|
519
|
-
|
|
520
|
-
|
|
516
|
+
Lt as E,
|
|
517
|
+
vt as i,
|
|
518
|
+
gt as m
|
|
521
519
|
};
|
|
@@ -1,12 +1,11 @@
|
|
|
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
|
|
2
|
-
import { E as ve, i as Ne } from "./el-input-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { C as ne, I as C, U as N } from "./index-0cb48e01.js";
|
|
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 q, 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-d249ac86.js";
|
|
3
|
+
import { d as Ve, C as ne, I as k, U as N, e as he, u as Ie, f as Ee, E as Q, g as ye, m as ge, h as we, p as _e } from "./index-8c85d7c5.js";
|
|
4
|
+
import { e as X, b as Se, k as b, l as E, g as Ae, u as Pe, j as C, m as U, _ as Fe, t as Te, n as Ce, w as ke } from "./base-674a354a.js";
|
|
5
|
+
import { c as xe } from "./el-scrollbar-35bac6b3.js";
|
|
7
6
|
const De = 100, Be = 600, Z = {
|
|
8
7
|
beforeMount(u, V) {
|
|
9
|
-
const i = V.value, { interval: a = De, delay:
|
|
8
|
+
const i = V.value, { interval: a = De, delay: y = Be } = X(i) ? {} : i;
|
|
10
9
|
let c, m;
|
|
11
10
|
const l = () => X(i) ? i() : i.handler(), f = () => {
|
|
12
11
|
m && (clearTimeout(m), m = void 0), c && (clearInterval(c), c = void 0);
|
|
@@ -18,7 +17,7 @@ const De = 100, Be = 600, Z = {
|
|
|
18
17
|
c = setInterval(() => {
|
|
19
18
|
l();
|
|
20
19
|
}, a);
|
|
21
|
-
},
|
|
20
|
+
}, y));
|
|
22
21
|
});
|
|
23
22
|
}
|
|
24
23
|
}, Le = Se({
|
|
@@ -67,13 +66,13 @@ const De = 100, Be = 600, Z = {
|
|
|
67
66
|
type: Boolean,
|
|
68
67
|
default: !0
|
|
69
68
|
},
|
|
70
|
-
...
|
|
69
|
+
...xe(["ariaLabel"])
|
|
71
70
|
}), Me = {
|
|
72
71
|
[ne]: (u, V) => V !== u,
|
|
73
72
|
blur: (u) => u instanceof FocusEvent,
|
|
74
73
|
focus: (u) => u instanceof FocusEvent,
|
|
75
|
-
[
|
|
76
|
-
[N]: (u) => b(u) ||
|
|
74
|
+
[k]: (u) => b(u) || E(u),
|
|
75
|
+
[N]: (u) => b(u) || E(u)
|
|
77
76
|
}, $e = ee({
|
|
78
77
|
name: "ElInputNumber"
|
|
79
78
|
}), ze = /* @__PURE__ */ ee({
|
|
@@ -81,26 +80,26 @@ const De = 100, Be = 600, Z = {
|
|
|
81
80
|
props: Le,
|
|
82
81
|
emits: Me,
|
|
83
82
|
setup(u, { expose: V, emit: i }) {
|
|
84
|
-
const a = u, { t:
|
|
83
|
+
const a = u, { t: y } = Ae(), c = Pe("input-number"), m = ce(), l = de({
|
|
85
84
|
currentValue: a.modelValue,
|
|
86
85
|
userInput: null
|
|
87
86
|
}), { formItem: f } = he(), g = I(() => b(a.modelValue) && a.modelValue <= a.min), Y = I(() => b(a.modelValue) && a.modelValue >= a.max), te = I(() => {
|
|
88
87
|
const e = W(a.step);
|
|
89
|
-
return
|
|
90
|
-
}),
|
|
88
|
+
return C(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);
|
|
89
|
+
}), x = I(() => a.controls && a.controlsPosition === "right"), G = Ie(), h = Ee(), D = I(() => {
|
|
91
90
|
if (l.userInput !== null)
|
|
92
91
|
return l.userInput;
|
|
93
92
|
let e = l.currentValue;
|
|
94
|
-
if (
|
|
93
|
+
if (E(e))
|
|
95
94
|
return "";
|
|
96
95
|
if (b(e)) {
|
|
97
96
|
if (Number.isNaN(e))
|
|
98
97
|
return "";
|
|
99
|
-
|
|
98
|
+
C(a.precision) || (e = e.toFixed(a.precision));
|
|
100
99
|
}
|
|
101
100
|
return e;
|
|
102
101
|
}), B = (e, n) => {
|
|
103
|
-
if (
|
|
102
|
+
if (C(n) && (n = te.value), n === 0)
|
|
104
103
|
return Math.round(e);
|
|
105
104
|
let t = String(e);
|
|
106
105
|
const o = t.indexOf(".");
|
|
@@ -109,33 +108,33 @@ const De = 100, Be = 600, Z = {
|
|
|
109
108
|
const _ = t.length;
|
|
110
109
|
return t.charAt(_ - 1) === "5" && (t = `${t.slice(0, Math.max(0, _ - 1))}6`), Number.parseFloat(Number(t).toFixed(n));
|
|
111
110
|
}, W = (e) => {
|
|
112
|
-
if (
|
|
111
|
+
if (E(e))
|
|
113
112
|
return 0;
|
|
114
113
|
const n = e.toString(), t = n.indexOf(".");
|
|
115
114
|
let o = 0;
|
|
116
115
|
return t !== -1 && (o = n.length - t - 1), o;
|
|
117
|
-
},
|
|
116
|
+
}, j = (e, n = 1) => b(e) ? B(e + a.step * n) : l.currentValue, L = () => {
|
|
118
117
|
if (a.readonly || h.value || Y.value)
|
|
119
118
|
return;
|
|
120
|
-
const e = Number(D.value) || 0, n =
|
|
121
|
-
w(n), i(
|
|
119
|
+
const e = Number(D.value) || 0, n = j(e);
|
|
120
|
+
w(n), i(k, l.currentValue), $();
|
|
122
121
|
}, M = () => {
|
|
123
122
|
if (a.readonly || h.value || g.value)
|
|
124
123
|
return;
|
|
125
|
-
const e = Number(D.value) || 0, n =
|
|
126
|
-
w(n), i(
|
|
124
|
+
const e = Number(D.value) || 0, n = j(e, -1);
|
|
125
|
+
w(n), i(k, l.currentValue), $();
|
|
127
126
|
}, H = (e, n) => {
|
|
128
127
|
const { max: t, min: o, step: s, precision: p, stepStrictly: _, valueOnClear: S } = a;
|
|
129
128
|
t < o && Te("InputNumber", "min should not be greater than max.");
|
|
130
129
|
let d = Number(e);
|
|
131
|
-
if (
|
|
130
|
+
if (E(e) || Number.isNaN(d))
|
|
132
131
|
return null;
|
|
133
132
|
if (e === "") {
|
|
134
133
|
if (S === null)
|
|
135
134
|
return null;
|
|
136
|
-
d =
|
|
135
|
+
d = Ce(S) ? { min: o, max: t }[S] : S;
|
|
137
136
|
}
|
|
138
|
-
return _ && (d = B(Math.round(d / s) * s, p), d !== e && n && i(N, d)),
|
|
137
|
+
return _ && (d = B(Math.round(d / s) * s, p), d !== e && n && i(N, d)), C(p) || (d = B(d, p)), (d > t || d < o) && (d = d > t ? t : o, n && i(N, d)), d;
|
|
139
138
|
}, w = (e, n = !0) => {
|
|
140
139
|
var t;
|
|
141
140
|
const o = l.currentValue, s = H(e);
|
|
@@ -147,7 +146,7 @@ const De = 100, Be = 600, Z = {
|
|
|
147
146
|
}, re = (e) => {
|
|
148
147
|
l.userInput = e;
|
|
149
148
|
const n = e === "" ? null : Number(e);
|
|
150
|
-
i(
|
|
149
|
+
i(k, n), w(n, !1);
|
|
151
150
|
}, ae = (e) => {
|
|
152
151
|
const n = e !== "" ? Number(e) : "";
|
|
153
152
|
(b(n) && !Number.isNaN(n) || e === "") && w(n), $(), l.userInput = null;
|
|
@@ -191,22 +190,22 @@ const De = 100, Be = 600, Z = {
|
|
|
191
190
|
r(c).m(r(G)),
|
|
192
191
|
r(c).is("disabled", r(h)),
|
|
193
192
|
r(c).is("without-controls", !e.controls),
|
|
194
|
-
r(c).is("controls-right", r(
|
|
193
|
+
r(c).is("controls-right", r(x))
|
|
195
194
|
]),
|
|
196
195
|
onDragstart: O(() => {
|
|
197
196
|
}, ["prevent"])
|
|
198
197
|
}, [
|
|
199
|
-
e.controls ?
|
|
198
|
+
e.controls ? q((v(), z("span", {
|
|
200
199
|
key: 0,
|
|
201
200
|
role: "button",
|
|
202
|
-
"aria-label": r(
|
|
201
|
+
"aria-label": r(y)("el.inputNumber.decrease"),
|
|
203
202
|
class: K([r(c).e("decrease"), r(c).is("disabled", r(g))]),
|
|
204
203
|
onKeydown: A(M, ["enter"])
|
|
205
204
|
}, [
|
|
206
205
|
P(e.$slots, "decrease-icon", {}, () => [
|
|
207
206
|
R(r(Q), null, {
|
|
208
207
|
default: F(() => [
|
|
209
|
-
r(
|
|
208
|
+
r(x) ? (v(), T(r(ye), { key: 0 })) : (v(), T(r(ge), { key: 1 }))
|
|
210
209
|
]),
|
|
211
210
|
_: 1
|
|
212
211
|
})
|
|
@@ -214,17 +213,17 @@ const De = 100, Be = 600, Z = {
|
|
|
214
213
|
], 42, ["aria-label", "onKeydown"])), [
|
|
215
214
|
[r(Z), M]
|
|
216
215
|
]) : J("v-if", !0),
|
|
217
|
-
e.controls ?
|
|
216
|
+
e.controls ? q((v(), z("span", {
|
|
218
217
|
key: 1,
|
|
219
218
|
role: "button",
|
|
220
|
-
"aria-label": r(
|
|
219
|
+
"aria-label": r(y)("el.inputNumber.increase"),
|
|
221
220
|
class: K([r(c).e("increase"), r(c).is("disabled", r(Y))]),
|
|
222
221
|
onKeydown: A(L, ["enter"])
|
|
223
222
|
}, [
|
|
224
223
|
P(e.$slots, "increase-icon", {}, () => [
|
|
225
224
|
R(r(Q), null, {
|
|
226
225
|
default: F(() => [
|
|
227
|
-
r(
|
|
226
|
+
r(x) ? (v(), T(r(we), { key: 0 })) : (v(), T(r(_e), { key: 1 }))
|
|
228
227
|
]),
|
|
229
228
|
_: 1
|
|
230
229
|
})
|
|
@@ -276,7 +275,7 @@ const De = 100, Be = 600, Z = {
|
|
|
276
275
|
}
|
|
277
276
|
});
|
|
278
277
|
var Ke = /* @__PURE__ */ Fe(ze, [["__file", "input-number.vue"]]);
|
|
279
|
-
const
|
|
278
|
+
const We = ke(Ke);
|
|
280
279
|
export {
|
|
281
|
-
|
|
280
|
+
We as E
|
|
282
281
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),M=require("./el-input-2ff1628c.cjs"),a=require("./index-a49f4743.cjs"),u=require("./base-00ce90ec.cjs"),W=require("./el-scrollbar-ec09bbd3.cjs"),G=100,Y=600,x={beforeMount(o,v){const d=v.value,{interval:l=G,delay:V=Y}=u.isFunction(d)?{}:d;let f,p;const i=()=>u.isFunction(d)?d():d.handler(),N=()=>{p&&(clearTimeout(p),p=void 0),f&&(clearInterval(f),f=void 0)};o.addEventListener("mousedown",h=>{h.button===0&&(N(),i(),document.addEventListener("mouseup",()=>N(),{once:!0}),p=setTimeout(()=>{f=setInterval(()=>{i()},l)},V))})}},H=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:a.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},...W.useAriaProps(["ariaLabel"])}),j={[a.CHANGE_EVENT]:(o,v)=>v!==o,blur:o=>o instanceof FocusEvent,focus:o=>o instanceof FocusEvent,[a.INPUT_EVENT]:o=>u.isNumber(o)||u.isNil(o),[a.UPDATE_MODEL_EVENT]:o=>u.isNumber(o)||u.isNil(o)},J=e.defineComponent({name:"ElInputNumber"}),Q=e.defineComponent({...J,props:H,emits:j,setup(o,{expose:v,emit:d}){const l=o,{t:V}=u.useLocale(),f=u.useNamespace("input-number"),p=e.ref(),i=e.reactive({currentValue:l.modelValue,userInput:null}),{formItem:N}=a.useFormItem(),h=e.computed(()=>u.isNumber(l.modelValue)&&l.modelValue<=l.min),k=e.computed(()=>u.isNumber(l.modelValue)&&l.modelValue>=l.max),U=e.computed(()=>{const n=B(l.step);return u.isUndefined(l.precision)?Math.max(B(l.modelValue),n):(n>l.precision&&u.debugWarn("InputNumber","precision should not be less than the decimal places of step"),l.precision)}),_=e.computed(()=>l.controls&&l.controlsPosition==="right"),D=a.useFormSize(),E=a.useFormDisabled(),T=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}),g=(n,t)=>{if(u.isUndefined(t)&&(t=U.value),t===0)return Math.round(n);let r=String(n);const s=r.indexOf(".");if(s===-1||!r.replace(".","").split("")[s+t])return n;const y=r.length;return r.charAt(y-1)==="5"&&(r=`${r.slice(0,Math.max(0,y-1))}6`),Number.parseFloat(Number(r).toFixed(t))},B=n=>{if(u.isNil(n))return 0;const t=n.toString(),r=t.indexOf(".");let s=0;return r!==-1&&(s=t.length-r-1),s},C=(n,t=1)=>u.isNumber(n)?g(n+l.step*t):i.currentValue,P=()=>{if(l.readonly||E.value||k.value)return;const n=Number(T.value)||0,t=C(n);I(t),d(a.INPUT_EVENT,i.currentValue),A()},S=()=>{if(l.readonly||E.value||h.value)return;const n=Number(T.value)||0,t=C(n,-1);I(t),d(a.INPUT_EVENT,i.currentValue),A()},F=(n,t)=>{const{max:r,min:s,step:c,precision:b,stepStrictly:y,valueOnClear:w}=l;r<s&&u.throwError("InputNumber","min should not be greater than max.");let m=Number(n);if(u.isNil(n)||Number.isNaN(m))return null;if(n===""){if(w===null)return null;m=u.isString(w)?{min:s,max:r}[w]:w}return y&&(m=g(Math.round(m/c)*c,b),m!==n&&t&&d(a.UPDATE_MODEL_EVENT,m)),u.isUndefined(b)||(m=g(m,b)),(m>r||m<s)&&(m=m>r?r:s,t&&d(a.UPDATE_MODEL_EVENT,m)),m},I=(n,t=!0)=>{var r;const s=i.currentValue,c=F(n);if(!t){d(a.UPDATE_MODEL_EVENT,c);return}s===c&&n||(i.userInput=null,d(a.UPDATE_MODEL_EVENT,c),s!==c&&d(a.CHANGE_EVENT,c,s),l.validateEvent&&((r=N==null?void 0:N.validate)==null||r.call(N,"change").catch(b=>u.debugWarn(b))),i.currentValue=c)},L=n=>{i.userInput=n;const t=n===""?null:Number(n);d(a.INPUT_EVENT,t),I(t,!1)},O=n=>{const t=n!==""?Number(n):"";(u.isNumber(t)&&!Number.isNaN(t)||n==="")&&I(t),A(),i.userInput=null},K=()=>{var n,t;(t=(n=p.value)==null?void 0:n.focus)==null||t.call(n)},z=()=>{var n,t;(t=(n=p.value)==null?void 0:n.blur)==null||t.call(n)},$=n=>{d("focus",n)},q=n=>{var t,r;i.userInput=null,M.isFirefox()&&i.currentValue===null&&((t=p.value)!=null&&t.input)&&(p.value.input.value=""),d("blur",n),l.validateEvent&&((r=N==null?void 0:N.validate)==null||r.call(N,"blur").catch(s=>u.debugWarn(s)))},A=()=>{i.currentValue!==l.modelValue&&(i.currentValue=l.modelValue)},R=n=>{document.activeElement===n.target&&n.preventDefault()};return e.watch(()=>l.modelValue,(n,t)=>{const r=F(n,!0);i.userInput===null&&r!==t&&(i.currentValue=r)},{immediate:!0}),e.onMounted(()=>{var n;const{min:t,max:r,modelValue:s}=l,c=(n=p.value)==null?void 0:n.input;if(c.setAttribute("role","spinbutton"),Number.isFinite(r)?c.setAttribute("aria-valuemax",String(r)):c.removeAttribute("aria-valuemax"),Number.isFinite(t)?c.setAttribute("aria-valuemin",String(t)):c.removeAttribute("aria-valuemin"),c.setAttribute("aria-valuenow",i.currentValue||i.currentValue===0?String(i.currentValue):""),c.setAttribute("aria-disabled",String(E.value)),!u.isNumber(s)&&s!=null){let b=Number(s);Number.isNaN(b)&&(b=null),d(a.UPDATE_MODEL_EVENT,b)}c.addEventListener("wheel",R,{passive:!1})}),e.onUpdated(()=>{var n,t;const r=(n=p.value)==null?void 0:n.input;r==null||r.setAttribute("aria-valuenow",`${(t=i.currentValue)!=null?t:""}`)}),v({focus:K,blur:z}),(n,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(f).b(),e.unref(f).m(e.unref(D)),e.unref(f).is("disabled",e.unref(E)),e.unref(f).is("without-controls",!n.controls),e.unref(f).is("controls-right",e.unref(_))]),onDragstart:e.withModifiers(()=>{},["prevent"])},[n.controls?e.withDirectives((e.openBlock(),e.createElementBlock("span",{key:0,role:"button","aria-label":e.unref(V)("el.inputNumber.decrease"),class:e.normalizeClass([e.unref(f).e("decrease"),e.unref(f).is("disabled",e.unref(h))]),onKeydown:e.withKeys(S,["enter"])},[e.renderSlot(n.$slots,"decrease-icon",{},()=>[e.createVNode(e.unref(a.ElIcon),null,{default:e.withCtx(()=>[e.unref(_)?(e.openBlock(),e.createBlock(e.unref(a.arrow_down_default),{key:0})):(e.openBlock(),e.createBlock(e.unref(a.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(V)("el.inputNumber.increase"),class:e.normalizeClass([e.unref(f).e("increase"),e.unref(f).is("disabled",e.unref(k))]),onKeydown:e.withKeys(P,["enter"])},[e.renderSlot(n.$slots,"increase-icon",{},()=>[e.createVNode(e.unref(a.ElIcon),null,{default:e.withCtx(()=>[e.unref(_)?(e.openBlock(),e.createBlock(e.unref(a.arrow_up_default),{key:0})):(e.openBlock(),e.createBlock(e.unref(a.plus_default),{key:1}))]),_:1})])],42,["aria-label","onKeydown"])),[[e.unref(x),P]]):e.createCommentVNode("v-if",!0),e.createVNode(e.unref(M.ElInput),{id:n.id,ref_key:"input",ref:p,type:"number",step:n.step,"model-value":e.unref(T),placeholder:n.placeholder,readonly:n.readonly,disabled:e.unref(E),size:e.unref(D),max:n.max,min:n.min,name:n.name,"aria-label":n.ariaLabel,"validate-event":!1,onKeydown:[e.withKeys(e.withModifiers(P,["prevent"]),["up"]),e.withKeys(e.withModifiers(S,["prevent"]),["down"])],onBlur:q,onFocus:$,onInput:L,onChange:O},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 X=u._export_sfc(Q,[["__file","input-number.vue"]]);const Z=u.withInstall(X);exports.ElInputNumber=Z;
|