@nutui/nutui 3.1.19-beta.1 → 3.1.19-beta.2
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/README.md +9 -8
- package/dist/nutui.es.js +2875 -3576
- package/dist/nutui.umd.js +2965 -3579
- package/dist/packages/_es/ActionSheet.js +18 -12
- package/dist/packages/_es/Address.js +69 -78
- 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 +110 -68
- package/dist/packages/_es/Badge.js +3 -3
- package/dist/packages/_es/Barrage.js +55 -62
- package/dist/packages/_es/Button.js +2 -2
- package/dist/packages/_es/Calendar.js +27 -32
- package/dist/packages/_es/CalendarItem.js +3 -3
- package/dist/packages/_es/Card.js +5 -6
- package/dist/packages/_es/Cascader.js +7 -7
- package/dist/packages/_es/Cell.js +11 -4
- package/dist/packages/_es/CellGroup.js +1 -1
- package/dist/packages/_es/Checkbox.js +13 -3
- package/dist/packages/_es/CheckboxGroup.js +2 -2
- package/dist/packages/_es/CircleProgress.js +40 -149
- package/dist/packages/_es/Col.js +1 -1
- package/dist/packages/_es/Collapse.js +8 -34
- package/dist/packages/_es/CollapseItem.js +59 -90
- package/dist/packages/_es/CountDown.js +5 -5
- package/dist/packages/_es/CountUp.js +51 -43
- package/dist/packages/_es/DatePicker.js +20 -21
- package/dist/packages/_es/Dialog.js +91 -12
- package/dist/packages/_es/Divider.js +4 -4
- package/dist/packages/_es/Drag.js +54 -92
- package/dist/packages/_es/Elevator.js +50 -75
- package/dist/packages/_es/Empty.js +3 -3
- package/dist/packages/_es/FixedNav.js +10 -11
- package/dist/packages/_es/Form.js +5 -9
- package/dist/packages/_es/FormItem.js +1 -1
- package/dist/packages/_es/Grid.js +1 -1
- package/dist/packages/_es/GridItem.js +26 -8
- package/dist/packages/_es/Icon.js +1 -1
- package/dist/packages/_es/ImagePreview.js +83 -14
- package/dist/packages/_es/Indicator.js +3 -3
- package/dist/packages/_es/InfiniteLoading.js +107 -93
- package/dist/packages/_es/Input.js +8 -8
- package/dist/packages/_es/InputNumber.js +16 -23
- package/dist/packages/_es/Layout.js +1 -1
- package/dist/packages/_es/List.js +34 -41
- package/dist/packages/_es/Menu.js +12 -15
- package/dist/packages/_es/MenuItem.js +7 -7
- package/dist/packages/_es/Navbar.js +4 -3
- package/dist/packages/_es/NoticeBar.js +40 -47
- package/dist/packages/_es/Notify.js +166 -27
- package/dist/packages/_es/NumberKeyboard.js +18 -8
- package/dist/packages/_es/OldPicker.js +120 -122
- package/dist/packages/_es/OverLay.js +25 -5
- package/dist/packages/_es/Pagination.js +14 -13
- package/dist/packages/_es/Picker.js +16 -39
- package/dist/packages/_es/Popover.js +29 -154
- package/dist/packages/_es/Popup.js +69 -6
- package/dist/packages/_es/Price.js +5 -17
- package/dist/packages/_es/Progress.js +8 -18
- package/dist/packages/_es/PullRefresh.js +1 -1
- package/dist/packages/_es/Radio.js +14 -4
- package/dist/packages/_es/RadioGroup.js +1 -1
- package/dist/packages/_es/Range.js +33 -46
- package/dist/packages/_es/Rate.js +19 -16
- package/dist/packages/_es/Row.js +1 -1
- package/dist/packages/_es/SearchBar.js +11 -12
- package/dist/packages/_es/ShortPassword.js +67 -89
- package/dist/packages/_es/SideNavBar.js +16 -5
- package/dist/packages/_es/SideNavBarItem.js +1 -1
- package/dist/packages/_es/Signature.js +88 -69
- package/dist/packages/_es/Skeleton.js +11 -8
- package/dist/packages/_es/Sku.js +57 -49
- package/dist/packages/_es/Step.js +1 -1
- package/dist/packages/_es/Steps.js +1 -1
- package/dist/packages/_es/Sticky.js +23 -28
- package/dist/packages/_es/SubSideNavBar.js +1 -1
- package/dist/packages/_es/Swipe.js +26 -39
- package/dist/packages/_es/Swiper.js +14 -32
- package/dist/packages/_es/SwiperItem.js +2 -2
- 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 +21 -11
- package/dist/packages/_es/Table.js +13 -13
- package/dist/packages/_es/Tabs.js +20 -21
- package/dist/packages/_es/Tag.js +4 -4
- package/dist/packages/_es/TextArea.js +42 -44
- package/dist/packages/_es/TimeDetail.js +3 -4
- package/dist/packages/_es/TimePannel.js +3 -3
- package/dist/packages/_es/TimeSelect.js +7 -8
- package/dist/packages/_es/Toast.js +170 -41
- package/dist/packages/_es/Uploader.js +138 -109
- package/dist/packages/_es/Video.js +9 -8
- package/dist/packages/_es/common.js +1 -1
- package/dist/packages/_es/component.js +135 -3
- package/dist/packages/_es/index.js +6 -44
- package/dist/packages/_es/index2.js +31 -8
- package/dist/packages/_es/index3.js +7 -58
- package/dist/packages/_es/index4.js +56 -413
- package/dist/packages/_es/{index.taro.js → index5.js} +113 -140
- package/dist/packages/_es/plugin-vue_export-helper.js +1 -1
- package/dist/packages/_es/pxCheck.js +1 -1
- package/dist/packages/_es/raf.js +19 -0
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +42 -42
- package/dist/styles/themes/jdt.scss +42 -42
- package/dist/types/__VUE/actionsheet/index.d.ts +269 -0
- package/dist/types/__VUE/address/index.d.ts +386 -0
- package/dist/types/__VUE/audio/index.d.ts +92 -0
- package/dist/types/__VUE/audiooperate/index.d.ts +68 -0
- package/dist/types/__VUE/avatar/index.d.ts +66 -0
- package/dist/types/__VUE/backtop/index.d.ts +105 -0
- package/dist/types/__VUE/badge/index.d.ts +94 -0
- package/dist/types/__VUE/barrage/index.d.ts +80 -0
- package/dist/types/__VUE/button/index.d.ts +116 -0
- package/dist/types/__VUE/calendar/index.d.ts +155 -0
- package/dist/types/__VUE/calendaritem/index.d.ts +195 -0
- package/dist/types/__VUE/card/index.d.ts +81 -0
- package/dist/types/__VUE/cascader/cascader-item.d.ts +76 -0
- package/dist/types/__VUE/cascader/helper.d.ts +8 -0
- package/dist/types/__VUE/cascader/index.d.ts +76 -0
- package/dist/types/__VUE/cascader/tree.d.ts +17 -0
- package/dist/types/__VUE/cascader/types.d.ts +30 -0
- package/dist/types/__VUE/cell/index.d.ts +109 -0
- package/dist/types/__VUE/cellgroup/index.d.ts +38 -0
- package/dist/types/__VUE/checkbox/index.d.ts +102 -0
- package/dist/types/__VUE/checkboxgroup/index.d.ts +39 -0
- package/dist/types/__VUE/circleprogress/index.d.ts +66 -0
- package/dist/types/__VUE/col/index.d.ts +42 -0
- package/dist/types/__VUE/collapse/index.d.ts +104 -0
- package/dist/types/__VUE/collapseitem/index.d.ts +83 -0
- package/dist/types/__VUE/countdown/index.d.ts +90 -0
- package/dist/types/__VUE/countup/index.d.ts +216 -0
- package/dist/types/__VUE/datepicker/index.d.ts +347 -0
- package/dist/types/__VUE/datepicker/utils.d.ts +5 -0
- package/dist/types/__VUE/dialog/index.d.ts +306 -0
- package/dist/types/__VUE/divider/index.d.ts +47 -0
- package/dist/types/__VUE/drag/index.d.ts +61 -0
- package/dist/types/__VUE/elevator/index.d.ts +71 -0
- package/dist/types/__VUE/empty/index.d.ts +46 -0
- package/dist/types/__VUE/fixednav/index.d.ts +96 -0
- package/dist/types/__VUE/form/common.d.ts +20 -0
- package/dist/types/__VUE/form/index.d.ts +32 -0
- package/dist/types/__VUE/form/types.d.ts +13 -0
- package/dist/types/__VUE/formitem/index.d.ts +120 -0
- package/dist/types/__VUE/formitem/types.d.ts +10 -0
- package/dist/types/__VUE/grid/common.d.ts +91 -0
- package/dist/types/__VUE/grid/index.d.ts +100 -0
- package/dist/types/__VUE/griditem/index.d.ts +80 -0
- package/dist/types/__VUE/icon/index.d.ts +74 -0
- package/dist/types/__VUE/imagepreview/index.d.ts +125 -0
- package/dist/types/__VUE/indicator/index.d.ts +70 -0
- package/dist/types/__VUE/infiniteloading/index.d.ts +140 -0
- package/dist/types/__VUE/input/index.d.ts +336 -0
- package/dist/types/__VUE/input/util.d.ts +5 -0
- package/dist/types/__VUE/inputnumber/index.d.ts +117 -0
- package/dist/types/__VUE/layout/index.d.ts +13 -0
- package/dist/types/__VUE/list/index.d.ts +48 -0
- package/dist/types/__VUE/menu/index.d.ts +51 -0
- package/dist/types/__VUE/menuitem/index.d.ts +77 -0
- package/dist/types/__VUE/navbar/index.d.ts +84 -0
- package/dist/types/__VUE/noticebar/index.d.ts +209 -0
- package/dist/types/__VUE/notify/index.d.ts +103 -0
- package/dist/types/__VUE/numberkeyboard/index.d.ts +123 -0
- package/dist/types/__VUE/oldpicker/Column.d.ts +96 -0
- package/dist/types/__VUE/oldpicker/commonProps.d.ts +22 -0
- package/dist/types/__VUE/oldpicker/index.d.ts +360 -0
- package/dist/types/__VUE/oldpicker/types.d.ts +24 -0
- package/dist/types/__VUE/overlay/index.d.ts +1614 -0
- package/dist/types/__VUE/pagination/index.d.ts +112 -0
- package/dist/types/__VUE/picker/Column.d.ts +90 -0
- package/dist/types/__VUE/picker/index.d.ts +342 -0
- package/dist/types/__VUE/picker/types.d.ts +26 -0
- package/dist/types/__VUE/popover/index.d.ts +233 -0
- package/dist/types/__VUE/popup/index.d.ts +1734 -0
- package/dist/types/__VUE/popup/use-lock-scroll.d.ts +5 -0
- package/dist/types/__VUE/price/index.d.ts +87 -0
- package/dist/types/__VUE/progress/index.d.ts +137 -0
- package/dist/types/__VUE/pullrefresh/index.d.ts +128 -0
- package/dist/types/__VUE/pullrefresh/use-touch.d.ts +20 -0
- package/dist/types/__VUE/pullrefresh/util.d.ts +6 -0
- package/dist/types/__VUE/radio/index.d.ts +90 -0
- package/dist/types/__VUE/radiogroup/index.d.ts +48 -0
- package/dist/types/__VUE/range/index.d.ts +156 -0
- package/dist/types/__VUE/rate/index.d.ts +142 -0
- package/dist/types/__VUE/row/index.d.ts +63 -0
- package/dist/types/__VUE/searchbar/index.d.ts +100 -0
- package/dist/types/__VUE/shortpassword/index.d.ts +136 -0
- package/dist/types/__VUE/sidenavbar/index.d.ts +36 -0
- package/dist/types/__VUE/sidenavbaritem/index.d.ts +41 -0
- package/dist/types/__VUE/signature/index.d.ts +73 -0
- package/dist/types/__VUE/skeleton/common.d.ts +63 -0
- package/dist/types/__VUE/skeleton/index.d.ts +117 -0
- package/dist/types/__VUE/sku/components/SkuHeader.d.ts +27 -0
- package/dist/types/__VUE/sku/components/SkuOperate.d.ts +70 -0
- package/dist/types/__VUE/sku/components/SkuSelect.d.ts +30 -0
- package/dist/types/__VUE/sku/components/SkuStepper.d.ts +67 -0
- package/dist/types/__VUE/sku/index.d.ts +300 -0
- package/dist/types/__VUE/step/index.d.ts +70 -0
- package/dist/types/__VUE/steps/index.d.ts +47 -0
- package/dist/types/__VUE/sticky/index.d.ts +63 -0
- package/dist/types/__VUE/subsidenavbar/index.d.ts +54 -0
- package/dist/types/__VUE/swipe/index.d.ts +69 -0
- package/dist/types/__VUE/swiper/index.d.ts +163 -0
- package/dist/types/__VUE/swiper/use-touch.d.ts +20 -0
- package/dist/types/__VUE/swiperitem/index.d.ts +24 -0
- package/dist/types/__VUE/switch/index.d.ts +136 -0
- package/dist/types/__VUE/tabbar/index.d.ts +84 -0
- package/dist/types/__VUE/tabbaritem/index.d.ts +108 -0
- package/dist/types/__VUE/table/common.d.ts +54 -0
- package/dist/types/__VUE/table/index.d.ts +75 -0
- package/dist/types/__VUE/table/renderColumn.d.ts +20 -0
- package/dist/types/__VUE/table/types.d.ts +19 -0
- package/dist/types/__VUE/tabpane/index.d.ts +47 -0
- package/dist/types/__VUE/tabs/index.d.ts +128 -0
- package/dist/types/__VUE/tag/index.d.ts +89 -0
- package/dist/types/__VUE/textarea/index.d.ts +120 -0
- package/dist/types/__VUE/timedetail/index.d.ts +48 -0
- package/dist/types/__VUE/timepannel/index.d.ts +43 -0
- package/dist/types/__VUE/timeselect/index.d.ts +82 -0
- package/dist/types/__VUE/toast/index.d.ts +149 -0
- package/dist/types/__VUE/uploader/index.d.ts +258 -0
- package/dist/types/__VUE/uploader/uploader.d.ts +25 -0
- package/dist/types/__VUE/video/index.d.ts +123 -0
- package/dist/{index.d.ts → types/index.d.ts} +0 -0
- package/dist/types/nutui.d.ts +92 -0
- package/package.json +14 -5
- package/dist/nutui.d.ts +0 -104
- package/dist/packages/_es/use-lock-scroll.js +0 -23
- package/dist/packages/_es/util.js +0 -47
|
@@ -1,25 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.19-beta.
|
|
2
|
+
* @nutui/nutui v3.1.19-beta.2 Thu Apr 07 2022 17:52:31 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { ref, reactive, computed, onMounted, onActivated, onDeactivated, openBlock, createElementBlock, normalizeClass,
|
|
6
|
+
import { ref, reactive, computed, onMounted, onActivated, onDeactivated, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
|
-
import
|
|
8
|
+
import { r as requestAniFrame } from "./raf.js";
|
|
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();
|
|
23
10
|
const { componentName, create } = createComponent("drag");
|
|
24
11
|
const _sfc_main = create({
|
|
25
12
|
props: {
|
|
@@ -53,13 +40,10 @@ const _sfc_main = create({
|
|
|
53
40
|
screenHeight: 0,
|
|
54
41
|
startTop: 0,
|
|
55
42
|
startLeft: 0,
|
|
56
|
-
initTop: 0,
|
|
57
43
|
nx: 0,
|
|
58
44
|
ny: 0,
|
|
59
45
|
xPum: 0,
|
|
60
46
|
yPum: 0,
|
|
61
|
-
top: 0,
|
|
62
|
-
left: 0,
|
|
63
47
|
position: { x: 0, y: 0 },
|
|
64
48
|
boundary: {
|
|
65
49
|
top: 0,
|
|
@@ -69,57 +53,54 @@ const _sfc_main = create({
|
|
|
69
53
|
}
|
|
70
54
|
});
|
|
71
55
|
const classes = computed(() => {
|
|
72
|
-
const prefixCls =
|
|
56
|
+
const prefixCls = componentName;
|
|
73
57
|
return {
|
|
74
58
|
[prefixCls]: true
|
|
75
59
|
};
|
|
76
60
|
});
|
|
77
|
-
const domElem = Taro.getSystemInfoSync();
|
|
78
61
|
function getInfo() {
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}).exec();
|
|
85
|
-
state.screenWidth = domElem.screenWidth;
|
|
86
|
-
state.screenHeight = domElem.screenHeight;
|
|
62
|
+
const domElem = document.documentElement;
|
|
63
|
+
state.elWidth = myDrag.value.offsetWidth;
|
|
64
|
+
state.elHeight = myDrag.value.offsetHeight;
|
|
65
|
+
state.screenWidth = domElem.clientWidth || 375;
|
|
66
|
+
state.screenHeight = domElem.clientHeight || 667;
|
|
87
67
|
}
|
|
88
|
-
function goLeft() {
|
|
68
|
+
function goLeft(target) {
|
|
89
69
|
if (state.boundary.left) {
|
|
90
|
-
if (+
|
|
91
|
-
|
|
92
|
-
requestAniFrame
|
|
93
|
-
goLeft();
|
|
70
|
+
if (+target.style.left.split("px")[0] > state.boundary.left) {
|
|
71
|
+
target.style.left = +target.style.left.split("px")[0] - 10 + "px";
|
|
72
|
+
requestAniFrame(() => {
|
|
73
|
+
goLeft(target);
|
|
94
74
|
});
|
|
95
75
|
} else {
|
|
96
|
-
|
|
76
|
+
target.style.left = `${state.boundary.left}px`;
|
|
97
77
|
}
|
|
98
78
|
} else {
|
|
99
|
-
if (+
|
|
100
|
-
|
|
101
|
-
requestAniFrame
|
|
102
|
-
goLeft();
|
|
79
|
+
if (+target.style.left.split("px")[0] > 10) {
|
|
80
|
+
target.style.left = +target.style.left.split("px")[0] - 10 + "px";
|
|
81
|
+
requestAniFrame(() => {
|
|
82
|
+
goLeft(target);
|
|
103
83
|
});
|
|
104
84
|
} else {
|
|
105
|
-
|
|
85
|
+
target.style.left = "0px";
|
|
106
86
|
}
|
|
107
87
|
}
|
|
108
88
|
}
|
|
109
|
-
function goRight(rightLocation) {
|
|
110
|
-
if (rightLocation - parseInt(
|
|
111
|
-
|
|
112
|
-
requestAniFrame
|
|
113
|
-
goRight(rightLocation);
|
|
89
|
+
function goRight(target, rightLocation) {
|
|
90
|
+
if (rightLocation - parseInt(target.style.left.split("px")[0]) > 10) {
|
|
91
|
+
target.style.left = parseInt(target.style.left.split("px")[0]) + 10 + "px";
|
|
92
|
+
requestAniFrame(() => {
|
|
93
|
+
goRight(target, rightLocation);
|
|
114
94
|
});
|
|
115
95
|
} else {
|
|
116
|
-
|
|
96
|
+
target.style.left = rightLocation + "px";
|
|
117
97
|
}
|
|
118
98
|
}
|
|
119
99
|
function touchMove(e) {
|
|
120
100
|
e.preventDefault();
|
|
121
|
-
|
|
122
|
-
|
|
101
|
+
const target = e.currentTarget;
|
|
102
|
+
if (e.targetTouches.length === 1) {
|
|
103
|
+
const touch = e.targetTouches[0];
|
|
123
104
|
state.nx = touch.clientX - state.position.x;
|
|
124
105
|
state.ny = touch.clientY - state.position.y;
|
|
125
106
|
state.xPum = state.startLeft + state.nx;
|
|
@@ -136,14 +117,15 @@ const _sfc_main = create({
|
|
|
136
117
|
state.yPum = state.screenHeight - state.elHeight - state.boundary.bottom;
|
|
137
118
|
}
|
|
138
119
|
if (props.direction != "y") {
|
|
139
|
-
|
|
120
|
+
target.style.left = state.xPum + "px";
|
|
140
121
|
}
|
|
141
122
|
if (props.direction != "x") {
|
|
142
|
-
|
|
123
|
+
target.style.top = state.yPum + "px";
|
|
143
124
|
}
|
|
144
125
|
}
|
|
145
126
|
}
|
|
146
127
|
function touchEnd(e) {
|
|
128
|
+
const target = e.currentTarget;
|
|
147
129
|
const touch = e.changedTouches[0];
|
|
148
130
|
let currX = touch.clientX;
|
|
149
131
|
const rightLocation = state.screenWidth - state.elWidth - state.boundary.right;
|
|
@@ -156,48 +138,34 @@ const _sfc_main = create({
|
|
|
156
138
|
}
|
|
157
139
|
if (props.direction != "y" && props.attract) {
|
|
158
140
|
if (currX < state.screenWidth / 2) {
|
|
159
|
-
requestAniFrame
|
|
160
|
-
goLeft();
|
|
141
|
+
requestAniFrame(() => {
|
|
142
|
+
goLeft(target);
|
|
161
143
|
});
|
|
162
144
|
} else {
|
|
163
|
-
requestAniFrame
|
|
164
|
-
goRight(rightLocation);
|
|
145
|
+
requestAniFrame(() => {
|
|
146
|
+
goRight(target, rightLocation);
|
|
165
147
|
});
|
|
166
148
|
}
|
|
167
149
|
}
|
|
168
|
-
if (props.direction
|
|
169
|
-
|
|
150
|
+
if (props.direction != "x") {
|
|
151
|
+
target.style.top = state.yPum + "px";
|
|
170
152
|
}
|
|
171
153
|
}
|
|
172
154
|
function touchStart(e) {
|
|
173
|
-
|
|
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;
|
|
155
|
+
const target = e.currentTarget;
|
|
178
156
|
const touches = e.touches[0];
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
|
|
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();
|
|
157
|
+
const touch = e.targetTouches[0];
|
|
158
|
+
state.startTop = target.offsetTop;
|
|
159
|
+
state.startLeft = target.offsetLeft;
|
|
192
160
|
state.position.x = touches.clientX;
|
|
193
161
|
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;
|
|
194
166
|
}
|
|
195
167
|
onMounted(() => {
|
|
196
|
-
|
|
197
|
-
getInfo();
|
|
198
|
-
}, 200);
|
|
199
|
-
eventCenter.once(getCurrentInstance().router.onReady, () => {
|
|
200
|
-
});
|
|
168
|
+
getInfo();
|
|
201
169
|
state.boundary = props.boundary;
|
|
202
170
|
});
|
|
203
171
|
onActivated(() => {
|
|
@@ -216,26 +184,20 @@ const _sfc_main = create({
|
|
|
216
184
|
myDrag,
|
|
217
185
|
touchStart,
|
|
218
186
|
touchMove,
|
|
219
|
-
touchEnd
|
|
220
|
-
state
|
|
187
|
+
touchEnd
|
|
221
188
|
};
|
|
222
189
|
}
|
|
223
190
|
});
|
|
224
191
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
225
192
|
return openBlock(), createElementBlock("view", {
|
|
226
|
-
class: normalizeClass(
|
|
193
|
+
class: normalizeClass(_ctx.classes),
|
|
227
194
|
ref: "myDrag",
|
|
228
195
|
onTouchstart: _cache[0] || (_cache[0] = ($event) => _ctx.touchStart($event)),
|
|
229
|
-
onTouchmove: _cache[1] || (_cache[1] =
|
|
230
|
-
|
|
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
|
-
})
|
|
196
|
+
onTouchmove: _cache[1] || (_cache[1] = ($event) => _ctx.touchMove($event)),
|
|
197
|
+
onTouchend: _cache[2] || (_cache[2] = ($event) => _ctx.touchEnd($event))
|
|
236
198
|
}, [
|
|
237
199
|
renderSlot(_ctx.$slots, "default")
|
|
238
|
-
],
|
|
200
|
+
], 34);
|
|
239
201
|
}
|
|
240
|
-
var
|
|
241
|
-
export {
|
|
202
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
203
|
+
export { index as default };
|
|
@@ -18,14 +18,13 @@ 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.2 Thu Apr 07 2022 17:52:31 GMT+0800 (中国标准时间)
|
|
22
22
|
* (c) 2022 @jdf2e.
|
|
23
23
|
* Released under the MIT License.
|
|
24
24
|
*/
|
|
25
|
-
import { ref, reactive, computed,
|
|
25
|
+
import { ref, reactive, computed, toRefs, nextTick, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, Fragment, renderList, toDisplayString, withDirectives, vShow, createCommentVNode, withModifiers } from "vue";
|
|
26
26
|
import { c as createComponent } from "./component.js";
|
|
27
|
-
import { u as useExpose } from "./
|
|
28
|
-
import Taro, { eventCenter, getCurrentInstance } from "@tarojs/taro";
|
|
27
|
+
import { u as useExpose } from "./index3.js";
|
|
29
28
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
30
29
|
const { componentName, create } = createComponent("elevator");
|
|
31
30
|
const _sfc_main = create({
|
|
@@ -48,7 +47,7 @@ const _sfc_main = create({
|
|
|
48
47
|
emits: ["click-item", "click-index"],
|
|
49
48
|
setup(props, context) {
|
|
50
49
|
const spaceHeight = 23;
|
|
51
|
-
const listview = ref();
|
|
50
|
+
const listview = ref(null);
|
|
52
51
|
const state = reactive({
|
|
53
52
|
anchorIndex: 0,
|
|
54
53
|
listHeight: [],
|
|
@@ -59,9 +58,6 @@ const _sfc_main = create({
|
|
|
59
58
|
},
|
|
60
59
|
scrollStart: false,
|
|
61
60
|
currentIndex: 0,
|
|
62
|
-
query: Taro.createSelectorQuery(),
|
|
63
|
-
scrollTop: 0,
|
|
64
|
-
storageListHeight: [],
|
|
65
61
|
currentData: {}
|
|
66
62
|
});
|
|
67
63
|
const classes = computed(() => {
|
|
@@ -81,11 +77,9 @@ const _sfc_main = create({
|
|
|
81
77
|
y2: 0
|
|
82
78
|
};
|
|
83
79
|
};
|
|
84
|
-
const getData = (el) => {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
return el.dataset.index;
|
|
80
|
+
const getData = (el, name) => {
|
|
81
|
+
const prefix = "data-";
|
|
82
|
+
return el.getAttribute(prefix + name);
|
|
89
83
|
};
|
|
90
84
|
const setListGroup = (el) => {
|
|
91
85
|
nextTick(() => {
|
|
@@ -97,38 +91,34 @@ const _sfc_main = create({
|
|
|
97
91
|
const calculateHeight = () => {
|
|
98
92
|
let height = 0;
|
|
99
93
|
state.listHeight.push(height);
|
|
100
|
-
state.storageListHeight.push(height);
|
|
101
94
|
for (let i = 0; i < state.listGroup.length; i++) {
|
|
102
|
-
state.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
state.listHeight.push(height);
|
|
106
|
-
state.storageListHeight.push(height);
|
|
107
|
-
});
|
|
95
|
+
let item = state.listGroup[i];
|
|
96
|
+
height += item.clientHeight;
|
|
97
|
+
state.listHeight.push(height);
|
|
108
98
|
}
|
|
109
99
|
};
|
|
110
|
-
const scrollTo = (
|
|
111
|
-
if (!
|
|
100
|
+
const scrollTo = (index2) => {
|
|
101
|
+
if (!index2 && index2 !== 0) {
|
|
112
102
|
return;
|
|
113
103
|
}
|
|
114
104
|
if (!state.listHeight.length) {
|
|
115
|
-
|
|
105
|
+
calculateHeight();
|
|
116
106
|
}
|
|
117
|
-
if (
|
|
118
|
-
|
|
119
|
-
if (
|
|
120
|
-
|
|
121
|
-
state.currentIndex =
|
|
122
|
-
|
|
107
|
+
if (index2 < 0)
|
|
108
|
+
index2 = 0;
|
|
109
|
+
if (index2 > state.listHeight.length - 2)
|
|
110
|
+
index2 = state.listHeight.length - 2;
|
|
111
|
+
state.currentIndex = index2;
|
|
112
|
+
listview.value.scrollTo(0, state.listHeight[index2]);
|
|
123
113
|
};
|
|
124
114
|
const touchStart = (e) => {
|
|
125
115
|
state.scrollStart = true;
|
|
126
|
-
let
|
|
116
|
+
let index2 = getData(e.target, "index");
|
|
127
117
|
let firstTouch = e.touches[0];
|
|
128
118
|
state.touchState.y1 = firstTouch.pageY;
|
|
129
|
-
state.anchorIndex = +
|
|
130
|
-
state.currentIndex = +
|
|
131
|
-
scrollTo(+
|
|
119
|
+
state.anchorIndex = +index2;
|
|
120
|
+
state.currentIndex = +index2;
|
|
121
|
+
scrollTo(+index2);
|
|
132
122
|
};
|
|
133
123
|
const touchMove = (e) => {
|
|
134
124
|
let firstTouch = e.touches[0];
|
|
@@ -147,15 +137,6 @@ const _sfc_main = create({
|
|
|
147
137
|
const handleClickIndex = (key) => {
|
|
148
138
|
context.emit("click-index", key);
|
|
149
139
|
};
|
|
150
|
-
onMounted(() => {
|
|
151
|
-
if (Taro.getEnv() === "WEB") {
|
|
152
|
-
calculateHeight();
|
|
153
|
-
} else {
|
|
154
|
-
eventCenter.once(getCurrentInstance().router.onReady, () => {
|
|
155
|
-
calculateHeight();
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
140
|
useExpose({
|
|
160
141
|
scrollTo
|
|
161
142
|
});
|
|
@@ -177,40 +158,34 @@ const _hoisted_2 = ["onClick", "innerHTML"];
|
|
|
177
158
|
const _hoisted_3 = { class: "nut-elevator__bars__inner" };
|
|
178
159
|
const _hoisted_4 = ["data-index", "onClick"];
|
|
179
160
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
180
|
-
const _component_scroll_view = resolveComponent("scroll-view");
|
|
181
161
|
return openBlock(), createElementBlock("view", {
|
|
182
162
|
class: normalizeClass(_ctx.classes)
|
|
183
163
|
}, [
|
|
184
|
-
|
|
185
|
-
class: "nut-elevator__list
|
|
186
|
-
"scroll-top": _ctx.scrollTop,
|
|
187
|
-
"scroll-y": true,
|
|
164
|
+
createElementVNode("view", {
|
|
165
|
+
class: "nut-elevator__list",
|
|
188
166
|
ref: "listview",
|
|
189
167
|
style: normalizeStyle({ height: isNaN(+_ctx.height) ? _ctx.height : `${_ctx.height}px` })
|
|
190
|
-
},
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
_: 1
|
|
212
|
-
}, 8, ["scroll-top", "style"]),
|
|
213
|
-
_ctx.indexList.length > 0 ? withDirectives((openBlock(), createElementBlock("view", {
|
|
168
|
+
}, [
|
|
169
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.indexList, (item) => {
|
|
170
|
+
return openBlock(), createElementBlock("view", {
|
|
171
|
+
class: "nut-elevator__list__item",
|
|
172
|
+
key: item[_ctx.acceptKey],
|
|
173
|
+
ref_for: true,
|
|
174
|
+
ref: _ctx.setListGroup
|
|
175
|
+
}, [
|
|
176
|
+
createElementVNode("view", _hoisted_1, toDisplayString(item[_ctx.acceptKey]), 1),
|
|
177
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(item.list, (subitem) => {
|
|
178
|
+
return openBlock(), createElementBlock("view", {
|
|
179
|
+
class: normalizeClass(["nut-elevator__list__item__name", { "nut-elevator__list__item__name--highcolor": _ctx.currentData.id === subitem.id }]),
|
|
180
|
+
key: subitem["id"],
|
|
181
|
+
onClick: ($event) => _ctx.handleClickItem(item[_ctx.acceptKey], subitem),
|
|
182
|
+
innerHTML: subitem.name
|
|
183
|
+
}, null, 10, _hoisted_2);
|
|
184
|
+
}), 128))
|
|
185
|
+
]);
|
|
186
|
+
}), 128))
|
|
187
|
+
], 4),
|
|
188
|
+
_ctx.indexList.length ? withDirectives((openBlock(), createElementBlock("view", {
|
|
214
189
|
key: 0,
|
|
215
190
|
class: "nut-elevator__code--current"
|
|
216
191
|
}, toDisplayString(_ctx.indexList[_ctx.currentIndex][_ctx.acceptKey]), 513)), [
|
|
@@ -223,10 +198,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
223
198
|
onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx.touchEnd && _ctx.touchEnd(...args))
|
|
224
199
|
}, [
|
|
225
200
|
createElementVNode("view", _hoisted_3, [
|
|
226
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.indexList, (item,
|
|
201
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.indexList, (item, index2) => {
|
|
227
202
|
return openBlock(), createElementBlock("view", {
|
|
228
203
|
class: "nut-elevator__bars__inner__item",
|
|
229
|
-
"data-index":
|
|
204
|
+
"data-index": index2,
|
|
230
205
|
key: item[_ctx.acceptKey],
|
|
231
206
|
onClick: ($event) => _ctx.handleClickIndex(item[_ctx.acceptKey])
|
|
232
207
|
}, toDisplayString(item[_ctx.acceptKey]), 9, _hoisted_4);
|
|
@@ -235,5 +210,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
235
210
|
], 32)
|
|
236
211
|
], 2);
|
|
237
212
|
}
|
|
238
|
-
var
|
|
239
|
-
export {
|
|
213
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
214
|
+
export { index as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.19-beta.
|
|
2
|
+
* @nutui/nutui v3.1.19-beta.2 Thu Apr 07 2022 17:52:31 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -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 = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
74
|
+
export { index as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.19-beta.
|
|
2
|
+
* @nutui/nutui v3.1.19-beta.2 Thu Apr 07 2022 17:52:31 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -7,7 +7,7 @@ import { computed, resolveComponent, openBlock, createElementBlock, normalizeCla
|
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
8
|
import overlay from "./OverLay.js";
|
|
9
9
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
10
|
-
const { componentName, create } = createComponent("fixednav");
|
|
10
|
+
const { componentName, create, translate } = createComponent("fixednav");
|
|
11
11
|
const _sfc_main = create({
|
|
12
12
|
components: {
|
|
13
13
|
[overlay.name]: overlay
|
|
@@ -26,11 +26,11 @@ const _sfc_main = create({
|
|
|
26
26
|
type: Array
|
|
27
27
|
},
|
|
28
28
|
activeText: {
|
|
29
|
-
default: "
|
|
29
|
+
default: "",
|
|
30
30
|
type: String
|
|
31
31
|
},
|
|
32
32
|
unActiveText: {
|
|
33
|
-
default: "
|
|
33
|
+
default: "",
|
|
34
34
|
type: String
|
|
35
35
|
},
|
|
36
36
|
position: {
|
|
@@ -47,7 +47,6 @@ const _sfc_main = create({
|
|
|
47
47
|
type: String
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
|
-
components: {},
|
|
51
50
|
emits: ["update:visible", "selected"],
|
|
52
51
|
setup(props, { emit }) {
|
|
53
52
|
const classes = computed(() => {
|
|
@@ -67,7 +66,7 @@ const _sfc_main = create({
|
|
|
67
66
|
event
|
|
68
67
|
});
|
|
69
68
|
};
|
|
70
|
-
return { classes, updateValue, selected };
|
|
69
|
+
return { classes, updateValue, selected, translate };
|
|
71
70
|
}
|
|
72
71
|
});
|
|
73
72
|
const _hoisted_1 = { class: "nut-fixednav__list" };
|
|
@@ -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, index2) => {
|
|
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 || index2
|
|
102
101
|
}, [
|
|
103
102
|
createElementVNode("img", {
|
|
104
103
|
src: item.icon
|
|
@@ -118,10 +117,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
118
117
|
name: "left",
|
|
119
118
|
color: "#fff"
|
|
120
119
|
}),
|
|
121
|
-
createElementVNode("view", _hoisted_6, toDisplayString(_ctx.visible ? _ctx.activeText : _ctx.unActiveText), 1)
|
|
120
|
+
createElementVNode("view", _hoisted_6, toDisplayString(_ctx.visible ? _ctx.activeText || _ctx.translate("activeText") : _ctx.unActiveText || _ctx.translate("unActiveText")), 1)
|
|
122
121
|
])
|
|
123
122
|
])
|
|
124
123
|
], 6);
|
|
125
124
|
}
|
|
126
|
-
var
|
|
127
|
-
export {
|
|
125
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
126
|
+
export { index as default };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.19-beta.
|
|
2
|
+
* @nutui/nutui v3.1.19-beta.2 Thu Apr 07 2022 17:52:31 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { c as createComponent } from "./component.js";
|
|
7
|
-
import { i as isPromise } from "./util.js";
|
|
6
|
+
import { g as getPropByPath, i as isPromise, c as createComponent } from "./component.js";
|
|
8
7
|
import { computed, reactive, provide, watch, resolveComponent, openBlock, createElementBlock, withModifiers, createVNode, withCtx, renderSlot } from "vue";
|
|
9
8
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
10
9
|
const component = {
|
|
@@ -32,7 +31,7 @@ const component = {
|
|
|
32
31
|
}, { immediate: true });
|
|
33
32
|
const findFormItem = (vnodes) => {
|
|
34
33
|
let task = [];
|
|
35
|
-
vnodes.forEach((vnode,
|
|
34
|
+
vnodes.forEach((vnode, index2) => {
|
|
36
35
|
var _a, _b, _c;
|
|
37
36
|
let type = vnode.type;
|
|
38
37
|
type = type.name || type;
|
|
@@ -61,9 +60,6 @@ const component = {
|
|
|
61
60
|
resolve(errorMsg);
|
|
62
61
|
});
|
|
63
62
|
};
|
|
64
|
-
const getPropByPath = (obj, keyPath) => {
|
|
65
|
-
return keyPath.split(".").reduce((prev, curr) => prev[curr], obj);
|
|
66
|
-
};
|
|
67
63
|
if (!prop) {
|
|
68
64
|
console.warn("[NutUI] <FormItem> \u4F7F\u7528 rules \u6821\u9A8C\u89C4\u5219\u65F6 , \u5FC5\u987B\u8BBE\u7F6E prop \u53C2\u6570");
|
|
69
65
|
}
|
|
@@ -152,5 +148,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
152
148
|
})
|
|
153
149
|
], 32);
|
|
154
150
|
}
|
|
155
|
-
var
|
|
156
|
-
export {
|
|
151
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
152
|
+
export { index as default };
|