UNPKG

@empathyco/x-components

Version:
41 lines (38 loc) 1.38 kB
import { defineComponent } from 'vue'; import BaseSuggestion from '../../../components/suggestions/base-suggestion.vue.js'; import { useGetter } from '../../../composables/use-getter.js'; import { semanticQueriesXModule } from '../x-module.js'; /** * This component renders a semantic query. A semantic query is a recommended query * that is similar in its meaning to another one. * It contains the query and the distance, which indicates how similar the query is * compared to the searched query. * * @public */ var _sfc_main = defineComponent({ name: 'SemanticQuery', xModule: semanticQueriesXModule.name, components: { BaseSuggestion }, props: { /** The {@link @empathyco/x-types#SemanticQuery} to render. */ suggestion: { type: Object, required: true, }, }, setup(props) { /** The normalized query of the semantic queries' module. */ const query = useGetter('semanticQueries').normalizedQuery; /** The list of events that are going to be emitted when the button is pressed. */ const suggestionSelectedEvents = { UserSelectedASemanticQuery: props.suggestion, }; return { query, suggestionSelectedEvents, }; }, }); export { _sfc_main as default }; //# sourceMappingURL=semantic-query.vue2.js.map