@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,12 +1,11 @@
|
|
|
1
|
-
import { ref, reactive, computed, provide, onDeactivated, onBeforeUnmount, watch, nextTick, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, renderSlot, Fragment, renderList, createCommentVNode } from "vue";
|
|
2
|
-
import { c as
|
|
3
|
-
import { u as
|
|
4
|
-
import { u as
|
|
5
|
-
import { r as
|
|
6
|
-
import { _ as
|
|
1
|
+
import { ref as Q, reactive as Z, computed as s, provide as _, onDeactivated as ee, onBeforeUnmount as te, watch as E, nextTick as Y, openBlock as P, createElementBlock as b, normalizeClass as S, createElementVNode as ne, normalizeStyle as L, renderSlot as j, Fragment as oe, renderList as ae, createCommentVNode as ie } from "vue";
|
|
2
|
+
import { c as le, e as B } from "./component-234624bc.js";
|
|
3
|
+
import { u as re } from "./index-53ec2d4d.js";
|
|
4
|
+
import { u as ue } from "./index-fadb0974.js";
|
|
5
|
+
import { r as k } from "./raf-a74f1a06.js";
|
|
6
|
+
import { _ as se } from "./_plugin-vue_export-helper-dad06003.js";
|
|
7
7
|
import "../locale/lang";
|
|
8
|
-
const { create, componentName } =
|
|
9
|
-
const _sfc_main = create({
|
|
8
|
+
const { create: ce, componentName: M } = le("swiper"), fe = ce({
|
|
10
9
|
props: {
|
|
11
10
|
width: {
|
|
12
11
|
type: [Number, String],
|
|
@@ -23,7 +22,7 @@ const _sfc_main = create({
|
|
|
23
22
|
},
|
|
24
23
|
paginationVisible: {
|
|
25
24
|
type: Boolean,
|
|
26
|
-
default:
|
|
25
|
+
default: !1
|
|
27
26
|
},
|
|
28
27
|
paginationColor: {
|
|
29
28
|
type: String,
|
|
@@ -31,7 +30,7 @@ const _sfc_main = create({
|
|
|
31
30
|
},
|
|
32
31
|
loop: {
|
|
33
32
|
type: Boolean,
|
|
34
|
-
default:
|
|
33
|
+
default: !0
|
|
35
34
|
},
|
|
36
35
|
duration: {
|
|
37
36
|
type: [Number, String],
|
|
@@ -47,361 +46,225 @@ const _sfc_main = create({
|
|
|
47
46
|
},
|
|
48
47
|
touchable: {
|
|
49
48
|
type: Boolean,
|
|
50
|
-
default:
|
|
49
|
+
default: !0
|
|
51
50
|
},
|
|
52
51
|
isPreventDefault: {
|
|
53
52
|
type: Boolean,
|
|
54
|
-
default:
|
|
53
|
+
default: !0
|
|
55
54
|
},
|
|
56
55
|
isStopPropagation: {
|
|
57
56
|
type: Boolean,
|
|
58
|
-
default:
|
|
57
|
+
default: !0
|
|
59
58
|
}
|
|
60
59
|
},
|
|
61
60
|
emits: ["change"],
|
|
62
|
-
setup(
|
|
63
|
-
const
|
|
64
|
-
const state = reactive({
|
|
61
|
+
setup(n, { emit: c, slots: p }) {
|
|
62
|
+
const N = Q(), e = Z({
|
|
65
63
|
active: 0,
|
|
66
64
|
num: 0,
|
|
67
65
|
rect: null,
|
|
68
66
|
width: 0,
|
|
69
67
|
height: 0,
|
|
70
|
-
moving:
|
|
68
|
+
moving: !1,
|
|
71
69
|
offset: 0,
|
|
72
70
|
touchTime: 0,
|
|
73
71
|
autoplayTimer: null,
|
|
74
72
|
children: [],
|
|
75
73
|
childrenVNode: [],
|
|
76
74
|
style: {}
|
|
77
|
-
})
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const
|
|
75
|
+
}), f = re(), v = s(() => ({
|
|
76
|
+
[M]: !0
|
|
77
|
+
})), l = s(() => n.direction === "vertical"), q = s(() => {
|
|
78
|
+
const t = M;
|
|
81
79
|
return {
|
|
82
|
-
[
|
|
80
|
+
[`${t}-inner`]: !0,
|
|
81
|
+
[`${t}-vertical`]: l.value
|
|
83
82
|
};
|
|
84
|
-
})
|
|
85
|
-
|
|
86
|
-
const classesInner = computed(() => {
|
|
87
|
-
const prefixCls = componentName;
|
|
83
|
+
}), R = s(() => {
|
|
84
|
+
const t = M;
|
|
88
85
|
return {
|
|
89
|
-
[`${
|
|
90
|
-
[`${
|
|
86
|
+
[`${t}-pagination`]: !0,
|
|
87
|
+
[`${t}-pagination-vertical`]: l.value
|
|
91
88
|
};
|
|
92
|
-
})
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
[
|
|
98
|
-
|
|
99
|
-
});
|
|
100
|
-
const delTa = computed(() => {
|
|
101
|
-
return isVertical.value ? touch.deltaY.value : touch.deltaX.value;
|
|
102
|
-
});
|
|
103
|
-
const isCorrectDirection = computed(() => {
|
|
104
|
-
return touch.direction.value === props.direction;
|
|
105
|
-
});
|
|
106
|
-
const childCount = computed(() => state.children.length);
|
|
107
|
-
const size = computed(() => state[isVertical.value ? "height" : "width"]);
|
|
108
|
-
const trackSize = computed(() => childCount.value * size.value);
|
|
109
|
-
const minOffset = computed(() => {
|
|
110
|
-
if (state.rect) {
|
|
111
|
-
const base = isVertical.value ? state.rect.height : state.rect.width;
|
|
112
|
-
return base - size.value * childCount.value;
|
|
113
|
-
}
|
|
114
|
-
return 0;
|
|
115
|
-
});
|
|
116
|
-
const activePagination = computed(() => (state.active + childCount.value) % childCount.value);
|
|
117
|
-
const getStyle = () => {
|
|
118
|
-
let offset = 0;
|
|
119
|
-
offset = state.offset;
|
|
120
|
-
state.style = {
|
|
121
|
-
transitionDuration: `${state.moving ? 0 : props.duration}ms`,
|
|
122
|
-
transform: `translate${isVertical.value ? "Y" : "X"}(${offset}px)`,
|
|
123
|
-
[isVertical.value ? "height" : "width"]: `${size.value * childCount.value}px`,
|
|
124
|
-
[isVertical.value ? "width" : "height"]: `${isVertical.value ? state.width : state.height}px`
|
|
89
|
+
}), h = s(() => l.value ? f.deltaY.value : f.deltaX.value), D = s(() => f.direction.value === n.direction), i = s(() => e.children.length), d = s(() => e[l.value ? "height" : "width"]), A = s(() => i.value * d.value), T = s(() => e.rect ? (l.value ? e.rect.height : e.rect.width) - d.value * i.value : 0), O = s(() => (e.active + i.value) % i.value), $ = () => {
|
|
90
|
+
let t = 0;
|
|
91
|
+
t = e.offset, e.style = {
|
|
92
|
+
transitionDuration: `${e.moving ? 0 : n.duration}ms`,
|
|
93
|
+
transform: `translate${l.value ? "Y" : "X"}(${t}px)`,
|
|
94
|
+
[l.value ? "height" : "width"]: `${d.value * i.value}px`,
|
|
95
|
+
[l.value ? "width" : "height"]: `${l.value ? e.width : e.height}px`
|
|
125
96
|
};
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
} else if (childrenVNodeLen < children.length) {
|
|
143
|
-
for (let i = 0; i < childrenVNodeLen; i++) {
|
|
144
|
-
if (children[i].key !== state.childrenVNode[i].key) {
|
|
145
|
-
child.proxy && state.children.splice(i, 0, child.proxy);
|
|
146
|
-
child.vnode && state.childrenVNode.splice(i, 0, child.vnode);
|
|
147
|
-
break;
|
|
148
|
-
}
|
|
97
|
+
}, U = (t) => {
|
|
98
|
+
var m;
|
|
99
|
+
let o = [];
|
|
100
|
+
const u = e.childrenVNode.length;
|
|
101
|
+
let r = (m = p == null ? void 0 : p.default) == null ? void 0 : m.call(p);
|
|
102
|
+
if (r = r.filter((a) => a.children && Array.isArray(a.children)), r.forEach((a) => {
|
|
103
|
+
o = o.concat(a.children);
|
|
104
|
+
}), !u)
|
|
105
|
+
e.childrenVNode = o.slice(), t.proxy && e.children.push(t.proxy);
|
|
106
|
+
else if (u > o.length)
|
|
107
|
+
e.children = e.children.filter((a) => t.proxy !== a);
|
|
108
|
+
else if (u < o.length) {
|
|
109
|
+
for (let a = 0; a < u; a++)
|
|
110
|
+
if (o[a].key !== e.childrenVNode[a].key) {
|
|
111
|
+
t.proxy && e.children.splice(a, 0, t.proxy), t.vnode && e.childrenVNode.splice(a, 0, t.vnode);
|
|
112
|
+
break;
|
|
149
113
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
if (
|
|
163
|
-
currentPosition = Math.min(currentPosition, -minOffset.value);
|
|
164
|
-
}
|
|
165
|
-
let targetOffset = offset - currentPosition;
|
|
166
|
-
if (!props.loop) {
|
|
167
|
-
targetOffset = clamp(targetOffset, minOffset.value, 0);
|
|
168
|
-
}
|
|
169
|
-
return targetOffset;
|
|
170
|
-
};
|
|
171
|
-
const getActive = (pace) => {
|
|
172
|
-
const { active } = state;
|
|
173
|
-
if (pace) {
|
|
174
|
-
if (props.loop) {
|
|
175
|
-
return clamp(active + pace, -1, childCount.value);
|
|
176
|
-
}
|
|
177
|
-
return clamp(active + pace, 0, childCount.value - 1);
|
|
178
|
-
}
|
|
179
|
-
return active;
|
|
180
|
-
};
|
|
181
|
-
const move = ({ pace = 0, offset = 0, isEmit = false }) => {
|
|
182
|
-
if (childCount.value <= 1)
|
|
114
|
+
u !== o.length && (t.proxy && e.children.push(t.proxy), t.vnode && e.childrenVNode.push(t.vnode));
|
|
115
|
+
} else
|
|
116
|
+
e.childrenVNode = o.slice(), t.proxy && e.children.push(t.proxy);
|
|
117
|
+
}, z = (t, o = 0) => {
|
|
118
|
+
let u = t * d.value;
|
|
119
|
+
n.loop || (u = Math.min(u, -T.value));
|
|
120
|
+
let r = o - u;
|
|
121
|
+
return n.loop || (r = B(r, T.value, 0)), r;
|
|
122
|
+
}, W = (t) => {
|
|
123
|
+
const { active: o } = e;
|
|
124
|
+
return t ? n.loop ? B(o + t, -1, i.value) : B(o + t, 0, i.value - 1) : o;
|
|
125
|
+
}, g = ({ pace: t = 0, offset: o = 0, isEmit: u = !1 }) => {
|
|
126
|
+
if (i.value <= 1)
|
|
183
127
|
return;
|
|
184
|
-
const { active } =
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
const rightBound = targetOffset < minOffset.value;
|
|
190
|
-
state.children[0].setOffset(rightBound ? trackSize.value : 0);
|
|
128
|
+
const { active: r } = e, m = W(t), a = z(m, o);
|
|
129
|
+
if (n.loop) {
|
|
130
|
+
if (e.children[0] && a !== T.value) {
|
|
131
|
+
const V = a < T.value;
|
|
132
|
+
e.children[0].setOffset(V ? A.value : 0);
|
|
191
133
|
}
|
|
192
|
-
if (
|
|
193
|
-
const
|
|
194
|
-
|
|
134
|
+
if (e.children[i.value - 1] && a !== 0) {
|
|
135
|
+
const V = a > 0;
|
|
136
|
+
e.children[i.value - 1].setOffset(V ? -A.value : 0);
|
|
195
137
|
}
|
|
196
138
|
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
}
|
|
209
|
-
if (state.active >= childCount.value) {
|
|
210
|
-
move({ pace: -childCount.value });
|
|
211
|
-
}
|
|
212
|
-
};
|
|
213
|
-
const stopAutoPlay = () => {
|
|
214
|
-
if (state.autoplayTimer) {
|
|
215
|
-
clearTimeout(state.autoplayTimer);
|
|
216
|
-
}
|
|
217
|
-
};
|
|
218
|
-
const jump = (pace) => {
|
|
219
|
-
resettPosition();
|
|
220
|
-
touch.reset();
|
|
221
|
-
requestAniFrame(() => {
|
|
222
|
-
requestAniFrame(() => {
|
|
223
|
-
state.moving = false;
|
|
224
|
-
move({
|
|
225
|
-
pace,
|
|
226
|
-
isEmit: true
|
|
139
|
+
e.active = m, e.offset = a, u && r !== e.active && c("change", O.value), $();
|
|
140
|
+
}, C = () => {
|
|
141
|
+
e.moving = !0, e.active <= -1 && g({ pace: i.value }), e.active >= i.value && g({ pace: -i.value });
|
|
142
|
+
}, y = () => {
|
|
143
|
+
e.autoplayTimer && clearTimeout(e.autoplayTimer);
|
|
144
|
+
}, F = (t) => {
|
|
145
|
+
C(), f.reset(), k(() => {
|
|
146
|
+
k(() => {
|
|
147
|
+
e.moving = !1, g({
|
|
148
|
+
pace: t,
|
|
149
|
+
isEmit: !0
|
|
227
150
|
});
|
|
228
151
|
});
|
|
229
152
|
});
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
state.moving = false;
|
|
242
|
-
let targetIndex;
|
|
243
|
-
if (props.loop && childCount.value === index) {
|
|
244
|
-
targetIndex = state.active === 0 ? 0 : index;
|
|
245
|
-
} else {
|
|
246
|
-
targetIndex = index % childCount.value;
|
|
247
|
-
}
|
|
248
|
-
move({
|
|
249
|
-
pace: targetIndex - state.active,
|
|
250
|
-
isEmit: true
|
|
153
|
+
}, x = () => {
|
|
154
|
+
F(-1);
|
|
155
|
+
}, I = () => {
|
|
156
|
+
F(1);
|
|
157
|
+
}, G = (t) => {
|
|
158
|
+
C(), f.reset(), k(() => {
|
|
159
|
+
e.moving = !1;
|
|
160
|
+
let o;
|
|
161
|
+
n.loop && i.value === t ? o = e.active === 0 ? 0 : t : o = t % i.value, g({
|
|
162
|
+
pace: o - e.active,
|
|
163
|
+
isEmit: !0
|
|
251
164
|
});
|
|
252
165
|
});
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
|
|
166
|
+
}, w = () => {
|
|
167
|
+
n.autoPlay <= 0 || i.value <= 1 || (y(), e.autoplayTimer = setTimeout(() => {
|
|
168
|
+
I(), w();
|
|
169
|
+
}, Number(n.autoPlay)));
|
|
170
|
+
}, X = (t = +n.initPage) => {
|
|
171
|
+
y(), e.rect = N.value.getBoundingClientRect(), t = Math.min(i.value - 1, t), e.width = n.width ? +n.width : e.rect.width, e.height = n.height ? +n.height : e.rect.height, e.active = t, e.offset = z(e.active), e.moving = !0, $(), w();
|
|
172
|
+
}, H = (t) => {
|
|
173
|
+
n.isPreventDefault && t.preventDefault(), n.isStopPropagation && t.stopPropagation(), n.touchable && (f.start(t), e.touchTime = Date.now(), y(), C());
|
|
174
|
+
}, J = (t) => {
|
|
175
|
+
n.touchable && e.moving && (f.move(t), D.value && g({
|
|
176
|
+
offset: h.value
|
|
177
|
+
}));
|
|
178
|
+
}, K = (t) => {
|
|
179
|
+
if (!n.touchable || !e.moving)
|
|
256
180
|
return;
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
stopAutoPlay();
|
|
265
|
-
state.rect = container.value.getBoundingClientRect();
|
|
266
|
-
active = Math.min(childCount.value - 1, active);
|
|
267
|
-
state.width = props.width ? +props.width : state.rect.width;
|
|
268
|
-
state.height = props.height ? +props.height : state.rect.height;
|
|
269
|
-
state.active = active;
|
|
270
|
-
state.offset = getOffset(state.active);
|
|
271
|
-
state.moving = true;
|
|
272
|
-
getStyle();
|
|
273
|
-
autoplay();
|
|
274
|
-
};
|
|
275
|
-
const onTouchStart = (e) => {
|
|
276
|
-
if (props.isPreventDefault)
|
|
277
|
-
e.preventDefault();
|
|
278
|
-
if (props.isStopPropagation)
|
|
279
|
-
e.stopPropagation();
|
|
280
|
-
if (!props.touchable)
|
|
281
|
-
return;
|
|
282
|
-
touch.start(e);
|
|
283
|
-
state.touchTime = Date.now();
|
|
284
|
-
stopAutoPlay();
|
|
285
|
-
resettPosition();
|
|
286
|
-
};
|
|
287
|
-
const onTouchMove = (e) => {
|
|
288
|
-
if (props.touchable && state.moving) {
|
|
289
|
-
touch.move(e);
|
|
290
|
-
if (isCorrectDirection.value) {
|
|
291
|
-
move({
|
|
292
|
-
offset: delTa.value
|
|
293
|
-
});
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
};
|
|
297
|
-
const onTouchEnd = (e) => {
|
|
298
|
-
if (!props.touchable || !state.moving)
|
|
299
|
-
return;
|
|
300
|
-
const speed = delTa.value / (Date.now() - state.touchTime);
|
|
301
|
-
const isShouldMove = Math.abs(speed) > 0.3 || Math.abs(delTa.value) > +(size.value / 2).toFixed(2);
|
|
302
|
-
if (isShouldMove && isCorrectDirection.value) {
|
|
303
|
-
let pace = 0;
|
|
304
|
-
const offset = isVertical.value ? touch.offsetY.value : touch.offsetX.value;
|
|
305
|
-
if (props.loop) {
|
|
306
|
-
pace = offset > 0 ? delTa.value > 0 ? -1 : 1 : 0;
|
|
307
|
-
} else {
|
|
308
|
-
pace = -Math[delTa.value > 0 ? "ceil" : "floor"](delTa.value / size.value);
|
|
309
|
-
}
|
|
310
|
-
move({
|
|
311
|
-
pace,
|
|
312
|
-
isEmit: true
|
|
181
|
+
const o = h.value / (Date.now() - e.touchTime);
|
|
182
|
+
if ((Math.abs(o) > 0.3 || Math.abs(h.value) > +(d.value / 2).toFixed(2)) && D.value) {
|
|
183
|
+
let r = 0;
|
|
184
|
+
const m = l.value ? f.offsetY.value : f.offsetX.value;
|
|
185
|
+
n.loop ? r = m > 0 ? h.value > 0 ? -1 : 1 : 0 : r = -Math[h.value > 0 ? "ceil" : "floor"](h.value / d.value), g({
|
|
186
|
+
pace: r,
|
|
187
|
+
isEmit: !0
|
|
313
188
|
});
|
|
314
|
-
} else
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
state.moving = false;
|
|
318
|
-
getStyle();
|
|
319
|
-
autoplay();
|
|
189
|
+
} else
|
|
190
|
+
h.value && g({ pace: 0 });
|
|
191
|
+
e.moving = !1, $(), w();
|
|
320
192
|
};
|
|
321
|
-
|
|
322
|
-
props,
|
|
323
|
-
size,
|
|
324
|
-
relation
|
|
325
|
-
})
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
})
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
() => props.initPage,
|
|
339
|
-
(val) => {
|
|
340
|
-
nextTick(() => {
|
|
341
|
-
init(Number(val));
|
|
193
|
+
return _("parent", {
|
|
194
|
+
props: n,
|
|
195
|
+
size: d,
|
|
196
|
+
relation: U
|
|
197
|
+
}), ue({
|
|
198
|
+
prev: x,
|
|
199
|
+
next: I,
|
|
200
|
+
to: G
|
|
201
|
+
}), ee(() => {
|
|
202
|
+
y();
|
|
203
|
+
}), te(() => {
|
|
204
|
+
y();
|
|
205
|
+
}), E(
|
|
206
|
+
() => n.initPage,
|
|
207
|
+
(t) => {
|
|
208
|
+
Y(() => {
|
|
209
|
+
X(Number(t));
|
|
342
210
|
});
|
|
343
211
|
}
|
|
344
|
-
)
|
|
345
|
-
|
|
346
|
-
() => state.children.length,
|
|
212
|
+
), E(
|
|
213
|
+
() => e.children.length,
|
|
347
214
|
() => {
|
|
348
|
-
|
|
349
|
-
|
|
215
|
+
Y(() => {
|
|
216
|
+
X();
|
|
350
217
|
});
|
|
351
218
|
}
|
|
352
|
-
)
|
|
353
|
-
|
|
354
|
-
() =>
|
|
355
|
-
|
|
356
|
-
val > 0 ? autoplay() : stopAutoPlay();
|
|
219
|
+
), E(
|
|
220
|
+
() => n.autoPlay,
|
|
221
|
+
(t) => {
|
|
222
|
+
t > 0 ? w() : y();
|
|
357
223
|
}
|
|
358
|
-
)
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
onTouchEnd
|
|
224
|
+
), {
|
|
225
|
+
state: e,
|
|
226
|
+
classes: v,
|
|
227
|
+
classesInner: q,
|
|
228
|
+
classesPagination: R,
|
|
229
|
+
container: N,
|
|
230
|
+
activePagination: O,
|
|
231
|
+
onTouchStart: H,
|
|
232
|
+
onTouchMove: J,
|
|
233
|
+
onTouchEnd: K
|
|
369
234
|
};
|
|
370
235
|
}
|
|
371
236
|
});
|
|
372
|
-
function
|
|
373
|
-
return
|
|
237
|
+
function ve(n, c, p, N, e, f) {
|
|
238
|
+
return P(), b("view", {
|
|
374
239
|
ref: "container",
|
|
375
|
-
class:
|
|
376
|
-
onTouchstart:
|
|
377
|
-
onTouchmove:
|
|
378
|
-
onTouchend:
|
|
379
|
-
onTouchcancel:
|
|
240
|
+
class: S(n.classes),
|
|
241
|
+
onTouchstart: c[0] || (c[0] = (...v) => n.onTouchStart && n.onTouchStart(...v)),
|
|
242
|
+
onTouchmove: c[1] || (c[1] = (...v) => n.onTouchMove && n.onTouchMove(...v)),
|
|
243
|
+
onTouchend: c[2] || (c[2] = (...v) => n.onTouchEnd && n.onTouchEnd(...v)),
|
|
244
|
+
onTouchcancel: c[3] || (c[3] = (...v) => n.onTouchEnd && n.onTouchEnd(...v))
|
|
380
245
|
}, [
|
|
381
|
-
|
|
382
|
-
class:
|
|
383
|
-
style:
|
|
246
|
+
ne("view", {
|
|
247
|
+
class: S(n.classesInner),
|
|
248
|
+
style: L(n.state.style)
|
|
384
249
|
}, [
|
|
385
|
-
|
|
250
|
+
j(n.$slots, "default")
|
|
386
251
|
], 6),
|
|
387
|
-
|
|
388
|
-
|
|
252
|
+
j(n.$slots, "page"),
|
|
253
|
+
n.paginationVisible && !n.$slots.page ? (P(), b("view", {
|
|
389
254
|
key: 0,
|
|
390
|
-
class:
|
|
255
|
+
class: S(n.classesPagination)
|
|
391
256
|
}, [
|
|
392
|
-
(
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
}), 128))
|
|
401
|
-
], 2)) : createCommentVNode("", true)
|
|
257
|
+
(P(!0), b(oe, null, ae(n.state.children.length, (v, l) => (P(), b("i", {
|
|
258
|
+
style: L({
|
|
259
|
+
backgroundColor: n.activePagination === l ? n.paginationColor : "#ddd"
|
|
260
|
+
}),
|
|
261
|
+
class: S({ active: n.activePagination === l }),
|
|
262
|
+
key: l
|
|
263
|
+
}, null, 6))), 128))
|
|
264
|
+
], 2)) : ie("", !0)
|
|
402
265
|
], 34);
|
|
403
266
|
}
|
|
404
|
-
const
|
|
267
|
+
const we = /* @__PURE__ */ se(fe, [["render", ve]]);
|
|
405
268
|
export {
|
|
406
|
-
|
|
269
|
+
we as default
|
|
407
270
|
};
|
|
@@ -1,55 +1,39 @@
|
|
|
1
|
-
import { inject, getCurrentInstance, reactive, computed, onUnmounted, openBlock, createElementBlock
|
|
2
|
-
import { c as
|
|
3
|
-
import { u as
|
|
4
|
-
import { _ as
|
|
1
|
+
import { inject as p, getCurrentInstance as c, reactive as m, computed as a, onUnmounted as u, openBlock as d, createElementBlock as $, normalizeClass as h, normalizeStyle as z, renderSlot as _ } from "vue";
|
|
2
|
+
import { c as x } from "./component-234624bc.js";
|
|
3
|
+
import { u as y } from "./index-fadb0974.js";
|
|
4
|
+
import { _ as C } from "./_plugin-vue_export-helper-dad06003.js";
|
|
5
5
|
import "../locale/lang";
|
|
6
|
-
const { create, componentName } =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const state = reactive({
|
|
6
|
+
const { create: v, componentName: w } = x("swiper-item"), S = v({
|
|
7
|
+
setup(s, { slots: l }) {
|
|
8
|
+
const e = p("parent");
|
|
9
|
+
e.relation(c());
|
|
10
|
+
const o = m({
|
|
12
11
|
offset: 0
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const style = computed(() => {
|
|
21
|
-
const style2 = {};
|
|
22
|
-
const direction = parent == null ? void 0 : parent.props.direction;
|
|
23
|
-
if (parent == null ? void 0 : parent.size.value) {
|
|
24
|
-
style2[direction === "horizontal" ? "width" : "height"] = `${parent == null ? void 0 : parent.size.value}px`;
|
|
25
|
-
}
|
|
26
|
-
if (state.offset) {
|
|
27
|
-
style2["transform"] = `translate${direction === "horizontal" ? "X" : "Y"}(${state.offset}px)`;
|
|
28
|
-
}
|
|
29
|
-
return style2;
|
|
30
|
-
});
|
|
31
|
-
const setOffset = (offset) => {
|
|
32
|
-
state.offset = offset;
|
|
12
|
+
}), r = a(() => ({
|
|
13
|
+
[w]: !0
|
|
14
|
+
})), n = a(() => {
|
|
15
|
+
const t = {}, i = e == null ? void 0 : e.props.direction;
|
|
16
|
+
return e != null && e.size.value && (t[i === "horizontal" ? "width" : "height"] = `${e == null ? void 0 : e.size.value}px`), o.offset && (t.transform = `translate${i === "horizontal" ? "X" : "Y"}(${o.offset}px)`), t;
|
|
17
|
+
}), f = (t) => {
|
|
18
|
+
o.offset = t;
|
|
33
19
|
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
style,
|
|
40
|
-
classes
|
|
20
|
+
return u(() => {
|
|
21
|
+
e.relation(c(), "unmount");
|
|
22
|
+
}), y({ setOffset: f }), {
|
|
23
|
+
style: n,
|
|
24
|
+
classes: r
|
|
41
25
|
};
|
|
42
26
|
}
|
|
43
27
|
});
|
|
44
|
-
function
|
|
45
|
-
return
|
|
46
|
-
class:
|
|
47
|
-
style:
|
|
28
|
+
function g(s, l, e, o, r, n) {
|
|
29
|
+
return d(), $("view", {
|
|
30
|
+
class: h(s.classes),
|
|
31
|
+
style: z(s.style)
|
|
48
32
|
}, [
|
|
49
|
-
|
|
33
|
+
_(s.$slots, "default")
|
|
50
34
|
], 6);
|
|
51
35
|
}
|
|
52
|
-
const
|
|
36
|
+
const N = /* @__PURE__ */ C(S, [["render", g]]);
|
|
53
37
|
export {
|
|
54
|
-
|
|
38
|
+
N as default
|
|
55
39
|
};
|