@empathyco/x-components 3.0.0-alpha.27 → 3.0.0-alpha.30
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 +133 -0
- package/core/index.js +9 -9
- package/core/index.js.map +1 -1
- package/design-system/badge-default.css +2 -5
- package/design-system/base.css +10 -1
- package/design-system/button-default.css +6 -11
- package/design-system/default-theme.css +229 -291
- package/design-system/dropdown-default.css +21 -38
- package/design-system/dropdown-line.css +10 -0
- package/design-system/facet-default.css +11 -22
- package/design-system/filter-default.css +10 -19
- package/design-system/filter-hierarchical.css +6 -10
- package/design-system/full-theme.css +1767 -1171
- package/design-system/grid-default.css +2 -1
- package/design-system/icon-default.css +3 -7
- package/design-system/input-default.css +6 -22
- package/design-system/input-group-default.css +18 -46
- package/design-system/input-group-line.css +6 -10
- package/design-system/list-default.css +31 -63
- package/design-system/message-default.css +57 -0
- package/design-system/option-list-default.css +3 -5
- package/design-system/picture-default.css +1 -2
- package/design-system/picture-fixed-ratio.css +6 -10
- package/design-system/progress-bar-progress-bar.css +23 -0
- package/design-system/row-default.css +1 -2
- package/design-system/sliding-panel-default.css +1 -2
- package/design-system/suggestion-default.css +9 -17
- package/design-system/suggestion-group-default.css +9 -17
- package/design-system/tag-default.css +6 -11
- package/design-system/utilities-border-radius.css +860 -312
- package/design-system/utilities-dev-mode.css +11 -0
- package/design-system/utilities-font-weight.css +8 -0
- package/design-system/utilities-margin.css +318 -268
- package/design-system/utilities-padding.css +308 -250
- package/docs/API-reference/api/x-adapter.empathybannermapper._constructor_.md +2 -2
- package/docs/API-reference/api/x-adapter.empathypromotedmapper._constructor_.md +2 -2
- package/docs/API-reference/api/x-adapter.empathyredirectionmapper._constructor_.md +2 -2
- package/docs/API-reference/api/x-adapter.empathyresultmapper._constructor_.md +2 -2
- package/docs/API-reference/api/x-adapter.empathytaggingmapper.map.md +3 -3
- package/docs/API-reference/api/x-adapter.empathytaggingmapper.md +2 -2
- package/docs/API-reference/api/x-adapter.searchresponse.md +1 -1
- package/docs/API-reference/api/x-adapter.searchresponse.querytagging.md +1 -1
- package/docs/API-reference/api/x-adapter.trackableshowresponse.md +1 -1
- package/docs/API-reference/api/x-adapter.trackableshowresponse.showtagging.md +1 -1
- package/docs/API-reference/api/x-components.autoprogressbar.durationinseconds.md +13 -0
- package/docs/API-reference/api/x-components.autoprogressbar.isloading.md +13 -0
- package/docs/API-reference/api/x-components.autoprogressbar.md +22 -0
- package/docs/API-reference/api/x-components.baseresultlink.md +0 -11
- package/docs/API-reference/api/x-components.basescroll.md +0 -12
- package/docs/API-reference/api/x-components.basesuggestion.emitevents.md +17 -0
- package/docs/API-reference/api/x-components.basesuggestion.feature.md +13 -0
- package/docs/API-reference/api/x-components.basesuggestion.md +8 -1
- package/docs/API-reference/api/x-components.clearpendingscrolltowire.md +13 -0
- package/docs/API-reference/api/x-components.defaultfacetsservice.updatefiltersselectedstate.md +1 -1
- package/docs/API-reference/api/x-components.defaultsessionservice._constructor_.md +21 -0
- package/docs/API-reference/api/x-components.defaultsessionservice.clearsessionid.md +15 -0
- package/docs/API-reference/api/x-components.defaultsessionservice.getsessionid.md +15 -0
- package/docs/API-reference/api/x-components.defaultsessionservice.instance.md +13 -0
- package/docs/API-reference/api/x-components.defaultsessionservice.md +37 -0
- package/docs/API-reference/api/x-components.defaultsessionservice.session_id_key.md +11 -0
- package/docs/API-reference/api/x-components.defaultsessionservice.storageservice.md +11 -0
- package/docs/API-reference/api/x-components.defaultsessionservice.ttlms.md +11 -0
- package/docs/API-reference/api/x-components.extraparams.md +2 -0
- package/docs/API-reference/api/x-components.extraparams.mounted.md +17 -0
- package/docs/API-reference/api/x-components.extraparams.storeextraparams.md +13 -0
- package/docs/API-reference/api/x-components.extraparamsxevents.extraparamschanged.md +2 -0
- package/docs/API-reference/api/x-components.extraparamsxevents.extraparamsinitialized.md +13 -0
- package/docs/API-reference/api/x-components.extraparamsxevents.extraparamsprovided.md +2 -0
- package/docs/API-reference/api/x-components.extraparamsxevents.md +4 -3
- package/docs/API-reference/api/x-components.extraparamsxevents.userchangedextraparams.md +2 -0
- package/docs/API-reference/api/x-components.featurelocation.md +22 -0
- package/docs/API-reference/api/x-components.identifierresults.md +1 -0
- package/docs/API-reference/api/x-components.identifierresults.resultclickextraevents.md +13 -0
- package/docs/API-reference/api/x-components.identifierresultsactions.md +1 -0
- package/docs/API-reference/api/x-components.identifierresultsactions.saveorigin.md +24 -0
- package/docs/API-reference/api/x-components.identifierresultsmutations.md +1 -0
- package/docs/API-reference/api/x-components.identifierresultsmutations.setorigin.md +24 -0
- package/docs/API-reference/api/x-components.identifierresultsstate.md +1 -0
- package/docs/API-reference/api/x-components.identifierresultsstate.origin.md +13 -0
- package/docs/API-reference/api/x-components.locationprovider.location.md +13 -0
- package/docs/API-reference/api/x-components.locationprovider.md +21 -0
- package/docs/API-reference/api/x-components.mainscroll.margin.md +13 -0
- package/docs/API-reference/api/x-components.mainscroll.md +33 -0
- package/docs/API-reference/api/{x-components.basemainscroll.mounted.md → x-components.mainscroll.mounted.md} +4 -2
- package/docs/API-reference/api/x-components.mainscroll.restorescrolltimeoutms.md +13 -0
- package/docs/API-reference/api/x-components.mainscroll.threshold.md +13 -0
- package/docs/API-reference/api/x-components.mainscroll.usewindow.md +13 -0
- package/docs/API-reference/api/x-components.mainscroll.visibleelementsobserver.md +13 -0
- package/docs/API-reference/api/x-components.mainscrollitem._el.md +13 -0
- package/docs/API-reference/api/x-components.mainscrollitem.item.md +13 -0
- package/docs/API-reference/api/x-components.mainscrollitem.md +29 -0
- package/docs/API-reference/api/x-components.mainscrollitem.observeitem.md +25 -0
- package/docs/API-reference/api/x-components.mainscrollitem.tag.md +13 -0
- package/docs/API-reference/api/x-components.md +48 -11
- package/docs/API-reference/api/x-components.multicolumnmaxwidthlayout.md +2 -3
- package/docs/API-reference/api/{x-components.partialquerybutton.events.md → x-components.partialquerybutton.emitevents.md} +8 -4
- package/docs/API-reference/api/x-components.partialquerybutton.md +6 -1
- package/docs/API-reference/api/x-components.queryfeature.md +13 -0
- package/docs/API-reference/api/x-components.queryorigin.md +4 -2
- package/docs/API-reference/api/x-components.queryorigininit.md +15 -0
- package/docs/API-reference/api/x-components.redirection.abortredirect.md +17 -0
- package/docs/API-reference/api/x-components.redirection.delayinseconds.md +18 -0
- package/docs/API-reference/api/x-components.redirection.isredirecting.md +13 -0
- package/docs/API-reference/api/x-components.redirection.md +31 -0
- package/docs/API-reference/api/x-components.redirection.mode.md +13 -0
- package/docs/API-reference/api/x-components.redirection.redirect.md +17 -0
- package/docs/API-reference/api/x-components.redirection.redirections.md +11 -0
- package/docs/API-reference/api/x-components.relatedtag.emitevents.md +17 -0
- package/docs/API-reference/api/x-components.relatedtag.md +6 -0
- package/docs/API-reference/api/x-components.renderlessextraparams.md +2 -3
- package/docs/API-reference/api/{x-components.renderlessextraparams.defaultvalue.md → x-components.renderlessextraparams.stateparams.md} +4 -4
- package/docs/API-reference/api/x-components.requeststatus.md +1 -1
- package/docs/API-reference/api/x-components.resultfeature.md +13 -0
- package/docs/API-reference/api/x-components.resultorigin.md +15 -0
- package/docs/API-reference/api/x-components.saveidentifierresultsoriginwire.md +13 -0
- package/docs/API-reference/api/x-components.saveorigin.md +13 -0
- package/docs/API-reference/api/{x-components.setorigin.md → x-components.saveoriginwire.md} +3 -3
- package/docs/API-reference/api/{x-components.baseidscroll.distancetobottom.md → x-components.scroll.distancetobottom.md} +2 -2
- package/docs/API-reference/api/{x-components.baseidscroll.id.md → x-components.scroll.id.md} +2 -2
- package/docs/API-reference/api/x-components.scroll.md +23 -0
- package/docs/API-reference/api/{x-components.baseidscroll.throttlems.md → x-components.scroll.throttlems.md} +2 -2
- package/docs/API-reference/api/{x-components.urlstate.params.md → x-components.scrollactions.md} +5 -3
- package/docs/API-reference/api/x-components.scrollcomponentstate.direction.md +13 -0
- package/docs/API-reference/api/x-components.scrollcomponentstate.hasalmostreachedend.md +13 -0
- package/docs/API-reference/api/x-components.scrollcomponentstate.hasreachedend.md +13 -0
- package/docs/API-reference/api/x-components.scrollcomponentstate.hasreachedstart.md +13 -0
- package/docs/API-reference/api/x-components.scrollcomponentstate.md +24 -0
- package/docs/API-reference/api/x-components.scrollcomponentstate.position.md +13 -0
- package/docs/API-reference/api/x-components.scrollgetters.md +13 -0
- package/docs/API-reference/api/x-components.scrollmixin._el.md +13 -0
- package/docs/API-reference/api/x-components.scrollmixin.firstelementthresholdpx.md +13 -0
- package/docs/API-reference/api/x-components.scrollmixin.md +3 -0
- package/docs/API-reference/api/x-components.scrollmixin.resetonchange.md +13 -0
- package/docs/API-reference/api/x-components.scrollmutations.md +21 -0
- package/docs/API-reference/api/x-components.scrollmutations.setpendingscrollto.md +24 -0
- package/docs/API-reference/api/x-components.scrollmutations.setscrollcomponentstate.md +24 -0
- package/docs/API-reference/api/x-components.scrollstate.data.md +13 -0
- package/docs/API-reference/api/x-components.scrollstate.md +21 -0
- package/docs/API-reference/api/x-components.scrollstate.pendingscrollto.md +13 -0
- package/docs/API-reference/api/x-components.scrollstatepayload.md +21 -0
- package/docs/API-reference/api/x-components.scrollstatepayload.newstate.md +13 -0
- package/docs/API-reference/api/{x-components.basescrolltotop.animation.md → x-components.scrolltotop.animation.md} +2 -2
- package/docs/API-reference/api/x-components.scrolltotop.md +23 -0
- package/docs/API-reference/api/{x-components.basescrolltotop.scrollid.md → x-components.scrolltotop.scrollid.md} +3 -3
- package/docs/API-reference/api/{x-components.basescrolltotop.thresholdpx.md → x-components.scrolltotop.thresholdpx.md} +2 -2
- package/docs/API-reference/api/x-components.scrollvisibilityobserver.md +21 -0
- package/docs/API-reference/api/x-components.scrollvisibilityobserver.observe.md +24 -0
- package/docs/API-reference/api/x-components.scrollvisibilityobserver.unobserve.md +24 -0
- package/docs/API-reference/api/x-components.scrollxevents.md +27 -0
- package/docs/API-reference/api/x-components.scrollxevents.scrollrestorefailed.md +13 -0
- package/docs/API-reference/api/x-components.scrollxevents.scrollrestoresucceeded.md +13 -0
- package/docs/API-reference/api/x-components.scrollxevents.useralmostreachedscrollend.md +13 -0
- package/docs/API-reference/api/{x-components.xeventstypes.userchangedscrolldirection.md → x-components.scrollxevents.userchangedscrolldirection.md} +2 -2
- package/docs/API-reference/api/x-components.scrollxevents.userreachedscrollend.md +13 -0
- package/docs/API-reference/api/x-components.scrollxevents.userreachedscrollstart.md +13 -0
- package/docs/API-reference/api/{x-components.xeventstypes.userscrolled.md → x-components.scrollxevents.userscrolled.md} +2 -2
- package/docs/API-reference/api/x-components.scrollxevents.userscrolledtoelement.md +13 -0
- package/docs/API-reference/api/x-components.scrollxmodule.md +13 -0
- package/docs/API-reference/api/x-components.scrollxstoremodule.md +15 -0
- package/docs/API-reference/api/x-components.searchactions.md +1 -0
- package/docs/API-reference/api/x-components.searchactions.saveorigin.md +24 -0
- package/docs/API-reference/api/{x-components.searchbutton.events.md → x-components.searchbutton.emitevents.md} +9 -3
- package/docs/API-reference/api/x-components.searchbutton.md +6 -1
- package/docs/API-reference/api/x-components.searchmutations.md +1 -0
- package/docs/API-reference/api/x-components.searchmutations.setorigin.md +2 -2
- package/docs/API-reference/api/x-components.searchmutations.setquerytagging.md +24 -0
- package/docs/API-reference/api/x-components.searchstate.md +1 -0
- package/docs/API-reference/api/x-components.searchstate.querytagging.md +13 -0
- package/docs/API-reference/api/x-components.searchxevents.md +3 -0
- package/docs/API-reference/api/x-components.searchxevents.searchtaggingchanged.md +13 -0
- package/docs/API-reference/api/x-components.searchxevents.userclickedabortaredirection.md +13 -0
- package/docs/API-reference/api/x-components.searchxevents.userclickedaredirection.md +13 -0
- package/docs/API-reference/api/x-components.sessionservice.clearsessionid.md +17 -0
- package/docs/API-reference/api/x-components.sessionservice.getsessionid.md +23 -0
- package/docs/API-reference/api/x-components.sessionservice.md +21 -0
- package/docs/API-reference/api/x-components.setconsent.md +13 -0
- package/docs/API-reference/api/x-components.setinitialextraparams.md +13 -0
- package/docs/API-reference/api/{x-components.seturlextraparams.md → x-components.setparams.md} +3 -3
- package/docs/API-reference/api/x-components.setpendingscrolltowire.md +13 -0
- package/docs/API-reference/api/x-components.setquerytaggingdebounce.md +13 -0
- package/docs/API-reference/api/x-components.setscrolldirectionwire.md +13 -0
- package/docs/API-reference/api/x-components.setscrollhasalmostreachedendwire.md +13 -0
- package/docs/API-reference/api/x-components.setscrollhasreachedendwire.md +13 -0
- package/docs/API-reference/api/x-components.setscrollhasreachedstartwire.md +13 -0
- package/docs/API-reference/api/x-components.setscrollpositionwire.md +13 -0
- package/docs/API-reference/api/x-components.setsessionduration.md +13 -0
- package/docs/API-reference/api/x-components.seturlfilters.md +1 -1
- package/docs/API-reference/api/x-components.seturlpage.md +1 -1
- package/docs/API-reference/api/x-components.seturlquery.md +1 -1
- package/docs/API-reference/api/x-components.seturlrelatedtags.md +1 -1
- package/docs/API-reference/api/x-components.seturlscroll.md +13 -0
- package/docs/API-reference/api/x-components.seturlsort.md +13 -0
- package/docs/API-reference/api/x-components.singlecolumnlayout.md +2 -3
- package/docs/API-reference/api/x-components.sortmixin.items.md +1 -1
- package/docs/API-reference/api/x-components.sortmixin.md +2 -3
- package/docs/API-reference/api/x-components.sortmixin.providedselectedsort.md +1 -1
- package/docs/API-reference/api/{x-components.spellcheckbutton.events.md → x-components.spellcheckbutton.emitevents.md} +8 -4
- package/docs/API-reference/api/x-components.spellcheckbutton.md +6 -1
- package/docs/API-reference/api/x-components.taggingconfig.md +8 -0
- package/docs/API-reference/api/x-components.taggingconfig.querytaggingdebouncems.md +13 -0
- package/docs/API-reference/api/x-components.taggingconfig.sessionttlms.md +13 -0
- package/docs/API-reference/api/x-components.taggingmutations.md +9 -0
- package/docs/API-reference/api/x-components.taggingmutations.setconsent.md +24 -0
- package/docs/API-reference/api/x-components.taggingmutations.setquerytaggingdebounce.md +24 -0
- package/docs/API-reference/api/x-components.taggingmutations.setsessionduration.md +24 -0
- package/docs/API-reference/api/x-components.taggingstate.config.md +13 -0
- package/docs/API-reference/api/x-components.taggingstate.consent.md +13 -0
- package/docs/API-reference/api/x-components.taggingstate.md +8 -0
- package/docs/API-reference/api/x-components.taggingxevents.consentchanged.md +13 -0
- package/docs/API-reference/api/x-components.taggingxevents.consentprovided.md +13 -0
- package/docs/API-reference/api/x-components.taggingxevents.md +10 -0
- package/docs/API-reference/api/x-components.taggingxevents.querytaggingdebounceprovided.md +13 -0
- package/docs/API-reference/api/x-components.taggingxevents.sessiondurationprovided.md +13 -0
- package/docs/API-reference/api/x-components.urlactions.md +0 -7
- package/docs/API-reference/api/x-components.urlhandler.created.md +17 -0
- package/docs/API-reference/api/x-components.urlhandler.md +23 -0
- package/docs/API-reference/api/x-components.urlhandler.updateurlwithpush.md +24 -0
- package/docs/API-reference/api/x-components.urlhandler.updateurlwithreplace.md +24 -0
- package/docs/API-reference/api/x-components.urlmutations.md +3 -1
- package/docs/API-reference/api/{x-components.urlmutations.setextraparams.md → x-components.urlmutations.setinitialextraparams.md} +5 -5
- package/docs/API-reference/api/x-components.urlmutations.setparams.md +2 -2
- package/docs/API-reference/api/x-components.urlmutations.setscroll.md +24 -0
- package/docs/API-reference/api/x-components.urlmutations.setsort.md +24 -0
- package/docs/API-reference/api/x-components.urlparams.md +1 -1
- package/docs/API-reference/api/x-components.urlparams.scroll.md +1 -1
- package/docs/API-reference/api/x-components.urlstate.md +5 -9
- package/docs/API-reference/api/x-components.urlxevents.extraparamsloadedfromurl.md +13 -0
- package/docs/API-reference/api/x-components.urlxevents.md +2 -1
- package/docs/API-reference/api/x-components.urlxevents.paramsloadedfromurl.md +1 -1
- package/docs/API-reference/api/{x-components.basemainscroll.beforedestroy.md → x-components.windowscroll.beforedestroy.md} +4 -2
- package/docs/API-reference/api/{x-components.basemainscroll.id.md → x-components.windowscroll.id.md} +2 -2
- package/docs/API-reference/api/x-components.windowscroll.md +30 -0
- package/docs/API-reference/api/{x-components.basescroll.mounted.md → x-components.windowscroll.mounted.md} +2 -2
- package/docs/API-reference/api/{x-components.basemainscroll.render.md → x-components.windowscroll.render.md} +2 -2
- package/docs/API-reference/api/x-components.windowscroll.scrollableelement.md +13 -0
- package/docs/API-reference/api/x-components.wiremetadata.feature.md +13 -0
- package/docs/API-reference/api/x-components.wiremetadata.location.md +13 -0
- package/docs/API-reference/api/x-components.wiremetadata.md +2 -1
- package/docs/API-reference/api/x-components.xcomponentaliasapi.md +3 -0
- package/docs/API-reference/api/x-components.xcomponentaliasapi.noresults.md +13 -0
- package/docs/API-reference/api/x-components.xcomponentaliasapi.partialresults.md +13 -0
- package/docs/API-reference/api/x-components.xcomponentaliasapi.redirections.md +13 -0
- package/docs/API-reference/api/x-components.xcomponentbusapi.emit_1.md +2 -2
- package/docs/API-reference/api/x-components.xeventstypes.md +3 -8
- package/docs/API-reference/api/x-components.xmodulestree.md +1 -0
- package/docs/API-reference/api/x-components.xmodulestree.scroll.md +11 -0
- package/docs/API-reference/api/x-types.banner.md +2 -3
- package/docs/API-reference/api/x-types.identifiable.id.md +1 -1
- package/docs/API-reference/api/x-types.identifiable.md +2 -2
- package/docs/API-reference/api/x-types.md +5 -2
- package/docs/API-reference/api/x-types.promoted.md +2 -3
- package/docs/API-reference/api/x-types.redirection.md +2 -3
- package/docs/API-reference/api/x-types.result.md +2 -3
- package/docs/API-reference/api/x-types.taggable.md +20 -0
- package/docs/API-reference/api/x-types.taggable.tagging.md +13 -0
- package/docs/API-reference/api/{x-types.banner.tagging.md → x-types.taggableschema.md} +4 -6
- package/docs/API-reference/api/x-types.tagging.add2cart.md +13 -0
- package/docs/API-reference/api/x-types.tagging.checkout.md +13 -0
- package/docs/API-reference/api/{x-types.promoted.tagging.md → x-types.tagging.click.md} +4 -6
- package/docs/API-reference/api/x-types.tagging.md +6 -3
- package/docs/API-reference/api/x-types.tagging.query.md +13 -0
- package/docs/API-reference/api/x-types.tagging.wishlist.md +13 -0
- package/docs/API-reference/api/x-types.tagginginfo.md +21 -0
- package/docs/API-reference/api/{x-types.tagging.params.md → x-types.tagginginfo.params.md} +3 -3
- package/docs/API-reference/api/{x-types.tagging.url.md → x-types.tagginginfo.url.md} +2 -2
- package/docs/API-reference/api/x-types.tagginginfoschema.md +13 -0
- package/docs/API-reference/components/common/layouts/x-components.fixed-header-and-asides-layout.md +73 -0
- package/docs/API-reference/components/common/layouts/x-components.multi-column-max-width-layout.md +133 -0
- package/docs/API-reference/components/common/result/x-components.base-result-image.md +2 -2
- package/docs/API-reference/components/common/result/x-components.base-result-link.md +2 -3
- package/docs/API-reference/components/common/scroll/x-components.base-scroll.md +9 -9
- package/docs/API-reference/components/common/suggestions/x-components.base-suggestion.md +9 -8
- package/docs/API-reference/components/common/x-components.auto-progress-bar.md +63 -0
- package/docs/API-reference/components/common/x-components.location-provider.md +54 -0
- package/docs/API-reference/components/extra-params/x-components.renderless-extra-param.md +7 -13
- package/docs/API-reference/components/facets/x-components.lists/sliced-filters.md +10 -6
- package/docs/API-reference/components/scroll/x-components.main-scroll-item.md +84 -0
- package/docs/API-reference/components/scroll/x-components.main-scroll.md +175 -0
- package/docs/API-reference/components/{common/scroll/x-components.base-scroll-to-top.md → scroll/x-components.scroll-to-top.md} +11 -14
- package/docs/API-reference/components/scroll/x-components.scroll.md +168 -0
- package/docs/API-reference/components/scroll/x-components.window-scroll.md +158 -0
- package/docs/API-reference/components/search/x-components.redirection.md +99 -0
- package/docs/API-reference/components/search/x-components.sort-dropdown.md +4 -5
- package/docs/API-reference/components/search/x-components.sort-list.md +4 -5
- package/docs/API-reference/components/tagging/x-components.tagging.md +84 -0
- package/docs/API-reference/components/url/x-components.url-handler.md +14 -2
- package/docs/sidebar.json +1 -1
- package/identifier-results/index.js +2 -1
- package/js/components/auto-progress-bar.vue.js +65 -0
- package/js/components/auto-progress-bar.vue.js.map +1 -0
- package/js/components/auto-progress-bar.vue_rollup-plugin-vue=script.js +42 -0
- package/js/components/auto-progress-bar.vue_rollup-plugin-vue=script.js.map +1 -0
- package/js/components/base-dropdown.vue.js +31 -9
- package/js/components/base-dropdown.vue.js.map +1 -1
- package/js/components/base-dropdown.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/components/base-grid.vue.js +2 -2
- package/js/components/base-grid.vue.js.map +1 -1
- package/js/components/base-grid.vue_rollup-plugin-vue=script.js +1 -1
- package/js/components/base-grid.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/components/layouts/layouts.mixin.js +44 -0
- package/js/components/layouts/layouts.mixin.js.map +1 -0
- package/js/components/layouts/multi-column-max-width-layout.vue.js +64 -54
- package/js/components/layouts/multi-column-max-width-layout.vue.js.map +1 -1
- package/js/components/layouts/multi-column-max-width-layout.vue_rollup-plugin-vue=script.js +6 -26
- package/js/components/layouts/multi-column-max-width-layout.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/components/layouts/single-column-layout.vue.js +20 -14
- package/js/components/layouts/single-column-layout.vue.js.map +1 -1
- package/js/components/layouts/single-column-layout.vue_rollup-plugin-vue=script.js +6 -25
- package/js/components/layouts/single-column-layout.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/components/location-provider.vue.js +39 -0
- package/js/components/location-provider.vue.js.map +1 -0
- package/js/components/location-provider.vue_rollup-plugin-vue=script.js +27 -0
- package/js/components/location-provider.vue_rollup-plugin-vue=script.js.map +1 -0
- package/js/components/result/base-result-image.vue.js +4 -4
- package/js/components/result/base-result-image.vue.js.map +1 -1
- package/js/components/result/base-result-link.vue.js +2 -2
- package/js/components/result/base-result-link.vue.js.map +1 -1
- package/js/components/result/base-result-link.vue_rollup-plugin-vue=script.js +5 -14
- package/js/components/result/base-result-link.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/components/scroll/base-scroll.vue.js +2 -2
- package/js/components/scroll/base-scroll.vue.js.map +1 -1
- package/js/components/scroll/base-scroll.vue_rollup-plugin-vue=script.js +2 -49
- package/js/components/scroll/base-scroll.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/components/scroll/scroll.mixin.js +122 -52
- package/js/components/scroll/scroll.mixin.js.map +1 -1
- package/js/components/staggering-transition-group.vue_rollup-plugin-vue=script.js +1 -0
- package/js/components/staggering-transition-group.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/components/suggestions/base-suggestion.vue.js +2 -2
- package/js/components/suggestions/base-suggestion.vue.js.map +1 -1
- package/js/components/suggestions/base-suggestion.vue_rollup-plugin-vue=script.js +21 -6
- package/js/components/suggestions/base-suggestion.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/components/x-component.utils.js +2 -2
- package/js/components/x-component.utils.js.map +1 -1
- package/js/index.js +27 -14
- package/js/index.js.map +1 -1
- package/js/plugins/x-emitters.js +92 -21
- package/js/plugins/x-emitters.js.map +1 -1
- package/js/plugins/x-plugin.alias.js +37 -26
- package/js/plugins/x-plugin.alias.js.map +1 -1
- package/js/plugins/x-plugin.js +1 -0
- package/js/plugins/x-plugin.js.map +1 -1
- package/js/plugins/x-plugin.mixin.js +16 -6
- package/js/plugins/x-plugin.mixin.js.map +1 -1
- package/js/store/utils/status-store.utils.js.map +1 -1
- package/js/store/x.module.js +7 -6
- package/js/store/x.module.js.map +1 -1
- package/js/utils/array.js +19 -1
- package/js/utils/array.js.map +1 -1
- package/js/utils/origin.js +20 -0
- package/js/utils/origin.js.map +1 -0
- package/js/x-installer/x-installer/x-installer.js +7 -4
- package/js/x-installer/x-installer/x-installer.js.map +1 -1
- package/js/x-modules/extra-params/components/extra-params.vue.js.map +1 -1
- package/js/x-modules/extra-params/components/extra-params.vue_rollup-plugin-vue=script.js +18 -8
- package/js/x-modules/extra-params/components/extra-params.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/extra-params/components/renderless-extra-param.vue.js.map +1 -1
- package/js/x-modules/extra-params/components/renderless-extra-param.vue_rollup-plugin-vue=script.js +9 -39
- package/js/x-modules/extra-params/components/renderless-extra-param.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/extra-params/components/snippet-config-extra-params.vue.js.map +1 -1
- package/js/x-modules/extra-params/components/snippet-config-extra-params.vue_rollup-plugin-vue=script.js +10 -10
- package/js/x-modules/extra-params/components/snippet-config-extra-params.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/extra-params/wiring.js +3 -0
- package/js/x-modules/extra-params/wiring.js.map +1 -1
- package/js/x-modules/facets/components/clear-filters.vue.js +7 -1
- package/js/x-modules/facets/components/clear-filters.vue.js.map +1 -1
- package/js/x-modules/facets/components/clear-filters.vue_rollup-plugin-vue=script.js +5 -6
- package/js/x-modules/facets/components/clear-filters.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/facets/components/facets/facets-provider.vue_rollup-plugin-vue=script.js +5 -6
- package/js/x-modules/facets/components/facets/facets-provider.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/facets/components/filters/all-filter.vue_rollup-plugin-vue=script.js +5 -6
- package/js/x-modules/facets/components/filters/all-filter.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/facets/components/filters/base-filter.vue_rollup-plugin-vue=script.js +5 -6
- package/js/x-modules/facets/components/filters/base-filter.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/facets/components/filters/hierarchical-filter.vue_rollup-plugin-vue=script.js +5 -6
- package/js/x-modules/facets/components/filters/hierarchical-filter.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/facets/components/filters/number-range-filter.vue_rollup-plugin-vue=script.js +5 -6
- package/js/x-modules/facets/components/filters/number-range-filter.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/facets/components/filters/renderless-filter.vue_rollup-plugin-vue=script.js +5 -6
- package/js/x-modules/facets/components/filters/renderless-filter.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/facets/components/filters/simple-filter.vue_rollup-plugin-vue=script.js +5 -6
- package/js/x-modules/facets/components/filters/simple-filter.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/facets/components/lists/exclude-filters-with-no-results.vue_rollup-plugin-vue=script.js +5 -6
- package/js/x-modules/facets/components/lists/exclude-filters-with-no-results.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/facets/components/lists/filters-list.vue_rollup-plugin-vue=script.js +5 -6
- package/js/x-modules/facets/components/lists/filters-list.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/facets/components/lists/filters-search.vue_rollup-plugin-vue=script.js +5 -6
- package/js/x-modules/facets/components/lists/filters-search.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/facets/components/lists/selected-filters.vue_rollup-plugin-vue=script.js +5 -6
- package/js/x-modules/facets/components/lists/selected-filters.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/facets/components/lists/sliced-filters.vue.js +14 -6
- package/js/x-modules/facets/components/lists/sliced-filters.vue.js.map +1 -1
- package/js/x-modules/facets/components/lists/sliced-filters.vue_rollup-plugin-vue=script.js +5 -6
- package/js/x-modules/facets/components/lists/sliced-filters.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/facets/components/lists/sorted-filters.vue_rollup-plugin-vue=script.js +6 -6
- package/js/x-modules/facets/entities/filter-entity.factory.js +22 -1
- package/js/x-modules/facets/entities/filter-entity.factory.js.map +1 -1
- package/js/x-modules/facets/service/facets.service.js +17 -15
- package/js/x-modules/facets/service/facets.service.js.map +1 -1
- package/js/x-modules/facets/wiring.js +2 -0
- package/js/x-modules/facets/wiring.js.map +1 -1
- package/js/x-modules/history-queries/store/actions/set-url-params.action.js +1 -3
- package/js/x-modules/history-queries/store/actions/set-url-params.action.js.map +1 -1
- package/js/x-modules/identifier-results/components/identifier-results.vue.js.map +1 -1
- package/js/x-modules/identifier-results/components/identifier-results.vue_rollup-plugin-vue=script.js +14 -2
- package/js/x-modules/identifier-results/components/identifier-results.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/identifier-results/store/actions/save-origin.action.js +18 -0
- package/js/x-modules/identifier-results/store/actions/save-origin.action.js.map +1 -0
- package/js/x-modules/identifier-results/store/actions/set-url-params.action.js +1 -3
- package/js/x-modules/identifier-results/store/actions/set-url-params.action.js.map +1 -1
- package/js/x-modules/identifier-results/store/emitters.js +5 -1
- package/js/x-modules/identifier-results/store/emitters.js.map +1 -1
- package/js/x-modules/identifier-results/store/getters/identifier-results-request.getter.js +3 -2
- package/js/x-modules/identifier-results/store/getters/identifier-results-request.getter.js.map +1 -1
- package/js/x-modules/identifier-results/store/module.js +11 -4
- package/js/x-modules/identifier-results/store/module.js.map +1 -1
- package/js/x-modules/identifier-results/wiring.js +12 -2
- package/js/x-modules/identifier-results/wiring.js.map +1 -1
- package/js/x-modules/next-queries/components/next-queries-list.vue_rollup-plugin-vue=script.js +1 -1
- package/js/x-modules/next-queries/store/actions/set-url-params.action.js +1 -3
- package/js/x-modules/next-queries/store/actions/set-url-params.action.js.map +1 -1
- package/js/x-modules/next-queries/store/emitters.js +2 -2
- package/js/x-modules/next-queries/store/emitters.js.map +1 -1
- package/js/x-modules/next-queries/store/module.js +1 -1
- package/js/x-modules/next-queries/store/module.js.map +1 -1
- package/js/x-modules/popular-searches/store/module.js +1 -1
- package/js/x-modules/popular-searches/store/module.js.map +1 -1
- package/js/x-modules/query-suggestions/store/actions/set-url-params.action.js +1 -3
- package/js/x-modules/query-suggestions/store/actions/set-url-params.action.js.map +1 -1
- package/js/x-modules/query-suggestions/store/module.js +1 -1
- package/js/x-modules/query-suggestions/store/module.js.map +1 -1
- package/js/x-modules/recommendations/store/module.js +1 -1
- package/js/x-modules/recommendations/store/module.js.map +1 -1
- package/js/x-modules/related-tags/components/related-tag.vue.js +5 -4
- package/js/x-modules/related-tags/components/related-tag.vue.js.map +1 -1
- package/js/x-modules/related-tags/components/related-tag.vue_rollup-plugin-vue=script.js +15 -24
- package/js/x-modules/related-tags/components/related-tag.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/related-tags/store/actions/set-url-params.action.js +14 -20
- package/js/x-modules/related-tags/store/actions/set-url-params.action.js.map +1 -1
- package/js/x-modules/related-tags/store/emitters.js +5 -1
- package/js/x-modules/related-tags/store/emitters.js.map +1 -1
- package/js/x-modules/related-tags/store/module.js +1 -1
- package/js/x-modules/related-tags/store/module.js.map +1 -1
- package/js/x-modules/scroll/components/main-scroll-item.vue.js +52 -0
- package/js/x-modules/scroll/components/main-scroll-item.vue.js.map +1 -0
- package/js/x-modules/scroll/components/main-scroll-item.vue_rollup-plugin-vue=script.js +188 -0
- package/js/x-modules/scroll/components/main-scroll-item.vue_rollup-plugin-vue=script.js.map +1 -0
- package/js/{components/scroll/base-main-scroll.vue.js → x-modules/scroll/components/main-scroll.vue.js} +2 -2
- package/js/x-modules/scroll/components/main-scroll.vue.js.map +1 -0
- package/js/x-modules/scroll/components/main-scroll.vue_rollup-plugin-vue=script.js +204 -0
- package/js/x-modules/scroll/components/main-scroll.vue_rollup-plugin-vue=script.js.map +1 -0
- package/js/{components/scroll/base-scroll-to-top.vue.js → x-modules/scroll/components/scroll-to-top.vue.js} +2 -2
- package/js/x-modules/scroll/components/scroll-to-top.vue.js.map +1 -0
- package/js/x-modules/scroll/components/scroll-to-top.vue_rollup-plugin-vue=script.js +231 -0
- package/js/x-modules/scroll/components/scroll-to-top.vue_rollup-plugin-vue=script.js.map +1 -0
- package/js/x-modules/scroll/components/scroll.const.js +15 -0
- package/js/x-modules/scroll/components/scroll.const.js.map +1 -0
- package/js/{components/scroll/base-id-scroll.vue.js → x-modules/scroll/components/scroll.vue.js} +8 -9
- package/js/x-modules/scroll/components/scroll.vue.js.map +1 -0
- package/js/x-modules/scroll/components/scroll.vue_rollup-plugin-vue=script.js +110 -0
- package/js/x-modules/scroll/components/scroll.vue_rollup-plugin-vue=script.js.map +1 -0
- package/js/x-modules/scroll/components/window-scroll.vue.js +39 -0
- package/js/x-modules/scroll/components/window-scroll.vue.js.map +1 -0
- package/js/x-modules/scroll/components/window-scroll.vue_rollup-plugin-vue=script.js +186 -0
- package/js/x-modules/scroll/components/window-scroll.vue_rollup-plugin-vue=script.js.map +1 -0
- package/js/x-modules/scroll/store/emitters.js +15 -0
- package/js/x-modules/scroll/store/emitters.js.map +1 -0
- package/js/x-modules/scroll/store/module.js +36 -0
- package/js/x-modules/scroll/store/module.js.map +1 -0
- package/js/x-modules/scroll/wiring.js +114 -0
- package/js/x-modules/scroll/wiring.js.map +1 -0
- package/js/x-modules/scroll/x-module.js +19 -0
- package/js/x-modules/scroll/x-module.js.map +1 -0
- package/js/x-modules/search/components/banners-list.vue_rollup-plugin-vue=script.js +1 -1
- package/js/x-modules/search/components/partial-query-button.vue.js +3 -2
- package/js/x-modules/search/components/partial-query-button.vue.js.map +1 -1
- package/js/x-modules/search/components/partial-query-button.vue_rollup-plugin-vue=script.js +13 -122
- package/js/x-modules/search/components/partial-query-button.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/search/components/promoteds-list.vue_rollup-plugin-vue=script.js +1 -1
- package/js/x-modules/search/components/redirection.vue.js +65 -0
- package/js/x-modules/search/components/redirection.vue.js.map +1 -0
- package/js/x-modules/search/components/redirection.vue_rollup-plugin-vue=script.js +108 -0
- package/js/x-modules/search/components/redirection.vue_rollup-plugin-vue=script.js.map +1 -0
- package/js/x-modules/search/components/sort-list.vue_rollup-plugin-vue=script.js +5 -6
- package/js/x-modules/search/components/sort-list.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/search/components/sort.mixin.js +7 -12
- package/js/x-modules/search/components/sort.mixin.js.map +1 -1
- package/js/x-modules/search/components/spellcheck-button.vue.js +3 -2
- package/js/x-modules/search/components/spellcheck-button.vue.js.map +1 -1
- package/js/x-modules/search/components/spellcheck-button.vue_rollup-plugin-vue=script.js +13 -121
- package/js/x-modules/search/components/spellcheck-button.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/search/components/spellcheck.vue_rollup-plugin-vue=script.js +5 -6
- package/js/x-modules/search/components/spellcheck.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/search/store/actions/fetch-and-save-search-response.action.js +2 -1
- 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-origin.action.js +18 -0
- package/js/x-modules/search/store/actions/save-origin.action.js.map +1 -0
- package/js/x-modules/search/store/actions/set-url-params.action.js +4 -7
- package/js/x-modules/search/store/actions/set-url-params.action.js.map +1 -1
- package/js/x-modules/search/store/emitters.js +7 -1
- package/js/x-modules/search/store/emitters.js.map +1 -1
- package/js/x-modules/search/store/module.js +17 -4
- package/js/x-modules/search/store/module.js.map +1 -1
- package/js/x-modules/search/wiring.js +25 -23
- package/js/x-modules/search/wiring.js.map +1 -1
- package/js/x-modules/search-box/components/search-button.vue.js +3 -2
- package/js/x-modules/search-box/components/search-button.vue.js.map +1 -1
- package/js/x-modules/search-box/components/search-button.vue_rollup-plugin-vue=script.js +16 -15
- package/js/x-modules/search-box/components/search-button.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/search-box/components/search-input.vue.js +3 -2
- package/js/x-modules/search-box/components/search-input.vue.js.map +1 -1
- package/js/x-modules/search-box/components/search-input.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/search-box/store/actions/set-url-params.action.js +1 -3
- package/js/x-modules/search-box/store/actions/set-url-params.action.js.map +1 -1
- package/js/x-modules/tagging/service/session.service.js +35 -0
- package/js/x-modules/tagging/service/session.service.js.map +1 -0
- package/js/x-modules/tagging/store/emitters.js +3 -1
- package/js/x-modules/tagging/store/emitters.js.map +1 -1
- package/js/x-modules/tagging/store/module.js +16 -2
- package/js/x-modules/tagging/store/module.js.map +1 -1
- package/js/x-modules/tagging/wiring.js +59 -2
- package/js/x-modules/tagging/wiring.js.map +1 -1
- package/js/x-modules/url/components/url-handler.vue.js +50 -0
- package/js/x-modules/url/components/url-handler.vue.js.map +1 -0
- package/js/x-modules/url/components/url-handler.vue_rollup-plugin-vue=script.js +243 -0
- package/js/x-modules/url/components/url-handler.vue_rollup-plugin-vue=script.js.map +1 -0
- package/js/x-modules/url/store/emitters.js +24 -7
- package/js/x-modules/url/store/emitters.js.map +1 -1
- package/js/x-modules/url/store/getters/url-params.getter.js +11 -7
- package/js/x-modules/url/store/getters/url-params.getter.js.map +1 -1
- package/js/x-modules/url/store/initial-state.js +6 -9
- package/js/x-modules/url/store/initial-state.js.map +1 -1
- package/js/x-modules/url/store/module.js +17 -15
- package/js/x-modules/url/store/module.js.map +1 -1
- package/js/x-modules/url/store/mutations/set-params.mutation.js +21 -0
- package/js/x-modules/url/store/mutations/set-params.mutation.js.map +1 -0
- package/js/x-modules/url/wiring.js +32 -23
- package/js/x-modules/url/wiring.js.map +1 -1
- package/next-queries/index.js +0 -1
- package/package.json +6 -4
- package/report/x-adapter.api.json +18 -18
- package/report/x-components.api.json +4829 -1625
- package/report/x-components.api.md +534 -207
- package/report/x-types.api.json +396 -310
- package/scroll/index.d.ts +1 -0
- package/scroll/index.js +10 -0
- package/search/index.js +2 -1
- package/tagging/index.js +2 -1
- package/types/adapter/real-adapter.d.ts.map +1 -1
- package/types/adapter/util.d.ts +1 -1
- package/types/adapter/util.d.ts.map +1 -1
- package/types/components/auto-progress-bar.vue.d.ts +29 -0
- package/types/components/auto-progress-bar.vue.d.ts.map +1 -0
- package/types/components/base-dropdown.vue.d.ts.map +1 -1
- package/types/components/index.d.ts +2 -0
- package/types/components/index.d.ts.map +1 -1
- package/types/components/layouts/layouts.mixin.d.ts +24 -0
- package/types/components/layouts/layouts.mixin.d.ts.map +1 -0
- package/types/components/layouts/multi-column-max-width-layout.vue.d.ts +4 -16
- package/types/components/layouts/multi-column-max-width-layout.vue.d.ts.map +1 -1
- package/types/components/layouts/single-column-layout.vue.d.ts +4 -16
- package/types/components/layouts/single-column-layout.vue.d.ts.map +1 -1
- package/types/components/location-provider.vue.d.ts +17 -0
- package/types/components/location-provider.vue.d.ts.map +1 -0
- package/types/components/result/base-result-link.vue.d.ts +8 -18
- package/types/components/result/base-result-link.vue.d.ts.map +1 -1
- package/types/components/scroll/base-scroll.vue.d.ts +0 -28
- package/types/components/scroll/base-scroll.vue.d.ts.map +1 -1
- package/types/components/scroll/index.d.ts +0 -3
- package/types/components/scroll/index.d.ts.map +1 -1
- package/types/components/scroll/scroll.mixin.d.ts +75 -30
- package/types/components/scroll/scroll.mixin.d.ts.map +1 -1
- package/types/components/suggestions/base-suggestion.vue.d.ts +15 -2
- package/types/components/suggestions/base-suggestion.vue.d.ts.map +1 -1
- package/types/components/x-component.utils.d.ts +1 -1
- package/types/components/x-component.utils.d.ts.map +1 -1
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/types/plugins/x-emitters.d.ts.map +1 -1
- package/types/plugins/x-plugin.alias.d.ts.map +1 -1
- package/types/plugins/x-plugin.d.ts +1 -1
- package/types/plugins/x-plugin.d.ts.map +1 -1
- package/types/plugins/x-plugin.mixin.d.ts +2 -2
- package/types/plugins/x-plugin.mixin.d.ts.map +1 -1
- package/types/plugins/x-plugin.types.d.ts +8 -2
- package/types/plugins/x-plugin.types.d.ts.map +1 -1
- package/types/router.d.ts.map +1 -1
- package/types/store/utils/status-store.utils.d.ts +1 -1
- package/types/store/utils/status-store.utils.d.ts.map +1 -1
- package/types/store/x.module.d.ts.map +1 -1
- package/types/types/index.d.ts +1 -1
- package/types/types/index.d.ts.map +1 -1
- package/types/types/origin.d.ts +46 -0
- package/types/types/origin.d.ts.map +1 -0
- package/types/types/url-params.d.ts +1 -1
- package/types/utils/array.d.ts +10 -0
- package/types/utils/array.d.ts.map +1 -1
- package/types/utils/index.d.ts +1 -0
- package/types/utils/index.d.ts.map +1 -1
- package/types/utils/origin.d.ts +13 -0
- package/types/utils/origin.d.ts.map +1 -0
- package/types/views/base-config.d.ts.map +1 -1
- package/types/wiring/events.types.d.ts +18 -40
- package/types/wiring/events.types.d.ts.map +1 -1
- package/types/wiring/wiring.types.d.ts +9 -10
- package/types/wiring/wiring.types.d.ts.map +1 -1
- package/types/x-installer/x-installer/x-installer.d.ts +1 -1
- package/types/x-installer/x-installer/x-installer.d.ts.map +1 -1
- package/types/x-modules/extra-params/components/extra-params.vue.d.ts +9 -0
- package/types/x-modules/extra-params/components/extra-params.vue.d.ts.map +1 -1
- package/types/x-modules/extra-params/components/renderless-extra-param.vue.d.ts +3 -27
- package/types/x-modules/extra-params/components/renderless-extra-param.vue.d.ts.map +1 -1
- package/types/x-modules/extra-params/components/snippet-config-extra-params.vue.d.ts +1 -1
- package/types/x-modules/extra-params/components/snippet-config-extra-params.vue.d.ts.map +1 -1
- package/types/x-modules/extra-params/events.types.d.ts +17 -0
- package/types/x-modules/extra-params/events.types.d.ts.map +1 -1
- package/types/x-modules/extra-params/wiring.d.ts +3 -0
- package/types/x-modules/extra-params/wiring.d.ts.map +1 -1
- package/types/x-modules/facets/components/clear-filters.vue.d.ts.map +1 -1
- package/types/x-modules/facets/components/lists/sliced-filters.vue.d.ts.map +1 -1
- package/types/x-modules/facets/entities/filter-entity.factory.d.ts +19 -2
- package/types/x-modules/facets/entities/filter-entity.factory.d.ts.map +1 -1
- package/types/x-modules/facets/service/facets.service.d.ts +4 -9
- package/types/x-modules/facets/service/facets.service.d.ts.map +1 -1
- package/types/x-modules/facets/wiring.d.ts +1 -0
- package/types/x-modules/facets/wiring.d.ts.map +1 -1
- package/types/x-modules/history-queries/store/actions/set-url-params.action.d.ts.map +1 -1
- package/types/x-modules/identifier-results/components/identifier-results.vue.d.ts +8 -0
- package/types/x-modules/identifier-results/components/identifier-results.vue.d.ts.map +1 -1
- package/types/x-modules/identifier-results/store/actions/save-origin.action.d.ts +12 -0
- package/types/x-modules/identifier-results/store/actions/save-origin.action.d.ts.map +1 -0
- package/types/x-modules/identifier-results/store/actions/set-url-params.action.d.ts.map +1 -1
- package/types/x-modules/identifier-results/store/emitters.d.ts +4 -1
- package/types/x-modules/identifier-results/store/emitters.d.ts.map +1 -1
- package/types/x-modules/identifier-results/store/getters/identifier-results-request.getter.d.ts.map +1 -1
- package/types/x-modules/identifier-results/store/index.d.ts +1 -0
- package/types/x-modules/identifier-results/store/index.d.ts.map +1 -1
- package/types/x-modules/identifier-results/store/module.d.ts.map +1 -1
- package/types/x-modules/identifier-results/store/types.d.ts +26 -10
- package/types/x-modules/identifier-results/store/types.d.ts.map +1 -1
- package/types/x-modules/identifier-results/wiring.d.ts +7 -0
- package/types/x-modules/identifier-results/wiring.d.ts.map +1 -1
- package/types/x-modules/next-queries/index.d.ts +0 -1
- package/types/x-modules/next-queries/index.d.ts.map +1 -1
- package/types/x-modules/next-queries/store/actions/set-url-params.action.d.ts.map +1 -1
- package/types/x-modules/next-queries/store/emitters.d.ts +1 -2
- package/types/x-modules/next-queries/store/emitters.d.ts.map +1 -1
- package/types/x-modules/query-suggestions/store/actions/set-url-params.action.d.ts.map +1 -1
- package/types/x-modules/related-tags/components/related-tag.vue.d.ts +3 -6
- package/types/x-modules/related-tags/components/related-tag.vue.d.ts.map +1 -1
- package/types/x-modules/related-tags/store/actions/set-url-params.action.d.ts.map +1 -1
- package/types/x-modules/related-tags/store/emitters.d.ts +4 -1
- package/types/x-modules/related-tags/store/emitters.d.ts.map +1 -1
- package/types/x-modules/scroll/components/index.d.ts +8 -0
- package/types/x-modules/scroll/components/index.d.ts.map +1 -0
- package/types/x-modules/scroll/components/main-scroll-item.vue.d.ts +65 -0
- package/types/x-modules/scroll/components/main-scroll-item.vue.d.ts.map +1 -0
- package/types/x-modules/scroll/components/main-scroll.vue.d.ts +121 -0
- package/types/x-modules/scroll/components/main-scroll.vue.d.ts.map +1 -0
- package/types/x-modules/scroll/components/scroll-to-top.vue.d.ts +80 -0
- package/types/x-modules/scroll/components/scroll-to-top.vue.d.ts.map +1 -0
- package/types/x-modules/scroll/components/scroll.const.d.ts +15 -0
- package/types/x-modules/scroll/components/scroll.const.d.ts.map +1 -0
- package/types/x-modules/scroll/components/scroll.types.d.ts +20 -0
- package/types/x-modules/scroll/components/scroll.types.d.ts.map +1 -0
- package/types/{components/scroll/base-id-scroll.vue.d.ts → x-modules/scroll/components/scroll.vue.d.ts} +17 -30
- package/types/x-modules/scroll/components/scroll.vue.d.ts.map +1 -0
- package/types/x-modules/scroll/components/window-scroll.vue.d.ts +47 -0
- package/types/x-modules/scroll/components/window-scroll.vue.d.ts.map +1 -0
- package/types/x-modules/scroll/events.types.d.ts +53 -0
- package/types/x-modules/scroll/events.types.d.ts.map +1 -0
- package/types/x-modules/scroll/index.d.ts +6 -0
- package/types/x-modules/scroll/index.d.ts.map +1 -0
- package/types/x-modules/scroll/store/emitters.d.ts +7 -0
- package/types/x-modules/scroll/store/emitters.d.ts.map +1 -0
- package/types/x-modules/scroll/store/index.d.ts +4 -0
- package/types/x-modules/scroll/store/index.d.ts.map +1 -0
- package/types/x-modules/scroll/store/module.d.ts +8 -0
- package/types/x-modules/scroll/store/module.d.ts.map +1 -0
- package/types/x-modules/scroll/store/types.d.ts +98 -0
- package/types/x-modules/scroll/store/types.d.ts.map +1 -0
- package/types/x-modules/scroll/wiring.d.ts +74 -0
- package/types/x-modules/scroll/wiring.d.ts.map +1 -0
- package/types/x-modules/scroll/x-module.d.ts +16 -0
- package/types/x-modules/scroll/x-module.d.ts.map +1 -0
- package/types/x-modules/search/components/index.d.ts +1 -0
- package/types/x-modules/search/components/index.d.ts.map +1 -1
- package/types/x-modules/search/components/partial-query-button.vue.d.ts +2 -5
- package/types/x-modules/search/components/partial-query-button.vue.d.ts.map +1 -1
- package/types/x-modules/search/components/redirection.vue.d.ts +72 -0
- package/types/x-modules/search/components/redirection.vue.d.ts.map +1 -0
- package/types/x-modules/search/components/sort.mixin.d.ts +3 -11
- package/types/x-modules/search/components/sort.mixin.d.ts.map +1 -1
- package/types/x-modules/search/components/spellcheck-button.vue.d.ts +2 -5
- package/types/x-modules/search/components/spellcheck-button.vue.d.ts.map +1 -1
- package/types/x-modules/search/events.types.d.ts +15 -1
- 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-origin.action.d.ts +12 -0
- package/types/x-modules/search/store/actions/save-origin.action.d.ts.map +1 -0
- package/types/x-modules/search/store/actions/set-url-params.action.d.ts.map +1 -1
- package/types/x-modules/search/store/emitters.d.ts +5 -1
- package/types/x-modules/search/store/emitters.d.ts.map +1 -1
- package/types/x-modules/search/store/module.d.ts.map +1 -1
- package/types/x-modules/search/store/types.d.ts +17 -3
- package/types/x-modules/search/store/types.d.ts.map +1 -1
- package/types/x-modules/search/wiring.d.ts +21 -19
- package/types/x-modules/search/wiring.d.ts.map +1 -1
- package/types/x-modules/search-box/components/search-button.vue.d.ts +6 -2
- package/types/x-modules/search-box/components/search-button.vue.d.ts.map +1 -1
- package/types/x-modules/search-box/components/search-input.vue.d.ts.map +1 -1
- package/types/x-modules/search-box/store/actions/set-url-params.action.d.ts.map +1 -1
- package/types/x-modules/tagging/components/index.d.ts +2 -0
- package/types/x-modules/tagging/components/index.d.ts.map +1 -0
- package/types/x-modules/tagging/config.types.d.ts +9 -0
- package/types/x-modules/tagging/config.types.d.ts.map +1 -1
- package/types/x-modules/tagging/events.types.d.ts +20 -0
- package/types/x-modules/tagging/events.types.d.ts.map +1 -1
- package/types/x-modules/tagging/index.d.ts +1 -0
- package/types/x-modules/tagging/index.d.ts.map +1 -1
- package/types/x-modules/tagging/service/index.d.ts +3 -0
- package/types/x-modules/tagging/service/index.d.ts.map +1 -0
- package/types/x-modules/tagging/service/session.service.d.ts +20 -0
- package/types/x-modules/tagging/service/session.service.d.ts.map +1 -0
- package/types/x-modules/tagging/service/types.d.ts +21 -0
- package/types/x-modules/tagging/service/types.d.ts.map +1 -0
- package/types/x-modules/tagging/store/emitters.d.ts +3 -1
- package/types/x-modules/tagging/store/emitters.d.ts.map +1 -1
- package/types/x-modules/tagging/store/module.d.ts.map +1 -1
- package/types/x-modules/tagging/store/types.d.ts +27 -0
- package/types/x-modules/tagging/store/types.d.ts.map +1 -1
- package/types/x-modules/tagging/wiring.d.ts +32 -1
- package/types/x-modules/tagging/wiring.d.ts.map +1 -1
- package/types/x-modules/url/components/url-handler.vue.d.ts +130 -0
- package/types/x-modules/url/components/url-handler.vue.d.ts.map +1 -0
- package/types/x-modules/url/events.types.d.ts +8 -2
- package/types/x-modules/url/events.types.d.ts.map +1 -1
- package/types/x-modules/url/index.d.ts +1 -0
- package/types/x-modules/url/index.d.ts.map +1 -1
- package/types/x-modules/url/store/emitters.d.ts +13 -6
- package/types/x-modules/url/store/emitters.d.ts.map +1 -1
- package/types/x-modules/url/store/getters/url-params.getter.d.ts.map +1 -1
- package/types/x-modules/url/store/initial-state.d.ts +2 -2
- package/types/x-modules/url/store/initial-state.d.ts.map +1 -1
- package/types/x-modules/url/store/module.d.ts.map +1 -1
- package/types/x-modules/url/store/mutations/set-params.mutation.d.ts +13 -0
- package/types/x-modules/url/store/mutations/set-params.mutation.d.ts.map +1 -0
- package/types/x-modules/url/store/types.d.ts +22 -17
- package/types/x-modules/url/store/types.d.ts.map +1 -1
- package/types/x-modules/url/wiring.d.ts +37 -19
- package/types/x-modules/url/wiring.d.ts.map +1 -1
- package/types/x-modules/x-modules.types.d.ts +3 -1
- package/types/x-modules/x-modules.types.d.ts.map +1 -1
- package/url/index.js +3 -2
- package/docs/API-reference/api/x-components.arenextqueriesdifferent.md +0 -27
- package/docs/API-reference/api/x-components.baseidscroll.md +0 -24
- package/docs/API-reference/api/x-components.baseidscroll.resetonquerychange.md +0 -13
- package/docs/API-reference/api/x-components.basemainscroll.element.md +0 -13
- package/docs/API-reference/api/x-components.basemainscroll.md +0 -31
- package/docs/API-reference/api/x-components.basemainscroll.tag.md +0 -13
- package/docs/API-reference/api/x-components.baseresultlink.emituserclickedaresult.md +0 -17
- package/docs/API-reference/api/x-components.baseresultlink.emituserrightclickedaresult.md +0 -17
- package/docs/API-reference/api/x-components.baseresultlink.metadata.md +0 -13
- package/docs/API-reference/api/x-components.baseresultlink.mounted.md +0 -15
- package/docs/API-reference/api/x-components.baseresultlink.origin.md +0 -13
- package/docs/API-reference/api/x-components.baseresultlink.resultclickextraevents.md +0 -13
- package/docs/API-reference/api/x-components.basescroll.resetonquerychange.md +0 -13
- package/docs/API-reference/api/x-components.basescrolltotop.md +0 -23
- package/docs/API-reference/api/x-components.multicolumnmaxwidthlayout.devmode.md +0 -13
- package/docs/API-reference/api/x-components.renderlessextraparams.extraparams.md +0 -13
- package/docs/API-reference/api/x-components.singlecolumnlayout.devmode.md +0 -13
- package/docs/API-reference/api/x-components.sortmixin.value.md +0 -13
- package/docs/API-reference/api/x-components.updatestorefromurl.md +0 -13
- package/docs/API-reference/api/x-components.urlactions.updatestorefromurl.md +0 -24
- package/docs/API-reference/api/x-components.urlstate.extraparams.md +0 -11
- package/docs/API-reference/api/x-components.wiremetadata.origin.md +0 -13
- package/docs/API-reference/api/x-components.xeventstypes.useralmostreachedscrollend.md +0 -13
- package/docs/API-reference/api/x-components.xeventstypes.userreachedscrollend.md +0 -13
- package/docs/API-reference/api/x-components.xeventstypes.userreachedscrollstart.md +0 -13
- package/docs/API-reference/api/x-types.redirection.tagging.md +0 -15
- package/docs/API-reference/api/x-types.result.tagging.md +0 -13
- package/docs/API-reference/api/x-types.resulttagging.add2cart.md +0 -13
- package/docs/API-reference/api/x-types.resulttagging.checkout.md +0 -13
- package/docs/API-reference/api/x-types.resulttagging.click.md +0 -13
- package/docs/API-reference/api/x-types.resulttagging.md +0 -22
- package/docs/API-reference/components/common/scroll/x-components.base-id-scroll.md +0 -216
- package/docs/API-reference/components/common/scroll/x-components.base-main-scroll.md +0 -170
- package/js/components/scroll/base-id-scroll.vue.js.map +0 -1
- package/js/components/scroll/base-id-scroll.vue_rollup-plugin-vue=script.js +0 -110
- package/js/components/scroll/base-id-scroll.vue_rollup-plugin-vue=script.js.map +0 -1
- package/js/components/scroll/base-main-scroll.vue.js.map +0 -1
- package/js/components/scroll/base-main-scroll.vue_rollup-plugin-vue=script.js +0 -105
- package/js/components/scroll/base-main-scroll.vue_rollup-plugin-vue=script.js.map +0 -1
- package/js/components/scroll/base-scroll-to-top.vue.js.map +0 -1
- package/js/components/scroll/base-scroll-to-top.vue_rollup-plugin-vue=script.js +0 -179
- package/js/components/scroll/base-scroll-to-top.vue_rollup-plugin-vue=script.js.map +0 -1
- package/js/x-modules/next-queries/utils.js +0 -15
- package/js/x-modules/next-queries/utils.js.map +0 -1
- package/js/x-modules/url/store/actions/update-store-from-url.action.js +0 -29
- package/js/x-modules/url/store/actions/update-store-from-url.action.js.map +0 -1
- package/types/components/scroll/base-id-scroll.vue.d.ts.map +0 -1
- package/types/components/scroll/base-main-scroll.vue.d.ts +0 -78
- package/types/components/scroll/base-main-scroll.vue.d.ts.map +0 -1
- package/types/components/scroll/base-scroll-to-top.vue.d.ts +0 -119
- package/types/components/scroll/base-scroll-to-top.vue.d.ts.map +0 -1
- package/types/types/query-origin.d.ts +0 -7
- package/types/types/query-origin.d.ts.map +0 -1
- package/types/x-modules/next-queries/utils.d.ts +0 -12
- package/types/x-modules/next-queries/utils.d.ts.map +0 -1
- package/types/x-modules/url/store/actions/update-store-from-url.action.d.ts +0 -12
- package/types/x-modules/url/store/actions/update-store-from-url.action.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"x-plugin.mixin.js","sources":["../../../src/plugins/x-plugin.mixin.ts"],"sourcesContent":["import Vue, { ComponentOptions } from 'vue';\nimport { XComponent } from '../components/x-component.types';\nimport { getXComponentXModuleName, isXComponent } from '../components/x-component.utils';\nimport { XEvent, XEventPayload } from '../wiring/events.types';\nimport { WireMetadata } from '../wiring/wiring.types';\nimport {
|
|
1
|
+
{"version":3,"file":"x-plugin.mixin.js","sources":["../../../src/plugins/x-plugin.mixin.ts"],"sourcesContent":["import Vue, { ComponentOptions } from 'vue';\nimport { XComponent } from '../components/x-component.types';\nimport { getXComponentXModuleName, isXComponent } from '../components/x-component.utils';\nimport { XEvent, XEventPayload } from '../wiring/events.types';\nimport { WireMetadata } from '../wiring/wiring.types';\nimport { FeatureLocation } from '../types/origin';\nimport { XBus } from './x-bus.types';\nimport { getAliasAPI } from './x-plugin.alias';\nimport { XComponentAPI, XComponentBusAPI } from './x-plugin.types';\n\ndeclare module 'vue/types/vue' {\n export interface Vue {\n $x: XComponentAPI;\n }\n}\n\ninterface PrivateExtendedVueComponent extends Vue {\n $location?: FeatureLocation;\n xComponent: XComponent | undefined;\n}\n\n/**\n * Vue global mixin that adds a `$x` object to every component with the {@link XComponentAPI}.\n *\n * @remarks It adds an injection property `origin` which value is included in the metadata of each\n * event emitted with `$x.emit`.\n *\n * @param bus - The {@link XBus} to use inside the components for emitting events.\n * @returns Mixin options which registers the component as X-Component and the $x.\n * @internal\n */\nexport const createXComponentAPIMixin = (\n bus: XBus\n): ComponentOptions<Vue> & ThisType<PrivateExtendedVueComponent> => ({\n inject: {\n $location: {\n from: 'location',\n default: undefined\n }\n },\n created(): void {\n this.xComponent = getRootXComponent(this);\n const aliasAPI = getAliasAPI(this.$store);\n const busAPI = getBusAPI(bus, this);\n this.$x = Object.assign(aliasAPI, busAPI);\n }\n});\n\n/**\n * Creates an object containing the API related to the {@link XBus}.\n *\n * @param bus - The global {@link XBus}.\n * @param component - The component instance.\n *\n * @returns An object containing the {@link XComponentBusAPI}.\n * @internal\n */\nexport function getBusAPI(bus: XBus, component: PrivateExtendedVueComponent): XComponentBusAPI {\n return {\n emit: <Event extends XEvent>(\n event: Event,\n payload?: XEventPayload<Event>,\n metadata: Omit<WireMetadata, 'moduleName'> = {}\n ) => {\n bus.emit(event, payload as any, createWireMetadata(component, metadata));\n component.xComponent?.$emit(event, payload);\n },\n on: bus.on.bind(bus)\n };\n}\n\n/**\n * Creates a wire metadata object based on the component and the provided metadata.\n *\n * @param component - The component this metadata belongs to.\n * @param metadata - Additional metadata emitted by the component.\n * @returns A {@link WireMetadata} object.\n * @internal\n */\nfunction createWireMetadata(\n component: PrivateExtendedVueComponent,\n metadata: Partial<WireMetadata>\n): WireMetadata {\n return {\n moduleName: getXComponentXModuleName(component.xComponent),\n location: component.$location,\n ...metadata\n };\n}\n\n/**\n * Given a component, finds the root XComponent in the ancestors hierarchy.\n *\n * @param component - The component to find its root XComponent.\n * @returns The root XComponent or undefined if it has not.\n * @public\n */\nexport function getRootXComponent(component: Vue): XComponent | undefined {\n let xComponent: XComponent | undefined;\n while (component !== undefined && component !== null) {\n if (isXComponent(component)) {\n xComponent = component;\n }\n component = component.$parent;\n }\n return xComponent;\n}\n"],"names":[],"mappings":";;;;AAqBA;;;;;;;;;;IAUa,wBAAwB,GAAG,UACtC,GAAS,IACyD,QAAC;IACnE,MAAM,EAAE;QACN,SAAS,EAAE;YACT,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE,SAAS;SACnB;KACF;IACD,OAAO,EAAP;QACE,IAAI,CAAC,UAAU,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAC1C,IAAM,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1C,IAAM,MAAM,GAAG,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACpC,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;KAC3C;CACF,KAAE;AAEH;;;;;;;;;SASgB,SAAS,CAAC,GAAS,EAAE,SAAsC;IACzE,OAAO;QACL,IAAI,EAAE,UACJ,KAAY,EACZ,OAA8B,EAC9B,QAA+C;;YAA/C,yBAAA,EAAA,aAA+C;YAE/C,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,OAAc,EAAE,kBAAkB,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;YACzE,MAAA,SAAS,CAAC,UAAU,0CAAE,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;SAC7C;QACD,EAAE,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC;KACrB,CAAC;AACJ,CAAC;AAED;;;;;;;;AAQA,SAAS,kBAAkB,CACzB,SAAsC,EACtC,QAA+B;IAE/B,kBACE,UAAU,EAAE,wBAAwB,CAAC,SAAS,CAAC,UAAU,CAAC,EAC1D,QAAQ,EAAE,SAAS,CAAC,SAAS,IAC1B,QAAQ,EACX;AACJ,CAAC;AAED;;;;;;;SAOgB,iBAAiB,CAAC,SAAc;IAC9C,IAAI,UAAkC,CAAC;IACvC,OAAO,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,IAAI,EAAE;QACpD,IAAI,YAAY,CAAC,SAAS,CAAC,EAAE;YAC3B,UAAU,GAAG,SAAS,CAAC;SACxB;QACD,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC;KAC/B;IACD,OAAO,UAAU,CAAC;AACpB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-store.utils.js","sources":["../../../../src/store/utils/status-store.utils.ts"],"sourcesContent":["/**\n * Status state type, containing a property to hold the status property.\n *\n * @public\n */\nexport interface StatusState {\n /** The request status. Useful for changing the displayed component depending on whether the\n * request has succeeded, has not been fulfilled or has failed. */\n status: RequestStatus;\n}\n\n/**\n * Status mutations, containing a method to change the current status.\n *\n * @public\n */\nexport interface StatusMutations {\n /**\n * Sets the request status.\n *\n * @param status - The new request status.\n */\n setStatus(status: RequestStatus): void;\n}\n\n/**\n * The possible status of a request:\n * - Success: The request has resolved successfully.\n * - Loading: The request is in process, waiting for a response.\n * - Error: The request has failed.\n *\n * @public\n */\nexport type RequestStatus = 'success' | 'loading' | 'error';\n\n/**\n * Sets the request status. Can be used as a mutation.\n *\n * @param state - The {@link https://vuex.vuejs.org/guide/state.html | state} provided by Vuex.\n * @param status - The new request status.\n * @public\n */\nexport function setStatus(state: StatusState, status: RequestStatus): void {\n state.status = status;\n}\n"],"names":[],"mappings":"AAmCA;;;;;;;SAOgB,SAAS,CAAC,KAAkB,EAAE,MAAqB;IACjE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;AACxB;;;;"}
|
|
1
|
+
{"version":3,"file":"status-store.utils.js","sources":["../../../../src/store/utils/status-store.utils.ts"],"sourcesContent":["/**\n * Status state type, containing a property to hold the status property.\n *\n * @public\n */\nexport interface StatusState {\n /** The request status. Useful for changing the displayed component depending on whether the\n * request has succeeded, has not been fulfilled or has failed. */\n status: RequestStatus;\n}\n\n/**\n * Status mutations, containing a method to change the current status.\n *\n * @public\n */\nexport interface StatusMutations {\n /**\n * Sets the request status.\n *\n * @param status - The new request status.\n */\n setStatus(status: RequestStatus): void;\n}\n\n/**\n * The possible status of a request:\n * - Success: The request has resolved successfully.\n * - Loading: The request is in process, waiting for a response.\n * - Error: The request has failed.\n *\n * @public\n */\nexport type RequestStatus = 'success' | 'loading' | 'error' | 'initial';\n\n/**\n * Sets the request status. Can be used as a mutation.\n *\n * @param state - The {@link https://vuex.vuejs.org/guide/state.html | state} provided by Vuex.\n * @param status - The new request status.\n * @public\n */\nexport function setStatus(state: StatusState, status: RequestStatus): void {\n state.status = status;\n}\n"],"names":[],"mappings":"AAmCA;;;;;;;SAOgB,SAAS,CAAC,KAAkB,EAAE,MAAqB;IACjE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;AACxB;;;;"}
|
package/js/store/x.module.js
CHANGED
|
@@ -8,19 +8,20 @@ var RootXStoreModule = {
|
|
|
8
8
|
state: function () { return ({
|
|
9
9
|
device: null,
|
|
10
10
|
empathize: null,
|
|
11
|
+
extraParams: null,
|
|
12
|
+
facets: null,
|
|
13
|
+
historyQueries: null,
|
|
14
|
+
identifierResults: null,
|
|
11
15
|
nextQueries: null,
|
|
12
16
|
popularSearches: null,
|
|
13
|
-
searchBox: null,
|
|
14
17
|
querySuggestions: null,
|
|
15
|
-
historyQueries: null,
|
|
16
18
|
recommendations: null,
|
|
17
19
|
relatedTags: null,
|
|
18
|
-
|
|
20
|
+
scroll: null,
|
|
19
21
|
search: null,
|
|
20
|
-
|
|
22
|
+
searchBox: null,
|
|
21
23
|
tagging: null,
|
|
22
|
-
url: null
|
|
23
|
-
extraParams: null
|
|
24
|
+
url: null
|
|
24
25
|
}); },
|
|
25
26
|
namespaced: true
|
|
26
27
|
};
|
package/js/store/x.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"x.module.js","sources":["../../../src/store/x.module.ts"],"sourcesContent":["import { Module } from 'vuex';\nimport { RootXStoreState } from './store.types';\n\n/**\n * The type of the x module state has a property for each other sub-module assigned to `null`,\n * so we can avoid re-executing getters every time\n * the `store.registerModule` method is called.\n *\n * @internal\n */\nexport type XModuleState = { [Key in keyof RootXStoreState['x']]: null };\n\n/**\n * The main module of the X Store. All of the other {@link XModule | XModules} will be\n * registered as a sub-module of this one.\n *\n * @internal\n */\nexport const RootXStoreModule: Module<XModuleState, any> = {\n state: () => ({\n device: null,\n empathize: null,\n
|
|
1
|
+
{"version":3,"file":"x.module.js","sources":["../../../src/store/x.module.ts"],"sourcesContent":["import { Module } from 'vuex';\nimport { RootXStoreState } from './store.types';\n\n/**\n * The type of the x module state has a property for each other sub-module assigned to `null`,\n * so we can avoid re-executing getters every time\n * the `store.registerModule` method is called.\n *\n * @internal\n */\nexport type XModuleState = { [Key in keyof RootXStoreState['x']]: null };\n\n/**\n * The main module of the X Store. All of the other {@link XModule | XModules} will be\n * registered as a sub-module of this one.\n *\n * @internal\n */\nexport const RootXStoreModule: Module<XModuleState, any> = {\n state: () => ({\n device: null,\n empathize: null,\n extraParams: null,\n facets: null,\n historyQueries: null,\n identifierResults: null,\n nextQueries: null,\n popularSearches: null,\n querySuggestions: null,\n recommendations: null,\n relatedTags: null,\n scroll: null,\n search: null,\n searchBox: null,\n tagging: null,\n url: null\n }),\n namespaced: true\n};\n"],"names":[],"mappings":"AAYA;;;;;;IAMa,gBAAgB,GAA8B;IACzD,KAAK,EAAE,cAAM,QAAC;QACZ,MAAM,EAAE,IAAI;QACZ,SAAS,EAAE,IAAI;QACf,WAAW,EAAE,IAAI;QACjB,MAAM,EAAE,IAAI;QACZ,cAAc,EAAE,IAAI;QACpB,iBAAiB,EAAE,IAAI;QACvB,WAAW,EAAE,IAAI;QACjB,eAAe,EAAE,IAAI;QACrB,gBAAgB,EAAE,IAAI;QACtB,eAAe,EAAE,IAAI;QACrB,WAAW,EAAE,IAAI;QACjB,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,IAAI;QACZ,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,IAAI;QACb,GAAG,EAAE,IAAI;KACV,IAAC;IACF,UAAU,EAAE,IAAI;;;;;"}
|
package/js/utils/array.js
CHANGED
|
@@ -193,7 +193,25 @@ function deepFlat(array, childrenKey) {
|
|
|
193
193
|
return flatArray(resultantArray, currentItem[childrenKey]);
|
|
194
194
|
}
|
|
195
195
|
return flatArray([], array);
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Creates an Emitter filter function to compare two arrays and filter those that are equal.
|
|
199
|
+
*
|
|
200
|
+
* @param comparator - String with the name of the field of the arrays items to compare, or function
|
|
201
|
+
* to compare items directly.
|
|
202
|
+
* @returns The comparator function that receives two arrays to compare them.
|
|
203
|
+
*
|
|
204
|
+
* @internal
|
|
205
|
+
*/
|
|
206
|
+
function createEmitterArrayFilter(comparator) {
|
|
207
|
+
var comparatorFn = typeof comparator === 'function'
|
|
208
|
+
? comparator
|
|
209
|
+
: function (newItem, oldItem) { return newItem[comparator] === oldItem[comparator]; };
|
|
210
|
+
return function (newCollection, oldCollection) {
|
|
211
|
+
return (newCollection.length !== oldCollection.length ||
|
|
212
|
+
newCollection.some(function (newItem) { return !oldCollection.find(function (oldItem) { return comparatorFn(newItem, oldItem); }); }));
|
|
213
|
+
};
|
|
196
214
|
}
|
|
197
215
|
|
|
198
|
-
export { arrayToObject, deepFilter, deepFlat, groupItemsBy, isArrayEmpty };
|
|
216
|
+
export { arrayToObject, createEmitterArrayFilter, deepFilter, deepFlat, groupItemsBy, isArrayEmpty };
|
|
199
217
|
//# sourceMappingURL=array.js.map
|
package/js/utils/array.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array.js","sources":["../../../src/utils/array.ts"],"sourcesContent":["import { PropsWithType } from './types';\n\n/**\n * Returns if the given array is `null`, `undefined`, or has no elements.\n *\n * @param array - The array to check if it is empty.\n * @returns `true` if the array is `null`, `undefined`, or has no elements. `false` otherwise.\n * @public\n */\nexport function isArrayEmpty(array: unknown[] | undefined | null): array is undefined | null | [] {\n return array == null || array.length === 0;\n}\n\n/**\n * Reduce an array of strings to an object which properties names are the value of each string,\n * and the value under that property are also the string.\n *\n * @param array - Array of strings that will be used to create the object.\n *\n * @returns New object which properties object[key] contains object of each iteration in the\n * array.\n *\n * @example Converting an array to an object:\n * arrayToObject(['a', 'b', 'c']) === \\{a: 'a', b: 'b', c: 'c'\\}\n *\n * @public\n */\nexport function arrayToObject(array: string[]): Record<string, string>;\n/**\n * Reduce an array of objects to an object which properties names are the value of each object[key],\n * and the value under that property are each object. 'key' is the the parameter passed to this\n * function.\n *\n * @param array - Array of objects that contains objects which have object[key] string as a property\n * value.\n * @param key - Key used to access to each object[key] value, used for each property name in the new\n * object.\n *\n * @returns New object which properties object[key] contains object of each iteration in the array.\n *\n * @public\n */\nexport function arrayToObject<ArrayType, KeyType extends string | number>(\n array: ArrayType[],\n key: PropsWithType<ArrayType, KeyType>\n): Record<string, ArrayType>;\n/**\n * Reduce an array to an object. The type of the object returned depends on the type of the params.\n * If the 'key' is passed then the function returns an object which properties names are the value\n * of each object[key] and the value under that property are each object.\n * If the 'key' is not passed then the function returns an object which properties names are each\n * array item, and the value is also the array item.\n *\n * @param array - Array from which to create an object.\n * @param key - Key used to access to each object[key] value, used for each property name in the\n * new object.\n *\n * @returns New object which properties object[key] contains each item in the array and the key is\n * either the item of the array or a property of each item designated by 'key' param.\n *\n * @public\n */\nexport function arrayToObject<ArrayType, KeyType extends string | number>(\n array: ArrayType[],\n key?: PropsWithType<ArrayType, KeyType>\n): Record<string, ArrayType> {\n return array.reduce<Record<string, ArrayType>>((accumulator, current) => {\n if (key) {\n accumulator[current[key] as unknown as string] = current;\n } else if (typeof current === 'string') {\n accumulator[current] = current;\n }\n return accumulator;\n }, {});\n}\n\n/**\n * Groups the array items based on the provided `groupBy` function.\n *\n * @param array - The array to iterate, grouping its items in different arrays based on the\n * `groupBy` function.\n * @param groupBy - A function to determine the group name of a single item.\n * @returns The items grouped in a dictionary.\n *\n * @public\n */\nexport function groupItemsBy<ArrayType, ReturnType extends string | number>(\n array: ArrayType[],\n groupBy: (item: ArrayType, index: number) => ReturnType\n): Record<ReturnType, ArrayType[]> {\n return array.reduce<Record<ReturnType, ArrayType[]>>((accumulator, current, index) => {\n const keyValue = groupBy(current, index);\n if (!accumulator[keyValue]) {\n accumulator[keyValue] = [];\n }\n accumulator[keyValue].push(current);\n return accumulator;\n }, {} as Record<ReturnType, ArrayType[]>);\n}\n\n/**\n * Filters an array with all elements that pass the test implemented by the provided filter\n * function. It also does it recursively if the property accessed, whose name is the parameter\n * childrenKey, to the current iteration in an array.\n *\n * @param array - Array to be filtered.\n * @param filter - Predicate function to test each element of the array. It should return true\n * to keep the element; or false otherwise.\n * @param childrenKey - Property name within the array used to perform a recursive call.\n *\n * @example\n * Input - Output example\n *\n * ```\n * const hierarchicalFilters: Filter[] = [\n * {\n * id: 'filter1'\n * selected: true,\n * children: [\n * {\n * id: 'filter1-1'\n * selected: true,\n * children: []\n * },\n * {\n * id: 'filter1-2'\n * selected: false,\n * children: []\n * }\n * ]\n * },\n * {\n * id: 'filter2',\n * selected: false,\n * children: [\n * {\n * id: 'filter2-1',\n * selected: true // not should happen\n * }\n * ]\n * }\n * ]\n *\n * const filteredArray: Filter[] = deepFilterArray(\n * hierarchicalFilters,\n * filter => filter.selected,\n * 'children'\n * )\n *\n * /*\n * filteredArray = [\n * {\n * id: 'filter1'\n * selected: true,\n * children: [\n * {\n * id: 'filter1-1'\n * selected: true,\n * children: []\n * },\n * {\n * id: 'filter1-2'\n * selected: false,\n * children: []\n * }\n * ]\n * },\n * {\n * id: 'filter1-1'\n * selected: true,\n * children: []\n * }\n * ]\n * ```\n *\n * @returns A new array with the elements that pass the test, or an empty array if no one\n * pass the test.\n *\n * @public\n */\nexport function deepFilter<ArrayType, Key extends PropsWithType<ArrayType, ArrayType[]>>(\n array: ArrayType[],\n filter: (item: ArrayType) => boolean,\n childrenKey: Key\n): ArrayType[] {\n const filterArray = function (\n currentArray: ArrayType[],\n initialArray: ArrayType[] = []\n ): ArrayType[] {\n return currentArray.reduce((result, currentItem) => {\n if (filter(currentItem)) {\n result.push(currentItem);\n filterArray(currentItem[childrenKey], result);\n }\n\n return result;\n }, initialArray);\n };\n\n return filterArray(array);\n}\n\n/**\n * Flat an ArrayType[] recursively using the childrenKey passed as parameter to access to his nested\n * child which is also ArrayType[].\n *\n * @param array - ArrayType[] which each ArrayType has a property childrenKey which value is also\n * an ArrayType[].\n * @param childrenKey - Key used to access to each ArrayType[childrenKey] value which is also\n * an ArrayType[].\n *\n * @returns ArrayType[] with all the nested ArrayType, including the nested ones, at the same depth\n * level.\n *\n * @public\n */\nexport function deepFlat<ArrayType, Key extends PropsWithType<ArrayType, ArrayType[] | undefined>>(\n array: ArrayType[],\n childrenKey: Key\n): ArrayType[] {\n /**\n * Flats an array recursively. In each iteration:\n * - If the currentItem is an array, flatArray is used to reduce it. So, the order of the\n * flatArray arguments defined is important. This happens when the function is called passing an\n * array as the second parameter.\n * - If not, the item is pushed to the resultantArray.\n * - Finally, flatArray function is called again with the currentItem children and the process\n * starts again.\n *\n * It's the main function of the parent. See the description above\n * for further information.\n *\n * @param resultantArray - Flattened array.\n * @param currentItem - ArrayType object.\n *\n * @returns Flattened ArrayType[].\n *\n * @internal\n */\n function flatArray(\n resultantArray: ArrayType[],\n currentItem: ArrayType | ArrayType[]\n ): ArrayType[] {\n if (!currentItem) {\n return resultantArray;\n }\n\n if (Array.isArray(currentItem)) {\n return currentItem.reduce(flatArray, resultantArray);\n }\n resultantArray.push(currentItem);\n return flatArray(resultantArray, currentItem[childrenKey]);\n }\n\n return flatArray([], array);\n}\n"],"names":[],"mappings":"AAEA;;;;;;;SAOgB,YAAY,CAAC,KAAmC;IAC9D,OAAO,KAAK,IAAI,IAAI,IAAI,KAAK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,IAAI,CAAC,WAAW,CAAC,CAAC;gBACzB,WAAW,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,CAAC;aAC/C;YAED,OAAO,MAAM,CAAC;SACf,EAAE,YAAY,CAAC,CAAC;KAClB,CAAC;IAEF,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5B,CAAC;AAED;;;;;;;;;;;;;;SAcgB,QAAQ,CACtB,KAAkB,EAClB,WAAgB;;;;;;;;;;;;;;;;;;;;IAqBhB,SAAS,SAAS,CAChB,cAA2B,EAC3B,WAAoC;QAEpC,IAAI,CAAC,WAAW,EAAE;YAChB,OAAO,cAAc,CAAC;SACvB;QAED,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;YAC9B,OAAO,WAAW,CAAC,MAAM,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;SACtD;QACD,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACjC,OAAO,SAAS,CAAC,cAAc,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC;KAC5D;IAED,OAAO,SAAS,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;AAC9B;;;;"}
|
|
1
|
+
{"version":3,"file":"array.js","sources":["../../../src/utils/array.ts"],"sourcesContent":["import { PropsWithType } from './types';\n\n/**\n * Returns if the given array is `null`, `undefined`, or has no elements.\n *\n * @param array - The array to check if it is empty.\n * @returns `true` if the array is `null`, `undefined`, or has no elements. `false` otherwise.\n * @public\n */\nexport function isArrayEmpty(array: unknown[] | undefined | null): array is undefined | null | [] {\n return array == null || array.length === 0;\n}\n\n/**\n * Reduce an array of strings to an object which properties names are the value of each string,\n * and the value under that property are also the string.\n *\n * @param array - Array of strings that will be used to create the object.\n *\n * @returns New object which properties object[key] contains object of each iteration in the\n * array.\n *\n * @example Converting an array to an object:\n * arrayToObject(['a', 'b', 'c']) === \\{a: 'a', b: 'b', c: 'c'\\}\n *\n * @public\n */\nexport function arrayToObject(array: string[]): Record<string, string>;\n/**\n * Reduce an array of objects to an object which properties names are the value of each object[key],\n * and the value under that property are each object. 'key' is the the parameter passed to this\n * function.\n *\n * @param array - Array of objects that contains objects which have object[key] string as a property\n * value.\n * @param key - Key used to access to each object[key] value, used for each property name in the new\n * object.\n *\n * @returns New object which properties object[key] contains object of each iteration in the array.\n *\n * @public\n */\nexport function arrayToObject<ArrayType, KeyType extends string | number>(\n array: ArrayType[],\n key: PropsWithType<ArrayType, KeyType>\n): Record<string, ArrayType>;\n/**\n * Reduce an array to an object. The type of the object returned depends on the type of the params.\n * If the 'key' is passed then the function returns an object which properties names are the value\n * of each object[key] and the value under that property are each object.\n * If the 'key' is not passed then the function returns an object which properties names are each\n * array item, and the value is also the array item.\n *\n * @param array - Array from which to create an object.\n * @param key - Key used to access to each object[key] value, used for each property name in the\n * new object.\n *\n * @returns New object which properties object[key] contains each item in the array and the key is\n * either the item of the array or a property of each item designated by 'key' param.\n *\n * @public\n */\nexport function arrayToObject<ArrayType, KeyType extends string | number>(\n array: ArrayType[],\n key?: PropsWithType<ArrayType, KeyType>\n): Record<string, ArrayType> {\n return array.reduce<Record<string, ArrayType>>((accumulator, current) => {\n if (key) {\n accumulator[current[key] as unknown as string] = current;\n } else if (typeof current === 'string') {\n accumulator[current] = current;\n }\n return accumulator;\n }, {});\n}\n\n/**\n * Groups the array items based on the provided `groupBy` function.\n *\n * @param array - The array to iterate, grouping its items in different arrays based on the\n * `groupBy` function.\n * @param groupBy - A function to determine the group name of a single item.\n * @returns The items grouped in a dictionary.\n *\n * @public\n */\nexport function groupItemsBy<ArrayType, ReturnType extends string | number>(\n array: ArrayType[],\n groupBy: (item: ArrayType, index: number) => ReturnType\n): Record<ReturnType, ArrayType[]> {\n return array.reduce<Record<ReturnType, ArrayType[]>>((accumulator, current, index) => {\n const keyValue = groupBy(current, index);\n if (!accumulator[keyValue]) {\n accumulator[keyValue] = [];\n }\n accumulator[keyValue].push(current);\n return accumulator;\n }, {} as Record<ReturnType, ArrayType[]>);\n}\n\n/**\n * Filters an array with all elements that pass the test implemented by the provided filter\n * function. It also does it recursively if the property accessed, whose name is the parameter\n * childrenKey, to the current iteration in an array.\n *\n * @param array - Array to be filtered.\n * @param filter - Predicate function to test each element of the array. It should return true\n * to keep the element; or false otherwise.\n * @param childrenKey - Property name within the array used to perform a recursive call.\n *\n * @example\n * Input - Output example\n *\n * ```\n * const hierarchicalFilters: Filter[] = [\n * {\n * id: 'filter1'\n * selected: true,\n * children: [\n * {\n * id: 'filter1-1'\n * selected: true,\n * children: []\n * },\n * {\n * id: 'filter1-2'\n * selected: false,\n * children: []\n * }\n * ]\n * },\n * {\n * id: 'filter2',\n * selected: false,\n * children: [\n * {\n * id: 'filter2-1',\n * selected: true // not should happen\n * }\n * ]\n * }\n * ]\n *\n * const filteredArray: Filter[] = deepFilterArray(\n * hierarchicalFilters,\n * filter => filter.selected,\n * 'children'\n * )\n *\n * /*\n * filteredArray = [\n * {\n * id: 'filter1'\n * selected: true,\n * children: [\n * {\n * id: 'filter1-1'\n * selected: true,\n * children: []\n * },\n * {\n * id: 'filter1-2'\n * selected: false,\n * children: []\n * }\n * ]\n * },\n * {\n * id: 'filter1-1'\n * selected: true,\n * children: []\n * }\n * ]\n * ```\n *\n * @returns A new array with the elements that pass the test, or an empty array if no one\n * pass the test.\n *\n * @public\n */\nexport function deepFilter<ArrayType, Key extends PropsWithType<ArrayType, ArrayType[]>>(\n array: ArrayType[],\n filter: (item: ArrayType) => boolean,\n childrenKey: Key\n): ArrayType[] {\n const filterArray = function (\n currentArray: ArrayType[],\n initialArray: ArrayType[] = []\n ): ArrayType[] {\n return currentArray.reduce((result, currentItem) => {\n if (filter(currentItem)) {\n result.push(currentItem);\n filterArray(currentItem[childrenKey], result);\n }\n\n return result;\n }, initialArray);\n };\n\n return filterArray(array);\n}\n\n/**\n * Flat an ArrayType[] recursively using the childrenKey passed as parameter to access to his nested\n * child which is also ArrayType[].\n *\n * @param array - ArrayType[] which each ArrayType has a property childrenKey which value is also\n * an ArrayType[].\n * @param childrenKey - Key used to access to each ArrayType[childrenKey] value which is also\n * an ArrayType[].\n *\n * @returns ArrayType[] with all the nested ArrayType, including the nested ones, at the same depth\n * level.\n *\n * @public\n */\nexport function deepFlat<ArrayType, Key extends PropsWithType<ArrayType, ArrayType[] | undefined>>(\n array: ArrayType[],\n childrenKey: Key\n): ArrayType[] {\n /**\n * Flats an array recursively. In each iteration:\n * - If the currentItem is an array, flatArray is used to reduce it. So, the order of the\n * flatArray arguments defined is important. This happens when the function is called passing an\n * array as the second parameter.\n * - If not, the item is pushed to the resultantArray.\n * - Finally, flatArray function is called again with the currentItem children and the process\n * starts again.\n *\n * It's the main function of the parent. See the description above\n * for further information.\n *\n * @param resultantArray - Flattened array.\n * @param currentItem - ArrayType object.\n *\n * @returns Flattened ArrayType[].\n *\n * @internal\n */\n function flatArray(\n resultantArray: ArrayType[],\n currentItem: ArrayType | ArrayType[]\n ): ArrayType[] {\n if (!currentItem) {\n return resultantArray;\n }\n\n if (Array.isArray(currentItem)) {\n return currentItem.reduce(flatArray, resultantArray);\n }\n resultantArray.push(currentItem);\n return flatArray(resultantArray, currentItem[childrenKey]);\n }\n\n return flatArray([], array);\n}\n\n/**\n * Creates an Emitter filter function to compare two arrays and filter those that are equal.\n *\n * @param comparator - String with the name of the field of the arrays items to compare, or function\n * to compare items directly.\n * @returns The comparator function that receives two arrays to compare them.\n *\n * @internal\n */\nexport function createEmitterArrayFilter<T>(\n comparator: keyof T | ((item1: T, item2: T) => boolean)\n): (newCollection: Array<T>, oldCollection: Array<T>) => boolean {\n const comparatorFn =\n typeof comparator === 'function'\n ? comparator\n : (newItem: T, oldItem: T) => newItem[comparator] === oldItem[comparator];\n return function (newCollection: Array<T>, oldCollection: Array<T>): boolean {\n return (\n newCollection.length !== oldCollection.length ||\n newCollection.some(newItem => !oldCollection.find(oldItem => comparatorFn(newItem, oldItem)))\n );\n };\n}\n"],"names":[],"mappings":"AAEA;;;;;;;SAOgB,YAAY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,OAAO,CAAC,GAAA,CAAC,GAAA,CAAC,EAC7F;KACH,CAAC;AACJ;;;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a {@link QueryOrigin} or a {@link ResultOrigin} string given a {@link QueryFeature} and
|
|
3
|
+
* a {@link FeatureLocation}.
|
|
4
|
+
* If it can't be created, it returns `undefined`.
|
|
5
|
+
*
|
|
6
|
+
* @param originInit - An object containing the needed properties to create a {@link QueryOrigin} or
|
|
7
|
+
* a {@link ResultOrigin}.
|
|
8
|
+
* @returns The composed origin, or `null` if it is not able to create the origin.
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
function createOrigin(_a) {
|
|
12
|
+
var feature = _a.feature, location = _a.location;
|
|
13
|
+
if (location && feature) {
|
|
14
|
+
return feature + ":" + location;
|
|
15
|
+
}
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { createOrigin };
|
|
20
|
+
//# sourceMappingURL=origin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"origin.js","sources":["../../../src/utils/origin.ts"],"sourcesContent":["import { QueryOrigin, QueryOriginInit, ResultOrigin } from '../types/origin';\n\n/**\n * Creates a {@link QueryOrigin} or a {@link ResultOrigin} string given a {@link QueryFeature} and\n * a {@link FeatureLocation}.\n * If it can't be created, it returns `undefined`.\n *\n * @param originInit - An object containing the needed properties to create a {@link QueryOrigin} or\n * a {@link ResultOrigin}.\n * @returns The composed origin, or `null` if it is not able to create the origin.\n * @internal\n */\nexport function createOrigin({\n feature,\n location\n}: QueryOriginInit): QueryOrigin | ResultOrigin | null {\n if (location && feature) {\n return `${feature}:${location}`;\n }\n return null;\n}\n"],"names":[],"mappings":"AAEA;;;;;;;;;;SAUgB,YAAY,CAAC,EAGX;QAFhB,OAAO,aAAA,EACP,QAAQ,cAAA;IAER,IAAI,QAAQ,IAAI,OAAO,EAAE;QACvB,OAAU,OAAO,SAAI,QAAU,CAAC;KACjC;IACD,OAAO,IAAI,CAAC;AACd;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __awaiter, __generator,
|
|
1
|
+
import { __awaiter, __generator, __assign } from 'tslib';
|
|
2
2
|
import Vue from 'vue';
|
|
3
3
|
import { cleanUndefined } from '../../utils/object.js';
|
|
4
4
|
import { deepMerge } from '@empathyco/x-deep-merge';
|
|
@@ -162,11 +162,14 @@ var XInstaller = /** @class */ (function () {
|
|
|
162
162
|
* @internal
|
|
163
163
|
*/
|
|
164
164
|
XInstaller.prototype.getAdapterConfig = function (_a) {
|
|
165
|
-
var instance = _a.instance, env = _a.env, lang = _a.lang, searchLang = _a.searchLang, scope = _a.scope
|
|
165
|
+
var instance = _a.instance, env = _a.env, lang = _a.lang, searchLang = _a.searchLang, scope = _a.scope;
|
|
166
166
|
return deepMerge(defaultAdapterConfig, cleanUndefined({
|
|
167
167
|
instance: instance,
|
|
168
168
|
env: env,
|
|
169
|
-
requestParams:
|
|
169
|
+
requestParams: {
|
|
170
|
+
lang: searchLang !== null && searchLang !== void 0 ? searchLang : lang,
|
|
171
|
+
scope: scope
|
|
172
|
+
}
|
|
170
173
|
}));
|
|
171
174
|
};
|
|
172
175
|
/**
|
|
@@ -273,7 +276,7 @@ var XInstaller = /** @class */ (function () {
|
|
|
273
276
|
var _this = this;
|
|
274
277
|
if (this.options.app !== undefined) {
|
|
275
278
|
var vue = this.getVue();
|
|
276
|
-
vue.observable(snippetConfig);
|
|
279
|
+
snippetConfig = vue.observable(snippetConfig);
|
|
277
280
|
return new vue(__assign(__assign(__assign({}, extraPlugins), this.options.vueOptions), { provide: function () {
|
|
278
281
|
return {
|
|
279
282
|
snippetConfig: snippetConfig
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"x-installer.js","sources":["../../../../src/x-installer/x-installer/x-installer.ts"],"sourcesContent":["import { EmpathyAdapterConfig } from '@empathyco/x-adapter';\nimport { deepMerge } from '@empathyco/x-deep-merge';\nimport Vue, { PluginObject, VueConstructor } from 'vue';\nimport { BaseXBus } from '../../plugins/x-bus';\nimport { XBus } from '../../plugins/x-bus.types';\nimport { XPlugin } from '../../plugins/x-plugin';\nimport { XPluginOptions } from '../../plugins/x-plugin.types';\nimport { cleanUndefined } from '../../utils/object';\nimport { DeepPartial } from '../../utils/types';\nimport { SnippetConfig, XAPI } from '../api/api.types';\nimport { BaseXAPI } from '../api/base-api';\nimport { InstallXOptions, VueConstructorPartialArgument } from './types';\n\ndeclare global {\n interface Window {\n X?: XAPI;\n }\n}\n\nconst defaultAdapterConfig: DeepPartial<EmpathyAdapterConfig> = {\n env: 'live',\n requestParams: {\n lang: 'es',\n scope: 'default'\n }\n};\n\n/**\n * The purpose of this class is to offer a quick way to initialize the XComponents in a setup\n * project. It allows to receive all the options in {@link InstallXOptions} which is an extension\n * of {@link XPluginOptions} with all the options for the plugin and some options more.\n *\n * This class does multiple things:\n * 1. Install the {@link XPlugin} with the {@link XPluginOptions}.\n * 2. Creates the public {@link XAPI} and add it to global window.\n * 3. Creates the Vue Application for the customer project.\n *\n * The steps 2 & 3 are optional and depends on the options passed in {@link InstallXOptions}.\n *\n * @example The way to use this class is the next:\n * 1. Create the installer passing in the {@link InstallXOptions}. This only save the options:\n *\n * ```\n * const installer = new XInstaller(installXOptions)\n * ```\n *\n * 2. Initialize passing the {@link SnippetConfig}. This installs the plugin and creates the App.\n * There are 3 different ways to do this:\n *\n * 2.1 Using the created installer:\n *\n * ```\n * installer.init(snipetConfig)\n * ```\n *\n * 2.2 If the API option is enabled (`createAPI` is `true` in {@link InstallXOptions}, or\n * is not present as the default vlaue is `true`) then this init step can be done with\n * the Public API:\n *\n * ```\n * window.X.init(snippetConfig)\n * ```\n *\n * 2.3 When the script of the project build is loaded it searches for a global `initX`\n * variable that the customer must have in their web site. This variable can be a\n * function that returns the {@link SnippetConfig} or an object that contains the\n * {@link SnippetConfig} itself:\n *\n * ```\n * window.initX = function() {\n * return {\n * instance,\n * env,\n * scope,\n * lang,\n * searchLang,\n * currency,\n * consent,\n * documentDirection\n * };\n * };\n * ```\n *\n * ```\n * window.initX = {\n * instance,\n * env,\n * scope,\n * lang,\n * searchLang,\n * currency,\n * consent,\n * documentDirection\n * };\n * ```\n *\n * @public\n */\nexport class XInstaller {\n private api?: XAPI;\n\n /**\n * Receives the {@link InstallXOptions} and merges it with the default fallback options. Also\n * creates the public {@link XAPI}.\n *\n * @param options - The {@link InstallXOptions}.\n *\n * @public\n */\n public constructor(protected readonly options: InstallXOptions) {\n this.createAPI();\n }\n\n /**\n * Creates the public {@link XAPI} using the `api` option from {@link InstallXOptions}. If this\n * `api` option is not passed, then a default {@link BaseXAPI} is created. To disable the API\n * creation the value `false` must be passed in the `api` option.\n *\n * @internal\n */\n protected createAPI(): void {\n const { api } = this.options;\n if (api !== false) {\n this.api = api ?? new BaseXAPI();\n this.api.setInitCallback(this.init.bind(this));\n window.X = this.api;\n }\n }\n\n /**\n * Receives the {@link SnippetConfig | snippet config}, installs the plugin and initializes\n * the Vue application.\n *\n * @param snippetConfig - The {@link SnippetConfig} that receives from snippet\n * integration.\n *\n * @returns Object with the {@link XAPI}, the {@link XBus}, the {@link XPlugin} and the Vue App\n * used in the application.\n *\n * @public\n */\n async init(snippetConfig: SnippetConfig): Promise<{\n app: Vue | undefined;\n api: XAPI | undefined;\n bus: XBus;\n plugin: PluginObject<XPluginOptions>;\n }> {\n const adapterConfig = this.getAdapterConfig(snippetConfig);\n this.applyConfigToAdapter(adapterConfig);\n const bus = this.createBus();\n const pluginOptions = this.getPluginOptions();\n const plugin = this.installPlugin(pluginOptions, bus);\n const extraPlugins = await this.installExtraPlugins(snippetConfig, bus);\n const app = this.createApp(extraPlugins, snippetConfig);\n this.api?.setBus(bus);\n\n return {\n api: this.api,\n app,\n bus,\n plugin\n };\n }\n\n /**\n * Creates the Adapter Config object using the {@link SnippetConfig} to do it. It also\n * merges the default configuration.\n *\n * @param options - The {@link SnippetConfig}.\n *\n * @returns The Adapter Config object.\n *\n * @internal\n */\n protected getAdapterConfig({\n instance,\n env,\n lang,\n searchLang,\n scope,\n consent,\n currency,\n documentDirection,\n ...extraParams\n }: SnippetConfig): unknown {\n return deepMerge(\n defaultAdapterConfig,\n cleanUndefined<DeepPartial<EmpathyAdapterConfig>>({\n instance,\n env,\n requestParams: {\n lang: searchLang ?? lang,\n scope,\n ...extraParams\n }\n })\n );\n }\n\n /**\n * Creates the {@link XPluginOptions} object.\n *\n * @returns The {@link XPluginOptions} object.\n *\n * @internal\n */\n protected getPluginOptions(): XPluginOptions {\n const { adapter, store, initialXModules, xModules, __PRIVATE__xModules } = this.options;\n return {\n adapter,\n store,\n xModules,\n initialXModules,\n __PRIVATE__xModules\n };\n }\n\n /**\n * It applies the snippet configuration to the Adapter. Not all the parameters are for the Adapter\n * but they appear destructured to not include them in the `extraParams` parameter.\n *\n * @param adapterConfig - The Adapter config object.\n *\n * @internal\n */\n protected applyConfigToAdapter(adapterConfig: any): void {\n this.options.adapter.setConfig?.(adapterConfig);\n }\n\n /**\n * This method returns the bus instance to be used in the {@link XPlugin} and in the {@link XAPI}.\n * It returns the `bus` parameter in the {@link InstallXOptions} or if not provided, then\n * creates a new instance of {@link BaseXBus}.\n *\n * @returns XBus - The bus instance.\n *\n * @internal\n */\n protected createBus(): XBus {\n return this.options.bus ?? new BaseXBus();\n }\n\n /**\n * This method returns the VueConstructor to use to create the App instance.\n * It returns the `vue` parameter in the {@link InstallXOptions} or if not provided, then\n * returns the default Vue.\n *\n * @remarks The purpose of this option is mainly the testing. In a test we can use this option\n * to pass the local vue instance created by `createLocalVue` method.\n *\n * @returns VueConstructor - The vue constructor to create the App instance.\n *\n * @internal\n */\n protected getVue(): VueConstructor {\n return this.options.vue ?? Vue;\n }\n\n /**\n * Creates and install the Vue Plugin. If `plugin` parameter is passed in the\n * {@link InstallXOptions}, then it is used. If not, then a new instance of {@link XPlugin} is\n * created and installed.\n *\n * @param pluginOptions - The {@link XPluginOptions} to passed as parameter to the install method\n * of the plugin.\n * @param bus - The {@link XBus} to be used to create the XPlugin.\n *\n * @returns PluginObject<XPluginOption> - The plugin instance.\n * @internal\n */\n protected installPlugin(pluginOptions: XPluginOptions, bus: XBus): PluginObject<XPluginOptions> {\n const plugin = this.options.plugin ?? new XPlugin(bus);\n const vue = this.getVue();\n vue.use(plugin, pluginOptions);\n return plugin;\n }\n\n /**\n * Install more plugins to Vue defined by the user.\n *\n * @param snippet - The snippet configuration.\n * @param bus - The events bus used in the application.\n * @returns The arguments from the plugins installation to be used in Vue's constructor.\n * @internal\n */\n protected installExtraPlugins(\n snippet: SnippetConfig,\n bus: XBus\n ): Promise<VueConstructorPartialArgument> {\n const vue = this.getVue();\n return Promise.resolve(this.options.installExtraPlugins?.({ vue, snippet, bus }));\n }\n\n /**\n * In the case that the `app` parameter is present in the {@link InstallXOptions}, then a new Vue\n * application is created using that app.\n *\n * @param extraPlugins - Vue plugins initialisation data.\n * @param snippetConfig - Configuration from the client snippet.\n * @returns The Created Vue application or undefined if not created.\n *\n * @internal\n */\n protected createApp(\n extraPlugins: VueConstructorPartialArgument,\n snippetConfig: SnippetConfig\n ): Vue | undefined {\n if (this.options.app !== undefined) {\n const vue = this.getVue();\n vue.observable(snippetConfig);\n return new vue({\n ...extraPlugins,\n ...this.options.vueOptions,\n provide() {\n return {\n snippetConfig\n };\n },\n store: this.options.store,\n el: this.getMountingTarget(this.options.domElement),\n render: h => h(this.options.app)\n });\n }\n }\n\n /**\n * It returns the HTML element to mount the Vue Application. If the `domElement` parameter in the\n * {@link InstallXOptions} is an Element or a string, then it is used. If it is\n * not present then a new <div> Element is created and append to the body to be used.\n *\n * @param elementOrSelector - String or Element used to mount the Vue App.\n *\n * @returns The Element to use as mounting point for the Vue App.\n * @internal\n */\n protected getMountingTarget(elementOrSelector?: string | Element): Element {\n if (typeof elementOrSelector === 'string') {\n const target = document.querySelector(elementOrSelector);\n if (!target) {\n throw Error(\n `XComponents app couldn't be mounted: Element \"${elementOrSelector}\" couldn't be found`\n );\n }\n return target;\n } else if (elementOrSelector !== undefined) {\n return elementOrSelector;\n } else {\n return document.body.appendChild(document.createElement('div'));\n }\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAmBA,IAAM,oBAAoB,GAAsC;IAC9D,GAAG,EAAE,MAAM;IACX,aAAa,EAAE;QACb,IAAI,EAAE,IAAI;QACV,KAAK,EAAE,SAAS;KACjB;CACF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkFE,oBAAsC,OAAwB;QAAxB,YAAO,GAAP,OAAO,CAAiB;QAC5D,IAAI,CAAC,SAAS,EAAE,CAAC;KAClB;;;;;;;;IASS,8BAAS,GAAnB;QACU,IAAA,GAAG,GAAK,IAAI,CAAC,OAAO,IAAjB,CAAkB;QAC7B,IAAI,GAAG,KAAK,KAAK,EAAE;YACjB,IAAI,CAAC,GAAG,GAAG,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,IAAI,QAAQ,EAAE,CAAC;YACjC,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;YAC/C,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC;SACrB;KACF;;;;;;;;;;;;;IAcK,yBAAI,GAAV,UAAW,aAA4B;;;;;;;wBAM/B,aAAa,GAAG,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;wBAC3D,IAAI,CAAC,oBAAoB,CAAC,aAAa,CAAC,CAAC;wBACnC,GAAG,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;wBACvB,aAAa,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;wBACxC,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC;wBACjC,qBAAM,IAAI,CAAC,mBAAmB,CAAC,aAA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AAC,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EACnD,MAAM,EAAE,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,KAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAA,IAChC,CAAC;SACJ;KACF;;;;;;;;;;;IAYS,sCAAiB,GAA3B,UAA4B,iBAAoC;QAC9D,IAAI,OAAO,iBAAiB,KAAK,QAAQ,EAAE;YACzC,IAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC;YACzD,IAAI,CAAC,MAAM,EAAE;gBACX,MAAM,KAAK,CACT,oDAAiD,iBAAiB,yBAAqB,CACxF,CAAC;aACH;YACD,OAAO,MAAM,CAAC;SACf;aAAM,IAAI,iBAAiB,KAAK,SAAS,EAAE;YAC1C,OAAO,iBAAiB,CAAC;SAC1B;aAAM;YACL,OAAO,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;SACjE;KACF;IACH,iBAAC;AAAD,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"x-installer.js","sources":["../../../../src/x-installer/x-installer/x-installer.ts"],"sourcesContent":["import { EmpathyAdapterConfig } from '@empathyco/x-adapter';\nimport { deepMerge } from '@empathyco/x-deep-merge';\nimport Vue, { PluginObject, VueConstructor } from 'vue';\nimport { BaseXBus } from '../../plugins/x-bus';\nimport { XBus } from '../../plugins/x-bus.types';\nimport { XPlugin } from '../../plugins/x-plugin';\nimport { XPluginOptions } from '../../plugins/x-plugin.types';\nimport { cleanUndefined } from '../../utils/object';\nimport { DeepPartial } from '../../utils/types';\nimport { SnippetConfig, XAPI } from '../api/api.types';\nimport { BaseXAPI } from '../api/base-api';\nimport { InstallXOptions, VueConstructorPartialArgument } from './types';\n\ndeclare global {\n interface Window {\n X?: XAPI;\n }\n}\n\nconst defaultAdapterConfig: DeepPartial<EmpathyAdapterConfig> = {\n env: 'live',\n requestParams: {\n lang: 'es',\n scope: 'default'\n }\n};\n\n/**\n * The purpose of this class is to offer a quick way to initialize the XComponents in a setup\n * project. It allows to receive all the options in {@link InstallXOptions} which is an extension\n * of {@link XPluginOptions} with all the options for the plugin and some options more.\n *\n * This class does multiple things:\n * 1. Install the {@link XPlugin} with the {@link XPluginOptions}.\n * 2. Creates the public {@link XAPI} and add it to global window.\n * 3. Creates the Vue Application for the customer project.\n *\n * The steps 2 & 3 are optional and depends on the options passed in {@link InstallXOptions}.\n *\n * @example The way to use this class is the next:\n * 1. Create the installer passing in the {@link InstallXOptions}. This only save the options:\n *\n * ```\n * const installer = new XInstaller(installXOptions)\n * ```\n *\n * 2. Initialize passing the {@link SnippetConfig}. This installs the plugin and creates the App.\n * There are 3 different ways to do this:\n *\n * 2.1 Using the created installer:\n *\n * ```\n * installer.init(snipetConfig)\n * ```\n *\n * 2.2 If the API option is enabled (`createAPI` is `true` in {@link InstallXOptions}, or\n * is not present as the default vlaue is `true`) then this init step can be done with\n * the Public API:\n *\n * ```\n * window.X.init(snippetConfig)\n * ```\n *\n * 2.3 When the script of the project build is loaded it searches for a global `initX`\n * variable that the customer must have in their web site. This variable can be a\n * function that returns the {@link SnippetConfig} or an object that contains the\n * {@link SnippetConfig} itself:\n *\n * ```\n * window.initX = function() {\n * return {\n * instance,\n * env,\n * scope,\n * lang,\n * searchLang,\n * currency,\n * consent,\n * documentDirection\n * };\n * };\n * ```\n *\n * ```\n * window.initX = {\n * instance,\n * env,\n * scope,\n * lang,\n * searchLang,\n * currency,\n * consent,\n * documentDirection\n * };\n * ```\n *\n * @public\n */\nexport class XInstaller {\n private api?: XAPI;\n\n /**\n * Receives the {@link InstallXOptions} and merges it with the default fallback options. Also\n * creates the public {@link XAPI}.\n *\n * @param options - The {@link InstallXOptions}.\n *\n * @public\n */\n public constructor(protected readonly options: InstallXOptions) {\n this.createAPI();\n }\n\n /**\n * Creates the public {@link XAPI} using the `api` option from {@link InstallXOptions}. If this\n * `api` option is not passed, then a default {@link BaseXAPI} is created. To disable the API\n * creation the value `false` must be passed in the `api` option.\n *\n * @internal\n */\n protected createAPI(): void {\n const { api } = this.options;\n if (api !== false) {\n this.api = api ?? new BaseXAPI();\n this.api.setInitCallback(this.init.bind(this));\n window.X = this.api;\n }\n }\n\n /**\n * Receives the {@link SnippetConfig | snippet config}, installs the plugin and initializes\n * the Vue application.\n *\n * @param snippetConfig - The {@link SnippetConfig} that receives from snippet\n * integration.\n *\n * @returns Object with the {@link XAPI}, the {@link XBus}, the {@link XPlugin} and the Vue App\n * used in the application.\n *\n * @public\n */\n async init(snippetConfig: SnippetConfig): Promise<{\n app: Vue | undefined;\n api: XAPI | undefined;\n bus: XBus;\n plugin: PluginObject<XPluginOptions>;\n }> {\n const adapterConfig = this.getAdapterConfig(snippetConfig);\n this.applyConfigToAdapter(adapterConfig);\n const bus = this.createBus();\n const pluginOptions = this.getPluginOptions();\n const plugin = this.installPlugin(pluginOptions, bus);\n const extraPlugins = await this.installExtraPlugins(snippetConfig, bus);\n const app = this.createApp(extraPlugins, snippetConfig);\n this.api?.setBus(bus);\n\n return {\n api: this.api,\n app,\n bus,\n plugin\n };\n }\n\n /**\n * Creates the Adapter Config object using the {@link SnippetConfig} to do it. It also\n * merges the default configuration.\n *\n * @param options - The {@link SnippetConfig}.\n *\n * @returns The Adapter Config object.\n *\n * @internal\n */\n protected getAdapterConfig({ instance, env, lang, searchLang, scope }: SnippetConfig): unknown {\n return deepMerge(\n defaultAdapterConfig,\n cleanUndefined<DeepPartial<EmpathyAdapterConfig>>({\n instance,\n env,\n requestParams: {\n lang: searchLang ?? lang,\n scope\n }\n })\n );\n }\n\n /**\n * Creates the {@link XPluginOptions} object.\n *\n * @returns The {@link XPluginOptions} object.\n *\n * @internal\n */\n protected getPluginOptions(): XPluginOptions {\n const { adapter, store, initialXModules, xModules, __PRIVATE__xModules } = this.options;\n return {\n adapter,\n store,\n xModules,\n initialXModules,\n __PRIVATE__xModules\n };\n }\n\n /**\n * It applies the snippet configuration to the Adapter. Not all the parameters are for the Adapter\n * but they appear destructured to not include them in the `extraParams` parameter.\n *\n * @param adapterConfig - The Adapter config object.\n *\n * @internal\n */\n protected applyConfigToAdapter(adapterConfig: any): void {\n this.options.adapter.setConfig?.(adapterConfig);\n }\n\n /**\n * This method returns the bus instance to be used in the {@link XPlugin} and in the {@link XAPI}.\n * It returns the `bus` parameter in the {@link InstallXOptions} or if not provided, then\n * creates a new instance of {@link BaseXBus}.\n *\n * @returns XBus - The bus instance.\n *\n * @internal\n */\n protected createBus(): XBus {\n return this.options.bus ?? new BaseXBus();\n }\n\n /**\n * This method returns the VueConstructor to use to create the App instance.\n * It returns the `vue` parameter in the {@link InstallXOptions} or if not provided, then\n * returns the default Vue.\n *\n * @remarks The purpose of this option is mainly the testing. In a test we can use this option\n * to pass the local vue instance created by `createLocalVue` method.\n *\n * @returns VueConstructor - The vue constructor to create the App instance.\n *\n * @internal\n */\n protected getVue(): VueConstructor {\n return this.options.vue ?? Vue;\n }\n\n /**\n * Creates and install the Vue Plugin. If `plugin` parameter is passed in the\n * {@link InstallXOptions}, then it is used. If not, then a new instance of {@link XPlugin} is\n * created and installed.\n *\n * @param pluginOptions - The {@link XPluginOptions} to passed as parameter to the install method\n * of the plugin.\n * @param bus - The {@link XBus} to be used to create the XPlugin.\n *\n * @returns PluginObject<XPluginOption> - The plugin instance.\n * @internal\n */\n protected installPlugin(pluginOptions: XPluginOptions, bus: XBus): PluginObject<XPluginOptions> {\n const plugin = this.options.plugin ?? new XPlugin(bus);\n const vue = this.getVue();\n vue.use(plugin, pluginOptions);\n return plugin;\n }\n\n /**\n * Install more plugins to Vue defined by the user.\n *\n * @param snippet - The snippet configuration.\n * @param bus - The events bus used in the application.\n * @returns The arguments from the plugins installation to be used in Vue's constructor.\n * @internal\n */\n protected installExtraPlugins(\n snippet: SnippetConfig,\n bus: XBus\n ): Promise<VueConstructorPartialArgument> {\n const vue = this.getVue();\n return Promise.resolve(this.options.installExtraPlugins?.({ vue, snippet, bus }));\n }\n\n /**\n * In the case that the `app` parameter is present in the {@link InstallXOptions}, then a new Vue\n * application is created using that app.\n *\n * @param extraPlugins - Vue plugins initialisation data.\n * @param snippetConfig - Configuration from the client snippet.\n * @returns The Created Vue application or undefined if not created.\n *\n * @internal\n */\n protected createApp(\n extraPlugins: VueConstructorPartialArgument,\n snippetConfig: SnippetConfig\n ): Vue | undefined {\n if (this.options.app !== undefined) {\n const vue = this.getVue();\n snippetConfig = vue.observable(snippetConfig);\n return new vue({\n ...extraPlugins,\n ...this.options.vueOptions,\n provide() {\n return {\n snippetConfig\n };\n },\n store: this.options.store,\n el: this.getMountingTarget(this.options.domElement),\n render: h => h(this.options.app)\n });\n }\n }\n\n /**\n * It returns the HTML element to mount the Vue Application. If the `domElement` parameter in the\n * {@link InstallXOptions} is an Element or a string, then it is used. If it is\n * not present then a new <div> Element is created and append to the body to be used.\n *\n * @param elementOrSelector - String or Element used to mount the Vue App.\n *\n * @returns The Element to use as mounting point for the Vue App.\n * @internal\n */\n protected getMountingTarget(elementOrSelector?: string | Element): Element {\n if (typeof elementOrSelector === 'string') {\n const target = document.querySelector(elementOrSelector);\n if (!target) {\n throw Error(\n `XComponents app couldn't be mounted: Element \"${elementOrSelector}\" couldn't be found`\n );\n }\n return target;\n } else if (elementOrSelector !== undefined) {\n return elementOrSelector;\n } else {\n return document.body.appendChild(document.createElement('div'));\n }\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAmBA,IAAM,oBAAoB,GAAsC;IAC9D,GAAG,EAAE,MAAM;IACX,aAAa,EAAE;QACb,IAAI,EAAE,IAAI;QACV,KAAK,EAAE,SAAS;KACjB;CACF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkFE,oBAAsC,OAAwB;QAAxB,YAAO,GAAP,OAAO,CAAiB;QAC5D,IAAI,CAAC,SAAS,EAAE,CAAC;KAClB;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B;aAAM;YACL,OAAO,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;SACjE;KACF;IACH,iBAAC;AAAD,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extra-params.vue.js","sources":["../../../../../src/x-modules/extra-params/components/extra-params.vue"],"sourcesContent":["<script lang=\"ts\">\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import { xComponentMixin, XEmit } from '../../../components';\n import { Dictionary } from '../../../utils';\n import { extraParamsXModule } from '../x-module';\n\n /**\n * It emits a {@link ExtraParamsXEvents.ExtraParamsProvided} with the values\n * received as a prop.\n *\n * @public\n */\n @Component({\n mixins: [xComponentMixin(extraParamsXModule)]\n })\n export default class ExtraParams extends Vue {\n /**\n * (Required) A Dictionary where the keys are the extra param names and its values.\n *\n * @remarks Emits the {@link ExtraParamsXEvents.ExtraParamsProvided} when the\n * component is rendered or the values changed.\n *\n * @public\n */\n @XEmit('ExtraParamsProvided', {
|
|
1
|
+
{"version":3,"file":"extra-params.vue.js","sources":["../../../../../src/x-modules/extra-params/components/extra-params.vue"],"sourcesContent":["<script lang=\"ts\">\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import { State, xComponentMixin, XEmit } from '../../../components';\n import { Dictionary } from '../../../utils';\n import { extraParamsXModule } from '../x-module';\n\n /**\n * It emits a {@link ExtraParamsXEvents.ExtraParamsProvided} with the values\n * received as a prop.\n *\n * @public\n */\n @Component({\n mixins: [xComponentMixin(extraParamsXModule)]\n })\n export default class ExtraParams extends Vue {\n /**\n * Emits the initial extra params, overriding with the state extra params, just in case, those\n * values were already set by XComponents initialization (url, plugin config, etc.).\n */\n mounted(): void {\n this.$x.emit('ExtraParamsInitialized', this.values);\n this.$x.emit('ExtraParamsProvided', { ...this.values, ...this.storeExtraParams });\n }\n\n /**\n * (Required) A Dictionary where the keys are the extra param names and its values.\n *\n * @remarks Emits the {@link ExtraParamsXEvents.ExtraParamsProvided} when the\n * component is rendered or the values changed.\n *\n * @public\n */\n @XEmit('ExtraParamsProvided', { deep: true })\n @Prop({ required: true })\n public values!: Dictionary<unknown>;\n\n /**\n * State extra params. Used to override the initial extra params.\n */\n @State('extraParams', 'params')\n public storeExtraParams!: Dictionary<unknown>;\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n render(): void {}\n }\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\n- [`ExtraParamsProvided`][1]\n\n[1](./../../api/x-components.extraparamsxevents.extraparamsprovided.md)\n\n## See it in action\n\n_See how the event is triggered when the component is rendered._\n\n```vue\n<template>\n <ExtraParams :values=\"values\" />\n</template>\n\n<script>\n import { ExtraParams } from '@empathyco/x-components/extra-params';\n\n export default {\n name: 'ExtraParamsDemo',\n components: {\n ExtraParams\n },\n data() {\n return {\n values: {\n warehouse: 1234\n }\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":["const"],"mappings":";;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __extends, __decorate } from 'tslib';
|
|
1
|
+
import { __extends, __assign, __decorate } from 'tslib';
|
|
2
2
|
import Vue from 'vue';
|
|
3
3
|
import { Prop, Component } from 'vue-property-decorator';
|
|
4
4
|
import '../../../components/animations/animate-width.vue.js';
|
|
@@ -88,11 +88,9 @@ import '../../../components/result/base-result-fallback-image.vue.js';
|
|
|
88
88
|
import '../../../components/result/base-result-placeholder-image.vue.js';
|
|
89
89
|
import '../../../components/scroll/scroll.mixin.js';
|
|
90
90
|
import '../../../components/scroll/base-scroll.vue.js';
|
|
91
|
-
import '../../../components/scroll/base-id-scroll.vue.js';
|
|
92
|
-
import '../../../components/scroll/base-scroll-to-top.vue.js';
|
|
93
|
-
import '../../../components/scroll/base-main-scroll.vue.js';
|
|
94
91
|
import '../../../components/suggestions/base-suggestion.vue.js';
|
|
95
92
|
import '../../../components/suggestions/base-suggestions.vue.js';
|
|
93
|
+
import '../../../components/auto-progress-bar.vue.js';
|
|
96
94
|
import '../../../components/decorators/injection.consts.js';
|
|
97
95
|
import '../../../components/base-grid.vue.js';
|
|
98
96
|
import '../../../components/base-keyboard-navigation.vue.js';
|
|
@@ -100,12 +98,13 @@ import '../../../components/base-variable-column-grid.vue.js';
|
|
|
100
98
|
import '../../../components/decorators/debounce.decorators.js';
|
|
101
99
|
import '../../../components/sliding-panel.vue.js';
|
|
102
100
|
import '../../../components/items-list.vue.js';
|
|
101
|
+
import { State } from '../../../components/decorators/store.decorators.js';
|
|
102
|
+
import '../../../components/x-component.utils.js';
|
|
103
|
+
import { xComponentMixin } from '../../../components/x-component.mixin.js';
|
|
103
104
|
import '../../../components/layouts/multi-column-max-width-layout.vue.js';
|
|
104
105
|
import '../../../components/layouts/single-column-layout.vue.js';
|
|
105
|
-
import '../../../components/
|
|
106
|
+
import '../../../components/location-provider.vue.js';
|
|
106
107
|
import '../../../components/items-list-injection.mixin.js';
|
|
107
|
-
import '../../../components/x-component.utils.js';
|
|
108
|
-
import { xComponentMixin } from '../../../components/x-component.mixin.js';
|
|
109
108
|
import { extraParamsXModule } from '../x-module.js';
|
|
110
109
|
|
|
111
110
|
/**
|
|
@@ -119,12 +118,23 @@ var ExtraParams = /** @class */ (function (_super) {
|
|
|
119
118
|
function ExtraParams() {
|
|
120
119
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
121
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* Emits the initial extra params, overriding with the state extra params, just in case, those
|
|
123
|
+
* values were already set by XComponents initialization (url, plugin config, etc.).
|
|
124
|
+
*/
|
|
125
|
+
ExtraParams.prototype.mounted = function () {
|
|
126
|
+
this.$x.emit('ExtraParamsInitialized', this.values);
|
|
127
|
+
this.$x.emit('ExtraParamsProvided', __assign(__assign({}, this.values), this.storeExtraParams));
|
|
128
|
+
};
|
|
122
129
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
123
130
|
ExtraParams.prototype.render = function () { };
|
|
124
131
|
__decorate([
|
|
125
|
-
XEmit('ExtraParamsProvided', {
|
|
132
|
+
XEmit('ExtraParamsProvided', { deep: true }),
|
|
126
133
|
Prop({ required: true })
|
|
127
134
|
], ExtraParams.prototype, "values", void 0);
|
|
135
|
+
__decorate([
|
|
136
|
+
State('extraParams', 'params')
|
|
137
|
+
], ExtraParams.prototype, "storeExtraParams", void 0);
|
|
128
138
|
ExtraParams = __decorate([
|
|
129
139
|
Component({
|
|
130
140
|
mixins: [xComponentMixin(extraParamsXModule)]
|
package/js/x-modules/extra-params/components/extra-params.vue_rollup-plugin-vue=script.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extra-params.vue_rollup-plugin-vue=script.js","sources":["../../../../../src/x-modules/extra-params/components/extra-params.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\nimport Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport { xComponentMixin, XEmit } from '../../../components';\nimport { Dictionary } from '../../../utils';\nimport { extraParamsXModule } from '../x-module';\n\n/**\n * It emits a {@link ExtraParamsXEvents.ExtraParamsProvided} with the values\n * received as a prop.\n *\n * @public\n */\n@Component({\n mixins: [xComponentMixin(extraParamsXModule)]\n})\nexport default class ExtraParams extends Vue {\n /**\n * (Required) A Dictionary where the keys are the extra param names and its values.\n *\n * @remarks Emits the {@link ExtraParamsXEvents.ExtraParamsProvided} when the\n * component is rendered or the values changed.\n *\n * @public\n */\n @XEmit('ExtraParamsProvided', {
|
|
1
|
+
{"version":3,"file":"extra-params.vue_rollup-plugin-vue=script.js","sources":["../../../../../src/x-modules/extra-params/components/extra-params.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\nimport Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport { State, xComponentMixin, XEmit } from '../../../components';\nimport { Dictionary } from '../../../utils';\nimport { extraParamsXModule } from '../x-module';\n\n/**\n * It emits a {@link ExtraParamsXEvents.ExtraParamsProvided} with the values\n * received as a prop.\n *\n * @public\n */\n@Component({\n mixins: [xComponentMixin(extraParamsXModule)]\n})\nexport default class ExtraParams extends Vue {\n /**\n * Emits the initial extra params, overriding with the state extra params, just in case, those\n * values were already set by XComponents initialization (url, plugin config, etc.).\n */\n mounted(): void {\n this.$x.emit('ExtraParamsInitialized', this.values);\n this.$x.emit('ExtraParamsProvided', { ...this.values, ...this.storeExtraParams });\n }\n\n /**\n * (Required) A Dictionary where the keys are the extra param names and its values.\n *\n * @remarks Emits the {@link ExtraParamsXEvents.ExtraParamsProvided} when the\n * component is rendered or the values changed.\n *\n * @public\n */\n @XEmit('ExtraParamsProvided', { deep: true })\n @Prop({ required: true })\n public values!: Dictionary<unknown>;\n\n /**\n * State extra params. Used to override the initial extra params.\n */\n @State('extraParams', 'params')\n public storeExtraParams!: Dictionary<unknown>;\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n render(): void {}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA;;;;;;AASA;IAAyC,+BAAG;IAA5C;;KA8BC;;;;;IAzBC,6BAAO,GAAP;QACE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,wBAAwB,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACpD,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,qBAAqB,wBAAO,IAAI,CAAC,MAAM,GAAK,IAAI,CAAC,gBAAgB,EAAG,CAAC;KACnF;;IAqBD,4BAAM,GAAN,eAAiB;IATjB;QAFC,KAAK,CAAC,qBAAqB,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;QAC5C,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;+CACW;IAMpC;QADC,KAAK,CAAC,aAAa,EAAE,QAAQ,CAAC;yDACe;IA1B3B,WAAW;QAH/B,SAAS,CAAC;YACT,MAAM,EAAE,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;SAC9C,CAAC;OACmB,WAAW,CA8B/B;IAAD,kBAAC;CAAA,CA9BwC,GAAG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderless-extra-param.vue.js","sources":["../../../../../src/x-modules/extra-params/components/renderless-extra-param.vue"],"sourcesContent":["<template>\n <NoElement>\n <slot v-bind=\"{ value, updateValue }\"></slot>\n </NoElement>\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import { NoElement, State, xComponentMixin } from '../../../components';\n import { Dictionary } from '../../../utils';\n import {
|
|
1
|
+
{"version":3,"file":"renderless-extra-param.vue.js","sources":["../../../../../src/x-modules/extra-params/components/renderless-extra-param.vue"],"sourcesContent":["<template>\n <NoElement>\n <slot v-bind=\"{ value, updateValue }\"></slot>\n </NoElement>\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import { NoElement, State, xComponentMixin } from '../../../components';\n import { Dictionary } from '../../../utils';\n import { extraParamsXModule } from '../x-module';\n\n /**\n * It emits a {@link ExtraParamsXEvents.UserChangedExtraParams} when the `updateValue`\n * is called.\n *\n * @public\n */\n @Component({\n mixins: [xComponentMixin(extraParamsXModule)],\n components: {\n NoElement\n }\n })\n export default class RenderlessExtraParam extends Vue {\n /**\n * The extra param's name.\n *\n * @public\n */\n @Prop({ required: true })\n public name!: string;\n\n /**\n * A dictionary with the extra params in the store state.\n *\n * @public\n */\n @State('extraParams', 'params')\n public stateParams!: Dictionary<unknown>;\n\n /**\n * It returns the value of the extra param from the store.\n *\n * @returns - The value from the store.\n *\n * @internal\n */\n protected get value(): unknown {\n return this.stateParams[this.name];\n }\n\n /**\n * It sets the new value to the store.\n *\n * @param newValue - The new value of the extra param.\n *\n * @internal\n */\n protected updateValue(newValue: unknown): void {\n this.$x.emit('UserChangedExtraParams', { [this.name]: newValue });\n }\n }\n</script>\n\n<docs lang=\"mdx\">\n# Examples\n\nRenders default slot content. It binds to the default slot the name of the extra parameter and the\ndefault value of it.\n\n## Basic usage\n\n```vue\n<template>\n <RenderlessExtraParam #default=\"{ value, updateValue }\" name=\"store\">\n <BaseDropdown @change=\"updateValue\" :value=\"value\" :items=\"items\" />\n </RenderlessExtraParam>\n</template>\n\n<script>\n import { RenderlessExtraParams } from '@empathyco/x-components/extra-params';\n import { BaseDropdown } from '@empathyco/x-components';\n\n export default {\n name: 'RenderlessExtraParamsDemo',\n components: {\n RenderlessExtraParams,\n BaseDropdown\n },\n props: ['name'],\n data() {\n return {\n items: ['spain', 'portugal']\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":["const"],"mappings":";;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/js/x-modules/extra-params/components/renderless-extra-param.vue_rollup-plugin-vue=script.js
CHANGED
|
@@ -88,11 +88,9 @@ import '../../../components/result/base-result-fallback-image.vue.js';
|
|
|
88
88
|
import '../../../components/result/base-result-placeholder-image.vue.js';
|
|
89
89
|
import '../../../components/scroll/scroll.mixin.js';
|
|
90
90
|
import '../../../components/scroll/base-scroll.vue.js';
|
|
91
|
-
import '../../../components/scroll/base-id-scroll.vue.js';
|
|
92
|
-
import '../../../components/scroll/base-scroll-to-top.vue.js';
|
|
93
|
-
import '../../../components/scroll/base-main-scroll.vue.js';
|
|
94
91
|
import '../../../components/suggestions/base-suggestion.vue.js';
|
|
95
92
|
import '../../../components/suggestions/base-suggestions.vue.js';
|
|
93
|
+
import '../../../components/auto-progress-bar.vue.js';
|
|
96
94
|
import '../../../components/decorators/injection.consts.js';
|
|
97
95
|
import '../../../components/base-grid.vue.js';
|
|
98
96
|
import '../../../components/base-keyboard-navigation.vue.js';
|
|
@@ -100,18 +98,18 @@ import '../../../components/base-variable-column-grid.vue.js';
|
|
|
100
98
|
import '../../../components/decorators/debounce.decorators.js';
|
|
101
99
|
import '../../../components/sliding-panel.vue.js';
|
|
102
100
|
import '../../../components/items-list.vue.js';
|
|
103
|
-
import '../../../components/layouts/multi-column-max-width-layout.vue.js';
|
|
104
|
-
import '../../../components/layouts/single-column-layout.vue.js';
|
|
105
101
|
import { State } from '../../../components/decorators/store.decorators.js';
|
|
106
|
-
import '../../../components/items-list-injection.mixin.js';
|
|
107
102
|
import '../../../components/x-component.utils.js';
|
|
108
103
|
import { xComponentMixin } from '../../../components/x-component.mixin.js';
|
|
104
|
+
import '../../../components/layouts/multi-column-max-width-layout.vue.js';
|
|
105
|
+
import '../../../components/layouts/single-column-layout.vue.js';
|
|
106
|
+
import '../../../components/location-provider.vue.js';
|
|
107
|
+
import '../../../components/items-list-injection.mixin.js';
|
|
109
108
|
import { extraParamsXModule } from '../x-module.js';
|
|
110
109
|
|
|
111
110
|
/**
|
|
112
111
|
* It emits a {@link ExtraParamsXEvents.UserChangedExtraParams} when the `updateValue`
|
|
113
|
-
* is called
|
|
114
|
-
* a defaultValue.
|
|
112
|
+
* is called.
|
|
115
113
|
*
|
|
116
114
|
* @public
|
|
117
115
|
*/
|
|
@@ -120,20 +118,6 @@ var RenderlessExtraParam = /** @class */ (function (_super) {
|
|
|
120
118
|
function RenderlessExtraParam() {
|
|
121
119
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
122
120
|
}
|
|
123
|
-
/**
|
|
124
|
-
* Emits the {@link ExtraParamsXEvents.ExtraParamsProvided} when the component
|
|
125
|
-
* is mounted if the defaultValue is set.
|
|
126
|
-
*
|
|
127
|
-
* @internal
|
|
128
|
-
*/
|
|
129
|
-
RenderlessExtraParam.prototype.created = function () {
|
|
130
|
-
var _this = this;
|
|
131
|
-
this.$watch(function () { return _this.defaultValue; }, function (defaultValue) {
|
|
132
|
-
if (defaultValue !== undefined && _this.value === undefined) {
|
|
133
|
-
_this.emitEvent('ExtraParamsProvided', _this.defaultValue);
|
|
134
|
-
}
|
|
135
|
-
}, { immediate: true });
|
|
136
|
-
};
|
|
137
121
|
Object.defineProperty(RenderlessExtraParam.prototype, "value", {
|
|
138
122
|
/**
|
|
139
123
|
* It returns the value of the extra param from the store.
|
|
@@ -143,7 +127,7 @@ var RenderlessExtraParam = /** @class */ (function (_super) {
|
|
|
143
127
|
* @internal
|
|
144
128
|
*/
|
|
145
129
|
get: function () {
|
|
146
|
-
return this.
|
|
130
|
+
return this.stateParams[this.name];
|
|
147
131
|
},
|
|
148
132
|
enumerable: false,
|
|
149
133
|
configurable: true
|
|
@@ -156,29 +140,15 @@ var RenderlessExtraParam = /** @class */ (function (_super) {
|
|
|
156
140
|
* @internal
|
|
157
141
|
*/
|
|
158
142
|
RenderlessExtraParam.prototype.updateValue = function (newValue) {
|
|
159
|
-
this.emitEvent('UserChangedExtraParams', newValue);
|
|
160
|
-
};
|
|
161
|
-
/**
|
|
162
|
-
* It emits an {@link ExtraParamsXEvents| event} passed as payload.
|
|
163
|
-
*
|
|
164
|
-
* @param event - The name of the event.
|
|
165
|
-
* @param value - The value of the extra param.
|
|
166
|
-
*
|
|
167
|
-
* @internal
|
|
168
|
-
*/
|
|
169
|
-
RenderlessExtraParam.prototype.emitEvent = function (event, value) {
|
|
170
143
|
var _a;
|
|
171
|
-
this.$x.emit(
|
|
144
|
+
this.$x.emit('UserChangedExtraParams', (_a = {}, _a[this.name] = newValue, _a));
|
|
172
145
|
};
|
|
173
146
|
__decorate([
|
|
174
147
|
Prop({ required: true })
|
|
175
148
|
], RenderlessExtraParam.prototype, "name", void 0);
|
|
176
|
-
__decorate([
|
|
177
|
-
Prop()
|
|
178
|
-
], RenderlessExtraParam.prototype, "defaultValue", void 0);
|
|
179
149
|
__decorate([
|
|
180
150
|
State('extraParams', 'params')
|
|
181
|
-
], RenderlessExtraParam.prototype, "
|
|
151
|
+
], RenderlessExtraParam.prototype, "stateParams", void 0);
|
|
182
152
|
RenderlessExtraParam = __decorate([
|
|
183
153
|
Component({
|
|
184
154
|
mixins: [xComponentMixin(extraParamsXModule)],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderless-extra-param.vue_rollup-plugin-vue=script.js","sources":["../../../../../src/x-modules/extra-params/components/renderless-extra-param.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\nimport Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport { NoElement, State, xComponentMixin } from '../../../components';\nimport { Dictionary } from '../../../utils';\nimport {
|
|
1
|
+
{"version":3,"file":"renderless-extra-param.vue_rollup-plugin-vue=script.js","sources":["../../../../../src/x-modules/extra-params/components/renderless-extra-param.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\nimport Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport { NoElement, State, xComponentMixin } from '../../../components';\nimport { Dictionary } from '../../../utils';\nimport { extraParamsXModule } from '../x-module';\n\n/**\n * It emits a {@link ExtraParamsXEvents.UserChangedExtraParams} when the `updateValue`\n * is called.\n *\n * @public\n */\n@Component({\n mixins: [xComponentMixin(extraParamsXModule)],\n components: {\n NoElement\n }\n})\nexport default class RenderlessExtraParam extends Vue {\n /**\n * The extra param's name.\n *\n * @public\n */\n @Prop({ required: true })\n public name!: string;\n\n /**\n * A dictionary with the extra params in the store state.\n *\n * @public\n */\n @State('extraParams', 'params')\n public stateParams!: Dictionary<unknown>;\n\n /**\n * It returns the value of the extra param from the store.\n *\n * @returns - The value from the store.\n *\n * @internal\n */\n protected get value(): unknown {\n return this.stateParams[this.name];\n }\n\n /**\n * It sets the new value to the store.\n *\n * @param newValue - The new value of the extra param.\n *\n * @internal\n */\n protected updateValue(newValue: unknown): void {\n this.$x.emit('UserChangedExtraParams', { [this.name]: newValue });\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA;;;;;;AAYA;IAAkD,wCAAG;IAArD;;KAsCC;IAdC,sBAAc,uCAAK;;;;;;;;aAAnB;YACE,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACpC;;;OAAA;;;;;;;;IASS,0CAAW,GAArB,UAAsB,QAAiB;;QACrC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,wBAAwB,YAAI,GAAC,IAAI,CAAC,IAAI,IAAG,QAAQ,MAAG,CAAC;KACnE;IA9BD;QADC,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sDACJ;IAQrB;QADC,KAAK,CAAC,aAAa,EAAE,QAAQ,CAAC;6DACU;IAftB,oBAAoB;QANxC,SAAS,CAAC;YACT,MAAM,EAAE,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;YAC7C,UAAU,EAAE;gBACV,SAAS,WAAA;aACV;SACF,CAAC;OACmB,oBAAoB,CAsCxC;IAAD,2BAAC;CAAA,CAtCiD,GAAG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snippet-config-extra-params.vue.js","sources":["../../../../../src/x-modules/extra-params/components/snippet-config-extra-params.vue"],"sourcesContent":["<template>\n <ExtraParams :values=\"extraParams\" />\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component, Watch } from 'vue-property-decorator';\n import { xComponentMixin
|
|
1
|
+
{"version":3,"file":"snippet-config-extra-params.vue.js","sources":["../../../../../src/x-modules/extra-params/components/snippet-config-extra-params.vue"],"sourcesContent":["<template>\n <ExtraParams :values=\"extraParams\" />\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component, Watch, Inject } from 'vue-property-decorator';\n import { xComponentMixin } from '../../../components';\n import { Dictionary, forEach } from '../../../utils';\n import { SnippetConfig } from '../../../x-installer';\n import { extraParamsXModule } from '../x-module';\n import ExtraParams from './extra-params.vue';\n\n /**\n * Extracts the extra parameters from the {@link SnippetConfig} and syncs it with the request\n * objects of every x-module.\n *\n * @public\n */\n @Component({\n components: { ExtraParams },\n mixins: [xComponentMixin(extraParamsXModule)]\n })\n export default class SnippetConfigExtraParams extends Vue {\n /**\n * It injects {@link SnippetConfig} provided by an ancestor as snippetConfig.\n *\n * @internal\n */\n @Inject('snippetConfig')\n public snippetConfig!: SnippetConfig;\n\n /**\n * Custom object containing the extra params from the snippet config.\n *\n * @remarks This object keeps manually the desired snippet config properties to avoid\n * unnecessary re-renders.\n *\n * @internal\n */\n protected extraParams: Dictionary<unknown> = {};\n\n /**\n * Updates the extraParams object when the snippet config changes.\n *\n * @param snippetConfig - The new snippet config.\n *\n * @internal\n */\n @Watch('snippetConfig', { deep: true, immediate: true })\n syncExtraParams({\n instance,\n scope,\n lang,\n searchLang,\n consent,\n documentDirection,\n currency,\n ...snippetExtraParams\n }: SnippetConfig): void {\n forEach(snippetExtraParams, (name, value) => {\n this.$set(this.extraParams, name, value);\n });\n }\n }\n</script>\n\n<docs lang=\"mdx\">\n## See it in action\n\n_See how the snippet config is injected and passed to the SnippetConfigExtraParams component._\n\n```vue\n<template>\n <Provider>\n <SnippetConfigExtraParams />\n </Provider>\n</template>\n\n<script>\n import { SnippetConfigExtraParams } from '@empathyco/x-components/extra-params';\n\n const Provider = {\n provide: {\n snippetConfig: {\n instance: 'demo',\n lang: 'es',\n warehouse: 1234\n }\n }\n };\n\n export default {\n name: 'SnippetConfigExtraParamsDemo',\n components: {\n Provider,\n SnippetConfigExtraParams\n }\n };\n</script>\n```\n</docs>\n"],"names":["const"],"mappings":";;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|