@vue-interface/tag-field 1.0.0
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/LICENSE +22 -0
- package/README.md +43 -0
- package/dist/index.d.ts +3 -0
- package/dist/src/TagField.vue.d.ts +114 -0
- package/dist/tag-field.js +383 -0
- package/dist/tag-field.js.map +1 -0
- package/dist/tag-field.umd.cjs +2 -0
- package/dist/tag-field.umd.cjs.map +1 -0
- package/dist/vite.config.d.ts +3 -0
- package/index.css +6 -0
- package/package.json +63 -0
- package/src/TagField.vue +624 -0
- package/src/css/tag-field.css +129 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Justin Kimbrell
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Searchable Select Field
|
|
2
|
+
|
|
3
|
+
The `tag-field` component provides flexible and customizable searchable input field with tags that have customizable sizes, states, and colors.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm i @vue-interface/tag-field
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
yarn add @vue-interface/tag-field
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm i @vue-interface/tag-field
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
bun i @vue-interface/tag-field
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Basic Usage
|
|
24
|
+
|
|
25
|
+
```vue
|
|
26
|
+
<TagField v-model="selected" :options="languages"></TagField>
|
|
27
|
+
<TagField :options="options" placeholder="Type to search..." label="Placeholder"></TagField>
|
|
28
|
+
<TagField :options="options" label="Descriptive Text Field" help-text="Some helpful text goes here."></TagField>
|
|
29
|
+
<TagField :options="options" label="Readonly" placeholder="Type something here..." readonly></TagField>
|
|
30
|
+
<TagField :options="options" label="Disabled" disabled></TagField>
|
|
31
|
+
<TagField :options="options" placeholder="Disabled" label="Disabled (Placeholder)" disabled></TagField>
|
|
32
|
+
<TagField :options="options" label="Clearable" placeholder="Clearable" clearable></TagField>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Use the `plaintext` prop to use a plaintext version.
|
|
36
|
+
|
|
37
|
+
```vue
|
|
38
|
+
<TagField :options="options" placeholder="Click to search..." :model-value="['Tag']" label="Plaintext" plaintext></TagField>
|
|
39
|
+
<TagField :options="options" label="Plaintext Readonly" :model-value="['Tag']" plaintext readonly></TagField>
|
|
40
|
+
<TagField :options="options" label="Plaintext Disabled" :model-value="['Tag']" plaintext disabled></TagField>
|
|
41
|
+
``
|
|
42
|
+
|
|
43
|
+
For more comprehensive documentation and examples, please visit the [online documentation](https://vue-interface.github.io/packages/tag-field/).
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { FormControlProps, FormControlSlots } from '@vue-interface/form-control';
|
|
2
|
+
import { IFuseOptions } from 'fuse.js';
|
|
3
|
+
import { HTMLAttributes } from 'vue';
|
|
4
|
+
export type TagFieldSizePrefix = 'form-control';
|
|
5
|
+
export type TagFieldProps<T, Value> = /* @vue-ignore */ FormControlProps<HTMLAttributes, TagFieldSizePrefix, T[], Value[]> & {
|
|
6
|
+
options?: T[];
|
|
7
|
+
fuseOptions?: IFuseOptions<T>;
|
|
8
|
+
display?: (option: T) => string;
|
|
9
|
+
format?: (value: string) => T;
|
|
10
|
+
allowCustom?: boolean;
|
|
11
|
+
addTagLabel?: string;
|
|
12
|
+
noResultsText?: string;
|
|
13
|
+
showNoResults?: boolean;
|
|
14
|
+
clearable?: boolean;
|
|
15
|
+
};
|
|
16
|
+
declare const _default: <T, Value>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
17
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
18
|
+
readonly onInput?: ((event: Event) => any) | undefined;
|
|
19
|
+
readonly onSelect?: ((event: Event) => any) | undefined;
|
|
20
|
+
readonly onClick?: ((event: MouseEvent) => any) | undefined;
|
|
21
|
+
readonly onSubmit?: ((event: Event) => any) | undefined;
|
|
22
|
+
readonly onReset?: ((event: Event) => any) | undefined;
|
|
23
|
+
readonly onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
24
|
+
readonly onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
25
|
+
readonly onFocusin?: ((event: FocusEvent) => any) | undefined;
|
|
26
|
+
readonly onFocusout?: ((event: FocusEvent) => any) | undefined;
|
|
27
|
+
readonly onDoubleclick?: ((event: MouseEvent) => any) | undefined;
|
|
28
|
+
readonly onContextmenu?: ((event: MouseEvent) => any) | undefined;
|
|
29
|
+
readonly onMousedown?: ((event: MouseEvent) => any) | undefined;
|
|
30
|
+
readonly onMouseup?: ((event: MouseEvent) => any) | undefined;
|
|
31
|
+
readonly onMouseover?: ((event: MouseEvent) => any) | undefined;
|
|
32
|
+
readonly onMouseout?: ((event: MouseEvent) => any) | undefined;
|
|
33
|
+
readonly onMouseenter?: ((event: MouseEvent) => any) | undefined;
|
|
34
|
+
readonly onMouseleave?: ((event: MouseEvent) => any) | undefined;
|
|
35
|
+
readonly onMousemove?: ((event: MouseEvent) => any) | undefined;
|
|
36
|
+
readonly onKeydown?: ((event: KeyboardEvent) => any) | undefined;
|
|
37
|
+
readonly onKeyup?: ((event: KeyboardEvent) => any) | undefined;
|
|
38
|
+
readonly onKeypress?: ((event: KeyboardEvent) => any) | undefined;
|
|
39
|
+
readonly onSelectionchange?: ((event: Event) => any) | undefined;
|
|
40
|
+
readonly onInvalid?: ((event: Event) => any) | undefined;
|
|
41
|
+
readonly onScroll?: ((event: Event) => any) | undefined;
|
|
42
|
+
readonly onWheel?: ((event: WheelEvent) => any) | undefined;
|
|
43
|
+
readonly onCopy?: ((event: ClipboardEvent) => any) | undefined;
|
|
44
|
+
readonly onCut?: ((event: ClipboardEvent) => any) | undefined;
|
|
45
|
+
readonly onPaste?: ((event: ClipboardEvent) => any) | undefined;
|
|
46
|
+
readonly onTouchstart?: ((event: TouchEvent) => any) | undefined;
|
|
47
|
+
readonly onTouchend?: ((event: TouchEvent) => any) | undefined;
|
|
48
|
+
readonly onTouchmove?: ((event: TouchEvent) => any) | undefined;
|
|
49
|
+
readonly onTouchcancel?: ((event: TouchEvent) => any) | undefined;
|
|
50
|
+
readonly onChange?: ((event: Event) => any) | undefined;
|
|
51
|
+
readonly onBeforeinput?: ((event: Event) => any) | undefined;
|
|
52
|
+
readonly "onUpdate:modelValue"?: ((value: T[]) => any) | undefined;
|
|
53
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onCopy" | "onCut" | "onPaste" | "onFocus" | "onFocusin" | "onFocusout" | "onBlur" | "onChange" | "onBeforeinput" | "onInput" | "onReset" | "onSubmit" | "onInvalid" | "onKeydown" | "onKeypress" | "onKeyup" | "onMousedown" | "onMouseenter" | "onMouseleave" | "onMousemove" | "onMouseout" | "onMouseover" | "onMouseup" | "onSelect" | "onScroll" | "onTouchcancel" | "onTouchend" | "onTouchmove" | "onTouchstart" | "onClick" | "onContextmenu" | "onWheel" | "onDoubleclick" | "onSelectionchange" | "onUpdate:modelValue"> & ({
|
|
54
|
+
modelValue?: T[];
|
|
55
|
+
} & {
|
|
56
|
+
activity?: boolean;
|
|
57
|
+
disabled?: boolean;
|
|
58
|
+
error?: import('@vue-interface/form-control').FormControlErrorProp;
|
|
59
|
+
errors?: import('@vue-interface/form-control').FormControlErrorPropArray | import('@vue-interface/form-control').FormControlErrorPropRecord;
|
|
60
|
+
feedback?: import('@vue-interface/form-control').FormControlFeedbackProp;
|
|
61
|
+
formControlClass?: string;
|
|
62
|
+
helpText?: string;
|
|
63
|
+
id?: string;
|
|
64
|
+
indicator?: import('vue').Component;
|
|
65
|
+
indicatorSize?: import('@vue-interface/sizeable').ComponentSize<import('@vue-interface/activity-indicator').ActivityIndicatorSizePrefix>;
|
|
66
|
+
invalid?: boolean;
|
|
67
|
+
label?: string;
|
|
68
|
+
labelClass?: string;
|
|
69
|
+
modelValue?: T[] | undefined;
|
|
70
|
+
name?: string;
|
|
71
|
+
plaintext?: boolean;
|
|
72
|
+
size?: import('@vue-interface/form-control').FormControlSize<"form-control"> | undefined;
|
|
73
|
+
color?: string;
|
|
74
|
+
readonly?: boolean;
|
|
75
|
+
valid?: boolean;
|
|
76
|
+
value?: Value[] | undefined;
|
|
77
|
+
} & Omit<HTMLAttributes, "size"> & {
|
|
78
|
+
options?: T[] | undefined;
|
|
79
|
+
fuseOptions?: IFuseOptions<T> | undefined;
|
|
80
|
+
display?: ((option: T) => string) | undefined;
|
|
81
|
+
format?: ((value: string) => T) | undefined;
|
|
82
|
+
allowCustom?: boolean;
|
|
83
|
+
addTagLabel?: string;
|
|
84
|
+
noResultsText?: string;
|
|
85
|
+
showNoResults?: boolean;
|
|
86
|
+
clearable?: boolean;
|
|
87
|
+
}) & Partial<{}>> & import('vue').PublicProps;
|
|
88
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
|
89
|
+
attrs: any;
|
|
90
|
+
slots: Readonly<FormControlSlots<"form-control", T[]> & {
|
|
91
|
+
default(props: {
|
|
92
|
+
option: T;
|
|
93
|
+
display?: (option: T) => string;
|
|
94
|
+
}): any;
|
|
95
|
+
'no-results'(props: {
|
|
96
|
+
input: string | undefined;
|
|
97
|
+
}): any;
|
|
98
|
+
}> & FormControlSlots<"form-control", T[]> & {
|
|
99
|
+
default(props: {
|
|
100
|
+
option: T;
|
|
101
|
+
display?: (option: T) => string;
|
|
102
|
+
}): any;
|
|
103
|
+
'no-results'(props: {
|
|
104
|
+
input: string | undefined;
|
|
105
|
+
}): any;
|
|
106
|
+
};
|
|
107
|
+
emit: (((evt: "input", event: Event) => void) & ((evt: "select", event: Event) => void) & ((evt: "click", event: MouseEvent) => void) & ((evt: "submit", event: Event) => void) & ((evt: "reset", event: Event) => void) & ((evt: "blur", event: FocusEvent) => void) & ((evt: "focus", event: FocusEvent) => void) & ((evt: "focusin", event: FocusEvent) => void) & ((evt: "focusout", event: FocusEvent) => void) & ((evt: "doubleclick", event: MouseEvent) => void) & ((evt: "contextmenu", event: MouseEvent) => void) & ((evt: "mousedown", event: MouseEvent) => void) & ((evt: "mouseup", event: MouseEvent) => void) & ((evt: "mouseover", event: MouseEvent) => void) & ((evt: "mouseout", event: MouseEvent) => void) & ((evt: "mouseenter", event: MouseEvent) => void) & ((evt: "mouseleave", event: MouseEvent) => void) & ((evt: "mousemove", event: MouseEvent) => void) & ((evt: "keydown", event: KeyboardEvent) => void) & ((evt: "keyup", event: KeyboardEvent) => void) & ((evt: "keypress", event: KeyboardEvent) => void) & ((evt: "selectionchange", event: Event) => void) & ((evt: "invalid", event: Event) => void) & ((evt: "scroll", event: Event) => void) & ((evt: "wheel", event: WheelEvent) => void) & ((evt: "copy", event: ClipboardEvent) => void) & ((evt: "cut", event: ClipboardEvent) => void) & ((evt: "paste", event: ClipboardEvent) => void) & ((evt: "touchstart", event: TouchEvent) => void) & ((evt: "touchend", event: TouchEvent) => void) & ((evt: "touchmove", event: TouchEvent) => void) & ((evt: "touchcancel", event: TouchEvent) => void) & ((evt: "change", event: Event) => void) & ((evt: "beforeinput", event: Event) => void)) & ((evt: "update:modelValue", value: T[]) => void);
|
|
108
|
+
}>) => import('vue').VNode & {
|
|
109
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
110
|
+
};
|
|
111
|
+
export default _default;
|
|
112
|
+
type __VLS_PrettifyLocal<T> = {
|
|
113
|
+
[K in keyof T]: T[K];
|
|
114
|
+
} & {};
|
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
import { openBlock as r, createElementBlock as d, createElementVNode as f, defineComponent as xe, useModel as Be, useTemplateRef as W, ref as B, computed as T, watch as ae, toRaw as Fe, unref as u, onBeforeMount as Ae, onBeforeUnmount as Ke, normalizeClass as L, renderSlot as k, toDisplayString as y, createCommentVNode as h, normalizeProps as F, guardReactiveProps as A, mergeProps as ze, withModifiers as a, Fragment as re, renderList as se, createBlock as R, withCtx as K, createTextVNode as H, createVNode as S, withDirectives as Ie, withKeys as c, vModelText as Oe, Transition as Ve, mergeModels as De } from "vue";
|
|
2
|
+
import { ActivityIndicator as Le } from "@vue-interface/activity-indicator";
|
|
3
|
+
import { Badge as Re } from "@vue-interface/badge";
|
|
4
|
+
import { useFormControl as Se, FormControlErrors as Ne, FormControlFeedback as je } from "@vue-interface/form-control";
|
|
5
|
+
import Pe from "fuse.js";
|
|
6
|
+
import { isEqual as z } from "lodash-es";
|
|
7
|
+
function Ue(I, N) {
|
|
8
|
+
return r(), d("svg", {
|
|
9
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
10
|
+
fill: "none",
|
|
11
|
+
viewBox: "0 0 24 24",
|
|
12
|
+
"stroke-width": "1.5",
|
|
13
|
+
stroke: "currentColor",
|
|
14
|
+
"aria-hidden": "true",
|
|
15
|
+
"data-slot": "icon"
|
|
16
|
+
}, [
|
|
17
|
+
f("path", {
|
|
18
|
+
"stroke-linecap": "round",
|
|
19
|
+
"stroke-linejoin": "round",
|
|
20
|
+
d: "M12 4.5v15m7.5-7.5h-15"
|
|
21
|
+
})
|
|
22
|
+
]);
|
|
23
|
+
}
|
|
24
|
+
function ue(I, N) {
|
|
25
|
+
return r(), d("svg", {
|
|
26
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
27
|
+
fill: "none",
|
|
28
|
+
viewBox: "0 0 24 24",
|
|
29
|
+
"stroke-width": "1.5",
|
|
30
|
+
stroke: "currentColor",
|
|
31
|
+
"aria-hidden": "true",
|
|
32
|
+
"data-slot": "icon"
|
|
33
|
+
}, [
|
|
34
|
+
f("path", {
|
|
35
|
+
"stroke-linecap": "round",
|
|
36
|
+
"stroke-linejoin": "round",
|
|
37
|
+
d: "M6 18 18 6M6 6l12 12"
|
|
38
|
+
})
|
|
39
|
+
]);
|
|
40
|
+
}
|
|
41
|
+
const qe = ["for"], Ge = { class: "form-control-inner" }, Je = { class: "flex flex-wrap gap-2 mr-2 flex-1" }, We = ["placeholder", "onKeydown"], He = { class: "form-control-activity-indicator" }, Qe = {
|
|
42
|
+
invalid: "",
|
|
43
|
+
class: "invalid-feedback"
|
|
44
|
+
}, Xe = {
|
|
45
|
+
valid: "",
|
|
46
|
+
class: "valid-feedback"
|
|
47
|
+
}, Ye = {
|
|
48
|
+
key: 0,
|
|
49
|
+
class: "form-help"
|
|
50
|
+
}, Ze = ["onMouseup"], _e = { class: "truncate" }, et = {
|
|
51
|
+
key: 1,
|
|
52
|
+
class: "py-2 px-4 text-neutral-400 dark:text-neutral-500"
|
|
53
|
+
}, st = /* @__PURE__ */ xe({
|
|
54
|
+
inheritAttrs: !1,
|
|
55
|
+
__name: "TagField",
|
|
56
|
+
props: {
|
|
57
|
+
modelValue: {},
|
|
58
|
+
modelModifiers: {}
|
|
59
|
+
},
|
|
60
|
+
emits: /* @__PURE__ */ De(["blur", "focus", "focusin", "focusout", "click", "doubleclick", "contextmenu", "mousedown", "mouseup", "mouseover", "mouseout", "mouseenter", "mouseleave", "mousemove", "keydown", "keyup", "keypress", "select", "selectionchange", "invalid", "submit", "reset", "scroll", "wheel", "copy", "cut", "paste", "touchstart", "touchend", "touchmove", "touchcancel", "change", "input", "beforeinput"], ["update:modelValue"]),
|
|
61
|
+
setup(I, { emit: N }) {
|
|
62
|
+
const s = I, n = Be(I, "modelValue"), ie = N, {
|
|
63
|
+
controlAttributes: E,
|
|
64
|
+
formGroupClasses: de,
|
|
65
|
+
listeners: ve
|
|
66
|
+
} = Se({ model: n, props: s, emit: ie }), j = W("wrapperEl"), O = W("inputEl"), P = W("tagEl"), l = B(), v = B([]), b = B(!1), i = B(), V = B(s.options), U = T(() => !s.disabled && !s.readonly), q = T(() => s.clearable && (!!l.value || !!n.value?.length) && U.value), ce = T(() => typeof s.options == "object" && s.options?.[0] ? Object.keys(s.options?.[0]) : []), Q = pe(s.options), fe = T(() => b.value && (p.value.length || l.value)), D = T(() => v.value.map((e) => (n.value ?? []).findIndex((t) => z(t, e))));
|
|
67
|
+
ae(() => s.options, () => {
|
|
68
|
+
V.value = s.options;
|
|
69
|
+
}), ae(l, () => {
|
|
70
|
+
b.value = !0, i.value = void 0, m();
|
|
71
|
+
});
|
|
72
|
+
function pe(e) {
|
|
73
|
+
return new Pe(e, s.fuseOptions ?? {
|
|
74
|
+
includeScore: !0,
|
|
75
|
+
threshold: 0.45,
|
|
76
|
+
keys: ce.value
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
const p = T(() => {
|
|
80
|
+
const e = V.value.filter((t) => !(n.value ?? []).find((o) => z(o, Fe(u(t)))));
|
|
81
|
+
return l.value ? (Q.setCollection(e), Q.search(l.value).map(({ item: t }) => t)) : e;
|
|
82
|
+
});
|
|
83
|
+
function G(e) {
|
|
84
|
+
const t = s.format?.(e) ?? e;
|
|
85
|
+
V.value.find((o) => z(o, t)) || (V.value.push(t), M(t), l.value = void 0);
|
|
86
|
+
}
|
|
87
|
+
function M(e) {
|
|
88
|
+
n.value = [...n.value ?? [], e], l.value = void 0, i.value = void 0;
|
|
89
|
+
}
|
|
90
|
+
function X(e) {
|
|
91
|
+
const t = [...n.value ?? []];
|
|
92
|
+
t.splice(t.indexOf(e), 1), x(e), n.value = t;
|
|
93
|
+
}
|
|
94
|
+
function C(e, t = !1) {
|
|
95
|
+
t || m(e), $(e) ? x(e) : Z(e);
|
|
96
|
+
}
|
|
97
|
+
function me(e) {
|
|
98
|
+
const t = n.value ?? [], o = t.indexOf(e), g = D.value[D.value.length - 1], w = $(e) ? x : Z;
|
|
99
|
+
if (g === void 0) {
|
|
100
|
+
C(e);
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
let J = [];
|
|
104
|
+
o > g ? J = t.slice(g, o + 1) : o < g && (J = t.slice(o, g + 1));
|
|
105
|
+
for (const Me of J)
|
|
106
|
+
w(Me);
|
|
107
|
+
}
|
|
108
|
+
function ge() {
|
|
109
|
+
l.value || (v.value = [...n.value ?? []]);
|
|
110
|
+
}
|
|
111
|
+
function m(e) {
|
|
112
|
+
if (!e)
|
|
113
|
+
v.value = [];
|
|
114
|
+
else {
|
|
115
|
+
const t = v.value.filter(
|
|
116
|
+
(o) => !z(o, e)
|
|
117
|
+
);
|
|
118
|
+
for (const o of t)
|
|
119
|
+
x(o);
|
|
120
|
+
}
|
|
121
|
+
Y();
|
|
122
|
+
}
|
|
123
|
+
function Y() {
|
|
124
|
+
if (P.value)
|
|
125
|
+
for (const e of P.value)
|
|
126
|
+
e?.$el?.blur();
|
|
127
|
+
}
|
|
128
|
+
function $(e) {
|
|
129
|
+
return !!v.value.find((t) => z(t, e));
|
|
130
|
+
}
|
|
131
|
+
function Z(e) {
|
|
132
|
+
$(e) || v.value.push(e);
|
|
133
|
+
}
|
|
134
|
+
function x(e) {
|
|
135
|
+
$(e) && v.value.splice(v.value.indexOf(e), 1), Y();
|
|
136
|
+
}
|
|
137
|
+
function _() {
|
|
138
|
+
n.value = (n.value ?? []).filter((e) => !$(e)), v.value = [];
|
|
139
|
+
}
|
|
140
|
+
function ke() {
|
|
141
|
+
O.value?.focus(), !l.value && (v.value.length ? _() : n.value?.length && X(n.value[n.value.length - 1]));
|
|
142
|
+
}
|
|
143
|
+
function we(e) {
|
|
144
|
+
i.value !== void 0 ? M(p.value[i.value]) : p.value.length ? M(p.value[0]) : s.allowCustom && l.value && G(l.value), e.preventDefault();
|
|
145
|
+
}
|
|
146
|
+
function ye(e) {
|
|
147
|
+
i.value !== void 0 && (M(p.value[i.value]), e.preventDefault());
|
|
148
|
+
}
|
|
149
|
+
function he() {
|
|
150
|
+
i.value ? i.value-- : i.value = p.value.length - 1;
|
|
151
|
+
}
|
|
152
|
+
function be() {
|
|
153
|
+
i.value === void 0 || i.value === p.value.length - 1 ? i.value = 0 : i.value++;
|
|
154
|
+
}
|
|
155
|
+
function ee(e = !1) {
|
|
156
|
+
if (!n.value?.length || l.value)
|
|
157
|
+
return;
|
|
158
|
+
const t = Math.min(...D.value, n.value.length) - 1;
|
|
159
|
+
n.value[t] ? C(n.value[t], e) : m();
|
|
160
|
+
}
|
|
161
|
+
function te(e = !1) {
|
|
162
|
+
if (!n.value?.length || l.value)
|
|
163
|
+
return;
|
|
164
|
+
const t = Math.max(...D.value, -1) + 1;
|
|
165
|
+
n.value[t] ? C(n.value[t], e) : m();
|
|
166
|
+
}
|
|
167
|
+
function Ce() {
|
|
168
|
+
b.value ? b.value = !1 : m();
|
|
169
|
+
}
|
|
170
|
+
function $e() {
|
|
171
|
+
s.allowCustom && l.value && G(l.value), b.value = !1, m();
|
|
172
|
+
}
|
|
173
|
+
function Te() {
|
|
174
|
+
b.value = !0, m();
|
|
175
|
+
}
|
|
176
|
+
function Ee() {
|
|
177
|
+
l.value && G(l.value);
|
|
178
|
+
}
|
|
179
|
+
function oe() {
|
|
180
|
+
U.value && (l.value = void 0, n.value = []);
|
|
181
|
+
}
|
|
182
|
+
function ne(e) {
|
|
183
|
+
e.target && (j.value == e.target || j.value?.contains(e.target) || m());
|
|
184
|
+
}
|
|
185
|
+
function le(e) {
|
|
186
|
+
switch (e.key) {
|
|
187
|
+
case "Backspace":
|
|
188
|
+
v.value.length && (_(), e.preventDefault());
|
|
189
|
+
break;
|
|
190
|
+
case "Escape":
|
|
191
|
+
b.value || m();
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return Ae(() => {
|
|
195
|
+
document.addEventListener("click", ne), document.addEventListener("keydown", le);
|
|
196
|
+
}), Ke(() => {
|
|
197
|
+
document.removeEventListener("click", ne), document.removeEventListener("keydown", le);
|
|
198
|
+
}), (e, t) => (r(), d("div", {
|
|
199
|
+
ref_key: "wrapperEl",
|
|
200
|
+
ref: j,
|
|
201
|
+
class: L(["tag-field", [u(de), { "has-clear-button": q.value }]])
|
|
202
|
+
}, [
|
|
203
|
+
k(e.$slots, "label", {}, () => [
|
|
204
|
+
e.label ? (r(), d("label", {
|
|
205
|
+
key: 0,
|
|
206
|
+
class: L(e.labelClass),
|
|
207
|
+
for: u(E).id
|
|
208
|
+
}, y(e.label), 11, qe)) : h("", !0)
|
|
209
|
+
]),
|
|
210
|
+
f("div", Ge, [
|
|
211
|
+
k(e.$slots, "control", F(A({ controlAttributes: u(E), listeners: u(ve) })), () => [
|
|
212
|
+
e.$slots.icon ? (r(), d("div", {
|
|
213
|
+
key: 0,
|
|
214
|
+
class: "form-control-inner-icon",
|
|
215
|
+
onClick: t[0] || (t[0] = (o) => O.value?.focus())
|
|
216
|
+
}, [
|
|
217
|
+
k(e.$slots, "icon")
|
|
218
|
+
])) : h("", !0),
|
|
219
|
+
f("div", ze(u(E), {
|
|
220
|
+
class: "form-control flex",
|
|
221
|
+
onClick: t[8] || (t[8] = a((o) => O.value?.focus(), ["self"]))
|
|
222
|
+
}), [
|
|
223
|
+
f("div", Je, [
|
|
224
|
+
(r(!0), d(re, null, se(n.value, (o, g) => (r(), R(u(Re), {
|
|
225
|
+
ref_for: !0,
|
|
226
|
+
ref_key: "tagEl",
|
|
227
|
+
ref: P,
|
|
228
|
+
key: `tag-${g}`,
|
|
229
|
+
tabindex: "-1",
|
|
230
|
+
size: "badge-[.95em]",
|
|
231
|
+
class: L(["badge-neutral-100 dark:badge-neutral-500", {
|
|
232
|
+
"badge-blue-600!": $(o)
|
|
233
|
+
}]),
|
|
234
|
+
closeable: "",
|
|
235
|
+
onMousedown: t[2] || (t[2] = a(() => {
|
|
236
|
+
}, ["prevent"])),
|
|
237
|
+
onClose: (w) => X(o),
|
|
238
|
+
onFocus: (w) => C(o),
|
|
239
|
+
onBlur: (w) => x(o),
|
|
240
|
+
onClick: [
|
|
241
|
+
a((w) => C(o, !0), ["exact", "meta"]),
|
|
242
|
+
a((w) => C(o), ["exact"]),
|
|
243
|
+
a((w) => me(o), ["exact", "shift"])
|
|
244
|
+
]
|
|
245
|
+
}, {
|
|
246
|
+
"close-icon": K(() => [
|
|
247
|
+
S(u(ue), {
|
|
248
|
+
class: "size-[1.25em]",
|
|
249
|
+
onMousedown: t[1] || (t[1] = a(() => {
|
|
250
|
+
}, ["prevent"]))
|
|
251
|
+
})
|
|
252
|
+
]),
|
|
253
|
+
default: K(() => [
|
|
254
|
+
k(e.$slots, "default", {
|
|
255
|
+
option: o,
|
|
256
|
+
display: e.display
|
|
257
|
+
}, () => [
|
|
258
|
+
H(y(e.display?.(o) ?? o), 1)
|
|
259
|
+
])
|
|
260
|
+
]),
|
|
261
|
+
_: 2
|
|
262
|
+
}, 1032, ["class", "onClose", "onFocus", "onBlur", "onClick"]))), 128)),
|
|
263
|
+
Ie(f("input", {
|
|
264
|
+
ref_key: "inputEl",
|
|
265
|
+
ref: O,
|
|
266
|
+
"onUpdate:modelValue": t[3] || (t[3] = (o) => l.value = o),
|
|
267
|
+
placeholder: e.placeholder,
|
|
268
|
+
class: "bg-transparent outline-none flex-1 min-w-0",
|
|
269
|
+
onKeydown: [
|
|
270
|
+
c(a(ke, ["exact"]), ["delete"]),
|
|
271
|
+
c(a(ge, ["exact", "meta"]), ["a"]),
|
|
272
|
+
c(a(we, ["exact"]), ["enter"]),
|
|
273
|
+
c(a(ye, ["exact"]), ["space"]),
|
|
274
|
+
c(a(he, ["exact"]), ["arrow-up"]),
|
|
275
|
+
c(a(be, ["exact"]), ["arrow-down"]),
|
|
276
|
+
t[4] || (t[4] = c(a((o) => ee(), ["exact"]), ["arrow-left"])),
|
|
277
|
+
t[5] || (t[5] = c(a((o) => ee(!0), ["exact", "shift"]), ["arrow-left"])),
|
|
278
|
+
t[6] || (t[6] = c(a((o) => te(), ["exact"]), ["arrow-right"])),
|
|
279
|
+
t[7] || (t[7] = c(a((o) => te(!0), ["exact", "shift"]), ["arrow-right"])),
|
|
280
|
+
c(Ce, ["esc"])
|
|
281
|
+
],
|
|
282
|
+
onBlur: $e,
|
|
283
|
+
onFocus: Te
|
|
284
|
+
}, null, 40, We), [
|
|
285
|
+
[Oe, l.value]
|
|
286
|
+
])
|
|
287
|
+
])
|
|
288
|
+
], 16)
|
|
289
|
+
]),
|
|
290
|
+
f("div", He, [
|
|
291
|
+
k(e.$slots, "activity", F(A({ canClear: q.value, clear: oe, isInteractive: U.value })), () => [
|
|
292
|
+
q.value ? (r(), d("button", {
|
|
293
|
+
key: 0,
|
|
294
|
+
type: "button",
|
|
295
|
+
class: "tag-field-clear-button",
|
|
296
|
+
onClick: a(oe, ["stop"])
|
|
297
|
+
}, [
|
|
298
|
+
S(u(ue), { class: "size-[1.25em]" })
|
|
299
|
+
])) : (r(), R(Ve, {
|
|
300
|
+
key: 1,
|
|
301
|
+
name: "tag-field-fade"
|
|
302
|
+
}, {
|
|
303
|
+
default: K(() => [
|
|
304
|
+
e.activity && e.indicator ? (r(), R(u(Le), {
|
|
305
|
+
key: "activity",
|
|
306
|
+
type: e.indicator,
|
|
307
|
+
size: e.indicatorSize
|
|
308
|
+
}, null, 8, ["type", "size"])) : h("", !0)
|
|
309
|
+
]),
|
|
310
|
+
_: 1
|
|
311
|
+
}))
|
|
312
|
+
])
|
|
313
|
+
])
|
|
314
|
+
]),
|
|
315
|
+
k(e.$slots, "errors", F(A({ error: e.error, errors: e.errors, id: u(E).id, name: e.name })), () => [
|
|
316
|
+
e.error || e.errors ? (r(), R(u(Ne), {
|
|
317
|
+
key: 0,
|
|
318
|
+
id: u(E).id,
|
|
319
|
+
name: e.name,
|
|
320
|
+
error: e.error,
|
|
321
|
+
errors: e.errors
|
|
322
|
+
}, {
|
|
323
|
+
default: K(({ error: o }) => [
|
|
324
|
+
f("div", Qe, y(o), 1)
|
|
325
|
+
]),
|
|
326
|
+
_: 1
|
|
327
|
+
}, 8, ["id", "name", "error", "errors"])) : h("", !0)
|
|
328
|
+
]),
|
|
329
|
+
k(e.$slots, "feedback", F(A({ feedback: e.feedback })), () => [
|
|
330
|
+
S(u(je), { feedback: e.feedback }, {
|
|
331
|
+
default: K(({ feedback: o }) => [
|
|
332
|
+
f("div", Xe, y(o), 1)
|
|
333
|
+
]),
|
|
334
|
+
_: 1
|
|
335
|
+
}, 8, ["feedback"])
|
|
336
|
+
]),
|
|
337
|
+
k(e.$slots, "help", F(A({ helpText: e.helpText })), () => [
|
|
338
|
+
e.helpText ? (r(), d("small", Ye, y(e.helpText), 1)) : h("", !0)
|
|
339
|
+
]),
|
|
340
|
+
fe.value ? (r(), d("div", {
|
|
341
|
+
key: 0,
|
|
342
|
+
tabindex: "-1",
|
|
343
|
+
class: "tag-field-dropdown",
|
|
344
|
+
onMousedown: t[11] || (t[11] = a(() => {
|
|
345
|
+
}, ["prevent", "stop"]))
|
|
346
|
+
}, [
|
|
347
|
+
(r(!0), d(re, null, se(p.value, (o, g) => (r(), d("button", {
|
|
348
|
+
key: `option-${JSON.stringify(o)}`,
|
|
349
|
+
type: "button",
|
|
350
|
+
tabindex: "-1",
|
|
351
|
+
class: L({
|
|
352
|
+
"bg-neutral-100 dark:bg-neutral-800": i.value === g
|
|
353
|
+
}),
|
|
354
|
+
onMousedown: t[9] || (t[9] = a(() => {
|
|
355
|
+
}, ["prevent"])),
|
|
356
|
+
onMouseup: (w) => M(o)
|
|
357
|
+
}, [
|
|
358
|
+
f("div", _e, y(e.display?.(o) ?? o), 1)
|
|
359
|
+
], 42, Ze))), 128)),
|
|
360
|
+
e.allowCustom && l.value ? (r(), d("button", {
|
|
361
|
+
key: 0,
|
|
362
|
+
class: "flex items-center gap-1",
|
|
363
|
+
type: "button",
|
|
364
|
+
onMousedown: t[10] || (t[10] = a(() => {
|
|
365
|
+
}, ["prevent"])),
|
|
366
|
+
onMouseup: Ee
|
|
367
|
+
}, [
|
|
368
|
+
S(u(Ue), { class: "size-4" }),
|
|
369
|
+
H(" " + y(e.addTagLabel), 1)
|
|
370
|
+
], 32)) : h("", !0),
|
|
371
|
+
e.showNoResults && !p.value.length && !e.allowCustom ? (r(), d("div", et, [
|
|
372
|
+
k(e.$slots, "no-results", { input: l.value }, () => [
|
|
373
|
+
H(y(e.noResultsText), 1)
|
|
374
|
+
])
|
|
375
|
+
])) : h("", !0)
|
|
376
|
+
], 32)) : h("", !0)
|
|
377
|
+
], 2));
|
|
378
|
+
}
|
|
379
|
+
});
|
|
380
|
+
export {
|
|
381
|
+
st as TagField
|
|
382
|
+
};
|
|
383
|
+
//# sourceMappingURL=tag-field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag-field.js","sources":["../../../node_modules/.pnpm/@heroicons+vue@2.2.0_vue@3.5.27_typescript@5.9.3_/node_modules/@heroicons/vue/24/outline/esm/PlusIcon.js","../../../node_modules/.pnpm/@heroicons+vue@2.2.0_vue@3.5.27_typescript@5.9.3_/node_modules/@heroicons/vue/24/outline/esm/XMarkIcon.js","../src/TagField.vue"],"sourcesContent":["import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n \"stroke-width\": \"1.5\",\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\",\n \"data-slot\": \"icon\"\n }, [\n _createElementVNode(\"path\", {\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n d: \"M12 4.5v15m7.5-7.5h-15\"\n })\n ]))\n}","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n \"stroke-width\": \"1.5\",\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\",\n \"data-slot\": \"icon\"\n }, [\n _createElementVNode(\"path\", {\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n d: \"M6 18 18 6M6 6l12 12\"\n })\n ]))\n}","<script setup lang=\"ts\" generic=\"T, Value\">\nimport { PlusIcon, XMarkIcon } from '@heroicons/vue/24/outline';\nimport { ActivityIndicator } from '@vue-interface/activity-indicator';\nimport { Badge } from '@vue-interface/badge';\nimport type { FormControlEvents, FormControlProps, FormControlSlots } from '@vue-interface/form-control';\nimport { FormControlErrors, FormControlFeedback, useFormControl } from '@vue-interface/form-control';\nimport type { IFuseOptions } from 'fuse.js';\nimport Fuse from 'fuse.js';\nimport { isEqual } from 'lodash-es';\nimport { type HTMLAttributes, computed, onBeforeMount, onBeforeUnmount, ref, toRaw, unref, useTemplateRef, watch, type Ref } from 'vue';\n\nexport type TagFieldSizePrefix = 'form-control';\n\nexport type TagFieldProps<T, Value> = /* @vue-ignore */ FormControlProps<\n HTMLAttributes,\n TagFieldSizePrefix,\n T[],\n Value[]\n> & {\n options?: T[];\n fuseOptions?: IFuseOptions<T>;\n display?: (option: T) => string;\n format?: (value: string) => T;\n allowCustom?: boolean;\n addTagLabel?: string;\n noResultsText?: string;\n showNoResults?: boolean;\n clearable?: boolean;\n};\n\nconst props = withDefaults(defineProps<TagFieldProps<T, Value>>(), {\n formControlClass: 'form-control',\n labelClass: 'form-label',\n size: 'form-control-md',\n allowCustom: false,\n addTagLabel: 'Add Tag',\n noResultsText: 'No results found',\n showNoResults: true,\n clearable: false,\n options: () => [],\n});\n\ndefineOptions({\n inheritAttrs: false\n});\n\nconst model = defineModel<T[]>();\n\ndefineSlots<FormControlSlots<TagFieldSizePrefix, T[]> & {\n default(props: { option: T; display?: (option: T) => string }): any;\n 'no-results'(props: { input: string | undefined }): any;\n}>();\n\nconst emit = defineEmits<FormControlEvents>();\n\nconst {\n controlAttributes,\n formGroupClasses,\n listeners\n} = useFormControl<HTMLAttributes, TagFieldSizePrefix, T[]|undefined, Value[]>({ model, props, emit });\n\nconst wrapperEl = useTemplateRef('wrapperEl');\nconst inputEl = useTemplateRef('inputEl');\nconst tagEl = useTemplateRef('tagEl');\n\nconst input = ref<string>();\nconst selected = ref<T[]>([]) as Ref<T[]>;\nconst hasFocus = ref(false);\nconst focusIndex = ref<number>();\nconst options = ref(props.options) as Ref<T[]>;\n\nconst isInteractive = computed(() => !props.disabled && !props.readonly);\n\nconst canClear = computed(() => {\n return props.clearable && (!!input.value || !!model.value?.length) && isInteractive.value;\n});\n\nconst keys = computed(() => {\n return typeof props.options === 'object' && props.options?.[0]\n ? Object.keys(props.options?.[0])\n : [];\n});\n\nconst fuse: Fuse<T> = createFuse(props.options);\n\nconst showOptions = computed(() => {\n return hasFocus.value && (filtered.value.length || input.value);\n});\n\nconst selectedIndexes = computed(() => {\n return selected.value.map(tag => {\n return (model.value ?? []).findIndex(item => isEqual(item, tag));\n });\n});\n\nwatch(() => props.options, () => {\n options.value = props.options;\n});\n\nwatch(input, () => {\n hasFocus.value = true;\n focusIndex.value = undefined;\n\n deactivateTags();\n});\n\nfunction createFuse(items: T[]) {\n return new Fuse(items, props.fuseOptions ?? {\n includeScore: true,\n threshold: .45,\n keys: keys.value\n });\n}\n\nconst filtered = computed<T[]>(() => {\n const items = options.value.filter(option => {\n return !(model.value ?? []).find(item => {\n return isEqual(item, toRaw(unref(option)));\n });\n });\n\n if(!input.value) {\n return items;\n }\n\n fuse.setCollection(items as T[]);\n\n return fuse.search(input.value).map(({ item }) => item);\n});\n\nfunction addCustomTag(value: string) {\n const tag = props.format?.(value) ?? value as T;\n\n if(!options.value.find(option => isEqual(option, tag))) {\n options.value.push(tag);\n\n addTag(tag);\n\n input.value = undefined;\n }\n}\n\nfunction addTag(tag: T) {\n model.value = [...(model.value ?? []), tag];\n input.value = undefined;\n focusIndex.value = undefined;\n}\n\nfunction removeTag(tag: T) {\n const value = [...(model.value ?? [])];\n\n value.splice(value.indexOf(tag), 1);\n\n deactivateTag(tag);\n\n model.value = value;\n}\n\nfunction toggleActiveTag(tag: T, multiple = false) {\n if(!multiple) {\n deactivateTags(tag);\n }\n\n if(!isTagActive(tag)) {\n activateTag(tag);\n }\n else {\n deactivateTag(tag);\n }\n}\n\nfunction toggleActiveTagRange(tag: T) {\n const items = model.value ?? [];\n const index = items.indexOf(tag);\n const lastSelectedIndex = selectedIndexes.value[selectedIndexes.value.length - 1];\n const fn = !isTagActive(tag) ? activateTag : deactivateTag;\n\n if(lastSelectedIndex === undefined) {\n toggleActiveTag(tag);\n\n return;\n }\n\n let range: T[] = [];\n\n if(index > lastSelectedIndex) {\n range = items.slice(lastSelectedIndex, index + 1);\n }\n else if(index < lastSelectedIndex) {\n range = items.slice(index, lastSelectedIndex + 1);\n }\n\n for(const tag of range) {\n fn(tag);\n }\n}\n\nfunction selectAllTags() {\n if(input.value) {\n return;\n }\n\n selected.value = [...(model.value ?? [])];\n}\n\nfunction deactivateTags(omit?: T) {\n if(!omit) {\n selected.value = [];\n }\n else {\n const tags = selected.value.filter(\n item => !isEqual(item, omit)\n );\n\n for(const tag of tags) {\n deactivateTag(tag);\n }\n }\n\n blurTags();\n}\n\nfunction blurTags() {\n if(!tagEl.value) {\n return;\n }\n\n for(const tag of tagEl.value) {\n (tag?.$el as HTMLElement | undefined)?.blur();\n }\n}\n\nfunction isTagActive(tag: T) {\n return !!selected.value.find(item => isEqual(item, tag));\n}\n\nfunction activateTag(tag: T) {\n if(!isTagActive(tag)) {\n selected.value.push(tag);\n }\n}\n\nfunction deactivateTag(tag: T) {\n if(isTagActive(tag)) {\n selected.value.splice(selected.value.indexOf(tag), 1);\n }\n\n blurTags();\n}\n\nfunction removeActiveTags() {\n model.value = (model.value ?? []).filter(tag => {\n return !isTagActive(tag);\n });\n\n selected.value = [];\n}\n\nfunction onBackspace() {\n inputEl.value?.focus();\n\n if(input.value) {\n return;\n }\n\n if(selected.value.length) {\n removeActiveTags();\n }\n else if(model.value?.length) {\n removeTag(model.value[model.value.length - 1]);\n }\n}\n\nfunction onKeydownEnter(e: KeyboardEvent) {\n if(focusIndex.value !== undefined) {\n addTag(filtered.value[focusIndex.value]);\n }\n else if(filtered.value.length) {\n addTag(filtered.value[0]);\n }\n else if(props.allowCustom && input.value) {\n addCustomTag(input.value);\n }\n\n e.preventDefault();\n}\n\nfunction onKeydownSpace(e: KeyboardEvent) {\n if(focusIndex.value === undefined) {\n return;\n }\n\n addTag(filtered.value[focusIndex.value]);\n\n e.preventDefault();\n}\n\nfunction onKeydownUp() {\n if(!focusIndex.value) {\n focusIndex.value = filtered.value.length - 1;\n }\n else {\n focusIndex.value--;\n }\n}\n\nfunction onKeydownDown() {\n if(focusIndex.value === undefined || focusIndex.value === filtered.value.length - 1) {\n focusIndex.value = 0;\n }\n else {\n focusIndex.value++;\n }\n}\n\nfunction onKeydownLeft(multiple: boolean = false) {\n if(!model.value?.length || input.value) {\n return;\n }\n\n const nextIndex = Math.min(...selectedIndexes.value, model.value.length) - 1;\n\n if(model.value[nextIndex]) {\n toggleActiveTag(model.value[nextIndex], multiple);\n }\n else {\n deactivateTags();\n }\n}\n\nfunction onKeydownRight(multiple: boolean = false) {\n if(!model.value?.length || input.value) {\n return;\n }\n\n const nextIndex = Math.max(...selectedIndexes.value, -1) + 1;\n\n if(model.value[nextIndex]) {\n toggleActiveTag(model.value[nextIndex], multiple);\n }\n else {\n deactivateTags();\n }\n}\n\nfunction onEscape() {\n if(hasFocus.value) {\n hasFocus.value = false;\n }\n else {\n deactivateTags();\n }\n}\n\nfunction onBlur() {\n if(props.allowCustom && input.value) {\n addCustomTag(input.value);\n }\n\n hasFocus.value = false;\n\n deactivateTags();\n}\n\nfunction onFocus() {\n hasFocus.value = true;\n\n deactivateTags();\n}\n\nfunction onClickAddTag() {\n if(input.value) {\n addCustomTag(input.value);\n }\n}\n\nfunction clear() {\n if (!isInteractive.value) return;\n input.value = undefined;\n model.value = [];\n}\n\nfunction onClickOutsideWrapper(e: MouseEvent) {\n if(!e.target) {\n return;\n }\n\n if(!(wrapperEl.value == e.target || wrapperEl.value?.contains(e.target as Element))) {\n deactivateTags();\n }\n}\n\nfunction onDocumentKeydown(e: KeyboardEvent) {\n switch (e.key) {\n case 'Backspace':\n if(selected.value.length) {\n removeActiveTags();\n e.preventDefault();\n }\n break;\n case 'Escape':\n if(!hasFocus.value) {\n deactivateTags();\n }\n }\n}\n\nonBeforeMount(() => {\n document.addEventListener('click', onClickOutsideWrapper);\n document.addEventListener('keydown', onDocumentKeydown);\n});\n\nonBeforeUnmount(() => {\n document.removeEventListener('click', onClickOutsideWrapper);\n document.removeEventListener('keydown', onDocumentKeydown);\n});\n</script>\n\n<template>\n <div\n ref=\"wrapperEl\"\n class=\"tag-field\"\n :class=\"[formGroupClasses, { 'has-clear-button': canClear }]\">\n <slot name=\"label\">\n <label\n v-if=\"label\"\n :class=\"labelClass\"\n :for=\"controlAttributes.id\">\n {{ label }}\n </label>\n </slot>\n\n <div class=\"form-control-inner\">\n <slot\n name=\"control\"\n v-bind=\"{ controlAttributes, listeners }\">\n <div\n v-if=\"$slots.icon\"\n class=\"form-control-inner-icon\"\n @click=\"inputEl?.focus()\">\n <slot name=\"icon\" />\n </div>\n <div\n v-bind=\"controlAttributes\"\n class=\"form-control flex\"\n @click.self=\"inputEl?.focus()\">\n <div class=\"flex flex-wrap gap-2 mr-2 flex-1\">\n <Badge\n v-for=\"(tag, i) in model\"\n ref=\"tagEl\"\n :key=\"`tag-${i}`\"\n tabindex=\"-1\"\n size=\"badge-[.95em]\"\n class=\"badge-neutral-100 dark:badge-neutral-500\"\n :class=\"{\n 'badge-blue-600!': isTagActive(tag),\n }\"\n closeable\n @mousedown.prevent\n @close=\"removeTag(tag)\"\n @focus=\"toggleActiveTag(tag)\"\n @blur=\"deactivateTag(tag)\"\n @click.exact.meta=\"toggleActiveTag(tag, true)\"\n @click.exact=\"toggleActiveTag(tag)\"\n @click.exact.shift=\"toggleActiveTagRange(tag)\">\n <slot :option=\"tag\" :display=\"display\">\n {{ display?.(tag) ?? tag }}\n </slot>\n <template #close-icon>\n <XMarkIcon class=\"size-[1.25em]\" @mousedown.prevent />\n </template>\n </Badge>\n\n <input\n ref=\"inputEl\"\n v-model=\"input\"\n :placeholder=\"placeholder\"\n class=\"bg-transparent outline-none flex-1 min-w-0\"\n @keydown.exact.delete=\"onBackspace\"\n @keydown.exact.meta.a=\"selectAllTags\"\n @keydown.exact.enter=\"onKeydownEnter\"\n @keydown.exact.space=\"onKeydownSpace\"\n @keydown.exact.arrow-up=\"onKeydownUp\"\n @keydown.exact.arrow-down=\"onKeydownDown\"\n @keydown.exact.arrow-left=\"onKeydownLeft()\"\n @keydown.exact.shift.arrow-left=\"onKeydownLeft(true)\"\n @keydown.exact.arrow-right=\"onKeydownRight()\"\n @keydown.exact.shift.arrow-right=\"onKeydownRight(true)\"\n @keydown.esc=\"onEscape\"\n @blur=\"onBlur\"\n @focus=\"onFocus\">\n </div>\n </div>\n </slot>\n\n <div class=\"form-control-activity-indicator\">\n <slot name=\"activity\" v-bind=\"{ canClear, clear, isInteractive }\">\n <button\n v-if=\"canClear\"\n type=\"button\"\n class=\"tag-field-clear-button\"\n @click.stop=\"clear\">\n <XMarkIcon class=\"size-[1.25em]\" />\n </button>\n <Transition name=\"tag-field-fade\" v-else>\n <ActivityIndicator\n v-if=\"activity && indicator\"\n key=\"activity\"\n :type=\"indicator\"\n :size=\"indicatorSize\" />\n </Transition>\n </slot>\n </div>\n </div>\n\n <slot\n name=\"errors\"\n v-bind=\"{ error, errors, id: controlAttributes.id, name }\">\n <FormControlErrors\n v-if=\"!!(error || errors)\"\n :id=\"controlAttributes.id\"\n v-slot=\"{ error: err }\"\n :name=\"name\"\n :error=\"error\"\n :errors=\"errors\">\n <div\n invalid\n class=\"invalid-feedback\">\n {{ err }}\n </div>\n </FormControlErrors>\n </slot>\n\n <slot\n name=\"feedback\"\n v-bind=\"{ feedback }\">\n <FormControlFeedback\n v-slot=\"{ feedback: fb }\"\n :feedback=\"feedback\">\n <div\n valid\n class=\"valid-feedback\">\n {{ fb }}\n </div>\n </FormControlFeedback>\n </slot>\n\n <slot\n name=\"help\"\n v-bind=\"{ helpText }\">\n <small\n v-if=\"helpText\"\n class=\"form-help\">\n {{ helpText }}\n </small>\n </slot>\n\n <div\n v-if=\"showOptions\"\n tabindex=\"-1\"\n class=\"tag-field-dropdown\"\n @mousedown.prevent.stop>\n <button\n v-for=\"(option, i) in filtered\"\n :key=\"`option-${JSON.stringify(option)}`\"\n type=\"button\"\n tabindex=\"-1\"\n :class=\"{\n ['bg-neutral-100 dark:bg-neutral-800']: focusIndex === i\n }\"\n @mousedown.prevent\n @mouseup=\"addTag(option)\">\n <div class=\"truncate\">\n {{ display?.(option) ?? option }}\n </div>\n </button>\n <button\n v-if=\"allowCustom && input\"\n class=\"flex items-center gap-1\"\n type=\"button\"\n @mousedown.prevent\n @mouseup=\"onClickAddTag\">\n <PlusIcon class=\"size-4\" /> {{ addTagLabel }}\n </button>\n <div\n v-if=\"showNoResults && !filtered.length && !allowCustom\"\n class=\"py-2 px-4 text-neutral-400 dark:text-neutral-500\">\n <slot name=\"no-results\" :input=\"input\">\n {{ noResultsText }}\n </slot>\n </div>\n </div>\n </div>\n</template>\n"],"names":["render","_ctx","_cache","_openBlock","_createElementBlock","_createElementVNode","props","__props","model","_useModel","emit","__emit","controlAttributes","formGroupClasses","listeners","useFormControl","wrapperEl","useTemplateRef","inputEl","tagEl","input","ref","selected","hasFocus","focusIndex","options","isInteractive","computed","canClear","keys","fuse","createFuse","showOptions","filtered","selectedIndexes","tag","item","isEqual","watch","deactivateTags","items","Fuse","option","toRaw","unref","addCustomTag","value","addTag","removeTag","deactivateTag","toggleActiveTag","multiple","isTagActive","activateTag","toggleActiveTagRange","index","lastSelectedIndex","fn","range","selectAllTags","omit","tags","blurTags","removeActiveTags","onBackspace","onKeydownEnter","onKeydownSpace","onKeydownUp","onKeydownDown","onKeydownLeft","nextIndex","onKeydownRight","onEscape","onBlur","onFocus","onClickAddTag","clear","onClickOutsideWrapper","onDocumentKeydown","onBeforeMount","onBeforeUnmount","_normalizeClass","_unref","_renderSlot","label","labelClass","_hoisted_1","_hoisted_2","_normalizeProps","_guardReactiveProps","$slots","$event","_mergeProps","_withModifiers","_hoisted_3","_Fragment","_renderList","i","_createBlock","Badge","_createVNode","XMarkIcon","display","placeholder","_hoisted_5","_Transition","activity","indicator","ActivityIndicator","indicatorSize","error","errors","name","FormControlErrors","_withCtx","err","_hoisted_6","_toDisplayString","feedback","FormControlFeedback","fb","_hoisted_7","helpText","_hoisted_8","_hoisted_10","allowCustom","PlusIcon","_createTextVNode","addTagLabel","showNoResults","_hoisted_11","noResultsText"],"mappings":";;;;;;AAEe,SAASA,GAAOC,GAAMC,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