@nutui/nutui 3.2.5 → 3.2.6-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 +12 -0
- package/dist/nutui.es.js +4214 -4444
- package/dist/nutui.umd.js +4213 -4543
- package/dist/packages/_es/ActionSheet.js +18 -19
- package/dist/packages/_es/Address.js +94 -85
- package/dist/packages/_es/AddressList.js +25 -12
- package/dist/packages/_es/Animate.js +3 -3
- package/dist/packages/_es/Audio.js +9 -2
- package/dist/packages/_es/AudioOperate.js +5 -1
- package/dist/packages/_es/Avatar.js +10 -10
- package/dist/packages/_es/AvatarGroup.js +5 -5
- package/dist/packages/_es/BackTop.js +55 -108
- package/dist/packages/_es/Badge.js +6 -4
- package/dist/packages/_es/Barrage.js +79 -103
- package/dist/packages/_es/Button.js +5 -3
- package/dist/packages/_es/Calendar.js +36 -23
- package/dist/packages/_es/CalendarItem.js +4 -3
- package/dist/packages/_es/Card.js +15 -5
- package/dist/packages/_es/Cascader.js +12 -11
- package/dist/packages/_es/Category.js +13 -12
- package/dist/packages/_es/CategoryPane.js +17 -13
- package/dist/packages/_es/Cell.js +9 -12
- package/dist/packages/_es/CellGroup.js +4 -2
- package/dist/packages/_es/Checkbox.js +1 -1
- package/dist/packages/_es/CheckboxGroup.js +2 -2
- package/dist/packages/_es/CircleProgress.js +98 -82
- package/dist/packages/_es/Col.js +1 -1
- package/dist/packages/_es/Collapse.js +65 -34
- package/dist/packages/_es/CollapseItem.js +93 -60
- package/dist/packages/_es/Comment.js +43 -19
- package/dist/packages/_es/ConfigProvider.js +1 -1
- package/dist/packages/_es/CountDown.js +3 -3
- package/dist/packages/_es/CountUp.js +47 -52
- package/dist/packages/_es/DatePicker.js +37 -54
- package/dist/packages/_es/Dialog.js +9 -88
- package/dist/packages/_es/Divider.js +3 -3
- package/dist/packages/_es/Drag.js +75 -49
- package/dist/packages/_es/Ecard.js +20 -18
- package/dist/packages/_es/Elevator.js +101 -76
- package/dist/packages/_es/Ellipsis.js +140 -100
- package/dist/packages/_es/Empty.js +6 -4
- package/dist/packages/_es/FixedNav.js +11 -6
- package/dist/packages/_es/Form.js +4 -4
- package/dist/packages/_es/FormItem.js +3 -1
- package/dist/packages/_es/Grid.js +1 -1
- package/dist/packages/_es/GridItem.js +10 -27
- package/dist/packages/_es/Icon.js +1 -1
- package/dist/packages/_es/Image.js +13 -114
- package/dist/packages/_es/ImagePreview.js +154 -400
- package/dist/packages/_es/Indicator.js +3 -3
- package/dist/packages/_es/InfiniteLoading.js +103 -115
- package/dist/packages/_es/Input.js +54 -26
- package/dist/packages/_es/InputNumber.js +25 -16
- package/dist/packages/_es/Invoice.js +6 -5
- package/dist/packages/_es/Layout.js +1 -1
- package/dist/packages/_es/List.js +47 -34
- package/dist/packages/_es/Menu.js +35 -35
- package/dist/packages/_es/MenuItem.js +56 -29
- package/dist/packages/_es/Navbar.js +49 -39
- package/dist/packages/_es/NoticeBar.js +52 -41
- package/dist/packages/_es/Notify.js +37 -166
- package/dist/packages/_es/NumberKeyboard.js +15 -20
- package/dist/packages/_es/OldPicker.js +130 -116
- package/dist/packages/_es/OverLay.js +5 -28
- package/dist/packages/_es/Pagination.js +8 -5
- package/dist/packages/_es/Picker.js +196 -65
- package/dist/packages/_es/Popover.js +201 -881
- package/dist/packages/_es/Popup.js +28 -84
- package/dist/packages/_es/Price.js +22 -6
- package/dist/packages/_es/Progress.js +18 -11
- package/dist/packages/_es/PullRefresh.js +4 -2
- package/dist/packages/_es/Radio.js +3 -3
- package/dist/packages/_es/RadioGroup.js +1 -1
- package/dist/packages/_es/Range.js +48 -34
- package/dist/packages/_es/Rate.js +15 -14
- package/dist/packages/_es/Row.js +1 -1
- package/dist/packages/_es/SearchBar.js +39 -36
- package/dist/packages/_es/ShortPassword.js +97 -66
- package/dist/packages/_es/SideNavBar.js +7 -18
- package/dist/packages/_es/SideNavBarItem.js +1 -1
- package/dist/packages/_es/Signature.js +113 -80
- package/dist/packages/_es/Skeleton.js +12 -11
- package/dist/packages/_es/Sku.js +63 -38
- package/dist/packages/_es/Step.js +7 -2
- package/dist/packages/_es/Steps.js +1 -1
- package/dist/packages/_es/Sticky.js +33 -23
- package/dist/packages/_es/SubSideNavBar.js +4 -2
- package/dist/packages/_es/Swipe.js +41 -26
- package/dist/packages/_es/Swiper.js +38 -21
- package/dist/packages/_es/SwiperItem.js +2 -2
- package/dist/packages/_es/Switch.js +8 -8
- package/dist/packages/_es/TabPane.js +1 -1
- package/dist/packages/_es/Tabbar.js +40 -9
- package/dist/packages/_es/TabbarItem.js +24 -30
- package/dist/packages/_es/Table.js +22 -17
- package/dist/packages/_es/Tabs.js +49 -16
- package/dist/packages/_es/Tag.js +6 -5
- package/dist/packages/_es/TextArea.js +114 -49
- package/dist/packages/_es/TimeDetail.js +4 -3
- package/dist/packages/_es/TimePannel.js +3 -3
- package/dist/packages/_es/TimeSelect.js +12 -10
- package/dist/packages/_es/Toast.js +53 -164
- package/dist/packages/_es/TrendArrow.js +6 -4
- package/dist/packages/_es/Uploader.js +141 -140
- package/dist/packages/_es/Video.js +72 -5
- package/dist/packages/_es/WaterMark.js +22 -14
- package/dist/packages/_es/common.js +1 -1
- package/dist/packages/_es/component.js +1 -1
- package/dist/packages/_es/index.js +44 -6
- package/dist/packages/_es/{index5.js → index.taro.js} +167 -154
- package/dist/packages/_es/index2.js +8 -31
- package/dist/packages/_es/index3.js +64 -7
- package/dist/packages/_es/index4.js +424 -62
- 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 +1 -1
- package/dist/packages/_es/style.css +21 -3
- package/dist/packages/_es/use-lock-scroll.js +23 -0
- package/dist/packages/locale/lang/baseLang.js +1 -1
- package/dist/packages/locale/lang/en-US.js +1 -1
- package/dist/packages/locale/lang/id-ID.js +1 -1
- package/dist/packages/locale/lang/index.js +1 -1
- package/dist/packages/locale/lang/zh-CN.js +1 -1
- package/dist/packages/locale/lang/zh-TW.js +1 -1
- package/dist/packages/signature/index.scss +4 -1
- package/dist/packages/swiperitem/index.scss +1 -1
- package/dist/smartips/attributes.json +4 -0
- package/dist/smartips/tags.json +2 -1
- package/dist/smartips/web-types.json +10 -1
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +44 -44
- package/dist/styles/themes/jdb.scss +44 -44
- package/dist/styles/themes/jddkh.scss +44 -44
- package/dist/styles/themes/jdt.scss +44 -44
- package/dist/types/__VUE/actionsheet/{index.vue.d.ts → index.taro.vue.d.ts} +11 -11
- package/dist/types/__VUE/address/{index.vue.d.ts → index.taro.vue.d.ts} +74 -34
- package/dist/types/__VUE/addresslist/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/animate/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/avatar/{index.vue.d.ts → index.taro.vue.d.ts} +5 -5
- package/dist/types/__VUE/avatargroup/{index.vue.d.ts → index.taro.vue.d.ts} +1 -1
- package/dist/types/__VUE/backtop/{index.vue.d.ts → index.taro.vue.d.ts} +14 -36
- package/dist/types/__VUE/badge/{index.vue.d.ts → index.taro.vue.d.ts} +1 -1
- package/dist/types/__VUE/barrage/{index.vue.d.ts → index.taro.vue.d.ts} +2 -2
- package/dist/types/__VUE/button/index.taro.vue.d.ts +116 -0
- package/dist/types/__VUE/calendar/{index.vue.d.ts → index.taro.vue.d.ts} +14 -2
- package/dist/types/__VUE/calendaritem/{index.vue.d.ts → index.taro.vue.d.ts} +17 -17
- package/dist/types/__VUE/card/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/cascader/{index.vue.d.ts → index.taro.vue.d.ts} +2 -2
- package/dist/types/__VUE/category/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/categorypane/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/cell/{index.vue.d.ts → index.taro.vue.d.ts} +12 -5
- package/dist/types/__VUE/checkbox/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/circleprogress/{index.vue.d.ts → index.taro.vue.d.ts} +14 -15
- package/dist/types/__VUE/collapse/{index.vue.d.ts → index.taro.vue.d.ts} +1 -1
- package/dist/types/__VUE/collapseitem/{index.vue.d.ts → index.taro.vue.d.ts} +1 -9
- package/dist/types/__VUE/comment/{index.vue.d.ts → index.taro.vue.d.ts} +1 -2
- package/dist/types/__VUE/configprovider/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/countdown/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/countup/{index.vue.d.ts → index.taro.vue.d.ts} +5 -7
- package/dist/types/__VUE/datepicker/{index.vue.d.ts → index.taro.vue.d.ts} +6 -6
- package/dist/types/__VUE/dialog/{index.vue.d.ts → index.taro.vue.d.ts} +10 -13
- package/dist/types/__VUE/divider/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/drag/{index.vue.d.ts → index.taro.vue.d.ts} +2 -1
- package/dist/types/__VUE/ecard/{index.vue.d.ts → index.taro.vue.d.ts} +3 -3
- package/dist/types/__VUE/elevator/{index.vue.d.ts → index.taro.vue.d.ts} +11 -2
- package/dist/types/__VUE/ellipsis/{index.vue.d.ts → index.taro.vue.d.ts} +4 -0
- package/dist/types/__VUE/empty/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/fixednav/{index.vue.d.ts → index.taro.vue.d.ts} +1 -1
- package/dist/types/__VUE/form/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/grid/{index.vue.d.ts → index.taro.vue.d.ts} +1 -1
- package/dist/types/__VUE/griditem/{index.vue.d.ts → index.taro.vue.d.ts} +2 -27
- package/dist/types/__VUE/icon/index.taro.vue.d.ts +74 -0
- package/dist/types/__VUE/image/index.taro.vue.d.ts +33 -0
- package/dist/types/__VUE/imagepreview/{index.vue.d.ts → index.taro.vue.d.ts} +41 -43
- package/dist/types/__VUE/indicator/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/infiniteloading/{index.vue.d.ts → index.taro.vue.d.ts} +15 -8
- package/dist/types/__VUE/input/{index.vue.d.ts → index.taro.vue.d.ts} +34 -16
- package/dist/types/__VUE/inputnumber/{index.vue.d.ts → index.taro.vue.d.ts} +2 -2
- package/dist/types/__VUE/invoice/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/layout/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/list/{index.vue.d.ts → index.taro.vue.d.ts} +2 -2
- package/dist/types/__VUE/menu/{index.vue.d.ts → index.taro.vue.d.ts} +2 -1
- package/dist/types/__VUE/menuitem/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/navbar/{index.vue.d.ts → index.taro.vue.d.ts} +1 -2
- package/dist/types/__VUE/noticebar/{index.vue.d.ts → index.taro.vue.d.ts} +6 -5
- package/dist/types/__VUE/notify/{index.vue.d.ts → index.taro.vue.d.ts} +10 -25
- package/dist/types/__VUE/numberkeyboard/{index.vue.d.ts → index.taro.vue.d.ts} +6 -30
- package/dist/types/__VUE/oldpicker/{Column.vue.d.ts → ColumnTaro.vue.d.ts} +28 -17
- package/dist/types/__VUE/oldpicker/{index.vue.d.ts → index.taro.vue.d.ts} +65 -45
- package/dist/types/__VUE/overlay/index.taro.vue.d.ts +85 -0
- package/dist/types/__VUE/pagination/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/picker/{Column.vue.d.ts → ColumnTaro.vue.d.ts} +16 -4
- package/dist/types/__VUE/picker/{index.vue.d.ts → index.taro.vue.d.ts} +54 -29
- package/dist/types/__VUE/popover/{index.vue.d.ts → index.taro.vue.d.ts} +18 -16
- package/dist/types/__VUE/popup/index.taro.vue.d.ts +1728 -0
- package/dist/types/__VUE/popup/index.vue.d.ts +4 -4
- package/dist/types/__VUE/price/{index.vue.d.ts → index.taro.vue.d.ts} +1 -0
- package/dist/types/__VUE/progress/{index.vue.d.ts → index.taro.vue.d.ts} +1 -1
- package/dist/types/__VUE/radio/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/range/{index.vue.d.ts → index.taro.vue.d.ts} +7 -6
- package/dist/types/__VUE/rate/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/searchbar/{index.vue.d.ts → index.taro.vue.d.ts} +19 -19
- package/dist/types/__VUE/shortpassword/{index.vue.d.ts → index.taro.vue.d.ts} +6 -21
- package/dist/types/__VUE/sidenavbar/{index.vue.d.ts → index.taro.vue.d.ts} +0 -5
- package/dist/types/__VUE/signature/{index.vue.d.ts → index.taro.vue.d.ts} +8 -5
- package/dist/types/__VUE/skeleton/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/sku/{index.vue.d.ts → index.taro.vue.d.ts} +55 -183
- package/dist/types/__VUE/step/index.vue.d.ts +1 -1
- package/dist/types/__VUE/steps/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/sticky/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/swipe/{index.vue.d.ts → index.taro.vue.d.ts} +4 -3
- package/dist/types/__VUE/swiper/{index.vue.d.ts → index.taro.vue.d.ts} +2 -1
- package/dist/types/__VUE/swiperitem/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/switch/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/tabbar/{index.vue.d.ts → index.taro.vue.d.ts} +10 -0
- package/dist/types/__VUE/tabbaritem/{index.vue.d.ts → index.taro.vue.d.ts} +8 -8
- package/dist/types/__VUE/table/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/tabs/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/tag/{index.vue.d.ts → index.taro.vue.d.ts} +4 -4
- package/dist/types/__VUE/textarea/{index.vue.d.ts → index.taro.vue.d.ts} +5 -3
- package/dist/types/__VUE/timedetail/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/timepannel/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/timeselect/{index.vue.d.ts → index.taro.vue.d.ts} +7 -8
- package/dist/types/__VUE/toast/{index.vue.d.ts → index.taro.vue.d.ts} +44 -22
- package/dist/types/__VUE/trendarrow/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/uploader/{index.vue.d.ts → index.taro.vue.d.ts} +22 -13
- package/dist/types/__VUE/video/index.vue.d.ts +4 -2
- package/dist/types/__VUE/watermark/{index.vue.d.ts → index.taro.vue.d.ts} +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/nutui.d.ts +89 -89
- package/package.json +1 -1
- package/dist/types/__VUE/dialog/index.d.ts +0 -48
- package/dist/types/__VUE/image/index.vue.d.ts +0 -117
- package/dist/types/__VUE/image/type.d.ts +0 -6
- package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +0 -108
- package/dist/types/__VUE/imagepreview/index.d.ts +0 -25
- package/dist/types/__VUE/notify/index.d.ts +0 -26
- package/dist/types/__VUE/tag/type.d.ts +0 -5
- package/dist/types/__VUE/toast/index.d.ts +0 -16
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.2.
|
|
2
|
+
* @nutui/nutui v3.2.6-beta.1 Mon Oct 31 2022 19:38:22 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { reactive, computed, onBeforeMount, watch, toRefs, resolveComponent, openBlock, createBlock, withCtx, renderSlot } from "vue";
|
|
7
|
-
import
|
|
8
|
-
import { popupProps } from "./
|
|
6
|
+
import { reactive, computed, onBeforeMount, watch, toRefs, resolveComponent, openBlock, createBlock, withCtx, renderSlot, createTextVNode } from "vue";
|
|
7
|
+
import nutPicker from "./Picker.js";
|
|
8
|
+
import { p as popupProps } from "./index4.js";
|
|
9
9
|
import { c as createComponent } from "./component.js";
|
|
10
10
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
11
|
-
import "./
|
|
11
|
+
import "./Popup.js";
|
|
12
|
+
import "./use-lock-scroll.js";
|
|
12
13
|
import "./OverLay.js";
|
|
13
14
|
import "../locale/lang";
|
|
14
15
|
import "./Icon.js";
|
|
15
16
|
import "./pxCheck.js";
|
|
17
|
+
import "./index3.js";
|
|
18
|
+
import "./index.js";
|
|
19
|
+
import "@tarojs/taro";
|
|
16
20
|
function padZero(num, targetLength = 2) {
|
|
17
21
|
let str = num + "";
|
|
18
22
|
while (str.length < targetLength) {
|
|
@@ -20,22 +24,22 @@ function padZero(num, targetLength = 2) {
|
|
|
20
24
|
}
|
|
21
25
|
return str;
|
|
22
26
|
}
|
|
23
|
-
const { componentName, create
|
|
27
|
+
const { componentName, create } = createComponent("datepicker");
|
|
24
28
|
const currentYear = new Date().getFullYear();
|
|
25
29
|
function isDate(val) {
|
|
26
30
|
return Object.prototype.toString.call(val) === "[object Date]" && !isNaN(val.getTime());
|
|
27
31
|
}
|
|
28
32
|
const zhCNType = {
|
|
29
|
-
day:
|
|
30
|
-
year:
|
|
31
|
-
month:
|
|
32
|
-
hour:
|
|
33
|
-
minute:
|
|
34
|
-
seconds:
|
|
33
|
+
day: "\u65E5",
|
|
34
|
+
year: "\u5E74",
|
|
35
|
+
month: "\u6708",
|
|
36
|
+
hour: "\u65F6",
|
|
37
|
+
minute: "\u5206",
|
|
38
|
+
seconds: "\u79D2"
|
|
35
39
|
};
|
|
36
40
|
const _sfc_main = create({
|
|
37
41
|
components: {
|
|
38
|
-
|
|
42
|
+
nutPicker
|
|
39
43
|
},
|
|
40
44
|
props: {
|
|
41
45
|
...popupProps,
|
|
@@ -88,7 +92,7 @@ const _sfc_main = create({
|
|
|
88
92
|
},
|
|
89
93
|
filter: Function
|
|
90
94
|
},
|
|
91
|
-
emits: ["click", "update:visible", "change", "confirm", "update:
|
|
95
|
+
emits: ["click", "update:visible", "change", "confirm", "update:moduleValue"],
|
|
92
96
|
setup(props, { emit }) {
|
|
93
97
|
const state = reactive({
|
|
94
98
|
show: props.visible,
|
|
@@ -111,12 +115,12 @@ const _sfc_main = create({
|
|
|
111
115
|
const boundary = props[`${type}Date`];
|
|
112
116
|
const year = boundary.getFullYear();
|
|
113
117
|
let month = 1;
|
|
114
|
-
let
|
|
118
|
+
let date = 1;
|
|
115
119
|
let hour = 0;
|
|
116
120
|
let minute = 0;
|
|
117
121
|
if (type === "max") {
|
|
118
122
|
month = 12;
|
|
119
|
-
|
|
123
|
+
date = getMonthEndDay(value.getFullYear(), value.getMonth() + 1);
|
|
120
124
|
hour = 23;
|
|
121
125
|
minute = 59;
|
|
122
126
|
}
|
|
@@ -124,36 +128,27 @@ const _sfc_main = create({
|
|
|
124
128
|
if (value.getFullYear() === year) {
|
|
125
129
|
month = boundary.getMonth() + 1;
|
|
126
130
|
if (value.getMonth() + 1 === month) {
|
|
127
|
-
|
|
128
|
-
if (value.getDate() ===
|
|
131
|
+
date = boundary.getDate();
|
|
132
|
+
if (value.getDate() === date) {
|
|
129
133
|
hour = boundary.getHours();
|
|
130
134
|
if (value.getHours() === hour) {
|
|
131
135
|
minute = boundary.getMinutes();
|
|
132
136
|
}
|
|
133
137
|
}
|
|
134
138
|
}
|
|
135
|
-
} else {
|
|
136
|
-
return {
|
|
137
|
-
[`${type}Year`]: year,
|
|
138
|
-
[`${type}Month`]: month,
|
|
139
|
-
[`${type}Day`]: day,
|
|
140
|
-
[`${type}Hour`]: hour,
|
|
141
|
-
[`${type}Minute`]: minute,
|
|
142
|
-
[`${type}Seconds`]: seconds
|
|
143
|
-
};
|
|
144
139
|
}
|
|
145
140
|
return {
|
|
146
141
|
[`${type}Year`]: year,
|
|
147
142
|
[`${type}Month`]: month,
|
|
148
|
-
[`${type}
|
|
143
|
+
[`${type}Date`]: date,
|
|
149
144
|
[`${type}Hour`]: hour,
|
|
150
145
|
[`${type}Minute`]: minute,
|
|
151
146
|
[`${type}Seconds`]: seconds
|
|
152
147
|
};
|
|
153
148
|
};
|
|
154
149
|
const ranges = computed(() => {
|
|
155
|
-
const { maxYear,
|
|
156
|
-
const { minYear,
|
|
150
|
+
const { maxYear, maxDate, maxMonth, maxHour, maxMinute, maxSeconds } = getBoundary("max", state.currentDate);
|
|
151
|
+
const { minYear, minDate, minMonth, minHour, minMinute, minSeconds } = getBoundary("min", state.currentDate);
|
|
157
152
|
let result = [
|
|
158
153
|
{
|
|
159
154
|
type: "year",
|
|
@@ -165,7 +160,7 @@ const _sfc_main = create({
|
|
|
165
160
|
},
|
|
166
161
|
{
|
|
167
162
|
type: "day",
|
|
168
|
-
range: [
|
|
163
|
+
range: [minDate, maxDate]
|
|
169
164
|
},
|
|
170
165
|
{
|
|
171
166
|
type: "hour",
|
|
@@ -218,11 +213,11 @@ const _sfc_main = create({
|
|
|
218
213
|
selectedValue.forEach((item) => {
|
|
219
214
|
formatDate.push(item);
|
|
220
215
|
});
|
|
221
|
-
if (props.type == "month-day"
|
|
222
|
-
formatDate.unshift(new Date(
|
|
216
|
+
if (props.type == "month-day") {
|
|
217
|
+
formatDate.unshift(new Date(props.modelValue || props.minDate || props.maxDate).getFullYear());
|
|
223
218
|
}
|
|
224
219
|
if (props.type == "year-month" && formatDate.length < 3) {
|
|
225
|
-
formatDate.push(new Date(
|
|
220
|
+
formatDate.push(new Date(props.modelValue || props.minDate || props.maxDate).getDate());
|
|
226
221
|
}
|
|
227
222
|
const year = Number(formatDate[0]);
|
|
228
223
|
const month = Number(formatDate[1]) - 1;
|
|
@@ -253,7 +248,7 @@ const _sfc_main = create({
|
|
|
253
248
|
};
|
|
254
249
|
const generateValue = (min, max, val, type, columnIndex) => {
|
|
255
250
|
const arr = [];
|
|
256
|
-
let
|
|
251
|
+
let index = 0;
|
|
257
252
|
while (min <= max) {
|
|
258
253
|
arr.push(formatterOption(type, min));
|
|
259
254
|
if (type === "minute") {
|
|
@@ -262,10 +257,10 @@ const _sfc_main = create({
|
|
|
262
257
|
min++;
|
|
263
258
|
}
|
|
264
259
|
if (min <= val) {
|
|
265
|
-
|
|
260
|
+
index++;
|
|
266
261
|
}
|
|
267
262
|
}
|
|
268
|
-
state.selectedValue[columnIndex] = arr[
|
|
263
|
+
state.selectedValue[columnIndex] = arr[index].value;
|
|
269
264
|
return props.filter ? props.filter(type, arr) : arr;
|
|
270
265
|
};
|
|
271
266
|
const getDateIndex = (type) => {
|
|
@@ -292,25 +287,13 @@ const _sfc_main = create({
|
|
|
292
287
|
emit("confirm", val);
|
|
293
288
|
};
|
|
294
289
|
onBeforeMount(() => {
|
|
290
|
+
console.log("\u5E73\u94FA\u5C55\u793A");
|
|
295
291
|
state.currentDate = formatValue(props.modelValue);
|
|
296
292
|
});
|
|
297
293
|
watch(
|
|
298
294
|
() => props.modelValue,
|
|
299
295
|
(value) => {
|
|
300
|
-
|
|
301
|
-
const isSameValue = JSON.stringify(newValues) === JSON.stringify(state.currentDate);
|
|
302
|
-
if (!isSameValue) {
|
|
303
|
-
state.currentDate = newValues;
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
);
|
|
307
|
-
watch(
|
|
308
|
-
() => state.currentDate,
|
|
309
|
-
(newValues) => {
|
|
310
|
-
const isSameValue = JSON.stringify(newValues) === JSON.stringify(props.modelValue);
|
|
311
|
-
if (!isSameValue) {
|
|
312
|
-
emit("update:modelValue", newValues);
|
|
313
|
-
}
|
|
296
|
+
state.currentDate = formatValue(value);
|
|
314
297
|
}
|
|
315
298
|
);
|
|
316
299
|
watch(
|
|
@@ -340,7 +323,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
340
323
|
modelValue: _ctx.selectedValue,
|
|
341
324
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.selectedValue = $event),
|
|
342
325
|
visible: _ctx.show,
|
|
343
|
-
"onUpdate:visible": _cache[1] || (_cache[1] = ($event) => _ctx.show = $event),
|
|
344
326
|
okText: _ctx.okText,
|
|
345
327
|
cancelText: _ctx.cancelText,
|
|
346
328
|
onClose: _ctx.closeHandler,
|
|
@@ -358,10 +340,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
358
340
|
renderSlot(_ctx.$slots, "top")
|
|
359
341
|
]),
|
|
360
342
|
default: withCtx(() => [
|
|
343
|
+
createTextVNode(),
|
|
361
344
|
renderSlot(_ctx.$slots, "default")
|
|
362
345
|
]),
|
|
363
346
|
_: 3
|
|
364
347
|
}, 8, ["modelValue", "visible", "okText", "cancelText", "onClose", "columns", "onChange", "title", "onConfirm", "isWrapTeleport", "threeDimensional", "swipeDuration", "safeAreaInsetBottom", "destroyOnClose"]);
|
|
365
348
|
}
|
|
366
|
-
var
|
|
367
|
-
export {
|
|
349
|
+
var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
350
|
+
export { index_taro as default };
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.2.
|
|
2
|
+
* @nutui/nutui v3.2.6-beta.1 Mon Oct 31 2022 19:38:22 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { ref, onMounted, watch, computed, resolveComponent, openBlock, createBlock, normalizeStyle, withCtx, createElementVNode, normalizeClass, createElementBlock, renderSlot, Fragment, createTextVNode, toDisplayString, createCommentVNode, resolveDynamicComponent
|
|
6
|
+
import { ref, onMounted, watch, computed, resolveComponent, openBlock, createBlock, normalizeStyle, withCtx, createElementVNode, normalizeClass, createElementBlock, renderSlot, Fragment, createTextVNode, toDisplayString, createCommentVNode, resolveDynamicComponent } from "vue";
|
|
7
7
|
import { i as isPromise, c as createComponent } from "./component.js";
|
|
8
8
|
import Popup, { popupProps } from "./Popup.js";
|
|
9
9
|
import Button from "./Button.js";
|
|
10
10
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
11
11
|
import "../locale/lang";
|
|
12
|
+
import "./use-lock-scroll.js";
|
|
12
13
|
import "./OverLay.js";
|
|
13
14
|
import "./Icon.js";
|
|
14
15
|
import "./pxCheck.js";
|
|
@@ -132,8 +133,8 @@ const _sfc_main = create({
|
|
|
132
133
|
}
|
|
133
134
|
};
|
|
134
135
|
const onOk = () => {
|
|
135
|
-
emit("ok");
|
|
136
136
|
closed("ok");
|
|
137
|
+
emit("ok");
|
|
137
138
|
};
|
|
138
139
|
return {
|
|
139
140
|
closed,
|
|
@@ -176,6 +177,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
176
177
|
createTextVNode(toDisplayString(_ctx.title), 1)
|
|
177
178
|
], 64))
|
|
178
179
|
])) : createCommentVNode("", true),
|
|
180
|
+
createTextVNode(),
|
|
179
181
|
createElementVNode("view", {
|
|
180
182
|
class: "nut-dialog__content",
|
|
181
183
|
style: normalizeStyle({ textAlign: _ctx.textAlign })
|
|
@@ -185,6 +187,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
185
187
|
innerHTML: _ctx.content
|
|
186
188
|
}, null, 8, _hoisted_2)) : (openBlock(), createBlock(resolveDynamicComponent(_ctx.content), { key: 2 }))
|
|
187
189
|
], 4),
|
|
190
|
+
createTextVNode(),
|
|
188
191
|
!_ctx.noFooter ? (openBlock(), createElementBlock("view", {
|
|
189
192
|
key: 1,
|
|
190
193
|
class: normalizeClass(["nut-dialog__footer", { [_ctx.footerDirection]: _ctx.footerDirection }])
|
|
@@ -203,6 +206,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
203
206
|
]),
|
|
204
207
|
_: 1
|
|
205
208
|
}, 8, ["onClick"])) : createCommentVNode("", true),
|
|
209
|
+
createTextVNode(),
|
|
206
210
|
!_ctx.noOkBtn ? (openBlock(), createBlock(_component_nut_button, {
|
|
207
211
|
key: 1,
|
|
208
212
|
size: "small",
|
|
@@ -222,88 +226,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
222
226
|
_: 3
|
|
223
227
|
}, 8, ["teleport", "visible", "close-on-click-overlay", "lock-scroll", "pop-class", "style", "overlay-class", "overlay-style", "onClickOverlay", "onClickCloseIcon"]);
|
|
224
228
|
}
|
|
225
|
-
var
|
|
226
|
-
|
|
227
|
-
constructor() {
|
|
228
|
-
this.title = "";
|
|
229
|
-
this.content = "";
|
|
230
|
-
this.cancelText = "";
|
|
231
|
-
this.okText = "";
|
|
232
|
-
this.textAlign = "center";
|
|
233
|
-
this.customClass = "";
|
|
234
|
-
this.overlayStyle = {};
|
|
235
|
-
this.overlayClass = "";
|
|
236
|
-
this.popStyle = {};
|
|
237
|
-
this.popClass = "";
|
|
238
|
-
this.teleport = "body";
|
|
239
|
-
this.id = new Date().getTime();
|
|
240
|
-
this.footerDirection = "horizontal";
|
|
241
|
-
this.onUpdate = (value) => {
|
|
242
|
-
};
|
|
243
|
-
this.onOk = () => {
|
|
244
|
-
};
|
|
245
|
-
this.onCancel = () => {
|
|
246
|
-
};
|
|
247
|
-
this.onOpened = () => {
|
|
248
|
-
};
|
|
249
|
-
this.onClosed = () => {
|
|
250
|
-
};
|
|
251
|
-
this.visible = true;
|
|
252
|
-
this.noFooter = false;
|
|
253
|
-
this.noOkBtn = false;
|
|
254
|
-
this.noCancelBtn = false;
|
|
255
|
-
this.okBtnDisabled = false;
|
|
256
|
-
this.closeOnPopstate = false;
|
|
257
|
-
this.lockScroll = false;
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
class DialogFunction {
|
|
261
|
-
constructor(_options) {
|
|
262
|
-
this.options = new DialogOptions();
|
|
263
|
-
this.close = () => {
|
|
264
|
-
};
|
|
265
|
-
this.setDefaultOptions = (options2) => {
|
|
266
|
-
};
|
|
267
|
-
this.resetDefaultOptions = () => {
|
|
268
|
-
};
|
|
269
|
-
let options = Object.assign(this.options, _options);
|
|
270
|
-
let elWarp = document.body;
|
|
271
|
-
let teleport = options.teleport;
|
|
272
|
-
if (teleport != "body") {
|
|
273
|
-
if (typeof teleport == "string") {
|
|
274
|
-
elWarp = document.querySelector(teleport);
|
|
275
|
-
} else {
|
|
276
|
-
elWarp = options.teleport;
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
const root = document.createElement("view");
|
|
280
|
-
root.id = "dialog-" + options.id;
|
|
281
|
-
const Wrapper = {
|
|
282
|
-
setup() {
|
|
283
|
-
options.onUpdate = (val) => {
|
|
284
|
-
if (val == false) {
|
|
285
|
-
elWarp.removeChild(root);
|
|
286
|
-
}
|
|
287
|
-
};
|
|
288
|
-
if (options == null ? void 0 : options.onOpened) {
|
|
289
|
-
options == null ? void 0 : options.onOpened();
|
|
290
|
-
}
|
|
291
|
-
options.teleport = `#${root.id}`;
|
|
292
|
-
return () => {
|
|
293
|
-
return h(Dialog, options);
|
|
294
|
-
};
|
|
295
|
-
}
|
|
296
|
-
};
|
|
297
|
-
this.instance = createVNode(Wrapper);
|
|
298
|
-
elWarp.appendChild(root);
|
|
299
|
-
render(this.instance, root);
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
const _Dialog = function(options) {
|
|
303
|
-
return new DialogFunction(options);
|
|
304
|
-
};
|
|
305
|
-
_Dialog.install = (app) => {
|
|
306
|
-
app.use(Dialog);
|
|
307
|
-
app.config.globalProperties.$dialog = _Dialog;
|
|
308
|
-
};
|
|
309
|
-
export { Dialog, DialogOptions, _Dialog as default };
|
|
229
|
+
var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
230
|
+
export { index_taro as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.2.
|
|
2
|
+
* @nutui/nutui v3.2.6-beta.1 Mon Oct 31 2022 19:38:22 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -66,5 +66,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
66
66
|
class: normalizeClass(_ctx.classes)
|
|
67
67
|
}, null, 2));
|
|
68
68
|
}
|
|
69
|
-
var
|
|
70
|
-
export {
|
|
69
|
+
var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
70
|
+
export { index_taro as default };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.2.
|
|
2
|
+
* @nutui/nutui v3.2.6-beta.1 Mon Oct 31 2022 19:38:22 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, 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 Taro, { eventCenter, getCurrentInstance } from "@tarojs/taro";
|
|
9
10
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
10
11
|
import "../locale/lang";
|
|
11
12
|
const { componentName, create } = createComponent("drag");
|
|
@@ -31,7 +32,7 @@ const _sfc_main = create({
|
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
34
|
},
|
|
34
|
-
setup(props) {
|
|
35
|
+
setup(props, { emit }) {
|
|
35
36
|
const myDrag = ref();
|
|
36
37
|
const state = reactive({
|
|
37
38
|
keepAlive: false,
|
|
@@ -41,10 +42,13 @@ const _sfc_main = create({
|
|
|
41
42
|
screenHeight: 0,
|
|
42
43
|
startTop: 0,
|
|
43
44
|
startLeft: 0,
|
|
45
|
+
initTop: 0,
|
|
44
46
|
nx: 0,
|
|
45
47
|
ny: 0,
|
|
46
48
|
xPum: 0,
|
|
47
49
|
yPum: 0,
|
|
50
|
+
top: 0,
|
|
51
|
+
left: 0,
|
|
48
52
|
position: { x: 0, y: 0 },
|
|
49
53
|
boundary: {
|
|
50
54
|
top: 0,
|
|
@@ -54,54 +58,57 @@ const _sfc_main = create({
|
|
|
54
58
|
}
|
|
55
59
|
});
|
|
56
60
|
const classes = computed(() => {
|
|
57
|
-
const prefixCls =
|
|
61
|
+
const prefixCls = "nut-taro-drag";
|
|
58
62
|
return {
|
|
59
63
|
[prefixCls]: true
|
|
60
64
|
};
|
|
61
65
|
});
|
|
66
|
+
const domElem = Taro.getSystemInfoSync();
|
|
62
67
|
function getInfo() {
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
+
const query = Taro.createSelectorQuery();
|
|
69
|
+
query.select(".myDrag").boundingClientRect((rec) => {
|
|
70
|
+
state.elWidth = rec.width;
|
|
71
|
+
state.elHeight = rec.height;
|
|
72
|
+
state.initTop = rec.top;
|
|
73
|
+
}).exec();
|
|
74
|
+
state.screenWidth = domElem.screenWidth;
|
|
75
|
+
state.screenHeight = domElem.screenHeight;
|
|
68
76
|
}
|
|
69
|
-
function goLeft(
|
|
77
|
+
function goLeft() {
|
|
70
78
|
if (state.boundary.left) {
|
|
71
|
-
if (+
|
|
72
|
-
|
|
79
|
+
if (+state.left.split("px")[0] > state.boundary.left) {
|
|
80
|
+
state.left = +state.left.split("px")[0] - 10 + "px";
|
|
73
81
|
requestAniFrame(() => {
|
|
74
|
-
goLeft(
|
|
82
|
+
goLeft();
|
|
75
83
|
});
|
|
76
84
|
} else {
|
|
77
|
-
|
|
85
|
+
state.left = `${state.boundary.left}px`;
|
|
78
86
|
}
|
|
79
87
|
} else {
|
|
80
|
-
if (+
|
|
81
|
-
|
|
88
|
+
if (+state.left.split("px")[0] > 10) {
|
|
89
|
+
state.left = +state.left.split("px")[0] - 10 + "px";
|
|
82
90
|
requestAniFrame(() => {
|
|
83
|
-
goLeft(
|
|
91
|
+
goLeft();
|
|
84
92
|
});
|
|
85
93
|
} else {
|
|
86
|
-
|
|
94
|
+
state.left = "0px";
|
|
87
95
|
}
|
|
88
96
|
}
|
|
89
97
|
}
|
|
90
|
-
function goRight(
|
|
91
|
-
if (rightLocation - parseInt(
|
|
92
|
-
|
|
98
|
+
function goRight(rightLocation) {
|
|
99
|
+
if (rightLocation - parseInt(state.left.split("px")[0]) > 10) {
|
|
100
|
+
state.left = parseInt(state.left.split("px")[0]) + 10 + "px";
|
|
93
101
|
requestAniFrame(() => {
|
|
94
|
-
goRight(
|
|
102
|
+
goRight(rightLocation);
|
|
95
103
|
});
|
|
96
104
|
} else {
|
|
97
|
-
|
|
105
|
+
state.left = rightLocation + "px";
|
|
98
106
|
}
|
|
99
107
|
}
|
|
100
108
|
function touchMove(e) {
|
|
101
109
|
e.preventDefault();
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
const touch = e.targetTouches[0];
|
|
110
|
+
if (e.touches.length === 1) {
|
|
111
|
+
const touch = e.touches[0];
|
|
105
112
|
state.nx = touch.clientX - state.position.x;
|
|
106
113
|
state.ny = touch.clientY - state.position.y;
|
|
107
114
|
state.xPum = state.startLeft + state.nx;
|
|
@@ -118,15 +125,14 @@ const _sfc_main = create({
|
|
|
118
125
|
state.yPum = state.screenHeight - state.elHeight - state.boundary.bottom;
|
|
119
126
|
}
|
|
120
127
|
if (props.direction != "y") {
|
|
121
|
-
|
|
128
|
+
state.left = state.xPum;
|
|
122
129
|
}
|
|
123
130
|
if (props.direction != "x") {
|
|
124
|
-
|
|
131
|
+
state.top = state.yPum;
|
|
125
132
|
}
|
|
126
133
|
}
|
|
127
134
|
}
|
|
128
135
|
function touchEnd(e) {
|
|
129
|
-
const target = e.currentTarget;
|
|
130
136
|
const touch = e.changedTouches[0];
|
|
131
137
|
let currX = touch.clientX;
|
|
132
138
|
const rightLocation = state.screenWidth - state.elWidth - state.boundary.right;
|
|
@@ -140,33 +146,47 @@ const _sfc_main = create({
|
|
|
140
146
|
if (props.direction != "y" && props.attract) {
|
|
141
147
|
if (currX < state.screenWidth / 2) {
|
|
142
148
|
requestAniFrame(() => {
|
|
143
|
-
goLeft(
|
|
149
|
+
goLeft();
|
|
144
150
|
});
|
|
145
151
|
} else {
|
|
146
152
|
requestAniFrame(() => {
|
|
147
|
-
goRight(
|
|
153
|
+
goRight(rightLocation);
|
|
148
154
|
});
|
|
149
155
|
}
|
|
150
156
|
}
|
|
151
|
-
if (props.direction
|
|
152
|
-
|
|
157
|
+
if (props.direction !== "x") {
|
|
158
|
+
state.top = state.yPum;
|
|
153
159
|
}
|
|
154
160
|
}
|
|
155
161
|
function touchStart(e) {
|
|
156
|
-
|
|
162
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
163
|
+
const query = Taro.createSelectorQuery();
|
|
164
|
+
let id = (_a = e == null ? void 0 : e.mpEvent) == null ? void 0 : _a.currentTarget.id;
|
|
165
|
+
let offsetTop = (_b = e == null ? void 0 : e.currentTarget) == null ? void 0 : _b.offsetTop;
|
|
166
|
+
let offsetLeft = (_c = e == null ? void 0 : e.currentTarget) == null ? void 0 : _c.offsetLeft;
|
|
157
167
|
const touches = e.touches[0];
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
|
|
168
|
+
const mobileTop = (_f = (_e = (_d = e.touches[0]) == null ? void 0 : _d.target) == null ? void 0 : _e.parentNode) == null ? void 0 : _f.style.top;
|
|
169
|
+
const mobileLeft = (_i = (_h = (_g = e.touches[0]) == null ? void 0 : _g.target) == null ? void 0 : _h.parentNode) == null ? void 0 : _i.style.left;
|
|
170
|
+
query.selectAll(".myDrag").boundingClientRect((rec) => {
|
|
171
|
+
rec.forEach((element) => {
|
|
172
|
+
if (id && id == element.id) {
|
|
173
|
+
state.startTop = element.top - offsetTop;
|
|
174
|
+
state.startLeft = element.left - offsetLeft;
|
|
175
|
+
} else if (mobileTop) {
|
|
176
|
+
state.startTop = Number(mobileTop.slice(0, -2));
|
|
177
|
+
state.startLeft = Number(mobileLeft.slice(0, -2));
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
}).exec();
|
|
161
181
|
state.position.x = touches.clientX;
|
|
162
182
|
state.position.y = touches.clientY;
|
|
163
|
-
state.nx = touch.clientX - state.position.x;
|
|
164
|
-
state.ny = touch.clientY - state.position.y;
|
|
165
|
-
state.xPum = state.startLeft + state.nx;
|
|
166
|
-
state.yPum = state.startTop + state.ny;
|
|
167
183
|
}
|
|
168
184
|
onMounted(() => {
|
|
169
|
-
|
|
185
|
+
setTimeout(() => {
|
|
186
|
+
getInfo();
|
|
187
|
+
}, 200);
|
|
188
|
+
eventCenter.once(getCurrentInstance().router.onReady, () => {
|
|
189
|
+
});
|
|
170
190
|
state.boundary = props.boundary;
|
|
171
191
|
});
|
|
172
192
|
onActivated(() => {
|
|
@@ -185,20 +205,26 @@ const _sfc_main = create({
|
|
|
185
205
|
myDrag,
|
|
186
206
|
touchStart,
|
|
187
207
|
touchMove,
|
|
188
|
-
touchEnd
|
|
208
|
+
touchEnd,
|
|
209
|
+
state
|
|
189
210
|
};
|
|
190
211
|
}
|
|
191
212
|
});
|
|
192
213
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
193
214
|
return openBlock(), createElementBlock("view", {
|
|
194
|
-
class: normalizeClass(_ctx.classes),
|
|
215
|
+
class: normalizeClass([_ctx.classes, "myDrag"]),
|
|
195
216
|
ref: "myDrag",
|
|
196
217
|
onTouchstart: _cache[0] || (_cache[0] = ($event) => _ctx.touchStart($event)),
|
|
197
|
-
onTouchmove: _cache[1] || (_cache[1] = ($event) => _ctx.touchMove($event)),
|
|
198
|
-
|
|
218
|
+
onTouchmove: _cache[1] || (_cache[1] = withModifiers(($event) => _ctx.touchMove($event), ["prevent"])),
|
|
219
|
+
catchtouchmove: "true",
|
|
220
|
+
style: normalizeStyle({
|
|
221
|
+
transform: ` translate(${_ctx.state.left + "px"}, ${_ctx.state.top + "px"})`,
|
|
222
|
+
top: _ctx.state.top + "px",
|
|
223
|
+
left: _ctx.state.left + "px"
|
|
224
|
+
})
|
|
199
225
|
}, [
|
|
200
226
|
renderSlot(_ctx.$slots, "default")
|
|
201
|
-
],
|
|
227
|
+
], 38);
|
|
202
228
|
}
|
|
203
|
-
var
|
|
204
|
-
export {
|
|
229
|
+
var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
230
|
+
export { index_taro as default };
|