@nutui/nutui 3.1.10 → 3.1.12-beta.1
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 +17 -0
- package/dist/nutui.d.ts +5 -1
- package/dist/nutui.es.js +4041 -3518
- package/dist/nutui.umd.js +4084 -3627
- package/dist/packages/_es/ActionSheet.js +13 -12
- package/dist/packages/_es/Address.js +63 -49
- package/dist/packages/_es/Avatar.js +4 -5
- package/dist/packages/_es/BackTop.js +72 -109
- package/dist/packages/_es/Badge.js +4 -5
- package/dist/packages/_es/Barrage.js +63 -57
- package/dist/packages/_es/Button.js +5 -6
- package/dist/packages/_es/Calendar.js +27 -18
- package/dist/packages/_es/Card.js +104 -0
- package/dist/packages/_es/Cell.js +5 -13
- package/dist/packages/_es/CellGroup.js +4 -5
- package/dist/packages/_es/Checkbox.js +3 -3
- package/dist/packages/_es/CheckboxGroup.js +9 -4
- package/dist/packages/_es/CircleProgress.js +142 -46
- package/dist/packages/_es/Col.js +4 -5
- package/dist/packages/_es/Collapse.js +35 -10
- package/dist/packages/_es/CollapseItem.js +80 -35
- package/dist/packages/_es/CountDown.js +7 -5
- package/dist/packages/_es/CountUp.js +34 -31
- package/dist/packages/_es/DatePicker.js +451 -219
- package/dist/packages/_es/Dialog.js +13 -87
- package/dist/packages/_es/Divider.js +5 -6
- package/dist/packages/_es/Drag.js +76 -50
- package/dist/packages/_es/Elevator.js +81 -52
- package/dist/packages/_es/FixedNav.js +8 -9
- package/dist/packages/_es/Form.js +137 -0
- package/dist/packages/_es/FormItem.js +109 -0
- package/dist/packages/_es/Icon.js +6 -40
- package/dist/packages/_es/ImagePreview.js +23 -21
- package/dist/packages/_es/InfiniteLoading.js +95 -109
- package/dist/packages/_es/Input.js +22 -21
- package/dist/packages/_es/InputNumber.js +24 -18
- package/dist/packages/_es/Layout.js +2 -2
- package/dist/packages/_es/Menu.js +89 -171
- package/dist/packages/_es/MenuItem.js +155 -18
- package/dist/packages/_es/Navbar.js +7 -7
- package/dist/packages/_es/NoticeBar.js +39 -26
- package/dist/packages/_es/Notify.js +30 -166
- package/dist/packages/_es/NumberKeyboard.js +10 -6
- package/dist/packages/_es/OverLay.js +22 -29
- package/dist/packages/_es/Pagination.js +8 -9
- package/dist/packages/_es/Picker.js +61 -447
- package/dist/packages/_es/Popover.js +146 -25
- package/dist/packages/_es/Popup.js +18 -39
- package/dist/packages/_es/Price.js +18 -7
- package/dist/packages/_es/Progress.js +23 -12
- package/dist/packages/_es/Radio.js +20 -7
- package/dist/packages/_es/RadioGroup.js +7 -3
- package/dist/packages/_es/Range.js +38 -59
- package/dist/packages/_es/Rate.js +16 -20
- package/dist/packages/_es/Row.js +4 -5
- package/dist/packages/_es/SearchBar.js +7 -5
- package/dist/packages/_es/ShortPassword.js +89 -59
- package/dist/packages/_es/Signature.js +70 -71
- package/dist/packages/_es/Sku.js +508 -0
- package/dist/packages/_es/Step.js +10 -8
- package/dist/packages/_es/Steps.js +2 -2
- package/dist/packages/_es/Swipe.js +42 -27
- package/dist/packages/_es/Swiper.js +17 -418
- package/dist/packages/_es/SwiperItem.js +14 -39
- package/dist/packages/_es/Switch.js +4 -5
- package/dist/packages/_es/TabPane.js +4 -5
- package/dist/packages/_es/Tabbar.js +4 -5
- package/dist/packages/_es/TabbarItem.js +8 -9
- package/dist/packages/_es/Tabs.js +23 -17
- package/dist/packages/_es/Tag.js +5 -6
- package/dist/packages/_es/TextArea.js +16 -12
- package/dist/packages/_es/TimeDetail.js +7 -5
- package/dist/packages/_es/TimePannel.js +7 -5
- package/dist/packages/_es/TimeSelect.js +12 -7
- package/dist/packages/_es/Toast.js +41 -163
- package/dist/packages/_es/Uploader.js +210 -164
- package/dist/packages/_es/commonProps.js +30 -0
- package/dist/packages/_es/component.js +1 -1
- package/dist/packages/_es/index.js +1 -1
- package/dist/packages/_es/index.taro.vue_vue&type=script&lang.js +44 -0
- package/dist/packages/_es/index2.js +44 -8
- package/dist/packages/_es/index3.js +419 -0
- package/dist/packages/_es/pxCheck.js +1 -1
- package/dist/packages/_es/raf.js +1 -1
- package/dist/packages/_es/use-lock-scroll.js +23 -0
- package/dist/packages/_es/util.js +47 -0
- package/dist/packages/button/index.scss +9 -0
- package/dist/packages/card/index.scss +97 -0
- package/dist/packages/checkbox/index.scss +1 -1
- package/dist/packages/form/index.scss +2 -0
- package/dist/packages/formitem/index.scss +60 -0
- package/dist/packages/menu/index.scss +32 -60
- package/dist/packages/menuitem/index.scss +36 -99
- package/dist/packages/numberkeyboard/index.scss +1 -1
- package/dist/packages/progress/index.scss +2 -0
- package/dist/packages/radio/index.scss +32 -4
- package/dist/packages/radiogroup/index.scss +20 -0
- package/dist/packages/sku/index.scss +147 -0
- package/dist/packages/switch/index.scss +1 -1
- package/dist/packages/uploader/index.scss +95 -8
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -2
- package/dist/styles/mixins/index.scss +0 -4
- package/dist/styles/themes/default.scss +34 -30
- package/dist/styles/variables.scss +45 -3
- package/package.json +3 -2
- package/dist/packages/_es/Video.js +0 -405
- package/dist/packages/_es/plugin-vue_export-helper.js +0 -12
- package/dist/packages/_es/style.css +0 -160
|
@@ -1,429 +1,28 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { reactive, ref, computed, provide, onMounted, nextTick, onActivated, onDeactivated, onBeforeUnmount, watch, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, renderSlot, Fragment, renderList, createCommentVNode } from "vue";
|
|
7
6
|
import { c as createComponent } from "./component.js";
|
|
8
|
-
import {
|
|
9
|
-
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
10
|
-
const DISTANCE = 5;
|
|
11
|
-
function useTouch() {
|
|
12
|
-
const state = reactive({
|
|
13
|
-
startX: 0,
|
|
14
|
-
startY: 0,
|
|
15
|
-
deltaX: 0,
|
|
16
|
-
deltaY: 0,
|
|
17
|
-
offsetX: 0,
|
|
18
|
-
offsetY: 0,
|
|
19
|
-
direction: ""
|
|
20
|
-
});
|
|
21
|
-
const getDirection = (x, y) => {
|
|
22
|
-
if (x > y && x > DISTANCE)
|
|
23
|
-
return "horizontal";
|
|
24
|
-
if (y > x && y > DISTANCE)
|
|
25
|
-
return "vertical";
|
|
26
|
-
return "";
|
|
27
|
-
};
|
|
28
|
-
const reset = () => {
|
|
29
|
-
state.startX = 0;
|
|
30
|
-
state.startY = 0;
|
|
31
|
-
state.deltaX = 0;
|
|
32
|
-
state.deltaY = 0;
|
|
33
|
-
state.offsetX = 0;
|
|
34
|
-
state.offsetY = 0;
|
|
35
|
-
state.direction = "";
|
|
36
|
-
};
|
|
37
|
-
const start = (e) => {
|
|
38
|
-
reset();
|
|
39
|
-
state.startX = e.touches[0].clientX;
|
|
40
|
-
state.startY = e.touches[0].clientY;
|
|
41
|
-
};
|
|
42
|
-
const move = (e) => {
|
|
43
|
-
state.deltaX = e.touches[0].clientX - state.startX;
|
|
44
|
-
state.deltaY = e.touches[0].clientY - state.startY;
|
|
45
|
-
state.offsetX = Math.abs(state.deltaX);
|
|
46
|
-
state.offsetY = Math.abs(state.deltaY);
|
|
47
|
-
if (!state.direction) {
|
|
48
|
-
state.direction = getDirection(state.offsetX, state.offsetY);
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
return {
|
|
52
|
-
state,
|
|
53
|
-
start,
|
|
54
|
-
reset,
|
|
55
|
-
move
|
|
56
|
-
};
|
|
57
|
-
}
|
|
7
|
+
import { resolveComponent, openBlock, createBlock, normalizeProps, guardReactiveProps, withCtx, renderSlot } from "vue";
|
|
58
8
|
const { create, componentName } = createComponent("swiper");
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
type: [Number, String],
|
|
67
|
-
default: 0
|
|
68
|
-
},
|
|
69
|
-
direction: {
|
|
70
|
-
type: [String],
|
|
71
|
-
default: "horizontal"
|
|
72
|
-
},
|
|
73
|
-
paginationVisible: {
|
|
74
|
-
type: Boolean,
|
|
75
|
-
default: false
|
|
76
|
-
},
|
|
77
|
-
paginationColor: {
|
|
78
|
-
type: String,
|
|
79
|
-
default: "#fff"
|
|
80
|
-
},
|
|
81
|
-
loop: {
|
|
82
|
-
type: Boolean,
|
|
83
|
-
default: true
|
|
84
|
-
},
|
|
85
|
-
duration: {
|
|
86
|
-
type: [Number, String],
|
|
87
|
-
default: 500
|
|
88
|
-
},
|
|
89
|
-
autoPlay: {
|
|
90
|
-
type: [Number, String],
|
|
91
|
-
default: 0
|
|
92
|
-
},
|
|
93
|
-
initPage: {
|
|
94
|
-
type: [Number, String],
|
|
95
|
-
default: 0
|
|
96
|
-
},
|
|
97
|
-
touchable: {
|
|
98
|
-
type: Boolean,
|
|
99
|
-
default: true
|
|
100
|
-
},
|
|
101
|
-
isPreventDefault: {
|
|
102
|
-
type: Boolean,
|
|
103
|
-
default: true
|
|
104
|
-
},
|
|
105
|
-
isStopPropagation: {
|
|
106
|
-
type: Boolean,
|
|
107
|
-
default: true
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
emits: ["change"],
|
|
111
|
-
setup(props, { emit, slots }) {
|
|
112
|
-
const container = ref();
|
|
113
|
-
const state = reactive({
|
|
114
|
-
active: 0,
|
|
115
|
-
num: 0,
|
|
116
|
-
rect: null,
|
|
117
|
-
width: 0,
|
|
118
|
-
height: 0,
|
|
119
|
-
moving: false,
|
|
120
|
-
offset: 0,
|
|
121
|
-
touchTime: 0,
|
|
122
|
-
autoplayTimer: 0,
|
|
123
|
-
children: [],
|
|
124
|
-
style: {}
|
|
125
|
-
});
|
|
126
|
-
const touch = useTouch();
|
|
127
|
-
const classes = computed(() => {
|
|
128
|
-
const prefixCls = componentName;
|
|
129
|
-
return {
|
|
130
|
-
[prefixCls]: true
|
|
131
|
-
};
|
|
132
|
-
});
|
|
133
|
-
const isVertical = computed(() => props.direction === "vertical");
|
|
134
|
-
const delTa = computed(() => {
|
|
135
|
-
return isVertical.value ? touch.state.deltaY : touch.state.deltaX;
|
|
136
|
-
});
|
|
137
|
-
const isCorrectDirection = computed(() => {
|
|
138
|
-
return touch.state.direction === props.direction;
|
|
139
|
-
});
|
|
140
|
-
const childCount = computed(() => state.children.length);
|
|
141
|
-
const size = computed(() => state[isVertical.value ? "height" : "width"]);
|
|
142
|
-
const trackSize = computed(() => childCount.value * size.value);
|
|
143
|
-
const minOffset = computed(() => {
|
|
144
|
-
if (state.rect) {
|
|
145
|
-
const base = isVertical.value ? state.rect.height : state.rect.width;
|
|
146
|
-
return base - size.value * childCount.value;
|
|
147
|
-
}
|
|
148
|
-
return 0;
|
|
149
|
-
});
|
|
150
|
-
const activePagination = computed(() => (state.active + childCount.value) % childCount.value);
|
|
151
|
-
const getStyle = () => {
|
|
152
|
-
state.style = {
|
|
153
|
-
transitionDuration: `${state.moving ? 0 : props.duration}ms`,
|
|
154
|
-
transform: `translate${isVertical.value ? "Y" : "X"}(${state.offset}px)`,
|
|
155
|
-
[isVertical.value ? "height" : "width"]: `${size.value * childCount.value}px`,
|
|
156
|
-
[isVertical.value ? "width" : "height"]: `${isVertical.value ? state.width : state.height}px`
|
|
157
|
-
};
|
|
158
|
-
};
|
|
159
|
-
const relation = (child) => {
|
|
160
|
-
if (child.proxy) {
|
|
161
|
-
state.children.push(child.proxy);
|
|
162
|
-
}
|
|
163
|
-
};
|
|
164
|
-
const range = (num, min, max) => {
|
|
165
|
-
return Math.min(Math.max(num, min), max);
|
|
166
|
-
};
|
|
167
|
-
const requestFrame = (fn) => {
|
|
168
|
-
window.requestAnimationFrame.call(window, fn);
|
|
169
|
-
};
|
|
170
|
-
const getOffset = (active, offset = 0) => {
|
|
171
|
-
let currentPosition = active * size.value;
|
|
172
|
-
if (!props.loop) {
|
|
173
|
-
currentPosition = Math.min(currentPosition, -minOffset.value);
|
|
174
|
-
}
|
|
175
|
-
let targetOffset = offset - currentPosition;
|
|
176
|
-
if (!props.loop) {
|
|
177
|
-
targetOffset = range(targetOffset, minOffset.value, 0);
|
|
178
|
-
}
|
|
179
|
-
return targetOffset;
|
|
180
|
-
};
|
|
181
|
-
const getActive = (pace) => {
|
|
182
|
-
const { active } = state;
|
|
183
|
-
if (pace) {
|
|
184
|
-
if (props.loop) {
|
|
185
|
-
return range(active + pace, -1, childCount.value);
|
|
186
|
-
}
|
|
187
|
-
return range(active + pace, 0, childCount.value - 1);
|
|
188
|
-
}
|
|
189
|
-
return active;
|
|
190
|
-
};
|
|
191
|
-
const move = ({ pace = 0, offset = 0, isEmit = false }) => {
|
|
192
|
-
if (childCount.value <= 1)
|
|
193
|
-
return;
|
|
194
|
-
const { active } = state;
|
|
195
|
-
const targetActive = getActive(pace);
|
|
196
|
-
const targetOffset = getOffset(targetActive, offset);
|
|
197
|
-
if (props.loop) {
|
|
198
|
-
if (state.children[0] && targetOffset !== minOffset.value) {
|
|
199
|
-
const rightBound = targetOffset < minOffset.value;
|
|
200
|
-
state.children[0].setOffset(rightBound ? trackSize.value : 0);
|
|
201
|
-
}
|
|
202
|
-
if (state.children[childCount.value - 1] && targetOffset !== 0) {
|
|
203
|
-
const leftBound = targetOffset > 0;
|
|
204
|
-
state.children[childCount.value - 1].setOffset(leftBound ? -trackSize.value : 0);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
state.active = targetActive;
|
|
208
|
-
state.offset = targetOffset;
|
|
209
|
-
if (isEmit && active !== state.active) {
|
|
210
|
-
emit("change", activePagination.value);
|
|
211
|
-
}
|
|
212
|
-
getStyle();
|
|
213
|
-
};
|
|
214
|
-
const resettPosition = () => {
|
|
215
|
-
state.moving = true;
|
|
216
|
-
if (state.active <= -1) {
|
|
217
|
-
move({ pace: childCount.value });
|
|
218
|
-
}
|
|
219
|
-
if (state.active >= childCount.value) {
|
|
220
|
-
move({ pace: -childCount.value });
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
const stopAutoPlay = () => {
|
|
224
|
-
clearTimeout(state.autoplayTimer);
|
|
225
|
-
};
|
|
226
|
-
const prev = () => {
|
|
227
|
-
resettPosition();
|
|
228
|
-
touch.reset();
|
|
229
|
-
requestFrame(() => {
|
|
230
|
-
requestFrame(() => {
|
|
231
|
-
state.moving = false;
|
|
232
|
-
move({
|
|
233
|
-
pace: -1,
|
|
234
|
-
isEmit: true
|
|
235
|
-
});
|
|
236
|
-
});
|
|
237
|
-
});
|
|
238
|
-
};
|
|
239
|
-
const next = () => {
|
|
240
|
-
resettPosition();
|
|
241
|
-
touch.reset();
|
|
242
|
-
requestFrame(() => {
|
|
243
|
-
requestFrame(() => {
|
|
244
|
-
state.moving = false;
|
|
245
|
-
move({
|
|
246
|
-
pace: 1,
|
|
247
|
-
isEmit: true
|
|
248
|
-
});
|
|
249
|
-
});
|
|
250
|
-
});
|
|
251
|
-
};
|
|
252
|
-
const to = (index2) => {
|
|
253
|
-
resettPosition();
|
|
254
|
-
touch.reset();
|
|
255
|
-
requestFrame(() => {
|
|
256
|
-
requestFrame(() => {
|
|
257
|
-
state.moving = false;
|
|
258
|
-
let targetIndex;
|
|
259
|
-
if (props.loop && childCount.value === index2) {
|
|
260
|
-
targetIndex = state.active === 0 ? 0 : index2;
|
|
261
|
-
} else {
|
|
262
|
-
targetIndex = index2 % childCount.value;
|
|
263
|
-
}
|
|
264
|
-
move({
|
|
265
|
-
pace: targetIndex - state.active,
|
|
266
|
-
isEmit: true
|
|
267
|
-
});
|
|
268
|
-
});
|
|
269
|
-
});
|
|
270
|
-
};
|
|
271
|
-
const autoplay = () => {
|
|
272
|
-
if (props.autoPlay <= 0 || childCount.value <= 1)
|
|
273
|
-
return;
|
|
274
|
-
stopAutoPlay();
|
|
275
|
-
state.autoplayTimer = setTimeout(() => {
|
|
276
|
-
next();
|
|
277
|
-
autoplay();
|
|
278
|
-
}, Number(props.autoPlay));
|
|
279
|
-
};
|
|
280
|
-
const init = (active = +props.initPage) => {
|
|
281
|
-
stopAutoPlay();
|
|
282
|
-
state.rect = container.value.getBoundingClientRect();
|
|
283
|
-
active = Math.min(childCount.value - 1, active);
|
|
284
|
-
state.width = props.width ? +props.width : state.rect.width;
|
|
285
|
-
state.height = props.height ? +props.height : state.rect.height;
|
|
286
|
-
state.active = active;
|
|
287
|
-
state.offset = getOffset(state.active);
|
|
288
|
-
state.moving = true;
|
|
289
|
-
getStyle();
|
|
290
|
-
autoplay();
|
|
291
|
-
};
|
|
292
|
-
const onTouchStart = (e) => {
|
|
293
|
-
if (props.isPreventDefault)
|
|
294
|
-
e.preventDefault();
|
|
295
|
-
if (props.isStopPropagation)
|
|
296
|
-
e.stopPropagation();
|
|
297
|
-
if (!props.touchable)
|
|
298
|
-
return;
|
|
299
|
-
touch.start(e);
|
|
300
|
-
state.touchTime = Date.now();
|
|
301
|
-
stopAutoPlay();
|
|
302
|
-
resettPosition();
|
|
303
|
-
};
|
|
304
|
-
const onTouchMove = (e) => {
|
|
305
|
-
if (props.touchable && state.moving) {
|
|
306
|
-
touch.move(e);
|
|
307
|
-
if (isCorrectDirection.value) {
|
|
308
|
-
move({
|
|
309
|
-
offset: delTa.value
|
|
310
|
-
});
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
};
|
|
314
|
-
const onTouchEnd = (e) => {
|
|
315
|
-
if (!props.touchable || !state.moving)
|
|
316
|
-
return;
|
|
317
|
-
const speed = delTa.value / (Date.now() - state.touchTime);
|
|
318
|
-
const isShouldMove = Math.abs(speed) > 0.3 || Math.abs(delTa.value) > +(size.value / 2).toFixed(2);
|
|
319
|
-
if (isShouldMove && isCorrectDirection.value) {
|
|
320
|
-
let pace = 0;
|
|
321
|
-
const offset = isVertical.value ? touch.state.offsetY : touch.state.offsetX;
|
|
322
|
-
if (props.loop) {
|
|
323
|
-
pace = offset > 0 ? delTa.value > 0 ? -1 : 1 : 0;
|
|
324
|
-
} else {
|
|
325
|
-
pace = -Math[delTa.value > 0 ? "ceil" : "floor"](delTa.value / size.value);
|
|
326
|
-
}
|
|
327
|
-
move({
|
|
328
|
-
pace,
|
|
329
|
-
isEmit: true
|
|
330
|
-
});
|
|
331
|
-
} else if (delTa.value) {
|
|
332
|
-
move({ pace: 0 });
|
|
333
|
-
}
|
|
334
|
-
state.moving = false;
|
|
335
|
-
getStyle();
|
|
336
|
-
autoplay();
|
|
337
|
-
};
|
|
338
|
-
provide("parent", {
|
|
339
|
-
props,
|
|
340
|
-
size,
|
|
341
|
-
relation
|
|
342
|
-
});
|
|
343
|
-
useExpose({
|
|
344
|
-
prev,
|
|
345
|
-
next,
|
|
346
|
-
to
|
|
347
|
-
});
|
|
348
|
-
onMounted(() => {
|
|
349
|
-
nextTick(() => {
|
|
350
|
-
init();
|
|
351
|
-
});
|
|
352
|
-
});
|
|
353
|
-
onActivated(() => {
|
|
354
|
-
nextTick(() => {
|
|
355
|
-
init();
|
|
356
|
-
});
|
|
357
|
-
});
|
|
358
|
-
onDeactivated(() => {
|
|
359
|
-
stopAutoPlay();
|
|
360
|
-
});
|
|
361
|
-
onBeforeUnmount(() => {
|
|
362
|
-
stopAutoPlay();
|
|
363
|
-
});
|
|
364
|
-
watch(() => props.initPage, (val) => {
|
|
365
|
-
nextTick(() => {
|
|
366
|
-
init(Number(val));
|
|
367
|
-
});
|
|
368
|
-
});
|
|
369
|
-
watch(() => state.children.length, () => {
|
|
370
|
-
nextTick(() => {
|
|
371
|
-
init(state.active);
|
|
372
|
-
});
|
|
373
|
-
});
|
|
374
|
-
watch(() => props.autoPlay, (val) => {
|
|
375
|
-
val > 0 ? autoplay() : stopAutoPlay();
|
|
376
|
-
});
|
|
377
|
-
return {
|
|
378
|
-
state,
|
|
379
|
-
classes,
|
|
380
|
-
container,
|
|
381
|
-
componentName,
|
|
382
|
-
isVertical,
|
|
383
|
-
slots,
|
|
384
|
-
activePagination,
|
|
385
|
-
onTouchStart,
|
|
386
|
-
onTouchMove,
|
|
387
|
-
onTouchEnd
|
|
388
|
-
};
|
|
9
|
+
var _sfc_main = create({
|
|
10
|
+
inheritAttrs: false,
|
|
11
|
+
props: {},
|
|
12
|
+
emits: [],
|
|
13
|
+
setup(props, context) {
|
|
14
|
+
const attrs = context.attrs;
|
|
15
|
+
return { attrs };
|
|
389
16
|
}
|
|
390
17
|
});
|
|
391
18
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
onTouchstart: _cache[0] || (_cache[0] = (...args) => _ctx.onTouchStart && _ctx.onTouchStart(...args)),
|
|
396
|
-
onTouchmove: _cache[1] || (_cache[1] = (...args) => _ctx.onTouchMove && _ctx.onTouchMove(...args)),
|
|
397
|
-
onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args)),
|
|
398
|
-
onTouchcancel: _cache[3] || (_cache[3] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args))
|
|
399
|
-
}, [
|
|
400
|
-
createElementVNode("view", {
|
|
401
|
-
class: normalizeClass({
|
|
402
|
-
[`${_ctx.componentName}-inner`]: true,
|
|
403
|
-
[`${_ctx.componentName}-vertical`]: _ctx.isVertical
|
|
404
|
-
}),
|
|
405
|
-
style: normalizeStyle(_ctx.state.style)
|
|
406
|
-
}, [
|
|
19
|
+
const _component_swiper = resolveComponent("swiper");
|
|
20
|
+
return openBlock(), createBlock(_component_swiper, normalizeProps(guardReactiveProps(_ctx.attrs)), {
|
|
21
|
+
default: withCtx(() => [
|
|
407
22
|
renderSlot(_ctx.$slots, "default")
|
|
408
|
-
]
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
key: 0,
|
|
412
|
-
class: normalizeClass({
|
|
413
|
-
[`${_ctx.componentName}-pagination`]: true,
|
|
414
|
-
[`${_ctx.componentName}-pagination-vertical`]: _ctx.isVertical
|
|
415
|
-
})
|
|
416
|
-
}, [
|
|
417
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.state.children.length, (item, index2) => {
|
|
418
|
-
return openBlock(), createElementBlock("i", {
|
|
419
|
-
style: normalizeStyle({
|
|
420
|
-
backgroundColor: _ctx.activePagination === index2 ? _ctx.paginationColor : "#ddd"
|
|
421
|
-
}),
|
|
422
|
-
key: index2
|
|
423
|
-
}, null, 4);
|
|
424
|
-
}), 128))
|
|
425
|
-
], 2)) : createCommentVNode("", true)
|
|
426
|
-
], 34);
|
|
23
|
+
]),
|
|
24
|
+
_: 3
|
|
25
|
+
}, 16);
|
|
427
26
|
}
|
|
428
|
-
|
|
429
|
-
export {
|
|
27
|
+
_sfc_main.render = _sfc_render;
|
|
28
|
+
export { _sfc_main as default };
|
|
@@ -1,60 +1,35 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { computed, resolveComponent, openBlock, createBlock, normalizeClass, withCtx, renderSlot } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
|
-
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
|
-
function useExpose(apis) {
|
|
10
|
-
const instance = getCurrentInstance();
|
|
11
|
-
if (instance) {
|
|
12
|
-
Object.assign(instance.proxy, apis);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
8
|
const { create, componentName } = createComponent("swiper-item");
|
|
16
|
-
|
|
9
|
+
var _sfc_main = create({
|
|
17
10
|
props: {},
|
|
18
11
|
setup(props, { slots }) {
|
|
19
|
-
const parent = inject("parent");
|
|
20
|
-
parent["relation"](getCurrentInstance());
|
|
21
|
-
const state = reactive({
|
|
22
|
-
offset: 0
|
|
23
|
-
});
|
|
24
12
|
const classes = computed(() => {
|
|
25
13
|
const prefixCls = componentName;
|
|
26
14
|
return {
|
|
27
15
|
[prefixCls]: true
|
|
28
16
|
};
|
|
29
17
|
});
|
|
30
|
-
const style = computed(() => {
|
|
31
|
-
const style2 = {};
|
|
32
|
-
const direction = parent == null ? void 0 : parent.props.direction;
|
|
33
|
-
if (parent == null ? void 0 : parent.size.value) {
|
|
34
|
-
style2[direction === "horizontal" ? "width" : "height"] = `${parent == null ? void 0 : parent.size.value}px`;
|
|
35
|
-
}
|
|
36
|
-
if (state.offset) {
|
|
37
|
-
style2["transform"] = `translate${direction === "horizontal" ? "X" : "Y"}(${state.offset}px)`;
|
|
38
|
-
}
|
|
39
|
-
return style2;
|
|
40
|
-
});
|
|
41
|
-
const setOffset = (offset) => {
|
|
42
|
-
state.offset = offset;
|
|
43
|
-
};
|
|
44
|
-
useExpose({ setOffset });
|
|
45
18
|
return {
|
|
46
|
-
style,
|
|
47
19
|
classes
|
|
48
20
|
};
|
|
49
21
|
}
|
|
50
22
|
});
|
|
51
23
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
|
|
24
|
+
const _component_swiper_item = resolveComponent("swiper-item");
|
|
25
|
+
return openBlock(), createBlock(_component_swiper_item, {
|
|
26
|
+
class: normalizeClass(_ctx.classes)
|
|
27
|
+
}, {
|
|
28
|
+
default: withCtx(() => [
|
|
29
|
+
renderSlot(_ctx.$slots, "default")
|
|
30
|
+
]),
|
|
31
|
+
_: 3
|
|
32
|
+
}, 8, ["class"]);
|
|
58
33
|
}
|
|
59
|
-
|
|
60
|
-
export {
|
|
34
|
+
_sfc_main.render = _sfc_render;
|
|
35
|
+
export { _sfc_main as default };
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, withDirectives, vShow, Fragment, toDisplayString, createCommentVNode } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
|
-
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
8
|
const { componentName, create } = createComponent("switch");
|
|
10
|
-
|
|
9
|
+
var _sfc_main = create({
|
|
11
10
|
props: {
|
|
12
11
|
modelValue: {
|
|
13
12
|
type: Boolean,
|
|
@@ -86,5 +85,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
86
85
|
])
|
|
87
86
|
], 6);
|
|
88
87
|
}
|
|
89
|
-
|
|
90
|
-
export {
|
|
88
|
+
_sfc_main.render = _sfc_render;
|
|
89
|
+
export { _sfc_main as default };
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { inject, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
|
-
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
8
|
const { create } = createComponent("tabpane");
|
|
10
|
-
|
|
9
|
+
var _sfc_main = create({
|
|
11
10
|
props: {
|
|
12
11
|
title: {
|
|
13
12
|
type: [String, Number],
|
|
@@ -35,5 +34,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
35
34
|
renderSlot(_ctx.$slots, "default")
|
|
36
35
|
], 2);
|
|
37
36
|
}
|
|
38
|
-
|
|
39
|
-
export {
|
|
37
|
+
_sfc_main.render = _sfc_render;
|
|
38
|
+
export { _sfc_main as default };
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { reactive, provide, watch, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
|
-
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
8
|
const { create } = createComponent("tabbar");
|
|
10
|
-
|
|
9
|
+
var _sfc_main = create({
|
|
11
10
|
props: {
|
|
12
11
|
visible: {
|
|
13
12
|
type: [Number, String],
|
|
@@ -69,5 +68,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
69
68
|
renderSlot(_ctx.$slots, "default")
|
|
70
69
|
], 2);
|
|
71
70
|
}
|
|
72
|
-
|
|
73
|
-
export {
|
|
71
|
+
_sfc_main.render = _sfc_render;
|
|
72
|
+
export { _sfc_main as default };
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { c as createComponent } from "./component.js";
|
|
7
7
|
import { useRouter } from "vue-router";
|
|
8
8
|
import { inject, reactive, getCurrentInstance, computed, watch, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, toDisplayString, createCommentVNode, createVNode } from "vue";
|
|
9
|
-
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
10
9
|
const { create } = createComponent("tabbar-item");
|
|
11
|
-
|
|
10
|
+
var _sfc_main = create({
|
|
12
11
|
props: {
|
|
13
12
|
tabTitle: {
|
|
14
13
|
type: String,
|
|
@@ -56,14 +55,14 @@ const _sfc_main = create({
|
|
|
56
55
|
const router = useRouter();
|
|
57
56
|
const relation = (child) => {
|
|
58
57
|
if (child.proxy) {
|
|
59
|
-
let
|
|
60
|
-
state.index =
|
|
58
|
+
let index = parent.children.length;
|
|
59
|
+
state.index = index;
|
|
61
60
|
parent.children.push(child.proxy);
|
|
62
61
|
}
|
|
63
62
|
};
|
|
64
63
|
relation(getCurrentInstance());
|
|
65
|
-
function change(
|
|
66
|
-
parent.changeIndex(
|
|
64
|
+
function change(index) {
|
|
65
|
+
parent.changeIndex(index);
|
|
67
66
|
}
|
|
68
67
|
const choosed = computed(() => {
|
|
69
68
|
if (parent) {
|
|
@@ -134,5 +133,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
134
133
|
])
|
|
135
134
|
], 6);
|
|
136
135
|
}
|
|
137
|
-
|
|
138
|
-
export {
|
|
136
|
+
_sfc_main.render = _sfc_render;
|
|
137
|
+
export { _sfc_main as default };
|