@nutui/nutui 3.2.6 → 3.2.8-beta.0
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/CHANGELOG.md +41 -0
- package/README.md +11 -1
- package/dist/nutui.es.js +2685 -4599
- package/dist/nutui.umd.js +2684 -4600
- package/dist/packages/_es/ActionSheet.js +2 -5
- package/dist/packages/_es/Address.js +162 -250
- package/dist/packages/_es/AddressList.js +229 -307
- package/dist/packages/_es/Animate.js +1 -1
- package/dist/packages/_es/Audio.js +1 -1
- package/dist/packages/_es/AudioOperate.js +1 -1
- package/dist/packages/_es/Avatar.js +1 -1
- package/dist/packages/_es/AvatarGroup.js +1 -1
- package/dist/packages/_es/BackTop.js +1 -1
- package/dist/packages/_es/Badge.js +1 -1
- package/dist/packages/_es/Barrage.js +1 -1
- package/dist/packages/_es/Button.js +1 -1
- package/dist/packages/_es/Calendar.js +11 -4
- package/dist/packages/_es/CalendarItem.js +1 -1
- package/dist/packages/_es/Card.js +1 -1
- package/dist/packages/_es/Cascader.js +2 -5
- package/dist/packages/_es/Category.js +1 -1
- package/dist/packages/_es/CategoryPane.js +1 -1
- package/dist/packages/_es/Cell.js +1 -1
- package/dist/packages/_es/CellGroup.js +1 -1
- package/dist/packages/_es/Checkbox.js +1 -1
- package/dist/packages/_es/CheckboxGroup.js +1 -1
- package/dist/packages/_es/CircleProgress.js +2 -2
- package/dist/packages/_es/Col.js +1 -1
- package/dist/packages/_es/Collapse.js +4 -11
- package/dist/packages/_es/CollapseItem.js +12 -12
- package/dist/packages/_es/Comment.js +1 -1
- package/dist/packages/_es/ConfigProvider.js +1 -1
- package/dist/packages/_es/CountDown.js +2 -10
- package/dist/packages/_es/CountUp.js +1 -1
- package/dist/packages/_es/DatePicker.js +8 -17
- package/dist/packages/_es/Dialog.js +38 -63
- package/dist/packages/_es/Divider.js +1 -1
- package/dist/packages/_es/Drag.js +1 -1
- package/dist/packages/_es/Ecard.js +1 -1
- package/dist/packages/_es/Elevator.js +9 -3
- package/dist/packages/_es/Ellipsis.js +3 -3
- package/dist/packages/_es/Empty.js +1 -1
- package/dist/packages/_es/FixedNav.js +1 -1
- package/dist/packages/_es/Form.js +39 -31
- package/dist/packages/_es/FormItem.js +1 -1
- package/dist/packages/_es/Grid.js +2 -2
- package/dist/packages/_es/GridItem.js +1 -1
- package/dist/packages/_es/Icon.js +1 -1
- package/dist/packages/_es/Image.js +1 -1
- package/dist/packages/_es/ImagePreview.js +131 -214
- package/dist/packages/_es/Indicator.js +4 -4
- package/dist/packages/_es/InfiniteLoading.js +9 -2
- package/dist/packages/_es/Input.js +109 -132
- package/dist/packages/_es/InputNumber.js +1 -1
- package/dist/packages/_es/Invoice.js +1 -1
- package/dist/packages/_es/Layout.js +1 -1
- package/dist/packages/_es/List.js +1 -1
- package/dist/packages/_es/Menu.js +14 -1
- package/dist/packages/_es/MenuItem.js +14 -8
- package/dist/packages/_es/Navbar.js +1 -1
- package/dist/packages/_es/NoticeBar.js +1 -1
- package/dist/packages/_es/Notify.js +5 -7
- package/dist/packages/_es/NumberKeyboard.js +4 -4
- package/dist/packages/_es/OverLay.js +60 -63
- package/dist/packages/_es/Pagination.js +1 -1
- package/dist/packages/_es/Picker.js +25 -50
- package/dist/packages/_es/Popover.js +111 -930
- package/dist/packages/_es/Popup.js +108 -261
- package/dist/packages/_es/Price.js +1 -1
- package/dist/packages/_es/Progress.js +1 -1
- package/dist/packages/_es/Radio.js +1 -1
- package/dist/packages/_es/RadioGroup.js +1 -1
- package/dist/packages/_es/Range.js +1 -1
- package/dist/packages/_es/Rate.js +1 -1
- package/dist/packages/_es/Row.js +1 -1
- package/dist/packages/_es/SearchBar.js +1 -1
- package/dist/packages/_es/ShortPassword.js +4 -4
- package/dist/packages/_es/SideNavBar.js +1 -1
- package/dist/packages/_es/SideNavBarItem.js +1 -1
- package/dist/packages/_es/Signature.js +1 -1
- package/dist/packages/_es/Skeleton.js +19 -24
- package/dist/packages/_es/Sku.js +4 -7
- package/dist/packages/_es/Step.js +1 -1
- package/dist/packages/_es/Steps.js +1 -1
- package/dist/packages/_es/Sticky.js +1 -1
- package/dist/packages/_es/SubSideNavBar.js +1 -1
- package/dist/packages/_es/Swipe.js +1 -1
- package/dist/packages/_es/Swiper.js +1 -1
- package/dist/packages/_es/SwiperItem.js +1 -1
- package/dist/packages/_es/Switch.js +1 -1
- package/dist/packages/_es/TabPane.js +1 -1
- package/dist/packages/_es/Tabbar.js +1 -1
- package/dist/packages/_es/TabbarItem.js +24 -10
- package/dist/packages/_es/Table.js +1 -1
- package/dist/packages/_es/Tabs.js +2 -2
- package/dist/packages/_es/Tag.js +1 -1
- package/dist/packages/_es/TextArea.js +1 -1
- package/dist/packages/_es/TimeDetail.js +1 -1
- package/dist/packages/_es/TimePannel.js +1 -1
- package/dist/packages/_es/TimeSelect.js +4 -4
- package/dist/packages/_es/Toast.js +5 -6
- package/dist/packages/_es/TrendArrow.js +1 -1
- package/dist/packages/_es/Uploader.js +7 -7
- package/dist/packages/_es/Video.js +3 -2
- package/dist/packages/_es/WaterMark.js +1 -1
- package/dist/packages/_es/common.js +1 -1
- package/dist/packages/_es/component.js +22 -2
- package/dist/packages/_es/index.js +1 -1
- package/dist/packages/_es/index2.js +1 -1
- package/dist/packages/_es/index3.js +1 -1
- package/dist/packages/_es/index4.js +1 -1
- package/dist/packages/_es/index5.js +8 -2
- package/dist/packages/_es/interceptor.js +32 -0
- package/dist/packages/_es/mountComponent.js +42 -0
- package/dist/packages/_es/plugin-vue_export-helper.js +1 -1
- package/dist/packages/_es/props.js +80 -0
- package/dist/packages/_es/pxCheck.js +1 -1
- package/dist/packages/_es/raf.js +1 -1
- package/dist/packages/_es/style.css +1 -1
- package/dist/packages/address/index.scss +12 -3
- package/dist/packages/addresslist/index.scss +61 -101
- package/dist/packages/card/index.scss +1 -0
- package/dist/packages/ellipsis/index.scss +4 -0
- package/dist/packages/formitem/index.scss +2 -0
- package/dist/packages/imagepreview/index.scss +14 -1
- package/dist/packages/inputnumber/index.scss +5 -1
- 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 +0 -14
- package/dist/packages/notify/index.scss +2 -2
- package/dist/packages/overlay/index.scss +2 -1
- package/dist/packages/picker/index.scss +20 -12
- package/dist/packages/popover/index.scss +191 -363
- package/dist/packages/popup/index.scss +3 -14
- package/dist/packages/signature/index.scss +6 -2
- package/dist/packages/skeleton/index.scss +21 -19
- package/dist/packages/sticky/index.scss +3 -0
- package/dist/packages/tabbaritem/index.scss +4 -0
- package/dist/packages/timeselect/index.scss +0 -1
- package/dist/smartips/attributes.json +91 -111
- package/dist/smartips/tags.json +22 -35
- package/dist/smartips/web-types.json +162 -221
- package/dist/style.css +1 -1
- package/dist/styles/font/config.json +4 -0
- package/dist/styles/font/demo_index.html +118 -26
- package/dist/styles/font/iconfont.css +23 -7
- package/dist/styles/font/iconfont.js +6 -6
- package/dist/styles/font/iconfont.json +35 -7
- package/dist/styles/font/iconfont.ttf +0 -0
- package/dist/styles/font/iconfont.woff +0 -0
- package/dist/styles/font/iconfont.woff2 +0 -0
- package/dist/styles/themes/default.scss +52 -54
- package/dist/styles/themes/jdb.scss +52 -54
- package/dist/styles/themes/jddkh.scss +52 -54
- package/dist/styles/themes/jdt.scss +52 -54
- package/dist/styles/variables-jdb.scss +8 -1
- package/dist/styles/variables-jddkh.scss +8 -1
- package/dist/styles/variables-jdt.scss +8 -1
- package/dist/styles/variables.scss +17 -1
- package/dist/types/__VUE/actionsheet/index.vue.d.ts +58 -54
- package/dist/types/__VUE/address/index.vue.d.ts +71 -91
- package/dist/types/__VUE/addresslist/components/GeneralShell.vue.d.ts +29 -9
- package/dist/types/__VUE/addresslist/components/ItemContents.vue.d.ts +4 -13
- package/dist/types/__VUE/addresslist/components/SwipeShell.vue.d.ts +9 -9
- package/dist/types/__VUE/addresslist/index.vue.d.ts +23 -20
- package/dist/types/__VUE/audio/index.vue.d.ts +4 -4
- package/dist/types/__VUE/avatar/index.vue.d.ts +2 -2
- package/dist/types/__VUE/avatargroup/index.vue.d.ts +1 -1
- package/dist/types/__VUE/backtop/index.vue.d.ts +1 -1
- package/dist/types/__VUE/badge/index.vue.d.ts +1 -1
- package/dist/types/__VUE/button/index.vue.d.ts +1 -1
- package/dist/types/__VUE/calendar/index.vue.d.ts +11 -0
- package/dist/types/__VUE/calendaritem/index.vue.d.ts +15 -5
- package/dist/types/__VUE/cascader/index.vue.d.ts +47 -52
- package/dist/types/__VUE/cell/index.vue.d.ts +5 -5
- package/dist/types/__VUE/collapseitem/index.vue.d.ts +1 -1
- package/dist/types/__VUE/countdown/index.vue.d.ts +0 -1
- package/dist/types/__VUE/countdown/util.d.ts +0 -1
- package/dist/types/__VUE/countup/index.vue.d.ts +2 -2
- package/dist/types/__VUE/datepicker/index.vue.d.ts +55 -60
- package/dist/types/__VUE/dialog/index.d.ts +0 -3
- package/dist/types/__VUE/dialog/index.vue.d.ts +48 -57
- package/dist/types/__VUE/elevator/index.vue.d.ts +2 -1
- package/dist/types/__VUE/form/common.d.ts +4 -2
- package/dist/types/__VUE/form/index.vue.d.ts +4 -4
- package/dist/types/__VUE/grid/index.vue.d.ts +2 -2
- package/dist/types/__VUE/image/index.vue.d.ts +1 -1
- package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +27 -20
- package/dist/types/__VUE/imagepreview/index.d.ts +19 -5
- package/dist/types/__VUE/imagepreview/index.vue.d.ts +56 -42
- package/dist/types/__VUE/imagepreview/types.d.ts +44 -0
- package/dist/types/__VUE/indicator/index.vue.d.ts +1 -0
- package/dist/types/__VUE/input/index.vue.d.ts +37 -26
- package/dist/types/__VUE/invoice/index.vue.d.ts +1 -1
- package/dist/types/__VUE/menuitem/index.vue.d.ts +3 -1
- package/dist/types/__VUE/navbar/index.vue.d.ts +1 -1
- package/dist/types/__VUE/noticebar/index.vue.d.ts +4 -4
- package/dist/types/__VUE/notify/index.vue.d.ts +3 -3
- package/dist/types/__VUE/numberkeyboard/index.vue.d.ts +3 -3
- package/dist/types/__VUE/overlay/index.vue.d.ts +11 -12
- package/dist/types/__VUE/picker/Column.vue.d.ts +4 -6
- package/dist/types/__VUE/picker/index.vue.d.ts +60 -67
- package/dist/types/__VUE/popover/index.vue.d.ts +36 -139
- package/dist/types/__VUE/popup/common.d.ts +103 -0
- package/dist/types/__VUE/popup/index.vue.d.ts +55 -1591
- package/dist/types/__VUE/popup/props.d.ts +82 -0
- package/dist/types/__VUE/range/index.vue.d.ts +7 -7
- package/dist/types/__VUE/shortpassword/index.vue.d.ts +4 -4
- package/dist/types/__VUE/skeleton/common.d.ts +2 -3
- package/dist/types/__VUE/skeleton/index.vue.d.ts +2 -3
- package/dist/types/__VUE/sku/index.vue.d.ts +56 -61
- package/dist/types/__VUE/step/index.vue.d.ts +1 -1
- package/dist/types/__VUE/swiper/index.vue.d.ts +1 -1
- package/dist/types/__VUE/tabbaritem/index.vue.d.ts +2 -1
- package/dist/types/__VUE/timeselect/index.vue.d.ts +3 -3
- package/dist/types/__VUE/toast/index.vue.d.ts +1 -1
- package/dist/types/__VUE/uploader/index.vue.d.ts +15 -6
- package/dist/types/__VUE/video/index.vue.d.ts +5 -5
- package/dist/types/index.d.ts +1 -1
- package/dist/types/nutui.d.ts +1 -3
- package/package.json +3 -3
- package/dist/packages/_es/OldPicker.js +0 -486
- package/dist/packages/_es/PullRefresh.js +0 -349
- package/dist/packages/oldpicker/index.scss +0 -133
- package/dist/packages/pullrefresh/index.scss +0 -71
- package/dist/types/__VUE/addresslist/components/LongPressShell.vue.d.ts +0 -47
- package/dist/types/__VUE/datepicker/utils.d.ts +0 -5
- package/dist/types/__VUE/oldpicker/Column.vue.d.ts +0 -96
- package/dist/types/__VUE/oldpicker/commonProps.d.ts +0 -22
- package/dist/types/__VUE/oldpicker/index.vue.d.ts +0 -369
- package/dist/types/__VUE/oldpicker/types.d.ts +0 -24
- package/dist/types/__VUE/popup/use-lock-scroll.d.ts +0 -5
- package/dist/types/__VUE/pullrefresh/index.vue.d.ts +0 -128
- package/dist/types/__VUE/pullrefresh/use-touch.d.ts +0 -20
- package/dist/types/__VUE/pullrefresh/util.d.ts +0 -6
|
@@ -1,29 +1,36 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.2.
|
|
2
|
+
* @nutui/nutui v3.2.7 Fri Dec 02 2022 14:12:17 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { reactive, computed, watch, toRefs, resolveComponent, openBlock, createBlock, withCtx,
|
|
7
|
-
import { c as createComponent,
|
|
6
|
+
import { reactive, computed, watch, toRefs, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, normalizeStyle, createElementBlock, createCommentVNode, ref, onMounted, Fragment, renderList, toDisplayString, normalizeClass, createVNode, mergeProps, h } from "vue";
|
|
7
|
+
import { c as createComponent, a as preventDefault, j as isArray } from "./component.js";
|
|
8
|
+
import { u as useRect } from "./index2.js";
|
|
9
|
+
import { u as useTouch } from "./index4.js";
|
|
10
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
11
|
+
import { f as funInterceptor } from "./interceptor.js";
|
|
12
|
+
import "../locale/lang";
|
|
13
|
+
import { C as CreateComponent } from "./mountComponent.js";
|
|
8
14
|
import Popup from "./Popup.js";
|
|
9
15
|
import Video from "./Video.js";
|
|
10
16
|
import Swiper from "./Swiper.js";
|
|
11
17
|
import SwiperItem from "./SwiperItem.js";
|
|
12
18
|
import _sfc_main$2 from "./Icon.js";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import "../locale/lang";
|
|
16
|
-
import "./OverLay.js";
|
|
17
|
-
import "./pxCheck.js";
|
|
19
|
+
import OverLay from "./OverLay.js";
|
|
20
|
+
import "./props.js";
|
|
18
21
|
import "./index3.js";
|
|
22
|
+
import "./pxCheck.js";
|
|
23
|
+
const baseProps = {
|
|
24
|
+
show: { type: Boolean, default: false },
|
|
25
|
+
initNo: { type: Number, default: 0 },
|
|
26
|
+
showIndex: { type: Boolean, default: true },
|
|
27
|
+
minZoom: { type: Number, default: 1 / 3 },
|
|
28
|
+
maxZoom: { type: Number, default: 3 }
|
|
29
|
+
};
|
|
19
30
|
const { create: create$1 } = createComponent("imagepreviewitem");
|
|
20
31
|
const _sfc_main$1 = create$1({
|
|
21
32
|
props: {
|
|
22
|
-
|
|
23
|
-
type: Boolean,
|
|
24
|
-
default: false
|
|
25
|
-
},
|
|
26
|
-
initNo: Number,
|
|
33
|
+
...baseProps,
|
|
27
34
|
image: {
|
|
28
35
|
type: Object,
|
|
29
36
|
default: () => ({})
|
|
@@ -32,10 +39,6 @@ const _sfc_main$1 = create$1({
|
|
|
32
39
|
type: Object,
|
|
33
40
|
default: () => ({})
|
|
34
41
|
},
|
|
35
|
-
showIndex: {
|
|
36
|
-
type: Boolean,
|
|
37
|
-
default: true
|
|
38
|
-
},
|
|
39
42
|
rootWidth: {
|
|
40
43
|
type: Number,
|
|
41
44
|
default: 0
|
|
@@ -43,24 +46,10 @@ const _sfc_main$1 = create$1({
|
|
|
43
46
|
rootHeight: {
|
|
44
47
|
type: Number,
|
|
45
48
|
default: 0
|
|
46
|
-
},
|
|
47
|
-
minZoom: {
|
|
48
|
-
type: Number,
|
|
49
|
-
default: 1 / 3
|
|
50
|
-
},
|
|
51
|
-
maxZoom: {
|
|
52
|
-
type: Number,
|
|
53
|
-
default: 3
|
|
54
49
|
}
|
|
55
50
|
},
|
|
56
51
|
emits: ["close", "scale"],
|
|
57
|
-
components: {
|
|
58
|
-
[Popup.name]: Popup,
|
|
59
|
-
[Video.name]: Video,
|
|
60
|
-
[Swiper.name]: Swiper,
|
|
61
|
-
[SwiperItem.name]: SwiperItem,
|
|
62
|
-
[_sfc_main$2.name]: _sfc_main$2
|
|
63
|
-
},
|
|
52
|
+
components: {},
|
|
64
53
|
setup(props, { emit }) {
|
|
65
54
|
const state = reactive({
|
|
66
55
|
scale: 1,
|
|
@@ -79,16 +68,20 @@ const _sfc_main$1 = create$1({
|
|
|
79
68
|
return state.imageRatio > rootRatio;
|
|
80
69
|
});
|
|
81
70
|
const imageStyle = computed(() => {
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
71
|
+
const images = props.image;
|
|
72
|
+
if (images && images.src) {
|
|
73
|
+
const { scale, moveX, moveY, moving, zooming } = state;
|
|
74
|
+
const style = {
|
|
75
|
+
transitionDuration: zooming || moving ? "0s" : ".3s"
|
|
76
|
+
};
|
|
77
|
+
if (scale !== 1) {
|
|
78
|
+
const offsetX = moveX / scale;
|
|
79
|
+
const offsetY = moveY / scale;
|
|
80
|
+
style.transform = `scale(${scale}, ${scale}) translate(${offsetX}px, ${offsetY}px)`;
|
|
81
|
+
}
|
|
82
|
+
return style;
|
|
90
83
|
}
|
|
91
|
-
return
|
|
84
|
+
return {};
|
|
92
85
|
});
|
|
93
86
|
const maxMoveX = computed(() => {
|
|
94
87
|
if (state.imageRatio) {
|
|
@@ -198,7 +191,6 @@ const _sfc_main$1 = create$1({
|
|
|
198
191
|
}
|
|
199
192
|
};
|
|
200
193
|
const onTouchEnd = (event) => {
|
|
201
|
-
console.log("ontauchend");
|
|
202
194
|
let stopPropagation = false;
|
|
203
195
|
if (state.moving || state.zooming) {
|
|
204
196
|
stopPropagation = true;
|
|
@@ -227,17 +219,8 @@ const _sfc_main$1 = create$1({
|
|
|
227
219
|
checkTap();
|
|
228
220
|
touch.reset();
|
|
229
221
|
};
|
|
230
|
-
const preventDefault = (event, isStopPropagation) => {
|
|
231
|
-
if (typeof event.cancelable !== "boolean" || event.cancelable) {
|
|
232
|
-
event.preventDefault();
|
|
233
|
-
}
|
|
234
|
-
if (isStopPropagation) {
|
|
235
|
-
event.stopPropagation();
|
|
236
|
-
}
|
|
237
|
-
};
|
|
238
222
|
const clamp = (num, min, max) => Math.min(Math.max(num, min), max);
|
|
239
|
-
const closeSwiper = (
|
|
240
|
-
console.log("\u5173\u95ED\u89C6\u9891");
|
|
223
|
+
const closeSwiper = () => {
|
|
241
224
|
emit("close");
|
|
242
225
|
};
|
|
243
226
|
watch(() => props.initNo, resetScale);
|
|
@@ -267,8 +250,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
267
250
|
const _component_nut_swiper_item = resolveComponent("nut-swiper-item");
|
|
268
251
|
return openBlock(), createBlock(_component_nut_swiper_item, { onClick: _ctx.closeSwiper }, {
|
|
269
252
|
default: withCtx(() => [
|
|
270
|
-
|
|
271
|
-
key: 0,
|
|
253
|
+
createElementVNode("view", {
|
|
272
254
|
style: normalizeStyle(_ctx.imageStyle),
|
|
273
255
|
class: "nut-imagepreview-box",
|
|
274
256
|
onTouchstart: _cache[1] || (_cache[1] = (...args) => _ctx.onTouchStart && _ctx.onTouchStart(...args)),
|
|
@@ -276,26 +258,18 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
276
258
|
onTouchend: _cache[3] || (_cache[3] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args)),
|
|
277
259
|
onTouchcancel: _cache[4] || (_cache[4] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args))
|
|
278
260
|
}, [
|
|
279
|
-
|
|
261
|
+
_ctx.image && _ctx.image.src ? (openBlock(), createElementBlock("img", {
|
|
262
|
+
key: 0,
|
|
280
263
|
src: _ctx.image.src,
|
|
281
264
|
class: "nut-imagepreview-img",
|
|
282
265
|
onLoad: _cache[0] || (_cache[0] = (...args) => _ctx.imageLoad && _ctx.imageLoad(...args))
|
|
283
|
-
}, null, 40, _hoisted_1$1)
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
key: 1,
|
|
287
|
-
class: "nut-imagepreview-box",
|
|
288
|
-
onClick: _cache[5] || (_cache[5] = (...args) => _ctx.videoClick && _ctx.videoClick(...args)),
|
|
289
|
-
onTouchstart: _cache[6] || (_cache[6] = (...args) => _ctx.onTouchStart && _ctx.onTouchStart(...args)),
|
|
290
|
-
onTouchmove: _cache[7] || (_cache[7] = (...args) => _ctx.onTouchMove && _ctx.onTouchMove(...args)),
|
|
291
|
-
onTouchend: _cache[8] || (_cache[8] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args)),
|
|
292
|
-
onTouchcancel: _cache[9] || (_cache[9] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args))
|
|
293
|
-
}, [
|
|
294
|
-
createVNode(_component_nut_video, {
|
|
266
|
+
}, null, 40, _hoisted_1$1)) : createCommentVNode("", true),
|
|
267
|
+
_ctx.video && _ctx.video.source ? (openBlock(), createBlock(_component_nut_video, {
|
|
268
|
+
key: 1,
|
|
295
269
|
source: _ctx.video.source,
|
|
296
270
|
options: _ctx.video.options
|
|
297
|
-
}, null, 8, ["source", "options"])
|
|
298
|
-
],
|
|
271
|
+
}, null, 8, ["source", "options"])) : createCommentVNode("", true)
|
|
272
|
+
], 36)
|
|
299
273
|
]),
|
|
300
274
|
_: 1
|
|
301
275
|
}, 8, ["onClick"]);
|
|
@@ -304,46 +278,15 @@ var ImagePreviewItem = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc
|
|
|
304
278
|
const { create } = createComponent("imagepreview");
|
|
305
279
|
const _sfc_main = create({
|
|
306
280
|
props: {
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
},
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
},
|
|
315
|
-
|
|
316
|
-
type: Array,
|
|
317
|
-
default: () => []
|
|
318
|
-
},
|
|
319
|
-
contentClose: {
|
|
320
|
-
type: Boolean,
|
|
321
|
-
default: true
|
|
322
|
-
},
|
|
323
|
-
initNo: {
|
|
324
|
-
type: Number,
|
|
325
|
-
default: 1
|
|
326
|
-
},
|
|
327
|
-
paginationVisible: {
|
|
328
|
-
type: Boolean,
|
|
329
|
-
default: false
|
|
330
|
-
},
|
|
331
|
-
paginationColor: {
|
|
332
|
-
type: String,
|
|
333
|
-
default: "#fff"
|
|
334
|
-
},
|
|
335
|
-
autoplay: {
|
|
336
|
-
type: [Number, String],
|
|
337
|
-
default: 0
|
|
338
|
-
},
|
|
339
|
-
isWrapTeleport: {
|
|
340
|
-
type: Boolean,
|
|
341
|
-
default: false
|
|
342
|
-
},
|
|
343
|
-
showIndex: {
|
|
344
|
-
type: Boolean,
|
|
345
|
-
default: true
|
|
346
|
-
},
|
|
281
|
+
...baseProps,
|
|
282
|
+
images: { type: Array, default: () => [] },
|
|
283
|
+
videos: { type: Array, default: () => [] },
|
|
284
|
+
contentClose: { type: Boolean, default: true },
|
|
285
|
+
paginationVisible: { type: Boolean, default: false },
|
|
286
|
+
paginationColor: { type: String, default: "#fff" },
|
|
287
|
+
autoplay: { type: [Number, String], default: 0 },
|
|
288
|
+
teleport: { type: [String, Element], default: "body" },
|
|
289
|
+
teleportDisable: { ype: Boolean, default: false },
|
|
347
290
|
closeable: {
|
|
348
291
|
type: Boolean,
|
|
349
292
|
default: false
|
|
@@ -357,14 +300,6 @@ const _sfc_main = create({
|
|
|
357
300
|
default: "top-right"
|
|
358
301
|
},
|
|
359
302
|
beforeClose: Function,
|
|
360
|
-
minZoom: {
|
|
361
|
-
type: Number,
|
|
362
|
-
default: 1 / 3
|
|
363
|
-
},
|
|
364
|
-
maxZoom: {
|
|
365
|
-
type: Number,
|
|
366
|
-
default: 3
|
|
367
|
-
},
|
|
368
303
|
isLoop: {
|
|
369
304
|
type: Boolean,
|
|
370
305
|
default: true
|
|
@@ -372,64 +307,49 @@ const _sfc_main = create({
|
|
|
372
307
|
},
|
|
373
308
|
emits: ["close", "change"],
|
|
374
309
|
components: {
|
|
375
|
-
[Popup.name]: Popup,
|
|
376
|
-
[Video.name]: Video,
|
|
377
|
-
[Swiper.name]: Swiper,
|
|
378
|
-
[SwiperItem.name]: SwiperItem,
|
|
379
|
-
[_sfc_main$2.name]: _sfc_main$2,
|
|
380
310
|
ImagePreviewItem
|
|
381
311
|
},
|
|
382
312
|
setup(props, { emit }) {
|
|
383
313
|
const swipeRef = ref();
|
|
384
314
|
const state = reactive({
|
|
385
|
-
showPop:
|
|
386
|
-
active:
|
|
387
|
-
maxNo: 1,
|
|
315
|
+
showPop: props.show,
|
|
316
|
+
active: 0,
|
|
388
317
|
rootWidth: 0,
|
|
389
318
|
rootHeight: 0
|
|
390
319
|
});
|
|
391
|
-
const
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
320
|
+
const iconClasses = computed(() => {
|
|
321
|
+
const pre = "nut-imagepreview-close";
|
|
322
|
+
const iconn = props.closeIconPosition == "top-right" ? `${pre}-right` : `${pre}-left`;
|
|
323
|
+
return `nut-imagepreview-close-icon ${iconn}`;
|
|
324
|
+
});
|
|
325
|
+
const mergeImages = computed(() => {
|
|
326
|
+
if (isArray(props.videos)) {
|
|
327
|
+
return [].concat(props.videos).concat(props.images);
|
|
397
328
|
}
|
|
398
|
-
return
|
|
329
|
+
return props.images;
|
|
399
330
|
});
|
|
400
|
-
const
|
|
401
|
-
state.active
|
|
402
|
-
|
|
331
|
+
const setActive = (active) => {
|
|
332
|
+
if (active !== state.active) {
|
|
333
|
+
state.active = active;
|
|
334
|
+
emit("change", state.active);
|
|
335
|
+
}
|
|
403
336
|
};
|
|
404
337
|
const onClose = () => {
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
if (value) {
|
|
410
|
-
closeDone();
|
|
411
|
-
}
|
|
412
|
-
});
|
|
413
|
-
} else if (returnVal) {
|
|
414
|
-
closeDone();
|
|
415
|
-
}
|
|
416
|
-
} else {
|
|
417
|
-
closeDone();
|
|
418
|
-
}
|
|
338
|
+
funInterceptor(props.beforeClose, {
|
|
339
|
+
args: [state.active],
|
|
340
|
+
done: () => closeDone()
|
|
341
|
+
});
|
|
419
342
|
};
|
|
420
343
|
const closeDone = () => {
|
|
421
344
|
state.showPop = false;
|
|
422
|
-
state.active = 1;
|
|
423
345
|
emit("close");
|
|
424
346
|
};
|
|
425
|
-
const handleCloseIcon = () => {
|
|
426
|
-
onClose();
|
|
427
|
-
};
|
|
428
347
|
const init = () => {
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
state.
|
|
432
|
-
|
|
348
|
+
if (swipeRef.value) {
|
|
349
|
+
const rect = useRect(swipeRef.value);
|
|
350
|
+
state.rootHeight = rect.height;
|
|
351
|
+
state.rootWidth = rect.width;
|
|
352
|
+
}
|
|
433
353
|
};
|
|
434
354
|
watch(
|
|
435
355
|
() => props.show,
|
|
@@ -438,18 +358,23 @@ const _sfc_main = create({
|
|
|
438
358
|
init();
|
|
439
359
|
}
|
|
440
360
|
);
|
|
361
|
+
watch(
|
|
362
|
+
() => props.initNo,
|
|
363
|
+
(val) => {
|
|
364
|
+
if (val != state.active)
|
|
365
|
+
setActive(val);
|
|
366
|
+
}
|
|
367
|
+
);
|
|
441
368
|
onMounted(() => {
|
|
442
|
-
|
|
443
|
-
state.showPop = props.show;
|
|
444
|
-
state.maxNo = props.images.length + props.videos.length;
|
|
369
|
+
setActive(props.initNo);
|
|
445
370
|
});
|
|
446
371
|
return {
|
|
447
372
|
swipeRef,
|
|
448
373
|
...toRefs(state),
|
|
449
|
-
slideChangeEnd,
|
|
450
374
|
onClose,
|
|
451
|
-
|
|
452
|
-
|
|
375
|
+
mergeImages,
|
|
376
|
+
setActive,
|
|
377
|
+
iconClasses
|
|
453
378
|
};
|
|
454
379
|
}
|
|
455
380
|
});
|
|
@@ -467,12 +392,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
467
392
|
const _component_nut_icon = resolveComponent("nut-icon");
|
|
468
393
|
const _component_nut_popup = resolveComponent("nut-popup");
|
|
469
394
|
return openBlock(), createBlock(_component_nut_popup, {
|
|
470
|
-
"pop-class": "custom-pop",
|
|
395
|
+
"pop-class": "nut-imagepreview-custom-pop",
|
|
471
396
|
visible: _ctx.showPop,
|
|
472
397
|
"onUpdate:visible": _cache[1] || (_cache[1] = ($event) => _ctx.showPop = $event),
|
|
473
|
-
|
|
398
|
+
teleportDisable: _ctx.teleportDisable,
|
|
399
|
+
teleport: _ctx.teleport,
|
|
474
400
|
onClosed: _ctx.onClose,
|
|
475
|
-
style: { "width": "100%" },
|
|
476
401
|
"lock-scroll": ""
|
|
477
402
|
}, {
|
|
478
403
|
default: withCtx(() => [
|
|
@@ -484,97 +409,89 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
484
409
|
loop: _ctx.isLoop,
|
|
485
410
|
"is-preventDefault": false,
|
|
486
411
|
direction: "horizontal",
|
|
487
|
-
onChange: _ctx.
|
|
488
|
-
"init-page": _ctx.initNo
|
|
412
|
+
onChange: _ctx.setActive,
|
|
413
|
+
"init-page": _ctx.initNo,
|
|
489
414
|
"pagination-visible": _ctx.paginationVisible,
|
|
490
415
|
"pagination-color": _ctx.paginationColor
|
|
491
416
|
}, {
|
|
492
417
|
default: withCtx(() => [
|
|
493
|
-
|
|
418
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.mergeImages, (item, index) => {
|
|
494
419
|
return openBlock(), createBlock(_component_image_preview_item, {
|
|
495
420
|
key: index,
|
|
496
|
-
video: item,
|
|
421
|
+
video: index < _ctx.videos.length ? item : {},
|
|
422
|
+
image: index >= _ctx.videos.length ? item : {},
|
|
497
423
|
rootHeight: _ctx.rootHeight,
|
|
498
424
|
rootWidth: _ctx.rootWidth,
|
|
499
425
|
show: _ctx.showPop,
|
|
500
|
-
"init-no": _ctx.active,
|
|
426
|
+
"init-no": _ctx.active + 1,
|
|
501
427
|
onClose: _ctx.onClose,
|
|
502
428
|
maxZoom: _ctx.maxZoom,
|
|
503
429
|
minZoom: _ctx.minZoom
|
|
504
|
-
}, null, 8, ["video", "rootHeight", "rootWidth", "show", "init-no", "onClose", "maxZoom", "minZoom"]);
|
|
505
|
-
}), 128)) : createCommentVNode("", true),
|
|
506
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.images, (item, index) => {
|
|
507
|
-
return openBlock(), createBlock(_component_image_preview_item, {
|
|
508
|
-
key: index,
|
|
509
|
-
image: item,
|
|
510
|
-
rootHeight: _ctx.rootHeight,
|
|
511
|
-
rootWidth: _ctx.rootWidth,
|
|
512
|
-
show: _ctx.showPop,
|
|
513
|
-
"init-no": _ctx.active,
|
|
514
|
-
onClose: _ctx.onClose
|
|
515
|
-
}, null, 8, ["image", "rootHeight", "rootWidth", "show", "init-no", "onClose"]);
|
|
430
|
+
}, null, 8, ["video", "image", "rootHeight", "rootWidth", "show", "init-no", "onClose", "maxZoom", "minZoom"]);
|
|
516
431
|
}), 128))
|
|
517
432
|
]),
|
|
518
433
|
_: 1
|
|
519
434
|
}, 8, ["auto-play", "loop", "onChange", "init-page", "pagination-visible", "pagination-color"])) : createCommentVNode("", true)
|
|
520
435
|
], 512),
|
|
521
|
-
_ctx.showIndex ? (openBlock(), createElementBlock("view", _hoisted_2, toDisplayString(_ctx.active) + " / " + toDisplayString(_ctx.
|
|
436
|
+
_ctx.showIndex ? (openBlock(), createElementBlock("view", _hoisted_2, toDisplayString(_ctx.active + 1) + " / " + toDisplayString(_ctx.mergeImages.length), 1)) : createCommentVNode("", true),
|
|
522
437
|
_ctx.closeable ? (openBlock(), createElementBlock("view", {
|
|
523
438
|
key: 1,
|
|
524
|
-
class:
|
|
525
|
-
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.
|
|
526
|
-
style: normalizeStyle(_ctx.styles)
|
|
439
|
+
class: normalizeClass(_ctx.iconClasses),
|
|
440
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClose && _ctx.onClose(...args))
|
|
527
441
|
}, [
|
|
528
442
|
createVNode(_component_nut_icon, mergeProps({ name: _ctx.closeIcon }, _ctx.$attrs, { color: "#ffffff" }), null, 16, ["name"])
|
|
529
|
-
],
|
|
443
|
+
], 2)) : createCommentVNode("", true)
|
|
530
444
|
]),
|
|
531
445
|
_: 1
|
|
532
|
-
}, 8, ["visible", "
|
|
446
|
+
}, 8, ["visible", "teleportDisable", "teleport", "onClosed"]);
|
|
533
447
|
}
|
|
534
448
|
var ImagePreview = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
535
449
|
class ImagePreviewOptions {
|
|
536
450
|
constructor() {
|
|
537
451
|
this.show = false;
|
|
538
452
|
this.images = [];
|
|
539
|
-
this.
|
|
453
|
+
this.videos = [];
|
|
454
|
+
this.contentClose = true;
|
|
455
|
+
this.initNo = 0;
|
|
540
456
|
this.paginationVisible = false;
|
|
541
457
|
this.paginationColor = "";
|
|
542
|
-
this.
|
|
458
|
+
this.autoplay = 0;
|
|
459
|
+
this.isWrapTeleport = false;
|
|
460
|
+
this.showIndex = true;
|
|
461
|
+
this.closeable = false;
|
|
462
|
+
this.closeIcon = "circle-close";
|
|
463
|
+
this.closeIconPosition = "top-right";
|
|
464
|
+
this.maxZoom = 3;
|
|
465
|
+
this.minZoom = 1 / 3;
|
|
466
|
+
this.isLoop = true;
|
|
543
467
|
this.onClose = () => {
|
|
544
468
|
};
|
|
469
|
+
this.teleport = "body";
|
|
545
470
|
}
|
|
546
471
|
}
|
|
547
472
|
class ImagePreviewFunction {
|
|
548
473
|
constructor(_options) {
|
|
549
474
|
this.options = new ImagePreviewOptions();
|
|
550
475
|
const options = Object.assign(this.options, _options);
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
options.teleport = `#${root.id}`;
|
|
565
|
-
return () => {
|
|
566
|
-
return h(ImagePreview, options);
|
|
476
|
+
const { instance, unmount } = CreateComponent(options, {
|
|
477
|
+
name: "imagepreview",
|
|
478
|
+
components: [Popup, Video, Swiper, SwiperItem, _sfc_main$2, OverLay],
|
|
479
|
+
wrapper: () => {
|
|
480
|
+
return {
|
|
481
|
+
setup() {
|
|
482
|
+
return () => {
|
|
483
|
+
options.onClose = () => {
|
|
484
|
+
unmount();
|
|
485
|
+
};
|
|
486
|
+
return h(ImagePreview, options);
|
|
487
|
+
};
|
|
488
|
+
}
|
|
567
489
|
};
|
|
568
490
|
}
|
|
569
|
-
};
|
|
570
|
-
const instance = createVNode(Wrapper);
|
|
571
|
-
elWarp.appendChild(root);
|
|
572
|
-
render(instance, root);
|
|
491
|
+
});
|
|
573
492
|
}
|
|
574
493
|
}
|
|
575
|
-
const _ImagePreview = (options) =>
|
|
576
|
-
return new ImagePreviewFunction(options);
|
|
577
|
-
};
|
|
494
|
+
const _ImagePreview = (options) => new ImagePreviewFunction(options);
|
|
578
495
|
_ImagePreview.install = (app) => {
|
|
579
496
|
app.use(ImagePreview);
|
|
580
497
|
app.config.globalProperties.$imagepreview = _ImagePreview;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.2.
|
|
2
|
+
* @nutui/nutui v3.2.7 Fri Dec 02 2022 14:12:17 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { toRefs, computed, openBlock, createElementBlock, normalizeClass, Fragment, renderList, toDisplayString } from "vue";
|
|
7
|
-
import { c as createComponent } from "./component.js";
|
|
7
|
+
import { p as padZero, c as createComponent } from "./component.js";
|
|
8
8
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
9
|
import "../locale/lang";
|
|
10
10
|
const { componentName, create } = createComponent("indicator");
|
|
@@ -43,7 +43,7 @@ const _sfc_main = create({
|
|
|
43
43
|
[`${prefixCls}--align__${align.value}`]: block.value && align.value
|
|
44
44
|
};
|
|
45
45
|
});
|
|
46
|
-
return { classes, componentName };
|
|
46
|
+
return { classes, componentName, padZero };
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
49
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
@@ -55,7 +55,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
55
55
|
item === _ctx.current ? (openBlock(), createElementBlock("view", {
|
|
56
56
|
key: 0,
|
|
57
57
|
class: normalizeClass(`${_ctx.componentName}--number`)
|
|
58
|
-
}, toDisplayString(_ctx.fillZero && item
|
|
58
|
+
}, toDisplayString(_ctx.fillZero && _ctx.padZero(item) || item), 3)) : (openBlock(), createElementBlock("view", {
|
|
59
59
|
key: 1,
|
|
60
60
|
class: normalizeClass(`${_ctx.componentName}--dot`)
|
|
61
61
|
}, null, 2))
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.2.
|
|
2
|
+
* @nutui/nutui v3.2.7 Fri Dec 02 2022 14:12:17 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { reactive, computed, onMounted, onUnmounted, ref, onActivated, onDeactivated, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, createVNode, mergeProps, toDisplayString, renderSlot, Fragment, createCommentVNode } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { u as useTouch } from "./index4.js";
|
|
8
9
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
10
|
import "../locale/lang";
|
|
10
11
|
const { componentName, create, translate } = createComponent("infiniteloading");
|
|
@@ -57,6 +58,7 @@ const _sfc_main = create({
|
|
|
57
58
|
},
|
|
58
59
|
emits: ["scroll-change", "load-more", "refresh"],
|
|
59
60
|
setup(props, { emit, slots }) {
|
|
61
|
+
const touch = useTouch();
|
|
60
62
|
const state = reactive({
|
|
61
63
|
scrollEl: window,
|
|
62
64
|
scroller: null,
|
|
@@ -137,6 +139,7 @@ const _sfc_main = create({
|
|
|
137
139
|
state.isTouching = false;
|
|
138
140
|
};
|
|
139
141
|
const touchStart = (event) => {
|
|
142
|
+
touch.start(event);
|
|
140
143
|
if (state.beforeScrollTop == 0 && !state.isTouching && props.isOpenRefresh) {
|
|
141
144
|
state.y = event.touches[0].pageY;
|
|
142
145
|
state.isTouching = true;
|
|
@@ -145,8 +148,9 @@ const _sfc_main = create({
|
|
|
145
148
|
}
|
|
146
149
|
};
|
|
147
150
|
const touchMove = (event) => {
|
|
151
|
+
touch.move(event);
|
|
148
152
|
state.distance = event.touches[0].pageY - state.y;
|
|
149
|
-
if (state.distance > 0 && state.isTouching) {
|
|
153
|
+
if (touch.isVertical() && state.distance > 0 && state.isTouching) {
|
|
150
154
|
event.preventDefault();
|
|
151
155
|
if (state.distance >= state.refreshMaxH)
|
|
152
156
|
state.distance = state.refreshMaxH;
|
|
@@ -163,6 +167,9 @@ const _sfc_main = create({
|
|
|
163
167
|
emit("refresh", refreshDone);
|
|
164
168
|
}
|
|
165
169
|
}
|
|
170
|
+
setTimeout(() => {
|
|
171
|
+
touch.reset();
|
|
172
|
+
}, 0);
|
|
166
173
|
};
|
|
167
174
|
const getParentElement = (el) => {
|
|
168
175
|
return !!props.containerId ? document.querySelector(`#${props.containerId}`) : el && el.parentNode;
|