@nutui/nutui 3.1.18-beta.0 → 3.1.19-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 +41 -0
- package/LICENSE +1 -1
- package/README.md +6 -0
- package/dist/nutui.d.ts +39 -36
- package/dist/nutui.es.js +13149 -11288
- package/dist/nutui.umd.js +13156 -11381
- package/dist/packages/_es/ActionSheet.js +13 -19
- package/dist/packages/_es/Address.js +70 -55
- package/dist/packages/_es/Audio.js +13 -13
- package/dist/packages/_es/AudioOperate.js +125 -0
- package/dist/packages/_es/Avatar.js +4 -4
- package/dist/packages/_es/BackTop.js +69 -108
- package/dist/packages/_es/Badge.js +4 -4
- package/dist/packages/_es/Barrage.js +63 -56
- package/dist/packages/_es/Button.js +3 -3
- package/dist/packages/_es/Calendar.js +30 -702
- package/dist/packages/_es/CalendarItem.js +10 -0
- package/dist/packages/_es/Card.js +7 -6
- package/dist/packages/_es/Cascader.js +8 -8
- package/dist/packages/_es/Cell.js +27 -27
- package/dist/packages/_es/CellGroup.js +2 -2
- package/dist/packages/_es/Checkbox.js +4 -4
- package/dist/packages/_es/CheckboxGroup.js +3 -3
- package/dist/packages/_es/CircleProgress.js +150 -41
- package/dist/packages/_es/Col.js +2 -2
- package/dist/packages/_es/Collapse.js +35 -9
- package/dist/packages/_es/CollapseItem.js +79 -38
- package/dist/packages/_es/CountDown.js +8 -6
- package/dist/packages/_es/CountUp.js +31 -30
- package/dist/packages/_es/DatePicker.js +81 -44
- package/dist/packages/_es/Dialog.js +7 -83
- package/dist/packages/_es/Divider.js +5 -5
- package/dist/packages/_es/Drag.js +93 -55
- package/dist/packages/_es/Elevator.js +75 -50
- package/dist/packages/_es/Empty.js +4 -4
- package/dist/packages/_es/FixedNav.js +6 -6
- package/dist/packages/_es/Form.js +11 -9
- package/dist/packages/_es/FormItem.js +9 -6
- package/dist/packages/_es/Grid.js +2 -2
- package/dist/packages/_es/GridItem.js +9 -27
- package/dist/packages/_es/Icon.js +2 -2
- package/dist/packages/_es/ImagePreview.js +14 -83
- package/dist/packages/_es/Indicator.js +4 -4
- package/dist/packages/_es/InfiniteLoading.js +94 -108
- package/dist/packages/_es/Input.js +297 -73
- package/dist/packages/_es/InputNumber.js +24 -17
- package/dist/packages/_es/Layout.js +2 -2
- package/dist/packages/_es/List.js +131 -0
- package/dist/packages/_es/Menu.js +16 -13
- package/dist/packages/_es/MenuItem.js +8 -8
- package/dist/packages/_es/Navbar.js +17 -12
- package/dist/packages/_es/NoticeBar.js +47 -39
- package/dist/packages/_es/Notify.js +28 -163
- package/dist/packages/_es/NumberKeyboard.js +4 -4
- package/dist/packages/_es/OldPicker.js +486 -0
- package/dist/packages/_es/OverLay.js +6 -26
- package/dist/packages/_es/Pagination.js +8 -8
- package/dist/packages/_es/Picker.js +192 -163
- package/dist/packages/_es/Popover.js +155 -30
- package/dist/packages/_es/Popup.js +7 -70
- package/dist/packages/_es/Price.js +18 -6
- package/dist/packages/_es/Progress.js +29 -27
- package/dist/packages/_es/PullRefresh.js +363 -0
- package/dist/packages/_es/Radio.js +4 -4
- package/dist/packages/_es/RadioGroup.js +2 -2
- package/dist/packages/_es/Range.js +169 -46
- package/dist/packages/_es/Rate.js +17 -20
- package/dist/packages/_es/Row.js +2 -2
- package/dist/packages/_es/SearchBar.js +9 -7
- package/dist/packages/_es/ShortPassword.js +90 -68
- package/dist/packages/_es/SideNavBar.js +6 -17
- package/dist/packages/_es/SideNavBarItem.js +2 -2
- package/dist/packages/_es/Signature.js +70 -70
- package/dist/packages/_es/Skeleton.js +9 -12
- package/dist/packages/_es/Sku.js +40 -31
- package/dist/packages/_es/Step.js +28 -12
- package/dist/packages/_es/Steps.js +8 -3
- package/dist/packages/_es/Sticky.js +29 -24
- package/dist/packages/_es/SubSideNavBar.js +2 -2
- package/dist/packages/_es/Swipe.js +40 -27
- package/dist/packages/_es/Swiper.js +32 -14
- package/dist/packages/_es/SwiperItem.js +2 -2
- package/dist/packages/_es/Switch.js +4 -4
- package/dist/packages/_es/TabPane.js +2 -2
- package/dist/packages/_es/Tabbar.js +4 -4
- package/dist/packages/_es/TabbarItem.js +28 -23
- package/dist/packages/_es/Table.js +14 -14
- package/dist/packages/_es/Tabs.js +19 -15
- package/dist/packages/_es/Tag.js +14 -8
- package/dist/packages/_es/TextArea.js +49 -15
- package/dist/packages/_es/TimeDetail.js +5 -4
- package/dist/packages/_es/TimePannel.js +4 -4
- package/dist/packages/_es/TimeSelect.js +9 -8
- package/dist/packages/_es/Toast.js +42 -171
- package/dist/packages/_es/Uploader.js +108 -139
- package/dist/packages/_es/Video.js +14 -10
- package/dist/packages/_es/common.js +2 -2
- package/dist/packages/_es/component.js +2 -2
- package/dist/packages/_es/index.js +45 -7
- package/dist/packages/_es/index.taro.js +719 -0
- package/dist/packages/_es/index2.js +2 -2
- package/dist/packages/_es/index3.js +57 -29
- package/dist/packages/_es/index4.js +414 -57
- package/dist/packages/_es/plugin-vue_export-helper.js +2 -2
- package/dist/packages/_es/pxCheck.js +2 -2
- package/dist/packages/_es/use-lock-scroll.js +23 -0
- package/dist/packages/_es/util.js +2 -2
- package/dist/packages/badge/index.scss +11 -13
- package/dist/packages/button/index.scss +1 -0
- package/dist/packages/calendar/index.scss +9 -4
- package/dist/packages/calendaritem/index.scss +0 -207
- package/dist/packages/cell/index.scss +6 -6
- package/dist/packages/checkbox/index.scss +4 -3
- package/dist/packages/collapseitem/index.scss +21 -11
- package/dist/packages/countdown/index.scss +3 -1
- package/dist/packages/divider/index.scss +8 -8
- package/dist/packages/elevator/index.scss +36 -36
- package/dist/packages/formitem/index.scss +15 -8
- package/dist/packages/indicator/index.scss +1 -1
- package/dist/packages/input/index.scss +70 -24
- package/dist/packages/inputnumber/index.scss +4 -2
- package/dist/packages/list/index.scss +24 -0
- package/dist/packages/menu/index.scss +3 -3
- package/dist/packages/navbar/index.scss +28 -8
- package/dist/packages/noticebar/index.scss +7 -8
- package/dist/packages/notify/index.scss +9 -0
- package/dist/packages/numberkeyboard/index.scss +22 -21
- package/dist/packages/oldpicker/index.scss +131 -0
- package/dist/packages/picker/index.scss +38 -32
- package/dist/packages/progress/index.scss +6 -5
- package/dist/packages/radio/index.scss +7 -6
- package/dist/packages/range/index.scss +109 -2
- package/dist/packages/searchbar/index.scss +7 -7
- package/dist/packages/sidenavbaritem/index.scss +5 -5
- package/dist/packages/step/index.scss +29 -29
- package/dist/packages/subsidenavbar/index.scss +10 -8
- package/dist/packages/tabbaritem/index.scss +15 -0
- package/dist/packages/timedetail/index.scss +13 -13
- package/dist/packages/timepannel/index.scss +7 -7
- package/dist/packages/timeselect/index.scss +3 -3
- package/dist/packages/uploader/index.scss +6 -6
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +64 -62
- package/dist/styles/themes/jdt.scss +91 -0
- package/dist/styles/variables-jdt.scss +728 -0
- package/dist/styles/variables.scss +250 -44
- package/package.json +2 -1
- package/dist/packages/_es/raf.js +0 -19
- package/dist/styles/themes/jdd.scss +0 -2
|
@@ -18,13 +18,16 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.
|
|
22
|
-
* (c)
|
|
21
|
+
* @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
|
|
22
|
+
* (c) 2022 @jdf2e.
|
|
23
23
|
* Released under the MIT License.
|
|
24
24
|
*/
|
|
25
|
-
import { reactive, computed, onMounted,
|
|
25
|
+
import { reactive, computed, onMounted, toRefs, resolveComponent, openBlock, createBlock, normalizeClass, withCtx, createElementVNode, normalizeStyle, createVNode, toDisplayString, renderSlot, createElementBlock, createCommentVNode } from "vue";
|
|
26
26
|
import { c as createComponent } from "./component.js";
|
|
27
|
+
import _sfc_main$1 from "./Icon.js";
|
|
28
|
+
import Taro from "@tarojs/taro";
|
|
27
29
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
30
|
+
import "./pxCheck.js";
|
|
28
31
|
const { componentName, create } = createComponent("infiniteloading");
|
|
29
32
|
const _sfc_main = create({
|
|
30
33
|
props: {
|
|
@@ -36,6 +39,10 @@ const _sfc_main = create({
|
|
|
36
39
|
type: Number,
|
|
37
40
|
default: 200
|
|
38
41
|
},
|
|
42
|
+
upperThreshold: {
|
|
43
|
+
type: Number,
|
|
44
|
+
default: 40
|
|
45
|
+
},
|
|
39
46
|
pullIcon: {
|
|
40
47
|
type: String,
|
|
41
48
|
default: "https://img10.360buyimg.com/imagetools/jfs/t1/169863/6/4565/6306/60125948E7e92774e/40b3a0cf42852bcb.png"
|
|
@@ -74,14 +81,16 @@ const _sfc_main = create({
|
|
|
74
81
|
}
|
|
75
82
|
},
|
|
76
83
|
emits: ["scroll-change", "load-more", "refresh"],
|
|
84
|
+
components: {
|
|
85
|
+
"nut-icon": _sfc_main$1
|
|
86
|
+
},
|
|
77
87
|
setup(props, { emit, slots }) {
|
|
78
88
|
const state = reactive({
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
refreshTop: null,
|
|
82
|
-
beforeScrollTop: 0,
|
|
83
|
-
isTouching: false,
|
|
89
|
+
scrollHeight: 0,
|
|
90
|
+
scrollTop: 0,
|
|
84
91
|
isInfiniting: false,
|
|
92
|
+
direction: "down",
|
|
93
|
+
isTouching: false,
|
|
85
94
|
refreshMaxH: 0,
|
|
86
95
|
y: 0,
|
|
87
96
|
x: 0,
|
|
@@ -100,69 +109,43 @@ const _sfc_main = create({
|
|
|
100
109
|
};
|
|
101
110
|
});
|
|
102
111
|
const getParentElement = (el) => {
|
|
103
|
-
return !!props.containerId ?
|
|
104
|
-
};
|
|
105
|
-
const requestAniFrame = () => {
|
|
106
|
-
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || function(callback) {
|
|
107
|
-
window.setTimeout(callback, 1e3 / 60);
|
|
108
|
-
};
|
|
112
|
+
return Taro.createSelectorQuery().select(!!props.containerId ? `#${props.containerId} #${el}` : `#${el}`);
|
|
109
113
|
};
|
|
110
|
-
const
|
|
111
|
-
|
|
114
|
+
const getScrollHeight = () => {
|
|
115
|
+
const parentElement = getParentElement("scroller");
|
|
116
|
+
parentElement.boundingClientRect((rect) => {
|
|
117
|
+
state.scrollHeight = rect.height;
|
|
118
|
+
}).exec();
|
|
112
119
|
};
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
const isScrollAtBottom = () => {
|
|
117
|
-
let offsetDistance = 0;
|
|
118
|
-
let resScrollTop = 0;
|
|
119
|
-
let direction = "down";
|
|
120
|
-
const windowScrollTop = getWindowScrollTop();
|
|
121
|
-
if (props.useWindow) {
|
|
122
|
-
if (state.scroller) {
|
|
123
|
-
offsetDistance = calculateTopPosition(state.scroller) + state.scroller.offsetHeight - windowScrollTop - window.innerHeight;
|
|
124
|
-
}
|
|
125
|
-
resScrollTop = windowScrollTop;
|
|
120
|
+
const lower = () => {
|
|
121
|
+
if (state.direction == "up" || !props.hasMore || state.isInfiniting) {
|
|
122
|
+
return false;
|
|
126
123
|
} else {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
124
|
+
state.isInfiniting = true;
|
|
125
|
+
emit("load-more", infiniteDone);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
const scroll = (e) => {
|
|
129
|
+
if (e.detail.scrollTop <= 0) {
|
|
130
|
+
e.detail.scrollTop = 0;
|
|
131
|
+
} else if (e.detail.scrollTop >= state.scrollHeight) {
|
|
132
|
+
e.detail.scrollTop = state.scrollHeight;
|
|
130
133
|
}
|
|
131
|
-
if (
|
|
132
|
-
direction = "
|
|
134
|
+
if (e.detail.scrollTop > state.scrollTop || e.detail.scrollTop >= state.scrollHeight) {
|
|
135
|
+
state.direction = "down";
|
|
133
136
|
} else {
|
|
134
|
-
direction = "
|
|
137
|
+
state.direction = "up";
|
|
135
138
|
}
|
|
136
|
-
state.
|
|
137
|
-
emit("scroll-change",
|
|
138
|
-
return offsetDistance <= props.threshold && direction == "down";
|
|
139
|
+
state.scrollTop = e.detail.scrollTop;
|
|
140
|
+
emit("scroll-change", e.detail.scrollTop);
|
|
139
141
|
};
|
|
140
142
|
const infiniteDone = () => {
|
|
141
143
|
state.isInfiniting = false;
|
|
142
144
|
};
|
|
143
|
-
const handleScroll = () => {
|
|
144
|
-
requestAniFrame()(() => {
|
|
145
|
-
if (!isScrollAtBottom() || !props.hasMore || state.isInfiniting) {
|
|
146
|
-
return false;
|
|
147
|
-
} else {
|
|
148
|
-
state.isInfiniting = true;
|
|
149
|
-
emit("load-more", infiniteDone);
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
};
|
|
153
|
-
const scrollListener = () => {
|
|
154
|
-
state.scrollEl.addEventListener("scroll", handleScroll, props.useCapture);
|
|
155
|
-
};
|
|
156
|
-
const refreshDone = () => {
|
|
157
|
-
state.distance = 0;
|
|
158
|
-
state.isTouching = false;
|
|
159
|
-
};
|
|
160
145
|
const touchStart = (event) => {
|
|
161
|
-
if (state.
|
|
146
|
+
if (state.scrollTop == 0 && !state.isTouching && props.isOpenRefresh) {
|
|
162
147
|
state.y = event.touches[0].pageY;
|
|
163
148
|
state.isTouching = true;
|
|
164
|
-
const childHeight = state.refreshTop.firstElementChild.offsetHeight;
|
|
165
|
-
state.refreshMaxH = Math.floor(childHeight * 1 + 10);
|
|
166
149
|
}
|
|
167
150
|
};
|
|
168
151
|
const touchMove = (event) => {
|
|
@@ -183,28 +166,21 @@ const _sfc_main = create({
|
|
|
183
166
|
emit("refresh", refreshDone);
|
|
184
167
|
}
|
|
185
168
|
};
|
|
169
|
+
const refreshDone = () => {
|
|
170
|
+
state.distance = 0;
|
|
171
|
+
state.isTouching = false;
|
|
172
|
+
};
|
|
186
173
|
onMounted(() => {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
onUnmounted(() => {
|
|
192
|
-
state.scrollEl.removeEventListener("scroll", handleScroll, props.useCapture);
|
|
193
|
-
});
|
|
194
|
-
const isKeepAlive = ref(false);
|
|
195
|
-
onActivated(() => {
|
|
196
|
-
if (isKeepAlive.value) {
|
|
197
|
-
isKeepAlive.value = false;
|
|
198
|
-
scrollListener();
|
|
199
|
-
}
|
|
200
|
-
});
|
|
201
|
-
onDeactivated(() => {
|
|
202
|
-
isKeepAlive.value = true;
|
|
203
|
-
state.scrollEl.removeEventListener("scroll", handleScroll, props.useCapture);
|
|
174
|
+
state.refreshMaxH = props.upperThreshold;
|
|
175
|
+
setTimeout(() => {
|
|
176
|
+
getScrollHeight();
|
|
177
|
+
}, 200);
|
|
204
178
|
});
|
|
205
179
|
return __spreadProps(__spreadValues({
|
|
206
180
|
classes
|
|
207
181
|
}, toRefs(state)), {
|
|
182
|
+
lower,
|
|
183
|
+
scroll,
|
|
208
184
|
touchStart,
|
|
209
185
|
touchMove,
|
|
210
186
|
touchEnd,
|
|
@@ -212,7 +188,10 @@ const _sfc_main = create({
|
|
|
212
188
|
});
|
|
213
189
|
}
|
|
214
190
|
});
|
|
215
|
-
const _hoisted_1 = {
|
|
191
|
+
const _hoisted_1 = {
|
|
192
|
+
class: "top-box",
|
|
193
|
+
id: "refreshTop"
|
|
194
|
+
};
|
|
216
195
|
const _hoisted_2 = { class: "top-text" };
|
|
217
196
|
const _hoisted_3 = { class: "nut-infinite-container" };
|
|
218
197
|
const _hoisted_4 = { class: "nut-infinite-bottom" };
|
|
@@ -227,39 +206,46 @@ const _hoisted_7 = {
|
|
|
227
206
|
};
|
|
228
207
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
229
208
|
const _component_nut_icon = resolveComponent("nut-icon");
|
|
230
|
-
|
|
209
|
+
const _component_scroll_view = resolveComponent("scroll-view");
|
|
210
|
+
return openBlock(), createBlock(_component_scroll_view, {
|
|
231
211
|
class: normalizeClass(_ctx.classes),
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
createElementVNode("view",
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
212
|
+
scrollY: "true",
|
|
213
|
+
style: { "height": "100%" },
|
|
214
|
+
id: "scroller",
|
|
215
|
+
onScrolltolower: _ctx.lower,
|
|
216
|
+
onScroll: _ctx.scroll,
|
|
217
|
+
onTouchstart: _ctx.touchStart,
|
|
218
|
+
onTouchmove: _ctx.touchMove,
|
|
219
|
+
onTouchend: _ctx.touchEnd
|
|
220
|
+
}, {
|
|
221
|
+
default: withCtx(() => [
|
|
222
|
+
createElementVNode("view", {
|
|
223
|
+
class: "nut-infinite-top",
|
|
224
|
+
style: normalizeStyle(_ctx.getStyle)
|
|
225
|
+
}, [
|
|
226
|
+
createElementVNode("view", _hoisted_1, [
|
|
227
|
+
createVNode(_component_nut_icon, {
|
|
228
|
+
class: "top-img",
|
|
229
|
+
name: _ctx.pullIcon
|
|
230
|
+
}, null, 8, ["name"]),
|
|
231
|
+
createElementVNode("view", _hoisted_2, toDisplayString(_ctx.pullTxt), 1)
|
|
232
|
+
])
|
|
233
|
+
], 4),
|
|
234
|
+
createElementVNode("view", _hoisted_3, [
|
|
235
|
+
renderSlot(_ctx.$slots, "default")
|
|
236
|
+
]),
|
|
237
|
+
createElementVNode("view", _hoisted_4, [
|
|
238
|
+
_ctx.isInfiniting ? (openBlock(), createElementBlock("view", _hoisted_5, [
|
|
239
|
+
createVNode(_component_nut_icon, {
|
|
240
|
+
class: "bottom-img",
|
|
241
|
+
name: _ctx.loadIcon
|
|
242
|
+
}, null, 8, ["name"]),
|
|
243
|
+
createElementVNode("view", _hoisted_6, toDisplayString(_ctx.loadTxt), 1)
|
|
244
|
+
])) : !_ctx.hasMore ? (openBlock(), createElementBlock("view", _hoisted_7, toDisplayString(_ctx.loadMoreTxt), 1)) : createCommentVNode("", true)
|
|
248
245
|
])
|
|
249
|
-
], 4),
|
|
250
|
-
createElementVNode("view", _hoisted_3, [
|
|
251
|
-
renderSlot(_ctx.$slots, "default")
|
|
252
246
|
]),
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
createVNode(_component_nut_icon, {
|
|
256
|
-
class: "bottom-img",
|
|
257
|
-
name: _ctx.loadIcon
|
|
258
|
-
}, null, 8, ["name"]),
|
|
259
|
-
createElementVNode("view", _hoisted_6, toDisplayString(_ctx.loadTxt), 1)
|
|
260
|
-
])) : !_ctx.hasMore ? (openBlock(), createElementBlock("view", _hoisted_7, toDisplayString(_ctx.loadMoreTxt), 1)) : createCommentVNode("", true)
|
|
261
|
-
])
|
|
262
|
-
], 34);
|
|
247
|
+
_: 3
|
|
248
|
+
}, 8, ["class", "onScrolltolower", "onScroll", "onTouchstart", "onTouchmove", "onTouchend"]);
|
|
263
249
|
}
|
|
264
|
-
var
|
|
265
|
-
export {
|
|
250
|
+
var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
251
|
+
export { index_taro as default };
|