@empathyco/x-components 6.0.0-alpha.5 → 6.0.0-alpha.51
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 +448 -0
- package/core/index.js +8 -1
- package/core/index.js.map +1 -1
- package/design-system/deprecated-full-theme.css +596 -596
- 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 +11 -0
- 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.basetabspanel.md +8 -8
- 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 +12 -0
- package/docs/API-reference/api/x-components.hierarchicalfilter.md +8 -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 +38 -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.relatedpromptrequest.md +13 -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 +22 -0
- package/docs/API-reference/api/x-components.relatedpromptsgetters.md +20 -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 +26 -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.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 +24 -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.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 +73 -0
- package/docs/API-reference/api/x-components.relatedpromptsxevents.md +24 -0
- package/docs/API-reference/api/x-components.relatedpromptsxevents.relatedpromptsrequestupdated.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.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.semanticqueriesmutations.md +1 -1
- package/docs/API-reference/api/x-components.semanticqueriesstate.md +1 -1
- 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.simplefilter.md +6 -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 +6 -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 +1 -1
- 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 +5 -0
- package/docs/API-reference/api/x-types.relatedprompt.md +26 -0
- package/docs/API-reference/api/x-types.relatedprompt.nextqueries.md +13 -0
- package/docs/API-reference/api/x-types.relatedprompt.relatedpromptnextqueries.md +13 -0
- package/docs/API-reference/api/x-types.relatedprompt.suggestiontext.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.relatedprompt.type.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.relatedpromptsrequest.md +15 -0
- package/docs/API-reference/api/x-types.relatedpromptsresponse.md +20 -0
- package/docs/API-reference/api/x-types.relatedpromptsresponse.relatedprompts.md +11 -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/api/x-types.xcomponentsadapter.md +1 -0
- package/docs/API-reference/api/x-types.xcomponentsadapter.relatedprompts.md +11 -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.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-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 +20 -3
- 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 +8 -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 +6 -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 +7 -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 +26 -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 +98 -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 +226 -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/emitters.js +15 -0
- package/js/x-modules/related-prompts/store/emitters.js.map +1 -0
- package/js/x-modules/related-prompts/store/getters/request.getter.js +16 -0
- package/js/x-modules/related-prompts/store/getters/request.getter.js.map +1 -0
- package/js/x-modules/related-prompts/store/module.js +61 -0
- package/js/x-modules/related-prompts/store/module.js.map +1 -0
- package/js/x-modules/related-prompts/wiring.js +99 -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 +6 -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/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 +105 -8
- 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 +2 -1
- 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/package.json +50 -49
- package/related-prompts/index.d.ts +1 -0
- package/related-prompts/index.js +10 -0
- package/report/x-adapter-platform.api.json +936 -81
- package/report/x-components.api.json +16366 -17517
- package/report/x-components.api.md +806 -213
- package/report/x-types.api.json +577 -0
- package/tagging/index.js +2 -2
- package/types/adapter/e2e-adapter.d.ts.map +1 -1
- 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-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 +12 -0
- package/types/components/global-x-bus.vue.d.ts.map +1 -1
- package/types/components/index.d.ts +3 -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 +6 -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 +2 -2
- 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/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 +8 -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 +6 -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 +132 -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 +36 -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/emitters.d.ts +9 -0
- package/types/x-modules/related-prompts/store/emitters.d.ts.map +1 -0
- package/types/x-modules/related-prompts/store/getters/request.getter.d.ts +13 -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 +7 -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 +108 -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 +38 -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/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/x-modules.types.d.ts +2 -0
- package/types/x-modules/x-modules.types.d.ts.map +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
|
@@ -19,7 +19,7 @@ differently based on their purpose and this can be achieved using the exposed sl
|
|
|
19
19
|
| ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------- | ----------------- |
|
|
20
20
|
| <code>facetsIds</code> | Array of facets ids used to get the selected filters for those facets. | <code>Array<Facet['id']></code> | <code></code> |
|
|
21
21
|
| <code>alwaysVisible</code> | Flag to render the component even if there are no filters selected. | <code>boolean</code> | <code></code> |
|
|
22
|
-
| <code>animation</code> | Animation component that will be used to animate the facets. | <code>
|
|
22
|
+
| <code>animation</code> | Animation component that will be used to animate the facets. | <code>AnimationProp</code> | <code>'ul'</code> |
|
|
23
23
|
| <code>renderableFacets</code> | Discriminates the facets rendered by this component. It expects a string containing facets<br />ids, comma separated. This property will include or exclude facets based on its value.<br />The default value is an empty string and the component will render all existing facets. | <code>string</code> | <code></code> |
|
|
24
24
|
|
|
25
25
|
## Slots
|
|
@@ -20,7 +20,7 @@ The property "alwaysVisible" handles if the component is rendered if no filters
|
|
|
20
20
|
| -------------------------- | --------------------------------------------------------------------------- | ------------------------------- | ----------------- |
|
|
21
21
|
| <code>facetsIds</code> | Array of facets ids used to get the selected filters for those facets. | <code>Array<Facet['id']></code> | <code></code> |
|
|
22
22
|
| <code>alwaysVisible</code> | Flag to render the component even if there are no filters selected. | <code>boolean</code> | <code></code> |
|
|
23
|
-
| <code>animation</code> | Animation component that will be used to animate the selected filters list. | <code>
|
|
23
|
+
| <code>animation</code> | Animation component that will be used to animate the selected filters list. | <code>AnimationProp</code> | <code>'ul'</code> |
|
|
24
24
|
|
|
25
25
|
## Slots
|
|
26
26
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
|
|
3
|
+
title: RelatedPrompt
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# RelatedPrompt
|
|
8
|
+
|
|
9
|
+
This component shows a suggested related prompt.
|
|
10
|
+
|
|
11
|
+
## Props
|
|
12
|
+
|
|
13
|
+
| Name | Description | Type | Default |
|
|
14
|
+
| -------------------------- | ----------- | -------------------------- | ------------------ |
|
|
15
|
+
| <code>relatedPrompt</code> | | <code>RelatedPrompt</code> | <code></code> |
|
|
16
|
+
| <code>selected</code> | | <code>boolean</code> | <code>false</code> |
|
|
17
|
+
|
|
18
|
+
## Slots
|
|
19
|
+
|
|
20
|
+
| Name | Description | Bindings<br />(name - type - description) |
|
|
21
|
+
| ----------------------------------------- | ----------- | ----------------------------------------- |
|
|
22
|
+
| <code>related-prompt-extra-content</code> | | |
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
---
|
|
2
|
+
|
|
3
|
+
title: RelatedPromptsList
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# RelatedPromptsList
|
|
8
|
+
|
|
9
|
+
Component that inserts groups of related prompts in different positions of the injected search items
|
|
10
|
+
list, based on the provided configuration.
|
|
11
|
+
|
|
12
|
+
## Props
|
|
13
|
+
|
|
14
|
+
| Name | Description | Type | Default |
|
|
15
|
+
| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------- | ---------------------- |
|
|
16
|
+
| <code>animation</code> | Animation component that will be used to animate the related prompts groups. | <code>AnimationProp</code> | <code>'ul'</code> |
|
|
17
|
+
| <code>offset</code> | The first index to insert a group of related prompts at. | <code>number</code> | <code>24</code> |
|
|
18
|
+
| <code>frequency</code> | The items cycle size to keep inserting related prompts groups at. | <code>number</code> | <code>24</code> |
|
|
19
|
+
| <code>maxRelatedPromptsPerGroup</code> | The maximum amount of related prompts to add in a single group. | <code>number</code> | <code>4</code> |
|
|
20
|
+
| <code>maxGroups</code> | The maximum number of groups to insert into the injected list items list. | <code>number</code> | <code>undefined</code> |
|
|
21
|
+
| <code>showOnlyAfterOffset</code> | Determines if a group is added to the injected items list in case the number<br />of items is smaller than the offset. | <code>boolean</code> | <code>false</code> |
|
|
22
|
+
|
|
23
|
+
## Events
|
|
24
|
+
|
|
25
|
+
This component emits no events.
|
|
26
|
+
|
|
27
|
+
## See it in action
|
|
28
|
+
|
|
29
|
+
<!-- prettier-ignore-start -->
|
|
30
|
+
|
|
31
|
+
:::warning Backend microservice required To use this component, the <b>QuerySignals</b> microservice
|
|
32
|
+
must be implemented. :::
|
|
33
|
+
|
|
34
|
+
<!-- prettier-ignore-end -->
|
|
35
|
+
|
|
36
|
+
Usually, this component is going to be used together with the `ResultsList` one. Related prompts
|
|
37
|
+
groups will be inserted between the results, guiding users to discover new searches directly from
|
|
38
|
+
the results list.
|
|
39
|
+
|
|
40
|
+
```vue live
|
|
41
|
+
<template>
|
|
42
|
+
<div>
|
|
43
|
+
<SearchInput />
|
|
44
|
+
<ResultsList>
|
|
45
|
+
<RelatedPromptsList />
|
|
46
|
+
</ResultsList>
|
|
47
|
+
</div>
|
|
48
|
+
</template>
|
|
49
|
+
|
|
50
|
+
<script>
|
|
51
|
+
import { RelatedPromptsList } from '@empathyco/x-components/related-prompts';
|
|
52
|
+
import { ResultsList } from '@empathyco/x-components/search';
|
|
53
|
+
import { SearchInput } from '@empathyco/x-components/search-box';
|
|
54
|
+
|
|
55
|
+
export default {
|
|
56
|
+
name: 'RelatedPromptsListDemo',
|
|
57
|
+
components: {
|
|
58
|
+
RelatedPromptsList,
|
|
59
|
+
ResultsList,
|
|
60
|
+
SearchInput
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
</script>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Play with the index that related prompts groups are inserted at
|
|
67
|
+
|
|
68
|
+
The component allows to customise where are the related prompts groups inserted. In the following
|
|
69
|
+
example, the first group of related prompts will be inserted at the index `48` (`offset`), and then
|
|
70
|
+
a second group will be inserted at index `120` because of the `frequency` prop configured to `72`.
|
|
71
|
+
Finally, a third group will be inserted at index `192`. Because `maxGroups` is configured to `3`, no
|
|
72
|
+
more groups will be inserted. Each one of this groups will have up to `6` related prompts
|
|
73
|
+
(`maxRelatedPromptsPerGroup`).
|
|
74
|
+
|
|
75
|
+
```vue live
|
|
76
|
+
<template>
|
|
77
|
+
<div>
|
|
78
|
+
<SearchInput />
|
|
79
|
+
<ResultsList>
|
|
80
|
+
<RelatedPromptsList
|
|
81
|
+
:offset="48"
|
|
82
|
+
:frequency="72"
|
|
83
|
+
:maxRelatedPromptsPerGroup="6"
|
|
84
|
+
:maxGroups="3"
|
|
85
|
+
/>
|
|
86
|
+
</ResultsList>
|
|
87
|
+
</div>
|
|
88
|
+
</template>
|
|
89
|
+
|
|
90
|
+
<script>
|
|
91
|
+
import { RelatedPromptsList } from '@empathyco/x-components/related-prompts';
|
|
92
|
+
import { ResultsList } from '@empathyco/x-components/search';
|
|
93
|
+
import { SearchInput } from '@empathyco/x-components/search-box';
|
|
94
|
+
|
|
95
|
+
export default {
|
|
96
|
+
name: 'RelatedPromptsListDemo',
|
|
97
|
+
components: {
|
|
98
|
+
RelatedPromptsList,
|
|
99
|
+
ResultsList,
|
|
100
|
+
SearchInput
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
</script>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Showing/hiding first related prompts group when no more items
|
|
107
|
+
|
|
108
|
+
By default, the first related prompts group will be inserted when the total number of results is
|
|
109
|
+
smaller than the offset, but this behavior can be deactivated by setting the `showOnlyAfterOffset`
|
|
110
|
+
to `true`.
|
|
111
|
+
|
|
112
|
+
```vue live
|
|
113
|
+
<template>
|
|
114
|
+
<div>
|
|
115
|
+
<SearchInput />
|
|
116
|
+
<ResultsList>
|
|
117
|
+
<RelatedPromptsList
|
|
118
|
+
:offset="48"
|
|
119
|
+
:frequency="72"
|
|
120
|
+
:maxRelatedPromptsPerGroup="1"
|
|
121
|
+
:showOnlyAfterOffset="true"
|
|
122
|
+
/>
|
|
123
|
+
</ResultsList>
|
|
124
|
+
</div>
|
|
125
|
+
</template>
|
|
126
|
+
|
|
127
|
+
<script>
|
|
128
|
+
import { RelatedPromptsList } from '@empathyco/x-components/related-prompts';
|
|
129
|
+
import { ResultsList } from '@empathyco/x-components/search';
|
|
130
|
+
import { SearchInput } from '@empathyco/x-components/search-box';
|
|
131
|
+
|
|
132
|
+
export default {
|
|
133
|
+
name: 'RelatedPromptsListDemo',
|
|
134
|
+
components: {
|
|
135
|
+
RelatedPromptsList,
|
|
136
|
+
ResultsList,
|
|
137
|
+
SearchInput
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
</script>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Customise the layout of the component
|
|
144
|
+
|
|
145
|
+
This component will render by default the `id` of each search item, both the injected, and for the
|
|
146
|
+
groups of related prompts generated, but the common case is to integrate it with another layout
|
|
147
|
+
component, for example the `BaseGrid`. To do so, you can use the `default` slot
|
|
148
|
+
|
|
149
|
+
```vue
|
|
150
|
+
<template>
|
|
151
|
+
<div>
|
|
152
|
+
<SearchInput />
|
|
153
|
+
<ResultsList>
|
|
154
|
+
<RelatedPromptsList
|
|
155
|
+
:offset="48"
|
|
156
|
+
:frequency="72"
|
|
157
|
+
:maxRelatedPromptsPerGroup="6"
|
|
158
|
+
:maxGroups="3"
|
|
159
|
+
#default="{ items }"
|
|
160
|
+
>
|
|
161
|
+
<BaseGrid :items="items" :animation="animation">
|
|
162
|
+
<template #related-prompts-group="{ item }">
|
|
163
|
+
<span v-for="const prompt of items.relatedPrompts">
|
|
164
|
+
RelatedPromptsGroup:
|
|
165
|
+
<pre>{{ prompt }}</pre>
|
|
166
|
+
</span>
|
|
167
|
+
</template>
|
|
168
|
+
<template #result="{ item }">
|
|
169
|
+
<span>Result: {{ item.name }}</span>
|
|
170
|
+
</template>
|
|
171
|
+
<template #default="{ item }">
|
|
172
|
+
<span>Default: {{ item }}</span>
|
|
173
|
+
</template>
|
|
174
|
+
</BaseGrid>
|
|
175
|
+
</RelatedPromptsList>
|
|
176
|
+
</ResultsList>
|
|
177
|
+
</div>
|
|
178
|
+
</template>
|
|
179
|
+
|
|
180
|
+
<script>
|
|
181
|
+
import { RelatedPromptsList } from '@empathyco/x-components/related-prompts';
|
|
182
|
+
import { ResultsList } from '@empathyco/x-components/search';
|
|
183
|
+
import { SearchInput } from '@empathyco/x-components/search-box';
|
|
184
|
+
import { BaseGrid } from '@empathyco/x-components';
|
|
185
|
+
|
|
186
|
+
export default {
|
|
187
|
+
name: 'RelatedPromptsListDemo',
|
|
188
|
+
components: {
|
|
189
|
+
RelatedPromptsLis,
|
|
190
|
+
ResultsList,
|
|
191
|
+
BaseGrid,
|
|
192
|
+
SearchInput
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
</script>
|
|
196
|
+
```
|
package/docs/API-reference/components/related-prompts/x-components.related-prompts-tag-list.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
|
|
3
|
+
title: RelatedPromptsTagList
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# RelatedPromptsTagList
|
|
8
|
+
|
|
9
|
+
This component shows the list of `RelatedPrompts` components.
|
|
10
|
+
|
|
11
|
+
If the default slot is reimplemented in the consumer, `onSelect` function will be necessary to
|
|
12
|
+
handle the selection of the related prompt and to trigger the stagger-fade-slide animation.
|
|
13
|
+
|
|
14
|
+
## Props
|
|
15
|
+
|
|
16
|
+
| Name | Description | Type | Default |
|
|
17
|
+
| ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | ----------------- |
|
|
18
|
+
| <code>buttonClass</code> | The CSS class for the left and right button of the sliding panel. | <code>string</code> | <code></code> |
|
|
19
|
+
| <code>showButtons</code> | The boolean prop to handle the visiblity of sliding pannel buttons. | <code>boolean</code> | <code>true</code> |
|
|
20
|
+
| <code>scrollContainerClass</code> | The CSS class for the wrapper of all the related prompt wrapper elements. | <code>string</code> | <code></code> |
|
|
21
|
+
| <code>tagClass</code> | The CSS class for all the related prompt wrapper elements. | <code>string</code> | <code></code> |
|
|
22
|
+
| <code>tagColors</code> | Array of colors to apply to the related prompts. It will be applied to tag<br />elements cyclically according to their index in the nex way: `tagColors[index % tagColors.length]`. | <code>string[]</code> | <code></code> |
|
|
23
|
+
| <code>animationDurationInMs</code> | The duration of the total animation in milliseconds. | <code>number</code> | <code>700</code> |
|
|
24
|
+
|
|
25
|
+
## Slots
|
|
26
|
+
|
|
27
|
+
| Name | Description | Bindings<br />(name - type - description) |
|
|
28
|
+
| ----------------------------------------- | ------------------------------------------------------------------ | ----------------------------------------- |
|
|
29
|
+
| <code>sliding-panel-left-button</code> | The button to be displayed on the left side of the sliding panel. | None |
|
|
30
|
+
| <code>default</code> | - The slot to render related prompt information. | <br /><br /> |
|
|
31
|
+
| <code>related-prompt-extra-content</code> | | |
|
|
32
|
+
| <code>sliding-panel-right-button</code> | The button to be displayed on the right side of the sliding panel. | None |
|
|
@@ -17,7 +17,7 @@ result bound.
|
|
|
17
17
|
|
|
18
18
|
| Name | Description | Type | Default |
|
|
19
19
|
| ---------------------- | ------------------------------------------------------------- | -------------------------- | ----------------- |
|
|
20
|
-
| <code>animation</code> | Animation component that will be used to animate the results. | <code>
|
|
20
|
+
| <code>animation</code> | Animation component that will be used to animate the results. | <code>AnimationProp</code> | <code>'ul'</code> |
|
|
21
21
|
|
|
22
22
|
## Events
|
|
23
23
|
|
|
@@ -12,13 +12,13 @@ It allows you to activate or deactivate the session id management through the `c
|
|
|
12
12
|
|
|
13
13
|
## Props
|
|
14
14
|
|
|
15
|
-
| Name
|
|
16
|
-
|
|
|
17
|
-
| <code>
|
|
18
|
-
| <code>
|
|
19
|
-
| <code>sessionTTLMs</code>
|
|
20
|
-
| <code>queryTaggingDebounceMs</code>
|
|
21
|
-
| <code>consent</code>
|
|
15
|
+
| Name | Description | Type | Default |
|
|
16
|
+
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------- | ------------------ |
|
|
17
|
+
| <code>storageTTLMs</code> | The TTL in milliseconds for storing the result info. | <code>number</code> | <code>30000</code> |
|
|
18
|
+
| <code>storageKey</code> | The Object key of the @empathyco/x-types#Result clicked or added to the cart by the user<br />that will be used as id for the storage.<br />By default, the Result url will be used. | <code>string</code> | <code>'url'</code> |
|
|
19
|
+
| <code>sessionTTLMs</code> | The session TTL in milliseconds. | <code>number</code> | <code></code> |
|
|
20
|
+
| <code>queryTaggingDebounceMs</code> | The debounce time in milliseconds to track the query. | <code>number</code> | <code>2000</code> |
|
|
21
|
+
| <code>consent</code> | The consent to be emitted. | <code>boolean</code> | <code>null</code> |
|
|
22
22
|
|
|
23
23
|
## Events
|
|
24
24
|
|
|
@@ -53,13 +53,12 @@ doesn't render elements to the DOM.
|
|
|
53
53
|
|
|
54
54
|
In this example, the `Tagging` component will emit `ConsentProvided` with payload false by default
|
|
55
55
|
if the consent is not provided, the `TaggingConfigProvided` event will be emitted only if the props
|
|
56
|
-
`queryTaggingDebounceMs`, `sessionDurationMs`, `
|
|
57
|
-
`clickedResultStorageKey`are defined.
|
|
56
|
+
`queryTaggingDebounceMs`, `sessionDurationMs`, `storageTTLMs` or `storageKey`are defined.
|
|
58
57
|
|
|
59
|
-
Every time the user clicks a result
|
|
60
|
-
browser during 30 seconds which is the default value for the prop
|
|
61
|
-
distinguish the storage information for the different results the product url
|
|
62
|
-
`
|
|
58
|
+
Every time the user clicks a result or adds a result to the cart, the information for the product
|
|
59
|
+
will be stored on the browser during 30 seconds which is the default value for the prop
|
|
60
|
+
`storageTTLMs`. To distinguish the storage information for the different results the product url
|
|
61
|
+
will be used since `storageKey` default value is 'url'.
|
|
63
62
|
|
|
64
63
|
```vue
|
|
65
64
|
<template>
|
|
@@ -78,12 +77,12 @@ distinguish the storage information for the different results the product url wi
|
|
|
78
77
|
</script>
|
|
79
78
|
```
|
|
80
79
|
|
|
81
|
-
In this example, the clicked result information will be stored on the browser
|
|
82
|
-
the product id will be used as storage key
|
|
80
|
+
In this example, the clicked or added to cart result information will be stored on the browser
|
|
81
|
+
during 60 seconds and the product id will be used as storage key
|
|
83
82
|
|
|
84
83
|
```vue
|
|
85
84
|
<template>
|
|
86
|
-
<Tagging :
|
|
85
|
+
<Tagging :storageTTLMs="60000" :storageKey="'id'" />
|
|
87
86
|
</template>
|
|
88
87
|
|
|
89
88
|
<script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _sfc_main from './fade-and-slide.vue2.js';
|
|
2
|
-
import { openBlock, createBlock, TransitionGroup, withCtx,
|
|
2
|
+
import { openBlock, createBlock, TransitionGroup, withCtx, renderSlot } from 'vue';
|
|
3
3
|
import './fade-and-slide.vue3.js';
|
|
4
4
|
import _export_sfc from '../../_virtual/_plugin-vue_export-helper.js';
|
|
5
5
|
|
|
@@ -11,7 +11,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
11
11
|
appear: _ctx.appear
|
|
12
12
|
}, {
|
|
13
13
|
default: withCtx(() => [
|
|
14
|
-
createCommentVNode(" @slot (Required) Transition-group content "),
|
|
15
14
|
renderSlot(_ctx.$slots, "default")
|
|
16
15
|
]),
|
|
17
16
|
_: 3
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fade-and-slide.vue.js","sources":["../../../../src/components/animations/fade-and-slide.vue"],"sourcesContent":["<template>\n <transition-group class=\"x-fade-and-slide\" :name=\"name\" :tag=\"tag\" :appear=\"appear\">\n <!-- @slot (Required) Transition-group content -->\n <slot />\n </transition-group>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent } from 'vue';\n import { useDisableAnimation } from './use-disable-animation';\n\n /**\n * Renders a transition group wrapping the elements passed in the default slot and animating\n * them with a fade and slide animation.\n *\n * @public\n */\n export default defineComponent({\n name: 'FadeAndSlide',\n props: {\n /**\n * HTML Element that the transition-group children will be wrapped in.\n */\n tag: String,\n /**\n * Indicates if the transition must be applied on the initial render of the node.\n */\n appear: {\n type: Boolean,\n default: true\n }\n },\n setup: function () {\n /**\n * The name of the animation.\n */\n const animationName = 'x-fade-and-slide-';\n\n const { name } = useDisableAnimation(animationName);\n\n return { name };\n }\n });\n</script>\n\n<style lang=\"css\">\n .x-fade-and-slide--move,\n .x-fade-and-slide--enter-active,\n .x-fade-and-slide--leave-active {\n transition: opacity 0.2s ease-out, transform 0.3s ease-out;\n }\n\n .x-fade-and-slide--enter-from,\n .x-fade-and-slide--leave-to {\n transform: translate(-20%, 0);\n opacity: 0;\n }\n\n .x-fade-and-slide--leave-active {\n position: absolute;\n }\n</style>\n\n<docs lang=\"mdx\">\n## Examples\n\nThe FadeAndSlide component is intended to be used as a prop in animatable components but also works\nas a wrapper of a transition group that can receive the tag it will render to as a prop.\n\nUsed as a prop in an animatable component:\n\n```vue\n<AnimatableComponent :animation=\"FadeAndSlide\" />\n```\n\nUsed as a regular component passing a the tag as prop:\n\n```vue\n<FadeAndSlide tag=\"ul\">\n <li>Element to animate</li>\n <li>Element to animate</li>\n <li>Element to animate</li>\n</FadeAndSlide>\n```\n</docs>\n"],"names":["name","_createBlock","_TransitionGroup","tag","appear","
|
|
1
|
+
{"version":3,"file":"fade-and-slide.vue.js","sources":["../../../../src/components/animations/fade-and-slide.vue"],"sourcesContent":["<template>\n <transition-group class=\"x-fade-and-slide\" :name=\"name\" :tag=\"tag\" :appear=\"appear\">\n <!-- @slot (Required) Transition-group content -->\n <slot />\n </transition-group>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent } from 'vue';\n import { useDisableAnimation } from './use-disable-animation';\n\n /**\n * Renders a transition group wrapping the elements passed in the default slot and animating\n * them with a fade and slide animation.\n *\n * @public\n */\n export default defineComponent({\n name: 'FadeAndSlide',\n props: {\n /**\n * HTML Element that the transition-group children will be wrapped in.\n */\n tag: String,\n /**\n * Indicates if the transition must be applied on the initial render of the node.\n */\n appear: {\n type: Boolean,\n default: true\n }\n },\n setup: function () {\n /**\n * The name of the animation.\n */\n const animationName = 'x-fade-and-slide-';\n\n const { name } = useDisableAnimation(animationName);\n\n return { name };\n }\n });\n</script>\n\n<style lang=\"css\">\n .x-fade-and-slide--move,\n .x-fade-and-slide--enter-active,\n .x-fade-and-slide--leave-active {\n transition: opacity 0.2s ease-out, transform 0.3s ease-out;\n }\n\n .x-fade-and-slide--enter-from,\n .x-fade-and-slide--leave-to {\n transform: translate(-20%, 0);\n opacity: 0;\n }\n\n .x-fade-and-slide--leave-active {\n position: absolute;\n }\n</style>\n\n<docs lang=\"mdx\">\n## Examples\n\nThe FadeAndSlide component is intended to be used as a prop in animatable components but also works\nas a wrapper of a transition group that can receive the tag it will render to as a prop.\n\nUsed as a prop in an animatable component:\n\n```vue\n<AnimatableComponent :animation=\"FadeAndSlide\" />\n```\n\nUsed as a regular component passing a the tag as prop:\n\n```vue\n<FadeAndSlide tag=\"ul\">\n <li>Element to animate</li>\n <li>Element to animate</li>\n <li>Element to animate</li>\n</FadeAndSlide>\n```\n</docs>\n"],"names":["name","_createBlock","_TransitionGroup","tag","appear","_renderSlot"],"mappings":";;;;;AACyB,SAAA,WAAA,CAAC,IAAkB,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,KAAA,EAAA,QAAA,EAAA;SAAQA,SAAI,EAAA,EAAAC,WAAA,CAAAC,eAAA,EAAA;AAAA,IAAG,KAAKC,EAAAA,kBAAAA;AAAAA,IAAM,MAAM,IAAEC,CAAAA,IAAAA;AAAAA,IAAAA,GAAAA,EAAAA,IAAAA,CAAAA,GAAAA;AAD9E,IAAA,MAAA,EAAA,IAAA,CAAA,MAAA;AAAA,GAAA,EAAA;;AAAA,MAAAC,UAAA,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,CAAA;AAAA,KAAA,CAAA;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _sfc_main from './base-dropdown.vue2.js';
|
|
2
|
-
import { openBlock, createElementBlock, withKeys, withModifiers, normalizeClass, createElementVNode,
|
|
2
|
+
import { openBlock, createElementBlock, withKeys, withModifiers, normalizeClass, createElementVNode, renderSlot, createTextVNode, toDisplayString, createBlock, resolveDynamicComponent, withCtx, withDirectives, Fragment, renderList, vShow } from 'vue';
|
|
3
3
|
import './base-dropdown.vue3.js';
|
|
4
4
|
import _export_sfc from '../_virtual/_plugin-vue_export-helper.js';
|
|
5
5
|
|
|
@@ -32,7 +32,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
32
32
|
"aria-label": _ctx.ariaLabel,
|
|
33
33
|
"aria-autocomplete": "none"
|
|
34
34
|
}, [
|
|
35
|
-
createCommentVNode("\n @slot Used to render the contents of the dropdown toggle button. If not provided, it uses\n the item slot as fallback.\n @binding {string|number|Identifiable} item - The item data to render.\n @binding {boolean} isOpen - True if the dropdown is opened, and false if it is closed.\n "),
|
|
36
35
|
_ctx.hasToggleSlot ? renderSlot(_ctx.$slots, "toggle", {
|
|
37
36
|
key: 0,
|
|
38
37
|
isOpen: _ctx.isOpen,
|
|
@@ -85,7 +84,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
85
84
|
"data-test": "dropdown-item",
|
|
86
85
|
role: "option"
|
|
87
86
|
}, [
|
|
88
|
-
createCommentVNode("\n @slot (required) Used to render each one of the items content, and as fallback\n for the toggle button content slot if it is not provided.\n @binding {string|number|Identifiable} item - Item to render\n @binding {boolean} isHighlighted - True when the item has the focus.\n @binding {boolean} isSelected - True when the item is selected.\n "),
|
|
89
87
|
renderSlot(_ctx.$slots, "item", {
|
|
90
88
|
isHighlighted: index === _ctx.highlightedItemIndex,
|
|
91
89
|
isSelected: item === _ctx.modelValue,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-dropdown.vue.js","sources":["../../../src/components/base-dropdown.vue"],"sourcesContent":["<template>\n <div\n ref=\"rootRef\"\n @keydown=\"updateSearchBuffer\"\n @keydown.down.prevent=\"highlightNextItem\"\n @keydown.up.prevent=\"highlightPreviousItem\"\n :class=\"dropdownCSSClasses\"\n class=\"x-dropdown\"\n >\n <button\n ref=\"toggleButtonRef\"\n @click=\"toggle\"\n @keydown.up.down.prevent.stop=\"open\"\n class=\"x-dropdown__toggle\"\n data-test=\"dropdown-toggle\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n :aria-expanded=\"isOpen.toString()\"\n :aria-controls=\"listId\"\n :aria-label=\"ariaLabel\"\n aria-autocomplete=\"none\"\n >\n <!--\n @slot Used to render the contents of the dropdown toggle button. If not provided, it uses\n the item slot as fallback.\n @binding {string|number|Identifiable} item - The item data to render.\n @binding {boolean} isOpen - True if the dropdown is opened, and false if it is closed.\n -->\n <slot v-if=\"hasToggleSlot\" :isOpen=\"isOpen\" :item=\"modelValue\" name=\"toggle\">\n {{ modelValue }}\n </slot>\n <slot v-else :item=\"modelValue\" name=\"item\">{{ modelValue }}</slot>\n </button>\n\n <component :is=\"animation\">\n <ul\n v-show=\"isOpen\"\n @keydown.end=\"highlightLastItem\"\n @keydown.esc=\"closeAndFocusToggleButton\"\n @keydown.home=\"highlightFirstItem\"\n :id=\"listId\"\n class=\"x-dropdown__items-list\"\n data-test=\"dropdown-list\"\n role=\"listbox\"\n tabindex=\"-1\"\n >\n <li v-for=\"(item, index) in items\" :key=\"item.id || item\" class=\"x-dropdown__list-item\">\n <button\n :ref=\"el => (itemsButtonRefs[index] = el)\"\n @click=\"emitSelectedItemChanged(item)\"\n :aria-selected=\"(item === modelValue).toString()\"\n :class=\"itemsCSSClasses[index]\"\n class=\"x-dropdown__item\"\n data-test=\"dropdown-item\"\n role=\"option\"\n >\n <!--\n @slot (required) Used to render each one of the items content, and as fallback\n for the toggle button content slot if it is not provided.\n @binding {string|number|Identifiable} item - Item to render\n @binding {boolean} isHighlighted - True when the item has the focus.\n @binding {boolean} isSelected - True when the item is selected.\n -->\n <slot\n :isHighlighted=\"index === highlightedItemIndex\"\n :isSelected=\"item === modelValue\"\n :item=\"item\"\n name=\"item\"\n >\n {{ item }}\n </slot>\n </button>\n </li>\n </ul>\n </component>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { Identifiable } from '@empathyco/x-types';\n import { computed, defineComponent, nextTick, onBeforeUnmount, PropType, ref, watch } from 'vue';\n import { AnimationProp } from '../types';\n import { debounceFunction, normalizeString, getTargetElement, isInRange } from '../utils';\n import { NoAnimation } from './animations';\n\n type DropdownItem = string | number | Identifiable;\n let dropdownCount = 0;\n\n /**\n * Dropdown component that mimics a Select element behavior, but with the option\n * to customize the toggle button and each item contents.\n */\n export default defineComponent({\n name: 'BaseDropdown',\n props: {\n /** List of items to display.*/\n items: {\n type: Array as PropType<DropdownItem[]>,\n required: true\n },\n /** The selected item. */\n modelValue: {\n type: null as unknown as PropType<DropdownItem | null>,\n validator: (v: any) =>\n typeof v === 'string' || typeof v === 'number' || typeof v === 'object' || v === null,\n required: true\n },\n /** Description of what the dropdown is used for. */\n ariaLabel: String,\n /**\n * Animation component to use for expanding the dropdown. This is a single element animation,\n * so only `<transition>` components are allowed.\n */\n animation: {\n type: AnimationProp,\n default: () => NoAnimation\n },\n /** Time to wait without receiving any keystroke before resetting the items search query. */\n searchTimeoutMs: {\n type: Number,\n default: 1000\n }\n },\n emits: ['update:modelValue'],\n setup(props, { emit, slots }) {\n const rootRef = ref<HTMLElement>();\n /** The button that opens and closes the list of options. */\n const toggleButtonRef = ref<HTMLButtonElement>();\n /** Array containing the dropdown list buttons HTMLElements. */\n const itemsButtonRefs = ref<HTMLButtonElement[]>([]);\n\n /** Property to check whether the dropdown is expanded or closed. */\n const isOpen = ref(false);\n /** Index of the element that has the focus in the list. -1 means no element has focus. */\n const highlightedItemIndex = ref(-1);\n /** String to search for the first element that starts with it. */\n const searchBuffer = ref('');\n\n /** Resets the search buffer after a certain time has passed. */\n let restartResetSearchTimeout: () => void;\n /* Unique ID to identify the dropdown. */\n const listId = `x-dropdown-${dropdownCount++}`;\n\n /**\n * Dynamic CSS classes to add to the dropdown root element.\n *\n * @returns An object containing the CSS classes to add to the dropdown root element.\n */\n const dropdownCSSClasses = computed(() => ({ 'x-dropdown--is-open': isOpen }));\n\n /**\n * Dynamic CSS classes to add to each one of the items.\n *\n * @returns An object containing the CSS classes to add to each item.\n */\n const itemsCSSClasses = computed(() =>\n props.items.map((item, index) => ({\n 'x-dropdown__item--is-selected': props.modelValue === item,\n 'x-dropdown__item--is-highlighted': highlightedItemIndex.value === index\n }))\n );\n\n /* Opens the dropdown. */\n const open = () => (isOpen.value = true);\n /* Closes the dropdown. */\n const close = () => (isOpen.value = false);\n /* Toggles the dropdown. */\n const toggle = () => (isOpen.value = !isOpen.value);\n\n /**\n * Closes the modal and focuses the toggle button.\n */\n function closeAndFocusToggleButton() {\n close();\n toggleButtonRef.value?.focus();\n }\n\n /**\n * Emits the event that the selected item has changed.\n *\n * @param item - The new selected item.\n */\n function emitSelectedItemChanged(item: DropdownItem) {\n emit('update:modelValue', item);\n closeAndFocusToggleButton();\n }\n\n /**\n * Highlights the item after the one that is currently highlighted.\n */\n function highlightNextItem() {\n open();\n highlightedItemIndex.value = (highlightedItemIndex.value + 1) % props.items.length;\n }\n\n /**\n * Highlights the item before the one that is currently highlighted.\n */\n function highlightPreviousItem() {\n const currentIndex = highlightedItemIndex.value;\n open();\n highlightedItemIndex.value = currentIndex > 0 ? currentIndex - 1 : props.items.length - 1;\n }\n\n /**\n * Highlights the first of the provided items.\n */\n function highlightFirstItem() {\n highlightedItemIndex.value = 0;\n }\n\n /**\n * Highlights the last of the provided items.\n */\n function highlightLastItem() {\n highlightedItemIndex.value = props.items.length - 1;\n }\n\n /**\n * Updates the variable that is used to search in the filters.\n *\n * @param event - The event coming from the user typing.\n */\n function updateSearchBuffer(event: KeyboardEvent) {\n if (/^\\w$/.test(event.key)) {\n const key = event.key;\n searchBuffer.value += key;\n restartResetSearchTimeout();\n }\n }\n\n /**\n * Resets the search buffer.\n */\n function resetSearchBuffer() {\n searchBuffer.value = '';\n }\n\n /**\n * Closes the dropdown if the passed event has happened on an element out of the dropdown.\n *\n * @param event - The event to check if it has happened out of the dropdown component.\n */\n function closeIfEventIsOutOfDropdown(event: MouseEvent | TouchEvent | FocusEvent) {\n if (!rootRef.value?.contains(getTargetElement(event))) {\n close();\n }\n }\n\n /**\n * Adds listeners to the document element to detect if the focus has moved out from the\n * dropdown.\n */\n function addDocumentCloseListeners() {\n document.addEventListener('mousedown', closeIfEventIsOutOfDropdown);\n document.addEventListener('touchstart', closeIfEventIsOutOfDropdown);\n document.addEventListener('focusin', closeIfEventIsOutOfDropdown);\n }\n\n /**\n * Removes the listeners of the document element to detect if the focus has moved out from the\n * dropdown.\n */\n function removeDocumentCloseListeners() {\n document.removeEventListener('mousedown', closeIfEventIsOutOfDropdown);\n document.removeEventListener('touchstart', closeIfEventIsOutOfDropdown);\n document.removeEventListener('focusin', closeIfEventIsOutOfDropdown);\n }\n\n /**\n * Highlights the item that matches the search buffer. To do so it checks the list buttons\n * text content. It highlights items following this priority:\n * - If an element is already highlighted, it starts searching from that element.\n * - If no element is found starting from the previously highlighted, it returns the first one.\n * - If no element is found matching the search query it highlights the first element.\n *\n * @param search - The search string to find in the HTML.\n */\n watch(searchBuffer, search => {\n if (search) {\n const normalizedSearch = normalizeString(search);\n const matchingIndices = itemsButtonRefs?.value?.reduce<number[]>(\n (matchingIndices, button, index) => {\n const safeButtonWordCharacters = button.textContent!.replace(/[^\\w]/g, '');\n const normalizedButtonText = normalizeString(safeButtonWordCharacters);\n if (normalizedButtonText.startsWith(normalizedSearch)) {\n matchingIndices.push(index);\n }\n return matchingIndices;\n },\n []\n );\n highlightedItemIndex.value =\n // First matching item starting to search from the current highlighted element\n matchingIndices?.find(index => index >= highlightedItemIndex.value) ??\n // First matching item\n matchingIndices?.[0] ??\n // First item\n 0;\n }\n });\n\n /**\n * Updates the debounced function to reset the search.\n *\n * @param searchTimeoutMs - The new milliseconds that have to pass without typing before\n * resetting the search.\n */\n watch(\n () => props.searchTimeoutMs,\n searchTimeoutMs => {\n restartResetSearchTimeout = debounceFunction(resetSearchBuffer, searchTimeoutMs);\n },\n { immediate: true }\n );\n\n /**\n * Focuses the DOM element which matches the `highlightedItemIndex`.\n *\n * @param highlightedItemIndex - The index of the HTML element to focus.\n */\n watch(\n highlightedItemIndex,\n highlightedItemIndex => {\n nextTick(() => {\n if (itemsButtonRefs && isInRange(highlightedItemIndex, [0, props.items.length - 1])) {\n const newItem = itemsButtonRefs?.value?.[highlightedItemIndex];\n newItem?.focus();\n }\n });\n },\n { immediate: true }\n );\n\n /**\n * When the dropdown is open it sets the focused element to the one that is selected.\n *\n * @param isOpen - True if the dropdown is open, false otherwise.\n */\n watch(isOpen, isOpen => {\n highlightedItemIndex.value = isOpen\n ? props.modelValue === null\n ? 0\n : props.items.indexOf(props.modelValue)\n : -1;\n });\n\n /**\n * Adds and removes listeners to close the dropdown when it loses the focus.\n *\n * @param isOpen - True if the dropdown is open, false otherwise.\n */\n watch(isOpen, isOpen => {\n /*\n * Because there is an issue with Firefox in macOS and Safari that doesn't focus the target\n * element of the `mousedown` events, the `focusout` event `relatedTarget` property can't be\n * used to detect whether the user has blurred the dropdown. The hack here is to use\n * document listeners that have the side effect of losing the focus.\n */\n if (isOpen) {\n addDocumentCloseListeners();\n } else {\n removeDocumentCloseListeners();\n }\n });\n\n /**\n * If the dropdown is destroyed before removing the document listeners, it ensures that they\n * are removed too.\n */\n onBeforeUnmount(() => {\n removeDocumentCloseListeners();\n });\n\n return {\n hasToggleSlot: !!slots.toggle,\n closeAndFocusToggleButton,\n dropdownCSSClasses,\n emitSelectedItemChanged,\n highlightFirstItem,\n highlightLastItem,\n highlightNextItem,\n highlightPreviousItem,\n highlightedItemIndex,\n isOpen,\n itemsButtonRefs,\n itemsCSSClasses,\n listId,\n open,\n rootRef,\n toggle,\n toggleButtonRef,\n updateSearchBuffer\n };\n }\n });\n</script>\n\n<style lang=\"css\" scoped>\n .x-dropdown {\n position: relative;\n }\n\n .x-dropdown__items-list {\n z-index: 1;\n list-style: none;\n position: absolute;\n padding: 0;\n margin: 0;\n top: calc(100% + var(--x-size-gap-dropdown-default, 0));\n }\n</style>\n\n<docs lang=\"mdx\">\n## Example\n\nThe `Dropdown` component is a simple yet customizable select component. The component needs to work\nthe list of items available to select, which are passed using the `items` prop, and the selected\nitem, which is passed in using the `value` prop.\n\nThe supported items must be an array that can contain unique strings, unique numbers, or objects\nwith a unique `id` property.\n\nThe content of each item can be customized using the `item` slot, which apart from the data of the\nitem, it also receives via prop if the element is selected or highlighted.\n\nThere `toggle` slot can be used to customize the button that opens the dropdown. If this is not\nprovided, the `item` slot will be used for that.\n\n```vue\n<template>\n <BaseDropdown v-model=\"value\" :items=\"items\">\n <template #toggle=\"{ item, isOpen }\">{{ item }} {{ isOpen ? '🔼' : '🔽' }}️</template>\n\n <template #item=\"{ item, isSelected, isHighlighted }\">\n <span v-if=\"isHighlighted\">🟢</span>\n <span v-if=\"isSelected\">✅</span>\n <span>{{ item }}</span>\n </template>\n </BaseDropdown>\n</template>\n\n<script>\n import { BaseDropdown } from '@empathyco/x-components';\n\n export default {\n name: 'DropdownTest',\n components: {\n BaseDropdown\n },\n data() {\n return {\n items: ['a', 2, { id: '3' }],\n value: 'a'\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":["_openBlock","_createElementBlock","_withKeys","_withModifiers","dropdownCSSClasses","_normalizeClass","_createElementVNode","listId","ariaLabel","hasToggleSlot","_createCommentVNode","isOpen","_createTextVNode","_toDisplayString","modelValue","_createBlock","_resolveDynamicComponent","_withCtx","_withDirectives","_Fragment","_renderList","itemsButt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vue"],"sourcesContent":["<template>\n <div\n ref=\"rootRef\"\n @keydown=\"updateSearchBuffer\"\n @keydown.down.prevent=\"highlightNextItem\"\n @keydown.up.prevent=\"highlightPreviousItem\"\n :class=\"dropdownCSSClasses\"\n class=\"x-dropdown\"\n >\n <button\n ref=\"toggleButtonRef\"\n @click=\"toggle\"\n @keydown.up.down.prevent.stop=\"open\"\n class=\"x-dropdown__toggle\"\n data-test=\"dropdown-toggle\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n :aria-expanded=\"isOpen.toString()\"\n :aria-controls=\"listId\"\n :aria-label=\"ariaLabel\"\n aria-autocomplete=\"none\"\n >\n <!--\n @slot Used to render the contents of the dropdown toggle button. If not provided, it uses\n the item slot as fallback.\n @binding {string|number|Identifiable} item - The item data to render.\n @binding {boolean} isOpen - True if the dropdown is opened, and false if it is closed.\n -->\n <slot v-if=\"hasToggleSlot\" :isOpen=\"isOpen\" :item=\"modelValue\" name=\"toggle\">\n {{ modelValue }}\n </slot>\n <slot v-else :item=\"modelValue\" name=\"item\">{{ modelValue }}</slot>\n </button>\n\n <component :is=\"animation\">\n <ul\n v-show=\"isOpen\"\n @keydown.end=\"highlightLastItem\"\n @keydown.esc=\"closeAndFocusToggleButton\"\n @keydown.home=\"highlightFirstItem\"\n :id=\"listId\"\n class=\"x-dropdown__items-list\"\n data-test=\"dropdown-list\"\n role=\"listbox\"\n tabindex=\"-1\"\n >\n <li v-for=\"(item, index) in items\" :key=\"item.id || item\" class=\"x-dropdown__list-item\">\n <button\n :ref=\"el => (itemsButtonRefs[index] = el)\"\n @click=\"emitSelectedItemChanged(item)\"\n :aria-selected=\"(item === modelValue).toString()\"\n :class=\"itemsCSSClasses[index]\"\n class=\"x-dropdown__item\"\n data-test=\"dropdown-item\"\n role=\"option\"\n >\n <!--\n @slot (required) Used to render each one of the items content, and as fallback\n for the toggle button content slot if it is not provided.\n @binding {string|number|Identifiable} item - Item to render\n @binding {boolean} isHighlighted - True when the item has the focus.\n @binding {boolean} isSelected - True when the item is selected.\n -->\n <slot\n :isHighlighted=\"index === highlightedItemIndex\"\n :isSelected=\"item === modelValue\"\n :item=\"item\"\n name=\"item\"\n >\n {{ item }}\n </slot>\n </button>\n </li>\n </ul>\n </component>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { Identifiable } from '@empathyco/x-types';\n import { computed, defineComponent, nextTick, onBeforeUnmount, PropType, ref, watch } from 'vue';\n import { AnimationProp } from '../types';\n import { debounceFunction, normalizeString, getTargetElement } from '../utils';\n import { NoAnimation } from './animations';\n\n type DropdownItem = string | number | Identifiable;\n let dropdownCount = 0;\n\n /**\n * Dropdown component that mimics a Select element behavior, but with the option\n * to customize the toggle button and each item contents.\n */\n export default defineComponent({\n name: 'BaseDropdown',\n props: {\n /** List of items to display.*/\n items: {\n type: Array as PropType<DropdownItem[]>,\n required: true\n },\n /** The selected item. */\n modelValue: {\n type: null as unknown as PropType<DropdownItem | null>,\n validator: (v: any) =>\n typeof v === 'string' || typeof v === 'number' || typeof v === 'object' || v === null,\n required: true\n },\n /** Description of what the dropdown is used for. */\n ariaLabel: String,\n /**\n * Animation component to use for expanding the dropdown. This is a single element animation,\n * so only `<transition>` components are allowed.\n */\n animation: {\n type: AnimationProp,\n default: () => NoAnimation\n },\n /** Time to wait without receiving any keystroke before resetting the items search query. */\n searchTimeoutMs: {\n type: Number,\n default: 1000\n }\n },\n emits: ['update:modelValue'],\n setup(props, { emit, slots }) {\n const rootRef = ref<HTMLElement>();\n /** The button that opens and closes the list of options. */\n const toggleButtonRef = ref<HTMLButtonElement>();\n /** Array containing the dropdown list buttons HTMLElements. */\n const itemsButtonRefs = ref<HTMLButtonElement[]>([]);\n\n /** Property to check whether the dropdown is expanded or closed. */\n const isOpen = ref(false);\n /** Index of the element that has the focus in the list. -1 means no element has focus. */\n const highlightedItemIndex = ref(-1);\n /** String to search for the first element that starts with it. */\n const searchBuffer = ref('');\n\n /** Resets the search buffer after a certain time has passed. */\n let restartResetSearchTimeout: () => void;\n /* Unique ID to identify the dropdown. */\n const listId = `x-dropdown-${dropdownCount++}`;\n\n /**\n * Dynamic CSS classes to add to the dropdown root element.\n *\n * @returns An object containing the CSS classes to add to the dropdown root element.\n */\n const dropdownCSSClasses = computed(() => ({ 'x-dropdown--is-open': isOpen }));\n\n /**\n * Dynamic CSS classes to add to each one of the items.\n *\n * @returns An object containing the CSS classes to add to each item.\n */\n const itemsCSSClasses = computed(() =>\n props.items.map((item, index) => ({\n 'x-dropdown__item--is-selected': props.modelValue === item,\n 'x-dropdown__item--is-highlighted': highlightedItemIndex.value === index\n }))\n );\n\n /* Opens the dropdown. */\n const open = () => (isOpen.value = true);\n /* Closes the dropdown. */\n const close = () => (isOpen.value = false);\n /* Toggles the dropdown. */\n const toggle = () => (isOpen.value = !isOpen.value);\n\n /**\n * Closes the modal and focuses the toggle button.\n */\n function closeAndFocusToggleButton() {\n close();\n toggleButtonRef.value?.focus();\n }\n\n /**\n * Emits the event that the selected item has changed.\n *\n * @param item - The new selected item.\n */\n function emitSelectedItemChanged(item: DropdownItem) {\n emit('update:modelValue', item);\n closeAndFocusToggleButton();\n }\n\n /**\n * Highlights the item after the one that is currently highlighted.\n */\n function highlightNextItem() {\n open();\n highlightedItemIndex.value = (highlightedItemIndex.value + 1) % props.items.length;\n }\n\n /**\n * Highlights the item before the one that is currently highlighted.\n */\n function highlightPreviousItem() {\n const currentIndex = highlightedItemIndex.value;\n open();\n highlightedItemIndex.value = currentIndex > 0 ? currentIndex - 1 : props.items.length - 1;\n }\n\n /**\n * Highlights the first of the provided items.\n */\n function highlightFirstItem() {\n highlightedItemIndex.value = 0;\n }\n\n /**\n * Highlights the last of the provided items.\n */\n function highlightLastItem() {\n highlightedItemIndex.value = props.items.length - 1;\n }\n\n /**\n * Updates the variable that is used to search in the filters.\n *\n * @param event - The event coming from the user typing.\n */\n function updateSearchBuffer(event: KeyboardEvent) {\n if (/^\\w$/.test(event.key)) {\n const key = event.key;\n searchBuffer.value += key;\n restartResetSearchTimeout();\n }\n }\n\n /**\n * Resets the search buffer.\n */\n function resetSearchBuffer() {\n searchBuffer.value = '';\n }\n\n /**\n * Closes the dropdown if the passed event has happened on an element out of the dropdown.\n *\n * @param event - The event to check if it has happened out of the dropdown component.\n */\n function closeIfEventIsOutOfDropdown(event: MouseEvent | TouchEvent | FocusEvent) {\n if (!rootRef.value?.contains(getTargetElement(event))) {\n close();\n }\n }\n\n /**\n * Adds listeners to the document element to detect if the focus has moved out from the\n * dropdown.\n */\n function addDocumentCloseListeners() {\n document.addEventListener('mousedown', closeIfEventIsOutOfDropdown);\n document.addEventListener('touchstart', closeIfEventIsOutOfDropdown);\n document.addEventListener('focusin', closeIfEventIsOutOfDropdown);\n }\n\n /**\n * Removes the listeners of the document element to detect if the focus has moved out from the\n * dropdown.\n */\n function removeDocumentCloseListeners() {\n document.removeEventListener('mousedown', closeIfEventIsOutOfDropdown);\n document.removeEventListener('touchstart', closeIfEventIsOutOfDropdown);\n document.removeEventListener('focusin', closeIfEventIsOutOfDropdown);\n }\n\n /**\n * Highlights the item that matches the search buffer. To do so it checks the list buttons\n * text content. It highlights items following this priority:\n * - If an element is already highlighted, it starts searching from that element.\n * - If no element is found starting from the previously highlighted, it returns the first one.\n * - If no element is found matching the search query it highlights the first element.\n *\n * @param search - The search string to find in the HTML.\n */\n watch(searchBuffer, search => {\n if (search) {\n const normalizedSearch = normalizeString(search);\n const matchingIndices = itemsButtonRefs?.value?.reduce<number[]>(\n (matchingIndices, button, index) => {\n const safeButtonWordCharacters = button.textContent!.replace(/[^\\w]/g, '');\n const normalizedButtonText = normalizeString(safeButtonWordCharacters);\n if (normalizedButtonText.startsWith(normalizedSearch)) {\n matchingIndices.push(index);\n }\n return matchingIndices;\n },\n []\n );\n highlightedItemIndex.value =\n // First matching item starting to search from the current highlighted element\n matchingIndices?.find(index => index >= highlightedItemIndex.value) ??\n // First matching item\n matchingIndices?.[0] ??\n // First item\n 0;\n }\n });\n\n /**\n * Updates the debounced function to reset the search.\n *\n * @param searchTimeoutMs - The new milliseconds that have to pass without typing before\n * resetting the search.\n */\n watch(\n () => props.searchTimeoutMs,\n searchTimeoutMs => {\n restartResetSearchTimeout = debounceFunction(resetSearchBuffer, searchTimeoutMs);\n },\n { immediate: true }\n );\n\n /**\n * Focuses the DOM element which matches the `highlightedItemIndex`.\n *\n * @param highlightedItemIndex - The index of the HTML element to focus.\n */\n watch(\n highlightedItemIndex,\n highlightedItemIndex => {\n nextTick(() => itemsButtonRefs.value[highlightedItemIndex]?.focus());\n },\n { immediate: true }\n );\n\n /**\n * When the dropdown is open it sets the focused element to the one that is selected.\n *\n * @param isOpen - True if the dropdown is open, false otherwise.\n */\n watch(isOpen, isOpen => {\n highlightedItemIndex.value = isOpen\n ? props.modelValue === null\n ? 0\n : props.items.indexOf(props.modelValue)\n : -1;\n });\n\n /**\n * Adds and removes listeners to close the dropdown when it loses the focus.\n *\n * @param isOpen - True if the dropdown is open, false otherwise.\n */\n watch(isOpen, isOpen => {\n /*\n * Because there is an issue with Firefox in macOS and Safari that doesn't focus the target\n * element of the `mousedown` events, the `focusout` event `relatedTarget` property can't be\n * used to detect whether the user has blurred the dropdown. The hack here is to use\n * document listeners that have the side effect of losing the focus.\n */\n if (isOpen) {\n addDocumentCloseListeners();\n } else {\n removeDocumentCloseListeners();\n }\n });\n\n /**\n * If the dropdown is destroyed before removing the document listeners, it ensures that they\n * are removed too.\n */\n onBeforeUnmount(() => {\n removeDocumentCloseListeners();\n });\n\n return {\n hasToggleSlot: !!slots.toggle,\n closeAndFocusToggleButton,\n dropdownCSSClasses,\n emitSelectedItemChanged,\n highlightFirstItem,\n highlightLastItem,\n highlightNextItem,\n highlightPreviousItem,\n highlightedItemIndex,\n isOpen,\n itemsButtonRefs,\n itemsCSSClasses,\n listId,\n open,\n rootRef,\n toggle,\n toggleButtonRef,\n updateSearchBuffer\n };\n }\n });\n</script>\n\n<style lang=\"css\" scoped>\n .x-dropdown {\n position: relative;\n }\n\n .x-dropdown__items-list {\n z-index: 1;\n list-style: none;\n position: absolute;\n padding: 0;\n margin: 0;\n top: calc(100% + var(--x-size-gap-dropdown-default, 0));\n }\n</style>\n\n<docs lang=\"mdx\">\n## Example\n\nThe `Dropdown` component is a simple yet customizable select component. The component needs to work\nthe list of items available to select, which are passed using the `items` prop, and the selected\nitem, which is passed in using the `value` prop.\n\nThe supported items must be an array that can contain unique strings, unique numbers, or objects\nwith a unique `id` property.\n\nThe content of each item can be customized using the `item` slot, which apart from the data of the\nitem, it also receives via prop if the element is selected or highlighted.\n\nThere `toggle` slot can be used to customize the button that opens the dropdown. If this is not\nprovided, the `item` slot will be used for that.\n\n```vue\n<template>\n <BaseDropdown v-model=\"value\" :items=\"items\">\n <template #toggle=\"{ item, isOpen }\">{{ item }} {{ isOpen ? '🔼' : '🔽' }}️</template>\n\n <template #item=\"{ item, isSelected, isHighlighted }\">\n <span v-if=\"isHighlighted\">🟢</span>\n <span v-if=\"isSelected\">✅</span>\n <span>{{ item }}</span>\n </template>\n </BaseDropdown>\n</template>\n\n<script>\n import { BaseDropdown } from '@empathyco/x-components';\n\n export default {\n name: 'DropdownTest',\n components: {\n BaseDropdown\n },\n data() {\n return {\n items: ['a', 2, { id: '3' }],\n value: 'a'\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":["_openBlock","_createElementBlock","_withKeys","_withModifiers","dropdownCSSClasses","_normalizeClass","_createElementVNode","listId","ariaLabel","_renderSlot","isOpen","_createTextVNode","_toDisplayString","modelValue","_createBlock","_resolveDynamicComponent","_withCtx","_withDirectives","_Fragment","_renderList","itemsButtonRefs","itemsCSSClasses"],"mappings":";;;;;AAAA,MAAA,UAAA,GAAA,CAAA,eAAA,EAAA,eAAA,EAAA,YAAA,CAAA,CAAA;;;SAEQ,WAAS,CAAA,IAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,KAAA,EAAA,QAAA,EAAA;SACZA,SAAO,EAAA,EAAAC,kBAAA;AAAA,IAAA,KAAA;AAAA,IAAA;AAAA,MA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AYP,KAAU,CAAA,GAAA,EAAA;AAAA,oBACnC,OAAA,EAnDb,CAmDoBQ,MAAAA,KAAAA,IAAAA,CAAAA,uBAAAA,CAAgB,IAClB,CAAA;AAAA,oBACN,kBAAU,IAAe,KAAA,IAAA,CAAA,UAAA,EAAA,QAAA,EAAA;AAAA,oBACzB,OAAKhB,cAAQ,CAAA,CAAA,IAAA,CAAA,eAAA,CAAA,KAAA,CAAA,EAAA,kBAAA,CAAA,CAAA;AAAA,oBAAA,WAAA,EAAA,eAAA;AASb,oBAAA,IAAA,EAAA,QAAA;AAAA,mBAAA,EAAA;AAEa,oBAAAI,UAAA,CAAA,IAAA,CAAE,MAASI,EAAAA,MAAAA,EAAAA;AAAAA,sBACrB,aAAU,EAAA,KAAA,KAAA,IAAA,CAAA,oBAAA;AAAA,sBAIN,UAAA,EAAA,IAAA,KAAA,IAAA,CAAA,UAAA;AAAA,sBAtEnB,IAAA;AAAA,qBAAA,EAAA,MAAA;;AAAA,wBAAAD,eAAA,CAAA,IAAA,CAAA;AAAA,wBAAA,CAAA;AAAA;AAAA,uBAAA;AAAA,qBAAA,EAAA,IAAA,CAAA;;;;;;AAoCsB,aAAA;AAAA,WAAA,EAAA,EAAA,EAAA,UAAA,CAAA,EAAA;;AApCtB,WAAA,CAAA;AAAA,SAAA,CAAA;;;;;;;;;;;;;"}
|
|
@@ -3,7 +3,6 @@ import { AnimationProp } from '../types/animation-prop.js';
|
|
|
3
3
|
import { debounce } from '../utils/debounce.js';
|
|
4
4
|
import { getTargetElement } from '../utils/html.js';
|
|
5
5
|
import { normalizeString } from '../utils/normalize.js';
|
|
6
|
-
import { isInRange } from '../utils/number.js';
|
|
7
6
|
import '../utils/storage.js';
|
|
8
7
|
import './animations/animate-width.vue2.js';
|
|
9
8
|
import './animations/animate-width.vue3.js';
|
|
@@ -230,12 +229,7 @@ var _sfc_main = defineComponent({
|
|
|
230
229
|
* @param highlightedItemIndex - The index of the HTML element to focus.
|
|
231
230
|
*/
|
|
232
231
|
watch(highlightedItemIndex, highlightedItemIndex => {
|
|
233
|
-
nextTick(() =>
|
|
234
|
-
if (itemsButtonRefs && isInRange(highlightedItemIndex, [0, props.items.length - 1])) {
|
|
235
|
-
const newItem = itemsButtonRefs?.value?.[highlightedItemIndex];
|
|
236
|
-
newItem?.focus();
|
|
237
|
-
}
|
|
238
|
-
});
|
|
232
|
+
nextTick(() => itemsButtonRefs.value[highlightedItemIndex]?.focus());
|
|
239
233
|
}, { immediate: true });
|
|
240
234
|
/**
|
|
241
235
|
* When the dropdown is open it sets the focused element to the one that is selected.
|