@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,14 +1,17 @@
|
|
|
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, watch, onMounted, toRefs, openBlock, createElementBlock, createElementVNode, normalizeStyle, Fragment, renderList, normalizeClass, toDisplayString, createCommentVNode, onBeforeUnmount, resolveComponent, createVNode, withCtx, renderSlot } from "vue";
|
|
6
|
+
import { ref, reactive, computed, watch, onMounted, toRefs, openBlock, createElementBlock, createElementVNode, normalizeStyle, Fragment, renderList, normalizeClass, toDisplayString, createCommentVNode, createTextVNode, onBeforeUnmount, resolveComponent, createVNode, withCtx, renderSlot } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
|
-
import
|
|
9
|
-
import { u as useTouch } from "./
|
|
8
|
+
import { popupProps } from "./Popup.js";
|
|
9
|
+
import { u as useTouch } from "./index3.js";
|
|
10
10
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
11
|
+
import { u as useTaroRect } from "./index.js";
|
|
12
|
+
import Taro from "@tarojs/taro";
|
|
11
13
|
import "../locale/lang";
|
|
14
|
+
import "./use-lock-scroll.js";
|
|
12
15
|
import "./OverLay.js";
|
|
13
16
|
import "./Icon.js";
|
|
14
17
|
import "./pxCheck.js";
|
|
@@ -17,6 +20,10 @@ const _sfc_main$1 = create$1({
|
|
|
17
20
|
props: {
|
|
18
21
|
value: [String, Number],
|
|
19
22
|
columnsType: String,
|
|
23
|
+
lineSpacing: {
|
|
24
|
+
type: Number,
|
|
25
|
+
default: 36
|
|
26
|
+
},
|
|
20
27
|
itemShow: {
|
|
21
28
|
type: Boolean,
|
|
22
29
|
default: false
|
|
@@ -42,6 +49,7 @@ const _sfc_main$1 = create$1({
|
|
|
42
49
|
setup(props, { emit }) {
|
|
43
50
|
const touch = useTouch();
|
|
44
51
|
const wrapper = ref();
|
|
52
|
+
const itemref = ref();
|
|
45
53
|
const state = reactive({
|
|
46
54
|
touchParams: {
|
|
47
55
|
startY: 0,
|
|
@@ -54,28 +62,29 @@ const _sfc_main$1 = create$1({
|
|
|
54
62
|
currIndex: 1,
|
|
55
63
|
transformY: 0,
|
|
56
64
|
scrollDistance: 0,
|
|
57
|
-
lineSpacing: 36,
|
|
58
65
|
rotation: 20,
|
|
59
66
|
timer: null
|
|
60
67
|
});
|
|
61
68
|
const roller = ref(null);
|
|
62
69
|
const list = ref(null);
|
|
70
|
+
const listitem = ref(null);
|
|
63
71
|
const moving = ref(false);
|
|
64
72
|
const touchDeg = ref(0);
|
|
65
73
|
const touchTime = ref(0);
|
|
74
|
+
const touchTranslateY = ref(0);
|
|
66
75
|
const DEFAULT_DURATION = 200;
|
|
67
76
|
const INERTIA_TIME = 300;
|
|
68
77
|
const INERTIA_DISTANCE = 15;
|
|
69
|
-
const
|
|
78
|
+
const touchTileStyle = computed(() => {
|
|
70
79
|
return {
|
|
71
80
|
transition: `transform ${touchTime.value}ms cubic-bezier(0.17, 0.89, 0.45, 1)`,
|
|
72
|
-
transform: `
|
|
81
|
+
transform: `translate3d(0, ${state.scrollDistance}px, 0)`
|
|
73
82
|
};
|
|
74
83
|
});
|
|
75
|
-
const
|
|
84
|
+
const touchRollerStyle = computed(() => {
|
|
76
85
|
return {
|
|
77
86
|
transition: `transform ${touchTime.value}ms cubic-bezier(0.17, 0.89, 0.45, 1)`,
|
|
78
|
-
transform: `
|
|
87
|
+
transform: `rotate3d(1, 0, 0, ${touchDeg.value})`
|
|
79
88
|
};
|
|
80
89
|
});
|
|
81
90
|
const setRollerStyle = (index) => {
|
|
@@ -97,7 +106,7 @@ const _sfc_main$1 = create$1({
|
|
|
97
106
|
};
|
|
98
107
|
const onTouchMove = (event) => {
|
|
99
108
|
touch.move(event);
|
|
100
|
-
if (touch.isVertical
|
|
109
|
+
if (touch.isVertical) {
|
|
101
110
|
moving.value = true;
|
|
102
111
|
preventDefault(event, true);
|
|
103
112
|
}
|
|
@@ -141,6 +150,7 @@ const _sfc_main$1 = create$1({
|
|
|
141
150
|
touchTime.value = 0;
|
|
142
151
|
}
|
|
143
152
|
touchDeg.value = deg;
|
|
153
|
+
touchTranslateY.value = translateY;
|
|
144
154
|
state.scrollDistance = translateY;
|
|
145
155
|
};
|
|
146
156
|
const setMove = (move, type, time) => {
|
|
@@ -149,22 +159,22 @@ const _sfc_main$1 = create$1({
|
|
|
149
159
|
if (updateMove > 0) {
|
|
150
160
|
updateMove = 0;
|
|
151
161
|
}
|
|
152
|
-
if (updateMove < -(props.column.length - 1) *
|
|
153
|
-
updateMove = -(props.column.length - 1) *
|
|
162
|
+
if (updateMove < -(props.column.length - 1) * props.lineSpacing) {
|
|
163
|
+
updateMove = -(props.column.length - 1) * props.lineSpacing;
|
|
154
164
|
}
|
|
155
|
-
let endMove = Math.round(updateMove /
|
|
156
|
-
let deg = `${(Math.abs(Math.round(endMove /
|
|
165
|
+
let endMove = Math.round(updateMove / props.lineSpacing) * props.lineSpacing;
|
|
166
|
+
let deg = `${(Math.abs(Math.round(endMove / props.lineSpacing)) + 1) * state.rotation}deg`;
|
|
157
167
|
setTransform(endMove, type, time, deg);
|
|
158
|
-
state.currIndex = Math.abs(Math.round(endMove /
|
|
168
|
+
state.currIndex = Math.abs(Math.round(endMove / props.lineSpacing)) + 1;
|
|
159
169
|
} else {
|
|
160
170
|
let deg = 0;
|
|
161
|
-
let currentDeg = (-updateMove /
|
|
171
|
+
let currentDeg = (-updateMove / props.lineSpacing + 1) * state.rotation;
|
|
162
172
|
const maxDeg = (props.column.length + 1) * state.rotation;
|
|
163
173
|
const minDeg = 0;
|
|
164
174
|
deg = Math.min(Math.max(currentDeg, minDeg), maxDeg);
|
|
165
175
|
if (minDeg < deg && deg < maxDeg) {
|
|
166
176
|
setTransform(updateMove, null, void 0, deg + "deg");
|
|
167
|
-
state.currIndex = Math.abs(Math.round(updateMove /
|
|
177
|
+
state.currIndex = Math.abs(Math.round(updateMove / props.lineSpacing)) + 1;
|
|
168
178
|
}
|
|
169
179
|
}
|
|
170
180
|
};
|
|
@@ -175,7 +185,7 @@ const _sfc_main$1 = create$1({
|
|
|
175
185
|
const { column: column2 } = props;
|
|
176
186
|
let index = column2.findIndex((columnItem) => columnItem.value == props.value);
|
|
177
187
|
state.currIndex = index === -1 ? 1 : index + 1;
|
|
178
|
-
let move = index === -1 ? 0 : index *
|
|
188
|
+
let move = index === -1 ? 0 : index * props.lineSpacing;
|
|
179
189
|
type && setChooseValue();
|
|
180
190
|
setMove(-move);
|
|
181
191
|
};
|
|
@@ -214,36 +224,47 @@ const _sfc_main$1 = create$1({
|
|
|
214
224
|
deep: true
|
|
215
225
|
}
|
|
216
226
|
);
|
|
227
|
+
watch(
|
|
228
|
+
() => props.lineSpacing,
|
|
229
|
+
(val) => {
|
|
230
|
+
console.log("\u66F4\u65B0");
|
|
231
|
+
modifyStatus(false);
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
deep: true
|
|
235
|
+
}
|
|
236
|
+
);
|
|
217
237
|
onMounted(() => {
|
|
218
|
-
modifyStatus(
|
|
238
|
+
modifyStatus(false);
|
|
219
239
|
});
|
|
240
|
+
const refRandomId = Math.random().toString(36).slice(-8);
|
|
220
241
|
return {
|
|
221
242
|
...toRefs(state),
|
|
222
243
|
...toRefs(props),
|
|
223
244
|
wrapper,
|
|
245
|
+
itemref,
|
|
224
246
|
setRollerStyle,
|
|
225
247
|
isHidden,
|
|
226
248
|
roller,
|
|
227
249
|
list,
|
|
250
|
+
listitem,
|
|
228
251
|
onTouchStart,
|
|
229
252
|
onTouchMove,
|
|
230
253
|
onTouchEnd,
|
|
231
|
-
touchRollerStyle,
|
|
232
254
|
touchTileStyle,
|
|
255
|
+
touchRollerStyle,
|
|
233
256
|
setMove,
|
|
257
|
+
refRandomId,
|
|
234
258
|
stopMomentum
|
|
235
259
|
};
|
|
236
260
|
}
|
|
237
261
|
});
|
|
238
|
-
const _hoisted_1$1 =
|
|
262
|
+
const _hoisted_1$1 = ["id"];
|
|
263
|
+
const _hoisted_2$1 = {
|
|
239
264
|
key: 1,
|
|
240
265
|
class: "nut-picker-roller-item-tile"
|
|
241
266
|
};
|
|
242
|
-
const
|
|
243
|
-
const _hoisted_3$1 = {
|
|
244
|
-
key: 0,
|
|
245
|
-
class: "nut-picker-content"
|
|
246
|
-
};
|
|
267
|
+
const _hoisted_3$1 = /* @__PURE__ */ createElementVNode("view", { class: "nut-picker-roller-mask" }, null, -1);
|
|
247
268
|
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
248
269
|
return openBlock(), createElementBlock("view", {
|
|
249
270
|
class: "nut-picker__list",
|
|
@@ -254,6 +275,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
254
275
|
createElementVNode("view", {
|
|
255
276
|
class: "nut-picker-roller",
|
|
256
277
|
ref: "roller",
|
|
278
|
+
id: "roller" + _ctx.refRandomId,
|
|
257
279
|
style: normalizeStyle(_ctx.threeDimensional ? _ctx.touchRollerStyle : _ctx.touchTileStyle),
|
|
258
280
|
onTransitionend: _cache[0] || (_cache[0] = (...args) => _ctx.stopMomentum && _ctx.stopMomentum(...args))
|
|
259
281
|
}, [
|
|
@@ -266,26 +288,20 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
266
288
|
class: normalizeClass(["nut-picker-roller-item", { "nut-picker-roller-item-hidden": _ctx.isHidden(index + 1) }]),
|
|
267
289
|
style: normalizeStyle(_ctx.setRollerStyle(index + 1))
|
|
268
290
|
}, toDisplayString(item.text), 7)) : createCommentVNode("", true),
|
|
269
|
-
|
|
291
|
+
createTextVNode(),
|
|
292
|
+
item && item.text && !_ctx.threeDimensional ? (openBlock(), createElementBlock("view", _hoisted_2$1, toDisplayString(item.text), 1)) : createCommentVNode("", true)
|
|
270
293
|
], 64);
|
|
271
294
|
}), 128))
|
|
272
|
-
],
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
createElementVNode("view", {
|
|
276
|
-
class: "nut-picker-list-panel",
|
|
277
|
-
ref: "list",
|
|
278
|
-
style: normalizeStyle(_ctx.touchTileStyle)
|
|
279
|
-
}, null, 4)
|
|
280
|
-
])) : createCommentVNode("", true)
|
|
295
|
+
], 44, _hoisted_1$1),
|
|
296
|
+
createTextVNode(),
|
|
297
|
+
_hoisted_3$1
|
|
281
298
|
], 32);
|
|
282
299
|
}
|
|
283
300
|
var column = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
|
|
284
301
|
const { componentName, create, translate } = createComponent("picker");
|
|
285
302
|
const _sfc_main = create({
|
|
286
303
|
components: {
|
|
287
|
-
[column.name]: column
|
|
288
|
-
[Popup.name]: Popup
|
|
304
|
+
[column.name]: column
|
|
289
305
|
},
|
|
290
306
|
props: {
|
|
291
307
|
...popupProps,
|
|
@@ -328,9 +344,15 @@ const _sfc_main = create({
|
|
|
328
344
|
setup(props, { emit }) {
|
|
329
345
|
const state = reactive({
|
|
330
346
|
show: false,
|
|
331
|
-
formattedColumns: props.columns
|
|
347
|
+
formattedColumns: props.columns,
|
|
348
|
+
lineSpacing: 36,
|
|
349
|
+
picking: false,
|
|
350
|
+
ENV: Taro.getEnv(),
|
|
351
|
+
ENV_TYPE: Taro.ENV_TYPE
|
|
332
352
|
});
|
|
353
|
+
const pickerline = ref(null);
|
|
333
354
|
let defaultValues = ref(props.modelValue);
|
|
355
|
+
let defaultIndexes = ref([]);
|
|
334
356
|
const pickerColumn = ref([]);
|
|
335
357
|
const swipeRef = (el) => {
|
|
336
358
|
if (el && pickerColumn.value.length < columnsList.value.length) {
|
|
@@ -345,11 +367,13 @@ const _sfc_main = create({
|
|
|
345
367
|
});
|
|
346
368
|
const selectedOptions = computed(() => {
|
|
347
369
|
let optins = [];
|
|
348
|
-
columnsList.value.map(
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
370
|
+
columnsList.value.map(
|
|
371
|
+
(column2, index) => {
|
|
372
|
+
let currOptions = [];
|
|
373
|
+
currOptions = column2.filter((item) => item.value == defaultValues.value[index]);
|
|
374
|
+
optins.push(currOptions[0]);
|
|
375
|
+
}
|
|
376
|
+
);
|
|
353
377
|
return optins;
|
|
354
378
|
});
|
|
355
379
|
const columnsType = computed(() => {
|
|
@@ -425,25 +449,83 @@ const _sfc_main = create({
|
|
|
425
449
|
});
|
|
426
450
|
}
|
|
427
451
|
};
|
|
428
|
-
const
|
|
429
|
-
|
|
430
|
-
|
|
452
|
+
const defaultValuesConvert = computed(() => {
|
|
453
|
+
let defaultIndexs = [];
|
|
454
|
+
if (defaultValues.value.length > 0) {
|
|
455
|
+
defaultValues.value.forEach((value, index) => {
|
|
456
|
+
for (let i = 0; i < columnsList.value[index].length; i++) {
|
|
457
|
+
if (columnsList.value[index][i].value == value) {
|
|
458
|
+
defaultIndexs.push(i);
|
|
459
|
+
break;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
return defaultIndexs;
|
|
465
|
+
});
|
|
466
|
+
const tileChange = ({ detail }) => {
|
|
467
|
+
console.log("\u9009\u62E9");
|
|
468
|
+
const prevDefaultValue = defaultIndexes.value;
|
|
469
|
+
let changeIndex = 0;
|
|
470
|
+
detail.value.forEach((col, index) => {
|
|
471
|
+
if (prevDefaultValue[index] != col)
|
|
472
|
+
changeIndex = index;
|
|
431
473
|
});
|
|
474
|
+
if (state.show) {
|
|
475
|
+
defaultIndexes.value = detail.value;
|
|
476
|
+
changeHandler(changeIndex, columnsList.value[changeIndex][detail.value[changeIndex]]);
|
|
477
|
+
}
|
|
478
|
+
};
|
|
479
|
+
const confirmHandler = () => {
|
|
480
|
+
if (state.picking) {
|
|
481
|
+
console.log("\u6EDA\u52A8\u4E2D");
|
|
482
|
+
setTimeout(() => {
|
|
483
|
+
confirmHandlerAwit();
|
|
484
|
+
}, 0);
|
|
485
|
+
} else {
|
|
486
|
+
confirmHandlerAwit();
|
|
487
|
+
}
|
|
488
|
+
};
|
|
489
|
+
const confirmHandlerAwit = () => {
|
|
432
490
|
if (defaultValues.value && !defaultValues.value.length) {
|
|
433
491
|
columnsList.value.forEach((columns) => {
|
|
434
492
|
defaultValues.value.push(columns[0].value);
|
|
435
493
|
selectedOptions.value.push(columns[0]);
|
|
436
494
|
});
|
|
437
495
|
}
|
|
496
|
+
console.log("\u786E\u5B9A", defaultValues.value);
|
|
438
497
|
emit("confirm", {
|
|
439
498
|
selectedValue: defaultValues.value,
|
|
440
499
|
selectedOptions: selectedOptions.value
|
|
441
500
|
});
|
|
442
501
|
emit("update:visible", false);
|
|
502
|
+
state.show = false;
|
|
503
|
+
};
|
|
504
|
+
const handlePickstart = () => {
|
|
505
|
+
console.log("\u5F00\u59CB\u6EDA\u52A8");
|
|
506
|
+
state.picking = true;
|
|
507
|
+
};
|
|
508
|
+
const handlePickend = () => {
|
|
509
|
+
console.log("\u6EDA\u52A8\u7ED3\u675F");
|
|
510
|
+
state.picking = false;
|
|
511
|
+
};
|
|
512
|
+
const refRandomId = Math.random().toString(36).slice(-8);
|
|
513
|
+
const getReference = async () => {
|
|
514
|
+
const refe = await useTaroRect(pickerline, Taro);
|
|
515
|
+
console.log(refe.height);
|
|
516
|
+
state.lineSpacing = refe.height ? refe.height : 36;
|
|
443
517
|
};
|
|
444
518
|
onMounted(() => {
|
|
445
|
-
if (props.visible)
|
|
519
|
+
if (props.visible) {
|
|
520
|
+
if (Taro.getEnv() == Taro.ENV_TYPE.WEB) {
|
|
521
|
+
setTimeout(() => {
|
|
522
|
+
getReference();
|
|
523
|
+
}, 200);
|
|
524
|
+
} else {
|
|
525
|
+
defaultIndexes.value = defaultValuesConvert.value;
|
|
526
|
+
}
|
|
446
527
|
state.show = props.visible;
|
|
528
|
+
}
|
|
447
529
|
});
|
|
448
530
|
onBeforeUnmount(() => {
|
|
449
531
|
if (props.visible)
|
|
@@ -455,6 +537,7 @@ const _sfc_main = create({
|
|
|
455
537
|
const isSameValue = JSON.stringify(newValues) === JSON.stringify(defaultValues.value);
|
|
456
538
|
if (!isSameValue) {
|
|
457
539
|
defaultValues.value = newValues;
|
|
540
|
+
defaultIndexes.value = defaultValuesConvert.value;
|
|
458
541
|
}
|
|
459
542
|
},
|
|
460
543
|
{ deep: true }
|
|
@@ -473,8 +556,16 @@ const _sfc_main = create({
|
|
|
473
556
|
() => props.visible,
|
|
474
557
|
(val) => {
|
|
475
558
|
state.show = val;
|
|
476
|
-
if (val)
|
|
477
|
-
|
|
559
|
+
if (val) {
|
|
560
|
+
if (Taro.getEnv() == Taro.ENV_TYPE.WEB) {
|
|
561
|
+
setTimeout(() => {
|
|
562
|
+
getReference();
|
|
563
|
+
}, 200);
|
|
564
|
+
pickerColumn.value = [];
|
|
565
|
+
} else {
|
|
566
|
+
defaultIndexes.value = defaultValuesConvert.value;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
478
569
|
}
|
|
479
570
|
);
|
|
480
571
|
watch(
|
|
@@ -494,19 +585,27 @@ const _sfc_main = create({
|
|
|
494
585
|
changeHandler,
|
|
495
586
|
confirmHandler,
|
|
496
587
|
defaultValues,
|
|
588
|
+
defaultIndexes,
|
|
497
589
|
translate,
|
|
498
590
|
pickerColumn,
|
|
499
|
-
swipeRef
|
|
591
|
+
swipeRef,
|
|
592
|
+
refRandomId,
|
|
593
|
+
pickerline,
|
|
594
|
+
tileChange,
|
|
595
|
+
defaultValuesConvert,
|
|
596
|
+
handlePickstart,
|
|
597
|
+
handlePickend
|
|
500
598
|
};
|
|
501
599
|
}
|
|
502
600
|
});
|
|
503
601
|
const _hoisted_1 = { class: "nut-picker__bar" };
|
|
504
602
|
const _hoisted_2 = { class: "nut-picker__title" };
|
|
505
|
-
const _hoisted_3 =
|
|
506
|
-
|
|
507
|
-
|
|
603
|
+
const _hoisted_3 = ["value"];
|
|
604
|
+
const _hoisted_4 = {
|
|
605
|
+
key: 1,
|
|
606
|
+
class: "nut-picker__column"
|
|
508
607
|
};
|
|
509
|
-
const
|
|
608
|
+
const _hoisted_5 = ["id"];
|
|
510
609
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
511
610
|
const _component_nut_picker_column = resolveComponent("nut-picker-column");
|
|
512
611
|
const _component_nut_popup = resolveComponent("nut-popup");
|
|
@@ -516,13 +615,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
516
615
|
createVNode(_component_nut_popup, {
|
|
517
616
|
position: "bottom",
|
|
518
617
|
visible: _ctx.show,
|
|
519
|
-
"onUpdate:visible": _cache[
|
|
618
|
+
"onUpdate:visible": _cache[5] || (_cache[5] = ($event) => _ctx.show = $event),
|
|
520
619
|
teleport: _ctx.teleport,
|
|
521
620
|
"lock-scroll": _ctx.lockScroll,
|
|
522
621
|
"close-on-click-overlay": _ctx.closeOnClickOverlay,
|
|
523
622
|
onClose: _ctx.close,
|
|
524
623
|
round: true,
|
|
525
|
-
isWrapTeleport: _ctx.isWrapTeleport,
|
|
526
624
|
safeAreaInsetBottom: _ctx.safeAreaInsetBottom,
|
|
527
625
|
destroyOnClose: _ctx.destroyOnClose
|
|
528
626
|
}, {
|
|
@@ -532,15 +630,46 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
532
630
|
class: "nut-picker__cancel nut-picker__left nut-picker__button",
|
|
533
631
|
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.close && _ctx.close(...args))
|
|
534
632
|
}, toDisplayString(_ctx.cancelText || _ctx.translate("cancel")), 1),
|
|
633
|
+
createTextVNode(),
|
|
535
634
|
createElementVNode("view", _hoisted_2, toDisplayString(_ctx.title), 1),
|
|
635
|
+
createTextVNode(),
|
|
536
636
|
createElementVNode("view", {
|
|
537
637
|
class: "nut-picker__confirm nut-picker__right nut-picker__button",
|
|
538
638
|
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.confirmHandler())
|
|
539
639
|
}, toDisplayString(_ctx.okText || _ctx.translate("confirm")), 1)
|
|
540
640
|
]),
|
|
641
|
+
createTextVNode(),
|
|
541
642
|
renderSlot(_ctx.$slots, "top"),
|
|
542
|
-
|
|
543
|
-
|
|
643
|
+
createTextVNode(),
|
|
644
|
+
_ctx.ENV == _ctx.ENV_TYPE.WEAPP ? (openBlock(), createElementBlock("picker-view", {
|
|
645
|
+
key: 0,
|
|
646
|
+
"indicator-style": "height: 34px;",
|
|
647
|
+
value: _ctx.defaultIndexes,
|
|
648
|
+
style: { "width": "100%", "height": "252px" },
|
|
649
|
+
"immediate-change": true,
|
|
650
|
+
onChange: _cache[2] || (_cache[2] = (...args) => _ctx.tileChange && _ctx.tileChange(...args)),
|
|
651
|
+
onPickstart: _cache[3] || (_cache[3] = (...args) => _ctx.handlePickstart && _ctx.handlePickstart(...args)),
|
|
652
|
+
onPickend: _cache[4] || (_cache[4] = (...args) => _ctx.handlePickend && _ctx.handlePickend(...args))
|
|
653
|
+
}, [
|
|
654
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.columnsList, (column2, columnIndex) => {
|
|
655
|
+
return openBlock(), createElementBlock("picker-view-column", { key: columnIndex }, [
|
|
656
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(column2, (item, index) => {
|
|
657
|
+
return openBlock(), createElementBlock("view", {
|
|
658
|
+
class: "nut-picker-roller-item-tarotile",
|
|
659
|
+
key: item.value ? item.value : index
|
|
660
|
+
}, toDisplayString(item.text), 1);
|
|
661
|
+
}), 128))
|
|
662
|
+
]);
|
|
663
|
+
}), 128))
|
|
664
|
+
], 40, _hoisted_3)) : createCommentVNode("", true),
|
|
665
|
+
createTextVNode(),
|
|
666
|
+
_ctx.ENV == _ctx.ENV_TYPE.WEB ? (openBlock(), createElementBlock("view", _hoisted_4, [
|
|
667
|
+
createElementVNode("view", {
|
|
668
|
+
class: "nut-picker__hairline",
|
|
669
|
+
ref: "pickerline",
|
|
670
|
+
id: "pickerline" + _ctx.refRandomId
|
|
671
|
+
}, null, 8, _hoisted_5),
|
|
672
|
+
createTextVNode(),
|
|
544
673
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.columnsList, (column2, columnIndex) => {
|
|
545
674
|
return openBlock(), createElementBlock("view", {
|
|
546
675
|
class: "nut-picker__columnitem",
|
|
@@ -554,20 +683,22 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
554
683
|
readonly: _ctx.readonly,
|
|
555
684
|
columnsType: _ctx.columnsType,
|
|
556
685
|
value: _ctx.defaultValues[columnIndex],
|
|
557
|
-
threeDimensional:
|
|
686
|
+
threeDimensional: false,
|
|
558
687
|
swipeDuration: _ctx.swipeDuration,
|
|
688
|
+
lineSpacing: _ctx.lineSpacing,
|
|
559
689
|
onChange: (option) => {
|
|
560
690
|
_ctx.changeHandler(columnIndex, option);
|
|
561
691
|
}
|
|
562
|
-
}, null, 8, ["itemShow", "column", "readonly", "columnsType", "value", "
|
|
692
|
+
}, null, 8, ["itemShow", "column", "readonly", "columnsType", "value", "swipeDuration", "lineSpacing", "onChange"])
|
|
563
693
|
]);
|
|
564
694
|
}), 128))
|
|
565
|
-
],
|
|
695
|
+
])) : createCommentVNode("", true),
|
|
696
|
+
createTextVNode(),
|
|
566
697
|
renderSlot(_ctx.$slots, "default")
|
|
567
698
|
]),
|
|
568
699
|
_: 3
|
|
569
|
-
}, 8, ["visible", "teleport", "lock-scroll", "close-on-click-overlay", "onClose", "
|
|
700
|
+
}, 8, ["visible", "teleport", "lock-scroll", "close-on-click-overlay", "onClose", "safeAreaInsetBottom", "destroyOnClose"])
|
|
570
701
|
], 2);
|
|
571
702
|
}
|
|
572
|
-
var
|
|
573
|
-
export {
|
|
703
|
+
var nutPicker = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
704
|
+
export { nutPicker as default };
|