Blame view

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