@nutui/nutui 4.0.10-beta.1 → 4.0.11
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 +23 -0
- package/dist/nutui.es.js +1 -1
- package/dist/nutui.js +6316 -7237
- package/dist/nutui.umd.js +1 -1
- package/dist/packages/_es/ActionSheet.js +78 -111
- package/dist/packages/_es/Address.js +250 -375
- package/dist/packages/_es/AddressList.js +269 -354
- package/dist/packages/_es/Animate.js +41 -58
- package/dist/packages/_es/Audio.js +128 -197
- package/dist/packages/_es/AudioOperate.js +60 -71
- package/dist/packages/_es/Avatar.js +66 -89
- package/dist/packages/_es/AvatarGroup.js +23 -31
- package/dist/packages/_es/Backtop.js +59 -99
- package/dist/packages/_es/Badge.js +36 -47
- package/dist/packages/_es/Barrage.js +68 -147
- package/dist/packages/_es/Button.js +47 -66
- package/dist/packages/_es/Calendar.js +135 -157
- package/dist/packages/_es/CalendarItem.js +6 -6
- package/dist/packages/_es/Card.js +42 -56
- package/dist/packages/_es/Cascader.js +315 -474
- package/dist/packages/_es/Category.js +29 -39
- package/dist/packages/_es/CategoryPane.js +57 -83
- package/dist/packages/_es/Cell.js +56 -71
- package/dist/packages/_es/CellGroup.js +19 -27
- package/dist/packages/_es/Checkbox.js +109 -156
- package/dist/packages/_es/CheckboxGroup.js +38 -59
- package/dist/packages/_es/CircleProgress.js +67 -96
- package/dist/packages/_es/Col.js +23 -31
- package/dist/packages/_es/Collapse.js +33 -58
- package/dist/packages/_es/CollapseItem.js +78 -108
- package/dist/packages/_es/Comment.js +207 -279
- package/dist/packages/_es/ConfigProvider.js +37 -55
- package/dist/packages/_es/Countdown.js +100 -212
- package/dist/packages/_es/Countup.js +232 -445
- package/dist/packages/_es/DatePicker.js +162 -265
- package/dist/packages/_es/Dialog.js +161 -213
- package/dist/packages/_es/Divider.js +42 -57
- package/dist/packages/_es/Drag.js +70 -153
- package/dist/packages/_es/Ecard.js +64 -104
- package/dist/packages/_es/Elevator.js +143 -219
- package/dist/packages/_es/Ellipsis.js +95 -178
- package/dist/packages/_es/Empty.js +23 -39
- package/dist/packages/_es/FixedNav.js +93 -116
- package/dist/packages/_es/Form.js +107 -178
- package/dist/packages/_es/FormItem.js +48 -61
- package/dist/packages/_es/Grid.js +5 -6
- package/dist/packages/_es/GridItem.js +58 -84
- package/dist/packages/_es/Image.js +90 -129
- package/dist/packages/_es/ImagePreview.js +256 -412
- package/dist/packages/_es/Indicator.js +30 -34
- package/dist/packages/_es/InfiniteLoading.js +83 -136
- package/dist/packages/_es/Input.js +160 -264
- package/dist/packages/_es/InputNumber.js +81 -117
- package/dist/packages/_es/Interceptor-6e26b757.js +18 -0
- package/dist/packages/_es/Invoice.js +104 -130
- package/dist/packages/_es/Layout.js +3 -4
- package/dist/packages/_es/List.js +117 -215
- package/dist/packages/_es/Menu.js +95 -150
- package/dist/packages/_es/MenuItem.js +109 -154
- package/dist/packages/_es/Navbar.js +103 -119
- package/dist/packages/_es/Noticebar.js +197 -312
- package/dist/packages/_es/Notify.js +110 -166
- package/dist/packages/_es/NumberKeyboard.js +127 -202
- package/dist/packages/_es/Overlay.js +52 -80
- package/dist/packages/_es/Pagination.js +70 -100
- package/dist/packages/_es/Picker.js +275 -437
- package/dist/packages/_es/Popover.js +122 -225
- package/dist/packages/_es/Popup.js +4 -4
- package/dist/packages/_es/Price.js +44 -82
- package/dist/packages/_es/Progress.js +63 -79
- package/dist/packages/_es/PullRefresh.js +95 -173
- package/dist/packages/_es/Radio.js +4 -4
- package/dist/packages/_es/RadioGroup.js +3 -3
- package/dist/packages/_es/Range.js +204 -347
- package/dist/packages/_es/Rate.js +92 -141
- package/dist/packages/_es/Row.js +21 -27
- package/dist/packages/_es/Searchbar.js +123 -174
- package/dist/packages/_es/ShortPassword.js +69 -93
- package/dist/packages/_es/SideNavbar.js +49 -80
- package/dist/packages/_es/SideNavbarItem.js +22 -32
- package/dist/packages/_es/Signature.js +83 -146
- package/dist/packages/_es/Skeleton.js +110 -130
- package/dist/packages/_es/Sku.js +250 -343
- package/dist/packages/_es/Step.js +59 -86
- package/dist/packages/_es/Steps.js +26 -31
- package/dist/packages/_es/Sticky.js +4 -4
- package/dist/packages/_es/SubSideNavbar.js +52 -74
- package/dist/packages/_es/Swipe.js +83 -155
- package/dist/packages/_es/Swiper.js +174 -311
- package/dist/packages/_es/SwiperItem.js +28 -44
- package/dist/packages/_es/Switch.js +55 -68
- package/dist/packages/_es/TabPane.js +30 -41
- package/dist/packages/_es/Tabbar.js +41 -52
- package/dist/packages/_es/TabbarItem.js +61 -82
- package/dist/packages/_es/Table.js +109 -165
- package/dist/packages/_es/Tabs.js +240 -388
- package/dist/packages/_es/Tag.js +44 -61
- package/dist/packages/_es/Textarea.js +80 -124
- package/dist/packages/_es/TimeDetail.js +49 -76
- package/dist/packages/_es/TimePannel.js +34 -48
- package/dist/packages/_es/TimeSelect.js +47 -68
- package/dist/packages/_es/Toast.js +144 -218
- package/dist/packages/_es/Tour.js +138 -192
- package/dist/packages/_es/TrendArrow.js +57 -77
- package/dist/packages/_es/Uploader.js +234 -359
- package/dist/packages/_es/Video.js +191 -316
- package/dist/packages/_es/Watermark.js +84 -117
- package/dist/packages/_es/_plugin-vue_export-helper-dad06003.js +9 -0
- package/dist/packages/_es/common-d218746f.js +116 -0
- package/dist/packages/_es/component-234624bc.js +89 -0
- package/dist/packages/_es/index-14dfadc4.js +561 -0
- package/dist/packages/_es/index-192a3ef6.js +29 -0
- package/dist/packages/_es/index-360c5092.js +210 -0
- package/dist/packages/_es/index-496e6e05.js +24 -0
- package/dist/packages/_es/index-50eed3d9.js +7 -0
- package/dist/packages/_es/index-53ec2d4d.js +34 -0
- package/dist/packages/_es/index-fadb0974.js +8 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-1139b29a.js +43 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-43b774dd.js +77 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-f44c159d.js +110 -0
- package/dist/packages/_es/mountComponent-6d4ff200.js +23 -0
- package/dist/packages/_es/pxCheck-38173291.js +4 -0
- package/dist/packages/_es/raf-a74f1a06.js +16 -0
- package/dist/packages/_es/renderIcon-47498b32.js +5 -0
- package/dist/smartips/web-types.json +1 -1
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +148 -45
- package/dist/styles/themes/jdb.scss +148 -45
- package/dist/styles/themes/jddkh.scss +148 -45
- package/dist/styles/themes/jdt.scss +148 -45
- package/dist/types/__VUE/address/index.vue.d.ts +1 -1
- package/dist/types/__VUE/collapseitem/index.vue.d.ts +110 -3
- package/dist/types/__VUE/image/index.vue.d.ts +2 -2
- package/dist/types/__VUE/rate/index.vue.d.ts +110 -3
- package/dist/types/__VUE/searchbar/index.vue.d.ts +110 -3
- package/dist/types/__VUE/skeleton/index.vue.d.ts +2 -2
- package/dist/types/__VUE/swiper/index.vue.d.ts +1 -1
- package/dist/types/__VUE/table/common.d.ts +55 -2
- package/dist/types/__VUE/timeselect/index.vue.d.ts +1 -1
- package/dist/types/__VUE/watermark/index.vue.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
- package/dist/packages/_es/Interceptor-956b24fc.js +0 -29
- package/dist/packages/_es/_plugin-vue_export-helper-cc2b3d55.js +0 -10
- package/dist/packages/_es/common-b9a5e726.js +0 -145
- package/dist/packages/_es/component-81a4c1d0.js +0 -145
- package/dist/packages/_es/index-29892cda.js +0 -33
- package/dist/packages/_es/index-43c34ac6.js +0 -30
- package/dist/packages/_es/index-54d03fc1.js +0 -8
- package/dist/packages/_es/index-79c5dc33.js +0 -10
- package/dist/packages/_es/index-7a7385e4.js +0 -67
- package/dist/packages/_es/index-87422be8.js +0 -942
- package/dist/packages/_es/index-da0a7662.js +0 -259
- package/dist/packages/_es/index.vue_vue_type_script_lang-22dfc112.js +0 -46
- package/dist/packages/_es/index.vue_vue_type_script_lang-442e4704.js +0 -98
- package/dist/packages/_es/index.vue_vue_type_script_lang-cc5c4086.js +0 -151
- package/dist/packages/_es/mountComponent-8b24c346.js +0 -39
- package/dist/packages/_es/pxCheck-c6b9f6b7.js +0 -6
- package/dist/packages/_es/raf-729dad54.js +0 -25
- package/dist/packages/_es/renderIcon-3d0fd47c.js +0 -9
|
@@ -1,53 +1,40 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
25
|
-
import { reactive, computed, watch, toRefs, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, normalizeStyle, createElementBlock, createCommentVNode, ref, onMounted, Fragment, renderList, toDisplayString, normalizeClass, renderSlot, createVNode, nextTick, h } from "vue";
|
|
26
|
-
import { c as createComponent, e as clamp, d as preventDefault, i as isArray } from "./component-81a4c1d0.js";
|
|
27
|
-
import { u as useRect } from "./index-29892cda.js";
|
|
28
|
-
import { u as useTouch } from "./index-7a7385e4.js";
|
|
29
|
-
import Video from "./Video.js";
|
|
30
|
-
import SwiperItem from "./SwiperItem.js";
|
|
31
|
-
import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
|
|
32
|
-
import { CircleClose } from "@nutui/icons-vue";
|
|
33
|
-
import { P as Popup } from "./index-da0a7662.js";
|
|
34
|
-
import Swiper from "./Swiper.js";
|
|
35
|
-
import { f as funInterceptor } from "./Interceptor-956b24fc.js";
|
|
1
|
+
var re = Object.defineProperty, me = Object.defineProperties;
|
|
2
|
+
var ce = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var j = Object.getOwnPropertySymbols;
|
|
4
|
+
var ue = Object.prototype.hasOwnProperty, pe = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var M = Math.pow, H = (e, t, o) => t in e ? re(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o, S = (e, t) => {
|
|
6
|
+
for (var o in t || (t = {}))
|
|
7
|
+
ue.call(t, o) && H(e, o, t[o]);
|
|
8
|
+
if (j)
|
|
9
|
+
for (var o of j(t))
|
|
10
|
+
pe.call(t, o) && H(e, o, t[o]);
|
|
11
|
+
return e;
|
|
12
|
+
}, P = (e, t) => me(e, ce(t));
|
|
13
|
+
var l = (e, t, o) => (H(e, typeof t != "symbol" ? t + "" : t, o), o);
|
|
14
|
+
import { reactive as G, computed as w, watch as Z, toRefs as J, resolveComponent as y, openBlock as p, createBlock as I, withCtx as R, createElementVNode as K, normalizeStyle as fe, createElementBlock as k, createCommentVNode as N, ref as ge, onMounted as ve, Fragment as de, renderList as he, toDisplayString as q, normalizeClass as we, renderSlot as ye, createVNode as Ce, nextTick as be, h as Te } from "vue";
|
|
15
|
+
import { c as Q, e as $, d as U, i as Se } from "./component-234624bc.js";
|
|
16
|
+
import { u as Pe } from "./index-192a3ef6.js";
|
|
17
|
+
import { u as $e } from "./index-53ec2d4d.js";
|
|
18
|
+
import B from "./Video.js";
|
|
19
|
+
import E from "./SwiperItem.js";
|
|
20
|
+
import { _ } from "./_plugin-vue_export-helper-dad06003.js";
|
|
21
|
+
import { CircleClose as Ie } from "@nutui/icons-vue";
|
|
22
|
+
import { P as L } from "./index-360c5092.js";
|
|
23
|
+
import A from "./Swiper.js";
|
|
24
|
+
import { f as Ne } from "./Interceptor-6e26b757.js";
|
|
36
25
|
import "../locale/lang";
|
|
37
|
-
import { C as
|
|
38
|
-
import
|
|
39
|
-
import "./index-
|
|
40
|
-
import "./raf-
|
|
41
|
-
const
|
|
42
|
-
show: { type: Boolean, default:
|
|
26
|
+
import { C as Xe } from "./mountComponent-6d4ff200.js";
|
|
27
|
+
import Ye from "./Overlay.js";
|
|
28
|
+
import "./index-fadb0974.js";
|
|
29
|
+
import "./raf-a74f1a06.js";
|
|
30
|
+
const x = {
|
|
31
|
+
show: { type: Boolean, default: !1 },
|
|
43
32
|
initNo: { type: Number, default: 0 },
|
|
44
|
-
showIndex: { type: Boolean, default:
|
|
33
|
+
showIndex: { type: Boolean, default: !0 },
|
|
45
34
|
minZoom: { type: Number, default: 1 / 3 },
|
|
46
35
|
maxZoom: { type: Number, default: 3 }
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const _sfc_main$1 = create$1({
|
|
50
|
-
props: __spreadProps(__spreadValues({}, baseProps), {
|
|
36
|
+
}, { create: ke } = Q("image-preview-item"), Ze = ke({
|
|
37
|
+
props: P(S({}, x), {
|
|
51
38
|
image: {
|
|
52
39
|
type: Object,
|
|
53
40
|
default: () => ({})
|
|
@@ -66,253 +53,150 @@ const _sfc_main$1 = create$1({
|
|
|
66
53
|
},
|
|
67
54
|
contentClose: {
|
|
68
55
|
type: Boolean,
|
|
69
|
-
default:
|
|
56
|
+
default: !0
|
|
70
57
|
}
|
|
71
58
|
}),
|
|
72
59
|
emits: ["close", "scale"],
|
|
73
60
|
components: {
|
|
74
|
-
[
|
|
75
|
-
[
|
|
61
|
+
[B.name]: B,
|
|
62
|
+
[E.name]: E
|
|
76
63
|
},
|
|
77
|
-
setup(
|
|
78
|
-
const
|
|
64
|
+
setup(e, { emit: t }) {
|
|
65
|
+
const o = G({
|
|
79
66
|
scale: 1,
|
|
80
67
|
moveX: 0,
|
|
81
68
|
moveY: 0,
|
|
82
|
-
moving:
|
|
83
|
-
zooming:
|
|
69
|
+
moving: !1,
|
|
70
|
+
zooming: !1,
|
|
84
71
|
imageRatio: 0,
|
|
85
72
|
displayWidth: 0,
|
|
86
73
|
displayHeight: 0
|
|
87
|
-
})
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
const images = props.image;
|
|
96
|
-
if (images && images.src) {
|
|
97
|
-
const { scale, moveX, moveY, moving, zooming } = state;
|
|
98
|
-
const style = {
|
|
99
|
-
transitionDuration: zooming || moving ? "0s" : ".3s"
|
|
74
|
+
}), a = $e(), v = w(() => {
|
|
75
|
+
const { rootWidth: n, rootHeight: s } = e, r = s / n;
|
|
76
|
+
return o.imageRatio > r;
|
|
77
|
+
}), C = w(() => {
|
|
78
|
+
const n = e.image;
|
|
79
|
+
if (n && n.src) {
|
|
80
|
+
const { scale: s, moveX: r, moveY: f, moving: h, zooming: z } = o, F = {
|
|
81
|
+
transitionDuration: z || h ? "0s" : ".3s"
|
|
100
82
|
};
|
|
101
|
-
if (
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
style.transform = `scale(${scale}, ${scale}) translate(${offsetX}px, ${offsetY}px)`;
|
|
83
|
+
if (s !== 1) {
|
|
84
|
+
const ae = r / s, le = f / s;
|
|
85
|
+
F.transform = `scale(${s}, ${s}) translate(${ae}px, ${le}px)`;
|
|
105
86
|
}
|
|
106
|
-
return
|
|
87
|
+
return F;
|
|
107
88
|
}
|
|
108
89
|
return {};
|
|
109
|
-
})
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
const displayWidth = vertical.value ? rootHeight / state.imageRatio : rootWidth;
|
|
114
|
-
return Math.max(0, (state.scale * displayWidth - rootWidth) / 2);
|
|
90
|
+
}), c = w(() => {
|
|
91
|
+
if (o.imageRatio) {
|
|
92
|
+
const { rootWidth: n, rootHeight: s } = e, r = v.value ? s / o.imageRatio : n;
|
|
93
|
+
return Math.max(0, (o.scale * r - n) / 2);
|
|
115
94
|
}
|
|
116
95
|
return 0;
|
|
117
|
-
})
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
const displayHeight = vertical.value ? rootHeight : rootWidth * state.imageRatio;
|
|
122
|
-
return Math.max(0, (state.scale * displayHeight - rootHeight) / 2);
|
|
96
|
+
}), u = w(() => {
|
|
97
|
+
if (o.imageRatio) {
|
|
98
|
+
const { rootWidth: n, rootHeight: s } = e, r = v.value ? s : n * o.imageRatio;
|
|
99
|
+
return Math.max(0, (o.scale * r - s) / 2);
|
|
123
100
|
}
|
|
124
101
|
return 0;
|
|
125
|
-
})
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
102
|
+
}), m = (n) => {
|
|
103
|
+
const { naturalWidth: s, naturalHeight: r } = n.target;
|
|
104
|
+
o.imageRatio = r / s;
|
|
105
|
+
}, g = () => {
|
|
106
|
+
i(1), o.moveX = 0, o.moveY = 0;
|
|
107
|
+
}, i = (n) => {
|
|
108
|
+
n = $(n, +e.minZoom, +e.maxZoom + 1), n !== o.scale && (o.scale = n, t("scale", {
|
|
109
|
+
scale: n,
|
|
110
|
+
index: e.initNo
|
|
111
|
+
}));
|
|
112
|
+
}, d = () => {
|
|
113
|
+
const n = o.scale > 1 ? 1 : 2;
|
|
114
|
+
i(n), o.moveX = 0, o.moveY = 0;
|
|
115
|
+
}, D = (n) => Math.sqrt(M(n[0].clientX - n[1].clientX, 2) + M(n[0].clientY - n[1].clientY, 2));
|
|
116
|
+
let X, Y, W, V, b, O, T;
|
|
117
|
+
const oe = (n) => {
|
|
118
|
+
const { touches: s } = n, { offsetX: r } = a;
|
|
119
|
+
a.start(n), T = s.length, X = o.moveX, Y = o.moveY, O = Date.now(), o.moving = T === 1 && o.scale !== 1, o.zooming = T === 2 && !r.value, o.zooming && (W = o.scale, V = D(n.touches));
|
|
120
|
+
}, te = (n) => {
|
|
121
|
+
const { touches: s } = n;
|
|
122
|
+
if (a.move(n), (o.moving || o.zooming) && U(n, !0), o.moving) {
|
|
123
|
+
const { deltaX: r, deltaY: f } = a, h = r.value + X, z = f.value + Y;
|
|
124
|
+
o.moveX = $(h, -c.value, c.value), o.moveY = $(z, -u.value, u.value);
|
|
143
125
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
setScale(scale);
|
|
148
|
-
state.moveX = 0;
|
|
149
|
-
state.moveY = 0;
|
|
150
|
-
};
|
|
151
|
-
const getDistance = (touches) => Math.sqrt(__pow(touches[0].clientX - touches[1].clientX, 2) + __pow(touches[0].clientY - touches[1].clientY, 2));
|
|
152
|
-
let startMoveX;
|
|
153
|
-
let startMoveY;
|
|
154
|
-
let startScale;
|
|
155
|
-
let startDistance;
|
|
156
|
-
let doubleTapTimer;
|
|
157
|
-
let touchStartTime;
|
|
158
|
-
let fingerNum;
|
|
159
|
-
const onTouchStart = (event) => {
|
|
160
|
-
const { touches } = event;
|
|
161
|
-
const { offsetX } = touch;
|
|
162
|
-
touch.start(event);
|
|
163
|
-
fingerNum = touches.length;
|
|
164
|
-
startMoveX = state.moveX;
|
|
165
|
-
startMoveY = state.moveY;
|
|
166
|
-
touchStartTime = Date.now();
|
|
167
|
-
state.moving = fingerNum === 1 && state.scale !== 1;
|
|
168
|
-
state.zooming = fingerNum === 2 && !offsetX.value;
|
|
169
|
-
if (state.zooming) {
|
|
170
|
-
startScale = state.scale;
|
|
171
|
-
startDistance = getDistance(event.touches);
|
|
172
|
-
}
|
|
173
|
-
};
|
|
174
|
-
const onTouchMove = (event) => {
|
|
175
|
-
const { touches } = event;
|
|
176
|
-
touch.move(event);
|
|
177
|
-
if (state.moving || state.zooming) {
|
|
178
|
-
preventDefault(event, true);
|
|
179
|
-
}
|
|
180
|
-
if (state.moving) {
|
|
181
|
-
const { deltaX, deltaY } = touch;
|
|
182
|
-
const moveX = deltaX.value + startMoveX;
|
|
183
|
-
const moveY = deltaY.value + startMoveY;
|
|
184
|
-
state.moveX = clamp(moveX, -maxMoveX.value, maxMoveX.value);
|
|
185
|
-
state.moveY = clamp(moveY, -maxMoveY.value, maxMoveY.value);
|
|
186
|
-
}
|
|
187
|
-
if (state.zooming && touches.length === 2) {
|
|
188
|
-
const distance = getDistance(touches);
|
|
189
|
-
const scale = startScale * distance / startDistance;
|
|
190
|
-
setScale(scale);
|
|
126
|
+
if (o.zooming && s.length === 2) {
|
|
127
|
+
const r = D(s), f = W * r / V;
|
|
128
|
+
i(f);
|
|
191
129
|
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
if (fingerNum == 1 && props.video && props.video.source) {
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
if (fingerNum > 1) {
|
|
130
|
+
}, ne = () => {
|
|
131
|
+
if (T == 1 && e.video && e.video.source || T > 1)
|
|
198
132
|
return;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
toggleScale();
|
|
209
|
-
} else {
|
|
210
|
-
doubleTapTimer = setTimeout(() => {
|
|
211
|
-
if (props.contentClose) {
|
|
212
|
-
emit("close");
|
|
213
|
-
}
|
|
214
|
-
doubleTapTimer = null;
|
|
215
|
-
}, TAP_TIME);
|
|
216
|
-
}
|
|
217
|
-
}
|
|
133
|
+
const { offsetX: n, offsetY: s } = a, r = Date.now() - O, f = 250, h = 5;
|
|
134
|
+
n.value < h && s.value < h && r < f && (b ? (clearTimeout(b), b = null, d()) : b = setTimeout(() => {
|
|
135
|
+
e.contentClose && t("close"), b = null;
|
|
136
|
+
}, f));
|
|
137
|
+
}, ie = (n) => {
|
|
138
|
+
let s = !1;
|
|
139
|
+
(o.moving || o.zooming) && (s = !0, o.moving && X === o.moveX && Y === o.moveY && (s = !1), n.touches.length || (o.zooming && (o.moveX = $(o.moveX, -c.value, c.value), o.moveY = $(o.moveY, -u.value, u.value), o.zooming = !1), o.moving = !1, X = 0, Y = 0, W = 1, o.scale < 1 && g(), o.scale > e.maxZoom && (o.scale = +e.maxZoom))), U(n, s), ne(), a.reset();
|
|
140
|
+
}, se = () => {
|
|
141
|
+
t("close");
|
|
218
142
|
};
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
if (state.moving && startMoveX === state.moveX && startMoveY === state.moveY) {
|
|
224
|
-
stopPropagation = false;
|
|
225
|
-
}
|
|
226
|
-
if (!event.touches.length) {
|
|
227
|
-
if (state.zooming) {
|
|
228
|
-
state.moveX = clamp(state.moveX, -maxMoveX.value, maxMoveX.value);
|
|
229
|
-
state.moveY = clamp(state.moveY, -maxMoveY.value, maxMoveY.value);
|
|
230
|
-
state.zooming = false;
|
|
231
|
-
}
|
|
232
|
-
state.moving = false;
|
|
233
|
-
startMoveX = 0;
|
|
234
|
-
startMoveY = 0;
|
|
235
|
-
startScale = 1;
|
|
236
|
-
if (state.scale < 1) {
|
|
237
|
-
resetScale();
|
|
238
|
-
}
|
|
239
|
-
if (state.scale > props.maxZoom) {
|
|
240
|
-
state.scale = +props.maxZoom;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
143
|
+
return Z(() => e.initNo, g), Z(
|
|
144
|
+
() => e.show,
|
|
145
|
+
(n) => {
|
|
146
|
+
n || g();
|
|
243
147
|
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
watch(
|
|
253
|
-
() => props.show,
|
|
254
|
-
(value) => {
|
|
255
|
-
if (!value) {
|
|
256
|
-
resetScale();
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
);
|
|
260
|
-
return __spreadProps(__spreadValues({}, toRefs(state)), {
|
|
261
|
-
onTouchStart,
|
|
262
|
-
onTouchMove,
|
|
263
|
-
onTouchEnd,
|
|
264
|
-
getDistance,
|
|
265
|
-
imageStyle,
|
|
266
|
-
imageLoad,
|
|
267
|
-
closeSwiper
|
|
148
|
+
), P(S({}, J(o)), {
|
|
149
|
+
onTouchStart: oe,
|
|
150
|
+
onTouchMove: te,
|
|
151
|
+
onTouchEnd: ie,
|
|
152
|
+
getDistance: D,
|
|
153
|
+
imageStyle: C,
|
|
154
|
+
imageLoad: m,
|
|
155
|
+
closeSwiper: se
|
|
268
156
|
});
|
|
269
157
|
}
|
|
270
|
-
});
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
createElementVNode("view", {
|
|
278
|
-
style: normalizeStyle(_ctx.imageStyle),
|
|
158
|
+
}), De = ["src"];
|
|
159
|
+
function We(e, t, o, a, v, C) {
|
|
160
|
+
const c = y("nut-video"), u = y("nut-swiper-item");
|
|
161
|
+
return p(), I(u, { onClick: e.closeSwiper }, {
|
|
162
|
+
default: R(() => [
|
|
163
|
+
K("view", {
|
|
164
|
+
style: fe(e.imageStyle),
|
|
279
165
|
class: "nut-image-preview-box",
|
|
280
|
-
onTouchstart:
|
|
281
|
-
onTouchmove:
|
|
282
|
-
onTouchend:
|
|
283
|
-
onTouchcancel:
|
|
166
|
+
onTouchstart: t[1] || (t[1] = (...m) => e.onTouchStart && e.onTouchStart(...m)),
|
|
167
|
+
onTouchmove: t[2] || (t[2] = (...m) => e.onTouchMove && e.onTouchMove(...m)),
|
|
168
|
+
onTouchend: t[3] || (t[3] = (...m) => e.onTouchEnd && e.onTouchEnd(...m)),
|
|
169
|
+
onTouchcancel: t[4] || (t[4] = (...m) => e.onTouchEnd && e.onTouchEnd(...m))
|
|
284
170
|
}, [
|
|
285
|
-
|
|
171
|
+
e.image && e.image.src ? (p(), k("img", {
|
|
286
172
|
key: 0,
|
|
287
|
-
src:
|
|
173
|
+
src: e.image.src,
|
|
288
174
|
class: "nut-image-preview-img",
|
|
289
|
-
onLoad:
|
|
290
|
-
}, null, 40,
|
|
291
|
-
|
|
175
|
+
onLoad: t[0] || (t[0] = (...m) => e.imageLoad && e.imageLoad(...m))
|
|
176
|
+
}, null, 40, De)) : N("", !0),
|
|
177
|
+
e.video && e.video.source ? (p(), I(c, {
|
|
292
178
|
key: 1,
|
|
293
|
-
source:
|
|
294
|
-
options:
|
|
295
|
-
}, null, 8, ["source", "options"])) :
|
|
179
|
+
source: e.video.source,
|
|
180
|
+
options: e.video.options
|
|
181
|
+
}, null, 8, ["source", "options"])) : N("", !0)
|
|
296
182
|
], 36)
|
|
297
183
|
]),
|
|
298
184
|
_: 1
|
|
299
185
|
}, 8, ["onClick"]);
|
|
300
186
|
}
|
|
301
|
-
const
|
|
302
|
-
|
|
303
|
-
const _sfc_main = create({
|
|
304
|
-
props: __spreadProps(__spreadValues({}, baseProps), {
|
|
187
|
+
const ze = /* @__PURE__ */ _(Ze, [["render", We]]), { create: He } = Q("image-preview"), Me = He({
|
|
188
|
+
props: P(S({}, x), {
|
|
305
189
|
images: { type: Array, default: () => [] },
|
|
306
190
|
videos: { type: Array, default: () => [] },
|
|
307
|
-
contentClose: { type: Boolean, default:
|
|
308
|
-
paginationVisible: { type: Boolean, default:
|
|
191
|
+
contentClose: { type: Boolean, default: !0 },
|
|
192
|
+
paginationVisible: { type: Boolean, default: !1 },
|
|
309
193
|
paginationColor: { type: String, default: "#fff" },
|
|
310
194
|
autoplay: { type: [Number, String], default: 0 },
|
|
311
195
|
teleport: { type: [String, Element], default: "body" },
|
|
312
|
-
teleportDisable: { ype: Boolean, default:
|
|
196
|
+
teleportDisable: { ype: Boolean, default: !1 },
|
|
313
197
|
closeable: {
|
|
314
198
|
type: Boolean,
|
|
315
|
-
default:
|
|
199
|
+
default: !1
|
|
316
200
|
},
|
|
317
201
|
closeIconPosition: {
|
|
318
202
|
type: String,
|
|
@@ -322,212 +206,172 @@ const _sfc_main = create({
|
|
|
322
206
|
beforeClose: Function,
|
|
323
207
|
isLoop: {
|
|
324
208
|
type: Boolean,
|
|
325
|
-
default:
|
|
209
|
+
default: !0
|
|
326
210
|
}
|
|
327
211
|
}),
|
|
328
212
|
emits: ["close", "change"],
|
|
329
213
|
components: {
|
|
330
|
-
ImagePreviewItem,
|
|
331
|
-
CircleClose,
|
|
332
|
-
[
|
|
333
|
-
[
|
|
214
|
+
ImagePreviewItem: ze,
|
|
215
|
+
CircleClose: Ie,
|
|
216
|
+
[L.name]: L,
|
|
217
|
+
[A.name]: A
|
|
334
218
|
},
|
|
335
|
-
setup(
|
|
336
|
-
const
|
|
337
|
-
|
|
338
|
-
showPop: props.show,
|
|
219
|
+
setup(e, { emit: t }) {
|
|
220
|
+
const o = ge(), a = G({
|
|
221
|
+
showPop: e.show,
|
|
339
222
|
active: 0,
|
|
340
223
|
rootWidth: 0,
|
|
341
224
|
rootHeight: 0
|
|
342
|
-
})
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
})
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
}
|
|
352
|
-
return props.images;
|
|
353
|
-
});
|
|
354
|
-
const setActive = (active) => {
|
|
355
|
-
if (active !== state.active) {
|
|
356
|
-
state.active = active;
|
|
357
|
-
emit("change", state.active);
|
|
358
|
-
}
|
|
359
|
-
};
|
|
360
|
-
const onClose = () => {
|
|
361
|
-
funInterceptor(props.beforeClose, {
|
|
362
|
-
args: [state.active],
|
|
363
|
-
done: () => closeDone()
|
|
225
|
+
}), v = w(() => {
|
|
226
|
+
const i = "nut-image-preview-close";
|
|
227
|
+
return `nut-image-preview-close-icon ${e.closeIconPosition == "top-right" ? `${i}-right` : `${i}-left`}`;
|
|
228
|
+
}), C = w(() => Se(e.videos) ? [].concat(e.videos).concat(e.images) : e.images), c = (i) => {
|
|
229
|
+
i !== a.active && (a.active = i, t("change", a.active));
|
|
230
|
+
}, u = () => {
|
|
231
|
+
Ne(e.beforeClose, {
|
|
232
|
+
args: [a.active],
|
|
233
|
+
done: () => m()
|
|
364
234
|
});
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
if (swipeRef.value) {
|
|
372
|
-
const rect = useRect(swipeRef.value);
|
|
373
|
-
state.rootHeight = rect.height;
|
|
374
|
-
state.rootWidth = rect.width;
|
|
235
|
+
}, m = () => {
|
|
236
|
+
a.showPop = !1, t("close");
|
|
237
|
+
}, g = () => {
|
|
238
|
+
if (o.value) {
|
|
239
|
+
const i = Pe(o.value);
|
|
240
|
+
a.rootHeight = i.height, a.rootWidth = i.width;
|
|
375
241
|
}
|
|
376
242
|
};
|
|
377
|
-
|
|
378
|
-
() =>
|
|
379
|
-
(
|
|
380
|
-
|
|
381
|
-
if (val) {
|
|
382
|
-
setActive(props.initNo);
|
|
383
|
-
init();
|
|
384
|
-
}
|
|
243
|
+
return Z(
|
|
244
|
+
() => e.show,
|
|
245
|
+
(i) => {
|
|
246
|
+
a.showPop = i, i && (c(e.initNo), g());
|
|
385
247
|
}
|
|
386
|
-
)
|
|
387
|
-
|
|
388
|
-
() =>
|
|
389
|
-
|
|
390
|
-
if (val != state.active)
|
|
391
|
-
setActive(val);
|
|
248
|
+
), Z(
|
|
249
|
+
() => e.initNo,
|
|
250
|
+
(i) => {
|
|
251
|
+
i != a.active && c(i);
|
|
392
252
|
}
|
|
393
|
-
)
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
setActive,
|
|
403
|
-
iconClasses
|
|
253
|
+
), ve(() => {
|
|
254
|
+
c(e.initNo);
|
|
255
|
+
}), P(S({
|
|
256
|
+
swipeRef: o
|
|
257
|
+
}, J(a)), {
|
|
258
|
+
onClose: u,
|
|
259
|
+
mergeImages: C,
|
|
260
|
+
setActive: c,
|
|
261
|
+
iconClasses: v
|
|
404
262
|
});
|
|
405
263
|
}
|
|
406
|
-
})
|
|
407
|
-
const _hoisted_1 = {
|
|
264
|
+
}), Re = {
|
|
408
265
|
class: "nut-image-preview",
|
|
409
266
|
ref: "swipeRef"
|
|
410
|
-
}
|
|
411
|
-
const _hoisted_2 = {
|
|
267
|
+
}, Be = {
|
|
412
268
|
key: 0,
|
|
413
269
|
class: "nut-image-preview-index"
|
|
414
270
|
};
|
|
415
|
-
function
|
|
416
|
-
const
|
|
417
|
-
|
|
418
|
-
const _component_CircleClose = resolveComponent("CircleClose");
|
|
419
|
-
const _component_nut_popup = resolveComponent("nut-popup");
|
|
420
|
-
return openBlock(), createBlock(_component_nut_popup, {
|
|
271
|
+
function Ee(e, t, o, a, v, C) {
|
|
272
|
+
const c = y("image-preview-item"), u = y("nut-swiper"), m = y("CircleClose"), g = y("nut-popup");
|
|
273
|
+
return p(), I(g, {
|
|
421
274
|
"pop-class": "nut-image-preview-custom-pop",
|
|
422
|
-
visible:
|
|
423
|
-
"onUpdate:visible":
|
|
424
|
-
teleportDisable:
|
|
425
|
-
teleport:
|
|
426
|
-
onClosed:
|
|
275
|
+
visible: e.showPop,
|
|
276
|
+
"onUpdate:visible": t[1] || (t[1] = (i) => e.showPop = i),
|
|
277
|
+
teleportDisable: e.teleportDisable,
|
|
278
|
+
teleport: e.teleport,
|
|
279
|
+
onClosed: e.onClose,
|
|
427
280
|
"lock-scroll": ""
|
|
428
281
|
}, {
|
|
429
|
-
default:
|
|
430
|
-
|
|
431
|
-
|
|
282
|
+
default: R(() => [
|
|
283
|
+
K("view", Re, [
|
|
284
|
+
e.showPop ? (p(), I(u, {
|
|
432
285
|
key: 0,
|
|
433
|
-
"auto-play":
|
|
286
|
+
"auto-play": e.autoplay,
|
|
434
287
|
class: "nut-image-preview-swiper",
|
|
435
|
-
loop:
|
|
436
|
-
"is-preventDefault":
|
|
288
|
+
loop: e.isLoop,
|
|
289
|
+
"is-preventDefault": !1,
|
|
437
290
|
direction: "horizontal",
|
|
438
|
-
onChange:
|
|
439
|
-
"init-page":
|
|
440
|
-
"pagination-visible":
|
|
441
|
-
"pagination-color":
|
|
291
|
+
onChange: e.setActive,
|
|
292
|
+
"init-page": e.initNo,
|
|
293
|
+
"pagination-visible": e.paginationVisible,
|
|
294
|
+
"pagination-color": e.paginationColor
|
|
442
295
|
}, {
|
|
443
|
-
default:
|
|
444
|
-
(
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
}, null, 8, ["video", "image", "rootHeight", "rootWidth", "show", "init-no", "onClose", "content-close", "maxZoom", "minZoom"]);
|
|
458
|
-
}), 128))
|
|
296
|
+
default: R(() => [
|
|
297
|
+
(p(!0), k(de, null, he(e.mergeImages, (i, d) => (p(), I(c, {
|
|
298
|
+
key: d,
|
|
299
|
+
video: d < e.videos.length ? i : {},
|
|
300
|
+
image: d >= e.videos.length ? i : {},
|
|
301
|
+
rootHeight: e.rootHeight,
|
|
302
|
+
rootWidth: e.rootWidth,
|
|
303
|
+
show: e.showPop,
|
|
304
|
+
"init-no": e.active + 1,
|
|
305
|
+
onClose: e.onClose,
|
|
306
|
+
"content-close": e.contentClose,
|
|
307
|
+
maxZoom: e.maxZoom,
|
|
308
|
+
minZoom: e.minZoom
|
|
309
|
+
}, null, 8, ["video", "image", "rootHeight", "rootWidth", "show", "init-no", "onClose", "content-close", "maxZoom", "minZoom"]))), 128))
|
|
459
310
|
]),
|
|
460
311
|
_: 1
|
|
461
|
-
}, 8, ["auto-play", "loop", "onChange", "init-page", "pagination-visible", "pagination-color"])) :
|
|
312
|
+
}, 8, ["auto-play", "loop", "onChange", "init-page", "pagination-visible", "pagination-color"])) : N("", !0)
|
|
462
313
|
], 512),
|
|
463
|
-
|
|
464
|
-
|
|
314
|
+
e.showIndex ? (p(), k("view", Be, q(e.active + 1) + " / " + q(e.mergeImages.length), 1)) : N("", !0),
|
|
315
|
+
e.closeable ? (p(), k("view", {
|
|
465
316
|
key: 1,
|
|
466
|
-
class:
|
|
467
|
-
onClick:
|
|
317
|
+
class: we(e.iconClasses),
|
|
318
|
+
onClick: t[0] || (t[0] = (...i) => e.onClose && e.onClose(...i))
|
|
468
319
|
}, [
|
|
469
|
-
|
|
470
|
-
|
|
320
|
+
ye(e.$slots, "close-icon", {}, () => [
|
|
321
|
+
Ce(m, { color: "#ffffff" })
|
|
471
322
|
])
|
|
472
|
-
], 2)) :
|
|
323
|
+
], 2)) : N("", !0)
|
|
473
324
|
]),
|
|
474
325
|
_: 3
|
|
475
326
|
}, 8, ["visible", "teleportDisable", "teleport", "onClosed"]);
|
|
476
327
|
}
|
|
477
|
-
const
|
|
478
|
-
class
|
|
328
|
+
const ee = /* @__PURE__ */ _(Me, [["render", Ee]]);
|
|
329
|
+
class Le {
|
|
479
330
|
constructor() {
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
331
|
+
l(this, "show", !1);
|
|
332
|
+
l(this, "images", []);
|
|
333
|
+
l(this, "videos", []);
|
|
334
|
+
l(this, "contentClose", !0);
|
|
335
|
+
l(this, "initNo", 0);
|
|
336
|
+
l(this, "paginationVisible", !1);
|
|
337
|
+
l(this, "paginationColor", "");
|
|
338
|
+
l(this, "autoplay", 0);
|
|
339
|
+
l(this, "isWrapTeleport", !1);
|
|
340
|
+
l(this, "showIndex", !0);
|
|
341
|
+
l(this, "closeable", !1);
|
|
342
|
+
l(this, "closeIcon", "circle-close");
|
|
343
|
+
l(this, "closeIconPosition", "top-right");
|
|
344
|
+
l(this, "beforeClose");
|
|
345
|
+
l(this, "maxZoom", 3);
|
|
346
|
+
l(this, "minZoom", 1 / 3);
|
|
347
|
+
l(this, "isLoop", !0);
|
|
348
|
+
l(this, "teleport", "body");
|
|
498
349
|
}
|
|
499
350
|
}
|
|
500
|
-
class
|
|
501
|
-
constructor(
|
|
502
|
-
|
|
503
|
-
const
|
|
504
|
-
const { unmount } = CreateComponent(options, {
|
|
351
|
+
class Ae {
|
|
352
|
+
constructor(t) {
|
|
353
|
+
l(this, "options", new Le());
|
|
354
|
+
const o = Object.assign(this.options, t), { unmount: a } = Xe(o, {
|
|
505
355
|
name: "image-preview",
|
|
506
|
-
components: [
|
|
507
|
-
wrapper: () => {
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
};
|
|
517
|
-
return h(ImagePreview, options);
|
|
518
|
-
};
|
|
519
|
-
}
|
|
520
|
-
};
|
|
521
|
-
}
|
|
356
|
+
components: [L, B, A, E, Ye],
|
|
357
|
+
wrapper: () => ({
|
|
358
|
+
setup() {
|
|
359
|
+
return () => (o.onClose = () => {
|
|
360
|
+
o.show = !1, be(() => {
|
|
361
|
+
a();
|
|
362
|
+
});
|
|
363
|
+
}, Te(ee, o));
|
|
364
|
+
}
|
|
365
|
+
})
|
|
522
366
|
});
|
|
523
367
|
}
|
|
524
368
|
}
|
|
525
|
-
const
|
|
526
|
-
|
|
527
|
-
|
|
369
|
+
const Ve = (e) => new Ae(e);
|
|
370
|
+
Ve.install = (e) => {
|
|
371
|
+
e.use(ee);
|
|
528
372
|
};
|
|
529
373
|
export {
|
|
530
|
-
ImagePreviewOptions,
|
|
531
|
-
|
|
532
|
-
showImagePreview
|
|
374
|
+
Le as ImagePreviewOptions,
|
|
375
|
+
ee as default,
|
|
376
|
+
Ve as showImagePreview
|
|
533
377
|
};
|