2016-11-27 01:42:39 +08:00
|
|
|
// es6 polyfill
|
2016-12-25 22:49:42 +08:00
|
|
|
import 'core-js/fn/array/find-index';
|
2016-11-27 01:42:39 +08:00
|
|
|
|
2016-10-31 17:41:42 +08:00
|
|
|
import Affix from './components/affix';
|
2017-03-02 11:50:02 +08:00
|
|
|
import Alert from './components/alert';
|
2017-03-07 10:03:11 +08:00
|
|
|
import BackTop from './components/back-top';
|
2017-03-02 12:05:57 +08:00
|
|
|
import Badge from './components/badge';
|
2017-03-03 21:05:30 +08:00
|
|
|
import Breadcrumb from './components/breadcrumb';
|
2017-03-01 14:43:27 +08:00
|
|
|
import Button from './components/button';
|
2017-03-02 17:35:02 +08:00
|
|
|
import Card from './components/card';
|
2017-03-02 15:36:39 +08:00
|
|
|
import Carousel from './components/carousel';
|
2017-03-06 17:30:39 +08:00
|
|
|
import Cascader from './components/cascader';
|
2017-03-01 17:58:40 +08:00
|
|
|
import Checkbox from './components/checkbox';
|
2017-03-03 11:54:23 +08:00
|
|
|
import Circle from './components/circle';
|
2017-03-02 15:05:06 +08:00
|
|
|
import Collapse from './components/collapse';
|
2017-03-07 18:06:56 +08:00
|
|
|
import DatePicker from './components/date-picker';
|
2017-03-03 17:46:09 +08:00
|
|
|
import Dropdown from './components/dropdown';
|
2017-03-08 15:31:59 +08:00
|
|
|
import Form from './components/form';
|
2017-03-01 14:43:27 +08:00
|
|
|
import Icon from './components/icon';
|
2017-03-01 15:23:12 +08:00
|
|
|
import Input from './components/input';
|
2017-03-02 13:40:09 +08:00
|
|
|
import InputNumber from './components/input-number';
|
2017-03-09 17:29:40 +08:00
|
|
|
import LoadingBar from './components/loading-bar';
|
2017-03-06 13:31:48 +08:00
|
|
|
import Menu from './components/menu';
|
2017-03-09 22:21:54 +08:00
|
|
|
import Message from './components/message';
|
2017-03-09 18:31:47 +08:00
|
|
|
import Modal from './components/modal';
|
2017-03-09 22:32:57 +08:00
|
|
|
import Notice from './components/notice';
|
2017-03-07 10:32:46 +08:00
|
|
|
import Page from './components/page';
|
2017-03-03 15:19:21 +08:00
|
|
|
import Poptip from './components/poptip';
|
2017-03-02 14:41:28 +08:00
|
|
|
import Progress from './components/progress';
|
2017-03-01 17:01:22 +08:00
|
|
|
import Radio from './components/radio';
|
2017-03-02 19:31:21 +08:00
|
|
|
import Rate from './components/rate';
|
2017-03-03 14:00:16 +08:00
|
|
|
import Slider from './components/slider';
|
2017-03-06 13:43:15 +08:00
|
|
|
import Spin from './components/spin';
|
2017-03-01 21:10:43 +08:00
|
|
|
import Steps from './components/steps';
|
2017-03-02 11:19:00 +08:00
|
|
|
import Switch from './components/switch';
|
2017-03-09 14:11:22 +08:00
|
|
|
import Table from './components/table';
|
2017-03-03 13:38:46 +08:00
|
|
|
import Tabs from './components/tabs';
|
2017-03-02 12:22:15 +08:00
|
|
|
import Tag from './components/tag';
|
2017-03-02 09:06:39 +08:00
|
|
|
import Timeline from './components/timeline';
|
2017-03-07 18:06:56 +08:00
|
|
|
import TimePicker from './components/time-picker';
|
2017-03-03 14:00:16 +08:00
|
|
|
import Tooltip from './components/tooltip';
|
2017-03-07 15:06:38 +08:00
|
|
|
import Transfer from './components/transfer';
|
2017-03-02 17:40:19 +08:00
|
|
|
import Tree from './components/tree';
|
2017-03-02 14:41:28 +08:00
|
|
|
import Upload from './components/upload';
|
2017-03-01 14:28:44 +08:00
|
|
|
import { Row, Col } from './components/grid';
|
2017-03-06 18:24:57 +08:00
|
|
|
import { Select, Option, OptionGroup } from './components/select';
|
2017-01-11 18:04:29 +08:00
|
|
|
import locale from './locale';
|
2016-09-09 14:29:19 +08:00
|
|
|
|
|
|
|
const iview = {
|
2016-10-31 17:41:42 +08:00
|
|
|
Affix,
|
2017-03-02 11:50:02 +08:00
|
|
|
Alert,
|
2017-03-07 10:03:11 +08:00
|
|
|
BackTop,
|
2017-03-02 12:05:57 +08:00
|
|
|
Badge,
|
2017-03-03 21:05:30 +08:00
|
|
|
Breadcrumb,
|
|
|
|
BreadcrumbItem: Breadcrumb.Item,
|
2017-03-09 15:03:05 +08:00
|
|
|
iButton: Button,
|
2017-03-01 14:43:27 +08:00
|
|
|
Button,
|
|
|
|
ButtonGroup: Button.Group,
|
2017-03-02 17:35:02 +08:00
|
|
|
Card,
|
2017-03-02 15:36:39 +08:00
|
|
|
Carousel,
|
|
|
|
CarouselItem: Carousel.Item,
|
2017-03-06 17:30:39 +08:00
|
|
|
Cascader,
|
2017-03-01 17:58:40 +08:00
|
|
|
Checkbox,
|
|
|
|
CheckboxGroup: Checkbox.Group,
|
2017-03-03 11:54:23 +08:00
|
|
|
iCircle: Circle,
|
2017-03-07 18:06:56 +08:00
|
|
|
DatePicker,
|
2017-03-03 17:46:09 +08:00
|
|
|
Dropdown,
|
|
|
|
DropdownItem: Dropdown.Item,
|
|
|
|
DropdownMenu: Dropdown.Menu,
|
2017-03-08 15:31:59 +08:00
|
|
|
iForm: Form,
|
|
|
|
FormItem: Form.Item,
|
2017-03-20 15:08:25 +08:00
|
|
|
Col,
|
2017-03-01 14:28:44 +08:00
|
|
|
iCol: Col,
|
2017-03-02 15:05:06 +08:00
|
|
|
Collapse,
|
2017-03-01 14:43:27 +08:00
|
|
|
Icon,
|
2017-03-01 15:23:12 +08:00
|
|
|
Input,
|
2017-03-13 16:22:54 +08:00
|
|
|
iInput: Input,
|
2017-03-02 13:40:09 +08:00
|
|
|
InputNumber,
|
2017-03-09 17:29:40 +08:00
|
|
|
LoadingBar,
|
2017-03-06 13:31:48 +08:00
|
|
|
Menu,
|
2017-03-13 16:22:54 +08:00
|
|
|
iMenu: Menu,
|
2017-03-06 13:31:48 +08:00
|
|
|
MenuGroup: Menu.Group,
|
|
|
|
MenuItem: Menu.Item,
|
|
|
|
Submenu: Menu.Sub,
|
2017-03-09 22:21:54 +08:00
|
|
|
Message,
|
2017-03-09 18:31:47 +08:00
|
|
|
Modal,
|
2017-03-09 22:32:57 +08:00
|
|
|
Notice,
|
2017-03-14 14:28:56 +08:00
|
|
|
Option: Option,
|
2017-03-06 18:24:57 +08:00
|
|
|
iOption: Option,
|
|
|
|
OptionGroup,
|
2017-03-07 10:32:46 +08:00
|
|
|
Page,
|
2017-03-02 15:05:06 +08:00
|
|
|
Panel: Collapse.Panel,
|
2017-03-03 15:19:21 +08:00
|
|
|
Poptip,
|
2017-03-02 14:41:28 +08:00
|
|
|
Progress,
|
2017-03-13 16:19:08 +08:00
|
|
|
iProgress: Progress,
|
2017-03-01 17:01:22 +08:00
|
|
|
Radio,
|
|
|
|
RadioGroup: Radio.Group,
|
2017-03-02 19:31:21 +08:00
|
|
|
Rate,
|
2017-03-01 14:28:44 +08:00
|
|
|
Row,
|
2017-03-13 16:29:29 +08:00
|
|
|
Select,
|
2017-03-06 18:24:57 +08:00
|
|
|
iSelect: Select,
|
2017-03-03 14:00:16 +08:00
|
|
|
Slider,
|
2017-03-06 13:43:15 +08:00
|
|
|
Spin,
|
2017-03-01 21:10:43 +08:00
|
|
|
Step: Steps.Step,
|
|
|
|
Steps,
|
2017-03-02 11:19:00 +08:00
|
|
|
iSwitch: Switch,
|
2017-03-13 16:29:29 +08:00
|
|
|
iTable: Table,
|
2017-03-09 14:11:22 +08:00
|
|
|
Table,
|
2017-03-03 13:38:46 +08:00
|
|
|
Tabs: Tabs,
|
|
|
|
TabPane: Tabs.Pane,
|
2017-03-02 12:22:15 +08:00
|
|
|
Tag,
|
2017-03-02 09:06:39 +08:00
|
|
|
Timeline,
|
|
|
|
TimelineItem: Timeline.Item,
|
2017-03-07 18:06:56 +08:00
|
|
|
TimePicker,
|
2017-03-03 14:00:16 +08:00
|
|
|
Tooltip,
|
2017-03-07 15:06:38 +08:00
|
|
|
Transfer,
|
2017-03-02 17:40:19 +08:00
|
|
|
Tree,
|
2017-03-02 14:41:28 +08:00
|
|
|
Upload
|
2016-09-09 14:29:19 +08:00
|
|
|
};
|
2017-03-15 11:22:33 +08:00
|
|
|
|
2017-01-11 18:04:29 +08:00
|
|
|
const install = function (Vue, opts = {}) {
|
|
|
|
locale.use(opts.locale);
|
|
|
|
locale.i18n(opts.i18n);
|
|
|
|
|
2016-11-03 10:19:35 +08:00
|
|
|
Object.keys(iview).forEach((key) => {
|
2017-03-15 11:22:33 +08:00
|
|
|
Vue.component(key, iview[key]);
|
2016-11-14 13:49:06 +08:00
|
|
|
});
|
|
|
|
|
2017-03-09 17:29:40 +08:00
|
|
|
Vue.prototype.$Loading = LoadingBar;
|
2017-03-09 22:21:54 +08:00
|
|
|
Vue.prototype.$Message = Message;
|
2017-03-09 18:31:47 +08:00
|
|
|
Vue.prototype.$Modal = Modal;
|
2017-03-09 22:32:57 +08:00
|
|
|
Vue.prototype.$Notice = Notice;
|
2016-11-14 13:49:06 +08:00
|
|
|
};
|
2016-11-03 10:19:35 +08:00
|
|
|
|
|
|
|
// auto install
|
|
|
|
if (typeof window !== 'undefined' && window.Vue) {
|
|
|
|
install(window.Vue);
|
2016-11-14 13:49:06 +08:00
|
|
|
}
|
2016-11-03 10:19:35 +08:00
|
|
|
|
2016-12-25 22:49:42 +08:00
|
|
|
module.exports = Object.assign(iview, {install}); // eslint-disable-line no-undef
|