UNPKG

@empathyco/x-components

Version:
68 lines (65 loc) 1.71 kB
import { defineComponent, ref } from 'vue'; import '../../composables/create-use-device.js'; import { use$x } from '../../composables/use-_x.js'; import 'vuex'; 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 '@vueuse/core'; import BaseRating from '../base-rating.vue.js'; /** * 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(); const el = ref(); /** * Emits the `UserClickedAResultRating` event when user clicks this component, with the * {@link @empathyco/x-types#Result} as payload. * * @internal */ const emitClickedEvent = () => { $x.emit('UserClickedAResultRating', props.result, { target: el.value, }); }; return { el, emitClickedEvent, }; }, }); export { _sfc_main as default }; //# sourceMappingURL=base-result-rating.vue2.js.map