vlite3 0.5.10 → 0.6.1
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/ColorPicker/ColorIro.vue3.js +2 -2
- package/components/ColorPicker/ColorPicker.vue.js +2 -2
- package/components/DateRangePicker.vue.d.ts +1 -0
- package/components/DateRangePicker.vue.js +18 -17
- package/components/Form/FormField.vue.js +15 -15
- package/components/Input.vue.js +91 -93
- package/components/Screen/ScreenFilter.vue.js +1 -1
- package/package.json +1 -1
- package/style.css +2 -2
- /package/components/ColorPicker/{ColorIro.vue2.js → ColorIro.vue.js} +0 -0
|
@@ -5,8 +5,8 @@ import O from "../Input.vue.js";
|
|
|
5
5
|
/* empty css */
|
|
6
6
|
import "../../core/config.js";
|
|
7
7
|
import y from "../Button.vue.js";
|
|
8
|
-
import E from "./ColorIro.
|
|
9
|
-
/* empty css
|
|
8
|
+
import E from "./ColorIro.vue.js";
|
|
9
|
+
/* empty css */
|
|
10
10
|
import { useEyeDropper as P } from "@vueuse/core";
|
|
11
11
|
const I = {
|
|
12
12
|
key: 0,
|
|
@@ -14,6 +14,7 @@ type __VLS_Props = {
|
|
|
14
14
|
size?: ButtonSize;
|
|
15
15
|
variant?: ButtonVariant;
|
|
16
16
|
showQuickRanges?: boolean;
|
|
17
|
+
triggerClass?: string;
|
|
17
18
|
};
|
|
18
19
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
19
20
|
change: (...args: any[]) => void;
|
|
@@ -6,10 +6,10 @@ import { $t as l } from "../utils/i18n.js";
|
|
|
6
6
|
import P from "./Button.vue.js";
|
|
7
7
|
import p from "v-datepicker-lite";
|
|
8
8
|
import "v-datepicker-lite/style.css";
|
|
9
|
-
const $ = { class: "flex items-center gap-2" },
|
|
9
|
+
const $ = { class: "flex items-center justify-between gap-2 w-full" }, j = { class: "flex flex-col sm:flex-row bg-background rounded-md" }, H = {
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "flex flex-col gap-1 sm:pr-3 py-2 sm:border-r border-border max-h-[280px]"
|
|
12
|
-
},
|
|
12
|
+
}, Q = { class: "flex flex-col sm:flex-row items-center gap-4 py-2 p-3" }, O = { class: "border border-border rounded-md overflow-hidden bg-background" }, I = { class: "flex items-center justify-center shrink-0" }, U = { class: "border border-border rounded-md overflow-hidden bg-background" }, ee = /* @__PURE__ */ V({
|
|
13
13
|
__name: "DateRangePicker",
|
|
14
14
|
props: {
|
|
15
15
|
modelValue: {},
|
|
@@ -21,18 +21,19 @@ const $ = { class: "flex items-center gap-2" }, H = { class: "flex flex-col sm:f
|
|
|
21
21
|
readonly: { type: Boolean },
|
|
22
22
|
size: {},
|
|
23
23
|
variant: {},
|
|
24
|
-
showQuickRanges: { type: Boolean, default: !0 }
|
|
24
|
+
showQuickRanges: { type: Boolean, default: !0 },
|
|
25
|
+
triggerClass: {}
|
|
25
26
|
},
|
|
26
27
|
emits: ["update:modelValue", "change"],
|
|
27
28
|
setup(r, { emit: M }) {
|
|
28
|
-
const v = r,
|
|
29
|
+
const v = r, b = M, o = w(!1), c = w(0);
|
|
29
30
|
L(o, (t) => {
|
|
30
31
|
t && c.value++;
|
|
31
32
|
});
|
|
32
33
|
const n = u({
|
|
33
34
|
get: () => v.modelValue || { start: null, end: null },
|
|
34
35
|
set: (t) => {
|
|
35
|
-
|
|
36
|
+
b("update:modelValue", t), b("change", t);
|
|
36
37
|
}
|
|
37
38
|
}), Y = (t) => {
|
|
38
39
|
n.value = { ...n.value, start: t };
|
|
@@ -44,13 +45,13 @@ const $ = { class: "flex items-center gap-2" }, H = { class: "flex flex-col sm:f
|
|
|
44
45
|
if (!isNaN(t.getTime())) return t.toISOString();
|
|
45
46
|
}
|
|
46
47
|
return v.maxDate;
|
|
47
|
-
}),
|
|
48
|
+
}), C = u(() => {
|
|
48
49
|
if (n.value.start) {
|
|
49
50
|
const t = new Date(n.value.start);
|
|
50
51
|
if (!isNaN(t.getTime())) return t.toISOString();
|
|
51
52
|
}
|
|
52
53
|
return v.minDate;
|
|
53
|
-
}),
|
|
54
|
+
}), D = (t) => {
|
|
54
55
|
if (!t) return "";
|
|
55
56
|
try {
|
|
56
57
|
const e = new Date(t);
|
|
@@ -58,7 +59,7 @@ const $ = { class: "flex items-center gap-2" }, H = { class: "flex flex-col sm:f
|
|
|
58
59
|
} catch {
|
|
59
60
|
return "";
|
|
60
61
|
}
|
|
61
|
-
},
|
|
62
|
+
}, N = u(() => [
|
|
62
63
|
{
|
|
63
64
|
label: l("vlite.dateRangePicker.today") !== "vlite.dateRangePicker.today" ? l("vlite.dateRangePicker.today") : "Today",
|
|
64
65
|
value: "today",
|
|
@@ -152,30 +153,30 @@ const $ = { class: "flex items-center gap-2" }, H = { class: "flex flex-col sm:f
|
|
|
152
153
|
variant: r.variant || "outline",
|
|
153
154
|
size: r.size || "md",
|
|
154
155
|
disabled: r.disabled,
|
|
155
|
-
class: k(["w-
|
|
156
|
+
class: k(["w-max justify-between text-left font-normal", [r.triggerClass, { "ring-1 ring-ring ring-offset-[1]": a }]])
|
|
156
157
|
}, {
|
|
157
158
|
default: y(() => [
|
|
158
159
|
i("div", $, [
|
|
159
160
|
i("span", {
|
|
160
161
|
class: k({ "text-muted-foreground": !n.value.start })
|
|
161
|
-
}, R(n.value.start ?
|
|
162
|
+
}, R(n.value.start ? D(n.value.start) : r.placeholderStart), 3),
|
|
162
163
|
g(f, {
|
|
163
164
|
icon: "lucide:arrow-right",
|
|
164
|
-
class: "w-4 h-4 text-muted-foreground opacity-
|
|
165
|
+
class: "w-4 h-4 text-muted-foreground opacity-60 shrink-0"
|
|
165
166
|
}),
|
|
166
167
|
i("span", {
|
|
167
168
|
class: k({ "text-muted-foreground": !n.value.end })
|
|
168
|
-
}, R(n.value.end ?
|
|
169
|
+
}, R(n.value.end ? D(n.value.end) : r.placeholderEnd), 3)
|
|
169
170
|
])
|
|
170
171
|
]),
|
|
171
172
|
_: 1
|
|
172
173
|
}, 8, ["variant", "size", "disabled", "class"])
|
|
173
174
|
]),
|
|
174
175
|
menu: y(() => [
|
|
175
|
-
i("div",
|
|
176
|
-
r.showQuickRanges ? (d(), x("div",
|
|
176
|
+
i("div", j, [
|
|
177
|
+
r.showQuickRanges ? (d(), x("div", H, [
|
|
177
178
|
e[1] || (e[1] = i("div", { class: "text-xs pl-2 pb-2 font-semibold text-muted-foreground uppercase tracking-wider" }, " Quick Ranges ", -1)),
|
|
178
|
-
(d(!0), x(z, null, B(
|
|
179
|
+
(d(!0), x(z, null, B(N.value, (a) => (d(), m(P, {
|
|
179
180
|
key: a.value,
|
|
180
181
|
text: a.label,
|
|
181
182
|
icon: a.icon,
|
|
@@ -185,7 +186,7 @@ const $ = { class: "flex items-center gap-2" }, H = { class: "flex flex-col sm:f
|
|
|
185
186
|
onClick: (s) => F(a)
|
|
186
187
|
}, null, 8, ["text", "icon", "onClick"]))), 128))
|
|
187
188
|
])) : E("", !0),
|
|
188
|
-
i("div",
|
|
189
|
+
i("div", Q, [
|
|
189
190
|
i("div", O, [
|
|
190
191
|
(d(), m(h(p), {
|
|
191
192
|
key: "start-" + c.value,
|
|
@@ -214,7 +215,7 @@ const $ = { class: "flex items-center gap-2" }, H = { class: "flex flex-col sm:f
|
|
|
214
215
|
value: n.value.end,
|
|
215
216
|
onChange: _,
|
|
216
217
|
mode: "date",
|
|
217
|
-
"min-date":
|
|
218
|
+
"min-date": C.value,
|
|
218
219
|
"max-date": r.maxDate,
|
|
219
220
|
disabled: r.disabled,
|
|
220
221
|
readonly: r.readonly
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as U, computed as o, markRaw as I, openBlock as r, createBlock as f, mergeProps as
|
|
1
|
+
import { defineComponent as U, computed as o, markRaw as I, openBlock as r, createBlock as f, mergeProps as s, toHandlers as S, createSlots as N, unref as R, withCtx as n, createVNode as z, createTextVNode as c, toDisplayString as m, createCommentVNode as L, resolveDynamicComponent as B } from "vue";
|
|
2
2
|
import { isComponent as h, isAddonObject as p } from "./utils/form.utils.js";
|
|
3
3
|
import O from "../NumberInput.vue.js";
|
|
4
4
|
import v from "../Button.vue.js";
|
|
@@ -15,7 +15,7 @@ import G from "../DatePicker.vue.js";
|
|
|
15
15
|
import J from "../ColorPicker/ColorPicker.vue.js";
|
|
16
16
|
import K from "../IconPicker.vue.js";
|
|
17
17
|
import M from "./CustomFields.vue.js";
|
|
18
|
-
const
|
|
18
|
+
const ue = /* @__PURE__ */ U({
|
|
19
19
|
__name: "FormField",
|
|
20
20
|
props: {
|
|
21
21
|
field: {},
|
|
@@ -32,10 +32,10 @@ const se = /* @__PURE__ */ U({
|
|
|
32
32
|
},
|
|
33
33
|
emits: ["change", "addonChange", "addonAction"],
|
|
34
34
|
setup(l, { emit: $ }) {
|
|
35
|
-
const e = l,
|
|
36
|
-
|
|
35
|
+
const e = l, u = $, d = (t, a) => {
|
|
36
|
+
u("change", { value: t, data: a });
|
|
37
37
|
}, w = (t) => {
|
|
38
|
-
|
|
38
|
+
u("change", { value: t });
|
|
39
39
|
}, C = o(() => {
|
|
40
40
|
const t = e.field.type;
|
|
41
41
|
if (h(t))
|
|
@@ -111,7 +111,7 @@ const se = /* @__PURE__ */ U({
|
|
|
111
111
|
max: e.field.max,
|
|
112
112
|
step: e.field.props?.step ?? 1,
|
|
113
113
|
variant: e.field.props?.variant ?? "split",
|
|
114
|
-
mode: e.field.props?.mode ?? "outline",
|
|
114
|
+
mode: e.field.props?.mode ?? (e.variant === "transparent" ? "ghost" : "outline"),
|
|
115
115
|
size: e.size,
|
|
116
116
|
rounded: e.rounded,
|
|
117
117
|
placeholder: i,
|
|
@@ -232,18 +232,18 @@ const se = /* @__PURE__ */ U({
|
|
|
232
232
|
const t = e.field.type;
|
|
233
233
|
return t === "text" || t === "email" || t === "password" || t === "tel" || t === "url" || t === "search" || !t;
|
|
234
234
|
}), P = o(() => F.value && A.value), V = (t, a) => {
|
|
235
|
-
|
|
235
|
+
u("addonChange", t.name, { value: a.value });
|
|
236
236
|
}, k = (t) => {
|
|
237
|
-
t.action &&
|
|
237
|
+
t.action && u("addonAction", t.action);
|
|
238
238
|
};
|
|
239
|
-
return (t, a) => P.value ? (r(), f(g,
|
|
239
|
+
return (t, a) => P.value ? (r(), f(g, s({ key: 0 }, {
|
|
240
240
|
...b.value,
|
|
241
241
|
...l.field?.props || {}
|
|
242
242
|
}, S(x.value)), N({ _: 2 }, [
|
|
243
243
|
R(p)(l.field.addonLeft) ? {
|
|
244
244
|
name: "addon-left",
|
|
245
245
|
fn: n(() => [
|
|
246
|
-
l.field.addonLeft.type === "select" ? (r(), f(y,
|
|
246
|
+
l.field.addonLeft.type === "select" ? (r(), f(y, s({
|
|
247
247
|
key: 0,
|
|
248
248
|
modelValue: l.field.addonLeft.name ? l.values[l.field.addonLeft.name] : void 0,
|
|
249
249
|
options: l.field.addonLeft.options || []
|
|
@@ -259,7 +259,7 @@ const se = /* @__PURE__ */ U({
|
|
|
259
259
|
}, 1024)
|
|
260
260
|
]),
|
|
261
261
|
_: 1
|
|
262
|
-
}, 16, ["modelValue", "options"])) : l.field.addonLeft.type === "button" ? (r(), f(v,
|
|
262
|
+
}, 16, ["modelValue", "options"])) : l.field.addonLeft.type === "button" ? (r(), f(v, s({
|
|
263
263
|
key: 1,
|
|
264
264
|
variant: "outline"
|
|
265
265
|
}, l.field.addonLeft.props || {}, {
|
|
@@ -276,7 +276,7 @@ const se = /* @__PURE__ */ U({
|
|
|
276
276
|
R(p)(l.field.addonRight) ? {
|
|
277
277
|
name: "addon-right",
|
|
278
278
|
fn: n(() => [
|
|
279
|
-
l.field.addonRight.type === "select" ? (r(), f(y,
|
|
279
|
+
l.field.addonRight.type === "select" ? (r(), f(y, s({
|
|
280
280
|
key: 0,
|
|
281
281
|
modelValue: l.field.addonRight.name ? l.values[l.field.addonRight.name] : void 0,
|
|
282
282
|
options: l.field.addonRight.options || []
|
|
@@ -292,7 +292,7 @@ const se = /* @__PURE__ */ U({
|
|
|
292
292
|
}, 1024)
|
|
293
293
|
]),
|
|
294
294
|
_: 1
|
|
295
|
-
}, 16, ["modelValue", "options"])) : l.field.addonRight.type === "button" ? (r(), f(v,
|
|
295
|
+
}, 16, ["modelValue", "options"])) : l.field.addonRight.type === "button" ? (r(), f(v, s({
|
|
296
296
|
key: 1,
|
|
297
297
|
variant: "outline"
|
|
298
298
|
}, l.field.addonRight.props || {}, {
|
|
@@ -306,7 +306,7 @@ const se = /* @__PURE__ */ U({
|
|
|
306
306
|
]),
|
|
307
307
|
key: "1"
|
|
308
308
|
} : void 0
|
|
309
|
-
]), 1040)) : (r(), f(B(C.value),
|
|
309
|
+
]), 1040)) : (r(), f(B(C.value), s({
|
|
310
310
|
key: 1,
|
|
311
311
|
class: ["switch", "check"].includes(l.field?.type) ? "" : "w-full"
|
|
312
312
|
}, {
|
|
@@ -316,5 +316,5 @@ const se = /* @__PURE__ */ U({
|
|
|
316
316
|
}
|
|
317
317
|
});
|
|
318
318
|
export {
|
|
319
|
-
|
|
319
|
+
ue as default
|
|
320
320
|
};
|
package/components/Input.vue.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as Y, computed as a, useSlots as Z, ref as b, onMounted as _, nextTick as z, openBlock as d, createElementBlock as u, normalizeClass as r, createBlock as R, withCtx as ee, createTextVNode as $, toDisplayString as w, createCommentVNode as i, createElementVNode as A, renderSlot as T, createVNode as C } from "vue";
|
|
2
2
|
import v from "./Icon.vue.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import te from "./Label.vue.js";
|
|
4
|
+
import le from "./Textarea.vue.js";
|
|
5
5
|
import { $t as E } from "../utils/i18n.js";
|
|
6
|
-
const
|
|
6
|
+
const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "min", "max"], ae = { class: "absolute right-3 top-1/2 -translate-y-1/2 flex items-center justify-center gap-2 z-20" }, fe = /* @__PURE__ */ Y({
|
|
7
7
|
__name: "Input",
|
|
8
8
|
props: {
|
|
9
9
|
modelValue: { default: "" },
|
|
@@ -38,23 +38,23 @@ const oe = ["for"], de = ["type", "value", "placeholder", "disabled", "min", "ma
|
|
|
38
38
|
},
|
|
39
39
|
emits: ["update:modelValue", "focus", "blur", "change", "click:icon", "click:icon-right"],
|
|
40
40
|
setup(t, { emit: D }) {
|
|
41
|
-
const e = t,
|
|
41
|
+
const e = t, c = D, s = a(() => e.labelI18n ? E(e.labelI18n) : e.label), I = a(
|
|
42
42
|
() => e.placeholderI18n ? E(e.placeholderI18n) : e.placeholder
|
|
43
|
-
), g =
|
|
43
|
+
), g = Z(), m = b(null), x = b(!1), y = b(!1), H = a(() => e.type === "password" && x.value ? "text" : e.type), k = a(() => e.modelValue !== "" && e.modelValue !== null && e.modelValue !== void 0), V = a(() => h.value || k.value || y.value), p = a(() => !!e.addonLeft || !!g["addon-left"]), B = a(() => !!e.addonRight || !!g["addon-right"]), U = a(() => [
|
|
44
44
|
"relative w-full",
|
|
45
45
|
e.class,
|
|
46
46
|
e.labelPosition === "left" ? "flex items-center gap-4" : "",
|
|
47
47
|
e.labelPosition === "right" ? "flex flex-row-reverse items-center gap-4" : "space-y-2"
|
|
48
|
-
].join(" ")),
|
|
48
|
+
].join(" ")), W = a(() => ["relative flex w-full items-stretch", e.labelPosition !== "top" ? "flex-1" : ""].join(
|
|
49
49
|
" "
|
|
50
|
-
)),
|
|
50
|
+
)), S = a(() => {
|
|
51
51
|
const l = "block w-full bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground/70 disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none relative focus:z-10", n = {
|
|
52
52
|
solid: "bg-muted border-transparent focus-visible:border-primary",
|
|
53
53
|
outline: "border border-input focus-visible:border-primary",
|
|
54
54
|
"outline-b": "border-b border-input bg-transparent rounded-none focus-visible:border-primary",
|
|
55
55
|
transparent: "border-none bg-transparent shadow-none",
|
|
56
56
|
floating: "border border-input focus-visible:border-primary"
|
|
57
|
-
},
|
|
57
|
+
}, f = {
|
|
58
58
|
sm: "h-7.5 text-xs",
|
|
59
59
|
md: "h-9 text-sm",
|
|
60
60
|
lg: "h-10 text-base"
|
|
@@ -68,27 +68,25 @@ const oe = ["for"], de = ["type", "value", "placeholder", "disabled", "min", "ma
|
|
|
68
68
|
"2xl": "rounded-2xl",
|
|
69
69
|
full: "rounded-full"
|
|
70
70
|
}[e.rounded];
|
|
71
|
-
|
|
72
|
-
const
|
|
73
|
-
return [
|
|
71
|
+
p.value && (e.rounded === "md" ? o = "rounded-r-md rounded-l-none" : e.rounded === "sm" ? o = "rounded-r-sm rounded-l-none" : e.rounded === "lg" ? o = "rounded-r-lg rounded-l-none" : e.rounded === "full" ? o = "rounded-r-full rounded-l-none" : e.rounded !== "none" && (o = o.replace("rounded-", "rounded-r-").replace("rounded-l-", ""))), B.value && (p.value ? o = "rounded-none" : e.rounded === "md" ? o = "rounded-l-md rounded-r-none" : e.rounded === "sm" ? o = "rounded-l-sm rounded-r-none" : e.rounded === "lg" ? o = "rounded-l-lg rounded-r-none" : e.rounded === "full" ? o = "rounded-l-full rounded-r-none" : e.rounded !== "none" && (o = o.replace("rounded-", "rounded-l-").replace("rounded-r-", ""))), e.variant === "outline-b" && (o = "rounded-none");
|
|
72
|
+
const M = e.variant === "outline-b" || e.variant === "transparent";
|
|
73
|
+
return e.variant, [
|
|
74
74
|
l,
|
|
75
75
|
n[e.variant],
|
|
76
|
-
e.type === "textarea" ? "" :
|
|
76
|
+
e.type === "textarea" ? "" : f[e.size],
|
|
77
77
|
o,
|
|
78
78
|
e.error ? "border-destructive focus-visible:ring-destructive" : "",
|
|
79
|
-
e.icon ? "pl-9" :
|
|
80
|
-
|
|
81
|
-
M && e.type === "textarea" ? "pt-3.5" : "",
|
|
82
|
-
e.showClearButton && k.value || e.type === "password" || e.loading || e.iconRight ? "pr-9" : N && !V.value ? "pr-0" : "",
|
|
79
|
+
e.icon ? "pl-9" : M && !p.value ? "pl-0" : "",
|
|
80
|
+
e.showClearButton && k.value || e.type === "password" || e.loading || e.iconRight ? "pr-9" : M && !B.value ? "pr-0" : "",
|
|
83
81
|
// Keyframe name used to detect browser autofill via animationstart event
|
|
84
82
|
e.variant === "floating" ? "autofill-detect" : "",
|
|
85
83
|
e.inputClass
|
|
86
84
|
].join(" ");
|
|
87
|
-
}),
|
|
85
|
+
}), L = {
|
|
88
86
|
sm: "text-xs",
|
|
89
87
|
md: "text-sm",
|
|
90
88
|
lg: "text-base"
|
|
91
|
-
},
|
|
89
|
+
}, P = (l) => {
|
|
92
90
|
const n = l === "left";
|
|
93
91
|
return [
|
|
94
92
|
"[&_button]:w-full [&_a]:w-full! [&_.v-btn]:w-full! [&_.tooltip-trigger]:w-full",
|
|
@@ -97,11 +95,11 @@ const oe = ["for"], de = ["type", "value", "placeholder", "disabled", "min", "ma
|
|
|
97
95
|
n ? "-mr-px" : "-ml-px",
|
|
98
96
|
"z-10"
|
|
99
97
|
].join(" ");
|
|
100
|
-
},
|
|
98
|
+
}, q = a(() => {
|
|
101
99
|
const l = !!g["addon-left"];
|
|
102
100
|
return [
|
|
103
101
|
"flex items-center justify-center whitespace-nowrap",
|
|
104
|
-
l ? `border-none ${
|
|
102
|
+
l ? `border-none ${P("left")}` : `bg-muted border border-input border-r-0! px-3 text-muted-foreground ${{
|
|
105
103
|
sm: "rounded-l-sm",
|
|
106
104
|
md: "rounded-l-md",
|
|
107
105
|
lg: "rounded-l-lg",
|
|
@@ -110,15 +108,15 @@ const oe = ["for"], de = ["type", "value", "placeholder", "disabled", "min", "ma
|
|
|
110
108
|
xl: "rounded-l-xl",
|
|
111
109
|
"2xl": "rounded-l-2xl"
|
|
112
110
|
}[e.rounded] || "rounded-l-md"}`,
|
|
113
|
-
l ? "" :
|
|
111
|
+
l ? "" : L[e.size],
|
|
114
112
|
e.addonLeftClass,
|
|
115
113
|
e.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
116
114
|
].join(" ");
|
|
117
|
-
}),
|
|
115
|
+
}), G = a(() => {
|
|
118
116
|
const l = !!g["addon-right"];
|
|
119
117
|
return [
|
|
120
118
|
"flex items-center justify-center whitespace-nowrap",
|
|
121
|
-
l ? `border-none ${
|
|
119
|
+
l ? `border-none ${P("right")}` : `bg-muted border border-input border-l-0! px-3 text-muted-foreground ${{
|
|
122
120
|
sm: "rounded-r-sm",
|
|
123
121
|
md: "rounded-r-md",
|
|
124
122
|
lg: "rounded-r-lg",
|
|
@@ -127,100 +125,100 @@ const oe = ["for"], de = ["type", "value", "placeholder", "disabled", "min", "ma
|
|
|
127
125
|
xl: "rounded-r-xl",
|
|
128
126
|
"2xl": "rounded-r-2xl"
|
|
129
127
|
}[e.rounded] || "rounded-r-md"}`,
|
|
130
|
-
l ? "" :
|
|
128
|
+
l ? "" : L[e.size],
|
|
131
129
|
e.addonRightClass,
|
|
132
130
|
e.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
133
131
|
].join(" ");
|
|
134
|
-
}),
|
|
132
|
+
}), J = (l) => {
|
|
135
133
|
const n = l.target;
|
|
136
|
-
|
|
137
|
-
},
|
|
134
|
+
c("update:modelValue", n.value);
|
|
135
|
+
}, K = (l) => {
|
|
138
136
|
const n = l.target;
|
|
139
|
-
|
|
140
|
-
},
|
|
137
|
+
c("change", n.value);
|
|
138
|
+
}, O = () => {
|
|
141
139
|
x.value = !x.value;
|
|
142
|
-
},
|
|
143
|
-
|
|
140
|
+
}, Q = () => {
|
|
141
|
+
c("update:modelValue", ""), z(() => {
|
|
144
142
|
m.value?.focus();
|
|
145
143
|
});
|
|
146
|
-
}, h = b(!1),
|
|
147
|
-
h.value = !0,
|
|
148
|
-
},
|
|
149
|
-
h.value = !1,
|
|
150
|
-
},
|
|
151
|
-
l.animationName === "onAutoFillStart" ?
|
|
144
|
+
}, h = b(!1), j = b(!1), F = (l) => {
|
|
145
|
+
h.value = !0, c("focus", l);
|
|
146
|
+
}, N = (l) => {
|
|
147
|
+
h.value = !1, c("blur", l);
|
|
148
|
+
}, X = (l) => {
|
|
149
|
+
l.animationName === "onAutoFillStart" ? y.value = !0 : l.animationName === "onAutoFillCancel" && (y.value = !1);
|
|
152
150
|
};
|
|
153
|
-
return
|
|
154
|
-
e.autofocus &&
|
|
151
|
+
return _(() => {
|
|
152
|
+
e.autofocus && z(() => {
|
|
155
153
|
m.value?.focus();
|
|
156
|
-
}),
|
|
157
|
-
m.value && m.value.value && !e.modelValue && (
|
|
154
|
+
}), z(() => {
|
|
155
|
+
m.value && m.value.value && !e.modelValue && (y.value = !0);
|
|
158
156
|
});
|
|
159
|
-
}), (l, n) => (
|
|
160
|
-
class: r(
|
|
157
|
+
}), (l, n) => (d(), u("div", {
|
|
158
|
+
class: r(U.value)
|
|
161
159
|
}, [
|
|
162
|
-
|
|
160
|
+
s.value && t.variant !== "floating" ? (d(), R(te, {
|
|
163
161
|
key: 0,
|
|
164
|
-
for:
|
|
162
|
+
for: s.value,
|
|
165
163
|
class: r(["mb-1.5", t.labelPosition !== "top" ? "mb-0" : ""].join(" "))
|
|
166
164
|
}, {
|
|
167
|
-
default:
|
|
168
|
-
|
|
165
|
+
default: ee(() => [
|
|
166
|
+
$(w(s.value), 1)
|
|
169
167
|
]),
|
|
170
168
|
_: 1
|
|
171
|
-
}, 8, ["for", "class"])) :
|
|
172
|
-
|
|
173
|
-
class: r(
|
|
169
|
+
}, 8, ["for", "class"])) : i("", !0),
|
|
170
|
+
A("div", {
|
|
171
|
+
class: r(W.value)
|
|
174
172
|
}, [
|
|
175
|
-
|
|
173
|
+
p.value ? (d(), u("div", {
|
|
176
174
|
key: 0,
|
|
177
|
-
class: r(
|
|
175
|
+
class: r(q.value)
|
|
178
176
|
}, [
|
|
179
177
|
T(l.$slots, "addon-left", {}, () => [
|
|
180
|
-
|
|
178
|
+
$(w(t.addonLeft), 1)
|
|
181
179
|
])
|
|
182
|
-
], 2)) :
|
|
183
|
-
|
|
180
|
+
], 2)) : i("", !0),
|
|
181
|
+
A("div", {
|
|
184
182
|
class: "relative w-full",
|
|
185
|
-
onMouseenter: n[2] || (n[2] = (
|
|
186
|
-
onMouseleave: n[3] || (n[3] = (
|
|
183
|
+
onMouseenter: n[2] || (n[2] = (f) => j.value = !0),
|
|
184
|
+
onMouseleave: n[3] || (n[3] = (f) => j.value = !1)
|
|
187
185
|
}, [
|
|
188
|
-
|
|
186
|
+
s.value && t.variant === "floating" ? (d(), u("label", {
|
|
189
187
|
key: 0,
|
|
190
|
-
for:
|
|
188
|
+
for: s.value,
|
|
191
189
|
class: r([
|
|
192
190
|
"absolute transition-all duration-200 ease-in-out pointer-events-none z-20",
|
|
193
|
-
|
|
191
|
+
V.value ? "-top-2.5 left-3 text-xs bg-background px-1 text-primary shadow-[0_4px_4px_-4px_bg-background] translate-y-0" : t.type === "textarea" ? `top-2 text-sm text-muted-foreground/70 ${t.icon ? "left-9" : "left-3"} translate-y-0` : `top-1/2 -translate-y-1/2 text-sm text-muted-foreground/70 ${t.icon ? "left-9" : "left-3"}`
|
|
194
192
|
])
|
|
195
|
-
}, w(
|
|
196
|
-
t.type === "textarea" ? (
|
|
193
|
+
}, w(s.value), 11, ne)) : i("", !0),
|
|
194
|
+
t.type === "textarea" ? (d(), R(le, {
|
|
197
195
|
key: 1,
|
|
198
196
|
"model-value": String(t.modelValue),
|
|
199
|
-
placeholder:
|
|
197
|
+
placeholder: t.variant === "floating" && s.value && !V.value ? "" : I.value,
|
|
200
198
|
disabled: t.disabled,
|
|
201
199
|
rows: t.rows,
|
|
202
|
-
class: r(
|
|
203
|
-
"onUpdate:modelValue": n[0] || (n[0] = (
|
|
204
|
-
onBlur:
|
|
200
|
+
class: r(S.value),
|
|
201
|
+
"onUpdate:modelValue": n[0] || (n[0] = (f) => c("update:modelValue", f)),
|
|
202
|
+
onBlur: N,
|
|
205
203
|
onFocus: F
|
|
206
|
-
}, null, 8, ["model-value", "placeholder", "disabled", "rows", "class"])) : (
|
|
204
|
+
}, null, 8, ["model-value", "placeholder", "disabled", "rows", "class"])) : (d(), u("input", {
|
|
207
205
|
key: 2,
|
|
208
206
|
ref_key: "inputRef",
|
|
209
207
|
ref: m,
|
|
210
208
|
type: H.value,
|
|
211
209
|
value: t.modelValue,
|
|
212
|
-
placeholder:
|
|
210
|
+
placeholder: t.variant === "floating" && s.value && !V.value ? "" : I.value,
|
|
213
211
|
disabled: t.disabled,
|
|
214
212
|
min: t.min,
|
|
215
213
|
max: t.max,
|
|
216
|
-
class: r(
|
|
217
|
-
onInput:
|
|
218
|
-
onChange:
|
|
219
|
-
onBlur:
|
|
214
|
+
class: r(S.value),
|
|
215
|
+
onInput: J,
|
|
216
|
+
onChange: K,
|
|
217
|
+
onBlur: N,
|
|
220
218
|
onFocus: F,
|
|
221
|
-
onAnimationstart:
|
|
222
|
-
}, null, 42,
|
|
223
|
-
t.icon ? (
|
|
219
|
+
onAnimationstart: X
|
|
220
|
+
}, null, 42, oe)),
|
|
221
|
+
t.icon ? (d(), u("div", {
|
|
224
222
|
key: 3,
|
|
225
223
|
tabindex: "-1",
|
|
226
224
|
class: r([
|
|
@@ -232,64 +230,64 @@ const oe = ["for"], de = ["type", "value", "placeholder", "disabled", "min", "ma
|
|
|
232
230
|
icon: t.icon,
|
|
233
231
|
class: r(["h-4 w-4", t.iconClass])
|
|
234
232
|
}, null, 8, ["icon", "class"])
|
|
235
|
-
], 2)) :
|
|
236
|
-
|
|
237
|
-
t.loading ? (
|
|
233
|
+
], 2)) : i("", !0),
|
|
234
|
+
A("div", ae, [
|
|
235
|
+
t.loading ? (d(), R(v, {
|
|
238
236
|
key: 0,
|
|
239
237
|
icon: "lucide:loader-2",
|
|
240
238
|
class: "h-4 w-4 animate-spin text-muted-foreground"
|
|
241
|
-
})) : t.iconRight ? (
|
|
239
|
+
})) : t.iconRight ? (d(), u("div", {
|
|
242
240
|
key: 1,
|
|
243
241
|
tabindex: "-1",
|
|
244
242
|
class: r([
|
|
245
243
|
"flex items-center justify-center text-muted-foreground",
|
|
246
244
|
t.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:text-foreground"
|
|
247
245
|
]),
|
|
248
|
-
onClick: n[1] || (n[1] = (
|
|
246
|
+
onClick: n[1] || (n[1] = (f) => !t.disabled && c("click:icon-right", f))
|
|
249
247
|
}, [
|
|
250
248
|
C(v, {
|
|
251
249
|
icon: t.iconRight,
|
|
252
250
|
class: r(["h-4 w-4", t.iconRightClass])
|
|
253
251
|
}, null, 8, ["icon", "class"])
|
|
254
|
-
], 2)) :
|
|
255
|
-
t.type === "password" && !t.disabled ? (
|
|
252
|
+
], 2)) : i("", !0),
|
|
253
|
+
t.type === "password" && !t.disabled ? (d(), u("button", {
|
|
256
254
|
key: 2,
|
|
257
255
|
type: "button",
|
|
258
256
|
tabindex: "-1",
|
|
259
257
|
class: "flex items-center justify-center text-muted-foreground hover:text-foreground focus:outline-none",
|
|
260
|
-
onClick:
|
|
258
|
+
onClick: O
|
|
261
259
|
}, [
|
|
262
260
|
C(v, {
|
|
263
261
|
icon: x.value ? "lucide:eye-off" : "lucide:eye",
|
|
264
262
|
class: "h-4 w-4"
|
|
265
263
|
}, null, 8, ["icon"])
|
|
266
|
-
])) :
|
|
267
|
-
t.showClearButton && k.value && !t.disabled && !t.loading && t.type !== "textarea" && t.type !== "password" && (h.value ||
|
|
264
|
+
])) : i("", !0),
|
|
265
|
+
t.showClearButton && k.value && !t.disabled && !t.loading && t.type !== "textarea" && t.type !== "password" && (h.value || j.value) ? (d(), u("button", {
|
|
268
266
|
key: 3,
|
|
269
267
|
type: "button",
|
|
270
268
|
tabindex: "-1",
|
|
271
269
|
class: "flex items-center justify-center text-muted-foreground hover:text-foreground focus:outline-none transition-opacity duration-200",
|
|
272
|
-
onClick:
|
|
270
|
+
onClick: Q
|
|
273
271
|
}, [
|
|
274
272
|
C(v, {
|
|
275
273
|
icon: "lucide:x-circle",
|
|
276
274
|
class: "h-4 w-4"
|
|
277
275
|
})
|
|
278
|
-
])) :
|
|
276
|
+
])) : i("", !0)
|
|
279
277
|
])
|
|
280
278
|
], 32),
|
|
281
|
-
|
|
279
|
+
B.value ? (d(), u("div", {
|
|
282
280
|
key: 1,
|
|
283
|
-
class: r(
|
|
281
|
+
class: r(G.value)
|
|
284
282
|
}, [
|
|
285
283
|
T(l.$slots, "addon-right", {}, () => [
|
|
286
|
-
|
|
284
|
+
$(w(t.addonRight), 1)
|
|
287
285
|
])
|
|
288
|
-
], 2)) :
|
|
286
|
+
], 2)) : i("", !0)
|
|
289
287
|
], 2)
|
|
290
288
|
], 2));
|
|
291
289
|
}
|
|
292
290
|
});
|
|
293
291
|
export {
|
|
294
|
-
|
|
292
|
+
fe as default
|
|
295
293
|
};
|
package/package.json
CHANGED
package/style.css
CHANGED
|
@@ -333,8 +333,8 @@
|
|
|
333
333
|
--date-picker-border: var(--color-border) !important;
|
|
334
334
|
--date-picker-radius: var(--radius) !important;
|
|
335
335
|
|
|
336
|
-
--color-success-subtle: #
|
|
337
|
-
--color-success-subtle-fg: #
|
|
336
|
+
--color-success-subtle: #ECF8EB;
|
|
337
|
+
--color-success-subtle-fg: #216e39;
|
|
338
338
|
--color-success-subtle-border: #b7e1c1;
|
|
339
339
|
|
|
340
340
|
--color-info-subtle: #e8f0fe;
|
|
File without changes
|