vue-instantsearch 4.8.10 → 4.10.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.
Files changed (44) hide show
  1. package/package.json +4 -4
  2. package/src/__tests__/common.test.js +161 -1
  3. package/src/components/Hits.vue +2 -0
  4. package/src/components/InfiniteHits.vue +2 -0
  5. package/src/components/InstantSearch.js +7 -0
  6. package/src/components/__tests__/Hits.js +1 -0
  7. package/src/components/__tests__/InfiniteHits.js +1 -0
  8. package/src/util/__tests__/createServerRootMixin.test.js +3 -18
  9. package/src/util/createInstantSearchComponent.js +1 -1
  10. package/src/util/vue-compat/index-vue3.js +24 -3
  11. package/vue2/cjs/index.js +1 -1
  12. package/vue2/cjs/index.js.map +1 -1
  13. package/vue2/es/package.json.js +1 -1
  14. package/vue2/es/src/components/Hits.vue.js +1 -1
  15. package/vue2/es/src/components/InfiniteHits.vue.js +1 -1
  16. package/vue2/es/src/components/InstantSearch.js +1 -1
  17. package/vue2/es/src/components/InstantSearch.js.map +1 -1
  18. package/vue2/es/src/util/createInstantSearchComponent.js +1 -1
  19. package/vue2/es/src/util/createInstantSearchComponent.js.map +1 -1
  20. package/vue2/umd/index.js +1 -1
  21. package/vue2/umd/index.js.map +1 -1
  22. package/vue3/cjs/index.js +1 -1
  23. package/vue3/cjs/index.js.map +1 -1
  24. package/vue3/es/package.json.js +1 -1
  25. package/vue3/es/src/components/Hits.vue.js +1 -1
  26. package/vue3/es/src/components/Hits.vue_vue&type=script&lang.js.map +1 -1
  27. package/vue3/es/src/components/Hits.vue_vue&type=template&id=19b8dc8f&lang.js +2 -0
  28. package/vue3/es/src/components/Hits.vue_vue&type=template&id=19b8dc8f&lang.js.map +1 -0
  29. package/vue3/es/src/components/InfiniteHits.vue.js +1 -1
  30. package/vue3/es/src/components/InfiniteHits.vue_vue&type=script&lang.js.map +1 -1
  31. package/vue3/es/src/components/InfiniteHits.vue_vue&type=template&id=09224cc0&lang.js +2 -0
  32. package/vue3/es/src/components/InfiniteHits.vue_vue&type=template&id=09224cc0&lang.js.map +1 -0
  33. package/vue3/es/src/components/InstantSearch.js +1 -1
  34. package/vue3/es/src/components/InstantSearch.js.map +1 -1
  35. package/vue3/es/src/util/createInstantSearchComponent.js +1 -1
  36. package/vue3/es/src/util/createInstantSearchComponent.js.map +1 -1
  37. package/vue3/es/src/util/vue-compat/index-vue3.js +1 -1
  38. package/vue3/es/src/util/vue-compat/index-vue3.js.map +1 -1
  39. package/vue3/umd/index.js +1 -1
  40. package/vue3/umd/index.js.map +1 -1
  41. package/vue3/es/src/components/Hits.vue_vue&type=template&id=5bc4cfef&lang.js +0 -2
  42. package/vue3/es/src/components/Hits.vue_vue&type=template&id=5bc4cfef&lang.js.map +0 -1
  43. package/vue3/es/src/components/InfiniteHits.vue_vue&type=template&id=0e2ba520&lang.js +0 -2
  44. package/vue3/es/src/components/InfiniteHits.vue_vue&type=template&id=0e2ba520&lang.js.map +0 -1
@@ -1,2 +1,2 @@
1
- var r="4.8.10";export{r as version};
1
+ var r="4.10.0";export{r as version};
2
2
  //# sourceMappingURL=package.json.js.map
@@ -1,2 +1,2 @@
1
- import e from"./Hits.vue_vue&type=script&lang.js";import{render as t}from"./Hits.vue_vue&type=template&id=5bc4cfef&lang.js";e.render=t;export default e;
1
+ import e from"./Hits.vue_vue&type=script&lang.js";import{render as t}from"./Hits.vue_vue&type=template&id=19b8dc8f&lang.js";e.render=t;export default e;
2
2
  //# sourceMappingURL=Hits.vue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Hits.vue_vue&type=script&lang.js","sources":["../../../../src/components/Hits.vue"],"sourcesContent":["<template>\n <div v-if=\"state\" :class=\"suit()\">\n <slot\n :items=\"items\"\n :insights=\"state.insights\"\n :send-event=\"state.sendEvent\"\n >\n <ol :class=\"suit('list')\">\n <li\n v-for=\"(item, itemIndex) in items\"\n :key=\"item.objectID\"\n :class=\"suit('item')\"\n >\n <slot\n name=\"item\"\n :item=\"item\"\n :index=\"itemIndex\"\n :insights=\"state.insights\"\n >\n objectID: {{ item.objectID }}, index: {{ itemIndex }}\n </slot>\n </li>\n </ol>\n </slot>\n </div>\n</template>\n\n<script>\nimport { connectHitsWithInsights } from 'instantsearch.js/es/connectors';\nimport { createWidgetMixin } from '../mixins/widget';\nimport { createSuitMixin } from '../mixins/suit';\n\nexport default {\n name: 'AisHits',\n mixins: [\n createWidgetMixin(\n {\n connector: connectHitsWithInsights,\n },\n {\n $$widgetType: 'ais.hits',\n }\n ),\n createSuitMixin({ name: 'Hits' }),\n ],\n props: {\n escapeHTML: {\n type: Boolean,\n default: true,\n },\n transformItems: {\n type: Function,\n default: undefined,\n },\n },\n computed: {\n items() {\n return this.state.hits;\n },\n widgetParams() {\n return {\n escapeHTML: this.escapeHTML,\n transformItems: this.transformItems,\n };\n },\n },\n};\n</script>\n"],"names":["name","mixins","createWidgetMixin","connector","connectHitsWithInsights","$$widgetType","createSuitMixin","props","escapeHTML","type","Boolean","default","transformItems","Function","undefined","computed","items","this","state","hits","widgetParams"],"mappings":"4MAgCe,CACbA,KAAM,UACNC,OAAQ,CACNC,EACE,CACEC,UAAWC,GAEb,CACEC,aAAc,aAGlBC,EAAgB,CAAEN,KAAM,UAE1BO,MAAO,CACLC,WAAY,CACVC,KAAMC,QACNC,SAAS,GAEXC,eAAgB,CACdH,KAAMI,SACNF,aAASG,IAGbC,SAAU,CACRC,iBACE,OAAOC,KAAKC,MAAMC,MAEpBC,wBACE,MAAO,CACLZ,WAAYS,KAAKT,WACjBI,eAAgBK,KAAKL"}
1
+ {"version":3,"file":"Hits.vue_vue&type=script&lang.js","sources":["../../../../src/components/Hits.vue"],"sourcesContent":["<template>\n <div v-if=\"state\" :class=\"suit()\">\n <slot\n :items=\"items\"\n :insights=\"state.insights\"\n :send-event=\"state.sendEvent\"\n >\n <ol :class=\"suit('list')\">\n <li\n v-for=\"(item, itemIndex) in items\"\n :key=\"item.objectID\"\n :class=\"suit('item')\"\n @click=\"state.sendEvent('click:internal', item, 'Hit Clicked')\"\n >\n <slot\n name=\"item\"\n :item=\"item\"\n :index=\"itemIndex\"\n :insights=\"state.insights\"\n :send-event=\"state.sendEvent\"\n >\n objectID: {{ item.objectID }}, index: {{ itemIndex }}\n </slot>\n </li>\n </ol>\n </slot>\n </div>\n</template>\n\n<script>\nimport { connectHitsWithInsights } from 'instantsearch.js/es/connectors';\nimport { createWidgetMixin } from '../mixins/widget';\nimport { createSuitMixin } from '../mixins/suit';\n\nexport default {\n name: 'AisHits',\n mixins: [\n createWidgetMixin(\n {\n connector: connectHitsWithInsights,\n },\n {\n $$widgetType: 'ais.hits',\n }\n ),\n createSuitMixin({ name: 'Hits' }),\n ],\n props: {\n escapeHTML: {\n type: Boolean,\n default: true,\n },\n transformItems: {\n type: Function,\n default: undefined,\n },\n },\n computed: {\n items() {\n return this.state.hits;\n },\n widgetParams() {\n return {\n escapeHTML: this.escapeHTML,\n transformItems: this.transformItems,\n };\n },\n },\n};\n</script>\n"],"names":["name","mixins","createWidgetMixin","connector","connectHitsWithInsights","$$widgetType","createSuitMixin","props","escapeHTML","type","Boolean","default","transformItems","Function","undefined","computed","items","this","state","hits","widgetParams"],"mappings":"4MAkCe,CACbA,KAAM,UACNC,OAAQ,CACNC,EACE,CACEC,UAAWC,GAEb,CACEC,aAAc,aAGlBC,EAAgB,CAAEN,KAAM,UAE1BO,MAAO,CACLC,WAAY,CACVC,KAAMC,QACNC,SAAS,GAEXC,eAAgB,CACdH,KAAMI,SACNF,aAASG,IAGbC,SAAU,CACRC,iBACE,OAAOC,KAAKC,MAAMC,MAEpBC,wBACE,MAAO,CACLZ,WAAYS,KAAKT,WACjBI,eAAgBK,KAAKL"}
@@ -0,0 +1,2 @@
1
+ import{openBlock as t,createBlock as e,renderSlot as n,createVNode as s,Fragment as i,renderList as c,createTextVNode as l,toDisplayString as o,createCommentVNode as u}from"vue";function r(r,a,d,m,f,v){return r.state?(t(),e("div",{key:0,class:r.suit()},[n(r.$slots,"default",{items:v.items,insights:r.state.insights,sendEvent:r.state.sendEvent},function(){return[s("ol",{class:r.suit("list")},[(t(!0),e(i,null,c(v.items,function(s,i){return t(),e("li",{key:s.objectID,class:r.suit("item"),onClick:function(t){return r.state.sendEvent("click:internal",s,"Hit Clicked")}},[n(r.$slots,"item",{item:s,index:i,insights:r.state.insights,sendEvent:r.state.sendEvent},function(){return[l(" objectID: "+o(s.objectID)+", index: "+o(i),1)]})],10,["onClick"])}),128))],2)]})],2)):u("",!0)}export{r as render};
2
+ //# sourceMappingURL=Hits.vue_vue&type=template&id=19b8dc8f&lang.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Hits.vue_vue&type=template&id=19b8dc8f&lang.js","sources":["../../../../src/components/Hits.vue?vue&type=template&id=19b8dc8f&lang.js"],"sourcesContent":["<template>\n <div v-if=\"state\" :class=\"suit()\">\n <slot\n :items=\"items\"\n :insights=\"state.insights\"\n :send-event=\"state.sendEvent\"\n >\n <ol :class=\"suit('list')\">\n <li\n v-for=\"(item, itemIndex) in items\"\n :key=\"item.objectID\"\n :class=\"suit('item')\"\n @click=\"state.sendEvent('click:internal', item, 'Hit Clicked')\"\n >\n <slot\n name=\"item\"\n :item=\"item\"\n :index=\"itemIndex\"\n :insights=\"state.insights\"\n :send-event=\"state.sendEvent\"\n >\n objectID: {{ item.objectID }}, index: {{ itemIndex }}\n </slot>\n </li>\n </ol>\n </slot>\n </div>\n</template>\n\n<script>\nimport { connectHitsWithInsights } from 'instantsearch.js/es/connectors';\nimport { createWidgetMixin } from '../mixins/widget';\nimport { createSuitMixin } from '../mixins/suit';\n\nexport default {\n name: 'AisHits',\n mixins: [\n createWidgetMixin(\n {\n connector: connectHitsWithInsights,\n },\n {\n $$widgetType: 'ais.hits',\n }\n ),\n createSuitMixin({ name: 'Hits' }),\n ],\n props: {\n escapeHTML: {\n type: Boolean,\n default: true,\n },\n transformItems: {\n type: Function,\n default: undefined,\n },\n },\n computed: {\n items() {\n return this.state.hits;\n },\n widgetParams() {\n return {\n escapeHTML: this.escapeHTML,\n transformItems: this.transformItems,\n };\n },\n },\n};\n</script>\n"],"names":["_ctx","_createBlock","class","_renderSlot","items","$options","insights","sendEvent","_createVNode","item","itemIndex","key","objectID","onClick","index"],"mappings":"iNACaA,aAAXC,eAAmBC,MAAOF,WACxBG,sBACGC,MAAOC,QACPC,SAAUN,QAAMM,SAChBC,UAAYP,QAAMO,6BAEnBC,QAAKN,MAAOF,wBACVC,WAC8BI,iBAApBI,EAAMC,cADhBT,QAEGU,IAAKF,EAAKG,SACVV,MAAOF,eACPa,2BAAOb,QAAMO,2BAA4BE,oBAE1CN,mBAEGM,KAAMA,EACNK,MAAOJ,EACPJ,SAAUN,QAAMM,SAChBC,UAAYP,QAAMO,+CAENE,EAAKG,UAAW,cAAYF"}
@@ -1,2 +1,2 @@
1
- import e from"./InfiniteHits.vue_vue&type=script&lang.js";import{render as t}from"./InfiniteHits.vue_vue&type=template&id=0e2ba520&lang.js";e.render=t;export default e;
1
+ import e from"./InfiniteHits.vue_vue&type=script&lang.js";import{render as t}from"./InfiniteHits.vue_vue&type=template&id=09224cc0&lang.js";e.render=t;export default e;
2
2
  //# sourceMappingURL=InfiniteHits.vue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InfiniteHits.vue_vue&type=script&lang.js","sources":["../../../../src/components/InfiniteHits.vue"],"sourcesContent":["<template>\n <div v-if=\"state\" :class=\"suit()\">\n <slot\n v-if=\"showPrevious\"\n name=\"loadPrevious\"\n :refine-previous=\"refinePrevious\"\n :page=\"state.results.page\"\n :is-first-page=\"state.isFirstPage\"\n >\n <button\n :class=\"[\n suit('loadPrevious'),\n state.isFirstPage && suit('loadPrevious', 'disabled'),\n ]\"\n :disabled=\"state.isFirstPage\"\n @click=\"refinePrevious()\"\n >\n Show previous results\n </button>\n </slot>\n\n <slot\n :items=\"items\"\n :results=\"state.results\"\n :is-last-page=\"state.isLastPage\"\n :refine-previous=\"refinePrevious\"\n :refine-next=\"refineNext\"\n :refine=\"refineNext\"\n :insights=\"state.insights\"\n :send-event=\"state.sendEvent\"\n >\n <ol :class=\"suit('list')\">\n <li\n v-for=\"(item, index) in items\"\n :class=\"suit('item')\"\n :key=\"item.objectID\"\n >\n <slot\n name=\"item\"\n :item=\"item\"\n :index=\"index\"\n :insights=\"state.insights\"\n >\n objectID: {{ item.objectID }}, index: {{ index }}\n </slot>\n </li>\n </ol>\n\n <slot\n name=\"loadMore\"\n :refine-next=\"refineNext\"\n :refine=\"refineNext\"\n :page=\"state.results.page\"\n :is-last-page=\"state.isLastPage\"\n >\n <button\n :class=\"[\n suit('loadMore'),\n state.isLastPage && suit('loadMore', 'disabled'),\n ]\"\n :disabled=\"state.isLastPage\"\n @click=\"refineNext()\"\n >\n Show more results\n </button>\n </slot>\n </slot>\n </div>\n</template>\n\n<script>\nimport { createWidgetMixin } from '../mixins/widget';\nimport { connectInfiniteHitsWithInsights } from 'instantsearch.js/es/connectors';\nimport { createSuitMixin } from '../mixins/suit';\n\nexport default {\n name: 'AisInfiniteHits',\n mixins: [\n createWidgetMixin(\n {\n connector: connectInfiniteHitsWithInsights,\n },\n {\n $$widgetType: 'ais.infiniteHits',\n }\n ),\n createSuitMixin({ name: 'InfiniteHits' }),\n ],\n props: {\n showPrevious: {\n type: Boolean,\n default: false,\n },\n escapeHTML: {\n type: Boolean,\n default: true,\n },\n transformItems: {\n type: Function,\n default: undefined,\n },\n cache: {\n type: Object,\n default: undefined,\n },\n },\n computed: {\n widgetParams() {\n return {\n showPrevious: this.showPrevious,\n escapeHTML: this.escapeHTML,\n transformItems: this.transformItems,\n cache: this.cache,\n };\n },\n items() {\n // Fixes InstantSearch.js connectors API: every list\n // of things must be called `items`\n return this.state.hits;\n },\n },\n methods: {\n refinePrevious() {\n this.state.showPrevious();\n },\n refineNext() {\n this.state.showMore();\n },\n },\n};\n</script>\n"],"names":["name","mixins","createWidgetMixin","connector","connectInfiniteHitsWithInsights","$$widgetType","createSuitMixin","props","showPrevious","type","Boolean","default","escapeHTML","transformItems","Function","undefined","cache","Object","computed","widgetParams","this","items","state","hits","methods","refinePrevious","refineNext","showMore"],"mappings":"oNA2Ee,CACbA,KAAM,kBACNC,OAAQ,CACNC,EACE,CACEC,UAAWC,GAEb,CACEC,aAAc,qBAGlBC,EAAgB,CAAEN,KAAM,kBAE1BO,MAAO,CACLC,aAAc,CACZC,KAAMC,QACNC,SAAS,GAEXC,WAAY,CACVH,KAAMC,QACNC,SAAS,GAEXE,eAAgB,CACdJ,KAAMK,SACNH,aAASI,GAEXC,MAAO,CACLP,KAAMQ,OACNN,aAASI,IAGbG,SAAU,CACRC,wBACE,MAAO,CACLX,aAAcY,KAAKZ,aACnBI,WAAYQ,KAAKR,WACjBC,eAAgBO,KAAKP,eACrBG,MAAOI,KAAKJ,QAGhBK,iBAGE,OAAOD,KAAKE,MAAMC,OAGtBC,QAAS,CACPC,0BACEL,KAAKE,MAAMd,gBAEbkB,sBACEN,KAAKE,MAAMK"}
1
+ {"version":3,"file":"InfiniteHits.vue_vue&type=script&lang.js","sources":["../../../../src/components/InfiniteHits.vue"],"sourcesContent":["<template>\n <div v-if=\"state\" :class=\"suit()\">\n <slot\n v-if=\"showPrevious\"\n name=\"loadPrevious\"\n :refine-previous=\"refinePrevious\"\n :page=\"state.results.page\"\n :is-first-page=\"state.isFirstPage\"\n >\n <button\n :class=\"[\n suit('loadPrevious'),\n state.isFirstPage && suit('loadPrevious', 'disabled'),\n ]\"\n :disabled=\"state.isFirstPage\"\n @click=\"refinePrevious()\"\n >\n Show previous results\n </button>\n </slot>\n\n <slot\n :items=\"items\"\n :results=\"state.results\"\n :is-last-page=\"state.isLastPage\"\n :refine-previous=\"refinePrevious\"\n :refine-next=\"refineNext\"\n :refine=\"refineNext\"\n :insights=\"state.insights\"\n :send-event=\"state.sendEvent\"\n >\n <ol :class=\"suit('list')\">\n <li\n v-for=\"(item, index) in items\"\n :class=\"suit('item')\"\n :key=\"item.objectID\"\n @click=\"state.sendEvent('click:internal', item, 'Hit Clicked')\"\n >\n <slot\n name=\"item\"\n :item=\"item\"\n :index=\"index\"\n :insights=\"state.insights\"\n :send-event=\"state.sendEvent\"\n >\n objectID: {{ item.objectID }}, index: {{ index }}\n </slot>\n </li>\n </ol>\n\n <slot\n name=\"loadMore\"\n :refine-next=\"refineNext\"\n :refine=\"refineNext\"\n :page=\"state.results.page\"\n :is-last-page=\"state.isLastPage\"\n >\n <button\n :class=\"[\n suit('loadMore'),\n state.isLastPage && suit('loadMore', 'disabled'),\n ]\"\n :disabled=\"state.isLastPage\"\n @click=\"refineNext()\"\n >\n Show more results\n </button>\n </slot>\n </slot>\n </div>\n</template>\n\n<script>\nimport { createWidgetMixin } from '../mixins/widget';\nimport { connectInfiniteHitsWithInsights } from 'instantsearch.js/es/connectors';\nimport { createSuitMixin } from '../mixins/suit';\n\nexport default {\n name: 'AisInfiniteHits',\n mixins: [\n createWidgetMixin(\n {\n connector: connectInfiniteHitsWithInsights,\n },\n {\n $$widgetType: 'ais.infiniteHits',\n }\n ),\n createSuitMixin({ name: 'InfiniteHits' }),\n ],\n props: {\n showPrevious: {\n type: Boolean,\n default: false,\n },\n escapeHTML: {\n type: Boolean,\n default: true,\n },\n transformItems: {\n type: Function,\n default: undefined,\n },\n cache: {\n type: Object,\n default: undefined,\n },\n },\n computed: {\n widgetParams() {\n return {\n showPrevious: this.showPrevious,\n escapeHTML: this.escapeHTML,\n transformItems: this.transformItems,\n cache: this.cache,\n };\n },\n items() {\n // Fixes InstantSearch.js connectors API: every list\n // of things must be called `items`\n return this.state.hits;\n },\n },\n methods: {\n refinePrevious() {\n this.state.showPrevious();\n },\n refineNext() {\n this.state.showMore();\n },\n },\n};\n</script>\n"],"names":["name","mixins","createWidgetMixin","connector","connectInfiniteHitsWithInsights","$$widgetType","createSuitMixin","props","showPrevious","type","Boolean","default","escapeHTML","transformItems","Function","undefined","cache","Object","computed","widgetParams","this","items","state","hits","methods","refinePrevious","refineNext","showMore"],"mappings":"oNA6Ee,CACbA,KAAM,kBACNC,OAAQ,CACNC,EACE,CACEC,UAAWC,GAEb,CACEC,aAAc,qBAGlBC,EAAgB,CAAEN,KAAM,kBAE1BO,MAAO,CACLC,aAAc,CACZC,KAAMC,QACNC,SAAS,GAEXC,WAAY,CACVH,KAAMC,QACNC,SAAS,GAEXE,eAAgB,CACdJ,KAAMK,SACNH,aAASI,GAEXC,MAAO,CACLP,KAAMQ,OACNN,aAASI,IAGbG,SAAU,CACRC,wBACE,MAAO,CACLX,aAAcY,KAAKZ,aACnBI,WAAYQ,KAAKR,WACjBC,eAAgBO,KAAKP,eACrBG,MAAOI,KAAKJ,QAGhBK,iBAGE,OAAOD,KAAKE,MAAMC,OAGtBC,QAAS,CACPC,0BACEL,KAAKE,MAAMd,gBAEbkB,sBACEN,KAAKE,MAAMK"}
@@ -0,0 +1,2 @@
1
+ import{openBlock as e,createBlock as t,renderSlot as s,createVNode as i,createCommentVNode as n,Fragment as r,renderList as a,createTextVNode as o,toDisplayString as u}from"vue";function l(l,d,f,c,P,g){return l.state?(e(),t("div",{key:0,class:l.suit()},[f.showPrevious?s(l.$slots,"loadPrevious",{key:0,refinePrevious:g.refinePrevious,page:l.state.results.page,isFirstPage:l.state.isFirstPage},function(){return[i("button",{class:[l.suit("loadPrevious"),l.state.isFirstPage&&l.suit("loadPrevious","disabled")],disabled:l.state.isFirstPage,onClick:d[1]||(d[1]=function(e){return g.refinePrevious()})}," Show previous results ",10,["disabled"])]}):n("",!0),s(l.$slots,"default",{items:g.items,results:l.state.results,isLastPage:l.state.isLastPage,refinePrevious:g.refinePrevious,refineNext:g.refineNext,refine:g.refineNext,insights:l.state.insights,sendEvent:l.state.sendEvent},function(){return[i("ol",{class:l.suit("list")},[(e(!0),t(r,null,a(g.items,function(i,n){return e(),t("li",{class:l.suit("item"),key:i.objectID,onClick:function(e){return l.state.sendEvent("click:internal",i,"Hit Clicked")}},[s(l.$slots,"item",{item:i,index:n,insights:l.state.insights,sendEvent:l.state.sendEvent},function(){return[o(" objectID: "+u(i.objectID)+", index: "+u(n),1)]})],10,["onClick"])}),128))],2),s(l.$slots,"loadMore",{refineNext:g.refineNext,refine:g.refineNext,page:l.state.results.page,isLastPage:l.state.isLastPage},function(){return[i("button",{class:[l.suit("loadMore"),l.state.isLastPage&&l.suit("loadMore","disabled")],disabled:l.state.isLastPage,onClick:d[2]||(d[2]=function(e){return g.refineNext()})}," Show more results ",10,["disabled"])]})]})],2)):n("",!0)}export{l as render};
2
+ //# sourceMappingURL=InfiniteHits.vue_vue&type=template&id=09224cc0&lang.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InfiniteHits.vue_vue&type=template&id=09224cc0&lang.js","sources":["../../../../src/components/InfiniteHits.vue?vue&type=template&id=09224cc0&lang.js"],"sourcesContent":["<template>\n <div v-if=\"state\" :class=\"suit()\">\n <slot\n v-if=\"showPrevious\"\n name=\"loadPrevious\"\n :refine-previous=\"refinePrevious\"\n :page=\"state.results.page\"\n :is-first-page=\"state.isFirstPage\"\n >\n <button\n :class=\"[\n suit('loadPrevious'),\n state.isFirstPage && suit('loadPrevious', 'disabled'),\n ]\"\n :disabled=\"state.isFirstPage\"\n @click=\"refinePrevious()\"\n >\n Show previous results\n </button>\n </slot>\n\n <slot\n :items=\"items\"\n :results=\"state.results\"\n :is-last-page=\"state.isLastPage\"\n :refine-previous=\"refinePrevious\"\n :refine-next=\"refineNext\"\n :refine=\"refineNext\"\n :insights=\"state.insights\"\n :send-event=\"state.sendEvent\"\n >\n <ol :class=\"suit('list')\">\n <li\n v-for=\"(item, index) in items\"\n :class=\"suit('item')\"\n :key=\"item.objectID\"\n @click=\"state.sendEvent('click:internal', item, 'Hit Clicked')\"\n >\n <slot\n name=\"item\"\n :item=\"item\"\n :index=\"index\"\n :insights=\"state.insights\"\n :send-event=\"state.sendEvent\"\n >\n objectID: {{ item.objectID }}, index: {{ index }}\n </slot>\n </li>\n </ol>\n\n <slot\n name=\"loadMore\"\n :refine-next=\"refineNext\"\n :refine=\"refineNext\"\n :page=\"state.results.page\"\n :is-last-page=\"state.isLastPage\"\n >\n <button\n :class=\"[\n suit('loadMore'),\n state.isLastPage && suit('loadMore', 'disabled'),\n ]\"\n :disabled=\"state.isLastPage\"\n @click=\"refineNext()\"\n >\n Show more results\n </button>\n </slot>\n </slot>\n </div>\n</template>\n\n<script>\nimport { createWidgetMixin } from '../mixins/widget';\nimport { connectInfiniteHitsWithInsights } from 'instantsearch.js/es/connectors';\nimport { createSuitMixin } from '../mixins/suit';\n\nexport default {\n name: 'AisInfiniteHits',\n mixins: [\n createWidgetMixin(\n {\n connector: connectInfiniteHitsWithInsights,\n },\n {\n $$widgetType: 'ais.infiniteHits',\n }\n ),\n createSuitMixin({ name: 'InfiniteHits' }),\n ],\n props: {\n showPrevious: {\n type: Boolean,\n default: false,\n },\n escapeHTML: {\n type: Boolean,\n default: true,\n },\n transformItems: {\n type: Function,\n default: undefined,\n },\n cache: {\n type: Object,\n default: undefined,\n },\n },\n computed: {\n widgetParams() {\n return {\n showPrevious: this.showPrevious,\n escapeHTML: this.escapeHTML,\n transformItems: this.transformItems,\n cache: this.cache,\n };\n },\n items() {\n // Fixes InstantSearch.js connectors API: every list\n // of things must be called `items`\n return this.state.hits;\n },\n },\n methods: {\n refinePrevious() {\n this.state.showPrevious();\n },\n refineNext() {\n this.state.showMore();\n },\n },\n};\n</script>\n"],"names":["_ctx","_createBlock","class","$props","_renderSlot","refinePrevious","$options","page","results","isFirstPage","_createVNode","disabled","onClick","items","isLastPage","refineNext","refine","insights","sendEvent","item","index","key","objectID"],"mappings":"iNACaA,aAAXC,eAAmBC,MAAOF,WAEhBG,eADRC,iCAGGC,eAAiBC,iBACjBC,KAAMP,QAAMQ,QAAQD,KACpBE,YAAeT,QAAMS,+BAEtBC,YACGR,sFAIAS,SAAUX,QAAMS,YAChBG,uCAAON,6EAMZF,sBACGS,MAAOP,QACPE,QAASR,QAAMQ,QACfM,WAAcd,QAAMc,WACpBT,eAAiBC,iBACjBS,WAAaT,aACbU,OAAQV,aACRW,SAAUjB,QAAMiB,SAChBC,UAAYlB,QAAMkB,6BAEnBR,QAAKR,MAAOF,wBACVC,WAC0BK,iBAAhBa,EAAMC,cADhBnB,QAEGC,MAAOF,eACPqB,IAAKF,EAAKG,SACVV,2BAAOZ,QAAMkB,2BAA4BC,oBAE1Cf,mBAEGe,KAAMA,EACNC,MAAOA,EACPH,SAAUjB,QAAMiB,SAChBC,UAAYlB,QAAMkB,+CAENC,EAAKG,UAAW,cAAYF,sCAK/ChB,uBAEGW,WAAaT,aACbU,OAAQV,aACRC,KAAMP,QAAMQ,QAAQD,KACpBO,WAAcd,QAAMc,8BAErBJ,YACGR,6EAIAS,SAAUX,QAAMc,WAChBF,uCAAON"}
@@ -1,2 +1,2 @@
1
- import{renderCompat as t,getDefaultSlot as e}from"../util/vue-compat/index-vue3.js";import{warn as i}from"../util/warn.js";import a from"instantsearch.js/es/index.js";import{createInstantSearchComponent as n}from"../util/createInstantSearchComponent.js";var r="Vue InstantSearch: You used the prop api-key or app-id.\nThese have been replaced by search-client.\n\nSee more info here: https://www.algolia.com/doc/api-reference/widgets/instantsearch/vue/#widget-param-search-client";export default n({name:"AisInstantSearch",props:{searchClient:{type:Object,required:!0},insightsClient:{type:Function,default:void 0},indexName:{type:String,required:!0},routing:{default:void 0,validator:function(t){return!("boolean"==typeof t||!t.router&&!t.stateMapping)||(i("The `routing` option expects an object with `router` and/or `stateMapping`.\n\nSee https://www.algolia.com/doc/api-reference/widgets/instantsearch/vue/#widget-param-routing"),!1)}},stalledSearchDelay:{type:Number,default:void 0},searchFunction:{type:Function,default:void 0},onStateChange:{type:Function,default:void 0},initialUiState:{type:Object,default:void 0},apiKey:{type:String,default:void 0,validator:function(t){return t&&i(r),!1}},appId:{type:String,default:void 0,validator:function(t){return t&&i(r),!1}},middlewares:{type:Array,default:null}},data:function(){return{instantSearchInstance:a({searchClient:this.searchClient,insightsClient:this.insightsClient,indexName:this.indexName,routing:this.routing,stalledSearchDelay:this.stalledSearchDelay,searchFunction:this.searchFunction,onStateChange:this.onStateChange,initialUiState:this.initialUiState})}},render:t(function(t){var i;return t("div",{class:(i={},i[this.suit()]=!0,i[this.suit("","ssr")]=!1,i)},e(this))})});
1
+ import{renderCompat as t,getDefaultSlot as e}from"../util/vue-compat/index-vue3.js";import{warn as i}from"../util/warn.js";import n from"instantsearch.js/es/index.js";import{createInstantSearchComponent as a}from"../util/createInstantSearchComponent.js";var r="Vue InstantSearch: You used the prop api-key or app-id.\nThese have been replaced by search-client.\n\nSee more info here: https://www.algolia.com/doc/api-reference/widgets/instantsearch/vue/#widget-param-search-client";export default a({name:"AisInstantSearch",props:{searchClient:{type:Object,required:!0},insightsClient:{type:Function,default:void 0},indexName:{type:String,required:!0},routing:{default:void 0,validator:function(t){return!("boolean"==typeof t||!t.router&&!t.stateMapping)||(i("The `routing` option expects an object with `router` and/or `stateMapping`.\n\nSee https://www.algolia.com/doc/api-reference/widgets/instantsearch/vue/#widget-param-routing"),!1)}},insights:{default:void 0,validator:function(t){return"boolean"==typeof t||"object"==typeof t}},stalledSearchDelay:{type:Number,default:void 0},searchFunction:{type:Function,default:void 0},onStateChange:{type:Function,default:void 0},initialUiState:{type:Object,default:void 0},apiKey:{type:String,default:void 0,validator:function(t){return t&&i(r),!1}},appId:{type:String,default:void 0,validator:function(t){return t&&i(r),!1}},middlewares:{type:Array,default:null}},data:function(){return{instantSearchInstance:n({searchClient:this.searchClient,insightsClient:this.insightsClient,insights:this.insights,indexName:this.indexName,routing:this.routing,stalledSearchDelay:this.stalledSearchDelay,searchFunction:this.searchFunction,onStateChange:this.onStateChange,initialUiState:this.initialUiState})}},render:t(function(t){var i;return t("div",{class:(i={},i[this.suit()]=!0,i[this.suit("","ssr")]=!1,i)},e(this))})});
2
2
  //# sourceMappingURL=InstantSearch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InstantSearch.js","sources":["../../../../src/components/InstantSearch.js"],"sourcesContent":["import instantsearch from 'instantsearch.js/es';\nimport { createInstantSearchComponent } from '../util/createInstantSearchComponent';\nimport { warn } from '../util/warn';\nimport { renderCompat, getDefaultSlot } from '../util/vue-compat';\n\nconst oldApiWarning = `Vue InstantSearch: You used the prop api-key or app-id.\nThese have been replaced by search-client.\n\nSee more info here: https://www.algolia.com/doc/api-reference/widgets/instantsearch/vue/#widget-param-search-client`;\n\nexport default createInstantSearchComponent({\n name: 'AisInstantSearch',\n props: {\n searchClient: {\n type: Object,\n required: true,\n },\n insightsClient: {\n type: Function,\n default: undefined,\n },\n indexName: {\n type: String,\n required: true,\n },\n routing: {\n default: undefined,\n validator(value) {\n if (\n typeof value === 'boolean' ||\n (!value.router && !value.stateMapping)\n ) {\n warn(\n 'The `routing` option expects an object with `router` and/or `stateMapping`.\\n\\nSee https://www.algolia.com/doc/api-reference/widgets/instantsearch/vue/#widget-param-routing'\n );\n return false;\n }\n return true;\n },\n },\n stalledSearchDelay: {\n type: Number,\n default: undefined,\n },\n searchFunction: {\n type: Function,\n default: undefined,\n },\n onStateChange: {\n type: Function,\n default: undefined,\n },\n initialUiState: {\n type: Object,\n default: undefined,\n },\n apiKey: {\n type: String,\n default: undefined,\n validator(value) {\n if (value) {\n warn(oldApiWarning);\n }\n return false;\n },\n },\n appId: {\n type: String,\n default: undefined,\n validator(value) {\n if (value) {\n warn(oldApiWarning);\n }\n return false;\n },\n },\n middlewares: {\n type: Array,\n default: null,\n },\n },\n data() {\n return {\n instantSearchInstance: instantsearch({\n searchClient: this.searchClient,\n insightsClient: this.insightsClient,\n indexName: this.indexName,\n routing: this.routing,\n stalledSearchDelay: this.stalledSearchDelay,\n searchFunction: this.searchFunction,\n onStateChange: this.onStateChange,\n initialUiState: this.initialUiState,\n }),\n };\n },\n render: renderCompat(function (h) {\n return h(\n 'div',\n {\n class: {\n [this.suit()]: true,\n [this.suit('', 'ssr')]: false,\n },\n },\n getDefaultSlot(this)\n );\n }),\n});\n"],"names":["const","oldApiWarning","createInstantSearchComponent","name","props","searchClient","type","Object","required","insightsClient","Function","default","undefined","indexName","String","routing","validator","value","router","stateMapping","warn","stalledSearchDelay","Number","searchFunction","onStateChange","initialUiState","apiKey","appId","middlewares","Array","data","instantSearchInstance","instantsearch","this","render","renderCompat","h","class","suit","getDefaultSlot"],"mappings":"8PAKAA,IAAMC,EAAgB,4OAKPC,EAA6B,CAC1CC,KAAM,mBACNC,MAAO,CACLC,aAAc,CACZC,KAAMC,OACNC,UAAU,GAEZC,eAAgB,CACdH,KAAMI,SACNC,aAASC,GAEXC,UAAW,CACTP,KAAMQ,OACNN,UAAU,GAEZO,QAAS,CACPJ,aAASC,EACTI,mBAAUC,GACR,QACmB,kBAAVA,IACLA,EAAMC,SAAWD,EAAME,gBAEzBC,EACE,iLAEK,KAKbC,mBAAoB,CAClBf,KAAMgB,OACNX,aAASC,GAEXW,eAAgB,CACdjB,KAAMI,SACNC,aAASC,GAEXY,cAAe,CACblB,KAAMI,SACNC,aAASC,GAEXa,eAAgB,CACdnB,KAAMC,OACNI,aAASC,GAEXc,OAAQ,CACNpB,KAAMQ,OACNH,aAASC,EACTI,mBAAUC,GAIR,OAHIA,GACFG,EAAKnB,IAEA,IAGX0B,MAAO,CACLrB,KAAMQ,OACNH,aAASC,EACTI,mBAAUC,GAIR,OAHIA,GACFG,EAAKnB,IAEA,IAGX2B,YAAa,CACXtB,KAAMuB,MACNlB,QAAS,OAGbmB,gBACE,MAAO,CACLC,sBAAuBC,EAAc,CACnC3B,aAAc4B,KAAK5B,aACnBI,eAAgBwB,KAAKxB,eACrBI,UAAWoB,KAAKpB,UAChBE,QAASkB,KAAKlB,QACdM,mBAAoBY,KAAKZ,mBACzBE,eAAgBU,KAAKV,eACrBC,cAAeS,KAAKT,cACpBC,eAAgBQ,KAAKR,mBAI3BS,OAAQC,EAAa,SAAUC,SAC7B,OAAOA,EACL,MACA,CACEC,SAAO,KACJJ,KAAKK,SAAS,IACdL,KAAKK,KAAK,GAAI,SAAS,MAG5BC,EAAeN"}
1
+ {"version":3,"file":"InstantSearch.js","sources":["../../../../src/components/InstantSearch.js"],"sourcesContent":["import instantsearch from 'instantsearch.js/es';\nimport { createInstantSearchComponent } from '../util/createInstantSearchComponent';\nimport { warn } from '../util/warn';\nimport { renderCompat, getDefaultSlot } from '../util/vue-compat';\n\nconst oldApiWarning = `Vue InstantSearch: You used the prop api-key or app-id.\nThese have been replaced by search-client.\n\nSee more info here: https://www.algolia.com/doc/api-reference/widgets/instantsearch/vue/#widget-param-search-client`;\n\nexport default createInstantSearchComponent({\n name: 'AisInstantSearch',\n props: {\n searchClient: {\n type: Object,\n required: true,\n },\n insightsClient: {\n type: Function,\n default: undefined,\n },\n indexName: {\n type: String,\n required: true,\n },\n routing: {\n default: undefined,\n validator(value) {\n if (\n typeof value === 'boolean' ||\n (!value.router && !value.stateMapping)\n ) {\n warn(\n 'The `routing` option expects an object with `router` and/or `stateMapping`.\\n\\nSee https://www.algolia.com/doc/api-reference/widgets/instantsearch/vue/#widget-param-routing'\n );\n return false;\n }\n return true;\n },\n },\n insights: {\n default: undefined,\n validator(value) {\n return typeof value === 'boolean' || typeof value === 'object';\n },\n },\n stalledSearchDelay: {\n type: Number,\n default: undefined,\n },\n searchFunction: {\n type: Function,\n default: undefined,\n },\n onStateChange: {\n type: Function,\n default: undefined,\n },\n initialUiState: {\n type: Object,\n default: undefined,\n },\n apiKey: {\n type: String,\n default: undefined,\n validator(value) {\n if (value) {\n warn(oldApiWarning);\n }\n return false;\n },\n },\n appId: {\n type: String,\n default: undefined,\n validator(value) {\n if (value) {\n warn(oldApiWarning);\n }\n return false;\n },\n },\n middlewares: {\n type: Array,\n default: null,\n },\n },\n data() {\n return {\n instantSearchInstance: instantsearch({\n searchClient: this.searchClient,\n insightsClient: this.insightsClient,\n insights: this.insights,\n indexName: this.indexName,\n routing: this.routing,\n stalledSearchDelay: this.stalledSearchDelay,\n searchFunction: this.searchFunction,\n onStateChange: this.onStateChange,\n initialUiState: this.initialUiState,\n }),\n };\n },\n render: renderCompat(function (h) {\n return h(\n 'div',\n {\n class: {\n [this.suit()]: true,\n [this.suit('', 'ssr')]: false,\n },\n },\n getDefaultSlot(this)\n );\n }),\n});\n"],"names":["const","oldApiWarning","createInstantSearchComponent","name","props","searchClient","type","Object","required","insightsClient","Function","default","undefined","indexName","String","routing","validator","value","router","stateMapping","warn","insights","stalledSearchDelay","Number","searchFunction","onStateChange","initialUiState","apiKey","appId","middlewares","Array","data","instantSearchInstance","instantsearch","this","render","renderCompat","h","class","suit","getDefaultSlot"],"mappings":"8PAKAA,IAAMC,EAAgB,4OAKPC,EAA6B,CAC1CC,KAAM,mBACNC,MAAO,CACLC,aAAc,CACZC,KAAMC,OACNC,UAAU,GAEZC,eAAgB,CACdH,KAAMI,SACNC,aAASC,GAEXC,UAAW,CACTP,KAAMQ,OACNN,UAAU,GAEZO,QAAS,CACPJ,aAASC,EACTI,mBAAUC,GACR,QACmB,kBAAVA,IACLA,EAAMC,SAAWD,EAAME,gBAEzBC,EACE,iLAEK,KAKbC,SAAU,CACRV,aAASC,EACTI,mBAAUC,GACR,MAAwB,kBAAVA,GAAwC,iBAAVA,IAGhDK,mBAAoB,CAClBhB,KAAMiB,OACNZ,aAASC,GAEXY,eAAgB,CACdlB,KAAMI,SACNC,aAASC,GAEXa,cAAe,CACbnB,KAAMI,SACNC,aAASC,GAEXc,eAAgB,CACdpB,KAAMC,OACNI,aAASC,GAEXe,OAAQ,CACNrB,KAAMQ,OACNH,aAASC,EACTI,mBAAUC,GAIR,OAHIA,GACFG,EAAKnB,IAEA,IAGX2B,MAAO,CACLtB,KAAMQ,OACNH,aAASC,EACTI,mBAAUC,GAIR,OAHIA,GACFG,EAAKnB,IAEA,IAGX4B,YAAa,CACXvB,KAAMwB,MACNnB,QAAS,OAGboB,gBACE,MAAO,CACLC,sBAAuBC,EAAc,CACnC5B,aAAc6B,KAAK7B,aACnBI,eAAgByB,KAAKzB,eACrBY,SAAUa,KAAKb,SACfR,UAAWqB,KAAKrB,UAChBE,QAASmB,KAAKnB,QACdO,mBAAoBY,KAAKZ,mBACzBE,eAAgBU,KAAKV,eACrBC,cAAeS,KAAKT,cACpBC,eAAgBQ,KAAKR,mBAI3BS,OAAQC,EAAa,SAAUC,SAC7B,OAAOA,EACL,MACA,CACEC,SAAO,KACJJ,KAAKK,SAAS,IACdL,KAAKK,KAAK,GAAI,SAAS,MAG5BC,EAAeN"}
@@ -1,2 +1,2 @@
1
- import{createSuitMixin as n}from"../mixins/suit.js";import{_objectSpread as t}from"./polyfills.js";import{version as e}from"vue";import"./vue-compat/index-vue3.js";import{warn as a}from"./warn.js";import{version as i}from"../../package.json.js";var s=function(s){var r;return t(((r={mixins:[n({name:"InstantSearch"})],provide:function(){return{$_ais_instantSearchInstance:this.instantSearchInstance}},watch:{searchClient:function(n){a(!1),this.instantSearchInstance.helper.setClient(n).search()},indexName:function(n){this.instantSearchInstance.helper.setIndex(n).search()},stalledSearchDelay:function(n){this.instantSearchInstance._stalledSearchDelay=n},routing:function(){throw new Error("routing configuration can not be changed dynamically at this point.\n\nPlease open a new issue: https://github.com/algolia/instantsearch.js/discussions/new?category=ideas&labels=triage%2cLibrary%3A+Vue+InstantSearch&title=Feature%20request%3A%20dynamic%20props")},onStateChange:function(){throw new Error("onStateChange configuration can not be changed dynamically at this point.\n\nPlease open a new issue: https://github.com/algolia/instantsearch.js/discussions/new?category=ideas&labels=triage%2cLibrary%3A+Vue+InstantSearch&title=Feature%20request%3A%20dynamic%20props")},searchFunction:function(n){this.instantSearchInstance._searchFunction=n},middlewares:{immediate:!0,handler:function(n,t){var e=this;(t||[]).filter(function(t){return-1===(n||[]).indexOf(t)}).forEach(function(n){e.instantSearchInstance.unuse(n)}),(n||[]).filter(function(n){return-1===(t||[]).indexOf(n)}).forEach(function(n){e.instantSearchInstance.use(n)})}}},created:function(){var n=this.instantSearchInstance.client;"function"==typeof n.addAlgoliaAgent&&(n.addAlgoliaAgent("Vue ("+e+")"),n.addAlgoliaAgent("Vue InstantSearch ("+i+")"))},mounted:function(){var n=this;this.$nextTick(function(){n.instantSearchInstance.started||n.instantSearchInstance.start()})}}).beforeUnmount=function(){this.instantSearchInstance.started&&this.instantSearchInstance.dispose(),this.instantSearchInstance.__initialSearchResults=void 0},r),s)};export{s as createInstantSearchComponent};
1
+ import{createSuitMixin as n}from"../mixins/suit.js";import{_objectSpread as t}from"./polyfills.js";import{version as e}from"vue";import"./vue-compat/index-vue3.js";import{warn as a}from"./warn.js";import{version as i}from"../../package.json.js";var s=function(s){var r;return t(((r={mixins:[n({name:"InstantSearch"})],provide:function(){return{$_ais_instantSearchInstance:this.instantSearchInstance}},watch:{searchClient:function(n){a(!1),this.instantSearchInstance.helper.setClient(n).search()},indexName:function(n){this.instantSearchInstance.helper.setIndex(n||"").search()},stalledSearchDelay:function(n){this.instantSearchInstance._stalledSearchDelay=n},routing:function(){throw new Error("routing configuration can not be changed dynamically at this point.\n\nPlease open a new issue: https://github.com/algolia/instantsearch.js/discussions/new?category=ideas&labels=triage%2cLibrary%3A+Vue+InstantSearch&title=Feature%20request%3A%20dynamic%20props")},onStateChange:function(){throw new Error("onStateChange configuration can not be changed dynamically at this point.\n\nPlease open a new issue: https://github.com/algolia/instantsearch.js/discussions/new?category=ideas&labels=triage%2cLibrary%3A+Vue+InstantSearch&title=Feature%20request%3A%20dynamic%20props")},searchFunction:function(n){this.instantSearchInstance._searchFunction=n},middlewares:{immediate:!0,handler:function(n,t){var e=this;(t||[]).filter(function(t){return-1===(n||[]).indexOf(t)}).forEach(function(n){e.instantSearchInstance.unuse(n)}),(n||[]).filter(function(n){return-1===(t||[]).indexOf(n)}).forEach(function(n){e.instantSearchInstance.use(n)})}}},created:function(){var n=this.instantSearchInstance.client;"function"==typeof n.addAlgoliaAgent&&(n.addAlgoliaAgent("Vue ("+e+")"),n.addAlgoliaAgent("Vue InstantSearch ("+i+")"))},mounted:function(){var n=this;this.$nextTick(function(){n.instantSearchInstance.started||n.instantSearchInstance.start()})}}).beforeUnmount=function(){this.instantSearchInstance.started&&this.instantSearchInstance.dispose(),this.instantSearchInstance.__initialSearchResults=void 0},r),s)};export{s as createInstantSearchComponent};
2
2
  //# sourceMappingURL=createInstantSearchComponent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createInstantSearchComponent.js","sources":["../../../../src/util/createInstantSearchComponent.js"],"sourcesContent":["import { createSuitMixin } from '../mixins/suit';\nimport { version } from '../../package.json'; // rollup does pick only what needed from json\nimport { _objectSpread } from './polyfills';\nimport { isVue3, version as vueVersion } from './vue-compat';\nimport { warn } from './warn';\n\nexport const createInstantSearchComponent = (component) =>\n _objectSpread(\n {\n mixins: [createSuitMixin({ name: 'InstantSearch' })],\n provide() {\n return {\n $_ais_instantSearchInstance: this.instantSearchInstance,\n };\n },\n watch: {\n searchClient(searchClient) {\n warn(\n false,\n 'The `search-client` prop of `<ais-instant-search>` changed between renders, which may cause more search requests than necessary. If this is an unwanted behavior, please provide a stable reference: https://www.algolia.com/doc/api-reference/widgets/instantsearch/vue/#widget-param-search-client'\n );\n\n this.instantSearchInstance.helper.setClient(searchClient).search();\n },\n indexName(indexName) {\n this.instantSearchInstance.helper.setIndex(indexName).search();\n },\n stalledSearchDelay(stalledSearchDelay) {\n // private InstantSearch.js API:\n this.instantSearchInstance._stalledSearchDelay = stalledSearchDelay;\n },\n routing() {\n throw new Error(\n 'routing configuration can not be changed dynamically at this point.' +\n '\\n\\n' +\n 'Please open a new issue: https://github.com/algolia/instantsearch.js/discussions/new?category=ideas&labels=triage%2cLibrary%3A+Vue+InstantSearch&title=Feature%20request%3A%20dynamic%20props'\n );\n },\n onStateChange() {\n throw new Error(\n 'onStateChange configuration can not be changed dynamically at this point.' +\n '\\n\\n' +\n 'Please open a new issue: https://github.com/algolia/instantsearch.js/discussions/new?category=ideas&labels=triage%2cLibrary%3A+Vue+InstantSearch&title=Feature%20request%3A%20dynamic%20props'\n );\n },\n searchFunction(searchFunction) {\n // private InstantSearch.js API:\n this.instantSearchInstance._searchFunction = searchFunction;\n },\n middlewares: {\n immediate: true,\n handler(next, prev) {\n (prev || [])\n .filter((middleware) => (next || []).indexOf(middleware) === -1)\n .forEach((middlewareToRemove) => {\n this.instantSearchInstance.unuse(middlewareToRemove);\n });\n\n (next || [])\n .filter((middleware) => (prev || []).indexOf(middleware) === -1)\n .forEach((middlewareToAdd) => {\n this.instantSearchInstance.use(middlewareToAdd);\n });\n },\n },\n },\n created() {\n const searchClient = this.instantSearchInstance.client;\n if (typeof searchClient.addAlgoliaAgent === 'function') {\n searchClient.addAlgoliaAgent(`Vue (${vueVersion})`);\n searchClient.addAlgoliaAgent(`Vue InstantSearch (${version})`);\n }\n },\n mounted() {\n // from the documentation: https://vuejs.org/v2/api/#mounted\n // \"Note that mounted does not guarantee that all child components have also been mounted. If you want to\n // wait until the entire view has been rendered, you can use vm.$nextTick inside of mounted\"\n this.$nextTick(() => {\n if (!this.instantSearchInstance.started) {\n this.instantSearchInstance.start();\n }\n });\n },\n [isVue3 ? 'beforeUnmount' : 'beforeDestroy']() {\n if (this.instantSearchInstance.started) {\n this.instantSearchInstance.dispose();\n }\n\n // a hydrated instance will no longer be hydrated once disposed, and starts from scratch\n this.instantSearchInstance.__initialSearchResults = undefined;\n },\n },\n component\n );\n"],"names":["createInstantSearchComponent","component","_objectSpread","mixins","createSuitMixin","name","provide","$_ais_instantSearchInstance","this","instantSearchInstance","watch","searchClient","warn","helper","setClient","search","indexName","setIndex","stalledSearchDelay","_stalledSearchDelay","routing","Error","onStateChange","searchFunction","_searchFunction","middlewares","immediate","handler","next","prev","filter","middleware","indexOf","forEach","middlewareToRemove","unuse","middlewareToAdd","use","created","const","client","addAlgoliaAgent","vueVersion","version","mounted","$nextTick","started","start","dispose","__initialSearchResults","undefined"],"mappings":"yPAMaA,WAAgCC,gBAC3CC,MACE,CACEC,OAAQ,CAACC,EAAgB,CAAEC,KAAM,mBACjCC,mBACE,MAAO,CACLC,4BAA6BC,KAAKC,wBAGtCC,MAAO,CACLC,sBAAaA,GACXC,GACE,GAIFJ,KAAKC,sBAAsBI,OAAOC,UAAUH,GAAcI,UAE5DC,mBAAUA,GACRR,KAAKC,sBAAsBI,OAAOI,SAASD,GAAWD,UAExDG,4BAAmBA,GAEjBV,KAAKC,sBAAsBU,oBAAsBD,GAEnDE,mBACE,MAAM,IAAIC,MACR,yQAKJC,yBACE,MAAM,IAAID,MACR,+QAKJE,wBAAeA,GAEbf,KAAKC,sBAAsBe,gBAAkBD,GAE/CE,YAAa,CACXC,WAAW,EACXC,iBAAQC,EAAMC,eACXA,GAAQ,IACNC,gBAAQC,UAAqD,KAArCH,GAAQ,IAAII,QAAQD,KAC5CE,iBAASC,GACR1B,EAAKC,sBAAsB0B,MAAMD,MAGpCN,GAAQ,IACNE,gBAAQC,UAAqD,KAArCF,GAAQ,IAAIG,QAAQD,KAC5CE,iBAASG,GACR5B,EAAKC,sBAAsB4B,IAAID,QAKzCE,mBACEC,IAAM5B,EAAeH,KAAKC,sBAAsB+B,OACJ,mBAAjC7B,EAAa8B,kBACtB9B,EAAa8B,wBAAwBC,OACrC/B,EAAa8B,sCAAsCE,SAGvDC,8BAIEpC,KAAKqC,qBACErC,EAAKC,sBAAsBqC,SAC9BtC,EAAKC,sBAAsBsC,aAIU,yBACrCvC,KAAKC,sBAAsBqC,SAC7BtC,KAAKC,sBAAsBuC,UAI7BxC,KAAKC,sBAAsBwC,4BAAyBC,MAGxDjD"}
1
+ {"version":3,"file":"createInstantSearchComponent.js","sources":["../../../../src/util/createInstantSearchComponent.js"],"sourcesContent":["import { createSuitMixin } from '../mixins/suit';\nimport { version } from '../../package.json'; // rollup does pick only what needed from json\nimport { _objectSpread } from './polyfills';\nimport { isVue3, version as vueVersion } from './vue-compat';\nimport { warn } from './warn';\n\nexport const createInstantSearchComponent = (component) =>\n _objectSpread(\n {\n mixins: [createSuitMixin({ name: 'InstantSearch' })],\n provide() {\n return {\n $_ais_instantSearchInstance: this.instantSearchInstance,\n };\n },\n watch: {\n searchClient(searchClient) {\n warn(\n false,\n 'The `search-client` prop of `<ais-instant-search>` changed between renders, which may cause more search requests than necessary. If this is an unwanted behavior, please provide a stable reference: https://www.algolia.com/doc/api-reference/widgets/instantsearch/vue/#widget-param-search-client'\n );\n\n this.instantSearchInstance.helper.setClient(searchClient).search();\n },\n indexName(indexName) {\n this.instantSearchInstance.helper.setIndex(indexName || '').search();\n },\n stalledSearchDelay(stalledSearchDelay) {\n // private InstantSearch.js API:\n this.instantSearchInstance._stalledSearchDelay = stalledSearchDelay;\n },\n routing() {\n throw new Error(\n 'routing configuration can not be changed dynamically at this point.' +\n '\\n\\n' +\n 'Please open a new issue: https://github.com/algolia/instantsearch.js/discussions/new?category=ideas&labels=triage%2cLibrary%3A+Vue+InstantSearch&title=Feature%20request%3A%20dynamic%20props'\n );\n },\n onStateChange() {\n throw new Error(\n 'onStateChange configuration can not be changed dynamically at this point.' +\n '\\n\\n' +\n 'Please open a new issue: https://github.com/algolia/instantsearch.js/discussions/new?category=ideas&labels=triage%2cLibrary%3A+Vue+InstantSearch&title=Feature%20request%3A%20dynamic%20props'\n );\n },\n searchFunction(searchFunction) {\n // private InstantSearch.js API:\n this.instantSearchInstance._searchFunction = searchFunction;\n },\n middlewares: {\n immediate: true,\n handler(next, prev) {\n (prev || [])\n .filter((middleware) => (next || []).indexOf(middleware) === -1)\n .forEach((middlewareToRemove) => {\n this.instantSearchInstance.unuse(middlewareToRemove);\n });\n\n (next || [])\n .filter((middleware) => (prev || []).indexOf(middleware) === -1)\n .forEach((middlewareToAdd) => {\n this.instantSearchInstance.use(middlewareToAdd);\n });\n },\n },\n },\n created() {\n const searchClient = this.instantSearchInstance.client;\n if (typeof searchClient.addAlgoliaAgent === 'function') {\n searchClient.addAlgoliaAgent(`Vue (${vueVersion})`);\n searchClient.addAlgoliaAgent(`Vue InstantSearch (${version})`);\n }\n },\n mounted() {\n // from the documentation: https://vuejs.org/v2/api/#mounted\n // \"Note that mounted does not guarantee that all child components have also been mounted. If you want to\n // wait until the entire view has been rendered, you can use vm.$nextTick inside of mounted\"\n this.$nextTick(() => {\n if (!this.instantSearchInstance.started) {\n this.instantSearchInstance.start();\n }\n });\n },\n [isVue3 ? 'beforeUnmount' : 'beforeDestroy']() {\n if (this.instantSearchInstance.started) {\n this.instantSearchInstance.dispose();\n }\n\n // a hydrated instance will no longer be hydrated once disposed, and starts from scratch\n this.instantSearchInstance.__initialSearchResults = undefined;\n },\n },\n component\n );\n"],"names":["createInstantSearchComponent","component","_objectSpread","mixins","createSuitMixin","name","provide","$_ais_instantSearchInstance","this","instantSearchInstance","watch","searchClient","warn","helper","setClient","search","indexName","setIndex","stalledSearchDelay","_stalledSearchDelay","routing","Error","onStateChange","searchFunction","_searchFunction","middlewares","immediate","handler","next","prev","filter","middleware","indexOf","forEach","middlewareToRemove","unuse","middlewareToAdd","use","created","const","client","addAlgoliaAgent","vueVersion","version","mounted","$nextTick","started","start","dispose","__initialSearchResults","undefined"],"mappings":"yPAMaA,WAAgCC,gBAC3CC,MACE,CACEC,OAAQ,CAACC,EAAgB,CAAEC,KAAM,mBACjCC,mBACE,MAAO,CACLC,4BAA6BC,KAAKC,wBAGtCC,MAAO,CACLC,sBAAaA,GACXC,GACE,GAIFJ,KAAKC,sBAAsBI,OAAOC,UAAUH,GAAcI,UAE5DC,mBAAUA,GACRR,KAAKC,sBAAsBI,OAAOI,SAASD,GAAa,IAAID,UAE9DG,4BAAmBA,GAEjBV,KAAKC,sBAAsBU,oBAAsBD,GAEnDE,mBACE,MAAM,IAAIC,MACR,yQAKJC,yBACE,MAAM,IAAID,MACR,+QAKJE,wBAAeA,GAEbf,KAAKC,sBAAsBe,gBAAkBD,GAE/CE,YAAa,CACXC,WAAW,EACXC,iBAAQC,EAAMC,eACXA,GAAQ,IACNC,gBAAQC,UAAqD,KAArCH,GAAQ,IAAII,QAAQD,KAC5CE,iBAASC,GACR1B,EAAKC,sBAAsB0B,MAAMD,MAGpCN,GAAQ,IACNE,gBAAQC,UAAqD,KAArCF,GAAQ,IAAIG,QAAQD,KAC5CE,iBAASG,GACR5B,EAAKC,sBAAsB4B,IAAID,QAKzCE,mBACEC,IAAM5B,EAAeH,KAAKC,sBAAsB+B,OACJ,mBAAjC7B,EAAa8B,kBACtB9B,EAAa8B,wBAAwBC,OACrC/B,EAAa8B,sCAAsCE,SAGvDC,8BAIEpC,KAAKqC,qBACErC,EAAKC,sBAAsBqC,SAC9BtC,EAAKC,sBAAsBsC,aAIU,yBACrCvC,KAAKC,sBAAsBqC,SAC7BtC,KAAKC,sBAAsBuC,UAI7BxC,KAAKC,sBAAsBwC,4BAAyBC,MAGxDjD"}
@@ -1,2 +1,2 @@
1
- import{h as t}from"vue";import*as r from"vue";export{r as Vue};export{createApp,createSSRApp,h,nextTick,version}from"vue";var e=!1,o=!0;function n(r){function e(r,e,o){if("object"==typeof e&&(e.attrs||e.props)){var n=Object.assign({},e,e.attrs,e.props);return delete n.attrs,delete n.props,t(r,n,o)}return t(r,e,o)}return function(){return r.call(this,e)}}function p(t){return t.$slots.default&&t.$slots.default()}export{p as getDefaultSlot,e as isVue2,o as isVue3,n as renderCompat};
1
+ import{h as e}from"vue";import*as t from"vue";export{t as Vue};export{createApp,createSSRApp,h,nextTick,version}from"vue";var o=!1,r=!0;function n(t){function o(t,o,r){if("object"==typeof o&&(o.attrs||o.props||o.scopedSlots||o.on)){var n=Object.assign({},o,o.attrs,o.props,Object.keys(o.on||{}).reduce(function(e,t){return e["on"+t[0].toUpperCase()+t.slice(1)]=o.on[t],e},{}));return delete n.attrs,delete n.props,delete n.scopedSlots,delete n.on,e(t,n,o.scopedSlots?Object.assign({default:function(){return r}},o.scopedSlots):r)}return e(t,o,r)}return function(){return t.call(this,o)}}function s(e){return e.$slots.default&&e.$slots.default()}export{s as getDefaultSlot,o as isVue2,r as isVue3,n as renderCompat};
2
2
  //# sourceMappingURL=index-vue3.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-vue3.js","sources":["../../../../../src/util/vue-compat/index-vue3.js"],"sourcesContent":["import * as Vue from 'vue';\n\nconst isVue2 = false;\nconst isVue3 = true;\nconst Vue2 = undefined;\n\nexport { createApp, createSSRApp, h, version, nextTick } from 'vue';\nexport { Vue, Vue2, isVue2, isVue3 };\n\nexport function renderCompat(fn) {\n function h(tag, props, children) {\n if (typeof props === 'object' && (props.attrs || props.props)) {\n // In vue 3, we no longer wrap with `attrs` or `props` key.\n const flatProps = Object.assign({}, props, props.attrs, props.props);\n delete flatProps.attrs;\n delete flatProps.props;\n\n return Vue.h(tag, flatProps, children);\n }\n\n return Vue.h(tag, props, children);\n }\n\n return function () {\n return fn.call(this, h);\n };\n}\n\nexport function getDefaultSlot(component) {\n return component.$slots.default && component.$slots.default();\n}\n"],"names":["isVue2","isVue3","renderCompat","fn","h","tag","props","children","attrs","const","flatProps","Object","assign","Vue","call","this","getDefaultSlot","component","$slots","default"],"mappings":"8HAEMA,GAAS,EACTC,GAAS,EAMR,SAASC,EAAaC,GAC3B,SAASC,EAAEC,EAAKC,EAAOC,GACrB,GAAqB,iBAAVD,IAAuBA,EAAME,OAASF,EAAMA,OAAQ,CAE7DG,IAAMC,EAAYC,OAAOC,OAAO,GAAIN,EAAOA,EAAME,MAAOF,EAAMA,OAI9D,cAHOI,EAAUF,aACVE,EAAUJ,MAEVO,EAAMR,EAAKK,EAAWH,GAG/B,OAAOM,EAAMR,EAAKC,EAAOC,GAG3B,OAAO,WACL,OAAOJ,EAAGW,KAAKC,KAAMX,IAIlB,SAASY,EAAeC,GAC7B,OAAOA,EAAUC,OAAOC,SAAWF,EAAUC,OAAOC"}
1
+ {"version":3,"file":"index-vue3.js","sources":["../../../../../src/util/vue-compat/index-vue3.js"],"sourcesContent":["import * as Vue from 'vue';\n\nconst isVue2 = false;\nconst isVue3 = true;\nconst Vue2 = undefined;\n\nexport { createApp, createSSRApp, h, version, nextTick } from 'vue';\nexport { Vue, Vue2, isVue2, isVue3 };\n\nexport function renderCompat(fn) {\n function h(tag, props, children) {\n if (\n typeof props === 'object' &&\n (props.attrs || props.props || props.scopedSlots || props.on)\n ) {\n // In vue 3, we no longer wrap with `attrs` or `props` key.\n const flatProps = Object.assign(\n {},\n props,\n props.attrs,\n props.props,\n Object.keys(props.on || {}).reduce((acc, key) => {\n // eslint-disable-next-line no-param-reassign\n acc[`on${key[0].toUpperCase()}${key.slice(1)}`] = props.on[key];\n return acc;\n }, {})\n );\n delete flatProps.attrs;\n delete flatProps.props;\n delete flatProps.scopedSlots;\n delete flatProps.on;\n\n return Vue.h(\n tag,\n flatProps,\n props.scopedSlots\n ? Object.assign({ default: () => children }, props.scopedSlots)\n : children\n );\n }\n\n return Vue.h(tag, props, children);\n }\n\n return function () {\n return fn.call(this, h);\n };\n}\n\nexport function getDefaultSlot(component) {\n return component.$slots.default && component.$slots.default();\n}\n"],"names":["isVue2","isVue3","renderCompat","fn","h","tag","props","children","attrs","scopedSlots","on","const","flatProps","Object","assign","keys","reduce","acc","key","toUpperCase","slice","Vue","default","call","this","getDefaultSlot","component","$slots"],"mappings":"8HAEMA,GAAS,EACTC,GAAS,EAMR,SAASC,EAAaC,GAC3B,SAASC,EAAEC,EAAKC,EAAOC,GACrB,GACmB,iBAAVD,IACNA,EAAME,OAASF,EAAMA,OAASA,EAAMG,aAAeH,EAAMI,IAC1D,CAEAC,IAAMC,EAAYC,OAAOC,OACvB,GACAR,EACAA,EAAME,MACNF,EAAMA,MACNO,OAAOE,KAAKT,EAAMI,IAAM,IAAIM,gBAAQC,EAAKC,GAGvC,OADAD,OAASC,EAAI,GAAGC,cAAgBD,EAAIE,MAAM,IAAQd,EAAMI,GAAGQ,GACpDD,GACN,KAOL,cALOL,EAAUJ,aACVI,EAAUN,aACVM,EAAUH,mBACVG,EAAUF,GAEVW,EACLhB,EACAO,EACAN,EAAMG,YACFI,OAAOC,OAAO,CAAEQ,0BAAef,IAAYD,EAAMG,aACjDF,GAIR,OAAOc,EAAMhB,EAAKC,EAAOC,GAG3B,OAAO,WACL,OAAOJ,EAAGoB,KAAKC,KAAMpB,IAIlB,SAASqB,EAAeC,GAC7B,OAAOA,EAAUC,OAAOL,SAAWI,EAAUC,OAAOL"}