@nutui/nutui 3.2.6-beta.1 → 3.2.6-beta.2
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 +18 -4
- package/dist/nutui.es.js +4461 -4135
- package/dist/nutui.umd.js +4559 -4133
- package/dist/packages/_es/ActionSheet.js +19 -18
- package/dist/packages/_es/Address.js +85 -94
- package/dist/packages/_es/AddressList.js +12 -25
- package/dist/packages/_es/Animate.js +3 -3
- package/dist/packages/_es/Audio.js +2 -9
- package/dist/packages/_es/AudioOperate.js +1 -5
- package/dist/packages/_es/Avatar.js +10 -10
- package/dist/packages/_es/AvatarGroup.js +5 -5
- package/dist/packages/_es/BackTop.js +108 -55
- package/dist/packages/_es/Badge.js +12 -10
- package/dist/packages/_es/Barrage.js +103 -79
- package/dist/packages/_es/Button.js +3 -5
- package/dist/packages/_es/Calendar.js +23 -36
- package/dist/packages/_es/CalendarItem.js +3 -4
- package/dist/packages/_es/Card.js +5 -15
- package/dist/packages/_es/Cascader.js +11 -12
- package/dist/packages/_es/Category.js +12 -13
- package/dist/packages/_es/CategoryPane.js +13 -17
- package/dist/packages/_es/Cell.js +12 -9
- package/dist/packages/_es/CellGroup.js +2 -4
- package/dist/packages/_es/Checkbox.js +1 -1
- package/dist/packages/_es/CheckboxGroup.js +2 -2
- package/dist/packages/_es/CircleProgress.js +82 -98
- package/dist/packages/_es/Col.js +1 -1
- package/dist/packages/_es/Collapse.js +34 -65
- package/dist/packages/_es/CollapseItem.js +60 -93
- package/dist/packages/_es/Comment.js +19 -43
- package/dist/packages/_es/ConfigProvider.js +1 -1
- package/dist/packages/_es/CountDown.js +3 -3
- package/dist/packages/_es/CountUp.js +52 -47
- package/dist/packages/_es/DatePicker.js +54 -37
- package/dist/packages/_es/Dialog.js +88 -9
- package/dist/packages/_es/Divider.js +3 -3
- package/dist/packages/_es/Drag.js +49 -75
- package/dist/packages/_es/Ecard.js +18 -20
- package/dist/packages/_es/Elevator.js +76 -101
- package/dist/packages/_es/Ellipsis.js +100 -140
- package/dist/packages/_es/Empty.js +4 -6
- package/dist/packages/_es/FixedNav.js +6 -11
- package/dist/packages/_es/Form.js +4 -4
- package/dist/packages/_es/FormItem.js +1 -3
- package/dist/packages/_es/Grid.js +1 -1
- package/dist/packages/_es/GridItem.js +27 -10
- package/dist/packages/_es/Icon.js +1 -1
- package/dist/packages/_es/Image.js +114 -13
- package/dist/packages/_es/ImagePreview.js +411 -149
- package/dist/packages/_es/Indicator.js +3 -3
- package/dist/packages/_es/InfiniteLoading.js +115 -103
- package/dist/packages/_es/Input.js +32 -56
- package/dist/packages/_es/InputNumber.js +16 -25
- package/dist/packages/_es/Invoice.js +5 -6
- package/dist/packages/_es/Layout.js +1 -1
- package/dist/packages/_es/List.js +34 -47
- package/dist/packages/_es/Menu.js +35 -35
- package/dist/packages/_es/MenuItem.js +29 -56
- package/dist/packages/_es/Navbar.js +39 -49
- package/dist/packages/_es/NoticeBar.js +45 -54
- package/dist/packages/_es/Notify.js +162 -44
- package/dist/packages/_es/NumberKeyboard.js +20 -15
- package/dist/packages/_es/OldPicker.js +116 -130
- package/dist/packages/_es/OverLay.js +28 -5
- package/dist/packages/_es/Pagination.js +5 -8
- package/dist/packages/_es/Picker.js +74 -198
- package/dist/packages/_es/Popover.js +881 -201
- package/dist/packages/_es/Popup.js +84 -28
- package/dist/packages/_es/Price.js +6 -22
- package/dist/packages/_es/Progress.js +11 -18
- package/dist/packages/_es/PullRefresh.js +2 -4
- package/dist/packages/_es/Radio.js +3 -3
- package/dist/packages/_es/RadioGroup.js +1 -1
- package/dist/packages/_es/Range.js +34 -48
- package/dist/packages/_es/Rate.js +14 -15
- package/dist/packages/_es/Row.js +1 -1
- package/dist/packages/_es/SearchBar.js +36 -39
- package/dist/packages/_es/ShortPassword.js +66 -97
- package/dist/packages/_es/SideNavBar.js +18 -7
- package/dist/packages/_es/SideNavBarItem.js +1 -1
- package/dist/packages/_es/Signature.js +80 -113
- package/dist/packages/_es/Skeleton.js +11 -12
- package/dist/packages/_es/Sku.js +38 -63
- package/dist/packages/_es/Step.js +2 -7
- package/dist/packages/_es/Steps.js +1 -1
- package/dist/packages/_es/Sticky.js +23 -33
- package/dist/packages/_es/SubSideNavBar.js +2 -4
- package/dist/packages/_es/Swipe.js +26 -41
- package/dist/packages/_es/Swiper.js +21 -38
- package/dist/packages/_es/SwiperItem.js +2 -2
- package/dist/packages/_es/Switch.js +8 -8
- package/dist/packages/_es/TabPane.js +1 -1
- package/dist/packages/_es/Tabbar.js +13 -15
- package/dist/packages/_es/TabbarItem.js +30 -24
- package/dist/packages/_es/Table.js +17 -22
- package/dist/packages/_es/Tabs.js +16 -49
- package/dist/packages/_es/Tag.js +5 -6
- package/dist/packages/_es/TextArea.js +49 -114
- package/dist/packages/_es/TimeDetail.js +3 -4
- package/dist/packages/_es/TimePannel.js +3 -3
- package/dist/packages/_es/TimeSelect.js +10 -12
- package/dist/packages/_es/Toast.js +164 -53
- package/dist/packages/_es/TrendArrow.js +4 -6
- package/dist/packages/_es/Uploader.js +140 -141
- package/dist/packages/_es/Video.js +18 -39
- package/dist/packages/_es/WaterMark.js +14 -22
- package/dist/packages/_es/common.js +1 -1
- package/dist/packages/_es/component.js +1 -1
- package/dist/packages/_es/index.js +6 -44
- package/dist/packages/_es/index2.js +31 -8
- package/dist/packages/_es/index3.js +7 -64
- package/dist/packages/_es/index4.js +62 -424
- package/dist/packages/_es/{index.taro.js → index5.js} +154 -167
- package/dist/packages/_es/plugin-vue_export-helper.js +1 -1
- package/dist/packages/_es/pxCheck.js +1 -1
- package/dist/packages/_es/raf.js +1 -1
- package/dist/packages/_es/style.css +3 -21
- package/dist/packages/checkbox/index.scss +1 -0
- package/dist/packages/locale/lang/baseLang.js +1 -1
- package/dist/packages/locale/lang/en-US.js +1 -1
- package/dist/packages/locale/lang/id-ID.js +1 -1
- package/dist/packages/locale/lang/index.js +1 -1
- package/dist/packages/locale/lang/zh-CN.js +1 -1
- package/dist/packages/locale/lang/zh-TW.js +1 -1
- package/dist/packages/menuitem/index.scss +12 -3
- package/dist/smartips/attributes.json +5 -1
- package/dist/smartips/tags.json +1 -0
- package/dist/smartips/web-types.json +11 -2
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +48 -48
- package/dist/styles/themes/jdb.scss +48 -48
- package/dist/styles/themes/jddkh.scss +48 -48
- package/dist/styles/themes/jdt.scss +48 -48
- package/dist/types/__VUE/actionsheet/{index.taro.vue.d.ts → index.vue.d.ts} +9 -9
- package/dist/types/__VUE/address/{index.taro.vue.d.ts → index.vue.d.ts} +33 -73
- package/dist/types/__VUE/addresslist/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/animate/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/avatar/{index.taro.vue.d.ts → index.vue.d.ts} +6 -6
- package/dist/types/__VUE/avatargroup/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/backtop/{index.taro.vue.d.ts → index.vue.d.ts} +37 -15
- package/dist/types/__VUE/badge/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/barrage/{index.taro.vue.d.ts → index.vue.d.ts} +2 -2
- package/dist/types/__VUE/button/index.vue.d.ts +1 -1
- package/dist/types/__VUE/calendar/{index.taro.vue.d.ts → index.vue.d.ts} +1 -13
- package/dist/types/__VUE/calendaritem/{index.taro.vue.d.ts → index.vue.d.ts} +17 -17
- package/dist/types/__VUE/card/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/cascader/{index.taro.vue.d.ts → index.vue.d.ts} +1 -1
- package/dist/types/__VUE/category/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/categorypane/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/cell/{index.taro.vue.d.ts → index.vue.d.ts} +5 -12
- package/dist/types/__VUE/checkbox/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/circleprogress/{index.taro.vue.d.ts → index.vue.d.ts} +15 -14
- package/dist/types/__VUE/collapse/{index.taro.vue.d.ts → index.vue.d.ts} +1 -1
- package/dist/types/__VUE/collapseitem/{index.taro.vue.d.ts → index.vue.d.ts} +10 -2
- package/dist/types/__VUE/comment/{index.taro.vue.d.ts → index.vue.d.ts} +2 -1
- package/dist/types/__VUE/configprovider/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/countdown/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/countup/{index.taro.vue.d.ts → index.vue.d.ts} +7 -5
- package/dist/types/__VUE/datepicker/{index.taro.vue.d.ts → index.vue.d.ts} +5 -5
- package/dist/types/__VUE/dialog/index.d.ts +48 -0
- package/dist/types/__VUE/dialog/{index.taro.vue.d.ts → index.vue.d.ts} +12 -9
- package/dist/types/__VUE/divider/{index.taro.vue.d.ts → index.vue.d.ts} +1 -1
- package/dist/types/__VUE/drag/{index.taro.vue.d.ts → index.vue.d.ts} +1 -2
- package/dist/types/__VUE/ecard/{index.taro.vue.d.ts → index.vue.d.ts} +3 -3
- package/dist/types/__VUE/elevator/{index.taro.vue.d.ts → index.vue.d.ts} +2 -11
- package/dist/types/__VUE/ellipsis/{index.taro.vue.d.ts → index.vue.d.ts} +0 -4
- package/dist/types/__VUE/empty/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/fixednav/{index.taro.vue.d.ts → index.vue.d.ts} +1 -1
- package/dist/types/__VUE/form/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/grid/{index.taro.vue.d.ts → index.vue.d.ts} +2 -2
- package/dist/types/__VUE/griditem/{index.taro.vue.d.ts → index.vue.d.ts} +27 -2
- package/dist/types/__VUE/image/index.vue.d.ts +117 -0
- package/dist/types/__VUE/image/type.d.ts +6 -0
- package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +109 -0
- package/dist/types/__VUE/imagepreview/index.d.ts +25 -0
- package/dist/types/__VUE/imagepreview/{index.taro.vue.d.ts → index.vue.d.ts} +44 -33
- package/dist/types/__VUE/indicator/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/infiniteloading/{index.taro.vue.d.ts → index.vue.d.ts} +12 -19
- package/dist/types/__VUE/input/{index.taro.vue.d.ts → index.vue.d.ts} +16 -34
- package/dist/types/__VUE/inputnumber/{index.taro.vue.d.ts → index.vue.d.ts} +2 -2
- package/dist/types/__VUE/invoice/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/layout/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/list/{index.taro.vue.d.ts → index.vue.d.ts} +2 -2
- package/dist/types/__VUE/menu/{index.taro.vue.d.ts → index.vue.d.ts} +0 -1
- package/dist/types/__VUE/menuitem/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/navbar/{index.taro.vue.d.ts → index.vue.d.ts} +3 -2
- package/dist/types/__VUE/noticebar/{index.taro.vue.d.ts → index.vue.d.ts} +4 -4
- package/dist/types/__VUE/notify/index.d.ts +26 -0
- package/dist/types/__VUE/notify/{index.taro.vue.d.ts → index.vue.d.ts} +18 -5
- package/dist/types/__VUE/numberkeyboard/{index.taro.vue.d.ts → index.vue.d.ts} +29 -5
- package/dist/types/__VUE/oldpicker/{ColumnTaro.vue.d.ts → Column.vue.d.ts} +17 -28
- package/dist/types/__VUE/oldpicker/{index.taro.vue.d.ts → index.vue.d.ts} +44 -64
- package/dist/types/__VUE/pagination/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/picker/{ColumnTaro.vue.d.ts → Column.vue.d.ts} +4 -16
- package/dist/types/__VUE/picker/{index.taro.vue.d.ts → index.vue.d.ts} +28 -53
- package/dist/types/__VUE/popover/{index.taro.vue.d.ts → index.vue.d.ts} +13 -15
- package/dist/types/__VUE/popup/index.vue.d.ts +1 -1
- package/dist/types/__VUE/price/{index.taro.vue.d.ts → index.vue.d.ts} +0 -1
- package/dist/types/__VUE/progress/{index.taro.vue.d.ts → index.vue.d.ts} +1 -1
- package/dist/types/__VUE/radio/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/range/{index.taro.vue.d.ts → index.vue.d.ts} +7 -8
- package/dist/types/__VUE/rate/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/searchbar/{index.taro.vue.d.ts → index.vue.d.ts} +19 -19
- package/dist/types/__VUE/shortpassword/{index.taro.vue.d.ts → index.vue.d.ts} +21 -6
- package/dist/types/__VUE/sidenavbar/{index.taro.vue.d.ts → index.vue.d.ts} +5 -0
- package/dist/types/__VUE/signature/{index.taro.vue.d.ts → index.vue.d.ts} +5 -8
- package/dist/types/__VUE/skeleton/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/sku/index.vue.d.ts +310 -0
- package/dist/types/__VUE/step/index.vue.d.ts +1 -1
- package/dist/types/__VUE/steps/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/sticky/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/swipe/{index.taro.vue.d.ts → index.vue.d.ts} +1 -2
- package/dist/types/__VUE/swiper/{index.taro.vue.d.ts → index.vue.d.ts} +1 -2
- package/dist/types/__VUE/swiperitem/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/switch/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/tabbar/{index.taro.vue.d.ts → index.vue.d.ts} +2 -1
- package/dist/types/__VUE/tabbaritem/{index.taro.vue.d.ts → index.vue.d.ts} +9 -9
- package/dist/types/__VUE/table/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/tabs/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/tag/{index.taro.vue.d.ts → index.vue.d.ts} +4 -4
- package/dist/types/__VUE/tag/type.d.ts +5 -0
- package/dist/types/__VUE/textarea/{index.taro.vue.d.ts → index.vue.d.ts} +3 -5
- package/dist/types/__VUE/timedetail/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/timepannel/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/timeselect/{index.taro.vue.d.ts → index.vue.d.ts} +8 -7
- package/dist/types/__VUE/toast/index.d.ts +16 -0
- package/dist/types/__VUE/toast/{index.taro.vue.d.ts → index.vue.d.ts} +22 -44
- package/dist/types/__VUE/trendarrow/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/uploader/{index.taro.vue.d.ts → index.vue.d.ts} +13 -22
- package/dist/types/__VUE/watermark/{index.taro.vue.d.ts → index.vue.d.ts} +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/nutui.d.ts +89 -89
- package/package.json +3 -2
- package/dist/packages/_es/use-lock-scroll.js +0 -23
- package/dist/types/__VUE/button/index.taro.vue.d.ts +0 -116
- package/dist/types/__VUE/icon/index.taro.vue.d.ts +0 -74
- package/dist/types/__VUE/image/index.taro.vue.d.ts +0 -33
- package/dist/types/__VUE/overlay/index.taro.vue.d.ts +0 -85
- package/dist/types/__VUE/popup/index.taro.vue.d.ts +0 -1728
- package/dist/types/__VUE/sku/index.taro.vue.d.ts +0 -182
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.2.6-beta.
|
|
2
|
+
* @nutui/nutui v3.2.6-beta.2 Fri Nov 04 2022 17:24:29 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { reactive, computed,
|
|
6
|
+
import { reactive, computed, resolveComponent, openBlock, createElementBlock, normalizeClass, renderSlot, Fragment, createCommentVNode, renderList, createElementVNode, toDisplayString, createVNode, createBlock, createTextVNode, mergeProps } from "vue";
|
|
7
7
|
import { c as createComponent, i as isPromise } from "./component.js";
|
|
8
|
-
import Taro from "@tarojs/taro";
|
|
9
8
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
10
9
|
import "../locale/lang";
|
|
11
10
|
class UploadOptions {
|
|
@@ -119,14 +118,6 @@ const _sfc_main = create({
|
|
|
119
118
|
props: {
|
|
120
119
|
name: { type: String, default: "file" },
|
|
121
120
|
url: { type: String, default: "" },
|
|
122
|
-
sizeType: {
|
|
123
|
-
type: Array,
|
|
124
|
-
default: () => ["original", "compressed"]
|
|
125
|
-
},
|
|
126
|
-
sourceType: {
|
|
127
|
-
type: Array,
|
|
128
|
-
default: () => ["album", "camera"]
|
|
129
|
-
},
|
|
130
121
|
timeout: { type: [Number, String], default: 1e3 * 30 },
|
|
131
122
|
fileList: { type: Array, default: () => [] },
|
|
132
123
|
isPreview: { type: Boolean, default: true },
|
|
@@ -135,7 +126,7 @@ const _sfc_main = create({
|
|
|
135
126
|
method: { type: String, default: "post" },
|
|
136
127
|
capture: { type: Boolean, default: false },
|
|
137
128
|
maximize: { type: [Number, String], default: Number.MAX_VALUE },
|
|
138
|
-
maximum: { type: [Number, String], default:
|
|
129
|
+
maximum: { type: [Number, String], default: 1 },
|
|
139
130
|
clearInput: { type: Boolean, default: true },
|
|
140
131
|
accept: { type: String, default: "*" },
|
|
141
132
|
headers: { type: Object, default: {} },
|
|
@@ -143,7 +134,8 @@ const _sfc_main = create({
|
|
|
143
134
|
uploadIcon: { type: String, default: "photograph" },
|
|
144
135
|
uploadIconSize: { type: [String, Number], default: "" },
|
|
145
136
|
xhrState: { type: [Number, String], default: 200 },
|
|
146
|
-
|
|
137
|
+
withCredentials: { type: Boolean, default: false },
|
|
138
|
+
multiple: { type: Boolean, default: false },
|
|
147
139
|
disabled: { type: Boolean, default: false },
|
|
148
140
|
autoUpload: { type: Boolean, default: true },
|
|
149
141
|
beforeUpload: {
|
|
@@ -182,69 +174,60 @@ const _sfc_main = create({
|
|
|
182
174
|
[prefixCls]: true
|
|
183
175
|
};
|
|
184
176
|
});
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
return;
|
|
188
|
-
}
|
|
189
|
-
Taro.chooseImage({
|
|
190
|
-
count: props.multiple ? props.maximum * 1 - props.fileList.length : 1,
|
|
191
|
-
sizeType: props.sizeType,
|
|
192
|
-
sourceType: props.sourceType,
|
|
193
|
-
success: onChange
|
|
194
|
-
});
|
|
177
|
+
const clearInput = (el) => {
|
|
178
|
+
el.value = "";
|
|
195
179
|
};
|
|
196
180
|
const fileItemClick = (fileItem) => {
|
|
197
181
|
emit("file-item-click", { fileItem });
|
|
198
182
|
};
|
|
199
|
-
const executeUpload = (fileItem,
|
|
183
|
+
const executeUpload = (fileItem, index2) => {
|
|
200
184
|
const uploadOption = new UploadOptions();
|
|
201
|
-
uploadOption.name = props.name;
|
|
202
185
|
uploadOption.url = props.url;
|
|
203
|
-
uploadOption.fileType = fileItem.type;
|
|
204
186
|
uploadOption.formData = fileItem.formData;
|
|
205
187
|
uploadOption.timeout = props.timeout * 1;
|
|
206
188
|
uploadOption.method = props.method;
|
|
207
189
|
uploadOption.xhrState = props.xhrState;
|
|
208
|
-
uploadOption.method = props.method;
|
|
209
190
|
uploadOption.headers = props.headers;
|
|
210
|
-
uploadOption.
|
|
191
|
+
uploadOption.withCredentials = props.withCredentials;
|
|
211
192
|
uploadOption.beforeXhrUpload = props.beforeXhrUpload;
|
|
193
|
+
try {
|
|
194
|
+
uploadOption.sourceFile = fileItem.formData.get(props.name);
|
|
195
|
+
} catch (error) {
|
|
196
|
+
}
|
|
212
197
|
uploadOption.onStart = (option) => {
|
|
213
198
|
fileItem.status = "ready";
|
|
214
199
|
fileItem.message = translate("readyUpload");
|
|
215
|
-
clearUploadQueue(
|
|
200
|
+
clearUploadQueue(index2);
|
|
216
201
|
emit("start", option);
|
|
217
202
|
};
|
|
218
203
|
uploadOption.onProgress = (event, option) => {
|
|
219
204
|
fileItem.status = "uploading";
|
|
220
205
|
fileItem.message = translate("uploading");
|
|
221
|
-
fileItem.percentage = event.
|
|
206
|
+
fileItem.percentage = (event.loaded / event.total * 100).toFixed(0);
|
|
222
207
|
emit("progress", { event, option, percentage: fileItem.percentage });
|
|
223
208
|
};
|
|
224
|
-
uploadOption.onSuccess = (
|
|
209
|
+
uploadOption.onSuccess = (responseText, option) => {
|
|
225
210
|
fileItem.status = "success";
|
|
226
211
|
fileItem.message = translate("success");
|
|
227
212
|
emit("success", {
|
|
228
|
-
|
|
229
|
-
responseText: data,
|
|
213
|
+
responseText,
|
|
230
214
|
option,
|
|
231
215
|
fileItem
|
|
232
216
|
});
|
|
233
217
|
emit("update:fileList", fileList);
|
|
234
218
|
};
|
|
235
|
-
uploadOption.onFailure = (
|
|
219
|
+
uploadOption.onFailure = (responseText, option) => {
|
|
236
220
|
fileItem.status = "error";
|
|
237
221
|
fileItem.message = translate("error");
|
|
238
222
|
emit("failure", {
|
|
239
|
-
|
|
240
|
-
responseText: data,
|
|
223
|
+
responseText,
|
|
241
224
|
option,
|
|
242
225
|
fileItem
|
|
243
226
|
});
|
|
244
227
|
};
|
|
245
228
|
let task = new Uploader(uploadOption);
|
|
246
229
|
if (props.autoUpload) {
|
|
247
|
-
task.
|
|
230
|
+
task.upload();
|
|
248
231
|
} else {
|
|
249
232
|
uploadQueue.push(
|
|
250
233
|
new Promise((resolve, reject) => {
|
|
@@ -253,9 +236,9 @@ const _sfc_main = create({
|
|
|
253
236
|
);
|
|
254
237
|
}
|
|
255
238
|
};
|
|
256
|
-
const clearUploadQueue = (
|
|
257
|
-
if (
|
|
258
|
-
uploadQueue.splice(
|
|
239
|
+
const clearUploadQueue = (index2 = -1) => {
|
|
240
|
+
if (index2 > -1) {
|
|
241
|
+
uploadQueue.splice(index2, 1);
|
|
259
242
|
} else {
|
|
260
243
|
uploadQueue = [];
|
|
261
244
|
fileList.splice(0, fileList.length);
|
|
@@ -263,40 +246,33 @@ const _sfc_main = create({
|
|
|
263
246
|
};
|
|
264
247
|
const submit = () => {
|
|
265
248
|
Promise.all(uploadQueue).then((res) => {
|
|
266
|
-
res.forEach((i) => i.
|
|
249
|
+
res.forEach((i) => i.upload());
|
|
267
250
|
});
|
|
268
251
|
};
|
|
269
252
|
const readFile = (files) => {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
const fileItem = reactive(new FileItem());
|
|
275
|
-
if (!fileType && imgReg.test(file.path)) {
|
|
276
|
-
fileType = "image";
|
|
253
|
+
files.forEach((file, index2) => {
|
|
254
|
+
const formData = new FormData();
|
|
255
|
+
for (const [key, value] of Object.entries(props.data)) {
|
|
256
|
+
formData.append(key, value);
|
|
277
257
|
}
|
|
278
|
-
|
|
279
|
-
fileItem
|
|
258
|
+
formData.append(props.name, file);
|
|
259
|
+
const fileItem = reactive(new FileItem());
|
|
260
|
+
fileItem.name = file.name;
|
|
280
261
|
fileItem.status = "ready";
|
|
262
|
+
fileItem.type = file.type;
|
|
263
|
+
fileItem.formData = formData;
|
|
281
264
|
fileItem.message = translate("waitingUpload");
|
|
282
|
-
fileItem
|
|
283
|
-
if (
|
|
284
|
-
const
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
fileItem.type = (_b = file.originalFileObj) == null ? void 0 : _b.type;
|
|
291
|
-
fileItem.formData = formData;
|
|
265
|
+
executeUpload(fileItem, index2);
|
|
266
|
+
if (props.isPreview && file.type.includes("image")) {
|
|
267
|
+
const reader = new FileReader();
|
|
268
|
+
reader.onload = (event) => {
|
|
269
|
+
fileItem.url = event.target.result;
|
|
270
|
+
fileList.push(fileItem);
|
|
271
|
+
};
|
|
272
|
+
reader.readAsDataURL(file);
|
|
292
273
|
} else {
|
|
293
|
-
fileItem
|
|
294
|
-
}
|
|
295
|
-
if (props.isPreview) {
|
|
296
|
-
fileItem.url = file.path;
|
|
274
|
+
fileList.push(fileItem);
|
|
297
275
|
}
|
|
298
|
-
fileList.push(fileItem);
|
|
299
|
-
executeUpload(fileItem, index);
|
|
300
276
|
});
|
|
301
277
|
};
|
|
302
278
|
const filterFiles = (files) => {
|
|
@@ -320,61 +296,59 @@ const _sfc_main = create({
|
|
|
320
296
|
}
|
|
321
297
|
return files;
|
|
322
298
|
};
|
|
323
|
-
const deleted = (file,
|
|
324
|
-
fileList.splice(
|
|
299
|
+
const deleted = (file, index2) => {
|
|
300
|
+
fileList.splice(index2, 1);
|
|
325
301
|
emit("delete", {
|
|
326
302
|
file,
|
|
327
303
|
fileList,
|
|
328
|
-
index
|
|
304
|
+
index: index2
|
|
329
305
|
});
|
|
330
306
|
};
|
|
331
|
-
const onDelete = (file,
|
|
332
|
-
clearUploadQueue(
|
|
307
|
+
const onDelete = (file, index2) => {
|
|
308
|
+
clearUploadQueue(index2);
|
|
333
309
|
let fn = props.beforeDelete(file, fileList);
|
|
334
310
|
if (isPromise(fn)) {
|
|
335
311
|
fn.then((res) => {
|
|
336
312
|
if (res) {
|
|
337
|
-
deleted(file,
|
|
313
|
+
deleted(file, index2);
|
|
338
314
|
}
|
|
339
315
|
}).catch((error) => {
|
|
340
316
|
console.log(error, "\u7528\u6237\u963B\u6B62\u4E86\u5220\u9664\uFF01");
|
|
341
317
|
});
|
|
342
318
|
} else if (fn) {
|
|
343
|
-
deleted(file,
|
|
319
|
+
deleted(file, index2);
|
|
344
320
|
} else {
|
|
345
321
|
console.log("\u7528\u6237\u963B\u6B62\u4E86\u5220\u9664\uFF01");
|
|
346
322
|
}
|
|
347
323
|
};
|
|
348
|
-
const onChange = (
|
|
349
|
-
|
|
324
|
+
const onChange = (event) => {
|
|
325
|
+
if (props.disabled) {
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
const $el = event.target;
|
|
329
|
+
let { files } = $el;
|
|
350
330
|
if (props.beforeUpload) {
|
|
351
|
-
props.beforeUpload(
|
|
352
|
-
const _files = filterFiles(f);
|
|
331
|
+
props.beforeUpload(files).then((f) => {
|
|
332
|
+
const _files = filterFiles(new Array().slice.call(f));
|
|
353
333
|
readFile(_files);
|
|
354
334
|
});
|
|
355
335
|
} else {
|
|
356
|
-
const _files = filterFiles(
|
|
336
|
+
const _files = filterFiles(new Array().slice.call(files));
|
|
357
337
|
readFile(_files);
|
|
358
338
|
}
|
|
359
339
|
emit("change", {
|
|
360
|
-
fileList
|
|
340
|
+
fileList,
|
|
341
|
+
event
|
|
361
342
|
});
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
if (Taro.getEnv() == "WEB") {
|
|
365
|
-
const obj = document.createElement("input");
|
|
366
|
-
obj.setAttribute("type", "file");
|
|
367
|
-
obj.setAttribute("id", "taroChooseImage");
|
|
368
|
-
obj.setAttribute("accept", props.accept);
|
|
369
|
-
obj.setAttribute("style", "position: fixed; top: -4000px; left: -3000px; z-index: -300;");
|
|
370
|
-
document.body.appendChild(obj);
|
|
343
|
+
if (props.clearInput) {
|
|
344
|
+
clearInput($el);
|
|
371
345
|
}
|
|
372
|
-
}
|
|
346
|
+
};
|
|
373
347
|
return {
|
|
348
|
+
onChange,
|
|
374
349
|
onDelete,
|
|
375
350
|
fileList,
|
|
376
351
|
classes,
|
|
377
|
-
chooseImage,
|
|
378
352
|
fileItemClick,
|
|
379
353
|
clearUploadQueue,
|
|
380
354
|
submit
|
|
@@ -385,34 +359,37 @@ const _hoisted_1 = {
|
|
|
385
359
|
key: 0,
|
|
386
360
|
class: "nut-uploader__slot"
|
|
387
361
|
};
|
|
388
|
-
const _hoisted_2 =
|
|
362
|
+
const _hoisted_2 = ["accept", "multiple", "name", "disabled"];
|
|
363
|
+
const _hoisted_3 = ["accept", "multiple", "name", "disabled"];
|
|
364
|
+
const _hoisted_4 = {
|
|
389
365
|
key: 0,
|
|
390
366
|
class: "nut-uploader__preview-img"
|
|
391
367
|
};
|
|
392
|
-
const
|
|
368
|
+
const _hoisted_5 = {
|
|
393
369
|
key: 0,
|
|
394
370
|
class: "nut-uploader__preview__progress"
|
|
395
371
|
};
|
|
396
|
-
const
|
|
397
|
-
const
|
|
372
|
+
const _hoisted_6 = { class: "nut-uploader__preview__progress__msg" };
|
|
373
|
+
const _hoisted_7 = {
|
|
398
374
|
key: 1,
|
|
399
375
|
class: "nut-uploader__preview__progress"
|
|
400
376
|
};
|
|
401
|
-
const
|
|
402
|
-
const
|
|
403
|
-
const
|
|
377
|
+
const _hoisted_8 = { class: "nut-uploader__preview__progress__msg" };
|
|
378
|
+
const _hoisted_9 = ["onClick", "src"];
|
|
379
|
+
const _hoisted_10 = {
|
|
404
380
|
key: 4,
|
|
405
381
|
class: "nut-uploader__preview-img__file"
|
|
406
382
|
};
|
|
407
|
-
const
|
|
408
|
-
const
|
|
409
|
-
const
|
|
383
|
+
const _hoisted_11 = ["onClick"];
|
|
384
|
+
const _hoisted_12 = { class: "tips" };
|
|
385
|
+
const _hoisted_13 = {
|
|
410
386
|
key: 1,
|
|
411
387
|
class: "nut-uploader__preview-list"
|
|
412
388
|
};
|
|
413
|
-
const
|
|
389
|
+
const _hoisted_14 = ["onClick"];
|
|
390
|
+
const _hoisted_15 = ["accept", "multiple", "name", "disabled"];
|
|
391
|
+
const _hoisted_16 = ["accept", "multiple", "name", "disabled"];
|
|
414
392
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
415
|
-
const _component_nut_button = resolveComponent("nut-button");
|
|
416
393
|
const _component_nut_icon = resolveComponent("nut-icon");
|
|
417
394
|
const _component_nut_progress = resolveComponent("nut-progress");
|
|
418
395
|
return openBlock(), createElementBlock("view", {
|
|
@@ -420,74 +397,82 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
420
397
|
}, [
|
|
421
398
|
_ctx.$slots.default ? (openBlock(), createElementBlock("view", _hoisted_1, [
|
|
422
399
|
renderSlot(_ctx.$slots, "default"),
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
400
|
+
_ctx.maximum - _ctx.fileList.length ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
401
|
+
_ctx.capture ? (openBlock(), createElementBlock("input", {
|
|
402
|
+
key: 0,
|
|
403
|
+
class: "nut-uploader__input",
|
|
404
|
+
type: "file",
|
|
405
|
+
capture: "camera",
|
|
406
|
+
accept: _ctx.accept,
|
|
407
|
+
multiple: _ctx.multiple,
|
|
408
|
+
name: _ctx.name,
|
|
409
|
+
disabled: _ctx.disabled,
|
|
410
|
+
onChange: _cache[0] || (_cache[0] = (...args) => _ctx.onChange && _ctx.onChange(...args))
|
|
411
|
+
}, null, 40, _hoisted_2)) : (openBlock(), createElementBlock("input", {
|
|
412
|
+
key: 1,
|
|
413
|
+
class: "nut-uploader__input",
|
|
414
|
+
type: "file",
|
|
415
|
+
accept: _ctx.accept,
|
|
416
|
+
multiple: _ctx.multiple,
|
|
417
|
+
name: _ctx.name,
|
|
418
|
+
disabled: _ctx.disabled,
|
|
419
|
+
onChange: _cache[1] || (_cache[1] = (...args) => _ctx.onChange && _ctx.onChange(...args))
|
|
420
|
+
}, null, 40, _hoisted_3))
|
|
421
|
+
], 64)) : createCommentVNode("", true)
|
|
429
422
|
])) : createCommentVNode("", true),
|
|
430
|
-
|
|
431
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.fileList, (item, index) => {
|
|
432
|
-
var _a;
|
|
423
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.fileList, (item, index2) => {
|
|
433
424
|
return openBlock(), createElementBlock("view", {
|
|
434
425
|
class: normalizeClass(["nut-uploader__preview", [_ctx.listType]]),
|
|
435
426
|
key: item.uid
|
|
436
427
|
}, [
|
|
437
|
-
_ctx.listType == "picture" && !_ctx.$slots.default ? (openBlock(), createElementBlock("view",
|
|
438
|
-
item.status == "ready" ? (openBlock(), createElementBlock("view",
|
|
439
|
-
createElementVNode("view",
|
|
440
|
-
])) : item.status != "success" ? (openBlock(), createElementBlock("view",
|
|
428
|
+
_ctx.listType == "picture" && !_ctx.$slots.default ? (openBlock(), createElementBlock("view", _hoisted_4, [
|
|
429
|
+
item.status == "ready" ? (openBlock(), createElementBlock("view", _hoisted_5, [
|
|
430
|
+
createElementVNode("view", _hoisted_6, toDisplayString(item.message), 1)
|
|
431
|
+
])) : item.status != "success" ? (openBlock(), createElementBlock("view", _hoisted_7, [
|
|
441
432
|
createVNode(_component_nut_icon, {
|
|
442
433
|
color: "#fff",
|
|
443
434
|
name: item.status == "error" ? "failure" : "loading"
|
|
444
435
|
}, null, 8, ["name"]),
|
|
445
|
-
|
|
446
|
-
createElementVNode("view", _hoisted_6, toDisplayString(item.message), 1)
|
|
436
|
+
createElementVNode("view", _hoisted_8, toDisplayString(item.message), 1)
|
|
447
437
|
])) : createCommentVNode("", true),
|
|
448
|
-
createTextVNode(),
|
|
449
438
|
_ctx.isDeletable ? (openBlock(), createBlock(_component_nut_icon, {
|
|
450
439
|
key: 2,
|
|
451
|
-
onClick: ($event) => _ctx.onDelete(item,
|
|
440
|
+
onClick: ($event) => _ctx.onDelete(item, index2),
|
|
452
441
|
class: "close",
|
|
453
442
|
name: "failure"
|
|
454
443
|
}, null, 8, ["onClick"])) : createCommentVNode("", true),
|
|
455
|
-
|
|
456
|
-
((_a = item.type) == null ? void 0 : _a.includes("image")) && item.url ? (openBlock(), createElementBlock("img", {
|
|
444
|
+
item.type.includes("image") && item.url ? (openBlock(), createElementBlock("img", {
|
|
457
445
|
key: 3,
|
|
458
446
|
class: "nut-uploader__preview-img__c",
|
|
459
447
|
onClick: ($event) => _ctx.fileItemClick(item),
|
|
460
448
|
src: item.url
|
|
461
|
-
}, null, 8,
|
|
449
|
+
}, null, 8, _hoisted_9)) : (openBlock(), createElementBlock("view", _hoisted_10, [
|
|
462
450
|
createElementVNode("view", {
|
|
463
|
-
|
|
464
|
-
|
|
451
|
+
onClick: ($event) => _ctx.fileItemClick(item),
|
|
452
|
+
class: "nut-uploader__preview-img__file__name"
|
|
465
453
|
}, [
|
|
466
454
|
createVNode(_component_nut_icon, {
|
|
467
455
|
color: "#808080",
|
|
468
456
|
name: "link"
|
|
469
457
|
}),
|
|
470
458
|
createTextVNode("\xA0" + toDisplayString(item.name), 1)
|
|
471
|
-
], 8,
|
|
459
|
+
], 8, _hoisted_11)
|
|
472
460
|
])),
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
])) : _ctx.listType == "list" ? (openBlock(), createElementBlock("view", _hoisted_11, [
|
|
461
|
+
createElementVNode("view", _hoisted_12, toDisplayString(item.name), 1)
|
|
462
|
+
])) : _ctx.listType == "list" ? (openBlock(), createElementBlock("view", _hoisted_13, [
|
|
476
463
|
createElementVNode("view", {
|
|
477
|
-
|
|
478
|
-
|
|
464
|
+
onClick: ($event) => _ctx.fileItemClick(item),
|
|
465
|
+
class: normalizeClass(["nut-uploader__preview-img__file__name", [item.status]])
|
|
479
466
|
}, [
|
|
480
467
|
createVNode(_component_nut_icon, { name: "link" }),
|
|
481
468
|
createTextVNode("\xA0" + toDisplayString(item.name), 1)
|
|
482
|
-
], 10,
|
|
483
|
-
createTextVNode(),
|
|
469
|
+
], 10, _hoisted_14),
|
|
484
470
|
createVNode(_component_nut_icon, {
|
|
485
471
|
class: "nut-uploader__preview-img__file__del",
|
|
486
|
-
onClick: ($event) => _ctx.onDelete(item,
|
|
472
|
+
onClick: ($event) => _ctx.onDelete(item, index2),
|
|
487
473
|
color: "#808080",
|
|
488
474
|
name: "del"
|
|
489
475
|
}, null, 8, ["onClick"]),
|
|
490
|
-
createTextVNode(),
|
|
491
476
|
item.status == "uploading" ? (openBlock(), createBlock(_component_nut_progress, {
|
|
492
477
|
key: 0,
|
|
493
478
|
size: "small",
|
|
@@ -498,7 +483,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
498
483
|
])) : createCommentVNode("", true)
|
|
499
484
|
], 2);
|
|
500
485
|
}), 128)),
|
|
501
|
-
createTextVNode(),
|
|
502
486
|
_ctx.listType == "picture" && !_ctx.$slots.default && _ctx.maximum - _ctx.fileList.length ? (openBlock(), createElementBlock("view", {
|
|
503
487
|
key: 1,
|
|
504
488
|
class: normalizeClass(["nut-uploader__upload", [_ctx.listType]])
|
|
@@ -508,13 +492,28 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
508
492
|
color: "#808080",
|
|
509
493
|
name: _ctx.uploadIcon
|
|
510
494
|
}), null, 16, ["size", "name"]),
|
|
511
|
-
|
|
512
|
-
|
|
495
|
+
_ctx.capture ? (openBlock(), createElementBlock("input", {
|
|
496
|
+
key: 0,
|
|
497
|
+
class: "nut-uploader__input",
|
|
498
|
+
type: "file",
|
|
499
|
+
capture: "camera",
|
|
500
|
+
accept: _ctx.accept,
|
|
501
|
+
multiple: _ctx.multiple,
|
|
502
|
+
name: _ctx.name,
|
|
503
|
+
disabled: _ctx.disabled,
|
|
504
|
+
onChange: _cache[2] || (_cache[2] = (...args) => _ctx.onChange && _ctx.onChange(...args))
|
|
505
|
+
}, null, 40, _hoisted_15)) : (openBlock(), createElementBlock("input", {
|
|
506
|
+
key: 1,
|
|
513
507
|
class: "nut-uploader__input",
|
|
514
|
-
|
|
515
|
-
|
|
508
|
+
type: "file",
|
|
509
|
+
accept: _ctx.accept,
|
|
510
|
+
multiple: _ctx.multiple,
|
|
511
|
+
name: _ctx.name,
|
|
512
|
+
disabled: _ctx.disabled,
|
|
513
|
+
onChange: _cache[3] || (_cache[3] = (...args) => _ctx.onChange && _ctx.onChange(...args))
|
|
514
|
+
}, null, 40, _hoisted_16))
|
|
516
515
|
], 2)) : createCommentVNode("", true)
|
|
517
516
|
], 2);
|
|
518
517
|
}
|
|
519
|
-
var
|
|
520
|
-
export {
|
|
518
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
519
|
+
export { index as default };
|
|
@@ -1,37 +1,28 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.2.6-beta.
|
|
2
|
+
* @nutui/nutui v3.2.6-beta.2 Fri Nov 04 2022 17:24:29 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { reactive, ref, computed, watch, nextTick, onMounted, toRefs, openBlock, createElementBlock, createElementVNode,
|
|
6
|
+
import { reactive, ref, computed, watch, nextTick, onMounted, toRefs, openBlock, createElementBlock, createElementVNode, createCommentVNode, withDirectives, vShow, normalizeClass, toDisplayString, normalizeStyle, withModifiers } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
8
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
9
|
import "../locale/lang";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
} else if (type === 2) {
|
|
14
|
-
var timeout;
|
|
15
|
-
}
|
|
10
|
+
function throttle(fn, delay) {
|
|
11
|
+
let timer = null;
|
|
12
|
+
let startTime = Date.now();
|
|
16
13
|
return function() {
|
|
17
|
-
let
|
|
18
|
-
let
|
|
19
|
-
if (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if (!timeout) {
|
|
27
|
-
timeout = setTimeout(() => {
|
|
28
|
-
timeout = null;
|
|
29
|
-
func.apply(context, args);
|
|
30
|
-
}, wait);
|
|
31
|
-
}
|
|
14
|
+
let now = Date.now();
|
|
15
|
+
let remaining = delay - (now - startTime);
|
|
16
|
+
if (timer)
|
|
17
|
+
clearTimeout(timer);
|
|
18
|
+
if (remaining <= 0) {
|
|
19
|
+
fn.apply(null, arguments);
|
|
20
|
+
startTime = Date.now();
|
|
21
|
+
} else {
|
|
22
|
+
timer = setTimeout(fn, remaining);
|
|
32
23
|
}
|
|
33
24
|
};
|
|
34
|
-
}
|
|
25
|
+
}
|
|
35
26
|
const { create, translate } = createComponent("video");
|
|
36
27
|
const _sfc_main = create({
|
|
37
28
|
props: {
|
|
@@ -147,7 +138,7 @@ const _sfc_main = create({
|
|
|
147
138
|
emit("pause", state.videoElm);
|
|
148
139
|
});
|
|
149
140
|
state.videoElm.addEventListener("ended", playEnded);
|
|
150
|
-
state.videoElm.addEventListener("timeupdate", throttle(getPlayTime, 1e3
|
|
141
|
+
state.videoElm.addEventListener("timeupdate", throttle(getPlayTime, 1e3));
|
|
151
142
|
}
|
|
152
143
|
};
|
|
153
144
|
const customerInit = () => {
|
|
@@ -334,14 +325,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
334
325
|
type: _ctx.source.type
|
|
335
326
|
}, null, 8, _hoisted_3)
|
|
336
327
|
], 40, _hoisted_2),
|
|
337
|
-
createTextVNode(),
|
|
338
328
|
_ctx.showToolbox && !_ctx.isDisabled ? (openBlock(), createElementBlock("div", {
|
|
339
329
|
key: 0,
|
|
340
330
|
class: "playing-mask",
|
|
341
331
|
ref: "touchMask",
|
|
342
332
|
onClick: _cache[1] || (_cache[1] = (...args) => _ctx.play && _ctx.play(...args))
|
|
343
333
|
}, null, 512)) : createCommentVNode("", true),
|
|
344
|
-
createTextVNode(),
|
|
345
334
|
_ctx.showToolbox && !_ctx.isDisabled ? withDirectives((openBlock(), createElementBlock("div", {
|
|
346
335
|
key: 1,
|
|
347
336
|
class: "nut-video-play-btn",
|
|
@@ -350,7 +339,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
350
339
|
}, null, 512)), [
|
|
351
340
|
[vShow, !_ctx.state.playing]
|
|
352
341
|
]) : createCommentVNode("", true),
|
|
353
|
-
createTextVNode(),
|
|
354
342
|
withDirectives(createElementVNode("div", {
|
|
355
343
|
class: normalizeClass(["nut-video-controller", { "show-control": !_ctx.state.playing, "hide-control": _ctx.state.playing }])
|
|
356
344
|
}, [
|
|
@@ -358,16 +346,13 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
358
346
|
class: "control-play-btn",
|
|
359
347
|
onClick: _cache[3] || (_cache[3] = (...args) => _ctx.play && _ctx.play(...args))
|
|
360
348
|
}),
|
|
361
|
-
createTextVNode(),
|
|
362
349
|
createElementVNode("div", _hoisted_4, toDisplayString(_ctx.videoSet.displayTime), 1),
|
|
363
|
-
createTextVNode(),
|
|
364
350
|
createElementVNode("div", _hoisted_5, [
|
|
365
351
|
createElementVNode("div", _hoisted_6, [
|
|
366
352
|
createElementVNode("div", {
|
|
367
353
|
class: "buffered",
|
|
368
354
|
style: normalizeStyle({ width: `${_ctx.videoSet.loaded}%` })
|
|
369
355
|
}, null, 4),
|
|
370
|
-
createTextVNode(),
|
|
371
356
|
createElementVNode("div", {
|
|
372
357
|
class: "video-ball",
|
|
373
358
|
style: normalizeStyle({
|
|
@@ -377,18 +362,14 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
377
362
|
onTouchstart: _cache[5] || (_cache[5] = withModifiers(($event) => _ctx.touchSlidSrart($event), ["stop"])),
|
|
378
363
|
onTouchend: _cache[6] || (_cache[6] = withModifiers(($event) => _ctx.touchSlidEnd($event), ["stop"]))
|
|
379
364
|
}, _hoisted_8, 36),
|
|
380
|
-
createTextVNode(),
|
|
381
365
|
createElementVNode("div", _hoisted_9, null, 512)
|
|
382
366
|
], 512)
|
|
383
367
|
]),
|
|
384
|
-
createTextVNode(),
|
|
385
368
|
createElementVNode("div", _hoisted_10, toDisplayString(_ctx.videoSet.totalTime), 1),
|
|
386
|
-
createTextVNode(),
|
|
387
369
|
createElementVNode("div", {
|
|
388
370
|
class: normalizeClass(["volume", { muted: _ctx.state.isMuted }]),
|
|
389
371
|
onClick: _cache[7] || (_cache[7] = (...args) => _ctx.handleMuted && _ctx.handleMuted(...args))
|
|
390
372
|
}, null, 2),
|
|
391
|
-
createTextVNode(),
|
|
392
373
|
createElementVNode("div", {
|
|
393
374
|
class: "fullscreen-icon",
|
|
394
375
|
onClick: _cache[8] || (_cache[8] = (...args) => _ctx.fullScreen && _ctx.fullScreen(...args))
|
|
@@ -396,10 +377,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
396
377
|
], 2), [
|
|
397
378
|
[vShow, _ctx.showToolbox && !_ctx.isDisabled]
|
|
398
379
|
]),
|
|
399
|
-
createTextVNode(),
|
|
400
380
|
withDirectives(createElementVNode("div", _hoisted_11, [
|
|
401
381
|
createElementVNode("p", _hoisted_12, toDisplayString(_ctx.translate("errorTip")), 1),
|
|
402
|
-
createTextVNode(),
|
|
403
382
|
createElementVNode("p", {
|
|
404
383
|
class: "retry",
|
|
405
384
|
onClick: _cache[9] || (_cache[9] = (...args) => _ctx.retry && _ctx.retry(...args))
|
|
@@ -409,5 +388,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
409
388
|
])
|
|
410
389
|
], 512);
|
|
411
390
|
}
|
|
412
|
-
var
|
|
413
|
-
export {
|
|
391
|
+
var Video = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
392
|
+
export { Video as default };
|