@soft-stech/bootsman-ui-shadcn 2.0.37 → 2.0.39
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/{BuiAccordionTrigger.vue_vue_type_script_setup_true_lang-DDDv2wmp.js → BuiAccordionTrigger.vue_vue_type_script_setup_true_lang-YVELnYkR.js} +1 -1
- package/dist/BuiAdvancedAccordionTrigger.vue_vue_type_script_setup_true_lang-BjV8LPs_.js +79 -0
- package/dist/BuiTagsInputInput.vue_vue_type_script_setup_true_lang-Bqtyl-jn.js +143 -0
- package/dist/BuiTagsInputItem.vue_vue_type_script_setup_true_lang-D9Eyso9v.js +32 -0
- package/dist/BuiTagsInputItemDelete.vue_vue_type_script_setup_true_lang-BQrvxRQ_.js +81 -0
- package/dist/BuiTagsInputItemText.vue_vue_type_script_setup_true_lang-7mNXn8EF.js +46 -0
- package/dist/TagsInputItem-BO1sG5J9.js +63 -0
- package/dist/TagsInputRoot-BMN3YdoO.js +214 -0
- package/dist/components/accordion/BuiAccordionTrigger.js +1 -1
- package/dist/components/accordion/BuiAdvancedAccordionTrigger.js +1 -1
- package/dist/components/accordion/index.js +2 -2
- package/dist/components/tagsInput/BuiTagsInput.js +4 -0
- package/dist/components/tagsInput/BuiTagsInput.vue.d.ts +39 -0
- package/dist/components/tagsInput/BuiTagsInputInput.js +4 -0
- package/dist/components/tagsInput/BuiTagsInputInput.vue.d.ts +7 -0
- package/dist/components/tagsInput/BuiTagsInputItem.js +4 -0
- package/dist/components/tagsInput/BuiTagsInputItem.vue.d.ts +22 -0
- package/dist/components/tagsInput/BuiTagsInputItemDelete.js +4 -0
- package/dist/components/tagsInput/BuiTagsInputItemDelete.vue.d.ts +23 -0
- package/dist/components/tagsInput/BuiTagsInputItemText.js +4 -0
- package/dist/components/tagsInput/BuiTagsInputItemText.vue.d.ts +7 -0
- package/dist/components/tagsInput/index.d.ts +8 -0
- package/dist/components/tagsInput/index.js +75 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +173 -162
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/accordion/BuiAccordionTrigger.vue +1 -1
- package/src/components/accordion/BuiAdvancedAccordionTrigger.vue +1 -2
- package/src/components/tagsInput/BuiTagsInput.vue +41 -0
- package/src/components/tagsInput/BuiTagsInputInput.vue +25 -0
- package/src/components/tagsInput/BuiTagsInputItem.vue +28 -0
- package/src/components/tagsInput/BuiTagsInputItemDelete.vue +37 -0
- package/src/components/tagsInput/BuiTagsInputItemText.vue +20 -0
- package/src/components/tagsInput/index.ts +24 -0
- package/src/index.ts +1 -0
- package/src/stories/BuiTagsInput.stories.ts +62 -0
- package/dist/BuiAdvancedAccordionTrigger.vue_vue_type_script_setup_true_lang-DrPhNZKG.js +0 -77
|
@@ -18,7 +18,7 @@ const k = { class: "flex w-full items-center justify-between gap-2" }, y = { cla
|
|
|
18
18
|
return r;
|
|
19
19
|
});
|
|
20
20
|
return (e, r) => (a(), u(t(_), {
|
|
21
|
-
class: "border-border/16 bg-foreground/4 hover:[&:not([data-disabled])]:bg-foreground/8 dark:hover:[&:not([data-disabled])]:bg-accent/16 flex min-h-12 items-center px-2 py-1 data-[state=closed]:rounded-sm data-[state=open]:rounded-t-sm data-[state=open]:border-b",
|
|
21
|
+
class: "border-border/16 bg-foreground/4 hover:[&:not([data-disabled])]:bg-foreground/8 dark:hover:[&:not([data-disabled])]:bg-accent/16 relative flex min-h-12 items-center px-2 py-1 data-[state=closed]:rounded-sm data-[state=open]:rounded-t-sm data-[state=open]:border-b",
|
|
22
22
|
as: "div"
|
|
23
23
|
}, {
|
|
24
24
|
default: n(() => [
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { defineComponent as f, createBlock as m, openBlock as i, unref as s, normalizeClass as r, withCtx as l, createElementVNode as n, createVNode as d, renderSlot as a, createElementBlock as p, createCommentVNode as g } from "vue";
|
|
2
|
+
import { g as t } from "./utils-CWz5p1Mv.js";
|
|
3
|
+
import { A as u, a as C } from "./AccordionTrigger-CLOdW74d.js";
|
|
4
|
+
import { C as b } from "./chevron-down-CNPbIKfA.js";
|
|
5
|
+
const v = { class: "flex w-full items-center justify-between gap-2" }, x = { class: "flex flex-col items-start text-start" }, A = /* @__PURE__ */ f({
|
|
6
|
+
__name: "BuiAdvancedAccordionTrigger",
|
|
7
|
+
props: {
|
|
8
|
+
asChild: { type: Boolean },
|
|
9
|
+
as: {},
|
|
10
|
+
class: {},
|
|
11
|
+
borderColorClass: {},
|
|
12
|
+
bgColorClass: {},
|
|
13
|
+
hoverColorClass: {},
|
|
14
|
+
iconBgClass: {},
|
|
15
|
+
descriptionColorClass: {},
|
|
16
|
+
isIconHidden: { type: Boolean },
|
|
17
|
+
isDisabledAsNormal: { type: Boolean }
|
|
18
|
+
},
|
|
19
|
+
setup(c) {
|
|
20
|
+
const e = c;
|
|
21
|
+
return (o, h) => (i(), m(s(u), {
|
|
22
|
+
class: r(
|
|
23
|
+
s(t)(
|
|
24
|
+
"border-border/16 bg-foreground/4 relative flex min-h-12 items-center px-2 py-1 data-[state=closed]:rounded-sm data-[state=open]:rounded-t-sm data-[state=open]:border-b",
|
|
25
|
+
e.borderColorClass ?? "",
|
|
26
|
+
e.bgColorClass ?? "",
|
|
27
|
+
e.hoverColorClass ?? ""
|
|
28
|
+
)
|
|
29
|
+
),
|
|
30
|
+
as: "div"
|
|
31
|
+
}, {
|
|
32
|
+
default: l(() => [
|
|
33
|
+
n("div", v, [
|
|
34
|
+
d(s(C), {
|
|
35
|
+
class: r(
|
|
36
|
+
s(t)(
|
|
37
|
+
"text-foreground ring-offset-background focus-visible:ring-ring relative flex flex-1 items-center gap-2 rounded-sm align-middle text-base leading-6 font-semibold transition-all focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-30 [&[data-state=open]>svg]:rotate-180",
|
|
38
|
+
e.class,
|
|
39
|
+
e.isDisabledAsNormal ? "disabled:opacity-100" : ""
|
|
40
|
+
)
|
|
41
|
+
)
|
|
42
|
+
}, {
|
|
43
|
+
default: l(() => [
|
|
44
|
+
d(s(b), {
|
|
45
|
+
class: r(
|
|
46
|
+
s(t)(
|
|
47
|
+
"bg-primary/[0.56] dark:bg-primary text-primary-foreground h-4 w-4 shrink-0 rounded-sm transition-transform duration-200",
|
|
48
|
+
e.iconBgClass ? `${e.iconBgClass} dark:${e.iconBgClass}` : "",
|
|
49
|
+
e.isIconHidden ? "invisible" : "visible"
|
|
50
|
+
)
|
|
51
|
+
)
|
|
52
|
+
}, null, 8, ["class"]),
|
|
53
|
+
n("div", x, [
|
|
54
|
+
a(o.$slots, "default"),
|
|
55
|
+
o.$slots.description ? (i(), p("p", {
|
|
56
|
+
key: 0,
|
|
57
|
+
class: r(
|
|
58
|
+
s(t)(
|
|
59
|
+
"text-foreground/56 text-xs leading-4 font-normal",
|
|
60
|
+
e.descriptionColorClass ?? ""
|
|
61
|
+
)
|
|
62
|
+
)
|
|
63
|
+
}, [
|
|
64
|
+
a(o.$slots, "description")
|
|
65
|
+
], 2)) : g("", !0)
|
|
66
|
+
])
|
|
67
|
+
]),
|
|
68
|
+
_: 3
|
|
69
|
+
}, 8, ["class"]),
|
|
70
|
+
a(o.$slots, "actions")
|
|
71
|
+
])
|
|
72
|
+
]),
|
|
73
|
+
_: 3
|
|
74
|
+
}, 8, ["class"]));
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
export {
|
|
78
|
+
A as _
|
|
79
|
+
};
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { defineComponent as h, ref as b, onMounted as A, createBlock as g, openBlock as I, unref as o, withKeys as m, withCtx as P, renderSlot as B, nextTick as v, mergeProps as T } from "vue";
|
|
2
|
+
import { reactiveOmit as D } from "@vueuse/core";
|
|
3
|
+
import { u as E } from "./useForwardProps-COe1clk4.js";
|
|
4
|
+
import { u as V } from "./useForwardExpose-DmyWSR4F.js";
|
|
5
|
+
import { P as q } from "./Primitive-EBuBc72_.js";
|
|
6
|
+
import { i as F } from "./TagsInputRoot-BMN3YdoO.js";
|
|
7
|
+
import { g as K } from "./utils-CWz5p1Mv.js";
|
|
8
|
+
var O = /* @__PURE__ */ h({
|
|
9
|
+
__name: "TagsInputInput",
|
|
10
|
+
props: {
|
|
11
|
+
placeholder: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: !1
|
|
14
|
+
},
|
|
15
|
+
autoFocus: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
required: !1
|
|
18
|
+
},
|
|
19
|
+
maxLength: {
|
|
20
|
+
type: Number,
|
|
21
|
+
required: !1
|
|
22
|
+
},
|
|
23
|
+
asChild: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
required: !1
|
|
26
|
+
},
|
|
27
|
+
as: {
|
|
28
|
+
type: null,
|
|
29
|
+
required: !1,
|
|
30
|
+
default: "input"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
setup(s) {
|
|
34
|
+
const r = s, t = F(), { forwardRef: i, currentElement: u } = V();
|
|
35
|
+
function p(e) {
|
|
36
|
+
if (t.selectedElement.value = void 0, !t.addOnBlur.value) return;
|
|
37
|
+
const a = e.target;
|
|
38
|
+
if (!a.value) return;
|
|
39
|
+
t.onAddValue(a.value) && (a.value = "");
|
|
40
|
+
}
|
|
41
|
+
function y(e) {
|
|
42
|
+
t.addOnTab.value && c(e);
|
|
43
|
+
}
|
|
44
|
+
const d = b(!1);
|
|
45
|
+
function _() {
|
|
46
|
+
d.value = !0;
|
|
47
|
+
}
|
|
48
|
+
function x() {
|
|
49
|
+
v(() => {
|
|
50
|
+
d.value = !1;
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
async function c(e) {
|
|
54
|
+
if (d.value || (await v(), e.defaultPrevented)) return;
|
|
55
|
+
const a = e.target;
|
|
56
|
+
if (!a.value) return;
|
|
57
|
+
t.onAddValue(a.value) && (a.value = ""), e.preventDefault();
|
|
58
|
+
}
|
|
59
|
+
function w(e) {
|
|
60
|
+
if (t.isInvalidInput.value = !1, e.data === null) return;
|
|
61
|
+
const a = t.delimiter.value;
|
|
62
|
+
if (a === e.data || a instanceof RegExp && a.test(e.data)) {
|
|
63
|
+
const l = e.target;
|
|
64
|
+
l.value = l.value.replace(a, ""), t.onAddValue(l.value) && (l.value = "");
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function C(e) {
|
|
68
|
+
if (t.addOnPaste.value) {
|
|
69
|
+
e.preventDefault();
|
|
70
|
+
const a = e.clipboardData;
|
|
71
|
+
if (!a) return;
|
|
72
|
+
const n = a.getData("text");
|
|
73
|
+
t.delimiter.value ? n.split(t.delimiter.value).forEach((f) => {
|
|
74
|
+
t.onAddValue(f);
|
|
75
|
+
}) : t.onAddValue(n);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return A(() => {
|
|
79
|
+
const e = u.value.nodeName === "INPUT" ? u.value : u.value.querySelector("input");
|
|
80
|
+
e && setTimeout(() => {
|
|
81
|
+
r.autoFocus && e?.focus();
|
|
82
|
+
}, 1);
|
|
83
|
+
}), (e, a) => (I(), g(o(q), {
|
|
84
|
+
id: o(t).id?.value,
|
|
85
|
+
ref: o(i),
|
|
86
|
+
type: "text",
|
|
87
|
+
autocomplete: "off",
|
|
88
|
+
autocorrect: "off",
|
|
89
|
+
autocapitalize: "off",
|
|
90
|
+
as: e.as,
|
|
91
|
+
"as-child": e.asChild,
|
|
92
|
+
maxlength: e.maxLength,
|
|
93
|
+
placeholder: e.placeholder,
|
|
94
|
+
disabled: o(t).disabled.value,
|
|
95
|
+
"data-invalid": o(t).isInvalidInput.value ? "" : void 0,
|
|
96
|
+
onInput: w,
|
|
97
|
+
onKeydown: [
|
|
98
|
+
m(c, ["enter"]),
|
|
99
|
+
m(y, ["tab"]),
|
|
100
|
+
o(t).onInputKeydown
|
|
101
|
+
],
|
|
102
|
+
onBlur: p,
|
|
103
|
+
onCompositionstart: _,
|
|
104
|
+
onCompositionend: x,
|
|
105
|
+
onPaste: C
|
|
106
|
+
}, {
|
|
107
|
+
default: P(() => [B(e.$slots, "default")]),
|
|
108
|
+
_: 3
|
|
109
|
+
}, 8, [
|
|
110
|
+
"id",
|
|
111
|
+
"as",
|
|
112
|
+
"as-child",
|
|
113
|
+
"maxlength",
|
|
114
|
+
"placeholder",
|
|
115
|
+
"disabled",
|
|
116
|
+
"data-invalid",
|
|
117
|
+
"onKeydown"
|
|
118
|
+
]));
|
|
119
|
+
}
|
|
120
|
+
}), S = O;
|
|
121
|
+
const U = /* @__PURE__ */ h({
|
|
122
|
+
__name: "BuiTagsInputInput",
|
|
123
|
+
props: {
|
|
124
|
+
placeholder: {},
|
|
125
|
+
autoFocus: { type: Boolean },
|
|
126
|
+
maxLength: {},
|
|
127
|
+
asChild: { type: Boolean },
|
|
128
|
+
as: {},
|
|
129
|
+
class: {}
|
|
130
|
+
},
|
|
131
|
+
setup(s) {
|
|
132
|
+
const r = s, t = D(r, "class"), i = E(t);
|
|
133
|
+
return (u, p) => (I(), g(o(S), T(o(i), {
|
|
134
|
+
class: o(K)(
|
|
135
|
+
"min-h-5 flex-1 bg-transparent px-1 focus:outline-none disabled:cursor-not-allowed",
|
|
136
|
+
r.class
|
|
137
|
+
)
|
|
138
|
+
}), null, 16, ["class"]));
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
export {
|
|
142
|
+
U as _
|
|
143
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { defineComponent as p, createBlock as n, openBlock as m, unref as r, mergeProps as i, withCtx as l, renderSlot as c } from "vue";
|
|
2
|
+
import { reactiveOmit as d } from "@vueuse/core";
|
|
3
|
+
import { u } from "./useForwardProps-COe1clk4.js";
|
|
4
|
+
import { T as f } from "./TagsInputItem-BO1sG5J9.js";
|
|
5
|
+
import { g } from "./utils-CWz5p1Mv.js";
|
|
6
|
+
const v = /* @__PURE__ */ p({
|
|
7
|
+
__name: "BuiTagsInputItem",
|
|
8
|
+
props: {
|
|
9
|
+
value: {},
|
|
10
|
+
disabled: { type: Boolean },
|
|
11
|
+
asChild: { type: Boolean },
|
|
12
|
+
as: {},
|
|
13
|
+
class: {}
|
|
14
|
+
},
|
|
15
|
+
setup(o) {
|
|
16
|
+
const e = o, s = d(e, "class"), t = u(s);
|
|
17
|
+
return (a, _) => (m(), n(r(f), i(r(t), {
|
|
18
|
+
class: r(g)(
|
|
19
|
+
"text-foreground bg-primary/8 hover:bg-primary/16 dark:bg-primary/30 dark:hover:bg-primary/65 flex h-6 items-center justify-center gap-1 rounded-sm leading-5",
|
|
20
|
+
e.class
|
|
21
|
+
)
|
|
22
|
+
}), {
|
|
23
|
+
default: l(() => [
|
|
24
|
+
c(a.$slots, "default")
|
|
25
|
+
]),
|
|
26
|
+
_: 3
|
|
27
|
+
}, 16, ["class"]));
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
export {
|
|
31
|
+
v as _
|
|
32
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { defineComponent as i, computed as v, createBlock as u, openBlock as p, unref as e, mergeProps as c, withCtx as m, renderSlot as f, createVNode as _ } from "vue";
|
|
2
|
+
import { reactiveOmit as b } from "@vueuse/core";
|
|
3
|
+
import { u as I } from "./useForwardProps-COe1clk4.js";
|
|
4
|
+
import { u as g } from "./useForwardExpose-DmyWSR4F.js";
|
|
5
|
+
import { P as x } from "./Primitive-EBuBc72_.js";
|
|
6
|
+
import { i as y } from "./TagsInputRoot-BMN3YdoO.js";
|
|
7
|
+
import { i as C } from "./TagsInputItem-BO1sG5J9.js";
|
|
8
|
+
import { i as h } from "./ohash.D__AXeF1-5f2AoVdz.js";
|
|
9
|
+
import { g as w } from "./utils-CWz5p1Mv.js";
|
|
10
|
+
import { X as B } from "./x-Bk1T-hqx.js";
|
|
11
|
+
var P = /* @__PURE__ */ i({
|
|
12
|
+
__name: "TagsInputItemDelete",
|
|
13
|
+
props: {
|
|
14
|
+
asChild: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
required: !1
|
|
17
|
+
},
|
|
18
|
+
as: {
|
|
19
|
+
type: null,
|
|
20
|
+
required: !1,
|
|
21
|
+
default: "button"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
setup(n) {
|
|
25
|
+
const a = n;
|
|
26
|
+
g();
|
|
27
|
+
const o = y(), t = C(), r = v(() => t.disabled?.value || o.disabled.value);
|
|
28
|
+
function l() {
|
|
29
|
+
if (r.value) return;
|
|
30
|
+
const s = o.modelValue.value.findIndex((d) => h(d, t.value.value));
|
|
31
|
+
o.onRemoveValue(s);
|
|
32
|
+
}
|
|
33
|
+
return (s, d) => (p(), u(e(x), c({ tabindex: "-1" }, a, {
|
|
34
|
+
"aria-labelledby": e(t).textId,
|
|
35
|
+
"aria-current": e(t).isSelected.value,
|
|
36
|
+
"data-state": e(t).isSelected.value ? "active" : "inactive",
|
|
37
|
+
"data-disabled": r.value ? "" : void 0,
|
|
38
|
+
type: s.as === "button" ? "button" : void 0,
|
|
39
|
+
onClick: l
|
|
40
|
+
}), {
|
|
41
|
+
default: m(() => [f(s.$slots, "default")]),
|
|
42
|
+
_: 3
|
|
43
|
+
}, 16, [
|
|
44
|
+
"aria-labelledby",
|
|
45
|
+
"aria-current",
|
|
46
|
+
"data-state",
|
|
47
|
+
"data-disabled",
|
|
48
|
+
"type"
|
|
49
|
+
]));
|
|
50
|
+
}
|
|
51
|
+
}), T = P;
|
|
52
|
+
const N = /* @__PURE__ */ i({
|
|
53
|
+
__name: "BuiTagsInputItemDelete",
|
|
54
|
+
props: {
|
|
55
|
+
asChild: { type: Boolean },
|
|
56
|
+
as: {},
|
|
57
|
+
class: {},
|
|
58
|
+
readonly: { type: [Boolean, String] }
|
|
59
|
+
},
|
|
60
|
+
setup(n) {
|
|
61
|
+
const a = n, o = b(a, "class"), t = I(o);
|
|
62
|
+
return (r, l) => (p(), u(e(T), c(e(t), {
|
|
63
|
+
class: e(w)(
|
|
64
|
+
"mr-1 flex rounded bg-transparent",
|
|
65
|
+
"data-[disabled]:pointer-events-none data-[disabled]:cursor-not-allowed",
|
|
66
|
+
a.readonly && "pointer-events-none",
|
|
67
|
+
a.class
|
|
68
|
+
)
|
|
69
|
+
}), {
|
|
70
|
+
default: m(() => [
|
|
71
|
+
f(r.$slots, "default", {}, () => [
|
|
72
|
+
_(e(B), { class: "h-4 w-4" })
|
|
73
|
+
])
|
|
74
|
+
]),
|
|
75
|
+
_: 3
|
|
76
|
+
}, 16, ["class"]));
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
export {
|
|
80
|
+
N as _
|
|
81
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { defineComponent as o, createBlock as p, openBlock as n, unref as e, mergeProps as u, withCtx as m, renderSlot as l, createTextVNode as d, toDisplayString as c } from "vue";
|
|
2
|
+
import { reactiveOmit as _ } from "@vueuse/core";
|
|
3
|
+
import { u as f } from "./useForwardProps-COe1clk4.js";
|
|
4
|
+
import { u as x } from "./useForwardExpose-DmyWSR4F.js";
|
|
5
|
+
import { u as I } from "./useId-D4hM1ljW.js";
|
|
6
|
+
import { P as g } from "./Primitive-EBuBc72_.js";
|
|
7
|
+
import { i as T } from "./TagsInputItem-BO1sG5J9.js";
|
|
8
|
+
import { g as v } from "./utils-CWz5p1Mv.js";
|
|
9
|
+
var y = /* @__PURE__ */ o({
|
|
10
|
+
__name: "TagsInputItemText",
|
|
11
|
+
props: {
|
|
12
|
+
asChild: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
required: !1
|
|
15
|
+
},
|
|
16
|
+
as: {
|
|
17
|
+
type: null,
|
|
18
|
+
required: !1,
|
|
19
|
+
default: "span"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
setup(s) {
|
|
23
|
+
const r = s, t = T();
|
|
24
|
+
return x(), t.textId ||= I(void 0, "reka-tags-input-item-text"), (a, i) => (n(), p(e(g), u(r, { id: e(t).textId }), {
|
|
25
|
+
default: m(() => [l(a.$slots, "default", {}, () => [d(c(e(t).displayValue.value), 1)])]),
|
|
26
|
+
_: 3
|
|
27
|
+
}, 16, ["id"]));
|
|
28
|
+
}
|
|
29
|
+
}), C = y;
|
|
30
|
+
const b = /* @__PURE__ */ o({
|
|
31
|
+
__name: "BuiTagsInputItemText",
|
|
32
|
+
props: {
|
|
33
|
+
asChild: { type: Boolean },
|
|
34
|
+
as: {},
|
|
35
|
+
class: {}
|
|
36
|
+
},
|
|
37
|
+
setup(s) {
|
|
38
|
+
const r = s, t = _(r, "class"), a = f(t);
|
|
39
|
+
return (i, P) => (n(), p(e(C), u(e(a), {
|
|
40
|
+
class: e(v)("rounded bg-transparent px-2 py-0.5 text-sm", r.class)
|
|
41
|
+
}), null, 16, ["class"]));
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
export {
|
|
45
|
+
b as _
|
|
46
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { c as f } from "./createContext-BWsUZRn1.js";
|
|
2
|
+
import { u as v } from "./useForwardExpose-DmyWSR4F.js";
|
|
3
|
+
import { P as I } from "./Primitive-EBuBc72_.js";
|
|
4
|
+
import { u as _ } from "./Collection-BdNht7lW.js";
|
|
5
|
+
import { i as b } from "./TagsInputRoot-BMN3YdoO.js";
|
|
6
|
+
import { defineComponent as C, toRefs as g, computed as r, createBlock as x, openBlock as y, unref as e, withCtx as i, createVNode as T, renderSlot as h } from "vue";
|
|
7
|
+
const [P, q] = f("TagsInputItem");
|
|
8
|
+
var B = /* @__PURE__ */ C({
|
|
9
|
+
__name: "TagsInputItem",
|
|
10
|
+
props: {
|
|
11
|
+
value: {
|
|
12
|
+
type: [String, Object],
|
|
13
|
+
required: !0
|
|
14
|
+
},
|
|
15
|
+
disabled: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
required: !1
|
|
18
|
+
},
|
|
19
|
+
asChild: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
required: !1
|
|
22
|
+
},
|
|
23
|
+
as: {
|
|
24
|
+
type: null,
|
|
25
|
+
required: !1
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
setup(n) {
|
|
29
|
+
const o = n, { value: t } = g(o), a = b(), { forwardRef: d, currentElement: p } = v(), { CollectionItem: c } = _(), s = r(() => a.selectedElement.value === p.value), u = r(() => o.disabled || a.disabled.value), m = q({
|
|
30
|
+
value: t,
|
|
31
|
+
isSelected: s,
|
|
32
|
+
disabled: u,
|
|
33
|
+
textId: "",
|
|
34
|
+
displayValue: r(() => a.displayValue(t.value))
|
|
35
|
+
});
|
|
36
|
+
return (l, j) => (y(), x(e(c), { value: e(t) }, {
|
|
37
|
+
default: i(() => [T(e(I), {
|
|
38
|
+
ref: e(d),
|
|
39
|
+
as: l.as,
|
|
40
|
+
"as-child": l.asChild,
|
|
41
|
+
"aria-labelledby": e(m).textId,
|
|
42
|
+
"aria-current": s.value,
|
|
43
|
+
"data-disabled": u.value ? "" : void 0,
|
|
44
|
+
"data-state": s.value ? "active" : "inactive"
|
|
45
|
+
}, {
|
|
46
|
+
default: i(() => [h(l.$slots, "default")]),
|
|
47
|
+
_: 3
|
|
48
|
+
}, 8, [
|
|
49
|
+
"as",
|
|
50
|
+
"as-child",
|
|
51
|
+
"aria-labelledby",
|
|
52
|
+
"aria-current",
|
|
53
|
+
"data-disabled",
|
|
54
|
+
"data-state"
|
|
55
|
+
])]),
|
|
56
|
+
_: 3
|
|
57
|
+
}, 8, ["value"]));
|
|
58
|
+
}
|
|
59
|
+
}), F = B;
|
|
60
|
+
export {
|
|
61
|
+
F as T,
|
|
62
|
+
P as i
|
|
63
|
+
};
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { c as F } from "./createContext-BWsUZRn1.js";
|
|
2
|
+
import { u as x } from "./useArrowNavigation-kN9MfIAD.js";
|
|
3
|
+
import { u as P } from "./useDirection-nP8SCoKq.js";
|
|
4
|
+
import { u as N } from "./useFormControl-kgOmRVjW.js";
|
|
5
|
+
import { u as L } from "./useForwardExpose-DmyWSR4F.js";
|
|
6
|
+
import { P as H } from "./Primitive-EBuBc72_.js";
|
|
7
|
+
import { u as M } from "./Collection-BdNht7lW.js";
|
|
8
|
+
import { V as K } from "./VisuallyHiddenInput-BUnpp8eT.js";
|
|
9
|
+
import { defineComponent as U, toRefs as W, ref as q, computed as Y, createBlock as h, openBlock as w, unref as o, withCtx as T, createVNode as $, renderSlot as z, createCommentVNode as G } from "vue";
|
|
10
|
+
import { useVModel as J, useFocusWithin as Q } from "@vueuse/core";
|
|
11
|
+
const [ne, X] = F("TagsInputRoot");
|
|
12
|
+
var Z = /* @__PURE__ */ U({
|
|
13
|
+
__name: "TagsInputRoot",
|
|
14
|
+
props: {
|
|
15
|
+
modelValue: {
|
|
16
|
+
type: [Array, null],
|
|
17
|
+
required: !1
|
|
18
|
+
},
|
|
19
|
+
defaultValue: {
|
|
20
|
+
type: Array,
|
|
21
|
+
required: !1,
|
|
22
|
+
default: () => []
|
|
23
|
+
},
|
|
24
|
+
addOnPaste: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
required: !1
|
|
27
|
+
},
|
|
28
|
+
addOnTab: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
required: !1
|
|
31
|
+
},
|
|
32
|
+
addOnBlur: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
required: !1
|
|
35
|
+
},
|
|
36
|
+
duplicate: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
required: !1
|
|
39
|
+
},
|
|
40
|
+
disabled: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
required: !1
|
|
43
|
+
},
|
|
44
|
+
delimiter: {
|
|
45
|
+
type: null,
|
|
46
|
+
required: !1,
|
|
47
|
+
default: ","
|
|
48
|
+
},
|
|
49
|
+
dir: {
|
|
50
|
+
type: String,
|
|
51
|
+
required: !1
|
|
52
|
+
},
|
|
53
|
+
max: {
|
|
54
|
+
type: Number,
|
|
55
|
+
required: !1,
|
|
56
|
+
default: 0
|
|
57
|
+
},
|
|
58
|
+
id: {
|
|
59
|
+
type: String,
|
|
60
|
+
required: !1
|
|
61
|
+
},
|
|
62
|
+
convertValue: {
|
|
63
|
+
type: Function,
|
|
64
|
+
required: !1
|
|
65
|
+
},
|
|
66
|
+
displayValue: {
|
|
67
|
+
type: Function,
|
|
68
|
+
required: !1,
|
|
69
|
+
default: (c) => c.toString()
|
|
70
|
+
},
|
|
71
|
+
asChild: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
required: !1
|
|
74
|
+
},
|
|
75
|
+
as: {
|
|
76
|
+
type: null,
|
|
77
|
+
required: !1
|
|
78
|
+
},
|
|
79
|
+
name: {
|
|
80
|
+
type: String,
|
|
81
|
+
required: !1
|
|
82
|
+
},
|
|
83
|
+
required: {
|
|
84
|
+
type: Boolean,
|
|
85
|
+
required: !1
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
emits: [
|
|
89
|
+
"update:modelValue",
|
|
90
|
+
"invalid",
|
|
91
|
+
"addTag",
|
|
92
|
+
"removeTag"
|
|
93
|
+
],
|
|
94
|
+
setup(c, { emit: A }) {
|
|
95
|
+
const u = c, d = A, { addOnPaste: k, disabled: p, delimiter: I, max: v, id: B, dir: R, addOnBlur: C, addOnTab: D } = W(u), n = P(R), i = J(u, "modelValue", d, {
|
|
96
|
+
defaultValue: u.defaultValue,
|
|
97
|
+
passive: !0,
|
|
98
|
+
deep: !0
|
|
99
|
+
}), { forwardRef: _, currentElement: y } = L(), { focused: O } = Q(y), S = N(y), { getItems: g, CollectionSlot: E } = M({ isProvider: !0 }), t = q(), m = q(!1), j = Y(() => Array.isArray(i.value) ? [...i.value] : []);
|
|
100
|
+
function V(e) {
|
|
101
|
+
if (e !== -1) {
|
|
102
|
+
const r = g().filter((l) => l.ref.dataset.disabled !== "");
|
|
103
|
+
i.value = i.value.filter((l, s) => s !== e), d("removeTag", r[e].value);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return X({
|
|
107
|
+
modelValue: i,
|
|
108
|
+
onAddValue: (e) => {
|
|
109
|
+
const r = [...j.value], l = r.length > 0 && typeof r[0] == "object", s = r.length > 0 && typeof u.defaultValue[0] == "object";
|
|
110
|
+
if ((l || s) && typeof u.convertValue != "function") throw new Error("You must provide a `convertValue` function when using objects as values.");
|
|
111
|
+
const a = u.convertValue ? u.convertValue(e) : e;
|
|
112
|
+
if (r.length >= v.value && v.value)
|
|
113
|
+
return d("invalid", a), !1;
|
|
114
|
+
if (u.duplicate)
|
|
115
|
+
return i.value = [...r, a], d("addTag", a), !0;
|
|
116
|
+
if (r.includes(a))
|
|
117
|
+
m.value = !0;
|
|
118
|
+
else return i.value = [...r, a], d("addTag", a), !0;
|
|
119
|
+
return d("invalid", a), !1;
|
|
120
|
+
},
|
|
121
|
+
onRemoveValue: V,
|
|
122
|
+
onInputKeydown: (e) => {
|
|
123
|
+
const r = e.target, l = g().map((a) => a.ref).filter((a) => a.dataset.disabled !== "");
|
|
124
|
+
if (!l.length) return;
|
|
125
|
+
const s = l.at(-1);
|
|
126
|
+
switch (e.key) {
|
|
127
|
+
case "Delete":
|
|
128
|
+
case "Backspace": {
|
|
129
|
+
if (r.selectionStart !== 0 || r.selectionEnd !== 0) break;
|
|
130
|
+
if (t.value) {
|
|
131
|
+
const a = l.findIndex((f) => f === t.value);
|
|
132
|
+
V(a), t.value = t.value === s ? l.at(a - 1) : l.at(a + 1), e.preventDefault();
|
|
133
|
+
} else e.key === "Backspace" && (t.value = s, e.preventDefault());
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
case "Home":
|
|
137
|
+
case "End":
|
|
138
|
+
case "ArrowRight":
|
|
139
|
+
case "ArrowLeft": {
|
|
140
|
+
const a = e.key === "ArrowRight" && n.value === "ltr" || e.key === "ArrowLeft" && n.value === "rtl", f = !a;
|
|
141
|
+
if (r.selectionStart !== 0 || r.selectionEnd !== 0) break;
|
|
142
|
+
if (f && !t.value)
|
|
143
|
+
t.value = s, e.preventDefault();
|
|
144
|
+
else if (a && s && t.value === s)
|
|
145
|
+
t.value = void 0, e.preventDefault();
|
|
146
|
+
else if (t.value) {
|
|
147
|
+
const b = x(e, t.value, void 0, {
|
|
148
|
+
itemsArray: l,
|
|
149
|
+
loop: !1,
|
|
150
|
+
dir: n.value
|
|
151
|
+
});
|
|
152
|
+
b && (t.value = b), e.preventDefault();
|
|
153
|
+
}
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
156
|
+
case "ArrowUp":
|
|
157
|
+
case "ArrowDown": {
|
|
158
|
+
t.value && e.preventDefault();
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
default:
|
|
162
|
+
t.value = void 0;
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
selectedElement: t,
|
|
166
|
+
isInvalidInput: m,
|
|
167
|
+
addOnPaste: k,
|
|
168
|
+
addOnBlur: C,
|
|
169
|
+
addOnTab: D,
|
|
170
|
+
dir: n,
|
|
171
|
+
disabled: p,
|
|
172
|
+
delimiter: I,
|
|
173
|
+
max: v,
|
|
174
|
+
id: B,
|
|
175
|
+
displayValue: u.displayValue
|
|
176
|
+
}), (e, r) => (w(), h(o(E), null, {
|
|
177
|
+
default: T(() => [$(o(H), {
|
|
178
|
+
ref: o(_),
|
|
179
|
+
dir: o(n),
|
|
180
|
+
as: e.as,
|
|
181
|
+
"as-child": e.asChild,
|
|
182
|
+
"data-invalid": m.value ? "" : void 0,
|
|
183
|
+
"data-disabled": o(p) ? "" : void 0,
|
|
184
|
+
"data-focused": o(O) ? "" : void 0
|
|
185
|
+
}, {
|
|
186
|
+
default: T(() => [z(e.$slots, "default", { modelValue: o(i) }), o(S) && e.name ? (w(), h(o(K), {
|
|
187
|
+
key: 0,
|
|
188
|
+
name: e.name,
|
|
189
|
+
value: o(i),
|
|
190
|
+
required: e.required,
|
|
191
|
+
disabled: o(p)
|
|
192
|
+
}, null, 8, [
|
|
193
|
+
"name",
|
|
194
|
+
"value",
|
|
195
|
+
"required",
|
|
196
|
+
"disabled"
|
|
197
|
+
])) : G("v-if", !0)]),
|
|
198
|
+
_: 3
|
|
199
|
+
}, 8, [
|
|
200
|
+
"dir",
|
|
201
|
+
"as",
|
|
202
|
+
"as-child",
|
|
203
|
+
"data-invalid",
|
|
204
|
+
"data-disabled",
|
|
205
|
+
"data-focused"
|
|
206
|
+
])]),
|
|
207
|
+
_: 3
|
|
208
|
+
}));
|
|
209
|
+
}
|
|
210
|
+
}), fe = Z;
|
|
211
|
+
export {
|
|
212
|
+
fe as T,
|
|
213
|
+
ne as i
|
|
214
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { _ as i } from "../../BuiAccordion.vue_vue_type_script_setup_true_lang-DyGzWksC.js";
|
|
2
2
|
import { _ as e } from "../../BuiAccordionContent.vue_vue_type_script_setup_true_lang-CNqCCJhe.js";
|
|
3
3
|
import { _ as t } from "../../BuiAccordionItem.vue_vue_type_script_setup_true_lang-DmM2Mplh.js";
|
|
4
|
-
import { _ as a } from "../../BuiAccordionTrigger.vue_vue_type_script_setup_true_lang-
|
|
5
|
-
import { _ as A } from "../../BuiAdvancedAccordionTrigger.vue_vue_type_script_setup_true_lang-
|
|
4
|
+
import { _ as a } from "../../BuiAccordionTrigger.vue_vue_type_script_setup_true_lang-YVELnYkR.js";
|
|
5
|
+
import { _ as A } from "../../BuiAdvancedAccordionTrigger.vue_vue_type_script_setup_true_lang-BjV8LPs_.js";
|
|
6
6
|
export {
|
|
7
7
|
i as BuiAccordion,
|
|
8
8
|
e as BuiAccordionContent,
|