vue-instantsearch 4.8.7 → 4.8.9

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.
Files changed (27) hide show
  1. package/package.json +3 -3
  2. package/src/components/SearchInput.vue +3 -2
  3. package/src/components/__tests__/InstantSearch.js +32 -0
  4. package/src/components/__tests__/__snapshots__/RefinementList.js.snap +10 -8
  5. package/src/components/__tests__/__snapshots__/SearchBox.js.snap +5 -4
  6. package/src/util/createInstantSearchComponent.js +6 -0
  7. package/vue2/cjs/index.js +1 -1
  8. package/vue2/cjs/index.js.map +1 -1
  9. package/vue2/es/package.json.js +1 -1
  10. package/vue2/es/src/components/SearchInput.vue.js +1 -1
  11. package/vue2/es/src/util/createInstantSearchComponent.js +1 -1
  12. package/vue2/es/src/util/createInstantSearchComponent.js.map +1 -1
  13. package/vue2/umd/index.js +1 -1
  14. package/vue2/umd/index.js.map +1 -1
  15. package/vue3/cjs/index.js +1 -1
  16. package/vue3/cjs/index.js.map +1 -1
  17. package/vue3/es/package.json.js +1 -1
  18. package/vue3/es/src/components/SearchInput.vue.js +1 -1
  19. package/vue3/es/src/components/SearchInput.vue_vue&type=script&lang.js.map +1 -1
  20. package/vue3/es/src/components/SearchInput.vue_vue&type=template&id=00f0f603&lang.js +2 -0
  21. package/vue3/es/src/components/SearchInput.vue_vue&type=template&id=00f0f603&lang.js.map +1 -0
  22. package/vue3/es/src/util/createInstantSearchComponent.js +1 -1
  23. package/vue3/es/src/util/createInstantSearchComponent.js.map +1 -1
  24. package/vue3/umd/index.js +1 -1
  25. package/vue3/umd/index.js.map +1 -1
  26. package/vue3/es/src/components/SearchInput.vue_vue&type=template&id=084af36e&lang.js +0 -2
  27. package/vue3/es/src/components/SearchInput.vue_vue&type=template&id=084af36e&lang.js.map +0 -1
@@ -1,2 +0,0 @@
1
- import{openBlock as t,createBlock as e,withModifiers as o,createVNode as i,renderSlot as n,createCommentVNode as l}from"vue";var r=i("path",{d:"M26.804 29.01c-2.832 2.34-6.465 3.746-10.426 3.746C7.333 32.756 0 25.424 0 16.378 0 7.333 7.333 0 16.378 0c9.046 0 16.378 7.333 16.378 16.378 0 3.96-1.406 7.594-3.746 10.426l10.534 10.534c.607.607.61 1.59-.004 2.202-.61.61-1.597.61-2.202.004L26.804 29.01zm-10.426.627c7.323 0 13.26-5.936 13.26-13.26 0-7.32-5.937-13.257-13.26-13.257C9.056 3.12 3.12 9.056 3.12 16.378c0 7.323 5.936 13.26 13.258 13.26z",fillRule:"evenodd"},null,-1),a=i("path",{d:"M8.114 10L.944 2.83 0 1.885 1.886 0l.943.943L10 8.113l7.17-7.17.944-.943L20 1.886l-.943.943-7.17 7.17 7.17 7.17.943.944L18.114 20l-.943-.943-7.17-7.17-7.17 7.17-.944.943L0 18.114l.943-.943L8.113 10z",fillRule:"evenodd"},null,-1),s=i("g",{fill:"none","fill-rule":"evenodd"},[i("g",{transform:"translate(1 1)","stroke-width":"2"},[i("circle",{"stroke-opacity":".5",cx:"18",cy:"18",r:"18"}),i("path",{d:"M36 18c0-9.94-8.06-18-18-18"},[i("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})])])],-1);function u(u,c,d,h,m,f){return t(),e("form",{action:"",role:"search",novalidate:"",class:u.suit("form"),onSubmit:c[4]||(c[4]=o(function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return f.onFormSubmit&&f.onFormSubmit.apply(f,t)},["prevent"])),onReset:c[5]||(c[5]=o(function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return f.onFormReset&&f.onFormReset.apply(f,t)},["prevent"]))},[i("input",{type:"search",autocorrect:"off",autocapitalize:"off",autocomplete:"off",spellcheck:"false",required:"",maxlength:"512","aria-label":"Search",placeholder:d.placeholder,autofocus:d.autofocus,class:u.suit("input"),value:d.value||d.modelValue,onFocus:c[1]||(c[1]=function(t){return u.$emit("focus",t)}),onBlur:c[2]||(c[2]=function(t){return u.$emit("blur",t)}),onInput:c[3]||(c[3]=function(t){u.$emit("input",t.target.value),u.$emit("update:modelValue",t.target.value)}),ref:"input"},null,42,["placeholder","autofocus","value"]),i("button",{type:"submit",title:d.submitTitle,class:u.suit("submit"),hidden:d.showLoadingIndicator&&d.shouldShowLoadingIndicator},[n(u.$slots,"submit-icon",{},function(){return[(t(),e("svg",{role:"img",xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 40 40",class:u.suit("submitIcon")},[r],2))]})],10,["title","hidden"]),i("button",{type:"reset",title:d.resetTitle,class:u.suit("reset"),hidden:!d.value&&!d.modelValue||d.showLoadingIndicator&&d.shouldShowLoadingIndicator},[n(u.$slots,"reset-icon",{},function(){return[(t(),e("svg",{role:"img",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 20 20",class:u.suit("resetIcon")},[a],2))]})],10,["title","hidden"]),d.showLoadingIndicator?(t(),e("span",{key:0,hidden:!d.shouldShowLoadingIndicator,class:u.suit("loadingIndicator")},[n(u.$slots,"loading-indicator",{},function(){return[(t(),e("svg",{role:"img","aria-label":"Results are loading",width:"16",height:"16",xmlns:"http://www.w3.org/2000/svg",stroke:"#444",viewBox:"0 0 38 38",class:u.suit("loadingIcon")},[s],2))]})],10,["hidden"])):l("",!0)],34)}export{u as render};
2
- //# sourceMappingURL=SearchInput.vue_vue&type=template&id=084af36e&lang.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SearchInput.vue_vue&type=template&id=084af36e&lang.js","sources":["../../../../src/components/SearchInput.vue?vue&type=template&id=084af36e&lang.js"],"sourcesContent":["<template>\n <form\n action=\"\"\n role=\"search\"\n novalidate\n :class=\"suit('form')\"\n @submit.prevent=\"onFormSubmit\"\n @reset.prevent=\"onFormReset\"\n >\n <!-- :value/@input allows us to pass v-model to the component in v2 -->\n <!-- :modelValue/@update:modelValue allows us to pass v-model to the component in v3 -->\n <input\n type=\"search\"\n autocorrect=\"off\"\n autocapitalize=\"off\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n required\n maxlength=\"512\"\n aria-label=\"Search\"\n :placeholder=\"placeholder\"\n :autofocus=\"autofocus\"\n :class=\"suit('input')\"\n :value=\"value || modelValue\"\n @focus=\"$emit('focus', $event)\"\n @blur=\"$emit('blur', $event)\"\n @input=\"\n $emit('input', $event.target.value);\n $emit('update:modelValue', $event.target.value);\n \"\n ref=\"input\"\n />\n <button\n type=\"submit\"\n :title=\"submitTitle\"\n :class=\"suit('submit')\"\n :hidden=\"showLoadingIndicator && shouldShowLoadingIndicator\"\n >\n <slot name=\"submit-icon\">\n <svg\n role=\"img\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"10\"\n height=\"10\"\n viewBox=\"0 0 40 40\"\n :class=\"suit('submitIcon')\"\n >\n <path\n d=\"M26.804 29.01c-2.832 2.34-6.465 3.746-10.426 3.746C7.333 32.756 0 25.424 0 16.378 0 7.333 7.333 0 16.378 0c9.046 0 16.378 7.333 16.378 16.378 0 3.96-1.406 7.594-3.746 10.426l10.534 10.534c.607.607.61 1.59-.004 2.202-.61.61-1.597.61-2.202.004L26.804 29.01zm-10.426.627c7.323 0 13.26-5.936 13.26-13.26 0-7.32-5.937-13.257-13.26-13.257C9.056 3.12 3.12 9.056 3.12 16.378c0 7.323 5.936 13.26 13.258 13.26z\"\n fillRule=\"evenodd\"\n />\n </svg>\n </slot>\n </button>\n\n <button\n type=\"reset\"\n :title=\"resetTitle\"\n :class=\"suit('reset')\"\n :hidden=\"\n (!value && !modelValue) ||\n (showLoadingIndicator && shouldShowLoadingIndicator)\n \"\n >\n <slot name=\"reset-icon\">\n <svg\n role=\"img\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 20 20\"\n :class=\"suit('resetIcon')\"\n >\n <path\n d=\"M8.114 10L.944 2.83 0 1.885 1.886 0l.943.943L10 8.113l7.17-7.17.944-.943L20 1.886l-.943.943-7.17 7.17 7.17 7.17.943.944L18.114 20l-.943-.943-7.17-7.17-7.17 7.17-.944.943L0 18.114l.943-.943L8.113 10z\"\n fillRule=\"evenodd\"\n />\n </svg>\n </slot>\n </button>\n\n <span\n v-if=\"showLoadingIndicator\"\n :hidden=\"!shouldShowLoadingIndicator\"\n :class=\"suit('loadingIndicator')\"\n >\n <slot name=\"loading-indicator\">\n <svg\n role=\"img\"\n aria-label=\"Results are loading\"\n width=\"16\"\n height=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n stroke=\"#444\"\n viewBox=\"0 0 38 38\"\n :class=\"suit('loadingIcon')\"\n >\n <g fill=\"none\" fill-rule=\"evenodd\">\n <g transform=\"translate(1 1)\" stroke-width=\"2\">\n <circle stroke-opacity=\".5\" cx=\"18\" cy=\"18\" r=\"18\" />\n <path d=\"M36 18c0-9.94-8.06-18-18-18\">\n <animateTransform\n attributeName=\"transform\"\n type=\"rotate\"\n from=\"0 18 18\"\n to=\"360 18 18\"\n dur=\"1s\"\n repeatCount=\"indefinite\"\n />\n </path>\n </g>\n </g>\n </svg>\n </slot>\n </span>\n </form>\n</template>\n\n<script>\nimport { createSuitMixin } from '../mixins/suit';\n\nexport default {\n name: 'SearchInput',\n mixins: [createSuitMixin({ name: 'SearchBox' })],\n props: {\n placeholder: {\n type: String,\n default: 'Search here…',\n },\n autofocus: {\n type: Boolean,\n default: false,\n },\n showLoadingIndicator: {\n type: Boolean,\n default: false,\n },\n shouldShowLoadingIndicator: {\n type: Boolean,\n default: false,\n },\n submitTitle: {\n type: String,\n default: 'Search',\n },\n resetTitle: {\n type: String,\n default: 'Clear',\n },\n value: {\n type: String,\n required: false,\n default: undefined,\n },\n modelValue: {\n type: String,\n required: false,\n default: undefined,\n },\n },\n emits: ['input', 'update:modelValue', 'blur', 'focus', 'reset'],\n data() {\n return {\n query: '',\n };\n },\n methods: {\n isFocused() {\n return document.activeElement === this.$refs.input;\n },\n onFormSubmit() {\n const input = this.$refs.input;\n input.blur();\n },\n onFormReset() {\n this.$emit('input', '');\n this.$emit('update:modelValue', '');\n this.$emit('reset');\n },\n },\n};\n</script>\n"],"names":["_createVNode","d","fillRule","fill","fill-rule","transform","stroke-width","stroke-opacity","cx","cy","r","attributeName","type","from","to","dur","repeatCount","_createBlock","action","role","novalidate","class","_ctx","onSubmit","$options","onReset","autocorrect","autocapitalize","autocomplete","spellcheck","required","maxlength","aria-label","placeholder","$props","autofocus","value","onFocus","$event","onBlur","onInput","ref","title","hidden","_renderSlot","xmlns","width","height","viewBox","_hoisted_1","_hoisted_2","stroke","_hoisted_3"],"mappings":"mIA+CUA,UACEC,EAAE,mZACFC,SAAS,sBAwBXF,UACEC,EAAE,yMACFC,SAAS,sBAsBXF,OAAGG,KAAK,OAAOC,YAAU,YACvBJ,OAAGK,UAAU,iBAAiBC,eAAa,MACzCN,YAAQO,iBAAe,KAAKC,GAAG,KAAKC,GAAG,KAAKC,EAAE,OAC9CV,UAAMC,EAAE,gCACND,sBACEW,cAAc,YACdC,KAAK,SACLC,KAAK,UACLC,GAAG,YACHC,IAAI,KACJC,YAAY,2DA1G5BC,UACEC,OAAO,GACPC,KAAK,SACLC,WAAA,GACCC,MAAOC,eACPC,gGAAgBC,yDAChBC,+FAAeD,yDAIhBxB,WACEY,KAAK,SACLc,YAAY,MACZC,eAAe,MACfC,aAAa,MACbC,WAAW,QACXC,SAAA,GACAC,UAAU,MACVC,aAAW,SACVC,YAAaC,cACbC,UAAWD,YACXb,MAAOC,gBACPc,MAAOF,SAASA,aAChBG,uCAAOf,gBAAegB,KACtBC,sCAAMjB,eAAcgB,KACpBE,8GAIDC,IAAI,sDAENzC,YACEY,KAAK,SACJ8B,MAAOR,cACPb,MAAOC,iBACPqB,OAAQT,wBAAwBA,+BAEjCU,mDACE3B,SACEE,KAAK,MACL0B,MAAM,6BACNC,MAAM,KACNC,OAAO,KACPC,QAAQ,YACP3B,MAAOC,uBAER2B,kCAQNjD,YACEY,KAAK,QACJ8B,MAAOR,aACPb,MAAOC,gBACPqB,uFAKDC,kDACE3B,SACEE,KAAK,MACL0B,MAAM,6BACNC,MAAM,MACNC,OAAO,MACPC,QAAQ,YACP3B,MAAOC,sBAER4B,kCASEhB,4BADRjB,gBAEG0B,QAAST,6BACTb,MAAOC,6BAERsB,yDACE3B,SACEE,KAAK,MACLa,aAAW,sBACXc,MAAM,KACNC,OAAO,KACPF,MAAM,6BACNM,OAAO,OACPH,QAAQ,YACP3B,MAAOC,wBAER8B"}