@nutui/nutui 3.3.0 → 3.3.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nutui.es.js +324 -295
- package/dist/nutui.umd.js +320 -291
- package/dist/packages/_es/ActionSheet.js +1 -1
- package/dist/packages/_es/Address.js +1 -1
- package/dist/packages/_es/AddressList.js +2 -2
- package/dist/packages/_es/Animate.js +1 -1
- package/dist/packages/_es/Audio.js +1 -1
- package/dist/packages/_es/AudioOperate.js +1 -1
- package/dist/packages/_es/Avatar.js +1 -1
- package/dist/packages/_es/AvatarGroup.js +1 -1
- package/dist/packages/_es/BackTop.js +1 -1
- package/dist/packages/_es/Badge.js +1 -1
- package/dist/packages/_es/Barrage.js +1 -1
- package/dist/packages/_es/Button.js +1 -1
- package/dist/packages/_es/Calendar.js +1 -1
- package/dist/packages/_es/CalendarItem.js +1 -1
- package/dist/packages/_es/Card.js +1 -1
- package/dist/packages/_es/Cascader.js +1 -1
- package/dist/packages/_es/Category.js +1 -1
- package/dist/packages/_es/CategoryPane.js +1 -1
- package/dist/packages/_es/Cell.js +1 -1
- package/dist/packages/_es/CellGroup.js +1 -1
- package/dist/packages/_es/Checkbox.js +1 -1
- package/dist/packages/_es/CheckboxGroup.js +1 -1
- package/dist/packages/_es/CircleProgress.js +2 -2
- package/dist/packages/_es/Col.js +1 -1
- package/dist/packages/_es/Collapse.js +1 -1
- package/dist/packages/_es/CollapseItem.js +1 -1
- package/dist/packages/_es/Comment.js +1 -1
- package/dist/packages/_es/ConfigProvider.js +1 -1
- package/dist/packages/_es/CountDown.js +1 -1
- package/dist/packages/_es/CountUp.js +1 -1
- package/dist/packages/_es/DatePicker.js +1 -1
- package/dist/packages/_es/Dialog.js +1 -1
- package/dist/packages/_es/Divider.js +1 -1
- package/dist/packages/_es/Drag.js +1 -1
- package/dist/packages/_es/Ecard.js +1 -1
- package/dist/packages/_es/Elevator.js +1 -1
- package/dist/packages/_es/Ellipsis.js +1 -1
- package/dist/packages/_es/Empty.js +1 -1
- package/dist/packages/_es/FixedNav.js +1 -1
- package/dist/packages/_es/Form.js +2 -2
- package/dist/packages/_es/FormItem.js +1 -1
- package/dist/packages/_es/Grid.js +1 -1
- package/dist/packages/_es/GridItem.js +1 -1
- package/dist/packages/_es/Icon.js +1 -1
- package/dist/packages/_es/Image.js +1 -1
- package/dist/packages/_es/ImagePreview.js +3 -3
- package/dist/packages/_es/Indicator.js +1 -1
- package/dist/packages/_es/InfiniteLoading.js +18 -26
- package/dist/packages/_es/Input.js +1 -1
- package/dist/packages/_es/InputNumber.js +1 -1
- package/dist/packages/_es/Invoice.js +1 -1
- package/dist/packages/_es/Layout.js +1 -1
- package/dist/packages/_es/List.js +1 -1
- package/dist/packages/_es/Menu.js +1 -1
- package/dist/packages/_es/MenuItem.js +1 -1
- package/dist/packages/_es/Navbar.js +1 -1
- package/dist/packages/_es/NoticeBar.js +1 -1
- package/dist/packages/_es/Notify.js +1 -1
- package/dist/packages/_es/NumberKeyboard.js +1 -1
- package/dist/packages/_es/OverLay.js +1 -1
- package/dist/packages/_es/Pagination.js +1 -1
- package/dist/packages/_es/Picker.js +17 -7
- package/dist/packages/_es/Popover.js +171 -81
- package/dist/packages/_es/Popup.js +1 -1
- package/dist/packages/_es/Price.js +7 -2
- package/dist/packages/_es/Progress.js +1 -1
- package/dist/packages/_es/Radio.js +1 -1
- package/dist/packages/_es/RadioGroup.js +1 -1
- package/dist/packages/_es/Range.js +1 -1
- package/dist/packages/_es/Rate.js +1 -1
- package/dist/packages/_es/Row.js +1 -1
- package/dist/packages/_es/SearchBar.js +1 -1
- package/dist/packages/_es/ShortPassword.js +1 -1
- package/dist/packages/_es/SideNavBar.js +1 -1
- package/dist/packages/_es/SideNavBarItem.js +1 -1
- package/dist/packages/_es/Signature.js +1 -1
- package/dist/packages/_es/Skeleton.js +1 -1
- package/dist/packages/_es/Sku.js +1 -1
- package/dist/packages/_es/Step.js +1 -1
- package/dist/packages/_es/Steps.js +1 -1
- package/dist/packages/_es/Sticky.js +1 -1
- package/dist/packages/_es/SubSideNavBar.js +1 -1
- package/dist/packages/_es/Swipe.js +1 -1
- package/dist/packages/_es/Swiper.js +57 -115
- package/dist/packages/_es/SwiperItem.js +1 -1
- package/dist/packages/_es/Switch.js +1 -1
- package/dist/packages/_es/TabPane.js +1 -1
- package/dist/packages/_es/Tabbar.js +4 -8
- package/dist/packages/_es/TabbarItem.js +12 -13
- package/dist/packages/_es/Table.js +1 -1
- package/dist/packages/_es/Tabs.js +6 -9
- package/dist/packages/_es/Tag.js +1 -1
- package/dist/packages/_es/TextArea.js +1 -1
- package/dist/packages/_es/TimeDetail.js +1 -1
- package/dist/packages/_es/TimePannel.js +1 -1
- package/dist/packages/_es/TimeSelect.js +1 -1
- package/dist/packages/_es/Toast.js +1 -1
- package/dist/packages/_es/TrendArrow.js +1 -1
- package/dist/packages/_es/Uploader.js +1 -1
- package/dist/packages/_es/Video.js +1 -1
- package/dist/packages/_es/WaterMark.js +1 -1
- package/dist/packages/_es/common.js +1 -1
- package/dist/packages/_es/component.js +6 -2
- package/dist/packages/_es/index.js +1 -1
- package/dist/packages/_es/index2.js +1 -1
- package/dist/packages/_es/index3.js +1 -1
- package/dist/packages/_es/index4.js +1 -1
- package/dist/packages/_es/index5.js +1 -1
- package/dist/packages/_es/interceptor.js +2 -2
- package/dist/packages/_es/mountComponent.js +2 -2
- package/dist/packages/_es/plugin-vue_export-helper.js +1 -1
- package/dist/packages/_es/props.js +1 -1
- package/dist/packages/_es/pxCheck.js +1 -1
- package/dist/packages/_es/raf.js +1 -1
- package/dist/packages/infiniteloading/index.scss +2 -0
- package/dist/packages/locale/lang/baseLang.js +1 -1
- package/dist/packages/locale/lang/en-US.js +1 -1
- package/dist/packages/locale/lang/id-ID.js +1 -1
- package/dist/packages/locale/lang/index.js +1 -1
- package/dist/packages/locale/lang/zh-CN.js +1 -1
- package/dist/packages/locale/lang/zh-TW.js +1 -1
- package/dist/packages/picker/index.scss +10 -4
- package/dist/packages/popover/index.scss +10 -38
- package/dist/packages/price/index.scss +5 -0
- package/dist/smartips/attributes.json +36 -8
- package/dist/smartips/tags.json +13 -6
- package/dist/smartips/web-types.json +72 -9
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +55 -55
- package/dist/styles/themes/jdb.scss +55 -55
- package/dist/styles/themes/jddkh.scss +55 -55
- package/dist/styles/themes/jdt.scss +55 -55
- package/dist/types/__VUE/actionsheet/index.vue.d.ts +1 -1
- package/dist/types/__VUE/address/index.vue.d.ts +2 -2
- package/dist/types/__VUE/audio/index.vue.d.ts +4 -4
- package/dist/types/__VUE/avatar/index.vue.d.ts +2 -2
- package/dist/types/__VUE/avatargroup/index.vue.d.ts +1 -1
- package/dist/types/__VUE/backtop/index.vue.d.ts +1 -1
- package/dist/types/__VUE/badge/index.vue.d.ts +1 -1
- package/dist/types/__VUE/button/index.vue.d.ts +1 -1
- package/dist/types/__VUE/calendaritem/index.vue.d.ts +4 -4
- package/dist/types/__VUE/cell/index.vue.d.ts +5 -5
- package/dist/types/__VUE/collapseitem/index.vue.d.ts +1 -1
- package/dist/types/__VUE/countup/index.vue.d.ts +2 -2
- package/dist/types/__VUE/datepicker/index.vue.d.ts +1 -1
- package/dist/types/__VUE/dialog/index.vue.d.ts +1 -1
- package/dist/types/__VUE/fixednav/index.vue.d.ts +1 -1
- package/dist/types/__VUE/grid/index.vue.d.ts +1 -1
- package/dist/types/__VUE/image/index.vue.d.ts +1 -1
- package/dist/types/__VUE/imagepreview/index.vue.d.ts +2 -2
- package/dist/types/__VUE/infiniteloading/index.vue.d.ts +1 -1
- package/dist/types/__VUE/input/index.vue.d.ts +2 -2
- package/dist/types/__VUE/navbar/index.vue.d.ts +1 -1
- package/dist/types/__VUE/noticebar/index.vue.d.ts +4 -4
- package/dist/types/__VUE/picker/Column.vue.d.ts +4 -4
- package/dist/types/__VUE/picker/index.vue.d.ts +23 -5
- package/dist/types/__VUE/popover/index.vue.d.ts +33 -4
- package/dist/types/__VUE/popover/type.d.ts +7 -0
- package/dist/types/__VUE/price/index.vue.d.ts +9 -0
- package/dist/types/__VUE/range/index.vue.d.ts +7 -7
- package/dist/types/__VUE/rate/index.vue.d.ts +1 -1
- package/dist/types/__VUE/searchbar/index.vue.d.ts +1 -1
- package/dist/types/__VUE/step/index.vue.d.ts +1 -1
- package/dist/types/__VUE/swiper/index.vue.d.ts +9 -8
- package/dist/types/__VUE/swiperitem/index.vue.d.ts +2 -2
- package/dist/types/__VUE/switch/index.vue.d.ts +1 -1
- package/dist/types/__VUE/tabbar/index.vue.d.ts +2 -11
- package/dist/types/__VUE/tabbaritem/index.vue.d.ts +4 -4
- package/dist/types/__VUE/timeselect/index.vue.d.ts +1 -1
- package/dist/types/__VUE/toast/index.vue.d.ts +1 -1
- package/dist/types/__VUE/uploader/index.vue.d.ts +3 -3
- package/dist/types/__VUE/video/index.vue.d.ts +3 -3
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/types/__VUE/swiper/use-touch.d.ts +0 -20
|
@@ -1,61 +1,15 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.3.0 Fri Dec
|
|
2
|
+
* @nutui/nutui v3.3.1-beta.0 Fri Dec 16 2022 15:47:05 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
7
|
-
import { c as createComponent } from "./component.js";
|
|
6
|
+
import { ref, reactive, computed, provide, onDeactivated, onBeforeUnmount, watch, nextTick, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, renderSlot, Fragment, renderList, createCommentVNode } from "vue";
|
|
7
|
+
import { c as createComponent, d as clamp } from "./component.js";
|
|
8
|
+
import { u as useTouch } from "./index4.js";
|
|
8
9
|
import { u as useExpose } from "./index3.js";
|
|
10
|
+
import { r as requestAniFrame } from "./raf.js";
|
|
9
11
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
10
12
|
import "../locale/lang";
|
|
11
|
-
const DISTANCE = 5;
|
|
12
|
-
function useTouch() {
|
|
13
|
-
const state = reactive({
|
|
14
|
-
startX: 0,
|
|
15
|
-
startY: 0,
|
|
16
|
-
deltaX: 0,
|
|
17
|
-
deltaY: 0,
|
|
18
|
-
offsetX: 0,
|
|
19
|
-
offsetY: 0,
|
|
20
|
-
direction: ""
|
|
21
|
-
});
|
|
22
|
-
const getDirection = (x, y) => {
|
|
23
|
-
if (x > y && x > DISTANCE)
|
|
24
|
-
return "horizontal";
|
|
25
|
-
if (y > x && y > DISTANCE)
|
|
26
|
-
return "vertical";
|
|
27
|
-
return "";
|
|
28
|
-
};
|
|
29
|
-
const reset = () => {
|
|
30
|
-
state.startX = 0;
|
|
31
|
-
state.startY = 0;
|
|
32
|
-
state.deltaX = 0;
|
|
33
|
-
state.deltaY = 0;
|
|
34
|
-
state.offsetX = 0;
|
|
35
|
-
state.offsetY = 0;
|
|
36
|
-
state.direction = "";
|
|
37
|
-
};
|
|
38
|
-
const start = (e) => {
|
|
39
|
-
reset();
|
|
40
|
-
state.startX = e.touches[0].clientX;
|
|
41
|
-
state.startY = e.touches[0].clientY;
|
|
42
|
-
};
|
|
43
|
-
const move = (e) => {
|
|
44
|
-
state.deltaX = e.touches[0].clientX - state.startX;
|
|
45
|
-
state.deltaY = e.touches[0].clientY - state.startY;
|
|
46
|
-
state.offsetX = Math.abs(state.deltaX);
|
|
47
|
-
state.offsetY = Math.abs(state.deltaY);
|
|
48
|
-
if (!state.direction) {
|
|
49
|
-
state.direction = getDirection(state.offsetX, state.offsetY);
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
return {
|
|
53
|
-
state,
|
|
54
|
-
start,
|
|
55
|
-
reset,
|
|
56
|
-
move
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
13
|
const { create, componentName } = createComponent("swiper");
|
|
60
14
|
const _sfc_main = create({
|
|
61
15
|
props: {
|
|
@@ -68,7 +22,7 @@ const _sfc_main = create({
|
|
|
68
22
|
default: 0
|
|
69
23
|
},
|
|
70
24
|
direction: {
|
|
71
|
-
type:
|
|
25
|
+
type: String,
|
|
72
26
|
default: "horizontal"
|
|
73
27
|
},
|
|
74
28
|
paginationVisible: {
|
|
@@ -137,11 +91,25 @@ const _sfc_main = create({
|
|
|
137
91
|
};
|
|
138
92
|
});
|
|
139
93
|
const isVertical = computed(() => props.direction === "vertical");
|
|
94
|
+
const classesInner = computed(() => {
|
|
95
|
+
const prefixCls = componentName;
|
|
96
|
+
return {
|
|
97
|
+
[`${prefixCls}-inner`]: true,
|
|
98
|
+
[`${prefixCls}-vertical`]: isVertical.value
|
|
99
|
+
};
|
|
100
|
+
});
|
|
101
|
+
const classesPagination = computed(() => {
|
|
102
|
+
const prefixCls = componentName;
|
|
103
|
+
return {
|
|
104
|
+
[`${prefixCls}-pagination`]: true,
|
|
105
|
+
[`${prefixCls}-pagination-vertical`]: isVertical.value
|
|
106
|
+
};
|
|
107
|
+
});
|
|
140
108
|
const delTa = computed(() => {
|
|
141
|
-
return isVertical.value ? touch.
|
|
109
|
+
return isVertical.value ? touch.deltaY.value : touch.deltaX.value;
|
|
142
110
|
});
|
|
143
111
|
const isCorrectDirection = computed(() => {
|
|
144
|
-
return touch.
|
|
112
|
+
return touch.direction.value === props.direction;
|
|
145
113
|
});
|
|
146
114
|
const childCount = computed(() => state.children.length);
|
|
147
115
|
const size = computed(() => state[isVertical.value ? "height" : "width"]);
|
|
@@ -156,12 +124,7 @@ const _sfc_main = create({
|
|
|
156
124
|
const activePagination = computed(() => (state.active + childCount.value) % childCount.value);
|
|
157
125
|
const getStyle = () => {
|
|
158
126
|
let offset = 0;
|
|
159
|
-
|
|
160
|
-
offset = state.offset;
|
|
161
|
-
} else {
|
|
162
|
-
let val = isVertical.value ? state.rect.height - size.value : state.rect.width - size.value;
|
|
163
|
-
offset = state.offset + (state.active === childCount.value - 1 ? -val / 2 : val / 2);
|
|
164
|
-
}
|
|
127
|
+
offset = state.offset;
|
|
165
128
|
state.style = {
|
|
166
129
|
transitionDuration: `${state.moving ? 0 : props.duration}ms`,
|
|
167
130
|
transform: `translate${isVertical.value ? "Y" : "X"}(${offset}px)`,
|
|
@@ -172,26 +135,27 @@ const _sfc_main = create({
|
|
|
172
135
|
const relation = (child) => {
|
|
173
136
|
var _a;
|
|
174
137
|
let children = [];
|
|
138
|
+
const childrenVNodeLen = state.childrenVNode.length;
|
|
175
139
|
let slot = (_a = slots == null ? void 0 : slots.default) == null ? void 0 : _a.call(slots);
|
|
176
140
|
slot = slot.filter((item) => item.children && Array.isArray(item.children));
|
|
177
141
|
slot.forEach((item) => {
|
|
178
142
|
children = children.concat(item.children);
|
|
179
143
|
});
|
|
180
|
-
if (!
|
|
144
|
+
if (!childrenVNodeLen) {
|
|
181
145
|
state.childrenVNode = children.slice();
|
|
182
146
|
child.proxy && state.children.push(child.proxy);
|
|
183
147
|
} else {
|
|
184
|
-
if (
|
|
148
|
+
if (childrenVNodeLen > children.length) {
|
|
185
149
|
state.children = state.children.filter((item) => child.proxy !== item);
|
|
186
|
-
} else if (
|
|
187
|
-
for (let i = 0; i <
|
|
150
|
+
} else if (childrenVNodeLen < children.length) {
|
|
151
|
+
for (let i = 0; i < childrenVNodeLen; i++) {
|
|
188
152
|
if (children[i].key !== state.childrenVNode[i].key) {
|
|
189
153
|
child.proxy && state.children.splice(i, 0, child.proxy);
|
|
190
154
|
child.vnode && state.childrenVNode.splice(i, 0, child.vnode);
|
|
191
155
|
break;
|
|
192
156
|
}
|
|
193
157
|
}
|
|
194
|
-
if (
|
|
158
|
+
if (childrenVNodeLen !== children.length) {
|
|
195
159
|
child.proxy && state.children.push(child.proxy);
|
|
196
160
|
child.vnode && state.childrenVNode.push(child.vnode);
|
|
197
161
|
}
|
|
@@ -201,12 +165,6 @@ const _sfc_main = create({
|
|
|
201
165
|
}
|
|
202
166
|
}
|
|
203
167
|
};
|
|
204
|
-
const range = (num, min, max) => {
|
|
205
|
-
return Math.min(Math.max(num, min), max);
|
|
206
|
-
};
|
|
207
|
-
const requestFrame = (fn) => {
|
|
208
|
-
window.requestAnimationFrame.call(window, fn);
|
|
209
|
-
};
|
|
210
168
|
const getOffset = (active, offset = 0) => {
|
|
211
169
|
let currentPosition = active * size.value;
|
|
212
170
|
if (!props.loop) {
|
|
@@ -214,7 +172,7 @@ const _sfc_main = create({
|
|
|
214
172
|
}
|
|
215
173
|
let targetOffset = offset - currentPosition;
|
|
216
174
|
if (!props.loop) {
|
|
217
|
-
targetOffset =
|
|
175
|
+
targetOffset = clamp(targetOffset, minOffset.value, 0);
|
|
218
176
|
}
|
|
219
177
|
return targetOffset;
|
|
220
178
|
};
|
|
@@ -222,9 +180,9 @@ const _sfc_main = create({
|
|
|
222
180
|
const { active } = state;
|
|
223
181
|
if (pace) {
|
|
224
182
|
if (props.loop) {
|
|
225
|
-
return
|
|
183
|
+
return clamp(active + pace, -1, childCount.value);
|
|
226
184
|
}
|
|
227
|
-
return
|
|
185
|
+
return clamp(active + pace, 0, childCount.value - 1);
|
|
228
186
|
}
|
|
229
187
|
return active;
|
|
230
188
|
};
|
|
@@ -263,48 +221,39 @@ const _sfc_main = create({
|
|
|
263
221
|
const stopAutoPlay = () => {
|
|
264
222
|
clearTimeout(state.autoplayTimer);
|
|
265
223
|
};
|
|
266
|
-
const
|
|
224
|
+
const jump = (pace) => {
|
|
267
225
|
resettPosition();
|
|
268
226
|
touch.reset();
|
|
269
|
-
|
|
270
|
-
|
|
227
|
+
requestAniFrame(() => {
|
|
228
|
+
requestAniFrame(() => {
|
|
271
229
|
state.moving = false;
|
|
272
230
|
move({
|
|
273
|
-
pace
|
|
231
|
+
pace,
|
|
274
232
|
isEmit: true
|
|
275
233
|
});
|
|
276
234
|
});
|
|
277
235
|
});
|
|
278
236
|
};
|
|
237
|
+
const prev = () => {
|
|
238
|
+
jump(-1);
|
|
239
|
+
};
|
|
279
240
|
const next = () => {
|
|
280
|
-
|
|
281
|
-
touch.reset();
|
|
282
|
-
requestFrame(() => {
|
|
283
|
-
requestFrame(() => {
|
|
284
|
-
state.moving = false;
|
|
285
|
-
move({
|
|
286
|
-
pace: 1,
|
|
287
|
-
isEmit: true
|
|
288
|
-
});
|
|
289
|
-
});
|
|
290
|
-
});
|
|
241
|
+
jump(1);
|
|
291
242
|
};
|
|
292
243
|
const to = (index) => {
|
|
293
244
|
resettPosition();
|
|
294
245
|
touch.reset();
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
isEmit: true
|
|
307
|
-
});
|
|
246
|
+
requestAniFrame(() => {
|
|
247
|
+
state.moving = false;
|
|
248
|
+
let targetIndex;
|
|
249
|
+
if (props.loop && childCount.value === index) {
|
|
250
|
+
targetIndex = state.active === 0 ? 0 : index;
|
|
251
|
+
} else {
|
|
252
|
+
targetIndex = index % childCount.value;
|
|
253
|
+
}
|
|
254
|
+
move({
|
|
255
|
+
pace: targetIndex - state.active,
|
|
256
|
+
isEmit: true
|
|
308
257
|
});
|
|
309
258
|
});
|
|
310
259
|
};
|
|
@@ -358,7 +307,7 @@ const _sfc_main = create({
|
|
|
358
307
|
const isShouldMove = Math.abs(speed) > 0.3 || Math.abs(delTa.value) > +(size.value / 2).toFixed(2);
|
|
359
308
|
if (isShouldMove && isCorrectDirection.value) {
|
|
360
309
|
let pace = 0;
|
|
361
|
-
const offset = isVertical.value ? touch.
|
|
310
|
+
const offset = isVertical.value ? touch.offsetY.value : touch.offsetX.value;
|
|
362
311
|
if (props.loop) {
|
|
363
312
|
pace = offset > 0 ? delTa.value > 0 ? -1 : 1 : 0;
|
|
364
313
|
} else {
|
|
@@ -416,10 +365,9 @@ const _sfc_main = create({
|
|
|
416
365
|
return {
|
|
417
366
|
state,
|
|
418
367
|
classes,
|
|
368
|
+
classesInner,
|
|
369
|
+
classesPagination,
|
|
419
370
|
container,
|
|
420
|
-
componentName,
|
|
421
|
-
isVertical,
|
|
422
|
-
slots,
|
|
423
371
|
activePagination,
|
|
424
372
|
onTouchStart,
|
|
425
373
|
onTouchMove,
|
|
@@ -437,21 +385,15 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
437
385
|
onTouchcancel: _cache[3] || (_cache[3] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args))
|
|
438
386
|
}, [
|
|
439
387
|
createElementVNode("view", {
|
|
440
|
-
class: normalizeClass(
|
|
441
|
-
[`${_ctx.componentName}-inner`]: true,
|
|
442
|
-
[`${_ctx.componentName}-vertical`]: _ctx.isVertical
|
|
443
|
-
}),
|
|
388
|
+
class: normalizeClass(_ctx.classesInner),
|
|
444
389
|
style: normalizeStyle(_ctx.state.style)
|
|
445
390
|
}, [
|
|
446
391
|
renderSlot(_ctx.$slots, "default")
|
|
447
392
|
], 6),
|
|
448
393
|
renderSlot(_ctx.$slots, "page"),
|
|
449
|
-
_ctx.paginationVisible && !_ctx
|
|
394
|
+
_ctx.paginationVisible && !_ctx.$slots.page ? (openBlock(), createElementBlock("view", {
|
|
450
395
|
key: 0,
|
|
451
|
-
class: normalizeClass(
|
|
452
|
-
[`${_ctx.componentName}-pagination`]: true,
|
|
453
|
-
[`${_ctx.componentName}-pagination-vertical`]: _ctx.isVertical
|
|
454
|
-
})
|
|
396
|
+
class: normalizeClass(_ctx.classesPagination)
|
|
455
397
|
}, [
|
|
456
398
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.state.children.length, (item, index) => {
|
|
457
399
|
return openBlock(), createElementBlock("i", {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.3.0 Fri Dec
|
|
2
|
+
* @nutui/nutui v3.3.1-beta.0 Fri Dec 16 2022 15:47:05 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { toRefs, ref, reactive, provide, watch, onMounted, nextTick, openBlock, createElementBlock, normalizeStyle, createElementVNode, normalizeClass, renderSlot } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { u as useRect } from "./index2.js";
|
|
8
9
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
10
|
import "../locale/lang";
|
|
10
11
|
const { create } = createComponent("tabbar");
|
|
@@ -18,10 +19,6 @@ const _sfc_main = create({
|
|
|
18
19
|
type: Boolean,
|
|
19
20
|
default: false
|
|
20
21
|
},
|
|
21
|
-
type: {
|
|
22
|
-
type: String,
|
|
23
|
-
default: "base"
|
|
24
|
-
},
|
|
25
22
|
size: {
|
|
26
23
|
type: String,
|
|
27
24
|
default: "20px"
|
|
@@ -51,7 +48,7 @@ const _sfc_main = create({
|
|
|
51
48
|
val: props.visible,
|
|
52
49
|
children: []
|
|
53
50
|
});
|
|
54
|
-
const nutTabbar = ref(
|
|
51
|
+
const nutTabbar = ref();
|
|
55
52
|
function changeIndex(index2, active) {
|
|
56
53
|
emit("update:visible", active);
|
|
57
54
|
parentData.modelValue = active;
|
|
@@ -75,8 +72,7 @@ const _sfc_main = create({
|
|
|
75
72
|
onMounted(() => {
|
|
76
73
|
if (bottom.value && placeholder.value) {
|
|
77
74
|
nextTick(() => {
|
|
78
|
-
|
|
79
|
-
height.value = (_a = nutTabbar == null ? void 0 : nutTabbar.value) == null ? void 0 : _a.getBoundingClientRect().height;
|
|
75
|
+
height.value = useRect(nutTabbar).height;
|
|
80
76
|
});
|
|
81
77
|
}
|
|
82
78
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.3.0 Fri Dec
|
|
2
|
+
* @nutui/nutui v3.3.1-beta.0 Fri Dec 16 2022 15:47:05 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -27,7 +27,7 @@ const _sfc_main = create({
|
|
|
27
27
|
default: ""
|
|
28
28
|
},
|
|
29
29
|
num: {
|
|
30
|
-
type:
|
|
30
|
+
type: Number,
|
|
31
31
|
default: ""
|
|
32
32
|
},
|
|
33
33
|
activeImg: {
|
|
@@ -69,8 +69,8 @@ const _sfc_main = create({
|
|
|
69
69
|
var _a;
|
|
70
70
|
if (child.proxy) {
|
|
71
71
|
parent.children.push(child.proxy);
|
|
72
|
-
const index2 =
|
|
73
|
-
state.index = (_a = props.name) != null ? _a : index2
|
|
72
|
+
const index2 = parent.children.indexOf(child.proxy);
|
|
73
|
+
state.index = (_a = props.name) != null ? _a : index2;
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
76
|
relation(getCurrentInstance());
|
|
@@ -152,13 +152,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
152
152
|
}, [
|
|
153
153
|
createElementVNode("view", _hoisted_1, [
|
|
154
154
|
!_ctx.dot ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
155
|
-
_ctx.num && _ctx.num <= 99 ? (openBlock(), createElementBlock("view", _hoisted_2, toDisplayString(_ctx.num), 1)) : _ctx.num && _ctx.num
|
|
155
|
+
_ctx.num && _ctx.num <= 99 ? (openBlock(), createElementBlock("view", _hoisted_2, toDisplayString(_ctx.num), 1)) : _ctx.num && _ctx.num >= 100 ? (openBlock(), createElementBlock("view", _hoisted_3, toDisplayString("99+"))) : createCommentVNode("", true)
|
|
156
156
|
], 64)) : createCommentVNode("", true),
|
|
157
157
|
_ctx.dot ? (openBlock(), createElementBlock("div", _hoisted_4)) : createCommentVNode("", true),
|
|
158
|
-
_ctx.
|
|
158
|
+
_ctx.$slots.icon ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
159
159
|
renderSlot(_ctx.$slots, "icon", { active: _ctx.active })
|
|
160
|
-
])) :
|
|
161
|
-
_ctx.icon && !_ctx.isHaveSlot("icon") ? (openBlock(), createElementBlock("view", _hoisted_6, [
|
|
160
|
+
])) : _ctx.icon ? (openBlock(), createElementBlock("view", _hoisted_6, [
|
|
162
161
|
createVNode(_component_nut_icon, {
|
|
163
162
|
class: "nut-tabbar-item_icon-box_icon",
|
|
164
163
|
size: _ctx.state.size,
|
|
@@ -166,8 +165,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
166
165
|
"font-class-name": _ctx.fontClassName,
|
|
167
166
|
"class-prefix": _ctx.classPrefix
|
|
168
167
|
}, null, 8, ["size", "name", "font-class-name", "class-prefix"])
|
|
169
|
-
])) :
|
|
170
|
-
!_ctx.icon && _ctx.activeImg && !_ctx.isHaveSlot("icon") ? (openBlock(), createElementBlock("div", {
|
|
168
|
+
])) : _ctx.activeImg ? (openBlock(), createElementBlock("div", {
|
|
171
169
|
key: 4,
|
|
172
170
|
class: "nut-tabbar-item_icon-box_icon",
|
|
173
171
|
style: normalizeStyle({
|
|
@@ -179,11 +177,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
179
177
|
createElementVNode("view", {
|
|
180
178
|
class: normalizeClass([
|
|
181
179
|
"nut-tabbar-item_icon-box_nav-word",
|
|
182
|
-
{ "nut-tabbar-item_icon-box_big-word": !_ctx.icon && !_ctx.activeImg && !_ctx.
|
|
180
|
+
{ "nut-tabbar-item_icon-box_big-word": !_ctx.icon && !_ctx.activeImg && !_ctx.$slots.icon }
|
|
183
181
|
])
|
|
184
182
|
}, [
|
|
185
|
-
_ctx
|
|
186
|
-
|
|
183
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
184
|
+
_ctx.tabTitle ? (openBlock(), createElementBlock("view", _hoisted_7, toDisplayString(_ctx.tabTitle), 1)) : createCommentVNode("", true)
|
|
185
|
+
])
|
|
187
186
|
], 2)
|
|
188
187
|
])
|
|
189
188
|
], 6);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.3.0 Fri Dec
|
|
2
|
+
* @nutui/nutui v3.3.1-beta.0 Fri Dec 16 2022 15:47:05 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { T as TypeOfFun, c as createComponent } from "./component.js";
|
|
6
|
+
import { g as getScrollTopRoot, T as TypeOfFun, c as createComponent } from "./component.js";
|
|
7
7
|
import { ref, provide, computed, watch, onMounted, onActivated, resolveComponent, openBlock, createElementBlock, normalizeClass, createBlock, withCtx, createElementVNode, normalizeStyle, renderSlot, Fragment, renderList, createCommentVNode, createVNode, toDisplayString } from "vue";
|
|
8
8
|
import { p as pxCheck } from "./pxCheck.js";
|
|
9
9
|
import { u as useRect } from "./index2.js";
|
|
@@ -135,9 +135,6 @@ const component = {
|
|
|
135
135
|
init(vnodes);
|
|
136
136
|
}
|
|
137
137
|
);
|
|
138
|
-
const getScrollTopRoot = () => {
|
|
139
|
-
return window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
|
|
140
|
-
};
|
|
141
138
|
watch(
|
|
142
139
|
() => props.modelValue,
|
|
143
140
|
(value) => {
|
|
@@ -200,9 +197,11 @@ const component = {
|
|
|
200
197
|
};
|
|
201
198
|
}
|
|
202
199
|
};
|
|
200
|
+
const { create } = createComponent("tabs");
|
|
201
|
+
const _sfc_main = create(component);
|
|
203
202
|
const _hoisted_1 = ["onClick"];
|
|
204
203
|
const _hoisted_2 = ["onClick"];
|
|
205
|
-
function
|
|
204
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
206
205
|
const _component_nut_icon = resolveComponent("nut-icon");
|
|
207
206
|
const _component_nut_sticky = resolveComponent("nut-sticky");
|
|
208
207
|
return openBlock(), createElementBlock("view", {
|
|
@@ -292,7 +291,5 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
292
291
|
], 4)
|
|
293
292
|
], 2);
|
|
294
293
|
}
|
|
295
|
-
|
|
296
|
-
const _sfc_main = create(component);
|
|
297
|
-
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", render]]);
|
|
294
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
298
295
|
export { index as default };
|
package/dist/packages/_es/Tag.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.3.0 Fri Dec
|
|
2
|
+
* @nutui/nutui v3.3.1-beta.0 Fri Dec 16 2022 15:47:05 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -102,6 +102,10 @@ const padZero = (num, length = 2) => {
|
|
|
102
102
|
}
|
|
103
103
|
return num.toString();
|
|
104
104
|
};
|
|
105
|
+
const clamp = (num, min, max) => Math.min(Math.max(num, min), max);
|
|
106
|
+
const getScrollTopRoot = () => {
|
|
107
|
+
return window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
|
|
108
|
+
};
|
|
105
109
|
function createComponent(name) {
|
|
106
110
|
const componentName = "nut-" + name;
|
|
107
111
|
return {
|
|
@@ -126,4 +130,4 @@ function createComponent(name) {
|
|
|
126
130
|
}
|
|
127
131
|
};
|
|
128
132
|
}
|
|
129
|
-
export { TypeOfFun as T, preventDefault as a, body as b, createComponent as c,
|
|
133
|
+
export { TypeOfFun as T, preventDefault as a, body as b, createComponent as c, clamp as d, isPromise as e, isObject as f, getScrollTopRoot as g, getPropByPath as h, isDate as i, isString as j, isFunction as k, isArray as l, myFixed as m, floatData as n, padZero as p };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.3.0 Fri Dec
|
|
2
|
+
* @nutui/nutui v3.3.1-beta.0 Fri Dec 16 2022 15:47:05 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { e as isPromise } from "./component.js";
|
|
7
7
|
const funInterceptor = (interceptor, {
|
|
8
8
|
args = [],
|
|
9
9
|
done,
|