/**
 * 时间段选择
 * @author xiufu.wang
 */

import ElTimePicker from 'mars-pro/packages/time-picker';
import BaseMixin from 'mars-pro/packages/pro-input/src/mixins/base';
export default {
    name: 'ProInputTimeRange',
    componentName: 'ProInputTimeRange',
    mixins: [BaseMixin],
    components: {
        ElTimePicker
    },
    computed: {
        mergerPickerOptions() {
            const usepickerOptions = this.$attrs.pickerOptions || {}
            return {
                ...usepickerOptions
            }
        }
    },
    render() {
        const _datas = {
            props: {
                value: this.value,
                lazy: true,
                clearable: true,
                 valueFormat: 'HH:mm:ss',
                ...this.$attrs,
                pickerOptions: this.mergerPickerOptions,
                popperClass: 'pro-input-time-range-picker-panel',
                'is-range': true
            },
            attrs: this.$attrs,
            on: {
                ...this.$listeners
            },
            ref: 'elinput',
            'class': {
                'pro-input-time-range': true
            }
        }
        return (
            <ElTimePicker  {..._datas}>
                {this.renderSlots()}
            </ElTimePicker>
        )
    }
}