Blame view

src/index.js 4.75 KB
3735e376   jingsam   sort components
1
  import Affix from './components/affix';
5d122b37   梁灏   support Alert
2
  import Alert from './components/alert';
fed3e09d   梁灏   add AutoComplete ...
3
  import AutoComplete from './components/auto-complete';
2c5faf30   梁灏   init Avatar compo...
4
  import Avatar from './components/avatar';
1d8f7767   mod   support BackTop t...
5
  import BackTop from './components/back-top';
15368be1   梁灏   Support Badge
6
  import Badge from './components/badge';
c06e99d0   huixisheng   Support Breadcrumb
7
  import Breadcrumb from './components/breadcrumb';
d47ea998   梁灏   support Button an...
8
  import Button from './components/button';
a8cb711c   huixisheng   Support Card
9
  import Card from './components/card';
bb71140e   梁灏   support Carousel
10
  import Carousel from './components/carousel';
47a7f21d   梁灏   support Cascader
11
  import Cascader from './components/cascader';
cbe03a12   梁灏   support Checkbox
12
  import Checkbox from './components/checkbox';
b2d29401   梁灏   support Circle
13
  import Circle from './components/circle';
a190ce84   梁灏   support Collapse
14
  import Collapse from './components/collapse';
5a9cda85   梁灏   update ColorPicker
15
  import ColorPicker from './components/color-picker';
a2eb0287   zhigang.li   add layout compon...
16
  import Content from './components/content';
531cd165   梁灏   support DatePicke...
17
  import DatePicker from './components/date-picker';
b1c118d8   梁灏   support Dropdown
18
  import Dropdown from './components/dropdown';
a2eb0287   zhigang.li   add layout compon...
19
  import Footer from './components/footer';
257f80f1   梁灏   support Form
20
  import Form from './components/form';
a2eb0287   zhigang.li   add layout compon...
21
  import Header from './components/header';
d47ea998   梁灏   support Button an...
22
  import Icon from './components/icon';
fc7ef072   梁灏   support Input
23
  import Input from './components/input';
c97c42ab   梁灏   support InputNumber
24
  import InputNumber from './components/input-number';
be01f0b4   Sergio Crisostomo   New component: Sc...
25
  import Scroll from './components/scroll';
a2eb0287   zhigang.li   add layout compon...
26
  import Layout from './components/layout';
f97e5bb0   梁灏   support LoadingBar
27
  import LoadingBar from './components/loading-bar';
fd1582c5   梁灏   support Menu & La...
28
  import Menu from './components/menu';
6cadeba4   梁灏   support Message
29
  import Message from './components/message';
6259471f   梁灏   support Modal
30
  import Modal from './components/modal';
833501a4   梁灏   support Notice
31
  import Notice from './components/notice';
87c51597   梁灏   support Page
32
  import Page from './components/page';
79288d43   梁灏   support Poptip & ...
33
  import Poptip from './components/poptip';
5d08ddf2   梁灏   support Progress ...
34
  import Progress from './components/progress';
06322514   梁灏   support Radio
35
  import Radio from './components/radio';
6aa72722   huixisheng   Support rate
36
  import Rate from './components/rate';
a2eb0287   zhigang.li   add layout compon...
37
  import Sider from './components/sider';
d6f644e1   梁灏   support Tooltip
38
  import Slider from './components/slider';
2d43f26b   梁灏   support Spin
39
  import Spin from './components/spin';
bd596e7a   huixisheng   support Steps
40
  import Steps from './components/steps';
2d5ba278   梁灏   support Switch
41
  import Switch from './components/switch';
486d4fda   梁灏   update Table
42
  import Table from './components/table';
30510c3d   梁灏   support Tabs
43
  import Tabs from './components/tabs';
456daf34   梁灏   support Tag
44
  import Tag from './components/tag';
6c9e0282   huixisheng   Support timeline
45
  import Timeline from './components/timeline';
531cd165   梁灏   support DatePicke...
46
  import TimePicker from './components/time-picker';
d6f644e1   梁灏   support Tooltip
47
  import Tooltip from './components/tooltip';
5b19b5f5   梁灏   support Transfer
48
  import Transfer from './components/transfer';
cb84e64a   梁灏   update Tree
49
  import Tree from './components/tree';
5d08ddf2   梁灏   support Progress ...
50
  import Upload from './components/upload';
be01f0b4   Sergio Crisostomo   New component: Sc...
51
52
  import {Row, Col} from './components/grid';
  import {Select, Option, OptionGroup} from './components/select';
b26389a0   xiaofengsha   * 对照AntDesign,实现了...
53
  import Divider from './components/divider';
b9c1fe77   Sergio Crisostomo   export locale obj...
54
  import locale from './locale/index';
7fa943eb   梁灏   init
55
  
0c0d2c73   Sergio Crisostomo   reorganize and DR...
56
  const components = {
3735e376   jingsam   sort components
57
      Affix,
5d122b37   梁灏   support Alert
58
      Alert,
fed3e09d   梁灏   add AutoComplete ...
59
      AutoComplete,
2c5faf30   梁灏   init Avatar compo...
60
      Avatar,
1d8f7767   mod   support BackTop t...
61
      BackTop,
15368be1   梁灏   Support Badge
62
      Badge,
c06e99d0   huixisheng   Support Breadcrumb
63
64
      Breadcrumb,
      BreadcrumbItem: Breadcrumb.Item,
d47ea998   梁灏   support Button an...
65
66
      Button,
      ButtonGroup: Button.Group,
a8cb711c   huixisheng   Support Card
67
      Card,
bb71140e   梁灏   support Carousel
68
69
      Carousel,
      CarouselItem: Carousel.Item,
47a7f21d   梁灏   support Cascader
70
      Cascader,
cbe03a12   梁灏   support Checkbox
71
72
      Checkbox,
      CheckboxGroup: Checkbox.Group,
5a9cda85   梁灏   update ColorPicker
73
      Col,
5a9cda85   梁灏   update ColorPicker
74
75
      Collapse,
      ColorPicker,
a2eb0287   zhigang.li   add layout compon...
76
      Content: Content,
531cd165   梁灏   support DatePicke...
77
      DatePicker,
b1c118d8   梁灏   support Dropdown
78
79
80
      Dropdown,
      DropdownItem: Dropdown.Item,
      DropdownMenu: Dropdown.Menu,
a2eb0287   zhigang.li   add layout compon...
81
      Footer: Footer,
bf9649f6   梁灏   add Form
82
      Form,
257f80f1   梁灏   support Form
83
      FormItem: Form.Item,
a2eb0287   zhigang.li   add layout compon...
84
      Header: Header,
d47ea998   梁灏   support Button an...
85
      Icon,
fc7ef072   梁灏   support Input
86
      Input,
c97c42ab   梁灏   support InputNumber
87
      InputNumber,
be01f0b4   Sergio Crisostomo   New component: Sc...
88
      Scroll,
a2eb0287   zhigang.li   add layout compon...
89
90
91
      Sider: Sider,
      Submenu: Menu.Sub,
      Layout: Layout,
f97e5bb0   梁灏   support LoadingBar
92
      LoadingBar,
fd1582c5   梁灏   support Menu & La...
93
      Menu,
fd1582c5   梁灏   support Menu & La...
94
95
      MenuGroup: Menu.Group,
      MenuItem: Menu.Item,
6cadeba4   梁灏   support Message
96
      Message,
6259471f   梁灏   support Modal
97
      Modal,
833501a4   梁灏   support Notice
98
      Notice,
50168478   young   config(compontent...
99
      Option: Option,
4aec6a66   梁灏   support Select
100
      OptionGroup,
87c51597   梁灏   support Page
101
      Page,
a190ce84   梁灏   support Collapse
102
      Panel: Collapse.Panel,
79288d43   梁灏   support Poptip & ...
103
      Poptip,
5d08ddf2   梁灏   support Progress ...
104
      Progress,
06322514   梁灏   support Radio
105
106
      Radio,
      RadioGroup: Radio.Group,
6aa72722   huixisheng   Support rate
107
      Rate,
c755733a   梁灏   support Grid
108
      Row,
4a5d5cc9   梁灏   更新几个标签名称
109
      Select,
d6f644e1   梁灏   support Tooltip
110
      Slider,
2d43f26b   梁灏   support Spin
111
      Spin,
bd596e7a   huixisheng   support Steps
112
113
      Step: Steps.Step,
      Steps,
486d4fda   梁灏   update Table
114
      Table,
30510c3d   梁灏   support Tabs
115
116
      Tabs: Tabs,
      TabPane: Tabs.Pane,
456daf34   梁灏   support Tag
117
      Tag,
6c9e0282   huixisheng   Support timeline
118
119
      Timeline,
      TimelineItem: Timeline.Item,
531cd165   梁灏   support DatePicke...
120
      TimePicker,
d6f644e1   梁灏   support Tooltip
121
      Tooltip,
5b19b5f5   梁灏   support Transfer
122
      Transfer,
34ee7b4a   梁灏   support Tree & ad...
123
      Tree,
b26389a0   xiaofengsha   * 对照AntDesign,实现了...
124
125
      Upload,
      Divider
7fa943eb   梁灏   init
126
  };
fb189f16   young   cancel the compon...
127
  
0c0d2c73   Sergio Crisostomo   reorganize and DR...
128
129
130
131
132
  const iview = {
      ...components,
      iButton: Button,
      iCircle: Circle,
      iCol: Col,
a2eb0287   zhigang.li   add layout compon...
133
      iContent: Content,
0c0d2c73   Sergio Crisostomo   reorganize and DR...
134
      iForm: Form,
a2eb0287   zhigang.li   add layout compon...
135
136
      iFooter: Footer,
      iHeader: Header,
0c0d2c73   Sergio Crisostomo   reorganize and DR...
137
138
139
140
141
142
143
144
145
      iInput: Input,
      iMenu: Menu,
      iOption: Option,
      iProgress: Progress,
      iSelect: Select,
      iSwitch: Switch,
      iTable: Table
  };
  
be01f0b4   Sergio Crisostomo   New component: Sc...
146
  const install = function(Vue, opts = {}) {
d64ad52d   梁灏   update index
147
      if (install.installed) return;
d33b5143   梁灏   support i18n
148
149
150
      locale.use(opts.locale);
      locale.i18n(opts.i18n);
  
be01f0b4   Sergio Crisostomo   New component: Sc...
151
      Object.keys(iview).forEach(key => {
fb189f16   young   cancel the compon...
152
          Vue.component(key, iview[key]);
451b52ce   梁灏   Global install iView
153
154
      });
  
f97e5bb0   梁灏   support LoadingBar
155
      Vue.prototype.$Loading = LoadingBar;
6cadeba4   梁灏   support Message
156
      Vue.prototype.$Message = Message;
6259471f   梁灏   support Modal
157
      Vue.prototype.$Modal = Modal;
833501a4   梁灏   support Notice
158
      Vue.prototype.$Notice = Notice;
297648f1   梁灏   fixed #1063
159
      Vue.prototype.$Spin = Spin;
451b52ce   梁灏   Global install iView
160
  };
343abe50   jingsam   add iview.install()
161
162
163
164
  
  // auto install
  if (typeof window !== 'undefined' && window.Vue) {
      install(window.Vue);
451b52ce   梁灏   Global install iView
165
  }
343abe50   jingsam   add iview.install()
166
  
0c0d2c73   Sergio Crisostomo   reorganize and DR...
167
  const API = {
d962c7fa   Sergio Crisostomo   use version from ...
168
      version: process.env.VERSION, // eslint-disable-line no-undef
c7e432f7   梁灏   update export & i18n
169
170
171
      locale: locale.use,
      i18n: locale.i18n,
      install,
c7e432f7   梁灏   update export & i18n
172
      Circle,
c7e432f7   梁灏   update export & i18n
173
      Switch,
0c0d2c73   Sergio Crisostomo   reorganize and DR...
174
      ...components
c7e432f7   梁灏   update export & i18n
175
176
  };
  
0c0d2c73   Sergio Crisostomo   reorganize and DR...
177
  API.lang = (code) => {
5fbe80fe   Sergio Crisostomo   use dist's locale
178
179
180
181
182
      const langObject = window['iview/locale'].default;
      if (code === langObject.i.locale) locale.use(langObject);
      else console.log(`The ${code} language pack is not loaded.`); // eslint-disable-line no-console
  };
  
0c0d2c73   Sergio Crisostomo   reorganize and DR...
183
  module.exports.default = module.exports = API;   // eslint-disable-line no-undef