adverich-kun-ui 0.1.454 → 0.1.456
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/dist/components/KunCard/src/components/KunCard.vue.js +44 -47
- package/dist/components/KunNumberField/src/components/KunNumberField.vue.js +1 -1
- package/dist/components/KunNumberField/src/composables/useKunNumberFieldComposable.js +111 -103
- package/dist/components/KunTextarea/src/components/KunTextarea.vue.js +1 -1
- package/package.json +1 -1
|
@@ -1,37 +1,34 @@
|
|
|
1
|
-
import { computed as f, createBlock as
|
|
1
|
+
import { computed as f, createBlock as u, openBlock as s, unref as z, withCtx as a, createElementVNode as h, mergeProps as $, withKeys as K, withModifiers as S, renderSlot as n, createCommentVNode as l, createElementBlock as o, normalizeClass as i, createVNode as r, resolveDynamicComponent as j } from "vue";
|
|
2
2
|
import { RouterLink as B } from "vue-router";
|
|
3
3
|
import { kunCardProps as H } from "../composables/kunCardProps.js";
|
|
4
|
-
import
|
|
4
|
+
import p from "../../../KunCardItem/src/components/KunCardItem.vue.js";
|
|
5
5
|
import g from "../../../KunCardTitle/src/components/KunCardTitle.vue.js";
|
|
6
6
|
import b from "../../../KunCardText/src/components/KunCardText.vue.js";
|
|
7
7
|
import w from "../../../KunCardActions/src/components/KunCardActions.vue.js";
|
|
8
8
|
const W = ["href", "onClick", "onKeydown"], N = ["src"], V = {
|
|
9
9
|
key: 1,
|
|
10
|
-
class: "flex items-center gap-2
|
|
10
|
+
class: "flex items-center gap-2"
|
|
11
11
|
}, D = ["src"], E = {
|
|
12
12
|
key: 2,
|
|
13
|
-
class: "
|
|
13
|
+
class: "pt-2"
|
|
14
14
|
}, L = {
|
|
15
15
|
key: 4,
|
|
16
|
-
class: "flex items-center gap-2
|
|
16
|
+
class: "flex items-center gap-2"
|
|
17
17
|
}, P = ["src"], M = {
|
|
18
18
|
key: 5,
|
|
19
|
-
class: "
|
|
19
|
+
class: "flex justify-end gap-2"
|
|
20
20
|
}, O = {
|
|
21
21
|
key: 6,
|
|
22
22
|
class: "absolute bottom-0 left-0 w-full h-1 bg-primary animate-pulse"
|
|
23
23
|
}, R = ["src"], T = {
|
|
24
24
|
key: 1,
|
|
25
|
-
class: "flex items-center gap-2
|
|
26
|
-
}, q = ["src"], F = {
|
|
27
|
-
key: 2,
|
|
28
|
-
class: "px-4 pt-4"
|
|
29
|
-
}, G = {
|
|
25
|
+
class: "flex items-center gap-2"
|
|
26
|
+
}, q = ["src"], F = { key: 2 }, G = {
|
|
30
27
|
key: 4,
|
|
31
|
-
class: "flex items-center gap-2
|
|
28
|
+
class: "flex items-center gap-2"
|
|
32
29
|
}, J = ["src"], Q = {
|
|
33
30
|
key: 5,
|
|
34
|
-
class: "
|
|
31
|
+
class: "flex justify-end gap-2"
|
|
35
32
|
}, U = {
|
|
36
33
|
key: 6,
|
|
37
34
|
class: "absolute bottom-0 left-0 w-full h-1 bg-primary animate-pulse"
|
|
@@ -39,17 +36,17 @@ const W = ["href", "onClick", "onKeydown"], N = ["src"], V = {
|
|
|
39
36
|
__name: "KunCard",
|
|
40
37
|
props: H,
|
|
41
38
|
setup(C) {
|
|
42
|
-
const t = C,
|
|
43
|
-
function
|
|
39
|
+
const t = C, c = f(() => !!(t.to || t.href)), A = f(() => t.tag || "div");
|
|
40
|
+
function v(e, d) {
|
|
44
41
|
e.ctrlKey || e.metaKey || e.button === 1 || (e.preventDefault(), d == null || d());
|
|
45
42
|
}
|
|
46
|
-
const
|
|
43
|
+
const y = f(() => [
|
|
47
44
|
"relative",
|
|
48
45
|
"overflow-hidden",
|
|
49
46
|
"flex",
|
|
50
47
|
"flex-col",
|
|
51
48
|
"w-full",
|
|
52
|
-
|
|
49
|
+
c.value ? "cursor-pointer" : "",
|
|
53
50
|
t.scrollable ? "h-full" : "",
|
|
54
51
|
t.bgColor,
|
|
55
52
|
t.textColor,
|
|
@@ -71,30 +68,30 @@ const W = ["href", "onClick", "onKeydown"], N = ["src"], V = {
|
|
|
71
68
|
t.variant === "text" ? "bg-transparent shadow-none" : "",
|
|
72
69
|
(t.variant === "plain", "")
|
|
73
70
|
].filter(Boolean).join(" "));
|
|
74
|
-
return (e, d) =>
|
|
71
|
+
return (e, d) => c.value ? (s(), u(z(B), {
|
|
75
72
|
key: 0,
|
|
76
73
|
to: e.to,
|
|
77
74
|
replace: e.replace,
|
|
78
75
|
exact: e.exact,
|
|
79
76
|
custom: ""
|
|
80
77
|
}, {
|
|
81
|
-
default:
|
|
78
|
+
default: a(({ navigate: k, href: I }) => [
|
|
82
79
|
h("a", $({
|
|
83
80
|
href: I,
|
|
84
|
-
class:
|
|
81
|
+
class: y.value,
|
|
85
82
|
role: "link",
|
|
86
83
|
tabindex: "0",
|
|
87
|
-
onClick: (m) =>
|
|
88
|
-
onKeydown: K(S((m) =>
|
|
84
|
+
onClick: (m) => v(m, k),
|
|
85
|
+
onKeydown: K(S((m) => v(m, k), ["prevent"]), ["enter"])
|
|
89
86
|
}, e.$attrs), [
|
|
90
|
-
e.image || e.$slots.image ?
|
|
87
|
+
e.image || e.$slots.image ? n(e.$slots, "image", { key: 0 }, () => [
|
|
91
88
|
h("img", {
|
|
92
89
|
src: e.image,
|
|
93
90
|
class: "w-full h-auto object-cover"
|
|
94
91
|
}, null, 8, N)
|
|
95
92
|
]) : l("", !0),
|
|
96
93
|
e.prependAvatar || e.prependIcon || e.$slots.prepend ? (s(), o("div", V, [
|
|
97
|
-
|
|
94
|
+
n(e.$slots, "prepend"),
|
|
98
95
|
e.prependAvatar ? (s(), o("img", {
|
|
99
96
|
key: 0,
|
|
100
97
|
src: e.prependAvatar,
|
|
@@ -106,10 +103,10 @@ const W = ["href", "onClick", "onKeydown"], N = ["src"], V = {
|
|
|
106
103
|
}, null, 2)) : l("", !0)
|
|
107
104
|
])) : l("", !0),
|
|
108
105
|
e.$slots.title || e.title || e.subtitle ? (s(), o("div", E, [
|
|
109
|
-
r(
|
|
106
|
+
r(p, {
|
|
110
107
|
dense: e.density !== "default"
|
|
111
108
|
}, {
|
|
112
|
-
default:
|
|
109
|
+
default: a(() => [
|
|
113
110
|
r(g, {
|
|
114
111
|
title: e.title,
|
|
115
112
|
subtitle: e.subtitle,
|
|
@@ -121,17 +118,17 @@ const W = ["href", "onClick", "onKeydown"], N = ["src"], V = {
|
|
|
121
118
|
])) : l("", !0),
|
|
122
119
|
e.$slots.default || e.text ? (s(), o("div", {
|
|
123
120
|
key: 3,
|
|
124
|
-
class: i(["
|
|
121
|
+
class: i(["text-sm", e.scrollable ? "flex-grow overflow-auto" : ""])
|
|
125
122
|
}, [
|
|
126
|
-
e.text ? (s(), p
|
|
127
|
-
default:
|
|
123
|
+
e.text ? (s(), u(p, { key: 0 }, {
|
|
124
|
+
default: a(() => [
|
|
128
125
|
r(b, { text: e.text }, null, 8, ["text"])
|
|
129
126
|
]),
|
|
130
127
|
_: 1
|
|
131
|
-
})) :
|
|
128
|
+
})) : n(e.$slots, "default", { key: 1 })
|
|
132
129
|
], 2)) : l("", !0),
|
|
133
130
|
e.appendAvatar || e.appendIcon || e.$slots.append ? (s(), o("div", L, [
|
|
134
|
-
|
|
131
|
+
n(e.$slots, "append"),
|
|
135
132
|
e.appendAvatar ? (s(), o("img", {
|
|
136
133
|
key: 0,
|
|
137
134
|
src: e.appendAvatar,
|
|
@@ -144,8 +141,8 @@ const W = ["href", "onClick", "onKeydown"], N = ["src"], V = {
|
|
|
144
141
|
])) : l("", !0),
|
|
145
142
|
e.$slots.actions ? (s(), o("div", M, [
|
|
146
143
|
r(w, null, {
|
|
147
|
-
default:
|
|
148
|
-
|
|
144
|
+
default: a(() => [
|
|
145
|
+
n(e.$slots, "actions")
|
|
149
146
|
]),
|
|
150
147
|
_: 3
|
|
151
148
|
})
|
|
@@ -154,19 +151,19 @@ const W = ["href", "onClick", "onKeydown"], N = ["src"], V = {
|
|
|
154
151
|
], 16, W)
|
|
155
152
|
]),
|
|
156
153
|
_: 3
|
|
157
|
-
}, 8, ["to", "replace", "exact"])) : (s(),
|
|
154
|
+
}, 8, ["to", "replace", "exact"])) : (s(), u(j(A.value), $({
|
|
158
155
|
key: 1,
|
|
159
|
-
class:
|
|
156
|
+
class: y.value
|
|
160
157
|
}, e.$attrs), {
|
|
161
|
-
default:
|
|
162
|
-
e.image || e.$slots.image ?
|
|
158
|
+
default: a(() => [
|
|
159
|
+
e.image || e.$slots.image ? n(e.$slots, "image", { key: 0 }, () => [
|
|
163
160
|
h("img", {
|
|
164
161
|
src: e.image,
|
|
165
162
|
class: "w-full h-auto object-cover"
|
|
166
163
|
}, null, 8, R)
|
|
167
164
|
]) : l("", !0),
|
|
168
165
|
e.prependAvatar || e.prependIcon || e.$slots.prepend ? (s(), o("div", T, [
|
|
169
|
-
|
|
166
|
+
n(e.$slots, "prepend"),
|
|
170
167
|
e.prependAvatar ? (s(), o("img", {
|
|
171
168
|
key: 0,
|
|
172
169
|
src: e.prependAvatar,
|
|
@@ -178,10 +175,10 @@ const W = ["href", "onClick", "onKeydown"], N = ["src"], V = {
|
|
|
178
175
|
}, null, 2)) : l("", !0)
|
|
179
176
|
])) : l("", !0),
|
|
180
177
|
e.$slots.title || e.title || e.subtitle ? (s(), o("div", F, [
|
|
181
|
-
r(
|
|
178
|
+
r(p, {
|
|
182
179
|
dense: e.density !== "default"
|
|
183
180
|
}, {
|
|
184
|
-
default:
|
|
181
|
+
default: a(() => [
|
|
185
182
|
r(g, {
|
|
186
183
|
title: e.title,
|
|
187
184
|
subtitle: e.subtitle,
|
|
@@ -193,17 +190,17 @@ const W = ["href", "onClick", "onKeydown"], N = ["src"], V = {
|
|
|
193
190
|
])) : l("", !0),
|
|
194
191
|
e.$slots.default || e.text ? (s(), o("div", {
|
|
195
192
|
key: 3,
|
|
196
|
-
class: i(["
|
|
193
|
+
class: i(["text-sm", e.scrollable ? "flex-grow overflow-auto" : ""])
|
|
197
194
|
}, [
|
|
198
|
-
e.text ? (s(), p
|
|
199
|
-
default:
|
|
195
|
+
e.text ? (s(), u(p, { key: 0 }, {
|
|
196
|
+
default: a(() => [
|
|
200
197
|
r(b, { text: e.text }, null, 8, ["text"])
|
|
201
198
|
]),
|
|
202
199
|
_: 1
|
|
203
|
-
})) :
|
|
200
|
+
})) : n(e.$slots, "default", { key: 1 })
|
|
204
201
|
], 2)) : l("", !0),
|
|
205
202
|
e.appendAvatar || e.appendIcon || e.$slots.append ? (s(), o("div", G, [
|
|
206
|
-
|
|
203
|
+
n(e.$slots, "append"),
|
|
207
204
|
e.appendAvatar ? (s(), o("img", {
|
|
208
205
|
key: 0,
|
|
209
206
|
src: e.appendAvatar,
|
|
@@ -216,8 +213,8 @@ const W = ["href", "onClick", "onKeydown"], N = ["src"], V = {
|
|
|
216
213
|
])) : l("", !0),
|
|
217
214
|
e.$slots.actions ? (s(), o("div", Q, [
|
|
218
215
|
r(w, null, {
|
|
219
|
-
default:
|
|
220
|
-
|
|
216
|
+
default: a(() => [
|
|
217
|
+
n(e.$slots, "actions")
|
|
221
218
|
]),
|
|
222
219
|
_: 3
|
|
223
220
|
})
|
|
@@ -12,7 +12,7 @@ const O = {
|
|
|
12
12
|
class: "mx-2"
|
|
13
13
|
}, W = {
|
|
14
14
|
key: 2,
|
|
15
|
-
class: "flex items-center justify-center h-full pl-
|
|
15
|
+
class: "flex items-center justify-center h-full pl-2"
|
|
16
16
|
}, X = ["value", "placeholder", "readonly", "disabled", "maxlength", "aria-invalid"], Y = {
|
|
17
17
|
key: 3,
|
|
18
18
|
class: "px-2"
|
|
@@ -1,142 +1,150 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { format as
|
|
3
|
-
function
|
|
4
|
-
const
|
|
5
|
-
let
|
|
6
|
-
const K =
|
|
7
|
-
|
|
8
|
-
return
|
|
1
|
+
import { ref as w, computed as q, watch as G, nextTick as y } from "vue";
|
|
2
|
+
import { format as d, clamp as x, toRawNumberString as D, fromRawString as L } from "./numberFormatUtils.js";
|
|
3
|
+
function Q(i, s) {
|
|
4
|
+
const l = w(""), c = w(null), F = w(null), R = w(!1), m = w(0);
|
|
5
|
+
let t = "";
|
|
6
|
+
const K = q(() => {
|
|
7
|
+
const e = Number(i.precision);
|
|
8
|
+
return e > 0 ? e + 1 : 1;
|
|
9
|
+
});
|
|
10
|
+
function h(e) {
|
|
11
|
+
return Number(i.precision) === 0 ? e === "" ? "0" : e.replace(/^0+(\d)/, "$1") : e.padStart(K.value, "0");
|
|
9
12
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
G(
|
|
14
|
+
[() => i.modelValue, () => i.precision],
|
|
15
|
+
([e, n], [r, u]) => {
|
|
16
|
+
const N = Number(n) !== Number(u);
|
|
17
|
+
if (e == null || isNaN(e))
|
|
18
|
+
l.value = d(0, { ...i, precision: n }), t = "0".repeat(Number(n) + 1);
|
|
19
|
+
else {
|
|
20
|
+
const v = parseFloat(e), o = x(v, i.min, i.max);
|
|
21
|
+
N && (t = D(o, Number(n))), t.length < Number(n) + 1 && (t = t.padStart(Number(n) + 1, "0")), l.value = d(o, { ...i, precision: n });
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
{ immediate: !0 }
|
|
25
|
+
);
|
|
18
26
|
function $(e) {
|
|
19
|
-
const { key:
|
|
20
|
-
if (
|
|
21
|
-
|
|
22
|
-
if (!
|
|
23
|
-
const
|
|
24
|
-
|
|
27
|
+
const { key: n, target: r } = e, u = /^[0-9]$/.test(n), N = n === "Backspace", v = n === "Delete", o = ["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown"].includes(n), b = e.ctrlKey || e.metaKey, f = n === "Home", U = n === "End";
|
|
28
|
+
if (f) {
|
|
29
|
+
y(() => {
|
|
30
|
+
if (!c.value) return;
|
|
31
|
+
const S = l.value.search(/\d/);
|
|
32
|
+
c.value.setSelectionRange(S, S);
|
|
25
33
|
});
|
|
26
34
|
return;
|
|
27
35
|
}
|
|
28
|
-
if (
|
|
29
|
-
|
|
30
|
-
if (!
|
|
31
|
-
const a =
|
|
32
|
-
|
|
36
|
+
if (U) {
|
|
37
|
+
y(() => {
|
|
38
|
+
if (!c.value) return;
|
|
39
|
+
const a = l.value;
|
|
40
|
+
c.value.setSelectionRange(a.length, a.length);
|
|
33
41
|
});
|
|
34
42
|
return;
|
|
35
43
|
}
|
|
36
|
-
if (
|
|
37
|
-
const
|
|
44
|
+
if (o || b) return;
|
|
45
|
+
const V = E(l.value, r.selectionStart);
|
|
38
46
|
e.preventDefault();
|
|
39
|
-
const k = Number(
|
|
40
|
-
for (;
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
44
|
-
|
|
45
|
-
else if (
|
|
46
|
-
const a =
|
|
47
|
-
if (
|
|
48
|
-
const
|
|
49
|
-
|
|
47
|
+
const k = Number(i.precision) + 1;
|
|
48
|
+
for (; t.length < k; )
|
|
49
|
+
t = "0" + t;
|
|
50
|
+
const g = A(l.value, V);
|
|
51
|
+
if (u)
|
|
52
|
+
t = t.substring(0, g) + n + t.substring(g), m.value = g + 1;
|
|
53
|
+
else if (N && V > 0) {
|
|
54
|
+
const a = A(l.value, V), S = a - 1;
|
|
55
|
+
if (t.length <= Number(i.precision) + 1) {
|
|
56
|
+
const j = Math.max(0, a - 1);
|
|
57
|
+
t = t.slice(0, j) + t.slice(a), t = h(t), m.value = a, C();
|
|
50
58
|
return;
|
|
51
59
|
}
|
|
52
|
-
a > 0 && (
|
|
53
|
-
} else
|
|
54
|
-
for (
|
|
55
|
-
|
|
56
|
-
|
|
60
|
+
a > 0 && (t = t.slice(0, S) + t.slice(a), t = h(t), m.value = S);
|
|
61
|
+
} else v && V < l.value.length && g < t.length && (t = t.substring(0, g) + t.substring(g + 1), m.value = g);
|
|
62
|
+
for (t = h(t); t.length < k; )
|
|
63
|
+
t = "0" + t;
|
|
64
|
+
C();
|
|
57
65
|
}
|
|
58
|
-
function
|
|
59
|
-
let
|
|
60
|
-
for (let
|
|
61
|
-
/\d/.test(e[
|
|
62
|
-
return
|
|
66
|
+
function A(e, n) {
|
|
67
|
+
let r = 0;
|
|
68
|
+
for (let u = 0; u < n; u++)
|
|
69
|
+
/\d/.test(e[u]) && r++;
|
|
70
|
+
return r;
|
|
63
71
|
}
|
|
64
|
-
function B(e,
|
|
65
|
-
let
|
|
66
|
-
for (let
|
|
67
|
-
if (/\d/.test(e[
|
|
68
|
-
if (
|
|
69
|
-
return
|
|
70
|
-
|
|
72
|
+
function B(e, n) {
|
|
73
|
+
let r = 0;
|
|
74
|
+
for (let u = 0; u < e.length; u++)
|
|
75
|
+
if (/\d/.test(e[u])) {
|
|
76
|
+
if (r === n)
|
|
77
|
+
return u;
|
|
78
|
+
r++;
|
|
71
79
|
}
|
|
72
|
-
for (let
|
|
73
|
-
if (/\d/.test(e[
|
|
74
|
-
return
|
|
80
|
+
for (let u = e.length - 1; u >= 0; u--)
|
|
81
|
+
if (/\d/.test(e[u]))
|
|
82
|
+
return u + 1;
|
|
75
83
|
return e.length;
|
|
76
84
|
}
|
|
77
|
-
function E(e,
|
|
78
|
-
for (;
|
|
79
|
-
|
|
80
|
-
if (
|
|
81
|
-
for (
|
|
82
|
-
|
|
83
|
-
const
|
|
84
|
-
return
|
|
85
|
+
function E(e, n) {
|
|
86
|
+
for (; n < e.length && !/\d/.test(e[n]); )
|
|
87
|
+
n++;
|
|
88
|
+
if (n >= e.length)
|
|
89
|
+
for (n = e.length; n > 0 && !/\d/.test(e[n - 1]); )
|
|
90
|
+
n--;
|
|
91
|
+
const r = e.search(/\d/);
|
|
92
|
+
return n < r && (n = r), n;
|
|
85
93
|
}
|
|
86
|
-
function
|
|
87
|
-
const e = Number(
|
|
88
|
-
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
if (
|
|
94
|
+
function C() {
|
|
95
|
+
const e = Number(i.precision) + 1;
|
|
96
|
+
t.padStart(e, "0");
|
|
97
|
+
const n = Math.max(1, t.length - Number(i.precision)), r = t.slice(0, n) || "0", u = t.slice(n).padEnd(Number(i.precision), "0").slice(0, Number(i.precision)), N = `${r}.${u}`, v = parseFloat(N), o = x(v, i.min, i.max);
|
|
98
|
+
t = D(o, Number(i.precision)), l.value = d(o, i), s("update:modelValue", o), s("input", o), y(() => {
|
|
99
|
+
if (c.value)
|
|
92
100
|
try {
|
|
93
|
-
const b =
|
|
94
|
-
let
|
|
95
|
-
for (;
|
|
96
|
-
|
|
97
|
-
|
|
101
|
+
const b = l.value;
|
|
102
|
+
let f = B(b, m.value);
|
|
103
|
+
for (; f < b.length && !/\d/.test(b[f]); )
|
|
104
|
+
f++;
|
|
105
|
+
c.value.setSelectionRange(f, f);
|
|
98
106
|
} catch {
|
|
99
|
-
|
|
107
|
+
c.value.setSelectionRange(l.value.length, l.value.length);
|
|
100
108
|
}
|
|
101
109
|
});
|
|
102
110
|
}
|
|
103
111
|
function M() {
|
|
104
|
-
|
|
105
|
-
const e = L(
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
function P() {
|
|
109
|
-
var i;
|
|
110
|
-
x.value = !0;
|
|
111
|
-
const e = ((i = r.value) == null ? void 0 : i.selectionStart) || 0;
|
|
112
|
-
s.value = R(u.value, e), o("focus");
|
|
112
|
+
R.value = !1, t = h(t);
|
|
113
|
+
const e = L(t, Number(i.precision)), n = x(e, i.min, i.max);
|
|
114
|
+
t = D(n, Number(i.precision)), t = h(t), l.value = d(n, i), s("update:modelValue", n), s("blur");
|
|
113
115
|
}
|
|
114
116
|
function T() {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
+
var n;
|
|
118
|
+
R.value = !0;
|
|
119
|
+
const e = ((n = c.value) == null ? void 0 : n.selectionStart) || 0;
|
|
120
|
+
m.value = A(l.value, e), s("focus");
|
|
117
121
|
}
|
|
118
122
|
function H() {
|
|
119
|
-
let e = L(
|
|
120
|
-
e =
|
|
123
|
+
let e = L(t, Number(i.precision)) || 0;
|
|
124
|
+
e = x(e + Number(i.step), i.min, i.max), t = D(e, Number(i.precision)), l.value = d(e, i), s("update:modelValue", e);
|
|
121
125
|
}
|
|
122
126
|
function I() {
|
|
127
|
+
let e = L(t, Number(i.precision)) || 0;
|
|
128
|
+
e = x(e - Number(i.step), i.min, i.max), t = D(e, Number(i.precision)), l.value = d(e, i), s("update:modelValue", e);
|
|
129
|
+
}
|
|
130
|
+
function z() {
|
|
123
131
|
var e;
|
|
124
|
-
|
|
132
|
+
t = "0".repeat(Number(i.precision) + 1), m.value = Number(i.precision) + 1, C(), (e = c.value) == null || e.focus();
|
|
125
133
|
}
|
|
126
134
|
return {
|
|
127
|
-
inputValue:
|
|
128
|
-
numberInput:
|
|
135
|
+
inputValue: l,
|
|
136
|
+
numberInput: c,
|
|
129
137
|
rootRef: F,
|
|
130
138
|
validateKey: $,
|
|
131
|
-
handleFocus:
|
|
139
|
+
handleFocus: T,
|
|
132
140
|
handleBlur: M,
|
|
133
|
-
onIncrement:
|
|
134
|
-
onDecrement:
|
|
135
|
-
onClear:
|
|
136
|
-
isActive:
|
|
137
|
-
focus:
|
|
141
|
+
onIncrement: H,
|
|
142
|
+
onDecrement: I,
|
|
143
|
+
onClear: z,
|
|
144
|
+
isActive: R,
|
|
145
|
+
focus: R
|
|
138
146
|
};
|
|
139
147
|
}
|
|
140
148
|
export {
|
|
141
|
-
|
|
149
|
+
Q as useKunNumberField
|
|
142
150
|
};
|
|
@@ -168,7 +168,7 @@ const ce = { class: "relative" }, ve = {
|
|
|
168
168
|
onBlur: U,
|
|
169
169
|
onClick: r[2] || (r[2] = (s) => e.$emit("click:control", s)),
|
|
170
170
|
onMousedown: r[3] || (r[3] = (s) => e.$emit("mousedown:control", s)),
|
|
171
|
-
class: b([X.value]),
|
|
171
|
+
class: b(["bg-field-background", [X.value]]),
|
|
172
172
|
style: { width: "100%", "box-sizing": "border-box", "overflow-y": "hidden" }
|
|
173
173
|
}, null, 42, be),
|
|
174
174
|
e.clearable && n(v) ? (t(), l("div", {
|