@nutui/nutui 3.1.19-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/dist/nutui.d.ts +38 -37
- package/dist/nutui.es.js +13439 -12616
- package/dist/nutui.umd.js +13431 -12695
- package/dist/packages/_es/ActionSheet.js +12 -18
- package/dist/packages/_es/Address.js +78 -69
- package/dist/packages/_es/Audio.js +12 -12
- package/dist/packages/_es/AudioOperate.js +1 -1
- package/dist/packages/_es/Avatar.js +3 -3
- package/dist/packages/_es/BackTop.js +68 -110
- package/dist/packages/_es/Badge.js +3 -3
- package/dist/packages/_es/Barrage.js +62 -55
- package/dist/packages/_es/Button.js +2 -2
- package/dist/packages/_es/Calendar.js +28 -23
- package/dist/packages/_es/CalendarItem.js +3 -3
- package/dist/packages/_es/Card.js +6 -5
- package/dist/packages/_es/Cascader.js +7 -7
- package/dist/packages/_es/Cell.js +4 -11
- 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 +149 -40
- package/dist/packages/_es/Col.js +1 -1
- package/dist/packages/_es/Collapse.js +34 -8
- package/dist/packages/_es/CollapseItem.js +90 -59
- package/dist/packages/_es/CountDown.js +5 -5
- package/dist/packages/_es/CountUp.js +43 -51
- package/dist/packages/_es/DatePicker.js +21 -20
- package/dist/packages/_es/Dialog.js +8 -86
- package/dist/packages/_es/Divider.js +4 -4
- package/dist/packages/_es/Drag.js +92 -54
- package/dist/packages/_es/Elevator.js +74 -49
- package/dist/packages/_es/Empty.js +3 -3
- package/dist/packages/_es/FixedNav.js +5 -5
- package/dist/packages/_es/Form.js +4 -4
- package/dist/packages/_es/FormItem.js +1 -1
- package/dist/packages/_es/Grid.js +1 -1
- package/dist/packages/_es/GridItem.js +8 -26
- package/dist/packages/_es/Icon.js +1 -1
- package/dist/packages/_es/ImagePreview.js +15 -84
- package/dist/packages/_es/Indicator.js +3 -3
- package/dist/packages/_es/InfiniteLoading.js +93 -107
- package/dist/packages/_es/Input.js +8 -8
- package/dist/packages/_es/InputNumber.js +23 -16
- package/dist/packages/_es/Layout.js +1 -1
- package/dist/packages/_es/List.js +41 -34
- package/dist/packages/_es/Menu.js +15 -12
- package/dist/packages/_es/MenuItem.js +9 -9
- package/dist/packages/_es/Navbar.js +3 -4
- package/dist/packages/_es/NoticeBar.js +47 -40
- package/dist/packages/_es/Notify.js +29 -168
- package/dist/packages/_es/NumberKeyboard.js +5 -10
- package/dist/packages/_es/OldPicker.js +122 -120
- package/dist/packages/_es/OverLay.js +5 -25
- package/dist/packages/_es/Pagination.js +7 -7
- package/dist/packages/_es/Picker.js +39 -16
- package/dist/packages/_es/Popover.js +155 -30
- package/dist/packages/_es/Popup.js +8 -71
- package/dist/packages/_es/Price.js +17 -5
- package/dist/packages/_es/Progress.js +18 -8
- package/dist/packages/_es/PullRefresh.js +1 -1
- package/dist/packages/_es/Radio.js +2 -2
- package/dist/packages/_es/RadioGroup.js +1 -1
- package/dist/packages/_es/Range.js +46 -33
- package/dist/packages/_es/Rate.js +16 -19
- package/dist/packages/_es/Row.js +1 -1
- package/dist/packages/_es/SearchBar.js +8 -6
- package/dist/packages/_es/ShortPassword.js +89 -67
- package/dist/packages/_es/SideNavBar.js +5 -16
- package/dist/packages/_es/SideNavBarItem.js +1 -1
- package/dist/packages/_es/Signature.js +69 -88
- package/dist/packages/_es/Skeleton.js +8 -11
- package/dist/packages/_es/Sku.js +47 -56
- package/dist/packages/_es/Step.js +1 -1
- package/dist/packages/_es/Steps.js +1 -1
- package/dist/packages/_es/Sticky.js +28 -23
- package/dist/packages/_es/SubSideNavBar.js +1 -1
- package/dist/packages/_es/Swipe.js +39 -26
- package/dist/packages/_es/Swiper.js +31 -13
- package/dist/packages/_es/SwiperItem.js +1 -1
- package/dist/packages/_es/Switch.js +3 -3
- package/dist/packages/_es/TabPane.js +1 -1
- package/dist/packages/_es/Tabbar.js +3 -3
- package/dist/packages/_es/TabbarItem.js +17 -23
- package/dist/packages/_es/Table.js +13 -13
- package/dist/packages/_es/Tabs.js +21 -20
- package/dist/packages/_es/Tag.js +4 -4
- package/dist/packages/_es/TextArea.js +44 -42
- package/dist/packages/_es/TimeDetail.js +4 -3
- package/dist/packages/_es/TimePannel.js +3 -3
- package/dist/packages/_es/TimeSelect.js +8 -7
- package/dist/packages/_es/Toast.js +41 -170
- package/dist/packages/_es/Uploader.js +109 -138
- package/dist/packages/_es/Video.js +3 -3
- package/dist/packages/_es/common.js +1 -1
- package/dist/packages/_es/component.js +1 -1
- package/dist/packages/_es/index.js +44 -6
- package/dist/packages/_es/{index5.js → index.taro.js} +127 -95
- package/dist/packages/_es/index2.js +1 -1
- package/dist/packages/_es/index3.js +56 -28
- package/dist/packages/_es/index4.js +413 -56
- package/dist/packages/_es/plugin-vue_export-helper.js +1 -1
- package/dist/packages/_es/pxCheck.js +1 -1
- package/dist/packages/_es/use-lock-scroll.js +23 -0
- package/dist/packages/_es/util.js +1 -1
- package/dist/packages/uploader/index.scss +2 -2
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +61 -61
- package/dist/styles/themes/jdt.scss +61 -61
- package/package.json +1 -1
- package/dist/packages/_es/raf.js +0 -19
|
@@ -17,26 +17,24 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __publicField = (obj, key, value) => {
|
|
21
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
22
|
-
return value;
|
|
23
|
-
};
|
|
24
20
|
/*!
|
|
25
|
-
* @nutui/nutui v3.1.19-beta.
|
|
21
|
+
* @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
|
|
26
22
|
* (c) 2022 @jdf2e.
|
|
27
23
|
* Released under the MIT License.
|
|
28
24
|
*/
|
|
29
|
-
import { toRefs, reactive, watch, onMounted, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, withModifiers, createElementBlock, Fragment, renderList,
|
|
25
|
+
import { toRefs, reactive, watch, onMounted, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, withModifiers, createElementBlock, Fragment, renderList, createCommentVNode, toDisplayString } from "vue";
|
|
30
26
|
import { c as createComponent } from "./component.js";
|
|
31
|
-
import
|
|
32
|
-
import Video from "./Video.js";
|
|
27
|
+
import Popup from "./Popup.js";
|
|
33
28
|
import Swiper from "./Swiper.js";
|
|
34
29
|
import SwiperItem from "./SwiperItem.js";
|
|
35
30
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
31
|
+
import "./use-lock-scroll.js";
|
|
36
32
|
import "./OverLay.js";
|
|
37
33
|
import "./Icon.js";
|
|
38
34
|
import "./pxCheck.js";
|
|
35
|
+
import "./index.js";
|
|
39
36
|
import "./index2.js";
|
|
37
|
+
import "@tarojs/taro";
|
|
40
38
|
const { componentName, create } = createComponent("imagepreview");
|
|
41
39
|
const _sfc_main = create({
|
|
42
40
|
props: {
|
|
@@ -48,10 +46,6 @@ const _sfc_main = create({
|
|
|
48
46
|
type: Array,
|
|
49
47
|
default: () => []
|
|
50
48
|
},
|
|
51
|
-
videos: {
|
|
52
|
-
type: Array,
|
|
53
|
-
default: () => []
|
|
54
|
-
},
|
|
55
49
|
contentClose: {
|
|
56
50
|
type: Boolean,
|
|
57
51
|
default: false
|
|
@@ -71,16 +65,11 @@ const _sfc_main = create({
|
|
|
71
65
|
autoplay: {
|
|
72
66
|
type: [Number, String],
|
|
73
67
|
default: 3e3
|
|
74
|
-
},
|
|
75
|
-
isWrapTeleport: {
|
|
76
|
-
type: Boolean,
|
|
77
|
-
default: false
|
|
78
68
|
}
|
|
79
69
|
},
|
|
80
70
|
emits: ["close"],
|
|
81
71
|
components: {
|
|
82
|
-
[
|
|
83
|
-
[Video.name]: Video,
|
|
72
|
+
[Popup.name]: Popup,
|
|
84
73
|
[Swiper.name]: Swiper,
|
|
85
74
|
[SwiperItem.name]: SwiperItem
|
|
86
75
|
},
|
|
@@ -124,7 +113,9 @@ const _sfc_main = create({
|
|
|
124
113
|
return Math.hypot(Math.abs(second.x - first.x), Math.abs(second.y - first.y));
|
|
125
114
|
};
|
|
126
115
|
const scaleNow = () => {
|
|
127
|
-
|
|
116
|
+
if (state.eleImg != null) {
|
|
117
|
+
state.eleImg.style.transform = "scale(" + state.store.scale + ")";
|
|
118
|
+
}
|
|
128
119
|
};
|
|
129
120
|
const onTouchStart = (event) => {
|
|
130
121
|
const curTouchTime = new Date().getTime();
|
|
@@ -199,7 +190,7 @@ const _sfc_main = create({
|
|
|
199
190
|
onMounted(() => {
|
|
200
191
|
state.active = props.initNo;
|
|
201
192
|
state.showPop = props.show;
|
|
202
|
-
state.maxNo = props.images.length
|
|
193
|
+
state.maxNo = props.images.length;
|
|
203
194
|
});
|
|
204
195
|
return __spreadProps(__spreadValues({}, toRefs(state)), {
|
|
205
196
|
slideChangeEnd,
|
|
@@ -216,7 +207,6 @@ const _sfc_main = create({
|
|
|
216
207
|
const _hoisted_1 = ["src"];
|
|
217
208
|
const _hoisted_2 = { class: "nut-imagepreview-index" };
|
|
218
209
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
219
|
-
const _component_nut_video = resolveComponent("nut-video");
|
|
220
210
|
const _component_nut_swiper_item = resolveComponent("nut-swiper-item");
|
|
221
211
|
const _component_nut_swiper = resolveComponent("nut-swiper");
|
|
222
212
|
const _component_nut_popup = resolveComponent("nut-popup");
|
|
@@ -224,7 +214,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
224
214
|
"pop-class": "custom-pop",
|
|
225
215
|
visible: _ctx.showPop,
|
|
226
216
|
"onUpdate:visible": _cache[2] || (_cache[2] = ($event) => _ctx.showPop = $event),
|
|
227
|
-
isWrapTeleport: _ctx.isWrapTeleport,
|
|
228
217
|
onClick: _ctx.onClose,
|
|
229
218
|
style: { "width": "100%" }
|
|
230
219
|
}, {
|
|
@@ -247,17 +236,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
247
236
|
"pagination-color": _ctx.paginationColor
|
|
248
237
|
}, {
|
|
249
238
|
default: withCtx(() => [
|
|
250
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.videos, (item, index) => {
|
|
251
|
-
return openBlock(), createBlock(_component_nut_swiper_item, { key: index }, {
|
|
252
|
-
default: withCtx(() => [
|
|
253
|
-
createVNode(_component_nut_video, {
|
|
254
|
-
source: item.source,
|
|
255
|
-
options: item.options
|
|
256
|
-
}, null, 8, ["source", "options"])
|
|
257
|
-
]),
|
|
258
|
-
_: 2
|
|
259
|
-
}, 1024);
|
|
260
|
-
}), 128)),
|
|
261
239
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.images, (item, index) => {
|
|
262
240
|
return openBlock(), createBlock(_component_nut_swiper_item, { key: index }, {
|
|
263
241
|
default: withCtx(() => [
|
|
@@ -273,57 +251,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
273
251
|
_: 1
|
|
274
252
|
}, 8, ["auto-play", "onChange", "init-page", "pagination-visible", "pagination-color"])) : createCommentVNode("", true)
|
|
275
253
|
], 32),
|
|
276
|
-
createElementVNode("view", _hoisted_2, toDisplayString(_ctx.active) + " / " + toDisplayString(_ctx.images.length
|
|
254
|
+
createElementVNode("view", _hoisted_2, toDisplayString(_ctx.active) + " / " + toDisplayString(_ctx.images.length), 1)
|
|
277
255
|
]),
|
|
278
256
|
_: 1
|
|
279
|
-
}, 8, ["visible", "
|
|
280
|
-
}
|
|
281
|
-
var ImagePreview = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
282
|
-
class ImagePreviewOptions {
|
|
283
|
-
constructor() {
|
|
284
|
-
__publicField(this, "show", false);
|
|
285
|
-
__publicField(this, "images", []);
|
|
286
|
-
__publicField(this, "initNo", 1);
|
|
287
|
-
__publicField(this, "paginationVisible", false);
|
|
288
|
-
__publicField(this, "paginationColor", "");
|
|
289
|
-
__publicField(this, "teleport", "body");
|
|
290
|
-
__publicField(this, "onClose", () => {
|
|
291
|
-
});
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
class ImagePreviewFunction {
|
|
295
|
-
constructor(_options) {
|
|
296
|
-
__publicField(this, "options", new ImagePreviewOptions());
|
|
297
|
-
let options = Object.assign(this.options, _options);
|
|
298
|
-
let elWarp = document.body;
|
|
299
|
-
let teleport = options.teleport;
|
|
300
|
-
if (teleport != "body") {
|
|
301
|
-
if (typeof teleport == "string") {
|
|
302
|
-
elWarp = document.querySelector(teleport);
|
|
303
|
-
} else {
|
|
304
|
-
elWarp = options.teleport;
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
const root = document.createElement("view");
|
|
308
|
-
root.id = "imagepreview-" + new Date().getTime();
|
|
309
|
-
const Wrapper = {
|
|
310
|
-
setup() {
|
|
311
|
-
options.teleport = `#${root.id}`;
|
|
312
|
-
return () => {
|
|
313
|
-
return h(ImagePreview, options);
|
|
314
|
-
};
|
|
315
|
-
}
|
|
316
|
-
};
|
|
317
|
-
const instance = createVNode(Wrapper);
|
|
318
|
-
elWarp.appendChild(root);
|
|
319
|
-
render(instance, root);
|
|
320
|
-
}
|
|
257
|
+
}, 8, ["visible", "onClick"]);
|
|
321
258
|
}
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
};
|
|
325
|
-
_ImagePreview.install = (app) => {
|
|
326
|
-
app.use(ImagePreview);
|
|
327
|
-
app.config.globalProperties.$imagepreview = _ImagePreview;
|
|
328
|
-
};
|
|
329
|
-
export { ImagePreview, ImagePreviewOptions, _ImagePreview as default };
|
|
259
|
+
var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
260
|
+
export { index_taro as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.19-beta.
|
|
2
|
+
* @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -62,5 +62,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
62
62
|
}), 128))
|
|
63
63
|
], 2);
|
|
64
64
|
}
|
|
65
|
-
var
|
|
66
|
-
export {
|
|
65
|
+
var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
66
|
+
export { index_taro as default };
|
|
@@ -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.19-beta.
|
|
21
|
+
* @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
|
|
22
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 };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.19-beta.
|
|
2
|
+
* @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -7,14 +7,14 @@ import { ref, reactive, computed, watch, onMounted, resolveComponent, openBlock,
|
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
8
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
9
|
function trimExtraChar(value, char, regExp) {
|
|
10
|
-
const
|
|
11
|
-
if (
|
|
10
|
+
const index = value.indexOf(char);
|
|
11
|
+
if (index === -1) {
|
|
12
12
|
return value;
|
|
13
13
|
}
|
|
14
|
-
if (char === "-" &&
|
|
15
|
-
return value.slice(0,
|
|
14
|
+
if (char === "-" && index !== 0) {
|
|
15
|
+
return value.slice(0, index);
|
|
16
16
|
}
|
|
17
|
-
return value.slice(0,
|
|
17
|
+
return value.slice(0, index + 1) + value.slice(index).replace(regExp, "");
|
|
18
18
|
}
|
|
19
19
|
function formatNumber(value, allowDot = true, allowMinus = true) {
|
|
20
20
|
if (allowDot) {
|
|
@@ -413,5 +413,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
413
413
|
])
|
|
414
414
|
], 2);
|
|
415
415
|
}
|
|
416
|
-
var
|
|
417
|
-
export {
|
|
416
|
+
var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
417
|
+
export { index_taro as default };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.19-beta.
|
|
2
|
+
* @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { computed, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createVNode,
|
|
6
|
+
import { computed, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createVNode, toDisplayString } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
8
|
import { p as pxCheck } from "./pxCheck.js";
|
|
9
9
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
@@ -61,7 +61,7 @@ const _sfc_main = create({
|
|
|
61
61
|
};
|
|
62
62
|
const change = (event) => {
|
|
63
63
|
const input = event.target;
|
|
64
|
-
emit("update:modelValue", input.
|
|
64
|
+
emit("update:modelValue", input.value, event);
|
|
65
65
|
};
|
|
66
66
|
const emitChange = (value, event) => {
|
|
67
67
|
let output_value = fixedDecimalPlaces(value);
|
|
@@ -92,20 +92,13 @@ const _sfc_main = create({
|
|
|
92
92
|
emit("overlimit", event, "add");
|
|
93
93
|
}
|
|
94
94
|
};
|
|
95
|
-
const focus = (event) => {
|
|
96
|
-
if (props.disabled)
|
|
97
|
-
return;
|
|
98
|
-
if (props.readonly)
|
|
99
|
-
return;
|
|
100
|
-
emit("focus", event);
|
|
101
|
-
};
|
|
102
95
|
const blur = (event) => {
|
|
103
96
|
if (props.disabled)
|
|
104
97
|
return;
|
|
105
98
|
if (props.readonly)
|
|
106
99
|
return;
|
|
107
100
|
const input = event.target;
|
|
108
|
-
let value = input.
|
|
101
|
+
let value = +input.value;
|
|
109
102
|
if (value < Number(props.min)) {
|
|
110
103
|
value = Number(props.min);
|
|
111
104
|
} else if (value > Number(props.max)) {
|
|
@@ -114,6 +107,15 @@ const _sfc_main = create({
|
|
|
114
107
|
emitChange(value, event);
|
|
115
108
|
emit("blur", event);
|
|
116
109
|
};
|
|
110
|
+
const focus = (event) => {
|
|
111
|
+
if (props.disabled)
|
|
112
|
+
return;
|
|
113
|
+
if (props.readonly) {
|
|
114
|
+
blur(event);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
emit("focus", event);
|
|
118
|
+
};
|
|
117
119
|
return {
|
|
118
120
|
classes,
|
|
119
121
|
change,
|
|
@@ -127,7 +129,11 @@ const _sfc_main = create({
|
|
|
127
129
|
};
|
|
128
130
|
}
|
|
129
131
|
});
|
|
130
|
-
const _hoisted_1 =
|
|
132
|
+
const _hoisted_1 = {
|
|
133
|
+
key: 0,
|
|
134
|
+
class: "nut-inputnumber__text--readonly"
|
|
135
|
+
};
|
|
136
|
+
const _hoisted_2 = ["min", "max", "disabled", "readonly", "value"];
|
|
131
137
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
132
138
|
const _component_nut_icon = resolveComponent("nut-icon");
|
|
133
139
|
return openBlock(), createElementBlock("view", {
|
|
@@ -140,7 +146,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
140
146
|
size: _ctx.buttonSize,
|
|
141
147
|
onClick: _ctx.reduce
|
|
142
148
|
}, null, 8, ["class", "size", "onClick"]),
|
|
143
|
-
|
|
149
|
+
_ctx.readonly ? (openBlock(), createElementBlock("view", _hoisted_1, toDisplayString(_ctx.modelValue), 1)) : (openBlock(), createElementBlock("input", {
|
|
150
|
+
key: 1,
|
|
144
151
|
type: "number",
|
|
145
152
|
min: _ctx.min,
|
|
146
153
|
max: _ctx.max,
|
|
@@ -151,7 +158,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
151
158
|
onInput: _cache[0] || (_cache[0] = (...args) => _ctx.change && _ctx.change(...args)),
|
|
152
159
|
onBlur: _cache[1] || (_cache[1] = (...args) => _ctx.blur && _ctx.blur(...args)),
|
|
153
160
|
onFocus: _cache[2] || (_cache[2] = (...args) => _ctx.focus && _ctx.focus(...args))
|
|
154
|
-
}, null, 44,
|
|
161
|
+
}, null, 44, _hoisted_2)),
|
|
155
162
|
createVNode(_component_nut_icon, {
|
|
156
163
|
name: "plus",
|
|
157
164
|
class: normalizeClass(["nut-inputnumber__icon", { "nut-inputnumber__icon--disabled": !_ctx.addAllow() }]),
|
|
@@ -160,5 +167,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
160
167
|
}, null, 8, ["class", "size", "onClick"])
|
|
161
168
|
], 6);
|
|
162
169
|
}
|
|
163
|
-
var
|
|
164
|
-
export {
|
|
170
|
+
var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
171
|
+
export { index_taro as default };
|