@nutui/nutui 3.1.12-beta.0 → 3.1.12-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nutui.d.ts +4 -1
- package/dist/nutui.es.js +3943 -4130
- package/dist/nutui.umd.js +3947 -4201
- package/dist/packages/_es/ActionSheet.js +13 -12
- package/dist/packages/_es/Address.js +63 -49
- package/dist/packages/_es/Avatar.js +4 -5
- package/dist/packages/_es/BackTop.js +72 -109
- package/dist/packages/_es/Badge.js +4 -5
- package/dist/packages/_es/Barrage.js +63 -57
- package/dist/packages/_es/Button.js +5 -6
- package/dist/packages/_es/Calendar.js +27 -18
- package/dist/packages/_es/Card.js +104 -0
- package/dist/packages/_es/Cell.js +5 -13
- package/dist/packages/_es/CellGroup.js +4 -5
- package/dist/packages/_es/Checkbox.js +3 -3
- package/dist/packages/_es/CheckboxGroup.js +9 -4
- package/dist/packages/_es/CircleProgress.js +142 -46
- package/dist/packages/_es/Col.js +4 -5
- package/dist/packages/_es/Collapse.js +35 -10
- package/dist/packages/_es/CollapseItem.js +80 -35
- package/dist/packages/_es/CountDown.js +7 -5
- package/dist/packages/_es/CountUp.js +34 -31
- package/dist/packages/_es/DatePicker.js +451 -219
- package/dist/packages/_es/Dialog.js +24 -89
- package/dist/packages/_es/Divider.js +5 -6
- package/dist/packages/_es/Drag.js +76 -50
- package/dist/packages/_es/Elevator.js +81 -52
- package/dist/packages/_es/FixedNav.js +8 -9
- package/dist/packages/_es/Form.js +137 -0
- package/dist/packages/_es/FormItem.js +109 -0
- package/dist/packages/_es/Icon.js +6 -40
- package/dist/packages/_es/ImagePreview.js +23 -21
- package/dist/packages/_es/InfiniteLoading.js +95 -109
- package/dist/packages/_es/Input.js +22 -21
- package/dist/packages/_es/InputNumber.js +24 -18
- package/dist/packages/_es/Layout.js +2 -2
- package/dist/packages/_es/Menu.js +16 -14
- package/dist/packages/_es/MenuItem.js +9 -11
- package/dist/packages/_es/Navbar.js +7 -7
- package/dist/packages/_es/NoticeBar.js +39 -26
- package/dist/packages/_es/Notify.js +30 -166
- package/dist/packages/_es/NumberKeyboard.js +10 -6
- package/dist/packages/_es/OverLay.js +22 -29
- package/dist/packages/_es/Pagination.js +8 -9
- package/dist/packages/_es/Picker.js +61 -447
- package/dist/packages/_es/Popover.js +146 -25
- package/dist/packages/_es/Popup.js +17 -77
- package/dist/packages/_es/Price.js +18 -7
- package/dist/packages/_es/Progress.js +23 -12
- package/dist/packages/_es/Radio.js +3 -3
- package/dist/packages/_es/RadioGroup.js +2 -2
- package/dist/packages/_es/Range.js +37 -30
- package/dist/packages/_es/Rate.js +16 -20
- package/dist/packages/_es/Row.js +4 -5
- package/dist/packages/_es/SearchBar.js +7 -5
- package/dist/packages/_es/ShortPassword.js +89 -59
- package/dist/packages/_es/Signature.js +70 -71
- package/dist/packages/_es/Sku.js +54 -79
- package/dist/packages/_es/Step.js +10 -8
- package/dist/packages/_es/Steps.js +2 -2
- package/dist/packages/_es/Swipe.js +42 -27
- package/dist/packages/_es/Swiper.js +17 -418
- package/dist/packages/_es/SwiperItem.js +14 -39
- package/dist/packages/_es/Switch.js +4 -5
- package/dist/packages/_es/TabPane.js +4 -5
- package/dist/packages/_es/Tabbar.js +4 -5
- package/dist/packages/_es/TabbarItem.js +8 -9
- package/dist/packages/_es/Tabs.js +22 -16
- package/dist/packages/_es/Tag.js +5 -6
- package/dist/packages/_es/TextArea.js +16 -12
- package/dist/packages/_es/TimeDetail.js +7 -5
- package/dist/packages/_es/TimePannel.js +7 -5
- package/dist/packages/_es/TimeSelect.js +12 -7
- package/dist/packages/_es/Toast.js +41 -163
- package/dist/packages/_es/Uploader.js +109 -149
- package/dist/packages/_es/commonProps.js +30 -0
- package/dist/packages/_es/component.js +1 -1
- package/dist/packages/_es/index.js +1 -1
- package/dist/packages/_es/index.taro.vue_vue&type=script&lang.js +44 -0
- package/dist/packages/_es/index2.js +40 -27
- package/dist/packages/_es/index3.js +413 -7
- package/dist/packages/_es/pxCheck.js +1 -1
- package/dist/packages/_es/raf.js +1 -1
- package/dist/packages/_es/use-lock-scroll.js +23 -0
- package/dist/packages/_es/util.js +47 -0
- package/dist/packages/button/index.scss +6 -0
- package/dist/packages/card/index.scss +97 -0
- package/dist/packages/checkbox/index.scss +1 -1
- package/dist/packages/form/index.scss +2 -0
- package/dist/packages/formitem/index.scss +60 -0
- package/dist/packages/numberkeyboard/index.scss +1 -1
- package/dist/packages/switch/index.scss +1 -1
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -2
- package/dist/styles/themes/default.scss +35 -32
- package/dist/styles/variables.scss +11 -1
- package/package.json +2 -2
- package/dist/packages/_es/Video.js +0 -405
- package/dist/packages/_es/plugin-vue_export-helper.js +0 -13
|
@@ -17,29 +17,28 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
return value;
|
|
20
|
+
var __require = typeof require !== "undefined" ? require : (x) => {
|
|
21
|
+
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
23
22
|
};
|
|
24
23
|
/*!
|
|
25
|
-
* @nutui/nutui v3.1.
|
|
24
|
+
* @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
|
|
26
25
|
* (c) 2021 @jdf2e.
|
|
27
26
|
* Released under the MIT License.
|
|
28
27
|
*/
|
|
29
|
-
import { ref, onMounted, watch, computed, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, normalizeClass, createElementBlock, renderSlot, Fragment, createTextVNode, toDisplayString, createCommentVNode, normalizeStyle
|
|
28
|
+
import { ref, onMounted, watch, computed, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, normalizeClass, createElementBlock, renderSlot, Fragment, createTextVNode, toDisplayString, createCommentVNode, normalizeStyle } from "vue";
|
|
30
29
|
import { c as createComponent } from "./component.js";
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
30
|
+
import _sfc_main$1, { popupProps } from "./Popup.js";
|
|
31
|
+
import _sfc_main$2 from "./Button.js";
|
|
32
|
+
import "./use-lock-scroll.js";
|
|
34
33
|
import "./OverLay.js";
|
|
35
|
-
import "./
|
|
34
|
+
import "./index.taro.vue_vue&type=script&lang.js";
|
|
36
35
|
import "./pxCheck.js";
|
|
37
36
|
const { componentName, create } = createComponent("dialog");
|
|
38
|
-
|
|
37
|
+
var _sfc_main = create({
|
|
39
38
|
inheritAttrs: false,
|
|
40
39
|
components: {
|
|
41
|
-
[
|
|
42
|
-
[
|
|
40
|
+
[_sfc_main$1.name]: _sfc_main$1,
|
|
41
|
+
[_sfc_main$2.name]: _sfc_main$2
|
|
43
42
|
},
|
|
44
43
|
props: __spreadProps(__spreadValues({}, popupProps), {
|
|
45
44
|
closeOnClickOverlay: {
|
|
@@ -107,7 +106,16 @@ const _sfc_main = create({
|
|
|
107
106
|
default: false
|
|
108
107
|
}
|
|
109
108
|
}),
|
|
110
|
-
emits: [
|
|
109
|
+
emits: [
|
|
110
|
+
"update",
|
|
111
|
+
"update:visible",
|
|
112
|
+
"ok",
|
|
113
|
+
"cancel",
|
|
114
|
+
"open",
|
|
115
|
+
"opened",
|
|
116
|
+
"close",
|
|
117
|
+
"closed"
|
|
118
|
+
],
|
|
111
119
|
setup(props, { emit }) {
|
|
112
120
|
const showPopup = ref(props.visible);
|
|
113
121
|
onMounted(() => {
|
|
@@ -140,8 +148,8 @@ const _sfc_main = create({
|
|
|
140
148
|
}
|
|
141
149
|
};
|
|
142
150
|
const onOk = () => {
|
|
143
|
-
emit("ok");
|
|
144
151
|
closed();
|
|
152
|
+
emit("ok");
|
|
145
153
|
};
|
|
146
154
|
return {
|
|
147
155
|
closed,
|
|
@@ -227,78 +235,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
227
235
|
_: 3
|
|
228
236
|
}, 8, ["teleport", "visible", "close-on-click-overlay", "lock-scroll", "onClickOverlay", "onClickCloseIcon"]);
|
|
229
237
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
constructor() {
|
|
233
|
-
__publicField(this, "title", "");
|
|
234
|
-
__publicField(this, "content", "");
|
|
235
|
-
__publicField(this, "cancelText", "\u53D6\u6D88");
|
|
236
|
-
__publicField(this, "okText", "\u786E\u5B9A");
|
|
237
|
-
__publicField(this, "textAlign", "center");
|
|
238
|
-
__publicField(this, "teleport", "body");
|
|
239
|
-
__publicField(this, "onUpdate", (value) => {
|
|
240
|
-
});
|
|
241
|
-
__publicField(this, "onOk", () => {
|
|
242
|
-
});
|
|
243
|
-
__publicField(this, "onCancel", () => {
|
|
244
|
-
});
|
|
245
|
-
__publicField(this, "onClose", () => {
|
|
246
|
-
});
|
|
247
|
-
__publicField(this, "onClosed", () => {
|
|
248
|
-
});
|
|
249
|
-
__publicField(this, "visible", true);
|
|
250
|
-
__publicField(this, "noFooter", false);
|
|
251
|
-
__publicField(this, "noOkBtn", false);
|
|
252
|
-
__publicField(this, "noCancelBtn", false);
|
|
253
|
-
__publicField(this, "okBtnDisabled", false);
|
|
254
|
-
__publicField(this, "closeOnPopstate", false);
|
|
255
|
-
__publicField(this, "lockScroll", false);
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
class DialogFunction {
|
|
259
|
-
constructor(_options) {
|
|
260
|
-
__publicField(this, "options", new DialogOptions());
|
|
261
|
-
__publicField(this, "close", () => {
|
|
262
|
-
});
|
|
263
|
-
__publicField(this, "setDefaultOptions", (options) => {
|
|
264
|
-
});
|
|
265
|
-
__publicField(this, "resetDefaultOptions", () => {
|
|
266
|
-
});
|
|
267
|
-
let options = Object.assign(this.options, _options);
|
|
268
|
-
let elWarp = document.body;
|
|
269
|
-
let teleport = options.teleport;
|
|
270
|
-
if (teleport != "body") {
|
|
271
|
-
if (typeof teleport == "string") {
|
|
272
|
-
elWarp = document.querySelector(teleport);
|
|
273
|
-
} else {
|
|
274
|
-
elWarp = options.teleport;
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
const root = document.createElement("view");
|
|
278
|
-
root.id = "dialog-" + new Date().getTime();
|
|
279
|
-
const Wrapper = {
|
|
280
|
-
setup() {
|
|
281
|
-
options.onUpdate = (val) => {
|
|
282
|
-
if (val == false) {
|
|
283
|
-
elWarp.removeChild(root);
|
|
284
|
-
}
|
|
285
|
-
};
|
|
286
|
-
options.teleport = `#${root.id}`;
|
|
287
|
-
return () => {
|
|
288
|
-
return h(Dialog, options);
|
|
289
|
-
};
|
|
290
|
-
}
|
|
291
|
-
};
|
|
292
|
-
const instance = createVNode(Wrapper);
|
|
293
|
-
elWarp.appendChild(root);
|
|
294
|
-
render(instance, root);
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
const _Dialog = function(options) {
|
|
298
|
-
return new DialogFunction(options);
|
|
299
|
-
};
|
|
300
|
-
_Dialog.install = (app) => {
|
|
301
|
-
app.use(Dialog);
|
|
302
|
-
app.config.globalProperties.$dialog = _Dialog;
|
|
303
|
-
};
|
|
304
|
-
export { Dialog, DialogOptions, _Dialog as default };
|
|
238
|
+
_sfc_main.render = _sfc_render;
|
|
239
|
+
export { _sfc_main as default };
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { computed, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
|
-
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
8
|
const { componentName, create } = createComponent("divider");
|
|
10
|
-
|
|
9
|
+
var _sfc_main = create({
|
|
11
10
|
props: {
|
|
12
11
|
contentPosition: {
|
|
13
12
|
type: String,
|
|
@@ -39,11 +38,11 @@ const _sfc_main = create({
|
|
|
39
38
|
}
|
|
40
39
|
});
|
|
41
40
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
42
|
-
return openBlock(), createElementBlock("
|
|
41
|
+
return openBlock(), createElementBlock("view", {
|
|
43
42
|
class: normalizeClass(_ctx.classes)
|
|
44
43
|
}, [
|
|
45
44
|
renderSlot(_ctx.$slots, "default")
|
|
46
45
|
], 2);
|
|
47
46
|
}
|
|
48
|
-
|
|
49
|
-
export {
|
|
47
|
+
_sfc_main.render = _sfc_render;
|
|
48
|
+
export { _sfc_main as default };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { 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
8
|
import { r as requestAniFrame } from "./raf.js";
|
|
9
|
-
import {
|
|
9
|
+
import Taro, { eventCenter, getCurrentInstance } from "@tarojs/taro";
|
|
10
10
|
const { componentName, create } = createComponent("drag");
|
|
11
|
-
|
|
11
|
+
var _sfc_main = create({
|
|
12
12
|
props: {
|
|
13
13
|
attract: {
|
|
14
14
|
type: Boolean,
|
|
@@ -40,10 +40,13 @@ const _sfc_main = create({
|
|
|
40
40
|
screenHeight: 0,
|
|
41
41
|
startTop: 0,
|
|
42
42
|
startLeft: 0,
|
|
43
|
+
initTop: 0,
|
|
43
44
|
nx: 0,
|
|
44
45
|
ny: 0,
|
|
45
46
|
xPum: 0,
|
|
46
47
|
yPum: 0,
|
|
48
|
+
top: 0,
|
|
49
|
+
left: 0,
|
|
47
50
|
position: { x: 0, y: 0 },
|
|
48
51
|
boundary: {
|
|
49
52
|
top: 0,
|
|
@@ -53,54 +56,58 @@ const _sfc_main = create({
|
|
|
53
56
|
}
|
|
54
57
|
});
|
|
55
58
|
const classes = computed(() => {
|
|
56
|
-
const prefixCls =
|
|
59
|
+
const prefixCls = "nut-taro-drag";
|
|
57
60
|
return {
|
|
58
61
|
[prefixCls]: true
|
|
59
62
|
};
|
|
60
63
|
});
|
|
64
|
+
const domElem = Taro.getSystemInfoSync();
|
|
61
65
|
function getInfo() {
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
const query = Taro.createSelectorQuery();
|
|
67
|
+
query.select(".myDrag").boundingClientRect((rec) => {
|
|
68
|
+
state.elWidth = rec.width;
|
|
69
|
+
state.elHeight = rec.height;
|
|
70
|
+
state.initTop = rec.top;
|
|
71
|
+
}).exec();
|
|
72
|
+
console.log(domElem.windowWidth);
|
|
73
|
+
state.screenWidth = domElem.screenWidth;
|
|
74
|
+
state.screenHeight = domElem.screenHeight;
|
|
67
75
|
}
|
|
68
|
-
function goLeft(
|
|
76
|
+
function goLeft() {
|
|
69
77
|
if (state.boundary.left) {
|
|
70
|
-
if (+
|
|
71
|
-
|
|
78
|
+
if (+state.left.split("px")[0] > state.boundary.left) {
|
|
79
|
+
state.left = +state.left.split("px")[0] - 10 + "px";
|
|
72
80
|
requestAniFrame(() => {
|
|
73
|
-
goLeft(
|
|
81
|
+
goLeft();
|
|
74
82
|
});
|
|
75
83
|
} else {
|
|
76
|
-
|
|
84
|
+
state.left = `${state.boundary.left}px`;
|
|
77
85
|
}
|
|
78
86
|
} else {
|
|
79
|
-
if (+
|
|
80
|
-
|
|
87
|
+
if (+state.left.split("px")[0] > 10) {
|
|
88
|
+
state.left = +state.left.split("px")[0] - 10 + "px";
|
|
81
89
|
requestAniFrame(() => {
|
|
82
|
-
goLeft(
|
|
90
|
+
goLeft();
|
|
83
91
|
});
|
|
84
92
|
} else {
|
|
85
|
-
|
|
93
|
+
state.left = "0px";
|
|
86
94
|
}
|
|
87
95
|
}
|
|
88
96
|
}
|
|
89
|
-
function goRight(
|
|
90
|
-
if (rightLocation - parseInt(
|
|
91
|
-
|
|
97
|
+
function goRight(rightLocation) {
|
|
98
|
+
if (rightLocation - parseInt(state.left.split("px")[0]) > 10) {
|
|
99
|
+
state.left = parseInt(state.left.split("px")[0]) + 10 + "px";
|
|
92
100
|
requestAniFrame(() => {
|
|
93
|
-
goRight(
|
|
101
|
+
goRight(rightLocation);
|
|
94
102
|
});
|
|
95
103
|
} else {
|
|
96
|
-
|
|
104
|
+
state.left = rightLocation + "px";
|
|
97
105
|
}
|
|
98
106
|
}
|
|
99
107
|
function touchMove(e) {
|
|
100
108
|
e.preventDefault();
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
const touch = e.targetTouches[0];
|
|
109
|
+
if (e.touches.length === 1) {
|
|
110
|
+
const touch = e.touches[0];
|
|
104
111
|
state.nx = touch.clientX - state.position.x;
|
|
105
112
|
state.ny = touch.clientY - state.position.y;
|
|
106
113
|
state.xPum = state.startLeft + state.nx;
|
|
@@ -117,15 +124,14 @@ const _sfc_main = create({
|
|
|
117
124
|
state.yPum = state.screenHeight - state.elHeight - state.boundary.bottom;
|
|
118
125
|
}
|
|
119
126
|
if (props.direction != "y") {
|
|
120
|
-
|
|
127
|
+
state.left = state.xPum;
|
|
121
128
|
}
|
|
122
129
|
if (props.direction != "x") {
|
|
123
|
-
|
|
130
|
+
state.top = state.yPum;
|
|
124
131
|
}
|
|
125
132
|
}
|
|
126
133
|
}
|
|
127
134
|
function touchEnd(e) {
|
|
128
|
-
const target = e.currentTarget;
|
|
129
135
|
const touch = e.changedTouches[0];
|
|
130
136
|
let currX = touch.clientX;
|
|
131
137
|
const rightLocation = state.screenWidth - state.elWidth - state.boundary.right;
|
|
@@ -139,33 +145,47 @@ const _sfc_main = create({
|
|
|
139
145
|
if (props.direction != "y" && props.attract) {
|
|
140
146
|
if (currX < state.screenWidth / 2) {
|
|
141
147
|
requestAniFrame(() => {
|
|
142
|
-
goLeft(
|
|
148
|
+
goLeft();
|
|
143
149
|
});
|
|
144
150
|
} else {
|
|
145
151
|
requestAniFrame(() => {
|
|
146
|
-
goRight(
|
|
152
|
+
goRight(rightLocation);
|
|
147
153
|
});
|
|
148
154
|
}
|
|
149
155
|
}
|
|
150
|
-
if (props.direction
|
|
151
|
-
|
|
156
|
+
if (props.direction !== "x") {
|
|
157
|
+
state.top = state.yPum;
|
|
152
158
|
}
|
|
153
159
|
}
|
|
154
160
|
function touchStart(e) {
|
|
155
|
-
|
|
161
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
162
|
+
const query = Taro.createSelectorQuery();
|
|
163
|
+
let id = (_a = e == null ? void 0 : e.mpEvent) == null ? void 0 : _a.currentTarget.id;
|
|
164
|
+
let offsetTop = (_b = e == null ? void 0 : e.currentTarget) == null ? void 0 : _b.offsetTop;
|
|
165
|
+
let offsetLeft = (_c = e == null ? void 0 : e.currentTarget) == null ? void 0 : _c.offsetLeft;
|
|
156
166
|
const touches = e.touches[0];
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
-
|
|
167
|
+
const mobileTop = (_f = (_e = (_d = e.touches[0]) == null ? void 0 : _d.target) == null ? void 0 : _e.parentNode) == null ? void 0 : _f.style.top;
|
|
168
|
+
const mobileLeft = (_i = (_h = (_g = e.touches[0]) == null ? void 0 : _g.target) == null ? void 0 : _h.parentNode) == null ? void 0 : _i.style.left;
|
|
169
|
+
query.selectAll(".myDrag").boundingClientRect((rec) => {
|
|
170
|
+
rec.forEach((element) => {
|
|
171
|
+
if (id && id == element.id) {
|
|
172
|
+
state.startTop = element.top - offsetTop;
|
|
173
|
+
state.startLeft = element.left - offsetLeft;
|
|
174
|
+
} else if (mobileTop) {
|
|
175
|
+
state.startTop = Number(mobileTop.slice(0, -2));
|
|
176
|
+
state.startLeft = Number(mobileLeft.slice(0, -2));
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
}).exec();
|
|
160
180
|
state.position.x = touches.clientX;
|
|
161
181
|
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
182
|
}
|
|
167
183
|
onMounted(() => {
|
|
168
|
-
|
|
184
|
+
setTimeout(() => {
|
|
185
|
+
getInfo();
|
|
186
|
+
}, 200);
|
|
187
|
+
eventCenter.once(getCurrentInstance().router.onReady, () => {
|
|
188
|
+
});
|
|
169
189
|
state.boundary = props.boundary;
|
|
170
190
|
});
|
|
171
191
|
onActivated(() => {
|
|
@@ -184,20 +204,26 @@ const _sfc_main = create({
|
|
|
184
204
|
myDrag,
|
|
185
205
|
touchStart,
|
|
186
206
|
touchMove,
|
|
187
|
-
touchEnd
|
|
207
|
+
touchEnd,
|
|
208
|
+
state
|
|
188
209
|
};
|
|
189
210
|
}
|
|
190
211
|
});
|
|
191
212
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
192
213
|
return openBlock(), createElementBlock("view", {
|
|
193
|
-
class: normalizeClass(_ctx.classes),
|
|
214
|
+
class: normalizeClass([_ctx.classes, "myDrag"]),
|
|
194
215
|
ref: "myDrag",
|
|
195
216
|
onTouchstart: _cache[0] || (_cache[0] = ($event) => _ctx.touchStart($event)),
|
|
196
|
-
onTouchmove: _cache[1] || (_cache[1] = ($event) => _ctx.touchMove($event)),
|
|
197
|
-
|
|
217
|
+
onTouchmove: _cache[1] || (_cache[1] = withModifiers(($event) => _ctx.touchMove($event), ["prevent"])),
|
|
218
|
+
catchtouchmove: "true",
|
|
219
|
+
style: normalizeStyle({
|
|
220
|
+
transform: ` translate(${_ctx.state.left + "px"}, ${_ctx.state.top + "px"})`,
|
|
221
|
+
top: _ctx.state.top + "px",
|
|
222
|
+
left: _ctx.state.left + "px"
|
|
223
|
+
})
|
|
198
224
|
}, [
|
|
199
225
|
renderSlot(_ctx.$slots, "default")
|
|
200
|
-
],
|
|
226
|
+
], 38);
|
|
201
227
|
}
|
|
202
|
-
|
|
203
|
-
export {
|
|
228
|
+
_sfc_main.render = _sfc_render;
|
|
229
|
+
export { _sfc_main as default };
|
|
@@ -17,16 +17,19 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __require = typeof require !== "undefined" ? require : (x) => {
|
|
21
|
+
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
22
|
+
};
|
|
20
23
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.
|
|
24
|
+
* @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
|
|
22
25
|
* (c) 2021 @jdf2e.
|
|
23
26
|
* Released under the MIT License.
|
|
24
27
|
*/
|
|
25
|
-
import { ref, reactive, computed, toRefs, nextTick, openBlock, createElementBlock, normalizeClass,
|
|
28
|
+
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
29
|
import { c as createComponent } from "./component.js";
|
|
27
|
-
import {
|
|
30
|
+
import Taro, { eventCenter, getCurrentInstance } from "@tarojs/taro";
|
|
28
31
|
const { componentName, create } = createComponent("elevator");
|
|
29
|
-
|
|
32
|
+
var _sfc_main = create({
|
|
30
33
|
props: {
|
|
31
34
|
height: {
|
|
32
35
|
type: [Number, String],
|
|
@@ -46,7 +49,7 @@ const _sfc_main = create({
|
|
|
46
49
|
emits: ["click-item", "click-index"],
|
|
47
50
|
setup(props, context) {
|
|
48
51
|
const spaceHeight = 23;
|
|
49
|
-
const listview = ref(
|
|
52
|
+
const listview = ref();
|
|
50
53
|
const state = reactive({
|
|
51
54
|
anchorIndex: 0,
|
|
52
55
|
listHeight: [],
|
|
@@ -56,7 +59,10 @@ const _sfc_main = create({
|
|
|
56
59
|
y2: 0
|
|
57
60
|
},
|
|
58
61
|
scrollStart: false,
|
|
59
|
-
currentIndex: 0
|
|
62
|
+
currentIndex: 0,
|
|
63
|
+
query: Taro.createSelectorQuery(),
|
|
64
|
+
scrollTop: 0,
|
|
65
|
+
storageListHeight: []
|
|
60
66
|
});
|
|
61
67
|
const classes = computed(() => {
|
|
62
68
|
const prefixCls = componentName;
|
|
@@ -75,9 +81,11 @@ const _sfc_main = create({
|
|
|
75
81
|
y2: 0
|
|
76
82
|
};
|
|
77
83
|
};
|
|
78
|
-
const getData = (el
|
|
79
|
-
|
|
80
|
-
|
|
84
|
+
const getData = (el) => {
|
|
85
|
+
if (!el.dataset.index) {
|
|
86
|
+
return "0";
|
|
87
|
+
}
|
|
88
|
+
return el.dataset.index;
|
|
81
89
|
};
|
|
82
90
|
const setListGroup = (el) => {
|
|
83
91
|
nextTick(() => {
|
|
@@ -89,35 +97,38 @@ const _sfc_main = create({
|
|
|
89
97
|
const calculateHeight = () => {
|
|
90
98
|
let height = 0;
|
|
91
99
|
state.listHeight.push(height);
|
|
100
|
+
state.storageListHeight.push(height);
|
|
92
101
|
for (let i = 0; i < state.listGroup.length; i++) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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
|
+
});
|
|
96
108
|
}
|
|
97
109
|
};
|
|
98
|
-
const scrollTo = (
|
|
99
|
-
if (!
|
|
110
|
+
const scrollTo = (index) => {
|
|
111
|
+
if (!index && index !== 0) {
|
|
100
112
|
return;
|
|
101
113
|
}
|
|
102
114
|
if (!state.listHeight.length) {
|
|
103
|
-
|
|
115
|
+
state.listHeight = state.storageListHeight.slice();
|
|
104
116
|
}
|
|
105
|
-
if (
|
|
106
|
-
|
|
107
|
-
if (
|
|
108
|
-
|
|
109
|
-
state.currentIndex =
|
|
110
|
-
|
|
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];
|
|
111
123
|
};
|
|
112
124
|
const touchStart = (e) => {
|
|
113
125
|
state.scrollStart = true;
|
|
114
|
-
let
|
|
126
|
+
let index = getData(e.target);
|
|
115
127
|
let firstTouch = e.touches[0];
|
|
116
128
|
state.touchState.y1 = firstTouch.pageY;
|
|
117
|
-
state.anchorIndex = +
|
|
118
|
-
state.currentIndex = +
|
|
119
|
-
|
|
120
|
-
scrollTo(+index2);
|
|
129
|
+
state.anchorIndex = +index;
|
|
130
|
+
state.currentIndex = +index;
|
|
131
|
+
scrollTo(+index);
|
|
121
132
|
};
|
|
122
133
|
const touchMove = (e) => {
|
|
123
134
|
let firstTouch = e.touches[0];
|
|
@@ -135,6 +146,18 @@ const _sfc_main = create({
|
|
|
135
146
|
const handleClickIndex = (key) => {
|
|
136
147
|
context.emit("click-index", key);
|
|
137
148
|
};
|
|
149
|
+
onMounted(() => {
|
|
150
|
+
Taro.nextTick(() => {
|
|
151
|
+
calculateHeight();
|
|
152
|
+
});
|
|
153
|
+
if (Taro.getEnv() === "WEB") {
|
|
154
|
+
calculateHeight();
|
|
155
|
+
} else {
|
|
156
|
+
eventCenter.once(getCurrentInstance().router.onReady, () => {
|
|
157
|
+
calculateHeight();
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
});
|
|
138
161
|
return __spreadProps(__spreadValues({
|
|
139
162
|
classes
|
|
140
163
|
}, toRefs(state)), {
|
|
@@ -153,33 +176,39 @@ const _hoisted_2 = ["onClick", "innerHTML"];
|
|
|
153
176
|
const _hoisted_3 = { class: "nut-elevator__bars__inner" };
|
|
154
177
|
const _hoisted_4 = ["data-index", "onClick"];
|
|
155
178
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
179
|
+
const _component_scroll_view = resolveComponent("scroll-view");
|
|
156
180
|
return openBlock(), createElementBlock("view", {
|
|
157
181
|
class: normalizeClass(_ctx.classes)
|
|
158
182
|
}, [
|
|
159
|
-
|
|
160
|
-
class: "nut-elevator__list",
|
|
183
|
+
createVNode(_component_scroll_view, {
|
|
184
|
+
class: "nut-elevator__list scrollview",
|
|
185
|
+
"scroll-top": _ctx.scrollTop,
|
|
186
|
+
"scroll-y": true,
|
|
161
187
|
ref: "listview",
|
|
162
188
|
style: normalizeStyle({ height: isNaN(+_ctx.height) ? _ctx.height : `${_ctx.height}px` })
|
|
163
|
-
},
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
189
|
+
}, {
|
|
190
|
+
default: withCtx(() => [
|
|
191
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.indexList, (item, index) => {
|
|
192
|
+
return openBlock(), createElementBlock("view", {
|
|
193
|
+
class: normalizeClass(["nut-elevator__list__item", `elevator__item__${index}`]),
|
|
194
|
+
key: item[_ctx.acceptKey],
|
|
195
|
+
ref: _ctx.setListGroup
|
|
196
|
+
}, [
|
|
197
|
+
createElementVNode("view", _hoisted_1, toDisplayString(item[_ctx.acceptKey]), 1),
|
|
198
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(item.list, (subitem) => {
|
|
199
|
+
return openBlock(), createElementBlock("view", {
|
|
200
|
+
class: "nut-elevator__list__item__name",
|
|
201
|
+
key: subitem["id"],
|
|
202
|
+
onClick: ($event) => _ctx.handleClickItem(item[_ctx.acceptKey], subitem),
|
|
203
|
+
innerHTML: subitem.name
|
|
204
|
+
}, null, 8, _hoisted_2);
|
|
205
|
+
}), 128))
|
|
206
|
+
], 2);
|
|
207
|
+
}), 128))
|
|
208
|
+
]),
|
|
209
|
+
_: 1
|
|
210
|
+
}, 8, ["scroll-top", "style"]),
|
|
211
|
+
_ctx.indexList.length > 0 ? withDirectives((openBlock(), createElementBlock("view", {
|
|
183
212
|
key: 0,
|
|
184
213
|
class: "nut-elevator__code--current"
|
|
185
214
|
}, toDisplayString(_ctx.indexList[_ctx.currentIndex][_ctx.acceptKey]), 513)), [
|
|
@@ -192,10 +221,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
192
221
|
onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx.touchEnd && _ctx.touchEnd(...args))
|
|
193
222
|
}, [
|
|
194
223
|
createElementVNode("view", _hoisted_3, [
|
|
195
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.indexList, (item,
|
|
224
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.indexList, (item, index) => {
|
|
196
225
|
return openBlock(), createElementBlock("view", {
|
|
197
226
|
class: "nut-elevator__bars__inner__item",
|
|
198
|
-
"data-index":
|
|
227
|
+
"data-index": index,
|
|
199
228
|
key: item[_ctx.acceptKey],
|
|
200
229
|
onClick: ($event) => _ctx.handleClickIndex(item[_ctx.acceptKey])
|
|
201
230
|
}, toDisplayString(item[_ctx.acceptKey]), 9, _hoisted_4);
|
|
@@ -204,5 +233,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
204
233
|
], 32)
|
|
205
234
|
], 2);
|
|
206
235
|
}
|
|
207
|
-
|
|
208
|
-
export {
|
|
236
|
+
_sfc_main.render = _sfc_render;
|
|
237
|
+
export { _sfc_main as default };
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { computed, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createBlock, createCommentVNode, renderSlot, createElementVNode, Fragment, renderList, toDisplayString, createVNode } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
|
-
import
|
|
9
|
-
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
8
|
+
import _sfc_main$1 from "./OverLay.js";
|
|
10
9
|
const { componentName, create } = createComponent("fixednav");
|
|
11
|
-
|
|
10
|
+
var _sfc_main = create({
|
|
12
11
|
components: {
|
|
13
|
-
[
|
|
12
|
+
[_sfc_main$1.name]: _sfc_main$1
|
|
14
13
|
},
|
|
15
14
|
props: {
|
|
16
15
|
visible: {
|
|
@@ -94,11 +93,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
94
93
|
}, null, 8, ["visible"])) : createCommentVNode("", true),
|
|
95
94
|
renderSlot(_ctx.$slots, "list", {}, () => [
|
|
96
95
|
createElementVNode("view", _hoisted_1, [
|
|
97
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.navList, (item,
|
|
96
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.navList, (item, index) => {
|
|
98
97
|
return openBlock(), createElementBlock("view", {
|
|
99
98
|
class: "nut-fixednav__list-item",
|
|
100
99
|
onClick: ($event) => _ctx.selected(item, $event),
|
|
101
|
-
key: item.id ||
|
|
100
|
+
key: item.id || index
|
|
102
101
|
}, [
|
|
103
102
|
createElementVNode("img", {
|
|
104
103
|
src: item.icon
|
|
@@ -123,5 +122,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
123
122
|
])
|
|
124
123
|
], 6);
|
|
125
124
|
}
|
|
126
|
-
|
|
127
|
-
export {
|
|
125
|
+
_sfc_main.render = _sfc_render;
|
|
126
|
+
export { _sfc_main as default };
|