<!-- --------------------------------------------------------------------
                            Add Event Modal
-------------------------------------------------------------------- -->
<template>
    <v-dialog v-model="$store.state.EventAdd" width="60%" transition="slide-x-transition">
        <v-card class="RTL">
            <v-card-title class=" grey lighten-3" primary-title>
                <WM-PartTitle class="WM-Margin-T-20" TitleFa=" افزودن رویداد " TitleEn=" Add an Event " Color="cyan"></WM-PartTitle>
            </v-card-title>

            <v-card-text>
                <v-layout row wrap class="WM-Section" style="border-right-color: #00838F;">
                    <v-flex lg3>
                        <v-card-text>
                            <v-autocomplete prepend-icon="fas fa-align-right" :items="eventTypes" color="cyan" item-text="name" label=" نوع رویداد "></v-autocomplete>
                        </v-card-text>
                    </v-flex>
                    <v-flex xs12 sm4 md3>
                        <v-card-text>
                            <v-menu :close-on-content-click="false" v-model="eventDateBegin" :nudge-right="40" lazy transition="slide-y-transition" offset-y full-width min-width="290px">
                                <v-text-field slot="activator" v-model="date" label=" تاریخ شروع رویداد " prepend-icon="fas fa-calendar-alt" color="cyan" readonly></v-text-field>
                                <v-date-picker v-model="date" @input="eventDateBegin = false" color="cyan" locale="fa-ir"></v-date-picker>
                            </v-menu>
                        </v-card-text>
                    </v-flex>
                    <v-flex xs12 sm4 md3>
                        <v-card-text>
                            <v-menu :close-on-content-click="false" v-model="eventDateEnd" :nudge-right="40" lazy transition="slide-y-transition" offset-y full-width min-width="290px">
                                <v-text-field slot="activator" v-model="date" label=" تاریخ پایان رویداد " prepend-icon="fas fa-calendar-alt" color="cyan" readonly></v-text-field>
                                <v-date-picker v-model="date" @input="eventDateEnd = false" color="cyan" locale="fa-ir"></v-date-picker>
                            </v-menu>
                        </v-card-text>
                    </v-flex>
                    <v-flex md12>
                        <v-card-text class="WM-JustSide">
                            <v-textarea name="input-7-1" label=" جزئیات رویداد " value="" hint="حداکثر 2500 کاراکتر " color="cyan" prepend-icon="fas fa-quote-right"></v-textarea>
                        </v-card-text>
                    </v-flex>
                </v-layout>
                <v-layout row wrap class="WM-Section" style="border-right-color: #32c5d2;">
                    <v-flex xs12 sm4 md3>
                        <v-card-text class="WM-Padd-T-40">
                            <WM-Checkbox ItemText=" به من یادآوری کن " ItemID="RemindMe"></WM-Checkbox>
                        </v-card-text>
                    </v-flex>
                    <v-flex xs12 sm4 md2>
                        <v-card-text>
                            <v-menu :close-on-content-click="false" v-model="eventRemindDate" :nudge-right="40" lazy transition="slide-y-transition" offset-y full-width min-width="290px">
                                <v-text-field slot="activator" v-model="date" label="  در تاریخ " prepend-icon="fas fa-calendar-alt" color="cyan" readonly></v-text-field>
                                <v-date-picker v-model="date" @input="eventRemindDate = false" color="cyan" locale="fa-ir"></v-date-picker>
                            </v-menu>
                        </v-card-text>
                    </v-flex>
                    <v-flex xs12 sm4 md2>
                        <v-card-text>
                            <v-menu ref="selfTimeMenu" v-model="selfTimeMenu" :close-on-content-click="false" :nudge-right="40" :return-value.sync="selfTime" lazy transition="slide-y-transition" offset-y full-width max-width="290px" min-width="290px">
                                <template v-slot:activator="{ on }">
                                    <v-text-field v-model="selfTime" label="در ساعت" prepend-icon="fas fa-clock" class="text-lg-center" readonly color="cyan" v-on="on"></v-text-field>
                                </template>
                                <v-time-picker class="LTR" v-if="selfTimeMenu" v-model="selfTime" color="cyan" full-width  @click:minute="$refs.selfTimeMenu.save(selfTime)" locale="fa-ir"></v-time-picker>
                            </v-menu>
                        </v-card-text>
                    </v-flex>
                    <v-flex xs12 sm5>
                        <v-card-text style="padding-top:6px;">
                            <v-select v-model="selfRemindValues" :items="selfRemindItems"  color="cyan" attach chips label=" روش های اطلاع رسانی " multiple></v-select>
                        </v-card-text>
                    </v-flex>

                </v-layout>
                <v-layout row wrap class="WM-Section" style="border-right-color: #80DEEA;">
                    <v-flex xs12 sm4 md3>
                        <v-card-text class="WM-Padd-T-40">
                            <WM-Checkbox ItemText=" به مشتری یاد آوری کن " ItemID="RemindClient"></WM-Checkbox>
                        </v-card-text>
                    </v-flex>
                    <v-flex xs12 sm4 md2>
                        <v-card-text>
                            <v-menu :close-on-content-click="false" v-model="eventRemindDate" :nudge-right="40" lazy transition="slide-y-transition" offset-y full-width min-width="290px">
                                <v-text-field slot="activator" v-model="date2" label="  در تاریخ " prepend-icon="fas fa-calendar-alt" color="cyan" readonly></v-text-field>
                                <v-date-picker v-model="date2" @input="eventRemindDate = false" color="cyan" locale="fa-ir"></v-date-picker>
                            </v-menu>
                        </v-card-text>
                    </v-flex>
                    <v-flex xs12 sm4 md2>
                        <v-card-text>
                            <v-menu ref="clientTimeMenu" v-model="clientTimeMenu" :close-on-content-click="false" :nudge-right="40" :return-value.sync="clientTime" lazy transition="slide-y-transition" offset-y full-width max-width="290px" min-width="290px">
                                <template v-slot:activator="{ on }">
                                    <v-text-field v-model="clientTime" label="در ساعت" prepend-icon="fas fa-clock" class="text-lg-center" readonly color="cyan" v-on="on"></v-text-field>
                                </template>
                                <v-time-picker class="LTR" v-if="clientTimeMenu" v-model="clientTime" color="cyan" full-width  @click:minute="$refs.clientTimeMenu.save(clientTime)" locale="fa-ir"></v-time-picker>
                            </v-menu>
                        </v-card-text>
                    </v-flex>
                    <v-flex xs12 sm5>
                        <v-card-text style="padding-top:6px;">
                            <v-select v-model="clientRemindValues" :items="clientRemindItems"  color="cyan" attach chips label=" روش های اطلاع رسانی " multiple></v-select>
                        </v-card-text>
                    </v-flex>
                </v-layout>
            </v-card-text>

            <v-divider></v-divider>

            <v-card-actions>
                <v-spacer></v-spacer>
                <v-btn color="cyan" depressed dark @click="$store.state.EventAdd = false">
                    <v-icon dark right>fas fa-plus</v-icon> ثبت رویداد
                </v-btn>
            </v-card-actions>
        </v-card>
    </v-dialog>

</template>

<script>

export default {
    props: {
        Color:     { default: 'grey darken-4' },
    },
    data () {
        return {
            date: new Date().toISOString().substr(0, 10),
            date2: new Date().toISOString().substr(0, 10),
            eventDateBegin: false,
            eventDateEnd: false,
            eventRemindDate: false,
            eventTypes: [
                { name: ' ویزیت دکتر ', id: 1 },
                { name: ' عمل جراحی ', id: 2 },
                { name: ' خرید ', id: 2 },
            ],
            selfTime: '12:00',
            selfTimeMenu: false,
            selfRemindItems: [' پیام کوتاه ', ' ایمیل ', ' اطلاع رسانی در مرورگر '],
            selfRemindValues: [' پیام کوتاه ', ' ایمیل ', ' اطلاع رسانی در مرورگر '],
            clientTime: '12:00',
            clientTimeMenu: false,
            clientRemindItems: [' پیام کوتاه ', ' ایمیل '],
            clientRemindValues: [' پیام کوتاه ', ' ایمیل '],
        }
    }

};
</script>
