/* Automatically generated by './build/bin/build-entry.js' */
import {
  Input,
  InputNumber,
  Radio,
  RadioGroup,
  Checkbox,
  CheckboxGroup,
  Switch,
  Select,
  Option,
  OptionGroup,
  Button,
  ButtonGroup,
  DatePicker,
  TimeSelect,
  TimePicker,
  Form,
  FormItem,
  Tabs,
  TabPane,
  Upload,
  Avatar,
  Progress,
  ColorPicker
} from 'element-ui'

import InputForm from './input-form'
import TextareaForm from './textarea-form'
import SelectForm from './select-form'
import CitySelectForm from './city-select-form'
import DatePickerForm from './date-picker-form'
import DatePickerFromToForm from './date-picker-from-to-form'
import RadioGroupForm from './radio-group-form'
import CheckboxGroupForm from './checkbox-group-form'
import UploadForm from './upload-form'

const components = [
  InputForm,
  TextareaForm,
  SelectForm,
  CitySelectForm,
  DatePickerForm,
  DatePickerFromToForm,
  RadioGroupForm,
  CheckboxGroupForm,
  UploadForm
]

const install = function(Vue, opts = {}) {
  // locale.use(opts.locale);
  // locale.i18n(opts.i18n);

  Vue.use(Input)
  Vue.use(InputNumber)
  Vue.use(Radio)
  Vue.use(RadioGroup)
  Vue.use(Checkbox)
  Vue.use(CheckboxGroup)
  Vue.use(Switch)
  Vue.use(Select)
  Vue.use(Option)
  Vue.use(OptionGroup)
  Vue.use(Button)
  Vue.use(ButtonGroup)
  Vue.use(DatePicker)
  Vue.use(TimeSelect)
  Vue.use(TimePicker)
  Vue.use(Form)
  Vue.use(FormItem)
  Vue.use(Tabs)
  Vue.use(TabPane)
  Vue.use(Upload)
  Vue.use(Avatar)
  Vue.use(Progress)
  Vue.use(ColorPicker)

  components.forEach(component => {
    Vue.component(component.name, component)
  })

  // Vue.use(Loading.directive);

  // Vue.prototype.$ELEMENT = {
  //   size: opts.size || '',
  //   zIndex: opts.zIndex || 2000
  // };

  // Vue.prototype.$message = Message;
}

/* istanbul ignore if */
if (typeof window !== 'undefined' && window.Vue) {
  install(window.Vue)
}

export default {
  install,
  InputForm,
  TextareaForm,
  SelectForm,
  CitySelectForm,
  DatePickerForm,
  DatePickerFromToForm,
  RadioGroupForm,
  CheckboxGroupForm,
  UploadForm
}
