<template>
  <Picker
    :type="this.mode"
  >
    <template #default="{ time, onChangeHandler }">
      <DatePanal
        :value="time"
        :first-day-of-week="firstDayOfWeek"
        @change="onChangeHandler"
      />
    </template>
  </Picker>
</template>

<script>
import Picker from './picker';
import DatePanal from './panel/date';

export default {
  components: {
    Picker,
    DatePanal
  },
  props: {
    minDate: { type: [String, Date] },
    maxDate: { type: [String, Date] },
    disabledDate: { type: Function, default: () => false },
    firstDayOfWeek: { type: Number, default: 0, validator(v) { return [0, 1, 2, 3, 4, 5, 6].indexOf(v) > -1; } },
    mode: { type: String, default: 'date', validator(v) { return ['date', 'datetime', 'year', 'month'].indexOf(v) > -1; } }
  },
  computed: {

  }
};
</script>
