@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
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(function(s,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@vue-interface/activity-indicator"),require("@vue-interface/badge"),require("@vue-interface/form-control"),require("fuse.js"),require("lodash-es")):typeof define=="function"&&define.amd?define(["exports","vue","@vue-interface/activity-indicator","@vue-interface/badge","@vue-interface/form-control","fuse.js","lodash-es"],e):(s=typeof globalThis<"u"?globalThis:s||self,e(s.TagField={},s.Vue,s.VueInterfaceActivityIndicator,s.VueInterfaceBadge,s.VueInterfaceFormControl,s.FuseJs,s.LodashEs))})(this,(function(s,e,U,J,v,G,h){"use strict";function W(B,T){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4.5v15m7.5-7.5h-15"})])}function z(B,T){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18 18 6M6 6l12 12"})])}const H=["for"],Q={class:"form-control-inner"},X={class:"flex flex-wrap gap-2 mr-2 flex-1"},Y=["placeholder","onKeydown"],Z={class:"form-control-activity-indicator"},_={invalid:"",class:"invalid-feedback"},ee={valid:"",class:"valid-feedback"},te={key:0,class:"form-help"},oe=["onMouseup"],ne={class:"truncate"},re={key:1,class:"py-2 px-4 text-neutral-400 dark:text-neutral-500"},le=e.defineComponent({inheritAttrs:!1,__name:"TagField",props:{modelValue:{},modelModifiers:{}},emits:e.mergeModels(["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"]),setup(B,{emit:T}){const i=B,r=e.useModel(B,"modelValue"),ie=T,{controlAttributes:y,formGroupClasses:ae,listeners:se}=v.useFormControl({model:r,props:i,emit:ie}),V=e.useTemplateRef("wrapperEl"),E=e.useTemplateRef("inputEl"),N=e.useTemplateRef("tagEl"),l=e.ref(),c=e.ref([]),m=e.ref(!1),a=e.ref(),C=e.ref(i.options),$=e.computed(()=>!i.disabled&&!i.readonly),S=e.computed(()=>i.clearable&&(!!l.value||!!r.value?.length)&&$.value),ce=e.computed(()=>typeof i.options=="object"&&i.options?.[0]?Object.keys(i.options?.[0]):[]),F=fe(i.options),de=e.computed(()=>m.value&&(d.value.length||l.value)),M=e.computed(()=>c.value.map(t=>(r.value??[]).findIndex(o=>h.isEqual(o,t))));e.watch(()=>i.options,()=>{C.value=i.options}),e.watch(l,()=>{m.value=!0,a.value=void 0,f()});function fe(t){return new G(t,i.fuseOptions??{includeScore:!0,threshold:.45,keys:ce.value})}const d=e.computed(()=>{const t=C.value.filter(o=>!(r.value??[]).find(n=>h.isEqual(n,e.toRaw(e.unref(o)))));return l.value?(F.setCollection(t),F.search(l.value).map(({item:o})=>o)):t});function x(t){const o=i.format?.(t)??t;C.value.find(n=>h.isEqual(n,o))||(C.value.push(o),g(o),l.value=void 0)}function g(t){r.value=[...r.value??[],t],l.value=void 0,a.value=void 0}function D(t){const o=[...r.value??[]];o.splice(o.indexOf(t),1),b(t),r.value=o}function k(t,o=!1){o||f(t),w(t)?b(t):R(t)}function ue(t){const o=r.value??[],n=o.indexOf(t),u=M.value[M.value.length-1],p=w(t)?b:R;if(u===void 0){k(t);return}let K=[];n>u?K=o.slice(u,n+1):n<u&&(K=o.slice(n,u+1));for(const Ce of K)p(Ce)}function pe(){l.value||(c.value=[...r.value??[]])}function f(t){if(!t)c.value=[];else{const o=c.value.filter(n=>!h.isEqual(n,t));for(const n of o)b(n)}I()}function I(){if(N.value)for(const t of N.value)t?.$el?.blur()}function w(t){return!!c.value.find(o=>h.isEqual(o,t))}function R(t){w(t)||c.value.push(t)}function b(t){w(t)&&c.value.splice(c.value.indexOf(t),1),I()}function P(){r.value=(r.value??[]).filter(t=>!w(t)),c.value=[]}function me(){E.value?.focus(),!l.value&&(c.value.length?P():r.value?.length&&D(r.value[r.value.length-1]))}function ke(t){a.value!==void 0?g(d.value[a.value]):d.value.length?g(d.value[0]):i.allowCustom&&l.value&&x(l.value),t.preventDefault()}function we(t){a.value!==void 0&&(g(d.value[a.value]),t.preventDefault())}function he(){a.value?a.value--:a.value=d.value.length-1}function ye(){a.value===void 0||a.value===d.value.length-1?a.value=0:a.value++}function q(t=!1){if(!r.value?.length||l.value)return;const o=Math.min(...M.value,r.value.length)-1;r.value[o]?k(r.value[o],t):f()}function A(t=!1){if(!r.value?.length||l.value)return;const o=Math.max(...M.value,-1)+1;r.value[o]?k(r.value[o],t):f()}function ge(){m.value?m.value=!1:f()}function be(){i.allowCustom&&l.value&&x(l.value),m.value=!1,f()}function Be(){m.value=!0,f()}function Ee(){l.value&&x(l.value)}function L(){$.value&&(l.value=void 0,r.value=[])}function O(t){t.target&&(V.value==t.target||V.value?.contains(t.target)||f())}function j(t){switch(t.key){case"Backspace":c.value.length&&(P(),t.preventDefault());break;case"Escape":m.value||f()}}return e.onBeforeMount(()=>{document.addEventListener("click",O),document.addEventListener("keydown",j)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",O),document.removeEventListener("keydown",j)}),(t,o)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperEl",ref:V,class:e.normalizeClass(["tag-field",[e.unref(ae),{"has-clear-button":S.value}]])},[e.renderSlot(t.$slots,"label",{},()=>[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,class:e.normalizeClass(t.labelClass),for:e.unref(y).id},e.toDisplayString(t.label),11,H)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Q,[e.renderSlot(t.$slots,"control",e.normalizeProps(e.guardReactiveProps({controlAttributes:e.unref(y),listeners:e.unref(se)})),()=>[t.$slots.icon?(e.openBlock(),e.createElementBlock("div",{key:0,class:"form-control-inner-icon",onClick:o[0]||(o[0]=n=>E.value?.focus())},[e.renderSlot(t.$slots,"icon")])):e.createCommentVNode("",!0),e.createElementVNode("div",e.mergeProps(e.unref(y),{class:"form-control flex",onClick:o[8]||(o[8]=e.withModifiers(n=>E.value?.focus(),["self"]))}),[e.createElementVNode("div",X,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(n,u)=>(e.openBlock(),e.createBlock(e.unref(J.Badge),{ref_for:!0,ref_key:"tagEl",ref:N,key:`tag-${u}`,tabindex:"-1",size:"badge-[.95em]",class:e.normalizeClass(["badge-neutral-100 dark:badge-neutral-500",{"badge-blue-600!":w(n)}]),closeable:"",onMousedown:o[2]||(o[2]=e.withModifiers(()=>{},["prevent"])),onClose:p=>D(n),onFocus:p=>k(n),onBlur:p=>b(n),onClick:[e.withModifiers(p=>k(n,!0),["exact","meta"]),e.withModifiers(p=>k(n),["exact"]),e.withModifiers(p=>ue(n),["exact","shift"])]},{"close-icon":e.withCtx(()=>[e.createVNode(e.unref(z),{class:"size-[1.25em]",onMousedown:o[1]||(o[1]=e.withModifiers(()=>{},["prevent"]))})]),default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{option:n,display:t.display},()=>[e.createTextVNode(e.toDisplayString(t.display?.(n)??n),1)])]),_:2},1032,["class","onClose","onFocus","onBlur","onClick"]))),128)),e.withDirectives(e.createElementVNode("input",{ref_key:"inputEl",ref:E,"onUpdate:modelValue":o[3]||(o[3]=n=>l.value=n),placeholder:t.placeholder,class:"bg-transparent outline-none flex-1 min-w-0",onKeydown:[e.withKeys(e.withModifiers(me,["exact"]),["delete"]),e.withKeys(e.withModifiers(pe,["exact","meta"]),["a"]),e.withKeys(e.withModifiers(ke,["exact"]),["enter"]),e.withKeys(e.withModifiers(we,["exact"]),["space"]),e.withKeys(e.withModifiers(he,["exact"]),["arrow-up"]),e.withKeys(e.withModifiers(ye,["exact"]),["arrow-down"]),o[4]||(o[4]=e.withKeys(e.withModifiers(n=>q(),["exact"]),["arrow-left"])),o[5]||(o[5]=e.withKeys(e.withModifiers(n=>q(!0),["exact","shift"]),["arrow-left"])),o[6]||(o[6]=e.withKeys(e.withModifiers(n=>A(),["exact"]),["arrow-right"])),o[7]||(o[7]=e.withKeys(e.withModifiers(n=>A(!0),["exact","shift"]),["arrow-right"])),e.withKeys(ge,["esc"])],onBlur:be,onFocus:Be},null,40,Y),[[e.vModelText,l.value]])])],16)]),e.createElementVNode("div",Z,[e.renderSlot(t.$slots,"activity",e.normalizeProps(e.guardReactiveProps({canClear:S.value,clear:L,isInteractive:$.value})),()=>[S.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"tag-field-clear-button",onClick:e.withModifiers(L,["stop"])},[e.createVNode(e.unref(z),{class:"size-[1.25em]"})])):(e.openBlock(),e.createBlock(e.Transition,{key:1,name:"tag-field-fade"},{default:e.withCtx(()=>[t.activity&&t.indicator?(e.openBlock(),e.createBlock(e.unref(U.ActivityIndicator),{key:"activity",type:t.indicator,size:t.indicatorSize},null,8,["type","size"])):e.createCommentVNode("",!0)]),_:1}))])])]),e.renderSlot(t.$slots,"errors",e.normalizeProps(e.guardReactiveProps({error:t.error,errors:t.errors,id:e.unref(y).id,name:t.name})),()=>[t.error||t.errors?(e.openBlock(),e.createBlock(e.unref(v.FormControlErrors),{key:0,id:e.unref(y).id,name:t.name,error:t.error,errors:t.errors},{default:e.withCtx(({error:n})=>[e.createElementVNode("div",_,e.toDisplayString(n),1)]),_:1},8,["id","name","error","errors"])):e.createCommentVNode("",!0)]),e.renderSlot(t.$slots,"feedback",e.normalizeProps(e.guardReactiveProps({feedback:t.feedback})),()=>[e.createVNode(e.unref(v.FormControlFeedback),{feedback:t.feedback},{default:e.withCtx(({feedback:n})=>[e.createElementVNode("div",ee,e.toDisplayString(n),1)]),_:1},8,["feedback"])]),e.renderSlot(t.$slots,"help",e.normalizeProps(e.guardReactiveProps({helpText:t.helpText})),()=>[t.helpText?(e.openBlock(),e.createElementBlock("small",te,e.toDisplayString(t.helpText),1)):e.createCommentVNode("",!0)]),de.value?(e.openBlock(),e.createElementBlock("div",{key:0,tabindex:"-1",class:"tag-field-dropdown",onMousedown:o[11]||(o[11]=e.withModifiers(()=>{},["prevent","stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(n,u)=>(e.openBlock(),e.createElementBlock("button",{key:`option-${JSON.stringify(n)}`,type:"button",tabindex:"-1",class:e.normalizeClass({"bg-neutral-100 dark:bg-neutral-800":a.value===u}),onMousedown:o[9]||(o[9]=e.withModifiers(()=>{},["prevent"])),onMouseup:p=>g(n)},[e.createElementVNode("div",ne,e.toDisplayString(t.display?.(n)??n),1)],42,oe))),128)),t.allowCustom&&l.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"flex items-center gap-1",type:"button",onMousedown:o[10]||(o[10]=e.withModifiers(()=>{},["prevent"])),onMouseup:Ee},[e.createVNode(e.unref(W),{class:"size-4"}),e.createTextVNode(" "+e.toDisplayString(t.addTagLabel),1)],32)):e.createCommentVNode("",!0),t.showNoResults&&!d.value.length&&!t.allowCustom?(e.openBlock(),e.createElementBlock("div",re,[e.renderSlot(t.$slots,"no-results",{input:l.value},()=>[e.createTextVNode(e.toDisplayString(t.noResultsText),1)])])):e.createCommentVNode("",!0)],32)):e.createCommentVNode("",!0)],2))}});s.TagField=le,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})}));
|
|
2
|
+
//# sourceMappingURL=tag-field.umd.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag-field.umd.cjs","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","e","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":"qnBAEe,SAASA,EAAOC,EAAMC,EAAQ,CAC3C,OAAQC,EAAAA,UAAU,EAAIC,EAAAA,mBAAoB,MAAO,CAC/C,MAAO,6BACP,KAAM,OACN,QAAS,YACT,eAAgB,MAChB,OAAQ,eACR,cAAe,OACf,YAAa,MACjB,EAAK,CACDC,EAAAA,mBAAoB,OAAQ,CAC1B,iBAAkB,QAClB,kBAAmB,QACnB,EAAG,wBACT,CAAK,CACL,CAAG,CACH,CChBe,SAASL,EAAOC,EAAMC,EAAQ,CAC3C,OAAQC,EAAAA,UAAU,EAAIC,EAAAA,mBAAoB,MAAO,CAC/C,MAAO,6BACP,KAAM,OACN,QAAS,YACT,eAAgB,MAChB,OAAQ,eACR,cAAe,OACf,YAAa,MACjB,EAAK,CACDC,EAAAA,mBAAoB,OAAQ,CAC1B,iBAAkB,QAClB,kBAAmB,QACnB,EAAG,sBACT,CAAK,CACL,CAAG,CACH,g4BCYA,MAAMC,EAAQC,EAgBRC,EAAQC,EAAAA,uBAAiB,EAOzBC,GAAOC,EAEP,CACF,kBAAAC,EACA,iBAAAC,GACA,UAAAC,EAAA,EACAC,EAAAA,eAA2E,CAAE,MAAAP,EAAO,MAAAF,EAAO,KAAAI,GAAM,EAE/FM,EAAYC,EAAAA,eAAe,WAAW,EACtCC,EAAUD,EAAAA,eAAe,SAAS,EAClCE,EAAQF,EAAAA,eAAe,OAAO,EAE9BG,EAAQC,EAAAA,IAAA,EACRC,EAAWD,EAAAA,IAAS,EAAE,EACtBE,EAAWF,EAAAA,IAAI,EAAK,EACpBG,EAAaH,EAAAA,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AEOnF,EAAA,OAAA,aAAA,CAFkB,MAAOmB,EAAA,KAAA,EAAhC,IAEO,qCADAgH,EAAAA,aAAa,EAAA,CAAA,CAAA","x_google_ignoreList":[0,1]}
|
package/index.css
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vue-interface/tag-field",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A Vue tag field component.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/tag-field.umd.cjs",
|
|
7
|
+
"module": "./dist/tag-field.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"source": "./index.ts",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"style": "./index.css",
|
|
14
|
+
"import": "./dist/tag-field.js",
|
|
15
|
+
"require": "./dist/tag-field.umd.cjs"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"browserslist": "last 2 versions, > 0.5%, ie >= 11",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/vue-interface/vue-interface.github.io"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [
|
|
24
|
+
"Tag",
|
|
25
|
+
"Input",
|
|
26
|
+
"Field",
|
|
27
|
+
"Vue",
|
|
28
|
+
"Component",
|
|
29
|
+
"Tailwind"
|
|
30
|
+
],
|
|
31
|
+
"author": "Justin Kimbrell",
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"bugs": {
|
|
34
|
+
"url": "https://github.com/vue-interface/vue-interface.github.io"
|
|
35
|
+
},
|
|
36
|
+
"homepage": "https://vue-interface.github.io/packages/tag-field",
|
|
37
|
+
"readme": "README.md",
|
|
38
|
+
"files": [
|
|
39
|
+
"src",
|
|
40
|
+
"dist",
|
|
41
|
+
"index.css",
|
|
42
|
+
"README.md",
|
|
43
|
+
"LICENSE"
|
|
44
|
+
],
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"@heroicons/vue": "2.2.0",
|
|
47
|
+
"fuse.js": "^7.1.0",
|
|
48
|
+
"lodash-es": "^4.17.23",
|
|
49
|
+
"vue": "^3.3.4",
|
|
50
|
+
"@vue-interface/badge": "3.1.4",
|
|
51
|
+
"@vue-interface/sizeable": "2.0.0",
|
|
52
|
+
"@vue-interface/activity-indicator": "3.0.8",
|
|
53
|
+
"@vue-interface/form-control": "2.0.23"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@types/lodash-es": "^4.17.12"
|
|
57
|
+
},
|
|
58
|
+
"scripts": {
|
|
59
|
+
"dev": "vite",
|
|
60
|
+
"build": "vue-tsc && vite build",
|
|
61
|
+
"preview": "vite preview"
|
|
62
|
+
}
|
|
63
|
+
}
|