2020-03-16 06:38:40 +00:00
|
|
|
<template>
|
|
|
|
<div class="options-message chat-bubble agent">
|
|
|
|
<div class="card-body">
|
|
|
|
<h4 class="title">
|
|
|
|
{{ title }}
|
|
|
|
</h4>
|
2020-04-10 11:12:37 +00:00
|
|
|
<ul
|
|
|
|
v-if="!hideFields"
|
|
|
|
class="options"
|
|
|
|
:class="{ 'has-selected': !!selected }"
|
|
|
|
>
|
2020-03-16 06:38:40 +00:00
|
|
|
<chat-option
|
|
|
|
v-for="option in options"
|
|
|
|
:key="option.id"
|
|
|
|
:action="option"
|
|
|
|
:is-selected="isSelected(option)"
|
2020-04-10 11:12:37 +00:00
|
|
|
@click="onClick"
|
2020-03-16 06:38:40 +00:00
|
|
|
/>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import ChatOption from 'shared/components/ChatOption';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
ChatOption,
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
title: {
|
|
|
|
type: String,
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
options: {
|
|
|
|
type: Array,
|
|
|
|
default: () => [],
|
|
|
|
},
|
|
|
|
selected: {
|
|
|
|
type: String,
|
|
|
|
default: '',
|
|
|
|
},
|
2020-04-10 11:12:37 +00:00
|
|
|
hideFields: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
2020-03-16 06:38:40 +00:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
isSelected(option) {
|
|
|
|
return this.selected === option.id;
|
|
|
|
},
|
2020-04-10 11:12:37 +00:00
|
|
|
onClick(selectedOption) {
|
|
|
|
this.$emit('click', selectedOption);
|
|
|
|
},
|
2020-03-16 06:38:40 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
@import '~dashboard/assets/scss/variables.scss';
|
|
|
|
.has-selected {
|
|
|
|
.option-button:not(.is-selected) {
|
|
|
|
color: $color-light-gray;
|
|
|
|
cursor: initial;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
<style scoped lang="scss">
|
|
|
|
@import '~dashboard/assets/scss/variables.scss';
|
|
|
|
@import '~dashboard/assets/scss/mixins.scss';
|
|
|
|
|
|
|
|
.options-message {
|
|
|
|
background: white;
|
|
|
|
width: 60%;
|
|
|
|
max-width: 17rem;
|
|
|
|
padding: $space-small $space-normal;
|
|
|
|
border-radius: $space-small;
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
|
|
.title {
|
|
|
|
font-size: $font-size-small;
|
|
|
|
font-weight: $font-weight-normal;
|
|
|
|
margin-top: $space-smaller;
|
|
|
|
margin-bottom: $space-smaller;
|
|
|
|
color: $color-heading;
|
|
|
|
line-height: 1.5;
|
|
|
|
}
|
|
|
|
|
|
|
|
.options {
|
|
|
|
width: 100%;
|
|
|
|
|
|
|
|
> li {
|
|
|
|
list-style: none;
|
|
|
|
padding: 0;
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|