bkui-vue 2.0.1-beta.9 → 2.0.1-beta.91
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 +15 -0
- package/dist/index.cjs.js +167 -167
- package/dist/index.esm.js +32344 -31644
- package/dist/index.umd.js +167 -167
- package/dist/style.css +1 -1
- package/dist/style.variable.css +1 -1
- package/lib/affix/affix.css +130 -0
- package/lib/affix/affix.variable.css +262 -1
- package/lib/affix/index.js +7 -7
- package/lib/alert/alert.css +133 -3
- package/lib/alert/alert.d.ts +5 -12
- package/lib/alert/alert.variable.css +262 -1
- package/lib/alert/index.d.ts +11 -26
- package/lib/alert/index.js +6 -6
- package/lib/backtop/backtop.css +133 -3
- package/lib/backtop/backtop.d.ts +1 -1
- package/lib/backtop/backtop.variable.css +395 -4
- package/lib/backtop/index.d.ts +3 -3
- package/lib/backtop/index.js +6 -6
- package/lib/badge/badge.css +156 -26
- package/lib/badge/badge.variable.css +262 -1
- package/lib/badge/index.js +1 -1
- package/lib/breadcrumb/breadcrumb.css +135 -5
- package/lib/breadcrumb/breadcrumb.variable.css +397 -6
- package/lib/button/button.css +417 -243
- package/lib/button/button.d.ts +8 -8
- package/lib/button/button.less +74 -71
- package/lib/button/button.variable.css +450 -145
- package/lib/button/index.d.ts +11 -11
- package/lib/button/index.js +6 -7
- package/lib/card/card.css +134 -4
- package/lib/card/card.variable.css +396 -5
- package/lib/cascader/cascader-panel.d.ts +6 -1
- package/lib/cascader/cascader.css +153 -23
- package/lib/cascader/cascader.d.ts +5 -1
- package/lib/cascader/cascader.variable.css +415 -24
- package/lib/cascader/index.d.ts +1 -0
- package/lib/cascader/index.js +110 -40
- package/lib/cascader/interface.d.ts +1 -1
- package/lib/checkbox/checkbox-group.d.ts +0 -16
- package/lib/checkbox/checkbox.css +147 -9
- package/lib/checkbox/checkbox.d.ts +39 -7
- package/lib/checkbox/checkbox.less +12 -0
- package/lib/checkbox/checkbox.variable.css +270 -1
- package/lib/checkbox/index.d.ts +57 -22
- package/lib/checkbox/index.js +21 -8
- package/lib/checkbox/type.d.ts +1 -1
- package/lib/code-diff/code-diff.css +130 -0
- package/lib/code-diff/code-diff.variable.css +262 -1
- package/lib/code-diff/index.js +8 -8
- package/lib/collapse/collapse-panel.d.ts +5 -5
- package/lib/collapse/collapse.css +131 -1
- package/lib/collapse/collapse.variable.css +262 -1
- package/lib/collapse/index.d.ts +5 -5
- package/lib/collapse/index.js +4 -2
- package/lib/collapse/props.d.ts +2 -2
- package/lib/collapse/utils.d.ts +2 -2
- package/lib/collapse-transition/collapse-transition.css +130 -0
- package/lib/collapse-transition/collapse-transition.variable.css +262 -1
- package/lib/color-picker/color-picker.css +130 -0
- package/lib/color-picker/color-picker.d.ts +16 -0
- package/lib/color-picker/color-picker.variable.css +262 -1
- package/lib/color-picker/index.d.ts +23 -0
- package/lib/color-picker/index.js +52 -45
- package/lib/components.d.ts +30 -32
- package/lib/components.js +29 -31
- package/lib/config-provider/config-provider.css +130 -0
- package/lib/config-provider/config-provider.variable.css +262 -1
- package/lib/config-provider/index.d.ts +1 -1
- package/lib/container/container.css +130 -0
- package/lib/container/container.variable.css +392 -1
- package/lib/container/index.js +6 -7
- package/lib/date-picker/base/date-table.d.ts +1 -1
- package/lib/date-picker/base/month-table.d.ts +1 -1
- package/lib/date-picker/base/picker-dropdown.d.ts +1 -1
- package/lib/date-picker/base/year-table.d.ts +1 -1
- package/lib/date-picker/date-picker.css +147 -17
- package/lib/date-picker/date-picker.d.ts +3 -11
- package/lib/date-picker/date-picker.variable.css +262 -1
- package/lib/date-picker/index.d.ts +10 -24
- package/lib/date-picker/index.js +258 -219
- package/lib/date-picker/interface.d.ts +9 -9
- package/lib/date-picker/panel/date-range.d.ts +5 -5
- package/lib/date-picker/panel/date.d.ts +1 -1
- package/lib/date-picker/panel/time-range.d.ts +1 -10
- package/lib/date-picker/panel/time.d.ts +2 -11
- package/lib/date-picker/props.d.ts +1 -5
- package/lib/date-picker/time-picker.d.ts +3 -10
- package/lib/date-picker/utils.d.ts +1 -1
- package/lib/dialog/dialog.css +138 -8
- package/lib/dialog/dialog.d.ts +47 -31
- package/lib/dialog/dialog.variable.css +400 -9
- package/lib/dialog/index.d.ts +101 -67
- package/lib/dialog/index.js +25 -23
- package/lib/dialog/props.d.ts +20 -13
- package/lib/directives/index.d.ts +4 -3
- package/lib/directives/index.js +198 -176
- package/lib/directives/tooltips.d.ts +1 -1
- package/lib/dist.index.js +2 -4
- package/lib/divider/divider.css +133 -3
- package/lib/divider/divider.d.ts +5 -5
- package/lib/divider/divider.variable.css +262 -1
- package/lib/divider/index.d.ts +11 -11
- package/lib/divider/index.js +2 -2
- package/lib/divider/props.d.ts +2 -2
- package/lib/dropdown/dropdown-item.d.ts +1 -1
- package/lib/dropdown/dropdown-menu.d.ts +1 -1
- package/lib/dropdown/dropdown.css +130 -0
- package/lib/dropdown/dropdown.d.ts +11 -11
- package/lib/dropdown/dropdown.variable.css +392 -1
- package/lib/dropdown/index.d.ts +26 -26
- package/lib/dropdown/index.js +10 -8
- package/lib/exception/exception.css +130 -0
- package/lib/exception/exception.d.ts +9 -9
- package/lib/exception/exception.variable.css +262 -1
- package/lib/exception/index.d.ts +11 -11
- package/lib/exception/index.js +10 -10
- package/lib/exception/typings/index.d.ts +1 -1
- package/lib/fixed-navbar/fixed-navbar.css +134 -4
- package/lib/fixed-navbar/fixed-navbar.variable.css +262 -1
- package/lib/fixed-navbar/index.js +2 -2
- package/lib/form/form-item.d.ts +7 -19
- package/lib/form/form.css +130 -0
- package/lib/form/form.d.ts +2 -2
- package/lib/form/form.variable.css +262 -1
- package/lib/form/index.d.ts +7 -14
- package/lib/form/index.js +22 -21
- package/lib/form/type.d.ts +2 -2
- package/lib/icon/index.d.ts +11 -11
- package/lib/icon/index.js +11 -11
- package/lib/image/image-viewer.css +130 -0
- package/lib/image/image-viewer.d.ts +1 -1
- package/lib/image/image-viewer.variable.css +262 -1
- package/lib/image/image.css +130 -0
- package/lib/image/image.variable.css +392 -1
- package/lib/image/index.js +20 -21
- package/lib/index.d.ts +9 -3
- package/lib/index.js +5 -29
- package/lib/info-box/index.js +17 -18
- package/lib/info-box/info-box.css +134 -4
- package/lib/info-box/info-box.d.ts +15 -15
- package/lib/info-box/info-box.variable.css +262 -1
- package/lib/input/index.d.ts +15 -15
- package/lib/input/index.js +63 -516
- package/lib/input/input.css +225 -73
- package/lib/input/input.d.ts +15 -15
- package/lib/input/input.less +30 -1
- package/lib/input/input.variable.css +487 -74
- package/lib/link/index.d.ts +11 -11
- package/lib/link/index.js +3 -3
- package/lib/link/link.css +146 -16
- package/lib/link/link.d.ts +5 -5
- package/lib/link/link.variable.css +262 -1
- package/lib/loading/index.d.ts +12 -11
- package/lib/loading/index.js +10 -8
- package/lib/loading/loading.css +146 -16
- package/lib/loading/loading.d.ts +8 -8
- package/lib/loading/loading.variable.css +408 -17
- package/lib/locale/index.d.ts +1 -1
- package/lib/menu/index.d.ts +1 -0
- package/lib/menu/index.js +2 -3
- package/lib/menu/menu.css +148 -18
- package/lib/menu/menu.variable.css +410 -19
- package/lib/menu/submenu.css +130 -0
- package/lib/menu/submenu.d.ts +1 -0
- package/lib/menu/submenu.variable.css +262 -1
- package/lib/menu/utils.d.ts +3 -3
- package/lib/message/index.js +18 -18
- package/lib/message/message.css +153 -22
- package/lib/message/message.less +3 -2
- package/lib/message/message.variable.css +264 -2
- package/lib/message/messageConstructor.d.ts +16 -16
- package/lib/modal/index.d.ts +62 -21
- package/lib/modal/index.js +49 -28
- package/lib/modal/modal.css +134 -4
- package/lib/modal/modal.d.ts +24 -8
- package/lib/modal/modal.variable.css +396 -5
- package/lib/modal/props.mixin.d.ts +10 -3
- package/lib/navigation/index.js +20 -20
- package/lib/navigation/navigation.css +132 -2
- package/lib/navigation/navigation.d.ts +1 -1
- package/lib/navigation/navigation.variable.css +262 -1
- package/lib/notify/index.js +4 -4
- package/lib/notify/notify.css +137 -7
- package/lib/notify/notify.variable.css +262 -1
- package/lib/notify/notifyConstructor.d.ts +5 -5
- package/lib/overflow-title/components/overflow-title.d.ts +29 -20
- package/lib/overflow-title/index.d.ts +59 -42
- package/lib/overflow-title/index.js +75 -18
- package/lib/overflow-title/props.d.ts +28 -23
- package/lib/pagination/index.d.ts +0 -19
- package/lib/pagination/index.js +76 -23
- package/lib/pagination/pagination.css +139 -9
- package/lib/pagination/pagination.d.ts +0 -13
- package/lib/pagination/pagination.less +14 -13
- package/lib/pagination/pagination.variable.css +270 -9
- package/lib/pagination/type.d.ts +1 -1
- package/lib/pagination/use-limit.d.ts +1 -1
- package/lib/pagination/use-total.d.ts +1 -1
- package/lib/plugin-popover/index.js +127 -58
- package/lib/pop-confirm/index.d.ts +11 -43
- package/lib/pop-confirm/index.js +27 -28
- package/lib/pop-confirm/pop-confirm.css +133 -1
- package/lib/pop-confirm/pop-confirm.d.ts +5 -19
- package/lib/pop-confirm/pop-confirm.less +3 -1
- package/lib/pop-confirm/pop-confirm.variable.css +265 -2
- package/lib/pop-confirm/props.d.ts +5 -11
- package/lib/popover/const.d.ts +3 -3
- package/lib/popover/content.d.ts +5 -2
- package/lib/popover/index.d.ts +74 -30
- package/lib/popover/index.js +127 -58
- package/lib/popover/plugin-popover.d.ts +1 -1
- package/lib/popover/popover.css +130 -0
- package/lib/popover/popover.d.ts +32 -12
- package/lib/popover/popover.variable.css +262 -1
- package/lib/popover/props.d.ts +14 -6
- package/lib/popover/use-floating.d.ts +5 -2
- package/lib/preset.d.ts +0 -1
- package/lib/preset.js +0 -1
- package/lib/process/index.js +3 -3
- package/lib/process/process.css +143 -13
- package/lib/process/process.variable.css +262 -1
- package/lib/progress/index.d.ts +11 -11
- package/lib/progress/index.js +10 -11
- package/lib/progress/progress.css +134 -4
- package/lib/progress/progress.d.ts +7 -7
- package/lib/progress/progress.variable.css +396 -5
- package/lib/radio/index.d.ts +21 -21
- package/lib/radio/index.js +28 -17
- package/lib/radio/radio-button.d.ts +7 -7
- package/lib/radio/radio-group.d.ts +7 -7
- package/lib/radio/radio.css +172 -42
- package/lib/radio/radio.d.ts +7 -7
- package/lib/radio/radio.variable.css +262 -1
- package/lib/radio/type.d.ts +1 -1
- package/lib/rate/index.js +8 -8
- package/lib/rate/rate.css +130 -0
- package/lib/rate/rate.variable.css +262 -1
- package/lib/resize-layout/index.d.ts +34 -11
- package/lib/resize-layout/index.js +33 -14
- package/lib/resize-layout/resize-layout.css +130 -0
- package/lib/resize-layout/resize-layout.d.ts +16 -5
- package/lib/resize-layout/resize-layout.variable.css +262 -1
- package/lib/scrollbar/css/scrollbar.css +239 -0
- package/lib/scrollbar/css/scrollbar.less +139 -0
- package/lib/scrollbar/css/scrollbar.variable.css +499 -0
- package/lib/scrollbar/handlers/click-rail.d.ts +2 -0
- package/lib/scrollbar/handlers/drag-thumb.d.ts +1 -0
- package/lib/scrollbar/handlers/keyboard.d.ts +2 -0
- package/lib/scrollbar/handlers/mouse-wheel.d.ts +2 -0
- package/lib/scrollbar/handlers/touch.d.ts +4 -0
- package/lib/scrollbar/helper/class-names.d.ts +21 -0
- package/lib/scrollbar/helper/css.d.ts +3 -0
- package/lib/scrollbar/helper/dom.d.ts +4 -0
- package/lib/scrollbar/helper/event-manager.d.ts +20 -0
- package/lib/scrollbar/helper/util.d.ts +11 -0
- package/lib/scrollbar/index.d.ts +133 -13
- package/lib/scrollbar/index.js +1332 -18434
- package/lib/scrollbar/process-scroll-diff.d.ts +1 -0
- package/lib/scrollbar/update-geometry.d.ts +8 -0
- package/lib/search-select/index.d.ts +100 -78
- package/lib/search-select/index.js +344 -213
- package/lib/search-select/input.d.ts +17 -6
- package/lib/search-select/menu.d.ts +13 -1
- package/lib/search-select/search-select.css +163 -35
- package/lib/search-select/search-select.d.ts +33 -43
- package/lib/search-select/search-select.less +2 -2
- package/lib/search-select/search-select.variable.css +425 -36
- package/lib/search-select/selected.d.ts +35 -10
- package/lib/search-select/utils.d.ts +6 -6
- package/lib/select/common.d.ts +4 -4
- package/lib/select/index.d.ts +251 -91
- package/lib/select/index.js +313 -200
- package/lib/select/option.d.ts +5 -6
- package/lib/select/select.css +175 -43
- package/lib/select/select.d.ts +104 -34
- package/lib/select/select.less +7 -4
- package/lib/select/select.variable.css +437 -44
- package/lib/select/selectTagInput.d.ts +7 -6
- package/lib/select/type.d.ts +10 -11
- package/lib/shared/frame-throttle.d.ts +15 -0
- package/lib/shared/index.d.ts +2 -1
- package/lib/shared/index.js +111 -47
- package/lib/shared/popover.d.ts +3 -3
- package/lib/shared/token.d.ts +1 -1
- package/lib/shared/vue-types.d.ts +53 -52
- package/lib/shared/z-index-manager.d.ts +6 -6
- package/lib/sideslider/index.d.ts +52 -18
- package/lib/sideslider/index.js +12 -11
- package/lib/sideslider/sideslider.css +138 -9
- package/lib/sideslider/sideslider.d.ts +24 -8
- package/lib/sideslider/sideslider.less +7 -8
- package/lib/sideslider/sideslider.variable.css +269 -9
- package/lib/slider/index.js +21 -23
- package/lib/slider/slider.css +135 -5
- package/lib/slider/slider.variable.css +262 -1
- package/lib/steps/index.d.ts +14 -29
- package/lib/steps/index.js +3 -4
- package/lib/steps/steps.css +168 -38
- package/lib/steps/steps.d.ts +8 -18
- package/lib/steps/steps.variable.css +262 -1
- package/lib/styles/index.d.ts +1 -0
- package/lib/styles/mixins/animate.css +130 -0
- package/lib/styles/mixins/animate.variable.css +262 -1
- package/lib/styles/mixins/mixins.css +130 -0
- package/lib/styles/mixins/mixins.variable.css +130 -0
- package/lib/styles/mixins/popper.css +130 -0
- package/lib/styles/mixins/popper.variable.css +262 -1
- package/lib/styles/mixins/scroll.css +130 -0
- package/lib/styles/mixins/scroll.variable.css +262 -1
- package/lib/styles/reset.css +130 -0
- package/lib/styles/reset.variable.css +262 -1
- package/lib/{scrollbar/scrollbar.variable.css → styles/themes/themes.css} +2 -76
- package/lib/styles/themes/themes.less +299 -129
- package/lib/styles/themes/themes.variable.css +130 -0
- package/lib/swiper/index.js +5 -5
- package/lib/swiper/swiper.css +130 -0
- package/lib/swiper/swiper.variable.css +262 -1
- package/lib/switcher/index.d.ts +11 -11
- package/lib/switcher/index.js +2 -2
- package/lib/switcher/switcher.css +147 -17
- package/lib/switcher/switcher.d.ts +9 -9
- package/lib/switcher/switcher.variable.css +409 -18
- package/lib/tab/index.d.ts +49 -119
- package/lib/tab/index.js +60 -49
- package/lib/tab/props.d.ts +27 -52
- package/lib/tab/tab-nav.d.ts +26 -66
- package/lib/tab/tab-panel.d.ts +27 -5
- package/lib/tab/tab.css +211 -17
- package/lib/tab/tab.d.ts +10 -54
- package/lib/tab/tab.less +91 -4
- package/lib/tab/tab.variable.css +326 -1
- package/lib/table/components/ghost-body.d.ts +2 -0
- package/lib/table/components/table-cell.d.ts +22 -0
- package/lib/table/components/table-column.d.ts +23 -126
- package/lib/table/const.d.ts +23 -10
- package/lib/table/events.d.ts +16 -112
- package/lib/table/hooks/use-cell.d.ts +20 -0
- package/lib/table/hooks/use-column-resize.d.ts +7 -0
- package/lib/table/hooks/use-column-template.d.ts +5 -0
- package/lib/table/hooks/use-columns.d.ts +69 -0
- package/lib/table/{plugins → hooks}/use-draggable.d.ts +2 -2
- package/lib/table/hooks/use-fixed-column.d.ts +10 -0
- package/lib/table/hooks/use-head.d.ts +16 -0
- package/lib/table/hooks/use-layout.d.ts +25 -0
- package/lib/table/hooks/use-pagination.d.ts +16 -0
- package/lib/table/hooks/use-render.d.ts +21 -0
- package/lib/table/hooks/use-rows.d.ts +30 -0
- package/lib/table/hooks/use-settings.d.ts +136 -0
- package/lib/table/{plugins → hooks}/use-shift-key.d.ts +4 -2
- package/lib/table/index.d.ts +112 -634
- package/lib/table/index.js +4090 -3559
- package/lib/table/plugins/head-filter.css +135 -0
- package/lib/table/plugins/head-filter.d.ts +2 -1
- package/lib/table/plugins/head-filter.less +4 -0
- package/lib/table/plugins/head-filter.variable.css +267 -1
- package/lib/table/plugins/head-sort.css +130 -0
- package/lib/table/plugins/head-sort.variable.css +262 -1
- package/lib/table/plugins/settings.css +131 -0
- package/lib/table/plugins/settings.less +1 -0
- package/lib/table/plugins/settings.variable.css +263 -1
- package/lib/table/props.d.ts +125 -62
- package/lib/table/table.css +753 -431
- package/lib/table/table.d.ts +51 -185
- package/lib/table/table.less +244 -112
- package/lib/table/table.variable.css +1058 -475
- package/lib/table/utils.d.ts +49 -21
- package/lib/table-column/index.d.ts +30 -289
- package/lib/table-column/index.js +17385 -46
- package/lib/tag/index.d.ts +11 -11
- package/lib/tag/index.js +2 -3
- package/lib/tag/tag.css +136 -6
- package/lib/tag/tag.d.ts +5 -5
- package/lib/tag/tag.less +1 -1
- package/lib/tag/tag.variable.css +263 -2
- package/lib/tag-input/common.d.ts +2 -2
- package/lib/tag-input/index.d.ts +77 -19
- package/lib/tag-input/index.js +78 -54
- package/lib/tag-input/tag-input.css +157 -27
- package/lib/tag-input/tag-input.d.ts +39 -23
- package/lib/tag-input/tag-input.less +9 -9
- package/lib/tag-input/tag-input.variable.css +271 -10
- package/lib/tag-input/tag-props.d.ts +17 -4
- package/lib/time-picker/index.d.ts +10 -21
- package/lib/time-picker/time-picker.css +130 -0
- package/lib/time-picker/time-picker.variable.css +262 -1
- package/lib/timeline/index.js +2 -2
- package/lib/timeline/timeline.css +149 -19
- package/lib/timeline/timeline.variable.css +262 -1
- package/lib/transfer/const.d.ts +2 -2
- package/lib/transfer/index.js +3 -5
- package/lib/transfer/transfer.css +149 -19
- package/lib/transfer/transfer.variable.css +262 -1
- package/lib/tree/constant.d.ts +22 -20
- package/lib/tree/index.d.ts +41 -27
- package/lib/tree/index.js +102 -55
- package/lib/tree/props.d.ts +18 -11
- package/lib/tree/tree.css +242 -78
- package/lib/tree/tree.d.ts +17 -17
- package/lib/tree/tree.variable.css +504 -79
- package/lib/tree/use-empty.d.ts +1 -1
- package/lib/tree/use-node-action.d.ts +10 -9
- package/lib/tree/use-node-async.d.ts +2 -1
- package/lib/tree/use-node-attribute.d.ts +42 -34
- package/lib/tree/use-search.d.ts +1 -1
- package/lib/tree/use-tree-init.d.ts +8 -5
- package/lib/tree/util.d.ts +21 -21
- package/lib/upload/index.d.ts +52 -6
- package/lib/upload/index.js +134 -55
- package/lib/upload/props.d.ts +11 -2
- package/lib/upload/upload-list.d.ts +11 -1
- package/lib/upload/upload-trigger.d.ts +11 -1
- package/lib/upload/upload.css +157 -27
- package/lib/upload/upload.d.ts +24 -3
- package/lib/upload/upload.type.d.ts +12 -6
- package/lib/upload/upload.variable.css +419 -28
- package/lib/upload/use-file-handler.d.ts +1 -1
- package/lib/virtual-render/index.d.ts +12 -46
- package/lib/virtual-render/index.js +17468 -148
- package/lib/virtual-render/props.d.ts +2 -9
- package/lib/virtual-render/use-fix-top.d.ts +1 -1
- package/lib/virtual-render/use-scrollbar.d.ts +4 -17
- package/lib/virtual-render/v-virtual-render.d.ts +7 -1
- package/lib/virtual-render/virtual-render.css +225 -69
- package/lib/virtual-render/virtual-render.d.ts +6 -22
- package/lib/virtual-render/virtual-render.less +2 -11
- package/lib/virtual-render/virtual-render.variable.css +487 -70
- package/lib/volar.components.d.ts +2 -0
- package/package.json +17 -55
- package/lib/scrollbar/scrollbar-core/can-use-dom.d.ts +0 -2
- package/lib/scrollbar/scrollbar-core/helpers.d.ts +0 -5
- package/lib/scrollbar/scrollbar-core/index.d.ts +0 -241
- package/lib/scrollbar/scrollbar-core/mouse-wheel.d.ts +0 -5
- package/lib/scrollbar/scrollbar-core/scrollbar-width.d.ts +0 -1
- package/lib/scrollbar/scrollbar.css +0 -75
- package/lib/scrollbar/scrollbar.less +0 -94
- package/lib/table/plugins/col-group.d.ts +0 -38
- package/lib/table/plugins/settings.d.ts +0 -16
- package/lib/table/plugins/use-active-columns.d.ts +0 -16
- package/lib/table/plugins/use-column-resize.d.ts +0 -35
- package/lib/table/plugins/use-column-template.d.ts +0 -7
- package/lib/table/plugins/use-fixed-column.d.ts +0 -27
- package/lib/table/plugins/use-head-cell.d.ts +0 -7
- package/lib/table/plugins/use-pagination.d.ts +0 -23
- package/lib/table/use-attributes.d.ts +0 -62
- package/lib/table/use-column.d.ts +0 -275
- package/lib/table/use-common.d.ts +0 -1679
- package/lib/table/use-render.d.ts +0 -11
- /package/lib/table/{plugins → components}/body-empty.d.ts +0 -0
- /package/lib/table/{plugins → hooks}/use-observer-resize.d.ts +0 -0
- /package/lib/table/{plugins → hooks}/use-scroll-loading.d.ts +0 -0
package/lib/upload/index.js
CHANGED
@@ -1292,12 +1292,17 @@ var EThemes;
|
|
1292
1292
|
EThemes["DRAGGABLE"] = "draggable";
|
1293
1293
|
EThemes["PICTURE"] = "picture";
|
1294
1294
|
})(EThemes || (EThemes = {}));
|
1295
|
+
var ETypes;
|
1296
|
+
(function (ETypes) {
|
1297
|
+
ETypes["BINARY"] = "binary";
|
1298
|
+
ETypes["FORMDATA"] = "formdata";
|
1299
|
+
})(ETypes || (ETypes = {}));
|
1295
1300
|
var EUploadStatus;
|
1296
1301
|
(function (EUploadStatus) {
|
1302
|
+
EUploadStatus["FAIL"] = "fail";
|
1297
1303
|
EUploadStatus["NEW"] = "new";
|
1298
|
-
EUploadStatus["UPLOADING"] = "uploading";
|
1299
1304
|
EUploadStatus["SUCCESS"] = "success";
|
1300
|
-
EUploadStatus["
|
1305
|
+
EUploadStatus["UPLOADING"] = "uploading";
|
1301
1306
|
})(EUploadStatus || (EUploadStatus = {}));
|
1302
1307
|
;// CONCATENATED MODULE: ../../packages/upload/src/props.ts
|
1303
1308
|
/*
|
@@ -1327,7 +1332,19 @@ var EUploadStatus;
|
|
1327
1332
|
*/
|
1328
1333
|
|
1329
1334
|
var themes = [EThemes.BUTTON, EThemes.DRAGGABLE, EThemes.PICTURE];
|
1335
|
+
var types = [ETypes.FORMDATA, ETypes.BINARY];
|
1330
1336
|
/* harmony default export */ const props = ({
|
1337
|
+
type: {
|
1338
|
+
type: String,
|
1339
|
+
"default": 'formdata',
|
1340
|
+
validator: function validator(val) {
|
1341
|
+
if (!val || types.includes(val)) {
|
1342
|
+
return true;
|
1343
|
+
}
|
1344
|
+
console.error("invalid type, ".concat(val, ", the type must be one of \u3010").concat(types.join(' | '), "\u3011"));
|
1345
|
+
return false;
|
1346
|
+
}
|
1347
|
+
},
|
1331
1348
|
theme: {
|
1332
1349
|
type: String,
|
1333
1350
|
"default": 'draggable',
|
@@ -1459,6 +1476,11 @@ var themes = [EThemes.BUTTON, EThemes.DRAGGABLE, EThemes.PICTURE];
|
|
1459
1476
|
chunkSize: {
|
1460
1477
|
type: Number,
|
1461
1478
|
"default": 10
|
1479
|
+
},
|
1480
|
+
// 是否显示预览按钮
|
1481
|
+
isShowPreview: {
|
1482
|
+
type: Boolean,
|
1483
|
+
"default": true
|
1462
1484
|
}
|
1463
1485
|
});
|
1464
1486
|
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
|
@@ -1524,7 +1546,7 @@ function _slicedToArray(arr, i) {
|
|
1524
1546
|
;// CONCATENATED MODULE: external "../icon"
|
1525
1547
|
var icon_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
1526
1548
|
var icon_y = x => () => x
|
1527
|
-
const icon_namespaceObject = icon_x({ ["ArchiveFill"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.ArchiveFill, ["AudioFill"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.AudioFill, ["Del"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.Del, ["Done"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.Done, ["ImageFill"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.ImageFill, ["Plus"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.Plus, ["RightTurnLine"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.RightTurnLine, ["TextFill"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.TextFill, ["Upload"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.Upload, ["VideoFill"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.VideoFill });
|
1549
|
+
const icon_namespaceObject = icon_x({ ["ArchiveFill"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.ArchiveFill, ["AudioFill"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.AudioFill, ["Del"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.Del, ["Done"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.Done, ["Eye"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.Eye, ["ImageFill"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.ImageFill, ["Plus"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.Plus, ["RightTurnLine"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.RightTurnLine, ["TextFill"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.TextFill, ["Upload"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.Upload, ["VideoFill"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.VideoFill });
|
1528
1550
|
;// CONCATENATED MODULE: external "../progress"
|
1529
1551
|
var progress_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
1530
1552
|
var progress_y = x => () => x
|
@@ -1579,9 +1601,10 @@ function _isSlot(s) {
|
|
1579
1601
|
theme: props.theme,
|
1580
1602
|
disabled: props.disabled,
|
1581
1603
|
files: props.files,
|
1582
|
-
multiple: props.multiple
|
1604
|
+
multiple: props.multiple,
|
1605
|
+
isShowPreview: props.isShowPreview
|
1583
1606
|
},
|
1584
|
-
emits: ['remove', 'retry'],
|
1607
|
+
emits: ['remove', 'preview', 'retry'],
|
1585
1608
|
setup: function setup(props, _ref) {
|
1586
1609
|
var slots = _ref.slots,
|
1587
1610
|
emit = _ref.emit;
|
@@ -1591,7 +1614,8 @@ function _isSlot(s) {
|
|
1591
1614
|
var _toRefs = (0,external_vue_namespaceObject.toRefs)(props),
|
1592
1615
|
theme = _toRefs.theme,
|
1593
1616
|
disabled = _toRefs.disabled,
|
1594
|
-
multiple = _toRefs.multiple
|
1617
|
+
multiple = _toRefs.multiple,
|
1618
|
+
isShowPreview = _toRefs.isShowPreview;
|
1595
1619
|
var classBlock = "".concat(resolveClassName(CLASS_PREFIX), "-list");
|
1596
1620
|
var isPhotowall = (0,external_vue_namespaceObject.computed)(function () {
|
1597
1621
|
return theme.value === EThemes.PICTURE;
|
@@ -1608,6 +1632,9 @@ function _isSlot(s) {
|
|
1608
1632
|
var size = value / Math.pow(1024, index);
|
1609
1633
|
return "".concat(size.toFixed(2)).concat(uints[index]);
|
1610
1634
|
}
|
1635
|
+
function handlePreview(file, files, e) {
|
1636
|
+
emit('preview', file, files, e);
|
1637
|
+
}
|
1611
1638
|
function handleRemove(file, e) {
|
1612
1639
|
emit('remove', file, e);
|
1613
1640
|
}
|
@@ -1634,22 +1661,27 @@ function _isSlot(s) {
|
|
1634
1661
|
};
|
1635
1662
|
var PhotoItem = function PhotoItem(file) {
|
1636
1663
|
return [(0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("img", {
|
1637
|
-
"src": file.url,
|
1638
1664
|
"class": "".concat(classBlock, "__picture-item-thumbnail"),
|
1639
|
-
"alt": ""
|
1665
|
+
"alt": "",
|
1666
|
+
"src": file.url
|
1640
1667
|
}, null), [[external_vue_namespaceObject.vShow, file.status !== 'uploading']]), (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [file.status === 'uploading' && (0,external_vue_namespaceObject.createVNode)(progress_namespaceObject["default"], {
|
1668
|
+
"width": 50,
|
1641
1669
|
"class": "".concat(classBlock, "__picture-item-progress"),
|
1642
|
-
"type": "circle",
|
1643
|
-
"color": "#3a84ff",
|
1644
1670
|
"bgColor": "#333",
|
1645
|
-
"
|
1671
|
+
"color": "#3a84ff",
|
1672
|
+
"percent": file.percentage,
|
1646
1673
|
"titleStyle": {
|
1647
1674
|
color: '#fff'
|
1648
1675
|
},
|
1649
|
-
"
|
1676
|
+
"type": "circle"
|
1650
1677
|
}, null)]), (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [!disabled.value && (0,external_vue_namespaceObject.createVNode)("div", {
|
1651
1678
|
"class": "".concat(classBlock, "__picture-item-actions")
|
1652
|
-
}, [(0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.
|
1679
|
+
}, [isShowPreview.value && (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.Eye, {
|
1680
|
+
"class": "action-icon",
|
1681
|
+
"onClick": function onClick(e) {
|
1682
|
+
return handlePreview(file, props.files, e);
|
1683
|
+
}
|
1684
|
+
}, null), (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.Del, {
|
1653
1685
|
"class": "action-icon",
|
1654
1686
|
"onClick": function onClick(e) {
|
1655
1687
|
return handleRemove(file, e);
|
@@ -1700,9 +1732,9 @@ function _isSlot(s) {
|
|
1700
1732
|
return [(0,external_vue_namespaceObject.createVNode)("div", {
|
1701
1733
|
"class": "".concat(classBlock, "__item-icon")
|
1702
1734
|
}, [file.isPic ? (0,external_vue_namespaceObject.createVNode)("img", {
|
1703
|
-
"src": file.url,
|
1704
1735
|
"class": "".concat(classBlock, "__item-thumbnail"),
|
1705
|
-
"alt": ""
|
1736
|
+
"alt": "",
|
1737
|
+
"src": file.url
|
1706
1738
|
}, null) : FileIcon(file)]), (0,external_vue_namespaceObject.createVNode)("div", {
|
1707
1739
|
"class": "".concat(classBlock, "__item-summary")
|
1708
1740
|
}, [(0,external_vue_namespaceObject.createVNode)("div", {
|
@@ -1715,8 +1747,8 @@ function _isSlot(s) {
|
|
1715
1747
|
"class": "".concat(classBlock, "__item-message-success-icon")
|
1716
1748
|
}, null), file.statusText || t.value.uploadSuccess]), file.status === 'fail' && (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [file.statusText || t.value.uploadFailed])]), file.status === 'uploading' && (0,external_vue_namespaceObject.createVNode)(progress_namespaceObject["default"], {
|
1717
1749
|
"class": "".concat(classBlock, "__item-progress"),
|
1718
|
-
"showText": false,
|
1719
1750
|
"percent": file.percentage,
|
1751
|
+
"showText": false,
|
1720
1752
|
"size": "small"
|
1721
1753
|
}, null), file.status !== 'fail' && (0,external_vue_namespaceObject.createVNode)("div", {
|
1722
1754
|
"class": "".concat(classBlock, "__item-speed")
|
@@ -1739,10 +1771,10 @@ function _isSlot(s) {
|
|
1739
1771
|
}, null)])])];
|
1740
1772
|
};
|
1741
1773
|
return function () {
|
1742
|
-
var _props$files;
|
1743
|
-
return (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [isSinglePhoto.value ?
|
1774
|
+
var _slots$innerTrigger, _props$files, _slots$innerTrigger2;
|
1775
|
+
return (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [isSinglePhoto.value ? slots === null || slots === void 0 || (_slots$innerTrigger = slots.innerTrigger) === null || _slots$innerTrigger === void 0 ? void 0 : _slots$innerTrigger.call(slots, (_props$files = props.files) === null || _props$files === void 0 ? void 0 : _props$files[0]) : (0,external_vue_namespaceObject.createVNode)("ul", {
|
1744
1776
|
"class": classNames.value
|
1745
|
-
}, [isPhotowall.value ? Photowall() : Normal(),
|
1777
|
+
}, [isPhotowall.value ? Photowall() : Normal(), slots === null || slots === void 0 || (_slots$innerTrigger2 = slots.innerTrigger) === null || _slots$innerTrigger2 === void 0 ? void 0 : _slots$innerTrigger2.call(slots)])]);
|
1746
1778
|
};
|
1747
1779
|
}
|
1748
1780
|
}));
|
@@ -1802,9 +1834,10 @@ const button_less_namespaceObject = button_less_x({ });
|
|
1802
1834
|
file: {
|
1803
1835
|
type: Object
|
1804
1836
|
},
|
1805
|
-
selectChange: props.selectChange
|
1837
|
+
selectChange: props.selectChange,
|
1838
|
+
isShowPreview: props.isShowPreview
|
1806
1839
|
},
|
1807
|
-
emits: ['change', 'remove'],
|
1840
|
+
emits: ['change', 'remove', 'preview'],
|
1808
1841
|
setup: function setup(props, _ref) {
|
1809
1842
|
var slots = _ref.slots,
|
1810
1843
|
emit = _ref.emit;
|
@@ -1816,7 +1849,8 @@ const button_less_namespaceObject = button_less_x({ });
|
|
1816
1849
|
disabled = _toRefs.disabled,
|
1817
1850
|
file = _toRefs.file,
|
1818
1851
|
multiple = _toRefs.multiple,
|
1819
|
-
accept = _toRefs.accept
|
1852
|
+
accept = _toRefs.accept,
|
1853
|
+
isShowPreview = _toRefs.isShowPreview;
|
1820
1854
|
var classBlock = "".concat(resolveClassName(CLASS_PREFIX), "-trigger");
|
1821
1855
|
var isButton = (0,external_vue_namespaceObject.computed)(function () {
|
1822
1856
|
return theme.value === EThemes.BUTTON;
|
@@ -1870,6 +1904,11 @@ const button_less_namespaceObject = button_less_x({ });
|
|
1870
1904
|
e.stopPropagation();
|
1871
1905
|
e.preventDefault();
|
1872
1906
|
}
|
1907
|
+
function handlePreview(file, e) {
|
1908
|
+
emit('preview', file, [file], e);
|
1909
|
+
e.stopPropagation();
|
1910
|
+
e.preventDefault();
|
1911
|
+
}
|
1873
1912
|
var dragover = (0,external_vue_namespaceObject.ref)(false);
|
1874
1913
|
var Dragger = function Dragger() {
|
1875
1914
|
var handleDrop = function handleDrop(e) {
|
@@ -1895,9 +1934,9 @@ const button_less_namespaceObject = button_less_x({ });
|
|
1895
1934
|
var classNames = (0,shared_namespaceObject.classes)(_defineProperty({}, "".concat(classBlock, "__draggable"), true));
|
1896
1935
|
return (0,external_vue_namespaceObject.createVNode)("div", {
|
1897
1936
|
"class": classNames,
|
1898
|
-
"
|
1937
|
+
"onDragleave": handleDragleave,
|
1899
1938
|
"onDragover": handleDragover,
|
1900
|
-
"
|
1939
|
+
"onDrop": handleDrop
|
1901
1940
|
}, [slots["default"] ? slots["default"]() : (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [(0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.Upload, {
|
1902
1941
|
"class": "".concat(classBlock, "__draggable-icon")
|
1903
1942
|
}, null), (0,external_vue_namespaceObject.createVNode)("div", {
|
@@ -1920,22 +1959,27 @@ const button_less_namespaceObject = button_less_x({ });
|
|
1920
1959
|
};
|
1921
1960
|
var SinglePicture = function SinglePicture(file) {
|
1922
1961
|
return [(0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("img", {
|
1923
|
-
"src": file.url,
|
1924
1962
|
"class": "".concat(classBlock, "__picture-thumbnail"),
|
1925
|
-
"alt": ""
|
1963
|
+
"alt": "",
|
1964
|
+
"src": file.url
|
1926
1965
|
}, null), [[external_vue_namespaceObject.vShow, file.status !== 'uploading']]), (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [file.status === 'uploading' && (0,external_vue_namespaceObject.createVNode)(progress_namespaceObject["default"], {
|
1966
|
+
"width": 50,
|
1927
1967
|
"class": "".concat(classBlock, "__picture-progress"),
|
1928
|
-
"type": "circle",
|
1929
|
-
"color": "#3a84ff",
|
1930
1968
|
"bgColor": "#333",
|
1931
|
-
"
|
1969
|
+
"color": "#3a84ff",
|
1970
|
+
"percent": file.percentage,
|
1932
1971
|
"titleStyle": {
|
1933
1972
|
color: '#fff'
|
1934
1973
|
},
|
1935
|
-
"
|
1974
|
+
"type": "circle"
|
1936
1975
|
}, null)]), (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [!props.disabled && (0,external_vue_namespaceObject.createVNode)("div", {
|
1937
1976
|
"class": "".concat(classBlock, "__picture-actions")
|
1938
|
-
}, [(0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.
|
1977
|
+
}, [isShowPreview.value && (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.Eye, {
|
1978
|
+
"class": "action-icon",
|
1979
|
+
"onClick": function onClick(e) {
|
1980
|
+
return handlePreview(file, e);
|
1981
|
+
}
|
1982
|
+
}, null), (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.Del, {
|
1939
1983
|
"class": "action-icon",
|
1940
1984
|
"onClick": function onClick(e) {
|
1941
1985
|
return handleRemove(file, e);
|
@@ -1970,12 +2014,12 @@ const button_less_namespaceObject = button_less_x({ });
|
|
1970
2014
|
}, [slots.trigger ? [slots.trigger(), slots === null || slots === void 0 || (_slots$default = slots["default"]) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots)] : Trigger(), (0,external_vue_namespaceObject.createVNode)("input", {
|
1971
2015
|
"ref": inputEl,
|
1972
2016
|
"class": "".concat(classBlock, "__input-file"),
|
1973
|
-
"tabindex": "-1",
|
1974
|
-
"onChange": handleFileChange,
|
1975
2017
|
"accept": acceptTypes.value,
|
1976
|
-
"multiple": multiple.value,
|
1977
2018
|
"disabled": disabled.value,
|
1978
|
-
"
|
2019
|
+
"multiple": multiple.value,
|
2020
|
+
"tabindex": "-1",
|
2021
|
+
"type": "file",
|
2022
|
+
"onChange": handleFileChange
|
1979
2023
|
}, null)]);
|
1980
2024
|
};
|
1981
2025
|
}
|
@@ -2036,10 +2080,11 @@ var spark_md5_default = /*#__PURE__*/__webpack_require__.n(spark_md5);
|
|
2036
2080
|
*/
|
2037
2081
|
|
2038
2082
|
|
2083
|
+
var errMsg = 'An error occurred during upload';
|
2039
2084
|
function getRes(xhr) {
|
2040
2085
|
var res = xhr.responseText || xhr.response;
|
2041
2086
|
if (!res) {
|
2042
|
-
return res;
|
2087
|
+
return res || {};
|
2043
2088
|
}
|
2044
2089
|
try {
|
2045
2090
|
return JSON.parse(res);
|
@@ -2052,7 +2097,9 @@ var ajaxUpload = function ajaxUpload(option) {
|
|
2052
2097
|
throw new Error('XMLHttpRequest is undefined');
|
2053
2098
|
}
|
2054
2099
|
var xhr = new XMLHttpRequest();
|
2055
|
-
var action = option.action
|
2100
|
+
var action = option.action,
|
2101
|
+
type = option.type;
|
2102
|
+
var isFormdata = type === 'formdata';
|
2056
2103
|
if (xhr.upload) {
|
2057
2104
|
xhr.upload.addEventListener('progress', function (event) {
|
2058
2105
|
var progressEvent = event;
|
@@ -2061,7 +2108,7 @@ var ajaxUpload = function ajaxUpload(option) {
|
|
2061
2108
|
});
|
2062
2109
|
}
|
2063
2110
|
var formData = new FormData();
|
2064
|
-
if (option.data) {
|
2111
|
+
if (isFormdata && option.data) {
|
2065
2112
|
var appendData = option.data;
|
2066
2113
|
if (!Array.isArray(appendData)) {
|
2067
2114
|
appendData = [appendData];
|
@@ -2075,7 +2122,7 @@ var ajaxUpload = function ajaxUpload(option) {
|
|
2075
2122
|
}
|
2076
2123
|
});
|
2077
2124
|
}
|
2078
|
-
if (option.formDataAttributes) {
|
2125
|
+
if (isFormdata && option.formDataAttributes) {
|
2079
2126
|
var _appendData = option.formDataAttributes;
|
2080
2127
|
if (!Array.isArray(_appendData)) {
|
2081
2128
|
_appendData = [_appendData];
|
@@ -2084,13 +2131,27 @@ var ajaxUpload = function ajaxUpload(option) {
|
|
2084
2131
|
if (Array.isArray(item.value)) formData.append.apply(formData, [item.name].concat(_toConsumableArray(item.value)));else formData.append(item.name, item.value);
|
2085
2132
|
});
|
2086
2133
|
}
|
2087
|
-
|
2134
|
+
if (isFormdata) {
|
2135
|
+
formData.append(option.filename, option.file, option.file.name);
|
2136
|
+
}
|
2088
2137
|
xhr.addEventListener('error', function () {
|
2089
|
-
|
2138
|
+
var msg = new Error(errMsg);
|
2139
|
+
var responseText = getRes(xhr);
|
2140
|
+
if (responseText) {
|
2141
|
+
msg = new Error(responseText.message || errMsg);
|
2142
|
+
}
|
2143
|
+
console.log(responseText, msg);
|
2144
|
+
option.onError(msg);
|
2145
|
+
// option.onError(new Error('An error occurred during upload'));
|
2090
2146
|
});
|
2091
2147
|
xhr.addEventListener('load', function () {
|
2092
2148
|
if (xhr.status < 200 || xhr.status >= 300) {
|
2093
|
-
|
2149
|
+
var responseText = getRes(xhr);
|
2150
|
+
var msg = new Error(errMsg);
|
2151
|
+
if (responseText) {
|
2152
|
+
msg = new Error(responseText.message || errMsg);
|
2153
|
+
}
|
2154
|
+
return option.onError(msg);
|
2094
2155
|
}
|
2095
2156
|
option.onSuccess(getRes(xhr));
|
2096
2157
|
});
|
@@ -2128,7 +2189,7 @@ var ajaxUpload = function ajaxUpload(option) {
|
|
2128
2189
|
xhr.setRequestHeader(key, String(value));
|
2129
2190
|
}
|
2130
2191
|
}
|
2131
|
-
xhr.send(formData);
|
2192
|
+
xhr.send(isFormdata ? formData : option.file);
|
2132
2193
|
return xhr;
|
2133
2194
|
};
|
2134
2195
|
// 该方法用于在不同的浏览器使用不同的方式
|
@@ -2168,10 +2229,15 @@ var ajaxSliceUpload = /*#__PURE__*/function () {
|
|
2168
2229
|
req.open(option.method, option.mergeUrl, true);
|
2169
2230
|
req.onreadystatechange = function () {
|
2170
2231
|
if (req.readyState === 4) {
|
2232
|
+
var responseText = getRes(req);
|
2171
2233
|
if (req.status < 200 || req.status >= 300) {
|
2172
|
-
|
2234
|
+
var msg = new Error(errMsg);
|
2235
|
+
if (responseText) {
|
2236
|
+
msg = new Error(responseText.message || errMsg);
|
2237
|
+
}
|
2238
|
+
return option.onError(msg);
|
2173
2239
|
}
|
2174
|
-
option.onSuccess(
|
2240
|
+
option.onSuccess(responseText);
|
2175
2241
|
}
|
2176
2242
|
};
|
2177
2243
|
req.onloadend = function () {
|
@@ -2193,7 +2259,6 @@ var ajaxSliceUpload = /*#__PURE__*/function () {
|
|
2193
2259
|
// 请求分片上传,保存在progressList中
|
2194
2260
|
var sliceSend = function sliceSend(option, file, blockCount, hash, progressList, chunkSize) {
|
2195
2261
|
var _loop = function _loop(i) {
|
2196
|
-
// eslint-disable-next-line no-loop-func
|
2197
2262
|
var pooltask = new Promise(function (resolve, reject) {
|
2198
2263
|
var start = i * chunkSize;
|
2199
2264
|
var end = Math.min(file.size, start + chunkSize);
|
@@ -2231,10 +2296,14 @@ var sliceSend = function sliceSend(option, file, blockCount, hash, progressList,
|
|
2231
2296
|
var xhr = new XMLHttpRequest();
|
2232
2297
|
xhr.onreadystatechange = function () {
|
2233
2298
|
if (xhr.readyState === 4) {
|
2234
|
-
var
|
2299
|
+
var responseText = getRes(xhr);
|
2235
2300
|
if (xhr.status < 200 || xhr.status >= 300) {
|
2236
|
-
reject(
|
2237
|
-
|
2301
|
+
reject(responseText);
|
2302
|
+
var msg = new Error(errMsg);
|
2303
|
+
if (responseText) {
|
2304
|
+
msg = new Error(responseText.message || errMsg);
|
2305
|
+
}
|
2306
|
+
option.onError(msg);
|
2238
2307
|
} else {
|
2239
2308
|
resolve('reponseText');
|
2240
2309
|
}
|
@@ -2312,7 +2381,7 @@ var hashFile = function hashFile(file, chunkSize) {
|
|
2312
2381
|
}
|
2313
2382
|
};
|
2314
2383
|
fileReader.onerror = function () {
|
2315
|
-
reject(new Error('File
|
2384
|
+
reject(new Error('File slice failed'));
|
2316
2385
|
};
|
2317
2386
|
loadNext();
|
2318
2387
|
})["catch"](function (err) {
|
@@ -2609,7 +2678,7 @@ function upload_arrayLikeToArray(arr, len) { if (len == null || len > arr.length
|
|
2609
2678
|
/* harmony default export */ const upload = ((0,external_vue_namespaceObject.defineComponent)({
|
2610
2679
|
name: 'Upload',
|
2611
2680
|
props: props,
|
2612
|
-
emits: ['exceed', 'progress', 'success', 'error', 'delete', 'done'],
|
2681
|
+
emits: ['exceed', 'progress', 'success', 'error', 'delete', 'done', 'preview'],
|
2613
2682
|
setup: function setup(props, _ref) {
|
2614
2683
|
var slots = _ref.slots,
|
2615
2684
|
emit = _ref.emit,
|
@@ -2633,6 +2702,7 @@ function upload_arrayLikeToArray(arr, len) { if (len == null || len > arr.length
|
|
2633
2702
|
multiple: props.multiple,
|
2634
2703
|
disabled: props.disabled,
|
2635
2704
|
accept: props.accept,
|
2705
|
+
isShowPreview: props.isShowPreview,
|
2636
2706
|
selectChange: props.selectChange
|
2637
2707
|
};
|
2638
2708
|
});
|
@@ -2687,6 +2757,9 @@ function upload_arrayLikeToArray(arr, len) { if (len == null || len > arr.length
|
|
2687
2757
|
_iterator.f();
|
2688
2758
|
}
|
2689
2759
|
}
|
2760
|
+
function handlePreview(file, files) {
|
2761
|
+
emit('preview', file, files);
|
2762
|
+
}
|
2690
2763
|
function handleRetry(file) {
|
2691
2764
|
send(file.raw);
|
2692
2765
|
}
|
@@ -2707,7 +2780,7 @@ function upload_arrayLikeToArray(arr, len) { if (len == null || len > arr.length
|
|
2707
2780
|
case 2:
|
2708
2781
|
_context.prev = 2;
|
2709
2782
|
_context.next = 5;
|
2710
|
-
return (_props$beforeUpload = props.beforeUpload) === null || _props$beforeUpload === void 0 ? void 0 : _props$beforeUpload.call(props, file);
|
2783
|
+
return (_props$beforeUpload = props.beforeUpload) === null || _props$beforeUpload === void 0 ? void 0 : _props$beforeUpload.call(props, file, sendFiles);
|
2711
2784
|
case 5:
|
2712
2785
|
beforeResult = _context.sent;
|
2713
2786
|
_context.next = 11;
|
@@ -2734,7 +2807,8 @@ function upload_arrayLikeToArray(arr, len) { if (len == null || len > arr.length
|
|
2734
2807
|
return _upload.apply(this, arguments);
|
2735
2808
|
}
|
2736
2809
|
function send(file, sendFiles) {
|
2737
|
-
var
|
2810
|
+
var type = props.type,
|
2811
|
+
headers = props.headers,
|
2738
2812
|
header = props.header,
|
2739
2813
|
data = props.data,
|
2740
2814
|
formDataAttributes = props.formDataAttributes,
|
@@ -2748,6 +2822,7 @@ function upload_arrayLikeToArray(arr, len) { if (len == null || len > arr.length
|
|
2748
2822
|
customRequest = props.customRequest;
|
2749
2823
|
var uid = file.uid;
|
2750
2824
|
var options = {
|
2825
|
+
type: type,
|
2751
2826
|
headers: headers,
|
2752
2827
|
header: header,
|
2753
2828
|
withCredentials: withCredentials,
|
@@ -2818,6 +2893,7 @@ function upload_arrayLikeToArray(arr, len) { if (len == null || len > arr.length
|
|
2818
2893
|
});
|
2819
2894
|
});
|
2820
2895
|
expose({
|
2896
|
+
handlePreview: handlePreview,
|
2821
2897
|
handleRemove: handleRemove,
|
2822
2898
|
handleRetry: handleRetry
|
2823
2899
|
});
|
@@ -2829,10 +2905,12 @@ function upload_arrayLikeToArray(arr, len) { if (len == null || len > arr.length
|
|
2829
2905
|
}), slots), slots.tip ? slots.tip() : props.tip && (0,external_vue_namespaceObject.createVNode)("div", {
|
2830
2906
|
"class": "".concat(resolveClassName(CLASS_PREFIX), "__tip")
|
2831
2907
|
}, [props.tip]), (0,external_vue_namespaceObject.createVNode)(upload_list, {
|
2832
|
-
"files": fileList.value,
|
2833
|
-
"theme": props.theme,
|
2834
2908
|
"disabled": props.disabled,
|
2909
|
+
"files": fileList.value,
|
2910
|
+
"isShowPreview": props.isShowPreview,
|
2835
2911
|
"multiple": props.multiple,
|
2912
|
+
"theme": props.theme,
|
2913
|
+
"onPreview": handlePreview,
|
2836
2914
|
"onRemove": handleRemove,
|
2837
2915
|
"onRetry": handleRetry
|
2838
2916
|
}, {
|
@@ -2840,6 +2918,7 @@ function upload_arrayLikeToArray(arr, len) { if (len == null || len > arr.length
|
|
2840
2918
|
return isPhotowall.value && (0,external_vue_namespaceObject.createVNode)(upload_trigger, (0,external_vue_namespaceObject.mergeProps)(triggerProps.value, {
|
2841
2919
|
"file": file,
|
2842
2920
|
"onChange": handleFiles,
|
2921
|
+
"onPreview": handlePreview,
|
2843
2922
|
"onRemove": handleRemove
|
2844
2923
|
}), slots);
|
2845
2924
|
},
|
package/lib/upload/props.d.ts
CHANGED
@@ -1,6 +1,11 @@
|
|
1
|
+
import { APIResponse, EThemes, ETypes, ExtraFormData, FormDataAttr, HeaderDataAttr, MaxSize, UploadFile, UploadRawFile, UploadRequestHandler } from './upload.type';
|
1
2
|
import type { PropType } from 'vue';
|
2
|
-
import { APIResponse, EThemes, ExtraFormData, FormDataAttr, HeaderDataAttr, MaxSize, UploadFile, UploadRawFile, UploadRequestHandler } from './upload.type';
|
3
3
|
declare const _default: {
|
4
|
+
type: {
|
5
|
+
type: PropType<"formdata" | "binary">;
|
6
|
+
default: "formdata" | "binary";
|
7
|
+
validator: (val: ETypes) => boolean;
|
8
|
+
};
|
4
9
|
theme: {
|
5
10
|
type: PropType<"button" | "picture" | "draggable">;
|
6
11
|
default: "button" | "picture" | "draggable";
|
@@ -89,7 +94,7 @@ declare const _default: {
|
|
89
94
|
type: PropType<(event: Event) => boolean | void>;
|
90
95
|
};
|
91
96
|
beforeUpload: {
|
92
|
-
type: PropType<(file: UploadRawFile) => Promise<boolean> | boolean>;
|
97
|
+
type: PropType<(file: UploadRawFile, uploadFiles: File[]) => Promise<boolean> | boolean>;
|
93
98
|
};
|
94
99
|
beforeRemove: {
|
95
100
|
type: PropType<(file: UploadFile, uploadFiles: UploadFile[]) => Promise<boolean> | boolean>;
|
@@ -110,5 +115,9 @@ declare const _default: {
|
|
110
115
|
type: NumberConstructor;
|
111
116
|
default: number;
|
112
117
|
};
|
118
|
+
isShowPreview: {
|
119
|
+
type: BooleanConstructor;
|
120
|
+
default: boolean;
|
121
|
+
};
|
113
122
|
};
|
114
123
|
export default _default;
|
@@ -17,7 +17,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
17
17
|
type: BooleanConstructor;
|
18
18
|
default: boolean;
|
19
19
|
};
|
20
|
-
|
20
|
+
isShowPreview: {
|
21
|
+
type: BooleanConstructor;
|
22
|
+
default: boolean;
|
23
|
+
};
|
24
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("remove" | "preview" | "retry")[], "remove" | "preview" | "retry", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
21
25
|
theme: {
|
22
26
|
type: import("vue").PropType<"button" | "picture" | "draggable">;
|
23
27
|
default: "button" | "picture" | "draggable";
|
@@ -35,13 +39,19 @@ declare const _default: import("vue").DefineComponent<{
|
|
35
39
|
type: BooleanConstructor;
|
36
40
|
default: boolean;
|
37
41
|
};
|
42
|
+
isShowPreview: {
|
43
|
+
type: BooleanConstructor;
|
44
|
+
default: boolean;
|
45
|
+
};
|
38
46
|
}>> & {
|
39
47
|
onRemove?: (...args: any[]) => any;
|
48
|
+
onPreview?: (...args: any[]) => any;
|
40
49
|
onRetry?: (...args: any[]) => any;
|
41
50
|
}, {
|
42
51
|
disabled: boolean;
|
43
52
|
theme: "button" | "picture" | "draggable";
|
44
53
|
multiple: boolean;
|
45
54
|
files: UploadFile[];
|
55
|
+
isShowPreview: boolean;
|
46
56
|
}, {}>;
|
47
57
|
export default _default;
|
@@ -23,7 +23,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
23
23
|
selectChange: {
|
24
24
|
type: PropType<(event: Event) => boolean | void>;
|
25
25
|
};
|
26
|
-
|
26
|
+
isShowPreview: {
|
27
|
+
type: BooleanConstructor;
|
28
|
+
default: boolean;
|
29
|
+
};
|
30
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "remove" | "preview")[], "change" | "remove" | "preview", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
27
31
|
theme: {
|
28
32
|
type: PropType<"button" | "picture" | "draggable">;
|
29
33
|
default: "button" | "picture" | "draggable";
|
@@ -46,12 +50,18 @@ declare const _default: import("vue").DefineComponent<{
|
|
46
50
|
selectChange: {
|
47
51
|
type: PropType<(event: Event) => boolean | void>;
|
48
52
|
};
|
53
|
+
isShowPreview: {
|
54
|
+
type: BooleanConstructor;
|
55
|
+
default: boolean;
|
56
|
+
};
|
49
57
|
}>> & {
|
50
58
|
onChange?: (...args: any[]) => any;
|
51
59
|
onRemove?: (...args: any[]) => any;
|
60
|
+
onPreview?: (...args: any[]) => any;
|
52
61
|
}, {
|
53
62
|
disabled: boolean;
|
54
63
|
theme: "button" | "picture" | "draggable";
|
55
64
|
multiple: boolean;
|
65
|
+
isShowPreview: boolean;
|
56
66
|
}, {}>;
|
57
67
|
export default _default;
|