Socket
Socket
Sign inDemoInstall

vue-typeahead3

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-typeahead3 - npm Package Compare versions

Comparing version 1.1.1-rc2 to 1.1.3

6

dist/vue-typeahead.es.js

@@ -9,3 +9,3 @@ import { defineComponent, ref, toRefs, computed, watch, openBlock, createElementBlock, createElementVNode, withDirectives, normalizeClass, unref, withKeys, vModelText, Fragment, renderList, toDisplayString, createTextVNode, createCommentVNode, pushScopeId, popScopeId } from "vue";

};
const _withScopeId = (n) => (pushScopeId("data-v-50476530"), n = n(), popScopeId(), n);
const _withScopeId = (n) => (pushScopeId("data-v-5fa132ca"), n = n(), popScopeId(), n);
const _hoisted_1 = { class: "typeahead-container" };

@@ -89,4 +89,2 @@ const _hoisted_2 = { class: "search-container" };

watch(modelValue, (newVal, oldVal) => {
console.log(newVal);
console.log(oldVal);
if (newVal !== oldVal && newVal !== searchTerm.value) {

@@ -143,3 +141,3 @@ searchTerm.value = newVal;

});
var Typeahead = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-50476530"]]);
var Typeahead = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5fa132ca"]]);
Typeahead.install = function(app) {

@@ -146,0 +144,0 @@ app.component(Typeahead.name, Typeahead);

@@ -1,1 +0,1 @@

(function(s,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(s=typeof globalThis!="undefined"?globalThis:s||self,e(s.VueTypeahead={},s.Vue))})(this,function(s,e){"use strict";var b="",B=(n,f)=>{for(const[i,o]of f)n[i]=o;return n};const E=n=>(e.pushScopeId("data-v-50476530"),n=n(),e.popScopeId(),n),K={class:"typeahead-container"},V={class:"search-container"},C=["placeholder","onKeyup"],T={class:"results-container"},N={key:0,class:"results"},S=["onClick","onMouseover"],w={class:"category"},v={key:1},M={key:1,class:"results"},x=[E(()=>e.createElementVNode("li",null,"No results found!",-1))];var u=B(e.defineComponent({props:{modelValue:null,suggestions:null,placeholder:{default:"Type to search..."},searchKey:{default:"value"},categoryKey:{default:"category"},valueKey:{default:"value"},maxResults:{default:5}},emits:["update:modelValue"],setup(n,{emit:f}){const i=n,o=e.ref(""),d=e.ref(!1),a=e.ref(-1),{valueKey:h,suggestions:$,searchKey:I,modelValue:D}=e.toRefs(i),c=e.computed(()=>{var t;return!((t=o.value)==null?void 0:t.length)||d.value?[]:$.value.filter(l=>l[I.value].toLowerCase().includes(o.value.toLowerCase()))}),m=t=>(o.value=t[h.value],d.value=!0,f("update:modelValue",t)),y=t=>{t<0?a.value>0&&a.value--:t>0&&a.value<c.value.length-1&&a.value++},_=()=>(o.value="",d.value=!1,a.value=-1,f("update:modelValue",void 0)),F=()=>{o.value||_()},L=()=>{const t=c.value[a.value];m(t)},g=t=>{a.value=t},R=t=>t===a.value;return e.watch(D,(t,l)=>{console.log(t),console.log(l),t!==l&&t!==o.value&&(o.value=t)}),e.watch(o,t=>{(!t||t.length===0)&&(d.value=!1)}),(t,l)=>(e.openBlock(),e.createElementBlock("div",K,[e.createElementVNode("div",V,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":l[0]||(l[0]=r=>o.value=r),type:"search",placeholder:i.placeholder,class:e.normalizeClass({"has-results":e.unref(c).length}),onSearch:F,onKeyup:[l[1]||(l[1]=e.withKeys(r=>y(-1),["up"])),l[2]||(l[2]=e.withKeys(r=>y(1),["down"])),e.withKeys(_,["esc"]),e.withKeys(L,["enter"])]},null,42,C),[[e.vModelText,o.value]])]),e.createElementVNode("div",T,[e.unref(c).length&&!d.value?(e.openBlock(),e.createElementBlock("ul",N,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c),(r,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:p},[p<i.maxResults?(e.openBlock(),e.createElementBlock("li",{key:0,class:e.normalizeClass({focused:R(p)}),onClick:k=>m(r),onMouseover:k=>g(p),onMouseleave:l[3]||(l[3]=k=>g(-1))},[e.createElementVNode("h5",w,e.toDisplayString(r[n.categoryKey]),1),e.createTextVNode(" "+e.toDisplayString(r[e.unref(h)]),1)],42,S)):e.createCommentVNode("",!0),e.unref(c).length===0?(e.openBlock(),e.createElementBlock("li",v,"Test")):e.createCommentVNode("",!0)],64))),128))])):o.value&&!e.unref(c).length&&!d.value?(e.openBlock(),e.createElementBlock("ul",M,x)):e.createCommentVNode("",!0)])]))}}),[["__scopeId","data-v-50476530"]]);u.install=function(n){n.component(u.name,u)},s.default=u,Object.defineProperty(s,"__esModule",{value:!0}),s[Symbol.toStringTag]="Module"});
(function(s,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(s=typeof globalThis!="undefined"?globalThis:s||self,e(s.VueTypeahead={},s.Vue))})(this,function(s,e){"use strict";var b="",B=(n,f)=>{for(const[i,o]of f)n[i]=o;return n};const V=n=>(e.pushScopeId("data-v-5fa132ca"),n=n(),e.popScopeId(),n),E={class:"typeahead-container"},K={class:"search-container"},C=["placeholder","onKeyup"],T={class:"results-container"},N={key:0,class:"results"},w=["onClick","onMouseover"],S={class:"category"},v={key:1},M={key:1,class:"results"},x=[V(()=>e.createElementVNode("li",null,"No results found!",-1))];var u=B(e.defineComponent({props:{modelValue:null,suggestions:null,placeholder:{default:"Type to search..."},searchKey:{default:"value"},categoryKey:{default:"category"},valueKey:{default:"value"},maxResults:{default:5}},emits:["update:modelValue"],setup(n,{emit:f}){const i=n,o=e.ref(""),d=e.ref(!1),a=e.ref(-1),{valueKey:h,suggestions:$,searchKey:I,modelValue:D}=e.toRefs(i),c=e.computed(()=>{var t;return!((t=o.value)==null?void 0:t.length)||d.value?[]:$.value.filter(l=>l[I.value].toLowerCase().includes(o.value.toLowerCase()))}),m=t=>(o.value=t[h.value],d.value=!0,f("update:modelValue",t)),y=t=>{t<0?a.value>0&&a.value--:t>0&&a.value<c.value.length-1&&a.value++},_=()=>(o.value="",d.value=!1,a.value=-1,f("update:modelValue",void 0)),F=()=>{o.value||_()},L=()=>{const t=c.value[a.value];m(t)},k=t=>{a.value=t},R=t=>t===a.value;return e.watch(D,(t,l)=>{t!==l&&t!==o.value&&(o.value=t)}),e.watch(o,t=>{(!t||t.length===0)&&(d.value=!1)}),(t,l)=>(e.openBlock(),e.createElementBlock("div",E,[e.createElementVNode("div",K,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":l[0]||(l[0]=r=>o.value=r),type:"search",placeholder:i.placeholder,class:e.normalizeClass({"has-results":e.unref(c).length}),onSearch:F,onKeyup:[l[1]||(l[1]=e.withKeys(r=>y(-1),["up"])),l[2]||(l[2]=e.withKeys(r=>y(1),["down"])),e.withKeys(_,["esc"]),e.withKeys(L,["enter"])]},null,42,C),[[e.vModelText,o.value]])]),e.createElementVNode("div",T,[e.unref(c).length&&!d.value?(e.openBlock(),e.createElementBlock("ul",N,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c),(r,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:p},[p<i.maxResults?(e.openBlock(),e.createElementBlock("li",{key:0,class:e.normalizeClass({focused:R(p)}),onClick:g=>m(r),onMouseover:g=>k(p),onMouseleave:l[3]||(l[3]=g=>k(-1))},[e.createElementVNode("h5",S,e.toDisplayString(r[n.categoryKey]),1),e.createTextVNode(" "+e.toDisplayString(r[e.unref(h)]),1)],42,w)):e.createCommentVNode("",!0),e.unref(c).length===0?(e.openBlock(),e.createElementBlock("li",v,"Test")):e.createCommentVNode("",!0)],64))),128))])):o.value&&!e.unref(c).length&&!d.value?(e.openBlock(),e.createElementBlock("ul",M,x)):e.createCommentVNode("",!0)])]))}}),[["__scopeId","data-v-5fa132ca"]]);u.install=function(n){n.component(u.name,u)},s.default=u,Object.defineProperty(s,"__esModule",{value:!0}),s[Symbol.toStringTag]="Module"});
{
"name": "vue-typeahead3",
"version": "1.1.1-rc2",
"version": "1.1.3",
"files": [

@@ -5,0 +5,0 @@ "dist"

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc