2021-08-11 06:04:47 +00:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<div class="input-group-wrap">
|
2021-10-11 07:30:48 +00:00
|
|
|
<div class="input-group small" :class="{ error: $v.ccEmailsVal.$error }">
|
2021-08-11 06:04:47 +00:00
|
|
|
<label class="input-group-label">
|
|
|
|
{{ $t('CONVERSATION.REPLYBOX.EMAIL_HEAD.CC.LABEL') }}
|
|
|
|
</label>
|
|
|
|
<div class="input-group-field">
|
|
|
|
<woot-input
|
2021-10-11 07:30:48 +00:00
|
|
|
v-model.trim="$v.ccEmailsVal.$model"
|
2022-03-25 05:57:45 +00:00
|
|
|
type="text"
|
2021-10-11 07:30:48 +00:00
|
|
|
:class="{ error: $v.ccEmailsVal.$error }"
|
2021-08-11 06:04:47 +00:00
|
|
|
:placeholder="$t('CONVERSATION.REPLYBOX.EMAIL_HEAD.CC.PLACEHOLDER')"
|
2021-10-11 07:30:48 +00:00
|
|
|
@blur="onBlur"
|
2021-08-11 06:04:47 +00:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<woot-button
|
|
|
|
v-if="!showBcc"
|
|
|
|
variant="clear"
|
|
|
|
size="small"
|
|
|
|
@click="handleAddBcc"
|
|
|
|
>
|
|
|
|
{{ $t('CONVERSATION.REPLYBOX.EMAIL_HEAD.ADD_BCC') }}
|
|
|
|
</woot-button>
|
|
|
|
</div>
|
2021-10-11 07:30:48 +00:00
|
|
|
<span v-if="$v.ccEmailsVal.$error" class="message">
|
2021-08-11 06:04:47 +00:00
|
|
|
{{ $t('CONVERSATION.REPLYBOX.EMAIL_HEAD.CC.ERROR') }}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<div v-if="showBcc" class="input-group-wrap">
|
2021-10-11 07:30:48 +00:00
|
|
|
<div class="input-group small" :class="{ error: $v.bccEmailsVal.$error }">
|
2021-08-11 06:04:47 +00:00
|
|
|
<label class="input-group-label">
|
|
|
|
{{ $t('CONVERSATION.REPLYBOX.EMAIL_HEAD.BCC.LABEL') }}
|
|
|
|
</label>
|
|
|
|
<div class="input-group-field">
|
|
|
|
<woot-input
|
2021-10-11 07:30:48 +00:00
|
|
|
v-model.trim="$v.bccEmailsVal.$model"
|
2022-03-25 05:57:45 +00:00
|
|
|
type="text"
|
2021-10-11 07:30:48 +00:00
|
|
|
:class="{ error: $v.bccEmailsVal.$error }"
|
2021-08-11 06:04:47 +00:00
|
|
|
:placeholder="
|
|
|
|
$t('CONVERSATION.REPLYBOX.EMAIL_HEAD.BCC.PLACEHOLDER')
|
|
|
|
"
|
2021-10-11 07:30:48 +00:00
|
|
|
@blur="onBlur"
|
2021-08-11 06:04:47 +00:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-10-11 07:30:48 +00:00
|
|
|
<span v-if="$v.bccEmailsVal.$error" class="message">
|
2021-08-11 06:04:47 +00:00
|
|
|
{{ $t('CONVERSATION.REPLYBOX.EMAIL_HEAD.BCC.ERROR') }}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { validEmailsByComma } from './helpers/emailHeadHelper';
|
|
|
|
export default {
|
|
|
|
props: {
|
2021-12-07 18:14:32 +00:00
|
|
|
ccEmails: {
|
|
|
|
type: String,
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
bccEmails: {
|
|
|
|
type: String,
|
|
|
|
default: '',
|
2021-08-11 06:04:47 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
showBcc: false,
|
2021-10-11 07:30:48 +00:00
|
|
|
ccEmailsVal: '',
|
|
|
|
bccEmailsVal: '',
|
2021-08-11 06:04:47 +00:00
|
|
|
};
|
|
|
|
},
|
2021-12-07 18:14:32 +00:00
|
|
|
watch: {
|
|
|
|
bccEmails(newVal) {
|
|
|
|
if (newVal !== this.bccEmailsVal) {
|
|
|
|
this.bccEmailsVal = newVal;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
ccEmails(newVal) {
|
|
|
|
if (newVal !== this.ccEmailsVal) {
|
|
|
|
this.ccEmailsVal = newVal;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
2022-02-28 16:12:50 +00:00
|
|
|
mounted() {
|
|
|
|
this.ccEmailsVal = this.ccEmails;
|
|
|
|
this.bccEmailsVal = this.bccEmails;
|
|
|
|
},
|
2021-08-11 06:04:47 +00:00
|
|
|
validations: {
|
2021-10-11 07:30:48 +00:00
|
|
|
ccEmailsVal: {
|
2021-08-11 06:04:47 +00:00
|
|
|
hasValidEmails(value) {
|
|
|
|
return validEmailsByComma(value);
|
|
|
|
},
|
|
|
|
},
|
2021-10-11 07:30:48 +00:00
|
|
|
bccEmailsVal: {
|
2021-08-11 06:04:47 +00:00
|
|
|
hasValidEmails(value) {
|
|
|
|
return validEmailsByComma(value);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
handleAddBcc() {
|
|
|
|
this.showBcc = true;
|
|
|
|
},
|
2021-10-11 07:30:48 +00:00
|
|
|
onBlur() {
|
|
|
|
this.$v.$touch();
|
2021-12-07 18:14:32 +00:00
|
|
|
this.$emit('update:bccEmails', this.bccEmailsVal);
|
|
|
|
this.$emit('update:ccEmails', this.ccEmailsVal);
|
2021-10-11 07:30:48 +00:00
|
|
|
},
|
2021-08-11 06:04:47 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.input-group-wrap .message {
|
|
|
|
font-size: var(--font-size-small);
|
|
|
|
color: var(--r-500);
|
|
|
|
}
|
|
|
|
.input-group {
|
|
|
|
border-bottom: 1px solid var(--color-border);
|
|
|
|
margin-bottom: var(--space-smaller);
|
|
|
|
margin-top: var(--space-smaller);
|
|
|
|
|
|
|
|
.input-group-label {
|
|
|
|
border-color: transparent;
|
|
|
|
background: transparent;
|
|
|
|
font-size: var(--font-size-mini);
|
|
|
|
font-weight: var(--font-weight-bold);
|
|
|
|
}
|
|
|
|
.input-group-field::v-deep input {
|
|
|
|
margin-bottom: 0;
|
|
|
|
border-color: transparent;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.input-group.error {
|
|
|
|
border-bottom-color: var(--r-500);
|
|
|
|
.input-group-label {
|
|
|
|
color: var(--r-500);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|