cy-element-ui 1.1.13 → 1.1.15
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/README.md +35 -5
- package/lib/alert.js +68 -68
- package/lib/aside.js +11 -11
- package/lib/autocomplete.js +287 -287
- package/lib/avatar.js +121 -121
- package/lib/backtop.js +91 -91
- package/lib/badge.js +32 -32
- package/lib/breadcrumb-item.js +33 -33
- package/lib/breadcrumb.js +27 -27
- package/lib/button-group.js +4 -4
- package/lib/button.js +53 -53
- package/lib/calendar.js +426 -426
- package/lib/card.js +11 -11
- package/lib/carousel-item.js +108 -108
- package/lib/carousel.js +244 -244
- package/lib/cascader-panel.js +1045 -1045
- package/lib/cascader.js +577 -577
- package/lib/checkbox-button.js +137 -137
- package/lib/checkbox-group.js +39 -39
- package/lib/checkbox.js +151 -151
- package/lib/col.js +64 -64
- package/lib/collapse-item.js +66 -66
- package/lib/collapse.js +63 -63
- package/lib/color-picker.js +944 -944
- package/lib/container.js +24 -24
- package/lib/date-picker.js +2968 -2967
- package/lib/descriptions-item.js +29 -29
- package/lib/descriptions.js +324 -324
- package/lib/dialog.js +170 -170
- package/lib/directives/mousewheel.js +9 -9
- package/lib/directives/repeat-click.js +22 -22
- package/lib/divider.js +20 -20
- package/lib/drawer.js +156 -156
- package/lib/dropdown-item.js +19 -19
- package/lib/dropdown-menu.js +56 -56
- package/lib/dropdown.js +329 -329
- package/lib/element-ui.common.js +44918 -0
- package/lib/empty.js +39 -39
- package/lib/footer.js +11 -11
- package/lib/form-item.js +369 -369
- package/lib/form.js +181 -181
- package/lib/header.js +11 -11
- package/lib/icon.js +7 -7
- package/lib/image.js +520 -520
- package/lib/index.js +1 -1
- package/lib/infinite-scroll.js +127 -127
- package/lib/input-number.js +260 -260
- package/lib/input.js +370 -370
- package/lib/link.js +28 -28
- package/lib/loading.js +219 -219
- package/lib/locale/format.js +25 -26
- package/lib/locale/index.js +24 -24
- package/lib/locale/lang/en.js +121 -121
- package/lib/locale/lang/zh-CN.js +121 -121
- package/lib/locale/lang/zh-TW.js +121 -121
- package/lib/main.js +5 -5
- package/lib/menu-item-group.js +33 -33
- package/lib/menu-item.js +116 -116
- package/lib/menu.js +490 -490
- package/lib/message-box.js +421 -421
- package/lib/message.js +150 -150
- package/lib/mixins/emitter.js +26 -26
- package/lib/mixins/focus.js +7 -7
- package/lib/mixins/locale.js +8 -8
- package/lib/mixins/migrating.js +34 -34
- package/lib/notification.js +184 -184
- package/lib/option-group.js +46 -46
- package/lib/option.js +145 -145
- package/lib/page-header.js +14 -14
- package/lib/pagination.js +530 -530
- package/lib/popconfirm.js +68 -68
- package/lib/popover.js +225 -225
- package/lib/progress.js +183 -183
- package/lib/radio-button.js +78 -78
- package/lib/radio-group.js +103 -103
- package/lib/radio.js +86 -86
- package/lib/rate.js +283 -283
- package/lib/result.js +61 -61
- package/lib/row.js +32 -32
- package/lib/scrollbar.js +247 -247
- package/lib/select.js +999 -999
- package/lib/selectDisplayInput.js +61 -61
- package/lib/skeleton-item.js +19 -19
- package/lib/skeleton.js +53 -53
- package/lib/slider.js +550 -550
- package/lib/spinner.js +19 -19
- package/lib/statistic.js +198 -198
- package/lib/step.js +125 -125
- package/lib/steps.js +54 -54
- package/lib/subTitle.js +24 -24
- package/lib/submenu.js +405 -406
- package/lib/switch.js +135 -135
- package/lib/tab-pane.js +43 -43
- package/lib/tabDialog.js +508 -508
- package/lib/table-column.js +713 -713
- package/lib/table.js +3432 -3432
- package/lib/tabs.js +578 -578
- package/lib/tag.js +60 -60
- package/lib/time-picker.js +1350 -1350
- package/lib/time-select.js +949 -949
- package/lib/timeline-item.js +25 -25
- package/lib/timeline.js +30 -30
- package/lib/tooltip.js +255 -255
- package/lib/transfer.js +385 -385
- package/lib/transitions/collapse-transition.js +76 -76
- package/lib/tree.js +1547 -1547
- package/lib/treeSelect.js +2618 -2618
- package/lib/umd/locale/en.js +137 -137
- package/lib/umd/locale/zh-CN.js +137 -137
- package/lib/umd/locale/zh-TW.js +137 -137
- package/lib/upload.js +738 -738
- package/lib/utils/after-leave.js +19 -19
- package/lib/utils/aria-dialog.js +56 -56
- package/lib/utils/aria-utils.js +66 -66
- package/lib/utils/clickoutside.js +39 -39
- package/lib/utils/date-util.js +177 -177
- package/lib/utils/dom.js +161 -161
- package/lib/utils/menu/aria-menubar.js +8 -8
- package/lib/utils/menu/aria-menuitem.js +38 -38
- package/lib/utils/menu/aria-submenu.js +45 -45
- package/lib/utils/merge.js +12 -12
- package/lib/utils/popup/index.js +201 -201
- package/lib/utils/popup/popup-manager.js +171 -171
- package/lib/utils/resize-event.js +33 -33
- package/lib/utils/scroll-into-view.js +25 -25
- package/lib/utils/scrollbar-width.js +18 -18
- package/lib/utils/shared.js +3 -3
- package/lib/utils/types.js +10 -10
- package/lib/utils/util.js +170 -170
- package/lib/utils/vdom.js +1 -1
- package/lib/utils/vue-popper.js +176 -176
- package/package.json +9 -7
- package/packages/alert/index.js +1 -1
- package/packages/alert/src/main.vue +82 -82
- package/packages/aside/index.js +1 -1
- package/packages/aside/src/main.vue +13 -13
- package/packages/autocomplete/index.js +1 -1
- package/packages/autocomplete/src/autocomplete-suggestions.vue +64 -64
- package/packages/autocomplete/src/autocomplete.vue +272 -272
- package/packages/avatar/index.js +1 -1
- package/packages/avatar/src/main.vue +88 -88
- package/packages/backtop/index.js +1 -1
- package/packages/backtop/src/main.vue +92 -92
- package/packages/badge/index.js +1 -1
- package/packages/badge/src/main.vue +41 -41
- package/packages/breadcrumb/index.js +1 -1
- package/packages/breadcrumb/src/breadcrumb-item.vue +35 -35
- package/packages/breadcrumb/src/breadcrumb.vue +27 -27
- package/packages/breadcrumb-item/index.js +1 -1
- package/packages/button/index.js +1 -1
- package/packages/button/src/button-group.vue +6 -6
- package/packages/button/src/button.vue +70 -70
- package/packages/button-group/index.js +1 -1
- package/packages/calendar/index.js +1 -1
- package/packages/calendar/src/date-table.vue +193 -193
- package/packages/calendar/src/main.vue +242 -242
- package/packages/card/index.js +1 -1
- package/packages/card/src/main.vue +18 -18
- package/packages/carousel/index.js +1 -1
- package/packages/carousel/src/item.vue +122 -122
- package/packages/carousel/src/main.vue +305 -305
- package/packages/carousel-item/index.js +1 -1
- package/packages/cascader/index.js +1 -1
- package/packages/cascader/src/cascader.vue +626 -626
- package/packages/cascader-panel/index.js +1 -1
- package/packages/cascader-panel/src/cascader-menu.vue +128 -128
- package/packages/cascader-panel/src/cascader-node.vue +244 -244
- package/packages/cascader-panel/src/cascader-panel.vue +334 -334
- package/packages/cascader-panel/src/node.js +157 -158
- package/packages/cascader-panel/src/store.js +49 -50
- package/packages/checkbox/index.js +1 -1
- package/packages/checkbox/src/checkbox-button.vue +195 -195
- package/packages/checkbox/src/checkbox-group.vue +43 -43
- package/packages/checkbox/src/checkbox.vue +218 -218
- package/packages/checkbox-button/index.js +1 -1
- package/packages/checkbox-group/index.js +1 -1
- package/packages/col/index.js +1 -1
- package/packages/col/src/col.js +63 -63
- package/packages/collapse/index.js +1 -1
- package/packages/collapse/src/collapse-item.vue +101 -101
- package/packages/collapse/src/collapse.vue +61 -61
- package/packages/collapse-item/index.js +1 -1
- package/packages/color-picker/index.js +1 -1
- package/packages/color-picker/src/color.js +263 -263
- package/packages/color-picker/src/components/alpha-slider.vue +127 -127
- package/packages/color-picker/src/components/hue-slider.vue +118 -118
- package/packages/color-picker/src/components/picker-dropdown.vue +105 -105
- package/packages/color-picker/src/components/predefine.vue +55 -55
- package/packages/color-picker/src/components/sv-panel.vue +95 -95
- package/packages/color-picker/src/draggable.js +27 -27
- package/packages/color-picker/src/main.vue +183 -183
- package/packages/container/index.js +1 -1
- package/packages/container/src/main.vue +25 -25
- package/packages/date-picker/index.js +1 -1
- package/packages/date-picker/src/basic/date-table.vue +435 -435
- package/packages/date-picker/src/basic/month-table.vue +239 -240
- package/packages/date-picker/src/basic/time-spinner.vue +279 -279
- package/packages/date-picker/src/basic/year-table.vue +99 -99
- package/packages/date-picker/src/panel/date-range.vue +675 -675
- package/packages/date-picker/src/panel/date.vue +604 -604
- package/packages/date-picker/src/panel/month-range.vue +260 -260
- package/packages/date-picker/src/panel/time-range.vue +242 -242
- package/packages/date-picker/src/panel/time-select.vue +173 -173
- package/packages/date-picker/src/panel/time.vue +181 -181
- package/packages/date-picker/src/picker/date-picker.js +29 -29
- package/packages/date-picker/src/picker/time-picker.js +28 -28
- package/packages/date-picker/src/picker/time-select.js +12 -12
- package/packages/date-picker/src/picker.vue +900 -900
- package/packages/descriptions/index.js +1 -1
- package/packages/descriptions/src/descriptions-item.js +28 -28
- package/packages/descriptions/src/descriptions-row.js +114 -114
- package/packages/descriptions/src/index.js +168 -168
- package/packages/descriptions-item/index.js +1 -1
- package/packages/dialog/index.js +1 -1
- package/packages/dialog/src/component.vue +207 -207
- package/packages/divider/index.js +1 -1
- package/packages/divider/src/main.vue +29 -29
- package/packages/drawer/index.js +1 -1
- package/packages/drawer/src/main.vue +195 -195
- package/packages/dropdown/index.js +1 -1
- package/packages/dropdown/src/dropdown-item.vue +29 -29
- package/packages/dropdown/src/dropdown-menu.vue +59 -59
- package/packages/dropdown/src/dropdown.vue +271 -271
- package/packages/dropdown-item/index.js +1 -1
- package/packages/dropdown-menu/index.js +1 -1
- package/packages/empty/index.js +1 -1
- package/packages/empty/src/img-empty.vue +124 -124
- package/packages/empty/src/index.vue +40 -40
- package/packages/footer/index.js +1 -1
- package/packages/footer/src/main.vue +13 -13
- package/packages/form/index.js +1 -1
- package/packages/form/src/form-item.vue +294 -294
- package/packages/form/src/form.vue +169 -169
- package/packages/form/src/label-wrap.vue +65 -65
- package/packages/form-item/index.js +1 -1
- package/packages/header/index.js +1 -1
- package/packages/header/src/main.vue +13 -13
- package/packages/icon/index.js +1 -1
- package/packages/icon/src/icon.vue +7 -7
- package/packages/image/index.js +1 -1
- package/packages/image/src/image-viewer.vue +309 -309
- package/packages/image/src/main.vue +242 -242
- package/packages/infinite-scroll/index.js +1 -1
- package/packages/infinite-scroll/src/main.js +113 -114
- package/packages/input/index.js +1 -1
- package/packages/input/src/calcTextareaHeight.js +70 -70
- package/packages/input/src/input.vue +416 -416
- package/packages/input-number/index.js +1 -1
- package/packages/input-number/src/input-number.vue +272 -272
- package/packages/link/index.js +1 -1
- package/packages/link/src/main.vue +40 -40
- package/packages/loading/index.js +6 -6
- package/packages/loading/src/directive.js +105 -105
- package/packages/loading/src/index.js +74 -74
- package/packages/loading/src/loading.vue +35 -35
- package/packages/main/index.js +1 -1
- package/packages/main/src/main.vue +7 -7
- package/packages/menu/index.js +1 -1
- package/packages/menu/src/menu-item-group.vue +38 -38
- package/packages/menu/src/menu-item.vue +103 -103
- package/packages/menu/src/menu-mixin.js +39 -39
- package/packages/menu/src/menu.vue +298 -298
- package/packages/menu/src/submenu.vue +330 -331
- package/packages/menu-item/index.js +1 -1
- package/packages/menu-item-group/index.js +1 -1
- package/packages/message/src/main.js +65 -65
- package/packages/message/src/main.vue +105 -105
- package/packages/message-box/src/main.js +172 -172
- package/packages/message-box/src/main.vue +309 -309
- package/packages/notification/src/main.js +63 -63
- package/packages/notification/src/main.vue +135 -135
- package/packages/option/index.js +1 -1
- package/packages/option-group/index.js +1 -1
- package/packages/page-header/index.js +1 -1
- package/packages/page-header/src/main.vue +21 -21
- package/packages/pagination/index.js +1 -1
- package/packages/pagination/src/pager.vue +158 -158
- package/packages/pagination/src/pagination.js +377 -377
- package/packages/popconfirm/index.js +1 -1
- package/packages/popconfirm/src/main.vue +94 -94
- package/packages/popover/index.js +2 -2
- package/packages/popover/src/directive.js +15 -15
- package/packages/popover/src/main.vue +214 -214
- package/packages/progress/index.js +1 -1
- package/packages/progress/src/progress.vue +228 -228
- package/packages/radio/index.js +1 -1
- package/packages/radio/src/radio-button.vue +106 -106
- package/packages/radio/src/radio-group.vue +101 -101
- package/packages/radio/src/radio.vue +122 -122
- package/packages/radio-button/index.js +1 -1
- package/packages/radio-group/index.js +1 -1
- package/packages/rate/index.js +1 -1
- package/packages/rate/src/main.vue +316 -316
- package/packages/result/index.js +1 -1
- package/packages/result/src/icon-error.vue +6 -6
- package/packages/result/src/icon-info.vue +6 -6
- package/packages/result/src/icon-success.vue +6 -6
- package/packages/result/src/icon-warning.vue +6 -6
- package/packages/result/src/index.vue +51 -51
- package/packages/row/index.js +1 -1
- package/packages/row/src/row.js +36 -36
- package/packages/scrollbar/index.js +1 -1
- package/packages/scrollbar/src/bar.js +86 -86
- package/packages/scrollbar/src/main.js +120 -120
- package/packages/scrollbar/src/util.js +27 -27
- package/packages/select/index.js +1 -1
- package/packages/select/src/navigation-mixin.js +47 -47
- package/packages/select/src/option-group.vue +55 -55
- package/packages/select/src/option.vue +163 -163
- package/packages/select/src/select-dropdown.vue +57 -57
- package/packages/select/src/select.vue +895 -895
- package/packages/selectDisplayInput/index.js +1 -1
- package/packages/selectDisplayInput/src/main.vue +61 -61
- package/packages/skeleton/index.js +1 -1
- package/packages/skeleton/src/img-placeholder.vue +9 -9
- package/packages/skeleton/src/index.vue +70 -70
- package/packages/skeleton/src/item.vue +17 -17
- package/packages/skeleton-item/index.js +1 -1
- package/packages/slider/index.js +1 -1
- package/packages/slider/src/button.vue +230 -230
- package/packages/slider/src/main.vue +422 -422
- package/packages/slider/src/marker.js +14 -14
- package/packages/spinner/index.js +1 -1
- package/packages/spinner/src/spinner.vue +23 -23
- package/packages/statistic/index.js +1 -1
- package/packages/statistic/src/main.vue +196 -197
- package/packages/step/index.js +1 -1
- package/packages/steps/index.js +1 -1
- package/packages/steps/src/step.vue +177 -177
- package/packages/steps/src/steps.vue +53 -53
- package/packages/subTitle/index.js +1 -1
- package/packages/subTitle/src/main.vue +29 -29
- package/packages/submenu/index.js +1 -1
- package/packages/switch/index.js +1 -1
- package/packages/switch/src/component.vue +169 -169
- package/packages/tab-pane/index.js +1 -1
- package/packages/tabDialog/index.js +10 -10
- package/packages/tabDialog/src/dialog/drag.js +50 -50
- package/packages/tabDialog/src/dialog/dragHeight.js +27 -27
- package/packages/tabDialog/src/dialog/dragWidth.js +23 -23
- package/packages/tabDialog/src/main.vue +257 -257
- package/packages/table/index.js +1 -1
- package/packages/table/src/config.js +108 -108
- package/packages/table/src/dropdown.js +19 -19
- package/packages/table/src/filter-panel.vue +189 -189
- package/packages/table/src/layout-observer.js +60 -60
- package/packages/table/src/store/current.js +65 -65
- package/packages/table/src/store/expand.js +57 -57
- package/packages/table/src/store/helper.js +32 -32
- package/packages/table/src/store/index.js +133 -133
- package/packages/table/src/store/tree.js +194 -194
- package/packages/table/src/store/watcher.js +366 -366
- package/packages/table/src/table-body.js +456 -456
- package/packages/table/src/table-column.js +311 -311
- package/packages/table/src/table-footer.js +139 -139
- package/packages/table/src/table-header.js +496 -496
- package/packages/table/src/table-layout.js +241 -241
- package/packages/table/src/table-row.js +97 -97
- package/packages/table/src/table.vue +666 -666
- package/packages/table/src/util.js +214 -214
- package/packages/table-column/index.js +1 -1
- package/packages/tabs/index.js +1 -1
- package/packages/tabs/src/tab-bar.vue +47 -47
- package/packages/tabs/src/tab-nav.vue +268 -268
- package/packages/tabs/src/tab-pane.vue +47 -47
- package/packages/tabs/src/tabs.vue +174 -174
- package/packages/tag/index.js +1 -1
- package/packages/tag/src/tag.vue +55 -55
- package/packages/theme-chalk/gulpfile.js +11 -11
- package/packages/theme-chalk/src/alert.scss +138 -138
- package/packages/theme-chalk/src/aside.scss +3 -3
- package/packages/theme-chalk/src/autocomplete.scss +58 -58
- package/packages/theme-chalk/src/avatar.scss +46 -46
- package/packages/theme-chalk/src/backtop.scss +16 -16
- package/packages/theme-chalk/src/badge.scss +47 -47
- package/packages/theme-chalk/src/breadcrumb.scss +49 -49
- package/packages/theme-chalk/src/button.scss +229 -229
- package/packages/theme-chalk/src/calendar.scss +57 -57
- package/packages/theme-chalk/src/card.scss +23 -23
- package/packages/theme-chalk/src/carousel-item.scss +41 -41
- package/packages/theme-chalk/src/carousel.scss +148 -148
- package/packages/theme-chalk/src/cascader-panel.scss +106 -106
- package/packages/theme-chalk/src/cascader.scss +173 -173
- package/packages/theme-chalk/src/checkbox.scss +346 -346
- package/packages/theme-chalk/src/col.scss +130 -130
- package/packages/theme-chalk/src/collapse.scss +52 -52
- package/packages/theme-chalk/src/color-picker.scss +364 -364
- package/packages/theme-chalk/src/common/popup.scss +22 -22
- package/packages/theme-chalk/src/common/transition.scss +33 -33
- package/packages/theme-chalk/src/common/var.scss +16 -16
- package/packages/theme-chalk/src/container.scss +9 -9
- package/packages/theme-chalk/src/cy/base.scss +1 -1
- package/packages/theme-chalk/src/date-picker/date-picker.scss +91 -91
- package/packages/theme-chalk/src/date-picker/date-range-picker.scss +97 -97
- package/packages/theme-chalk/src/date-picker/date-table.scss +146 -146
- package/packages/theme-chalk/src/date-picker/month-table.scss +69 -69
- package/packages/theme-chalk/src/date-picker/picker-panel.scss +105 -105
- package/packages/theme-chalk/src/date-picker/picker.scss +188 -188
- package/packages/theme-chalk/src/date-picker/time-picker.scss +72 -72
- package/packages/theme-chalk/src/date-picker/time-range-picker.scss +23 -23
- package/packages/theme-chalk/src/date-picker/time-spinner.scss +106 -106
- package/packages/theme-chalk/src/date-picker/year-table.scss +47 -47
- package/packages/theme-chalk/src/descriptions-item.scss +33 -33
- package/packages/theme-chalk/src/descriptions.scss +105 -105
- package/packages/theme-chalk/src/dialog.scss +104 -104
- package/packages/theme-chalk/src/display.scss +7 -7
- package/packages/theme-chalk/src/divider.scss +36 -36
- package/packages/theme-chalk/src/drawer.scss +185 -185
- package/packages/theme-chalk/src/dropdown.scss +172 -172
- package/packages/theme-chalk/src/empty.scss +34 -34
- package/packages/theme-chalk/src/footer.scss +3 -3
- package/packages/theme-chalk/src/form.scss +149 -149
- package/packages/theme-chalk/src/header.scss +3 -3
- package/packages/theme-chalk/src/icon.scss +309 -309
- package/packages/theme-chalk/src/image.scss +153 -153
- package/packages/theme-chalk/src/input-number.scss +255 -255
- package/packages/theme-chalk/src/input.scss +345 -345
- package/packages/theme-chalk/src/link.scss +67 -67
- package/packages/theme-chalk/src/loading.scss +67 -67
- package/packages/theme-chalk/src/main.scss +7 -7
- package/packages/theme-chalk/src/menu.scss +248 -248
- package/packages/theme-chalk/src/message-box.scss +205 -205
- package/packages/theme-chalk/src/message.scss +111 -111
- package/packages/theme-chalk/src/mixins/_button.scss +64 -64
- package/packages/theme-chalk/src/mixins/function.scss +18 -18
- package/packages/theme-chalk/src/mixins/mixins.scss +126 -126
- package/packages/theme-chalk/src/mixins/utils.scss +26 -26
- package/packages/theme-chalk/src/notification.scss +88 -88
- package/packages/theme-chalk/src/option-group.scss +31 -31
- package/packages/theme-chalk/src/option.scss +27 -27
- package/packages/theme-chalk/src/page-header.scss +31 -31
- package/packages/theme-chalk/src/pagination.scss +284 -284
- package/packages/theme-chalk/src/popconfirm.scss +11 -11
- package/packages/theme-chalk/src/popover.scss +30 -30
- package/packages/theme-chalk/src/popper.scss +82 -82
- package/packages/theme-chalk/src/progress.scss +128 -128
- package/packages/theme-chalk/src/radio-button.scss +94 -94
- package/packages/theme-chalk/src/radio-group.scss +4 -4
- package/packages/theme-chalk/src/radio.scss +192 -192
- package/packages/theme-chalk/src/rate.scss +38 -38
- package/packages/theme-chalk/src/reset.scss +39 -39
- package/packages/theme-chalk/src/result.scss +56 -56
- package/packages/theme-chalk/src/row.scss +31 -31
- package/packages/theme-chalk/src/scrollbar.scss +57 -57
- package/packages/theme-chalk/src/select-dropdown.scss +47 -47
- package/packages/theme-chalk/src/select.scss +140 -140
- package/packages/theme-chalk/src/skeleton-item.scss +75 -75
- package/packages/theme-chalk/src/skeleton.scss +27 -27
- package/packages/theme-chalk/src/slider.scss +238 -238
- package/packages/theme-chalk/src/spinner.scss +27 -27
- package/packages/theme-chalk/src/statistic.scss +32 -32
- package/packages/theme-chalk/src/step.scss +312 -312
- package/packages/theme-chalk/src/steps.scss +13 -13
- package/packages/theme-chalk/src/switch.scss +101 -101
- package/packages/theme-chalk/src/table-column.scss +87 -87
- package/packages/theme-chalk/src/table.scss +556 -556
- package/packages/theme-chalk/src/tabs.scss +576 -576
- package/packages/theme-chalk/src/tag.scss +155 -155
- package/packages/theme-chalk/src/time-select.scss +14 -14
- package/packages/theme-chalk/src/timeline-item.scss +71 -71
- package/packages/theme-chalk/src/timeline.scss +8 -8
- package/packages/theme-chalk/src/tooltip.scss +136 -136
- package/packages/theme-chalk/src/transfer.scss +214 -214
- package/packages/theme-chalk/src/tree.scss +110 -110
- package/packages/theme-chalk/src/upload.scss +587 -587
- package/packages/time-picker/index.js +1 -1
- package/packages/time-select/index.js +1 -1
- package/packages/timeline/index.js +1 -1
- package/packages/timeline/src/item.vue +56 -56
- package/packages/timeline/src/main.vue +28 -28
- package/packages/timeline-item/index.js +1 -1
- package/packages/tooltip/index.js +1 -1
- package/packages/tooltip/src/main.js +234 -234
- package/packages/transfer/index.js +1 -1
- package/packages/transfer/src/main.vue +225 -225
- package/packages/transfer/src/transfer-panel.vue +245 -245
- package/packages/tree/index.js +1 -1
- package/packages/tree/src/model/node.js +467 -467
- package/packages/tree/src/model/tree-store.js +335 -335
- package/packages/tree/src/model/util.js +17 -17
- package/packages/tree/src/tree-node.vue +247 -247
- package/packages/tree/src/tree.vue +491 -491
- package/packages/treeSelect/index.js +1 -1
- package/packages/treeSelect/src/main.vue +275 -275
- package/packages/upload/index.js +1 -1
- package/packages/upload/src/ajax.js +77 -77
- package/packages/upload/src/index.vue +304 -304
- package/packages/upload/src/upload-dragger.vue +65 -65
- package/packages/upload/src/upload-list.vue +96 -96
- package/packages/upload/src/upload.vue +194 -194
- package/src/directives/mousewheel.js +9 -9
- package/src/directives/repeat-click.js +20 -20
- package/src/index.js +209 -210
- package/src/locale/format.js +24 -25
- package/src/locale/index.js +25 -25
- package/src/locale/lang/en.js +121 -121
- package/src/locale/lang/zh-CN.js +121 -121
- package/src/locale/lang/zh-TW.js +121 -121
- package/src/mixins/emitter.js +26 -26
- package/src/mixins/focus.js +7 -7
- package/src/mixins/locale.js +5 -5
- package/src/mixins/migrating.js +28 -28
- package/src/transitions/collapse-transition.js +60 -60
- package/src/utils/after-leave.js +17 -17
- package/src/utils/aria-dialog.js +48 -48
- package/src/utils/aria-utils.js +64 -64
- package/src/utils/clickoutside.js +34 -34
- package/src/utils/date-util.js +163 -163
- package/src/utils/dom.js +165 -165
- package/src/utils/menu/aria-menubar.js +5 -5
- package/src/utils/menu/aria-menuitem.js +36 -36
- package/src/utils/menu/aria-submenu.js +44 -44
- package/src/utils/merge.js +12 -12
- package/src/utils/popup/index.js +203 -203
- package/src/utils/popup/popup-manager.js +169 -169
- package/src/utils/resize-event.js +20 -20
- package/src/utils/scroll-into-view.js +20 -20
- package/src/utils/scrollbar-width.js +18 -18
- package/src/utils/shared.js +3 -3
- package/src/utils/types.js +12 -12
- package/src/utils/util.js +157 -157
- package/src/utils/vdom.js +1 -1
- package/src/utils/vue-popper.js +179 -179
package/lib/upload.js
CHANGED
|
@@ -220,8 +220,8 @@ module.exports = require("element-ui/lib/progress");
|
|
|
220
220
|
// ESM COMPAT FLAG
|
|
221
221
|
__webpack_require__.r(__webpack_exports__);
|
|
222
222
|
|
|
223
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/upload-list.vue?vue&type=template&id=
|
|
224
|
-
var
|
|
223
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/upload-list.vue?vue&type=template&id=3c713bfc
|
|
224
|
+
var upload_listvue_type_template_id_3c713bfc_render = function () {
|
|
225
225
|
var _vm = this
|
|
226
226
|
var _h = _vm.$createElement
|
|
227
227
|
var _c = _vm._self._c || _h
|
|
@@ -294,7 +294,7 @@ var upload_listvue_type_template_id_297b92c2_render = function () {
|
|
|
294
294
|
},
|
|
295
295
|
[
|
|
296
296
|
_c("i", { staticClass: "el-icon-document" }),
|
|
297
|
-
_vm._v(_vm._s(file.name) + "\n
|
|
297
|
+
_vm._v(_vm._s(file.name) + "\n\t\t\t"),
|
|
298
298
|
]
|
|
299
299
|
),
|
|
300
300
|
_c(
|
|
@@ -378,10 +378,10 @@ var upload_listvue_type_template_id_297b92c2_render = function () {
|
|
|
378
378
|
)
|
|
379
379
|
}
|
|
380
380
|
var staticRenderFns = []
|
|
381
|
-
|
|
381
|
+
upload_listvue_type_template_id_3c713bfc_render._withStripped = true
|
|
382
382
|
|
|
383
383
|
|
|
384
|
-
// CONCATENATED MODULE: ./packages/upload/src/upload-list.vue?vue&type=template&id=
|
|
384
|
+
// CONCATENATED MODULE: ./packages/upload/src/upload-list.vue?vue&type=template&id=3c713bfc
|
|
385
385
|
|
|
386
386
|
// EXTERNAL MODULE: external "element-ui/lib/mixins/locale"
|
|
387
387
|
var locale_ = __webpack_require__(7);
|
|
@@ -462,40 +462,40 @@ var progress_default = /*#__PURE__*/__webpack_require__.n(progress_);
|
|
|
462
462
|
|
|
463
463
|
/* harmony default export */ var upload_listvue_type_script_lang_js = ({
|
|
464
464
|
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
465
|
+
name: 'ElUploadList',
|
|
466
|
+
|
|
467
|
+
mixins: [locale_default.a],
|
|
468
|
+
|
|
469
|
+
data: function data() {
|
|
470
|
+
return {
|
|
471
|
+
focusing: false
|
|
472
|
+
};
|
|
473
|
+
},
|
|
474
|
+
|
|
475
|
+
components: { ElProgress: progress_default.a },
|
|
476
|
+
|
|
477
|
+
props: {
|
|
478
|
+
files: {
|
|
479
|
+
type: Array,
|
|
480
|
+
default: function _default() {
|
|
481
|
+
return [];
|
|
482
|
+
}
|
|
483
|
+
},
|
|
484
|
+
disabled: {
|
|
485
|
+
type: Boolean,
|
|
486
|
+
default: false
|
|
487
|
+
},
|
|
488
|
+
handlePreview: Function,
|
|
489
|
+
listType: String
|
|
490
|
+
},
|
|
491
|
+
methods: {
|
|
492
|
+
parsePercentage: function parsePercentage(val) {
|
|
493
|
+
return parseInt(val, 10);
|
|
494
|
+
},
|
|
495
|
+
handleClick: function handleClick(file) {
|
|
496
|
+
this.handlePreview && this.handlePreview(file);
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
499
|
});
|
|
500
500
|
// CONCATENATED MODULE: ./packages/upload/src/upload-list.vue?vue&type=script&lang=js
|
|
501
501
|
/* harmony default export */ var src_upload_listvue_type_script_lang_js = (upload_listvue_type_script_lang_js);
|
|
@@ -512,7 +512,7 @@ var componentNormalizer = __webpack_require__(0);
|
|
|
512
512
|
|
|
513
513
|
var component = Object(componentNormalizer["a" /* default */])(
|
|
514
514
|
src_upload_listvue_type_script_lang_js,
|
|
515
|
-
|
|
515
|
+
upload_listvue_type_template_id_3c713bfc_render,
|
|
516
516
|
staticRenderFns,
|
|
517
517
|
false,
|
|
518
518
|
null,
|
|
@@ -528,92 +528,92 @@ var external_babel_helper_vue_jsx_merge_props_default = /*#__PURE__*/__webpack_r
|
|
|
528
528
|
|
|
529
529
|
// CONCATENATED MODULE: ./packages/upload/src/ajax.js
|
|
530
530
|
function getError(action, option, xhr) {
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
531
|
+
var msg = void 0;
|
|
532
|
+
if (xhr.response) {
|
|
533
|
+
msg = '' + (xhr.response.error || xhr.response);
|
|
534
|
+
} else if (xhr.responseText) {
|
|
535
|
+
msg = '' + xhr.responseText;
|
|
536
|
+
} else {
|
|
537
|
+
msg = 'fail to post ' + action + ' ' + xhr.status;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
var err = new Error(msg);
|
|
541
|
+
err.status = xhr.status;
|
|
542
|
+
err.method = 'post';
|
|
543
|
+
err.url = action;
|
|
544
|
+
return err;
|
|
545
545
|
}
|
|
546
546
|
|
|
547
547
|
function getBody(xhr) {
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
548
|
+
var text = xhr.responseText || xhr.response;
|
|
549
|
+
if (!text) {
|
|
550
|
+
return text;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
try {
|
|
554
|
+
return JSON.parse(text);
|
|
555
|
+
} catch (e) {
|
|
556
|
+
return text;
|
|
557
|
+
}
|
|
558
558
|
}
|
|
559
559
|
|
|
560
560
|
function upload(option) {
|
|
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
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
561
|
+
if (typeof XMLHttpRequest === 'undefined') {
|
|
562
|
+
return;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
var xhr = new XMLHttpRequest();
|
|
566
|
+
var action = option.action;
|
|
567
|
+
|
|
568
|
+
if (xhr.upload) {
|
|
569
|
+
xhr.upload.onprogress = function progress(e) {
|
|
570
|
+
if (e.total > 0) {
|
|
571
|
+
e.percent = e.loaded / e.total * 100;
|
|
572
|
+
}
|
|
573
|
+
option.onProgress(e);
|
|
574
|
+
};
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
var formData = new FormData();
|
|
578
|
+
|
|
579
|
+
if (option.data) {
|
|
580
|
+
Object.keys(option.data).forEach(function (key) {
|
|
581
|
+
formData.append(key, option.data[key]);
|
|
582
|
+
});
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
formData.append(option.filename, option.file, option.file.name);
|
|
586
|
+
|
|
587
|
+
xhr.onerror = function error(e) {
|
|
588
|
+
option.onError(e);
|
|
589
|
+
};
|
|
590
|
+
|
|
591
|
+
xhr.onload = function onload() {
|
|
592
|
+
if (xhr.status < 200 || xhr.status >= 300) {
|
|
593
|
+
return option.onError(getError(action, option, xhr));
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
option.onSuccess(getBody(xhr));
|
|
597
|
+
};
|
|
598
|
+
|
|
599
|
+
xhr.open('post', action, true);
|
|
600
|
+
|
|
601
|
+
if (option.withCredentials && 'withCredentials' in xhr) {
|
|
602
|
+
xhr.withCredentials = true;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
var headers = option.headers || {};
|
|
606
|
+
|
|
607
|
+
for (var item in headers) {
|
|
608
|
+
if (headers.hasOwnProperty(item) && headers[item] !== null) {
|
|
609
|
+
xhr.setRequestHeader(item, headers[item]);
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
xhr.send(formData);
|
|
613
|
+
return xhr;
|
|
614
614
|
}
|
|
615
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/upload-dragger.vue?vue&type=template&id=
|
|
616
|
-
var
|
|
615
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/upload-dragger.vue?vue&type=template&id=1b387969
|
|
616
|
+
var upload_draggervue_type_template_id_1b387969_render = function () {
|
|
617
617
|
var _vm = this
|
|
618
618
|
var _h = _vm.$createElement
|
|
619
619
|
var _c = _vm._self._c || _h
|
|
@@ -643,11 +643,11 @@ var upload_draggervue_type_template_id_4c315758_render = function () {
|
|
|
643
643
|
2
|
|
644
644
|
)
|
|
645
645
|
}
|
|
646
|
-
var
|
|
647
|
-
|
|
646
|
+
var upload_draggervue_type_template_id_1b387969_staticRenderFns = []
|
|
647
|
+
upload_draggervue_type_template_id_1b387969_render._withStripped = true
|
|
648
648
|
|
|
649
649
|
|
|
650
|
-
// CONCATENATED MODULE: ./packages/upload/src/upload-dragger.vue?vue&type=template&id=
|
|
650
|
+
// CONCATENATED MODULE: ./packages/upload/src/upload-dragger.vue?vue&type=template&id=1b387969
|
|
651
651
|
|
|
652
652
|
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/upload-dragger.vue?vue&type=script&lang=js
|
|
653
653
|
//
|
|
@@ -665,60 +665,60 @@ upload_draggervue_type_template_id_4c315758_render._withStripped = true
|
|
|
665
665
|
//
|
|
666
666
|
|
|
667
667
|
/* harmony default export */ var upload_draggervue_type_script_lang_js = ({
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
668
|
+
name: 'ElUploadDrag',
|
|
669
|
+
props: {
|
|
670
|
+
disabled: Boolean
|
|
671
|
+
},
|
|
672
|
+
inject: {
|
|
673
|
+
uploader: {
|
|
674
|
+
default: ''
|
|
675
|
+
}
|
|
676
|
+
},
|
|
677
|
+
data: function data() {
|
|
678
|
+
return {
|
|
679
|
+
dragover: false
|
|
680
|
+
};
|
|
681
|
+
},
|
|
682
|
+
|
|
683
|
+
methods: {
|
|
684
|
+
onDragover: function onDragover() {
|
|
685
|
+
if (!this.disabled) {
|
|
686
|
+
this.dragover = true;
|
|
687
|
+
}
|
|
688
|
+
},
|
|
689
|
+
onDrop: function onDrop(e) {
|
|
690
|
+
if (this.disabled || !this.uploader) return;
|
|
691
|
+
var accept = this.uploader.accept;
|
|
692
|
+
this.dragover = false;
|
|
693
|
+
if (!accept) {
|
|
694
|
+
this.$emit('file', e.dataTransfer.files);
|
|
695
|
+
return;
|
|
696
|
+
}
|
|
697
|
+
this.$emit('file', [].slice.call(e.dataTransfer.files).filter(function (file) {
|
|
698
|
+
var type = file.type,
|
|
699
|
+
name = file.name;
|
|
700
|
+
|
|
701
|
+
var extension = name.indexOf('.') > -1 ? '.' + name.split('.').pop() : '';
|
|
702
|
+
var baseType = type.replace(/\/.*$/, '');
|
|
703
|
+
return accept.split(',').map(function (type) {
|
|
704
|
+
return type.trim();
|
|
705
|
+
}).filter(function (type) {
|
|
706
|
+
return type;
|
|
707
|
+
}).some(function (acceptedType) {
|
|
708
|
+
if (/\..+$/.test(acceptedType)) {
|
|
709
|
+
return extension === acceptedType;
|
|
710
|
+
}
|
|
711
|
+
if (/\/\*$/.test(acceptedType)) {
|
|
712
|
+
return baseType === acceptedType.replace(/\/\*$/, '');
|
|
713
|
+
}
|
|
714
|
+
if (/^[^\/]+\/[^\/]+$/.test(acceptedType)) {
|
|
715
|
+
return type === acceptedType;
|
|
716
|
+
}
|
|
717
|
+
return false;
|
|
718
|
+
});
|
|
719
|
+
}));
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
722
|
});
|
|
723
723
|
// CONCATENATED MODULE: ./packages/upload/src/upload-dragger.vue?vue&type=script&lang=js
|
|
724
724
|
/* harmony default export */ var src_upload_draggervue_type_script_lang_js = (upload_draggervue_type_script_lang_js);
|
|
@@ -732,8 +732,8 @@ upload_draggervue_type_template_id_4c315758_render._withStripped = true
|
|
|
732
732
|
|
|
733
733
|
var upload_dragger_component = Object(componentNormalizer["a" /* default */])(
|
|
734
734
|
src_upload_draggervue_type_script_lang_js,
|
|
735
|
-
|
|
736
|
-
|
|
735
|
+
upload_draggervue_type_template_id_1b387969_render,
|
|
736
|
+
upload_draggervue_type_template_id_1b387969_staticRenderFns,
|
|
737
737
|
false,
|
|
738
738
|
null,
|
|
739
739
|
null,
|
|
@@ -749,232 +749,232 @@ var upload_dragger_component = Object(componentNormalizer["a" /* default */])(
|
|
|
749
749
|
|
|
750
750
|
|
|
751
751
|
/* harmony default export */ var uploadvue_type_script_lang_js = ({
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
752
|
+
inject: ['uploader'],
|
|
753
|
+
components: {
|
|
754
|
+
UploadDragger: upload_dragger
|
|
755
|
+
},
|
|
756
|
+
props: {
|
|
757
|
+
type: String,
|
|
758
|
+
action: {
|
|
759
|
+
type: String,
|
|
760
|
+
required: true
|
|
761
|
+
},
|
|
762
|
+
name: {
|
|
763
|
+
type: String,
|
|
764
|
+
default: 'file'
|
|
765
|
+
},
|
|
766
|
+
data: Object,
|
|
767
|
+
headers: Object,
|
|
768
|
+
withCredentials: Boolean,
|
|
769
|
+
multiple: Boolean,
|
|
770
|
+
accept: String,
|
|
771
|
+
onStart: Function,
|
|
772
|
+
onProgress: Function,
|
|
773
|
+
onSuccess: Function,
|
|
774
|
+
onError: Function,
|
|
775
|
+
beforeUpload: Function,
|
|
776
|
+
drag: Boolean,
|
|
777
|
+
onPreview: {
|
|
778
|
+
type: Function,
|
|
779
|
+
default: function _default() {}
|
|
780
|
+
},
|
|
781
|
+
onRemove: {
|
|
782
|
+
type: Function,
|
|
783
|
+
default: function _default() {}
|
|
784
|
+
},
|
|
785
|
+
fileList: Array,
|
|
786
|
+
autoUpload: Boolean,
|
|
787
|
+
listType: String,
|
|
788
|
+
httpRequest: {
|
|
789
|
+
type: Function,
|
|
790
|
+
default: upload
|
|
791
|
+
},
|
|
792
|
+
disabled: Boolean,
|
|
793
|
+
limit: Number,
|
|
794
|
+
onExceed: Function
|
|
795
|
+
},
|
|
796
|
+
|
|
797
|
+
data: function data() {
|
|
798
|
+
return {
|
|
799
|
+
mouseover: false,
|
|
800
|
+
reqs: {}
|
|
801
|
+
};
|
|
802
|
+
},
|
|
803
|
+
|
|
804
|
+
|
|
805
|
+
methods: {
|
|
806
|
+
isImage: function isImage(str) {
|
|
807
|
+
return str.indexOf('image') !== -1;
|
|
808
|
+
},
|
|
809
|
+
handleChange: function handleChange(ev) {
|
|
810
|
+
var files = ev.target.files;
|
|
811
|
+
|
|
812
|
+
if (!files) return;
|
|
813
|
+
this.uploadFiles(files);
|
|
814
|
+
},
|
|
815
|
+
uploadFiles: function uploadFiles(files) {
|
|
816
|
+
var _this = this;
|
|
817
|
+
|
|
818
|
+
if (this.limit && this.fileList.length + files.length > this.limit) {
|
|
819
|
+
this.onExceed && this.onExceed(files, this.fileList);
|
|
820
|
+
return;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
var postFiles = Array.prototype.slice.call(files);
|
|
824
|
+
if (!this.multiple) {
|
|
825
|
+
postFiles = postFiles.slice(0, 1);
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
if (postFiles.length === 0) {
|
|
829
|
+
return;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
postFiles.forEach(function (rawFile) {
|
|
833
|
+
_this.onStart(rawFile);
|
|
834
|
+
if (_this.autoUpload) _this.upload(rawFile);
|
|
835
|
+
});
|
|
836
|
+
},
|
|
837
|
+
upload: function upload(rawFile) {
|
|
838
|
+
var _this2 = this;
|
|
839
|
+
|
|
840
|
+
this.$refs.input.value = null;
|
|
841
|
+
|
|
842
|
+
if (!this.beforeUpload) {
|
|
843
|
+
return this.post(rawFile);
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
var before = this.beforeUpload(rawFile);
|
|
847
|
+
if (before && before.then) {
|
|
848
|
+
before.then(function (processedFile) {
|
|
849
|
+
var fileType = Object.prototype.toString.call(processedFile);
|
|
850
|
+
|
|
851
|
+
if (fileType === '[object File]' || fileType === '[object Blob]') {
|
|
852
|
+
if (fileType === '[object Blob]') {
|
|
853
|
+
processedFile = new File([processedFile], rawFile.name, {
|
|
854
|
+
type: rawFile.type
|
|
855
|
+
});
|
|
856
|
+
}
|
|
857
|
+
for (var p in rawFile) {
|
|
858
|
+
if (rawFile.hasOwnProperty(p)) {
|
|
859
|
+
processedFile[p] = rawFile[p];
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
_this2.post(processedFile);
|
|
863
|
+
} else {
|
|
864
|
+
_this2.post(rawFile);
|
|
865
|
+
}
|
|
866
|
+
}, function () {
|
|
867
|
+
_this2.onRemove(null, rawFile);
|
|
868
|
+
});
|
|
869
|
+
} else if (before !== false) {
|
|
870
|
+
this.post(rawFile);
|
|
871
|
+
} else {
|
|
872
|
+
this.onRemove(null, rawFile);
|
|
873
|
+
}
|
|
874
|
+
},
|
|
875
|
+
abort: function abort(file) {
|
|
876
|
+
var reqs = this.reqs;
|
|
877
|
+
|
|
878
|
+
if (file) {
|
|
879
|
+
var uid = file;
|
|
880
|
+
if (file.uid) uid = file.uid;
|
|
881
|
+
if (reqs[uid]) {
|
|
882
|
+
reqs[uid].abort();
|
|
883
|
+
}
|
|
884
|
+
} else {
|
|
885
|
+
Object.keys(reqs).forEach(function (uid) {
|
|
886
|
+
if (reqs[uid]) reqs[uid].abort();
|
|
887
|
+
delete reqs[uid];
|
|
888
|
+
});
|
|
889
|
+
}
|
|
890
|
+
},
|
|
891
|
+
post: function post(rawFile) {
|
|
892
|
+
var _this3 = this;
|
|
893
|
+
|
|
894
|
+
var uid = rawFile.uid;
|
|
895
|
+
|
|
896
|
+
var options = {
|
|
897
|
+
headers: this.headers,
|
|
898
|
+
withCredentials: this.withCredentials,
|
|
899
|
+
file: rawFile,
|
|
900
|
+
data: this.data,
|
|
901
|
+
filename: this.name,
|
|
902
|
+
action: this.action,
|
|
903
|
+
onProgress: function onProgress(e) {
|
|
904
|
+
_this3.onProgress(e, rawFile);
|
|
905
|
+
},
|
|
906
|
+
onSuccess: function onSuccess(res) {
|
|
907
|
+
_this3.onSuccess(res, rawFile);
|
|
908
|
+
delete _this3.reqs[uid];
|
|
909
|
+
},
|
|
910
|
+
onError: function onError(err) {
|
|
911
|
+
_this3.onError(err, rawFile);
|
|
912
|
+
delete _this3.reqs[uid];
|
|
913
|
+
}
|
|
914
|
+
};
|
|
915
|
+
var req = this.httpRequest(options);
|
|
916
|
+
this.reqs[uid] = req;
|
|
917
|
+
if (req && req.then) {
|
|
918
|
+
req.then(options.onSuccess, options.onError);
|
|
919
|
+
}
|
|
920
|
+
},
|
|
921
|
+
handleClick: function handleClick() {
|
|
922
|
+
if (!this.disabled) {
|
|
923
|
+
this.$refs.input.value = null;
|
|
924
|
+
this.$refs.input.click();
|
|
925
|
+
}
|
|
926
|
+
},
|
|
927
|
+
handleKeydown: function handleKeydown(e) {
|
|
928
|
+
if (e.target !== e.currentTarget) return;
|
|
929
|
+
if (e.keyCode === 13 || e.keyCode === 32) {
|
|
930
|
+
this.handleClick();
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
},
|
|
934
|
+
|
|
935
|
+
render: function render(h) {
|
|
936
|
+
var handleClick = this.handleClick,
|
|
937
|
+
drag = this.drag,
|
|
938
|
+
name = this.name,
|
|
939
|
+
handleChange = this.handleChange,
|
|
940
|
+
multiple = this.multiple,
|
|
941
|
+
accept = this.accept,
|
|
942
|
+
listType = this.listType,
|
|
943
|
+
uploadFiles = this.uploadFiles,
|
|
944
|
+
disabled = this.disabled,
|
|
945
|
+
handleKeydown = this.handleKeydown;
|
|
946
|
+
|
|
947
|
+
var data = {
|
|
948
|
+
class: {
|
|
949
|
+
'el-upload': true
|
|
950
|
+
},
|
|
951
|
+
on: {
|
|
952
|
+
click: handleClick,
|
|
953
|
+
keydown: handleKeydown
|
|
954
|
+
}
|
|
955
|
+
};
|
|
956
|
+
data.class['el-upload--' + listType] = true;
|
|
957
|
+
return h(
|
|
958
|
+
'div',
|
|
959
|
+
external_babel_helper_vue_jsx_merge_props_default()([data, {
|
|
960
|
+
attrs: { tabindex: '0' }
|
|
961
|
+
}]),
|
|
962
|
+
[drag ? h(
|
|
963
|
+
'upload-dragger',
|
|
964
|
+
{
|
|
965
|
+
attrs: { disabled: disabled },
|
|
966
|
+
on: {
|
|
967
|
+
'file': uploadFiles
|
|
968
|
+
}
|
|
969
|
+
},
|
|
970
|
+
[this.$slots.default]
|
|
971
|
+
) : this.$slots.default, h('input', { 'class': 'el-upload__input', attrs: { type: 'file', name: name, multiple: multiple, accept: accept },
|
|
972
|
+
ref: 'input', on: {
|
|
973
|
+
'change': handleChange
|
|
974
|
+
}
|
|
975
|
+
})]
|
|
976
|
+
);
|
|
977
|
+
}
|
|
978
978
|
});
|
|
979
979
|
// CONCATENATED MODULE: ./packages/upload/src/upload.vue?vue&type=script&lang=js
|
|
980
980
|
/* harmony default export */ var src_uploadvue_type_script_lang_js = (uploadvue_type_script_lang_js);
|
|
@@ -1012,339 +1012,339 @@ var migrating_default = /*#__PURE__*/__webpack_require__.n(migrating_);
|
|
|
1012
1012
|
function noop() {}
|
|
1013
1013
|
|
|
1014
1014
|
/* harmony default export */ var srcvue_type_script_lang_js = ({
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1015
|
+
name: 'ElUpload',
|
|
1016
|
+
|
|
1017
|
+
mixins: [migrating_default.a],
|
|
1018
|
+
|
|
1019
|
+
components: {
|
|
1020
|
+
ElProgress: progress_default.a,
|
|
1021
|
+
UploadList: upload_list,
|
|
1022
|
+
Upload: src_upload
|
|
1023
|
+
},
|
|
1024
|
+
|
|
1025
|
+
provide: function provide() {
|
|
1026
|
+
return {
|
|
1027
|
+
uploader: this
|
|
1028
|
+
};
|
|
1029
|
+
},
|
|
1030
|
+
|
|
1031
|
+
|
|
1032
|
+
inject: {
|
|
1033
|
+
elForm: {
|
|
1034
|
+
default: ''
|
|
1035
|
+
}
|
|
1036
|
+
},
|
|
1037
|
+
|
|
1038
|
+
props: {
|
|
1039
|
+
action: {
|
|
1040
|
+
type: String,
|
|
1041
|
+
required: true
|
|
1042
|
+
},
|
|
1043
|
+
headers: {
|
|
1044
|
+
type: Object,
|
|
1045
|
+
default: function _default() {
|
|
1046
|
+
return {};
|
|
1047
|
+
}
|
|
1048
|
+
},
|
|
1049
|
+
data: Object,
|
|
1050
|
+
multiple: Boolean,
|
|
1051
|
+
name: {
|
|
1052
|
+
type: String,
|
|
1053
|
+
default: 'file'
|
|
1054
|
+
},
|
|
1055
|
+
drag: Boolean,
|
|
1056
|
+
dragger: Boolean,
|
|
1057
|
+
withCredentials: Boolean,
|
|
1058
|
+
showFileList: {
|
|
1059
|
+
type: Boolean,
|
|
1060
|
+
default: true
|
|
1061
|
+
},
|
|
1062
|
+
accept: String,
|
|
1063
|
+
type: {
|
|
1064
|
+
type: String,
|
|
1065
|
+
default: 'select'
|
|
1066
|
+
},
|
|
1067
|
+
beforeUpload: Function,
|
|
1068
|
+
beforeRemove: Function,
|
|
1069
|
+
onRemove: {
|
|
1070
|
+
type: Function,
|
|
1071
|
+
default: noop
|
|
1072
|
+
},
|
|
1073
|
+
onChange: {
|
|
1074
|
+
type: Function,
|
|
1075
|
+
default: noop
|
|
1076
|
+
},
|
|
1077
|
+
onPreview: {
|
|
1078
|
+
type: Function
|
|
1079
|
+
},
|
|
1080
|
+
onSuccess: {
|
|
1081
|
+
type: Function,
|
|
1082
|
+
default: noop
|
|
1083
|
+
},
|
|
1084
|
+
onProgress: {
|
|
1085
|
+
type: Function,
|
|
1086
|
+
default: noop
|
|
1087
|
+
},
|
|
1088
|
+
onError: {
|
|
1089
|
+
type: Function,
|
|
1090
|
+
default: noop
|
|
1091
|
+
},
|
|
1092
|
+
fileList: {
|
|
1093
|
+
type: Array,
|
|
1094
|
+
default: function _default() {
|
|
1095
|
+
return [];
|
|
1096
|
+
}
|
|
1097
|
+
},
|
|
1098
|
+
autoUpload: {
|
|
1099
|
+
type: Boolean,
|
|
1100
|
+
default: true
|
|
1101
|
+
},
|
|
1102
|
+
listType: {
|
|
1103
|
+
type: String,
|
|
1104
|
+
default: 'text' // text,picture,picture-card
|
|
1105
|
+
},
|
|
1106
|
+
httpRequest: Function,
|
|
1107
|
+
disabled: Boolean,
|
|
1108
|
+
limit: Number,
|
|
1109
|
+
onExceed: {
|
|
1110
|
+
type: Function,
|
|
1111
|
+
default: noop
|
|
1112
|
+
}
|
|
1113
|
+
},
|
|
1114
|
+
|
|
1115
|
+
data: function data() {
|
|
1116
|
+
return {
|
|
1117
|
+
uploadFiles: [],
|
|
1118
|
+
dragOver: false,
|
|
1119
|
+
draging: false,
|
|
1120
|
+
tempIndex: 1
|
|
1121
|
+
};
|
|
1122
|
+
},
|
|
1123
|
+
|
|
1124
|
+
|
|
1125
|
+
computed: {
|
|
1126
|
+
uploadDisabled: function uploadDisabled() {
|
|
1127
|
+
return this.disabled || (this.elForm || {}).disabled;
|
|
1128
|
+
}
|
|
1129
|
+
},
|
|
1130
|
+
|
|
1131
|
+
watch: {
|
|
1132
|
+
listType: function listType(type) {
|
|
1133
|
+
if (type === 'picture-card' || type === 'picture') {
|
|
1134
|
+
this.uploadFiles = this.uploadFiles.map(function (file) {
|
|
1135
|
+
if (!file.url && file.raw) {
|
|
1136
|
+
try {
|
|
1137
|
+
file.url = URL.createObjectURL(file.raw);
|
|
1138
|
+
} catch (err) {
|
|
1139
|
+
console.error('[Element Error][Upload]', err);
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
return file;
|
|
1143
|
+
});
|
|
1144
|
+
}
|
|
1145
|
+
},
|
|
1146
|
+
|
|
1147
|
+
fileList: {
|
|
1148
|
+
immediate: true,
|
|
1149
|
+
handler: function handler(fileList) {
|
|
1150
|
+
var _this = this;
|
|
1151
|
+
|
|
1152
|
+
this.uploadFiles = fileList.map(function (item) {
|
|
1153
|
+
item.uid = item.uid || Date.now() + _this.tempIndex++;
|
|
1154
|
+
item.status = item.status || 'success';
|
|
1155
|
+
return item;
|
|
1156
|
+
});
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
},
|
|
1160
|
+
|
|
1161
|
+
methods: {
|
|
1162
|
+
handleStart: function handleStart(rawFile) {
|
|
1163
|
+
rawFile.uid = Date.now() + this.tempIndex++;
|
|
1164
|
+
var file = {
|
|
1165
|
+
status: 'ready',
|
|
1166
|
+
name: rawFile.name,
|
|
1167
|
+
size: rawFile.size,
|
|
1168
|
+
percentage: 0,
|
|
1169
|
+
uid: rawFile.uid,
|
|
1170
|
+
raw: rawFile
|
|
1171
|
+
};
|
|
1172
|
+
|
|
1173
|
+
if (this.listType === 'picture-card' || this.listType === 'picture') {
|
|
1174
|
+
try {
|
|
1175
|
+
file.url = URL.createObjectURL(rawFile);
|
|
1176
|
+
} catch (err) {
|
|
1177
|
+
console.error('[Element Error][Upload]', err);
|
|
1178
|
+
return;
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
this.uploadFiles.push(file);
|
|
1183
|
+
this.onChange(file, this.uploadFiles);
|
|
1184
|
+
},
|
|
1185
|
+
handleProgress: function handleProgress(ev, rawFile) {
|
|
1186
|
+
var file = this.getFile(rawFile);
|
|
1187
|
+
this.onProgress(ev, file, this.uploadFiles);
|
|
1188
|
+
file.status = 'uploading';
|
|
1189
|
+
file.percentage = ev.percent || 0;
|
|
1190
|
+
},
|
|
1191
|
+
handleSuccess: function handleSuccess(res, rawFile) {
|
|
1192
|
+
var file = this.getFile(rawFile);
|
|
1193
|
+
|
|
1194
|
+
if (file) {
|
|
1195
|
+
file.status = 'success';
|
|
1196
|
+
file.response = res;
|
|
1197
|
+
|
|
1198
|
+
this.onSuccess(res, file, this.uploadFiles);
|
|
1199
|
+
this.onChange(file, this.uploadFiles);
|
|
1200
|
+
}
|
|
1201
|
+
},
|
|
1202
|
+
handleError: function handleError(err, rawFile) {
|
|
1203
|
+
var file = this.getFile(rawFile);
|
|
1204
|
+
var fileList = this.uploadFiles;
|
|
1205
|
+
|
|
1206
|
+
file.status = 'fail';
|
|
1207
|
+
|
|
1208
|
+
fileList.splice(fileList.indexOf(file), 1);
|
|
1209
|
+
|
|
1210
|
+
this.onError(err, file, this.uploadFiles);
|
|
1211
|
+
this.onChange(file, this.uploadFiles);
|
|
1212
|
+
},
|
|
1213
|
+
handleRemove: function handleRemove(file, raw) {
|
|
1214
|
+
var _this2 = this;
|
|
1215
|
+
|
|
1216
|
+
if (raw) {
|
|
1217
|
+
file = this.getFile(raw);
|
|
1218
|
+
}
|
|
1219
|
+
var doRemove = function doRemove() {
|
|
1220
|
+
_this2.abort(file);
|
|
1221
|
+
var fileList = _this2.uploadFiles;
|
|
1222
|
+
fileList.splice(fileList.indexOf(file), 1);
|
|
1223
|
+
_this2.onRemove(file, fileList);
|
|
1224
|
+
};
|
|
1225
|
+
|
|
1226
|
+
if (!this.beforeRemove) {
|
|
1227
|
+
doRemove();
|
|
1228
|
+
} else if (typeof this.beforeRemove === 'function') {
|
|
1229
|
+
var before = this.beforeRemove(file, this.uploadFiles);
|
|
1230
|
+
if (before && before.then) {
|
|
1231
|
+
before.then(function () {
|
|
1232
|
+
doRemove();
|
|
1233
|
+
}, noop);
|
|
1234
|
+
} else if (before !== false) {
|
|
1235
|
+
doRemove();
|
|
1236
|
+
}
|
|
1237
|
+
}
|
|
1238
|
+
},
|
|
1239
|
+
getFile: function getFile(rawFile) {
|
|
1240
|
+
var fileList = this.uploadFiles;
|
|
1241
|
+
var target = void 0;
|
|
1242
|
+
fileList.every(function (item) {
|
|
1243
|
+
target = rawFile.uid === item.uid ? item : null;
|
|
1244
|
+
return !target;
|
|
1245
|
+
});
|
|
1246
|
+
return target;
|
|
1247
|
+
},
|
|
1248
|
+
abort: function abort(file) {
|
|
1249
|
+
this.$refs['upload-inner'].abort(file);
|
|
1250
|
+
},
|
|
1251
|
+
clearFiles: function clearFiles() {
|
|
1252
|
+
this.uploadFiles = [];
|
|
1253
|
+
},
|
|
1254
|
+
submit: function submit() {
|
|
1255
|
+
var _this3 = this;
|
|
1256
|
+
|
|
1257
|
+
this.uploadFiles.filter(function (file) {
|
|
1258
|
+
return file.status === 'ready';
|
|
1259
|
+
}).forEach(function (file) {
|
|
1260
|
+
_this3.$refs['upload-inner'].upload(file.raw);
|
|
1261
|
+
});
|
|
1262
|
+
},
|
|
1263
|
+
getMigratingConfig: function getMigratingConfig() {
|
|
1264
|
+
return {
|
|
1265
|
+
props: {
|
|
1266
|
+
'default-file-list': 'default-file-list is renamed to file-list.',
|
|
1267
|
+
'show-upload-list': 'show-upload-list is renamed to show-file-list.',
|
|
1268
|
+
'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'
|
|
1269
|
+
}
|
|
1270
|
+
};
|
|
1271
|
+
}
|
|
1272
|
+
},
|
|
1273
|
+
|
|
1274
|
+
beforeDestroy: function beforeDestroy() {
|
|
1275
|
+
this.uploadFiles.forEach(function (file) {
|
|
1276
|
+
if (file.url && file.url.indexOf('blob:') === 0) {
|
|
1277
|
+
URL.revokeObjectURL(file.url);
|
|
1278
|
+
}
|
|
1279
|
+
});
|
|
1280
|
+
},
|
|
1281
|
+
render: function render(h) {
|
|
1282
|
+
var _this4 = this;
|
|
1283
|
+
|
|
1284
|
+
var uploadList = void 0;
|
|
1285
|
+
|
|
1286
|
+
if (this.showFileList) {
|
|
1287
|
+
uploadList = h(
|
|
1288
|
+
upload_list,
|
|
1289
|
+
{
|
|
1290
|
+
attrs: {
|
|
1291
|
+
disabled: this.uploadDisabled,
|
|
1292
|
+
listType: this.listType,
|
|
1293
|
+
files: this.uploadFiles,
|
|
1294
|
+
|
|
1295
|
+
handlePreview: this.onPreview },
|
|
1296
|
+
on: {
|
|
1297
|
+
'remove': this.handleRemove
|
|
1298
|
+
}
|
|
1299
|
+
},
|
|
1300
|
+
[function (props) {
|
|
1301
|
+
if (_this4.$scopedSlots.file) {
|
|
1302
|
+
return _this4.$scopedSlots.file({
|
|
1303
|
+
file: props.file
|
|
1304
|
+
});
|
|
1305
|
+
}
|
|
1306
|
+
}]
|
|
1307
|
+
);
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
var uploadData = {
|
|
1311
|
+
props: {
|
|
1312
|
+
type: this.type,
|
|
1313
|
+
drag: this.drag,
|
|
1314
|
+
action: this.action,
|
|
1315
|
+
multiple: this.multiple,
|
|
1316
|
+
'before-upload': this.beforeUpload,
|
|
1317
|
+
'with-credentials': this.withCredentials,
|
|
1318
|
+
headers: this.headers,
|
|
1319
|
+
name: this.name,
|
|
1320
|
+
data: this.data,
|
|
1321
|
+
accept: this.accept,
|
|
1322
|
+
fileList: this.uploadFiles,
|
|
1323
|
+
autoUpload: this.autoUpload,
|
|
1324
|
+
listType: this.listType,
|
|
1325
|
+
disabled: this.uploadDisabled,
|
|
1326
|
+
limit: this.limit,
|
|
1327
|
+
'on-exceed': this.onExceed,
|
|
1328
|
+
'on-start': this.handleStart,
|
|
1329
|
+
'on-progress': this.handleProgress,
|
|
1330
|
+
'on-success': this.handleSuccess,
|
|
1331
|
+
'on-error': this.handleError,
|
|
1332
|
+
'on-preview': this.onPreview,
|
|
1333
|
+
'on-remove': this.handleRemove,
|
|
1334
|
+
'http-request': this.httpRequest
|
|
1335
|
+
},
|
|
1336
|
+
ref: 'upload-inner'
|
|
1337
|
+
};
|
|
1338
|
+
|
|
1339
|
+
var trigger = this.$slots.trigger || this.$slots.default;
|
|
1340
|
+
var uploadComponent = h(
|
|
1341
|
+
'upload',
|
|
1342
|
+
uploadData,
|
|
1343
|
+
[trigger]
|
|
1344
|
+
);
|
|
1345
|
+
|
|
1346
|
+
return h('div', [this.listType === 'picture-card' ? uploadList : '', this.$slots.trigger ? [uploadComponent, this.$slots.default] : uploadComponent, this.$slots.tip, this.listType !== 'picture-card' ? uploadList : '']);
|
|
1347
|
+
}
|
|
1348
1348
|
});
|
|
1349
1349
|
// CONCATENATED MODULE: ./packages/upload/src/index.vue?vue&type=script&lang=js
|
|
1350
1350
|
/* harmony default export */ var upload_srcvue_type_script_lang_js = (srcvue_type_script_lang_js);
|
|
@@ -1373,7 +1373,7 @@ var src_component = Object(componentNormalizer["a" /* default */])(
|
|
|
1373
1373
|
|
|
1374
1374
|
/* istanbul ignore next */
|
|
1375
1375
|
src.install = function (Vue) {
|
|
1376
|
-
|
|
1376
|
+
Vue.component(src.name, src);
|
|
1377
1377
|
};
|
|
1378
1378
|
|
|
1379
1379
|
/* harmony default export */ var packages_upload = __webpack_exports__["default"] = (src);
|