@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
|
@@ -17,20 +17,17 @@ 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.
|
|
26
|
-
* (c)
|
|
21
|
+
* @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
|
|
22
|
+
* (c) 2022 @jdf2e.
|
|
27
23
|
* Released under the MIT License.
|
|
28
24
|
*/
|
|
29
|
-
import { ref, onMounted, watch, computed, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, normalizeClass, createElementBlock, renderSlot, Fragment, createTextVNode, toDisplayString, createCommentVNode, normalizeStyle
|
|
25
|
+
import { ref, onMounted, watch, computed, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, normalizeClass, createElementBlock, renderSlot, Fragment, createTextVNode, toDisplayString, createCommentVNode, normalizeStyle } from "vue";
|
|
30
26
|
import { c as createComponent } from "./component.js";
|
|
31
27
|
import Popup, { popupProps } from "./Popup.js";
|
|
32
28
|
import Button from "./Button.js";
|
|
33
29
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
30
|
+
import "./use-lock-scroll.js";
|
|
34
31
|
import "./OverLay.js";
|
|
35
32
|
import "./Icon.js";
|
|
36
33
|
import "./pxCheck.js";
|
|
@@ -128,8 +125,8 @@ const _sfc_main = create({
|
|
|
128
125
|
}
|
|
129
126
|
};
|
|
130
127
|
const onOk = () => {
|
|
131
|
-
emit("ok");
|
|
132
128
|
closed();
|
|
129
|
+
emit("ok");
|
|
133
130
|
};
|
|
134
131
|
return {
|
|
135
132
|
closed,
|
|
@@ -214,78 +211,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
214
211
|
_: 3
|
|
215
212
|
}, 8, ["teleport", "visible", "close-on-click-overlay", "lock-scroll", "onClickOverlay", "onClickCloseIcon"]);
|
|
216
213
|
}
|
|
217
|
-
var
|
|
218
|
-
|
|
219
|
-
constructor() {
|
|
220
|
-
__publicField(this, "title", "");
|
|
221
|
-
__publicField(this, "content", "");
|
|
222
|
-
__publicField(this, "cancelText", "\u53D6\u6D88");
|
|
223
|
-
__publicField(this, "okText", "\u786E\u5B9A");
|
|
224
|
-
__publicField(this, "textAlign", "center");
|
|
225
|
-
__publicField(this, "teleport", "body");
|
|
226
|
-
__publicField(this, "onUpdate", (value) => {
|
|
227
|
-
});
|
|
228
|
-
__publicField(this, "onOk", () => {
|
|
229
|
-
});
|
|
230
|
-
__publicField(this, "onCancel", () => {
|
|
231
|
-
});
|
|
232
|
-
__publicField(this, "onClose", () => {
|
|
233
|
-
});
|
|
234
|
-
__publicField(this, "onClosed", () => {
|
|
235
|
-
});
|
|
236
|
-
__publicField(this, "visible", true);
|
|
237
|
-
__publicField(this, "noFooter", false);
|
|
238
|
-
__publicField(this, "noOkBtn", false);
|
|
239
|
-
__publicField(this, "noCancelBtn", false);
|
|
240
|
-
__publicField(this, "okBtnDisabled", false);
|
|
241
|
-
__publicField(this, "closeOnPopstate", false);
|
|
242
|
-
__publicField(this, "lockScroll", false);
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
class DialogFunction {
|
|
246
|
-
constructor(_options) {
|
|
247
|
-
__publicField(this, "options", new DialogOptions());
|
|
248
|
-
__publicField(this, "close", () => {
|
|
249
|
-
});
|
|
250
|
-
__publicField(this, "setDefaultOptions", (options) => {
|
|
251
|
-
});
|
|
252
|
-
__publicField(this, "resetDefaultOptions", () => {
|
|
253
|
-
});
|
|
254
|
-
let options = Object.assign(this.options, _options);
|
|
255
|
-
let elWarp = document.body;
|
|
256
|
-
let teleport = options.teleport;
|
|
257
|
-
if (teleport != "body") {
|
|
258
|
-
if (typeof teleport == "string") {
|
|
259
|
-
elWarp = document.querySelector(teleport);
|
|
260
|
-
} else {
|
|
261
|
-
elWarp = options.teleport;
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
const root = document.createElement("view");
|
|
265
|
-
root.id = "dialog-" + new Date().getTime();
|
|
266
|
-
const Wrapper = {
|
|
267
|
-
setup() {
|
|
268
|
-
options.onUpdate = (val) => {
|
|
269
|
-
if (val == false) {
|
|
270
|
-
elWarp.removeChild(root);
|
|
271
|
-
}
|
|
272
|
-
};
|
|
273
|
-
options.teleport = `#${root.id}`;
|
|
274
|
-
return () => {
|
|
275
|
-
return h(Dialog, options);
|
|
276
|
-
};
|
|
277
|
-
}
|
|
278
|
-
};
|
|
279
|
-
const instance = createVNode(Wrapper);
|
|
280
|
-
elWarp.appendChild(root);
|
|
281
|
-
render(instance, root);
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
const _Dialog = function(options) {
|
|
285
|
-
return new DialogFunction(options);
|
|
286
|
-
};
|
|
287
|
-
_Dialog.install = (app) => {
|
|
288
|
-
app.use(Dialog);
|
|
289
|
-
app.config.globalProperties.$dialog = _Dialog;
|
|
290
|
-
};
|
|
291
|
-
export { Dialog, DialogOptions, _Dialog as default };
|
|
214
|
+
var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
215
|
+
export { index_taro as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
3
|
-
* (c)
|
|
2
|
+
* @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
|
|
3
|
+
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { computed, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
|
|
@@ -39,11 +39,11 @@ const _sfc_main = create({
|
|
|
39
39
|
}
|
|
40
40
|
});
|
|
41
41
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
42
|
-
return openBlock(), createElementBlock("
|
|
42
|
+
return openBlock(), createElementBlock("view", {
|
|
43
43
|
class: normalizeClass(_ctx.classes)
|
|
44
44
|
}, [
|
|
45
45
|
renderSlot(_ctx.$slots, "default")
|
|
46
46
|
], 2);
|
|
47
47
|
}
|
|
48
|
-
var
|
|
49
|
-
export {
|
|
48
|
+
var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
49
|
+
export { index_taro as default };
|
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
3
|
-
* (c)
|
|
2
|
+
* @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
|
|
3
|
+
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { ref, reactive, computed, onMounted, onActivated, onDeactivated, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
|
|
6
|
+
import { ref, reactive, computed, onMounted, onActivated, onDeactivated, openBlock, createElementBlock, normalizeClass, withModifiers, normalizeStyle, renderSlot } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
|
-
import {
|
|
8
|
+
import Taro, { eventCenter, getCurrentInstance } from "@tarojs/taro";
|
|
9
9
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
10
|
+
const _window = window;
|
|
11
|
+
function requestAniFrame() {
|
|
12
|
+
if (typeof _window !== "undefined") {
|
|
13
|
+
return _window.requestAnimationFrame || _window.webkitRequestAnimationFrame || function(callback) {
|
|
14
|
+
_window.setTimeout(callback, 1e3 / 60);
|
|
15
|
+
};
|
|
16
|
+
} else {
|
|
17
|
+
return function(callback) {
|
|
18
|
+
setTimeout(callback, 1e3 / 60);
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
var requestAniFrame$1 = requestAniFrame();
|
|
10
23
|
const { componentName, create } = createComponent("drag");
|
|
11
24
|
const _sfc_main = create({
|
|
12
25
|
props: {
|
|
@@ -40,10 +53,13 @@ const _sfc_main = create({
|
|
|
40
53
|
screenHeight: 0,
|
|
41
54
|
startTop: 0,
|
|
42
55
|
startLeft: 0,
|
|
56
|
+
initTop: 0,
|
|
43
57
|
nx: 0,
|
|
44
58
|
ny: 0,
|
|
45
59
|
xPum: 0,
|
|
46
60
|
yPum: 0,
|
|
61
|
+
top: 0,
|
|
62
|
+
left: 0,
|
|
47
63
|
position: { x: 0, y: 0 },
|
|
48
64
|
boundary: {
|
|
49
65
|
top: 0,
|
|
@@ -53,54 +69,57 @@ const _sfc_main = create({
|
|
|
53
69
|
}
|
|
54
70
|
});
|
|
55
71
|
const classes = computed(() => {
|
|
56
|
-
const prefixCls =
|
|
72
|
+
const prefixCls = "nut-taro-drag";
|
|
57
73
|
return {
|
|
58
74
|
[prefixCls]: true
|
|
59
75
|
};
|
|
60
76
|
});
|
|
77
|
+
const domElem = Taro.getSystemInfoSync();
|
|
61
78
|
function getInfo() {
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
79
|
+
const query = Taro.createSelectorQuery();
|
|
80
|
+
query.select(".myDrag").boundingClientRect((rec) => {
|
|
81
|
+
state.elWidth = rec.width;
|
|
82
|
+
state.elHeight = rec.height;
|
|
83
|
+
state.initTop = rec.top;
|
|
84
|
+
}).exec();
|
|
85
|
+
state.screenWidth = domElem.screenWidth;
|
|
86
|
+
state.screenHeight = domElem.screenHeight;
|
|
67
87
|
}
|
|
68
|
-
function goLeft(
|
|
88
|
+
function goLeft() {
|
|
69
89
|
if (state.boundary.left) {
|
|
70
|
-
if (+
|
|
71
|
-
|
|
72
|
-
requestAniFrame(() => {
|
|
73
|
-
goLeft(
|
|
90
|
+
if (+state.left.split("px")[0] > state.boundary.left) {
|
|
91
|
+
state.left = +state.left.split("px")[0] - 10 + "px";
|
|
92
|
+
requestAniFrame$1(() => {
|
|
93
|
+
goLeft();
|
|
74
94
|
});
|
|
75
95
|
} else {
|
|
76
|
-
|
|
96
|
+
state.left = `${state.boundary.left}px`;
|
|
77
97
|
}
|
|
78
98
|
} else {
|
|
79
|
-
if (+
|
|
80
|
-
|
|
81
|
-
requestAniFrame(() => {
|
|
82
|
-
goLeft(
|
|
99
|
+
if (+state.left.split("px")[0] > 10) {
|
|
100
|
+
state.left = +state.left.split("px")[0] - 10 + "px";
|
|
101
|
+
requestAniFrame$1(() => {
|
|
102
|
+
goLeft();
|
|
83
103
|
});
|
|
84
104
|
} else {
|
|
85
|
-
|
|
105
|
+
state.left = "0px";
|
|
86
106
|
}
|
|
87
107
|
}
|
|
88
108
|
}
|
|
89
|
-
function goRight(
|
|
90
|
-
if (rightLocation - parseInt(
|
|
91
|
-
|
|
92
|
-
requestAniFrame(() => {
|
|
93
|
-
goRight(
|
|
109
|
+
function goRight(rightLocation) {
|
|
110
|
+
if (rightLocation - parseInt(state.left.split("px")[0]) > 10) {
|
|
111
|
+
state.left = parseInt(state.left.split("px")[0]) + 10 + "px";
|
|
112
|
+
requestAniFrame$1(() => {
|
|
113
|
+
goRight(rightLocation);
|
|
94
114
|
});
|
|
95
115
|
} else {
|
|
96
|
-
|
|
116
|
+
state.left = rightLocation + "px";
|
|
97
117
|
}
|
|
98
118
|
}
|
|
99
119
|
function touchMove(e) {
|
|
100
120
|
e.preventDefault();
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
const touch = e.targetTouches[0];
|
|
121
|
+
if (e.touches.length === 1) {
|
|
122
|
+
const touch = e.touches[0];
|
|
104
123
|
state.nx = touch.clientX - state.position.x;
|
|
105
124
|
state.ny = touch.clientY - state.position.y;
|
|
106
125
|
state.xPum = state.startLeft + state.nx;
|
|
@@ -117,15 +136,14 @@ const _sfc_main = create({
|
|
|
117
136
|
state.yPum = state.screenHeight - state.elHeight - state.boundary.bottom;
|
|
118
137
|
}
|
|
119
138
|
if (props.direction != "y") {
|
|
120
|
-
|
|
139
|
+
state.left = state.xPum;
|
|
121
140
|
}
|
|
122
141
|
if (props.direction != "x") {
|
|
123
|
-
|
|
142
|
+
state.top = state.yPum;
|
|
124
143
|
}
|
|
125
144
|
}
|
|
126
145
|
}
|
|
127
146
|
function touchEnd(e) {
|
|
128
|
-
const target = e.currentTarget;
|
|
129
147
|
const touch = e.changedTouches[0];
|
|
130
148
|
let currX = touch.clientX;
|
|
131
149
|
const rightLocation = state.screenWidth - state.elWidth - state.boundary.right;
|
|
@@ -138,34 +156,48 @@ const _sfc_main = create({
|
|
|
138
156
|
}
|
|
139
157
|
if (props.direction != "y" && props.attract) {
|
|
140
158
|
if (currX < state.screenWidth / 2) {
|
|
141
|
-
requestAniFrame(() => {
|
|
142
|
-
goLeft(
|
|
159
|
+
requestAniFrame$1(() => {
|
|
160
|
+
goLeft();
|
|
143
161
|
});
|
|
144
162
|
} else {
|
|
145
|
-
requestAniFrame(() => {
|
|
146
|
-
goRight(
|
|
163
|
+
requestAniFrame$1(() => {
|
|
164
|
+
goRight(rightLocation);
|
|
147
165
|
});
|
|
148
166
|
}
|
|
149
167
|
}
|
|
150
|
-
if (props.direction
|
|
151
|
-
|
|
168
|
+
if (props.direction !== "x") {
|
|
169
|
+
state.top = state.yPum;
|
|
152
170
|
}
|
|
153
171
|
}
|
|
154
172
|
function touchStart(e) {
|
|
155
|
-
|
|
173
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
174
|
+
const query = Taro.createSelectorQuery();
|
|
175
|
+
let id = (_a = e == null ? void 0 : e.mpEvent) == null ? void 0 : _a.currentTarget.id;
|
|
176
|
+
let offsetTop = (_b = e == null ? void 0 : e.currentTarget) == null ? void 0 : _b.offsetTop;
|
|
177
|
+
let offsetLeft = (_c = e == null ? void 0 : e.currentTarget) == null ? void 0 : _c.offsetLeft;
|
|
156
178
|
const touches = e.touches[0];
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
-
|
|
179
|
+
const mobileTop = (_f = (_e = (_d = e.touches[0]) == null ? void 0 : _d.target) == null ? void 0 : _e.parentNode) == null ? void 0 : _f.style.top;
|
|
180
|
+
const mobileLeft = (_i = (_h = (_g = e.touches[0]) == null ? void 0 : _g.target) == null ? void 0 : _h.parentNode) == null ? void 0 : _i.style.left;
|
|
181
|
+
query.selectAll(".myDrag").boundingClientRect((rec) => {
|
|
182
|
+
rec.forEach((element) => {
|
|
183
|
+
if (id && id == element.id) {
|
|
184
|
+
state.startTop = element.top - offsetTop;
|
|
185
|
+
state.startLeft = element.left - offsetLeft;
|
|
186
|
+
} else if (mobileTop) {
|
|
187
|
+
state.startTop = Number(mobileTop.slice(0, -2));
|
|
188
|
+
state.startLeft = Number(mobileLeft.slice(0, -2));
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
}).exec();
|
|
160
192
|
state.position.x = touches.clientX;
|
|
161
193
|
state.position.y = touches.clientY;
|
|
162
|
-
state.nx = touch.clientX - state.position.x;
|
|
163
|
-
state.ny = touch.clientY - state.position.y;
|
|
164
|
-
state.xPum = state.startLeft + state.nx;
|
|
165
|
-
state.yPum = state.startTop + state.ny;
|
|
166
194
|
}
|
|
167
195
|
onMounted(() => {
|
|
168
|
-
|
|
196
|
+
setTimeout(() => {
|
|
197
|
+
getInfo();
|
|
198
|
+
}, 200);
|
|
199
|
+
eventCenter.once(getCurrentInstance().router.onReady, () => {
|
|
200
|
+
});
|
|
169
201
|
state.boundary = props.boundary;
|
|
170
202
|
});
|
|
171
203
|
onActivated(() => {
|
|
@@ -184,20 +216,26 @@ const _sfc_main = create({
|
|
|
184
216
|
myDrag,
|
|
185
217
|
touchStart,
|
|
186
218
|
touchMove,
|
|
187
|
-
touchEnd
|
|
219
|
+
touchEnd,
|
|
220
|
+
state
|
|
188
221
|
};
|
|
189
222
|
}
|
|
190
223
|
});
|
|
191
224
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
192
225
|
return openBlock(), createElementBlock("view", {
|
|
193
|
-
class: normalizeClass(_ctx.classes),
|
|
226
|
+
class: normalizeClass([_ctx.classes, "myDrag"]),
|
|
194
227
|
ref: "myDrag",
|
|
195
228
|
onTouchstart: _cache[0] || (_cache[0] = ($event) => _ctx.touchStart($event)),
|
|
196
|
-
onTouchmove: _cache[1] || (_cache[1] = ($event) => _ctx.touchMove($event)),
|
|
197
|
-
|
|
229
|
+
onTouchmove: _cache[1] || (_cache[1] = withModifiers(($event) => _ctx.touchMove($event), ["prevent"])),
|
|
230
|
+
catchtouchmove: "true",
|
|
231
|
+
style: normalizeStyle({
|
|
232
|
+
transform: ` translate(${_ctx.state.left + "px"}, ${_ctx.state.top + "px"})`,
|
|
233
|
+
top: _ctx.state.top + "px",
|
|
234
|
+
left: _ctx.state.left + "px"
|
|
235
|
+
})
|
|
198
236
|
}, [
|
|
199
237
|
renderSlot(_ctx.$slots, "default")
|
|
200
|
-
],
|
|
238
|
+
], 38);
|
|
201
239
|
}
|
|
202
|
-
var
|
|
203
|
-
export {
|
|
240
|
+
var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
241
|
+
export { index_taro as default };
|
|
@@ -18,13 +18,14 @@ 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 { ref, reactive, computed, toRefs, nextTick, openBlock, createElementBlock, normalizeClass,
|
|
25
|
+
import { ref, reactive, computed, onMounted, toRefs, nextTick, resolveComponent, openBlock, createElementBlock, normalizeClass, createVNode, normalizeStyle, withCtx, Fragment, renderList, createElementVNode, toDisplayString, withDirectives, vShow, createCommentVNode, withModifiers } from "vue";
|
|
26
26
|
import { c as createComponent } from "./component.js";
|
|
27
27
|
import { u as useExpose } from "./index2.js";
|
|
28
|
+
import Taro, { eventCenter, getCurrentInstance } from "@tarojs/taro";
|
|
28
29
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
29
30
|
const { componentName, create } = createComponent("elevator");
|
|
30
31
|
const _sfc_main = create({
|
|
@@ -47,7 +48,7 @@ const _sfc_main = create({
|
|
|
47
48
|
emits: ["click-item", "click-index"],
|
|
48
49
|
setup(props, context) {
|
|
49
50
|
const spaceHeight = 23;
|
|
50
|
-
const listview = ref(
|
|
51
|
+
const listview = ref();
|
|
51
52
|
const state = reactive({
|
|
52
53
|
anchorIndex: 0,
|
|
53
54
|
listHeight: [],
|
|
@@ -58,6 +59,9 @@ const _sfc_main = create({
|
|
|
58
59
|
},
|
|
59
60
|
scrollStart: false,
|
|
60
61
|
currentIndex: 0,
|
|
62
|
+
query: Taro.createSelectorQuery(),
|
|
63
|
+
scrollTop: 0,
|
|
64
|
+
storageListHeight: [],
|
|
61
65
|
currentData: {}
|
|
62
66
|
});
|
|
63
67
|
const classes = computed(() => {
|
|
@@ -77,9 +81,11 @@ const _sfc_main = create({
|
|
|
77
81
|
y2: 0
|
|
78
82
|
};
|
|
79
83
|
};
|
|
80
|
-
const getData = (el
|
|
81
|
-
|
|
82
|
-
|
|
84
|
+
const getData = (el) => {
|
|
85
|
+
if (!el.dataset.index) {
|
|
86
|
+
return "0";
|
|
87
|
+
}
|
|
88
|
+
return el.dataset.index;
|
|
83
89
|
};
|
|
84
90
|
const setListGroup = (el) => {
|
|
85
91
|
nextTick(() => {
|
|
@@ -91,34 +97,38 @@ const _sfc_main = create({
|
|
|
91
97
|
const calculateHeight = () => {
|
|
92
98
|
let height = 0;
|
|
93
99
|
state.listHeight.push(height);
|
|
100
|
+
state.storageListHeight.push(height);
|
|
94
101
|
for (let i = 0; i < state.listGroup.length; i++) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
102
|
+
state.query.selectAll(`.elevator__item__${i}`).boundingClientRect();
|
|
103
|
+
state.query.exec((res) => {
|
|
104
|
+
height += res[i][0].height;
|
|
105
|
+
state.listHeight.push(height);
|
|
106
|
+
state.storageListHeight.push(height);
|
|
107
|
+
});
|
|
98
108
|
}
|
|
99
109
|
};
|
|
100
|
-
const scrollTo = (
|
|
101
|
-
if (!
|
|
110
|
+
const scrollTo = (index) => {
|
|
111
|
+
if (!index && index !== 0) {
|
|
102
112
|
return;
|
|
103
113
|
}
|
|
104
114
|
if (!state.listHeight.length) {
|
|
105
|
-
|
|
115
|
+
state.listHeight = state.storageListHeight.slice();
|
|
106
116
|
}
|
|
107
|
-
if (
|
|
108
|
-
|
|
109
|
-
if (
|
|
110
|
-
|
|
111
|
-
state.currentIndex =
|
|
112
|
-
|
|
117
|
+
if (index < 0)
|
|
118
|
+
index = 0;
|
|
119
|
+
if (index > state.listHeight.length - 2)
|
|
120
|
+
index = state.listHeight.length - 2;
|
|
121
|
+
state.currentIndex = index;
|
|
122
|
+
state.scrollTop = state.listHeight[index];
|
|
113
123
|
};
|
|
114
124
|
const touchStart = (e) => {
|
|
115
125
|
state.scrollStart = true;
|
|
116
|
-
let
|
|
126
|
+
let index = getData(e.target);
|
|
117
127
|
let firstTouch = e.touches[0];
|
|
118
128
|
state.touchState.y1 = firstTouch.pageY;
|
|
119
|
-
state.anchorIndex = +
|
|
120
|
-
state.currentIndex = +
|
|
121
|
-
scrollTo(+
|
|
129
|
+
state.anchorIndex = +index;
|
|
130
|
+
state.currentIndex = +index;
|
|
131
|
+
scrollTo(+index);
|
|
122
132
|
};
|
|
123
133
|
const touchMove = (e) => {
|
|
124
134
|
let firstTouch = e.touches[0];
|
|
@@ -137,6 +147,15 @@ const _sfc_main = create({
|
|
|
137
147
|
const handleClickIndex = (key) => {
|
|
138
148
|
context.emit("click-index", key);
|
|
139
149
|
};
|
|
150
|
+
onMounted(() => {
|
|
151
|
+
if (Taro.getEnv() === "WEB") {
|
|
152
|
+
calculateHeight();
|
|
153
|
+
} else {
|
|
154
|
+
eventCenter.once(getCurrentInstance().router.onReady, () => {
|
|
155
|
+
calculateHeight();
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
});
|
|
140
159
|
useExpose({
|
|
141
160
|
scrollTo
|
|
142
161
|
});
|
|
@@ -158,34 +177,40 @@ const _hoisted_2 = ["onClick", "innerHTML"];
|
|
|
158
177
|
const _hoisted_3 = { class: "nut-elevator__bars__inner" };
|
|
159
178
|
const _hoisted_4 = ["data-index", "onClick"];
|
|
160
179
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
180
|
+
const _component_scroll_view = resolveComponent("scroll-view");
|
|
161
181
|
return openBlock(), createElementBlock("view", {
|
|
162
182
|
class: normalizeClass(_ctx.classes)
|
|
163
183
|
}, [
|
|
164
|
-
|
|
165
|
-
class: "nut-elevator__list",
|
|
184
|
+
createVNode(_component_scroll_view, {
|
|
185
|
+
class: "nut-elevator__list scrollview",
|
|
186
|
+
"scroll-top": _ctx.scrollTop,
|
|
187
|
+
"scroll-y": true,
|
|
166
188
|
ref: "listview",
|
|
167
189
|
style: normalizeStyle({ height: isNaN(+_ctx.height) ? _ctx.height : `${_ctx.height}px` })
|
|
168
|
-
},
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
190
|
+
}, {
|
|
191
|
+
default: withCtx(() => [
|
|
192
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.indexList, (item, index) => {
|
|
193
|
+
return openBlock(), createElementBlock("view", {
|
|
194
|
+
class: normalizeClass(["nut-elevator__list__item", `elevator__item__${index}`]),
|
|
195
|
+
key: item[_ctx.acceptKey],
|
|
196
|
+
ref_for: true,
|
|
197
|
+
ref: _ctx.setListGroup
|
|
198
|
+
}, [
|
|
199
|
+
createElementVNode("view", _hoisted_1, toDisplayString(item[_ctx.acceptKey]), 1),
|
|
200
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(item.list, (subitem) => {
|
|
201
|
+
return openBlock(), createElementBlock("view", {
|
|
202
|
+
class: normalizeClass(["nut-elevator__list__item__name", { "nut-elevator__list__item__name--highcolor": _ctx.currentData.id === subitem.id }]),
|
|
203
|
+
key: subitem["id"],
|
|
204
|
+
onClick: ($event) => _ctx.handleClickItem(item[_ctx.acceptKey], subitem),
|
|
205
|
+
innerHTML: subitem.name
|
|
206
|
+
}, null, 10, _hoisted_2);
|
|
207
|
+
}), 128))
|
|
208
|
+
], 2);
|
|
209
|
+
}), 128))
|
|
210
|
+
]),
|
|
211
|
+
_: 1
|
|
212
|
+
}, 8, ["scroll-top", "style"]),
|
|
213
|
+
_ctx.indexList.length > 0 ? withDirectives((openBlock(), createElementBlock("view", {
|
|
189
214
|
key: 0,
|
|
190
215
|
class: "nut-elevator__code--current"
|
|
191
216
|
}, toDisplayString(_ctx.indexList[_ctx.currentIndex][_ctx.acceptKey]), 513)), [
|
|
@@ -198,10 +223,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
198
223
|
onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx.touchEnd && _ctx.touchEnd(...args))
|
|
199
224
|
}, [
|
|
200
225
|
createElementVNode("view", _hoisted_3, [
|
|
201
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.indexList, (item,
|
|
226
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.indexList, (item, index) => {
|
|
202
227
|
return openBlock(), createElementBlock("view", {
|
|
203
228
|
class: "nut-elevator__bars__inner__item",
|
|
204
|
-
"data-index":
|
|
229
|
+
"data-index": index,
|
|
205
230
|
key: item[_ctx.acceptKey],
|
|
206
231
|
onClick: ($event) => _ctx.handleClickIndex(item[_ctx.acceptKey])
|
|
207
232
|
}, toDisplayString(item[_ctx.acceptKey]), 9, _hoisted_4);
|
|
@@ -210,5 +235,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
210
235
|
], 32)
|
|
211
236
|
], 2);
|
|
212
237
|
}
|
|
213
|
-
var
|
|
214
|
-
export {
|
|
238
|
+
var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
239
|
+
export { index_taro as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
3
|
-
* (c)
|
|
2
|
+
* @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
|
|
3
|
+
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { toRefs, computed, openBlock, createElementBlock, createElementVNode, normalizeStyle, renderSlot, Fragment, createCommentVNode, toDisplayString } from "vue";
|
|
@@ -70,5 +70,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
70
70
|
_ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 2 }) : createCommentVNode("", true)
|
|
71
71
|
]);
|
|
72
72
|
}
|
|
73
|
-
var
|
|
74
|
-
export {
|
|
73
|
+
var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
74
|
+
export { index_taro as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
3
|
-
* (c)
|
|
2
|
+
* @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
|
|
3
|
+
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { computed, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createBlock, createCommentVNode, renderSlot, createElementVNode, Fragment, renderList, toDisplayString, createVNode } from "vue";
|
|
@@ -94,11 +94,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
94
94
|
}, null, 8, ["visible"])) : createCommentVNode("", true),
|
|
95
95
|
renderSlot(_ctx.$slots, "list", {}, () => [
|
|
96
96
|
createElementVNode("view", _hoisted_1, [
|
|
97
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.navList, (item,
|
|
97
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.navList, (item, index) => {
|
|
98
98
|
return openBlock(), createElementBlock("view", {
|
|
99
99
|
class: "nut-fixednav__list-item",
|
|
100
100
|
onClick: ($event) => _ctx.selected(item, $event),
|
|
101
|
-
key: item.id ||
|
|
101
|
+
key: item.id || index
|
|
102
102
|
}, [
|
|
103
103
|
createElementVNode("img", {
|
|
104
104
|
src: item.icon
|
|
@@ -123,5 +123,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
123
123
|
])
|
|
124
124
|
], 6);
|
|
125
125
|
}
|
|
126
|
-
var
|
|
127
|
-
export {
|
|
126
|
+
var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
127
|
+
export { index_taro as default };
|