<script setup>
import { ref } from 'vue'
import useStyle from '../hooks/useStyle'

defineOptions({
  name: 'VTimePicker'
})

const root = ref(null)

const props = defineProps({
  field: {
    type: Object,
    required: true
  }
})

const model = defineModel({ type: [Date, Array] })

const { style } = useStyle(props)

defineExpose({
  root,
  focus(...rest) {
    root.value.focus(...rest)
  },
  blur(...rest) {
    root.value.blur(...rest)
  },
  handleOpen() {
    root.value.handleOpen()
  },
  handleClose() {
    root.value.handleClose()
  }
})
</script>

<template>
  <el-time-picker ref="root" v-model="model" v-bind="field" :style="style"> </el-time-picker>
</template>

<style scoped>
</style>