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