mazey-element-ui 2.0.1 → 2.15.16
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.
- package/LICENSE +2 -2
- package/README.md +71 -68
- package/lib/alert.js +271 -262
- package/lib/aside.js +134 -200
- package/lib/autocomplete.js +500 -443
- package/lib/avatar.js +284 -0
- package/lib/backtop.js +336 -0
- package/lib/badge.js +188 -221
- package/lib/breadcrumb-item.js +176 -226
- package/lib/breadcrumb.js +150 -213
- package/lib/button-group.js +121 -190
- package/lib/button.js +213 -268
- package/lib/calendar.js +801 -0
- package/lib/card.js +156 -203
- package/lib/carousel-item.js +242 -264
- package/lib/carousel.js +386 -284
- package/lib/cascader-panel.js +1323 -0
- package/lib/cascader.js +1000 -1116
- package/lib/checkbox-button.js +388 -327
- package/lib/checkbox-group.js +168 -233
- package/lib/checkbox.js +422 -350
- package/lib/col.js +58 -112
- package/lib/collapse-item.js +335 -327
- package/lib/collapse.js +177 -246
- package/lib/color-picker.js +1128 -1231
- package/lib/container.js +144 -211
- package/lib/date-picker.js +4316 -2745
- package/lib/descriptions-item.js +88 -0
- package/lib/descriptions.js +342 -0
- package/lib/dialog.js +359 -337
- package/lib/directives/mousewheel.js +6 -12
- package/lib/directives/repeat-click.js +10 -10
- package/lib/divider.js +251 -0
- package/lib/drawer.js +523 -0
- package/lib/dropdown-item.js +175 -228
- package/lib/dropdown-menu.js +203 -253
- package/lib/dropdown.js +286 -384
- package/lib/element-ui.common.js +34136 -25458
- package/lib/empty.js +657 -0
- package/lib/footer.js +134 -200
- package/lib/form-item.js +401 -304
- package/lib/form.js +278 -297
- package/lib/header.js +134 -200
- package/lib/icon.js +123 -193
- package/lib/image.js +1005 -0
- package/lib/index.js +1 -1
- package/lib/infinite-scroll.js +219 -0
- package/lib/input-number.js +442 -386
- package/lib/input.js +682 -512
- package/lib/link.js +267 -0
- package/lib/loading.js +278 -377
- package/lib/locale/format.js +14 -25
- package/lib/locale/index.js +19 -33
- package/lib/locale/lang/af-ZA.js +29 -8
- package/lib/locale/lang/ar.js +29 -14
- package/lib/locale/lang/az.js +127 -0
- package/lib/locale/lang/bg.js +35 -11
- package/lib/locale/lang/bn.js +126 -0
- package/lib/locale/lang/ca.js +24 -9
- package/lib/locale/lang/cs-CZ.js +19 -3
- package/lib/locale/lang/da.js +19 -3
- package/lib/locale/lang/de.js +19 -3
- package/lib/locale/lang/ee.js +24 -8
- package/lib/locale/lang/el.js +20 -4
- package/lib/locale/lang/en.js +25 -7
- package/lib/locale/lang/eo.js +128 -0
- package/lib/locale/lang/es.js +22 -7
- package/lib/locale/lang/eu.js +131 -0
- package/lib/locale/lang/fa.js +24 -8
- package/lib/locale/lang/fi.js +40 -24
- package/lib/locale/lang/fr.js +21 -4
- package/lib/locale/lang/he.js +29 -8
- package/lib/locale/lang/hr.js +131 -0
- package/lib/locale/lang/hu.js +20 -4
- package/lib/locale/lang/hy-AM.js +128 -0
- package/lib/locale/lang/id.js +23 -8
- package/lib/locale/lang/is.js +127 -0
- package/lib/locale/lang/it.js +21 -6
- package/lib/locale/lang/ja.js +19 -3
- package/lib/locale/lang/kg.js +128 -0
- package/lib/locale/lang/km.js +21 -6
- package/lib/locale/lang/ko.js +19 -3
- package/lib/locale/lang/ku.js +19 -3
- package/lib/locale/lang/kz.js +19 -3
- package/lib/locale/lang/lt.js +19 -3
- package/lib/locale/lang/lv.js +26 -10
- package/lib/locale/lang/mn.js +19 -3
- package/lib/locale/lang/ms.js +126 -0
- package/lib/locale/lang/nb-NO.js +28 -13
- package/lib/locale/lang/nl.js +19 -3
- package/lib/locale/lang/pl.js +19 -3
- package/lib/locale/lang/pt-br.js +18 -3
- package/lib/locale/lang/pt.js +35 -11
- package/lib/locale/lang/ro.js +19 -3
- package/lib/locale/lang/ru-RU.js +20 -5
- package/lib/locale/lang/si.js +130 -0
- package/lib/locale/lang/sk.js +23 -8
- package/lib/locale/lang/sl.js +26 -10
- package/lib/locale/lang/sr-Latn.js +127 -0
- package/lib/locale/lang/sr.js +131 -0
- package/lib/locale/lang/sv-SE.js +34 -15
- package/lib/locale/lang/sw.js +130 -0
- package/lib/locale/lang/ta.js +31 -9
- package/lib/locale/lang/th.js +30 -12
- package/lib/locale/lang/tk.js +27 -7
- package/lib/locale/lang/tr-TR.js +20 -4
- package/lib/locale/lang/ua.js +20 -5
- package/lib/locale/lang/ug-CN.js +22 -7
- package/lib/locale/lang/uz-UZ.js +127 -0
- package/lib/locale/lang/vi.js +23 -8
- package/lib/locale/lang/zh-CN.js +18 -3
- package/lib/locale/lang/zh-TW.js +25 -6
- package/lib/main.js +123 -192
- package/lib/menu-item-group.js +164 -225
- package/lib/menu-item.js +300 -333
- package/lib/menu.js +401 -576
- package/lib/message-box.js +730 -614
- package/lib/message.js +289 -327
- package/lib/mixins/emitter.js +2 -4
- package/lib/mixins/focus.js +3 -4
- package/lib/mixins/locale.js +5 -7
- package/lib/mixins/migrating.js +19 -21
- package/lib/notification.js +366 -394
- package/lib/option-group.js +198 -250
- package/lib/option.js +247 -291
- package/lib/page-header.js +248 -0
- package/lib/pagination.js +485 -635
- package/lib/popconfirm.js +381 -0
- package/lib/popover.js +361 -396
- package/lib/progress.js +387 -261
- package/lib/radio-button.js +319 -309
- package/lib/radio-group.js +224 -282
- package/lib/radio.js +347 -328
- package/lib/rate.js +286 -305
- package/lib/result.js +513 -0
- package/lib/row.js +59 -110
- package/lib/scrollbar.js +234 -344
- package/lib/select.js +1041 -806
- package/lib/skeleton-item.js +278 -0
- package/lib/skeleton.js +308 -0
- package/lib/slider.js +608 -467
- package/lib/spinner.js +160 -207
- package/lib/statistic.js +462 -0
- package/lib/step.js +270 -262
- package/lib/steps.js +198 -261
- package/lib/submenu.js +318 -420
- package/lib/switch.js +311 -281
- package/lib/tab-pane.js +185 -245
- package/lib/table-column.js +667 -414
- package/lib/table.js +3388 -2770
- package/lib/tabs.js +577 -648
- package/lib/tag.js +160 -227
- package/lib/theme-chalk/alert.css +1 -1
- package/lib/theme-chalk/aside.css +1 -1
- package/lib/theme-chalk/autocomplete.css +1 -1
- package/lib/theme-chalk/avatar.css +1 -0
- package/lib/theme-chalk/backtop.css +1 -0
- package/lib/theme-chalk/badge.css +1 -1
- package/lib/theme-chalk/base.css +1 -1
- package/lib/theme-chalk/breadcrumb.css +1 -1
- package/lib/theme-chalk/button.css +1 -1
- package/lib/theme-chalk/calendar.css +1 -0
- package/lib/theme-chalk/card.css +1 -1
- package/lib/theme-chalk/carousel-item.css +1 -1
- package/lib/theme-chalk/carousel.css +1 -1
- package/lib/theme-chalk/cascader-panel.css +1 -0
- package/lib/theme-chalk/cascader.css +1 -1
- package/lib/theme-chalk/checkbox.css +1 -1
- package/lib/theme-chalk/col.css +1 -1
- package/lib/theme-chalk/collapse.css +1 -1
- package/lib/theme-chalk/color-picker.css +1 -1
- package/lib/theme-chalk/container.css +1 -1
- package/lib/theme-chalk/date-picker.css +1 -1
- package/lib/theme-chalk/descriptions-item.css +1 -0
- package/lib/theme-chalk/descriptions.css +1 -0
- package/lib/theme-chalk/dialog.css +1 -1
- package/lib/theme-chalk/display.css +1 -1
- package/lib/theme-chalk/divider.css +1 -0
- package/lib/theme-chalk/drawer.css +1 -0
- package/lib/theme-chalk/dropdown.css +1 -1
- package/lib/theme-chalk/empty.css +1 -0
- package/lib/theme-chalk/fonts/element-icons.ttf +0 -0
- package/lib/theme-chalk/fonts/element-icons.woff +0 -0
- package/lib/theme-chalk/footer.css +1 -1
- package/lib/theme-chalk/form.css +1 -1
- package/lib/theme-chalk/header.css +1 -1
- package/lib/theme-chalk/icon.css +1 -1
- package/lib/theme-chalk/image.css +1 -0
- package/lib/theme-chalk/index.css +1 -1
- package/lib/theme-chalk/input-number.css +1 -1
- package/lib/theme-chalk/input.css +1 -1
- package/lib/theme-chalk/link.css +1 -0
- package/lib/theme-chalk/loading.css +1 -1
- package/lib/theme-chalk/main.css +1 -1
- package/lib/theme-chalk/menu.css +1 -1
- package/lib/theme-chalk/message-box.css +1 -1
- package/lib/theme-chalk/message.css +1 -1
- package/lib/theme-chalk/notification.css +1 -1
- package/lib/theme-chalk/option-group.css +1 -1
- package/lib/theme-chalk/option.css +1 -1
- package/lib/theme-chalk/page-header.css +1 -0
- package/lib/theme-chalk/pagination.css +1 -1
- package/lib/theme-chalk/popconfirm.css +1 -0
- package/lib/theme-chalk/popover.css +1 -1
- package/lib/theme-chalk/popper.css +1 -1
- package/lib/theme-chalk/progress.css +1 -1
- package/lib/theme-chalk/radio-button.css +1 -1
- package/lib/theme-chalk/radio.css +1 -1
- package/lib/theme-chalk/rate.css +1 -1
- package/lib/theme-chalk/reset.css +1 -1
- package/lib/theme-chalk/result.css +1 -0
- package/lib/theme-chalk/row.css +1 -1
- package/lib/theme-chalk/scrollbar.css +1 -1
- package/lib/theme-chalk/select-dropdown.css +1 -1
- package/lib/theme-chalk/select.css +1 -1
- package/lib/theme-chalk/skeleton-item.css +1 -0
- package/lib/theme-chalk/skeleton.css +1 -0
- package/lib/theme-chalk/slider.css +1 -1
- package/lib/theme-chalk/spinner.css +1 -1
- package/lib/theme-chalk/statistic.css +1 -0
- package/lib/theme-chalk/step.css +1 -1
- package/lib/theme-chalk/steps.css +1 -1
- package/lib/theme-chalk/switch.css +1 -1
- package/lib/theme-chalk/table-column.css +1 -1
- package/lib/theme-chalk/table.css +1 -1
- package/lib/theme-chalk/tabs.css +1 -1
- package/lib/theme-chalk/tag.css +1 -1
- package/lib/theme-chalk/time-picker.css +1 -1
- package/lib/theme-chalk/time-select.css +1 -1
- package/lib/theme-chalk/timeline-item.css +1 -0
- package/lib/theme-chalk/timeline.css +1 -0
- package/lib/theme-chalk/tooltip.css +1 -1
- package/lib/theme-chalk/transfer.css +1 -1
- package/lib/theme-chalk/tree.css +1 -1
- package/lib/theme-chalk/upload.css +1 -1
- package/lib/time-picker.js +1548 -1348
- package/lib/time-select.js +633 -853
- package/lib/timeline-item.js +301 -0
- package/lib/timeline.js +207 -0
- package/lib/tooltip.js +166 -240
- package/lib/transfer.js +731 -639
- package/lib/transitions/collapse-transition.js +13 -31
- package/lib/tree.js +1769 -1883
- package/lib/umd/locale/af-ZA.js +35 -14
- package/lib/umd/locale/ar.js +35 -20
- package/lib/umd/locale/az.js +143 -0
- package/lib/umd/locale/bg.js +41 -17
- package/lib/umd/locale/bn.js +142 -0
- package/lib/umd/locale/ca.js +30 -15
- package/lib/umd/locale/cs-CZ.js +25 -9
- package/lib/umd/locale/da.js +25 -9
- package/lib/umd/locale/de.js +25 -9
- package/lib/umd/locale/ee.js +30 -14
- package/lib/umd/locale/el.js +26 -10
- package/lib/umd/locale/en.js +31 -13
- package/lib/umd/locale/eo.js +144 -0
- package/lib/umd/locale/es.js +28 -13
- package/lib/umd/locale/eu.js +147 -0
- package/lib/umd/locale/fa.js +30 -14
- package/lib/umd/locale/fi.js +46 -30
- package/lib/umd/locale/fr.js +27 -10
- package/lib/umd/locale/he.js +35 -14
- package/lib/umd/locale/hr.js +147 -0
- package/lib/umd/locale/hu.js +26 -10
- package/lib/umd/locale/hy-AM.js +144 -0
- package/lib/umd/locale/id.js +29 -14
- package/lib/umd/locale/is.js +143 -0
- package/lib/umd/locale/it.js +27 -12
- package/lib/umd/locale/ja.js +25 -9
- package/lib/umd/locale/kg.js +144 -0
- package/lib/umd/locale/km.js +27 -12
- package/lib/umd/locale/ko.js +25 -9
- package/lib/umd/locale/ku.js +25 -9
- package/lib/umd/locale/kz.js +25 -9
- package/lib/umd/locale/lt.js +25 -9
- package/lib/umd/locale/lv.js +32 -16
- package/lib/umd/locale/mn.js +25 -9
- package/lib/umd/locale/ms.js +142 -0
- package/lib/umd/locale/nb-NO.js +34 -19
- package/lib/umd/locale/nl.js +25 -9
- package/lib/umd/locale/pl.js +25 -9
- package/lib/umd/locale/pt-br.js +24 -9
- package/lib/umd/locale/pt.js +41 -17
- package/lib/umd/locale/ro.js +25 -9
- package/lib/umd/locale/ru-RU.js +26 -11
- package/lib/umd/locale/si.js +146 -0
- package/lib/umd/locale/sk.js +29 -14
- package/lib/umd/locale/sl.js +32 -16
- package/lib/umd/locale/sr-Latn.js +143 -0
- package/lib/umd/locale/sr.js +147 -0
- package/lib/umd/locale/sv-SE.js +40 -21
- package/lib/umd/locale/sw.js +146 -0
- package/lib/umd/locale/ta.js +37 -15
- package/lib/umd/locale/th.js +36 -18
- package/lib/umd/locale/tk.js +33 -13
- package/lib/umd/locale/tr-TR.js +26 -10
- package/lib/umd/locale/ua.js +26 -11
- package/lib/umd/locale/ug-CN.js +28 -13
- package/lib/umd/locale/uz-UZ.js +143 -0
- package/lib/umd/locale/vi.js +29 -14
- package/lib/umd/locale/zh-CN.js +24 -9
- package/lib/umd/locale/zh-TW.js +31 -12
- package/lib/upload.js +1093 -1338
- package/lib/utils/after-leave.js +19 -16
- package/lib/utils/aria-dialog.js +11 -29
- package/lib/utils/aria-utils.js +7 -15
- package/lib/utils/clickoutside.js +16 -24
- package/lib/utils/date-util.js +267 -0
- package/lib/utils/date.js +56 -52
- package/lib/utils/dom.js +57 -27
- package/lib/utils/lodash.js +9421 -0
- package/lib/utils/menu/aria-menubar.js +6 -11
- package/lib/utils/menu/aria-menuitem.js +11 -22
- package/lib/utils/menu/aria-submenu.js +7 -16
- package/lib/utils/merge.js +9 -16
- package/lib/utils/popper.js +1141 -1170
- package/lib/utils/popup/index.js +24 -76
- package/lib/utils/popup/popup-manager.js +17 -49
- package/lib/utils/resize-event.js +11 -24
- package/lib/utils/scroll-into-view.js +4 -12
- package/lib/utils/scrollbar-width.js +8 -19
- package/lib/utils/types.js +38 -0
- package/lib/utils/util.js +165 -18
- package/lib/utils/vdom.js +5 -16
- package/lib/utils/vue-popper.js +10 -31
- package/package.json +131 -139
- package/packages/alert/src/main.vue +15 -8
- package/packages/autocomplete/src/autocomplete-suggestions.vue +4 -4
- package/packages/autocomplete/src/autocomplete.vue +45 -14
- package/packages/avatar/index.js +8 -0
- package/packages/avatar/src/main.vue +107 -0
- package/packages/backtop/index.js +8 -0
- package/packages/backtop/src/main.vue +110 -0
- package/packages/badge/src/main.vue +15 -3
- package/packages/button/src/button.vue +2 -1
- package/packages/calendar/index.js +8 -0
- package/packages/calendar/src/date-table.vue +200 -0
- package/packages/calendar/src/main.vue +280 -0
- package/packages/carousel/src/item.vue +36 -12
- package/packages/carousel/src/main.vue +83 -22
- package/packages/cascader/index.js +1 -1
- package/packages/cascader/src/cascader.vue +663 -0
- package/packages/cascader-panel/index.js +8 -0
- package/packages/cascader-panel/src/cascader-menu.vue +138 -0
- package/packages/cascader-panel/src/cascader-node.vue +246 -0
- package/packages/cascader-panel/src/cascader-panel.vue +391 -0
- package/packages/cascader-panel/src/node.js +166 -0
- package/packages/cascader-panel/src/store.js +58 -0
- package/packages/checkbox/src/checkbox-button.vue +11 -3
- package/packages/checkbox/src/checkbox-group.vue +1 -1
- package/packages/checkbox/src/checkbox.vue +15 -8
- package/packages/collapse/src/collapse-item.vue +12 -11
- package/packages/color-picker/src/color.js +1 -0
- package/packages/color-picker/src/components/picker-dropdown.vue +10 -6
- package/packages/color-picker/src/components/sv-panel.vue +1 -3
- package/packages/color-picker/src/main.vue +13 -4
- package/packages/date-picker/src/basic/date-table.vue +104 -168
- package/packages/date-picker/src/basic/month-table.vue +223 -58
- package/packages/date-picker/src/basic/time-spinner.vue +31 -15
- package/packages/date-picker/src/basic/year-table.vue +16 -5
- package/packages/date-picker/src/panel/date-range.vue +105 -48
- package/packages/date-picker/src/panel/date.vue +82 -39
- package/packages/date-picker/src/panel/month-range.vue +289 -0
- package/packages/date-picker/src/panel/time-range.vue +2 -2
- package/packages/date-picker/src/panel/time-select.vue +3 -2
- package/packages/date-picker/src/panel/time.vue +2 -2
- package/packages/date-picker/src/picker/date-picker.js +3 -0
- package/packages/date-picker/src/picker.vue +87 -43
- package/packages/descriptions/index.js +8 -0
- package/packages/descriptions/src/descriptions-item.js +30 -0
- package/packages/descriptions/src/descriptions-row.js +116 -0
- package/packages/descriptions/src/index.js +180 -0
- package/packages/descriptions-item/index.js +8 -0
- package/packages/dialog/src/component.vue +35 -12
- package/packages/divider/index.js +8 -0
- package/packages/divider/src/main.vue +37 -0
- package/packages/drawer/index.js +8 -0
- package/packages/drawer/src/main.vue +205 -0
- package/packages/dropdown/src/dropdown-item.vue +4 -2
- package/packages/dropdown/src/dropdown-menu.vue +6 -3
- package/packages/dropdown/src/dropdown.vue +55 -35
- package/packages/empty/index.js +7 -0
- package/packages/empty/src/img-empty.vue +132 -0
- package/packages/empty/src/index.vue +50 -0
- package/packages/form/src/form-item.vue +76 -44
- package/packages/form/src/form.vue +59 -11
- package/packages/form/src/label-wrap.vue +78 -0
- package/packages/image/index.js +8 -0
- package/packages/image/src/image-viewer.vue +330 -0
- package/packages/image/src/main.vue +249 -0
- package/packages/infinite-scroll/index.js +8 -0
- package/packages/infinite-scroll/src/main.js +150 -0
- package/packages/input/src/input.vue +186 -75
- package/packages/input-number/src/input-number.vue +52 -25
- package/packages/link/index.js +8 -0
- package/packages/link/src/main.vue +53 -0
- package/packages/loading/src/directive.js +9 -4
- package/packages/loading/src/index.js +5 -5
- package/packages/menu/src/menu-item.vue +4 -4
- package/packages/menu/src/menu.vue +24 -10
- package/packages/menu/src/submenu.vue +26 -12
- package/packages/message/src/main.js +35 -16
- package/packages/message/src/main.vue +12 -15
- package/packages/message-box/src/main.js +6 -4
- package/packages/message-box/src/main.vue +32 -24
- package/packages/notification/src/main.js +9 -8
- package/packages/page-header/index.js +8 -0
- package/packages/page-header/src/main.vue +30 -0
- package/packages/pagination/src/pagination.js +36 -77
- package/packages/popconfirm/index.js +8 -0
- package/packages/popconfirm/src/main.vue +104 -0
- package/packages/popover/src/directive.js +5 -1
- package/packages/popover/src/main.vue +49 -31
- package/packages/progress/src/progress.vue +118 -21
- package/packages/radio/index.js +1 -1
- package/packages/radio/src/radio-button.vue +7 -3
- package/packages/radio/src/radio-group.vue +9 -3
- package/packages/radio/src/radio.vue +6 -3
- package/packages/rate/src/main.vue +36 -37
- package/packages/result/index.js +8 -0
- package/packages/result/src/icon-error.vue +13 -0
- package/packages/result/src/icon-info.vue +13 -0
- package/packages/result/src/icon-success.vue +13 -0
- package/packages/result/src/icon-warning.vue +13 -0
- package/packages/result/src/index.vue +65 -0
- package/packages/row/src/row.js +2 -5
- package/packages/scrollbar/src/bar.js +5 -1
- package/packages/scrollbar/src/main.js +3 -3
- package/packages/select/src/option-group.vue +1 -1
- package/packages/select/src/option.vue +22 -9
- package/packages/select/src/select-dropdown.vue +1 -1
- package/packages/select/src/select.vue +126 -105
- package/packages/skeleton/index.js +8 -0
- package/packages/skeleton/src/img-placeholder.vue +16 -0
- package/packages/skeleton/src/index.vue +76 -0
- package/packages/skeleton/src/item.vue +22 -0
- package/packages/skeleton-item/index.js +8 -0
- package/packages/slider/src/button.vue +6 -9
- package/packages/slider/src/main.vue +60 -32
- package/packages/slider/src/marker.js +18 -0
- package/packages/spinner/src/spinner.vue +1 -1
- package/packages/statistic/index.js +8 -0
- package/packages/statistic/src/main.vue +204 -0
- package/packages/steps/src/step.vue +5 -1
- package/packages/steps/src/steps.vue +1 -1
- package/packages/switch/src/component.vue +18 -7
- package/packages/table/src/config.js +124 -0
- package/packages/table/src/filter-panel.vue +9 -18
- package/packages/table/src/layout-observer.js +2 -2
- package/packages/table/src/store/current.js +76 -0
- package/packages/table/src/store/expand.js +65 -0
- package/packages/table/src/store/helper.js +41 -0
- package/packages/table/src/store/index.js +147 -0
- package/packages/table/src/store/tree.js +209 -0
- package/packages/table/src/store/watcher.js +381 -0
- package/packages/table/src/table-body.js +221 -166
- package/packages/table/src/table-column.js +203 -308
- package/packages/table/src/table-footer.js +75 -65
- package/packages/table/src/table-header.js +68 -77
- package/packages/table/src/table-layout.js +43 -25
- package/packages/table/src/table-row.js +101 -0
- package/packages/table/src/table.vue +155 -99
- package/packages/table/src/util.js +164 -1
- package/packages/tabs/src/tab-bar.vue +7 -7
- package/packages/tabs/src/tab-nav.vue +35 -14
- package/packages/tabs/src/tab-pane.vue +10 -18
- package/packages/tabs/src/tabs.vue +45 -22
- package/packages/tag/src/tag.vue +35 -18
- package/packages/theme-chalk/gulpfile.js +33 -0
- package/packages/theme-chalk/package.json +36 -0
- package/packages/theme-chalk/src/alert.scss +57 -15
- package/packages/theme-chalk/src/autocomplete.scss +3 -4
- package/packages/theme-chalk/src/avatar.scss +51 -0
- package/packages/theme-chalk/src/backtop.scss +22 -0
- package/packages/theme-chalk/src/badge.scss +17 -1
- package/packages/theme-chalk/src/button.scss +40 -20
- package/packages/theme-chalk/src/calendar.scss +79 -0
- package/packages/theme-chalk/src/carousel.scss +33 -6
- package/packages/theme-chalk/src/cascader-panel.scss +120 -0
- package/packages/theme-chalk/src/cascader.scss +118 -112
- package/packages/theme-chalk/src/checkbox.scss +18 -17
- package/packages/theme-chalk/src/collapse.scss +16 -9
- package/packages/theme-chalk/src/common/popup.scss +3 -2
- package/packages/theme-chalk/src/common/var.scss +500 -184
- package/packages/theme-chalk/src/date-picker/date-picker.scss +1 -1
- package/packages/theme-chalk/src/date-picker/date-range-picker.scss +4 -7
- package/packages/theme-chalk/src/date-picker/date-table.scss +11 -11
- package/packages/theme-chalk/src/date-picker/month-table.scss +48 -6
- package/packages/theme-chalk/src/date-picker/picker-panel.scss +3 -3
- package/packages/theme-chalk/src/date-picker/picker.scss +7 -0
- package/packages/theme-chalk/src/date-picker/time-picker.scss +1 -0
- package/packages/theme-chalk/src/date-picker/year-table.scss +9 -2
- package/packages/theme-chalk/src/descriptions-item.scss +42 -0
- package/packages/theme-chalk/src/descriptions.scss +111 -0
- package/packages/theme-chalk/src/dialog.scss +5 -4
- package/packages/theme-chalk/src/divider.scss +47 -0
- package/packages/theme-chalk/src/drawer.scss +219 -0
- package/packages/theme-chalk/src/dropdown.scss +14 -1
- package/packages/theme-chalk/src/empty.scss +45 -0
- package/packages/theme-chalk/src/fonts/element-icons.ttf +0 -0
- package/packages/theme-chalk/src/fonts/element-icons.woff +0 -0
- package/packages/theme-chalk/src/form.scss +18 -23
- package/packages/theme-chalk/src/icon.scss +1052 -71
- package/packages/theme-chalk/src/image.scss +179 -0
- package/packages/theme-chalk/src/index.scss +20 -0
- package/packages/theme-chalk/src/input.scss +56 -5
- package/packages/theme-chalk/src/link.scss +81 -0
- package/packages/theme-chalk/src/main.scss +2 -0
- package/packages/theme-chalk/src/menu.scss +11 -8
- package/packages/theme-chalk/src/message-box.scss +14 -11
- package/packages/theme-chalk/src/message.scss +10 -10
- package/packages/theme-chalk/src/notification.scss +8 -7
- package/packages/theme-chalk/src/option.scss +1 -5
- package/packages/theme-chalk/src/page-header.scss +41 -0
- package/packages/theme-chalk/src/pagination.scss +9 -10
- package/packages/theme-chalk/src/popconfirm.scss +16 -0
- package/packages/theme-chalk/src/popover.scss +3 -2
- package/packages/theme-chalk/src/popper.scss +4 -4
- package/packages/theme-chalk/src/progress.scss +13 -1
- package/packages/theme-chalk/src/radio-button.scss +8 -8
- package/packages/theme-chalk/src/radio.scss +7 -6
- package/packages/theme-chalk/src/result.scss +61 -0
- package/packages/theme-chalk/src/row.scss +4 -0
- package/packages/theme-chalk/src/scrollbar.scss +1 -0
- package/packages/theme-chalk/src/select-dropdown.scss +5 -2
- package/packages/theme-chalk/src/select.scss +14 -6
- package/packages/theme-chalk/src/skeleton-item.scss +84 -0
- package/packages/theme-chalk/src/skeleton.scss +40 -0
- package/packages/theme-chalk/src/slider.scss +22 -0
- package/packages/theme-chalk/src/statistic.scss +38 -0
- package/packages/theme-chalk/src/switch.scss +0 -3
- package/packages/theme-chalk/src/table.scss +67 -60
- package/packages/theme-chalk/src/tabs.scss +58 -32
- package/packages/theme-chalk/src/tag.scss +85 -68
- package/packages/theme-chalk/src/timeline-item.scss +86 -0
- package/packages/theme-chalk/src/timeline.scss +14 -0
- package/packages/theme-chalk/src/tooltip.scss +1 -0
- package/packages/theme-chalk/src/transfer.scss +2 -2
- package/packages/theme-chalk/src/tree.scss +8 -5
- package/packages/theme-chalk/src/upload.scss +1 -0
- package/packages/timeline/index.js +8 -0
- package/packages/timeline/src/item.vue +73 -0
- package/packages/timeline/src/main.vue +33 -0
- package/packages/timeline-item/index.js +8 -0
- package/packages/tooltip/src/main.js +52 -26
- package/packages/transfer/src/main.vue +15 -7
- package/packages/transfer/src/transfer-panel.vue +4 -4
- package/packages/tree/src/model/node.js +27 -21
- package/packages/tree/src/model/tree-store.js +22 -16
- package/packages/tree/src/tree-node.vue +16 -10
- package/packages/tree/src/tree.vue +41 -27
- package/packages/upload/src/index.vue +42 -13
- package/packages/upload/src/upload-list.vue +46 -41
- package/src/directives/repeat-click.js +6 -4
- package/src/index.js +66 -8
- package/src/locale/format.js +1 -1
- package/src/locale/index.js +1 -1
- package/src/locale/lang/af-ZA.js +15 -1
- package/src/locale/lang/ar.js +26 -12
- package/src/locale/lang/az.js +126 -0
- package/src/locale/lang/bg.js +15 -1
- package/src/locale/lang/bn.js +126 -0
- package/src/locale/lang/ca.js +21 -7
- package/src/locale/lang/cs-CZ.js +15 -1
- package/src/locale/lang/da.js +15 -1
- package/src/locale/lang/de.js +15 -1
- package/src/locale/lang/ee.js +20 -6
- package/src/locale/lang/el.js +16 -2
- package/src/locale/lang/en.js +16 -2
- package/src/locale/lang/eo.js +123 -0
- package/src/locale/lang/es.js +19 -5
- package/src/locale/lang/eu.js +123 -0
- package/src/locale/lang/fa.js +20 -6
- package/src/locale/lang/fi.js +36 -22
- package/src/locale/lang/fr.js +15 -1
- package/src/locale/lang/he.js +15 -1
- package/src/locale/lang/hr.js +123 -0
- package/src/locale/lang/hu.js +16 -2
- package/src/locale/lang/hy-AM.js +123 -0
- package/src/locale/lang/id.js +20 -6
- package/src/locale/lang/is.js +124 -0
- package/src/locale/lang/it.js +18 -4
- package/src/locale/lang/ja.js +15 -1
- package/src/locale/lang/kg.js +123 -0
- package/src/locale/lang/km.js +18 -4
- package/src/locale/lang/ko.js +15 -1
- package/src/locale/lang/ku.js +15 -1
- package/src/locale/lang/kz.js +15 -1
- package/src/locale/lang/lt.js +15 -1
- package/src/locale/lang/lv.js +22 -8
- package/src/locale/lang/mn.js +15 -1
- package/src/locale/lang/ms.js +122 -0
- package/src/locale/lang/nb-NO.js +25 -11
- package/src/locale/lang/nl.js +15 -1
- package/src/locale/lang/pl.js +15 -1
- package/src/locale/lang/pt-br.js +15 -1
- package/src/locale/lang/pt.js +15 -1
- package/src/locale/lang/ro.js +15 -1
- package/src/locale/lang/ru-RU.js +17 -3
- package/src/locale/lang/si.js +123 -0
- package/src/locale/lang/sk.js +20 -6
- package/src/locale/lang/sl.js +21 -7
- package/src/locale/lang/sr-Latn.js +123 -0
- package/src/locale/lang/sr.js +123 -0
- package/src/locale/lang/sv-SE.js +23 -9
- package/src/locale/lang/sw.js +123 -0
- package/src/locale/lang/ta.js +15 -1
- package/src/locale/lang/th.js +22 -8
- package/src/locale/lang/tk.js +15 -1
- package/src/locale/lang/tr-TR.js +16 -2
- package/src/locale/lang/ua.js +17 -3
- package/src/locale/lang/ug-CN.js +19 -5
- package/src/locale/lang/uz-UZ.js +123 -0
- package/src/locale/lang/vi.js +20 -6
- package/src/locale/lang/zh-CN.js +15 -1
- package/src/locale/lang/zh-TW.js +15 -1
- package/src/mixins/locale.js +1 -1
- package/src/mixins/migrating.js +6 -3
- package/src/transitions/collapse-transition.js +1 -1
- package/src/utils/aria-utils.js +2 -1
- package/src/utils/clickoutside.js +1 -1
- package/{packages/date-picker/src/util/index.js → src/utils/date-util.js} +69 -27
- package/src/utils/date.js +54 -30
- package/src/utils/dom.js +55 -2
- package/src/utils/lodash.js +18075 -0
- package/src/utils/merge.js +3 -13
- package/src/utils/popup/index.js +3 -11
- package/src/utils/popup/popup-manager.js +3 -3
- package/src/utils/resize-event.js +2 -1
- package/src/utils/types.js +38 -0
- package/src/utils/util.js +161 -0
- package/src/utils/vdom.js +1 -5
- package/src/utils/vue-popper.js +2 -1
- package/types/alert.d.ts +4 -0
- package/types/autocomplete.d.ts +6 -3
- package/types/avatar.d.ts +20 -0
- package/types/backtop.d.ts +16 -0
- package/types/calendar.d.ts +15 -0
- package/types/carousel.d.ts +4 -0
- package/types/cascader-panel.d.ts +72 -0
- package/types/cascader.d.ts +29 -21
- package/types/collapse-item.d.ts +3 -0
- package/types/descriptions-item.d.ts +37 -0
- package/types/descriptions.d.ts +52 -0
- package/types/dialog.d.ts +3 -0
- package/types/divider.d.ts +12 -0
- package/types/drawer.d.ts +63 -0
- package/types/dropdown-item.d.ts +3 -0
- package/types/dropdown.d.ts +12 -0
- package/types/element-ui.d.ts +91 -3
- package/types/empty.d.ts +31 -0
- package/types/form.d.ts +6 -6
- package/types/icon.d.ts +7 -0
- package/types/image.d.ts +43 -0
- package/types/infinite-scroll.d.ts +6 -0
- package/types/input-number.d.ts +4 -1
- package/types/input.d.ts +16 -1
- package/types/link.d.ts +25 -0
- package/types/loading.d.ts +3 -1
- package/types/message-box.d.ts +14 -4
- package/types/message.d.ts +17 -2
- package/types/page-header.d.ts +10 -0
- package/types/pagination.d.ts +3 -0
- package/types/popconfirm.d.ts +29 -0
- package/types/popover.d.ts +7 -1
- package/types/progress.d.ts +7 -1
- package/types/rate.d.ts +16 -4
- package/types/result.d.ts +33 -0
- package/types/select.d.ts +9 -0
- package/types/skeleton-item.d.ts +7 -0
- package/types/skeleton.d.ts +33 -0
- package/types/slider.d.ts +6 -0
- package/types/spinner.d.ts +16 -0
- package/types/statistic.d.ts +37 -0
- package/types/submenu.d.ts +1 -1
- package/types/switch.d.ts +3 -0
- package/types/table-column.d.ts +1 -1
- package/types/table.d.ts +58 -3
- package/types/tabs.d.ts +4 -1
- package/types/tag.d.ts +5 -1
- package/types/timeline-item.d.ts +20 -0
- package/types/timeline.d.ts +6 -0
- package/types/tooltip.d.ts +3 -0
- package/types/tree.d.ts +120 -97
- package/types/upload.d.ts +7 -4
- package/web-types.json +4195 -0
- package/CHANGELOG.en-US.md +0 -576
- package/CHANGELOG.es.md +0 -581
- package/CHANGELOG.zh-CN.md +0 -576
- package/lib/utils/sync.js +0 -59
- package/packages/carousel/_index.js +0 -10
- package/packages/carousel/cooking.conf.js +0 -6
- package/packages/carousel/package.json +0 -17
- package/packages/cascader/cooking.conf.js +0 -18
- package/packages/cascader/package.json +0 -15
- package/packages/cascader/src/main.vue +0 -438
- package/packages/cascader/src/menu.vue +0 -369
- package/packages/color-picker/cooking.conf.js +0 -6
- package/packages/color-picker/package.json +0 -15
- package/packages/date-picker/README.md +0 -64
- package/packages/date-picker/_index.js +0 -12
- package/packages/date-picker/cooking.conf.js +0 -6
- package/packages/date-picker/package.json +0 -15
- package/packages/loading/README.md +0 -66
- package/packages/loading/cooking.conf.js +0 -6
- package/packages/loading/package.json +0 -15
- package/packages/pagination/README.md +0 -59
- package/packages/pagination/cooking.conf.js +0 -6
- package/packages/pagination/package.json +0 -15
- package/packages/table/README.md +0 -106
- package/packages/table/_index.js +0 -10
- package/packages/table/cooking.conf.js +0 -6
- package/packages/table/package.json +0 -17
- package/packages/table/src/table-store.js +0 -619
- package/packages/theme-chalk/lib/alert.css +0 -1
- package/packages/theme-chalk/lib/aside.css +0 -1
- package/packages/theme-chalk/lib/autocomplete.css +0 -1
- package/packages/theme-chalk/lib/badge.css +0 -1
- package/packages/theme-chalk/lib/base.css +0 -1
- package/packages/theme-chalk/lib/breadcrumb.css +0 -1
- package/packages/theme-chalk/lib/button.css +0 -1
- package/packages/theme-chalk/lib/card.css +0 -1
- package/packages/theme-chalk/lib/carousel-item.css +0 -1
- package/packages/theme-chalk/lib/carousel.css +0 -1
- package/packages/theme-chalk/lib/cascader.css +0 -1
- package/packages/theme-chalk/lib/checkbox.css +0 -1
- package/packages/theme-chalk/lib/col.css +0 -1
- package/packages/theme-chalk/lib/collapse-item.css +0 -0
- package/packages/theme-chalk/lib/collapse.css +0 -1
- package/packages/theme-chalk/lib/color-picker.css +0 -1
- package/packages/theme-chalk/lib/container.css +0 -1
- package/packages/theme-chalk/lib/date-picker.css +0 -1
- package/packages/theme-chalk/lib/dialog.css +0 -1
- package/packages/theme-chalk/lib/display.css +0 -1
- package/packages/theme-chalk/lib/dropdown-item.css +0 -0
- package/packages/theme-chalk/lib/dropdown-menu.css +0 -0
- package/packages/theme-chalk/lib/dropdown.css +0 -1
- package/packages/theme-chalk/lib/fonts/element-icons.ttf +0 -0
- package/packages/theme-chalk/lib/fonts/element-icons.woff +0 -0
- package/packages/theme-chalk/lib/footer.css +0 -1
- package/packages/theme-chalk/lib/form-item.css +0 -0
- package/packages/theme-chalk/lib/form.css +0 -1
- package/packages/theme-chalk/lib/header.css +0 -1
- package/packages/theme-chalk/lib/icon.css +0 -1
- package/packages/theme-chalk/lib/index.css +0 -1
- package/packages/theme-chalk/lib/input-number.css +0 -1
- package/packages/theme-chalk/lib/input.css +0 -1
- package/packages/theme-chalk/lib/loading.css +0 -1
- package/packages/theme-chalk/lib/main.css +0 -1
- package/packages/theme-chalk/lib/menu-item-group.css +0 -0
- package/packages/theme-chalk/lib/menu-item.css +0 -0
- package/packages/theme-chalk/lib/menu.css +0 -1
- package/packages/theme-chalk/lib/message-box.css +0 -1
- package/packages/theme-chalk/lib/message.css +0 -1
- package/packages/theme-chalk/lib/notification.css +0 -1
- package/packages/theme-chalk/lib/option-group.css +0 -1
- package/packages/theme-chalk/lib/option.css +0 -1
- package/packages/theme-chalk/lib/pagination.css +0 -1
- package/packages/theme-chalk/lib/popover.css +0 -1
- package/packages/theme-chalk/lib/popper.css +0 -1
- package/packages/theme-chalk/lib/progress.css +0 -1
- package/packages/theme-chalk/lib/radio-button.css +0 -1
- package/packages/theme-chalk/lib/radio-group.css +0 -1
- package/packages/theme-chalk/lib/radio.css +0 -1
- package/packages/theme-chalk/lib/rate.css +0 -1
- package/packages/theme-chalk/lib/reset.css +0 -1
- package/packages/theme-chalk/lib/row.css +0 -1
- package/packages/theme-chalk/lib/scrollbar.css +0 -1
- package/packages/theme-chalk/lib/select-dropdown.css +0 -1
- package/packages/theme-chalk/lib/select.css +0 -1
- package/packages/theme-chalk/lib/slider.css +0 -1
- package/packages/theme-chalk/lib/spinner.css +0 -1
- package/packages/theme-chalk/lib/step.css +0 -1
- package/packages/theme-chalk/lib/steps.css +0 -1
- package/packages/theme-chalk/lib/submenu.css +0 -0
- package/packages/theme-chalk/lib/switch.css +0 -1
- package/packages/theme-chalk/lib/tab-pane.css +0 -0
- package/packages/theme-chalk/lib/table-column.css +0 -1
- package/packages/theme-chalk/lib/table.css +0 -1
- package/packages/theme-chalk/lib/tabs.css +0 -1
- package/packages/theme-chalk/lib/tag.css +0 -1
- package/packages/theme-chalk/lib/time-picker.css +0 -1
- package/packages/theme-chalk/lib/time-select.css +0 -1
- package/packages/theme-chalk/lib/tooltip.css +0 -1
- package/packages/theme-chalk/lib/transfer.css +0 -1
- package/packages/theme-chalk/lib/tree.css +0 -1
- package/packages/theme-chalk/lib/upload.css +0 -1
- package/packages/upload/README.md +0 -67
- package/packages/upload/cooking.conf.js +0 -6
- package/packages/upload/package.json +0 -16
- package/packages/upload/src/iframe-upload.vue +0 -167
- package/src/utils/sync.js +0 -54
- /package/{packages/theme-chalk/lib/breadcrumb-item.css → lib/theme-chalk/infinite-scroll.css} +0 -0
- /package/{packages/theme-chalk/lib/button-group.css → lib/theme-chalk/infiniteScroll.css} +0 -0
- /package/packages/theme-chalk/{lib/checkbox-button.css → src/infinite-scroll.scss} +0 -0
- /package/packages/theme-chalk/{lib/checkbox-group.css → src/infiniteScroll.scss} +0 -0
package/lib/upload.js
CHANGED
|
@@ -1,107 +1,321 @@
|
|
|
1
|
-
|
|
2
|
-
/******/
|
|
3
|
-
/******/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
1
|
+
/******/ (() => { // webpackBootstrap
|
|
2
|
+
/******/ "use strict";
|
|
3
|
+
/******/ var __webpack_modules__ = ({
|
|
4
|
+
|
|
5
|
+
/***/ 5623
|
|
6
|
+
(module, __webpack_exports__, __webpack_require__) {
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
// EXPORTS
|
|
10
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
11
|
+
"default": () => (/* binding */ packages_upload)
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
;// ./node_modules/@vue/babel-helper-vue-jsx-merge-props/dist/helper.js
|
|
15
|
+
var helper_namespaceObject = /*#__PURE__*/__webpack_require__.cjs(function(module, exports) {
|
|
16
|
+
function _extends(){return _extends=Object.assign?Object.assign.bind():function(a){for(var b,c=1;c<arguments.length;c++)for(var d in b=arguments[c],b)Object.prototype.hasOwnProperty.call(b,d)&&(a[d]=b[d]);return a},_extends.apply(this,arguments)}var normalMerge=["attrs","props","domProps"],toArrayMerge=["class","style","directives"],functionalMerge=["on","nativeOn"],mergeJsxProps=function(a){return a.reduce(function(c,a){for(var b in a)if(!c[b])c[b]=a[b];else if(-1!==normalMerge.indexOf(b))c[b]=_extends({},c[b],a[b]);else if(-1!==toArrayMerge.indexOf(b)){var d=c[b]instanceof Array?c[b]:[c[b]],e=a[b]instanceof Array?a[b]:[a[b]];c[b]=[].concat(d,e)}else if(-1!==functionalMerge.indexOf(b)){for(var f in a[b])if(c[b][f]){var g=c[b][f]instanceof Array?c[b][f]:[c[b][f]],h=a[b][f]instanceof Array?a[b][f]:[a[b][f]];c[b][f]=[].concat(g,h)}else c[b][f]=a[b][f];}else if("hook"===b)for(var i in a[b])c[b][i]=c[b][i]?mergeFn(c[b][i],a[b][i]):a[b][i];else c[b]=a[b];return c},{})},mergeFn=function(a,b){return function(){a&&a.apply(this,arguments),b&&b.apply(this,arguments)}};module.exports=mergeJsxProps;
|
|
17
|
+
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
var helper_default = /*#__PURE__*/__webpack_require__.n(helper_namespaceObject);
|
|
21
|
+
;// ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./packages/upload/src/upload-list.vue?vue&type=template&id=78318cbf
|
|
22
|
+
var render = function () {
|
|
23
|
+
var _vm = this
|
|
24
|
+
var _h = _vm.$createElement
|
|
25
|
+
var _c = _vm._self._c || _h
|
|
26
|
+
return _c(
|
|
27
|
+
"transition-group",
|
|
28
|
+
{
|
|
29
|
+
class: [
|
|
30
|
+
"el-upload-list",
|
|
31
|
+
"el-upload-list--" + _vm.listType,
|
|
32
|
+
{ "is-disabled": _vm.disabled },
|
|
33
|
+
],
|
|
34
|
+
attrs: { tag: "ul", name: "el-list" },
|
|
35
|
+
},
|
|
36
|
+
_vm._l(_vm.files, function (file) {
|
|
37
|
+
return _c(
|
|
38
|
+
"li",
|
|
39
|
+
{
|
|
40
|
+
key: file.uid,
|
|
41
|
+
class: [
|
|
42
|
+
"el-upload-list__item",
|
|
43
|
+
"is-" + file.status,
|
|
44
|
+
_vm.focusing ? "focusing" : "",
|
|
45
|
+
],
|
|
46
|
+
attrs: { tabindex: "0" },
|
|
47
|
+
on: {
|
|
48
|
+
keydown: function ($event) {
|
|
49
|
+
if (
|
|
50
|
+
!("button" in $event) &&
|
|
51
|
+
_vm._k($event.keyCode, "delete", [8, 46], $event.key, [
|
|
52
|
+
"Backspace",
|
|
53
|
+
"Delete",
|
|
54
|
+
"Del",
|
|
55
|
+
])
|
|
56
|
+
) {
|
|
57
|
+
return null
|
|
58
|
+
}
|
|
59
|
+
!_vm.disabled && _vm.$emit("remove", file)
|
|
60
|
+
},
|
|
61
|
+
focus: function ($event) {
|
|
62
|
+
_vm.focusing = true
|
|
63
|
+
},
|
|
64
|
+
blur: function ($event) {
|
|
65
|
+
_vm.focusing = false
|
|
66
|
+
},
|
|
67
|
+
click: function ($event) {
|
|
68
|
+
_vm.focusing = false
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
[
|
|
73
|
+
_vm._t(
|
|
74
|
+
"default",
|
|
75
|
+
[
|
|
76
|
+
file.status !== "uploading" &&
|
|
77
|
+
["picture-card", "picture"].indexOf(_vm.listType) > -1
|
|
78
|
+
? _c("img", {
|
|
79
|
+
staticClass: "el-upload-list__item-thumbnail",
|
|
80
|
+
attrs: { src: file.url, alt: "" },
|
|
81
|
+
})
|
|
82
|
+
: _vm._e(),
|
|
83
|
+
_c(
|
|
84
|
+
"a",
|
|
85
|
+
{
|
|
86
|
+
staticClass: "el-upload-list__item-name",
|
|
87
|
+
on: {
|
|
88
|
+
click: function ($event) {
|
|
89
|
+
_vm.handleClick(file)
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
[
|
|
94
|
+
_c("i", { staticClass: "el-icon-document" }),
|
|
95
|
+
_vm._v(_vm._s(file.name) + "\n "),
|
|
96
|
+
]
|
|
97
|
+
),
|
|
98
|
+
_c(
|
|
99
|
+
"label",
|
|
100
|
+
{ staticClass: "el-upload-list__item-status-label" },
|
|
101
|
+
[
|
|
102
|
+
_c("i", {
|
|
103
|
+
class: {
|
|
104
|
+
"el-icon-upload-success": true,
|
|
105
|
+
"el-icon-circle-check": _vm.listType === "text",
|
|
106
|
+
"el-icon-check":
|
|
107
|
+
["picture-card", "picture"].indexOf(_vm.listType) > -1,
|
|
108
|
+
},
|
|
109
|
+
}),
|
|
110
|
+
]
|
|
111
|
+
),
|
|
112
|
+
!_vm.disabled
|
|
113
|
+
? _c("i", {
|
|
114
|
+
staticClass: "el-icon-close",
|
|
115
|
+
on: {
|
|
116
|
+
click: function ($event) {
|
|
117
|
+
_vm.$emit("remove", file)
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
})
|
|
121
|
+
: _vm._e(),
|
|
122
|
+
!_vm.disabled
|
|
123
|
+
? _c("i", { staticClass: "el-icon-close-tip" }, [
|
|
124
|
+
_vm._v(_vm._s(_vm.t("el.upload.deleteTip"))),
|
|
125
|
+
])
|
|
126
|
+
: _vm._e(),
|
|
127
|
+
file.status === "uploading"
|
|
128
|
+
? _c("el-progress", {
|
|
129
|
+
attrs: {
|
|
130
|
+
type: _vm.listType === "picture-card" ? "circle" : "line",
|
|
131
|
+
"stroke-width": _vm.listType === "picture-card" ? 6 : 2,
|
|
132
|
+
percentage: _vm.parsePercentage(file.percentage),
|
|
133
|
+
},
|
|
134
|
+
})
|
|
135
|
+
: _vm._e(),
|
|
136
|
+
_vm.listType === "picture-card"
|
|
137
|
+
? _c("span", { staticClass: "el-upload-list__item-actions" }, [
|
|
138
|
+
_vm.handlePreview && _vm.listType === "picture-card"
|
|
139
|
+
? _c(
|
|
140
|
+
"span",
|
|
141
|
+
{
|
|
142
|
+
staticClass: "el-upload-list__item-preview",
|
|
143
|
+
on: {
|
|
144
|
+
click: function ($event) {
|
|
145
|
+
_vm.handlePreview(file)
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
[_c("i", { staticClass: "el-icon-zoom-in" })]
|
|
150
|
+
)
|
|
151
|
+
: _vm._e(),
|
|
152
|
+
!_vm.disabled
|
|
153
|
+
? _c(
|
|
154
|
+
"span",
|
|
155
|
+
{
|
|
156
|
+
staticClass: "el-upload-list__item-delete",
|
|
157
|
+
on: {
|
|
158
|
+
click: function ($event) {
|
|
159
|
+
_vm.$emit("remove", file)
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
[_c("i", { staticClass: "el-icon-delete" })]
|
|
164
|
+
)
|
|
165
|
+
: _vm._e(),
|
|
166
|
+
])
|
|
167
|
+
: _vm._e(),
|
|
168
|
+
],
|
|
169
|
+
{ file: file }
|
|
170
|
+
),
|
|
171
|
+
],
|
|
172
|
+
2
|
|
173
|
+
)
|
|
174
|
+
}),
|
|
175
|
+
0
|
|
176
|
+
)
|
|
177
|
+
}
|
|
178
|
+
var staticRenderFns = []
|
|
179
|
+
render._withStripped = true
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
;// ./packages/upload/src/upload-list.vue?vue&type=template&id=78318cbf
|
|
183
|
+
|
|
184
|
+
;// external "mazey-element-ui/lib/mixins/locale"
|
|
185
|
+
const locale_namespaceObject = require("mazey-element-ui/lib/mixins/locale");
|
|
186
|
+
var locale_default = /*#__PURE__*/__webpack_require__.n(locale_namespaceObject);
|
|
187
|
+
;// external "mazey-element-ui/lib/progress"
|
|
188
|
+
const progress_namespaceObject = require("mazey-element-ui/lib/progress");
|
|
189
|
+
var progress_default = /*#__PURE__*/__webpack_require__.n(progress_namespaceObject);
|
|
190
|
+
;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./packages/upload/src/upload-list.vue?vue&type=script&lang=js
|
|
191
|
+
//
|
|
192
|
+
//
|
|
193
|
+
//
|
|
194
|
+
//
|
|
195
|
+
//
|
|
196
|
+
//
|
|
197
|
+
//
|
|
198
|
+
//
|
|
199
|
+
//
|
|
200
|
+
//
|
|
201
|
+
//
|
|
202
|
+
//
|
|
203
|
+
//
|
|
204
|
+
//
|
|
205
|
+
//
|
|
206
|
+
//
|
|
207
|
+
//
|
|
208
|
+
//
|
|
209
|
+
//
|
|
210
|
+
//
|
|
211
|
+
//
|
|
212
|
+
//
|
|
213
|
+
//
|
|
214
|
+
//
|
|
215
|
+
//
|
|
216
|
+
//
|
|
217
|
+
//
|
|
218
|
+
//
|
|
219
|
+
//
|
|
220
|
+
//
|
|
221
|
+
//
|
|
222
|
+
//
|
|
223
|
+
//
|
|
224
|
+
//
|
|
225
|
+
//
|
|
226
|
+
//
|
|
227
|
+
//
|
|
228
|
+
//
|
|
229
|
+
//
|
|
230
|
+
//
|
|
231
|
+
//
|
|
232
|
+
//
|
|
233
|
+
//
|
|
234
|
+
//
|
|
235
|
+
//
|
|
236
|
+
//
|
|
237
|
+
//
|
|
238
|
+
//
|
|
239
|
+
//
|
|
240
|
+
//
|
|
241
|
+
//
|
|
242
|
+
//
|
|
243
|
+
//
|
|
244
|
+
//
|
|
245
|
+
//
|
|
246
|
+
//
|
|
247
|
+
//
|
|
248
|
+
//
|
|
249
|
+
//
|
|
250
|
+
//
|
|
251
|
+
//
|
|
252
|
+
//
|
|
253
|
+
//
|
|
254
|
+
//
|
|
68
255
|
|
|
69
|
-
/***/ 0:
|
|
70
|
-
/***/ (function(module, exports) {
|
|
71
256
|
|
|
257
|
+
|
|
258
|
+
/* harmony default export */ const upload_listvue_type_script_lang_js = ({
|
|
259
|
+
name: 'ElUploadList',
|
|
260
|
+
mixins: [(locale_default())],
|
|
261
|
+
data: function data() {
|
|
262
|
+
return {
|
|
263
|
+
focusing: false
|
|
264
|
+
};
|
|
265
|
+
},
|
|
266
|
+
components: {
|
|
267
|
+
ElProgress: (progress_default())
|
|
268
|
+
},
|
|
269
|
+
props: {
|
|
270
|
+
files: {
|
|
271
|
+
type: Array,
|
|
272
|
+
default: function _default() {
|
|
273
|
+
return [];
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
disabled: {
|
|
277
|
+
type: Boolean,
|
|
278
|
+
default: false
|
|
279
|
+
},
|
|
280
|
+
handlePreview: Function,
|
|
281
|
+
listType: String
|
|
282
|
+
},
|
|
283
|
+
methods: {
|
|
284
|
+
parsePercentage: function parsePercentage(val) {
|
|
285
|
+
return parseInt(val, 10);
|
|
286
|
+
},
|
|
287
|
+
handleClick: function handleClick(file) {
|
|
288
|
+
this.handlePreview && this.handlePreview(file);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
;// ./packages/upload/src/upload-list.vue?vue&type=script&lang=js
|
|
293
|
+
/* harmony default export */ const src_upload_listvue_type_script_lang_js = (upload_listvue_type_script_lang_js);
|
|
294
|
+
;// ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
72
295
|
/* globals __VUE_SSR_CONTEXT__ */
|
|
73
296
|
|
|
74
|
-
// IMPORTANT: Do NOT use ES2015 features in this file.
|
|
297
|
+
// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
|
|
75
298
|
// This module is a runtime utility for cleaner component module output and will
|
|
76
299
|
// be included in the final webpack user bundle.
|
|
77
300
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
301
|
+
function normalizeComponent(
|
|
302
|
+
scriptExports,
|
|
303
|
+
render,
|
|
304
|
+
staticRenderFns,
|
|
81
305
|
functionalTemplate,
|
|
82
306
|
injectStyles,
|
|
83
307
|
scopeId,
|
|
84
|
-
moduleIdentifier /* server only
|
|
308
|
+
moduleIdentifier /* server only */,
|
|
309
|
+
shadowMode /* vue-cli only */
|
|
85
310
|
) {
|
|
86
|
-
var esModule
|
|
87
|
-
var scriptExports = rawScriptExports = rawScriptExports || {}
|
|
88
|
-
|
|
89
|
-
// ES6 modules interop
|
|
90
|
-
var type = typeof rawScriptExports.default
|
|
91
|
-
if (type === 'object' || type === 'function') {
|
|
92
|
-
esModule = rawScriptExports
|
|
93
|
-
scriptExports = rawScriptExports.default
|
|
94
|
-
}
|
|
95
|
-
|
|
96
311
|
// Vue.extend constructor export interop
|
|
97
|
-
var options =
|
|
98
|
-
? scriptExports.options
|
|
99
|
-
: scriptExports
|
|
312
|
+
var options =
|
|
313
|
+
typeof scriptExports === 'function' ? scriptExports.options : scriptExports
|
|
100
314
|
|
|
101
315
|
// render functions
|
|
102
|
-
if (
|
|
103
|
-
options.render =
|
|
104
|
-
options.staticRenderFns =
|
|
316
|
+
if (render) {
|
|
317
|
+
options.render = render
|
|
318
|
+
options.staticRenderFns = staticRenderFns
|
|
105
319
|
options._compiled = true
|
|
106
320
|
}
|
|
107
321
|
|
|
@@ -112,11 +326,12 @@ module.exports = function normalizeComponent (
|
|
|
112
326
|
|
|
113
327
|
// scopedId
|
|
114
328
|
if (scopeId) {
|
|
115
|
-
options._scopeId = scopeId
|
|
329
|
+
options._scopeId = 'data-v-' + scopeId
|
|
116
330
|
}
|
|
117
331
|
|
|
118
332
|
var hook
|
|
119
|
-
if (moduleIdentifier) {
|
|
333
|
+
if (moduleIdentifier) {
|
|
334
|
+
// server build
|
|
120
335
|
hook = function (context) {
|
|
121
336
|
// 2.3 injection
|
|
122
337
|
context =
|
|
@@ -140,1388 +355,928 @@ module.exports = function normalizeComponent (
|
|
|
140
355
|
// never gets called
|
|
141
356
|
options._ssrRegister = hook
|
|
142
357
|
} else if (injectStyles) {
|
|
143
|
-
hook =
|
|
358
|
+
hook = shadowMode
|
|
359
|
+
? function () {
|
|
360
|
+
injectStyles.call(
|
|
361
|
+
this,
|
|
362
|
+
(options.functional ? this.parent : this).$root.$options.shadowRoot
|
|
363
|
+
)
|
|
364
|
+
}
|
|
365
|
+
: injectStyles
|
|
144
366
|
}
|
|
145
367
|
|
|
146
368
|
if (hook) {
|
|
147
|
-
|
|
148
|
-
var existing = functional
|
|
149
|
-
? options.render
|
|
150
|
-
: options.beforeCreate
|
|
151
|
-
|
|
152
|
-
if (!functional) {
|
|
153
|
-
// inject component registration as beforeCreate hook
|
|
154
|
-
options.beforeCreate = existing
|
|
155
|
-
? [].concat(existing, hook)
|
|
156
|
-
: [hook]
|
|
157
|
-
} else {
|
|
369
|
+
if (options.functional) {
|
|
158
370
|
// for template-only hot-reload because in that case the render fn doesn't
|
|
159
371
|
// go through the normalizer
|
|
160
372
|
options._injectStyles = hook
|
|
161
|
-
// register for
|
|
162
|
-
options.render
|
|
373
|
+
// register for functional component in vue file
|
|
374
|
+
var originalRender = options.render
|
|
375
|
+
options.render = function renderWithStyleInjection(h, context) {
|
|
163
376
|
hook.call(context)
|
|
164
|
-
return
|
|
377
|
+
return originalRender(h, context)
|
|
165
378
|
}
|
|
379
|
+
} else {
|
|
380
|
+
// inject component registration as beforeCreate hook
|
|
381
|
+
var existing = options.beforeCreate
|
|
382
|
+
options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
|
|
166
383
|
}
|
|
167
384
|
}
|
|
168
385
|
|
|
169
386
|
return {
|
|
170
|
-
esModule: esModule,
|
|
171
387
|
exports: scriptExports,
|
|
172
388
|
options: options
|
|
173
389
|
}
|
|
174
390
|
}
|
|
175
391
|
|
|
392
|
+
;// ./packages/upload/src/upload-list.vue
|
|
176
393
|
|
|
177
|
-
/***/ }),
|
|
178
|
-
|
|
179
|
-
/***/ 105:
|
|
180
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
181
|
-
|
|
182
|
-
"use strict";
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
exports.__esModule = true;
|
|
186
|
-
|
|
187
|
-
var _uploadList = __webpack_require__(322);
|
|
188
|
-
|
|
189
|
-
var _uploadList2 = _interopRequireDefault(_uploadList);
|
|
190
|
-
|
|
191
|
-
var _upload = __webpack_require__(324);
|
|
192
394
|
|
|
193
|
-
var _upload2 = _interopRequireDefault(_upload);
|
|
194
395
|
|
|
195
|
-
var _iframeUpload = __webpack_require__(327);
|
|
196
396
|
|
|
197
|
-
var _iframeUpload2 = _interopRequireDefault(_iframeUpload);
|
|
198
397
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
var
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
398
|
+
/* normalize component */
|
|
399
|
+
;
|
|
400
|
+
var component = normalizeComponent(
|
|
401
|
+
src_upload_listvue_type_script_lang_js,
|
|
402
|
+
render,
|
|
403
|
+
staticRenderFns,
|
|
404
|
+
false,
|
|
405
|
+
null,
|
|
406
|
+
null,
|
|
407
|
+
null
|
|
408
|
+
|
|
409
|
+
)
|
|
208
410
|
|
|
209
|
-
|
|
411
|
+
/* harmony default export */ const upload_list = (component.exports);
|
|
412
|
+
;// ./packages/upload/src/ajax.js
|
|
413
|
+
function getError(action, option, xhr) {
|
|
414
|
+
var msg;
|
|
415
|
+
if (xhr.response) {
|
|
416
|
+
msg = "" + (xhr.response.error || xhr.response);
|
|
417
|
+
} else if (xhr.responseText) {
|
|
418
|
+
msg = "" + xhr.responseText;
|
|
419
|
+
} else {
|
|
420
|
+
msg = "fail to post " + action + " " + xhr.status;
|
|
421
|
+
}
|
|
422
|
+
var err = new Error(msg);
|
|
423
|
+
err.status = xhr.status;
|
|
424
|
+
err.method = 'post';
|
|
425
|
+
err.url = action;
|
|
426
|
+
return err;
|
|
427
|
+
}
|
|
428
|
+
function getBody(xhr) {
|
|
429
|
+
var text = xhr.responseText || xhr.response;
|
|
430
|
+
if (!text) {
|
|
431
|
+
return text;
|
|
432
|
+
}
|
|
433
|
+
try {
|
|
434
|
+
return JSON.parse(text);
|
|
435
|
+
} catch (e) {
|
|
436
|
+
return text;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
function upload(option) {
|
|
440
|
+
if (typeof XMLHttpRequest === 'undefined') {
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
var xhr = new XMLHttpRequest();
|
|
444
|
+
var action = option.action;
|
|
445
|
+
if (xhr.upload) {
|
|
446
|
+
xhr.upload.onprogress = function progress(e) {
|
|
447
|
+
if (e.total > 0) {
|
|
448
|
+
e.percent = e.loaded / e.total * 100;
|
|
449
|
+
}
|
|
450
|
+
option.onProgress(e);
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
var formData = new FormData();
|
|
454
|
+
if (option.data) {
|
|
455
|
+
Object.keys(option.data).forEach(function (key) {
|
|
456
|
+
formData.append(key, option.data[key]);
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
formData.append(option.filename, option.file, option.file.name);
|
|
460
|
+
xhr.onerror = function error(e) {
|
|
461
|
+
option.onError(e);
|
|
462
|
+
};
|
|
463
|
+
xhr.onload = function onload() {
|
|
464
|
+
if (xhr.status < 200 || xhr.status >= 300) {
|
|
465
|
+
return option.onError(getError(action, option, xhr));
|
|
466
|
+
}
|
|
467
|
+
option.onSuccess(getBody(xhr));
|
|
468
|
+
};
|
|
469
|
+
xhr.open('post', action, true);
|
|
470
|
+
if (option.withCredentials && 'withCredentials' in xhr) {
|
|
471
|
+
xhr.withCredentials = true;
|
|
472
|
+
}
|
|
473
|
+
var headers = option.headers || {};
|
|
474
|
+
for (var item in headers) {
|
|
475
|
+
if (headers.hasOwnProperty(item) && headers[item] !== null) {
|
|
476
|
+
xhr.setRequestHeader(item, headers[item]);
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
xhr.send(formData);
|
|
480
|
+
return xhr;
|
|
481
|
+
}
|
|
482
|
+
;// ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./packages/upload/src/upload-dragger.vue?vue&type=template&id=4c315758
|
|
483
|
+
var upload_draggervue_type_template_id_4c315758_render = function () {
|
|
484
|
+
var _vm = this
|
|
485
|
+
var _h = _vm.$createElement
|
|
486
|
+
var _c = _vm._self._c || _h
|
|
487
|
+
return _c(
|
|
488
|
+
"div",
|
|
489
|
+
{
|
|
490
|
+
staticClass: "el-upload-dragger",
|
|
491
|
+
class: {
|
|
492
|
+
"is-dragover": _vm.dragover,
|
|
493
|
+
},
|
|
494
|
+
on: {
|
|
495
|
+
drop: function ($event) {
|
|
496
|
+
$event.preventDefault()
|
|
497
|
+
return _vm.onDrop($event)
|
|
498
|
+
},
|
|
499
|
+
dragover: function ($event) {
|
|
500
|
+
$event.preventDefault()
|
|
501
|
+
return _vm.onDragover($event)
|
|
502
|
+
},
|
|
503
|
+
dragleave: function ($event) {
|
|
504
|
+
$event.preventDefault()
|
|
505
|
+
_vm.dragover = false
|
|
506
|
+
},
|
|
507
|
+
},
|
|
508
|
+
},
|
|
509
|
+
[_vm._t("default")],
|
|
510
|
+
2
|
|
511
|
+
)
|
|
512
|
+
}
|
|
513
|
+
var upload_draggervue_type_template_id_4c315758_staticRenderFns = []
|
|
514
|
+
upload_draggervue_type_template_id_4c315758_render._withStripped = true
|
|
210
515
|
|
|
211
|
-
exports.default = {
|
|
212
|
-
name: 'ElUpload',
|
|
213
516
|
|
|
214
|
-
|
|
517
|
+
;// ./packages/upload/src/upload-dragger.vue?vue&type=template&id=4c315758
|
|
215
518
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
519
|
+
;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./packages/upload/src/upload-dragger.vue?vue&type=script&lang=js
|
|
520
|
+
//
|
|
521
|
+
//
|
|
522
|
+
//
|
|
523
|
+
//
|
|
524
|
+
//
|
|
525
|
+
//
|
|
526
|
+
//
|
|
527
|
+
//
|
|
528
|
+
//
|
|
529
|
+
//
|
|
530
|
+
//
|
|
531
|
+
//
|
|
532
|
+
//
|
|
222
533
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
534
|
+
/* harmony default export */ const upload_draggervue_type_script_lang_js = ({
|
|
535
|
+
name: 'ElUploadDrag',
|
|
536
|
+
props: {
|
|
537
|
+
disabled: Boolean
|
|
227
538
|
},
|
|
228
|
-
|
|
229
|
-
|
|
230
539
|
inject: {
|
|
231
|
-
|
|
540
|
+
uploader: {
|
|
232
541
|
default: ''
|
|
233
542
|
}
|
|
234
543
|
},
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
544
|
+
data: function data() {
|
|
545
|
+
return {
|
|
546
|
+
dragover: false
|
|
547
|
+
};
|
|
548
|
+
},
|
|
549
|
+
methods: {
|
|
550
|
+
onDragover: function onDragover() {
|
|
551
|
+
if (!this.disabled) {
|
|
552
|
+
this.dragover = true;
|
|
553
|
+
}
|
|
554
|
+
},
|
|
555
|
+
onDrop: function onDrop(e) {
|
|
556
|
+
if (this.disabled || !this.uploader) return;
|
|
557
|
+
var accept = this.uploader.accept;
|
|
558
|
+
this.dragover = false;
|
|
559
|
+
if (!accept) {
|
|
560
|
+
this.$emit('file', e.dataTransfer.files);
|
|
561
|
+
return;
|
|
562
|
+
}
|
|
563
|
+
this.$emit('file', [].slice.call(e.dataTransfer.files).filter(function (file) {
|
|
564
|
+
var type = file.type,
|
|
565
|
+
name = file.name;
|
|
566
|
+
var extension = name.indexOf('.') > -1 ? "." + name.split('.').pop() : '';
|
|
567
|
+
var baseType = type.replace(/\/.*$/, '');
|
|
568
|
+
return accept.split(',').map(function (type) {
|
|
569
|
+
return type.trim();
|
|
570
|
+
}).filter(function (type) {
|
|
571
|
+
return type;
|
|
572
|
+
}).some(function (acceptedType) {
|
|
573
|
+
if (/\..+$/.test(acceptedType)) {
|
|
574
|
+
return extension === acceptedType;
|
|
575
|
+
}
|
|
576
|
+
if (/\/\*$/.test(acceptedType)) {
|
|
577
|
+
return baseType === acceptedType.replace(/\/\*$/, '');
|
|
578
|
+
}
|
|
579
|
+
if (/^[^\/]+\/[^\/]+$/.test(acceptedType)) {
|
|
580
|
+
return type === acceptedType;
|
|
581
|
+
}
|
|
582
|
+
return false;
|
|
583
|
+
});
|
|
584
|
+
}));
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
});
|
|
588
|
+
;// ./packages/upload/src/upload-dragger.vue?vue&type=script&lang=js
|
|
589
|
+
/* harmony default export */ const src_upload_draggervue_type_script_lang_js = (upload_draggervue_type_script_lang_js);
|
|
590
|
+
;// ./packages/upload/src/upload-dragger.vue
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
|
|
595
|
+
|
|
596
|
+
/* normalize component */
|
|
597
|
+
;
|
|
598
|
+
var upload_dragger_component = normalizeComponent(
|
|
599
|
+
src_upload_draggervue_type_script_lang_js,
|
|
600
|
+
upload_draggervue_type_template_id_4c315758_render,
|
|
601
|
+
upload_draggervue_type_template_id_4c315758_staticRenderFns,
|
|
602
|
+
false,
|
|
603
|
+
null,
|
|
604
|
+
null,
|
|
605
|
+
null
|
|
606
|
+
|
|
607
|
+
)
|
|
608
|
+
|
|
609
|
+
/* harmony default export */ const upload_dragger = (upload_dragger_component.exports);
|
|
610
|
+
;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./packages/upload/src/upload.vue?vue&type=script&lang=js
|
|
611
|
+
|
|
612
|
+
|
|
613
|
+
|
|
614
|
+
/* harmony default export */ const uploadvue_type_script_lang_js = ({
|
|
615
|
+
inject: ['uploader'],
|
|
616
|
+
components: {
|
|
617
|
+
UploadDragger: upload_dragger
|
|
618
|
+
},
|
|
619
|
+
props: {
|
|
620
|
+
type: String,
|
|
621
|
+
action: {
|
|
622
|
+
type: String,
|
|
623
|
+
required: true
|
|
624
|
+
},
|
|
249
625
|
name: {
|
|
250
626
|
type: String,
|
|
251
627
|
default: 'file'
|
|
252
628
|
},
|
|
253
|
-
|
|
254
|
-
|
|
629
|
+
data: Object,
|
|
630
|
+
headers: Object,
|
|
255
631
|
withCredentials: Boolean,
|
|
256
|
-
|
|
257
|
-
type: Boolean,
|
|
258
|
-
default: true
|
|
259
|
-
},
|
|
632
|
+
multiple: Boolean,
|
|
260
633
|
accept: String,
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
634
|
+
onStart: Function,
|
|
635
|
+
onProgress: Function,
|
|
636
|
+
onSuccess: Function,
|
|
637
|
+
onError: Function,
|
|
265
638
|
beforeUpload: Function,
|
|
266
|
-
|
|
267
|
-
onRemove: {
|
|
268
|
-
type: Function,
|
|
269
|
-
default: noop
|
|
270
|
-
},
|
|
271
|
-
onChange: {
|
|
272
|
-
type: Function,
|
|
273
|
-
default: noop
|
|
274
|
-
},
|
|
639
|
+
drag: Boolean,
|
|
275
640
|
onPreview: {
|
|
276
|
-
type: Function
|
|
277
|
-
},
|
|
278
|
-
onSuccess: {
|
|
279
641
|
type: Function,
|
|
280
|
-
default:
|
|
642
|
+
default: function _default() {}
|
|
281
643
|
},
|
|
282
|
-
|
|
644
|
+
onRemove: {
|
|
283
645
|
type: Function,
|
|
284
|
-
default:
|
|
646
|
+
default: function _default() {}
|
|
285
647
|
},
|
|
286
|
-
|
|
648
|
+
fileList: Array,
|
|
649
|
+
autoUpload: Boolean,
|
|
650
|
+
listType: String,
|
|
651
|
+
httpRequest: {
|
|
287
652
|
type: Function,
|
|
288
|
-
default:
|
|
289
|
-
},
|
|
290
|
-
fileList: {
|
|
291
|
-
type: Array,
|
|
292
|
-
default: function _default() {
|
|
293
|
-
return [];
|
|
294
|
-
}
|
|
295
|
-
},
|
|
296
|
-
autoUpload: {
|
|
297
|
-
type: Boolean,
|
|
298
|
-
default: true
|
|
299
|
-
},
|
|
300
|
-
listType: {
|
|
301
|
-
type: String,
|
|
302
|
-
default: 'text' // text,picture,picture-card
|
|
653
|
+
default: upload
|
|
303
654
|
},
|
|
304
|
-
httpRequest: Function,
|
|
305
655
|
disabled: Boolean,
|
|
306
656
|
limit: Number,
|
|
307
|
-
onExceed:
|
|
308
|
-
type: Function,
|
|
309
|
-
default: noop
|
|
310
|
-
}
|
|
657
|
+
onExceed: Function
|
|
311
658
|
},
|
|
312
|
-
|
|
313
659
|
data: function data() {
|
|
314
660
|
return {
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
draging: false,
|
|
318
|
-
tempIndex: 1
|
|
661
|
+
mouseover: false,
|
|
662
|
+
reqs: {}
|
|
319
663
|
};
|
|
320
664
|
},
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
computed: {
|
|
324
|
-
uploadDisabled: function uploadDisabled() {
|
|
325
|
-
return this.disabled || (this.elForm || {}).disabled;
|
|
326
|
-
}
|
|
327
|
-
},
|
|
328
|
-
|
|
329
|
-
watch: {
|
|
330
|
-
fileList: {
|
|
331
|
-
immediate: true,
|
|
332
|
-
handler: function handler(fileList) {
|
|
333
|
-
var _this = this;
|
|
334
|
-
|
|
335
|
-
this.uploadFiles = fileList.map(function (item) {
|
|
336
|
-
item.uid = item.uid || Date.now() + _this.tempIndex++;
|
|
337
|
-
item.status = item.status || 'success';
|
|
338
|
-
return item;
|
|
339
|
-
});
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
},
|
|
343
|
-
|
|
344
665
|
methods: {
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
var file = {
|
|
348
|
-
status: 'ready',
|
|
349
|
-
name: rawFile.name,
|
|
350
|
-
size: rawFile.size,
|
|
351
|
-
percentage: 0,
|
|
352
|
-
uid: rawFile.uid,
|
|
353
|
-
raw: rawFile
|
|
354
|
-
};
|
|
355
|
-
|
|
356
|
-
try {
|
|
357
|
-
file.url = URL.createObjectURL(rawFile);
|
|
358
|
-
} catch (err) {
|
|
359
|
-
console.error(err);
|
|
360
|
-
return;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
this.uploadFiles.push(file);
|
|
364
|
-
this.onChange(file, this.uploadFiles);
|
|
666
|
+
isImage: function isImage(str) {
|
|
667
|
+
return str.indexOf('image') !== -1;
|
|
365
668
|
},
|
|
366
|
-
|
|
367
|
-
var
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
file.percentage = ev.percent || 0;
|
|
669
|
+
handleChange: function handleChange(ev) {
|
|
670
|
+
var files = ev.target.files;
|
|
671
|
+
if (!files) return;
|
|
672
|
+
this.uploadFiles(files);
|
|
371
673
|
},
|
|
372
|
-
|
|
373
|
-
var
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
file.response = res;
|
|
378
|
-
|
|
379
|
-
this.onSuccess(res, file, this.uploadFiles);
|
|
380
|
-
this.onChange(file, this.uploadFiles);
|
|
674
|
+
uploadFiles: function uploadFiles(files) {
|
|
675
|
+
var _this = this;
|
|
676
|
+
if (this.limit && this.fileList.length + files.length > this.limit) {
|
|
677
|
+
this.onExceed && this.onExceed(files, this.fileList);
|
|
678
|
+
return;
|
|
381
679
|
}
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
var fileList = this.uploadFiles;
|
|
386
|
-
|
|
387
|
-
file.status = 'fail';
|
|
388
|
-
|
|
389
|
-
fileList.splice(fileList.indexOf(file), 1);
|
|
390
|
-
|
|
391
|
-
this.onError(err, file, this.uploadFiles);
|
|
392
|
-
this.onChange(file, this.uploadFiles);
|
|
393
|
-
},
|
|
394
|
-
handleRemove: function handleRemove(file, raw) {
|
|
395
|
-
var _this2 = this;
|
|
396
|
-
|
|
397
|
-
if (raw) {
|
|
398
|
-
file = this.getFile(raw);
|
|
680
|
+
var postFiles = Array.prototype.slice.call(files);
|
|
681
|
+
if (!this.multiple) {
|
|
682
|
+
postFiles = postFiles.slice(0, 1);
|
|
399
683
|
}
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
var fileList = _this2.uploadFiles;
|
|
403
|
-
fileList.splice(fileList.indexOf(file), 1);
|
|
404
|
-
_this2.onRemove(file, fileList);
|
|
405
|
-
};
|
|
406
|
-
|
|
407
|
-
if (!this.beforeRemove) {
|
|
408
|
-
doRemove();
|
|
409
|
-
} else if (typeof this.beforeRemove === 'function') {
|
|
410
|
-
var before = this.beforeRemove(file, this.uploadFiles);
|
|
411
|
-
if (before && before.then) {
|
|
412
|
-
before.then(function () {
|
|
413
|
-
doRemove();
|
|
414
|
-
}, noop);
|
|
415
|
-
} else if (before !== false) {
|
|
416
|
-
doRemove();
|
|
417
|
-
}
|
|
684
|
+
if (postFiles.length === 0) {
|
|
685
|
+
return;
|
|
418
686
|
}
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
var target = void 0;
|
|
423
|
-
fileList.every(function (item) {
|
|
424
|
-
target = rawFile.uid === item.uid ? item : null;
|
|
425
|
-
return !target;
|
|
687
|
+
postFiles.forEach(function (rawFile) {
|
|
688
|
+
_this.onStart(rawFile);
|
|
689
|
+
if (_this.autoUpload) _this.upload(rawFile);
|
|
426
690
|
});
|
|
427
|
-
return target;
|
|
428
|
-
},
|
|
429
|
-
abort: function abort(file) {
|
|
430
|
-
this.$refs['upload-inner'].abort(file);
|
|
431
|
-
},
|
|
432
|
-
clearFiles: function clearFiles() {
|
|
433
|
-
this.uploadFiles = [];
|
|
434
691
|
},
|
|
435
|
-
|
|
436
|
-
var
|
|
437
|
-
|
|
438
|
-
this.
|
|
439
|
-
return
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
|
|
692
|
+
upload: function upload(rawFile) {
|
|
693
|
+
var _this2 = this;
|
|
694
|
+
this.$refs.input.value = null;
|
|
695
|
+
if (!this.beforeUpload) {
|
|
696
|
+
return this.post(rawFile);
|
|
697
|
+
}
|
|
698
|
+
var before = this.beforeUpload(rawFile);
|
|
699
|
+
if (before && before.then) {
|
|
700
|
+
before.then(function (processedFile) {
|
|
701
|
+
var fileType = Object.prototype.toString.call(processedFile);
|
|
702
|
+
if (fileType === '[object File]' || fileType === '[object Blob]') {
|
|
703
|
+
if (fileType === '[object Blob]') {
|
|
704
|
+
processedFile = new File([processedFile], rawFile.name, {
|
|
705
|
+
type: rawFile.type
|
|
706
|
+
});
|
|
707
|
+
}
|
|
708
|
+
for (var p in rawFile) {
|
|
709
|
+
if (rawFile.hasOwnProperty(p)) {
|
|
710
|
+
processedFile[p] = rawFile[p];
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
_this2.post(processedFile);
|
|
714
|
+
} else {
|
|
715
|
+
_this2.post(rawFile);
|
|
716
|
+
}
|
|
717
|
+
}, function () {
|
|
718
|
+
_this2.onRemove(null, rawFile);
|
|
719
|
+
});
|
|
720
|
+
} else if (before !== false) {
|
|
721
|
+
this.post(rawFile);
|
|
722
|
+
} else {
|
|
723
|
+
this.onRemove(null, rawFile);
|
|
724
|
+
}
|
|
443
725
|
},
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
726
|
+
abort: function abort(file) {
|
|
727
|
+
var reqs = this.reqs;
|
|
728
|
+
if (file) {
|
|
729
|
+
var uid = file;
|
|
730
|
+
if (file.uid) uid = file.uid;
|
|
731
|
+
if (reqs[uid]) {
|
|
732
|
+
reqs[uid].abort();
|
|
733
|
+
}
|
|
734
|
+
} else {
|
|
735
|
+
Object.keys(reqs).forEach(function (uid) {
|
|
736
|
+
if (reqs[uid]) reqs[uid].abort();
|
|
737
|
+
delete reqs[uid];
|
|
738
|
+
});
|
|
739
|
+
}
|
|
740
|
+
},
|
|
741
|
+
post: function post(rawFile) {
|
|
742
|
+
var _this3 = this;
|
|
743
|
+
var uid = rawFile.uid;
|
|
744
|
+
var options = {
|
|
745
|
+
headers: this.headers,
|
|
746
|
+
withCredentials: this.withCredentials,
|
|
747
|
+
file: rawFile,
|
|
748
|
+
data: this.data,
|
|
749
|
+
filename: this.name,
|
|
750
|
+
action: this.action,
|
|
751
|
+
onProgress: function onProgress(e) {
|
|
752
|
+
_this3.onProgress(e, rawFile);
|
|
753
|
+
},
|
|
754
|
+
onSuccess: function onSuccess(res) {
|
|
755
|
+
_this3.onSuccess(res, rawFile);
|
|
756
|
+
delete _this3.reqs[uid];
|
|
757
|
+
},
|
|
758
|
+
onError: function onError(err) {
|
|
759
|
+
_this3.onError(err, rawFile);
|
|
760
|
+
delete _this3.reqs[uid];
|
|
450
761
|
}
|
|
451
762
|
};
|
|
763
|
+
var req = this.httpRequest(options);
|
|
764
|
+
this.reqs[uid] = req;
|
|
765
|
+
if (req && req.then) {
|
|
766
|
+
req.then(options.onSuccess, options.onError);
|
|
767
|
+
}
|
|
768
|
+
},
|
|
769
|
+
handleClick: function handleClick() {
|
|
770
|
+
if (!this.disabled) {
|
|
771
|
+
this.$refs.input.value = null;
|
|
772
|
+
this.$refs.input.click();
|
|
773
|
+
}
|
|
774
|
+
},
|
|
775
|
+
handleKeydown: function handleKeydown(e) {
|
|
776
|
+
if (e.target !== e.currentTarget) return;
|
|
777
|
+
if (e.keyCode === 13 || e.keyCode === 32) {
|
|
778
|
+
this.handleClick();
|
|
779
|
+
}
|
|
452
780
|
}
|
|
453
781
|
},
|
|
454
|
-
|
|
455
782
|
render: function render(h) {
|
|
456
|
-
var
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
});
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
var uploadData = {
|
|
473
|
-
props: {
|
|
474
|
-
type: this.type,
|
|
475
|
-
drag: this.drag,
|
|
476
|
-
action: this.action,
|
|
477
|
-
multiple: this.multiple,
|
|
478
|
-
'before-upload': this.beforeUpload,
|
|
479
|
-
'with-credentials': this.withCredentials,
|
|
480
|
-
headers: this.headers,
|
|
481
|
-
name: this.name,
|
|
482
|
-
data: this.data,
|
|
483
|
-
accept: this.accept,
|
|
484
|
-
fileList: this.uploadFiles,
|
|
485
|
-
autoUpload: this.autoUpload,
|
|
486
|
-
listType: this.listType,
|
|
487
|
-
disabled: this.uploadDisabled,
|
|
488
|
-
limit: this.limit,
|
|
489
|
-
'on-exceed': this.onExceed,
|
|
490
|
-
'on-start': this.handleStart,
|
|
491
|
-
'on-progress': this.handleProgress,
|
|
492
|
-
'on-success': this.handleSuccess,
|
|
493
|
-
'on-error': this.handleError,
|
|
494
|
-
'on-preview': this.onPreview,
|
|
495
|
-
'on-remove': this.handleRemove,
|
|
496
|
-
'http-request': this.httpRequest
|
|
783
|
+
var handleClick = this.handleClick,
|
|
784
|
+
drag = this.drag,
|
|
785
|
+
name = this.name,
|
|
786
|
+
handleChange = this.handleChange,
|
|
787
|
+
multiple = this.multiple,
|
|
788
|
+
accept = this.accept,
|
|
789
|
+
listType = this.listType,
|
|
790
|
+
uploadFiles = this.uploadFiles,
|
|
791
|
+
disabled = this.disabled,
|
|
792
|
+
handleKeydown = this.handleKeydown;
|
|
793
|
+
var data = {
|
|
794
|
+
class: {
|
|
795
|
+
'el-upload': true
|
|
497
796
|
},
|
|
498
|
-
|
|
797
|
+
on: {
|
|
798
|
+
click: handleClick,
|
|
799
|
+
keydown: handleKeydown
|
|
800
|
+
}
|
|
499
801
|
};
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
802
|
+
data.class["el-upload--" + listType] = true;
|
|
803
|
+
return h("div", helper_default()([{}, data, {
|
|
804
|
+
"attrs": {
|
|
805
|
+
"tabindex": "0"
|
|
806
|
+
}
|
|
807
|
+
}]), [drag ? h("upload-dragger", {
|
|
808
|
+
"attrs": {
|
|
809
|
+
"disabled": disabled
|
|
810
|
+
},
|
|
811
|
+
"on": {
|
|
812
|
+
"file": uploadFiles
|
|
813
|
+
}
|
|
814
|
+
}, [this.$slots.default]) : this.$slots.default, h("input", {
|
|
815
|
+
"class": "el-upload__input",
|
|
816
|
+
"attrs": {
|
|
817
|
+
"type": "file",
|
|
818
|
+
"name": name,
|
|
819
|
+
"multiple": multiple,
|
|
820
|
+
"accept": accept
|
|
821
|
+
},
|
|
822
|
+
"ref": "input",
|
|
823
|
+
"on": {
|
|
824
|
+
"change": handleChange
|
|
825
|
+
}
|
|
826
|
+
})]);
|
|
513
827
|
}
|
|
514
|
-
};
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
828
|
+
});
|
|
829
|
+
;// ./packages/upload/src/upload.vue?vue&type=script&lang=js
|
|
830
|
+
/* harmony default export */ const src_uploadvue_type_script_lang_js = (uploadvue_type_script_lang_js);
|
|
831
|
+
;// ./packages/upload/src/upload.vue
|
|
832
|
+
var upload_render, upload_staticRenderFns
|
|
833
|
+
;
|
|
834
|
+
|
|
835
|
+
|
|
836
|
+
|
|
837
|
+
/* normalize component */
|
|
838
|
+
;
|
|
839
|
+
var upload_component = normalizeComponent(
|
|
840
|
+
src_uploadvue_type_script_lang_js,
|
|
841
|
+
upload_render,
|
|
842
|
+
upload_staticRenderFns,
|
|
843
|
+
false,
|
|
844
|
+
null,
|
|
845
|
+
null,
|
|
846
|
+
null
|
|
847
|
+
|
|
848
|
+
)
|
|
529
849
|
|
|
530
|
-
|
|
850
|
+
/* harmony default export */ const src_upload = (upload_component.exports);
|
|
851
|
+
;// external "mazey-element-ui/lib/mixins/migrating"
|
|
852
|
+
const migrating_namespaceObject = require("mazey-element-ui/lib/mixins/migrating");
|
|
853
|
+
var migrating_default = /*#__PURE__*/__webpack_require__.n(migrating_namespaceObject);
|
|
854
|
+
;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./packages/upload/src/index.vue?vue&type=script&lang=js
|
|
531
855
|
|
|
532
|
-
var _progress2 = _interopRequireDefault(_progress);
|
|
533
856
|
|
|
534
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
535
857
|
|
|
536
|
-
//
|
|
537
|
-
//
|
|
538
|
-
//
|
|
539
|
-
//
|
|
540
|
-
//
|
|
541
|
-
//
|
|
542
|
-
//
|
|
543
|
-
//
|
|
544
|
-
//
|
|
545
|
-
//
|
|
546
|
-
//
|
|
547
|
-
//
|
|
548
|
-
//
|
|
549
|
-
//
|
|
550
|
-
//
|
|
551
|
-
//
|
|
552
|
-
//
|
|
553
|
-
//
|
|
554
|
-
//
|
|
555
|
-
//
|
|
556
|
-
//
|
|
557
|
-
//
|
|
558
|
-
//
|
|
559
|
-
//
|
|
560
|
-
//
|
|
561
|
-
//
|
|
562
|
-
//
|
|
563
|
-
//
|
|
564
|
-
//
|
|
565
|
-
//
|
|
566
|
-
//
|
|
567
|
-
//
|
|
568
|
-
//
|
|
569
|
-
//
|
|
570
|
-
//
|
|
571
|
-
//
|
|
572
|
-
//
|
|
573
|
-
//
|
|
574
|
-
//
|
|
575
|
-
//
|
|
576
|
-
//
|
|
577
|
-
//
|
|
578
|
-
//
|
|
579
|
-
//
|
|
580
|
-
//
|
|
581
|
-
//
|
|
582
|
-
//
|
|
583
|
-
//
|
|
584
|
-
//
|
|
585
|
-
//
|
|
586
|
-
//
|
|
587
|
-
//
|
|
588
|
-
//
|
|
589
|
-
//
|
|
590
|
-
//
|
|
591
|
-
//
|
|
592
|
-
//
|
|
593
|
-
//
|
|
594
|
-
//
|
|
595
|
-
//
|
|
596
|
-
//
|
|
597
|
-
//
|
|
598
858
|
|
|
599
|
-
exports.default = {
|
|
600
|
-
mixins: [_locale2.default],
|
|
601
859
|
|
|
602
|
-
|
|
860
|
+
function noop() {}
|
|
861
|
+
/* harmony default export */ const srcvue_type_script_lang_js = ({
|
|
862
|
+
name: 'ElUpload',
|
|
863
|
+
mixins: [(migrating_default())],
|
|
864
|
+
components: {
|
|
865
|
+
ElProgress: (progress_default()),
|
|
866
|
+
UploadList: upload_list,
|
|
867
|
+
Upload: src_upload
|
|
868
|
+
},
|
|
869
|
+
provide: function provide() {
|
|
603
870
|
return {
|
|
604
|
-
|
|
871
|
+
uploader: this
|
|
605
872
|
};
|
|
606
873
|
},
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
874
|
+
inject: {
|
|
875
|
+
elForm: {
|
|
876
|
+
default: ''
|
|
877
|
+
}
|
|
878
|
+
},
|
|
610
879
|
props: {
|
|
611
|
-
|
|
612
|
-
type:
|
|
880
|
+
action: {
|
|
881
|
+
type: String,
|
|
882
|
+
required: true
|
|
883
|
+
},
|
|
884
|
+
headers: {
|
|
885
|
+
type: Object,
|
|
613
886
|
default: function _default() {
|
|
614
|
-
return
|
|
887
|
+
return {};
|
|
615
888
|
}
|
|
616
889
|
},
|
|
617
|
-
|
|
890
|
+
data: Object,
|
|
891
|
+
multiple: Boolean,
|
|
892
|
+
name: {
|
|
893
|
+
type: String,
|
|
894
|
+
default: 'file'
|
|
895
|
+
},
|
|
896
|
+
drag: Boolean,
|
|
897
|
+
dragger: Boolean,
|
|
898
|
+
withCredentials: Boolean,
|
|
899
|
+
showFileList: {
|
|
618
900
|
type: Boolean,
|
|
619
|
-
default:
|
|
901
|
+
default: true
|
|
620
902
|
},
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
},
|
|
624
|
-
methods: {
|
|
625
|
-
parsePercentage: function parsePercentage(val) {
|
|
626
|
-
return parseInt(val, 10);
|
|
627
|
-
},
|
|
628
|
-
handleClick: function handleClick(file) {
|
|
629
|
-
this.handlePreview && this.handlePreview(file);
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
};
|
|
633
|
-
|
|
634
|
-
/***/ }),
|
|
635
|
-
|
|
636
|
-
/***/ 107:
|
|
637
|
-
/***/ (function(module, exports) {
|
|
638
|
-
|
|
639
|
-
module.exports = require("element-ui/lib/progress");
|
|
640
|
-
|
|
641
|
-
/***/ }),
|
|
642
|
-
|
|
643
|
-
/***/ 108:
|
|
644
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
645
|
-
|
|
646
|
-
"use strict";
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
exports.__esModule = true;
|
|
650
|
-
|
|
651
|
-
var _babelHelperVueJsxMergeProps = __webpack_require__(45);
|
|
652
|
-
|
|
653
|
-
var _babelHelperVueJsxMergeProps2 = _interopRequireDefault(_babelHelperVueJsxMergeProps);
|
|
654
|
-
|
|
655
|
-
var _ajax = __webpack_require__(325);
|
|
656
|
-
|
|
657
|
-
var _ajax2 = _interopRequireDefault(_ajax);
|
|
658
|
-
|
|
659
|
-
var _uploadDragger = __webpack_require__(109);
|
|
660
|
-
|
|
661
|
-
var _uploadDragger2 = _interopRequireDefault(_uploadDragger);
|
|
662
|
-
|
|
663
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
664
|
-
|
|
665
|
-
exports.default = {
|
|
666
|
-
inject: ['uploader'],
|
|
667
|
-
components: {
|
|
668
|
-
UploadDragger: _uploadDragger2.default
|
|
669
|
-
},
|
|
670
|
-
props: {
|
|
671
|
-
type: String,
|
|
672
|
-
action: {
|
|
673
|
-
type: String,
|
|
674
|
-
required: true
|
|
675
|
-
},
|
|
676
|
-
name: {
|
|
903
|
+
accept: String,
|
|
904
|
+
type: {
|
|
677
905
|
type: String,
|
|
678
|
-
default: '
|
|
906
|
+
default: 'select'
|
|
679
907
|
},
|
|
680
|
-
data: Object,
|
|
681
|
-
headers: Object,
|
|
682
|
-
withCredentials: Boolean,
|
|
683
|
-
multiple: Boolean,
|
|
684
|
-
accept: String,
|
|
685
|
-
onStart: Function,
|
|
686
|
-
onProgress: Function,
|
|
687
|
-
onSuccess: Function,
|
|
688
|
-
onError: Function,
|
|
689
908
|
beforeUpload: Function,
|
|
690
|
-
|
|
909
|
+
beforeRemove: Function,
|
|
910
|
+
onRemove: {
|
|
911
|
+
type: Function,
|
|
912
|
+
default: noop
|
|
913
|
+
},
|
|
914
|
+
onChange: {
|
|
915
|
+
type: Function,
|
|
916
|
+
default: noop
|
|
917
|
+
},
|
|
691
918
|
onPreview: {
|
|
919
|
+
type: Function
|
|
920
|
+
},
|
|
921
|
+
onSuccess: {
|
|
692
922
|
type: Function,
|
|
693
|
-
default:
|
|
923
|
+
default: noop
|
|
694
924
|
},
|
|
695
|
-
|
|
925
|
+
onProgress: {
|
|
696
926
|
type: Function,
|
|
697
|
-
default:
|
|
927
|
+
default: noop
|
|
698
928
|
},
|
|
699
|
-
|
|
700
|
-
autoUpload: Boolean,
|
|
701
|
-
listType: String,
|
|
702
|
-
httpRequest: {
|
|
929
|
+
onError: {
|
|
703
930
|
type: Function,
|
|
704
|
-
default:
|
|
931
|
+
default: noop
|
|
932
|
+
},
|
|
933
|
+
fileList: {
|
|
934
|
+
type: Array,
|
|
935
|
+
default: function _default() {
|
|
936
|
+
return [];
|
|
937
|
+
}
|
|
938
|
+
},
|
|
939
|
+
autoUpload: {
|
|
940
|
+
type: Boolean,
|
|
941
|
+
default: true
|
|
942
|
+
},
|
|
943
|
+
listType: {
|
|
944
|
+
type: String,
|
|
945
|
+
default: 'text' // text,picture,picture-card
|
|
705
946
|
},
|
|
947
|
+
httpRequest: Function,
|
|
706
948
|
disabled: Boolean,
|
|
707
949
|
limit: Number,
|
|
708
|
-
onExceed:
|
|
950
|
+
onExceed: {
|
|
951
|
+
type: Function,
|
|
952
|
+
default: noop
|
|
953
|
+
}
|
|
709
954
|
},
|
|
710
|
-
|
|
711
955
|
data: function data() {
|
|
712
956
|
return {
|
|
713
|
-
|
|
714
|
-
|
|
957
|
+
uploadFiles: [],
|
|
958
|
+
dragOver: false,
|
|
959
|
+
draging: false,
|
|
960
|
+
tempIndex: 1
|
|
715
961
|
};
|
|
716
962
|
},
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
if (this.limit && this.fileList.length + files.length > this.limit) {
|
|
733
|
-
this.onExceed && this.onExceed(files, this.fileList);
|
|
734
|
-
return;
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
var postFiles = Array.prototype.slice.call(files);
|
|
738
|
-
if (!this.multiple) {
|
|
739
|
-
postFiles = postFiles.slice(0, 1);
|
|
740
|
-
}
|
|
741
|
-
|
|
742
|
-
if (postFiles.length === 0) {
|
|
743
|
-
return;
|
|
744
|
-
}
|
|
745
|
-
|
|
746
|
-
postFiles.forEach(function (rawFile) {
|
|
747
|
-
_this.onStart(rawFile);
|
|
748
|
-
if (_this.autoUpload) _this.upload(rawFile);
|
|
749
|
-
});
|
|
750
|
-
},
|
|
751
|
-
upload: function upload(rawFile) {
|
|
752
|
-
var _this2 = this;
|
|
753
|
-
|
|
754
|
-
this.$refs.input.value = null;
|
|
755
|
-
|
|
756
|
-
if (!this.beforeUpload) {
|
|
757
|
-
return this.post(rawFile);
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
var before = this.beforeUpload(rawFile);
|
|
761
|
-
if (before && before.then) {
|
|
762
|
-
before.then(function (processedFile) {
|
|
763
|
-
var fileType = Object.prototype.toString.call(processedFile);
|
|
764
|
-
|
|
765
|
-
if (fileType === '[object File]' || fileType === '[object Blob]') {
|
|
766
|
-
if (fileType === '[object Blob]') {
|
|
767
|
-
processedFile = new File([processedFile], rawFile.name, {
|
|
768
|
-
type: rawFile.type
|
|
769
|
-
});
|
|
770
|
-
}
|
|
771
|
-
for (var p in rawFile) {
|
|
772
|
-
if (rawFile.hasOwnProperty(p)) {
|
|
773
|
-
processedFile[p] = rawFile[p];
|
|
774
|
-
}
|
|
963
|
+
computed: {
|
|
964
|
+
uploadDisabled: function uploadDisabled() {
|
|
965
|
+
return this.disabled || (this.elForm || {}).disabled;
|
|
966
|
+
}
|
|
967
|
+
},
|
|
968
|
+
watch: {
|
|
969
|
+
listType: function listType(type) {
|
|
970
|
+
if (type === 'picture-card' || type === 'picture') {
|
|
971
|
+
this.uploadFiles = this.uploadFiles.map(function (file) {
|
|
972
|
+
if (!file.url && file.raw) {
|
|
973
|
+
try {
|
|
974
|
+
file.url = URL.createObjectURL(file.raw);
|
|
975
|
+
} catch (err) {
|
|
976
|
+
console.error('[Element Error][Upload]', err);
|
|
775
977
|
}
|
|
776
|
-
_this2.post(processedFile);
|
|
777
|
-
} else {
|
|
778
|
-
_this2.post(rawFile);
|
|
779
978
|
}
|
|
780
|
-
|
|
781
|
-
_this2.onRemove(null, rawFile);
|
|
979
|
+
return file;
|
|
782
980
|
});
|
|
783
|
-
} else if (before !== false) {
|
|
784
|
-
this.post(rawFile);
|
|
785
|
-
} else {
|
|
786
|
-
this.onRemove(null, rawFile);
|
|
787
981
|
}
|
|
788
982
|
},
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
}
|
|
798
|
-
} else {
|
|
799
|
-
Object.keys(reqs).forEach(function (uid) {
|
|
800
|
-
if (reqs[uid]) reqs[uid].abort();
|
|
801
|
-
delete reqs[uid];
|
|
983
|
+
fileList: {
|
|
984
|
+
immediate: true,
|
|
985
|
+
handler: function handler(fileList) {
|
|
986
|
+
var _this = this;
|
|
987
|
+
this.uploadFiles = fileList.map(function (item) {
|
|
988
|
+
item.uid = item.uid || Date.now() + _this.tempIndex++;
|
|
989
|
+
item.status = item.status || 'success';
|
|
990
|
+
return item;
|
|
802
991
|
});
|
|
803
992
|
}
|
|
804
|
-
}
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
action: this.action,
|
|
817
|
-
onProgress: function onProgress(e) {
|
|
818
|
-
_this3.onProgress(e, rawFile);
|
|
819
|
-
},
|
|
820
|
-
onSuccess: function onSuccess(res) {
|
|
821
|
-
_this3.onSuccess(res, rawFile);
|
|
822
|
-
delete _this3.reqs[uid];
|
|
823
|
-
},
|
|
824
|
-
onError: function onError(err) {
|
|
825
|
-
_this3.onError(err, rawFile);
|
|
826
|
-
delete _this3.reqs[uid];
|
|
827
|
-
}
|
|
993
|
+
}
|
|
994
|
+
},
|
|
995
|
+
methods: {
|
|
996
|
+
handleStart: function handleStart(rawFile) {
|
|
997
|
+
rawFile.uid = Date.now() + this.tempIndex++;
|
|
998
|
+
var file = {
|
|
999
|
+
status: 'ready',
|
|
1000
|
+
name: rawFile.name,
|
|
1001
|
+
size: rawFile.size,
|
|
1002
|
+
percentage: 0,
|
|
1003
|
+
uid: rawFile.uid,
|
|
1004
|
+
raw: rawFile
|
|
828
1005
|
};
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
1006
|
+
if (this.listType === 'picture-card' || this.listType === 'picture') {
|
|
1007
|
+
try {
|
|
1008
|
+
file.url = URL.createObjectURL(rawFile);
|
|
1009
|
+
} catch (err) {
|
|
1010
|
+
console.error('[Element Error][Upload]', err);
|
|
1011
|
+
return;
|
|
1012
|
+
}
|
|
833
1013
|
}
|
|
1014
|
+
this.uploadFiles.push(file);
|
|
1015
|
+
this.onChange(file, this.uploadFiles);
|
|
834
1016
|
},
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
1017
|
+
handleProgress: function handleProgress(ev, rawFile) {
|
|
1018
|
+
var file = this.getFile(rawFile);
|
|
1019
|
+
this.onProgress(ev, file, this.uploadFiles);
|
|
1020
|
+
file.status = 'uploading';
|
|
1021
|
+
file.percentage = ev.percent || 0;
|
|
1022
|
+
},
|
|
1023
|
+
handleSuccess: function handleSuccess(res, rawFile) {
|
|
1024
|
+
var file = this.getFile(rawFile);
|
|
1025
|
+
if (file) {
|
|
1026
|
+
file.status = 'success';
|
|
1027
|
+
file.response = res;
|
|
1028
|
+
this.onSuccess(res, file, this.uploadFiles);
|
|
1029
|
+
this.onChange(file, this.uploadFiles);
|
|
839
1030
|
}
|
|
840
1031
|
},
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
handleChange = this.handleChange,
|
|
854
|
-
multiple = this.multiple,
|
|
855
|
-
accept = this.accept,
|
|
856
|
-
listType = this.listType,
|
|
857
|
-
uploadFiles = this.uploadFiles,
|
|
858
|
-
disabled = this.disabled,
|
|
859
|
-
handleKeydown = this.handleKeydown;
|
|
860
|
-
|
|
861
|
-
var data = {
|
|
862
|
-
class: {
|
|
863
|
-
'el-upload': true
|
|
864
|
-
},
|
|
865
|
-
on: {
|
|
866
|
-
click: handleClick,
|
|
867
|
-
keydown: handleKeydown
|
|
1032
|
+
handleError: function handleError(err, rawFile) {
|
|
1033
|
+
var file = this.getFile(rawFile);
|
|
1034
|
+
var fileList = this.uploadFiles;
|
|
1035
|
+
file.status = 'fail';
|
|
1036
|
+
fileList.splice(fileList.indexOf(file), 1);
|
|
1037
|
+
this.onError(err, file, this.uploadFiles);
|
|
1038
|
+
this.onChange(file, this.uploadFiles);
|
|
1039
|
+
},
|
|
1040
|
+
handleRemove: function handleRemove(file, raw) {
|
|
1041
|
+
var _this2 = this;
|
|
1042
|
+
if (raw) {
|
|
1043
|
+
file = this.getFile(raw);
|
|
868
1044
|
}
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
}
|
|
883
|
-
}
|
|
884
|
-
|
|
885
|
-
) : this.$slots.default, h('input', { 'class': 'el-upload__input', attrs: { type: 'file', name: name, multiple: multiple, accept: accept },
|
|
886
|
-
ref: 'input', on: {
|
|
887
|
-
'change': handleChange
|
|
1045
|
+
var doRemove = function doRemove() {
|
|
1046
|
+
_this2.abort(file);
|
|
1047
|
+
var fileList = _this2.uploadFiles;
|
|
1048
|
+
fileList.splice(fileList.indexOf(file), 1);
|
|
1049
|
+
_this2.onRemove(file, fileList);
|
|
1050
|
+
};
|
|
1051
|
+
if (!this.beforeRemove) {
|
|
1052
|
+
doRemove();
|
|
1053
|
+
} else if (typeof this.beforeRemove === 'function') {
|
|
1054
|
+
var before = this.beforeRemove(file, this.uploadFiles);
|
|
1055
|
+
if (before && before.then) {
|
|
1056
|
+
before.then(function () {
|
|
1057
|
+
doRemove();
|
|
1058
|
+
}, noop);
|
|
1059
|
+
} else if (before !== false) {
|
|
1060
|
+
doRemove();
|
|
888
1061
|
}
|
|
889
|
-
})]
|
|
890
|
-
);
|
|
891
|
-
}
|
|
892
|
-
};
|
|
893
|
-
|
|
894
|
-
/***/ }),
|
|
895
|
-
|
|
896
|
-
/***/ 109:
|
|
897
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
898
|
-
|
|
899
|
-
"use strict";
|
|
900
|
-
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
|
901
|
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_13_7_3_vue_loader_lib_selector_type_script_index_0_upload_dragger_vue__ = __webpack_require__(110);
|
|
902
|
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_13_7_3_vue_loader_lib_selector_type_script_index_0_upload_dragger_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_13_7_3_vue_loader_lib_selector_type_script_index_0_upload_dragger_vue__);
|
|
903
|
-
/* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_13_7_3_vue_loader_lib_selector_type_script_index_0_upload_dragger_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_13_7_3_vue_loader_lib_selector_type_script_index_0_upload_dragger_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
|
|
904
|
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_13_7_3_vue_loader_lib_template_compiler_index_id_data_v_4c315758_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_13_7_3_vue_loader_lib_selector_type_template_index_0_upload_dragger_vue__ = __webpack_require__(326);
|
|
905
|
-
var normalizeComponent = __webpack_require__(0)
|
|
906
|
-
/* script */
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
/* template */
|
|
910
|
-
|
|
911
|
-
/* template functional */
|
|
912
|
-
var __vue_template_functional__ = false
|
|
913
|
-
/* styles */
|
|
914
|
-
var __vue_styles__ = null
|
|
915
|
-
/* scopeId */
|
|
916
|
-
var __vue_scopeId__ = null
|
|
917
|
-
/* moduleIdentifier (server only) */
|
|
918
|
-
var __vue_module_identifier__ = null
|
|
919
|
-
var Component = normalizeComponent(
|
|
920
|
-
__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_13_7_3_vue_loader_lib_selector_type_script_index_0_upload_dragger_vue___default.a,
|
|
921
|
-
__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_13_7_3_vue_loader_lib_template_compiler_index_id_data_v_4c315758_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_13_7_3_vue_loader_lib_selector_type_template_index_0_upload_dragger_vue__["a" /* default */],
|
|
922
|
-
__vue_template_functional__,
|
|
923
|
-
__vue_styles__,
|
|
924
|
-
__vue_scopeId__,
|
|
925
|
-
__vue_module_identifier__
|
|
926
|
-
)
|
|
927
|
-
|
|
928
|
-
/* harmony default export */ __webpack_exports__["default"] = (Component.exports);
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
/***/ }),
|
|
932
|
-
|
|
933
|
-
/***/ 110:
|
|
934
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
935
|
-
|
|
936
|
-
"use strict";
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
exports.__esModule = true;
|
|
940
|
-
//
|
|
941
|
-
//
|
|
942
|
-
//
|
|
943
|
-
//
|
|
944
|
-
//
|
|
945
|
-
//
|
|
946
|
-
//
|
|
947
|
-
//
|
|
948
|
-
//
|
|
949
|
-
//
|
|
950
|
-
//
|
|
951
|
-
//
|
|
952
|
-
//
|
|
953
|
-
|
|
954
|
-
exports.default = {
|
|
955
|
-
name: 'ElUploadDrag',
|
|
956
|
-
props: {
|
|
957
|
-
disabled: Boolean
|
|
958
|
-
},
|
|
959
|
-
inject: {
|
|
960
|
-
uploader: {
|
|
961
|
-
default: ''
|
|
962
|
-
}
|
|
963
|
-
},
|
|
964
|
-
data: function data() {
|
|
965
|
-
return {
|
|
966
|
-
dragover: false
|
|
967
|
-
};
|
|
968
|
-
},
|
|
969
|
-
|
|
970
|
-
methods: {
|
|
971
|
-
onDragover: function onDragover() {
|
|
972
|
-
if (!this.disabled) {
|
|
973
|
-
this.dragover = true;
|
|
974
1062
|
}
|
|
975
1063
|
},
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
var
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
this.$emit('file', [].slice.call(e.dataTransfer.files).filter(function (file) {
|
|
985
|
-
var type = file.type,
|
|
986
|
-
name = file.name;
|
|
987
|
-
|
|
988
|
-
var extension = name.indexOf('.') > -1 ? '.' + name.split('.').pop() : '';
|
|
989
|
-
var baseType = type.replace(/\/.*$/, '');
|
|
990
|
-
return accept.split(',').map(function (type) {
|
|
991
|
-
return type.trim();
|
|
992
|
-
}).filter(function (type) {
|
|
993
|
-
return type;
|
|
994
|
-
}).some(function (acceptedType) {
|
|
995
|
-
if (/\..+$/.test(acceptedType)) {
|
|
996
|
-
return extension === acceptedType;
|
|
997
|
-
}
|
|
998
|
-
if (/\/\*$/.test(acceptedType)) {
|
|
999
|
-
return baseType === acceptedType.replace(/\/\*$/, '');
|
|
1000
|
-
}
|
|
1001
|
-
if (/^[^\/]+\/[^\/]+$/.test(acceptedType)) {
|
|
1002
|
-
return type === acceptedType;
|
|
1003
|
-
}
|
|
1004
|
-
return false;
|
|
1005
|
-
});
|
|
1006
|
-
}));
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
};
|
|
1010
|
-
|
|
1011
|
-
/***/ }),
|
|
1012
|
-
|
|
1013
|
-
/***/ 111:
|
|
1014
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
1015
|
-
|
|
1016
|
-
"use strict";
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
exports.__esModule = true;
|
|
1020
|
-
|
|
1021
|
-
var _uploadDragger = __webpack_require__(109);
|
|
1022
|
-
|
|
1023
|
-
var _uploadDragger2 = _interopRequireDefault(_uploadDragger);
|
|
1024
|
-
|
|
1025
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1026
|
-
|
|
1027
|
-
exports.default = {
|
|
1028
|
-
components: {
|
|
1029
|
-
UploadDragger: _uploadDragger2.default
|
|
1030
|
-
},
|
|
1031
|
-
props: {
|
|
1032
|
-
type: String,
|
|
1033
|
-
data: {},
|
|
1034
|
-
action: {
|
|
1035
|
-
type: String,
|
|
1036
|
-
required: true
|
|
1037
|
-
},
|
|
1038
|
-
name: {
|
|
1039
|
-
type: String,
|
|
1040
|
-
default: 'file'
|
|
1041
|
-
},
|
|
1042
|
-
withCredentials: Boolean,
|
|
1043
|
-
accept: String,
|
|
1044
|
-
onStart: Function,
|
|
1045
|
-
onProgress: Function,
|
|
1046
|
-
onSuccess: Function,
|
|
1047
|
-
onError: Function,
|
|
1048
|
-
beforeUpload: Function,
|
|
1049
|
-
onPreview: {
|
|
1050
|
-
type: Function,
|
|
1051
|
-
default: function _default() {}
|
|
1052
|
-
},
|
|
1053
|
-
onRemove: {
|
|
1054
|
-
type: Function,
|
|
1055
|
-
default: function _default() {}
|
|
1064
|
+
getFile: function getFile(rawFile) {
|
|
1065
|
+
var fileList = this.uploadFiles;
|
|
1066
|
+
var target;
|
|
1067
|
+
fileList.every(function (item) {
|
|
1068
|
+
target = rawFile.uid === item.uid ? item : null;
|
|
1069
|
+
return !target;
|
|
1070
|
+
});
|
|
1071
|
+
return target;
|
|
1056
1072
|
},
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
disabled: Boolean,
|
|
1060
|
-
limit: Number,
|
|
1061
|
-
onExceed: Function
|
|
1062
|
-
},
|
|
1063
|
-
|
|
1064
|
-
data: function data() {
|
|
1065
|
-
return {
|
|
1066
|
-
mouseover: false,
|
|
1067
|
-
domain: '',
|
|
1068
|
-
file: null,
|
|
1069
|
-
submitting: false
|
|
1070
|
-
};
|
|
1071
|
-
},
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
methods: {
|
|
1075
|
-
isImage: function isImage(str) {
|
|
1076
|
-
return str.indexOf('image') !== -1;
|
|
1073
|
+
abort: function abort(file) {
|
|
1074
|
+
this.$refs['upload-inner'].abort(file);
|
|
1077
1075
|
},
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
this.$refs.input.click();
|
|
1081
|
-
}
|
|
1076
|
+
clearFiles: function clearFiles() {
|
|
1077
|
+
this.uploadFiles = [];
|
|
1082
1078
|
},
|
|
1083
|
-
|
|
1084
|
-
var
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
}
|
|
1079
|
+
submit: function submit() {
|
|
1080
|
+
var _this3 = this;
|
|
1081
|
+
this.uploadFiles.filter(function (file) {
|
|
1082
|
+
return file.status === 'ready';
|
|
1083
|
+
}).forEach(function (file) {
|
|
1084
|
+
_this3.$refs['upload-inner'].upload(file.raw);
|
|
1085
|
+
});
|
|
1088
1086
|
},
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
if (this.submitting) return;
|
|
1096
|
-
this.submitting = true;
|
|
1097
|
-
this.file = file;
|
|
1098
|
-
this.onStart(file);
|
|
1099
|
-
|
|
1100
|
-
var formNode = this.getFormNode();
|
|
1101
|
-
var dataSpan = this.getFormDataNode();
|
|
1102
|
-
var data = this.data;
|
|
1103
|
-
if (typeof data === 'function') {
|
|
1104
|
-
data = data(file);
|
|
1105
|
-
}
|
|
1106
|
-
var inputs = [];
|
|
1107
|
-
for (var key in data) {
|
|
1108
|
-
if (data.hasOwnProperty(key)) {
|
|
1109
|
-
inputs.push('<input name="' + key + '" value="' + data[key] + '"/>');
|
|
1087
|
+
getMigratingConfig: function getMigratingConfig() {
|
|
1088
|
+
return {
|
|
1089
|
+
props: {
|
|
1090
|
+
'default-file-list': 'default-file-list is renamed to file-list.',
|
|
1091
|
+
'show-upload-list': 'show-upload-list is renamed to show-file-list.',
|
|
1092
|
+
'thumbnail-mode': 'thumbnail-mode has been deprecated, you can implement the same effect according to this case: http://element.eleme.io/#/zh-CN/component/upload#yong-hu-tou-xiang-shang-chuan'
|
|
1110
1093
|
}
|
|
1111
|
-
}
|
|
1112
|
-
dataSpan.innerHTML = inputs.join('');
|
|
1113
|
-
formNode.submit();
|
|
1114
|
-
dataSpan.innerHTML = '';
|
|
1115
|
-
},
|
|
1116
|
-
getFormNode: function getFormNode() {
|
|
1117
|
-
return this.$refs.form;
|
|
1118
|
-
},
|
|
1119
|
-
getFormDataNode: function getFormDataNode() {
|
|
1120
|
-
return this.$refs.data;
|
|
1094
|
+
};
|
|
1121
1095
|
}
|
|
1122
1096
|
},
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
mounted: function mounted() {
|
|
1128
|
-
var self = this;
|
|
1129
|
-
!this.$isServer && window.addEventListener('message', function (event) {
|
|
1130
|
-
if (!self.file) return;
|
|
1131
|
-
var targetOrigin = new URL(self.action).origin;
|
|
1132
|
-
if (event.origin !== targetOrigin) return;
|
|
1133
|
-
var response = event.data;
|
|
1134
|
-
if (response.result === 'success') {
|
|
1135
|
-
self.onSuccess(response, self.file);
|
|
1136
|
-
} else if (response.result === 'failed') {
|
|
1137
|
-
self.onError(response, self.file);
|
|
1097
|
+
beforeDestroy: function beforeDestroy() {
|
|
1098
|
+
this.uploadFiles.forEach(function (file) {
|
|
1099
|
+
if (file.url && file.url.indexOf('blob:') === 0) {
|
|
1100
|
+
URL.revokeObjectURL(file.url);
|
|
1138
1101
|
}
|
|
1139
|
-
|
|
1140
|
-
self.file = null;
|
|
1141
|
-
}, false);
|
|
1102
|
+
});
|
|
1142
1103
|
},
|
|
1143
1104
|
render: function render(h) {
|
|
1144
|
-
var
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
return h(
|
|
1154
|
-
'div',
|
|
1155
|
-
{
|
|
1156
|
-
'class': oClass,
|
|
1157
|
-
on: {
|
|
1158
|
-
'click': this.handleClick
|
|
1105
|
+
var _this4 = this;
|
|
1106
|
+
var uploadList;
|
|
1107
|
+
if (this.showFileList) {
|
|
1108
|
+
uploadList = h(upload_list, {
|
|
1109
|
+
"attrs": {
|
|
1110
|
+
"disabled": this.uploadDisabled,
|
|
1111
|
+
"listType": this.listType,
|
|
1112
|
+
"files": this.uploadFiles,
|
|
1113
|
+
"handlePreview": this.onPreview
|
|
1159
1114
|
},
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
'dragover': this.handleDragover,
|
|
1163
|
-
'dragleave': this.handleDragleave
|
|
1115
|
+
"on": {
|
|
1116
|
+
"remove": this.handleRemove
|
|
1164
1117
|
}
|
|
1165
|
-
},
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
ref: 'iframe',
|
|
1172
|
-
attrs: { name: frameName
|
|
1118
|
+
}, [function (props) {
|
|
1119
|
+
if (_this4.$scopedSlots.file) {
|
|
1120
|
+
return _this4.$scopedSlots.file({
|
|
1121
|
+
file: props.file
|
|
1122
|
+
});
|
|
1173
1123
|
}
|
|
1174
|
-
})
|
|
1175
|
-
'form',
|
|
1176
|
-
{ ref: 'form', attrs: { action: this.action, target: frameName, enctype: 'multipart/form-data', method: 'POST' }
|
|
1177
|
-
},
|
|
1178
|
-
[h('input', {
|
|
1179
|
-
'class': 'el-upload__input',
|
|
1180
|
-
attrs: { type: 'file',
|
|
1181
|
-
|
|
1182
|
-
name: 'file',
|
|
1183
|
-
|
|
1184
|
-
accept: this.accept },
|
|
1185
|
-
ref: 'input', on: {
|
|
1186
|
-
'change': this.handleChange
|
|
1187
|
-
}
|
|
1188
|
-
}), h('input', {
|
|
1189
|
-
attrs: { type: 'hidden', name: 'documentDomain' },
|
|
1190
|
-
domProps: {
|
|
1191
|
-
'value': this.$isServer ? '' : document.domain
|
|
1192
|
-
}
|
|
1193
|
-
}), h('span', { ref: 'data' })]
|
|
1194
|
-
), drag ? h(
|
|
1195
|
-
'upload-dragger',
|
|
1196
|
-
{
|
|
1197
|
-
on: {
|
|
1198
|
-
'file': uploadFiles
|
|
1199
|
-
},
|
|
1200
|
-
attrs: { disabled: disabled }
|
|
1201
|
-
},
|
|
1202
|
-
[this.$slots.default]
|
|
1203
|
-
) : this.$slots.default]
|
|
1204
|
-
);
|
|
1205
|
-
}
|
|
1206
|
-
};
|
|
1207
|
-
|
|
1208
|
-
/***/ }),
|
|
1209
|
-
|
|
1210
|
-
/***/ 320:
|
|
1211
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
1212
|
-
|
|
1213
|
-
"use strict";
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
exports.__esModule = true;
|
|
1217
|
-
|
|
1218
|
-
var _src = __webpack_require__(321);
|
|
1219
|
-
|
|
1220
|
-
var _src2 = _interopRequireDefault(_src);
|
|
1221
|
-
|
|
1222
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1223
|
-
|
|
1224
|
-
/* istanbul ignore next */
|
|
1225
|
-
_src2.default.install = function (Vue) {
|
|
1226
|
-
Vue.component(_src2.default.name, _src2.default);
|
|
1227
|
-
};
|
|
1228
|
-
|
|
1229
|
-
exports.default = _src2.default;
|
|
1230
|
-
|
|
1231
|
-
/***/ }),
|
|
1232
|
-
|
|
1233
|
-
/***/ 321:
|
|
1234
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1235
|
-
|
|
1236
|
-
"use strict";
|
|
1237
|
-
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
|
1238
|
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_13_7_3_vue_loader_lib_selector_type_script_index_0_index_vue__ = __webpack_require__(105);
|
|
1239
|
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_13_7_3_vue_loader_lib_selector_type_script_index_0_index_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_13_7_3_vue_loader_lib_selector_type_script_index_0_index_vue__);
|
|
1240
|
-
/* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_13_7_3_vue_loader_lib_selector_type_script_index_0_index_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_13_7_3_vue_loader_lib_selector_type_script_index_0_index_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
|
|
1241
|
-
var normalizeComponent = __webpack_require__(0)
|
|
1242
|
-
/* script */
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
/* template */
|
|
1246
|
-
var __vue_template__ = null
|
|
1247
|
-
/* template functional */
|
|
1248
|
-
var __vue_template_functional__ = false
|
|
1249
|
-
/* styles */
|
|
1250
|
-
var __vue_styles__ = null
|
|
1251
|
-
/* scopeId */
|
|
1252
|
-
var __vue_scopeId__ = null
|
|
1253
|
-
/* moduleIdentifier (server only) */
|
|
1254
|
-
var __vue_module_identifier__ = null
|
|
1255
|
-
var Component = normalizeComponent(
|
|
1256
|
-
__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_13_7_3_vue_loader_lib_selector_type_script_index_0_index_vue___default.a,
|
|
1257
|
-
__vue_template__,
|
|
1258
|
-
__vue_template_functional__,
|
|
1259
|
-
__vue_styles__,
|
|
1260
|
-
__vue_scopeId__,
|
|
1261
|
-
__vue_module_identifier__
|
|
1262
|
-
)
|
|
1263
|
-
|
|
1264
|
-
/* harmony default export */ __webpack_exports__["default"] = (Component.exports);
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
/***/ }),
|
|
1268
|
-
|
|
1269
|
-
/***/ 322:
|
|
1270
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1271
|
-
|
|
1272
|
-
"use strict";
|
|
1273
|
-
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
|
1274
|
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_13_7_3_vue_loader_lib_selector_type_script_index_0_upload_list_vue__ = __webpack_require__(106);
|
|
1275
|
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_13_7_3_vue_loader_lib_selector_type_script_index_0_upload_list_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_13_7_3_vue_loader_lib_selector_type_script_index_0_upload_list_vue__);
|
|
1276
|
-
/* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_13_7_3_vue_loader_lib_selector_type_script_index_0_upload_list_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_13_7_3_vue_loader_lib_selector_type_script_index_0_upload_list_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
|
|
1277
|
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_13_7_3_vue_loader_lib_template_compiler_index_id_data_v_5d44ef9a_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_13_7_3_vue_loader_lib_selector_type_template_index_0_upload_list_vue__ = __webpack_require__(323);
|
|
1278
|
-
var normalizeComponent = __webpack_require__(0)
|
|
1279
|
-
/* script */
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
/* template */
|
|
1283
|
-
|
|
1284
|
-
/* template functional */
|
|
1285
|
-
var __vue_template_functional__ = false
|
|
1286
|
-
/* styles */
|
|
1287
|
-
var __vue_styles__ = null
|
|
1288
|
-
/* scopeId */
|
|
1289
|
-
var __vue_scopeId__ = null
|
|
1290
|
-
/* moduleIdentifier (server only) */
|
|
1291
|
-
var __vue_module_identifier__ = null
|
|
1292
|
-
var Component = normalizeComponent(
|
|
1293
|
-
__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_13_7_3_vue_loader_lib_selector_type_script_index_0_upload_list_vue___default.a,
|
|
1294
|
-
__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_13_7_3_vue_loader_lib_template_compiler_index_id_data_v_5d44ef9a_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_13_7_3_vue_loader_lib_selector_type_template_index_0_upload_list_vue__["a" /* default */],
|
|
1295
|
-
__vue_template_functional__,
|
|
1296
|
-
__vue_styles__,
|
|
1297
|
-
__vue_scopeId__,
|
|
1298
|
-
__vue_module_identifier__
|
|
1299
|
-
)
|
|
1300
|
-
|
|
1301
|
-
/* harmony default export */ __webpack_exports__["default"] = (Component.exports);
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
/***/ }),
|
|
1305
|
-
|
|
1306
|
-
/***/ 323:
|
|
1307
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1308
|
-
|
|
1309
|
-
"use strict";
|
|
1310
|
-
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('transition-group',{class:[
|
|
1311
|
-
'el-upload-list',
|
|
1312
|
-
'el-upload-list--' + _vm.listType,
|
|
1313
|
-
{ 'is-disabled': _vm.disabled }
|
|
1314
|
-
],attrs:{"tag":"ul","name":"el-list"}},_vm._l((_vm.files),function(file,index){return _c('li',{key:index,class:['el-upload-list__item', 'is-' + file.status, _vm.focusing ? 'focusing' : ''],attrs:{"tabindex":"0"},on:{"keydown":function($event){if(!('button' in $event)&&_vm._k($event.keyCode,"delete",[8,46],$event.key,["Backspace","Delete"])){ return null; }!_vm.disabled && _vm.$emit('remove', file)},"focus":function($event){_vm.focusing = true},"blur":function($event){_vm.focusing = false},"click":function($event){_vm.focusing = false}}},[(file.status !== 'uploading' && ['picture-card', 'picture'].indexOf(_vm.listType) > -1)?_c('img',{staticClass:"el-upload-list__item-thumbnail",attrs:{"src":file.url,"alt":""}}):_vm._e(),_c('a',{staticClass:"el-upload-list__item-name",on:{"click":function($event){_vm.handleClick(file)}}},[_c('i',{staticClass:"el-icon-document"}),_vm._v(_vm._s(file.name)+"\n ")]),_c('label',{staticClass:"el-upload-list__item-status-label"},[_c('i',{class:{
|
|
1315
|
-
'el-icon-upload-success': true,
|
|
1316
|
-
'el-icon-circle-check': _vm.listType === 'text',
|
|
1317
|
-
'el-icon-check': ['picture-card', 'picture'].indexOf(_vm.listType) > -1
|
|
1318
|
-
}})]),(!_vm.disabled)?_c('i',{staticClass:"el-icon-close",on:{"click":function($event){_vm.$emit('remove', file)}}}):_vm._e(),(!_vm.disabled)?_c('i',{staticClass:"el-icon-close-tip"},[_vm._v(_vm._s(_vm.t('el.upload.deleteTip')))]):_vm._e(),(file.status === 'uploading')?_c('el-progress',{attrs:{"type":_vm.listType === 'picture-card' ? 'circle' : 'line',"stroke-width":_vm.listType === 'picture-card' ? 6 : 2,"percentage":_vm.parsePercentage(file.percentage)}}):_vm._e(),(_vm.listType === 'picture-card')?_c('span',{staticClass:"el-upload-list__item-actions"},[(_vm.handlePreview && _vm.listType === 'picture-card')?_c('span',{staticClass:"el-upload-list__item-preview",on:{"click":function($event){_vm.handlePreview(file)}}},[_c('i',{staticClass:"el-icon-zoom-in"})]):_vm._e(),(!_vm.disabled)?_c('span',{staticClass:"el-upload-list__item-delete",on:{"click":function($event){_vm.$emit('remove', file)}}},[_c('i',{staticClass:"el-icon-delete"})]):_vm._e()]):_vm._e()],1)}))}
|
|
1319
|
-
var staticRenderFns = []
|
|
1320
|
-
var esExports = { render: render, staticRenderFns: staticRenderFns }
|
|
1321
|
-
/* harmony default export */ __webpack_exports__["a"] = (esExports);
|
|
1322
|
-
|
|
1323
|
-
/***/ }),
|
|
1324
|
-
|
|
1325
|
-
/***/ 324:
|
|
1326
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1327
|
-
|
|
1328
|
-
"use strict";
|
|
1329
|
-
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
|
1330
|
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_13_7_3_vue_loader_lib_selector_type_script_index_0_upload_vue__ = __webpack_require__(108);
|
|
1331
|
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_13_7_3_vue_loader_lib_selector_type_script_index_0_upload_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_13_7_3_vue_loader_lib_selector_type_script_index_0_upload_vue__);
|
|
1332
|
-
/* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_13_7_3_vue_loader_lib_selector_type_script_index_0_upload_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_13_7_3_vue_loader_lib_selector_type_script_index_0_upload_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
|
|
1333
|
-
var normalizeComponent = __webpack_require__(0)
|
|
1334
|
-
/* script */
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
/* template */
|
|
1338
|
-
var __vue_template__ = null
|
|
1339
|
-
/* template functional */
|
|
1340
|
-
var __vue_template_functional__ = false
|
|
1341
|
-
/* styles */
|
|
1342
|
-
var __vue_styles__ = null
|
|
1343
|
-
/* scopeId */
|
|
1344
|
-
var __vue_scopeId__ = null
|
|
1345
|
-
/* moduleIdentifier (server only) */
|
|
1346
|
-
var __vue_module_identifier__ = null
|
|
1347
|
-
var Component = normalizeComponent(
|
|
1348
|
-
__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_13_7_3_vue_loader_lib_selector_type_script_index_0_upload_vue___default.a,
|
|
1349
|
-
__vue_template__,
|
|
1350
|
-
__vue_template_functional__,
|
|
1351
|
-
__vue_styles__,
|
|
1352
|
-
__vue_scopeId__,
|
|
1353
|
-
__vue_module_identifier__
|
|
1354
|
-
)
|
|
1355
|
-
|
|
1356
|
-
/* harmony default export */ __webpack_exports__["default"] = (Component.exports);
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
/***/ }),
|
|
1360
|
-
|
|
1361
|
-
/***/ 325:
|
|
1362
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
1363
|
-
|
|
1364
|
-
"use strict";
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
exports.__esModule = true;
|
|
1368
|
-
exports.default = upload;
|
|
1369
|
-
function getError(action, option, xhr) {
|
|
1370
|
-
var msg = void 0;
|
|
1371
|
-
if (xhr.response) {
|
|
1372
|
-
msg = '' + (xhr.response.error || xhr.response);
|
|
1373
|
-
} else if (xhr.responseText) {
|
|
1374
|
-
msg = '' + xhr.responseText;
|
|
1375
|
-
} else {
|
|
1376
|
-
msg = 'fail to post ' + action + ' ' + xhr.status;
|
|
1377
|
-
}
|
|
1378
|
-
|
|
1379
|
-
var err = new Error(msg);
|
|
1380
|
-
err.status = xhr.status;
|
|
1381
|
-
err.method = 'post';
|
|
1382
|
-
err.url = action;
|
|
1383
|
-
return err;
|
|
1384
|
-
}
|
|
1385
|
-
|
|
1386
|
-
function getBody(xhr) {
|
|
1387
|
-
var text = xhr.responseText || xhr.response;
|
|
1388
|
-
if (!text) {
|
|
1389
|
-
return text;
|
|
1390
|
-
}
|
|
1391
|
-
|
|
1392
|
-
try {
|
|
1393
|
-
return JSON.parse(text);
|
|
1394
|
-
} catch (e) {
|
|
1395
|
-
return text;
|
|
1396
|
-
}
|
|
1397
|
-
}
|
|
1398
|
-
|
|
1399
|
-
function upload(option) {
|
|
1400
|
-
if (typeof XMLHttpRequest === 'undefined') {
|
|
1401
|
-
return;
|
|
1402
|
-
}
|
|
1403
|
-
|
|
1404
|
-
var xhr = new XMLHttpRequest();
|
|
1405
|
-
var action = option.action;
|
|
1406
|
-
|
|
1407
|
-
if (xhr.upload) {
|
|
1408
|
-
xhr.upload.onprogress = function progress(e) {
|
|
1409
|
-
if (e.total > 0) {
|
|
1410
|
-
e.percent = e.loaded / e.total * 100;
|
|
1411
|
-
}
|
|
1412
|
-
option.onProgress(e);
|
|
1413
|
-
};
|
|
1414
|
-
}
|
|
1415
|
-
|
|
1416
|
-
var formData = new FormData();
|
|
1417
|
-
|
|
1418
|
-
if (option.data) {
|
|
1419
|
-
Object.keys(option.data).forEach(function (key) {
|
|
1420
|
-
formData.append(key, option.data[key]);
|
|
1421
|
-
});
|
|
1422
|
-
}
|
|
1423
|
-
|
|
1424
|
-
formData.append(option.filename, option.file, option.file.name);
|
|
1425
|
-
|
|
1426
|
-
xhr.onerror = function error(e) {
|
|
1427
|
-
option.onError(e);
|
|
1428
|
-
};
|
|
1429
|
-
|
|
1430
|
-
xhr.onload = function onload() {
|
|
1431
|
-
if (xhr.status < 200 || xhr.status >= 300) {
|
|
1432
|
-
return option.onError(getError(action, option, xhr));
|
|
1433
|
-
}
|
|
1434
|
-
|
|
1435
|
-
option.onSuccess(getBody(xhr));
|
|
1436
|
-
};
|
|
1437
|
-
|
|
1438
|
-
xhr.open('post', action, true);
|
|
1439
|
-
|
|
1440
|
-
if (option.withCredentials && 'withCredentials' in xhr) {
|
|
1441
|
-
xhr.withCredentials = true;
|
|
1442
|
-
}
|
|
1443
|
-
|
|
1444
|
-
var headers = option.headers || {};
|
|
1445
|
-
|
|
1446
|
-
for (var item in headers) {
|
|
1447
|
-
if (headers.hasOwnProperty(item) && headers[item] !== null) {
|
|
1448
|
-
xhr.setRequestHeader(item, headers[item]);
|
|
1124
|
+
}]);
|
|
1449
1125
|
}
|
|
1126
|
+
var uploadData = {
|
|
1127
|
+
props: {
|
|
1128
|
+
type: this.type,
|
|
1129
|
+
drag: this.drag,
|
|
1130
|
+
action: this.action,
|
|
1131
|
+
multiple: this.multiple,
|
|
1132
|
+
'before-upload': this.beforeUpload,
|
|
1133
|
+
'with-credentials': this.withCredentials,
|
|
1134
|
+
headers: this.headers,
|
|
1135
|
+
name: this.name,
|
|
1136
|
+
data: this.data,
|
|
1137
|
+
accept: this.accept,
|
|
1138
|
+
fileList: this.uploadFiles,
|
|
1139
|
+
autoUpload: this.autoUpload,
|
|
1140
|
+
listType: this.listType,
|
|
1141
|
+
disabled: this.uploadDisabled,
|
|
1142
|
+
limit: this.limit,
|
|
1143
|
+
'on-exceed': this.onExceed,
|
|
1144
|
+
'on-start': this.handleStart,
|
|
1145
|
+
'on-progress': this.handleProgress,
|
|
1146
|
+
'on-success': this.handleSuccess,
|
|
1147
|
+
'on-error': this.handleError,
|
|
1148
|
+
'on-preview': this.onPreview,
|
|
1149
|
+
'on-remove': this.handleRemove,
|
|
1150
|
+
'http-request': this.httpRequest
|
|
1151
|
+
},
|
|
1152
|
+
ref: 'upload-inner'
|
|
1153
|
+
};
|
|
1154
|
+
var trigger = this.$slots.trigger || this.$slots.default;
|
|
1155
|
+
var uploadComponent = h("upload", helper_default()([{}, uploadData]), [trigger]);
|
|
1156
|
+
return h("div", [this.listType === 'picture-card' ? uploadList : '', this.$slots.trigger ? [uploadComponent, this.$slots.default] : uploadComponent, this.$slots.tip, this.listType !== 'picture-card' ? uploadList : '']);
|
|
1450
1157
|
}
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1472
|
-
|
|
1473
|
-
"use strict";
|
|
1474
|
-
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
|
1475
|
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_13_7_3_vue_loader_lib_selector_type_script_index_0_iframe_upload_vue__ = __webpack_require__(111);
|
|
1476
|
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_13_7_3_vue_loader_lib_selector_type_script_index_0_iframe_upload_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_13_7_3_vue_loader_lib_selector_type_script_index_0_iframe_upload_vue__);
|
|
1477
|
-
/* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_13_7_3_vue_loader_lib_selector_type_script_index_0_iframe_upload_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_13_7_3_vue_loader_lib_selector_type_script_index_0_iframe_upload_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
|
|
1478
|
-
var normalizeComponent = __webpack_require__(0)
|
|
1479
|
-
/* script */
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
/* template */
|
|
1483
|
-
var __vue_template__ = null
|
|
1484
|
-
/* template functional */
|
|
1485
|
-
var __vue_template_functional__ = false
|
|
1486
|
-
/* styles */
|
|
1487
|
-
var __vue_styles__ = null
|
|
1488
|
-
/* scopeId */
|
|
1489
|
-
var __vue_scopeId__ = null
|
|
1490
|
-
/* moduleIdentifier (server only) */
|
|
1491
|
-
var __vue_module_identifier__ = null
|
|
1492
|
-
var Component = normalizeComponent(
|
|
1493
|
-
__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_13_7_3_vue_loader_lib_selector_type_script_index_0_iframe_upload_vue___default.a,
|
|
1494
|
-
__vue_template__,
|
|
1495
|
-
__vue_template_functional__,
|
|
1496
|
-
__vue_styles__,
|
|
1497
|
-
__vue_scopeId__,
|
|
1498
|
-
__vue_module_identifier__
|
|
1158
|
+
});
|
|
1159
|
+
;// ./packages/upload/src/index.vue?vue&type=script&lang=js
|
|
1160
|
+
/* harmony default export */ const upload_srcvue_type_script_lang_js = (srcvue_type_script_lang_js);
|
|
1161
|
+
;// ./packages/upload/src/index.vue
|
|
1162
|
+
var src_render, src_staticRenderFns
|
|
1163
|
+
;
|
|
1164
|
+
|
|
1165
|
+
|
|
1166
|
+
|
|
1167
|
+
/* normalize component */
|
|
1168
|
+
;
|
|
1169
|
+
var src_component = normalizeComponent(
|
|
1170
|
+
upload_srcvue_type_script_lang_js,
|
|
1171
|
+
src_render,
|
|
1172
|
+
src_staticRenderFns,
|
|
1173
|
+
false,
|
|
1174
|
+
null,
|
|
1175
|
+
null,
|
|
1176
|
+
null
|
|
1177
|
+
|
|
1499
1178
|
)
|
|
1500
1179
|
|
|
1501
|
-
/* harmony default export */
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
/***/ }),
|
|
1180
|
+
/* harmony default export */ const src = (src_component.exports);
|
|
1181
|
+
;// ./packages/upload/index.js
|
|
1505
1182
|
|
|
1506
|
-
/***/ 45:
|
|
1507
|
-
/***/ (function(module, exports) {
|
|
1508
1183
|
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
/***/ (function(module, exports) {
|
|
1515
|
-
|
|
1516
|
-
module.exports = require("element-ui/lib/mixins/locale");
|
|
1517
|
-
|
|
1518
|
-
/***/ }),
|
|
1519
|
-
|
|
1520
|
-
/***/ 8:
|
|
1521
|
-
/***/ (function(module, exports) {
|
|
1522
|
-
|
|
1523
|
-
module.exports = require("element-ui/lib/mixins/migrating");
|
|
1184
|
+
/* istanbul ignore next */
|
|
1185
|
+
src.install = function (Vue) {
|
|
1186
|
+
Vue.component(src.name, src);
|
|
1187
|
+
};
|
|
1188
|
+
/* harmony default export */ const packages_upload = (src);
|
|
1524
1189
|
|
|
1525
|
-
/***/ }
|
|
1190
|
+
/***/ }
|
|
1526
1191
|
|
|
1527
|
-
/******/
|
|
1192
|
+
/******/ });
|
|
1193
|
+
/************************************************************************/
|
|
1194
|
+
/******/ // The module cache
|
|
1195
|
+
/******/ const __webpack_module_cache__ = {};
|
|
1196
|
+
/******/
|
|
1197
|
+
/******/ // The require function
|
|
1198
|
+
/******/ function __webpack_require__(moduleId) {
|
|
1199
|
+
/******/ // Check if module is in cache
|
|
1200
|
+
/******/ const cachedModule = __webpack_module_cache__[moduleId];
|
|
1201
|
+
/******/ if (cachedModule !== undefined) {
|
|
1202
|
+
/******/ return cachedModule.exports;
|
|
1203
|
+
/******/ }
|
|
1204
|
+
/******/ // Create a new module (and put it into the cache)
|
|
1205
|
+
/******/ const module = __webpack_module_cache__[moduleId] = {
|
|
1206
|
+
/******/ // no module.id needed
|
|
1207
|
+
/******/ // no module.loaded needed
|
|
1208
|
+
/******/ exports: {}
|
|
1209
|
+
/******/ };
|
|
1210
|
+
/******/
|
|
1211
|
+
/******/ // Execute the module function
|
|
1212
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
1213
|
+
/******/
|
|
1214
|
+
/******/ // Return the exports of the module
|
|
1215
|
+
/******/ return module.exports;
|
|
1216
|
+
/******/ }
|
|
1217
|
+
/******/
|
|
1218
|
+
/************************************************************************/
|
|
1219
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
1220
|
+
/******/ (() => {
|
|
1221
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
1222
|
+
/******/ __webpack_require__.n = (module) => {
|
|
1223
|
+
/******/ const getter = module && module.__esModule ?
|
|
1224
|
+
/******/ () => (module['default']) :
|
|
1225
|
+
/******/ () => (module);
|
|
1226
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
|
1227
|
+
/******/ return getter;
|
|
1228
|
+
/******/ };
|
|
1229
|
+
/******/ })();
|
|
1230
|
+
/******/
|
|
1231
|
+
/******/ /* webpack/runtime/define property getters */
|
|
1232
|
+
/******/ (() => {
|
|
1233
|
+
/******/ // define getter/value functions for harmony exports
|
|
1234
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
1235
|
+
/******/ if(Array.isArray(definition)) {
|
|
1236
|
+
/******/ var i = 0;
|
|
1237
|
+
/******/ while(i < definition.length) {
|
|
1238
|
+
/******/ var key = definition[i++];
|
|
1239
|
+
/******/ var binding = definition[i++];
|
|
1240
|
+
/******/ if(!__webpack_require__.o(exports, key)) {
|
|
1241
|
+
/******/ if(binding === 0) {
|
|
1242
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, value: definition[i++] });
|
|
1243
|
+
/******/ } else {
|
|
1244
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: binding });
|
|
1245
|
+
/******/ }
|
|
1246
|
+
/******/ } else if(binding === 0) { i++; }
|
|
1247
|
+
/******/ }
|
|
1248
|
+
/******/ } else {
|
|
1249
|
+
/******/ for(var key in definition) {
|
|
1250
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
1251
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
1252
|
+
/******/ }
|
|
1253
|
+
/******/ }
|
|
1254
|
+
/******/ }
|
|
1255
|
+
/******/ };
|
|
1256
|
+
/******/ })();
|
|
1257
|
+
/******/
|
|
1258
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
1259
|
+
/******/ (() => {
|
|
1260
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
1261
|
+
/******/ })();
|
|
1262
|
+
/******/
|
|
1263
|
+
/******/ /* webpack/runtime/wrap commonjs module */
|
|
1264
|
+
/******/ (() => {
|
|
1265
|
+
/******/ // execute a CommonJS module body with real module/exports objects, returning the final exports
|
|
1266
|
+
/******/ __webpack_require__.cjs = (body) => {
|
|
1267
|
+
/******/ const mod = { exports: {} };
|
|
1268
|
+
/******/ body.call(mod.exports, mod, mod.exports);
|
|
1269
|
+
/******/ return mod.exports;
|
|
1270
|
+
/******/ };
|
|
1271
|
+
/******/ })();
|
|
1272
|
+
/******/
|
|
1273
|
+
/************************************************************************/
|
|
1274
|
+
/******/
|
|
1275
|
+
/******/ // startup
|
|
1276
|
+
/******/ // Load entry module and return exports
|
|
1277
|
+
/******/ // This entry module used 'module' so it can't be inlined
|
|
1278
|
+
/******/ let __webpack_exports__ = __webpack_require__(5623);
|
|
1279
|
+
/******/ module.exports = __webpack_exports__["default"];
|
|
1280
|
+
/******/
|
|
1281
|
+
/******/ })()
|
|
1282
|
+
;
|