UNPKG

@empathyco/x-components

Version:
67 lines (64 loc) 1.74 kB
import { defineComponent, ref } from 'vue'; import BaseRating from '../base-rating.vue.js'; import '../../composables/create-use-device.js'; import { use$x } from '../../composables/use-_x.js'; import '@vue/devtools-api'; import '../../plugins/devtools/timeline.devtools.js'; import '@empathyco/x-utils'; import 'rxjs/operators'; import 'rxjs'; import '../../plugins/devtools/colors.utils.js'; import '../../plugins/x-bus.js'; import '../../plugins/x-plugin.js'; import 'vuex'; import '@vueuse/core'; /** * This component renders a {@link BaseRating} for a result passed as prop. * * @public */ var _sfc_main = defineComponent({ components: { BaseRating }, inheritAttrs: false, props: { /** * The {@link @empathyco/x-types#Result} to render its rating. * * @public */ result: { type: Object, required: true }, /** * A link to redirect when rating is clicked. * * @public */ link: { type: String } }, setup(props) { const $x = use$x(); /** * Emits the `UserClickedAResultRating` event when user clicks this component, with the * {@link @empathyco/x-types#Result} as payload. * * @internal */ const emitClickedEvent = () => { const el = ref(null); $x.emit('UserClickedAResultRating', props.result, { target: el.value }); }; return { emitClickedEvent }; } }); export { _sfc_main as default }; //# sourceMappingURL=base-result-rating.vue2.js.map