import ElementUI from "element-ui";
import "./WsTheme/element-variables.scss";
// import 'element-ui/lib/theme-chalk/index.css'

/// [begin] auto import components
import WsButton from "./WsButton";
import WsInput from "./WsInput";
import WsSelect from "./WsSelect";
import WsOption from "./WsOption";
import WsDatePicker from "./WsDatePicker";
import WsCheckbox from "./WsCheckbox";
import WsCheckboxGroup from "./WsCheckboxGroup";
import WsRadio from "./WsRadio";
import WsRadioGroup from "./WsRadioGroup";
import WsSwitch from "./WsSwitch";
import WsLink from "./WsLink";
import WsDropdown from "./WsDropdown";
import WsDropdownMenu from "./WsDropdownMenu";
import WsDropdownItem from "./WsDropdownItem";
import WsTree from "./WsTree";
import WsForm from "./WsForm";
import WsFormItem from "./WsFormItem";
import WsTimeSelect from "./WsTimeSelect";
import WsRow from "./WsRow";
import WsCol from "./WsCol";
import WsTimePicker from "./WsTimePicker";
import WsInfoTable from "./WsInfoTable";
import WsPanel from "./WsPanel";
import WsTplForm from "./WsTplForm";
import WsTplFormEdit from "./WsTplFormEdit";
import WsClassTable from "./WsClassTable";
import WsClassTableCol from "./WsClassTableCol";
import WsBadge from "./WsBadge";
import WsButtonMap from "./WsButtonMap";
import WsTableColumn from "./WsTableColumn";
import WsNormalTable from "./WsNormalTable";
import WsDialog from "./WsDiaLog";

import WsFormTpl from "./WsFormTpl";
import WsFormTplItem from "./WsFormTplItem";
/// [end] auto import components

export const components = {
  /// [begin] auto ref components
  WsButton,
  WsInput,
  WsSelect,
  WsOption,
  WsDatePicker,
  WsCheckbox,
  WsCheckboxGroup,
  WsRadio,
  WsRadioGroup,
  WsSwitch,
  WsLink,
  WsDropdown,
  WsDropdownMenu,
  WsDropdownItem,
  WsTree,
  WsForm,
  WsFormItem,
  WsTimeSelect,
  WsRow,
  WsCol,
  WsTimePicker,
  WsInfoTable,
  WsPanel,
  WsTplForm,
  WsTplFormEdit,
  WsClassTable,
  WsClassTableCol,
  WsBadge,
  WsButtonMap,
  WsTableColumn,
  WsNormalTable,
  WsDialog,
  WsFormTpl,
  WsFormTplItem
  /// [end] auto ref components
};

const install = function(Vue, params) {
  if (install.isInstalled) {
    return;
  }
  install.isInstalled = true;

  Vue.use(ElementUI, params);

  for (var key in components) {
    var component = components[key];
    Vue.component(component.name, component);
  }
};

export default {
  install,
  ...components
};
