@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
@@ -0,0 +1,537 @@
1
+ <template>
2
+ <el-button
3
+ :type="type"
4
+ :disabled="disabled || innerLoading"
5
+ :size="size"
6
+ :circle="circle"
7
+ :native-type="nativeType"
8
+ class="ui-button"
9
+ :class="{'is-block': block, 'is-plain': plain, 'is-icon-btn': isIconBtn, 'is-link': link, 'is-active': active, 'has-text': hasText, 'has-icon': hasIcon}"
10
+ @click="handleClick"
11
+ >
12
+ <div class="ui-button__inner">
13
+ <ui-icon v-if="innerLoading" class="ui-button__icon ui-button__loading" name="loading"></ui-icon>
14
+ <span class="ui-button__icon" v-else-if="icon || $slots.icon">
15
+ <slot name="icon">
16
+ <ui-icon :name="icon"></ui-icon>
17
+ </slot>
18
+ </span>
19
+ <template v-if="$slots.default">
20
+ <span class="ui-button__text" v-if="innerLoading && loadingText">
21
+ {{loadingText}}
22
+ </span>
23
+ <span class="ui-button__text" :class="{'is-text-overflow': textOverflow}" v-else>
24
+ <slot></slot>
25
+ </span>
26
+ </template>
27
+ </div>
28
+ </el-button>
29
+ </template>
30
+ <script>
31
+ import { Button } from 'element-ui'
32
+ import UiIcon from '../icon'
33
+ import 'element-ui/lib/theme-chalk/button.css'
34
+ import { getClosestPopup } from './utils'
35
+
36
+ export default {
37
+ name: 'UiButton',
38
+ inject: {
39
+ UiDialog: {
40
+ default: null
41
+ },
42
+ UiDrawer: {
43
+ default: null
44
+ },
45
+ UiToolbar: {
46
+ default: null
47
+ }
48
+ },
49
+ components: {
50
+ UiIcon,
51
+ ElButton: Button
52
+ },
53
+ props: {
54
+ block: {
55
+ type: Boolean,
56
+ default: false
57
+ },
58
+ link: {
59
+ type: Boolean,
60
+ default: false
61
+ },
62
+ active: {
63
+ type: Boolean,
64
+ default: false
65
+ },
66
+ plain: {
67
+ type: Boolean,
68
+ default: false
69
+ },
70
+ circle: {
71
+ type: Boolean,
72
+ default: false
73
+ },
74
+ textOverflow: {
75
+ type: Boolean,
76
+ default: false
77
+ },
78
+ size: {
79
+ type: String,
80
+ default: 'small'
81
+ },
82
+ icon: {
83
+ type: String
84
+ },
85
+ type: {
86
+ type: String,
87
+ default: 'default'
88
+ },
89
+ nativeType: {
90
+ type: String,
91
+ default: 'button'
92
+ },
93
+ disabled: {
94
+ type: Boolean
95
+ },
96
+ loading: {
97
+ type: Boolean
98
+ },
99
+ loadingText: {
100
+ type: String
101
+ },
102
+ click: {
103
+ type: Function
104
+ }
105
+ },
106
+ data () {
107
+ return {
108
+ innerLoading: this.loading
109
+ }
110
+ },
111
+ computed: {
112
+ isIconBtn () {
113
+ return !this.$slots.default && this.icon
114
+ },
115
+ hasIcon () {
116
+ return this.$slots.icon || this.icon
117
+ },
118
+ hasText () {
119
+ return !!this.$slots.default
120
+ }
121
+ },
122
+ watch: {
123
+ loading (val) {
124
+ this.innerLoading = val
125
+ }
126
+ },
127
+ methods: {
128
+ closeDialog () {
129
+ if (this.$parent.$options.name === 'UiToolbarItem') {
130
+ const popup = getClosestPopup(this)
131
+ if (popup && this.UiToolbar && this.UiToolbar.closeDialog) {
132
+ popup.close()
133
+ }
134
+ }
135
+ },
136
+ handleClick (evt) {
137
+ if (this.innerLoading) {
138
+ return
139
+ }
140
+ clearTimeout(this._loadingTimer)
141
+ if (typeof this.click === 'function') {
142
+ const rs = this.click({
143
+ closeDialog: () => {
144
+ const popup = getClosestPopup(this)
145
+ if (popup) {
146
+ popup.close()
147
+ }
148
+ }
149
+ })
150
+ if (rs && rs.then) {
151
+ this.innerLoading = true
152
+ rs.then(() => {
153
+ this.closeDialog()
154
+ this._loadingTimer = setTimeout(() => {
155
+ this.innerLoading = false
156
+ }, 300)
157
+ }, err => {
158
+ this.innerLoading = false
159
+ throw new Error(err)
160
+ })
161
+ } else {
162
+ if (rs !== false) {
163
+ this.closeDialog()
164
+ }
165
+ }
166
+ } else {
167
+ this.closeDialog()
168
+ }
169
+ this.$emit('click', evt)
170
+ }
171
+ },
172
+ beforeDestroy () {
173
+ clearTimeout(this._loadingTimer)
174
+ }
175
+ }
176
+ </script>
177
+ <style lang="less">
178
+ @button-primary-color: #0052CC;
179
+ @button-default-color: #f8f9fa;
180
+ @button-danger-color: #f36d6f;
181
+ @button-warning-color: #F1A600;
182
+ @button-success-color: #10AA52;
183
+
184
+ .ui-button.el-button{
185
+ cursor: pointer;
186
+ line-height: 18px;
187
+ box-sizing: border-box;
188
+ max-width: 100%;
189
+ white-space: nowrap;
190
+ overflow: hidden;
191
+ text-overflow: ellipsis;
192
+ &.is-block{
193
+ width: 100%;
194
+ box-sizing: border-box;
195
+ }
196
+ &.is-plain{
197
+ background-color: transparent;
198
+ border-color: transparent;
199
+ }
200
+ &.is-icon-btn{
201
+ min-width: auto;
202
+ padding: 0 9px;
203
+ }
204
+ &.has-text{
205
+ .ui-button__loading{
206
+ margin-right: 2px;
207
+ }
208
+ }
209
+ &.has-icon{
210
+ padding-left: 7px;
211
+ }
212
+ &.is-link {
213
+ height: auto;
214
+ .ui-button__inner{
215
+ > span{
216
+ &:not(.ui-button__icon) {
217
+ display: inline;
218
+ white-space: nowrap;
219
+ overflow: hidden;
220
+ text-overflow: ellipsis;
221
+ }
222
+ }
223
+ }
224
+ }
225
+ }
226
+ .ui-button__inner{
227
+ display: flex;
228
+ flex-direction: row;
229
+ align-items: center;
230
+ justify-content: center;
231
+ max-width: 100%;
232
+ > span{
233
+ &:not(.ui-button__icon) {
234
+ max-width: 100%;
235
+ display: flex;
236
+ flex-direction: row;
237
+ align-items: center;
238
+ justify-content: center;
239
+ }
240
+ }
241
+ }
242
+ .ui-button__icon{
243
+ display: inline-block;
244
+ vertical-align: top;
245
+ height: 18px;
246
+ line-height: 18px;
247
+ text-align: center;
248
+ & + .ui-button__text{
249
+ margin-left: 4px;
250
+ }
251
+ }
252
+ .ui-button__text{
253
+ line-height: 1em;
254
+ &.is-text-overflow {
255
+ display: inline-block !important;
256
+ white-space: nowrap;
257
+ overflow: hidden;
258
+ text-overflow: ellipsis;
259
+ max-width: 100%;
260
+ }
261
+ }
262
+ .ui-button.el-button--mini{
263
+ font-size: 12px;
264
+ height: 26px;
265
+ line-height: 24px;
266
+ padding-top: 0;
267
+ padding-bottom: 0;
268
+ padding-left: 8px;
269
+ padding-right: 8px;
270
+ &.is-plain{
271
+ min-width: auto;
272
+ padding-left: 4px;
273
+ padding-right: 4px;
274
+ }
275
+
276
+ .ui-button__icon {
277
+ height: 16px;
278
+ vertical-align: top;
279
+ margin-top: -2px;
280
+ margin-right: -2px;
281
+ }
282
+ }
283
+ body .el-button--small{
284
+ font-size: 14px;
285
+ height: 32px;
286
+ padding-top: 0;
287
+ padding-bottom: 0;
288
+ padding-left: 12px;
289
+ padding-right: 12px;
290
+ min-width: 60px;
291
+ &.is-plain, &.is-link{
292
+ min-width: auto;
293
+ padding-left: 6px;
294
+ padding-right: 6px;
295
+ }
296
+ }
297
+ body .el-button--medium{
298
+ height: 36px;
299
+ padding-top: 0;
300
+ padding-bottom: 0;
301
+ &.is-plain{
302
+ min-width: auto;
303
+ padding-left: 8px;
304
+ padding-right: 8px;
305
+ }
306
+ }
307
+ .ui-button.el-button{
308
+ transition: all .15s ease-in-out;
309
+ font-weight: normal;
310
+ &.el-button--text{
311
+ color: #333;
312
+ min-width: auto;
313
+ }
314
+ &.el-button--primary{
315
+ &.is-plain{
316
+ color: @button-primary-color;
317
+ background-color: transparent;
318
+ border-color: transparent;
319
+ &:hover{
320
+ color: darken(@button-primary-color, 5%);
321
+ background-color: transparent;
322
+ border-color: transparent;
323
+ }
324
+ &.is-disabled{
325
+ color: @button-primary-color;
326
+ opacity: .5;
327
+ }
328
+ }
329
+ &.is-link {
330
+ color: @button-primary-color;
331
+ padding-left: 1px;
332
+ padding-right: 1px;
333
+ background-color: transparent;
334
+ }
335
+ &:not(.is-plain) {
336
+ &:not(.is-link) {
337
+ background-color: @button-primary-color;
338
+ border-color: @button-primary-color;
339
+ &:hover{
340
+ background-color: darken(@button-primary-color, 5%);
341
+ border-color: darken(@button-primary-color, 5%);
342
+ }
343
+ &:focus:not(.is-disabled){
344
+ border-color: @button-primary-color;
345
+ box-shadow: 0 0 0 0.2rem fade(@button-primary-color, 25%);
346
+ }
347
+ &.is-disabled{
348
+ background-color: @button-primary-color;
349
+ border-color: @button-primary-color;
350
+ opacity: .4;
351
+ }
352
+ }
353
+ }
354
+ }
355
+ &.el-button--danger{
356
+ &.is-plain{
357
+ color: @button-danger-color;
358
+ background-color: transparent;
359
+ border-color: transparent;
360
+ &:hover{
361
+ color: darken(@button-danger-color, 5%);
362
+ background-color: transparent;
363
+ border-color: transparent;
364
+ }
365
+ }
366
+ &.is-link {
367
+ color: @button-danger-color;
368
+ padding-left: 1px;
369
+ padding-right: 1px;
370
+ background-color: transparent;
371
+ }
372
+ &:not(.is-plain) {
373
+ &:not(.is-link) {
374
+ background-color: @button-danger-color;
375
+ border-color: @button-danger-color;
376
+ &:hover{
377
+ background-color: darken(@button-danger-color, 5%);
378
+ border-color: darken(@button-danger-color, 5%);
379
+ }
380
+ &:focus:not(.is-disabled){
381
+ border-color: @button-danger-color;
382
+ box-shadow: 0 0 0 0.2rem fade(@button-danger-color, 25%);
383
+ }
384
+ &.is-disabled{
385
+ background-color: @button-danger-color;
386
+ border-color: @button-danger-color;
387
+ opacity: .4;
388
+ }
389
+ }
390
+ }
391
+ }
392
+ &.el-button--warning{
393
+ &.is-plain{
394
+ color: @button-warning-color;
395
+ background-color: transparent;
396
+ border-color: transparent;
397
+ &:hover{
398
+ color: darken(@button-warning-color, 5%);
399
+ background-color: transparent;
400
+ border-color: transparent;
401
+ }
402
+ }
403
+ &.is-link {
404
+ color: @button-warning-color;
405
+ padding-left: 1px;
406
+ padding-right: 1px;
407
+ background-color: transparent;
408
+ }
409
+ &:not(.is-plain) {
410
+ &:not(.is-link) {
411
+ background-color: @button-warning-color;
412
+ border-color: @button-warning-color;
413
+ &:hover{
414
+ background-color: darken(@button-warning-color, 5%);
415
+ border-color: darken(@button-warning-color, 5%);
416
+ }
417
+ &:focus:not(.is-disabled){
418
+ border-color: @button-warning-color;
419
+ box-shadow: 0 0 0 0.2rem fade(@button-warning-color, 25%);
420
+ }
421
+ &.is-disabled{
422
+ background-color: @button-warning-color;
423
+ border-color: @button-warning-color;
424
+ opacity: .4;
425
+ }
426
+ }
427
+ }
428
+ }
429
+ &.el-button--success{
430
+ &.is-plain{
431
+ color: @button-success-color;
432
+ background-color: transparent;
433
+ border-color: transparent;
434
+ &:hover{
435
+ color: darken(@button-success-color, 5%);
436
+ background-color: transparent;
437
+ border-color: transparent;
438
+ }
439
+ }
440
+ &.is-link {
441
+ color: @button-warning-color;
442
+ padding-left: 1px;
443
+ padding-right: 1px;
444
+ background-color: transparent;
445
+ }
446
+ &:not(.is-plain) {
447
+ &:not(.is-link) {
448
+ background-color: @button-success-color;
449
+ border-color: @button-success-color;
450
+ &:hover{
451
+ background-color: darken(@button-success-color, 5%);
452
+ border-color: darken(@button-success-color, 5%);
453
+ }
454
+ &:focus:not(.is-disabled){
455
+ border-color: @button-success-color;
456
+ box-shadow: 0 0 0 0.2rem fade(@button-success-color, 25%);
457
+ }
458
+ &.is-disabled{
459
+ background-color: @button-success-color;
460
+ border-color: @button-success-color;
461
+ opacity: .4;
462
+ }
463
+ }
464
+ }
465
+ }
466
+ &.el-button--default {
467
+ &.is-plain{
468
+ &:not(.is-disabled){
469
+ &:hover{
470
+ color: #404040;
471
+ background-color: rgba(0,0,0,.1);
472
+ border-color: transparent;
473
+ }
474
+ &:focus{
475
+ background-color: rgba(0,0,0,.1);
476
+ border-color: transparent;
477
+ color: #404040;
478
+ }
479
+ }
480
+ &.is-disabled{
481
+ color: #c0c4cc;
482
+ border-color: transparent;
483
+ background-color: transparent;
484
+ }
485
+ }
486
+ &.is-link {
487
+ color: @button-primary-color;
488
+ padding-left: 1px;
489
+ padding-right: 1px;
490
+ background-color: transparent;
491
+ }
492
+ &:not(.is-plain) {
493
+ &:not(.is-link) {
494
+ &:hover{
495
+ &:not(.is-disabled){
496
+ color: @button-primary-color;
497
+ border-color: @button-primary-color;
498
+ background-color: transparent;
499
+ }
500
+ }
501
+ &:focus{
502
+ color: @button-primary-color;
503
+ background-color: transparent;
504
+ border-color: @button-primary-color;
505
+ box-shadow: 0 0 0 0.2rem rgba(26, 162, 232,.25);
506
+ }
507
+ &.is-disabled{
508
+ color: #c0c4cc;
509
+ border-color: #ebeef5;
510
+ }
511
+ }
512
+ }
513
+ }
514
+
515
+ &.el-button--link {
516
+ border-color: transparent;
517
+ background-color: transparent;
518
+ display: inline;
519
+ padding-left: 0;
520
+ padding-right: 0;
521
+ min-width: 0;
522
+ height: auto;
523
+ line-height: inherit;
524
+ color: #0052cc;
525
+ vertical-align: baseline;
526
+ &:hover,&:focus{
527
+ border-color: transparent;
528
+ }
529
+ &.is-disabled{
530
+ color: #C0C4CC;
531
+ border-color: transparent;
532
+ background-color: transparent;
533
+ }
534
+ }
535
+ }
536
+
537
+ </style>
@@ -0,0 +1,7 @@
1
+ import Button from './button.vue'
2
+
3
+ Button.install = (Vue) => {
4
+ Vue.component(Button.name, Button)
5
+ }
6
+
7
+ export default Button
@@ -0,0 +1,20 @@
1
+ /**
2
+ * 获取最近的一个弹框组件
3
+ * 包括对话框的测滑
4
+ */
5
+ export function getClosestPopup (vm) {
6
+ if (!vm) {
7
+ return
8
+ }
9
+ const popups = ['UiDialog', 'UiDrawer']
10
+ let popup
11
+ let target = vm
12
+ while (!popup && target) {
13
+ if (target && popups.includes(target.$options.name)) {
14
+ popup = target
15
+ } else {
16
+ target = target.$parent
17
+ }
18
+ }
19
+ return popup
20
+ }