vue-instantsearch 4.13.5 → 4.13.7

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 (31) hide show
  1. package/package.json +3 -3
  2. package/src/components/SearchBox.vue +5 -0
  3. package/src/components/SearchInput.vue +5 -1
  4. package/src/util/vue-compat/index-vue3.js +9 -1
  5. package/vue2/cjs/index.js +1 -1
  6. package/vue2/cjs/index.js.map +1 -1
  7. package/vue2/es/package.json.js +1 -1
  8. package/vue2/es/src/components/SearchBox.vue.js +1 -1
  9. package/vue2/es/src/components/SearchBox.vue_rollup-plugin-vue=script.js +1 -1
  10. package/vue2/es/src/components/SearchInput.vue_rollup-plugin-vue=script.js +1 -1
  11. package/vue2/umd/index.js +1 -1
  12. package/vue2/umd/index.js.map +1 -1
  13. package/vue3/cjs/index.js +1 -1
  14. package/vue3/cjs/index.js.map +1 -1
  15. package/vue3/es/package.json.js +1 -1
  16. package/vue3/es/src/components/SearchBox.vue.js +1 -1
  17. package/vue3/es/src/components/SearchBox.vue_vue&type=script&lang.js +1 -1
  18. package/vue3/es/src/components/SearchBox.vue_vue&type=script&lang.js.map +1 -1
  19. package/vue3/es/src/components/SearchBox.vue_vue&type=template&id=b43316e4&lang.js +2 -0
  20. package/vue3/es/src/components/SearchBox.vue_vue&type=template&id=b43316e4&lang.js.map +1 -0
  21. package/vue3/es/src/components/SearchInput.vue.js +1 -1
  22. package/vue3/es/src/components/SearchInput.vue_vue&type=script&lang.js +1 -1
  23. package/vue3/es/src/components/SearchInput.vue_vue&type=script&lang.js.map +1 -1
  24. package/vue3/es/src/components/{SearchInput.vue_vue&type=template&id=3a66396c&lang.js → SearchInput.vue_vue&type=template&id=02fb82e2&lang.js} +1 -1
  25. package/vue3/es/src/components/{SearchInput.vue_vue&type=template&id=3a66396c&lang.js.map → SearchInput.vue_vue&type=template&id=02fb82e2&lang.js.map} +1 -1
  26. package/vue3/es/src/util/vue-compat/index-vue3.js +1 -1
  27. package/vue3/es/src/util/vue-compat/index-vue3.js.map +1 -1
  28. package/vue3/umd/index.js +1 -1
  29. package/vue3/umd/index.js.map +1 -1
  30. package/vue3/es/src/components/SearchBox.vue_vue&type=template&id=47fdc6ba&lang.js +0 -2
  31. package/vue3/es/src/components/SearchBox.vue_vue&type=template&id=47fdc6ba&lang.js.map +0 -1
@@ -1,2 +0,0 @@
1
- import{resolveComponent as e,openBlock as t,createElementBlock as n,normalizeClass as i,renderSlot as o,createVNode as s,createSlots as r,withCtx as u,createCommentVNode as a}from"vue";function l(l,c,d,f,m,h){var $=e("search-input");return l.state?(t(),n("div",{key:0,class:i(l.suit())},[o(l.$slots,"default",{currentRefinement:h.currentRefinement,isSearchStalled:l.state.isSearchStalled,refine:l.state.refine},function(){return[s($,{onFocus:c[0]||(c[0]=function(e){return l.$emit("focus",e)}),onBlur:c[1]||(c[1]=function(e){return l.$emit("blur",e)}),onReset:c[2]||(c[2]=function(e){return l.$emit("reset")}),placeholder:d.placeholder,autofocus:d.autofocus,"show-loading-indicator":d.showLoadingIndicator,"should-show-loading-indicator":l.state.isSearchStalled,"submit-title":d.submitTitle,"reset-title":d.resetTitle,"class-names":l.classNames,modelValue:h.currentRefinement,"onUpdate:modelValue":c[3]||(c[3]=function(e){return h.currentRefinement=e}),ref:"searchInput"},r({default:u(function(){return[m.isVue2?o(l.$slots,"loading-indicator",{key:0,slot:"loading-indicator"}):a("",!0),m.isVue2?o(l.$slots,"submit-icon",{key:1,slot:"submit-icon"}):a("",!0),m.isVue2?o(l.$slots,"reset-icon",{key:2,slot:"reset-icon"}):a("",!0)]}),_:2},[m.isVue3?{name:"loading-indicator",fn:u(function(){return[o(l.$slots,"loading-indicator")]}),key:"0"}:void 0,m.isVue3?{name:"submit-icon",fn:u(function(){return[o(l.$slots,"submit-icon")]}),key:"1"}:void 0,m.isVue3?{name:"reset-icon",fn:u(function(){return[o(l.$slots,"reset-icon")]}),key:"2"}:void 0]),1032,["placeholder","autofocus","show-loading-indicator","should-show-loading-indicator","submit-title","reset-title","class-names","modelValue"])]})],2)):a("",!0)}export{l as render};
2
- //# sourceMappingURL=SearchBox.vue_vue&type=template&id=47fdc6ba&lang.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SearchBox.vue_vue&type=template&id=47fdc6ba&lang.js","sources":["../../../../src/components/SearchBox.vue?vue&type=template&id=47fdc6ba&lang.js"],"sourcesContent":["<template>\n <div v-if=\"state\" :class=\"suit()\">\n <slot\n :current-refinement=\"currentRefinement\"\n :is-search-stalled=\"state.isSearchStalled\"\n :refine=\"state.refine\"\n >\n <search-input\n @focus=\"$emit('focus', $event)\"\n @blur=\"$emit('blur', $event)\"\n @reset=\"$emit('reset')\"\n :placeholder=\"placeholder\"\n :autofocus=\"autofocus\"\n :show-loading-indicator=\"showLoadingIndicator\"\n :should-show-loading-indicator=\"state.isSearchStalled\"\n :submit-title=\"submitTitle\"\n :reset-title=\"resetTitle\"\n :class-names=\"classNames\"\n v-model=\"currentRefinement\"\n ref=\"searchInput\"\n >\n <template #loading-indicator v-if=\"isVue3\">\n <slot name=\"loading-indicator\" />\n </template>\n <slot v-if=\"isVue2\" name=\"loading-indicator\" slot=\"loading-indicator\" />\n\n <template #submit-icon v-if=\"isVue3\">\n <slot name=\"submit-icon\" />\n </template>\n <slot v-if=\"isVue2\" name=\"submit-icon\" slot=\"submit-icon\" />\n\n <template #reset-icon v-if=\"isVue3\">\n <slot name=\"reset-icon\" />\n </template>\n <slot v-if=\"isVue2\" name=\"reset-icon\" slot=\"reset-icon\" />\n </search-input>\n </slot>\n </div>\n</template>\n\n<script>\nimport { connectSearchBox } from 'instantsearch.js/es/connectors';\n\nimport { createSuitMixin } from '../mixins/suit';\nimport { createWidgetMixin } from '../mixins/widget';\nimport { isVue3, isVue2 } from '../util/vue-compat';\n\nimport SearchInput from './SearchInput.vue';\n\nexport default {\n name: 'AisSearchBox',\n mixins: [\n createWidgetMixin(\n {\n connector: connectSearchBox,\n },\n {\n $$widgetType: 'ais.searchBox',\n }\n ),\n createSuitMixin({ name: 'SearchBox' }),\n ],\n components: {\n SearchInput,\n },\n props: {\n placeholder: {\n type: String,\n default: '',\n },\n autofocus: {\n type: Boolean,\n default: false,\n },\n showLoadingIndicator: {\n type: Boolean,\n default: true,\n },\n submitTitle: {\n type: String,\n default: 'Submit the search query',\n },\n resetTitle: {\n type: String,\n default: 'Clear the search query',\n },\n value: {\n type: String,\n default: undefined,\n },\n modelValue: {\n type: String,\n default: undefined,\n },\n queryHook: {\n type: Function,\n default: undefined,\n },\n },\n data() {\n return {\n localValue: '',\n isVue2,\n isVue3,\n };\n },\n computed: {\n widgetParams() {\n return {\n queryHook: this.queryHook,\n };\n },\n isControlled() {\n return (\n typeof this.value !== 'undefined' ||\n typeof this.modelValue !== 'undefined'\n );\n },\n model() {\n return this.value || this.modelValue;\n },\n currentRefinement: {\n get() {\n // if the input is controlled, but not up to date\n // this means it didn't search, and we should pretend it was `set`\n if (this.isControlled && this.model !== this.localValue) {\n // eslint-disable-next-line vue/no-side-effects-in-computed-properties\n this.localValue = this.model;\n this.$emit('input', this.model);\n this.$emit('update:modelValue', this.model);\n this.state.refine(this.model);\n }\n\n // we return the local value if the input is focused to avoid\n // concurrent updates when typing\n const { searchInput } = this.$refs;\n if (searchInput && searchInput.isFocused()) {\n return this.localValue;\n }\n\n return this.model || this.state.query || '';\n },\n set(val) {\n this.localValue = val;\n this.state.refine(val);\n if (this.isControlled) {\n this.$emit('input', val);\n this.$emit('update:modelValue', val);\n }\n },\n },\n },\n};\n</script>\n"],"names":["_ctx","_createElementBlock","class","_renderSlot","currentRefinement","$options","isSearchStalled","refine","_createVNode","onFocus","$event","onBlur","onReset","placeholder","$props","autofocus","show-loading-indicator","should-show-loading-indicator","submit-title","reset-title","class-names","ref","$data","slot"],"mappings":"gPACaA,aAAXC,eAAmBC,QAAOF,YACxBG,sBACGC,kBAAoBC,oBACpBC,gBAAmBN,QAAMM,gBACzBC,OAAQP,QAAMO,0BAEfC,KACGC,uCAAOT,gBAAeU,KACtBC,sCAAMX,eAAcU,KACpBE,uCAAOZ,mBACPa,YAAaC,cACbC,UAAWD,YACXE,yBAAwBF,uBACxBG,gCAA+BjB,QAAMM,gBACrCY,eAAcJ,cACdK,cAAaL,aACbM,cAAapB,wBACLK,yEAAAA,wBACTgB,IAAI,8CAKQC,SAAZnB,sCAA6CoB,KAAK,+BAKtCD,SAAZnB,gCAAuCoB,KAAK,yBAKhCD,SAAZnB,+BAAsCoB,KAAK,iCAbRD,eAAxB,2CACTnB,mDAI2BmB,eAAlB,qCACTnB,6CAI0BmB,eAAjB,oCACTnB"}