@empathyco/x-components 7.2.1 → 7.2.3
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 +16 -0
- package/core/index.js +3 -3
- package/docs/API-reference/api/x-adapter-platform.browseendpointadapter.md +13 -0
- package/docs/API-reference/api/x-adapter-platform.browserequestmapper.md +13 -0
- package/docs/API-reference/api/x-adapter-platform.browserequestschema.md +13 -0
- package/docs/API-reference/api/x-adapter-platform.browseresponsemapper.md +13 -0
- package/docs/API-reference/api/x-adapter-platform.browseresponseschema.md +13 -0
- package/docs/API-reference/api/x-adapter-platform.md +55 -0
- package/docs/API-reference/api/x-types.browsablerequest.browsefield.md +11 -0
- package/docs/API-reference/api/x-types.browsablerequest.browsevalue.md +11 -0
- package/docs/API-reference/api/x-types.browsablerequest.md +73 -0
- package/docs/API-reference/api/x-types.browserequest.md +15 -0
- package/docs/API-reference/api/x-types.browseresponse.banners.md +11 -0
- package/docs/API-reference/api/x-types.browseresponse.browsetagging.md +11 -0
- package/docs/API-reference/api/x-types.browseresponse.displaybrowsetagging.md +11 -0
- package/docs/API-reference/api/x-types.browseresponse.facets.md +11 -0
- package/docs/API-reference/api/x-types.browseresponse.md +187 -0
- package/docs/API-reference/api/x-types.browseresponse.promoteds.md +11 -0
- package/docs/API-reference/api/x-types.browseresponse.results.md +11 -0
- package/docs/API-reference/api/x-types.browseresponse.stats.md +11 -0
- package/docs/API-reference/api/x-types.browseresponse.totalresults.md +11 -0
- package/docs/API-reference/api/x-types.md +33 -0
- package/js/components/animations/{animate-clip-path.vue2.js → animate-clip-path2.vue.js} +1 -1
- package/js/components/animations/animate-clip-path2.vue.js.map +1 -0
- package/js/components/animations/animate-clip-path3.vue.js +7 -0
- package/js/components/animations/animate-clip-path3.vue.js.map +1 -0
- package/js/components/animations/{animate-scale.vue2.js → animate-scale2.vue.js} +1 -1
- package/js/components/animations/animate-scale2.vue.js.map +1 -0
- package/js/components/animations/{animate-scale.vue3.js → animate-scale3.vue.js} +2 -2
- package/js/components/animations/animate-scale3.vue.js.map +1 -0
- package/js/components/animations/{animate-translate.vue2.js → animate-translate2.vue.js} +1 -1
- package/js/components/animations/animate-translate2.vue.js.map +1 -0
- package/js/components/animations/animate-translate3.vue.js +7 -0
- package/js/components/animations/animate-translate3.vue.js.map +1 -0
- package/js/components/animations/animate-width.vue.js +2 -2
- package/js/components/animations/{animate-width.vue2.js → animate-width2.vue.js} +1 -1
- package/js/components/animations/{animate-width.vue2.js.map → animate-width2.vue.js.map} +1 -1
- package/js/components/animations/{animate-width.vue3.js → animate-width3.vue.js} +1 -1
- package/js/components/animations/animate-width3.vue.js.map +1 -0
- package/js/components/animations/change-height.vue.js +2 -2
- package/js/components/animations/{change-height.vue2.js → change-height2.vue.js} +1 -1
- package/js/components/animations/{change-height.vue2.js.map → change-height2.vue.js.map} +1 -1
- package/js/components/animations/{change-height.vue3.js → change-height3.vue.js} +1 -1
- package/js/components/animations/change-height3.vue.js.map +1 -0
- package/js/components/animations/collapse-height.vue.js +2 -2
- package/js/components/animations/{collapse-height.vue2.js → collapse-height2.vue.js} +1 -1
- package/js/components/animations/{collapse-height.vue2.js.map → collapse-height2.vue.js.map} +1 -1
- package/js/components/animations/{collapse-height.vue3.js → collapse-height3.vue.js} +1 -1
- package/js/components/animations/collapse-height3.vue.js.map +1 -0
- package/js/components/animations/collapse-width.vue.js +2 -2
- package/js/components/animations/{collapse-width.vue2.js → collapse-width2.vue.js} +1 -1
- package/js/components/animations/{collapse-width.vue2.js.map → collapse-width2.vue.js.map} +1 -1
- package/js/components/animations/{collapse-width.vue3.js → collapse-width3.vue.js} +1 -1
- package/js/components/animations/collapse-width3.vue.js.map +1 -0
- package/js/components/animations/cross-fade.vue.js +2 -2
- package/js/components/animations/{cross-fade.vue2.js → cross-fade2.vue.js} +1 -1
- package/js/components/animations/{cross-fade.vue2.js.map → cross-fade2.vue.js.map} +1 -1
- package/js/components/animations/{cross-fade.vue3.js → cross-fade3.vue.js} +1 -1
- package/js/components/animations/cross-fade3.vue.js.map +1 -0
- package/js/components/animations/fade-and-slide.vue.js +2 -2
- package/js/components/animations/{fade-and-slide.vue2.js → fade-and-slide2.vue.js} +1 -1
- package/js/components/animations/{fade-and-slide.vue2.js.map → fade-and-slide2.vue.js.map} +1 -1
- package/js/components/animations/{fade-and-slide.vue3.js → fade-and-slide3.vue.js} +1 -1
- package/js/components/animations/fade-and-slide3.vue.js.map +1 -0
- package/js/components/animations/fade.vue.js +2 -2
- package/js/components/animations/{fade.vue2.js → fade2.vue.js} +1 -1
- package/js/components/animations/{fade.vue2.js.map → fade2.vue.js.map} +1 -1
- package/js/components/animations/{fade.vue3.js → fade3.vue.js} +1 -1
- package/js/components/animations/fade3.vue.js.map +1 -0
- package/js/components/animations/{no-animation.vue2.js → no-animation2.vue.js} +1 -1
- package/js/components/animations/no-animation2.vue.js.map +1 -0
- package/js/components/animations/staggered-fade-and-slide.vue.js +2 -2
- package/js/components/animations/{staggered-fade-and-slide.vue2.js → staggered-fade-and-slide2.vue.js} +1 -1
- package/js/components/animations/{staggered-fade-and-slide.vue2.js.map → staggered-fade-and-slide2.vue.js.map} +1 -1
- package/js/components/animations/{staggered-fade-and-slide.vue3.js → staggered-fade-and-slide3.vue.js} +1 -1
- package/js/components/animations/staggered-fade-and-slide3.vue.js.map +1 -0
- package/js/components/auto-progress-bar.vue.js +2 -2
- package/js/components/{auto-progress-bar.vue2.js → auto-progress-bar2.vue.js} +1 -1
- package/js/components/{auto-progress-bar.vue2.js.map → auto-progress-bar2.vue.js.map} +1 -1
- package/js/components/{auto-progress-bar.vue3.js → auto-progress-bar3.vue.js} +1 -1
- package/js/components/auto-progress-bar3.vue.js.map +1 -0
- package/js/components/base-dropdown.vue.js +2 -2
- package/js/components/{base-dropdown.vue2.js → base-dropdown2.vue.js} +20 -20
- package/js/components/{base-dropdown.vue2.js.map → base-dropdown2.vue.js.map} +1 -1
- package/js/components/{base-dropdown.vue3.js → base-dropdown3.vue.js} +1 -1
- package/js/components/base-dropdown3.vue.js.map +1 -0
- package/js/components/base-event-button.vue.js +1 -1
- package/js/components/{base-event-button.vue2.js → base-event-button2.vue.js} +1 -1
- package/js/components/{base-event-button.vue2.js.map → base-event-button2.vue.js.map} +1 -1
- package/js/components/base-grid.vue.js +2 -2
- package/js/components/{base-grid.vue2.js → base-grid2.vue.js} +1 -1
- package/js/components/{base-grid.vue2.js.map → base-grid2.vue.js.map} +1 -1
- package/js/components/{base-grid.vue3.js → base-grid3.vue.js} +1 -1
- package/js/components/base-grid3.vue.js.map +1 -0
- package/js/components/base-keyboard-navigation.vue.js +1 -1
- package/js/components/{base-keyboard-navigation.vue2.js → base-keyboard-navigation2.vue.js} +1 -1
- package/js/components/{base-keyboard-navigation.vue2.js.map → base-keyboard-navigation2.vue.js.map} +1 -1
- package/js/components/base-rating.vue.js +2 -2
- package/js/components/{base-rating.vue2.js → base-rating2.vue.js} +1 -1
- package/js/components/{base-rating.vue2.js.map → base-rating2.vue.js.map} +1 -1
- package/js/components/{base-rating.vue3.js → base-rating3.vue.js} +1 -1
- package/js/components/base-rating3.vue.js.map +1 -0
- package/js/components/base-slider.vue.js +2 -2
- package/js/components/{base-slider.vue2.js → base-slider2.vue.js} +1 -1
- package/js/components/{base-slider.vue2.js.map → base-slider2.vue.js.map} +1 -1
- package/js/components/{base-slider.vue3.js → base-slider3.vue.js} +1 -1
- package/js/components/base-slider3.vue.js.map +1 -0
- package/js/components/base-switch.vue.js +2 -2
- package/js/components/{base-switch.vue2.js → base-switch2.vue.js} +1 -1
- package/js/components/{base-switch.vue2.js.map → base-switch2.vue.js.map} +1 -1
- package/js/components/{base-switch.vue3.js → base-switch3.vue.js} +1 -1
- package/js/components/base-switch3.vue.js.map +1 -0
- package/js/components/base-teleport.vue.js +1 -1
- package/js/components/{base-teleport.vue2.js → base-teleport2.vue.js} +1 -1
- package/js/components/{base-teleport.vue2.js.map → base-teleport2.vue.js.map} +1 -1
- package/js/components/base-variable-column-grid.vue.js +1 -1
- package/js/components/{base-variable-column-grid.vue2.js → base-variable-column-grid2.vue.js} +1 -1
- package/js/components/{base-variable-column-grid.vue2.js.map → base-variable-column-grid2.vue.js.map} +1 -1
- package/js/components/column-picker/base-column-picker-dropdown.vue.js +1 -1
- package/js/components/column-picker/{base-column-picker-dropdown.vue2.js → base-column-picker-dropdown2.vue.js} +1 -1
- package/js/components/column-picker/{base-column-picker-dropdown.vue2.js.map → base-column-picker-dropdown2.vue.js.map} +1 -1
- package/js/components/column-picker/base-column-picker-list.vue.js +1 -1
- package/js/components/column-picker/{base-column-picker-list.vue2.js → base-column-picker-list2.vue.js} +1 -1
- package/js/components/column-picker/{base-column-picker-list.vue2.js.map → base-column-picker-list2.vue.js.map} +1 -1
- package/js/components/currency/base-currency.vue.js +1 -1
- package/js/components/currency/{base-currency.vue2.js → base-currency2.vue.js} +1 -1
- package/js/components/currency/{base-currency.vue2.js.map → base-currency2.vue.js.map} +1 -1
- package/js/components/{display-click-provider.vue2.js → display-click-provider2.vue.js} +1 -1
- package/js/components/display-click-provider2.vue.js.map +1 -0
- package/js/components/{display-emitter.vue2.js → display-emitter2.vue.js} +1 -1
- package/js/components/display-emitter2.vue.js.map +1 -0
- package/js/components/filters/labels/{base-price-filter-label.vue2.js → base-price-filter-label2.vue.js} +1 -1
- package/js/components/filters/labels/base-price-filter-label2.vue.js.map +1 -0
- package/js/components/filters/labels/base-rating-filter-label.vue.js +1 -1
- package/js/components/filters/labels/{base-rating-filter-label.vue2.js → base-rating-filter-label2.vue.js} +1 -1
- package/js/components/filters/labels/{base-rating-filter-label.vue2.js.map → base-rating-filter-label2.vue.js.map} +1 -1
- package/js/components/{global-x-bus.vue2.js → global-x-bus2.vue.js} +1 -1
- package/js/components/global-x-bus2.vue.js.map +1 -0
- package/js/components/highlight.vue.js +1 -1
- package/js/components/{highlight.vue2.js → highlight2.vue.js} +1 -1
- package/js/components/{highlight.vue2.js.map → highlight2.vue.js.map} +1 -1
- package/js/components/items-list.vue.js +1 -1
- package/js/components/{items-list.vue2.js → items-list2.vue.js} +1 -1
- package/js/components/{items-list.vue2.js.map → items-list2.vue.js.map} +1 -1
- package/js/components/{location-provider.vue2.js → location-provider2.vue.js} +1 -1
- package/js/components/location-provider2.vue.js.map +1 -0
- package/js/components/message.vue.js +17 -17
- package/js/components/{message.vue2.js → message2.vue.js} +1 -1
- package/js/components/message2.vue.js.map +1 -0
- package/js/components/modals/base-events-modal-close.vue.js +1 -1
- package/js/components/modals/{base-events-modal-close.vue2.js → base-events-modal-close2.vue.js} +1 -1
- package/js/components/modals/{base-events-modal-close.vue2.js.map → base-events-modal-close2.vue.js.map} +1 -1
- package/js/components/modals/base-events-modal-open.vue.js +1 -1
- package/js/components/modals/{base-events-modal-open.vue2.js → base-events-modal-open2.vue.js} +1 -1
- package/js/components/modals/{base-events-modal-open.vue2.js.map → base-events-modal-open2.vue.js.map} +1 -1
- package/js/components/modals/base-events-modal.vue.js +1 -1
- package/js/components/modals/{base-events-modal.vue2.js → base-events-modal2.vue.js} +1 -1
- package/js/components/modals/{base-events-modal.vue2.js.map → base-events-modal2.vue.js.map} +1 -1
- package/js/components/modals/base-id-modal-close.vue.js +1 -1
- package/js/components/modals/{base-id-modal-close.vue2.js → base-id-modal-close2.vue.js} +1 -1
- package/js/components/modals/{base-id-modal-close.vue2.js.map → base-id-modal-close2.vue.js.map} +1 -1
- package/js/components/modals/base-id-modal-open.vue.js +1 -1
- package/js/components/modals/{base-id-modal-open.vue2.js → base-id-modal-open2.vue.js} +1 -1
- package/js/components/modals/{base-id-modal-open.vue2.js.map → base-id-modal-open2.vue.js.map} +1 -1
- package/js/components/modals/base-id-modal.vue.js +1 -1
- package/js/components/modals/{base-id-modal.vue2.js → base-id-modal2.vue.js} +1 -1
- package/js/components/modals/{base-id-modal.vue2.js.map → base-id-modal2.vue.js.map} +1 -1
- package/js/components/modals/base-modal.vue.js +2 -2
- package/js/components/modals/{base-modal.vue2.js → base-modal2.vue.js} +18 -18
- package/js/components/modals/{base-modal.vue2.js.map → base-modal2.vue.js.map} +1 -1
- package/js/components/modals/{base-modal.vue3.js → base-modal3.vue.js} +1 -1
- package/js/components/modals/base-modal3.vue.js.map +1 -0
- package/js/components/modals/close-main-modal.vue.js +1 -1
- package/js/components/modals/{close-main-modal.vue2.js → close-main-modal2.vue.js} +1 -1
- package/js/components/modals/{close-main-modal.vue2.js.map → close-main-modal2.vue.js.map} +1 -1
- package/js/components/modals/main-modal.vue.js +1 -1
- package/js/components/modals/{main-modal.vue2.js → main-modal2.vue.js} +1 -1
- package/js/components/modals/{main-modal.vue2.js.map → main-modal2.vue.js.map} +1 -1
- package/js/components/modals/open-main-modal.vue.js +1 -1
- package/js/components/modals/{open-main-modal.vue2.js → open-main-modal2.vue.js} +1 -1
- package/js/components/modals/{open-main-modal.vue2.js.map → open-main-modal2.vue.js.map} +1 -1
- package/js/components/page-loader-button.vue.js +2 -2
- package/js/components/{page-loader-button.vue2.js → page-loader-button2.vue.js} +1 -1
- package/js/components/{page-loader-button.vue2.js.map → page-loader-button2.vue.js.map} +1 -1
- package/js/components/{page-loader-button.vue3.js → page-loader-button3.vue.js} +1 -1
- package/js/components/page-loader-button3.vue.js.map +1 -0
- package/js/components/page-selector.vue.js +2 -2
- package/js/components/{page-selector.vue2.js → page-selector2.vue.js} +1 -1
- package/js/components/{page-selector.vue2.js.map → page-selector2.vue.js.map} +1 -1
- package/js/components/{page-selector.vue3.js → page-selector3.vue.js} +1 -1
- package/js/components/page-selector3.vue.js.map +1 -0
- package/js/components/panels/base-header-toggle-panel.vue.js +2 -2
- package/js/components/panels/{base-header-toggle-panel.vue2.js → base-header-toggle-panel2.vue.js} +20 -20
- package/js/components/panels/{base-header-toggle-panel.vue2.js.map → base-header-toggle-panel2.vue.js.map} +1 -1
- package/js/components/panels/{base-header-toggle-panel.vue3.js → base-header-toggle-panel3.vue.js} +1 -1
- package/js/components/panels/base-header-toggle-panel3.vue.js.map +1 -0
- package/js/components/panels/base-id-toggle-panel-button.vue.js +1 -1
- package/js/components/panels/{base-id-toggle-panel-button.vue2.js → base-id-toggle-panel-button2.vue.js} +1 -1
- package/js/components/panels/{base-id-toggle-panel-button.vue2.js.map → base-id-toggle-panel-button2.vue.js.map} +1 -1
- package/js/components/panels/base-id-toggle-panel.vue.js +1 -1
- package/js/components/panels/{base-id-toggle-panel.vue2.js → base-id-toggle-panel2.vue.js} +20 -20
- package/js/components/panels/{base-id-toggle-panel.vue2.js.map → base-id-toggle-panel2.vue.js.map} +1 -1
- package/js/components/panels/base-tabs-panel.vue.js +2 -2
- package/js/components/panels/{base-tabs-panel.vue2.js → base-tabs-panel2.vue.js} +20 -20
- package/js/components/panels/{base-tabs-panel.vue2.js.map → base-tabs-panel2.vue.js.map} +1 -1
- package/js/components/panels/{base-tabs-panel.vue3.js → base-tabs-panel3.vue.js} +1 -1
- package/js/components/panels/base-tabs-panel3.vue.js.map +1 -0
- package/js/components/panels/base-toggle-panel.vue.js +1 -1
- package/js/components/panels/{base-toggle-panel.vue2.js → base-toggle-panel2.vue.js} +1 -1
- package/js/components/panels/{base-toggle-panel.vue2.js.map → base-toggle-panel2.vue.js.map} +1 -1
- package/js/components/result/base-result-add-to-cart.vue.js +1 -1
- package/js/components/result/{base-result-add-to-cart.vue2.js → base-result-add-to-cart2.vue.js} +1 -1
- package/js/components/result/{base-result-add-to-cart.vue2.js.map → base-result-add-to-cart2.vue.js.map} +1 -1
- package/js/components/result/base-result-current-price.vue.js +1 -1
- package/js/components/result/{base-result-current-price.vue2.js → base-result-current-price2.vue.js} +1 -1
- package/js/components/result/{base-result-current-price.vue2.js.map → base-result-current-price2.vue.js.map} +1 -1
- package/js/components/result/base-result-image.vue.js +2 -2
- package/js/components/result/{base-result-image.vue2.js → base-result-image2.vue.js} +20 -20
- package/js/components/result/{base-result-image.vue2.js.map → base-result-image2.vue.js.map} +1 -1
- package/js/components/result/{base-result-image.vue3.js → base-result-image3.vue.js} +1 -1
- package/js/components/result/base-result-image3.vue.js.map +1 -0
- package/js/components/result/base-result-link.vue.js +2 -2
- package/js/components/result/{base-result-link.vue2.js → base-result-link2.vue.js} +1 -1
- package/js/components/result/{base-result-link.vue2.js.map → base-result-link2.vue.js.map} +1 -1
- package/js/components/result/{base-result-link.vue3.js → base-result-link3.vue.js} +1 -1
- package/js/components/result/base-result-link3.vue.js.map +1 -0
- package/js/components/result/base-result-previous-price.vue.js +1 -1
- package/js/components/result/{base-result-previous-price.vue2.js → base-result-previous-price2.vue.js} +1 -1
- package/js/components/result/{base-result-previous-price.vue2.js.map → base-result-previous-price2.vue.js.map} +1 -1
- package/js/components/result/base-result-rating.vue.js +2 -2
- package/js/components/result/{base-result-rating.vue2.js → base-result-rating2.vue.js} +1 -1
- package/js/components/result/{base-result-rating.vue2.js.map → base-result-rating2.vue.js.map} +1 -1
- package/js/components/result/{base-result-rating.vue3.js → base-result-rating3.vue.js} +1 -1
- package/js/components/result/base-result-rating3.vue.js.map +1 -0
- package/js/components/result/result-variant-selector.vue.js +2 -2
- package/js/components/result/{result-variant-selector.vue2.js → result-variant-selector2.vue.js} +1 -1
- package/js/components/result/{result-variant-selector.vue2.js.map → result-variant-selector2.vue.js.map} +1 -1
- package/js/components/result/{result-variant-selector.vue3.js → result-variant-selector3.vue.js} +1 -1
- package/js/components/result/result-variant-selector3.vue.js.map +1 -0
- package/js/components/result/{result-variants-provider.vue2.js → result-variants-provider2.vue.js} +1 -1
- package/js/components/result/result-variants-provider2.vue.js.map +1 -0
- package/js/components/scroll/base-scroll.vue.js +1 -1
- package/js/components/scroll/{base-scroll.vue2.js → base-scroll2.vue.js} +1 -1
- package/js/components/scroll/{base-scroll.vue2.js.map → base-scroll2.vue.js.map} +1 -1
- package/js/components/sliding-panel.vue.js +2 -2
- package/js/components/{sliding-panel.vue2.js → sliding-panel2.vue.js} +1 -1
- package/js/components/{sliding-panel.vue2.js.map → sliding-panel2.vue.js.map} +1 -1
- package/js/components/{sliding-panel.vue3.js → sliding-panel3.vue.js} +1 -1
- package/js/components/sliding-panel3.vue.js.map +1 -0
- package/js/components/snippet-callbacks.vue.js +1 -1
- package/js/components/{snippet-callbacks.vue2.js → snippet-callbacks2.vue.js} +1 -1
- package/js/components/{snippet-callbacks.vue2.js.map → snippet-callbacks2.vue.js.map} +1 -1
- package/js/components/suggestions/base-suggestion.vue.js +1 -1
- package/js/components/suggestions/{base-suggestion.vue2.js → base-suggestion2.vue.js} +1 -1
- package/js/components/suggestions/{base-suggestion.vue2.js.map → base-suggestion2.vue.js.map} +1 -1
- package/js/components/suggestions/base-suggestions.vue.js +2 -2
- package/js/components/suggestions/{base-suggestions.vue2.js → base-suggestions2.vue.js} +1 -1
- package/js/components/suggestions/{base-suggestions.vue2.js.map → base-suggestions2.vue.js.map} +1 -1
- package/js/components/suggestions/{base-suggestions.vue3.js → base-suggestions3.vue.js} +1 -1
- package/js/components/suggestions/base-suggestions3.vue.js.map +1 -0
- package/js/index.js +3 -3
- package/js/x-modules/ai/components/ai-carousel.vue.js +2 -2
- package/js/x-modules/ai/components/{ai-carousel.vue2.js → ai-carousel2.vue.js} +75 -75
- package/js/x-modules/ai/components/{ai-carousel.vue2.js.map → ai-carousel2.vue.js.map} +1 -1
- package/js/x-modules/ai/components/{ai-carousel.vue3.js → ai-carousel3.vue.js} +1 -1
- package/js/x-modules/ai/components/ai-carousel3.vue.js.map +1 -0
- package/js/x-modules/ai/components/ai-grouped-carousel.vue.js +1 -1
- package/js/x-modules/ai/components/ai-grouped-carousel2.vue.js +123 -0
- package/js/x-modules/ai/components/{ai-grouped-carousel.vue2.js.map → ai-grouped-carousel2.vue.js.map} +1 -1
- package/js/x-modules/device/components/device-detector.vue.js +1 -1
- package/js/x-modules/device/components/{device-detector.vue2.js → device-detector2.vue.js} +1 -1
- package/js/x-modules/device/components/{device-detector.vue2.js.map → device-detector2.vue.js.map} +1 -1
- package/js/x-modules/empathize/components/empathize.vue.js +1 -1
- package/js/x-modules/empathize/components/{empathize.vue2.js → empathize2.vue.js} +82 -82
- package/js/x-modules/empathize/components/{empathize.vue2.js.map → empathize2.vue.js.map} +1 -1
- package/js/x-modules/experience-controls/components/{experience-controls.vue2.js → experience-controls2.vue.js} +1 -1
- package/js/x-modules/experience-controls/components/experience-controls2.vue.js.map +1 -0
- package/js/x-modules/extra-params/components/{extra-params.vue2.js → extra-params2.vue.js} +1 -1
- package/js/x-modules/{facets/components/facets/facets.vue3.js.map → extra-params/components/extra-params2.vue.js.map} +1 -1
- package/js/x-modules/extra-params/components/{renderless-extra-param.vue2.js → renderless-extra-param2.vue.js} +1 -1
- package/js/x-modules/extra-params/components/renderless-extra-param2.vue.js.map +1 -0
- package/js/x-modules/extra-params/components/snippet-config-extra-params.vue.js +1 -1
- package/js/x-modules/extra-params/components/{snippet-config-extra-params.vue2.js → snippet-config-extra-params2.vue.js} +1 -1
- package/js/x-modules/extra-params/components/{snippet-config-extra-params.vue2.js.map → snippet-config-extra-params2.vue.js.map} +1 -1
- package/js/x-modules/facets/components/clear-filters.vue.js +1 -1
- package/js/x-modules/facets/components/{clear-filters.vue2.js → clear-filters2.vue.js} +1 -1
- package/js/x-modules/facets/components/{clear-filters.vue2.js.map → clear-filters2.vue.js.map} +1 -1
- package/js/x-modules/facets/components/facets/facets-provider.vue.js +2 -2
- package/js/x-modules/facets/components/facets/{facets-provider.vue2.js → facets-provider2.vue.js} +1 -1
- package/js/x-modules/facets/components/facets/{facets-provider.vue2.js.map → facets-provider2.vue.js.map} +1 -1
- package/js/x-modules/facets/components/facets/{facets-provider.vue3.js → facets-provider3.vue.js} +1 -1
- package/js/x-modules/facets/components/facets/facets-provider3.vue.js.map +1 -0
- package/js/x-modules/facets/components/facets/facets.vue.js +2 -2
- package/js/x-modules/facets/components/facets/{facets.vue2.js → facets2.vue.js} +1 -1
- package/js/x-modules/facets/components/facets/{facets.vue2.js.map → facets2.vue.js.map} +1 -1
- package/js/x-modules/facets/components/facets/{facets.vue3.js → facets3.vue.js} +1 -1
- package/js/x-modules/facets/components/facets/facets3.vue.js.map +1 -0
- package/js/x-modules/facets/components/filters/all-filter.vue.js +1 -1
- package/js/x-modules/facets/components/filters/{all-filter.vue2.js → all-filter2.vue.js} +1 -1
- package/js/x-modules/facets/components/filters/{all-filter.vue2.js.map → all-filter2.vue.js.map} +1 -1
- package/js/x-modules/facets/components/filters/editable-number-range-filter.vue.js +2 -2
- package/js/x-modules/facets/components/filters/{editable-number-range-filter.vue2.js → editable-number-range-filter2.vue.js} +1 -1
- package/js/x-modules/facets/components/filters/{editable-number-range-filter.vue2.js.map → editable-number-range-filter2.vue.js.map} +1 -1
- package/js/x-modules/facets/components/filters/{editable-number-range-filter.vue3.js → editable-number-range-filter3.vue.js} +1 -1
- package/js/x-modules/facets/components/filters/editable-number-range-filter3.vue.js.map +1 -0
- package/js/x-modules/facets/components/filters/hierarchical-filter.vue.js +1 -1
- package/js/x-modules/facets/components/filters/{hierarchical-filter.vue2.js → hierarchical-filter2.vue.js} +1 -1
- package/js/x-modules/facets/components/filters/{hierarchical-filter.vue2.js.map → hierarchical-filter2.vue.js.map} +1 -1
- package/js/x-modules/facets/components/filters/number-range-filter.vue.js +1 -1
- package/js/x-modules/facets/components/filters/{number-range-filter.vue2.js → number-range-filter2.vue.js} +1 -1
- package/js/x-modules/facets/components/filters/{number-range-filter.vue2.js.map → number-range-filter2.vue.js.map} +1 -1
- package/js/x-modules/facets/components/filters/{renderless-filter.vue2.js → renderless-filter2.vue.js} +1 -1
- package/js/x-modules/facets/components/filters/renderless-filter2.vue.js.map +1 -0
- package/js/x-modules/facets/components/filters/simple-filter.vue.js +1 -1
- package/js/x-modules/facets/components/filters/{simple-filter.vue2.js → simple-filter2.vue.js} +1 -1
- package/js/x-modules/facets/components/filters/{simple-filter.vue2.js.map → simple-filter2.vue.js.map} +1 -1
- package/js/x-modules/facets/components/lists/{exclude-filters-with-no-results.vue2.js → exclude-filters-with-no-results2.vue.js} +1 -1
- package/js/x-modules/facets/components/lists/exclude-filters-with-no-results2.vue.js.map +1 -0
- package/js/x-modules/facets/components/lists/filters-list.vue.js +2 -2
- package/js/x-modules/facets/components/lists/{filters-list.vue2.js → filters-list2.vue.js} +1 -1
- package/js/x-modules/facets/components/lists/{filters-list.vue2.js.map → filters-list2.vue.js.map} +1 -1
- package/js/x-modules/facets/components/lists/{filters-list.vue3.js → filters-list3.vue.js} +1 -1
- package/js/x-modules/facets/components/lists/filters-list3.vue.js.map +1 -0
- package/js/x-modules/facets/components/lists/filters-search.vue.js +2 -2
- package/js/x-modules/facets/components/lists/{filters-search.vue2.js → filters-search2.vue.js} +1 -1
- package/js/x-modules/facets/components/lists/{filters-search.vue2.js.map → filters-search2.vue.js.map} +1 -1
- package/js/x-modules/facets/components/lists/{filters-search.vue3.js → filters-search3.vue.js} +1 -1
- package/js/x-modules/facets/components/lists/filters-search3.vue.js.map +1 -0
- package/js/x-modules/facets/components/lists/selected-filters-list.vue.js +1 -1
- package/js/x-modules/facets/components/lists/{selected-filters-list.vue2.js → selected-filters-list2.vue.js} +1 -1
- package/js/x-modules/facets/components/lists/{selected-filters-list.vue2.js.map → selected-filters-list2.vue.js.map} +1 -1
- package/js/x-modules/facets/components/lists/{selected-filters.vue2.js → selected-filters2.vue.js} +1 -1
- package/js/x-modules/facets/components/lists/selected-filters2.vue.js.map +1 -0
- package/js/x-modules/facets/components/lists/sliced-filters.vue.js +1 -1
- package/js/x-modules/facets/components/lists/{sliced-filters.vue2.js → sliced-filters2.vue.js} +1 -1
- package/js/x-modules/facets/components/lists/{sliced-filters.vue2.js.map → sliced-filters2.vue.js.map} +1 -1
- package/js/x-modules/facets/components/lists/{sorted-filters.vue2.js → sorted-filters2.vue.js} +1 -1
- package/js/x-modules/facets/components/lists/sorted-filters2.vue.js.map +1 -0
- package/js/x-modules/facets/components/{preselected-filters.vue2.js → preselected-filters2.vue.js} +1 -1
- package/js/x-modules/facets/components/preselected-filters2.vue.js.map +1 -0
- package/js/x-modules/history-queries/components/clear-history-queries.vue.js +1 -1
- package/js/x-modules/history-queries/components/{clear-history-queries.vue2.js → clear-history-queries2.vue.js} +1 -1
- package/js/x-modules/history-queries/components/{clear-history-queries.vue2.js.map → clear-history-queries2.vue.js.map} +1 -1
- package/js/x-modules/history-queries/components/history-queries-switch.vue.js +1 -1
- package/js/x-modules/history-queries/components/{history-queries-switch.vue2.js → history-queries-switch2.vue.js} +1 -1
- package/js/x-modules/history-queries/components/{history-queries-switch.vue2.js.map → history-queries-switch2.vue.js.map} +1 -1
- package/js/x-modules/history-queries/components/history-queries.vue.js +1 -1
- package/js/x-modules/history-queries/components/{history-queries.vue2.js → history-queries2.vue.js} +1 -1
- package/js/x-modules/history-queries/components/{history-queries.vue2.js.map → history-queries2.vue.js.map} +1 -1
- package/js/x-modules/history-queries/components/history-query.vue.js +1 -1
- package/js/x-modules/history-queries/components/{history-query.vue2.js → history-query2.vue.js} +1 -1
- package/js/x-modules/history-queries/components/{history-query.vue2.js.map → history-query2.vue.js.map} +1 -1
- package/js/x-modules/history-queries/components/my-history.vue.js +2 -2
- package/js/x-modules/history-queries/components/{my-history.vue2.js → my-history2.vue.js} +1 -1
- package/js/x-modules/history-queries/components/{my-history.vue2.js.map → my-history2.vue.js.map} +1 -1
- package/js/x-modules/history-queries/components/{my-history.vue3.js → my-history3.vue.js} +1 -1
- package/js/x-modules/history-queries/components/my-history3.vue.js.map +1 -0
- package/js/x-modules/history-queries/components/remove-history-query.vue.js +1 -1
- package/js/x-modules/history-queries/components/{remove-history-query.vue2.js → remove-history-query2.vue.js} +1 -1
- package/js/x-modules/history-queries/components/{remove-history-query.vue2.js.map → remove-history-query2.vue.js.map} +1 -1
- package/js/x-modules/identifier-results/components/identifier-result.vue.js +1 -1
- package/js/x-modules/identifier-results/components/{identifier-result.vue2.js → identifier-result2.vue.js} +1 -1
- package/js/x-modules/identifier-results/components/{identifier-result.vue2.js.map → identifier-result2.vue.js.map} +1 -1
- package/js/x-modules/identifier-results/components/identifier-results.vue.js +2 -2
- package/js/x-modules/identifier-results/components/{identifier-results.vue2.js → identifier-results2.vue.js} +1 -1
- package/js/x-modules/identifier-results/components/{identifier-results.vue2.js.map → identifier-results2.vue.js.map} +1 -1
- package/js/x-modules/identifier-results/components/{identifier-results.vue3.js → identifier-results3.vue.js} +1 -1
- package/js/x-modules/identifier-results/components/identifier-results3.vue.js.map +1 -0
- package/js/x-modules/next-queries/components/{next-queries-list.vue2.js → next-queries-list2.vue.js} +1 -1
- package/js/x-modules/next-queries/components/next-queries-list2.vue.js.map +1 -0
- package/js/x-modules/next-queries/components/next-queries.vue.js +1 -1
- package/js/x-modules/next-queries/components/{next-queries.vue2.js → next-queries2.vue.js} +1 -1
- package/js/x-modules/next-queries/components/{next-queries.vue2.js.map → next-queries2.vue.js.map} +1 -1
- package/js/x-modules/next-queries/components/next-query-preview.vue.js +1 -1
- package/js/x-modules/next-queries/components/{next-query-preview.vue2.js → next-query-preview2.vue.js} +1 -1
- package/js/x-modules/next-queries/components/{next-query-preview.vue2.js.map → next-query-preview2.vue.js.map} +1 -1
- package/js/x-modules/next-queries/components/next-query.vue.js +1 -1
- package/js/x-modules/next-queries/components/{next-query.vue2.js → next-query2.vue.js} +1 -1
- package/js/x-modules/next-queries/components/{next-query.vue2.js.map → next-query2.vue.js.map} +1 -1
- package/js/x-modules/popular-searches/components/popular-search.vue.js +1 -1
- package/js/x-modules/popular-searches/components/{popular-search.vue2.js → popular-search2.vue.js} +1 -1
- package/js/x-modules/popular-searches/components/{popular-search.vue2.js.map → popular-search2.vue.js.map} +1 -1
- package/js/x-modules/popular-searches/components/popular-searches.vue.js +1 -1
- package/js/x-modules/popular-searches/components/{popular-searches.vue2.js → popular-searches2.vue.js} +1 -1
- package/js/x-modules/popular-searches/components/{popular-searches.vue2.js.map → popular-searches2.vue.js.map} +1 -1
- package/js/x-modules/queries-preview/components/query-preview-button.vue.js +1 -1
- package/js/x-modules/queries-preview/components/query-preview-button2.vue.js +165 -0
- package/js/x-modules/queries-preview/components/{query-preview-button.vue2.js.map → query-preview-button2.vue.js.map} +1 -1
- package/js/x-modules/queries-preview/components/query-preview-list.vue.js +2 -2
- package/js/x-modules/queries-preview/components/{query-preview-list.vue2.js → query-preview-list2.vue.js} +1 -1
- package/js/x-modules/queries-preview/components/{query-preview-list.vue2.js.map → query-preview-list2.vue.js.map} +1 -1
- package/js/x-modules/queries-preview/components/{query-preview-list.vue3.js → query-preview-list3.vue.js} +1 -1
- package/js/x-modules/queries-preview/components/query-preview-list3.vue.js.map +1 -0
- package/js/x-modules/queries-preview/components/query-preview.vue.js +1 -1
- package/js/x-modules/queries-preview/components/{query-preview.vue2.js → query-preview2.vue.js} +82 -82
- package/js/x-modules/queries-preview/components/{query-preview.vue2.js.map → query-preview2.vue.js.map} +1 -1
- package/js/x-modules/query-suggestions/components/query-suggestion.vue.js +1 -1
- package/js/x-modules/query-suggestions/components/{query-suggestion.vue2.js → query-suggestion2.vue.js} +1 -1
- package/js/x-modules/query-suggestions/components/{query-suggestion.vue2.js.map → query-suggestion2.vue.js.map} +1 -1
- package/js/x-modules/query-suggestions/components/query-suggestions.vue.js +1 -1
- package/js/x-modules/query-suggestions/components/{query-suggestions.vue2.js → query-suggestions2.vue.js} +1 -1
- package/js/x-modules/query-suggestions/components/{query-suggestions.vue2.js.map → query-suggestions2.vue.js.map} +1 -1
- package/js/x-modules/recommendations/components/recommendations.vue.js +2 -2
- package/js/x-modules/recommendations/components/{recommendations.vue2.js → recommendations2.vue.js} +1 -1
- package/js/x-modules/recommendations/components/{recommendations.vue2.js.map → recommendations2.vue.js.map} +1 -1
- package/js/x-modules/recommendations/components/{recommendations.vue3.js → recommendations3.vue.js} +1 -1
- package/js/x-modules/recommendations/components/recommendations3.vue.js.map +1 -0
- package/js/x-modules/related-prompts/components/related-prompt.vue.js +2 -2
- package/js/x-modules/related-prompts/components/{related-prompt.vue2.js → related-prompt2.vue.js} +1 -1
- package/js/x-modules/related-prompts/components/{related-prompt.vue2.js.map → related-prompt2.vue.js.map} +1 -1
- package/js/x-modules/related-prompts/components/{related-prompt.vue3.js → related-prompt3.vue.js} +1 -1
- package/js/x-modules/related-prompts/components/related-prompt3.vue.js.map +1 -0
- package/js/x-modules/related-prompts/components/{related-prompts-list.vue2.js → related-prompts-list2.vue.js} +1 -1
- package/js/x-modules/related-prompts/components/related-prompts-list2.vue.js.map +1 -0
- package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue.js +2 -2
- package/js/x-modules/related-prompts/components/{related-prompts-tag-list.vue2.js → related-prompts-tag-list2.vue.js} +1 -1
- package/js/x-modules/related-prompts/components/{related-prompts-tag-list.vue2.js.map → related-prompts-tag-list2.vue.js.map} +1 -1
- package/js/x-modules/related-prompts/components/{related-prompts-tag-list.vue3.js → related-prompts-tag-list3.vue.js} +1 -1
- package/js/x-modules/related-prompts/components/related-prompts-tag-list3.vue.js.map +1 -0
- package/js/x-modules/related-tags/components/related-tag.vue.js +1 -1
- package/js/x-modules/related-tags/components/{related-tag.vue2.js → related-tag2.vue.js} +1 -1
- package/js/x-modules/related-tags/components/{related-tag.vue2.js.map → related-tag2.vue.js.map} +1 -1
- package/js/x-modules/related-tags/components/related-tags.vue.js +2 -2
- package/js/x-modules/related-tags/components/{related-tags.vue2.js → related-tags2.vue.js} +1 -1
- package/js/x-modules/related-tags/components/{related-tags.vue2.js.map → related-tags2.vue.js.map} +1 -1
- package/js/x-modules/related-tags/components/{related-tags.vue3.js → related-tags3.vue.js} +1 -1
- package/js/x-modules/related-tags/components/related-tags3.vue.js.map +1 -0
- package/js/x-modules/scroll/components/main-scroll-item.vue.js +1 -1
- package/js/x-modules/scroll/components/{main-scroll-item.vue2.js → main-scroll-item2.vue.js} +1 -1
- package/js/x-modules/scroll/components/{main-scroll-item.vue2.js.map → main-scroll-item2.vue.js.map} +1 -1
- package/js/x-modules/scroll/components/{main-scroll.vue2.js → main-scroll2.vue.js} +1 -1
- package/js/x-modules/scroll/components/main-scroll2.vue.js.map +1 -0
- package/js/x-modules/scroll/components/scroll-to-top.vue.js +1 -1
- package/js/x-modules/scroll/components/{scroll-to-top.vue2.js → scroll-to-top2.vue.js} +81 -81
- package/js/x-modules/scroll/components/{scroll-to-top.vue2.js.map → scroll-to-top2.vue.js.map} +1 -1
- package/js/x-modules/scroll/components/scroll.vue.js +1 -1
- package/js/x-modules/scroll/components/{scroll.vue2.js → scroll2.vue.js} +1 -1
- package/js/x-modules/scroll/components/{scroll.vue2.js.map → scroll2.vue.js.map} +1 -1
- package/js/x-modules/search/components/banner.vue.js +2 -2
- package/js/x-modules/search/components/{banner.vue2.js → banner2.vue.js} +1 -1
- package/js/x-modules/search/components/{banner.vue2.js.map → banner2.vue.js.map} +1 -1
- package/js/x-modules/search/components/{banner.vue3.js → banner3.vue.js} +1 -1
- package/js/x-modules/search/components/banner3.vue.js.map +1 -0
- package/js/x-modules/search/components/{banners-list.vue2.js → banners-list2.vue.js} +1 -1
- package/js/x-modules/search/components/banners-list2.vue.js.map +1 -0
- package/js/x-modules/search/components/fallback-disclaimer.vue.js +1 -1
- package/js/x-modules/search/components/{fallback-disclaimer.vue2.js → fallback-disclaimer2.vue.js} +1 -1
- package/js/x-modules/search/components/{fallback-disclaimer.vue2.js.map → fallback-disclaimer2.vue.js.map} +1 -1
- package/js/x-modules/search/components/partial-query-button.vue.js +1 -1
- package/js/x-modules/search/components/{partial-query-button.vue2.js → partial-query-button2.vue.js} +1 -1
- package/js/x-modules/search/components/{partial-query-button.vue2.js.map → partial-query-button2.vue.js.map} +1 -1
- package/js/x-modules/search/components/partial-results-list.vue.js +2 -2
- package/js/x-modules/search/components/{partial-results-list.vue2.js → partial-results-list2.vue.js} +1 -1
- package/js/x-modules/search/components/{partial-results-list.vue2.js.map → partial-results-list2.vue.js.map} +1 -1
- package/js/x-modules/search/components/{partial-results-list.vue3.js → partial-results-list3.vue.js} +1 -1
- package/js/x-modules/search/components/partial-results-list3.vue.js.map +1 -0
- package/js/x-modules/search/components/promoted.vue.js +2 -2
- package/js/x-modules/search/components/{promoted.vue2.js → promoted2.vue.js} +1 -1
- package/js/x-modules/search/components/{promoted.vue2.js.map → promoted2.vue.js.map} +1 -1
- package/js/x-modules/search/components/{promoted.vue3.js → promoted3.vue.js} +1 -1
- package/js/x-modules/search/components/promoted3.vue.js.map +1 -0
- package/js/x-modules/search/components/{promoteds-list.vue2.js → promoteds-list2.vue.js} +1 -1
- package/js/x-modules/search/components/promoteds-list2.vue.js.map +1 -0
- package/js/x-modules/search/components/redirection.vue.js +1 -1
- package/js/x-modules/search/components/{redirection.vue2.js → redirection2.vue.js} +1 -1
- package/js/x-modules/search/components/{redirection.vue2.js.map → redirection2.vue.js.map} +1 -1
- package/js/x-modules/search/components/{results-list.vue2.js → results-list2.vue.js} +1 -1
- package/js/x-modules/search/components/results-list2.vue.js.map +1 -0
- package/js/x-modules/search/components/sort-dropdown.vue.js +1 -1
- package/js/x-modules/search/components/{sort-dropdown.vue2.js → sort-dropdown2.vue.js} +1 -1
- package/js/x-modules/search/components/{sort-dropdown.vue2.js.map → sort-dropdown2.vue.js.map} +1 -1
- package/js/x-modules/search/components/sort-list.vue.js +2 -2
- package/js/x-modules/search/components/{sort-list.vue2.js → sort-list2.vue.js} +1 -1
- package/js/x-modules/search/components/{sort-list.vue2.js.map → sort-list2.vue.js.map} +1 -1
- package/js/x-modules/search/components/{sort-list.vue3.js → sort-list3.vue.js} +1 -1
- package/js/x-modules/search/components/sort-list3.vue.js.map +1 -0
- package/js/x-modules/search/components/sort-picker-list.vue.js +1 -1
- package/js/x-modules/search/components/{sort-picker-list.vue2.js → sort-picker-list2.vue.js} +1 -1
- package/js/x-modules/search/components/{sort-picker-list.vue2.js.map → sort-picker-list2.vue.js.map} +1 -1
- package/js/x-modules/search/components/spellcheck-button.vue.js +1 -1
- package/js/x-modules/search/components/{spellcheck-button.vue2.js → spellcheck-button2.vue.js} +1 -1
- package/js/x-modules/search/components/{spellcheck-button.vue2.js.map → spellcheck-button2.vue.js.map} +1 -1
- package/js/x-modules/search/components/spellcheck.vue.js +1 -1
- package/js/x-modules/search/components/{spellcheck.vue2.js → spellcheck2.vue.js} +1 -1
- package/js/x-modules/search/components/{spellcheck.vue2.js.map → spellcheck2.vue.js.map} +1 -1
- package/js/x-modules/search-box/components/clear-search-input.vue.js +1 -1
- package/js/x-modules/search-box/components/{clear-search-input.vue2.js → clear-search-input2.vue.js} +1 -1
- package/js/x-modules/search-box/components/{clear-search-input.vue2.js.map → clear-search-input2.vue.js.map} +1 -1
- package/js/x-modules/search-box/components/search-button.vue.js +1 -1
- package/js/x-modules/search-box/components/{search-button.vue2.js → search-button2.vue.js} +1 -1
- package/js/x-modules/search-box/components/{search-button.vue2.js.map → search-button2.vue.js.map} +1 -1
- package/js/x-modules/search-box/components/search-input-placeholder.vue.js +3 -3
- package/js/x-modules/search-box/components/{search-input-placeholder.vue2.js → search-input-placeholder2.vue.js} +2 -2
- package/js/x-modules/search-box/components/{search-input-placeholder.vue2.js.map → search-input-placeholder2.vue.js.map} +1 -1
- package/js/x-modules/search-box/components/{search-input-placeholder.vue3.js → search-input-placeholder3.vue.js} +1 -1
- package/js/x-modules/search-box/components/search-input-placeholder3.vue.js.map +1 -0
- package/js/x-modules/search-box/components/{search-input-placeholder.vue4.js → search-input-placeholder4.vue.js} +1 -1
- package/js/x-modules/search-box/components/search-input-placeholder4.vue.js.map +1 -0
- package/js/x-modules/search-box/components/search-input.vue.js +2 -2
- package/js/x-modules/search-box/components/{search-input.vue2.js → search-input2.vue.js} +1 -1
- package/js/x-modules/search-box/components/{search-input.vue2.js.map → search-input2.vue.js.map} +1 -1
- package/js/x-modules/search-box/components/{search-input.vue3.js → search-input3.vue.js} +1 -1
- package/js/x-modules/search-box/components/search-input3.vue.js.map +1 -0
- package/js/x-modules/semantic-queries/components/semantic-queries.vue.js +1 -1
- package/js/x-modules/semantic-queries/components/{semantic-queries.vue2.js → semantic-queries2.vue.js} +1 -1
- package/js/x-modules/semantic-queries/components/{semantic-queries.vue2.js.map → semantic-queries2.vue.js.map} +1 -1
- package/js/x-modules/semantic-queries/components/semantic-query.vue.js +1 -1
- package/js/x-modules/semantic-queries/components/{semantic-query.vue2.js → semantic-query2.vue.js} +1 -1
- package/js/x-modules/semantic-queries/components/{semantic-query.vue2.js.map → semantic-query2.vue.js.map} +1 -1
- package/js/x-modules/tagging/components/{tagging.vue2.js → tagging2.vue.js} +1 -1
- package/js/x-modules/tagging/components/tagging2.vue.js.map +1 -0
- package/js/x-modules/url/components/url-handler.vue.js +1 -1
- package/js/x-modules/url/components/{url-handler.vue2.js → url-handler2.vue.js} +1 -1
- package/js/x-modules/url/components/{url-handler.vue2.js.map → url-handler2.vue.js.map} +1 -1
- package/package.json +23 -23
- package/report/tsdoc-metadata.json +1 -1
- package/report/x-adapter-platform.api.json +251 -1
- package/report/x-components.api.json +1 -1
- package/report/x-types.api.json +426 -1
- package/types/src/x-modules/related-prompts/components/related-prompts-tag-list.vue.d.ts.map +1 -1
- package/js/components/animations/animate-clip-path.vue2.js.map +0 -1
- package/js/components/animations/animate-clip-path.vue3.js +0 -7
- package/js/components/animations/animate-clip-path.vue3.js.map +0 -1
- package/js/components/animations/animate-scale.vue2.js.map +0 -1
- package/js/components/animations/animate-scale.vue3.js.map +0 -1
- package/js/components/animations/animate-translate.vue2.js.map +0 -1
- package/js/components/animations/animate-translate.vue3.js +0 -7
- package/js/components/animations/animate-translate.vue3.js.map +0 -1
- package/js/components/animations/animate-width.vue3.js.map +0 -1
- package/js/components/animations/change-height.vue3.js.map +0 -1
- package/js/components/animations/collapse-height.vue3.js.map +0 -1
- package/js/components/animations/collapse-width.vue3.js.map +0 -1
- package/js/components/animations/cross-fade.vue3.js.map +0 -1
- package/js/components/animations/fade-and-slide.vue3.js.map +0 -1
- package/js/components/animations/fade.vue3.js.map +0 -1
- package/js/components/animations/no-animation.vue2.js.map +0 -1
- package/js/components/animations/staggered-fade-and-slide.vue3.js.map +0 -1
- package/js/components/auto-progress-bar.vue3.js.map +0 -1
- package/js/components/base-dropdown.vue3.js.map +0 -1
- package/js/components/base-grid.vue3.js.map +0 -1
- package/js/components/base-rating.vue3.js.map +0 -1
- package/js/components/base-slider.vue3.js.map +0 -1
- package/js/components/base-switch.vue3.js.map +0 -1
- package/js/components/display-click-provider.vue2.js.map +0 -1
- package/js/components/display-emitter.vue2.js.map +0 -1
- package/js/components/filters/labels/base-price-filter-label.vue2.js.map +0 -1
- package/js/components/global-x-bus.vue2.js.map +0 -1
- package/js/components/location-provider.vue2.js.map +0 -1
- package/js/components/message.vue2.js.map +0 -1
- package/js/components/modals/base-modal.vue3.js.map +0 -1
- package/js/components/page-loader-button.vue3.js.map +0 -1
- package/js/components/page-selector.vue3.js.map +0 -1
- package/js/components/panels/base-header-toggle-panel.vue3.js.map +0 -1
- package/js/components/panels/base-tabs-panel.vue3.js.map +0 -1
- package/js/components/result/base-result-image.vue3.js.map +0 -1
- package/js/components/result/base-result-link.vue3.js.map +0 -1
- package/js/components/result/base-result-rating.vue3.js.map +0 -1
- package/js/components/result/result-variant-selector.vue3.js.map +0 -1
- package/js/components/result/result-variants-provider.vue2.js.map +0 -1
- package/js/components/sliding-panel.vue3.js.map +0 -1
- package/js/components/suggestions/base-suggestions.vue3.js.map +0 -1
- package/js/x-modules/ai/components/ai-carousel.vue3.js.map +0 -1
- package/js/x-modules/ai/components/ai-grouped-carousel.vue2.js +0 -123
- package/js/x-modules/experience-controls/components/experience-controls.vue2.js.map +0 -1
- package/js/x-modules/extra-params/components/extra-params.vue2.js.map +0 -1
- package/js/x-modules/extra-params/components/renderless-extra-param.vue2.js.map +0 -1
- package/js/x-modules/facets/components/facets/facets-provider.vue3.js.map +0 -1
- package/js/x-modules/facets/components/filters/editable-number-range-filter.vue3.js.map +0 -1
- package/js/x-modules/facets/components/filters/renderless-filter.vue2.js.map +0 -1
- package/js/x-modules/facets/components/lists/exclude-filters-with-no-results.vue2.js.map +0 -1
- package/js/x-modules/facets/components/lists/filters-list.vue3.js.map +0 -1
- package/js/x-modules/facets/components/lists/filters-search.vue3.js.map +0 -1
- package/js/x-modules/facets/components/lists/selected-filters.vue2.js.map +0 -1
- package/js/x-modules/facets/components/lists/sorted-filters.vue2.js.map +0 -1
- package/js/x-modules/facets/components/preselected-filters.vue2.js.map +0 -1
- package/js/x-modules/history-queries/components/my-history.vue3.js.map +0 -1
- package/js/x-modules/identifier-results/components/identifier-results.vue3.js.map +0 -1
- package/js/x-modules/next-queries/components/next-queries-list.vue2.js.map +0 -1
- package/js/x-modules/queries-preview/components/query-preview-button.vue2.js +0 -165
- package/js/x-modules/queries-preview/components/query-preview-list.vue3.js.map +0 -1
- package/js/x-modules/recommendations/components/recommendations.vue3.js.map +0 -1
- package/js/x-modules/related-prompts/components/related-prompt.vue3.js.map +0 -1
- package/js/x-modules/related-prompts/components/related-prompts-list.vue2.js.map +0 -1
- package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue3.js.map +0 -1
- package/js/x-modules/related-tags/components/related-tags.vue3.js.map +0 -1
- package/js/x-modules/scroll/components/main-scroll.vue2.js.map +0 -1
- package/js/x-modules/search/components/banner.vue3.js.map +0 -1
- package/js/x-modules/search/components/banners-list.vue2.js.map +0 -1
- package/js/x-modules/search/components/partial-results-list.vue3.js.map +0 -1
- package/js/x-modules/search/components/promoted.vue3.js.map +0 -1
- package/js/x-modules/search/components/promoteds-list.vue2.js.map +0 -1
- package/js/x-modules/search/components/results-list.vue2.js.map +0 -1
- package/js/x-modules/search/components/sort-list.vue3.js.map +0 -1
- package/js/x-modules/search-box/components/search-input-placeholder.vue3.js.map +0 -1
- package/js/x-modules/search-box/components/search-input-placeholder.vue4.js.map +0 -1
- package/js/x-modules/search-box/components/search-input.vue3.js.map +0 -1
- package/js/x-modules/tagging/components/tagging.vue2.js.map +0 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { defineComponent, ref, watch, computed } from 'vue';
|
|
2
2
|
import { AnimationProp } from '../../types/animation-prop.js';
|
|
3
|
-
import '../animations/animate-clip-
|
|
4
|
-
import '../animations/animate-
|
|
5
|
-
import '../animations/animate-
|
|
6
|
-
import '../animations/animate-
|
|
7
|
-
import '../animations/animate-
|
|
8
|
-
import '../animations/change-
|
|
9
|
-
import '../animations/change-
|
|
10
|
-
import '../animations/collapse-
|
|
11
|
-
import '../animations/collapse-
|
|
12
|
-
import '../animations/collapse-
|
|
13
|
-
import '../animations/collapse-
|
|
14
|
-
import '../animations/cross-
|
|
15
|
-
import '../animations/cross-
|
|
16
|
-
import '../animations/fade-and-
|
|
17
|
-
import '../animations/fade-and-
|
|
18
|
-
import '../animations/
|
|
19
|
-
import '../animations/
|
|
3
|
+
import '../animations/animate-clip-path2.vue.js';
|
|
4
|
+
import '../animations/animate-scale2.vue.js';
|
|
5
|
+
import '../animations/animate-translate2.vue.js';
|
|
6
|
+
import '../animations/animate-width2.vue.js';
|
|
7
|
+
import '../animations/animate-width3.vue.js';
|
|
8
|
+
import '../animations/change-height2.vue.js';
|
|
9
|
+
import '../animations/change-height3.vue.js';
|
|
10
|
+
import '../animations/collapse-height2.vue.js';
|
|
11
|
+
import '../animations/collapse-height3.vue.js';
|
|
12
|
+
import '../animations/collapse-width2.vue.js';
|
|
13
|
+
import '../animations/collapse-width3.vue.js';
|
|
14
|
+
import '../animations/cross-fade2.vue.js';
|
|
15
|
+
import '../animations/cross-fade3.vue.js';
|
|
16
|
+
import '../animations/fade-and-slide2.vue.js';
|
|
17
|
+
import '../animations/fade-and-slide3.vue.js';
|
|
18
|
+
import '../animations/fade2.vue.js';
|
|
19
|
+
import '../animations/fade3.vue.js';
|
|
20
20
|
import _sfc_main$1 from '../animations/no-animation.vue.js';
|
|
21
|
-
import '../animations/staggered-fade-and-
|
|
22
|
-
import '../animations/staggered-fade-and-
|
|
21
|
+
import '../animations/staggered-fade-and-slide2.vue.js';
|
|
22
|
+
import '../animations/staggered-fade-and-slide3.vue.js';
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* Component to be reused that renders an `<img>`.
|
|
@@ -176,4 +176,4 @@ var _sfc_main = defineComponent({
|
|
|
176
176
|
});
|
|
177
177
|
|
|
178
178
|
export { _sfc_main as default };
|
|
179
|
-
//# sourceMappingURL=base-result-
|
|
179
|
+
//# sourceMappingURL=base-result-image2.vue.js.map
|
package/js/components/result/{base-result-image.vue2.js.map → base-result-image2.vue.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-result-image.vue2.js","sources":["../../../../src/components/result/base-result-image.vue"],"sourcesContent":["<template>\n <!-- This is a div because using a picture causes the onload event of the image to fire twice. -->\n <!-- eslint-disable-next-line vuejs-accessibility/mouse-events-have-key-events -->\n <div\n class=\"x-result-picture xds:picture\"\n data-test=\"result-picture\"\n @mouseenter.once=\"userHasHoveredImage = true\"\n @mouseenter=\"isHovering = true\"\n @mouseleave=\"isHovering = false\"\n >\n <img\n v-if=\"shouldLoadNextImage\"\n loading=\"lazy\"\n :src=\"pendingImages[0]\"\n :style=\"loaderStyles\"\n class=\"xds:picture-image\"\n data-test=\"result-picture-loader\"\n alt=\"\"\n role=\"presentation\"\n @load=\"flagImageLoaded\"\n @error=\"flagImageAsFailed\"\n />\n <component :is=\"animation\" class=\"xds:picture-image\" :appear=\"false\">\n <!-- @slot Fallback image content. It will be rendered when all the images failed -->\n <slot v-if=\"!loadedImages.length && !pendingImages.length\" name=\"fallback\" />\n\n <!-- @slot Loading image content. It will be rendered while the real image is not loaded -->\n <slot v-else-if=\"!loadedImages.length\" name=\"placeholder\" />\n\n <img\n v-else\n :key=\"imageSrc\"\n :alt=\"result.name\"\n :src=\"imageSrc\"\n class=\"x-result-picture-image\"\n data-test=\"result-picture-image\"\n />\n </component>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type { Result } from '@empathyco/x-types'\nimport type { PropType, Ref, StyleValue } from 'vue'\nimport { computed, defineComponent, ref, watch } from 'vue'\nimport { AnimationProp } from '../../types'\nimport { NoAnimation } from '../animations'\n\n/**\n * Component to be reused that renders an `<img>`.\n *\n * @public\n */\nexport default defineComponent({\n name: 'BaseResultImage',\n props: {\n /** (Required) The {@link @empathyco/x-types#Result} information. */\n result: {\n type: Object as PropType<Result>,\n required: true,\n },\n /**\n * Animation to use when switching between the placeholder, the loaded image, or the failed\n * image fallback.\n */\n loadAnimation: {\n type: AnimationProp,\n default: () => NoAnimation,\n },\n /** Animation to use when switching between the loaded image and the hover image. */\n hoverAnimation: {\n type: AnimationProp,\n },\n /**\n * Indicates if the next valid image should be displayed on hover.\n *\n * @public\n */\n showNextImageOnHover: {\n type: Boolean,\n default: false,\n },\n },\n setup(props) {\n /**\n * Copy of the images of the result.\n *\n * It is used as a queue of images to load, once an image loads/fails to load, it is removed\n * from this array.\n *\n * @internal\n */\n const pendingImages: Ref<string[]> = ref([])\n\n /**\n * Contains the images that have been loaded successfully.\n *\n * @internal\n */\n const loadedImages: Ref<string[]> = ref([])\n\n /**\n * Indicates if the user is hovering the image.\n *\n * @internal\n */\n const isHovering = ref(false)\n\n /**\n * Indicates if the user has hovered the image.\n *\n * @internal\n */\n const userHasHoveredImage = ref(false)\n\n /**\n * Styles to use inline in the image loader, to prevent override from CSS\n *\n * @internal\n */\n const loaderStyles: StyleValue = {\n // csstype issue: https://github.com/frenic/csstype/issues/160\n position: 'absolute !important' as 'absolute',\n top: '0 !important' as '0',\n left: '0 !important' as '0',\n width: '100% !important' as '100%',\n height: '100% !important' as '100%',\n pointerEvents: 'none !important' as 'none',\n visibility: 'hidden !important' as 'hidden',\n }\n\n /**\n * Initializes images state and resets when the result's images change.\n *\n * @internal\n */\n watch(\n () => props.result.images,\n () => {\n pendingImages.value = [...(props.result.images ?? [])]\n loadedImages.value = pendingImages.value.filter(image => loadedImages.value.includes(image))\n },\n { immediate: true },\n )\n\n /**\n * Animation to be used.\n *\n * @returns The animation to be used, taking into account if the user has hovered the image.\n *\n * @internal\n */\n const animation = computed(() => {\n return userHasHoveredImage.value\n ? (props.hoverAnimation ?? props.loadAnimation)\n : props.loadAnimation\n })\n\n /**\n * Gets the src from the result image.\n *\n * @returns The result image src.\n *\n * @internal\n */\n const imageSrc = computed(() => {\n return loadedImages.value[\n !props.showNextImageOnHover || !isHovering.value ? 0 : loadedImages.value.length - 1\n ]\n })\n\n /**\n * Indicates if the loader should try to load the next image.\n *\n * @returns True if it should try to load the next image.\n *\n * @internal\n */\n const shouldLoadNextImage = computed(() => {\n const numImagesToLoad = props.showNextImageOnHover && userHasHoveredImage.value ? 2 : 1\n return !!pendingImages.value.length && loadedImages.value.length < numImagesToLoad\n })\n\n /**\n * Sets an image as failed.\n *\n * @internal\n */\n const flagImageAsFailed = () => {\n pendingImages.value.shift()\n }\n\n /**\n * Sets an image as loaded.\n *\n * @internal\n */\n const flagImageLoaded = () => {\n const image = pendingImages.value.shift()\n if (image) {\n loadedImages.value.push(image)\n }\n }\n\n return {\n pendingImages,\n loadedImages,\n isHovering,\n userHasHoveredImage,\n loaderStyles,\n animation,\n imageSrc,\n shouldLoadNextImage,\n flagImageAsFailed,\n flagImageLoaded,\n }\n },\n})\n</script>\n\n<style lang=\"css\" scoped>\n.x-result-picture {\n position: relative;\n min-width: 1px;\n min-height: 1px;\n}\n\n.x-result-picture-image {\n max-width: 100%;\n max-height: 100%;\n}\n</style>\n\n<docs lang=\"mdx\">\n## Examples\n\n### Basic example\n\nThis component is for the result image. It may be part of the search result page, recommendations or\nother section which needs to include results.\n\nThe result prop is required. It will render a `<img/>` with the result image:\n\n```vue\n<template>\n <BaseResultImage :result=\"result\" />\n</template>\n\n<script setup>\nimport { BaseResultImage } from '@empathyco/x-components'\nconst result = {\n name: 'Jacket',\n images: ['https://some-image-url.com/image1.jpg'],\n}\n</script>\n```\n\n### Showing the next image on hover\n\nIf a result has multiple images, it can show the next one on hover.\n\n```vue\n<template>\n <BaseResultImage :result=\"result\" showNextImageOnHover />\n</template>\n\n<script setup>\nimport { BaseResultImage } from '@empathyco/x-components'\nconst result = {\n name: 'Jacket',\n images: ['https://some-image-url.com/image1.jpg', 'https://some-image-url.com/image2.jpg'],\n}\n</script>\n```\n\n### Customizing slots content\n\nFallback and placeholder contents can be customized.\n\nThe fallback slot allows you to replace the content of the fallback image.\n\nThe other slot is called `placeholder`, and allows you to set the image that its going to be\ndisplayed while the real one is loaded.\n\n```vue\n<template>\n <BaseResultImage :result=\"result\">\n <template #placeholder>\n <img alt=\"Placeholder image\" src=\"./placeholder-image.svg\" />\n </template>\n <template #fallback>\n <img alt=\"Fallback image\" src=\"./fallback-image.svg\" />\n </template>\n </BaseResultImage>\n</template>\n\n<script setup>\nimport { BaseResultImage } from '@empathyco/x-components'\nconst result = {\n name: 'Jacket',\n images: ['https://some-image-url.com/image1.jpg'],\n}\n</script>\n```\n\n### Customizing the animations\n\nTwo animations can be used in this component.\n\nThe `loadAnimation` is used to transition between the placeholder, the fallback and the image.\n\nThe `hoverAnimation` is used to transition between the image and the hover image, if the\n`showNextImageOnHover` prop is `true`.\n\n`hoverAnimation` will default to `loadAnimation` if it is not provided.\n\n```vue\n<template>\n <BaseResultImage\n :result=\"result\"\n :loadAnimation=\"loadAnimation\"\n :hoverAnimation=\"hoverAnimation\"\n showNextImageOnHover\n />\n</template>\n\n<script setup>\nimport { BaseResultImage } from '@empathyco/x-components'\nimport { CrossFade, CollapseHeight } from '@empathyco/x-components/animations'\nconst loadAnimation = CrossFade\nconst hoverAnimation = CollapseHeight\nconst result = {\n name: 'Jacket',\n images: ['https://some-image-url.com/image1.jpg', 'https://some-image-url.com/image2.jpg'],\n}\n</script>\n```\n</docs>\n"],"names":["NoAnimation"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAgDA;;;;AAIE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,iBAAiB;AACvB,IAAA,KAAK,EAAE;;AAEL,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA;AACD;;;AAGE;AACF,QAAA,aAAa,EAAE;AACb,YAAA,IAAI,EAAE,aAAa;AACnB,YAAA,OAAO,EAAE,MAAMA,WAAW;AAC3B,SAAA;;AAED,QAAA,cAAc,EAAE;AACd,YAAA,IAAI,EAAE,aAAa;AACpB,SAAA;AACD;;;;AAIE;AACF,QAAA,oBAAoB,EAAE;AACpB,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,OAAO,EAAE,KAAK;AACf,SAAA;AACF,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAA;AACT;;;;;;;AAOE;AACF,QAAA,MAAM,aAAa,GAAkB,GAAG,CAAC,EAAE,CAAA;AAE3C;;;;AAIE;AACF,QAAA,MAAM,YAAY,GAAkB,GAAG,CAAC,EAAE,CAAA;AAE1C;;;;AAIE;AACF,QAAA,MAAM,UAAS,GAAI,GAAG,CAAC,KAAK,CAAA;AAE5B;;;;AAIE;AACF,QAAA,MAAM,sBAAsB,GAAG,CAAC,KAAK,CAAA;AAErC;;;;AAIE;AACF,QAAA,MAAM,YAAY,GAAe;;AAE/B,YAAA,QAAQ,EAAE,qBAAmC;AAC7C,YAAA,GAAG,EAAE,cAAqB;AAC1B,YAAA,IAAI,EAAE,cAAqB;AAC3B,YAAA,KAAK,EAAE,iBAA2B;AAClC,YAAA,MAAM,EAAE,iBAA2B;AACnC,YAAA,aAAa,EAAE,iBAA2B;AAC1C,YAAA,UAAU,EAAE,mBAA+B;SAC7C;AAEA;;;;AAIE;QACF,KAAK,CACH,MAAM,KAAK,CAAC,MAAM,CAAC,MAAM,EACzB,MAAI;AACF,YAAA,aAAa,CAAC,KAAI,GAAI,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAA;YACrD,YAAY,CAAC,KAAI,GAAI,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,KAAI,IAAK,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;AAC7F,QAAA,CAAC,EACD,EAAE,SAAS,EAAE,MAAM,CACrB;AAEA;;;;;;AAME;AACF,QAAA,MAAM,SAAQ,GAAI,QAAQ,CAAC,MAAI;YAC7B,OAAO,mBAAmB,CAAC;mBACtB,KAAK,CAAC,cAAa,IAAK,KAAK,CAAC,aAAa;AAC9C,kBAAE,KAAK,CAAC,aAAY;AACxB,QAAA,CAAC,CAAA;AAED;;;;;;AAME;AACF,QAAA,MAAM,QAAO,GAAI,QAAQ,CAAC,MAAI;AAC5B,YAAA,OAAO,YAAY,CAAC,KAAK,CACvB,CAAC,KAAK,CAAC,oBAAmB,IAAK,CAAC,UAAU,CAAC,KAAI,GAAI,CAAA,GAAI,YAAY,CAAC,KAAK,CAAC,SAAS,CAAA,CACrF;AACF,QAAA,CAAC,CAAA;AAED;;;;;;AAME;AACF,QAAA,MAAM,mBAAkB,GAAI,QAAQ,CAAC,MAAI;AACvC,YAAA,MAAM,eAAc,GAAI,KAAK,CAAC,oBAAmB,IAAK,mBAAmB,CAAC,KAAI,GAAI,IAAI,CAAA;AACtF,YAAA,OAAO,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,MAAK,IAAK,YAAY,CAAC,KAAK,CAAC,MAAK,GAAI,eAAc;AACnF,QAAA,CAAC,CAAA;AAED;;;;AAIE;QACF,MAAM,iBAAgB,GAAI,MAAI;AAC5B,YAAA,aAAa,CAAC,KAAK,CAAC,KAAK,EAAC;AAC5B,QAAA,CAAA;AAEA;;;;AAIE;QACF,MAAM,kBAAkB,MAAI;YAC1B,MAAM,KAAI,GAAI,aAAa,CAAC,KAAK,CAAC,KAAK,EAAC;YACxC,IAAI,KAAK,EAAE;AACT,gBAAA,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAA;YAC/B;AACF,QAAA,CAAA;QAEA,OAAO;YACL,aAAa;YACb,YAAY;YACZ,UAAU;YACV,mBAAmB;YACnB,YAAY;YACZ,SAAS;YACT,QAAQ;YACR,mBAAmB;YACnB,iBAAiB;YACjB,eAAe;SACjB;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"base-result-image2.vue.js","sources":["../../../../src/components/result/base-result-image.vue"],"sourcesContent":["<template>\n <!-- This is a div because using a picture causes the onload event of the image to fire twice. -->\n <!-- eslint-disable-next-line vuejs-accessibility/mouse-events-have-key-events -->\n <div\n class=\"x-result-picture xds:picture\"\n data-test=\"result-picture\"\n @mouseenter.once=\"userHasHoveredImage = true\"\n @mouseenter=\"isHovering = true\"\n @mouseleave=\"isHovering = false\"\n >\n <img\n v-if=\"shouldLoadNextImage\"\n loading=\"lazy\"\n :src=\"pendingImages[0]\"\n :style=\"loaderStyles\"\n class=\"xds:picture-image\"\n data-test=\"result-picture-loader\"\n alt=\"\"\n role=\"presentation\"\n @load=\"flagImageLoaded\"\n @error=\"flagImageAsFailed\"\n />\n <component :is=\"animation\" class=\"xds:picture-image\" :appear=\"false\">\n <!-- @slot Fallback image content. It will be rendered when all the images failed -->\n <slot v-if=\"!loadedImages.length && !pendingImages.length\" name=\"fallback\" />\n\n <!-- @slot Loading image content. It will be rendered while the real image is not loaded -->\n <slot v-else-if=\"!loadedImages.length\" name=\"placeholder\" />\n\n <img\n v-else\n :key=\"imageSrc\"\n :alt=\"result.name\"\n :src=\"imageSrc\"\n class=\"x-result-picture-image\"\n data-test=\"result-picture-image\"\n />\n </component>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type { Result } from '@empathyco/x-types'\nimport type { PropType, Ref, StyleValue } from 'vue'\nimport { computed, defineComponent, ref, watch } from 'vue'\nimport { AnimationProp } from '../../types'\nimport { NoAnimation } from '../animations'\n\n/**\n * Component to be reused that renders an `<img>`.\n *\n * @public\n */\nexport default defineComponent({\n name: 'BaseResultImage',\n props: {\n /** (Required) The {@link @empathyco/x-types#Result} information. */\n result: {\n type: Object as PropType<Result>,\n required: true,\n },\n /**\n * Animation to use when switching between the placeholder, the loaded image, or the failed\n * image fallback.\n */\n loadAnimation: {\n type: AnimationProp,\n default: () => NoAnimation,\n },\n /** Animation to use when switching between the loaded image and the hover image. */\n hoverAnimation: {\n type: AnimationProp,\n },\n /**\n * Indicates if the next valid image should be displayed on hover.\n *\n * @public\n */\n showNextImageOnHover: {\n type: Boolean,\n default: false,\n },\n },\n setup(props) {\n /**\n * Copy of the images of the result.\n *\n * It is used as a queue of images to load, once an image loads/fails to load, it is removed\n * from this array.\n *\n * @internal\n */\n const pendingImages: Ref<string[]> = ref([])\n\n /**\n * Contains the images that have been loaded successfully.\n *\n * @internal\n */\n const loadedImages: Ref<string[]> = ref([])\n\n /**\n * Indicates if the user is hovering the image.\n *\n * @internal\n */\n const isHovering = ref(false)\n\n /**\n * Indicates if the user has hovered the image.\n *\n * @internal\n */\n const userHasHoveredImage = ref(false)\n\n /**\n * Styles to use inline in the image loader, to prevent override from CSS\n *\n * @internal\n */\n const loaderStyles: StyleValue = {\n // csstype issue: https://github.com/frenic/csstype/issues/160\n position: 'absolute !important' as 'absolute',\n top: '0 !important' as '0',\n left: '0 !important' as '0',\n width: '100% !important' as '100%',\n height: '100% !important' as '100%',\n pointerEvents: 'none !important' as 'none',\n visibility: 'hidden !important' as 'hidden',\n }\n\n /**\n * Initializes images state and resets when the result's images change.\n *\n * @internal\n */\n watch(\n () => props.result.images,\n () => {\n pendingImages.value = [...(props.result.images ?? [])]\n loadedImages.value = pendingImages.value.filter(image => loadedImages.value.includes(image))\n },\n { immediate: true },\n )\n\n /**\n * Animation to be used.\n *\n * @returns The animation to be used, taking into account if the user has hovered the image.\n *\n * @internal\n */\n const animation = computed(() => {\n return userHasHoveredImage.value\n ? (props.hoverAnimation ?? props.loadAnimation)\n : props.loadAnimation\n })\n\n /**\n * Gets the src from the result image.\n *\n * @returns The result image src.\n *\n * @internal\n */\n const imageSrc = computed(() => {\n return loadedImages.value[\n !props.showNextImageOnHover || !isHovering.value ? 0 : loadedImages.value.length - 1\n ]\n })\n\n /**\n * Indicates if the loader should try to load the next image.\n *\n * @returns True if it should try to load the next image.\n *\n * @internal\n */\n const shouldLoadNextImage = computed(() => {\n const numImagesToLoad = props.showNextImageOnHover && userHasHoveredImage.value ? 2 : 1\n return !!pendingImages.value.length && loadedImages.value.length < numImagesToLoad\n })\n\n /**\n * Sets an image as failed.\n *\n * @internal\n */\n const flagImageAsFailed = () => {\n pendingImages.value.shift()\n }\n\n /**\n * Sets an image as loaded.\n *\n * @internal\n */\n const flagImageLoaded = () => {\n const image = pendingImages.value.shift()\n if (image) {\n loadedImages.value.push(image)\n }\n }\n\n return {\n pendingImages,\n loadedImages,\n isHovering,\n userHasHoveredImage,\n loaderStyles,\n animation,\n imageSrc,\n shouldLoadNextImage,\n flagImageAsFailed,\n flagImageLoaded,\n }\n },\n})\n</script>\n\n<style lang=\"css\" scoped>\n.x-result-picture {\n position: relative;\n min-width: 1px;\n min-height: 1px;\n}\n\n.x-result-picture-image {\n max-width: 100%;\n max-height: 100%;\n}\n</style>\n\n<docs lang=\"mdx\">\n## Examples\n\n### Basic example\n\nThis component is for the result image. It may be part of the search result page, recommendations or\nother section which needs to include results.\n\nThe result prop is required. It will render a `<img/>` with the result image:\n\n```vue\n<template>\n <BaseResultImage :result=\"result\" />\n</template>\n\n<script setup>\nimport { BaseResultImage } from '@empathyco/x-components'\nconst result = {\n name: 'Jacket',\n images: ['https://some-image-url.com/image1.jpg'],\n}\n</script>\n```\n\n### Showing the next image on hover\n\nIf a result has multiple images, it can show the next one on hover.\n\n```vue\n<template>\n <BaseResultImage :result=\"result\" showNextImageOnHover />\n</template>\n\n<script setup>\nimport { BaseResultImage } from '@empathyco/x-components'\nconst result = {\n name: 'Jacket',\n images: ['https://some-image-url.com/image1.jpg', 'https://some-image-url.com/image2.jpg'],\n}\n</script>\n```\n\n### Customizing slots content\n\nFallback and placeholder contents can be customized.\n\nThe fallback slot allows you to replace the content of the fallback image.\n\nThe other slot is called `placeholder`, and allows you to set the image that its going to be\ndisplayed while the real one is loaded.\n\n```vue\n<template>\n <BaseResultImage :result=\"result\">\n <template #placeholder>\n <img alt=\"Placeholder image\" src=\"./placeholder-image.svg\" />\n </template>\n <template #fallback>\n <img alt=\"Fallback image\" src=\"./fallback-image.svg\" />\n </template>\n </BaseResultImage>\n</template>\n\n<script setup>\nimport { BaseResultImage } from '@empathyco/x-components'\nconst result = {\n name: 'Jacket',\n images: ['https://some-image-url.com/image1.jpg'],\n}\n</script>\n```\n\n### Customizing the animations\n\nTwo animations can be used in this component.\n\nThe `loadAnimation` is used to transition between the placeholder, the fallback and the image.\n\nThe `hoverAnimation` is used to transition between the image and the hover image, if the\n`showNextImageOnHover` prop is `true`.\n\n`hoverAnimation` will default to `loadAnimation` if it is not provided.\n\n```vue\n<template>\n <BaseResultImage\n :result=\"result\"\n :loadAnimation=\"loadAnimation\"\n :hoverAnimation=\"hoverAnimation\"\n showNextImageOnHover\n />\n</template>\n\n<script setup>\nimport { BaseResultImage } from '@empathyco/x-components'\nimport { CrossFade, CollapseHeight } from '@empathyco/x-components/animations'\nconst loadAnimation = CrossFade\nconst hoverAnimation = CollapseHeight\nconst result = {\n name: 'Jacket',\n images: ['https://some-image-url.com/image1.jpg', 'https://some-image-url.com/image2.jpg'],\n}\n</script>\n```\n</docs>\n"],"names":["NoAnimation"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAgDA;;;;AAIE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,iBAAiB;AACvB,IAAA,KAAK,EAAE;;AAEL,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA;AACD;;;AAGE;AACF,QAAA,aAAa,EAAE;AACb,YAAA,IAAI,EAAE,aAAa;AACnB,YAAA,OAAO,EAAE,MAAMA,WAAW;AAC3B,SAAA;;AAED,QAAA,cAAc,EAAE;AACd,YAAA,IAAI,EAAE,aAAa;AACpB,SAAA;AACD;;;;AAIE;AACF,QAAA,oBAAoB,EAAE;AACpB,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,OAAO,EAAE,KAAK;AACf,SAAA;AACF,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAA;AACT;;;;;;;AAOE;AACF,QAAA,MAAM,aAAa,GAAkB,GAAG,CAAC,EAAE,CAAA;AAE3C;;;;AAIE;AACF,QAAA,MAAM,YAAY,GAAkB,GAAG,CAAC,EAAE,CAAA;AAE1C;;;;AAIE;AACF,QAAA,MAAM,UAAS,GAAI,GAAG,CAAC,KAAK,CAAA;AAE5B;;;;AAIE;AACF,QAAA,MAAM,sBAAsB,GAAG,CAAC,KAAK,CAAA;AAErC;;;;AAIE;AACF,QAAA,MAAM,YAAY,GAAe;;AAE/B,YAAA,QAAQ,EAAE,qBAAmC;AAC7C,YAAA,GAAG,EAAE,cAAqB;AAC1B,YAAA,IAAI,EAAE,cAAqB;AAC3B,YAAA,KAAK,EAAE,iBAA2B;AAClC,YAAA,MAAM,EAAE,iBAA2B;AACnC,YAAA,aAAa,EAAE,iBAA2B;AAC1C,YAAA,UAAU,EAAE,mBAA+B;SAC7C;AAEA;;;;AAIE;QACF,KAAK,CACH,MAAM,KAAK,CAAC,MAAM,CAAC,MAAM,EACzB,MAAI;AACF,YAAA,aAAa,CAAC,KAAI,GAAI,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAA;YACrD,YAAY,CAAC,KAAI,GAAI,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,KAAI,IAAK,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;AAC7F,QAAA,CAAC,EACD,EAAE,SAAS,EAAE,MAAM,CACrB;AAEA;;;;;;AAME;AACF,QAAA,MAAM,SAAQ,GAAI,QAAQ,CAAC,MAAI;YAC7B,OAAO,mBAAmB,CAAC;mBACtB,KAAK,CAAC,cAAa,IAAK,KAAK,CAAC,aAAa;AAC9C,kBAAE,KAAK,CAAC,aAAY;AACxB,QAAA,CAAC,CAAA;AAED;;;;;;AAME;AACF,QAAA,MAAM,QAAO,GAAI,QAAQ,CAAC,MAAI;AAC5B,YAAA,OAAO,YAAY,CAAC,KAAK,CACvB,CAAC,KAAK,CAAC,oBAAmB,IAAK,CAAC,UAAU,CAAC,KAAI,GAAI,CAAA,GAAI,YAAY,CAAC,KAAK,CAAC,SAAS,CAAA,CACrF;AACF,QAAA,CAAC,CAAA;AAED;;;;;;AAME;AACF,QAAA,MAAM,mBAAkB,GAAI,QAAQ,CAAC,MAAI;AACvC,YAAA,MAAM,eAAc,GAAI,KAAK,CAAC,oBAAmB,IAAK,mBAAmB,CAAC,KAAI,GAAI,IAAI,CAAA;AACtF,YAAA,OAAO,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,MAAK,IAAK,YAAY,CAAC,KAAK,CAAC,MAAK,GAAI,eAAc;AACnF,QAAA,CAAC,CAAA;AAED;;;;AAIE;QACF,MAAM,iBAAgB,GAAI,MAAI;AAC5B,YAAA,aAAa,CAAC,KAAK,CAAC,KAAK,EAAC;AAC5B,QAAA,CAAA;AAEA;;;;AAIE;QACF,MAAM,kBAAkB,MAAI;YAC1B,MAAM,KAAI,GAAI,aAAa,CAAC,KAAK,CAAC,KAAK,EAAC;YACxC,IAAI,KAAK,EAAE;AACT,gBAAA,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAA;YAC/B;AACF,QAAA,CAAA;QAEA,OAAO;YACL,aAAa;YACb,YAAY;YACZ,UAAU;YACV,mBAAmB;YACnB,YAAY;YACZ,SAAS;YACT,QAAQ;YACR,mBAAmB;YACnB,iBAAiB;YACjB,eAAe;SACjB;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-result-image3.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import _sfc_main from './base-result-
|
|
1
|
+
import _sfc_main from './base-result-link2.vue.js';
|
|
2
2
|
import { openBlock, createElementBlock, withModifiers, renderSlot } from 'vue';
|
|
3
|
-
import './base-result-
|
|
3
|
+
import './base-result-link3.vue.js';
|
|
4
4
|
import _export_sfc from '../../_virtual/_plugin-vue_export-helper.js';
|
|
5
5
|
|
|
6
6
|
const _hoisted_1 = ["href"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-result-
|
|
1
|
+
{"version":3,"file":"base-result-link2.vue.js","sources":["../../../../src/components/result/base-result-link.vue"],"sourcesContent":["<template>\n <a\n :ref=\"el\"\n :href=\"result.url\"\n class=\"x-result-link\"\n data-test=\"result-link\"\n @click=\"emitUserClickedAResult\"\n @click.right=\"emitUserClickedAResult\"\n @click.middle=\"emitUserClickedAResult\"\n >\n <!--\n @slot (Required) Link content with a text, an image, another component or both\n @binding {Result} result - Result data\n -->\n <slot :result=\"result\" />\n </a>\n</template>\n\n<script lang=\"ts\">\nimport type { Result } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport type { PropsWithType } from '../../utils/types'\nimport type { WireMetadata } from '../../wiring'\nimport type { XEventsTypes } from '../../wiring/events.types'\nimport { defineComponent, inject, ref } from 'vue'\nimport { use$x } from '../../composables/index'\n\n/**\n * Component to be reused that renders an `<a>` wrapping the result contents.\n *\n * @remarks\n * It has the logic to emit {@link XEventsTypes.UserClickedAResult} to the bus on click mouse\n * events. Additionally, this component may be injected other events to be emitted on click\n * event, so, depending on where it's used its father component may provide this events.\n *\n * @public\n */\nexport default defineComponent({\n props: {\n /**\n * (Required) The {@link @empathyco/x-types#Result} information.\n *\n * @public\n */\n result: {\n type: Object as PropType<Result>,\n required: true,\n },\n },\n setup(props) {\n const $x = use$x()\n\n /**\n * The rendered DOM element.\n *\n * @internal\n */\n const el = ref()\n\n /**\n * The list of additional events to be emitted by the component when user clicks the link.\n *\n * @internal\n */\n const resultClickExtraEvents = inject<PropsWithType<XEventsTypes, Result>[]>(\n 'resultClickExtraEvents',\n [],\n )\n\n /**\n * The metadata to be injected in the events emitted by the component. This component can emit\n * have extra events so this record pairs each event to its metadata.\n */\n const resultLinkMetadataPerEvent = inject<\n // TODO: Refactor this inject key to the constants when doing EMP-909\n Partial<\n Record<\n PropsWithType<XEventsTypes, Result>,\n Omit<WireMetadata, 'moduleName' | 'origin' | 'location'>\n >\n >\n >('resultLinkMetadataPerEvent', {})\n\n /**\n * Emits the {@link XEventsTypes.UserClickedAResult} when user clicks on the result, and also\n * additional events if have been injected in the component.\n *\n * @internal\n */\n const emitUserClickedAResult = (): void => {\n $x.emit('UserClickedAResult', props.result, {\n target: el.value!,\n ...resultLinkMetadataPerEvent.UserClickedAResult,\n })\n resultClickExtraEvents.forEach(event => {\n $x.emit(event, props.result, { target: el.value!, ...resultLinkMetadataPerEvent[event] })\n })\n }\n\n return {\n el,\n emitUserClickedAResult,\n }\n },\n})\n</script>\n\n<style lang=\"css\" scoped>\n.x-result-link {\n text-decoration: none;\n}\n</style>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits the following event:\n\n- [`UserClickedAResult`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n\nThe component can emit more events on click using the `resultClickExtraEvents` prop.\n\n## Examples\n\nThis component is a wrapper for the result contents (images, name, price...). It may be part of the\nsearch result page, recommendations or other section which needs to include results.\n\nAdditionally, this component may be injected other events to be emitted on click event, so,\ndepending where it's used its father component may provide these events.\n\nThe result prop is required. It will render an anchor element with the href to the result URL:\n\n```vue\n<template>\n <BaseResultLink :result=\"result\">\n <template #default=\"{ result }\">\n <img :src=\"result.images[0]\" alt=\"Result image\" />\n <span>{{ result.name }}</span>\n </template>\n </BaseResultLink>\n</template>\n\n<script setup>\nimport { BaseResultLink } from '@empathyco/x-components'\nconst result = {\n name: 'Jacket',\n url: 'https://shop.com/jacket',\n images: ['https://shop.com/jacket.jpg'],\n}\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;;;;;;;AA2BA;;;;;;;;;AASE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,KAAK,EAAE;AACL;;;;AAIE;AACF,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA;AACF,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAA;AACT,QAAA,MAAM,EAAC,GAAI,KAAK,EAAC;AAEjB;;;;AAIE;AACF,QAAA,MAAM,KAAK,GAAG,EAAC;AAEf;;;;AAIE;QACF,MAAM,sBAAqB,GAAI,MAAM,CACnC,wBAAwB,EACxB,EAAE,CACJ;AAEA;;;AAGE;QACF,MAAM,0BAAyB,GAAI,MAAM,CAQvC,4BAA4B,EAAE,EAAE,CAAA;AAElC;;;;;AAKE;QACF,MAAM,sBAAqB,GAAI,MAAU;YACvC,EAAE,CAAC,IAAI,CAAC,oBAAoB,EAAE,KAAK,CAAC,MAAM,EAAE;gBAC1C,MAAM,EAAE,EAAE,CAAC,KAAM;gBACjB,GAAG,0BAA0B,CAAC,kBAAkB;AACjD,aAAA,CAAA;AACD,YAAA,sBAAsB,CAAC,OAAO,CAAC,KAAI,IAAG;gBACpC,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,KAAM,EAAE,GAAG,0BAA0B,CAAC,KAAK,GAAG,CAAA;AAC1F,YAAA,CAAC,CAAA;AACH,QAAA,CAAA;QAEA,OAAO;YACL,EAAE;YACF,sBAAsB;SACxB;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-result-link3.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _sfc_main from './base-result-previous-
|
|
1
|
+
import _sfc_main from './base-result-previous-price2.vue.js';
|
|
2
2
|
import { resolveComponent, openBlock, createElementBlock, renderSlot, createBlock, createCommentVNode } from 'vue';
|
|
3
3
|
import _export_sfc from '../../_virtual/_plugin-vue_export-helper.js';
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-result-previous-
|
|
1
|
+
{"version":3,"file":"base-result-previous-price2.vue.js","sources":["../../../../src/components/result/base-result-previous-price.vue"],"sourcesContent":["<template>\n <div\n v-if=\"result.price?.hasDiscount\"\n class=\"x-result-previous-price\"\n data-test=\"result-previous-price\"\n >\n <!--\n @slot Base currency item\n @binding {result} result - Result data\n -->\n <slot :result=\"result\">\n <BaseCurrency\n v-if=\"result.price?.originalValue\"\n :value=\"result.price.originalValue\"\n :currency=\"currency\"\n :format=\"format\"\n />\n </slot>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type { Result } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport { defineComponent } from 'vue'\nimport BaseCurrency from '../currency/base-currency.vue'\n\n/**\n * Component that renders the {@link @empathyco/x-types#Result} previous price.\n *\n * @public\n */\nexport default defineComponent({\n components: { BaseCurrency },\n props: {\n /**\n * (Required) The {@link @empathyco/x-types#Result} information.\n *\n * @public\n */\n result: {\n type: Object as PropType<Result>,\n required: true,\n },\n /**\n * Optional value coming from https://en.wikipedia.org/wiki/ISO_4217#List_of_ISO_4217_currency_codes.\n *\n * @public\n */\n currency: String,\n /**\n * The currency format possibilities from Intl.NumberFormatOptions.\n * Allows customization of decimal places, grouping, etc.\n *\n * @public\n */\n format: {\n type: Object as PropType<Omit<Intl.NumberFormatOptions, 'currency' | 'style'>>,\n default: () => ({}),\n },\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Examples\n\n### Basic example\n\nThis component shows the previous price formatted if it has discount. The component has optional\n`currency` and `format` props to customize the display.\n\n```vue\n<template>\n <BaseResultPreviousPrice :result=\"result\" currency=\"USD\" />\n</template>\n\n<script setup>\nimport { BaseResultPreviousPrice } from '@empathyco/x-components'\n\nconst result = {\n price: { originalValue: 199.99, hasDiscount: true },\n // ...other result properties\n}\n</script>\n```\n\n### Customizing format\n\nYou can customize the number formatting using the `format` prop with `Intl.NumberFormatOptions`:\n\n```vue\n<template>\n <BaseResultPreviousPrice\n :result=\"result\"\n currency=\"EUR\"\n :format=\"{ minimumFractionDigits: 2, maximumFractionDigits: 2 }\"\n />\n</template>\n\n<script setup>\nimport { BaseResultPreviousPrice } from '@empathyco/x-components'\n\nconst result = {\n price: { originalValue: 199.99, hasDiscount: true },\n // ...other result properties\n}\n</script>\n```\n\n### Overriding default slot\n\n```vue\n<template>\n <BaseResultPreviousPrice :result=\"result\">\n <span class=\"custom-base-result-previous-price\">{{ result.price.originalValue }}</span>\n </BaseResultPreviousPrice>\n</template>\n\n<script setup>\nimport { BaseResultPreviousPrice } from '@empathyco/x-components'\n\nconst result = {\n price: { originalValue: 199.99, hasDiscount: true },\n // ...other result properties\n}\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;AA2BA;;;;AAIE;AACF,gBAAe,eAAe,CAAC;IAC7B,UAAU,EAAE,EAAE,YAAW,EAAG;AAC5B,IAAA,KAAK,EAAE;AACL;;;;AAIE;AACF,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA;AACD;;;;AAIE;AACF,QAAA,QAAQ,EAAE,MAAM;AAChB;;;;;AAKE;AACF,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,MAAwE;AAC9E,YAAA,OAAO,EAAE,OAAO,EAAE,CAAC;AACpB,SAAA;AACF,KAAA;AACF,CAAA,CAAA;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import _sfc_main from './base-result-
|
|
1
|
+
import _sfc_main from './base-result-rating2.vue.js';
|
|
2
2
|
import { resolveComponent, openBlock, createBlock, resolveDynamicComponent, withCtx, renderSlot, createVNode, mergeProps, createCommentVNode } from 'vue';
|
|
3
|
-
import './base-result-
|
|
3
|
+
import './base-result-rating3.vue.js';
|
|
4
4
|
import _export_sfc from '../../_virtual/_plugin-vue_export-helper.js';
|
|
5
5
|
|
|
6
6
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
package/js/components/result/{base-result-rating.vue2.js.map → base-result-rating2.vue.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-result-
|
|
1
|
+
{"version":3,"file":"base-result-rating2.vue.js","sources":["../../../../src/components/result/base-result-rating.vue"],"sourcesContent":["<template>\n <component\n :is=\"link ? 'a' : 'div'\"\n v-if=\"result.rating && result.rating.value\"\n :ref=\"el\"\n :href=\"link\"\n class=\"x-result-rating\"\n data-test=\"result-rating\"\n @click=\"emitClickedEvent\"\n >\n <!--\n @slot To override the whole content\n -->\n <slot :rating=\"result.rating.value\" :result=\"result\">\n <BaseRating :value=\"result.rating.value\" v-bind=\"$attrs\">\n <template #empty-icon>\n <!--\n @slot The content to render as empty icon\n -->\n <slot name=\"empty-icon\" />\n </template>\n\n <template #filled-icon>\n <!--\n @slot The content to render as filled icon\n -->\n <slot name=\"filled-icon\" />\n </template>\n </BaseRating>\n </slot>\n </component>\n</template>\n\n<script lang=\"ts\">\nimport type { Result } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport { defineComponent, ref } from 'vue'\nimport { use$x } from '../../composables/index'\nimport BaseRating from '../base-rating.vue'\n\n/**\n * This component renders a {@link BaseRating} for a result passed as prop.\n *\n * @public\n */\nexport default defineComponent({\n components: {\n BaseRating,\n },\n inheritAttrs: false,\n props: {\n /**\n * The {@link @empathyco/x-types#Result} to render its rating.\n *\n * @public\n */\n result: {\n type: Object as PropType<Result>,\n required: true,\n },\n\n /**\n * A link to redirect when rating is clicked.\n *\n * @public\n */\n link: {\n type: String,\n },\n },\n setup(props) {\n const $x = use$x()\n\n const el = ref<HTMLElement | null>()\n\n /**\n * Emits the `UserClickedAResultRating` event when user clicks this component, with the\n * {@link @empathyco/x-types#Result} as payload.\n *\n * @internal\n */\n const emitClickedEvent = (): void => {\n $x.emit('UserClickedAResultRating', props.result, {\n target: el.value!,\n })\n }\n\n return {\n el,\n emitClickedEvent,\n }\n },\n})\n</script>\n\n<style lang=\"css\" scoped>\n.x-result-rating {\n color: inherit;\n text-decoration: none;\n}\n</style>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits the following events:\n\n- [`UserClickedAResultRating`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n\n## Examples\n\n### Basic example\n\n```vue\n<template>\n <BaseResultRating :result=\"result\" />\n</template>\n\n<script setup>\nimport { BaseResultRating } from '@empathyco/x-components'\nconst result = {\n id: 1,\n name: 'Result with rating',\n rating: { value: 3 },\n}\n</script>\n```\n\n### Play with props\n\n#### Custom max value\n\nIn this example, the result rating has been configured to 6 as maximum value using the prop `max`.\n\n```vue\n<template>\n <BaseResultRating :result=\"result\" :max=\"6\" />\n</template>\n\n<script setup>\nimport { BaseResultRating } from '@empathyco/x-components'\nconst result = {\n id: 1,\n name: 'Result with rating',\n rating: { value: 3 },\n}\n</script>\n```\n\n#### With link\n\nIn this example, the result rating has been configured with a link to redirect when is clicked.\n\n```vue\n<template>\n <BaseResultRating :result=\"result\" link=\"https://empathy.co/\" />\n</template>\n\n<script setup>\nimport { BaseResultRating } from '@empathyco/x-components'\nconst result = {\n id: 1,\n name: 'Result with rating',\n rating: { value: 3 },\n}\n</script>\n```\n\n### Play with events\n\nIn this example, a message has been added to be shown when the result rating is clicked.\n\n```vue\n<template>\n <BaseResultRating :result=\"result\" @UserClickedAResultRating=\"logUserClickedRating\" />\n</template>\n\n<script setup>\nimport { BaseResultRating } from '@empathyco/x-components'\nconst result = {\n id: 1,\n name: 'Result with rating',\n rating: { value: 3 },\n}\nfunction logUserClickedRating(result) {\n console.log('User clickedRating of this result:', result)\n}\n</script>\n```\n\n## Extending the component\n\n### Custom icons with slots\n\nThe rendered icons for rating can be configured through slots. Keep in mind that the icons for both\nstates (filled and empty), must have the same size make component work properly.\n\n```vue\n<template>\n <BaseResultRating :result=\"result\">\n <template #filled-icon>❤️</template>\n <template #empty-icon>🤍</template>\n </BaseResultRating>\n</template>\n\n<script setup>\nimport { BaseResultRating } from '@empathyco/x-components'\nconst result = {\n id: 1,\n name: 'Result with rating',\n rating: { value: 3 },\n}\n</script>\n```\n\n### Override all content\n\nIt is possible to override all the content of the component to show your own rating but keeping the\nlink and event behaviour:\n\n```vue\n<template>\n <BaseResultRating :result=\"result\" #default=\"{ rating, result }\">\n <span v-for=\"star in rating\" :key=\"star\">⭐️</span>\n <span>{{ result.name }}</span>\n </BaseResultRating>\n</template>\n\n<script setup>\nimport { BaseResultRating } from '@empathyco/x-components'\nconst result = {\n id: 1,\n name: 'Result with rating',\n rating: { value: 3 },\n}\n</script>\n```\n\n### Reuse BaseRating\n\nIt is also possible to reuse our rating component:\n\n```vue\n<template>\n <BaseResultRating :result=\"result\" #default=\"{ rating, result }\">\n <BaseRating :value=\"rating\" />\n <span>{{ result.name }}</span>\n </BaseResultRating>\n</template>\n\n<script setup>\nimport { BaseResultRating, BaseRating } from '@empathyco/x-components'\nconst result = {\n id: 1,\n name: 'Result with rating',\n rating: { value: 3 },\n}\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;;;;;;;;AAwCA;;;;AAIE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,UAAU,EAAE;QACV,UAAU;AACX,KAAA;AACD,IAAA,YAAY,EAAE,KAAK;AACnB,IAAA,KAAK,EAAE;AACL;;;;AAIE;AACF,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA;AAED;;;;AAIE;AACF,QAAA,IAAI,EAAE;AACJ,YAAA,IAAI,EAAE,MAAM;AACb,SAAA;AACF,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAA;AACT,QAAA,MAAM,EAAC,GAAI,KAAK,EAAC;AAEjB,QAAA,MAAM,EAAC,GAAI,GAAG,EAAqB;AAEnC;;;;;AAKE;QACF,MAAM,gBAAe,GAAI,MAAU;YACjC,EAAE,CAAC,IAAI,CAAC,0BAA0B,EAAE,KAAK,CAAC,MAAM,EAAE;gBAChD,MAAM,EAAE,EAAE,CAAC,KAAM;AAClB,aAAA,CAAA;AACH,QAAA,CAAA;QAEA,OAAO;YACL,EAAE;YACF,gBAAgB;SAClB;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-result-rating3.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import _sfc_main from './result-variant-
|
|
1
|
+
import _sfc_main from './result-variant-selector2.vue.js';
|
|
2
2
|
import { openBlock, createElementBlock, Fragment, renderList, normalizeClass, renderSlot, createElementVNode, createTextVNode, toDisplayString, createCommentVNode } from 'vue';
|
|
3
|
-
import './result-variant-
|
|
3
|
+
import './result-variant-selector3.vue.js';
|
|
4
4
|
import _export_sfc from '../../_virtual/_plugin-vue_export-helper.js';
|
|
5
5
|
|
|
6
6
|
const _hoisted_1 = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result-variant-selector.vue2.js","sources":["../../../../src/components/result/result-variant-selector.vue"],"sourcesContent":["<template>\n <ul v-if=\"result && variants\" class=\"x-result-variant-selector__list\" data-test=\"variants-list\">\n <li\n v-for=\"(variant, index) in variants\"\n :key=\"index\"\n class=\"x-result-variant-selector__item\"\n :class=\"{ 'x-result-variant-selector__item--is-selected': variantIsSelected(variant) }\"\n data-test=\"variant-item\"\n >\n <!--\n @slot Variant item\n @binding {ResultVariant} variant - The variant item\n @binding {boolean} isSelected - Indicates if the variant is selected\n @binding {() => void} selectVariant - Callback to select the variant\n -->\n <slot\n name=\"variant\"\n :variant=\"variant\"\n :is-selected=\"variantIsSelected(variant)\"\n :select-variant=\"() => selectVariant(variant)\"\n >\n <button data-test=\"variant-button\" class=\"x-button\" @click=\"selectVariant(variant)\">\n <!--\n @slot Variant content\n @binding {ResultVariant} variant - The variant item\n @binding {boolean} isSelected - Indicates if the variant is selected\n -->\n <slot name=\"variant-content\" :variant=\"variant\" :is-selected=\"variantIsSelected(variant)\">\n {{ variant }}\n </slot>\n </button>\n </slot>\n </li>\n </ul>\n</template>\n\n<script lang=\"ts\">\nimport type { Result, ResultVariant } from '@empathyco/x-types'\nimport type { Ref } from 'vue'\nimport { computed, defineComponent, inject } from 'vue'\nimport {\n RESULT_WITH_VARIANTS_KEY,\n SELECT_RESULT_VARIANT_KEY,\n SELECTED_VARIANTS_KEY,\n} from '../decorators/injection.consts'\n\n/**\n * Component to show and select the available variants of a product for a given nest level.\n * TODO: Log warning on mount when result is not injected.\n *\n * @public\n */\nexport default defineComponent({\n name: 'ResultVariantSelector',\n props: {\n /** The nest level of the variants to be rendered. */\n level: {\n type: Number,\n default: 0,\n },\n },\n setup(props, { slots }) {\n /**\n * Callback to be called when a variant is selected.\n *\n * @public\n * @returns The 'selectResultVariant' injection key.\n */\n const selectResultVariant = inject<(variant: ResultVariant, level?: number) => void>(\n SELECT_RESULT_VARIANT_KEY as string,\n )\n\n /** The original result, used to retrieve the available variants for the level. */\n const result = inject<Ref<Result>>(RESULT_WITH_VARIANTS_KEY as string)\n\n /** Array containing the selected variants. */\n const selectedVariants = inject<Ref<ResultVariant[]>>(SELECTED_VARIANTS_KEY as string)\n\n /**\n * It retrieves the available variants from the result.\n *\n * @returns - The variants of the result for the current level.\n */\n const variants = computed<ResultVariant[] | undefined>(() => {\n if (props.level === 0) {\n return result!.value?.variants\n }\n return selectedVariants!.value[props.level - 1]?.variants\n })\n\n /**\n * Gets the selected variant of the current level.\n *\n * @returns - The selected variant.\n */\n const selectedVariant = computed<ResultVariant | undefined>(() =>\n variants.value?.find(variant => variant === selectedVariants!.value[props.level]),\n )\n\n /**\n * Calls the provided method to select a variant.\n *\n * @param variant - Variant to select.\n */\n const selectVariant = (variant: ResultVariant) => {\n selectResultVariant!(variant, props.level)\n }\n\n /**\n * Checks if a variant is selected.\n *\n * @param variant - Variant to check.\n * @returns True if the variant is selected, false if not.\n */\n const variantIsSelected = (variant: ResultVariant) => {\n return selectedVariant.value === variant\n }\n\n /**\n * Render function to execute the `default` slot, binding `slotsProps` and getting only the\n * first `vNode` to avoid Fragments and Text root nodes.\n * If there are no result or variants, nothing is rendered.\n *\n * @remarks `slotProps` must be values without Vue reactivity and located inside the\n * render-function to update the binding data properly.\n *\n * @returns The root `vNode` of the `default` slot or empty string if there are\n * no result or variants.\n */\n function renderDefaultSlot() {\n const slotProps = {\n variants: variants.value,\n selectedVariant: selectedVariant.value,\n selectVariant,\n }\n return result && variants.value ? slots.default?.(slotProps)[0] : ''\n }\n\n /* Hack to render through a render-function, the `default` slot or, in its absence,\n the component itself. It is the alternative for the NoElement antipattern. */\n const componentProps = { result, variants, variantIsSelected, selectVariant }\n return (slots.default ? renderDefaultSlot : componentProps) as typeof componentProps\n },\n})\n</script>\n\n<style lang=\"css\" scoped>\n.x-result-variant-selector__list {\n display: flex;\n}\n</style>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component does not emit any events.\n\n## Examples\n\n### Basic usage\n\nThis component must be used as a child of `ResultVariantsProvider`.\n\nAlso, this component is intended to be used overwriting the content with the slots.\n\nBy default it will render a list of buttons containing the available variants.\n\nThis component only has a required `level` prop, that indicates the level of the variants to be\nrendered.\n\n```vue\n<template>\n <ResultVariantsProvider :result=\"result\">\n <p>Result name: {{ result.name }}</p>\n\n <h1>Select color</h1>\n <ResultVariantSelector :level=\"0\" />\n\n <h1>Select size</h1>\n <ResultVariantSelector :level=\"1\" />\n </ResultVariantsProvider>\n</template>\n\n<script setup>\nimport { ResultVariantsProvider, ResultVariantSelector } from '@empathyco/x-components'\nconst result = {\n id: 'jacket',\n modelName: 'Result',\n type: 'Product',\n isWishlisted: false,\n identifier: { value: 'jacket' },\n images: [],\n name: 'jacket',\n price: { hasDiscount: false, originalValue: 10, value: 10 },\n url: '/products/jacket',\n variants: [\n {\n name: 'red',\n variants: [{ name: 'red XL' }, { name: 'red L' }],\n },\n {\n name: 'blue',\n variants: [{ name: 'blue S' }, { name: 'blue M' }, { name: 'blue L' }],\n },\n ],\n}\n</script>\n```\n\n### Play with the default slot\n\nYou can customize the list using the default slot:\n\n```vue\n<template>\n <ResultVariantsProvider :result=\"result\">\n <ResultVariantSelector :level=\"0\" #default=\"{ variants, selectedVariant, selectVariant }\">\n <div>\n <p v-if=\"selectedVariant\">Selected variant: {{ selectedVariant.name }}</p>\n <ul class=\"x-flex\">\n <li v-for=\"(variant, index) in variants\" :key=\"index\">\n <button @click=\"selectVariant(variant)\">{{ variant.name }}</button>\n </li>\n </ul>\n </div>\n </ResultVariantSelector>\n </ResultVariantsProvider>\n</template>\n\n<script setup>\nimport { ResultVariantsProvider, ResultVariantSelector } from '@empathyco/x-components'\nconst result = {\n id: 'jacket',\n modelName: 'Result',\n type: 'Product',\n isWishlisted: false,\n identifier: { value: 'jacket' },\n images: [],\n name: 'jacket',\n price: { hasDiscount: false, originalValue: 10, value: 10 },\n url: '/products/jacket',\n variants: [{ name: 'red' }, { name: 'blue' }],\n}\n</script>\n```\n\n### Play with variant-slot\n\nYou can customize the variant item using the `variant` slot:\n\n```vue\n<template>\n <ResultVariantsProvider :result=\"result\">\n <ResultVariantSelector :level=\"0\" #variant=\"{ variant, isSelected, selectVariant }\">\n <div>\n <button @click=\"selectVariant\">\n {{ variant.name }}\n <span v-if=\"isSelected\">SELECTED!</span>\n </button>\n </div>\n </ResultVariantSelector>\n </ResultVariantsProvider>\n</template>\n\n<script setup>\nimport { ResultVariantsProvider, ResultVariantSelector } from '@empathyco/x-components'\nconst result = {\n id: 'jacket',\n modelName: 'Result',\n type: 'Product',\n isWishlisted: false,\n identifier: { value: 'jacket' },\n images: [],\n name: 'jacket',\n price: { hasDiscount: false, originalValue: 10, value: 10 },\n url: '/products/jacket',\n variants: [{ name: 'red' }, { name: 'blue' }],\n}\n</script>\n```\n\n### Play with variant-content slot\n\nYou can customize the content of the default variant button using the `variant-content` slot:\n\n```vue\n<template>\n <ResultVariantsProvider :result=\"result\">\n <ResultVariantSelector #variant-content=\"{ variant, isSelected }\">\n <div>\n {{ variant.name }}\n <span v-if=\"isSelected\">SELECTED!</span>\n </div>\n </ResultVariantSelector>\n </ResultVariantsProvider>\n</template>\n\n<script setup>\nimport { ResultVariantsProvider, ResultVariantSelector } from '@empathyco/x-components'\nconst result = {\n id: 'jacket',\n modelName: 'Result',\n type: 'Product',\n isWishlisted: false,\n identifier: { value: 'jacket' },\n images: [],\n name: 'jacket',\n price: { hasDiscount: false, originalValue: 10, value: 10 },\n url: '/products/jacket',\n variants: [{ name: 'red' }, { name: 'blue' }],\n}\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;AA8CA;;;;;AAKE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,uBAAuB;AAC7B,IAAA,KAAK,EAAE;;AAEL,QAAA,KAAK,EAAE;AACL,YAAA,IAAI,EAAE,MAAM;AACZ,YAAA,OAAO,EAAE,CAAC;AACX,SAAA;AACF,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAE,EAAE,KAAI,EAAG,EAAA;AACpB;;;;;AAKE;AACF,QAAA,MAAM,mBAAkB,GAAI,MAAM,CAChC,yBAAmC,CACrC;;AAGA,QAAA,MAAM,MAAK,GAAI,MAAM,CAAc,wBAAkC,CAAA;;AAGrE,QAAA,MAAM,gBAAe,GAAI,MAAM,CAAuB,qBAA+B,CAAA;AAErF;;;;AAIE;AACF,QAAA,MAAM,QAAO,GAAI,QAAQ,CAA8B,MAAI;AACzD,YAAA,IAAI,KAAK,CAAC,KAAI,KAAM,CAAC,EAAE;AACrB,gBAAA,OAAO,MAAO,CAAC,KAAK,EAAE,QAAO;YAC/B;AACA,YAAA,OAAO,gBAAiB,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,QAAO;AAC1D,QAAA,CAAC,CAAA;AAED;;;;AAIE;AACF,QAAA,MAAM,eAAc,GAAI,QAAQ,CAA4B,MAC1D,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,OAAM,IAAK,OAAM,KAAM,gBAAiB,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CACnF;AAEA;;;;AAIE;AACF,QAAA,MAAM,aAAY,GAAI,CAAC,OAAsB,KAAG;AAC9C,YAAA,mBAAoB,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAA;AAC3C,QAAA,CAAA;AAEA;;;;;AAKE;AACF,QAAA,MAAM,iBAAgB,GAAI,CAAC,OAAsB,KAAG;AAClD,YAAA,OAAO,eAAe,CAAC,KAAI,KAAM,OAAM;AACzC,QAAA,CAAA;AAEA;;;;;;;;;;AAUE;AACF,QAAA,SAAS,iBAAiB,GAAA;AACxB,YAAA,MAAM,YAAY;gBAChB,QAAQ,EAAE,QAAQ,CAAC,KAAK;gBACxB,eAAe,EAAE,eAAe,CAAC,KAAK;gBACtC,aAAa;aACf;YACA,OAAO,MAAK,IAAK,QAAQ,CAAC,KAAI,GAAI,KAAK,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC,CAAC,CAAA,GAAI,EAAC;QACrE;AAEA;AAC+E;QAC/E,MAAM,cAAa,GAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,aAAY,EAAE;AAC5E,QAAA,QAAQ,KAAK,CAAC,OAAM,GAAI,iBAAgB,GAAI,cAAc;IAC5D,CAAC;AACF,CAAA,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"result-variant-selector2.vue.js","sources":["../../../../src/components/result/result-variant-selector.vue"],"sourcesContent":["<template>\n <ul v-if=\"result && variants\" class=\"x-result-variant-selector__list\" data-test=\"variants-list\">\n <li\n v-for=\"(variant, index) in variants\"\n :key=\"index\"\n class=\"x-result-variant-selector__item\"\n :class=\"{ 'x-result-variant-selector__item--is-selected': variantIsSelected(variant) }\"\n data-test=\"variant-item\"\n >\n <!--\n @slot Variant item\n @binding {ResultVariant} variant - The variant item\n @binding {boolean} isSelected - Indicates if the variant is selected\n @binding {() => void} selectVariant - Callback to select the variant\n -->\n <slot\n name=\"variant\"\n :variant=\"variant\"\n :is-selected=\"variantIsSelected(variant)\"\n :select-variant=\"() => selectVariant(variant)\"\n >\n <button data-test=\"variant-button\" class=\"x-button\" @click=\"selectVariant(variant)\">\n <!--\n @slot Variant content\n @binding {ResultVariant} variant - The variant item\n @binding {boolean} isSelected - Indicates if the variant is selected\n -->\n <slot name=\"variant-content\" :variant=\"variant\" :is-selected=\"variantIsSelected(variant)\">\n {{ variant }}\n </slot>\n </button>\n </slot>\n </li>\n </ul>\n</template>\n\n<script lang=\"ts\">\nimport type { Result, ResultVariant } from '@empathyco/x-types'\nimport type { Ref } from 'vue'\nimport { computed, defineComponent, inject } from 'vue'\nimport {\n RESULT_WITH_VARIANTS_KEY,\n SELECT_RESULT_VARIANT_KEY,\n SELECTED_VARIANTS_KEY,\n} from '../decorators/injection.consts'\n\n/**\n * Component to show and select the available variants of a product for a given nest level.\n * TODO: Log warning on mount when result is not injected.\n *\n * @public\n */\nexport default defineComponent({\n name: 'ResultVariantSelector',\n props: {\n /** The nest level of the variants to be rendered. */\n level: {\n type: Number,\n default: 0,\n },\n },\n setup(props, { slots }) {\n /**\n * Callback to be called when a variant is selected.\n *\n * @public\n * @returns The 'selectResultVariant' injection key.\n */\n const selectResultVariant = inject<(variant: ResultVariant, level?: number) => void>(\n SELECT_RESULT_VARIANT_KEY as string,\n )\n\n /** The original result, used to retrieve the available variants for the level. */\n const result = inject<Ref<Result>>(RESULT_WITH_VARIANTS_KEY as string)\n\n /** Array containing the selected variants. */\n const selectedVariants = inject<Ref<ResultVariant[]>>(SELECTED_VARIANTS_KEY as string)\n\n /**\n * It retrieves the available variants from the result.\n *\n * @returns - The variants of the result for the current level.\n */\n const variants = computed<ResultVariant[] | undefined>(() => {\n if (props.level === 0) {\n return result!.value?.variants\n }\n return selectedVariants!.value[props.level - 1]?.variants\n })\n\n /**\n * Gets the selected variant of the current level.\n *\n * @returns - The selected variant.\n */\n const selectedVariant = computed<ResultVariant | undefined>(() =>\n variants.value?.find(variant => variant === selectedVariants!.value[props.level]),\n )\n\n /**\n * Calls the provided method to select a variant.\n *\n * @param variant - Variant to select.\n */\n const selectVariant = (variant: ResultVariant) => {\n selectResultVariant!(variant, props.level)\n }\n\n /**\n * Checks if a variant is selected.\n *\n * @param variant - Variant to check.\n * @returns True if the variant is selected, false if not.\n */\n const variantIsSelected = (variant: ResultVariant) => {\n return selectedVariant.value === variant\n }\n\n /**\n * Render function to execute the `default` slot, binding `slotsProps` and getting only the\n * first `vNode` to avoid Fragments and Text root nodes.\n * If there are no result or variants, nothing is rendered.\n *\n * @remarks `slotProps` must be values without Vue reactivity and located inside the\n * render-function to update the binding data properly.\n *\n * @returns The root `vNode` of the `default` slot or empty string if there are\n * no result or variants.\n */\n function renderDefaultSlot() {\n const slotProps = {\n variants: variants.value,\n selectedVariant: selectedVariant.value,\n selectVariant,\n }\n return result && variants.value ? slots.default?.(slotProps)[0] : ''\n }\n\n /* Hack to render through a render-function, the `default` slot or, in its absence,\n the component itself. It is the alternative for the NoElement antipattern. */\n const componentProps = { result, variants, variantIsSelected, selectVariant }\n return (slots.default ? renderDefaultSlot : componentProps) as typeof componentProps\n },\n})\n</script>\n\n<style lang=\"css\" scoped>\n.x-result-variant-selector__list {\n display: flex;\n}\n</style>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component does not emit any events.\n\n## Examples\n\n### Basic usage\n\nThis component must be used as a child of `ResultVariantsProvider`.\n\nAlso, this component is intended to be used overwriting the content with the slots.\n\nBy default it will render a list of buttons containing the available variants.\n\nThis component only has a required `level` prop, that indicates the level of the variants to be\nrendered.\n\n```vue\n<template>\n <ResultVariantsProvider :result=\"result\">\n <p>Result name: {{ result.name }}</p>\n\n <h1>Select color</h1>\n <ResultVariantSelector :level=\"0\" />\n\n <h1>Select size</h1>\n <ResultVariantSelector :level=\"1\" />\n </ResultVariantsProvider>\n</template>\n\n<script setup>\nimport { ResultVariantsProvider, ResultVariantSelector } from '@empathyco/x-components'\nconst result = {\n id: 'jacket',\n modelName: 'Result',\n type: 'Product',\n isWishlisted: false,\n identifier: { value: 'jacket' },\n images: [],\n name: 'jacket',\n price: { hasDiscount: false, originalValue: 10, value: 10 },\n url: '/products/jacket',\n variants: [\n {\n name: 'red',\n variants: [{ name: 'red XL' }, { name: 'red L' }],\n },\n {\n name: 'blue',\n variants: [{ name: 'blue S' }, { name: 'blue M' }, { name: 'blue L' }],\n },\n ],\n}\n</script>\n```\n\n### Play with the default slot\n\nYou can customize the list using the default slot:\n\n```vue\n<template>\n <ResultVariantsProvider :result=\"result\">\n <ResultVariantSelector :level=\"0\" #default=\"{ variants, selectedVariant, selectVariant }\">\n <div>\n <p v-if=\"selectedVariant\">Selected variant: {{ selectedVariant.name }}</p>\n <ul class=\"x-flex\">\n <li v-for=\"(variant, index) in variants\" :key=\"index\">\n <button @click=\"selectVariant(variant)\">{{ variant.name }}</button>\n </li>\n </ul>\n </div>\n </ResultVariantSelector>\n </ResultVariantsProvider>\n</template>\n\n<script setup>\nimport { ResultVariantsProvider, ResultVariantSelector } from '@empathyco/x-components'\nconst result = {\n id: 'jacket',\n modelName: 'Result',\n type: 'Product',\n isWishlisted: false,\n identifier: { value: 'jacket' },\n images: [],\n name: 'jacket',\n price: { hasDiscount: false, originalValue: 10, value: 10 },\n url: '/products/jacket',\n variants: [{ name: 'red' }, { name: 'blue' }],\n}\n</script>\n```\n\n### Play with variant-slot\n\nYou can customize the variant item using the `variant` slot:\n\n```vue\n<template>\n <ResultVariantsProvider :result=\"result\">\n <ResultVariantSelector :level=\"0\" #variant=\"{ variant, isSelected, selectVariant }\">\n <div>\n <button @click=\"selectVariant\">\n {{ variant.name }}\n <span v-if=\"isSelected\">SELECTED!</span>\n </button>\n </div>\n </ResultVariantSelector>\n </ResultVariantsProvider>\n</template>\n\n<script setup>\nimport { ResultVariantsProvider, ResultVariantSelector } from '@empathyco/x-components'\nconst result = {\n id: 'jacket',\n modelName: 'Result',\n type: 'Product',\n isWishlisted: false,\n identifier: { value: 'jacket' },\n images: [],\n name: 'jacket',\n price: { hasDiscount: false, originalValue: 10, value: 10 },\n url: '/products/jacket',\n variants: [{ name: 'red' }, { name: 'blue' }],\n}\n</script>\n```\n\n### Play with variant-content slot\n\nYou can customize the content of the default variant button using the `variant-content` slot:\n\n```vue\n<template>\n <ResultVariantsProvider :result=\"result\">\n <ResultVariantSelector #variant-content=\"{ variant, isSelected }\">\n <div>\n {{ variant.name }}\n <span v-if=\"isSelected\">SELECTED!</span>\n </div>\n </ResultVariantSelector>\n </ResultVariantsProvider>\n</template>\n\n<script setup>\nimport { ResultVariantsProvider, ResultVariantSelector } from '@empathyco/x-components'\nconst result = {\n id: 'jacket',\n modelName: 'Result',\n type: 'Product',\n isWishlisted: false,\n identifier: { value: 'jacket' },\n images: [],\n name: 'jacket',\n price: { hasDiscount: false, originalValue: 10, value: 10 },\n url: '/products/jacket',\n variants: [{ name: 'red' }, { name: 'blue' }],\n}\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;AA8CA;;;;;AAKE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,uBAAuB;AAC7B,IAAA,KAAK,EAAE;;AAEL,QAAA,KAAK,EAAE;AACL,YAAA,IAAI,EAAE,MAAM;AACZ,YAAA,OAAO,EAAE,CAAC;AACX,SAAA;AACF,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAE,EAAE,KAAI,EAAG,EAAA;AACpB;;;;;AAKE;AACF,QAAA,MAAM,mBAAkB,GAAI,MAAM,CAChC,yBAAmC,CACrC;;AAGA,QAAA,MAAM,MAAK,GAAI,MAAM,CAAc,wBAAkC,CAAA;;AAGrE,QAAA,MAAM,gBAAe,GAAI,MAAM,CAAuB,qBAA+B,CAAA;AAErF;;;;AAIE;AACF,QAAA,MAAM,QAAO,GAAI,QAAQ,CAA8B,MAAI;AACzD,YAAA,IAAI,KAAK,CAAC,KAAI,KAAM,CAAC,EAAE;AACrB,gBAAA,OAAO,MAAO,CAAC,KAAK,EAAE,QAAO;YAC/B;AACA,YAAA,OAAO,gBAAiB,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,QAAO;AAC1D,QAAA,CAAC,CAAA;AAED;;;;AAIE;AACF,QAAA,MAAM,eAAc,GAAI,QAAQ,CAA4B,MAC1D,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,OAAM,IAAK,OAAM,KAAM,gBAAiB,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CACnF;AAEA;;;;AAIE;AACF,QAAA,MAAM,aAAY,GAAI,CAAC,OAAsB,KAAG;AAC9C,YAAA,mBAAoB,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAA;AAC3C,QAAA,CAAA;AAEA;;;;;AAKE;AACF,QAAA,MAAM,iBAAgB,GAAI,CAAC,OAAsB,KAAG;AAClD,YAAA,OAAO,eAAe,CAAC,KAAI,KAAM,OAAM;AACzC,QAAA,CAAA;AAEA;;;;;;;;;;AAUE;AACF,QAAA,SAAS,iBAAiB,GAAA;AACxB,YAAA,MAAM,YAAY;gBAChB,QAAQ,EAAE,QAAQ,CAAC,KAAK;gBACxB,eAAe,EAAE,eAAe,CAAC,KAAK;gBACtC,aAAa;aACf;YACA,OAAO,MAAK,IAAK,QAAQ,CAAC,KAAI,GAAI,KAAK,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC,CAAC,CAAA,GAAI,EAAC;QACrE;AAEA;AAC+E;QAC/E,MAAM,cAAa,GAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,aAAY,EAAE;AAC5E,QAAA,QAAQ,KAAK,CAAC,OAAM,GAAI,iBAAgB,GAAI,cAAc;IAC5D,CAAC;AACF,CAAA,CAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result-variant-selector3.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result-variants-provider2.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-
|
|
1
|
+
{"version":3,"file":"base-scroll2.vue.js","sources":["../../../../src/components/scroll/base-scroll.vue"],"sourcesContent":["<template>\n <div\n ref=\"baseScrollEl\"\n class=\"x-base-scroll xds:scroll\"\n data-test=\"base-scroll\"\n @scroll=\"throttledStoreScrollData\"\n >\n <slot />\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type { PropType, SetupContext } from 'vue'\nimport type { XEvent } from '../../wiring/events.types'\nimport { defineComponent, ref } from 'vue'\nimport { useScroll } from './use-scroll'\n\n/**\n * Base scroll component that depending on the user interactivity emits different events for\n * knowing when the user scrolls, the direction of scroll and if user reaches the start or end.\n *\n * @public\n */\nexport default defineComponent({\n name: 'BaseScroll',\n props: {\n /**\n * Distance to the end of the scroll that when reached will emit the\n * `scroll:about-to-end` event.\n *\n * @public\n */\n distanceToBottom: {\n type: Number,\n default: 100,\n },\n /**\n * Positive vertical distance to still consider that the element is the first one visible.\n * For example, if set to 100, after scrolling 100 pixels, the first rendered element\n * will still be considered the first one.\n */\n firstElementThresholdPx: {\n type: Number,\n default: 100,\n },\n /**\n * Time duration to ignore the subsequent scroll events after an emission.\n * Higher values will decrease events precision but can prevent performance issues.\n *\n * @public\n */\n throttleMs: {\n type: Number,\n default: 100,\n },\n /**\n * If true (default), sets the scroll position to the top when certain events are emitted.\n *\n * @public\n */\n resetOnChange: {\n type: Boolean,\n default: true,\n },\n /**\n * List of events that should reset the scroll when emitted.\n *\n * @public\n */\n resetOn: {\n type: [String, Array] as PropType<XEvent | XEvent[]>,\n default: () => [\n 'SearchBoxQueryChanged',\n 'SortChanged',\n 'SelectedFiltersChanged',\n 'SelectedFiltersForRequestChanged',\n 'SelectedRelatedTagsChanged',\n 'UserChangedExtraParams',\n ],\n },\n },\n emits: [\n 'scroll',\n 'scroll:at-start',\n 'scroll:almost-at-end',\n 'scroll:at-end',\n 'scroll:direction-change',\n ],\n setup(props, context) {\n const baseScrollEl = ref<HTMLElement>()\n\n const { throttledStoreScrollData } = useScroll(\n props,\n context as SetupContext<any>,\n baseScrollEl,\n )\n\n return {\n throttledStoreScrollData,\n baseScrollEl,\n }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Examples\n\n### Basic usage\n\nThis is a highly configurable component that manages the scroll state of an element and emits events\nfor scroll position, direction, when reaching the start or end, and when about reaching the end.\n\n```vue\n<template>\n <BaseScroll\n @scroll=\"onScroll\"\n @scroll:direction-change=\"onDirectionChange\"\n @scroll:at-start=\"onAtStart\"\n @scroll:almost-at-end=\"onAlmostAtEnd\"\n @scroll:at-end=\"onAtEnd\"\n :throttleMs=\"1000\"\n :distanceToBottom=\"200\"\n >\n <div class=\"content-scroll\">\n <span>content1</span>\n <span>content2</span>\n </div>\n </BaseScroll>\n</template>\n\n<script setup>\nimport { BaseScroll } from '@empathyco/x-components'\nfunction onScroll(position) {\n console.log('scroll', position)\n}\nfunction onDirectionChange(direction) {\n console.log('scroll:direction-change', direction)\n}\nfunction onAtStart() {\n console.log('scroll:at-start')\n}\nfunction onAlmostAtEnd(distance) {\n console.log('scroll:almost-at-end', distance)\n}\nfunction onAtEnd() {\n console.log('scroll:at-end')\n}\n</script>\n```\n\n### Avoid reset scroll on query change\n\nSet `resetOnChange` to `false` to prevent scroll reset on query change (default is `true`).\n\n```vue\n<template>\n <BaseScroll @scroll=\"onScroll\" :resetOnChange=\"false\">\n <div class=\"content-scroll\">\n <span>content1</span>\n <span>content2</span>\n </div>\n </BaseScroll>\n</template>\n\n<script setup>\nimport { BaseScroll } from '@empathyco/x-components'\nfunction onScroll(position) {\n console.log('scroll', position)\n}\n</script>\n```\n\n### Reset scroll\n\nConfigure which events reset the scroll position using the `resetOn` prop.\n\n```vue\n<template>\n <BaseScroll @scroll=\"onScroll\" :resetOn=\"resetScrollEvents\">\n <div class=\"content-scroll\">\n <span>content1</span>\n <span>content2</span>\n </div>\n </BaseScroll>\n</template>\n\n<script setup>\nimport { BaseScroll } from '@empathyco/x-components'\nconst resetScrollEvents = ['UserAcceptedAQuery']\nfunction onScroll(position) {\n console.log('scroll', position)\n}\n</script>\n```\n\n## Vue Events\n\n- `scroll`: emitted after the user scrolls in this container. Payload: scroll top distance in pixels.\n- `scroll:direction-change`: emitted when the user changes the scroll direction. Payload: new direction.\n- `scroll:at-start`: emitted when the user scrolls to the initial position.\n- `scroll:almost-at-end`: emitted when the user is about to reach the bottom.\n- `scroll:at-end`: emitted when the user has reached the bottom.\n</docs>\n"],"names":[],"mappings":";;;AAiBA;;;;;AAKE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,YAAY;AAClB,IAAA,KAAK,EAAE;AACL;;;;;AAKE;AACF,QAAA,gBAAgB,EAAE;AAChB,YAAA,IAAI,EAAE,MAAM;AACZ,YAAA,OAAO,EAAE,GAAG;AACb,SAAA;AACD;;;;AAIE;AACF,QAAA,uBAAuB,EAAE;AACvB,YAAA,IAAI,EAAE,MAAM;AACZ,YAAA,OAAO,EAAE,GAAG;AACb,SAAA;AACD;;;;;AAKE;AACF,QAAA,UAAU,EAAE;AACV,YAAA,IAAI,EAAE,MAAM;AACZ,YAAA,OAAO,EAAE,GAAG;AACb,SAAA;AACD;;;;AAIE;AACF,QAAA,aAAa,EAAE;AACb,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,OAAO,EAAE,IAAI;AACd,SAAA;AACD;;;;AAIE;AACF,QAAA,OAAO,EAAE;AACP,YAAA,IAAI,EAAE,CAAC,MAAM,EAAE,KAAK,CAAgC;YACpD,OAAO,EAAE,MAAM;gBACb,uBAAuB;gBACvB,aAAa;gBACb,wBAAwB;gBACxB,kCAAkC;gBAClC,4BAA4B;gBAC5B,wBAAwB;AACzB,aAAA;AACF,SAAA;AACF,KAAA;AACD,IAAA,KAAK,EAAE;QACL,QAAQ;QACR,iBAAiB;QACjB,sBAAsB;QACtB,eAAe;QACf,yBAAyB;AAC1B,KAAA;IACD,KAAK,CAAC,KAAK,EAAE,OAAO,EAAA;AAClB,QAAA,MAAM,YAAW,GAAI,GAAG,EAAc;AAEtC,QAAA,MAAM,EAAE,wBAAuB,EAAE,GAAI,SAAS,CAC5C,KAAK,EACL,OAA4B,EAC5B,YAAY,CACd;QAEA,OAAO;YACL,wBAAwB;YACxB,YAAY;SACd;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import _sfc_main from './sliding-
|
|
1
|
+
import _sfc_main from './sliding-panel2.vue.js';
|
|
2
2
|
import { openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot, Fragment, createTextVNode, createCommentVNode } from 'vue';
|
|
3
|
-
import './sliding-
|
|
3
|
+
import './sliding-panel3.vue.js';
|
|
4
4
|
import _export_sfc from '../_virtual/_plugin-vue_export-helper.js';
|
|
5
5
|
|
|
6
6
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sliding-panel.vue2.js","sources":["../../../src/components/sliding-panel.vue"],"sourcesContent":["<template>\n <div v-if=\"slots.default\" class=\"xds:sliding-panel\" :class=\"cssClasses\" data-test=\"sliding-panel\">\n <div\n ref=\"scrollContainerRef\"\n class=\"x-sliding-panel__scroll\"\n :class=\"[scrollContainerClass, { 'xds:sliding-panel-fade': fade }]\"\n data-test=\"sliding-panel-scroll\"\n >\n <!-- @slot (Required) Sliding panel content -->\n <slot />\n </div>\n <slot name=\"sliding-panel-addons\" :arrived-state=\"arrivedState\" :scroll=\"xScroll\" />\n <template v-if=\"showButtons\">\n <button\n class=\"xds:sliding-panel-button xds:sliding-panel-button-left\"\n :class=\"buttonClass\"\n data-test=\"sliding-panel-left-button\"\n @click=\"xScroll -= slotContainerWidth * scrollFactor\"\n >\n <!-- @slot Left button content -->\n <slot name=\"sliding-panel-left-button\">ᐸ</slot>\n </button>\n <button\n class=\"xds:sliding-panel-button xds:sliding-panel-button-right\"\n :class=\"buttonClass\"\n data-test=\"sliding-panel-right-button\"\n @click=\"xScroll += slotContainerWidth * scrollFactor\"\n >\n <!-- @slot Right button content -->\n <slot name=\"sliding-panel-right-button\">ᐳ</slot>\n </button>\n </template>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type { PropType } from 'vue'\nimport type { VueCSSClasses } from '../utils/types'\nimport {\n useElementBounding,\n useElementVisibility,\n useMutationObserver,\n useScroll,\n whenever,\n} from '@vueuse/core'\nimport { computed, defineComponent, ref } from 'vue'\n\n/**\n * This component allows for any other component or element inside it to be horizontally\n * navigable. It also implements customizable buttons as well as other minor customizations to its\n * general behavior.\n *\n * Additionally, this component exposes the following props to modify the classes of the\n * elements: `buttonClass`.\n *\n * @public\n */\nexport default defineComponent({\n name: 'SlidingPanel',\n props: {\n /**\n * Scroll factor that will dictate how much the scroll moves when pressing a navigation button.\n */\n scrollFactor: {\n type: Number,\n default: 0.7,\n },\n /** Would make the navigation buttons visible when they're needed or always hide them. */\n showButtons: {\n type: Boolean,\n default: true,\n },\n /**\n * When true, whenever the DOM content in the sliding panel slot changes, it will reset\n * the scroll position to 0.\n */\n resetOnContentChange: {\n type: Boolean,\n default: true,\n },\n /**\n * When true, applies the design-system edge fade mask to the scroll container.\n */\n fade: {\n type: Boolean,\n default: true,\n },\n buttonClass: { type: [String, Object, Array] as PropType<VueCSSClasses> },\n scrollContainerClass: { type: [String, Object, Array] as PropType<VueCSSClasses> },\n },\n setup(props, { slots }) {\n const scrollContainerRef = ref<HTMLDivElement>()\n\n const { width: slotContainerWidth } = useElementBounding(scrollContainerRef)\n const isVisible = useElementVisibility(scrollContainerRef)\n\n const {\n x: xScroll,\n arrivedState,\n measure,\n } = useScroll(scrollContainerRef, {\n behavior: 'smooth',\n })\n\n /** CSS classes to apply based on the scroll position. */\n const cssClasses = computed(() => ({\n 'xds:sliding-panel-at-start': arrivedState.left,\n 'xds:sliding-panel-at-end': arrivedState.right,\n }))\n\n if (props.resetOnContentChange) {\n useMutationObserver(\n scrollContainerRef,\n mutations => {\n if (mutations.length > 0) {\n xScroll.value = 0\n }\n },\n {\n subtree: true,\n childList: true,\n attributes: false,\n characterData: false,\n },\n )\n }\n //ensure positions are right calculated as soon as the sliding panel is shown\n whenever(isVisible as any, measure)\n\n return {\n arrivedState,\n cssClasses,\n scrollContainerRef,\n slotContainerWidth,\n xScroll,\n slots,\n }\n },\n})\n</script>\n\n<style lang=\"css\" scoped>\n.x-sliding-panel__scroll {\n display: flex;\n flex: 100%;\n flex-flow: row nowrap;\n overflow-x: auto;\n overflow-y: hidden;\n scrollbar-width: none; /* Firefox */\n -ms-overflow-style: none; /* IE */\n}\n\n/* Chrome, Edge & Safari */\n.x-sliding-panel__scroll::-webkit-scrollbar {\n display: none;\n}\n\n.x-sliding-panel__scroll > * {\n flex: 0 0 auto;\n}\n</style>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits no events.\n\n## See it in action\n\nSimplest implementation of the component, just a list-based component inside its slot.\n\n```vue\n<template>\n <SlidingPanel>\n <div class=\"item\">Item 1</div>\n <div class=\"item\">Item 2</div>\n <div class=\"item\">Item 3</div>\n <div class=\"item\">Item 4</div>\n </SlidingPanel>\n</template>\n\n<script>\nimport { SlidingPanel } from '@empathyco/x-components'\n\nexport default {\n name: 'SlidingPanelDemo',\n components: {\n SlidingPanel,\n },\n}\n</script>\n\n<style>\n.x-sliding-panel {\n width: 200px;\n}\n\n.item {\n display: inline-block;\n width: 100px;\n}\n</style>\n```\n\n### Play with props\n\n#### Modifying scroll buttons travel distance\n\nEdit how much the scroll travels when navigating with the buttons by changing the `scrollFactor`\nprop.\n\n```vue\n<template>\n <SlidingPanel :scrollFactor=\"1.5\">\n <div class=\"item\">Item 1</div>\n <div class=\"item\">Item 2</div>\n <div class=\"item\">Item 3</div>\n <div class=\"item\">Item 4</div>\n </SlidingPanel>\n</template>\n\n<script>\nimport { SlidingPanel } from '@empathyco/x-components'\n\nexport default {\n name: 'SlidingPanelDemo',\n components: {\n SlidingPanel,\n },\n}\n</script>\n\n<style>\n.x-sliding-panel {\n width: 200px;\n}\n\n.item {\n display: inline-block;\n width: 100px;\n}\n</style>\n```\n\n#### Hiding scroll buttons\n\nHide the navigational buttons completely by setting the `showButtons` prop to `false`. This is\nintended to be used when other scrolling options are available, like in mobile, where you can scroll\njust by swiping.\n\n```vue\n<template>\n <SlidingPanel :showButtons=\"false\">\n <div class=\"item\">Item 1</div>\n <div class=\"item\">Item 2</div>\n <div class=\"item\">Item 3</div>\n <div class=\"item\">Item 4</div>\n </SlidingPanel>\n</template>\n\n<script>\nimport { SlidingPanel } from '@empathyco/x-components'\n\nexport default {\n name: 'SlidingPanelDemo',\n components: {\n SlidingPanel,\n },\n}\n</script>\n\n<style>\n.x-sliding-panel {\n width: 200px;\n}\n\n.item {\n display: inline-block;\n width: 100px;\n}\n</style>\n```\n\n#### Customizing the content with classes\n\nThe `buttonClass` prop can be used to add classes to the buttons.\n\nThe `scrollContainerClass` prop can be used to add classes to the scroll content.\n\n```vue\n<template>\n <SlidingPanel buttonClass=\"x-button--round\" scrollContainerClass=\"x-sliding-panel-fade\">\n <div class=\"item\">Item 1</div>\n <div class=\"item\">Item 2</div>\n <div class=\"item\">Item 3</div>\n <div class=\"item\">Item 4</div>\n </SlidingPanel>\n</template>\n\n<script>\nimport { SlidingPanel } from '@empathyco/x-components'\n\nexport default {\n name: 'SlidingPanelDemo',\n components: {\n SlidingPanel,\n },\n}\n</script>\n\n<style>\n.x-sliding-panel {\n width: 200px;\n}\n\n.item {\n display: inline-block;\n width: 100px;\n}\n</style>\n```\n\n#### Disabling reset the scroll when content changes\n\nBy default, whenever the content of the sliding panel changes, it auto resets its scroll position.\nYou can disable this behavior setting the `resetOnContentChange` prop to `false`.\n\n```vue\n<template>\n <div>\n <button @click=\"items++\">Add item</button>\n <label>\n <input type=\"checkbox\" v-model=\"resetOnContentChange\" />\n Reset content onchange\n </label>\n <SlidingPanel :resetOnContentChange=\"resetOnContentChange\">\n <div class=\"item\" v-for=\"item in items\" :key=\"item\">Item {{ item }}</div>\n </SlidingPanel>\n </div>\n</template>\n\n<script>\nimport { SlidingPanel } from '@empathyco/x-components'\n\nexport default {\n name: 'SlidingPanelDemo',\n components: {\n SlidingPanel,\n },\n data() {\n return {\n items: 4,\n resetOnContentChange: false,\n }\n },\n}\n</script>\n\n<style>\n.x-sliding-panel {\n width: 200px;\n}\n\n.item {\n display: inline-block;\n width: 100px;\n}\n</style>\n```\n\n## Extending the component\n\n### Overriding Button content\n\nBy default the buttons show an arrow depicting the direction the scroll would go to when clicked,\nbut this content can be customized with anything, from characters to SVG and images.\n\n```vue\n<template>\n <SlidingPanel>\n <template #sliding-panel-left-button>Left</template>\n <template #default>\n <div class=\"item\">Item 1</div>\n <div class=\"item\">Item 2</div>\n <div class=\"item\">Item 3</div>\n <div class=\"item\">Item 4</div>\n </template>\n <template #sliding-panel-right-button>Right</template>\n </SlidingPanel>\n</template>\n\n<script>\nimport { SlidingPanel } from '@empathyco/x-components'\n\nexport default {\n name: 'SlidingPanelDemo',\n components: {\n SlidingPanel,\n },\n}\n</script>\n\n<style>\n.x-sliding-panel {\n width: 200px;\n}\n\n.item {\n display: inline-block;\n width: 100px;\n}\n</style>\n```\n</docs>\n"],"names":[],"mappings":";;;AA+CA;;;;;;;;;AASE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,cAAc;AACpB,IAAA,KAAK,EAAE;AACL;;AAEE;AACF,QAAA,YAAY,EAAE;AACZ,YAAA,IAAI,EAAE,MAAM;AACZ,YAAA,OAAO,EAAE,GAAG;AACb,SAAA;;AAED,QAAA,WAAW,EAAE;AACX,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,OAAO,EAAE,IAAI;AACd,SAAA;AACD;;;AAGE;AACF,QAAA,oBAAoB,EAAE;AACpB,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,OAAO,EAAE,IAAI;AACd,SAAA;AACD;;AAEE;AACF,QAAA,IAAI,EAAE;AACJ,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,OAAO,EAAE,IAAI;AACd,SAAA;QACD,WAAW,EAAE,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,GAA8B;QACzE,oBAAoB,EAAE,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,GAA8B;AACnF,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAE,EAAE,KAAI,EAAG,EAAA;AACpB,QAAA,MAAM,kBAAiB,GAAI,GAAG,EAAiB;QAE/C,MAAM,EAAE,KAAK,EAAE,kBAAiB,EAAE,GAAI,kBAAkB,CAAC,kBAAkB,CAAA;AAC3E,QAAA,MAAM,YAAY,oBAAoB,CAAC,kBAAkB,CAAA;AAEzD,QAAA,MAAM,EACJ,CAAC,EAAE,OAAO,EACV,YAAY,EACZ,OAAO,GACT,GAAI,SAAS,CAAC,kBAAkB,EAAE;AAChC,YAAA,QAAQ,EAAE,QAAQ;AACnB,SAAA,CAAA;;AAGD,QAAA,MAAM,UAAS,GAAI,QAAQ,CAAC,OAAO;YACjC,4BAA4B,EAAE,YAAY,CAAC,IAAI;YAC/C,0BAA0B,EAAE,YAAY,CAAC,KAAK;AAC/C,SAAA,CAAC,CAAA;AAEF,QAAA,IAAI,KAAK,CAAC,oBAAoB,EAAE;AAC9B,YAAA,mBAAmB,CACjB,kBAAkB,EAClB,SAAQ,IAAG;AACT,gBAAA,IAAI,SAAS,CAAC,MAAK,GAAI,CAAC,EAAE;AACxB,oBAAA,OAAO,CAAC,KAAI,GAAI,CAAA;gBAClB;AACF,YAAA,CAAC,EACD;AACE,gBAAA,OAAO,EAAE,IAAI;AACb,gBAAA,SAAS,EAAE,IAAI;AACf,gBAAA,UAAU,EAAE,KAAK;AACjB,gBAAA,aAAa,EAAE,KAAK;AACrB,aAAA,CACH;QACF;;AAEA,QAAA,QAAQ,CAAC,SAAgB,EAAE,OAAO,CAAA;QAElC,OAAO;YACL,YAAY;YACZ,UAAU;YACV,kBAAkB;YAClB,kBAAkB;YAClB,OAAO;YACP,KAAK;SACP;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"sliding-panel2.vue.js","sources":["../../../src/components/sliding-panel.vue"],"sourcesContent":["<template>\n <div v-if=\"slots.default\" class=\"xds:sliding-panel\" :class=\"cssClasses\" data-test=\"sliding-panel\">\n <div\n ref=\"scrollContainerRef\"\n class=\"x-sliding-panel__scroll\"\n :class=\"[scrollContainerClass, { 'xds:sliding-panel-fade': fade }]\"\n data-test=\"sliding-panel-scroll\"\n >\n <!-- @slot (Required) Sliding panel content -->\n <slot />\n </div>\n <slot name=\"sliding-panel-addons\" :arrived-state=\"arrivedState\" :scroll=\"xScroll\" />\n <template v-if=\"showButtons\">\n <button\n class=\"xds:sliding-panel-button xds:sliding-panel-button-left\"\n :class=\"buttonClass\"\n data-test=\"sliding-panel-left-button\"\n @click=\"xScroll -= slotContainerWidth * scrollFactor\"\n >\n <!-- @slot Left button content -->\n <slot name=\"sliding-panel-left-button\">ᐸ</slot>\n </button>\n <button\n class=\"xds:sliding-panel-button xds:sliding-panel-button-right\"\n :class=\"buttonClass\"\n data-test=\"sliding-panel-right-button\"\n @click=\"xScroll += slotContainerWidth * scrollFactor\"\n >\n <!-- @slot Right button content -->\n <slot name=\"sliding-panel-right-button\">ᐳ</slot>\n </button>\n </template>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type { PropType } from 'vue'\nimport type { VueCSSClasses } from '../utils/types'\nimport {\n useElementBounding,\n useElementVisibility,\n useMutationObserver,\n useScroll,\n whenever,\n} from '@vueuse/core'\nimport { computed, defineComponent, ref } from 'vue'\n\n/**\n * This component allows for any other component or element inside it to be horizontally\n * navigable. It also implements customizable buttons as well as other minor customizations to its\n * general behavior.\n *\n * Additionally, this component exposes the following props to modify the classes of the\n * elements: `buttonClass`.\n *\n * @public\n */\nexport default defineComponent({\n name: 'SlidingPanel',\n props: {\n /**\n * Scroll factor that will dictate how much the scroll moves when pressing a navigation button.\n */\n scrollFactor: {\n type: Number,\n default: 0.7,\n },\n /** Would make the navigation buttons visible when they're needed or always hide them. */\n showButtons: {\n type: Boolean,\n default: true,\n },\n /**\n * When true, whenever the DOM content in the sliding panel slot changes, it will reset\n * the scroll position to 0.\n */\n resetOnContentChange: {\n type: Boolean,\n default: true,\n },\n /**\n * When true, applies the design-system edge fade mask to the scroll container.\n */\n fade: {\n type: Boolean,\n default: true,\n },\n buttonClass: { type: [String, Object, Array] as PropType<VueCSSClasses> },\n scrollContainerClass: { type: [String, Object, Array] as PropType<VueCSSClasses> },\n },\n setup(props, { slots }) {\n const scrollContainerRef = ref<HTMLDivElement>()\n\n const { width: slotContainerWidth } = useElementBounding(scrollContainerRef)\n const isVisible = useElementVisibility(scrollContainerRef)\n\n const {\n x: xScroll,\n arrivedState,\n measure,\n } = useScroll(scrollContainerRef, {\n behavior: 'smooth',\n })\n\n /** CSS classes to apply based on the scroll position. */\n const cssClasses = computed(() => ({\n 'xds:sliding-panel-at-start': arrivedState.left,\n 'xds:sliding-panel-at-end': arrivedState.right,\n }))\n\n if (props.resetOnContentChange) {\n useMutationObserver(\n scrollContainerRef,\n mutations => {\n if (mutations.length > 0) {\n xScroll.value = 0\n }\n },\n {\n subtree: true,\n childList: true,\n attributes: false,\n characterData: false,\n },\n )\n }\n //ensure positions are right calculated as soon as the sliding panel is shown\n whenever(isVisible as any, measure)\n\n return {\n arrivedState,\n cssClasses,\n scrollContainerRef,\n slotContainerWidth,\n xScroll,\n slots,\n }\n },\n})\n</script>\n\n<style lang=\"css\" scoped>\n.x-sliding-panel__scroll {\n display: flex;\n flex: 100%;\n flex-flow: row nowrap;\n overflow-x: auto;\n overflow-y: hidden;\n scrollbar-width: none; /* Firefox */\n -ms-overflow-style: none; /* IE */\n}\n\n/* Chrome, Edge & Safari */\n.x-sliding-panel__scroll::-webkit-scrollbar {\n display: none;\n}\n\n.x-sliding-panel__scroll > * {\n flex: 0 0 auto;\n}\n</style>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits no events.\n\n## See it in action\n\nSimplest implementation of the component, just a list-based component inside its slot.\n\n```vue\n<template>\n <SlidingPanel>\n <div class=\"item\">Item 1</div>\n <div class=\"item\">Item 2</div>\n <div class=\"item\">Item 3</div>\n <div class=\"item\">Item 4</div>\n </SlidingPanel>\n</template>\n\n<script>\nimport { SlidingPanel } from '@empathyco/x-components'\n\nexport default {\n name: 'SlidingPanelDemo',\n components: {\n SlidingPanel,\n },\n}\n</script>\n\n<style>\n.x-sliding-panel {\n width: 200px;\n}\n\n.item {\n display: inline-block;\n width: 100px;\n}\n</style>\n```\n\n### Play with props\n\n#### Modifying scroll buttons travel distance\n\nEdit how much the scroll travels when navigating with the buttons by changing the `scrollFactor`\nprop.\n\n```vue\n<template>\n <SlidingPanel :scrollFactor=\"1.5\">\n <div class=\"item\">Item 1</div>\n <div class=\"item\">Item 2</div>\n <div class=\"item\">Item 3</div>\n <div class=\"item\">Item 4</div>\n </SlidingPanel>\n</template>\n\n<script>\nimport { SlidingPanel } from '@empathyco/x-components'\n\nexport default {\n name: 'SlidingPanelDemo',\n components: {\n SlidingPanel,\n },\n}\n</script>\n\n<style>\n.x-sliding-panel {\n width: 200px;\n}\n\n.item {\n display: inline-block;\n width: 100px;\n}\n</style>\n```\n\n#### Hiding scroll buttons\n\nHide the navigational buttons completely by setting the `showButtons` prop to `false`. This is\nintended to be used when other scrolling options are available, like in mobile, where you can scroll\njust by swiping.\n\n```vue\n<template>\n <SlidingPanel :showButtons=\"false\">\n <div class=\"item\">Item 1</div>\n <div class=\"item\">Item 2</div>\n <div class=\"item\">Item 3</div>\n <div class=\"item\">Item 4</div>\n </SlidingPanel>\n</template>\n\n<script>\nimport { SlidingPanel } from '@empathyco/x-components'\n\nexport default {\n name: 'SlidingPanelDemo',\n components: {\n SlidingPanel,\n },\n}\n</script>\n\n<style>\n.x-sliding-panel {\n width: 200px;\n}\n\n.item {\n display: inline-block;\n width: 100px;\n}\n</style>\n```\n\n#### Customizing the content with classes\n\nThe `buttonClass` prop can be used to add classes to the buttons.\n\nThe `scrollContainerClass` prop can be used to add classes to the scroll content.\n\n```vue\n<template>\n <SlidingPanel buttonClass=\"x-button--round\" scrollContainerClass=\"x-sliding-panel-fade\">\n <div class=\"item\">Item 1</div>\n <div class=\"item\">Item 2</div>\n <div class=\"item\">Item 3</div>\n <div class=\"item\">Item 4</div>\n </SlidingPanel>\n</template>\n\n<script>\nimport { SlidingPanel } from '@empathyco/x-components'\n\nexport default {\n name: 'SlidingPanelDemo',\n components: {\n SlidingPanel,\n },\n}\n</script>\n\n<style>\n.x-sliding-panel {\n width: 200px;\n}\n\n.item {\n display: inline-block;\n width: 100px;\n}\n</style>\n```\n\n#### Disabling reset the scroll when content changes\n\nBy default, whenever the content of the sliding panel changes, it auto resets its scroll position.\nYou can disable this behavior setting the `resetOnContentChange` prop to `false`.\n\n```vue\n<template>\n <div>\n <button @click=\"items++\">Add item</button>\n <label>\n <input type=\"checkbox\" v-model=\"resetOnContentChange\" />\n Reset content onchange\n </label>\n <SlidingPanel :resetOnContentChange=\"resetOnContentChange\">\n <div class=\"item\" v-for=\"item in items\" :key=\"item\">Item {{ item }}</div>\n </SlidingPanel>\n </div>\n</template>\n\n<script>\nimport { SlidingPanel } from '@empathyco/x-components'\n\nexport default {\n name: 'SlidingPanelDemo',\n components: {\n SlidingPanel,\n },\n data() {\n return {\n items: 4,\n resetOnContentChange: false,\n }\n },\n}\n</script>\n\n<style>\n.x-sliding-panel {\n width: 200px;\n}\n\n.item {\n display: inline-block;\n width: 100px;\n}\n</style>\n```\n\n## Extending the component\n\n### Overriding Button content\n\nBy default the buttons show an arrow depicting the direction the scroll would go to when clicked,\nbut this content can be customized with anything, from characters to SVG and images.\n\n```vue\n<template>\n <SlidingPanel>\n <template #sliding-panel-left-button>Left</template>\n <template #default>\n <div class=\"item\">Item 1</div>\n <div class=\"item\">Item 2</div>\n <div class=\"item\">Item 3</div>\n <div class=\"item\">Item 4</div>\n </template>\n <template #sliding-panel-right-button>Right</template>\n </SlidingPanel>\n</template>\n\n<script>\nimport { SlidingPanel } from '@empathyco/x-components'\n\nexport default {\n name: 'SlidingPanelDemo',\n components: {\n SlidingPanel,\n },\n}\n</script>\n\n<style>\n.x-sliding-panel {\n width: 200px;\n}\n\n.item {\n display: inline-block;\n width: 100px;\n}\n</style>\n```\n</docs>\n"],"names":[],"mappings":";;;AA+CA;;;;;;;;;AASE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,cAAc;AACpB,IAAA,KAAK,EAAE;AACL;;AAEE;AACF,QAAA,YAAY,EAAE;AACZ,YAAA,IAAI,EAAE,MAAM;AACZ,YAAA,OAAO,EAAE,GAAG;AACb,SAAA;;AAED,QAAA,WAAW,EAAE;AACX,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,OAAO,EAAE,IAAI;AACd,SAAA;AACD;;;AAGE;AACF,QAAA,oBAAoB,EAAE;AACpB,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,OAAO,EAAE,IAAI;AACd,SAAA;AACD;;AAEE;AACF,QAAA,IAAI,EAAE;AACJ,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,OAAO,EAAE,IAAI;AACd,SAAA;QACD,WAAW,EAAE,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,GAA8B;QACzE,oBAAoB,EAAE,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,GAA8B;AACnF,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAE,EAAE,KAAI,EAAG,EAAA;AACpB,QAAA,MAAM,kBAAiB,GAAI,GAAG,EAAiB;QAE/C,MAAM,EAAE,KAAK,EAAE,kBAAiB,EAAE,GAAI,kBAAkB,CAAC,kBAAkB,CAAA;AAC3E,QAAA,MAAM,YAAY,oBAAoB,CAAC,kBAAkB,CAAA;AAEzD,QAAA,MAAM,EACJ,CAAC,EAAE,OAAO,EACV,YAAY,EACZ,OAAO,GACT,GAAI,SAAS,CAAC,kBAAkB,EAAE;AAChC,YAAA,QAAQ,EAAE,QAAQ;AACnB,SAAA,CAAA;;AAGD,QAAA,MAAM,UAAS,GAAI,QAAQ,CAAC,OAAO;YACjC,4BAA4B,EAAE,YAAY,CAAC,IAAI;YAC/C,0BAA0B,EAAE,YAAY,CAAC,KAAK;AAC/C,SAAA,CAAC,CAAA;AAEF,QAAA,IAAI,KAAK,CAAC,oBAAoB,EAAE;AAC9B,YAAA,mBAAmB,CACjB,kBAAkB,EAClB,SAAQ,IAAG;AACT,gBAAA,IAAI,SAAS,CAAC,MAAK,GAAI,CAAC,EAAE;AACxB,oBAAA,OAAO,CAAC,KAAI,GAAI,CAAA;gBAClB;AACF,YAAA,CAAC,EACD;AACE,gBAAA,OAAO,EAAE,IAAI;AACb,gBAAA,SAAS,EAAE,IAAI;AACf,gBAAA,UAAU,EAAE,KAAK;AACjB,gBAAA,aAAa,EAAE,KAAK;AACrB,aAAA,CACH;QACF;;AAEA,QAAA,QAAQ,CAAC,SAAgB,EAAE,OAAO,CAAA;QAElC,OAAO;YACL,YAAY;YACZ,UAAU;YACV,kBAAkB;YAClB,kBAAkB;YAClB,OAAO;YACP,KAAK;SACP;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sliding-panel3.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snippet-
|
|
1
|
+
{"version":3,"file":"snippet-callbacks2.vue.js","sources":["../../../src/components/snippet-callbacks.vue"],"sourcesContent":["<template>\n <GlobalXBus :listeners=\"eventListeners\" />\n</template>\n\n<script lang=\"ts\">\nimport type { WireMetadata } from '../wiring'\nimport type { SnippetConfig, XEventListeners } from '../x-installer/api/api.types'\nimport { map } from '@empathyco/x-utils'\nimport { computed, defineComponent, inject } from 'vue'\nimport { useXBus } from '../composables/use-x-bus'\nimport GlobalXBus from './global-x-bus.vue'\n\n/**\n * This component subscribes to any {@link XEvent} with a custom callbacks provided by the snippet\n * configuration.\n *\n * @public\n */\nexport default defineComponent({\n name: 'SnippetCallbacks',\n components: { GlobalXBus },\n setup() {\n const xBus = useXBus()\n\n /**\n * Injects {@link SnippetConfig} provided by an ancestor as snippetConfig.\n *\n * @internal\n */\n const snippetConfig = inject<SnippetConfig>('snippetConfig')\n\n /**\n * It maps all the callbacks provided by the snippetConfig and adds an emit to each one.\n *\n * @returns The event listeners with the {@link XEventsTypes.SnippetCallbackExecuted} emit in\n * the callback.\n *\n * @internal\n *\n */\n const eventListeners = computed<XEventListeners>(() => {\n const callbacks = snippetConfig?.callbacks\n\n return callbacks\n ? map(callbacks, (eventName, callback) => {\n return (payload: unknown, metadata: WireMetadata) => {\n const callbackReturn = callback(payload as never, metadata)\n xBus.emit('SnippetCallbackExecuted', {\n event: eventName,\n callbackReturn,\n payload: payload as never,\n metadata,\n })\n }\n })\n : ({} as XEventListeners)\n })\n\n return { eventListeners }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThe `SnippetCallbacks` will emit these events:\n\n- [`SnippetCallbackExecuted`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n each time a callback provided by the snippetConfig is fired.\n\n## See it in action\n\nThis component does not render anything. Its only responsibility is to receive any callback that\nwill be triggered once its listened event is emitted.\n\n```vue\n<template>\n <SnippetCallbacks />\n</template>\n\n<script>\nimport { SnippetCallbacks } from '@empathyco/x-components'\nexport default {\n name: 'SnippetCallbacksTest',\n components: {\n SnippetCallbacks,\n },\n}\n</script>\n```\n</docs>\n"],"names":["GlobalXBus"],"mappings":";;;;;AAYA;;;;;AAKE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,kBAAkB;IACxB,UAAU,EAAE,cAAEA,WAAS,EAAG;IAC1B,KAAK,GAAA;AACH,QAAA,MAAM,IAAG,GAAI,OAAO,EAAC;AAErB;;;;AAIE;AACF,QAAA,MAAM,aAAY,GAAI,MAAM,CAAgB,eAAe,CAAA;AAE3D;;;;;;;;AAQE;AACF,QAAA,MAAM,iBAAiB,QAAQ,CAAkB,MAAI;AACnD,YAAA,MAAM,SAAQ,GAAI,aAAa,EAAE,SAAQ;AAEzC,YAAA,OAAO;kBACH,GAAG,CAAC,SAAS,EAAE,CAAC,SAAS,EAAE,QAAQ,KAAG;AACpC,oBAAA,OAAO,CAAC,OAAgB,EAAE,QAAsB,KAAG;wBACjD,MAAM,cAAa,GAAI,QAAQ,CAAC,OAAgB,EAAE,QAAQ,CAAA;AAC1D,wBAAA,IAAI,CAAC,IAAI,CAAC,yBAAyB,EAAE;AACnC,4BAAA,KAAK,EAAE,SAAS;4BAChB,cAAc;AACd,4BAAA,OAAO,EAAE,OAAgB;4BACzB,QAAQ;AACT,yBAAA,CAAA;AACH,oBAAA,CAAA;AACF,gBAAA,CAAC;kBACA,EAAqB;AAC5B,QAAA,CAAC,CAAA;QAED,OAAO,EAAE,cAAa,EAAE;IAC1B,CAAC;AACF,CAAA,CAAA;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _sfc_main from './base-
|
|
1
|
+
import _sfc_main from './base-suggestion2.vue.js';
|
|
2
2
|
import { resolveComponent, openBlock, createElementBlock, normalizeClass, renderSlot, normalizeProps, guardReactiveProps, createVNode, toDisplayString, createCommentVNode } from 'vue';
|
|
3
3
|
import _export_sfc from '../../_virtual/_plugin-vue_export-helper.js';
|
|
4
4
|
|