@nutui/nutui 3.1.22-beta.0 → 3.1.22-beta.3
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/dist/nutui.es.js +4019 -19251
- package/dist/nutui.umd.js +4012 -19344
- package/dist/packages/_es/ActionSheet.js +26 -157
- package/dist/packages/_es/Address.js +119 -542
- package/dist/packages/_es/AddressList.js +113 -613
- package/dist/packages/_es/Audio.js +62 -264
- package/dist/packages/_es/AudioOperate.js +18 -107
- package/dist/packages/_es/Avatar.js +42 -165
- package/dist/packages/_es/AvatarGroup.js +14 -73
- package/dist/packages/_es/BackTop.js +43 -156
- package/dist/packages/_es/Badge.js +14 -86
- package/dist/packages/_es/Barrage.js +41 -120
- package/dist/packages/_es/Button.js +23 -128
- package/dist/packages/_es/Calendar.js +24 -237
- package/dist/packages/_es/CalendarItem.js +1 -1
- package/dist/packages/_es/Card.js +10 -107
- package/dist/packages/_es/Cascader.js +156 -500
- package/dist/packages/_es/Category.js +15 -58
- package/dist/packages/_es/CategoryPane.js +11 -111
- package/dist/packages/_es/Cell.js +21 -100
- package/dist/packages/_es/CellGroup.js +9 -44
- package/dist/packages/_es/Checkbox.js +31 -113
- package/dist/packages/_es/CheckboxGroup.js +29 -58
- package/dist/packages/_es/CircleProgress.js +28 -151
- package/dist/packages/_es/Col.js +14 -56
- package/dist/packages/_es/Collapse.js +24 -85
- package/dist/packages/_es/CollapseItem.js +70 -261
- package/dist/packages/_es/Comment.js +64 -434
- package/dist/packages/_es/CountDown.js +61 -242
- package/dist/packages/_es/CountUp.js +149 -546
- package/dist/packages/_es/DatePicker.js +107 -322
- package/dist/packages/_es/Dialog.js +69 -261
- package/dist/packages/_es/Divider.js +18 -68
- package/dist/packages/_es/Drag.js +56 -197
- package/dist/packages/_es/Ecard.js +24 -159
- package/dist/packages/_es/Elevator.js +63 -198
- package/dist/packages/_es/Empty.js +12 -71
- package/dist/packages/_es/FixedNav.js +15 -122
- package/dist/packages/_es/Form.js +64 -151
- package/dist/packages/_es/FormItem.js +15 -110
- package/dist/packages/_es/Grid.js +5 -6
- package/dist/packages/_es/GridItem.js +33 -144
- package/dist/packages/_es/Icon.js +15 -40
- package/dist/packages/_es/ImagePreview.js +74 -298
- package/dist/packages/_es/Indicator.js +15 -62
- package/dist/packages/_es/InfiniteLoading.js +66 -258
- package/dist/packages/_es/Input.js +51 -413
- package/dist/packages/_es/InputNumber.js +41 -160
- package/dist/packages/_es/Layout.js +4 -5
- package/dist/packages/_es/List.js +23 -110
- package/dist/packages/_es/Menu.js +30 -118
- package/dist/packages/_es/MenuItem.js +34 -162
- package/dist/packages/_es/Navbar.js +30 -192
- package/dist/packages/_es/NoticeBar.js +83 -387
- package/dist/packages/_es/Notify.js +81 -236
- package/dist/packages/_es/NumberKeyboard.js +41 -272
- package/dist/packages/_es/OldPicker.js +140 -464
- package/dist/packages/_es/OverLay.js +32 -105
- package/dist/packages/_es/Pagination.js +39 -157
- package/dist/packages/_es/Picker.js +138 -459
- package/dist/packages/_es/Popover.js +327 -965
- package/dist/packages/_es/Popup.js +64 -303
- package/dist/packages/_es/Price.js +16 -118
- package/dist/packages/_es/Progress.js +14 -146
- package/dist/packages/_es/PullRefresh.js +92 -346
- package/dist/packages/_es/Radio.js +22 -90
- package/dist/packages/_es/RadioGroup.js +8 -37
- package/dist/packages/_es/Range.js +92 -417
- package/dist/packages/_es/Rate.js +16 -139
- package/dist/packages/_es/Row.js +22 -64
- package/dist/packages/_es/SearchBar.js +46 -247
- package/dist/packages/_es/ShortPassword.js +35 -225
- package/dist/packages/_es/SideNavBar.js +33 -89
- package/dist/packages/_es/SideNavBarItem.js +11 -46
- package/dist/packages/_es/Signature.js +46 -165
- package/dist/packages/_es/Skeleton.js +20 -136
- package/dist/packages/_es/Sku.js +93 -499
- package/dist/packages/_es/Step.js +25 -119
- package/dist/packages/_es/Steps.js +18 -53
- package/dist/packages/_es/Sticky.js +53 -138
- package/dist/packages/_es/SubSideNavBar.js +26 -90
- package/dist/packages/_es/Swipe.js +46 -183
- package/dist/packages/_es/Swiper.js +121 -433
- package/dist/packages/_es/SwiperItem.js +22 -53
- package/dist/packages/_es/Switch.js +21 -116
- package/dist/packages/_es/TabPane.js +12 -39
- package/dist/packages/_es/Tabbar.js +17 -72
- package/dist/packages/_es/TabbarItem.js +29 -151
- package/dist/packages/_es/Table.js +27 -186
- package/dist/packages/_es/Tabs.js +51 -209
- package/dist/packages/_es/Tag.js +20 -97
- package/dist/packages/_es/TextArea.js +42 -160
- package/dist/packages/_es/TimeDetail.js +23 -84
- package/dist/packages/_es/TimePannel.js +19 -52
- package/dist/packages/_es/TimeSelect.js +15 -103
- package/dist/packages/_es/Toast.js +80 -319
- package/dist/packages/_es/Uploader.js +112 -460
- package/dist/packages/_es/Video.js +83 -340
- package/dist/packages/_es/common.js +38 -128
- package/dist/packages/_es/component.js +35 -76
- package/dist/packages/_es/index.js +5 -6
- package/dist/packages/_es/index2.js +9 -30
- package/dist/packages/_es/index3.js +6 -8
- package/dist/packages/_es/index4.js +13 -58
- package/dist/packages/_es/index5.js +120 -675
- package/dist/packages/_es/plugin-vue_export-helper.js +7 -8
- package/dist/packages/_es/pxCheck.js +3 -5
- package/dist/packages/_es/raf.js +8 -15
- package/dist/packages/button/index.scss +2 -1
- package/dist/packages/cell/index.scss +11 -0
- package/dist/packages/checkbox/index.scss +6 -0
- package/dist/packages/dialog/index.scss +1 -0
- package/dist/packages/elevator/index.scss +21 -0
- package/dist/packages/input/index.scss +13 -1
- package/dist/packages/locale/lang/baseLang.d.ts +1 -0
- package/dist/packages/locale/lang/baseLang.js +3 -3
- package/dist/packages/locale/lang/en-US.d.ts +8 -0
- package/dist/packages/locale/lang/en-US.js +5 -97
- package/dist/packages/locale/lang/id-ID.d.ts +8 -0
- package/dist/packages/locale/lang/id-ID.js +5 -97
- package/dist/packages/locale/lang/index.js +16 -38
- package/dist/packages/locale/lang/zh-CN.d.ts +8 -0
- package/dist/packages/locale/lang/zh-CN.js +5 -97
- package/dist/packages/locale/lang/zh-TW.d.ts +8 -0
- package/dist/packages/locale/lang/zh-TW.js +5 -97
- package/dist/packages/radio/index.scss +1 -0
- package/dist/packages/switch/index.scss +3 -3
- package/dist/packages/tabpane/index.scss +1 -0
- package/dist/smartips/attributes.json +62 -10
- package/dist/smartips/tags.json +17 -4
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +49 -49
- package/dist/styles/themes/jdb.scss +49 -49
- package/dist/styles/themes/jdt.scss +49 -49
- package/dist/styles/variables-jdb.scss +10 -1
- package/dist/styles/variables-jdt.scss +10 -1
- package/dist/styles/variables.scss +10 -1
- package/dist/types/__VUE/address/index.vue.d.ts +5 -5
- package/dist/types/__VUE/addresslist/components/ItemContents.vue.d.ts +1 -0
- package/dist/types/__VUE/audiooperate/index.vue.d.ts +1 -0
- package/dist/types/__VUE/avatar/index.vue.d.ts +4 -4
- package/dist/types/__VUE/backtop/index.vue.d.ts +2 -2
- package/dist/types/__VUE/badge/index.vue.d.ts +2 -2
- package/dist/types/__VUE/button/index.vue.d.ts +2 -2
- package/dist/types/__VUE/cascader/index.vue.d.ts +1 -1
- package/dist/types/__VUE/cell/index.vue.d.ts +11 -4
- package/dist/types/__VUE/checkbox/common.d.ts +59 -0
- package/dist/types/__VUE/checkbox/index.vue.d.ts +18 -5
- package/dist/types/__VUE/checkboxgroup/index.vue.d.ts +7 -0
- package/dist/types/__VUE/collapseitem/index.vue.d.ts +2 -2
- package/dist/types/__VUE/dialog/index.d.ts +9 -2
- package/dist/types/__VUE/dialog/index.vue.d.ts +23 -8
- package/dist/types/__VUE/ecard/index.vue.d.ts +3 -3
- package/dist/types/__VUE/elevator/index.vue.d.ts +29 -0
- package/dist/types/__VUE/empty/index.vue.d.ts +2 -2
- package/dist/types/__VUE/formitem/index.vue.d.ts +3 -10
- package/dist/types/__VUE/grid/index.vue.d.ts +4 -4
- package/dist/types/__VUE/griditem/index.vue.d.ts +1 -1
- package/dist/types/__VUE/input/index.vue.d.ts +2 -2
- package/dist/types/__VUE/noticebar/index.vue.d.ts +1 -1
- package/dist/types/__VUE/oldpicker/index.vue.d.ts +2 -2
- package/dist/types/__VUE/picker/index.vue.d.ts +2 -2
- package/dist/types/__VUE/popover/index.vue.d.ts +2 -2
- package/dist/types/__VUE/range/index.vue.d.ts +1 -1
- package/dist/types/__VUE/rate/index.vue.d.ts +2 -2
- package/dist/types/__VUE/row/index.vue.d.ts +2 -2
- package/dist/types/__VUE/shortpassword/index.vue.d.ts +2 -2
- package/dist/types/__VUE/step/index.vue.d.ts +2 -2
- package/dist/types/__VUE/switch/index.vue.d.ts +2 -2
- package/dist/types/__VUE/tabbaritem/index.vue.d.ts +2 -2
- package/dist/types/__VUE/timeselect/index.vue.d.ts +9 -2
- package/dist/types/__VUE/toast/index.vue.d.ts +3 -3
- package/dist/types/__VUE/uploader/index.vue.d.ts +2 -2
- package/dist/types/__VUE/video/index.vue.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -1
|
@@ -5,322 +5,98 @@ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
6
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
7
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (
|
|
9
|
-
for (var prop in
|
|
10
|
-
if (__hasOwnProp.call(
|
|
11
|
-
__defNormalProp(
|
|
8
|
+
var __spreadValues = (a2, b2) => {
|
|
9
|
+
for (var prop in b2 || (b2 = {}))
|
|
10
|
+
if (__hasOwnProp.call(b2, prop))
|
|
11
|
+
__defNormalProp(a2, prop, b2[prop]);
|
|
12
12
|
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(
|
|
14
|
-
if (__propIsEnum.call(
|
|
15
|
-
__defNormalProp(
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b2)) {
|
|
14
|
+
if (__propIsEnum.call(b2, prop))
|
|
15
|
+
__defNormalProp(a2, prop, b2[prop]);
|
|
16
16
|
}
|
|
17
|
-
return
|
|
17
|
+
return a2;
|
|
18
18
|
};
|
|
19
|
-
var __spreadProps = (
|
|
19
|
+
var __spreadProps = (a2, b2) => __defProps(a2, __getOwnPropDescs(b2));
|
|
20
20
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.22-beta.
|
|
21
|
+
* @nutui/nutui v3.1.22-beta.3 Wed Jun 15 2022 20:12:30 GMT+0800 (中国标准时间)
|
|
22
22
|
* (c) 2022 @jdf2e.
|
|
23
23
|
* Released under the MIT License.
|
|
24
24
|
*/
|
|
25
|
-
import { toRefs, reactive, watch, onMounted, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, withModifiers, createElementBlock, Fragment, renderList, createVNode, createCommentVNode, toDisplayString, render, h } from "vue";
|
|
26
|
-
import { c as
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import { _ as
|
|
25
|
+
import { toRefs as e, reactive as o, watch as t, onMounted as i, resolveComponent as s, openBlock as a, createBlock as n, withCtx as l, createElementVNode as r, withModifiers as p, createElementBlock as c, Fragment as u, renderList as m, createVNode as g, createCommentVNode as d, toDisplayString as h, render as v, h as y } from "vue";
|
|
26
|
+
import { c as f } from "./component.js";
|
|
27
|
+
import w from "./Popup.js";
|
|
28
|
+
import b from "./Video.js";
|
|
29
|
+
import T from "./Swiper.js";
|
|
30
|
+
import C from "./SwiperItem.js";
|
|
31
|
+
import { _ as x } from "./plugin-vue_export-helper.js";
|
|
32
32
|
import "../locale/lang";
|
|
33
33
|
import "./OverLay.js";
|
|
34
34
|
import "./Icon.js";
|
|
35
35
|
import "./pxCheck.js";
|
|
36
36
|
import "./index3.js";
|
|
37
|
-
const { componentName, create } =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
},
|
|
52
|
-
contentClose: {
|
|
53
|
-
type: Boolean,
|
|
54
|
-
default: false
|
|
55
|
-
},
|
|
56
|
-
initNo: {
|
|
57
|
-
type: Number,
|
|
58
|
-
default: 1
|
|
59
|
-
},
|
|
60
|
-
paginationVisible: {
|
|
61
|
-
type: Boolean,
|
|
62
|
-
default: false
|
|
63
|
-
},
|
|
64
|
-
paginationColor: {
|
|
65
|
-
type: String,
|
|
66
|
-
default: "#fff"
|
|
67
|
-
},
|
|
68
|
-
autoplay: {
|
|
69
|
-
type: [Number, String],
|
|
70
|
-
default: 3e3
|
|
71
|
-
},
|
|
72
|
-
isWrapTeleport: {
|
|
73
|
-
type: Boolean,
|
|
74
|
-
default: false
|
|
37
|
+
const { componentName: j, create: N } = f("imagepreview"), S = N({ props: { show: { type: Boolean, default: false }, images: { type: Array, default: () => [] }, videos: { type: Array, default: () => [] }, contentClose: { type: Boolean, default: false }, initNo: { type: Number, default: 1 }, paginationVisible: { type: Boolean, default: false }, paginationColor: { type: String, default: "#fff" }, autoplay: { type: [Number, String], default: 3e3 }, isWrapTeleport: { type: Boolean, default: false } }, emits: ["close"], components: { [w.name]: w, [b.name]: b, [T.name]: T, [C.name]: C }, setup(s2, { emit: a2 }) {
|
|
38
|
+
e(s2);
|
|
39
|
+
const n2 = o({ showPop: false, active: 1, maxNo: 1, source: { src: "https://storage.jd.com/about/big-final.mp4?Expires=3730193075&AccessKey=3LoYX1dQWa6ZXzQl&Signature=ViMFjz%2BOkBxS%2FY1rjtUVqbopbJI%3D", type: "video/mp4" }, options: { muted: true, controls: true }, eleImg: null, store: { scale: 1, moveable: false }, lastTouchEndTime: 0 }), l2 = () => {
|
|
40
|
+
n2.showPop = false, n2.store.scale = 1, p2(), n2.active = 1, a2("close");
|
|
41
|
+
}, r2 = (e2, o2) => Math.hypot(Math.abs(o2.x - e2.x), Math.abs(o2.y - e2.y)), p2 = () => {
|
|
42
|
+
n2.eleImg.style.transform = "scale(" + n2.store.scale + ")";
|
|
43
|
+
}, c2 = (e2) => {
|
|
44
|
+
if (!n2.store.moveable)
|
|
45
|
+
return;
|
|
46
|
+
const o2 = n2.store;
|
|
47
|
+
var t2 = e2.touches, i2 = t2[0], s3 = t2[1];
|
|
48
|
+
if (s3) {
|
|
49
|
+
const e3 = r2({ x: i2.pageX, y: i2.pageY }, { x: s3.pageX, y: s3.pageY }) / o2.oriDistance;
|
|
50
|
+
o2.scale = o2.originScale * e3, o2.scale > 3 && (o2.scale = 3), p2();
|
|
75
51
|
}
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
},
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
});
|
|
105
|
-
const slideChangeEnd = function(page) {
|
|
106
|
-
state.active = page + 1;
|
|
107
|
-
};
|
|
108
|
-
const closeOnImg = () => {
|
|
109
|
-
if (props.contentClose) {
|
|
110
|
-
onClose();
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
const onClose = () => {
|
|
114
|
-
state.showPop = false;
|
|
115
|
-
state.store.scale = 1;
|
|
116
|
-
scaleNow();
|
|
117
|
-
state.active = 1;
|
|
118
|
-
emit("close");
|
|
119
|
-
};
|
|
120
|
-
const getDistance = (first, second) => {
|
|
121
|
-
return Math.hypot(Math.abs(second.x - first.x), Math.abs(second.y - first.y));
|
|
122
|
-
};
|
|
123
|
-
const scaleNow = () => {
|
|
124
|
-
state.eleImg.style.transform = "scale(" + state.store.scale + ")";
|
|
125
|
-
};
|
|
126
|
-
const onTouchStart = (event) => {
|
|
127
|
-
const curTouchTime = new Date().getTime();
|
|
128
|
-
if (curTouchTime - state.lastTouchEndTime < 300) {
|
|
129
|
-
const store2 = state.store;
|
|
130
|
-
if (store2.scale > 1) {
|
|
131
|
-
store2.scale = 1;
|
|
132
|
-
} else if (store2.scale == 1) {
|
|
133
|
-
store2.scale = 2;
|
|
134
|
-
}
|
|
135
|
-
scaleNow();
|
|
136
|
-
}
|
|
137
|
-
var touches = event.touches;
|
|
138
|
-
var events = touches[0];
|
|
139
|
-
var events2 = touches[1];
|
|
140
|
-
const store = state.store;
|
|
141
|
-
store.moveable = true;
|
|
142
|
-
if (events2) {
|
|
143
|
-
store.oriDistance = getDistance({
|
|
144
|
-
x: events.pageX,
|
|
145
|
-
y: events.pageY
|
|
146
|
-
}, {
|
|
147
|
-
x: events2.pageX,
|
|
148
|
-
y: events2.pageY
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
store.originScale = store.scale || 1;
|
|
152
|
-
};
|
|
153
|
-
const onTouchMove = (event) => {
|
|
154
|
-
if (!state.store.moveable) {
|
|
155
|
-
return;
|
|
156
|
-
}
|
|
157
|
-
const store = state.store;
|
|
158
|
-
var touches = event.touches;
|
|
159
|
-
var events = touches[0];
|
|
160
|
-
var events2 = touches[1];
|
|
161
|
-
if (events2) {
|
|
162
|
-
const curDistance = getDistance({
|
|
163
|
-
x: events.pageX,
|
|
164
|
-
y: events.pageY
|
|
165
|
-
}, {
|
|
166
|
-
x: events2.pageX,
|
|
167
|
-
y: events2.pageY
|
|
168
|
-
});
|
|
169
|
-
const curScale = curDistance / store.oriDistance;
|
|
170
|
-
store.scale = store.originScale * curScale;
|
|
171
|
-
if (store.scale > 3) {
|
|
172
|
-
store.scale = 3;
|
|
173
|
-
}
|
|
174
|
-
scaleNow();
|
|
175
|
-
}
|
|
176
|
-
};
|
|
177
|
-
const onTouchEnd = () => {
|
|
178
|
-
state.lastTouchEndTime = new Date().getTime();
|
|
179
|
-
const store = state.store;
|
|
180
|
-
store.moveable = false;
|
|
181
|
-
if (store.scale < 1.1 && store.scale > 1 || store.scale < 1) {
|
|
182
|
-
store.scale = 1;
|
|
183
|
-
scaleNow();
|
|
184
|
-
}
|
|
185
|
-
};
|
|
186
|
-
const init = () => {
|
|
187
|
-
state.eleImg = document.querySelector(".nut-imagepreview");
|
|
188
|
-
document.addEventListener("touchmove", onTouchMove);
|
|
189
|
-
document.addEventListener("touchend", onTouchEnd);
|
|
190
|
-
document.addEventListener("touchcancel", onTouchEnd);
|
|
191
|
-
};
|
|
192
|
-
watch(() => props.show, (val) => {
|
|
193
|
-
state.showPop = val;
|
|
194
|
-
init();
|
|
195
|
-
});
|
|
196
|
-
onMounted(() => {
|
|
197
|
-
state.active = props.initNo;
|
|
198
|
-
state.showPop = props.show;
|
|
199
|
-
state.maxNo = props.images.length + props.videos.length;
|
|
200
|
-
});
|
|
201
|
-
return __spreadProps(__spreadValues({}, toRefs(state)), {
|
|
202
|
-
slideChangeEnd,
|
|
203
|
-
onClose,
|
|
204
|
-
closeOnImg,
|
|
205
|
-
onTouchStart,
|
|
206
|
-
onTouchMove,
|
|
207
|
-
onTouchEnd,
|
|
208
|
-
getDistance,
|
|
209
|
-
scaleNow
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
});
|
|
213
|
-
const _hoisted_1 = ["src"];
|
|
214
|
-
const _hoisted_2 = { class: "nut-imagepreview-index" };
|
|
215
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
216
|
-
const _component_nut_video = resolveComponent("nut-video");
|
|
217
|
-
const _component_nut_swiper_item = resolveComponent("nut-swiper-item");
|
|
218
|
-
const _component_nut_swiper = resolveComponent("nut-swiper");
|
|
219
|
-
const _component_nut_popup = resolveComponent("nut-popup");
|
|
220
|
-
return openBlock(), createBlock(_component_nut_popup, {
|
|
221
|
-
"pop-class": "custom-pop",
|
|
222
|
-
visible: _ctx.showPop,
|
|
223
|
-
"onUpdate:visible": _cache[2] || (_cache[2] = ($event) => _ctx.showPop = $event),
|
|
224
|
-
isWrapTeleport: _ctx.isWrapTeleport,
|
|
225
|
-
onClick: _ctx.onClose,
|
|
226
|
-
style: { "width": "100%" }
|
|
227
|
-
}, {
|
|
228
|
-
default: withCtx(() => [
|
|
229
|
-
createElementVNode("view", {
|
|
230
|
-
class: "nut-imagepreview",
|
|
231
|
-
onClick: _cache[0] || (_cache[0] = withModifiers((...args) => _ctx.closeOnImg && _ctx.closeOnImg(...args), ["stop"])),
|
|
232
|
-
onTouchstartCapture: _cache[1] || (_cache[1] = (...args) => _ctx.onTouchStart && _ctx.onTouchStart(...args))
|
|
233
|
-
}, [
|
|
234
|
-
_ctx.showPop ? (openBlock(), createBlock(_component_nut_swiper, {
|
|
235
|
-
key: 0,
|
|
236
|
-
"auto-play": _ctx.autoplay,
|
|
237
|
-
class: "nut-imagepreview-swiper",
|
|
238
|
-
loop: true,
|
|
239
|
-
"is-preventDefault": false,
|
|
240
|
-
direction: "horizontal",
|
|
241
|
-
onChange: _ctx.slideChangeEnd,
|
|
242
|
-
"init-page": _ctx.initNo > _ctx.maxNo ? _ctx.maxNo - 1 : _ctx.initNo - 1,
|
|
243
|
-
"pagination-visible": _ctx.paginationVisible,
|
|
244
|
-
"pagination-color": _ctx.paginationColor
|
|
245
|
-
}, {
|
|
246
|
-
default: withCtx(() => [
|
|
247
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.videos, (item, index) => {
|
|
248
|
-
return openBlock(), createBlock(_component_nut_swiper_item, { key: index }, {
|
|
249
|
-
default: withCtx(() => [
|
|
250
|
-
createVNode(_component_nut_video, {
|
|
251
|
-
source: item.source,
|
|
252
|
-
options: item.options
|
|
253
|
-
}, null, 8, ["source", "options"])
|
|
254
|
-
]),
|
|
255
|
-
_: 2
|
|
256
|
-
}, 1024);
|
|
257
|
-
}), 128)),
|
|
258
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.images, (item, index) => {
|
|
259
|
-
return openBlock(), createBlock(_component_nut_swiper_item, { key: index }, {
|
|
260
|
-
default: withCtx(() => [
|
|
261
|
-
createElementVNode("img", {
|
|
262
|
-
src: item.src,
|
|
263
|
-
class: "nut-imagepreview-img"
|
|
264
|
-
}, null, 8, _hoisted_1)
|
|
265
|
-
]),
|
|
266
|
-
_: 2
|
|
267
|
-
}, 1024);
|
|
268
|
-
}), 128))
|
|
269
|
-
]),
|
|
270
|
-
_: 1
|
|
271
|
-
}, 8, ["auto-play", "onChange", "init-page", "pagination-visible", "pagination-color"])) : createCommentVNode("", true)
|
|
272
|
-
], 32),
|
|
273
|
-
createElementVNode("view", _hoisted_2, toDisplayString(_ctx.active) + " / " + toDisplayString(_ctx.images.length + _ctx.videos.length), 1)
|
|
274
|
-
]),
|
|
275
|
-
_: 1
|
|
276
|
-
}, 8, ["visible", "isWrapTeleport", "onClick"]);
|
|
277
|
-
}
|
|
278
|
-
var ImagePreview = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
279
|
-
class ImagePreviewOptions {
|
|
52
|
+
}, u2 = () => {
|
|
53
|
+
n2.lastTouchEndTime = new Date().getTime();
|
|
54
|
+
const e2 = n2.store;
|
|
55
|
+
e2.moveable = false, (e2.scale < 1.1 && e2.scale > 1 || e2.scale < 1) && (e2.scale = 1, p2());
|
|
56
|
+
};
|
|
57
|
+
return t(() => s2.show, (e2) => {
|
|
58
|
+
n2.showPop = e2, n2.eleImg = document.querySelector(".nut-imagepreview"), document.addEventListener("touchmove", c2), document.addEventListener("touchend", u2), document.addEventListener("touchcancel", u2);
|
|
59
|
+
}), i(() => {
|
|
60
|
+
n2.active = s2.initNo, n2.showPop = s2.show, n2.maxNo = s2.images.length + s2.videos.length;
|
|
61
|
+
}), __spreadProps(__spreadValues({}, e(n2)), { slideChangeEnd: function(e2) {
|
|
62
|
+
n2.active = e2 + 1;
|
|
63
|
+
}, onClose: l2, closeOnImg: () => {
|
|
64
|
+
s2.contentClose && l2();
|
|
65
|
+
}, onTouchStart: (e2) => {
|
|
66
|
+
if (new Date().getTime() - n2.lastTouchEndTime < 300) {
|
|
67
|
+
const e3 = n2.store;
|
|
68
|
+
e3.scale > 1 ? e3.scale = 1 : e3.scale == 1 && (e3.scale = 2), p2();
|
|
69
|
+
}
|
|
70
|
+
var o2 = e2.touches, t2 = o2[0], i2 = o2[1];
|
|
71
|
+
const s3 = n2.store;
|
|
72
|
+
s3.moveable = true, i2 && (s3.oriDistance = r2({ x: t2.pageX, y: t2.pageY }, { x: i2.pageX, y: i2.pageY })), s3.originScale = s3.scale || 1;
|
|
73
|
+
}, onTouchMove: c2, onTouchEnd: u2, getDistance: r2, scaleNow: p2 });
|
|
74
|
+
} }), E = ["src"], I = { class: "nut-imagepreview-index" };
|
|
75
|
+
var P = x(S, [["render", function(e2, o2, t2, i2, v2, y2) {
|
|
76
|
+
const f2 = s("nut-video"), w2 = s("nut-swiper-item"), b2 = s("nut-swiper"), T2 = s("nut-popup");
|
|
77
|
+
return a(), n(T2, { "pop-class": "custom-pop", visible: e2.showPop, "onUpdate:visible": o2[2] || (o2[2] = (o3) => e2.showPop = o3), isWrapTeleport: e2.isWrapTeleport, onClick: e2.onClose, style: { width: "100%" } }, { default: l(() => [r("view", { class: "nut-imagepreview", onClick: o2[0] || (o2[0] = p((...o3) => e2.closeOnImg && e2.closeOnImg(...o3), ["stop"])), onTouchstartCapture: o2[1] || (o2[1] = (...o3) => e2.onTouchStart && e2.onTouchStart(...o3)) }, [e2.showPop ? (a(), n(b2, { key: 0, "auto-play": e2.autoplay, class: "nut-imagepreview-swiper", loop: true, "is-preventDefault": false, direction: "horizontal", onChange: e2.slideChangeEnd, "init-page": e2.initNo > e2.maxNo ? e2.maxNo - 1 : e2.initNo - 1, "pagination-visible": e2.paginationVisible, "pagination-color": e2.paginationColor }, { default: l(() => [(a(true), c(u, null, m(e2.videos, (e3, o3) => (a(), n(w2, { key: o3 }, { default: l(() => [g(f2, { source: e3.source, options: e3.options }, null, 8, ["source", "options"])]), _: 2 }, 1024))), 128)), (a(true), c(u, null, m(e2.images, (e3, o3) => (a(), n(w2, { key: o3 }, { default: l(() => [r("img", { src: e3.src, class: "nut-imagepreview-img" }, null, 8, E)]), _: 2 }, 1024))), 128))]), _: 1 }, 8, ["auto-play", "onChange", "init-page", "pagination-visible", "pagination-color"])) : d("", true)], 32), r("view", I, h(e2.active) + " / " + h(e2.images.length + e2.videos.length), 1)]), _: 1 }, 8, ["visible", "isWrapTeleport", "onClick"]);
|
|
78
|
+
}]]);
|
|
79
|
+
class k {
|
|
280
80
|
constructor() {
|
|
281
|
-
this.show = false
|
|
282
|
-
this.images = [];
|
|
283
|
-
this.initNo = 1;
|
|
284
|
-
this.paginationVisible = false;
|
|
285
|
-
this.paginationColor = "";
|
|
286
|
-
this.teleport = "body";
|
|
287
|
-
this.onClose = () => {
|
|
81
|
+
this.show = false, this.images = [], this.initNo = 1, this.paginationVisible = false, this.paginationColor = "", this.teleport = "body", this.onClose = () => {
|
|
288
82
|
};
|
|
289
83
|
}
|
|
290
84
|
}
|
|
291
|
-
class
|
|
292
|
-
constructor(
|
|
293
|
-
this.options = new
|
|
294
|
-
let
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
} else {
|
|
301
|
-
elWarp = options.teleport;
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
const root = document.createElement("view");
|
|
305
|
-
root.id = "imagepreview-" + new Date().getTime();
|
|
306
|
-
const Wrapper = {
|
|
307
|
-
setup() {
|
|
308
|
-
options.teleport = `#${root.id}`;
|
|
309
|
-
return () => {
|
|
310
|
-
return h(ImagePreview, options);
|
|
311
|
-
};
|
|
312
|
-
}
|
|
313
|
-
};
|
|
314
|
-
const instance = createVNode(Wrapper);
|
|
315
|
-
elWarp.appendChild(root);
|
|
316
|
-
render(instance, root);
|
|
85
|
+
class D {
|
|
86
|
+
constructor(e2) {
|
|
87
|
+
this.options = new k();
|
|
88
|
+
let o2 = Object.assign(this.options, e2), t2 = document.body, i2 = o2.teleport;
|
|
89
|
+
i2 != "body" && (t2 = typeof i2 == "string" ? document.querySelector(i2) : o2.teleport);
|
|
90
|
+
const s2 = document.createElement("view");
|
|
91
|
+
s2.id = "imagepreview-" + new Date().getTime();
|
|
92
|
+
const a2 = g({ setup: () => (o2.teleport = `#${s2.id}`, () => y(P, o2)) });
|
|
93
|
+
t2.appendChild(s2), v(a2, s2);
|
|
317
94
|
}
|
|
318
95
|
}
|
|
319
|
-
const
|
|
320
|
-
return new
|
|
96
|
+
const B = function(e2) {
|
|
97
|
+
return new D(e2);
|
|
321
98
|
};
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
app.config.globalProperties.$imagepreview = _ImagePreview;
|
|
99
|
+
B.install = (e2) => {
|
|
100
|
+
e2.use(P), e2.config.globalProperties.$imagepreview = B;
|
|
325
101
|
};
|
|
326
|
-
export { ImagePreview, ImagePreviewOptions,
|
|
102
|
+
export { P as ImagePreview, k as ImagePreviewOptions, B as default };
|
|
@@ -1,67 +1,20 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.22-beta.
|
|
2
|
+
* @nutui/nutui v3.1.22-beta.3 Wed Jun 15 2022 20:12:30 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { toRefs, computed, openBlock, createElementBlock, normalizeClass, Fragment, renderList, toDisplayString } from "vue";
|
|
7
|
-
import { c
|
|
8
|
-
import { _ as
|
|
6
|
+
import { toRefs as e, computed as r, openBlock as t, createElementBlock as l, normalizeClass as o, Fragment as n, renderList as a, toDisplayString as u } from "vue";
|
|
7
|
+
import { c } from "./component.js";
|
|
8
|
+
import { _ as s } from "./plugin-vue_export-helper.js";
|
|
9
9
|
import "../locale/lang";
|
|
10
|
-
const { componentName, create } =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
required: true
|
|
22
|
-
},
|
|
23
|
-
block: {
|
|
24
|
-
type: Boolean,
|
|
25
|
-
default: false
|
|
26
|
-
},
|
|
27
|
-
align: {
|
|
28
|
-
type: String,
|
|
29
|
-
default: "center"
|
|
30
|
-
},
|
|
31
|
-
fillZero: {
|
|
32
|
-
type: Boolean,
|
|
33
|
-
default: true
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
setup(props) {
|
|
37
|
-
const { block, align } = toRefs(props);
|
|
38
|
-
const classes = computed(() => {
|
|
39
|
-
const prefixCls = componentName;
|
|
40
|
-
return {
|
|
41
|
-
[prefixCls]: true,
|
|
42
|
-
[`${prefixCls}--block`]: block.value,
|
|
43
|
-
[`${prefixCls}--align__${align.value}`]: block.value && align.value
|
|
44
|
-
};
|
|
45
|
-
});
|
|
46
|
-
return { classes, componentName };
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
50
|
-
return openBlock(), createElementBlock("view", {
|
|
51
|
-
class: normalizeClass(_ctx.classes)
|
|
52
|
-
}, [
|
|
53
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.size, (item) => {
|
|
54
|
-
return openBlock(), createElementBlock(Fragment, { key: item }, [
|
|
55
|
-
item === _ctx.current ? (openBlock(), createElementBlock("view", {
|
|
56
|
-
key: 0,
|
|
57
|
-
class: normalizeClass(`${_ctx.componentName}--number`)
|
|
58
|
-
}, toDisplayString(_ctx.fillZero && item < 10 ? `0${item}` : item), 3)) : (openBlock(), createElementBlock("view", {
|
|
59
|
-
key: 1,
|
|
60
|
-
class: normalizeClass(`${_ctx.componentName}--dot`)
|
|
61
|
-
}, null, 2))
|
|
62
|
-
], 64);
|
|
63
|
-
}), 128))
|
|
64
|
-
], 2);
|
|
65
|
-
}
|
|
66
|
-
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
67
|
-
export { index as default };
|
|
10
|
+
const { componentName: i, create: p } = c("indicator");
|
|
11
|
+
var m = s(p({ props: { size: { type: Number, default: 3, required: true }, current: { type: Number, default: 1, required: true }, block: { type: Boolean, default: false }, align: { type: String, default: "center" }, fillZero: { type: Boolean, default: true } }, setup(t2) {
|
|
12
|
+
const { block: l2, align: o2 } = e(t2);
|
|
13
|
+
return { classes: r(() => {
|
|
14
|
+
const e2 = i;
|
|
15
|
+
return { [e2]: true, [`${e2}--block`]: l2.value, [`${e2}--align__${o2.value}`]: l2.value && o2.value };
|
|
16
|
+
}), componentName: i };
|
|
17
|
+
} }), [["render", function(e2, r2, c2, s2, i2, p2) {
|
|
18
|
+
return t(), l("view", { class: o(e2.classes) }, [(t(true), l(n, null, a(e2.size, (r3) => (t(), l(n, { key: r3 }, [r3 === e2.current ? (t(), l("view", { key: 0, class: o(`${e2.componentName}--number`) }, u(e2.fillZero && r3 < 10 ? `0${r3}` : r3), 3)) : (t(), l("view", { key: 1, class: o(`${e2.componentName}--dot`) }, null, 2))], 64))), 128))], 2);
|
|
19
|
+
}]]);
|
|
20
|
+
export { m as default };
|