vue-instantsearch
Version:
👀 Lightning-fast Algolia search for Vue apps
2 lines (1 loc) • 2.13 kB
JavaScript
import{_ as t}from"@swc/helpers/_/_define_property";import{_ as e}from"@swc/helpers/_/_type_of";import i from"instantsearch.js/es/index.js";import{createInstantSearchComponent as n}from"../util/createInstantSearchComponent.js";import{renderCompat as a,getDefaultSlot as r}from"../util/vue-compat/index-vue2.js";import{warn as o}from"../util/warn.js";var s="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",u=n({name:"AisInstantSearch",props:{searchClient:{type:Object,required:!0},insightsClient:{type:Function,default:void 0},indexName:{type:String,required:!1},compositionID:{type:String,required:!1},routing:{default:void 0,validator:function(t){return!("boolean"==typeof t||!t.router&&!t.stateMapping)||(o("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 void 0===t||"boolean"==typeof t||"object"===(void 0===t?"undefined":e(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&&o(s),!1}},appId:{type:String,default:void 0,validator:function(t){return t&&o(s),!1}},middlewares:{type:Array,default:null},future:{type:Object,default:void 0}},data:function(){return{instantSearchInstance:i({searchClient:this.searchClient,insightsClient:this.insightsClient,insights:this.insights,indexName:this.indexName,compositionID:this.compositionID,routing:this.routing,stalledSearchDelay:this.stalledSearchDelay,searchFunction:this.searchFunction,onStateChange:this.onStateChange,initialUiState:this.initialUiState,future:this.future})}},render:a(function(e){var i;return e("div",{class:(i={},t(i,this.suit(),!0),t(i,this.suit("","ssr"),!1),i)},r(this))})});export{u as default};