adverich-kun-ui 0.1.227 → 0.1.228
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getCurrentInstance as
|
|
1
|
+
import { getCurrentInstance as $, useSlots as z, computed as E, createElementBlock as l, openBlock as s, createCommentVNode as n, createElementVNode as i, normalizeClass as p, unref as o, toDisplayString as u, mergeProps as P, createBlock as g, renderSlot as C, Fragment as I, renderList as U } from "vue";
|
|
2
2
|
import { KunNumberFieldProps as H } from "../composables/KunNumberFieldProps.js";
|
|
3
3
|
import { useKunNumberField as L } from "../composables/useKunNumberFieldComposable.js";
|
|
4
4
|
import V from "../../../KunIcon/src/components/KunIcon.vue.js";
|
|
@@ -7,7 +7,7 @@ const q = { class: "w-full flex flex-col relative" }, G = {
|
|
|
7
7
|
class: "h-full"
|
|
8
8
|
}, J = ["disabled"], O = {
|
|
9
9
|
key: 1,
|
|
10
|
-
class: "
|
|
10
|
+
class: "mx-2"
|
|
11
11
|
}, Q = {
|
|
12
12
|
key: 2,
|
|
13
13
|
class: "flex items-center justify-center h-full pl-1"
|
|
@@ -47,19 +47,19 @@ const q = { class: "w-full flex flex-col relative" }, G = {
|
|
|
47
47
|
"keyUp"
|
|
48
48
|
],
|
|
49
49
|
setup(j, { emit: A }) {
|
|
50
|
-
const b = j, y = A, c = `number-input-${
|
|
50
|
+
const b = j, y = A, c = `number-input-${$().uid}`, k = z(), D = !!k["prepend-icon"], F = !!k["append-icon"], {
|
|
51
51
|
inputValue: f,
|
|
52
52
|
numberInput: K,
|
|
53
|
-
inputKey:
|
|
54
|
-
updateValue:
|
|
53
|
+
inputKey: x,
|
|
54
|
+
updateValue: B,
|
|
55
55
|
onIncrement: d,
|
|
56
56
|
onDecrement: a,
|
|
57
57
|
onClear: m,
|
|
58
58
|
focus: h,
|
|
59
59
|
handleFocus: v,
|
|
60
|
-
isActive:
|
|
60
|
+
isActive: M,
|
|
61
61
|
handleBlur: w
|
|
62
|
-
} = L(b, y),
|
|
62
|
+
} = L(b, y), N = E(() => b.density === "compact" ? "p-1" : b.density === "comfortable" ? "p-2" : "p-3");
|
|
63
63
|
return (e, r) => (s(), l("div", q, [
|
|
64
64
|
e.label ? (s(), l("label", {
|
|
65
65
|
key: 0,
|
|
@@ -67,7 +67,7 @@ const q = { class: "w-full flex flex-col relative" }, G = {
|
|
|
67
67
|
class: p([
|
|
68
68
|
e.labelColor,
|
|
69
69
|
"absolute left-2 transition-all duration-200 ease-in-out pointer-events-none select-none z-10",
|
|
70
|
-
o(
|
|
70
|
+
o(M) || e.placeholder ? "-top-2.25 text-xs opacity-80" : "top-3 text-sm opacity-80"
|
|
71
71
|
])
|
|
72
72
|
}, u(e.label), 3)) : n("", !0),
|
|
73
73
|
i("div", P({ class: "w-full flex flex-col justify-center relative" }, e.$attrs), [
|
|
@@ -99,7 +99,7 @@ const q = { class: "w-full flex flex-col relative" }, G = {
|
|
|
99
99
|
id: c,
|
|
100
100
|
ref_key: "numberInput",
|
|
101
101
|
ref: K,
|
|
102
|
-
key: o(
|
|
102
|
+
key: o(x),
|
|
103
103
|
type: "text",
|
|
104
104
|
value: o(f),
|
|
105
105
|
placeholder: e.placeholder,
|
|
@@ -107,9 +107,9 @@ const q = { class: "w-full flex flex-col relative" }, G = {
|
|
|
107
107
|
disabled: e.disabled,
|
|
108
108
|
maxlength: e.maxlength,
|
|
109
109
|
autocomplete: "off",
|
|
110
|
-
class: p(["w-full h-full bg-transparent rounded focus:outline-none", [
|
|
110
|
+
class: p(["w-full h-full bg-transparent rounded focus:outline-none", [N.value, e.textColor, e.placeholderColor, e.textCenter ? "text-center" : ""]]),
|
|
111
111
|
"aria-invalid": e.error ? "true" : "false",
|
|
112
|
-
onInput: r[1] || (r[1] = (t) => o(
|
|
112
|
+
onInput: r[1] || (r[1] = (t) => o(B)(t.target.value)),
|
|
113
113
|
onBlur: r[2] || (r[2] = (...t) => o(w) && o(w)(...t)),
|
|
114
114
|
onFocus: r[3] || (r[3] = (...t) => o(v) && o(v)(...t)),
|
|
115
115
|
onKeydown: r[4] || (r[4] = (t) => y("keyDown", t)),
|
|
@@ -179,7 +179,7 @@ const q = { class: "w-full flex flex-col relative" }, G = {
|
|
|
179
179
|
e.hideDetails ? n("", !0) : (s(), l("div", le, [
|
|
180
180
|
e.error || e.errorMessages ? (s(), l("div", ne, [
|
|
181
181
|
Array.isArray(e.errorMessages) ? (s(), l("div", ie, [
|
|
182
|
-
(s(!0), l(I, null, U(e.errorMessages, (t,
|
|
182
|
+
(s(!0), l(I, null, U(e.errorMessages, (t, S) => (s(), l("div", { key: S }, u(t), 1))), 128))
|
|
183
183
|
])) : typeof e.errorMessages == "string" ? (s(), l("div", de, u(e.errorMessages), 1)) : n("", !0)
|
|
184
184
|
])) : e.hint && (e.persistentHint || o(h)) ? (s(), l("div", ae, u(e.hint), 1)) : n("", !0)
|
|
185
185
|
]))
|