/* Automatic generated by './build/bin/build-entry.js' */

import Pagination from '../packages/pagination';
import Dialog from '../packages/dialog';
import Autocomplete from '../packages/autocomplete';
import Dropdown from '../packages/dropdown';
import DropdownMenu from '../packages/dropdown-menu';
import DropdownItem from '../packages/dropdown-item';
import Menu from '../packages/menu';
import Submenu from '../packages/submenu';
import MenuItem from '../packages/menu-item';
import MenuItemGroup from '../packages/menu-item-group';
import Input from '../packages/input';
import InputNumber from '../packages/input-number';
import Radio from '../packages/radio';
import RadioGroup from '../packages/radio-group';
import RadioButton from '../packages/radio-button';
import Checkbox from '../packages/checkbox';
import CheckboxGroup from '../packages/checkbox-group';
import Switch from '../packages/switch';
import Select from '../packages/select';
import Option from '../packages/option';
import OptionGroup from '../packages/option-group';
import Button from '../packages/button';
import ButtonGroup from '../packages/button-group';
import Table from '../packages/table';
import TableColumn from '../packages/table-column';
import DatePicker from '../packages/date-picker';
import TimeSelect from '../packages/time-select';
import TimePicker from '../packages/time-picker';
import Popover from '../packages/popover';
import Tooltip from '../packages/tooltip';
import MessageBox from '../packages/message-box';
import Breadcrumb from '../packages/breadcrumb';
import BreadcrumbItem from '../packages/breadcrumb-item';
import Form from '../packages/form';
import FormItem from '../packages/form-item';
import Tabs from '../packages/tabs';
import TabPane from '../packages/tab-pane';
import Tag from '../packages/tag';
import Tree from '../packages/tree';
import Alert from '../packages/alert';
import Notification from '../packages/notification';
import Slider from '../packages/slider';
import Loading from '../packages/loading';
import Icon from '../packages/icon';
import Row from '../packages/row';
import Col from '../packages/col';
import Upload from '../packages/upload';
import Progress from '../packages/progress';
import Spinner from '../packages/spinner';
import Message from '../packages/message';
import Badge from '../packages/badge';
import Card from '../packages/card';
import Rate from '../packages/rate';
import Steps from '../packages/steps';
import Step from '../packages/step';
import Carousel from '../packages/carousel';
import Scrollbar from '../packages/scrollbar';
import CarouselItem from '../packages/carousel-item';
import Collapse from '../packages/collapse';
import CollapseItem from '../packages/collapse-item';
import locale from 'element-ui/src/locale';

const components = [
  Pagination,
  Dialog,
  Autocomplete,
  Dropdown,
  DropdownMenu,
  DropdownItem,
  Menu,
  Submenu,
  MenuItem,
  MenuItemGroup,
  Input,
  InputNumber,
  Radio,
  RadioGroup,
  RadioButton,
  Checkbox,
  CheckboxGroup,
  Switch,
  Select,
  Option,
  OptionGroup,
  Button,
  ButtonGroup,
  Table,
  TableColumn,
  DatePicker,
  TimeSelect,
  TimePicker,
  Popover,
  Tooltip,
  Breadcrumb,
  BreadcrumbItem,
  Form,
  FormItem,
  Tabs,
  TabPane,
  Tag,
  Tree,
  Alert,
  Slider,
  Icon,
  Row,
  Col,
  Upload,
  Progress,
  Spinner,
  Badge,
  Card,
  Rate,
  Steps,
  Step,
  Carousel,
  Scrollbar,
  CarouselItem,
  Collapse,
  CollapseItem
];

const install = function(Vue, opts = {}) {
  /* istanbul ignore if */
  if (install.installed) return;
  locale.use(opts.locale);
  locale.i18n(opts.i18n);

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

  Vue.use(Loading.directive);

  Vue.prototype.$loading = Loading.service;
  Vue.prototype.$msgbox = MessageBox;
  Vue.prototype.$alert = MessageBox.alert;
  Vue.prototype.$confirm = MessageBox.confirm;
  Vue.prototype.$prompt = MessageBox.prompt;
  Vue.prototype.$notify = Notification;
  Vue.prototype.$message = Message;
};

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

module.exports = {
  version: '1.1.5',
  locale: locale.use,
  i18n: locale.i18n,
  install,
  Loading,
  Pagination,
  Dialog,
  Autocomplete,
  Dropdown,
  DropdownMenu,
  DropdownItem,
  Menu,
  Submenu,
  MenuItem,
  MenuItemGroup,
  Input,
  InputNumber,
  Radio,
  RadioGroup,
  RadioButton,
  Checkbox,
  CheckboxGroup,
  Switch,
  Select,
  Option,
  OptionGroup,
  Button,
  ButtonGroup,
  Table,
  TableColumn,
  DatePicker,
  TimeSelect,
  TimePicker,
  Popover,
  Tooltip,
  MessageBox,
  Breadcrumb,
  BreadcrumbItem,
  Form,
  FormItem,
  Tabs,
  TabPane,
  Tag,
  Tree,
  Alert,
  Notification,
  Slider,
  Icon,
  Row,
  Col,
  Upload,
  Progress,
  Spinner,
  Message,
  Badge,
  Card,
  Rate,
  Steps,
  Step,
  Carousel,
  Scrollbar,
  CarouselItem,
  Collapse,
  CollapseItem
};
