@soft-stech/bootsman-ui-shadcn 1.3.11 → 1.3.12
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/ui/auto-form/BuiAutoFormFieldBoolean.vue.d.ts +1 -1
- package/dist/components/ui/auto-form/BuiAutoFormFieldDate.vue.d.ts +1 -1
- package/dist/components/ui/auto-form/BuiAutoFormFieldEnum.vue.d.ts +1 -1
- package/dist/components/ui/auto-form/BuiAutoFormFieldFile.vue.d.ts +1 -1
- package/dist/components/ui/auto-form/BuiAutoFormFieldInput.vue.d.ts +1 -1
- package/dist/components/ui/auto-form/BuiAutoFormFieldNumber.vue.d.ts +1 -1
- package/dist/components/ui/input/index.js +47 -38
- package/package.json +1 -1
- package/src/components/ui/input/BuiInput.vue +25 -2
@@ -9,11 +9,11 @@ declare function __VLS_template(): {
|
|
9
9
|
errors: string[];
|
10
10
|
errorMessage: string | undefined;
|
11
11
|
handleInput: import('vee-validate').FieldContext["handleChange"];
|
12
|
+
handleBlur: (e?: Event, shouldValidate?: boolean) => void;
|
12
13
|
resetField: (state?: Partial<import('vee-validate').FieldState<unknown>> | undefined) => void;
|
13
14
|
handleReset: () => void;
|
14
15
|
validate: import('vee-validate').FieldValidator<unknown>;
|
15
16
|
handleChange: (e: Event | unknown, shouldValidate?: boolean) => void;
|
16
|
-
handleBlur: (e?: Event, shouldValidate?: boolean) => void;
|
17
17
|
setTouched: (isTouched: boolean) => void;
|
18
18
|
setErrors: (message: string | string[]) => void;
|
19
19
|
setValue: (value: unknown, shouldValidate?: boolean) => void;
|
@@ -9,11 +9,11 @@ declare function __VLS_template(): {
|
|
9
9
|
errors: string[];
|
10
10
|
errorMessage: string | undefined;
|
11
11
|
handleInput: import('vee-validate').FieldContext["handleChange"];
|
12
|
+
handleBlur: (e?: Event, shouldValidate?: boolean) => void;
|
12
13
|
resetField: (state?: Partial<import('vee-validate').FieldState<unknown>> | undefined) => void;
|
13
14
|
handleReset: () => void;
|
14
15
|
validate: import('vee-validate').FieldValidator<unknown>;
|
15
16
|
handleChange: (e: Event | unknown, shouldValidate?: boolean) => void;
|
16
|
-
handleBlur: (e?: Event, shouldValidate?: boolean) => void;
|
17
17
|
setTouched: (isTouched: boolean) => void;
|
18
18
|
setErrors: (message: string | string[]) => void;
|
19
19
|
setValue: (value: unknown, shouldValidate?: boolean) => void;
|
@@ -9,11 +9,11 @@ declare function __VLS_template(): {
|
|
9
9
|
errors: string[];
|
10
10
|
errorMessage: string | undefined;
|
11
11
|
handleInput: import('vee-validate').FieldContext["handleChange"];
|
12
|
+
handleBlur: (e?: Event, shouldValidate?: boolean) => void;
|
12
13
|
resetField: (state?: Partial<import('vee-validate').FieldState<unknown>> | undefined) => void;
|
13
14
|
handleReset: () => void;
|
14
15
|
validate: import('vee-validate').FieldValidator<unknown>;
|
15
16
|
handleChange: (e: Event | unknown, shouldValidate?: boolean) => void;
|
16
|
-
handleBlur: (e?: Event, shouldValidate?: boolean) => void;
|
17
17
|
setTouched: (isTouched: boolean) => void;
|
18
18
|
setErrors: (message: string | string[]) => void;
|
19
19
|
setValue: (value: unknown, shouldValidate?: boolean) => void;
|
@@ -9,11 +9,11 @@ declare function __VLS_template(): {
|
|
9
9
|
errors: string[];
|
10
10
|
errorMessage: string | undefined;
|
11
11
|
handleInput: import('vee-validate').FieldContext["handleChange"];
|
12
|
+
handleBlur: (e?: Event, shouldValidate?: boolean) => void;
|
12
13
|
resetField: (state?: Partial<import('vee-validate').FieldState<unknown>> | undefined) => void;
|
13
14
|
handleReset: () => void;
|
14
15
|
validate: import('vee-validate').FieldValidator<unknown>;
|
15
16
|
handleChange: (e: Event | unknown, shouldValidate?: boolean) => void;
|
16
|
-
handleBlur: (e?: Event, shouldValidate?: boolean) => void;
|
17
17
|
setTouched: (isTouched: boolean) => void;
|
18
18
|
setErrors: (message: string | string[]) => void;
|
19
19
|
setValue: (value: unknown, shouldValidate?: boolean) => void;
|
@@ -9,11 +9,11 @@ declare function __VLS_template(): {
|
|
9
9
|
errors: string[];
|
10
10
|
errorMessage: string | undefined;
|
11
11
|
handleInput: import('vee-validate').FieldContext["handleChange"];
|
12
|
+
handleBlur: (e?: Event, shouldValidate?: boolean) => void;
|
12
13
|
resetField: (state?: Partial<import('vee-validate').FieldState<unknown>> | undefined) => void;
|
13
14
|
handleReset: () => void;
|
14
15
|
validate: import('vee-validate').FieldValidator<unknown>;
|
15
16
|
handleChange: (e: Event | unknown, shouldValidate?: boolean) => void;
|
16
|
-
handleBlur: (e?: Event, shouldValidate?: boolean) => void;
|
17
17
|
setTouched: (isTouched: boolean) => void;
|
18
18
|
setErrors: (message: string | string[]) => void;
|
19
19
|
setValue: (value: unknown, shouldValidate?: boolean) => void;
|
@@ -9,11 +9,11 @@ declare function __VLS_template(): {
|
|
9
9
|
errors: string[];
|
10
10
|
errorMessage: string | undefined;
|
11
11
|
handleInput: import('vee-validate').FieldContext["handleChange"];
|
12
|
+
handleBlur: (e?: Event, shouldValidate?: boolean) => void;
|
12
13
|
resetField: (state?: Partial<import('vee-validate').FieldState<unknown>> | undefined) => void;
|
13
14
|
handleReset: () => void;
|
14
15
|
validate: import('vee-validate').FieldValidator<unknown>;
|
15
16
|
handleChange: (e: Event | unknown, shouldValidate?: boolean) => void;
|
16
|
-
handleBlur: (e?: Event, shouldValidate?: boolean) => void;
|
17
17
|
setTouched: (isTouched: boolean) => void;
|
18
18
|
setErrors: (message: string | string[]) => void;
|
19
19
|
setValue: (value: unknown, shouldValidate?: boolean) => void;
|
@@ -1,14 +1,14 @@
|
|
1
|
-
import { d as
|
2
|
-
import { defineComponent as
|
3
|
-
import { useVModel as
|
4
|
-
import { BuiBadge as
|
1
|
+
import { d as m, c as y, a as B } from "../../../utils-D2UeooB9.js";
|
2
|
+
import { defineComponent as c, ref as d, withDirectives as V, openBlock as s, createElementBlock as p, isRef as x, normalizeClass as E, unref as t, vModelText as I, createVNode as v, mergeProps as g, createElementVNode as M, createBlock as u, withCtx as $, createTextVNode as C, toDisplayString as N, createCommentVNode as P } from "vue";
|
3
|
+
import { useVModel as j, useElementBounding as A } from "@vueuse/core";
|
4
|
+
import { BuiBadge as D } from "../badge/index.js";
|
5
5
|
/**
|
6
6
|
* @license lucide-vue-next v0.441.0 - ISC
|
7
7
|
*
|
8
8
|
* This source code is licensed under the ISC license.
|
9
9
|
* See the LICENSE file in the root directory of this source tree.
|
10
10
|
*/
|
11
|
-
const
|
11
|
+
const F = m("EyeOffIcon", [
|
12
12
|
[
|
13
13
|
"path",
|
14
14
|
{
|
@@ -32,7 +32,7 @@ const P = p("EyeOffIcon", [
|
|
32
32
|
* This source code is licensed under the ISC license.
|
33
33
|
* See the LICENSE file in the root directory of this source tree.
|
34
34
|
*/
|
35
|
-
const
|
35
|
+
const R = m("EyeIcon", [
|
36
36
|
[
|
37
37
|
"path",
|
38
38
|
{
|
@@ -41,7 +41,7 @@ const j = p("EyeIcon", [
|
|
41
41
|
}
|
42
42
|
],
|
43
43
|
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
|
44
|
-
]),
|
44
|
+
]), h = /* @__PURE__ */ c({
|
45
45
|
__name: "BuiInput",
|
46
46
|
props: {
|
47
47
|
defaultValue: {},
|
@@ -51,73 +51,82 @@ const j = p("EyeIcon", [
|
|
51
51
|
},
|
52
52
|
emits: ["update:modelValue"],
|
53
53
|
setup(r, { emit: o }) {
|
54
|
-
const e = r, a =
|
54
|
+
const e = r, a = j(e, "modelValue", o, {
|
55
55
|
passive: !0,
|
56
56
|
defaultValue: e.defaultValue
|
57
|
-
})
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
},
|
62
|
-
|
57
|
+
}), n = d(!1), b = () => {
|
58
|
+
n.value = !0;
|
59
|
+
}, _ = () => {
|
60
|
+
n.value = !1;
|
61
|
+
}, k = (l) => {
|
62
|
+
(l.key === "Home" || l.key === "End") && n.value && l.stopPropagation();
|
63
|
+
};
|
64
|
+
return (l, f) => V((s(), p("input", {
|
65
|
+
"onUpdate:modelValue": f[0] || (f[0] = (w) => x(a) ? a.value = w : null),
|
66
|
+
class: E(t(y)(t(S)({ variant: l.variant }), e.class ?? "")),
|
67
|
+
onFocus: b,
|
68
|
+
onBlur: _,
|
69
|
+
onKeydown: k
|
70
|
+
}, null, 34)), [
|
71
|
+
[I, t(a)]
|
63
72
|
]);
|
64
73
|
}
|
65
|
-
}),
|
74
|
+
}), z = { class: "relative flex" }, L = /* @__PURE__ */ c({
|
66
75
|
inheritAttrs: !1,
|
67
76
|
__name: "BuiPasswordInput",
|
68
77
|
props: {
|
69
78
|
defaultValue: {}
|
70
79
|
},
|
71
80
|
setup(r) {
|
72
|
-
const e =
|
73
|
-
function
|
81
|
+
const e = d(r.defaultValue ?? "password");
|
82
|
+
function i() {
|
74
83
|
e.value === "password" ? e.value = "text" : e.value = "password";
|
75
84
|
}
|
76
|
-
return (a,
|
77
|
-
v(t(
|
85
|
+
return (a, n) => (s(), p("div", z, [
|
86
|
+
v(t(h), g(a.$attrs, {
|
78
87
|
type: e.value,
|
79
|
-
class: t(
|
88
|
+
class: t(y)(a.$attrs.class ?? "", "pr-8")
|
80
89
|
}), null, 16, ["type", "class"]),
|
81
|
-
|
82
|
-
onClick:
|
90
|
+
M("span", {
|
91
|
+
onClick: i,
|
83
92
|
class: "absolute right-3 top-0 flex h-full items-center justify-center"
|
84
93
|
}, [
|
85
|
-
e.value === "password" ? (s(),
|
94
|
+
e.value === "password" ? (s(), u(t(R), {
|
86
95
|
key: 0,
|
87
96
|
class: "h-4 w-4 cursor-pointer opacity-[0.56] hover:opacity-100"
|
88
|
-
})) : (s(),
|
97
|
+
})) : (s(), u(t(F), {
|
89
98
|
key: 1,
|
90
99
|
class: "h-4 w-4 cursor-pointer opacity-[0.56] hover:opacity-100"
|
91
100
|
}))
|
92
101
|
])
|
93
102
|
]));
|
94
103
|
}
|
95
|
-
}),
|
104
|
+
}), K = { class: "relative flex" }, O = 16, q = /* @__PURE__ */ c({
|
96
105
|
inheritAttrs: !1,
|
97
106
|
__name: "BuiBadgedInput",
|
98
107
|
props: {
|
99
108
|
badge: {}
|
100
109
|
},
|
101
110
|
setup(r) {
|
102
|
-
const o = r, e =
|
103
|
-
return (a,
|
104
|
-
v(t(
|
105
|
-
style: { paddingRight: t(
|
111
|
+
const o = r, e = d(null), { width: i } = A(e);
|
112
|
+
return (a, n) => (s(), p("div", K, [
|
113
|
+
v(t(h), g(a.$attrs, {
|
114
|
+
style: { paddingRight: t(i) + O + "px" }
|
106
115
|
}), null, 16, ["style"]),
|
107
|
-
o.badge ? (s(),
|
116
|
+
o.badge ? (s(), u(t(D), {
|
108
117
|
key: 0,
|
109
118
|
ref_key: "badgeEl",
|
110
119
|
ref: e,
|
111
120
|
class: "absolute right-3 top-1.5 flex items-center justify-center rounded-sm hover:bg-primary/[0.08] dark:hover:bg-primary/30"
|
112
121
|
}, {
|
113
|
-
default:
|
114
|
-
|
122
|
+
default: $(() => [
|
123
|
+
C(N(o.badge), 1)
|
115
124
|
]),
|
116
125
|
_: 1
|
117
|
-
}, 512)) :
|
126
|
+
}, 512)) : P("", !0)
|
118
127
|
]));
|
119
128
|
}
|
120
|
-
}),
|
129
|
+
}), S = B(
|
121
130
|
"flex h-10 w-full rounded bg-background border 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 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-30 dark:disabled:opacity-55 aria-[invalid=true]:border-destructive-foreground",
|
122
131
|
{
|
123
132
|
variants: {
|
@@ -133,8 +142,8 @@ const j = p("EyeIcon", [
|
|
133
142
|
}
|
134
143
|
);
|
135
144
|
export {
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
145
|
+
q as BuiBadgedInput,
|
146
|
+
h as BuiInput,
|
147
|
+
L as BuiPasswordInput,
|
148
|
+
S as inputVariants
|
140
149
|
};
|
package/package.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
<script setup lang="ts">
|
2
|
-
import type
|
2
|
+
import { ref, type HTMLAttributes } from 'vue'
|
3
3
|
import { useVModel } from '@vueuse/core'
|
4
4
|
import { cn } from '@/lib/utils'
|
5
5
|
import { inputVariants } from '.'
|
@@ -19,8 +19,31 @@ const modelValue = useVModel(props, 'modelValue', emits, {
|
|
19
19
|
passive: true,
|
20
20
|
defaultValue: props.defaultValue
|
21
21
|
})
|
22
|
+
|
23
|
+
const isFocused = ref<Boolean>(false)
|
24
|
+
|
25
|
+
const handleFocus = () => {
|
26
|
+
isFocused.value = true
|
27
|
+
}
|
28
|
+
const handleBlur = () => {
|
29
|
+
isFocused.value = false
|
30
|
+
}
|
31
|
+
|
32
|
+
const handleKeyDown = (e: KeyboardEvent) => {
|
33
|
+
if(e.key === 'Home' || e.key === 'End') {
|
34
|
+
if(isFocused.value) {
|
35
|
+
e.stopPropagation();
|
36
|
+
}
|
37
|
+
}
|
38
|
+
}
|
22
39
|
</script>
|
23
40
|
|
24
41
|
<template>
|
25
|
-
<input
|
42
|
+
<input
|
43
|
+
v-model="modelValue"
|
44
|
+
:class="cn(inputVariants({ variant }), props.class ?? '')"
|
45
|
+
@focus="handleFocus"
|
46
|
+
@blur="handleBlur"
|
47
|
+
@keydown="handleKeyDown"
|
48
|
+
/>
|
26
49
|
</template>
|