@aochuang/common 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (194) hide show
  1. package/common/loading/index.js +7 -0
  2. package/common/loading/loading.vue +71 -0
  3. package/common/tips/index.js +7 -0
  4. package/common/tips/tips.vue +82 -0
  5. package/common/tooltip/index.js +7 -0
  6. package/common/tooltip/popper.js +18 -0
  7. package/common/tooltip/tooltip.vue +55 -0
  8. package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-boolean.vue +33 -0
  9. package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-date-range.vue +30 -0
  10. package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-date.vue +41 -0
  11. package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-datetime-range.vue +34 -0
  12. package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-datetime.vue +41 -0
  13. package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-number-range.vue +67 -0
  14. package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-number.vue +35 -0
  15. package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-string.vue +41 -0
  16. package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-value.vue +73 -0
  17. package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item.vue +226 -0
  18. package/components/advanced-filter/advanced-filter-condition-toggle.vue +112 -0
  19. package/components/advanced-filter/advanced-filter-condition.vue +352 -0
  20. package/components/advanced-filter/advanced-filter-permanent-item.vue +10 -0
  21. package/components/advanced-filter/advanced-filter-permanent.vue +10 -0
  22. package/components/advanced-filter/advanced-filter-scene-form.vue +95 -0
  23. package/components/advanced-filter/advanced-filter-scene-item.vue +64 -0
  24. package/components/advanced-filter/advanced-filter-scene-manage.vue +264 -0
  25. package/components/advanced-filter/advanced-filter-scene-transfer.vue +283 -0
  26. package/components/advanced-filter/advanced-filter-scene.vue +199 -0
  27. package/components/advanced-filter/advanced-filter.vue +114 -0
  28. package/components/advanced-filter/index.js +36 -0
  29. package/components/advanced-filter/utils.js +132 -0
  30. package/components/autocomplete/autocomplete.vue +121 -0
  31. package/components/autocomplete/index.js +7 -0
  32. package/components/avatar/avatar.png +0 -0
  33. package/components/avatar/avatar.vue +212 -0
  34. package/components/avatar/index.js +7 -0
  35. package/components/brick-wall/brick-wall-skeleton.vue +125 -0
  36. package/components/brick-wall/brick-wall.vue +293 -0
  37. package/components/brick-wall/index.js +7 -0
  38. package/components/button/button.vue +537 -0
  39. package/components/button/index.js +7 -0
  40. package/components/button/utils.js +20 -0
  41. package/components/cascader/cascader.vue +184 -0
  42. package/components/cascader/index.js +7 -0
  43. package/components/cascader/util.js +50 -0
  44. package/components/checkbox/checkbox.vue +114 -0
  45. package/components/checkbox/index.js +7 -0
  46. package/components/checkbox-button/index.js +8 -0
  47. package/components/checkbox-group/checkbox-group.vue +11 -0
  48. package/components/checkbox-group/index.js +7 -0
  49. package/components/date-picker/date-picker.vue +300 -0
  50. package/components/date-picker/index.js +7 -0
  51. package/components/dialog/dialog.vue +182 -0
  52. package/components/dialog/index.js +14 -0
  53. package/components/dialog/utils.js +20 -0
  54. package/components/drawer/drawer.vue +186 -0
  55. package/components/drawer/index.js +14 -0
  56. package/components/drawer/utils.js +36 -0
  57. package/components/dropdown/dropdown-item.vue +63 -0
  58. package/components/dropdown/dropdown.vue +286 -0
  59. package/components/dropdown/index.js +16 -0
  60. package/components/empty/empty.vue +62 -0
  61. package/components/empty/index.js +7 -0
  62. package/components/filter/filter-group.vue +44 -0
  63. package/components/filter/filter-item.vue +122 -0
  64. package/components/filter/filter-more.vue +114 -0
  65. package/components/filter/filter.vue +407 -0
  66. package/components/filter/index.js +20 -0
  67. package/components/filter/refresh-line.svg +1 -0
  68. package/components/filter/util.js +5 -0
  69. package/components/form/form-cell.vue +231 -0
  70. package/components/form/form-group.vue +147 -0
  71. package/components/form/form-row.vue +51 -0
  72. package/components/form/form.vue +256 -0
  73. package/components/form/index.js +13 -0
  74. package/components/grid/grid-card-view/grid-card-view.vue +157 -0
  75. package/components/grid/grid-column.vue +136 -0
  76. package/components/grid/grid-filter/grid-filter-group.vue +41 -0
  77. package/components/grid/grid-filter/grid-filter-item.vue +68 -0
  78. package/components/grid/grid-filter/grid-filter.vue +115 -0
  79. package/components/grid/grid-filter/util.js +7 -0
  80. package/components/grid/grid-filter-operate/grid-filter-operate-item.vue +55 -0
  81. package/components/grid/grid-filter-operate/grid-filter-operate.vue +46 -0
  82. package/components/grid/grid-sort/grid-sort-proxy.js +27 -0
  83. package/components/grid/grid-sort/grid-sort.vue +205 -0
  84. package/components/grid/grid-sort/icons/asc.png +0 -0
  85. package/components/grid/grid-sort/icons/desc.png +0 -0
  86. package/components/grid/grid-sort/index.js +7 -0
  87. package/components/grid/grid-table-view/grid-table-view.vue +178 -0
  88. package/components/grid/grid-table.vue +547 -0
  89. package/components/grid/grid-toolbar/grid-batch-toolbar-proxy.js +21 -0
  90. package/components/grid/grid-toolbar/grid-batch-toolbar.vue +129 -0
  91. package/components/grid/grid-toolbar/grid-global-toolbar-proxy.js +21 -0
  92. package/components/grid/grid-toolbar/grid-global-toolbar.vue +37 -0
  93. package/components/grid/grid-toolbar/grid-more-toolbar-proxy.js +21 -0
  94. package/components/grid/grid-toolbar/grid-more-toolbar.vue +138 -0
  95. package/components/grid/grid-toolbar/grid-row-toolbar.vue +279 -0
  96. package/components/grid/grid-view-select.vue +78 -0
  97. package/components/grid/grid.vue +1102 -0
  98. package/components/grid/icons/more-line.svg +1 -0
  99. package/components/grid/icons/refresh.svg +14 -0
  100. package/components/grid/index.js +61 -0
  101. package/components/grid/util.js +31 -0
  102. package/components/icon/demo.css +539 -0
  103. package/components/icon/demo_index.html +7433 -0
  104. package/components/icon/icon.vue +96 -0
  105. package/components/icon/iconfont.css +1275 -0
  106. package/components/icon/iconfont.eot +0 -0
  107. package/components/icon/iconfont.js +1 -0
  108. package/components/icon/iconfont.json +2214 -0
  109. package/components/icon/iconfont.svg +455 -0
  110. package/components/icon/iconfont.ttf +0 -0
  111. package/components/icon/iconfont.woff +0 -0
  112. package/components/icon/iconfont.woff2 +0 -0
  113. package/components/icon/index.js +7 -0
  114. package/components/image/image.vue +299 -0
  115. package/components/image/index.js +12 -0
  116. package/components/image/util.js +26 -0
  117. package/components/index.js +153 -0
  118. package/components/loading/index.js +7 -0
  119. package/components/loading/loading.vue +130 -0
  120. package/components/menu/index.js +14 -0
  121. package/components/menu/menu-group.vue +240 -0
  122. package/components/menu/menu-item.vue +215 -0
  123. package/components/menu/menu.vue +64 -0
  124. package/components/message/index.js +19 -0
  125. package/components/message/message.js +28 -0
  126. package/components/message/message.less +6 -0
  127. package/components/message-box/index.js +10 -0
  128. package/components/message-box/message-box.js +140 -0
  129. package/components/message-box/message-box.less +5 -0
  130. package/components/pagination/index.js +7 -0
  131. package/components/pagination/pagination.vue +193 -0
  132. package/components/panel/index.js +7 -0
  133. package/components/panel/panel.vue +44 -0
  134. package/components/popover/index.js +7 -0
  135. package/components/popover/popover.vue +140 -0
  136. package/components/popup-select/index.js +7 -0
  137. package/components/popup-select/popup-select.vue +114 -0
  138. package/components/radio/index.js +7 -0
  139. package/components/radio/radio.vue +92 -0
  140. package/components/radio-button/index.js +7 -0
  141. package/components/radio-button/radio-button.vue +20 -0
  142. package/components/radio-group/index.js +7 -0
  143. package/components/radio-group/radio-group.vue +22 -0
  144. package/components/searchbox/index.js +7 -0
  145. package/components/searchbox/searchbox.vue +260 -0
  146. package/components/select/index.js +9 -0
  147. package/components/select/select-load-more.vue +53 -0
  148. package/components/select/select.vue +572 -0
  149. package/components/skeleton/index.js +14 -0
  150. package/components/skeleton/skeleton-rows.vue +52 -0
  151. package/components/skeleton/skeleton.vue +72 -0
  152. package/components/sortable/index.js +9 -0
  153. package/components/sortable/sortable-item.vue +77 -0
  154. package/components/sortable/sortable.vue +62 -0
  155. package/components/spinner/index.js +7 -0
  156. package/components/spinner/spinner.vue +121 -0
  157. package/components/spinner-range/index.js +7 -0
  158. package/components/spinner-range/spinner-range.vue +97 -0
  159. package/components/spinner-textarea/index.js +7 -0
  160. package/components/spinner-textarea/spinner-textarea.vue +65 -0
  161. package/components/switch/index.js +7 -0
  162. package/components/switch/switch.vue +105 -0
  163. package/components/tabs/index.js +10 -0
  164. package/components/tabs/tabs.vue +115 -0
  165. package/components/tag/index.js +9 -0
  166. package/components/tag/tag.less +30 -0
  167. package/components/text/index.js +7 -0
  168. package/components/text/text.vue +69 -0
  169. package/components/textarea/index.js +7 -0
  170. package/components/textarea/textarea.vue +229 -0
  171. package/components/textbox/index.js +7 -0
  172. package/components/textbox/textbox.vue +275 -0
  173. package/components/time-picker/index.js +7 -0
  174. package/components/time-picker/time-picker.vue +77 -0
  175. package/components/toolbar/index.js +14 -0
  176. package/components/toolbar/toolbar-item.vue +43 -0
  177. package/components/toolbar/toolbar.vue +81 -0
  178. package/components/tooltip/index.js +9 -0
  179. package/components/tooltip/tooltip.vue +86 -0
  180. package/components/transfer/index.js +7 -0
  181. package/components/transfer/transfer-load-more.vue +53 -0
  182. package/components/transfer/transfer.vue +245 -0
  183. package/components/tree/index.js +7 -0
  184. package/components/tree/tree.vue +326 -0
  185. package/components/tree/utils.js +122 -0
  186. package/components/video/index.js +7 -0
  187. package/components/video/video.vue +53 -0
  188. package/package.json +4 -1
  189. package/utils/date.js +55 -0
  190. package/utils/emitter.js +3 -0
  191. package/utils/json.js +19 -0
  192. package/utils/resize-event.js +35 -0
  193. package/utils/util.js +12 -0
  194. package/utils/utils.js +0 -0
Binary file
Binary file
Binary file
@@ -0,0 +1,7 @@
1
+ import Icon from './icon'
2
+
3
+ Icon.install = (Vue) => {
4
+ Vue.component(Icon.name, Icon)
5
+ }
6
+
7
+ export default Icon
@@ -0,0 +1,299 @@
1
+ <template>
2
+ <div
3
+ class="ui-image"
4
+ :class="className"
5
+ :style="style"
6
+ :title="title"
7
+ >
8
+ <div class="ui-image__main" :style="mainStyle">
9
+ <img
10
+ class="ui-image__img"
11
+ :src="source"
12
+ :alt="alt"
13
+ @load="handleImageLoad"
14
+ @error="handleImageError"
15
+ :style="imageStyle"
16
+ />
17
+ <ui-icon
18
+ v-if="status === 'error'"
19
+ name="image-error-line"
20
+ :size="iconSize"
21
+ color="#aaa"
22
+ ></ui-icon>
23
+ <div class="ui-image__preview" v-if="previewable && status === 'success'" @click="handlePreviewClick">
24
+ <ui-icon name="sousuo" :size="30" color="#fff"></ui-icon>
25
+ </div>
26
+ </div>
27
+ </div>
28
+ </template>
29
+ <script>
30
+ import UiIcon from '../icon'
31
+ import { fileToBase64, getImageClickFn } from './util'
32
+
33
+ const LoadStatus = {
34
+ normal: 'normal',
35
+ loading: 'loading',
36
+ success: 'success',
37
+ error: 'error'
38
+ }
39
+ export default {
40
+ name: 'UiImage',
41
+ components: {
42
+ UiIcon
43
+ },
44
+ props: {
45
+ width: {
46
+ type: String
47
+ },
48
+ height: {
49
+ type: String
50
+ },
51
+ maxWidth: {
52
+ type: Number
53
+ },
54
+ maxHeight: {
55
+ type: Number
56
+ },
57
+ fit: {
58
+ type: String,
59
+ default: 'none',
60
+ validator (value) {
61
+ return ['fill', 'contain', 'cover', 'none', 'scale-down'].indexOf(value) >= 0
62
+ }
63
+ },
64
+ src: {
65
+ type: [String, File]
66
+ },
67
+ alt: {
68
+ type: String
69
+ },
70
+ gray: {
71
+ type: Boolean,
72
+ default: false
73
+ },
74
+ radius: {
75
+ type: Number,
76
+ default: 6
77
+ },
78
+ loading: {
79
+ type: Boolean
80
+ },
81
+ previewable: {
82
+ type: Boolean,
83
+ default: false
84
+ },
85
+ previewMethod: {
86
+ type: Function
87
+ }
88
+ },
89
+ data () {
90
+ return {
91
+ source: null,
92
+ clientWidth: 0,
93
+ status: LoadStatus.normal
94
+ }
95
+ },
96
+ computed: {
97
+ style () {
98
+ const sy = {}
99
+ if (this.width) {
100
+ sy.width = this.width
101
+ }
102
+ if (this.height) {
103
+ sy.height = this.height
104
+ }
105
+ return sy
106
+ },
107
+ mainStyle () {
108
+ const sy = {
109
+ 'border-radius': this.radius + 'px'
110
+ }
111
+ if (this.fit) {
112
+ if (this.fit === 'none') {
113
+ sy['background-color'] = '#000'
114
+ }
115
+ }
116
+ return sy
117
+ },
118
+ imageStyle () {
119
+ const sy = {}
120
+ if (this.fit) {
121
+ if (this.fit === 'none') {
122
+ sy['max-width'] = this.maxWidth ? this.maxWidth + 'px' : (this.width === 'auto' ? '' : '100%')
123
+ sy['max-height'] = this.maxHeight ? this.maxHeight + 'px' : (this.height === 'auto' ? '' : '100%')
124
+ sy.width = 'auto'
125
+ sy.height = 'auto'
126
+ } else {
127
+ sy['object-fit'] = this.fit
128
+ sy.width = '100%'
129
+ sy.height = '100%'
130
+ }
131
+ }
132
+ return sy
133
+ },
134
+ title () {
135
+ if (this.error) {
136
+ return '图片加载失败'
137
+ }
138
+ return this.alt
139
+ },
140
+ iconSize () {
141
+ return this.clientWidth / 2
142
+ },
143
+ className () {
144
+ return ['is-' + this.status, { 'is-gray': this.gray }]
145
+ }
146
+ },
147
+ watch: {
148
+ src (val) {
149
+ this.handleLoadImage()
150
+ },
151
+ loading (val) {
152
+ this.updateLoading()
153
+ }
154
+ },
155
+ created () {
156
+ this.handleLoadImage()
157
+ this.updateLoading()
158
+ },
159
+ mounted () {
160
+ this.clientWidth = this.$el.clientWidth
161
+ },
162
+ methods: {
163
+ handlePreviewClick () {
164
+ if (this.previewMethod) {
165
+ this.previewMethod()
166
+ } else {
167
+ this.preview()
168
+ }
169
+ },
170
+ handleLoadImage () {
171
+ this.resolveSrc()
172
+ },
173
+ handleImageLoad () {
174
+ this.status = LoadStatus.success
175
+ this.$emit('load')
176
+ },
177
+ handleImageError () {
178
+ this.status = LoadStatus.error
179
+ this.$emit('error')
180
+ },
181
+ preview () {
182
+ if (!this.src) {
183
+ return
184
+ }
185
+ const clickFn = getImageClickFn()
186
+ if (clickFn) {
187
+ clickFn({
188
+ src: this.src
189
+ })
190
+ }
191
+ },
192
+ resolveSrc () {
193
+ if (!this.src) {
194
+ this.status = this.loading ? LoadStatus.loading : LoadStatus.normal
195
+ this.source = null
196
+ } else {
197
+ this.status = LoadStatus.loading
198
+ if (this.src instanceof File) {
199
+ this.status = LoadStatus.loading
200
+ fileToBase64(this.src).then((rs) => {
201
+ this.source = rs
202
+ }, () => {
203
+ this.status = LoadStatus.error
204
+ })
205
+ } else {
206
+ this.source = this.src
207
+ }
208
+ }
209
+ },
210
+ updateLoading () {
211
+ if (!this.src) {
212
+ this.status = this.loading ? LoadStatus.loading : LoadStatus.normal
213
+ } else {
214
+ if (typeof this.loading === 'boolean') {
215
+ if (this.loading === true) {
216
+ this.status = LoadStatus.loading
217
+ } else {
218
+ this.status = LoadStatus.success
219
+ }
220
+ }
221
+ }
222
+ }
223
+ }
224
+ }
225
+ </script>
226
+ <style lang="less">
227
+ .ui-image{
228
+ display: inline-block;
229
+ vertical-align: top;
230
+ &.is-loading{
231
+ animation-duration: 1s;
232
+ animation-fill-mode: forwards;
233
+ animation-iteration-count: infinite;
234
+ animation-name: ui-image-loading;
235
+ animation-timing-function: linear;
236
+ background: linear-gradient(to right, #eee 8%, #ddd 18%, #eee 33%);
237
+ background-size: 800px 104px;
238
+ }
239
+ &.is-gray {
240
+ -webkit-filter: grayscale(100%);
241
+ -moz-filter: grayscale(100%);
242
+ -ms-filter: grayscale(100%);
243
+ -o-filter: grayscale(100%);
244
+ filter: grayscale(100%);
245
+ filter: gray;
246
+ }
247
+ &.is-error,&.is-normal{
248
+ background-color: #eee;
249
+ }
250
+ &.is-success{
251
+ .ui-image__img{
252
+ display: inline-block;
253
+ }
254
+ .ui-image__preview{
255
+ display: flex;
256
+ }
257
+ }
258
+ }
259
+ .ui-image__main{
260
+ display: flex;
261
+ width: 100%;
262
+ height: 100%;
263
+ flex-direction: column;
264
+ justify-content: center;
265
+ align-items: center;
266
+ overflow: hidden;
267
+ position: relative;
268
+ }
269
+ .ui-image__img{
270
+ display: none;
271
+ }
272
+
273
+ @keyframes ui-image-loading {
274
+ 0%{
275
+ background-position: -468px 0
276
+ }
277
+ 100%{
278
+ background-position: 468px 0
279
+ }
280
+ }
281
+ .ui-image__preview{
282
+ position: absolute;
283
+ left: 0;
284
+ top: 0;
285
+ width: 100%;
286
+ height: 100%;
287
+ flex-direction: column;
288
+ align-items: center;
289
+ justify-content: center;
290
+ background-color: rgba(0,0,0,.3);
291
+ opacity: 0;
292
+ transition: all .3s;
293
+ cursor: pointer;
294
+ display: none;
295
+ &:hover{
296
+ opacity: 1;
297
+ }
298
+ }
299
+ </style>
@@ -0,0 +1,12 @@
1
+ import Image from './image'
2
+ import { setImageClickFn } from './util'
3
+
4
+ Image.install = (Vue, options) => {
5
+ options = Object.assign({
6
+ imageClickFn: null
7
+ }, options)
8
+ setImageClickFn(options.imageClickFn)
9
+ Vue.component(Image.name, Image)
10
+ }
11
+
12
+ export default Image
@@ -0,0 +1,26 @@
1
+ export function fileToBase64 (file) {
2
+ return new Promise((resolve, reject) => {
3
+ if (!file) {
4
+ reject()
5
+ } else {
6
+ var reader = new FileReader()
7
+ reader.readAsDataURL(file)
8
+ reader.onload = () => {
9
+ resolve(reader.result)
10
+ }
11
+ reader.onerror = () => {
12
+ reject()
13
+ }
14
+ }
15
+ })
16
+ }
17
+
18
+ let imageClickFn = null
19
+
20
+ export function setImageClickFn (fn) {
21
+ imageClickFn = fn
22
+ }
23
+
24
+ export function getImageClickFn () {
25
+ return imageClickFn
26
+ }
@@ -0,0 +1,153 @@
1
+ import Button from './button'
2
+ import BrickWall from './brick-wall'
3
+ import AdvancedFilter from './advanced-filter'
4
+ import Autocomplete from './autocomplete'
5
+ import Dropdown from './dropdown'
6
+ import Switch from './switch'
7
+ import Icon from './icon'
8
+ import Image from './image'
9
+ import Popover from './popover'
10
+ import Toolbar from './toolbar'
11
+ import Tooltip from './tooltip'
12
+ import Text from './text'
13
+ import Menu from './menu'
14
+ import Sortable from './sortable'
15
+ import Dialog from './dialog'
16
+ import Filter from './filter'
17
+ import Grid from './grid'
18
+ import Loading from './loading'
19
+ import Pagination from './pagination'
20
+ import Form from './form'
21
+ import Textarea from './textarea'
22
+ import Textbox from './textbox'
23
+ import Message from './message'
24
+ import MessageBox from './message-box'
25
+ import Empty from './empty'
26
+ import Avatar from './avatar'
27
+ import Drawer from './drawer'
28
+ import Tabs from './tabs'
29
+ import CheckboxGroup from './checkbox-group'
30
+ import Checkbox from './checkbox'
31
+ import CheckboxButton from './checkbox-button'
32
+ import Select from './select'
33
+ import Cascader from './cascader'
34
+ import Searchbox from './searchbox'
35
+ import DatePicker from './date-picker'
36
+ import Radio from './radio'
37
+ import RadioButton from './radio-button'
38
+ import RadioGroup from './radio-group'
39
+ import Video from './video'
40
+ import Spinner from './spinner'
41
+ import SpinnerRange from './spinner-range'
42
+ import SpinnerTextarea from './spinner-textarea'
43
+ import Skeleton from './skeleton'
44
+ import TimePicker from './time-picker'
45
+ import Tag from './tag'
46
+ import Tree from './tree'
47
+ import PopupSelect from './popup-select'
48
+ import Panel from './panel'
49
+ import Transfer from './transfer'
50
+
51
+ export {
52
+ AdvancedFilter,
53
+ Autocomplete,
54
+ Avatar,
55
+ Button,
56
+ BrickWall,
57
+ Cascader,
58
+ CheckboxGroup,
59
+ Checkbox,
60
+ CheckboxButton,
61
+ DatePicker,
62
+ Drawer,
63
+ Dropdown,
64
+ Dialog,
65
+ Empty,
66
+ Filter,
67
+ Form,
68
+ Grid,
69
+ Icon,
70
+ Image,
71
+ Menu,
72
+ Message,
73
+ MessageBox,
74
+ Pagination,
75
+ Popover,
76
+ PopupSelect,
77
+ Panel,
78
+ Radio,
79
+ RadioButton,
80
+ RadioGroup,
81
+ Sortable,
82
+ Select,
83
+ Searchbox,
84
+ Spinner,
85
+ SpinnerRange,
86
+ SpinnerTextarea,
87
+ Skeleton,
88
+ Switch,
89
+ Toolbar,
90
+ Tooltip,
91
+ Text,
92
+ Loading,
93
+ Textarea,
94
+ Textbox,
95
+ Tabs,
96
+ TimePicker,
97
+ Tag,
98
+ Tree,
99
+ Transfer,
100
+ Video
101
+ }
102
+
103
+ export default {
104
+ install (Vue, options = {}) {
105
+ Vue.use(Button)
106
+ Vue.use(Dropdown)
107
+ Vue.use(Switch)
108
+ Vue.use(Icon)
109
+ Vue.use(Image)
110
+ Vue.use(Popover)
111
+ Vue.use(Toolbar)
112
+ Vue.use(Tooltip)
113
+ Vue.use(Menu)
114
+ Vue.use(Sortable)
115
+ Vue.use(Dialog)
116
+ Vue.use(Filter)
117
+ Vue.use(Grid, options.grid)
118
+ Vue.use(Loading)
119
+ Vue.use(Pagination)
120
+ Vue.use(Form)
121
+ Vue.use(Textarea)
122
+ Vue.use(Textbox)
123
+ Vue.use(Text)
124
+ Vue.use(Message)
125
+ Vue.use(MessageBox)
126
+ Vue.use(Empty)
127
+ Vue.use(Avatar)
128
+ Vue.use(Drawer)
129
+ Vue.use(Tabs)
130
+ Vue.use(CheckboxGroup)
131
+ Vue.use(Checkbox)
132
+ Vue.use(CheckboxButton)
133
+ Vue.use(Select)
134
+ Vue.use(Cascader)
135
+ Vue.use(Searchbox)
136
+ Vue.use(DatePicker)
137
+ Vue.use(Radio)
138
+ Vue.use(RadioButton)
139
+ Vue.use(RadioGroup)
140
+ Vue.use(Video)
141
+ Vue.use(Spinner)
142
+ Vue.use(TimePicker)
143
+ Vue.use(Autocomplete)
144
+ Vue.use(Tag)
145
+ Vue.use(SpinnerRange)
146
+ Vue.use(SpinnerTextarea)
147
+ Vue.use(PopupSelect)
148
+ Vue.use(Panel)
149
+ Vue.use(Transfer)
150
+ Vue.use(Tree)
151
+ Vue.use(Skeleton)
152
+ }
153
+ }
@@ -0,0 +1,7 @@
1
+ import Loading from './loading'
2
+
3
+ Loading.install = (Vue) => {
4
+ Vue.component(Loading.name, Loading)
5
+ }
6
+
7
+ export default Loading
@@ -0,0 +1,130 @@
1
+ <template>
2
+ <div class="ui-loading" :class="['ui-loading--' + size, 'ui-loading--' + type, 'is-' + dir]">
3
+ <span class="ui-loading__icon"></span>
4
+ <span class="ui-loading__text" v-if="$slots.default || text">
5
+ <slot>{{ text }}</slot>
6
+ </span>
7
+ </div>
8
+ </template>
9
+ <script>
10
+ export default {
11
+ name: 'UiLoading',
12
+ props: {
13
+ type: {
14
+ type: String,
15
+ default: 'default',
16
+ validator(value) {
17
+ return ['default', 'primary', 'success', 'warning', 'danger', 'info'].includes(value)
18
+ }
19
+ },
20
+ dir: {
21
+ type: String,
22
+ default: 'horizon',
23
+ validator (value) {
24
+ return ['horizon', 'vertical'].includes(value)
25
+ }
26
+ },
27
+ text: {
28
+ type: String
29
+ },
30
+ size: {
31
+ type: String,
32
+ default: 'small',
33
+ validator(value) {
34
+ return ['small', 'mini', 'medium'].includes(value)
35
+ }
36
+ }
37
+ }
38
+ }
39
+ </script>
40
+ <style lang="less">
41
+ .ui-loading{
42
+ &.is-horizon{
43
+ display: flex;
44
+ flex-direction: row;
45
+ align-items: center;
46
+ .ui-loading__text{
47
+ margin-left: 6px;
48
+ }
49
+ }
50
+ &.is-vertical{
51
+ display: flex;
52
+ flex-direction: column;
53
+ align-items: center;
54
+ justify-content: center;
55
+ .ui-loading__text{
56
+ margin-top: 6px;
57
+ }
58
+ }
59
+ }
60
+ .ui-loading__text{
61
+ color: rgba(0,0,0,.5);
62
+ }
63
+ .ui-loading--medium {
64
+ .ui-loading__icon{
65
+ width: 24px;
66
+ height: 24px;
67
+ border-width: 6px;
68
+ }
69
+ }
70
+ .ui-loading--small {
71
+ .ui-loading__icon{
72
+ width: 20px;
73
+ height: 20px;
74
+ border-width: 3px;
75
+ }
76
+ }
77
+ .ui-loading--mini {
78
+ .ui-loading__icon{
79
+ width: 12px;
80
+ height: 12px;
81
+ border-width: 2px;
82
+ }
83
+ }
84
+ .ui-loading--default {
85
+ .ui-loading__icon{
86
+ border-color: #999;
87
+ }
88
+ }
89
+ .ui-loading--primary {
90
+ .ui-loading__icon{
91
+ border-color: #5f9efa;
92
+ }
93
+ }
94
+ .ui-loading--success {
95
+ .ui-loading__icon{
96
+ border-color: #7ebf4a;
97
+ }
98
+ }
99
+ .ui-loading--info {
100
+ .ui-loading__icon{
101
+ border-color: #999;
102
+ }
103
+ }
104
+ .ui-loading--warning {
105
+ .ui-loading__icon{
106
+ border-color: #dba54a;
107
+ }
108
+ }
109
+ .ui-loading--danger {
110
+ .ui-loading__icon{
111
+ border-color: #e3756f;
112
+ }
113
+ }
114
+ .ui-loading__icon{
115
+ display: inline-block;
116
+ border-style: solid;
117
+ border-color: #999;
118
+ border-radius: 50%;
119
+ border-right-color: transparent!important;
120
+ animation: rotating .7s linear infinite;
121
+ }
122
+ @keyframes rotating{
123
+ 0% {
124
+ transform: rotate(0);
125
+ }
126
+ 100% {
127
+ transform: rotate(1turn);
128
+ }
129
+ }
130
+ </style>
@@ -0,0 +1,14 @@
1
+ import Menu from './menu'
2
+ import MenuGroup from './menu-group'
3
+ import MenuItem from './menu-item'
4
+
5
+ export default {
6
+ Menu,
7
+ MenuGroup,
8
+ MenuItem,
9
+ install (Vue) {
10
+ Vue.component(Menu.name, Menu)
11
+ Vue.component(MenuGroup.name, MenuGroup)
12
+ Vue.component(MenuItem.name, MenuItem)
13
+ }
14
+ }