@empathyco/x-components 6.0.0-alpha.6 → 6.0.0-alpha.61
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.
- package/CHANGELOG.md +531 -0
- package/core/index.js +9 -1
- package/core/index.js.map +1 -1
- package/design-system/deprecated-full-theme.css +2371 -2371
- package/docs/API-reference/api/x-adapter-platform.md +12 -0
- package/docs/API-reference/api/x-adapter-platform.nextqueriesrelatedpromptsschema.md +11 -0
- package/docs/API-reference/api/x-adapter-platform.platformadapter.relatedprompts.md +1 -1
- package/docs/API-reference/api/x-adapter-platform.platformrelatedprompt.md +23 -0
- package/docs/API-reference/api/x-adapter-platform.platformrelatedprompt.nextqueries.md +11 -0
- package/docs/API-reference/api/x-adapter-platform.platformrelatedprompt.suggestiontext.md +11 -0
- package/docs/API-reference/api/x-adapter-platform.platformrelatedprompt.tagging.md +11 -0
- package/docs/API-reference/api/x-adapter-platform.platformrelatedprompt.type.md +11 -0
- package/docs/API-reference/api/x-adapter-platform.platformrelatedpromptnextqueriestagging.md +22 -0
- package/docs/API-reference/api/x-adapter-platform.platformrelatedpromptnextqueriestagging.toolingdisplay.md +11 -0
- package/docs/API-reference/api/x-adapter-platform.platformrelatedpromptnextqueriestagging.toolingdisplayadd2cart.md +11 -0
- package/docs/API-reference/api/x-adapter-platform.platformrelatedpromptnextqueriestagging.toolingdisplayclick.md +11 -0
- package/docs/API-reference/api/x-adapter-platform.platformrelatedpromptsrequest.md +15 -0
- package/docs/API-reference/api/x-adapter-platform.platformrelatedpromptsresponse.data.md +13 -0
- package/docs/API-reference/api/x-adapter-platform.platformrelatedpromptsresponse.md +21 -0
- package/docs/API-reference/api/x-adapter-platform.platformrelatedpromptsresponse.status.md +11 -0
- package/docs/API-reference/api/x-adapter-platform.platformrelatedprompttagging.md +22 -0
- package/docs/API-reference/api/x-adapter-platform.platformrelatedprompttagging.nextqueries.md +11 -0
- package/docs/API-reference/api/x-adapter-platform.platformrelatedprompttagging.toolingdisplay.md +11 -0
- package/docs/API-reference/api/x-adapter-platform.platformrelatedprompttagging.toolingdisplayclick.md +11 -0
- package/docs/API-reference/api/x-adapter-platform.platformsearchresponse.catalog.md +6 -0
- package/docs/API-reference/api/x-adapter-platform.platformsearchresponse.md +1 -1
- package/docs/API-reference/api/x-adapter-platform.relatedpromptschema.md +13 -0
- package/docs/API-reference/api/x-adapter-platform.relatedpromptsendpointadapter.md +13 -0
- package/docs/API-reference/api/x-adapter-platform.relatedpromptsrequestmapper.md +13 -0
- package/docs/API-reference/api/x-adapter-platform.relatedpromptsrequestschema.md +13 -0
- package/docs/API-reference/api/x-adapter-platform.relatedpromptsresponsemapper.md +13 -0
- package/docs/API-reference/api/x-adapter-platform.relatedpromptsresponseschema.md +13 -0
- package/docs/API-reference/api/x-components.animationprop.md +6 -1
- package/docs/API-reference/api/x-components.bannerslist.md +3 -3
- package/docs/API-reference/api/x-components.baseaddtocart.md +1 -0
- package/docs/API-reference/api/x-components.basedropdown.md +5 -5
- package/docs/API-reference/api/x-components.baseeventsmodal.md +2 -2
- package/docs/API-reference/api/x-components.basegrid.md +3 -3
- package/docs/API-reference/api/x-components.baseheadertogglepanel.md +5 -5
- package/docs/API-reference/api/x-components.baseidmodal.md +2 -2
- package/docs/API-reference/api/x-components.baseidtogglepanel.md +5 -5
- package/docs/API-reference/api/x-components.basemodal.md +10 -10
- package/docs/API-reference/api/x-components.baseresultimage.md +9 -9
- package/docs/API-reference/api/x-components.baseslider.md +70 -0
- package/docs/API-reference/api/x-components.basesuggestions.md +3 -3
- package/docs/API-reference/api/x-components.baseswitch.md +1 -1
- package/docs/API-reference/api/x-components.basetabspanel.md +8 -8
- package/docs/API-reference/api/x-components.baseteleport.md +21 -0
- package/docs/API-reference/api/x-components.basetogglepanel.md +3 -3
- package/docs/API-reference/api/x-components.basevariablecolumngrid.md +3 -3
- package/docs/API-reference/api/x-components.cancelfetchandsaverelatedprompts.md +13 -0
- package/docs/API-reference/api/x-components.configmutations.config.md +11 -0
- package/docs/API-reference/api/x-components.configmutations.md +29 -0
- package/docs/API-reference/api/x-components.configmutations.mergeconfig.md +24 -0
- package/docs/API-reference/api/x-components.configmutations.setconfig.md +24 -0
- package/docs/API-reference/api/x-components.createrelatedtagsquerygetter.md +26 -0
- package/docs/API-reference/api/x-components.createrelatedtagsquerygetteroptions.getrelatedtags.md +13 -0
- package/docs/API-reference/api/x-components.createrelatedtagsquerygetteroptions.md +20 -0
- package/docs/API-reference/api/x-components.createtrackrelatedprompttoolingdisplayclickwire.md +19 -0
- package/docs/API-reference/api/x-components.createtracktoolingadd2cartwire.md +19 -0
- package/docs/API-reference/api/x-components.createtracktoolingdisplaywire.md +19 -0
- package/docs/API-reference/api/{x-components.defaultpdpaddtocartservice._constructor_.md → x-components.defaultexternaltaggingservice._constructor_.md} +3 -3
- package/docs/API-reference/api/x-components.defaultexternaltaggingservice.add_to_cart_id_key.md +13 -0
- package/docs/API-reference/api/x-components.defaultexternaltaggingservice.instance.md +13 -0
- package/docs/API-reference/api/x-components.defaultexternaltaggingservice.localstorageservice.md +11 -0
- package/docs/API-reference/api/x-components.defaultexternaltaggingservice.md +43 -0
- package/docs/API-reference/api/{x-components.defaultpdpaddtocartservice.movetosessionstorage.md → x-components.defaultexternaltaggingservice.movetosessionstorage.md} +2 -2
- package/docs/API-reference/api/x-components.defaultexternaltaggingservice.result_clicked_id_key.md +13 -0
- package/docs/API-reference/api/x-components.defaultexternaltaggingservice.sessionstorageservice.md +11 -0
- package/docs/API-reference/api/x-components.defaultexternaltaggingservice.storagekey.md +11 -0
- package/docs/API-reference/api/x-components.defaultexternaltaggingservice.storagettlms.md +11 -0
- package/docs/API-reference/api/{x-components.defaultpdpaddtocartservice.store.md → x-components.defaultexternaltaggingservice.store.md} +2 -2
- package/docs/API-reference/api/x-components.defaultexternaltaggingservice.storeaddtocart.md +24 -0
- package/docs/API-reference/api/{x-components.defaultpdpaddtocartservice.storeresultclicked.md → x-components.defaultexternaltaggingservice.storeresultclicked.md} +3 -3
- package/docs/API-reference/api/{x-components.defaultpdpaddtocartservice.trackaddtocart.md → x-components.defaultexternaltaggingservice.trackaddtocart.md} +3 -3
- package/docs/API-reference/api/x-components.displayclickprovider.md +66 -0
- package/docs/API-reference/api/x-components.empathize.md +6 -6
- package/docs/API-reference/api/x-components.empathizemutations.md +1 -1
- package/docs/API-reference/api/x-components.externaltaggingservice.md +23 -0
- package/docs/API-reference/api/{x-components.pdpaddtocartservice.movetosessionstorage.md → x-components.externaltaggingservice.movetosessionstorage.md} +2 -2
- package/docs/API-reference/api/x-components.externaltaggingservice.storeaddtocart.md +24 -0
- package/docs/API-reference/api/{x-components.pdpaddtocartservice.storeresultclicked.md → x-components.externaltaggingservice.storeresultclicked.md} +3 -3
- package/docs/API-reference/api/{x-components.pdpaddtocartservice.trackaddtocart.md → x-components.externaltaggingservice.trackaddtocart.md} +3 -3
- package/docs/API-reference/api/x-components.facets.md +3 -3
- package/docs/API-reference/api/x-components.facetsmutations.md +1 -1
- package/docs/API-reference/api/x-components.featurelocation.md +1 -1
- package/docs/API-reference/api/x-components.fetchandsaverelatedprompts.md +13 -0
- package/docs/API-reference/api/x-components.fetchrelatedprompts.md +13 -0
- package/docs/API-reference/api/x-components.filterslist.md +3 -3
- package/docs/API-reference/api/x-components.globalxbus.md +14 -0
- package/docs/API-reference/api/x-components.hierarchicalfilter.md +9 -2
- package/docs/API-reference/api/x-components.historyqueriesmutations.md +1 -1
- package/docs/API-reference/api/x-components.historyqueriesstate.md +1 -1
- package/docs/API-reference/api/x-components.identifierresults.md +3 -3
- package/docs/API-reference/api/x-components.identifierresultsmutations.md +1 -1
- package/docs/API-reference/api/x-components.identifierresultsstate.md +1 -1
- package/docs/API-reference/api/x-components.installxoptions.domelement.md +1 -1
- package/docs/API-reference/api/x-components.installxoptions.installextraplugins.md +2 -2
- package/docs/API-reference/api/x-components.installxoptions.md +1 -1
- package/docs/API-reference/api/x-components.itemslist.md +3 -3
- package/docs/API-reference/api/x-components.mainmodal.md +2 -2
- package/docs/API-reference/api/x-components.md +39 -3
- package/docs/API-reference/api/x-components.mergeconfig.md +27 -0
- package/docs/API-reference/api/x-components.multicolumnmaxwidthlayout.md +5 -5
- package/docs/API-reference/api/x-components.myhistory.md +3 -3
- package/docs/API-reference/api/x-components.nextqueriesgroup.md +22 -0
- package/docs/API-reference/api/x-components.nextqueriesgroup.modelname.md +11 -0
- package/docs/API-reference/api/x-components.nextqueriesgroup.nextqueries.md +11 -0
- package/docs/API-reference/api/x-components.nextquerieslist.md +3 -3
- package/docs/API-reference/api/x-components.nextqueriesmutations.md +1 -1
- package/docs/API-reference/api/x-components.nextqueriesstate.md +1 -1
- package/docs/API-reference/api/x-components.pageselector.md +80 -0
- package/docs/API-reference/api/x-components.partialresultslist.md +3 -3
- package/docs/API-reference/api/x-components.popularsearchesmutations.md +1 -1
- package/docs/API-reference/api/x-components.promotedslist.md +3 -3
- package/docs/API-reference/api/x-components.queriespreviewmutations.md +1 -1
- package/docs/API-reference/api/x-components.queryfeature.md +1 -1
- package/docs/API-reference/api/x-components.querymutations.md +20 -0
- package/docs/API-reference/api/x-components.querymutations.setquery.md +24 -0
- package/docs/API-reference/api/x-components.querypreviewlist.md +3 -3
- package/docs/API-reference/api/x-components.querystate.md +20 -0
- package/docs/API-reference/api/x-components.querystate.query.md +13 -0
- package/docs/API-reference/api/x-components.querysuggestionsmutations.md +1 -1
- package/docs/API-reference/api/x-components.querysuggestionsstate.md +1 -1
- package/docs/API-reference/api/x-components.recommendations.md +3 -3
- package/docs/API-reference/api/x-components.recommendationsmutations.md +1 -1
- package/docs/API-reference/api/x-components.relatedprompt.md +33 -0
- package/docs/API-reference/api/x-components.relatedpromptsactioncontext.md +15 -0
- package/docs/API-reference/api/x-components.relatedpromptsactions.cancelfetchandsaverelatedprompts.md +17 -0
- package/docs/API-reference/api/x-components.relatedpromptsactions.fetchandsaverelatedprompts.md +24 -0
- package/docs/API-reference/api/x-components.relatedpromptsactions.fetchrelatedprompts.md +24 -0
- package/docs/API-reference/api/x-components.relatedpromptsactions.md +23 -0
- package/docs/API-reference/api/x-components.relatedpromptsactions.seturlparams.md +24 -0
- package/docs/API-reference/api/x-components.relatedpromptsgetters.md +21 -0
- package/docs/API-reference/api/x-components.relatedpromptsgetters.query.md +13 -0
- package/docs/API-reference/api/x-components.relatedpromptsgetters.request.md +13 -0
- package/docs/API-reference/api/x-components.relatedpromptslist.md +72 -0
- package/docs/API-reference/api/x-components.relatedpromptsmutations.md +27 -0
- package/docs/API-reference/api/x-components.relatedpromptsmutations.resetrelatedpromptsstate.md +17 -0
- package/docs/API-reference/api/x-components.relatedpromptsmutations.resetselectedprompt.md +17 -0
- package/docs/API-reference/api/x-components.relatedpromptsmutations.setparams.md +24 -0
- package/docs/API-reference/api/x-components.relatedpromptsmutations.setrelatedpromptsproducts.md +24 -0
- package/docs/API-reference/api/x-components.relatedpromptsmutations.setrelatedpromptsrelatedtags.md +24 -0
- package/docs/API-reference/api/x-components.relatedpromptsmutations.setselectedprompt.md +24 -0
- package/docs/API-reference/api/x-components.relatedpromptsmutations.setselectedquery.md +24 -0
- package/docs/API-reference/api/x-components.relatedpromptsstate.md +25 -0
- package/docs/API-reference/api/x-components.relatedpromptsstate.params.md +13 -0
- package/docs/API-reference/api/x-components.relatedpromptsstate.relatedprompts.md +13 -0
- package/docs/API-reference/api/x-components.relatedpromptsstate.relatedtags.md +13 -0
- package/docs/API-reference/api/x-components.relatedpromptsstate.selectedprompt.md +13 -0
- package/docs/API-reference/api/x-components.relatedpromptsstate.selectedquery.md +13 -0
- package/docs/API-reference/api/x-components.relatedpromptstaglist.md +72 -0
- package/docs/API-reference/api/x-components.relatedpromptsxevents.md +25 -0
- package/docs/API-reference/api/x-components.relatedpromptsxevents.relatedpromptsrequestupdated.md +13 -0
- package/docs/API-reference/api/x-components.relatedpromptsxevents.selectedrelatedpromptchanged.md +13 -0
- package/docs/API-reference/api/x-components.relatedpromptsxevents.userclickedarelatedpromptadd2cart.md +13 -0
- package/docs/API-reference/api/x-components.relatedpromptsxevents.userclickedarelatedpromptresult.md +13 -0
- package/docs/API-reference/api/x-components.relatedpromptsxevents.userselectedarelatedprompt.md +13 -0
- package/docs/API-reference/api/x-components.relatedpromptsxevents.userselectedarelatedpromptquery.md +13 -0
- package/docs/API-reference/api/x-components.relatedpromptsxmodule.md +13 -0
- package/docs/API-reference/api/x-components.relatedpromptsxstoremodule.md +15 -0
- package/docs/API-reference/api/x-components.relatedtags.md +3 -3
- package/docs/API-reference/api/x-components.relatedtagsmutations.md +1 -1
- package/docs/API-reference/api/x-components.relatedtagsstate.md +1 -1
- package/docs/API-reference/api/x-components.resultfeature.md +1 -1
- package/docs/API-reference/api/x-components.resultslist.md +3 -3
- package/docs/API-reference/api/x-components.scrolltotop.md +5 -5
- package/docs/API-reference/api/x-components.searchboxmutations.md +1 -1
- package/docs/API-reference/api/x-components.searchboxstate.md +1 -1
- package/docs/API-reference/api/x-components.searchconfig.md +1 -0
- package/docs/API-reference/api/x-components.searchconfig.pagemode.md +11 -0
- package/docs/API-reference/api/x-components.searchinputplaceholder.md +3 -3
- package/docs/API-reference/api/x-components.searchmutations.md +2 -1
- package/docs/API-reference/api/x-components.searchmutations.setstats.md +24 -0
- package/docs/API-reference/api/x-components.searchstate.md +2 -1
- package/docs/API-reference/api/x-components.searchstate.stats.md +13 -0
- package/docs/API-reference/api/x-components.searchxevents.md +1 -0
- package/docs/API-reference/api/x-components.searchxevents.userselectedapage.md +13 -0
- package/docs/API-reference/api/x-components.selectedfilterslist.md +3 -3
- package/docs/API-reference/api/x-components.semanticqueriesgetters.md +1 -0
- package/docs/API-reference/api/x-components.semanticqueriesgetters.query.md +13 -0
- package/docs/API-reference/api/x-components.semanticqueriesmutations.md +2 -1
- package/docs/API-reference/api/x-components.semanticqueriesmutations.setsemanticqueriesrelatedtags.md +24 -0
- package/docs/API-reference/api/x-components.semanticqueriesstate.md +2 -1
- package/docs/API-reference/api/x-components.semanticqueriesstate.relatedtags.md +13 -0
- package/docs/API-reference/api/x-components.setconfig.md +27 -0
- package/docs/API-reference/api/x-components.setquery.md +25 -0
- package/docs/API-reference/api/x-components.seturlprompt.md +13 -0
- package/docs/API-reference/api/x-components.simplefilter.md +7 -0
- package/docs/API-reference/api/x-components.singlecolumnlayout.md +3 -3
- package/docs/API-reference/api/x-components.slidingpanel.md +13 -5
- package/docs/API-reference/api/x-components.snippetcallbacks.md +7 -0
- package/docs/API-reference/api/x-components.sortdropdown.md +1 -1
- package/docs/API-reference/api/x-components.tagging.md +6 -6
- package/docs/API-reference/api/x-components.taggingconfig.md +2 -2
- package/docs/API-reference/api/{x-components.taggingconfig.clickedresultstoragekey.md → x-components.taggingconfig.storagekey.md} +3 -3
- package/docs/API-reference/api/x-components.taggingconfig.storagettlms.md +13 -0
- package/docs/API-reference/api/x-components.taggingmutations.md +1 -1
- package/docs/API-reference/api/x-components.taggingxevents.md +1 -1
- package/docs/API-reference/api/x-components.taggingxevents.resulturltrackingenabled.md +1 -1
- package/docs/API-reference/api/x-components.trackrelatedprompttoolingdisplayclickwire.md +13 -0
- package/docs/API-reference/api/x-components.tracktoolingadd2cartwire.md +13 -0
- package/docs/API-reference/api/x-components.tracktoolingdisplayclickedwire.md +13 -0
- package/docs/API-reference/api/x-components.typing.md +13 -0
- package/docs/API-reference/api/x-components.typingoptions.md +22 -0
- package/docs/API-reference/api/x-components.typingoptions.speed.md +13 -0
- package/docs/API-reference/api/x-components.typingoptions.targetattr.md +18 -0
- package/docs/API-reference/api/x-components.typingoptions.text.md +13 -0
- package/docs/API-reference/api/x-components.urlmutations.md +2 -1
- package/docs/API-reference/api/x-components.urlmutations.setprompt.md +24 -0
- package/docs/API-reference/api/x-components.urlparams.md +1 -0
- package/docs/API-reference/api/x-components.urlparams.prompt.md +11 -0
- package/docs/API-reference/api/x-components.urlstate.md +1 -1
- package/docs/API-reference/api/x-components.usealiasapi.md +1 -0
- package/docs/API-reference/api/x-components.usealiasapi.pricestats.md +16 -0
- package/docs/API-reference/api/x-components.xeventstypes.md +3 -3
- package/docs/API-reference/api/x-components.xmodulestree.md +1 -0
- package/docs/API-reference/api/x-components.xmodulestree.relatedprompts.md +11 -0
- package/docs/API-reference/api/x-types.md +2 -0
- package/docs/API-reference/api/x-types.relatedprompt.md +4 -1
- package/docs/API-reference/api/x-types.relatedprompt.nextqueries.md +1 -1
- package/docs/API-reference/api/x-types.relatedprompt.relatedpromptnextqueries.md +13 -0
- package/docs/API-reference/api/x-types.relatedprompt.tagging.md +17 -0
- package/docs/API-reference/api/x-types.relatedprompt.toolingdisplaytagging.md +13 -0
- package/docs/API-reference/api/x-types.relatedpromptnextquery.md +23 -0
- package/docs/API-reference/api/x-types.relatedpromptnextquery.query.md +13 -0
- package/docs/API-reference/api/x-types.relatedpromptnextquery.toolingdisplayadd2carttagging.md +13 -0
- package/docs/API-reference/api/x-types.relatedpromptnextquery.toolingdisplayclicktagging.md +13 -0
- package/docs/API-reference/api/x-types.relatedpromptnextquery.toolingdisplaytagging.md +13 -0
- package/docs/API-reference/api/x-types.searchresponse.md +1 -0
- package/docs/API-reference/api/x-types.searchresponse.stats.md +11 -0
- package/docs/API-reference/api/x-types.stats.md +22 -0
- package/docs/API-reference/api/x-types.stats.price.md +14 -0
- package/docs/API-reference/components/common/result/x-components.base-result-image.md +2 -2
- package/docs/API-reference/components/common/x-components.base-slider.md +189 -0
- package/docs/API-reference/components/common/x-components.base-teleport.md +19 -0
- package/docs/API-reference/components/common/x-components.display-click-provider.md +17 -0
- package/docs/API-reference/components/common/x-components.items-list.md +1 -1
- package/docs/API-reference/components/common/x-components.page-selector.md +136 -0
- package/docs/API-reference/components/common/x-components.sliding-panel.md +7 -7
- package/docs/API-reference/components/facets/x-components.facets/facets.md +1 -1
- package/docs/API-reference/components/facets/x-components.lists/selected-filters-list.md +1 -1
- package/docs/API-reference/components/related-prompts/x-components.related-prompt.md +22 -0
- package/docs/API-reference/components/related-prompts/x-components.related-prompts-list.md +196 -0
- package/docs/API-reference/components/related-prompts/x-components.related-prompts-tag-list.md +32 -0
- package/docs/API-reference/components/search/x-components.results-list.md +1 -1
- package/docs/API-reference/components/tagging/x-components.tagging.md +15 -16
- package/js/components/animations/fade-and-slide.vue.js +1 -2
- package/js/components/animations/fade-and-slide.vue.js.map +1 -1
- package/js/components/base-dropdown.vue.js +1 -3
- package/js/components/base-dropdown.vue.js.map +1 -1
- package/js/components/base-dropdown.vue2.js +1 -7
- package/js/components/base-dropdown.vue2.js.map +1 -1
- package/js/components/base-event-button.vue.js +1 -2
- package/js/components/base-event-button.vue.js.map +1 -1
- package/js/components/base-grid.vue.js +11 -18
- package/js/components/base-grid.vue.js.map +1 -1
- package/js/components/base-grid.vue2.js.map +1 -1
- package/js/components/base-grid.vue3.js +1 -1
- package/js/components/base-keyboard-navigation.vue.js +1 -2
- package/js/components/base-keyboard-navigation.vue.js.map +1 -1
- package/js/components/base-rating.vue.js +1 -3
- package/js/components/base-rating.vue.js.map +1 -1
- package/js/components/base-slider.vue.js +65 -0
- package/js/components/base-slider.vue.js.map +1 -0
- package/js/components/base-slider.vue2.js +109 -0
- package/js/components/base-slider.vue2.js.map +1 -0
- package/js/components/base-slider.vue3.js +7 -0
- package/js/components/base-slider.vue3.js.map +1 -0
- package/js/components/base-switch.vue.js.map +1 -1
- package/js/components/base-switch.vue2.js +3 -7
- package/js/components/base-switch.vue2.js.map +1 -1
- package/js/components/base-teleport.vue.js +17 -0
- package/js/components/base-teleport.vue.js.map +1 -0
- package/js/components/base-teleport.vue2.js +14 -0
- package/js/components/base-teleport.vue2.js.map +1 -0
- package/js/components/base-teleport.vue3.js +7 -0
- package/js/components/base-teleport.vue3.js.map +1 -0
- package/js/components/base-variable-column-grid.vue.js +1 -2
- package/js/components/base-variable-column-grid.vue.js.map +1 -1
- package/js/components/column-picker/base-column-picker-dropdown.vue.js +1 -3
- package/js/components/column-picker/base-column-picker-dropdown.vue.js.map +1 -1
- package/js/components/column-picker/base-column-picker-list.vue.js +1 -3
- package/js/components/column-picker/base-column-picker-list.vue.js.map +1 -1
- package/js/components/display-click-provider.vue.js +74 -0
- package/js/components/display-click-provider.vue.js.map +1 -0
- package/js/components/display-click-provider.vue2.js +6 -0
- package/js/components/display-click-provider.vue2.js.map +1 -0
- package/js/components/filters/labels/base-rating-filter-label.vue.js +1 -3
- package/js/components/filters/labels/base-rating-filter-label.vue.js.map +1 -1
- package/js/components/icons/cross-tiny.vue.js +2 -2
- package/js/components/icons/plus.vue.js +2 -2
- package/js/components/items-list.vue.js +1 -2
- package/js/components/items-list.vue.js.map +1 -1
- package/js/components/items-list.vue2.js +2 -2
- package/js/components/items-list.vue2.js.map +1 -1
- package/js/components/layouts/fixed-header-and-asides-layout.vue.js +1 -7
- package/js/components/layouts/fixed-header-and-asides-layout.vue.js.map +1 -1
- package/js/components/layouts/multi-column-max-width-layout.vue.js +1 -9
- package/js/components/layouts/multi-column-max-width-layout.vue.js.map +1 -1
- package/js/components/layouts/single-column-layout.vue.js +1 -9
- package/js/components/layouts/single-column-layout.vue.js.map +1 -1
- package/js/components/modals/base-events-modal-close.vue.js +1 -2
- package/js/components/modals/base-events-modal-close.vue.js.map +1 -1
- package/js/components/modals/base-events-modal-open.vue.js +1 -2
- package/js/components/modals/base-events-modal-open.vue.js.map +1 -1
- package/js/components/modals/base-id-modal-close.vue.js +1 -2
- package/js/components/modals/base-id-modal-close.vue.js.map +1 -1
- package/js/components/modals/base-id-modal-open.vue.js +1 -2
- package/js/components/modals/base-id-modal-open.vue.js.map +1 -1
- package/js/components/modals/base-modal.vue.js +1 -2
- package/js/components/modals/base-modal.vue.js.map +1 -1
- package/js/components/modals/base-modal.vue2.js +13 -6
- package/js/components/modals/base-modal.vue2.js.map +1 -1
- package/js/components/page-loader-button.vue.js +8 -10
- package/js/components/page-loader-button.vue.js.map +1 -1
- package/js/components/page-loader-button.vue2.js.map +1 -1
- package/js/components/page-loader-button.vue3.js +7 -0
- package/js/components/page-loader-button.vue3.js.map +1 -0
- package/js/components/page-selector.vue.js +78 -0
- package/js/components/page-selector.vue.js.map +1 -0
- package/js/components/page-selector.vue2.js +128 -0
- package/js/components/page-selector.vue2.js.map +1 -0
- package/js/components/page-selector.vue3.js +7 -0
- package/js/components/page-selector.vue3.js.map +1 -0
- package/js/components/panels/base-header-toggle-panel.vue.js +1 -5
- package/js/components/panels/base-header-toggle-panel.vue.js.map +1 -1
- package/js/components/panels/base-id-toggle-panel-button.vue.js +1 -2
- package/js/components/panels/base-id-toggle-panel-button.vue.js.map +1 -1
- package/js/components/panels/base-id-toggle-panel.vue.js +1 -2
- package/js/components/panels/base-id-toggle-panel.vue.js.map +1 -1
- package/js/components/panels/base-tabs-panel.vue.js +1 -4
- package/js/components/panels/base-tabs-panel.vue.js.map +1 -1
- package/js/components/panels/base-toggle-panel.vue.js +1 -2
- package/js/components/panels/base-toggle-panel.vue.js.map +1 -1
- package/js/components/result/base-result-add-to-cart.vue.js +3 -3
- package/js/components/result/base-result-add-to-cart.vue.js.map +1 -1
- package/js/components/result/base-result-add-to-cart.vue2.js +19 -5
- package/js/components/result/base-result-add-to-cart.vue2.js.map +1 -1
- package/js/components/result/base-result-current-price.vue.js +1 -2
- package/js/components/result/base-result-current-price.vue.js.map +1 -1
- package/js/components/result/base-result-image.vue.js +39 -59
- package/js/components/result/base-result-image.vue.js.map +1 -1
- package/js/components/result/base-result-image.vue2.js +5 -5
- package/js/components/result/base-result-image.vue2.js.map +1 -1
- package/js/components/result/base-result-link.vue.js +1 -2
- package/js/components/result/base-result-link.vue.js.map +1 -1
- package/js/components/result/base-result-previous-price.vue.js +1 -2
- package/js/components/result/base-result-previous-price.vue.js.map +1 -1
- package/js/components/result/base-result-rating.vue.js +1 -4
- package/js/components/result/base-result-rating.vue.js.map +1 -1
- package/js/components/result/result-variant-selector.vue.js +1 -3
- package/js/components/result/result-variant-selector.vue.js.map +1 -1
- package/js/components/sliding-panel.vue.js +3 -6
- package/js/components/sliding-panel.vue.js.map +1 -1
- package/js/components/sliding-panel.vue2.js +2 -2
- package/js/components/sliding-panel.vue2.js.map +1 -1
- package/js/components/suggestions/base-suggestion.vue.js +1 -2
- package/js/components/suggestions/base-suggestion.vue.js.map +1 -1
- package/js/components/suggestions/base-suggestions.vue.js +1 -2
- package/js/components/suggestions/base-suggestions.vue.js.map +1 -1
- package/js/composables/use-alias-api.js +4 -1
- package/js/composables/use-alias-api.js.map +1 -1
- package/js/composables/use-getter.js +1 -1
- package/js/composables/use-state.js +1 -1
- package/js/directives/typing.js +58 -0
- package/js/directives/typing.js.map +1 -0
- package/js/index.js +21 -4
- package/js/index.js.map +1 -1
- package/js/types/animation-prop.js +5 -0
- package/js/types/animation-prop.js.map +1 -1
- package/js/x-installer/x-installer/x-installer.js +3 -3
- package/js/x-installer/x-installer/x-installer.js.map +1 -1
- package/js/x-modules/device/store/emitters.js +1 -0
- package/js/x-modules/device/store/emitters.js.map +1 -1
- package/js/x-modules/empathize/components/empathize.vue.js +1 -2
- package/js/x-modules/empathize/components/empathize.vue.js.map +1 -1
- package/js/x-modules/empathize/components/empathize.vue2.js +10 -3
- package/js/x-modules/empathize/components/empathize.vue2.js.map +1 -1
- package/js/x-modules/empathize/store/emitters.js +1 -0
- package/js/x-modules/empathize/store/emitters.js.map +1 -1
- package/js/x-modules/experience-controls/store/emitters.js +1 -0
- package/js/x-modules/experience-controls/store/emitters.js.map +1 -1
- package/js/x-modules/extra-params/components/extra-params.vue.js +1 -1
- package/js/x-modules/extra-params/components/extra-params.vue.js.map +1 -1
- package/js/x-modules/extra-params/store/emitters.js +1 -0
- package/js/x-modules/extra-params/store/emitters.js.map +1 -1
- package/js/x-modules/facets/components/facets/facets.vue.js +20 -33
- package/js/x-modules/facets/components/facets/facets.vue.js.map +1 -1
- package/js/x-modules/facets/components/facets/facets.vue2.js +2 -2
- package/js/x-modules/facets/components/facets/facets.vue2.js.map +1 -1
- package/js/x-modules/facets/components/filters/all-filter.vue.js +1 -2
- package/js/x-modules/facets/components/filters/all-filter.vue.js.map +1 -1
- package/js/x-modules/facets/components/filters/editable-number-range-filter.vue.js +1 -6
- package/js/x-modules/facets/components/filters/editable-number-range-filter.vue.js.map +1 -1
- package/js/x-modules/facets/components/filters/hierarchical-filter.vue.js +1 -3
- package/js/x-modules/facets/components/filters/hierarchical-filter.vue.js.map +1 -1
- package/js/x-modules/facets/components/filters/number-range-filter.vue.js +1 -3
- package/js/x-modules/facets/components/filters/number-range-filter.vue.js.map +1 -1
- package/js/x-modules/facets/components/filters/simple-filter.vue.js +1 -3
- package/js/x-modules/facets/components/filters/simple-filter.vue.js.map +1 -1
- package/js/x-modules/facets/components/lists/filters-list.vue.js +1 -2
- package/js/x-modules/facets/components/lists/filters-list.vue.js.map +1 -1
- package/js/x-modules/facets/components/lists/filters-search.vue.js +1 -3
- package/js/x-modules/facets/components/lists/filters-search.vue.js.map +1 -1
- package/js/x-modules/facets/components/lists/selected-filters-list.vue.js +11 -18
- package/js/x-modules/facets/components/lists/selected-filters-list.vue.js.map +1 -1
- package/js/x-modules/facets/components/lists/selected-filters-list.vue2.js +2 -2
- package/js/x-modules/facets/components/lists/selected-filters-list.vue2.js.map +1 -1
- package/js/x-modules/facets/components/lists/sliced-filters.vue.js +1 -4
- package/js/x-modules/facets/components/lists/sliced-filters.vue.js.map +1 -1
- package/js/x-modules/history-queries/components/clear-history-queries.vue.js +1 -2
- package/js/x-modules/history-queries/components/clear-history-queries.vue.js.map +1 -1
- package/js/x-modules/history-queries/components/history-queries.vue.js +1 -10
- package/js/x-modules/history-queries/components/history-queries.vue.js.map +1 -1
- package/js/x-modules/history-queries/components/history-query.vue.js +1 -6
- package/js/x-modules/history-queries/components/history-query.vue.js.map +1 -1
- package/js/x-modules/history-queries/components/my-history.vue.js +1 -4
- package/js/x-modules/history-queries/components/my-history.vue.js.map +1 -1
- package/js/x-modules/history-queries/components/remove-history-query.vue.js +1 -2
- package/js/x-modules/history-queries/components/remove-history-query.vue.js.map +1 -1
- package/js/x-modules/history-queries/store/emitters.js +1 -0
- package/js/x-modules/history-queries/store/emitters.js.map +1 -1
- package/js/x-modules/identifier-results/components/identifier-results.vue.js +1 -2
- package/js/x-modules/identifier-results/components/identifier-results.vue.js.map +1 -1
- package/js/x-modules/identifier-results/store/emitters.js +1 -0
- package/js/x-modules/identifier-results/store/emitters.js.map +1 -1
- package/js/x-modules/next-queries/components/next-queries.vue.js +1 -7
- package/js/x-modules/next-queries/components/next-queries.vue.js.map +1 -1
- package/js/x-modules/next-queries/components/next-query-preview.vue.js +1 -3
- package/js/x-modules/next-queries/components/next-query-preview.vue.js.map +1 -1
- package/js/x-modules/next-queries/components/next-query.vue.js +1 -4
- package/js/x-modules/next-queries/components/next-query.vue.js.map +1 -1
- package/js/x-modules/next-queries/store/emitters.js +1 -0
- package/js/x-modules/next-queries/store/emitters.js.map +1 -1
- package/js/x-modules/popular-searches/components/popular-search.vue.js +1 -4
- package/js/x-modules/popular-searches/components/popular-search.vue.js.map +1 -1
- package/js/x-modules/popular-searches/components/popular-searches.vue.js +1 -7
- package/js/x-modules/popular-searches/components/popular-searches.vue.js.map +1 -1
- package/js/x-modules/queries-preview/components/query-preview-button.vue.js +1 -2
- package/js/x-modules/queries-preview/components/query-preview-button.vue.js.map +1 -1
- package/js/x-modules/queries-preview/components/query-preview-button.vue2.js +8 -0
- package/js/x-modules/queries-preview/components/query-preview-button.vue2.js.map +1 -1
- package/js/x-modules/queries-preview/components/query-preview-list.vue.js.map +1 -1
- package/js/x-modules/queries-preview/components/query-preview-list.vue2.js +15 -2
- package/js/x-modules/queries-preview/components/query-preview-list.vue2.js.map +1 -1
- package/js/x-modules/queries-preview/components/query-preview.vue.js +1 -2
- package/js/x-modules/queries-preview/components/query-preview.vue.js.map +1 -1
- package/js/x-modules/queries-preview/components/query-preview.vue2.js +9 -1
- package/js/x-modules/queries-preview/components/query-preview.vue2.js.map +1 -1
- package/js/x-modules/queries-preview/store/actions/fetch-and-save-query-preview.action.js +2 -1
- package/js/x-modules/queries-preview/store/actions/fetch-and-save-query-preview.action.js.map +1 -1
- package/js/x-modules/queries-preview/store/emitters.js +1 -0
- package/js/x-modules/queries-preview/store/emitters.js.map +1 -1
- package/js/x-modules/queries-preview/store/module.js +1 -1
- package/js/x-modules/queries-preview/store/module.js.map +1 -1
- package/js/x-modules/queries-preview/utils/get-hash-from-query-preview.js +6 -4
- package/js/x-modules/queries-preview/utils/get-hash-from-query-preview.js.map +1 -1
- package/js/x-modules/query-suggestions/components/query-suggestion.vue.js +1 -4
- package/js/x-modules/query-suggestions/components/query-suggestion.vue.js.map +1 -1
- package/js/x-modules/query-suggestions/components/query-suggestions.vue.js +1 -7
- package/js/x-modules/query-suggestions/components/query-suggestions.vue.js.map +1 -1
- package/js/x-modules/query-suggestions/store/emitters.js +1 -0
- package/js/x-modules/query-suggestions/store/emitters.js.map +1 -1
- package/js/x-modules/recommendations/components/recommendations.vue.js +1 -2
- package/js/x-modules/recommendations/components/recommendations.vue.js.map +1 -1
- package/js/x-modules/recommendations/store/emitters.js +1 -0
- package/js/x-modules/recommendations/store/emitters.js.map +1 -1
- package/js/x-modules/related-prompts/components/related-prompt.vue.js +27 -0
- package/js/x-modules/related-prompts/components/related-prompt.vue.js.map +1 -0
- package/js/x-modules/related-prompts/components/related-prompt.vue2.js +31 -0
- package/js/x-modules/related-prompts/components/related-prompt.vue2.js.map +1 -0
- package/js/x-modules/related-prompts/components/related-prompt.vue3.js +7 -0
- package/js/x-modules/related-prompts/components/related-prompt.vue3.js.map +1 -0
- package/js/x-modules/related-prompts/components/related-prompts-list.vue.js +154 -0
- package/js/x-modules/related-prompts/components/related-prompts-list.vue.js.map +1 -0
- package/js/x-modules/related-prompts/components/related-prompts-list.vue2.js +6 -0
- package/js/x-modules/related-prompts/components/related-prompts-list.vue2.js.map +1 -0
- package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue.js +101 -0
- package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue.js.map +1 -0
- package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue2.js +221 -0
- package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue2.js.map +1 -0
- package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue3.js +7 -0
- package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue3.js.map +1 -0
- package/js/x-modules/related-prompts/store/actions/fetch-and-save-related-prompts.action.js +29 -0
- package/js/x-modules/related-prompts/store/actions/fetch-and-save-related-prompts.action.js.map +1 -0
- package/js/x-modules/related-prompts/store/actions/fetch-related-prompts.action.js +20 -0
- package/js/x-modules/related-prompts/store/actions/fetch-related-prompts.action.js.map +1 -0
- package/js/x-modules/related-prompts/store/actions/set-url-params.action.js +15 -0
- package/js/x-modules/related-prompts/store/actions/set-url-params.action.js.map +1 -0
- package/js/x-modules/related-prompts/store/emitters.js +16 -0
- package/js/x-modules/related-prompts/store/emitters.js.map +1 -0
- package/js/x-modules/related-prompts/store/getters/related-prompts-query.getter.js +18 -0
- package/js/x-modules/related-prompts/store/getters/related-prompts-query.getter.js.map +1 -0
- package/js/x-modules/related-prompts/store/getters/request.getter.js +17 -0
- package/js/x-modules/related-prompts/store/getters/request.getter.js.map +1 -0
- package/js/x-modules/related-prompts/store/module.js +64 -0
- package/js/x-modules/related-prompts/store/module.js.map +1 -0
- package/js/x-modules/related-prompts/wiring.js +82 -0
- package/js/x-modules/related-prompts/wiring.js.map +1 -0
- package/js/x-modules/related-prompts/x-module.js +21 -0
- package/js/x-modules/related-prompts/x-module.js.map +1 -0
- package/js/x-modules/related-tags/components/related-tag.vue.js +1 -2
- package/js/x-modules/related-tags/components/related-tag.vue.js.map +1 -1
- package/js/x-modules/related-tags/components/related-tags.vue.js +1 -4
- package/js/x-modules/related-tags/components/related-tags.vue.js.map +1 -1
- package/js/x-modules/related-tags/store/emitters.js +1 -0
- package/js/x-modules/related-tags/store/emitters.js.map +1 -1
- package/js/x-modules/scroll/components/scroll-to-top.vue.js +1 -2
- package/js/x-modules/scroll/components/scroll-to-top.vue.js.map +1 -1
- package/js/x-modules/scroll/components/scroll-to-top.vue2.js +8 -0
- package/js/x-modules/scroll/components/scroll-to-top.vue2.js.map +1 -1
- package/js/x-modules/scroll/store/emitters.js +1 -0
- package/js/x-modules/scroll/store/emitters.js.map +1 -1
- package/js/x-modules/search/components/partial-results-list.vue.js +1 -2
- package/js/x-modules/search/components/partial-results-list.vue.js.map +1 -1
- package/js/x-modules/search/components/results-list.vue.js +2 -2
- package/js/x-modules/search/components/results-list.vue.js.map +1 -1
- package/js/x-modules/search/components/sort-dropdown.vue.js +1 -3
- package/js/x-modules/search/components/sort-dropdown.vue.js.map +1 -1
- package/js/x-modules/search/store/actions/fetch-and-save-search-response.action.js +10 -3
- package/js/x-modules/search/store/actions/fetch-and-save-search-response.action.js.map +1 -1
- package/js/x-modules/search/store/actions/save-search-response.action.js +3 -1
- package/js/x-modules/search/store/actions/save-search-response.action.js.map +1 -1
- package/js/x-modules/search/store/emitters.js +1 -0
- package/js/x-modules/search/store/emitters.js.map +1 -1
- package/js/x-modules/search/store/module.js +9 -3
- package/js/x-modules/search/store/module.js.map +1 -1
- package/js/x-modules/search/wiring.js +4 -0
- package/js/x-modules/search/wiring.js.map +1 -1
- package/js/x-modules/search-box/components/clear-search-input.vue.js +1 -2
- package/js/x-modules/search-box/components/clear-search-input.vue.js.map +1 -1
- package/js/x-modules/search-box/components/search-button.vue.js +1 -2
- package/js/x-modules/search-box/components/search-button.vue.js.map +1 -1
- package/js/x-modules/search-box/store/emitters.js +1 -0
- package/js/x-modules/search-box/store/emitters.js.map +1 -1
- package/js/x-modules/semantic-queries/components/semantic-queries.vue.js +1 -3
- package/js/x-modules/semantic-queries/components/semantic-queries.vue.js.map +1 -1
- package/js/x-modules/semantic-queries/components/semantic-query.vue.js +1 -4
- package/js/x-modules/semantic-queries/components/semantic-query.vue.js.map +1 -1
- package/js/x-modules/semantic-queries/store/getters/normalized-query.getter.js +1 -1
- package/js/x-modules/semantic-queries/store/getters/normalized-query.getter.js.map +1 -1
- package/js/x-modules/semantic-queries/store/getters/request.getter.js +5 -4
- package/js/x-modules/semantic-queries/store/getters/request.getter.js.map +1 -1
- package/js/x-modules/semantic-queries/store/getters/semanti-queries-query.getter.js +18 -0
- package/js/x-modules/semantic-queries/store/getters/semanti-queries-query.getter.js.map +1 -0
- package/js/x-modules/semantic-queries/store/module.js +8 -2
- package/js/x-modules/semantic-queries/store/module.js.map +1 -1
- package/js/x-modules/semantic-queries/wiring.js +5 -0
- package/js/x-modules/semantic-queries/wiring.js.map +1 -1
- package/js/x-modules/tagging/components/tagging.vue.js +8 -7
- package/js/x-modules/tagging/components/tagging.vue.js.map +1 -1
- package/js/x-modules/tagging/service/{pdp-add-to-cart.service.js → external-tagging.service.js} +56 -25
- package/js/x-modules/tagging/service/external-tagging.service.js.map +1 -0
- package/js/x-modules/tagging/store/emitters.js +1 -1
- package/js/x-modules/tagging/store/emitters.js.map +1 -1
- package/js/x-modules/tagging/store/module.js +7 -3
- package/js/x-modules/tagging/store/module.js.map +1 -1
- package/js/x-modules/tagging/wiring.js +110 -9
- package/js/x-modules/tagging/wiring.js.map +1 -1
- package/js/x-modules/url/components/url-handler.vue.js.map +1 -1
- package/js/x-modules/url/components/url-handler.vue2.js +4 -5
- package/js/x-modules/url/components/url-handler.vue2.js.map +1 -1
- package/js/x-modules/url/store/emitters.js +1 -0
- package/js/x-modules/url/store/emitters.js.map +1 -1
- package/js/x-modules/url/store/getters/url-params.getter.js +2 -3
- package/js/x-modules/url/store/getters/url-params.getter.js.map +1 -1
- package/js/x-modules/url/store/initial-state.js +2 -1
- package/js/x-modules/url/store/initial-state.js.map +1 -1
- package/js/x-modules/url/store/module.js +3 -0
- package/js/x-modules/url/store/module.js.map +1 -1
- package/js/x-modules/url/wiring.js +10 -1
- package/js/x-modules/url/wiring.js.map +1 -1
- package/package.json +50 -49
- package/related-prompts/index.d.ts +1 -0
- package/related-prompts/index.js +9 -0
- package/report/x-adapter-platform.api.json +895 -67
- package/report/x-components.api.json +16491 -17162
- package/report/x-components.api.md +847 -215
- package/report/x-types.api.json +320 -4
- package/tagging/index.js +2 -2
- package/types/adapter/mocked-responses.d.ts +3 -0
- package/types/adapter/mocked-responses.d.ts.map +1 -1
- package/types/components/base-dropdown.vue.d.ts +5 -5
- package/types/components/base-dropdown.vue.d.ts.map +1 -1
- package/types/components/base-grid.vue.d.ts +3 -3
- package/types/components/base-slider.vue.d.ts +74 -0
- package/types/components/base-slider.vue.d.ts.map +1 -0
- package/types/components/base-switch.vue.d.ts +2 -1
- package/types/components/base-switch.vue.d.ts.map +1 -1
- package/types/components/base-teleport.vue.d.ts +13 -0
- package/types/components/base-teleport.vue.d.ts.map +1 -0
- package/types/components/base-variable-column-grid.vue.d.ts +3 -3
- package/types/components/display-click-provider.vue.d.ts +61 -0
- package/types/components/display-click-provider.vue.d.ts.map +1 -0
- package/types/components/global-x-bus.vue.d.ts +14 -0
- package/types/components/global-x-bus.vue.d.ts.map +1 -1
- package/types/components/index.d.ts +4 -0
- package/types/components/index.d.ts.map +1 -1
- package/types/components/items-list.vue.d.ts +3 -3
- package/types/components/layouts/multi-column-max-width-layout.vue.d.ts +5 -5
- package/types/components/layouts/single-column-layout.vue.d.ts +3 -3
- package/types/components/modals/base-events-modal.vue.d.ts +2 -2
- package/types/components/modals/base-id-modal.vue.d.ts +2 -2
- package/types/components/modals/base-modal.vue.d.ts +10 -10
- package/types/components/modals/base-modal.vue.d.ts.map +1 -1
- package/types/components/modals/main-modal.vue.d.ts +2 -2
- package/types/components/page-selector.vue.d.ts +125 -0
- package/types/components/page-selector.vue.d.ts.map +1 -0
- package/types/components/panels/base-header-toggle-panel.vue.d.ts +5 -5
- package/types/components/panels/base-id-toggle-panel.vue.d.ts +5 -5
- package/types/components/panels/base-tabs-panel.vue.d.ts +8 -8
- package/types/components/panels/base-toggle-panel.vue.d.ts +3 -3
- package/types/components/result/base-result-add-to-cart.vue.d.ts +2 -0
- package/types/components/result/base-result-add-to-cart.vue.d.ts.map +1 -1
- package/types/components/result/base-result-image.vue.d.ts +10 -10
- package/types/components/result/base-result-image.vue.d.ts.map +1 -1
- package/types/components/sliding-panel.vue.d.ts +15 -5
- package/types/components/sliding-panel.vue.d.ts.map +1 -1
- package/types/components/snippet-callbacks.vue.d.ts +7 -0
- package/types/components/snippet-callbacks.vue.d.ts.map +1 -1
- package/types/components/suggestions/base-suggestions.vue.d.ts +3 -3
- package/types/composables/use-alias-api.d.ts +5 -0
- package/types/composables/use-alias-api.d.ts.map +1 -1
- package/types/composables/use-store.d.ts +2 -2
- package/types/composables/use-store.d.ts.map +1 -1
- package/types/directives/index.d.ts +1 -0
- package/types/directives/index.d.ts.map +1 -1
- package/types/directives/typing.d.ts +35 -0
- package/types/directives/typing.d.ts.map +1 -0
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/types/store/index.d.ts +4 -1
- package/types/store/index.d.ts.map +1 -1
- package/types/tailwind/plugin-options.d.ts +1 -2
- package/types/tailwind/plugin-options.d.ts.map +1 -1
- package/types/types/animation-prop.d.ts +6 -2
- package/types/types/animation-prop.d.ts.map +1 -1
- package/types/types/origin.d.ts +3 -3
- package/types/types/origin.d.ts.map +1 -1
- package/types/types/page-mode.d.ts +2 -0
- package/types/types/page-mode.d.ts.map +1 -0
- package/types/types/url-params.d.ts +1 -0
- package/types/types/url-params.d.ts.map +1 -1
- package/types/views/home/types.d.ts +3 -0
- package/types/views/home/types.d.ts.map +1 -1
- package/types/wiring/events.types.d.ts +3 -1
- package/types/wiring/events.types.d.ts.map +1 -1
- package/types/x-installer/x-installer/types.d.ts +2 -2
- package/types/x-installer/x-installer/types.d.ts.map +1 -1
- package/types/x-installer/x-installer/x-installer.d.ts +4 -4
- package/types/x-installer/x-installer/x-installer.d.ts.map +1 -1
- package/types/x-modules/empathize/components/empathize.vue.d.ts +6 -6
- package/types/x-modules/empathize/components/empathize.vue.d.ts.map +1 -1
- package/types/x-modules/facets/components/facets/facets.vue.d.ts +3 -3
- package/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts +9 -2
- package/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts.map +1 -1
- package/types/x-modules/facets/components/filters/simple-filter.vue.d.ts +7 -0
- package/types/x-modules/facets/components/filters/simple-filter.vue.d.ts.map +1 -1
- package/types/x-modules/facets/components/lists/filters-list.vue.d.ts +3 -3
- package/types/x-modules/facets/components/lists/selected-filters-list.vue.d.ts +3 -3
- package/types/x-modules/history-queries/components/my-history.vue.d.ts +3 -3
- package/types/x-modules/identifier-results/components/identifier-results.vue.d.ts +3 -3
- package/types/x-modules/next-queries/components/next-queries-list.vue.d.ts +3 -3
- package/types/x-modules/next-queries/index.d.ts +1 -0
- package/types/x-modules/next-queries/index.d.ts.map +1 -1
- package/types/x-modules/queries-preview/components/query-preview-list.vue.d.ts +3 -3
- package/types/x-modules/queries-preview/components/query-preview-list.vue.d.ts.map +1 -1
- package/types/x-modules/queries-preview/components/query-preview.vue.d.ts.map +1 -1
- package/types/x-modules/queries-preview/store/actions/fetch-and-save-query-preview.action.d.ts.map +1 -1
- package/types/x-modules/queries-preview/store/module.d.ts.map +1 -1
- package/types/x-modules/queries-preview/utils/get-hash-from-query-preview.d.ts +4 -2
- package/types/x-modules/queries-preview/utils/get-hash-from-query-preview.d.ts.map +1 -1
- package/types/x-modules/recommendations/components/recommendations.vue.d.ts +3 -3
- package/types/x-modules/related-prompts/components/index.d.ts +4 -0
- package/types/x-modules/related-prompts/components/index.d.ts.map +1 -0
- package/types/x-modules/related-prompts/components/related-prompt.vue.d.ts +28 -0
- package/types/x-modules/related-prompts/components/related-prompt.vue.d.ts.map +1 -0
- package/types/x-modules/related-prompts/components/related-prompts-list.vue.d.ts +106 -0
- package/types/x-modules/related-prompts/components/related-prompts-list.vue.d.ts.map +1 -0
- package/types/x-modules/related-prompts/components/related-prompts-tag-list.vue.d.ts +131 -0
- package/types/x-modules/related-prompts/components/related-prompts-tag-list.vue.d.ts.map +1 -0
- package/types/x-modules/related-prompts/events.types.d.ts +41 -0
- package/types/x-modules/related-prompts/events.types.d.ts.map +1 -0
- package/types/x-modules/related-prompts/index.d.ts +6 -0
- package/types/x-modules/related-prompts/index.d.ts.map +1 -0
- package/types/x-modules/related-prompts/store/actions/fetch-and-save-related-prompts.action.d.ts +17 -0
- package/types/x-modules/related-prompts/store/actions/fetch-and-save-related-prompts.action.d.ts.map +1 -0
- package/types/x-modules/related-prompts/store/actions/fetch-related-prompts.action.d.ts +13 -0
- package/types/x-modules/related-prompts/store/actions/fetch-related-prompts.action.d.ts.map +1 -0
- package/types/x-modules/related-prompts/store/actions/set-url-params.action.d.ts +11 -0
- package/types/x-modules/related-prompts/store/actions/set-url-params.action.d.ts.map +1 -0
- package/types/x-modules/related-prompts/store/emitters.d.ts +10 -0
- package/types/x-modules/related-prompts/store/emitters.d.ts.map +1 -0
- package/types/x-modules/related-prompts/store/getters/index.d.ts +3 -0
- package/types/x-modules/related-prompts/store/getters/index.d.ts.map +1 -0
- package/types/x-modules/related-prompts/store/getters/related-prompts-query.getter.d.ts +13 -0
- package/types/x-modules/related-prompts/store/getters/related-prompts-query.getter.d.ts.map +1 -0
- package/types/x-modules/related-prompts/store/getters/request.getter.d.ts +14 -0
- package/types/x-modules/related-prompts/store/getters/request.getter.d.ts.map +1 -0
- package/types/x-modules/related-prompts/store/index.d.ts +6 -0
- package/types/x-modules/related-prompts/store/index.d.ts.map +1 -0
- package/types/x-modules/related-prompts/store/module.d.ts +8 -0
- package/types/x-modules/related-prompts/store/module.d.ts.map +1 -0
- package/types/x-modules/related-prompts/store/types.d.ts +125 -0
- package/types/x-modules/related-prompts/store/types.d.ts.map +1 -0
- package/types/x-modules/related-prompts/types.d.ts +10 -0
- package/types/x-modules/related-prompts/types.d.ts.map +1 -0
- package/types/x-modules/related-prompts/wiring.d.ts +42 -0
- package/types/x-modules/related-prompts/wiring.d.ts.map +1 -0
- package/types/x-modules/related-prompts/x-module.d.ts +16 -0
- package/types/x-modules/related-prompts/x-module.d.ts.map +1 -0
- package/types/x-modules/related-tags/components/related-tags.vue.d.ts +3 -3
- package/types/x-modules/scroll/components/scroll-to-top.vue.d.ts +5 -5
- package/types/x-modules/search/components/banners-list.vue.d.ts +3 -3
- package/types/x-modules/search/components/partial-results-list.vue.d.ts +3 -3
- package/types/x-modules/search/components/promoteds-list.vue.d.ts +3 -3
- package/types/x-modules/search/components/results-list.vue.d.ts +3 -3
- package/types/x-modules/search/components/sort-dropdown.vue.d.ts +1 -1
- package/types/x-modules/search/config.types.d.ts +2 -0
- package/types/x-modules/search/config.types.d.ts.map +1 -1
- package/types/x-modules/search/events.types.d.ts +4 -0
- package/types/x-modules/search/events.types.d.ts.map +1 -1
- package/types/x-modules/search/store/actions/fetch-and-save-search-response.action.d.ts.map +1 -1
- package/types/x-modules/search/store/actions/save-search-response.action.d.ts.map +1 -1
- package/types/x-modules/search/store/module.d.ts +2 -0
- package/types/x-modules/search/store/module.d.ts.map +1 -1
- package/types/x-modules/search/store/types.d.ts +9 -1
- package/types/x-modules/search/store/types.d.ts.map +1 -1
- package/types/x-modules/search/wiring.d.ts +4 -0
- package/types/x-modules/search/wiring.d.ts.map +1 -1
- package/types/x-modules/search-box/components/search-input-placeholder.vue.d.ts +3 -3
- package/types/x-modules/semantic-queries/store/getters/index.d.ts +1 -0
- package/types/x-modules/semantic-queries/store/getters/index.d.ts.map +1 -1
- package/types/x-modules/semantic-queries/store/getters/normalized-query.getter.d.ts +1 -1
- package/types/x-modules/semantic-queries/store/getters/request.getter.d.ts +2 -1
- package/types/x-modules/semantic-queries/store/getters/request.getter.d.ts.map +1 -1
- package/types/x-modules/semantic-queries/store/getters/semanti-queries-query.getter.d.ts +13 -0
- package/types/x-modules/semantic-queries/store/getters/semanti-queries-query.getter.d.ts.map +1 -0
- package/types/x-modules/semantic-queries/store/module.d.ts.map +1 -1
- package/types/x-modules/semantic-queries/store/types.d.ts +13 -1
- package/types/x-modules/semantic-queries/store/types.d.ts.map +1 -1
- package/types/x-modules/semantic-queries/wiring.d.ts +3 -0
- package/types/x-modules/semantic-queries/wiring.d.ts.map +1 -1
- package/types/x-modules/tagging/components/tagging.vue.d.ts +14 -12
- package/types/x-modules/tagging/components/tagging.vue.d.ts.map +1 -1
- package/types/x-modules/tagging/config.types.d.ts +3 -3
- package/types/x-modules/tagging/config.types.d.ts.map +1 -1
- package/types/x-modules/tagging/events.types.d.ts +2 -2
- package/types/x-modules/tagging/service/{pdp-add-to-cart.service.d.ts → external-tagging.service.d.ts} +31 -13
- package/types/x-modules/tagging/service/external-tagging.service.d.ts.map +1 -0
- package/types/x-modules/tagging/service/index.d.ts +1 -1
- package/types/x-modules/tagging/service/index.d.ts.map +1 -1
- package/types/x-modules/tagging/service/types.d.ts +13 -4
- package/types/x-modules/tagging/service/types.d.ts.map +1 -1
- package/types/x-modules/tagging/store/module.d.ts.map +1 -1
- package/types/x-modules/tagging/wiring.d.ts +54 -2
- package/types/x-modules/tagging/wiring.d.ts.map +1 -1
- package/types/x-modules/url/components/url-handler.vue.d.ts.map +1 -1
- package/types/x-modules/url/store/getters/url-params.getter.d.ts +2 -3
- package/types/x-modules/url/store/getters/url-params.getter.d.ts.map +1 -1
- package/types/x-modules/url/store/initial-state.d.ts.map +1 -1
- package/types/x-modules/url/store/module.d.ts.map +1 -1
- package/types/x-modules/url/store/types.d.ts +6 -0
- package/types/x-modules/url/store/types.d.ts.map +1 -1
- package/types/x-modules/url/wiring.d.ts +9 -0
- package/types/x-modules/url/wiring.d.ts.map +1 -1
- package/types/x-modules/x-modules.types.d.ts +2 -0
- package/types/x-modules/x-modules.types.d.ts.map +1 -1
- package/url/index.js +1 -1
- package/docs/API-reference/api/x-components.defaultpdpaddtocartservice.clickedresultstoragekey.md +0 -11
- package/docs/API-reference/api/x-components.defaultpdpaddtocartservice.clickedresultstoragettlms.md +0 -11
- package/docs/API-reference/api/x-components.defaultpdpaddtocartservice.instance.md +0 -13
- package/docs/API-reference/api/x-components.defaultpdpaddtocartservice.localstorageservice.md +0 -11
- package/docs/API-reference/api/x-components.defaultpdpaddtocartservice.md +0 -41
- package/docs/API-reference/api/x-components.defaultpdpaddtocartservice.result_clicked_id_key.md +0 -13
- package/docs/API-reference/api/x-components.defaultpdpaddtocartservice.sessionstorageservice.md +0 -11
- package/docs/API-reference/api/x-components.pdpaddtocartservice.md +0 -22
- package/docs/API-reference/api/x-components.taggingconfig.clickedresultstoragettlms.md +0 -13
- package/docs/API-reference/api/x-components.usestore.md +0 -19
- package/docs/assets/features/overview-my-history.svg +0 -279
- package/docs/assets/features/overview-product-results-card.svg +0 -128
- package/docs/assets/interface/build-search-ui.svg +0 -167
- package/docs/assets/interface/experience-search-intro.svg +0 -1
- package/docs/assets/interface/integration-guide.svg +0 -1
- package/docs/assets/interface/integration-video.png +0 -0
- package/docs/assets/interface/x-architecture.svg +0 -1
- package/docs/assets/interface/x-empathize.gif +0 -0
- package/docs/assets/interface/x-facets.gif +0 -0
- package/docs/assets/interface/x-facets.svg +0 -189
- package/docs/assets/interface/x-history-queries.gif +0 -0
- package/docs/assets/interface/x-id-results.gif +0 -0
- package/docs/assets/interface/x-next-queries.gif +0 -0
- package/docs/assets/interface/x-popular-searches.gif +0 -0
- package/docs/assets/interface/x-query-suggestions.gif +0 -0
- package/docs/assets/interface/x-recommendations.gif +0 -0
- package/docs/assets/interface/x-recommendations.svg +0 -472
- package/docs/assets/interface/x-related-tags.gif +0 -0
- package/docs/assets/interface/x-results-layout.svg +0 -259
- package/docs/assets/interface/x-search-box-elements.svg +0 -1
- package/docs/assets/interface/x-search-box.svg +0 -60
- package/docs/build-search-ui/README.md +0 -127
- package/docs/build-search-ui/sidebar.js +0 -7
- package/docs/build-search-ui/web-archetype-development-guide.md +0 -186
- package/docs/build-search-ui/web-archetype-integration-guide.md +0 -458
- package/docs/build-search-ui/web-how-to-use-x-components-guide.md +0 -200
- package/docs/build-search-ui/web-x-architecture.md +0 -83
- package/docs/build-search-ui/web-x-components-development-guide.md +0 -157
- package/docs/experience-search-and-discovery/README.md +0 -132
- package/docs/experience-search-and-discovery/empathize.md +0 -119
- package/docs/experience-search-and-discovery/facets-and-filters.md +0 -154
- package/docs/experience-search-and-discovery/history-queries.md +0 -70
- package/docs/experience-search-and-discovery/id-results.md +0 -49
- package/docs/experience-search-and-discovery/my-history.md +0 -60
- package/docs/experience-search-and-discovery/next-queries.md +0 -72
- package/docs/experience-search-and-discovery/popular-searches.md +0 -50
- package/docs/experience-search-and-discovery/product-results-ui.md +0 -82
- package/docs/experience-search-and-discovery/query-suggestions.md +0 -48
- package/docs/experience-search-and-discovery/recommendations.md +0 -134
- package/docs/experience-search-and-discovery/related-tags.md +0 -66
- package/docs/experience-search-and-discovery/search-box.md +0 -99
- package/docs/experience-search-and-discovery/serp-ui.md +0 -125
- package/docs/experience-search-and-discovery/sidebar.js +0 -17
- package/docs/experience-search-and-discovery/web-local-storage.md +0 -30
- package/docs/input-status-machine-state.png +0 -0
- package/js/composables/use-store.js +0 -15
- package/js/composables/use-store.js.map +0 -1
- package/js/utils/options-api.js +0 -4
- package/js/utils/options-api.js.map +0 -1
- package/js/x-modules/tagging/service/pdp-add-to-cart.service.js.map +0 -1
- package/types/utils/options-api.d.ts +0 -3
- package/types/utils/options-api.d.ts.map +0 -1
- package/types/x-modules/tagging/service/pdp-add-to-cart.service.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selected-filters-list.vue2.js","sources":["../../../../../../src/x-modules/facets/components/lists/selected-filters-list.vue"],"sourcesContent":["<template>\n <SelectedFilters\n v-slot=\"{ selectedFilters }\"\n :facetsIds=\"facetsIds\"\n :alwaysVisible=\"alwaysVisible\"\n >\n <component\n :is=\"animation\"\n class=\"x-selected-filters-list\"\n data-test=\"selected-filters-list\"\n tag=\"ul\"\n >\n <li\n v-for=\"{ slotName, selectedFilter } in mapSlot(selectedFilters)\"\n :key=\"selectedFilter.id\"\n class=\"x-selected-filters-list__item\"\n data-test=\"selected-filters-list-item\"\n >\n <!--\n @slot Custom filter rendering. Dynamic slot defined in the template with the filter\n facet id. It renders the filter label by default.\n @binding {Filter} filter - Filter to render.\n -->\n <slot v-if=\"hasSlot(slotName)\" :name=\"slotName\" :filter=\"selectedFilter\">\n <span class=\"x-tag\">{{ selectedFilter.label }}</span>\n </slot>\n\n <!--\n @slot Default filter rendering. It renders the filter label by default.\n @binding {Filter} filter - Filter to render.\n -->\n <slot v-else name=\"default\" :filter=\"selectedFilter\">\n {{ selectedFilter.label }}\n </slot>\n </li>\n </component>\n </SelectedFilters>\n</template>\n\n<script lang=\"ts\">\n import { Facet, Filter, isFacetFilter } from '@empathyco/x-types';\n import { defineComponent, PropType } from 'vue';\n import {
|
|
1
|
+
{"version":3,"file":"selected-filters-list.vue2.js","sources":["../../../../../../src/x-modules/facets/components/lists/selected-filters-list.vue"],"sourcesContent":["<template>\n <SelectedFilters\n v-slot=\"{ selectedFilters }\"\n :facetsIds=\"facetsIds\"\n :alwaysVisible=\"alwaysVisible\"\n >\n <component\n :is=\"animation\"\n class=\"x-selected-filters-list\"\n data-test=\"selected-filters-list\"\n tag=\"ul\"\n >\n <li\n v-for=\"{ slotName, selectedFilter } in mapSlot(selectedFilters)\"\n :key=\"selectedFilter.id\"\n class=\"x-selected-filters-list__item\"\n data-test=\"selected-filters-list-item\"\n >\n <!--\n @slot Custom filter rendering. Dynamic slot defined in the template with the filter\n facet id. It renders the filter label by default.\n @binding {Filter} filter - Filter to render.\n -->\n <slot v-if=\"hasSlot(slotName)\" :name=\"slotName\" :filter=\"selectedFilter\">\n <span class=\"x-tag\">{{ selectedFilter.label }}</span>\n </slot>\n\n <!--\n @slot Default filter rendering. It renders the filter label by default.\n @binding {Filter} filter - Filter to render.\n -->\n <slot v-else name=\"default\" :filter=\"selectedFilter\">\n {{ selectedFilter.label }}\n </slot>\n </li>\n </component>\n </SelectedFilters>\n</template>\n\n<script lang=\"ts\">\n import { Facet, Filter, isFacetFilter } from '@empathyco/x-types';\n import { defineComponent, PropType } from 'vue';\n import { toKebabCase } from '../../../../utils/string';\n import { useFacets } from '../../composables/use-facets';\n import { facetsXModule } from '../../x-module';\n import { AnimationProp } from '../../../../types';\n import SelectedFilters from './selected-filters.vue';\n\n /**\n * Custom interface to provide a slot name to a Filter.\n *\n * @internal\n */\n interface RenderFilter {\n slotName: string;\n selectedFilter: Filter;\n }\n\n /**\n * This component renders a list of selected filters from every facet, or from the facet\n * ids passed as property. It uses the SelectedFilters component (state).\n *\n * It provides two slots: a scoped one which name is the filter facet id; and a default one.\n * Both exposes the filter and renders the filter label by default.\n *\n * The property \"alwaysVisible\" handles if the component is rendered if no filters are selected.\n *\n * @public\n */\n export default defineComponent({\n name: 'SelectedFiltersList',\n xModule: facetsXModule.name,\n components: { SelectedFilters },\n props: {\n /** Array of facets ids used to get the selected filters for those facets. */\n facetsIds: Array as PropType<Array<Facet['id']>>,\n /** Flag to render the component even if there are no filters selected. */\n alwaysVisible: Boolean,\n /** Animation component that will be used to animate the selected filters list. */\n animation: {\n type: AnimationProp,\n default: 'ul'\n }\n },\n setup: function (props, { slots }) {\n const { selectedFilters } = useFacets(props);\n\n /**\n * Transforms a dictionary of Filters including the slot name.\n *\n * @param selectedFilters - A list of selected filters without slot name.\n *\n * @returns A dictionary of facets with the slot name.\n */\n function mapSlot(selectedFilters: Filter[]): RenderFilter[] {\n return selectedFilters.map(filter => ({\n slotName: isFacetFilter(filter) ? toKebabCase(filter.facetId as string) : 'default',\n selectedFilter: filter\n }));\n }\n\n /**\n * Whether the slot is present in the template or not.\n *\n * @param name - The slot name.\n *\n * @returns True is the slot is present in the template. False otherwise.\n */\n function hasSlot(name: string): boolean {\n return !!slots[name];\n }\n\n return {\n selectedFilters,\n mapSlot,\n hasSlot\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Example\n\nThis component renders a list of selected filters from every facet, or from the facets which facets\nids are passed as property. It uses the SelectedFilters component (state).\n\nIt provides two slots: a scoped one which name is the filter facet id; and a default one. Both\nexposes the filter and renders the filter label by default.\n\nThe property \"alwaysVisible\" handles if the component is rendered if no filters are selected.\n\n### Default usage\n\n```vue\n<template>\n <SelectedFiltersList />\n</template>\n\n<script>\n import { SelectedFiltersList } from '@empathyco/x-components/facets';\n\n export default {\n components: {\n SelectedFiltersList\n }\n };\n</script>\n```\n\n### Customized usage\n\n```vue\n<template>\n <SelectedFiltersList #default=\"{ filter }\">Default: {{ filter.label }}</SelectedFiltersList>\n</template>\n\n<script>\n import { SelectedFilters } from '@empathyco/x-components/facets';\n\n export default {\n components: {\n SelectedFilters\n }\n };\n</script>\n```\n\n```vue\n<template>\n <SelectedFiltersList>\n <template #default=\"{ filter }\">Default: {{ filter.label }}</template>\n <template #brand_facet=\"{ filter }\">Brand: {{ filter.label }}</template>\n <template #age_facet=\"{ filter }\">Age: {{ filter.label }}</template>\n <template #price_facet=\"{ filter }\">Price: {{ filter.label }}</template>\n </SelectedFiltersList>\n</template>\n\n<script>\n import { SelectedFilters } from '@empathyco/x-components/facets';\n\n export default {\n components: {\n SelectedFilters\n }\n };\n</script>\n```\n\n#### Always visible\n\nIf \"alwaysVisible\" is true, the component is rendered no matter if there are some filter selected.\nIf \"alwaysVisible\" is false (default), the component is rendered if there are some filter selected.\n\n```vue\n<SelectedFiltersList :alwaysVisible=\"true\" />\n```\n\nOutput:\n\n```html\n<div class=\"x-selected-filters\">\n <ul class=\"x-selected-filters-list\" data-test=\"selected-filters-list\"></ul>\n</div>\n```\n\n#### Providing an array of facet ids\n\nIn this example, the selected filters computed are the ones that match the facet ids passed as\nproperties.\n\n```vue\n<SelectedFilters :facetsIds=\"['brand_facet', 'gender_facet']\" />\n```\n</docs>\n"],"names":["SelectedFilters"],"mappings":";;;;;;;;AA0DE;;;;;;;;;;AAUE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,qBAAqB;IAC3B,OAAO,EAAE,aAAa,CAAC,IAAI;IAC3B,UAAU,EAAE,mBAAEA,WAAc,EAAG;AAC/B,IAAA,KAAK,EAAE;;AAEL,QAAA,SAAS,EAAE,KAAqC;;AAEhD,QAAA,aAAa,EAAE,OAAO;;AAEtB,QAAA,SAAS,EAAE;AACT,YAAA,IAAI,EAAE,aAAa;AACnB,YAAA,OAAO,EAAE,IAAG;AACd,SAAA;AACD,KAAA;AACD,IAAA,KAAK,EAAE,UAAU,KAAK,EAAE,EAAE,KAAM,EAAC,EAAA;QAC/B,MAAM,EAAE,eAAc,KAAM,SAAS,CAAC,KAAK,CAAC,CAAA;AAE5C;;;;;;AAME;QACF,SAAS,OAAO,CAAC,eAAyB,EAAA;YACxC,OAAO,eAAe,CAAC,GAAG,CAAC,MAAO,KAAI;AACpC,gBAAA,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAA,GAAI,WAAW,CAAC,MAAM,CAAC,OAAiB,CAAE,GAAE,SAAS;AACnF,gBAAA,cAAc,EAAE,MAAK;AACtB,aAAA,CAAC,CAAC,CAAA;SACL;AAEA;;;;;;AAME;QACF,SAAS,OAAO,CAAC,IAAY,EAAA;AAC3B,YAAA,OAAO,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;SACtB;QAEA,OAAO;YACL,eAAe;YACf,OAAO;YACP,OAAM;SACP,CAAA;KACH;AACD,CAAA,CAAC;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _sfc_main from './sliced-filters.vue2.js';
|
|
2
|
-
import { openBlock, createElementBlock, normalizeClass,
|
|
2
|
+
import { openBlock, createElementBlock, normalizeClass, renderSlot, Fragment, createTextVNode, createElementVNode, toDisplayString, createCommentVNode } from 'vue';
|
|
3
3
|
import _export_sfc from '../../../../_virtual/_plugin-vue_export-helper.js';
|
|
4
4
|
|
|
5
5
|
const _hoisted_1 = { "data-test": "show-more-amount" };
|
|
@@ -12,7 +12,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
12
12
|
"data-test": "filters-show-more"
|
|
13
13
|
},
|
|
14
14
|
[
|
|
15
|
-
createCommentVNode("\n @slot (Required) Sliced filters content.\n @binding {Filter[]} slicedFilters - Sliced filters..\n "),
|
|
16
15
|
renderSlot(_ctx.$slots, "default", { slicedFilters: _ctx.slicedFilters }),
|
|
17
16
|
_ctx.showButton ? (openBlock(), createElementBlock(
|
|
18
17
|
Fragment,
|
|
@@ -27,7 +26,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
27
26
|
"data-test": "sliced-filters-show-more-button"
|
|
28
27
|
},
|
|
29
28
|
[
|
|
30
|
-
createCommentVNode("\n @slot Button show more filters.\n @binding {number} difference - The difference between the filters and max to show.\n "),
|
|
31
29
|
renderSlot(_ctx.$slots, "show-more", { difference: _ctx.difference }, () => [
|
|
32
30
|
createTextVNode(" Show "),
|
|
33
31
|
createElementVNode(
|
|
@@ -51,7 +49,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
51
49
|
"data-test": "sliced-filters-show-less-button"
|
|
52
50
|
},
|
|
53
51
|
[
|
|
54
|
-
createCommentVNode("\n @slot Button show less filters.\n @binding {number} difference - The difference between the filters and max to show.\n "),
|
|
55
52
|
renderSlot(_ctx.$slots, "show-less", { difference: _ctx.difference }, () => [
|
|
56
53
|
createTextVNode(" Show "),
|
|
57
54
|
createElementVNode(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sliced-filters.vue.js","sources":["../../../../../../src/x-modules/facets/components/lists/sliced-filters.vue"],"sourcesContent":["<template>\n <div class=\"x-sliced-filters\" :class=\"cssClasses\" data-test=\"filters-show-more\">\n <!--\n @slot (Required) Sliced filters content.\n @binding {Filter[]} slicedFilters - Sliced filters..\n -->\n <slot :slicedFilters=\"slicedFilters\" />\n <template v-if=\"showButton\">\n <button\n v-if=\"showMoreFilters\"\n @click=\"toggleShowMoreFilters\"\n class=\"x-facet-filter x-sliced-filters__button x-sliced-filters__button--show-more\"\n :class=\"buttonClass\"\n data-test=\"sliced-filters-show-more-button\"\n >\n <!--\n @slot Button show more filters.\n @binding {number} difference - The difference between the filters and max to show.\n -->\n <slot name=\"show-more\" :difference=\"difference\">\n Show\n <span data-test=\"show-more-amount\">{{ difference }}</span>\n more filters\n </slot>\n </button>\n <button\n v-else\n @click=\"toggleShowMoreFilters\"\n class=\"x-facet-filter x-sliced-filters__button x-sliced-filters__button--show-less\"\n :class=\"buttonClass\"\n data-test=\"sliced-filters-show-less-button\"\n >\n <!--\n @slot Button show less filters.\n @binding {number} difference - The difference between the filters and max to show.\n -->\n <slot name=\"show-less\" :difference=\"difference\">\n Show\n <span data-test=\"show-less-amount\">{{ difference }}</span>\n less filters\n </slot>\n </button>\n </template>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { Filter } from '@empathyco/x-types';\n import { computed, defineComponent, PropType, provide, ref } from 'vue';\n import { VueCSSClasses } from '../../../../utils';\n import { facetsXModule } from '../../x-module';\n import { useFiltersInjection } from '../../composables/use-filters-injection';\n\n /**\n * Component that slices a list of filters and returns them using the default scoped slot,\n * allowing the user to show the full list of them or slicing them again using the\n * show more/less buttons.\n *\n * @public\n */\n export default defineComponent({\n name: 'SlicedFilters',\n xModule: facetsXModule.name,\n props: {\n /**\n * The list of filters to be rendered as slots.\n *\n * @public\n */\n filters: Array as PropType<Filter[]>,\n /**\n * This prop is used in the `HierarchicalFilter` component and only in that case. It is necessary\n * to make the `renderedFilters` to return only the filters of each level of the hierarchy.\n */\n parentId: {\n type: String as PropType<Filter['id']>,\n required: false\n },\n /** The maximum number of filters to show. */\n max: {\n type: Number,\n required: true\n },\n buttonClass: String\n },\n emits: ['click:show-less', 'click:show-more'],\n setup(props, { emit }) {\n /** For showing the remaining filters. */\n let showMoreFilters = ref(true);\n\n const renderedFilters = useFiltersInjection(props);\n\n /**\n * Show the buttons template when length filters is greater than property max.\n *\n * @returns Boolean if length filters is greater than property max.\n * @internal\n */\n const showButton = computed(() => renderedFilters.value.length > props.max);\n\n /**\n * Sliced the array of filters depends on click button show more.\n *\n * @returns Array of sliced filters or all filters.\n * @internal\n */\n const slicedFilters = computed((): Filter[] => {\n return showMoreFilters.value\n ? renderedFilters.value.slice(0, props.max)\n : renderedFilters.value;\n });\n provide('filters', slicedFilters);\n\n /**\n * The difference between length filters and max to show.\n *\n * @returns Number of remaining filters to show.\n * @internal\n */\n const difference = computed(() => renderedFilters.value.length - props.max);\n\n /**\n * Show or hide the remaining filters. It also emits a Vue event based on the clicked button.\n *\n * @param event - The click event.\n *\n * @internal\n */\n const toggleShowMoreFilters = (event: MouseEvent): void => {\n showMoreFilters.value = !showMoreFilters.value;\n emit(showMoreFilters.value ? 'click:show-less' : 'click:show-more', event);\n };\n\n /**\n * Adds the dynamic css classes to the component.\n *\n * @returns The classes to be added to the component.\n * @internal\n */\n const cssClasses = computed((): VueCSSClasses => {\n return {\n 'x-sliced-filters--is-sliced': showButton.value\n };\n });\n\n return {\n cssClasses,\n toggleShowMoreFilters,\n showButton,\n difference,\n slicedFilters,\n showMoreFilters\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Example\n\nThe sliced filters component, takes a list of filters, and the maximum number of filters to render\nas prop. Then, it slices the list of filters using the `max` prop, and returns this new filters list\nusing the default scoped slot.\n\nThe user can click the show more button if he wants to see the full list of filters, or the show\nless button when he wants to reset the filters. This buttons text or icons can be configured via\nslot too. They receive a `difference` prop which can be useful for writing friendlier messages.\n\nThis component is usually integrated with the `Facets` and `Filters` component. It is useful when\nthere are lots of available filters for a single facet, helping to improve the app performance, as\nless nodes are rendered.\n\n### Important\n\nThe component has two ways of receive the filters list, it can be injected by another component or\nbe send it as a prop. If the component doesnt have a parent component that receive and exposed a\nfilters list to their children, it is mandatory to send it as prop.\n\n### Basic usage\n\n```vue\n<template>\n <Facets v-slot=\"{ facet }\">\n <SlicedFilters :filters=\"facet.filters\" :max=\"4\">\n <template #default=\"{ slicedFilters }\">\n <Filters :items=\"slicedFilters\" v-slot=\"{ filter }\">\n <SimpleFilter :filter=\"filter\" />\n </Filters>\n </template>\n <template #show-more=\"{ difference }\">\n Show\n <span data-test=\"show-more-amount\">{{ difference }}</span>\n more filters\n </template>\n <template #show-less=\"{ difference }\">\n Show\n <span data-test=\"show-less-amount\">{{ difference }}</span>\n less filters\n </template>\n </SlicedFilters>\n </Facets>\n</template>\n<script>\n import { BaseShowMoreFilters } from '@empathyco/x-components';\n import { Facets, SimpleFilter, Filters } from '@empathyco/x-components';\n\n export default {\n components: {\n Facets,\n BaseShowMoreFilters,\n Filters,\n SimpleFilter\n }\n };\n</script>\n```\n\n> **Using injection**: It can receive the filters list by injection. It only works if it has a\n> parent component that receives and exposes the filters list. Using the injection, It is not\n> necessary to send the prop to the child components, it has to be send it in the parent component ,\n> the rest of components will inject this list.\n\n```vue\n<Facets v-slot=\"{ facet }\">\n <SlicedFilters :filters=\"facet.filters\" :max=\"4\">\n <Filters v-slot=\"{ filter }\">\n <SimpleFilter :filter=\"filter\"/>\n </Filters>\n <template #show-more=\"{ difference }\">Show {{ difference }} more filters</template>\n <template #show-less=\"{ difference }\">Show {{ difference }} less filters</template>\n </SlicedFilters>\n</Facets>\n```\n\n### Customizing the items with classes\n\nThe `buttonClass` prop can be used to add classes to the show more/less buttons.\n\n```vue live\n<Facets v-slot=\"{ facet }\">\n <SlicedFilters :filters=\"facet.filters\" :max=\"4\" buttonClass=\"x-facet-filter-lg\">\n <Filters v-slot=\"{ filter }\">\n <SimpleFilter :filter=\"filter\"/>\n </Filters>\n <template #show-more=\"{ difference }\">Show {{ difference }} more filters</template>\n <template #show-less=\"{ difference }\">Show {{ difference }} less filters</template>\n </SlicedFilters>\n</Facets>\n```\n</docs>\n"],"names":["cssClasses","_openBlock","_createElementBlock","_normalizeClass","_createCommentVNode","_renderSlot","_Fragment","_createTextVNode","_createElementVNode"],"mappings":";;;;;;SACY,WADZ,CAAA,IAAA,EAAA,MAAA,EACa,gBAA2BA,KAAU,EAAA,QAAA,EAAA;SAAEC,SAAU,EAAA,EAAAC,kBAAA;AAAA,IAAmB,KAAA;AAAA,IAAA;AAAA,MAAA,KAAA,EAAAC,cAAA,CAAA,CAAA,kBAAA,EAAA,IAAA,CAAA,UAAA,CAAA,CAAA;AAC7E,MAAA,WAAA,EAAA,mBAAA;AAAA,KAAA;AAIA,IAAA;AAAA,MAC0BC,kBAAA,CAAA,sHAAA,CAAA;AAAA,MAAAC,UAAA,CAAA,IAAA,CAAA,MAAA,EAA1B,SAPJ,EAAA,EAAA,aAAA,EAAA,IAAA,CAAA,aAAA,EAAA,CAAA;AAAA,MAAA,IAAA,CAAA,UAAA,IAAAJ,SAAA,EAAA,EAAAC,kBAAA;AAQM,QAAAI,QAAA;AAAA,QAgBS,EAAA,GAAA,EAAA,CAAA,EAAA;AAAA,QAAA;AAAA,UAAA,IAAA,CAxBf,eAUc,IAAAL,SAAA,EAAA,EAAAC,kBAAA;AAAA,YAAA,QAAA;AAAA,YAAA;AAAA,cACN,GAAK,EAAA,CAAA;AAAA,cAEL,gBAAU,CAAiC,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAA,CAAA,GAAA,IAAA,KAAA,IAAA,CAAA,qBAAA,IAAA,IAAA,CAAA,qBAAA,CAAA,GAAA,IAAA,CAAA,CAAA;AAAA,cAAA,KAAA,EAAAC,cAAA,CAAA,CAAA,6EAAA,EAAA,IAAA,CAAA,WAAA,CAAA,CAAA;AAE3C,cAAA,WAAA,EAAA,iCAAA;AAAA,aAAA;AAIA,YAAA;AAAA,cAAAC,kBAAA,CAAgD,uJAE9C,CAAA;AAAA,cAA0DC,UAAA,CAAA,IAAA,CAAA,MAAA,EAAA,WAAA,EAA1D,EAA0D,UAAA,EAAA,IAAA,CAAA,UAAA,EAAV,EAAA,MAAA;AAAA,gBArB1DE,eAqBoE,CAAA,QAAA,CAAA;AAAA,gBAAAC,kBAAA;;;;;;;;;;AArBpE,YAAA,CAAA;AAAA;AAAA,WA2Bc,KAAAP,SAAA,EAAA,EAAAC,kBAAA;AAAA,YAAA,QAAA;AAAA,YAAA;AAAA,cACN,GAAK,EAAA,CAAA;AAAA,cAEL,gBAAU,CAAiC,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAA,CAAA,GAAA,IAAA,KAAA,IAAA,CAAA,qBAAA,IAAA,IAAA,CAAA,qBAAA,CAAA,GAAA,IAAA,CAAA,CAAA;AAAA,cAAA,KAAA,EAAAC,cAAA,CAAA,CAAA,6EAAA,EAAA,IAAA,CAAA,WAAA,CAAA,CAAA;AAE3C,cAAA,WAAA,EAAA,iCAAA;AAAA,aAAA;AAIA,YAAA;AAAA,cAAAC,kBAAA,CAAgD,uJAE9C,CAAA;AAAA,cAA0DC,UAAA,CAAA,IAAA,CAAA,MAAA,EAAA,WAAA,EAA1D,EAA0D,UAAA,EAAA,IAAA,CAAA,UAAA,EAAV,EAAA,MAAA;AAAA,gBAtC1DE,eAsCoE,CAAA,QAAA,CAAA;AAAA,gBAAAC,kBAAA;;;;;;;;;AAtCpE,aAAA;AAAA,YAAA,CAAA;AAAA;AAAA,WAAA,CAAA;AAAA,SAAA;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"sliced-filters.vue.js","sources":["../../../../../../src/x-modules/facets/components/lists/sliced-filters.vue"],"sourcesContent":["<template>\n <div class=\"x-sliced-filters\" :class=\"cssClasses\" data-test=\"filters-show-more\">\n <!--\n @slot (Required) Sliced filters content.\n @binding {Filter[]} slicedFilters - Sliced filters..\n -->\n <slot :slicedFilters=\"slicedFilters\" />\n <template v-if=\"showButton\">\n <button\n v-if=\"showMoreFilters\"\n @click=\"toggleShowMoreFilters\"\n class=\"x-facet-filter x-sliced-filters__button x-sliced-filters__button--show-more\"\n :class=\"buttonClass\"\n data-test=\"sliced-filters-show-more-button\"\n >\n <!--\n @slot Button show more filters.\n @binding {number} difference - The difference between the filters and max to show.\n -->\n <slot name=\"show-more\" :difference=\"difference\">\n Show\n <span data-test=\"show-more-amount\">{{ difference }}</span>\n more filters\n </slot>\n </button>\n <button\n v-else\n @click=\"toggleShowMoreFilters\"\n class=\"x-facet-filter x-sliced-filters__button x-sliced-filters__button--show-less\"\n :class=\"buttonClass\"\n data-test=\"sliced-filters-show-less-button\"\n >\n <!--\n @slot Button show less filters.\n @binding {number} difference - The difference between the filters and max to show.\n -->\n <slot name=\"show-less\" :difference=\"difference\">\n Show\n <span data-test=\"show-less-amount\">{{ difference }}</span>\n less filters\n </slot>\n </button>\n </template>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { Filter } from '@empathyco/x-types';\n import { computed, defineComponent, PropType, provide, ref } from 'vue';\n import { VueCSSClasses } from '../../../../utils';\n import { facetsXModule } from '../../x-module';\n import { useFiltersInjection } from '../../composables/use-filters-injection';\n\n /**\n * Component that slices a list of filters and returns them using the default scoped slot,\n * allowing the user to show the full list of them or slicing them again using the\n * show more/less buttons.\n *\n * @public\n */\n export default defineComponent({\n name: 'SlicedFilters',\n xModule: facetsXModule.name,\n props: {\n /**\n * The list of filters to be rendered as slots.\n *\n * @public\n */\n filters: Array as PropType<Filter[]>,\n /**\n * This prop is used in the `HierarchicalFilter` component and only in that case. It is necessary\n * to make the `renderedFilters` to return only the filters of each level of the hierarchy.\n */\n parentId: {\n type: String as PropType<Filter['id']>,\n required: false\n },\n /** The maximum number of filters to show. */\n max: {\n type: Number,\n required: true\n },\n buttonClass: String\n },\n emits: ['click:show-less', 'click:show-more'],\n setup(props, { emit }) {\n /** For showing the remaining filters. */\n let showMoreFilters = ref(true);\n\n const renderedFilters = useFiltersInjection(props);\n\n /**\n * Show the buttons template when length filters is greater than property max.\n *\n * @returns Boolean if length filters is greater than property max.\n * @internal\n */\n const showButton = computed(() => renderedFilters.value.length > props.max);\n\n /**\n * Sliced the array of filters depends on click button show more.\n *\n * @returns Array of sliced filters or all filters.\n * @internal\n */\n const slicedFilters = computed((): Filter[] => {\n return showMoreFilters.value\n ? renderedFilters.value.slice(0, props.max)\n : renderedFilters.value;\n });\n provide('filters', slicedFilters);\n\n /**\n * The difference between length filters and max to show.\n *\n * @returns Number of remaining filters to show.\n * @internal\n */\n const difference = computed(() => renderedFilters.value.length - props.max);\n\n /**\n * Show or hide the remaining filters. It also emits a Vue event based on the clicked button.\n *\n * @param event - The click event.\n *\n * @internal\n */\n const toggleShowMoreFilters = (event: MouseEvent): void => {\n showMoreFilters.value = !showMoreFilters.value;\n emit(showMoreFilters.value ? 'click:show-less' : 'click:show-more', event);\n };\n\n /**\n * Adds the dynamic css classes to the component.\n *\n * @returns The classes to be added to the component.\n * @internal\n */\n const cssClasses = computed((): VueCSSClasses => {\n return {\n 'x-sliced-filters--is-sliced': showButton.value\n };\n });\n\n return {\n cssClasses,\n toggleShowMoreFilters,\n showButton,\n difference,\n slicedFilters,\n showMoreFilters\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Example\n\nThe sliced filters component, takes a list of filters, and the maximum number of filters to render\nas prop. Then, it slices the list of filters using the `max` prop, and returns this new filters list\nusing the default scoped slot.\n\nThe user can click the show more button if he wants to see the full list of filters, or the show\nless button when he wants to reset the filters. This buttons text or icons can be configured via\nslot too. They receive a `difference` prop which can be useful for writing friendlier messages.\n\nThis component is usually integrated with the `Facets` and `Filters` component. It is useful when\nthere are lots of available filters for a single facet, helping to improve the app performance, as\nless nodes are rendered.\n\n### Important\n\nThe component has two ways of receive the filters list, it can be injected by another component or\nbe send it as a prop. If the component doesnt have a parent component that receive and exposed a\nfilters list to their children, it is mandatory to send it as prop.\n\n### Basic usage\n\n```vue\n<template>\n <Facets v-slot=\"{ facet }\">\n <SlicedFilters :filters=\"facet.filters\" :max=\"4\">\n <template #default=\"{ slicedFilters }\">\n <Filters :items=\"slicedFilters\" v-slot=\"{ filter }\">\n <SimpleFilter :filter=\"filter\" />\n </Filters>\n </template>\n <template #show-more=\"{ difference }\">\n Show\n <span data-test=\"show-more-amount\">{{ difference }}</span>\n more filters\n </template>\n <template #show-less=\"{ difference }\">\n Show\n <span data-test=\"show-less-amount\">{{ difference }}</span>\n less filters\n </template>\n </SlicedFilters>\n </Facets>\n</template>\n<script>\n import { BaseShowMoreFilters } from '@empathyco/x-components';\n import { Facets, SimpleFilter, Filters } from '@empathyco/x-components';\n\n export default {\n components: {\n Facets,\n BaseShowMoreFilters,\n Filters,\n SimpleFilter\n }\n };\n</script>\n```\n\n> **Using injection**: It can receive the filters list by injection. It only works if it has a\n> parent component that receives and exposes the filters list. Using the injection, It is not\n> necessary to send the prop to the child components, it has to be send it in the parent component ,\n> the rest of components will inject this list.\n\n```vue\n<Facets v-slot=\"{ facet }\">\n <SlicedFilters :filters=\"facet.filters\" :max=\"4\">\n <Filters v-slot=\"{ filter }\">\n <SimpleFilter :filter=\"filter\"/>\n </Filters>\n <template #show-more=\"{ difference }\">Show {{ difference }} more filters</template>\n <template #show-less=\"{ difference }\">Show {{ difference }} less filters</template>\n </SlicedFilters>\n</Facets>\n```\n\n### Customizing the items with classes\n\nThe `buttonClass` prop can be used to add classes to the show more/less buttons.\n\n```vue live\n<Facets v-slot=\"{ facet }\">\n <SlicedFilters :filters=\"facet.filters\" :max=\"4\" buttonClass=\"x-facet-filter-lg\">\n <Filters v-slot=\"{ filter }\">\n <SimpleFilter :filter=\"filter\"/>\n </Filters>\n <template #show-more=\"{ difference }\">Show {{ difference }} more filters</template>\n <template #show-less=\"{ difference }\">Show {{ difference }} less filters</template>\n </SlicedFilters>\n</Facets>\n```\n</docs>\n"],"names":["cssClasses","_openBlock","_createElementBlock","_normalizeClass","showButton","_Fragment","_createTextVNode","_createElementVNode"],"mappings":";;;;;;SACY,WADZ,CAAA,IAAA,EAAA,MAAA,EACa,gBAA2BA,KAAU,EAAA,QAAA,EAAA;SAAEC,SAAU,EAAA,EAAAC,kBAAA;AAAA,IAAmB,KAAA;AAAA,IAAA;AAAA,MAAA,KAAA,EAAAC,cAAA,CAAA,CAAA,kBAAA,EAAA,IAAA,CAAA,UAAA,CAAA,CAAA;MAK7E,WAAuC,EAAA,mBAAA;AAAA,KAAA;AACvBC,IAAAA;AAAAA,MAAAA,UAAAA,CAAAA,IAAAA,CAAAA,MAAAA,EAAhB,SAPJ,EAAA,EAAA,aAAA,EAAA,IAAA,CAAA,aAAA,EAAA,CAAA;AAAA,MAAA,IAAA,CAAA,UAAA,IAAAH,SAAA,EAAA,EAAAC,kBAAA;AAQM,QAAAG,QAAA;AAAA,QAgBS,EAAA,GAAA,EAAA,CAAA,EAAA;AAAA,QAAA;AAAA,UAAA,IAAA,CAxBf,eAUc,IAAAJ,SAAA,EAAA,EAAAC,kBAAA;AAAA,YAAA,QAAA;AAAA,YAAA;AAAA,cACN,GAAK,EAAA,CAAA;AAAA,cAEL,gBAAU,CAAiC,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAA,CAAA,GAAA,IAAA,KAAA,IAAA,CAAA,qBAAA,IAAA,IAAA,CAAA,qBAAA,CAAA,GAAA,IAAA,CAAA,CAAA;AAAA,cAAA,KAAA,EAAAC,cAAA,CAAA,CAAA,6EAAA,EAAA,IAAA,CAAA,WAAA,CAAA,CAAA;cAM3C,WAIO,EAAA,iCAAA;AAAA,aAAA;;yBAFL,IAA0D,CAAA,MAAA,EAAA,WAAA,EAA1D,EAA0D,UAAA,EAAA,IAAA,CAAA,UAAA,EAAV,EAAA,MAAA;AAAA,gBArB1DG,eAqBoE,CAAA,QAAA,CAAA;AAAA,gBAAAC,kBAAA;;;;;;;;;;AArBpE,YAAA,CAAA;AAAA;AAAA,WA2Bc,KAAAN,SAAA,EAAA,EAAAC,kBAAA;AAAA,YAAA,QAAA;AAAA,YAAA;AAAA,cACN,GAAK,EAAA,CAAA;AAAA,cAEL,gBAAU,CAAiC,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAA,CAAA,GAAA,IAAA,KAAA,IAAA,CAAA,qBAAA,IAAA,IAAA,CAAA,qBAAA,CAAA,GAAA,IAAA,CAAA,CAAA;AAAA,cAAA,KAAA,EAAAC,cAAA,CAAA,CAAA,6EAAA,EAAA,IAAA,CAAA,WAAA,CAAA,CAAA;cAM3C,WAIO,EAAA,iCAAA;AAAA,aAAA;;yBAFL,IAA0D,CAAA,MAAA,EAAA,WAAA,EAA1D,EAA0D,UAAA,EAAA,IAAA,CAAA,UAAA,EAAV,EAAA,MAAA;AAAA,gBAtC1DG,eAsCoE,CAAA,QAAA,CAAA;AAAA,gBAAAC,kBAAA;;;;;;;;;AAtCpE,aAAA;AAAA,YAAA,CAAA;AAAA;AAAA,WAAA,CAAA;AAAA,SAAA;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _sfc_main from './clear-history-queries.vue2.js';
|
|
2
|
-
import { resolveComponent, openBlock, createBlock, normalizeClass, withCtx,
|
|
2
|
+
import { resolveComponent, openBlock, createBlock, normalizeClass, withCtx, renderSlot, createTextVNode } from 'vue';
|
|
3
3
|
import _export_sfc from '../../../_virtual/_plugin-vue_export-helper.js';
|
|
4
4
|
|
|
5
5
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
@@ -12,7 +12,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
12
12
|
"aria-label": "Clear all"
|
|
13
13
|
}, {
|
|
14
14
|
default: withCtx(() => [
|
|
15
|
-
createCommentVNode(" @slot (Required) Button content with a message, an icon or both "),
|
|
16
15
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
17
16
|
createTextVNode("\u2715")
|
|
18
17
|
])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clear-history-queries.vue.js","sources":["../../../../../src/x-modules/history-queries/components/clear-history-queries.vue"],"sourcesContent":["<template>\n <BaseEventButton\n class=\"x-clear-history-queries x-button\"\n :class=\"dynamicClasses\"\n :disabled=\"isHistoryQueriesEmpty\"\n :events=\"clearHistoryQueriesEvents\"\n data-test=\"clear-history-queries\"\n aria-label=\"Clear all\"\n >\n <!-- @slot (Required) Button content with a message, an icon or both -->\n <slot>✕</slot>\n </BaseEventButton>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent } from 'vue';\n import BaseEventButton from '../../../components/base-event-button.vue';\n import { VueCSSClasses } from '../../../utils/types';\n import { XEventsTypes } from '../../../wiring/events.types';\n import { historyQueriesXModule } from '../x-module';\n import { useState } from '../../../composables/use-state';\n\n /**\n * A button that when is pressed, emits the\n * {@link HistoryQueriesXEvents.UserPressedClearHistoryQueries} event, expressing the user\n * intention to clear the whole history of queries.\n *\n * @public\n */\n export default defineComponent({\n name: 'ClearHistoryQueries',\n xModule: historyQueriesXModule.name,\n components: {\n BaseEventButton\n },\n setup() {\n /**\n * The whole history queries.\n *\n * @internal\n */\n const { historyQueries } = useState('historyQueries', ['historyQueries']);\n\n /**\n * Returns if the array of history queries is empty.\n *\n * @returns `true` if the {@link historyQueries} array is empty, `false` otherwise.\n * @internal\n */\n const isHistoryQueriesEmpty = computed(() => historyQueries.value.length === 0);\n\n /**\n * Dynamic CSS classes to add to the root element of this component.\n *\n * @returns A booleans dictionary where each key is the class name to add, and the boolean value\n * tells if it should be added or not.\n * @internal\n */\n const dynamicClasses = computed(\n (): VueCSSClasses => ({\n 'x-clear-history-queries--is-empty': isHistoryQueriesEmpty.value\n })\n );\n\n /**\n * The list of events that are going to be emitted when the button is pressed.\n *\n * @internal\n */\n const clearHistoryQueriesEvents: Partial<XEventsTypes> = {\n UserPressedClearHistoryQueries: undefined\n };\n\n return {\n dynamicClasses,\n clearHistoryQueriesEvents,\n isHistoryQueriesEmpty\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`UserPressedClearHistoryQueries`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after the user clicks the button.\n\n## Examples\n\n### Basic example\n\nThe component exposes a single default slot, where you can add icons or text.\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <ClearHistoryQueries>Clear history queries</ClearHistoryQueries>\n <HistoryQueries :animation=\"'FadeAndSlide'\" :maxItemsToRender=\"10\" />\n </div>\n</template>\n\n<script>\n import Vue from 'vue';\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { HistoryQueries, ClearHistoryQueries } from '@empathyco/x-components/history-queries';\n import { FadeAndSlide } from '@empathyco/x-components';\n\n // Registering the animation as a global component\n Vue.component('FadeAndSlide', FadeAndSlide);\n export default {\n name: 'ClearHistoryQueriesDemo',\n components: {\n SearchInput,\n HistoryQueries,\n ClearHistoryQueries\n }\n };\n</script>\n```\n</docs>\n"],"names":["_resolveComponent","_openBlock","_createBlock","_normalizeClass","clearHistoryQueriesEvents","_withCtx","
|
|
1
|
+
{"version":3,"file":"clear-history-queries.vue.js","sources":["../../../../../src/x-modules/history-queries/components/clear-history-queries.vue"],"sourcesContent":["<template>\n <BaseEventButton\n class=\"x-clear-history-queries x-button\"\n :class=\"dynamicClasses\"\n :disabled=\"isHistoryQueriesEmpty\"\n :events=\"clearHistoryQueriesEvents\"\n data-test=\"clear-history-queries\"\n aria-label=\"Clear all\"\n >\n <!-- @slot (Required) Button content with a message, an icon or both -->\n <slot>✕</slot>\n </BaseEventButton>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent } from 'vue';\n import BaseEventButton from '../../../components/base-event-button.vue';\n import { VueCSSClasses } from '../../../utils/types';\n import { XEventsTypes } from '../../../wiring/events.types';\n import { historyQueriesXModule } from '../x-module';\n import { useState } from '../../../composables/use-state';\n\n /**\n * A button that when is pressed, emits the\n * {@link HistoryQueriesXEvents.UserPressedClearHistoryQueries} event, expressing the user\n * intention to clear the whole history of queries.\n *\n * @public\n */\n export default defineComponent({\n name: 'ClearHistoryQueries',\n xModule: historyQueriesXModule.name,\n components: {\n BaseEventButton\n },\n setup() {\n /**\n * The whole history queries.\n *\n * @internal\n */\n const { historyQueries } = useState('historyQueries', ['historyQueries']);\n\n /**\n * Returns if the array of history queries is empty.\n *\n * @returns `true` if the {@link historyQueries} array is empty, `false` otherwise.\n * @internal\n */\n const isHistoryQueriesEmpty = computed(() => historyQueries.value.length === 0);\n\n /**\n * Dynamic CSS classes to add to the root element of this component.\n *\n * @returns A booleans dictionary where each key is the class name to add, and the boolean value\n * tells if it should be added or not.\n * @internal\n */\n const dynamicClasses = computed(\n (): VueCSSClasses => ({\n 'x-clear-history-queries--is-empty': isHistoryQueriesEmpty.value\n })\n );\n\n /**\n * The list of events that are going to be emitted when the button is pressed.\n *\n * @internal\n */\n const clearHistoryQueriesEvents: Partial<XEventsTypes> = {\n UserPressedClearHistoryQueries: undefined\n };\n\n return {\n dynamicClasses,\n clearHistoryQueriesEvents,\n isHistoryQueriesEmpty\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`UserPressedClearHistoryQueries`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after the user clicks the button.\n\n## Examples\n\n### Basic example\n\nThe component exposes a single default slot, where you can add icons or text.\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <ClearHistoryQueries>Clear history queries</ClearHistoryQueries>\n <HistoryQueries :animation=\"'FadeAndSlide'\" :maxItemsToRender=\"10\" />\n </div>\n</template>\n\n<script>\n import Vue from 'vue';\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { HistoryQueries, ClearHistoryQueries } from '@empathyco/x-components/history-queries';\n import { FadeAndSlide } from '@empathyco/x-components';\n\n // Registering the animation as a global component\n Vue.component('FadeAndSlide', FadeAndSlide);\n export default {\n name: 'ClearHistoryQueriesDemo',\n components: {\n SearchInput,\n HistoryQueries,\n ClearHistoryQueries\n }\n };\n</script>\n```\n</docs>\n"],"names":["_resolveComponent","_openBlock","_createBlock","_normalizeClass","clearHistoryQueriesEvents","_withCtx","_renderSlot"],"mappings":";;;;;AAWoB,EAAA,MAAA,0BAAA,GAAAA,gBAAA,CAAA,iBAAA,CAAA,CAAA;AAPf,EAAA,OAAAC,SAAA,EAA+B,EAAAC,WAAA,CAAA,0BAAA,EAAA;AAAA,IAC/B,KAAA,EAAMC,eAAEC,CAAyB,kCAAA,EAAA,IAAA,CAAA,cAAA,CAAA,CAAA;AAAA,IAClC,QAAU,EAAA,IAAA,CAAA,qBAAA;AAAA,IACV,MAAU,EAAA,IAAA,CAAA,yBAAA;AAAA,IAAA,WAAA,EAAA,uBAAA;AAPd,IAAA,YAAA,EAAA,WAAA;AAAA,GAAA,EAAA;aAAAC,OAUW,CAAA,MAAA;AAAA,MAAAC,UAAA,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,EAAA,EAAA,EAAA,MAAA;;AAVX,OAAA,CAAA;AAAA,KAAA,CAAA;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _sfc_main from './history-queries.vue2.js';
|
|
2
|
-
import { resolveComponent, openBlock, createBlock, withCtx,
|
|
2
|
+
import { resolveComponent, openBlock, createBlock, withCtx, renderSlot, normalizeProps, guardReactiveProps, createVNode } from 'vue';
|
|
3
3
|
import _export_sfc from '../../../_virtual/_plugin-vue_export-helper.js';
|
|
4
4
|
|
|
5
5
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
@@ -11,9 +11,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
11
11
|
"data-test": "history-queries"
|
|
12
12
|
}, {
|
|
13
13
|
default: withCtx((baseScope) => [
|
|
14
|
-
createCommentVNode(" eslint-disable max-len "),
|
|
15
|
-
createCommentVNode("\n @slot History Query item\n @binding {Object} v-bind - History Query suggestion attributes:<br /> - **suggestion** <code>Suggestion</code> - History Query suggestion data<br /> - **index** <code>number</code> - History Query suggestion index\n "),
|
|
16
|
-
createCommentVNode(" eslint-enable max-len "),
|
|
17
14
|
renderSlot(_ctx.$slots, "suggestion", normalizeProps(guardReactiveProps({ ...baseScope })), () => [
|
|
18
15
|
createVNode(_component_HistoryQuery, {
|
|
19
16
|
suggestion: baseScope.suggestion,
|
|
@@ -22,15 +19,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
22
19
|
suggestionClass: "x-suggestion"
|
|
23
20
|
}, {
|
|
24
21
|
default: withCtx((historyQueryScope) => [
|
|
25
|
-
createCommentVNode(" eslint-disable max-len "),
|
|
26
|
-
createCommentVNode("\n @slot History Query content\n @binding {Object} v-bind - History Query suggestion attributes:<br /> - **suggestion** <code>Suggestion</code> - History Query suggestion data<br /> - **index** <code>number</code> - History Query suggestion index\n "),
|
|
27
|
-
createCommentVNode(" eslint-enable max-len "),
|
|
28
22
|
renderSlot(_ctx.$slots, "suggestion-content", normalizeProps(guardReactiveProps({ ...baseScope, ...historyQueryScope })))
|
|
29
23
|
]),
|
|
30
24
|
"remove-button-content": withCtx((removeHistoryQueryScope) => [
|
|
31
|
-
createCommentVNode(" eslint-disable max-len "),
|
|
32
|
-
createCommentVNode("\n @slot History Query remove button content\n @binding {Object} v-bind - History Query suggestion attributes:<br /> - **suggestion** <code>Suggestion</code> - History Query suggestion data<br /> - **index** <code>number</code> - History Query suggestion index\n "),
|
|
33
|
-
createCommentVNode(" eslint-enable max-len "),
|
|
34
25
|
renderSlot(_ctx.$slots, "suggestion-remove-content", normalizeProps(guardReactiveProps({ ...baseScope, ...removeHistoryQueryScope })))
|
|
35
26
|
]),
|
|
36
27
|
_: 2
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history-queries.vue.js","sources":["../../../../../src/x-modules/history-queries/components/history-queries.vue"],"sourcesContent":["<template>\n <BaseSuggestions\n :suggestions=\"historyQueriesWithResults\"\n class=\"x-history-queries\"\n data-test=\"history-queries\"\n >\n <template #default=\"baseScope\">\n <!-- eslint-disable max-len -->\n <!--\n @slot History Query item\n @binding {Object} v-bind - History Query suggestion attributes:<br /> - **suggestion** <code>Suggestion</code> - History Query suggestion data<br /> - **index** <code>number</code> - History Query suggestion index\n -->\n <!-- eslint-enable max-len -->\n <slot name=\"suggestion\" v-bind=\"{ ...baseScope }\">\n <HistoryQuery\n :suggestion=\"baseScope.suggestion\"\n data-test=\"history-query-item\"\n class=\"x-history-queries__item\"\n suggestionClass=\"x-suggestion\"\n >\n <template #default=\"historyQueryScope\">\n <!-- eslint-disable max-len -->\n <!--\n @slot History Query content\n @binding {Object} v-bind - History Query suggestion attributes:<br /> - **suggestion** <code>Suggestion</code> - History Query suggestion data<br /> - **index** <code>number</code> - History Query suggestion index\n -->\n <!-- eslint-enable max-len -->\n <slot name=\"suggestion-content\" v-bind=\"{ ...baseScope, ...historyQueryScope }\" />\n </template>\n <template #remove-button-content=\"removeHistoryQueryScope\">\n <!-- eslint-disable max-len -->\n <!--\n @slot History Query remove button content\n @binding {Object} v-bind - History Query suggestion attributes:<br /> - **suggestion** <code>Suggestion</code> - History Query suggestion data<br /> - **index** <code>number</code> - History Query suggestion index\n -->\n <!-- eslint-enable max-len -->\n <slot\n name=\"suggestion-remove-content\"\n v-bind=\"{ ...baseScope, ...removeHistoryQueryScope }\"\n />\n </template>\n </HistoryQuery>\n </slot>\n </template>\n </BaseSuggestions>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent } from 'vue';\n import BaseSuggestions from '../../../components/suggestions/base-suggestions.vue';\n import { historyQueriesXModule } from '../x-module';\n import { useGetter } from '../../../composables/use-getter';\n import HistoryQuery from './history-query.vue';\n\n /**\n * This component renders a list of suggestions coming from the user queries history.\n * Allows the user to select one of them, emitting the needed events. A history query is just\n * another type of suggestion that contains a query that the user has made in the past.\n *\n * @public\n */\n export default defineComponent({\n name: 'HistoryQueries',\n xModule: historyQueriesXModule.name,\n components: {\n BaseSuggestions,\n HistoryQuery\n },\n setup() {\n /**\n * The filtered list of history queries.\n *\n * @internal\n */\n const { historyQueriesWithResults } = useGetter('historyQueries', [\n 'historyQueriesWithResults'\n ]);\n\n return {\n historyQueriesWithResults\n };\n }\n });\n</script>\n\n<!--eslint-disable max-len -->\n<docs lang=\"mdx\">\n## Inherited props\n\nThis component inherits the [`BaseSuggestions`](../base-components/x-components.base-suggestions.md)\nprops.\n\n| Name | Description | Type | Default |\n| ------------------ | ----------------------------------------------------------------- | -------- | ------- |\n| `animation` | Animation component that will be used to animate the suggestions. | `Vue` | `\"ul\"` |\n| `maxItemsToRender` | Number of popular searches to be rendered. | `number` | |\n\n## Events\n\nThis component doesn't emit events.\n\n## See it in action\n\nHere you have a basic example of how the HistoryQueries is rendered.\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <HistoryQueries />\n </div>\n</template>\n\n<script>\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { HistoryQueries } from '@empathyco/x-components/history-queries';\n\n export default {\n name: 'HistoryQueriesDemo',\n components: {\n SearchInput,\n HistoryQueries\n }\n };\n</script>\n```\n\n### Play with props\n\nIn this example, the history queries have been limited to render a maximum of 10 queries (by default\nit is 5).\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <HistoryQueries :maxItemsToRender=\"10\" />\n </div>\n</template>\n\n<script>\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { HistoryQueries } from '@empathyco/x-components/history-queries';\n\n export default {\n name: 'HistoryQueriesDemo',\n components: {\n SearchInput,\n HistoryQueries\n }\n };\n</script>\n```\n\n### Play with the animation\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <HistoryQueries :animation=\"'FadeAndSlide'\" />\n </div>\n</template>\n\n<script>\n import Vue from 'vue';\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { HistoryQueries } from '@empathyco/x-components/history-queries';\n import { FadeAndSlide } from '@empathyco/x-components';\n\n // Registering the animation as a global component\n Vue.component('FadeAndSlide', FadeAndSlide);\n export default {\n name: 'HistoryQueriesDemo',\n components: {\n SearchInput,\n HistoryQueries\n }\n };\n</script>\n```\n\n### Play with suggestion slot\n\nIn this example, the [`HistoryQuery`](./x-components.history-query.md) component is passed in the\n`suggestion` slot (although any other component could potentially be passed).\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <HistoryQueries #suggestion=\"{ suggestion }\">\n <HistoryQuery :suggestion=\"suggestion\" />\n </HistoryQueries>\n </div>\n</template>\n\n<script>\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { HistoryQueries, HistoryQuery } from '@empathyco/x-components/history-queries';\n\n export default {\n name: 'HistoryQueriesDemo',\n components: {\n SearchInput,\n HistoryQueries,\n HistoryQuery\n }\n };\n</script>\n```\n\n### Play with suggestion-content slot\n\nTo continue the previous example, the [`HistoryQuery`](./x-components.history-query.md) component is\npassed in the `suggestion-content` slot, but in addition, an HTML span tag for the text are also\npassed.\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <HistoryQueries #suggestion-content=\"{ suggestion }\">\n <span>{{ suggestion.query }}</span>\n </HistoryQueries>\n </div>\n</template>\n\n<script>\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { HistoryQueries } from '@empathyco/x-components/history-queries';\n\n export default {\n name: 'HistoryQueriesDemo',\n components: {\n SearchInput,\n HistoryQueries\n }\n };\n</script>\n```\n\n### Play with suggestion-content-remove slot\n\nTo continue the previous example, the [`HistoryQuery`](./x-components.history-query.md) component is\npassed in the `suggestion-content` slot, but in addition, a cross icon is also passed to change the\nicon to remove the history query.\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <HistoryQueries #suggestion-remove-content=\"{ suggestion }\">\n <CrossIcon />\n </HistoryQueries>\n </div>\n</template>\n\n<script>\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { HistoryQueries } from '@empathyco/x-components/history-queries';\n import { CrossIcon } from '@empathyco/x-components';\n\n export default {\n name: 'HistoryQueriesDemo',\n components: {\n SearchInput,\n HistoryQueries,\n CrossIcon\n }\n };\n</script>\n```\n</docs>\n"],"names":["_resolveComponent","_openBlock","_createBlock","_withCtx","
|
|
1
|
+
{"version":3,"file":"history-queries.vue.js","sources":["../../../../../src/x-modules/history-queries/components/history-queries.vue"],"sourcesContent":["<template>\n <BaseSuggestions\n :suggestions=\"historyQueriesWithResults\"\n class=\"x-history-queries\"\n data-test=\"history-queries\"\n >\n <template #default=\"baseScope\">\n <!-- eslint-disable max-len -->\n <!--\n @slot History Query item\n @binding {Object} v-bind - History Query suggestion attributes:<br /> - **suggestion** <code>Suggestion</code> - History Query suggestion data<br /> - **index** <code>number</code> - History Query suggestion index\n -->\n <!-- eslint-enable max-len -->\n <slot name=\"suggestion\" v-bind=\"{ ...baseScope }\">\n <HistoryQuery\n :suggestion=\"baseScope.suggestion\"\n data-test=\"history-query-item\"\n class=\"x-history-queries__item\"\n suggestionClass=\"x-suggestion\"\n >\n <template #default=\"historyQueryScope\">\n <!-- eslint-disable max-len -->\n <!--\n @slot History Query content\n @binding {Object} v-bind - History Query suggestion attributes:<br /> - **suggestion** <code>Suggestion</code> - History Query suggestion data<br /> - **index** <code>number</code> - History Query suggestion index\n -->\n <!-- eslint-enable max-len -->\n <slot name=\"suggestion-content\" v-bind=\"{ ...baseScope, ...historyQueryScope }\" />\n </template>\n <template #remove-button-content=\"removeHistoryQueryScope\">\n <!-- eslint-disable max-len -->\n <!--\n @slot History Query remove button content\n @binding {Object} v-bind - History Query suggestion attributes:<br /> - **suggestion** <code>Suggestion</code> - History Query suggestion data<br /> - **index** <code>number</code> - History Query suggestion index\n -->\n <!-- eslint-enable max-len -->\n <slot\n name=\"suggestion-remove-content\"\n v-bind=\"{ ...baseScope, ...removeHistoryQueryScope }\"\n />\n </template>\n </HistoryQuery>\n </slot>\n </template>\n </BaseSuggestions>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent } from 'vue';\n import BaseSuggestions from '../../../components/suggestions/base-suggestions.vue';\n import { historyQueriesXModule } from '../x-module';\n import { useGetter } from '../../../composables/use-getter';\n import HistoryQuery from './history-query.vue';\n\n /**\n * This component renders a list of suggestions coming from the user queries history.\n * Allows the user to select one of them, emitting the needed events. A history query is just\n * another type of suggestion that contains a query that the user has made in the past.\n *\n * @public\n */\n export default defineComponent({\n name: 'HistoryQueries',\n xModule: historyQueriesXModule.name,\n components: {\n BaseSuggestions,\n HistoryQuery\n },\n setup() {\n /**\n * The filtered list of history queries.\n *\n * @internal\n */\n const { historyQueriesWithResults } = useGetter('historyQueries', [\n 'historyQueriesWithResults'\n ]);\n\n return {\n historyQueriesWithResults\n };\n }\n });\n</script>\n\n<!--eslint-disable max-len -->\n<docs lang=\"mdx\">\n## Inherited props\n\nThis component inherits the [`BaseSuggestions`](../base-components/x-components.base-suggestions.md)\nprops.\n\n| Name | Description | Type | Default |\n| ------------------ | ----------------------------------------------------------------- | -------- | ------- |\n| `animation` | Animation component that will be used to animate the suggestions. | `Vue` | `\"ul\"` |\n| `maxItemsToRender` | Number of popular searches to be rendered. | `number` | |\n\n## Events\n\nThis component doesn't emit events.\n\n## See it in action\n\nHere you have a basic example of how the HistoryQueries is rendered.\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <HistoryQueries />\n </div>\n</template>\n\n<script>\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { HistoryQueries } from '@empathyco/x-components/history-queries';\n\n export default {\n name: 'HistoryQueriesDemo',\n components: {\n SearchInput,\n HistoryQueries\n }\n };\n</script>\n```\n\n### Play with props\n\nIn this example, the history queries have been limited to render a maximum of 10 queries (by default\nit is 5).\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <HistoryQueries :maxItemsToRender=\"10\" />\n </div>\n</template>\n\n<script>\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { HistoryQueries } from '@empathyco/x-components/history-queries';\n\n export default {\n name: 'HistoryQueriesDemo',\n components: {\n SearchInput,\n HistoryQueries\n }\n };\n</script>\n```\n\n### Play with the animation\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <HistoryQueries :animation=\"'FadeAndSlide'\" />\n </div>\n</template>\n\n<script>\n import Vue from 'vue';\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { HistoryQueries } from '@empathyco/x-components/history-queries';\n import { FadeAndSlide } from '@empathyco/x-components';\n\n // Registering the animation as a global component\n Vue.component('FadeAndSlide', FadeAndSlide);\n export default {\n name: 'HistoryQueriesDemo',\n components: {\n SearchInput,\n HistoryQueries\n }\n };\n</script>\n```\n\n### Play with suggestion slot\n\nIn this example, the [`HistoryQuery`](./x-components.history-query.md) component is passed in the\n`suggestion` slot (although any other component could potentially be passed).\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <HistoryQueries #suggestion=\"{ suggestion }\">\n <HistoryQuery :suggestion=\"suggestion\" />\n </HistoryQueries>\n </div>\n</template>\n\n<script>\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { HistoryQueries, HistoryQuery } from '@empathyco/x-components/history-queries';\n\n export default {\n name: 'HistoryQueriesDemo',\n components: {\n SearchInput,\n HistoryQueries,\n HistoryQuery\n }\n };\n</script>\n```\n\n### Play with suggestion-content slot\n\nTo continue the previous example, the [`HistoryQuery`](./x-components.history-query.md) component is\npassed in the `suggestion-content` slot, but in addition, an HTML span tag for the text are also\npassed.\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <HistoryQueries #suggestion-content=\"{ suggestion }\">\n <span>{{ suggestion.query }}</span>\n </HistoryQueries>\n </div>\n</template>\n\n<script>\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { HistoryQueries } from '@empathyco/x-components/history-queries';\n\n export default {\n name: 'HistoryQueriesDemo',\n components: {\n SearchInput,\n HistoryQueries\n }\n };\n</script>\n```\n\n### Play with suggestion-content-remove slot\n\nTo continue the previous example, the [`HistoryQuery`](./x-components.history-query.md) component is\npassed in the `suggestion-content` slot, but in addition, a cross icon is also passed to change the\nicon to remove the history query.\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <HistoryQueries #suggestion-remove-content=\"{ suggestion }\">\n <CrossIcon />\n </HistoryQueries>\n </div>\n</template>\n\n<script>\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { HistoryQueries } from '@empathyco/x-components/history-queries';\n import { CrossIcon } from '@empathyco/x-components';\n\n export default {\n name: 'HistoryQueriesDemo',\n components: {\n SearchInput,\n HistoryQueries,\n CrossIcon\n }\n };\n</script>\n```\n</docs>\n"],"names":["_resolveComponent","_openBlock","_createBlock","_withCtx","_renderSlot","_normalizeProps","_guardReactiveProps","_createVNode"],"mappings":";;;;;;AA4CoB,EAAA,MAAA,0BAAA,GAAAA,gBAAA,CAAA,iBAAA,CAAA,CAAA;AAzCX,EAAA,OAAAC,SAAA,EAAoB,EAAAC,WAAA,CAAA,0BAAA,EAAA;AAAA,IACzB,WAAU,EAAA,IAAA,CAAA,yBAAA;AAAA,IAAA,KAAA,EAAA,mBAAA;IAEC,WAAO,EAAA,iBAAA;AAAA,GAAA,EAAA;aAQdC,OA2Be,CAAA,CAAA,SAAA,KAAA;AAAA,MA1BZC,UAAA,CAAA,IAAA,CAAY,QAAS,YAAW,EAAAC,cAAA,CAAAC,kBAAA,CAAA,EAAA,GAAA,SAAA,EAAA,CAAA,CAAA,EAAA,MAAA;AAAA,QAAAC,WAAA,CACxB,uBAAqB,EAAA;AAAA,UAC9B,UAAM,EAAA,SAAA,CAAA,UAAA;AAAA,UACN,WAAA,EAAA,oBAAA;AAAA,UAAA,KAAA,EAAA,yBAAA;UAEW,eAAO,EAAA,cAAA;AAAA,SAAA,EAAA;;AASP,YAAAH,UAAA,CAAA,IAAA,CAAA,MAAA,EAAqB,sBAAEC,cAAuB,CAAAC,kBAAA,CAAA,EAAA,GAAA,SAAA,EAAA,GAAA,iBAAA,EAAA,CAAA,CAAA,CAAA;AAAA,WAAA,CAAA;;AA7BnE,YAAAF,UAAA,CAAA,IAAA,CAAA,MAAA,EAAA,2BAAA,EAAAC,cAAA,CAAAC,kBAAA,CAAA,EAAA,GAAA,SAAA,EAAA,GAAA,uBAAA,EAAA,CAAA,CAAA,CAAA;AAAA,WAAA,CAAA;;;;AAAA,OAAA,CAAA;AAAA,KAAA,CAAA;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _sfc_main from './history-query.vue2.js';
|
|
2
|
-
import { resolveComponent, openBlock, createElementBlock,
|
|
2
|
+
import { resolveComponent, openBlock, createElementBlock, createVNode, mergeProps, withCtx, renderSlot, normalizeProps, guardReactiveProps, normalizeClass, createTextVNode } from 'vue';
|
|
3
3
|
import _export_sfc from '../../../_virtual/_plugin-vue_export-helper.js';
|
|
4
4
|
|
|
5
5
|
const _hoisted_1 = { class: "x-history-query x-suggestion-group" };
|
|
@@ -7,7 +7,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
7
7
|
const _component_BaseSuggestion = resolveComponent("BaseSuggestion");
|
|
8
8
|
const _component_RemoveHistoryQuery = resolveComponent("RemoveHistoryQuery");
|
|
9
9
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
10
|
-
createCommentVNode("\n Click on the History Query suggestion\n @event click\n @property {Suggestion} suggestion - History Query suggestion data\n @property {MouseEvent} event - The original mouse event\n "),
|
|
11
10
|
createVNode(_component_BaseSuggestion, mergeProps({
|
|
12
11
|
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click", _ctx.suggestion, $event)),
|
|
13
12
|
class: ["x-history-query__suggestion", _ctx.suggestionClass]
|
|
@@ -16,9 +15,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
16
15
|
feature: "history_query"
|
|
17
16
|
}), {
|
|
18
17
|
default: withCtx((baseScope) => [
|
|
19
|
-
createCommentVNode(" eslint-disable max-len "),
|
|
20
|
-
createCommentVNode("\n @slot History Query content\n @binding {Object} v-bind - `BaseSuggestion` default slot scope: **suggestion** <code>Suggestion</code> - Suggestion data<br /> **query** <code>string</code> - The query that the suggestion belongs to<br /> **filter** <code>Filter or undefined</code> - Suggestion's filter\n "),
|
|
21
|
-
createCommentVNode(" eslint-enable max-len "),
|
|
22
18
|
renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({ ...baseScope })))
|
|
23
19
|
]),
|
|
24
20
|
_: 3
|
|
@@ -30,7 +26,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
30
26
|
"data-test": "remove-history-query"
|
|
31
27
|
}, {
|
|
32
28
|
default: withCtx(() => [
|
|
33
|
-
createCommentVNode("\n @slot History Query remove button content\n @binding {Suggestion} suggestion - History Query suggestion data\n "),
|
|
34
29
|
renderSlot(_ctx.$slots, "remove-button-content", normalizeProps(guardReactiveProps({ suggestion: _ctx.suggestion })), () => [
|
|
35
30
|
createTextVNode("\u2715")
|
|
36
31
|
])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history-query.vue.js","sources":["../../../../../src/x-modules/history-queries/components/history-query.vue"],"sourcesContent":["<template>\n <div class=\"x-history-query x-suggestion-group\">\n <!--\n Click on the History Query suggestion\n @event click\n @property {Suggestion} suggestion - History Query suggestion data\n @property {MouseEvent} event - The original mouse event\n -->\n <BaseSuggestion\n @click=\"$emit('click', suggestion, $event)\"\n class=\"x-history-query__suggestion\"\n :class=\"suggestionClass\"\n v-bind=\"{ suggestion, suggestionSelectedEvents, query }\"\n data-test=\"history-query\"\n feature=\"history_query\"\n #default=\"baseScope\"\n >\n <!-- eslint-disable max-len -->\n <!--\n @slot History Query content\n @binding {Object} v-bind - `BaseSuggestion` default slot scope: **suggestion** <code>Suggestion</code> - Suggestion data<br /> **query** <code>string</code> - The query that the suggestion belongs to<br /> **filter** <code>Filter or undefined</code> - Suggestion's filter\n -->\n <!-- eslint-enable max-len -->\n <slot v-bind=\"{ ...baseScope }\" />\n </BaseSuggestion>\n <RemoveHistoryQuery\n class=\"x-history-query__remove x-suggestion-group-button\"\n :class=\"removeButtonClass\"\n :historyQuery=\"suggestion\"\n data-test=\"remove-history-query\"\n >\n <!--\n @slot History Query remove button content\n @binding {Suggestion} suggestion - History Query suggestion data\n -->\n <slot name=\"remove-button-content\" v-bind=\"{ suggestion }\">✕</slot>\n </RemoveHistoryQuery>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { HistoryQuery as HistoryQueryModel } from '@empathyco/x-types';\n import { computed, defineComponent, PropType } from 'vue';\n import BaseSuggestion from '../../../components/suggestions/base-suggestion.vue';\n import { XEventsTypes } from '../../../wiring/events.types';\n import { historyQueriesXModule } from '../x-module';\n import { useGetter } from '../../../composables/use-getter';\n import RemoveHistoryQuery from './remove-history-query.vue';\n\n /**\n * This component renders a history query suggestion combining two buttons: one for selecting this\n * suggestion as the search query, and another one to remove this query suggestion from the\n * history queries.\n *\n * @public\n */\n export default defineComponent({\n name: 'HistoryQuery',\n xModule: historyQueriesXModule.name,\n components: { RemoveHistoryQuery, BaseSuggestion },\n props: {\n /**\n * The history query suggestion to render.\n *\n * @public\n */\n suggestion: {\n type: Object as PropType<HistoryQueryModel>,\n required: true\n },\n /** Class inherited by content element. */\n removeButtonClass: String,\n /** Class inherited by content element. */\n suggestionClass: String\n },\n emits: ['click'],\n setup(props) {\n /**\n * The normalized query of the history-queries module.\n *\n * @internal\n */\n const query = useGetter('historyQueries', ['normalizedQuery']).normalizedQuery;\n\n /**\n * The list of events that are going to be emitted when the suggestion button is pressed.\n *\n * @internal\n * @returns The {@link XEvent} to emit.\n */\n const suggestionSelectedEvents = computed(\n (): Partial<XEventsTypes> => ({\n UserSelectedAHistoryQuery: props.suggestion\n })\n );\n\n return {\n query,\n suggestionSelectedEvents\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`UserSelectedAHistoryQuery`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after the user clicks the button. The event payload is the history query\n data.\n\n## Examples\n\n### Basic usage\n\nThis component only requires a prop called `suggestion`\n\n```vue live\n<template>\n <HistoryQuery :suggestion=\"suggestion\" />\n</template>\n\n<script>\n import { HistoryQuery } from '@empathyco/x-components/history-queries';\n export default {\n name: 'HistoryQueryDemo',\n components: {\n HistoryQuery\n },\n data() {\n return {\n suggestion: {\n modelName: 'HistoryQuery',\n query: 'trousers',\n facets: []\n }\n };\n }\n };\n</script>\n```\n\n### Customizing slots content\n\nSuggestion and remove buttons contents can be customized.\n\nThe default slot allows you to replace the content of the suggestion button. It has two properties,\nthe suggestion itself, and a `string` of HTML with the matched query.\n\nThe other slot is called `remove-button-content`, and allows you to set the content of the button\nthat serves to remove this query from the history. This slot only has one property, the suggestion.\n\n```vue live\n<template>\n <HistoryQuery :suggestion=\"suggestion\">\n <template #default=\"{ suggestion }\">\n <HistoryIcon />\n <Highlight highlight=\"tro\" :text=\"suggestion.query\" />\n </template>\n\n <template #remove-button-content=\"{ suggestion }\">\n <CrossIcon />\n </template>\n </HistoryQuery>\n</template>\n\n<script>\n import { HistoryQuery } from '@empathyco/x-components/history-queries';\n import { HistoryIcon, CrossIcon, Highlight } from '@empathyco/x-components';\n\n export default {\n name: 'HistoryQueryDemo',\n components: {\n HistoryQuery,\n HistoryIcon,\n CrossIcon,\n Highlight\n },\n data() {\n return {\n suggestion: {\n modelName: 'HistoryQuery',\n query: 'trousers',\n facets: []\n }\n };\n }\n };\n</script>\n```\n\n### Customizing the content with classes\n\nThe `suggestionClass` prop can be used to add classes to the history query suggestion.\n\n```vue live\n<template>\n <HistoryQuery :suggestion=\"suggestion\" suggestionClass=\"x-custom-class\" />\n</template>\n\n<script>\n import { HistoryQuery } from '@empathyco/x-components/history-queries';\n export default {\n name: 'HistoryQueryDemo',\n components: {\n HistoryQuery\n },\n data() {\n return {\n suggestion: {\n modelName: 'HistoryQuery',\n query: 'trousers',\n facets: []\n }\n };\n }\n };\n</script>\n```\n\nThe `removeButtonClass` prop can be used to add classes to the remove history query.\n\n```vue live\n<template>\n <HistoryQuery :suggestion=\"suggestion\" removeButtonClass=\"x-custom-class\" />\n</template>\n\n<script>\n import { HistoryQuery } from '@empathyco/x-components/history-queries';\n export default {\n name: 'HistoryQueryDemo',\n components: {\n HistoryQuery\n },\n data() {\n return {\n suggestion: {\n modelName: 'HistoryQuery',\n query: 'trousers',\n facets: []\n }\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":["_resolveComponent","_openBlock","
|
|
1
|
+
{"version":3,"file":"history-query.vue.js","sources":["../../../../../src/x-modules/history-queries/components/history-query.vue"],"sourcesContent":["<template>\n <div class=\"x-history-query x-suggestion-group\">\n <!--\n Click on the History Query suggestion\n @event click\n @property {Suggestion} suggestion - History Query suggestion data\n @property {MouseEvent} event - The original mouse event\n -->\n <BaseSuggestion\n @click=\"$emit('click', suggestion, $event)\"\n class=\"x-history-query__suggestion\"\n :class=\"suggestionClass\"\n v-bind=\"{ suggestion, suggestionSelectedEvents, query }\"\n data-test=\"history-query\"\n feature=\"history_query\"\n #default=\"baseScope\"\n >\n <!-- eslint-disable max-len -->\n <!--\n @slot History Query content\n @binding {Object} v-bind - `BaseSuggestion` default slot scope: **suggestion** <code>Suggestion</code> - Suggestion data<br /> **query** <code>string</code> - The query that the suggestion belongs to<br /> **filter** <code>Filter or undefined</code> - Suggestion's filter\n -->\n <!-- eslint-enable max-len -->\n <slot v-bind=\"{ ...baseScope }\" />\n </BaseSuggestion>\n <RemoveHistoryQuery\n class=\"x-history-query__remove x-suggestion-group-button\"\n :class=\"removeButtonClass\"\n :historyQuery=\"suggestion\"\n data-test=\"remove-history-query\"\n >\n <!--\n @slot History Query remove button content\n @binding {Suggestion} suggestion - History Query suggestion data\n -->\n <slot name=\"remove-button-content\" v-bind=\"{ suggestion }\">✕</slot>\n </RemoveHistoryQuery>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { HistoryQuery as HistoryQueryModel } from '@empathyco/x-types';\n import { computed, defineComponent, PropType } from 'vue';\n import BaseSuggestion from '../../../components/suggestions/base-suggestion.vue';\n import { XEventsTypes } from '../../../wiring/events.types';\n import { historyQueriesXModule } from '../x-module';\n import { useGetter } from '../../../composables/use-getter';\n import RemoveHistoryQuery from './remove-history-query.vue';\n\n /**\n * This component renders a history query suggestion combining two buttons: one for selecting this\n * suggestion as the search query, and another one to remove this query suggestion from the\n * history queries.\n *\n * @public\n */\n export default defineComponent({\n name: 'HistoryQuery',\n xModule: historyQueriesXModule.name,\n components: { RemoveHistoryQuery, BaseSuggestion },\n props: {\n /**\n * The history query suggestion to render.\n *\n * @public\n */\n suggestion: {\n type: Object as PropType<HistoryQueryModel>,\n required: true\n },\n /** Class inherited by content element. */\n removeButtonClass: String,\n /** Class inherited by content element. */\n suggestionClass: String\n },\n emits: ['click'],\n setup(props) {\n /**\n * The normalized query of the history-queries module.\n *\n * @internal\n */\n const query = useGetter('historyQueries', ['normalizedQuery']).normalizedQuery;\n\n /**\n * The list of events that are going to be emitted when the suggestion button is pressed.\n *\n * @internal\n * @returns The {@link XEvent} to emit.\n */\n const suggestionSelectedEvents = computed(\n (): Partial<XEventsTypes> => ({\n UserSelectedAHistoryQuery: props.suggestion\n })\n );\n\n return {\n query,\n suggestionSelectedEvents\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`UserSelectedAHistoryQuery`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after the user clicks the button. The event payload is the history query\n data.\n\n## Examples\n\n### Basic usage\n\nThis component only requires a prop called `suggestion`\n\n```vue live\n<template>\n <HistoryQuery :suggestion=\"suggestion\" />\n</template>\n\n<script>\n import { HistoryQuery } from '@empathyco/x-components/history-queries';\n export default {\n name: 'HistoryQueryDemo',\n components: {\n HistoryQuery\n },\n data() {\n return {\n suggestion: {\n modelName: 'HistoryQuery',\n query: 'trousers',\n facets: []\n }\n };\n }\n };\n</script>\n```\n\n### Customizing slots content\n\nSuggestion and remove buttons contents can be customized.\n\nThe default slot allows you to replace the content of the suggestion button. It has two properties,\nthe suggestion itself, and a `string` of HTML with the matched query.\n\nThe other slot is called `remove-button-content`, and allows you to set the content of the button\nthat serves to remove this query from the history. This slot only has one property, the suggestion.\n\n```vue live\n<template>\n <HistoryQuery :suggestion=\"suggestion\">\n <template #default=\"{ suggestion }\">\n <HistoryIcon />\n <Highlight highlight=\"tro\" :text=\"suggestion.query\" />\n </template>\n\n <template #remove-button-content=\"{ suggestion }\">\n <CrossIcon />\n </template>\n </HistoryQuery>\n</template>\n\n<script>\n import { HistoryQuery } from '@empathyco/x-components/history-queries';\n import { HistoryIcon, CrossIcon, Highlight } from '@empathyco/x-components';\n\n export default {\n name: 'HistoryQueryDemo',\n components: {\n HistoryQuery,\n HistoryIcon,\n CrossIcon,\n Highlight\n },\n data() {\n return {\n suggestion: {\n modelName: 'HistoryQuery',\n query: 'trousers',\n facets: []\n }\n };\n }\n };\n</script>\n```\n\n### Customizing the content with classes\n\nThe `suggestionClass` prop can be used to add classes to the history query suggestion.\n\n```vue live\n<template>\n <HistoryQuery :suggestion=\"suggestion\" suggestionClass=\"x-custom-class\" />\n</template>\n\n<script>\n import { HistoryQuery } from '@empathyco/x-components/history-queries';\n export default {\n name: 'HistoryQueryDemo',\n components: {\n HistoryQuery\n },\n data() {\n return {\n suggestion: {\n modelName: 'HistoryQuery',\n query: 'trousers',\n facets: []\n }\n };\n }\n };\n</script>\n```\n\nThe `removeButtonClass` prop can be used to add classes to the remove history query.\n\n```vue live\n<template>\n <HistoryQuery :suggestion=\"suggestion\" removeButtonClass=\"x-custom-class\" />\n</template>\n\n<script>\n import { HistoryQuery } from '@empathyco/x-components/history-queries';\n export default {\n name: 'HistoryQueryDemo',\n components: {\n HistoryQuery\n },\n data() {\n return {\n suggestion: {\n modelName: 'HistoryQuery',\n query: 'trousers',\n facets: []\n }\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":["_resolveComponent","_openBlock","_createElementBlock","_createVNode","_mergeProps","suggestionClass","suggestion","suggestionSelectedEvents","_withCtx","_renderSlot","_normalizeProps","_guardReactiveProps"],"mappings":";;;;;;;wCACEA,gBAoCM,CAAA,oBAAA,CAAA,CAAA;AA5BD,EAAA,OAAAC,SAAA,EAAY,EAAAC,kBAAA,CAAA,KAAA,EAAA,UAAA,EAAA;AAAA,IAAAC,WAAA,CACP,2BAA6BC,UAC3BC,CAAAA;AAAAA,MACEC,OAAAA,EAAAA,MAAAA,CAAAA,CAAAA,CAAAA,KAAAA,MAAAA,CAAU,qCAAEC,IAAwB,CAAA,UAAA,EAAA,MAAA,CAAA,CAAA;AAAA,MAC9C,KAAyB,EAAA,CAAA,6BAAA,EAAA,IAAA,CAAA,eAAA,CAAA;AAAA,KAAA,EACzB,cAAQ,IAAe,CAAA,UAAA,EAAA,wBAAA,EAAA,IAAA,CAAA,wBAAA,EAAA,KAAA,EAAA,IAAA,CAAA,KAAA,EAAA,EAAA;AAAA,MAAA,WAAA,EAAA,eAAA;MACtB,OAAO,EAAA,eAAA;AAAA,KAQR,CAAA,EAAA;AAAA,MAAA,OAAA,EAAAC,OAAA,CAAA,CAAA,SAAA,KAAA;AAvBN,QAAAC,UAAA,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,EAAAC,cAAA,CAAAC,kBAAA,CAAA,EAAA,GAAA,SAAA,EAAA,CAAA,CAAA,CAAA;AAAA,OAAA,CAAA;AAyBI,MAAA,CAAA,EAAA,CAAA;AAAA;AAAA,KAAA,EACE,IA1BN,CA0BY,OAAA,CAAA,CAAA;AAAA,IAAAR,WAAA,CAEL,6BAAwB,EAAA;AAAA,MACzB,sBAAU,CAAsB,mDAAA,EAAA,IAAA,CAAA,iBAAA,CAAA,CAAA;AAAA,MAAA,YAAA,EAAA,IAAA,CAAA,UAAA;AA7BtC,MAAA,WAAA,EAAA,sBAAA;AAAA,KAAA,EAAA;eAAAK,OAmCkE,CAAA,MAAA;AAAA,QAAAC,UAAA,CAAA,IAAA,CAAA,MAAA,EAAA,uBAAA,EAAAC,cAAA,CAAAC,kBAAA,CAAA,EAAA,UAAA,EAAA,IAAA,CAAA,UAAA,EAAA,CAAA,CAAA,EAAA,MAAA;;AAnClE,SAAA,CAAA;AAAA,OAAA,CAAA;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _sfc_main from './my-history.vue2.js';
|
|
2
|
-
import { resolveComponent, openBlock, createBlock, resolveDynamicComponent, withCtx, createElementBlock, Fragment, renderList, renderSlot, createElementVNode, toDisplayString, createVNode, normalizeClass,
|
|
2
|
+
import { resolveComponent, openBlock, createBlock, resolveDynamicComponent, withCtx, createElementBlock, Fragment, renderList, renderSlot, createElementVNode, toDisplayString, createVNode, normalizeClass, mergeProps, createTextVNode, createCommentVNode } from 'vue';
|
|
3
3
|
import './my-history.vue3.js';
|
|
4
4
|
import _export_sfc from '../../../_virtual/_plugin-vue_export-helper.js';
|
|
5
5
|
|
|
@@ -41,7 +41,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
41
41
|
animation: _ctx.animation
|
|
42
42
|
}, {
|
|
43
43
|
default: withCtx(({ suggestion, index }) => [
|
|
44
|
-
createCommentVNode("\n @slot History Query item\n @binding {Suggestion} suggestion - History Query suggestion data\n @binding {number} index - History Query suggestion index\n @binding {() => string} formatTime - Callback to format time to `hh:mm [PM/AM]`\n "),
|
|
45
44
|
renderSlot(_ctx.$slots, "suggestion", mergeProps({ ref_for: true }, { suggestion, index, formatTime: _ctx.formatTime }), () => [
|
|
46
45
|
createVNode(_component_HistoryQuery, {
|
|
47
46
|
suggestion,
|
|
@@ -49,7 +48,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
49
48
|
class: "x-history-queries__item x-suggestion"
|
|
50
49
|
}, {
|
|
51
50
|
default: withCtx(() => [
|
|
52
|
-
createCommentVNode("\n @slot History Query content\n @binding {Suggestion} suggestion - History Query suggestion data\n @binding {number} index - History Query suggestion index\n @binding {() => string} formatTime - Callback to format time to `hh:mm [PM/AM]`\n "),
|
|
53
51
|
renderSlot(_ctx.$slots, "suggestion-content", mergeProps({ ref_for: true }, { suggestion, index, formatTime: _ctx.formatTime }), () => [
|
|
54
52
|
createTextVNode(
|
|
55
53
|
toDisplayString(suggestion.query) + " - " + toDisplayString(_ctx.formatTime(suggestion.timestamp)),
|
|
@@ -59,7 +57,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
59
57
|
], true)
|
|
60
58
|
]),
|
|
61
59
|
"remove-button-content": withCtx(() => [
|
|
62
|
-
createCommentVNode("\n @slot History Query remove button content\n @binding {Suggestion} suggestion - History Query suggestion data\n @binding {number} index - History Query suggestion index\n "),
|
|
63
60
|
renderSlot(_ctx.$slots, "suggestion-remove-content", mergeProps({ ref_for: true }, { suggestion, index }), void 0, true)
|
|
64
61
|
]),
|
|
65
62
|
_: 2
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"my-history.vue.js","sources":["../../../../../src/x-modules/history-queries/components/my-history.vue"],"sourcesContent":["<template>\n <component :is=\"animation\" v-if=\"hasHistoryQueries\" class=\"x-my-history\" tag=\"ul\">\n <li\n v-for=\"(historyQueries, date) in groupByDate\"\n :key=\"date\"\n class=\"x-my-history-item\"\n data-test=\"my-history-item\"\n >\n <slot name=\"date\" :date=\"date\">\n <span class=\"x-my-history-item__date\" data-test=\"my-history-date\">{{ date }}</span>\n </slot>\n <BaseSuggestions\n :suggestions=\"historyQueries\"\n class=\"x-my-history-queries\"\n :class=\"queriesListClass\"\n data-test=\"my-history-queries\"\n :animation=\"animation\"\n >\n <template #default=\"{ suggestion, index }\">\n <!--\n @slot History Query item\n @binding {Suggestion} suggestion - History Query suggestion data\n @binding {number} index - History Query suggestion index\n @binding {() => string} formatTime - Callback to format time to `hh:mm [PM/AM]`\n -->\n <slot name=\"suggestion\" v-bind=\"{ suggestion, index, formatTime }\">\n <HistoryQuery\n :suggestion=\"suggestion\"\n data-test=\"history-query-item\"\n class=\"x-history-queries__item x-suggestion\"\n >\n <template #default>\n <!--\n @slot History Query content\n @binding {Suggestion} suggestion - History Query suggestion data\n @binding {number} index - History Query suggestion index\n @binding {() => string} formatTime - Callback to format time to `hh:mm [PM/AM]`\n -->\n <slot name=\"suggestion-content\" v-bind=\"{ suggestion, index, formatTime }\">\n {{ suggestion.query }} - {{ formatTime(suggestion.timestamp) }}\n </slot>\n </template>\n <template #remove-button-content>\n <!--\n @slot History Query remove button content\n @binding {Suggestion} suggestion - History Query suggestion data\n @binding {number} index - History Query suggestion index\n -->\n <slot name=\"suggestion-remove-content\" v-bind=\"{ suggestion, index }\" />\n </template>\n </HistoryQuery>\n </slot>\n </template>\n </BaseSuggestions>\n </li>\n </component>\n</template>\n\n<script lang=\"ts\">\n import { HistoryQuery as HistoryQueryType } from '@empathyco/x-types';\n import { Dictionary } from '@empathyco/x-utils';\n import { computed, defineComponent, inject } from 'vue';\n import BaseSuggestions from '../../../components/suggestions/base-suggestions.vue';\n import { groupItemsBy, isArrayEmpty } from '../../../utils/array';\n import { SnippetConfig } from '../../../x-installer/api/api.types';\n import { historyQueriesXModule } from '../x-module';\n import { AnimationProp } from '../../../types/index';\n import { useState } from '../../../composables/use-state';\n import HistoryQuery from './history-query.vue';\n\n /**\n * The component renders the full history of user searched queries grouped by the day\n * they were performed.\n *\n * @remarks\n *\n * Allows the user to select one of them, emitting the needed events.\n * A history query is just another type of suggestion that contains a query that the user has\n * made in the past.\n * @public\n */\n export default defineComponent({\n name: 'MyHistory',\n xModule: historyQueriesXModule.name,\n components: {\n HistoryQuery,\n BaseSuggestions\n },\n props: {\n /**\n * Animation component that will be used to animate the suggestions.\n *\n * @public\n */\n animation: {\n type: AnimationProp,\n default: 'ul'\n },\n /**\n * The current locale.\n *\n * @public\n */\n locale: {\n type: String,\n default: 'en'\n },\n /** Class inherited by content element. */\n queriesListClass: String\n },\n setup(props) {\n /**\n * The list of history queries.\n *\n * @internal\n */\n const { historyQueries } = useState('historyQueries', ['historyQueries']);\n\n /**\n * The provided {@link SnippetConfig}.\n *\n * @internal\n */\n const snippetConfig = inject<SnippetConfig | undefined>('snippetConfig');\n\n /**\n * The locale that it is going to be used. It can be the one send it by the snippet config or\n * the one pass it using the prop.\n *\n * @returns The locale to be used.\n * @internal\n */\n const usedLocale = computed(() => snippetConfig?.lang ?? props.locale);\n\n /**\n * Returns a record of history queries grouped by date.\n *\n * @example\n * ```typescript\n * const historyQueriesGrouped = {\n * 'Monday, January 10th, 2022' : [{\n * query: 'lego',\n * modelName: 'HistoryQuery',\n * timestamp: 121312312\n * }],\n * 'Tuesday, January 11th, 2022' : [{\n * query: 'barbie',\n * modelName: 'HistoryQuery',\n * timestamp: 15221212\n * }]\n * }\n * ```\n * @returns The history queries grouped by date.\n * @internal\n */\n const groupByDate = computed((): Dictionary<HistoryQueryType[]> => {\n return groupItemsBy(historyQueries.value as HistoryQueryType[], current => {\n return new Date(current.timestamp).toLocaleDateString(usedLocale.value, {\n day: 'numeric',\n weekday: 'long',\n month: 'long',\n year: 'numeric'\n });\n });\n });\n\n /**\n * Formats a timestamp into `hh:mm [PM/AM]` format.\n *\n * @example\n * ```typescript\n * // locale 'es'\n * console.log(formatTime(Date.now()) // '16:54'.\n *\n * // locale 'en'\n * console.log(formatTime(Date.now()) // '16:54 PM'.\n * ```\n * @param timestamp - The timestamp to format.\n * @returns The formatted time.\n * @internal\n */\n const formatTime = (timestamp: number) =>\n new Date(timestamp).toLocaleTimeString(usedLocale.value, {\n hour: '2-digit',\n minute: '2-digit'\n });\n\n /**\n * The `hasHistoryQueries` computed property is a flag representing if there are history queries\n * stored.\n *\n * @returns True if there are history queries; false otherwise.\n * @internal\n */\n const hasHistoryQueries = computed(\n () => !isArrayEmpty(historyQueries.value as HistoryQueryType[])\n );\n\n return {\n hasHistoryQueries,\n groupByDate,\n historyQueries,\n formatTime\n };\n }\n });\n</script>\n\n<style lang=\"css\" scoped>\n .x-my-history {\n display: flex;\n flex-flow: column nowrap;\n }\n</style>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component doesn't emit events.\n\n## See it in action\n\nHere you have a basic example of how the MyHistory is rendered.\n\n```vue\n<template>\n <MyHistory />\n</template>\n\n<script>\n import { MyHistory } from '@empathyco/x-components/history-queries';\n\n export default {\n name: 'MyHistoryDemo',\n components: {\n MyHistory\n }\n };\n</script>\n```\n\n### Play with props\n\nIn this example, the my history has been configured to use the 'es' locale.\n\n```vue\n<template>\n <MyHistory :locale=\"es\" />\n</template>\n\n<script>\n import { MyHistory } from '@empathyco/x-components/history-queries';\n\n export default {\n name: 'MyHistoryDemo',\n components: {\n MyHistory\n }\n };\n</script>\n```\n\n### Play with the animation\n\n```vue\n<template>\n <MyHistory :animation=\"fadeAndSlide\" />\n</template>\n\n<script>\n import { MyHistory } from '@empathyco/x-components/history-queries';\n import { FadeAndSlide } from '@empathyco/x-components';\n\n export default {\n name: 'MyHistoryDemo',\n components: {\n MyHistory\n },\n data() {\n return {\n fadeAndSlide: FadeAndSlide\n };\n }\n };\n</script>\n```\n\n### Play with suggestion slot\n\nIn this example, the [`HistoryQuery`](./x-components.history-query.md) component is passed in the\n`suggestion` slot (although any other component could potentially be passed).\n\n```vue\n<template>\n <MyHistory #suggestion=\"{ suggestion }\">\n <HistoryQuery :suggestion=\"suggestion\"></HistoryQuery>\n </MyHistory>\n</template>\n\n<script>\n import { MyHistory, HistoryQuery } from '@empathyco/x-components/history-queries';\n\n export default {\n name: 'MyHistoryDemo',\n components: {\n MyHistory,\n HistoryQuery\n }\n };\n</script>\n```\n\n### Play with suggestion-content slot\n\nTo continue the previous example, the [`HistoryQuery`](./x-components.history-query.md) component is\npassed in the `suggestion-content` slot, but in addition, an HTML span tag for the text are also\npassed.\n\n```vue\n<template>\n <MyHistory #suggestion-content=\"{ suggestion }\">\n <span>{{ suggestion.query }}</span>\n </MyHistory>\n</template>\n\n<script>\n import { MyHistory } from '@empathyco/x-components/history-queries';\n\n export default {\n name: 'MyHistoryDemo',\n components: {\n MyHistory\n }\n };\n</script>\n```\n\n### Play with suggestion-content slot\n\nIn this example, an HTML span tag for the date are passed.\n\n```vue\n<template>\n <MyHistory #date=\"{ date }\">\n <span>{{ date }}</span>\n </MyHistory>\n</template>\n\n<script>\n import { MyHistory } from '@empathyco/x-components/history-queries';\n\n export default {\n name: 'MyHistoryDemo',\n components: {\n MyHistory\n }\n };\n</script>\n```\n\n### Play with suggestion-content-remove slot\n\nTo continue the previous example, the [`HistoryQuery`](./x-components.history-query.md) component is\npassed in the `suggestion-content` slot, but in addition, a cross icon is also passed to change the\nicon to remove the history query.\n\n```vue\n<template>\n <MyHistory #suggestion-content-remove=\"{ suggestion }\">\n <CrossIcon />\n </MyHistory>\n</template>\n\n<script>\n import { MyHistory } from '@empathyco/x-components/history-queries';\n import { CrossIcon } from '@empathyco/x-components';\n\n export default {\n name: 'MyHistoryDemo',\n components: {\n MyHistory,\n CrossIcon\n }\n };\n</script>\n```\n\n### Customizing the items with classes\n\nThe `queriesListClass` prop can be used to add classes to the suggestions list.\n\n```vue live\n<template>\n <MyHistory #date=\"{ date }\" queriesListClass=\"x-gap-16\" />\n</template>\n\n<script>\n import { MyHistory } from '@empathyco/x-components/history-queries';\n\n export default {\n name: 'MyHistoryDemo',\n components: {\n MyHistory\n }\n };\n</script>\n```\n</docs>\n"],"names":["_resolveComponent","_openBlock","_createBlock","_resolveDynamicComponent","_createElementBlock","_Fragment","_renderList","_createElementVNode","_toDisplayString","_createVNode","animation","_withCtx","_createCommentVNode","_renderSlot","_mergeProps"],"mappings":";;;;;MAS8C,UAAU,GAAA;AAAA,EAAA,KAAA,EAAA,yBAAA;;;;;AARJ,EAAA,MAAA,0BAAA,GAAAA,gBAAA,CAAA,iBAAA,CAAA,CAAA;AADpD,EAAA,OAAA,IAAA,CAAA,iBAAA,IAAAC,SAAA,EAC0E,EAAAC,WAAA,CAAAC,uBAAA,CAAA,IAAA,CAAA,SAAA,CAAA,EAAA;AAAA,IAAC,GAAI,EAAA,CAAA;AAAA,IAAA,KAAA,EAAA,cAAA;AAD/E,IAAA,GAAA,EAAA,IAAA;AAAA,GAAA,EAAA;;iBAIY,IAAI,CAAA,EAAAC,kBAAA;AAAA,QAAAC,QAAA;AAAA,QAAA,IAAA;AAAA,QAAAC,UAAA,CAAA,IAAA,CAAA,WAAA,EAAA,CAAA,cAAA,EAAA,IAAA,KAAA;AACL,UAAA,OAAAL,SAAA,EAAoB,EAAAG,kBAAA,CAAA,IAAA,EAAA;AAAA,YACzB,GAAA,EAAA,IAAA;AAAA,YAAA,KAAA,EAAA,mBAAA;YAEA,WAEO,EAAA,iBAAA;AAAA,WAAA,EAAA;;AACP,cAAAG,kBAAA;AAAA,gBA0CkB,MAAA;AAAA,gBAAA,UAAA;AAAA,gBAAAC,eAAA,CAAA,IAAA,CAAA;AAAA,gBAAA,CAAA;AAAA;AAAA,eAAA;AAAA,aAzCf,EAAA,IAAA,CAAA;AAAA,YAAAC,WAAA,CAZT,0BAac,EAAA;AAAA,cAEN,WAAU,EAAA,cAAA;AAAA,cACT,sBAAWC,CAAS,sBAAA,EAAA,IAAA,CAAA,gBAAA,CAAA,CAAA;AAAA,cAAA,WAAA,EAAA,oBAAA;cAEV,SAAO,EAAA,IAAA,CAAA,SAAA;AAAA,aAAA,EAAA;AAOhB,cAAA,OAAA,EAAAC,OAAA,CA0BO,CA1BP,EAAA,UAAA,EAAA,KAAA,EAAA,KAAA;AAAA,gBAyBiBC,kBAAA,CAAA,6RAAA,CAAA;AAAA,gBAAAC,UAAA,CAvBZ,KAAY,MAAU,EAAA,YAAA,EAAAC,UAAA,CAAA,EAAA,OAAA,EAAA,IAAA,EAAA,EAAA,EAAA,UAAA,EAAA,KAAA,EAAA,UAAA,EAAA,IAAA,CAAA,UAAA,EAAA,CAAA,EAAA,MAAA;AAAA,kBAAAL,WAAA,CACd,uBAAqB,EAAA;AAAA,oBAC9B,UAAA;AAAA,oBAAA,WAAA,EAAA,oBAAA;oBAEW,KAAO,EAAA,sCAAA;AAAA,mBAAA,EAAA;6BAOhBE,OAEO,CAAA,MAAA;AAAA,sBAAAC,kBAAA,CAxCvB,8TAuC6E,CAAA;AAAA,sBAAAC,UAAA,CAAA,IAAA,CAAA,MAAA,EAAA,oBAAA,EAAAC,UAAA,CAAA,EAAA,OAAA,EAAA,IAAA,EAAA,EAAA,EAAA,UAAA,EAAA,KAAA,EAAA,UAAA,EAAA,IAAA,CAAA,UAAA,EAAA,CAAA,EAAA,MAAA;;;;;;AAGpD,uBAAA,EAAA,IAAA,CAAA;AAAA,qBAAA,CAAA;AAM+D,oBAAA,uBAAA,EAAAH,OAAA,CAAA,MAAA;AAAA,sBAAAC,kBAAA,CAAA,yOAAA,CAAA;AAhDxF,sBAAAC,UAAA,CAAA,IAAA,CAAA,MAAA,EAAA,2BAAA,EAAAC,UAAA,CAAA,EAAA,OAAA,EAAA,IAAA,EAAA,EAAA,EAAA,UAAA,EAAA,KAAA,EAAA,CAAA,EAAA,KAAA,CAAA,EAAA,IAAA,CAAA;AAAA,qBAAA,CAAA;;;;AAAA,iBAAA,EAAA,IAAA,CAAA;AAAA,eAAA,CAAA;;;;;AAAA,SAAA,CAAA;AAAA,QAAA,GAAA;AAAA;AAAA,OAAA;AAAA,KAAA,CAAA;AAAA,IAAA,CAAA,EAAA,CAAA;AAAA;AAAA,GAAA,CAAA,IAAAF,kBAAA,CAAA,MAAA,EAAA,IAAA,CAAA,CAAA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"my-history.vue.js","sources":["../../../../../src/x-modules/history-queries/components/my-history.vue"],"sourcesContent":["<template>\n <component :is=\"animation\" v-if=\"hasHistoryQueries\" class=\"x-my-history\" tag=\"ul\">\n <li\n v-for=\"(historyQueries, date) in groupByDate\"\n :key=\"date\"\n class=\"x-my-history-item\"\n data-test=\"my-history-item\"\n >\n <slot name=\"date\" :date=\"date\">\n <span class=\"x-my-history-item__date\" data-test=\"my-history-date\">{{ date }}</span>\n </slot>\n <BaseSuggestions\n :suggestions=\"historyQueries\"\n class=\"x-my-history-queries\"\n :class=\"queriesListClass\"\n data-test=\"my-history-queries\"\n :animation=\"animation\"\n >\n <template #default=\"{ suggestion, index }\">\n <!--\n @slot History Query item\n @binding {Suggestion} suggestion - History Query suggestion data\n @binding {number} index - History Query suggestion index\n @binding {() => string} formatTime - Callback to format time to `hh:mm [PM/AM]`\n -->\n <slot name=\"suggestion\" v-bind=\"{ suggestion, index, formatTime }\">\n <HistoryQuery\n :suggestion=\"suggestion\"\n data-test=\"history-query-item\"\n class=\"x-history-queries__item x-suggestion\"\n >\n <template #default>\n <!--\n @slot History Query content\n @binding {Suggestion} suggestion - History Query suggestion data\n @binding {number} index - History Query suggestion index\n @binding {() => string} formatTime - Callback to format time to `hh:mm [PM/AM]`\n -->\n <slot name=\"suggestion-content\" v-bind=\"{ suggestion, index, formatTime }\">\n {{ suggestion.query }} - {{ formatTime(suggestion.timestamp) }}\n </slot>\n </template>\n <template #remove-button-content>\n <!--\n @slot History Query remove button content\n @binding {Suggestion} suggestion - History Query suggestion data\n @binding {number} index - History Query suggestion index\n -->\n <slot name=\"suggestion-remove-content\" v-bind=\"{ suggestion, index }\" />\n </template>\n </HistoryQuery>\n </slot>\n </template>\n </BaseSuggestions>\n </li>\n </component>\n</template>\n\n<script lang=\"ts\">\n import { HistoryQuery as HistoryQueryType } from '@empathyco/x-types';\n import { Dictionary } from '@empathyco/x-utils';\n import { computed, defineComponent, inject } from 'vue';\n import BaseSuggestions from '../../../components/suggestions/base-suggestions.vue';\n import { groupItemsBy, isArrayEmpty } from '../../../utils/array';\n import { SnippetConfig } from '../../../x-installer/api/api.types';\n import { historyQueriesXModule } from '../x-module';\n import { AnimationProp } from '../../../types/index';\n import { useState } from '../../../composables/use-state';\n import HistoryQuery from './history-query.vue';\n\n /**\n * The component renders the full history of user searched queries grouped by the day\n * they were performed.\n *\n * @remarks\n *\n * Allows the user to select one of them, emitting the needed events.\n * A history query is just another type of suggestion that contains a query that the user has\n * made in the past.\n * @public\n */\n export default defineComponent({\n name: 'MyHistory',\n xModule: historyQueriesXModule.name,\n components: {\n HistoryQuery,\n BaseSuggestions\n },\n props: {\n /**\n * Animation component that will be used to animate the suggestions.\n *\n * @public\n */\n animation: {\n type: AnimationProp,\n default: 'ul'\n },\n /**\n * The current locale.\n *\n * @public\n */\n locale: {\n type: String,\n default: 'en'\n },\n /** Class inherited by content element. */\n queriesListClass: String\n },\n setup(props) {\n /**\n * The list of history queries.\n *\n * @internal\n */\n const { historyQueries } = useState('historyQueries', ['historyQueries']);\n\n /**\n * The provided {@link SnippetConfig}.\n *\n * @internal\n */\n const snippetConfig = inject<SnippetConfig | undefined>('snippetConfig');\n\n /**\n * The locale that it is going to be used. It can be the one send it by the snippet config or\n * the one pass it using the prop.\n *\n * @returns The locale to be used.\n * @internal\n */\n const usedLocale = computed(() => snippetConfig?.lang ?? props.locale);\n\n /**\n * Returns a record of history queries grouped by date.\n *\n * @example\n * ```typescript\n * const historyQueriesGrouped = {\n * 'Monday, January 10th, 2022' : [{\n * query: 'lego',\n * modelName: 'HistoryQuery',\n * timestamp: 121312312\n * }],\n * 'Tuesday, January 11th, 2022' : [{\n * query: 'barbie',\n * modelName: 'HistoryQuery',\n * timestamp: 15221212\n * }]\n * }\n * ```\n * @returns The history queries grouped by date.\n * @internal\n */\n const groupByDate = computed((): Dictionary<HistoryQueryType[]> => {\n return groupItemsBy(historyQueries.value as HistoryQueryType[], current => {\n return new Date(current.timestamp).toLocaleDateString(usedLocale.value, {\n day: 'numeric',\n weekday: 'long',\n month: 'long',\n year: 'numeric'\n });\n });\n });\n\n /**\n * Formats a timestamp into `hh:mm [PM/AM]` format.\n *\n * @example\n * ```typescript\n * // locale 'es'\n * console.log(formatTime(Date.now()) // '16:54'.\n *\n * // locale 'en'\n * console.log(formatTime(Date.now()) // '16:54 PM'.\n * ```\n * @param timestamp - The timestamp to format.\n * @returns The formatted time.\n * @internal\n */\n const formatTime = (timestamp: number) =>\n new Date(timestamp).toLocaleTimeString(usedLocale.value, {\n hour: '2-digit',\n minute: '2-digit'\n });\n\n /**\n * The `hasHistoryQueries` computed property is a flag representing if there are history queries\n * stored.\n *\n * @returns True if there are history queries; false otherwise.\n * @internal\n */\n const hasHistoryQueries = computed(\n () => !isArrayEmpty(historyQueries.value as HistoryQueryType[])\n );\n\n return {\n hasHistoryQueries,\n groupByDate,\n historyQueries,\n formatTime\n };\n }\n });\n</script>\n\n<style lang=\"css\" scoped>\n .x-my-history {\n display: flex;\n flex-flow: column nowrap;\n }\n</style>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component doesn't emit events.\n\n## See it in action\n\nHere you have a basic example of how the MyHistory is rendered.\n\n```vue\n<template>\n <MyHistory />\n</template>\n\n<script>\n import { MyHistory } from '@empathyco/x-components/history-queries';\n\n export default {\n name: 'MyHistoryDemo',\n components: {\n MyHistory\n }\n };\n</script>\n```\n\n### Play with props\n\nIn this example, the my history has been configured to use the 'es' locale.\n\n```vue\n<template>\n <MyHistory :locale=\"es\" />\n</template>\n\n<script>\n import { MyHistory } from '@empathyco/x-components/history-queries';\n\n export default {\n name: 'MyHistoryDemo',\n components: {\n MyHistory\n }\n };\n</script>\n```\n\n### Play with the animation\n\n```vue\n<template>\n <MyHistory :animation=\"fadeAndSlide\" />\n</template>\n\n<script>\n import { MyHistory } from '@empathyco/x-components/history-queries';\n import { FadeAndSlide } from '@empathyco/x-components';\n\n export default {\n name: 'MyHistoryDemo',\n components: {\n MyHistory\n },\n data() {\n return {\n fadeAndSlide: FadeAndSlide\n };\n }\n };\n</script>\n```\n\n### Play with suggestion slot\n\nIn this example, the [`HistoryQuery`](./x-components.history-query.md) component is passed in the\n`suggestion` slot (although any other component could potentially be passed).\n\n```vue\n<template>\n <MyHistory #suggestion=\"{ suggestion }\">\n <HistoryQuery :suggestion=\"suggestion\"></HistoryQuery>\n </MyHistory>\n</template>\n\n<script>\n import { MyHistory, HistoryQuery } from '@empathyco/x-components/history-queries';\n\n export default {\n name: 'MyHistoryDemo',\n components: {\n MyHistory,\n HistoryQuery\n }\n };\n</script>\n```\n\n### Play with suggestion-content slot\n\nTo continue the previous example, the [`HistoryQuery`](./x-components.history-query.md) component is\npassed in the `suggestion-content` slot, but in addition, an HTML span tag for the text are also\npassed.\n\n```vue\n<template>\n <MyHistory #suggestion-content=\"{ suggestion }\">\n <span>{{ suggestion.query }}</span>\n </MyHistory>\n</template>\n\n<script>\n import { MyHistory } from '@empathyco/x-components/history-queries';\n\n export default {\n name: 'MyHistoryDemo',\n components: {\n MyHistory\n }\n };\n</script>\n```\n\n### Play with suggestion-content slot\n\nIn this example, an HTML span tag for the date are passed.\n\n```vue\n<template>\n <MyHistory #date=\"{ date }\">\n <span>{{ date }}</span>\n </MyHistory>\n</template>\n\n<script>\n import { MyHistory } from '@empathyco/x-components/history-queries';\n\n export default {\n name: 'MyHistoryDemo',\n components: {\n MyHistory\n }\n };\n</script>\n```\n\n### Play with suggestion-content-remove slot\n\nTo continue the previous example, the [`HistoryQuery`](./x-components.history-query.md) component is\npassed in the `suggestion-content` slot, but in addition, a cross icon is also passed to change the\nicon to remove the history query.\n\n```vue\n<template>\n <MyHistory #suggestion-content-remove=\"{ suggestion }\">\n <CrossIcon />\n </MyHistory>\n</template>\n\n<script>\n import { MyHistory } from '@empathyco/x-components/history-queries';\n import { CrossIcon } from '@empathyco/x-components';\n\n export default {\n name: 'MyHistoryDemo',\n components: {\n MyHistory,\n CrossIcon\n }\n };\n</script>\n```\n\n### Customizing the items with classes\n\nThe `queriesListClass` prop can be used to add classes to the suggestions list.\n\n```vue live\n<template>\n <MyHistory #date=\"{ date }\" queriesListClass=\"x-gap-16\" />\n</template>\n\n<script>\n import { MyHistory } from '@empathyco/x-components/history-queries';\n\n export default {\n name: 'MyHistoryDemo',\n components: {\n MyHistory\n }\n };\n</script>\n```\n</docs>\n"],"names":["_resolveComponent","_openBlock","_createBlock","_resolveDynamicComponent","_createElementBlock","_Fragment","_renderList","_createElementVNode","_toDisplayString","_createVNode","animation","_withCtx","_renderSlot","_mergeProps","_createCommentVNode"],"mappings":";;;;;MAS8C,UAAU,GAAA;AAAA,EAAA,KAAA,EAAA,yBAAA;;;;;AARJ,EAAA,MAAA,0BAAA,GAAAA,gBAAA,CAAA,iBAAA,CAAA,CAAA;AADpD,EAAA,OAAA,IAAA,CAAA,iBAAA,IAAAC,SAAA,EAC0E,EAAAC,WAAA,CAAAC,uBAAA,CAAA,IAAA,CAAA,SAAA,CAAA,EAAA;AAAA,IAAC,GAAI,EAAA,CAAA;AAAA,IAAA,KAAA,EAAA,cAAA;AAD/E,IAAA,GAAA,EAAA,IAAA;AAAA,GAAA,EAAA;;iBAIY,IAAI,CAAA,EAAAC,kBAAA;AAAA,QAAAC,QAAA;AAAA,QAAA,IAAA;AAAA,QAAAC,UAAA,CAAA,IAAA,CAAA,WAAA,EAAA,CAAA,cAAA,EAAA,IAAA,KAAA;AACL,UAAA,OAAAL,SAAA,EAAoB,EAAAG,kBAAA,CAAA,IAAA,EAAA;AAAA,YACzB,GAAA,EAAA,IAAA;AAAA,YAAA,KAAA,EAAA,mBAAA;YAEA,WAEO,EAAA,iBAAA;AAAA,WAAA,EAAA;;AACP,cAAAG,kBAAA;AAAA,gBA0CkB,MAAA;AAAA,gBAAA,UAAA;AAAA,gBAAAC,eAAA,CAAA,IAAA,CAAA;AAAA,gBAAA,CAAA;AAAA;AAAA,eAAA;AAAA,aAzCf,EAAA,IAAA,CAAA;AAAA,YAAAC,WAAA,CAZT,0BAac,EAAA;AAAA,cAEN,WAAU,EAAA,cAAA;AAAA,cACT,sBAAWC,CAAS,sBAAA,EAAA,IAAA,CAAA,gBAAA,CAAA,CAAA;AAAA,cAAA,WAAA,EAAA,oBAAA;cAEV,SAAO,EAAA,IAAA,CAAA,SAAA;AAAA,aAAA,EAAA;uBAQdC,OAwBe,CAAA,CAAA,EAAA,UAAA,EAAA,KAAA,EAAA,KAAA;AAAA,gBAAAC,UAAA,CAvBZ,KAAY,MAAU,EAAA,YAAA,EAAAC,UAAA,CAAA,EAAA,OAAA,EAAA,IAAA,EAAA,EAAA,EAAA,UAAA,EAAA,KAAA,EAAA,UAAA,EAAA,IAAA,CAAA,UAAA,EAAA,CAAA,EAAA,MAAA;AAAA,kBAAAJ,WAAA,CACd,uBAAqB,EAAA;AAAA,oBAC9B,UAAA;AAAA,oBAAA,WAAA,EAAA,oBAAA;oBAEW,KAAO,EAAA,sCAAA;AAAA,mBAAA,EAAA;AA/BhC,oBAAA,OAAA,EAAAE,OAAA,CAAA,MAAA;AAAA,sBAAAC,UAAA,CAAA,IAAA,CAAA,MAAA,EAAA,oBAAA,EAAAC,UAAA,CAAA,EAAA,OAAA,EAAA,IAAA,EAAA,EAAA,EAAA,UAAA,EAAA,KAAA,EAAA,UAAA,EAAA,IAAA,CAAA,UAAA,EAAA,CAAA,EAAA,MAAA;;;;;;AA0CyB,uBAAA,EAAA,IAAA,CAAA;AAAA,qBAAA,CAAA;;AA1CzB,sBAAAD,UAAA,CAAA,IAAA,CAAA,MAAA,EAAA,2BAAA,EAAAC,UAAA,CAAA,EAAA,OAAA,EAAA,IAAA,EAAA,EAAA,EAAA,UAAA,EAAA,KAAA,EAAA,CAAA,EAAA,KAAA,CAAA,EAAA,IAAA,CAAA;AAAA,qBAAA,CAAA;;;;AAAA,iBAAA,EAAA,IAAA,CAAA;AAAA,eAAA,CAAA;;;;;AAAA,SAAA,CAAA;AAAA,QAAA,GAAA;AAAA;AAAA,OAAA;AAAA,KAAA,CAAA;AAAA,IAAA,CAAA,EAAA,CAAA;AAAA;AAAA,GAAA,CAAA,IAAAC,kBAAA,CAAA,MAAA,EAAA,IAAA,CAAA,CAAA;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _sfc_main from './remove-history-query.vue2.js';
|
|
2
|
-
import { resolveComponent, openBlock, createBlock, withCtx,
|
|
2
|
+
import { resolveComponent, openBlock, createBlock, withCtx, renderSlot } from 'vue';
|
|
3
3
|
import _export_sfc from '../../../_virtual/_plugin-vue_export-helper.js';
|
|
4
4
|
|
|
5
5
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
@@ -10,7 +10,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
10
10
|
"aria-label": "remove"
|
|
11
11
|
}, {
|
|
12
12
|
default: withCtx(() => [
|
|
13
|
-
createCommentVNode(" @slot (Required) Button content with a text, an icon or both "),
|
|
14
13
|
renderSlot(_ctx.$slots, "default")
|
|
15
14
|
]),
|
|
16
15
|
_: 3
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove-history-query.vue.js","sources":["../../../../../src/x-modules/history-queries/components/remove-history-query.vue"],"sourcesContent":["<template>\n <BaseEventButton\n class=\"x-remove-history-query\"\n :events=\"removeHistoryQueryEvent\"\n aria-label=\"remove\"\n >\n <!-- @slot (Required) Button content with a text, an icon or both -->\n <slot />\n </BaseEventButton>\n</template>\n\n<script lang=\"ts\">\n import { HistoryQuery } from '@empathyco/x-types';\n import { computed, defineComponent, PropType } from 'vue';\n import BaseEventButton from '../../../components/base-event-button.vue';\n import { XEventsTypes } from '../../../wiring/events.types';\n import { historyQueriesXModule } from '../x-module';\n\n /**\n * Button that when it is pressed emits the\n * {@link HistoryQueriesXEvents.UserPressedRemoveHistoryQuery} event, expressing the user\n * intention to remove a query in the history.\n *\n * @public\n */\n export default defineComponent({\n name: 'RemoveHistoryQuery',\n xModule: historyQueriesXModule.name,\n components: {\n BaseEventButton\n },\n props: {\n /**\n * The historyQuery that will be removed when clicking the clear button.\n *\n * @public\n */\n historyQuery: {\n type: Object as PropType<HistoryQuery>,\n required: true\n }\n },\n setup(props) {\n /**\n * The event handler that will be triggered when clicking on the clear history query button.\n *\n * @remarks\n * {@link HistoryQueriesXEvents.UserPressedRemoveHistoryQuery}: historyQuery\n *\n * @returns The {@link XEvent} to emit.\n * @public\n */\n const removeHistoryQueryEvent = computed(\n (): Partial<XEventsTypes> => ({ UserPressedRemoveHistoryQuery: props.historyQuery })\n );\n\n return {\n removeHistoryQueryEvent\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`UserPressedRemoveHistoryQuery`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after the user clicks the button. The event payload is the history query\n data.\n\n## Examples\n\n### Basic Example\n\nYou can customize the content that this component renders. To do so, simply use the default slot.\n\n```vue\n<RemoveHistoryQuery :historyQuery=\"historyQuery\">\n <img class=\"x-history-query__icon\" src=\"./my-awesome-clear-icon.svg\"/>\n</RemoveHistoryQuery>\n```\n</docs>\n"],"names":["_resolveComponent","_openBlock","_createBlock","
|
|
1
|
+
{"version":3,"file":"remove-history-query.vue.js","sources":["../../../../../src/x-modules/history-queries/components/remove-history-query.vue"],"sourcesContent":["<template>\n <BaseEventButton\n class=\"x-remove-history-query\"\n :events=\"removeHistoryQueryEvent\"\n aria-label=\"remove\"\n >\n <!-- @slot (Required) Button content with a text, an icon or both -->\n <slot />\n </BaseEventButton>\n</template>\n\n<script lang=\"ts\">\n import { HistoryQuery } from '@empathyco/x-types';\n import { computed, defineComponent, PropType } from 'vue';\n import BaseEventButton from '../../../components/base-event-button.vue';\n import { XEventsTypes } from '../../../wiring/events.types';\n import { historyQueriesXModule } from '../x-module';\n\n /**\n * Button that when it is pressed emits the\n * {@link HistoryQueriesXEvents.UserPressedRemoveHistoryQuery} event, expressing the user\n * intention to remove a query in the history.\n *\n * @public\n */\n export default defineComponent({\n name: 'RemoveHistoryQuery',\n xModule: historyQueriesXModule.name,\n components: {\n BaseEventButton\n },\n props: {\n /**\n * The historyQuery that will be removed when clicking the clear button.\n *\n * @public\n */\n historyQuery: {\n type: Object as PropType<HistoryQuery>,\n required: true\n }\n },\n setup(props) {\n /**\n * The event handler that will be triggered when clicking on the clear history query button.\n *\n * @remarks\n * {@link HistoryQueriesXEvents.UserPressedRemoveHistoryQuery}: historyQuery\n *\n * @returns The {@link XEvent} to emit.\n * @public\n */\n const removeHistoryQueryEvent = computed(\n (): Partial<XEventsTypes> => ({ UserPressedRemoveHistoryQuery: props.historyQuery })\n );\n\n return {\n removeHistoryQueryEvent\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`UserPressedRemoveHistoryQuery`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after the user clicks the button. The event payload is the history query\n data.\n\n## Examples\n\n### Basic Example\n\nYou can customize the content that this component renders. To do so, simply use the default slot.\n\n```vue\n<RemoveHistoryQuery :historyQuery=\"historyQuery\">\n <img class=\"x-history-query__icon\" src=\"./my-awesome-clear-icon.svg\"/>\n</RemoveHistoryQuery>\n```\n</docs>\n"],"names":["_resolveComponent","_openBlock","_createBlock","_renderSlot"],"mappings":";;;;;AAQoB,EAAA,MAAA,0BAAA,GAAAA,gBAAA,CAAA,iBAAA,CAAA,CAAA;AALT,EAAA,OAAAC,SAAA,EAAyB,EAAAC,WAAA,CAAA,0BAAA,EAAA;AAAA,IAChC,KAAA,EAAA,wBAAA;AAAA,IAAA,MAAA,EAAA,IAAA,CAAA,uBAAA;AAJJ,IAAA,YAAA,EAAA,QAAA;AAAA,GAAA,EAAA;;AAAA,MAAAC,UAAA,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,CAAA;AAAA,KAAA,CAAA;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emitters.js","sources":["../../../../../src/x-modules/history-queries/store/emitters.ts"],"sourcesContent":["import { createStoreEmitters } from '../../../store';\nimport { historyQueriesXStoreModule } from './module';\n\n/**\n * {@link StoreEmitters} For the history-queries module.\n *\n * @internal\n */\nexport const historyQueriesEmitters = createStoreEmitters(historyQueriesXStoreModule, {\n // Used for filtering next-queries with the session history queries\n SessionHistoryQueriesChanged: (_state, getters) => getters.sessionHistoryQueries,\n // Used for refreshing the session until it is extracted from the history queries module\n HistoryQueriesQueryChanged: { immediate: true, selector: state => state.query },\n // Used to load history-queries from the browser storage\n HistoryQueriesStorageKeyChanged: {\n immediate: true,\n selector: (_state, getters) => getters.storageKey\n }\n});\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"emitters.js","sources":["../../../../../src/x-modules/history-queries/store/emitters.ts"],"sourcesContent":["import { createStoreEmitters } from '../../../store';\nimport { historyQueriesXStoreModule } from './module';\n\n/**\n * {@link StoreEmitters} For the history-queries module.\n *\n * @internal\n */\nexport const historyQueriesEmitters = createStoreEmitters(historyQueriesXStoreModule, {\n // Used for filtering next-queries with the session history queries\n SessionHistoryQueriesChanged: (_state, getters) => getters.sessionHistoryQueries,\n // Used for refreshing the session until it is extracted from the history queries module\n HistoryQueriesQueryChanged: { immediate: true, selector: state => state.query },\n // Used to load history-queries from the browser storage\n HistoryQueriesStorageKeyChanged: {\n immediate: true,\n selector: (_state, getters) => getters.storageKey\n }\n});\n"],"names":[],"mappings":";;;;AAGA;;;;AAIG;AACU,MAAA,sBAAsB,GAAG,mBAAmB,CAAC,0BAA0B,EAAE;;IAEpF,4BAA4B,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC,qBAAqB;;AAEhF,IAAA,0BAA0B,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,IAAI,KAAK,CAAC,KAAK,EAAE;;AAE/E,IAAA,+BAA+B,EAAE;AAC/B,QAAA,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC,UAAU;AAClD,KAAA;AACF,CAAA;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _sfc_main from './identifier-results.vue2.js';
|
|
2
|
-
import { openBlock, createBlock, resolveDynamicComponent, withCtx, createElementBlock, Fragment, renderList,
|
|
2
|
+
import { openBlock, createBlock, resolveDynamicComponent, withCtx, createElementBlock, Fragment, renderList, renderSlot, createCommentVNode } from 'vue';
|
|
3
3
|
import './identifier-results.vue3.js';
|
|
4
4
|
import _export_sfc from '../../../_virtual/_plugin-vue_export-helper.js';
|
|
5
5
|
|
|
@@ -19,7 +19,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
19
19
|
class: "x-identifier-results__item",
|
|
20
20
|
"data-test": "identifier-results-item"
|
|
21
21
|
}, [
|
|
22
|
-
createCommentVNode("\n @slot (Required) Identifier results item content\n @binding {Result} identifierResult - Identifier Result data\n "),
|
|
23
22
|
renderSlot(_ctx.$slots, "default", { identifierResult }, void 0, true)
|
|
24
23
|
]);
|
|
25
24
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identifier-results.vue.js","sources":["../../../../../src/x-modules/identifier-results/components/identifier-results.vue"],"sourcesContent":["<template>\n <component :is=\"animation\" v-if=\"identifierResults.length\" tag=\"ul\" class=\"x-identifier-results\">\n <li\n v-for=\"identifierResult in identifierResultsToRender\"\n :key=\"identifierResult.id\"\n class=\"x-identifier-results__item\"\n data-test=\"identifier-results-item\"\n >\n <!--\n @slot (Required) Identifier results item content\n @binding {Result} identifierResult - Identifier Result data\n -->\n <slot :identifierResult=\"identifierResult\" />\n </li>\n </component>\n</template>\n\n<script lang=\"ts\">\n import { Result } from '@empathyco/x-types';\n import { computed, defineComponent, provide } from 'vue';\n import { PropsWithType } from '../../../utils/types';\n import { XEventsTypes } from '../../../wiring/events.types';\n import { identifierResultsXModule } from '../x-module';\n import { AnimationProp } from '../../../types/animation-prop';\n import { useState } from '../../../composables/use-state';\n\n /**\n * Paints the list of identifier results stored in the state. Each identifier result should be\n * represented by a {@link IdentifierResult} component besides any\n * other component.\n *\n * @public\n */\n export default defineComponent({\n name: 'IdentifierResults',\n xModule: identifierResultsXModule.name,\n props: {\n /**\n * Animation component that will be used to animate the identifier results.\n *\n * @public\n */\n animation: {\n type: AnimationProp,\n default: 'ul'\n },\n /**\n * Number of identifier results to render.\n *\n * @public\n */\n maxItemsToRender: Number\n },\n setup: function (props) {\n /**\n * The module's list of identifier results.\n *\n * @public\n */\n const { identifierResults } = useState('identifierResults', ['identifierResults']);\n\n /**\n * The additional events to be emitted by the mandatory {@link BaseResultLink} component.\n *\n * @public\n */\n provide<PropsWithType<XEventsTypes, Result>[]>('resultClickExtraEvents', [\n 'UserClickedAIdentifierResult'\n ]);\n\n /**\n * Slices the identifier results from the state.\n *\n * @returns - The list of identifier results sliced by the number of items to render.\n *\n * @internal\n */\n const identifierResultsToRender = computed(() =>\n (identifierResults.value as Result[]).slice(0, props.maxItemsToRender)\n );\n\n return {\n identifierResults,\n identifierResultsToRender\n };\n }\n });\n</script>\n\n<style lang=\"css\" scoped>\n .x-identifier-results {\n display: flex;\n flex-flow: column nowrap;\n }\n</style>\n\n<docs lang=\"mdx\">\n## Examples\n\n### Play with slot\n\nA IdentifierResult **must** be used inside the IdentifierResults component. In the example below the\nBaseResultLink is used as a wrapper and its default slot is filled with the IdentifierResult\ncomponent.\n\n```vue\n<IdentifierResults :animation=\"fadeAndSlide\">\n <template #default=\"{ identifierResult }\">\n <BaseResultLink :result=\"identifierResult\">\n <template #default=\"{ result }\">\n <IdentifierResult :result=\"result\"/>\n </template>\n </BaseResultLink>\n </template>\n</IdentifierResults>\n```\n\n### Play with props\n\nIn this example, the identifier results have been limited to render a maximum of 3 items.\n\n```vue\n<template>\n <IdentifierResults #default=\"{ identifierResult }\" :maxItemsToRender=\"3\">\n <IdentifierResult :result=\"identifierResult\" />\n </IdentifierResults>\n</template>\n\n<script>\n import { IdentifierResults, IdentifierResult } from '@empathyco/x-components';\n\n export default {\n name: 'IdentifierResultsDemo',\n components: {\n IdentifierResults,\n IdentifierResult\n }\n };\n</script>\n```\n</docs>\n"],"names":["animation","_openBlock","_createBlock","_resolveDynamicComponent","_createElementBlock","_Fragment","_renderList","_createCommentVNode"],"mappings":";;;;;AACE,SAAA,WAAA,CAAA,IAAA,EAAA,MAAA,EADF,MACkBA,EAAAA,MAAAA,EAAAA,KAAAA,EAAAA,QAAAA,EAAAA;SADlB,IACqE,CAAA,iBAAA,CAAA,MAAA,IAAAC,SAAA,EAAA,EAAAC,WAAA,CAAAC,uBAAA,CAAA,IAAA,CAAA,SAAA,CAAA,EAAA;AAAA,IAAC,GAAK,EAAA,CAAA;AAAA,IAAA,GAAA,EAAA,IAAA;AAD3E,IAAA,KAAA,EAAA,sBAAA;AAAA,GAAA,EAAA;;AAIY,OAAAF,SAAA,CAAA,IAAA,CAAA,EAAAG,kBAAA;AAAA,QAAmBC,QAAA;AAAA,QAAA,IAAA;AAAA,QAAAC,UAAA,CAAA,IAAA,CAAA,yBAAA,EAAA,CAAA,gBAAA,KAAA;AACpB,UAAA,OAAAL,SAAA,EAA6B,EAAAG,kBAAA,CAAA,IAAA,EAAA;AAAA,YAClC,GAAU,EAAA,gBAAA,CAAA,EAAA;AAAA,YAAA,KAAA,EAAA,4BAAA;
|
|
1
|
+
{"version":3,"file":"identifier-results.vue.js","sources":["../../../../../src/x-modules/identifier-results/components/identifier-results.vue"],"sourcesContent":["<template>\n <component :is=\"animation\" v-if=\"identifierResults.length\" tag=\"ul\" class=\"x-identifier-results\">\n <li\n v-for=\"identifierResult in identifierResultsToRender\"\n :key=\"identifierResult.id\"\n class=\"x-identifier-results__item\"\n data-test=\"identifier-results-item\"\n >\n <!--\n @slot (Required) Identifier results item content\n @binding {Result} identifierResult - Identifier Result data\n -->\n <slot :identifierResult=\"identifierResult\" />\n </li>\n </component>\n</template>\n\n<script lang=\"ts\">\n import { Result } from '@empathyco/x-types';\n import { computed, defineComponent, provide } from 'vue';\n import { PropsWithType } from '../../../utils/types';\n import { XEventsTypes } from '../../../wiring/events.types';\n import { identifierResultsXModule } from '../x-module';\n import { AnimationProp } from '../../../types/animation-prop';\n import { useState } from '../../../composables/use-state';\n\n /**\n * Paints the list of identifier results stored in the state. Each identifier result should be\n * represented by a {@link IdentifierResult} component besides any\n * other component.\n *\n * @public\n */\n export default defineComponent({\n name: 'IdentifierResults',\n xModule: identifierResultsXModule.name,\n props: {\n /**\n * Animation component that will be used to animate the identifier results.\n *\n * @public\n */\n animation: {\n type: AnimationProp,\n default: 'ul'\n },\n /**\n * Number of identifier results to render.\n *\n * @public\n */\n maxItemsToRender: Number\n },\n setup: function (props) {\n /**\n * The module's list of identifier results.\n *\n * @public\n */\n const { identifierResults } = useState('identifierResults', ['identifierResults']);\n\n /**\n * The additional events to be emitted by the mandatory {@link BaseResultLink} component.\n *\n * @public\n */\n provide<PropsWithType<XEventsTypes, Result>[]>('resultClickExtraEvents', [\n 'UserClickedAIdentifierResult'\n ]);\n\n /**\n * Slices the identifier results from the state.\n *\n * @returns - The list of identifier results sliced by the number of items to render.\n *\n * @internal\n */\n const identifierResultsToRender = computed(() =>\n (identifierResults.value as Result[]).slice(0, props.maxItemsToRender)\n );\n\n return {\n identifierResults,\n identifierResultsToRender\n };\n }\n });\n</script>\n\n<style lang=\"css\" scoped>\n .x-identifier-results {\n display: flex;\n flex-flow: column nowrap;\n }\n</style>\n\n<docs lang=\"mdx\">\n## Examples\n\n### Play with slot\n\nA IdentifierResult **must** be used inside the IdentifierResults component. In the example below the\nBaseResultLink is used as a wrapper and its default slot is filled with the IdentifierResult\ncomponent.\n\n```vue\n<IdentifierResults :animation=\"fadeAndSlide\">\n <template #default=\"{ identifierResult }\">\n <BaseResultLink :result=\"identifierResult\">\n <template #default=\"{ result }\">\n <IdentifierResult :result=\"result\"/>\n </template>\n </BaseResultLink>\n </template>\n</IdentifierResults>\n```\n\n### Play with props\n\nIn this example, the identifier results have been limited to render a maximum of 3 items.\n\n```vue\n<template>\n <IdentifierResults #default=\"{ identifierResult }\" :maxItemsToRender=\"3\">\n <IdentifierResult :result=\"identifierResult\" />\n </IdentifierResults>\n</template>\n\n<script>\n import { IdentifierResults, IdentifierResult } from '@empathyco/x-components';\n\n export default {\n name: 'IdentifierResultsDemo',\n components: {\n IdentifierResults,\n IdentifierResult\n }\n };\n</script>\n```\n</docs>\n"],"names":["animation","_openBlock","_createBlock","_resolveDynamicComponent","_createElementBlock","_Fragment","_renderList","_createCommentVNode"],"mappings":";;;;;AACE,SAAA,WAAA,CAAA,IAAA,EAAA,MAAA,EADF,MACkBA,EAAAA,MAAAA,EAAAA,KAAAA,EAAAA,QAAAA,EAAAA;SADlB,IACqE,CAAA,iBAAA,CAAA,MAAA,IAAAC,SAAA,EAAA,EAAAC,WAAA,CAAAC,uBAAA,CAAA,IAAA,CAAA,SAAA,CAAA,EAAA;AAAA,IAAC,GAAK,EAAA,CAAA;AAAA,IAAA,GAAA,EAAA,IAAA;AAD3E,IAAA,KAAA,EAAA,sBAAA;AAAA,GAAA,EAAA;;AAIY,OAAAF,SAAA,CAAA,IAAA,CAAA,EAAAG,kBAAA;AAAA,QAAmBC,QAAA;AAAA,QAAA,IAAA;AAAA,QAAAC,UAAA,CAAA,IAAA,CAAA,yBAAA,EAAA,CAAA,gBAAA,KAAA;AACpB,UAAA,OAAAL,SAAA,EAA6B,EAAAG,kBAAA,CAAA,IAAA,EAAA;AAAA,YAClC,GAAU,EAAA,gBAAA,CAAA,EAAA;AAAA,YAAA,KAAA,EAAA,4BAAA;YAMV,WAA6C,EAAA,yBAAA;AAAA,WAAA,EAAA;;;AAZnD,SAAA,CAAA;AAAA,QAAA,GAAA;AAAA;AAAA,OAAA;AAAA,KAAA,CAAA;AAAA,IAAA,CAAA,EAAA,CAAA;AAAA;AAAA,GAAA,CAAA,IAAAG,kBAAA,CAAA,MAAA,EAAA,IAAA,CAAA,CAAA;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emitters.js","sources":["../../../../../src/x-modules/identifier-results/store/emitters.ts"],"sourcesContent":["import { createStoreEmitters } from '../../../store';\nimport { createEmitterArrayFilter } from '../../../utils/array';\nimport { identifierResultsXStoreModule } from './module';\n\n/**\n * {@link StoreEmitters} For the identifier-results module.\n *\n * @internal\n */\nexport const identifierResultsEmitters = createStoreEmitters(identifierResultsXStoreModule, {\n IdentifierResultsChanged: {\n selector: state => state.identifierResults,\n filter: createEmitterArrayFilter('id')\n },\n IdentifierResultsRequestUpdated: (_, getters) => getters.identifierResultsRequest\n});\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"emitters.js","sources":["../../../../../src/x-modules/identifier-results/store/emitters.ts"],"sourcesContent":["import { createStoreEmitters } from '../../../store';\nimport { createEmitterArrayFilter } from '../../../utils/array';\nimport { identifierResultsXStoreModule } from './module';\n\n/**\n * {@link StoreEmitters} For the identifier-results module.\n *\n * @internal\n */\nexport const identifierResultsEmitters = createStoreEmitters(identifierResultsXStoreModule, {\n IdentifierResultsChanged: {\n selector: state => state.identifierResults,\n filter: createEmitterArrayFilter('id')\n },\n IdentifierResultsRequestUpdated: (_, getters) => getters.identifierResultsRequest\n});\n"],"names":[],"mappings":";;;;;AAIA;;;;AAIG;AACU,MAAA,yBAAyB,GAAG,mBAAmB,CAAC,6BAA6B,EAAE;AAC1F,IAAA,wBAAwB,EAAE;AACxB,QAAA,QAAQ,EAAE,KAAK,IAAI,KAAK,CAAC,iBAAiB;AAC1C,QAAA,MAAM,EAAE,wBAAwB,CAAC,IAAI,CAAC;AACvC,KAAA;IACD,+BAA+B,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,wBAAwB;AAClF,CAAA;;;;"}
|