UNPKG

@empathyco/x-components

Version:
176 lines (173 loc) • 8.37 kB
import { defineComponent, computed } from 'vue'; import '../../../components/animations/animate-clip-path/animate-clip-path.style.scss.js'; import '../../../components/animations/animate-scale/animate-scale.style.scss.js'; import '../../../components/animations/animate-translate/animate-translate.style.scss.js'; import '../../../components/animations/animate-width.vue2.js'; import '../../../components/animations/animate-width.vue3.js'; import '../../../components/animations/change-height.vue2.js'; import '../../../components/animations/collapse-height.vue2.js'; import '../../../components/animations/collapse-height.vue3.js'; import '../../../components/animations/collapse-width.vue2.js'; import '../../../components/animations/collapse-width.vue3.js'; import '../../../components/animations/cross-fade.vue2.js'; import '../../../components/animations/cross-fade.vue3.js'; import '../../../components/animations/fade-and-slide.vue2.js'; import '../../../components/animations/fade-and-slide.vue3.js'; import '../../../components/animations/fade.vue2.js'; import '../../../components/animations/fade.vue3.js'; import '../../../components/animations/no-animation.vue.js'; import '../../../components/animations/staggered-fade-and-slide.vue2.js'; import '../../../components/animations/staggered-fade-and-slide.vue3.js'; import '../../../components/auto-progress-bar.vue2.js'; import '../../../components/auto-progress-bar.vue3.js'; import '../../../components/base-dropdown.vue2.js'; import '../../../components/base-dropdown.vue3.js'; import BaseEventButton from '../../../components/base-event-button.vue.js'; import '../../../components/base-grid.vue2.js'; import '../../../components/base-grid.vue3.js'; import '../../../components/base-keyboard-navigation.vue2.js'; import '../../../components/base-rating.vue2.js'; import '../../../components/base-rating.vue3.js'; import '../../../components/base-slider.vue2.js'; import '../../../components/base-slider.vue3.js'; import '../../../components/base-switch.vue2.js'; import '../../../components/base-switch.vue3.js'; import '../../../components/base-teleport.vue2.js'; import '../../../components/base-variable-column-grid.vue2.js'; import '../../../components/column-picker/base-column-picker-dropdown.vue2.js'; import '../../../components/column-picker/base-column-picker-list.vue2.js'; import '../../../components/currency/base-currency.vue2.js'; import '../../../components/display-click-provider.vue.js'; import '../../../components/display-emitter.vue.js'; import '../../../components/filters/labels/base-price-filter-label.vue.js'; import '../../../components/filters/labels/base-rating-filter-label.vue2.js'; import '../../../components/global-x-bus.vue.js'; import '../../../components/highlight.vue2.js'; import '../../../components/items-list.vue2.js'; import '../../../components/layouts/fixed-header-and-asides-layout.vue2.js'; import '../../../components/layouts/fixed-header-and-asides-layout.vue3.js'; import '../../../components/layouts/multi-column-max-width-layout.vue2.js'; import '../../../components/layouts/multi-column-max-width-layout.vue3.js'; import '../../../components/layouts/multi-column-max-width-layout.vue4.js'; import '../../../components/layouts/single-column-layout.vue2.js'; import '../../../components/layouts/single-column-layout.vue3.js'; import '../../../components/location-provider.vue.js'; import '../../../components/modals/base-events-modal-close.vue2.js'; import '../../../components/modals/base-events-modal-open.vue2.js'; import '../../../components/modals/base-events-modal.vue2.js'; import '../../../components/modals/base-id-modal-close.vue2.js'; import '../../../components/modals/base-id-modal-open.vue2.js'; import '../../../components/modals/base-id-modal.vue2.js'; import '../../../components/modals/base-modal.vue2.js'; import '../../../components/modals/base-modal.vue3.js'; import '../../../components/modals/close-main-modal.vue2.js'; import '../../../components/modals/main-modal.vue2.js'; import '../../../components/modals/open-main-modal.vue2.js'; import '../../../components/page-loader-button.vue2.js'; import '../../../components/page-loader-button.vue3.js'; import '../../../components/page-selector.vue2.js'; import '../../../components/page-selector.vue3.js'; import '../../../components/panels/base-header-toggle-panel.vue2.js'; import '../../../components/panels/base-header-toggle-panel.vue3.js'; import '../../../components/panels/base-id-toggle-panel-button.vue2.js'; import '../../../components/panels/base-id-toggle-panel.vue2.js'; import '../../../components/panels/base-tabs-panel.vue2.js'; import '../../../components/panels/base-tabs-panel.vue3.js'; import '../../../components/panels/base-toggle-panel.vue2.js'; import '../../../components/result/base-result-add-to-cart.vue2.js'; import '../../../components/result/base-result-current-price.vue2.js'; import '../../../components/result/base-result-image.vue2.js'; import '../../../components/result/base-result-image.vue3.js'; import '../../../components/result/base-result-link.vue2.js'; import '../../../components/result/base-result-link.vue3.js'; import '../../../components/result/base-result-previous-price.vue2.js'; import '../../../components/result/base-result-rating.vue2.js'; import '../../../components/result/base-result-rating.vue3.js'; import '../../../components/result/result-variant-selector.vue2.js'; import '../../../components/result/result-variant-selector.vue3.js'; import '../../../components/result/result-variants-provider.vue.js'; import '../../../components/scroll/base-scroll.vue2.js'; import '@empathyco/x-utils'; import 'vuex'; import '@vue/devtools-api'; import '../../../plugins/devtools/timeline.devtools.js'; import 'rxjs/operators'; import 'rxjs'; import '../../../plugins/devtools/colors.utils.js'; import '../../../plugins/x-bus.js'; import '../../../plugins/x-plugin.js'; import '../../../components/sliding-panel.vue2.js'; import '../../../components/sliding-panel.vue3.js'; import '../../../components/snippet-callbacks.vue2.js'; import '../../../components/suggestions/base-suggestion.vue2.js'; import '../../../components/suggestions/base-suggestions.vue2.js'; import '../../../components/suggestions/base-suggestions.vue3.js'; import { useState } from '../../../composables/use-state.js'; import { queriesPreviewXModule } from '../x-module.js'; /** * Component containing an event button that emits * {@link QueriesPreviewXEvents.UserAcceptedAQueryPreview} when clicked with * the full query preview info as payload. * * It has a default slot to customize its contents. * * @public */ var _sfc_main = defineComponent({ name: 'QueryPreviewButton', xModule: queriesPreviewXModule.name, components: { BaseEventButton }, props: { /** * The information about the request of the query preview. * * @public */ queryPreviewInfo: { type: Object, required: true, }, /** * The metadata property for the request on each query preview. * * @public */ metadata: { type: Object, }, }, setup(props) { /** * We use the module extra params to combine them with the query preview's extra params. */ const { params } = useState('queriesPreview'); /** * The provided query preview with the base extra params from the module merged in. * * @returns The query preview info with the base extra params merged in. * @public */ const fullQueryPreviewInfo = computed(() => ({ ...props.queryPreviewInfo, extraParams: { ...params.value, ...props.queryPreviewInfo.extraParams, }, filters: props.queryPreviewInfo.filters, })); /** * List of events to emit by the BaseEventButton. * * @returns An object with the event and payload. * * @internal */ const events = computed(() => ({ UserAcceptedAQueryPreview: fullQueryPreviewInfo.value })); return { fullQueryPreviewInfo, events, }; }, }); export { _sfc_main as default }; //# sourceMappingURL=query-preview-button.vue2.js.map