@nutui/nutui 3.1.22-beta.0 → 3.1.22
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 +48 -0
- package/README.md +3 -4
- package/dist/nutui.es.js +4203 -19263
- package/dist/nutui.umd.js +4208 -19368
- package/dist/packages/_es/ActionSheet.js +17 -167
- package/dist/packages/_es/Address.js +110 -552
- package/dist/packages/_es/AddressList.js +113 -613
- package/dist/packages/_es/Animate.js +22 -0
- package/dist/packages/_es/Audio.js +53 -274
- package/dist/packages/_es/AudioOperate.js +13 -121
- package/dist/packages/_es/Avatar.js +38 -177
- package/dist/packages/_es/AvatarGroup.js +14 -73
- package/dist/packages/_es/BackTop.js +43 -156
- package/dist/packages/_es/Badge.js +14 -86
- package/dist/packages/_es/Barrage.js +41 -120
- package/dist/packages/_es/Button.js +23 -128
- package/dist/packages/_es/Calendar.js +30 -237
- package/dist/packages/_es/CalendarItem.js +2 -1
- package/dist/packages/_es/Card.js +10 -107
- package/dist/packages/_es/Cascader.js +147 -523
- package/dist/packages/_es/Category.js +15 -58
- package/dist/packages/_es/CategoryPane.js +11 -111
- package/dist/packages/_es/Cell.js +21 -100
- package/dist/packages/_es/CellGroup.js +9 -44
- package/dist/packages/_es/Checkbox.js +31 -113
- package/dist/packages/_es/CheckboxGroup.js +29 -58
- package/dist/packages/_es/CircleProgress.js +28 -151
- package/dist/packages/_es/Col.js +14 -56
- package/dist/packages/_es/Collapse.js +32 -84
- package/dist/packages/_es/CollapseItem.js +59 -272
- package/dist/packages/_es/Comment.js +64 -434
- package/dist/packages/_es/ConfigProvider.js +13 -0
- package/dist/packages/_es/CountDown.js +56 -256
- package/dist/packages/_es/CountUp.js +140 -556
- package/dist/packages/_es/DatePicker.js +98 -332
- package/dist/packages/_es/Dialog.js +60 -271
- package/dist/packages/_es/Divider.js +13 -82
- package/dist/packages/_es/Drag.js +56 -197
- package/dist/packages/_es/Ecard.js +24 -159
- package/dist/packages/_es/Elevator.js +58 -212
- package/dist/packages/_es/Ellipsis.js +64 -0
- package/dist/packages/_es/Empty.js +12 -71
- package/dist/packages/_es/FixedNav.js +15 -122
- package/dist/packages/_es/Form.js +64 -151
- package/dist/packages/_es/FormItem.js +15 -110
- package/dist/packages/_es/Grid.js +5 -6
- package/dist/packages/_es/GridItem.js +33 -144
- package/dist/packages/_es/Icon.js +15 -40
- package/dist/packages/_es/Image.js +31 -0
- package/dist/packages/_es/ImagePreview.js +77 -309
- package/dist/packages/_es/Indicator.js +15 -62
- package/dist/packages/_es/InfiniteLoading.js +57 -268
- package/dist/packages/_es/Input.js +51 -413
- package/dist/packages/_es/InputNumber.js +41 -160
- package/dist/packages/_es/Layout.js +4 -5
- package/dist/packages/_es/List.js +18 -124
- package/dist/packages/_es/Menu.js +45 -118
- package/dist/packages/_es/MenuItem.js +37 -162
- package/dist/packages/_es/Navbar.js +30 -192
- package/dist/packages/_es/NoticeBar.js +74 -397
- package/dist/packages/_es/Notify.js +72 -246
- package/dist/packages/_es/NumberKeyboard.js +41 -272
- package/dist/packages/_es/OldPicker.js +131 -474
- package/dist/packages/_es/OverLay.js +24 -113
- package/dist/packages/_es/Pagination.js +39 -157
- package/dist/packages/_es/Picker.js +129 -469
- package/dist/packages/_es/Popover.js +318 -975
- package/dist/packages/_es/Popup.js +55 -313
- package/dist/packages/_es/Price.js +16 -118
- package/dist/packages/_es/Progress.js +14 -146
- package/dist/packages/_es/PullRefresh.js +84 -354
- package/dist/packages/_es/Radio.js +22 -90
- package/dist/packages/_es/RadioGroup.js +8 -37
- package/dist/packages/_es/Range.js +83 -427
- package/dist/packages/_es/Rate.js +35 -137
- package/dist/packages/_es/Row.js +22 -64
- package/dist/packages/_es/SearchBar.js +37 -257
- package/dist/packages/_es/ShortPassword.js +35 -225
- package/dist/packages/_es/SideNavBar.js +24 -99
- package/dist/packages/_es/SideNavBarItem.js +11 -46
- package/dist/packages/_es/Signature.js +41 -179
- package/dist/packages/_es/Skeleton.js +20 -136
- package/dist/packages/_es/Sku.js +84 -509
- package/dist/packages/_es/Step.js +20 -133
- package/dist/packages/_es/Steps.js +18 -53
- package/dist/packages/_es/Sticky.js +53 -138
- package/dist/packages/_es/SubSideNavBar.js +17 -100
- package/dist/packages/_es/Swipe.js +41 -197
- package/dist/packages/_es/Swiper.js +121 -433
- package/dist/packages/_es/SwiperItem.js +22 -53
- package/dist/packages/_es/Switch.js +21 -116
- package/dist/packages/_es/TabPane.js +12 -39
- package/dist/packages/_es/Tabbar.js +17 -72
- package/dist/packages/_es/TabbarItem.js +29 -151
- package/dist/packages/_es/Table.js +18 -196
- package/dist/packages/_es/Tabs.js +43 -217
- package/dist/packages/_es/Tag.js +20 -97
- package/dist/packages/_es/TextArea.js +42 -160
- package/dist/packages/_es/TimeDetail.js +18 -98
- package/dist/packages/_es/TimePannel.js +14 -66
- package/dist/packages/_es/TimeSelect.js +15 -103
- package/dist/packages/_es/Toast.js +71 -329
- package/dist/packages/_es/Uploader.js +104 -468
- package/dist/packages/_es/Video.js +74 -350
- package/dist/packages/_es/common.js +38 -128
- package/dist/packages/_es/component.js +35 -76
- package/dist/packages/_es/index.js +5 -6
- package/dist/packages/_es/index2.js +9 -30
- package/dist/packages/_es/index3.js +6 -8
- package/dist/packages/_es/index4.js +13 -58
- package/dist/packages/_es/index5.js +164 -682
- package/dist/packages/_es/plugin-vue_export-helper.js +7 -8
- package/dist/packages/_es/pxCheck.js +3 -5
- package/dist/packages/_es/raf.js +8 -15
- package/dist/packages/animate/index.scss +299 -0
- package/dist/packages/button/index.scss +2 -1
- package/dist/packages/cell/index.scss +18 -1
- package/dist/packages/checkbox/index.scss +16 -0
- package/dist/packages/configprovider/index.scss +2 -0
- package/dist/packages/dialog/index.scss +1 -0
- package/dist/packages/elevator/index.scss +21 -0
- package/dist/packages/ellipsis/index.scss +12 -0
- package/dist/packages/formitem/index.scss +12 -0
- package/dist/packages/griditem/index.scss +11 -0
- package/dist/packages/image/index.scss +39 -0
- package/dist/packages/imagepreview/index.scss +21 -2
- package/dist/packages/input/index.scss +26 -1
- package/dist/packages/inputnumber/index.scss +21 -0
- package/dist/packages/locale/lang/baseLang.d.ts +1 -0
- package/dist/packages/locale/lang/baseLang.js +3 -3
- package/dist/packages/locale/lang/en-US.d.ts +8 -0
- package/dist/packages/locale/lang/en-US.js +5 -97
- package/dist/packages/locale/lang/id-ID.d.ts +8 -0
- package/dist/packages/locale/lang/id-ID.js +5 -97
- package/dist/packages/locale/lang/index.js +16 -38
- package/dist/packages/locale/lang/zh-CN.d.ts +8 -0
- package/dist/packages/locale/lang/zh-CN.js +5 -97
- package/dist/packages/locale/lang/zh-TW.d.ts +8 -0
- package/dist/packages/locale/lang/zh-TW.js +5 -97
- package/dist/packages/menu/index.scss +45 -36
- package/dist/packages/menuitem/index.scss +4 -0
- package/dist/packages/navbar/index.scss +9 -0
- package/dist/packages/pagination/index.scss +19 -0
- package/dist/packages/radio/index.scss +19 -0
- package/dist/packages/range/index.scss +19 -0
- package/dist/packages/rate/index.scss +1 -1
- package/dist/packages/searchbar/index.scss +21 -0
- package/dist/packages/switch/index.scss +4 -3
- package/dist/packages/tabbar/index.scss +5 -0
- package/dist/packages/tabbaritem/index.scss +7 -0
- package/dist/packages/tabpane/index.scss +6 -0
- package/dist/packages/tabs/index.scss +22 -0
- package/dist/packages/textarea/index.scss +8 -0
- package/dist/smartips/attributes.json +192 -12
- package/dist/smartips/tags.json +70 -10
- package/dist/smartips/web-types.json +6945 -0
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/font/config.json +3 -1
- package/dist/styles/font/demo_index.html +49 -3
- package/dist/styles/font/iconfont.css +11 -3
- package/dist/styles/font/iconfont.js +15 -15
- package/dist/styles/font/iconfont.json +14 -0
- package/dist/styles/font/iconfont.ttf +0 -0
- package/dist/styles/font/iconfont.woff +0 -0
- package/dist/styles/font/iconfont.woff2 +0 -0
- package/dist/styles/themes/default.scss +54 -50
- package/dist/styles/themes/jdb.scss +54 -50
- package/dist/styles/themes/jdt.scss +54 -50
- package/dist/styles/variables-jdb.scss +22 -1
- package/dist/styles/variables-jdt.scss +22 -1
- package/dist/styles/variables.scss +22 -1
- package/dist/types/__VUE/actionsheet/index.vue.d.ts +2 -2
- package/dist/types/__VUE/address/index.vue.d.ts +4 -4
- package/dist/types/__VUE/addresslist/components/ItemContents.vue.d.ts +1 -0
- package/dist/types/__VUE/animate/index.vue.d.ts +48 -0
- package/dist/types/__VUE/animate/type.d.ts +6 -0
- package/dist/types/__VUE/audiooperate/index.vue.d.ts +1 -0
- package/dist/types/__VUE/avatar/index.vue.d.ts +5 -5
- package/dist/types/__VUE/avatargroup/index.vue.d.ts +2 -2
- package/dist/types/__VUE/badge/index.vue.d.ts +4 -4
- package/dist/types/__VUE/button/index.vue.d.ts +6 -6
- package/dist/types/__VUE/calendaritem/index.vue.d.ts +10 -2
- package/dist/types/__VUE/cascader/index.vue.d.ts +3 -3
- package/dist/types/__VUE/cell/index.vue.d.ts +11 -4
- package/dist/types/__VUE/checkbox/common.d.ts +59 -0
- package/dist/types/__VUE/checkbox/index.vue.d.ts +20 -7
- package/dist/types/__VUE/checkboxgroup/index.vue.d.ts +7 -0
- package/dist/types/__VUE/circleprogress/index.vue.d.ts +2 -2
- package/dist/types/__VUE/collapse/index.vue.d.ts +3 -1
- package/dist/types/__VUE/comment/index.vue.d.ts +2 -2
- package/dist/types/__VUE/configprovider/common.d.ts +20 -0
- package/dist/types/__VUE/configprovider/index.vue.d.ts +33 -0
- package/dist/types/__VUE/datepicker/index.vue.d.ts +2 -2
- package/dist/types/__VUE/dialog/index.d.ts +9 -2
- package/dist/types/__VUE/dialog/index.vue.d.ts +25 -10
- package/dist/types/__VUE/ecard/index.vue.d.ts +3 -3
- package/dist/types/__VUE/elevator/index.vue.d.ts +29 -0
- package/dist/types/__VUE/ellipsis/index.vue.d.ts +72 -0
- package/dist/types/__VUE/empty/index.vue.d.ts +2 -2
- package/dist/types/__VUE/fixednav/index.vue.d.ts +2 -2
- package/dist/types/__VUE/formitem/index.vue.d.ts +3 -10
- package/dist/types/__VUE/grid/index.vue.d.ts +4 -4
- package/dist/types/__VUE/griditem/index.vue.d.ts +1 -1
- package/dist/types/__VUE/image/index.vue.d.ts +105 -0
- package/dist/types/__VUE/image/type.d.ts +6 -0
- package/dist/types/__VUE/imagepreview/index.vue.d.ts +36 -2
- package/dist/types/__VUE/input/index.vue.d.ts +6 -6
- package/dist/types/__VUE/inputnumber/index.vue.d.ts +2 -2
- package/dist/types/__VUE/menu/index.vue.d.ts +29 -2
- package/dist/types/__VUE/menuitem/index.vue.d.ts +12 -3
- package/dist/types/__VUE/noticebar/index.vue.d.ts +3 -3
- package/dist/types/__VUE/notify/index.vue.d.ts +2 -2
- package/dist/types/__VUE/oldpicker/index.vue.d.ts +2 -2
- package/dist/types/__VUE/picker/Column.vue.d.ts +1 -1
- package/dist/types/__VUE/picker/index.vue.d.ts +3 -3
- package/dist/types/__VUE/popover/index.vue.d.ts +6 -6
- package/dist/types/__VUE/popup/index.vue.d.ts +2 -2
- package/dist/types/__VUE/radio/index.vue.d.ts +4 -4
- package/dist/types/__VUE/range/index.vue.d.ts +4 -4
- package/dist/types/__VUE/rate/common.d.ts +149 -0
- package/dist/types/__VUE/rate/index.vue.d.ts +15 -5
- package/dist/types/__VUE/skeleton/index.vue.d.ts +4 -4
- package/dist/types/__VUE/sku/index.vue.d.ts +2 -2
- package/dist/types/__VUE/step/index.vue.d.ts +2 -2
- package/dist/types/__VUE/sticky/index.vue.d.ts +4 -4
- package/dist/types/__VUE/swiper/index.vue.d.ts +4 -4
- package/dist/types/__VUE/tabbar/index.vue.d.ts +2 -2
- package/dist/types/__VUE/tag/index.vue.d.ts +2 -2
- package/dist/types/__VUE/timeselect/index.vue.d.ts +10 -2
- package/dist/types/__VUE/toast/index.vue.d.ts +5 -5
- package/dist/types/__VUE/uploader/index.vue.d.ts +6 -6
- package/dist/types/__VUE/uploader/uploader.d.ts +1 -0
- package/dist/types/__VUE/video/index.vue.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/nutui.d.ts +5 -1
- package/package.json +6 -3
|
@@ -1,204 +1,63 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.22
|
|
2
|
+
* @nutui/nutui v3.1.22 Fri Jun 24 2022 18:11:16 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";
|
|
7
|
-
import { c as
|
|
8
|
-
import { r as
|
|
9
|
-
import { _ as
|
|
6
|
+
import { ref as t, reactive as e, computed as o, onMounted as n, onActivated as r, onDeactivated as s, openBlock as i, createElementBlock as l, normalizeClass as u, renderSlot as c } from "vue";
|
|
7
|
+
import { c as a } from "./component.js";
|
|
8
|
+
import { r as p } from "./raf.js";
|
|
9
|
+
import { _ as y } from "./plugin-vue_export-helper.js";
|
|
10
10
|
import "../locale/lang";
|
|
11
|
-
const { componentName, create } =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
setup(props, { emit }) {
|
|
35
|
-
const myDrag = ref();
|
|
36
|
-
const state = reactive({
|
|
37
|
-
keepAlive: false,
|
|
38
|
-
elWidth: 0,
|
|
39
|
-
elHeight: 0,
|
|
40
|
-
screenWidth: 0,
|
|
41
|
-
screenHeight: 0,
|
|
42
|
-
startTop: 0,
|
|
43
|
-
startLeft: 0,
|
|
44
|
-
nx: 0,
|
|
45
|
-
ny: 0,
|
|
46
|
-
xPum: 0,
|
|
47
|
-
yPum: 0,
|
|
48
|
-
position: { x: 0, y: 0 },
|
|
49
|
-
boundary: {
|
|
50
|
-
top: 0,
|
|
51
|
-
left: 0,
|
|
52
|
-
right: 0,
|
|
53
|
-
bottom: 0
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
const classes = computed(() => {
|
|
57
|
-
const prefixCls = componentName;
|
|
58
|
-
return {
|
|
59
|
-
[prefixCls]: true
|
|
60
|
-
};
|
|
61
|
-
});
|
|
62
|
-
function getInfo() {
|
|
63
|
-
const domElem = document.documentElement;
|
|
64
|
-
state.elWidth = myDrag.value.offsetWidth;
|
|
65
|
-
state.elHeight = myDrag.value.offsetHeight;
|
|
66
|
-
state.screenWidth = domElem.clientWidth || 375;
|
|
67
|
-
state.screenHeight = domElem.clientHeight || 667;
|
|
68
|
-
}
|
|
69
|
-
function goLeft(target) {
|
|
70
|
-
if (state.boundary.left) {
|
|
71
|
-
if (+target.style.left.split("px")[0] > state.boundary.left) {
|
|
72
|
-
target.style.left = +target.style.left.split("px")[0] - 10 + "px";
|
|
73
|
-
requestAniFrame(() => {
|
|
74
|
-
goLeft(target);
|
|
75
|
-
});
|
|
76
|
-
} else {
|
|
77
|
-
target.style.left = `${state.boundary.left}px`;
|
|
78
|
-
}
|
|
79
|
-
} else {
|
|
80
|
-
if (+target.style.left.split("px")[0] > 10) {
|
|
81
|
-
target.style.left = +target.style.left.split("px")[0] - 10 + "px";
|
|
82
|
-
requestAniFrame(() => {
|
|
83
|
-
goLeft(target);
|
|
84
|
-
});
|
|
85
|
-
} else {
|
|
86
|
-
target.style.left = "0px";
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
function goRight(target, rightLocation) {
|
|
91
|
-
if (rightLocation - parseInt(target.style.left.split("px")[0]) > 10) {
|
|
92
|
-
target.style.left = parseInt(target.style.left.split("px")[0]) + 10 + "px";
|
|
93
|
-
requestAniFrame(() => {
|
|
94
|
-
goRight(target, rightLocation);
|
|
95
|
-
});
|
|
96
|
-
} else {
|
|
97
|
-
target.style.left = rightLocation + "px";
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
function touchMove(e) {
|
|
101
|
-
e.preventDefault();
|
|
102
|
-
const target = e.currentTarget;
|
|
103
|
-
if (e.targetTouches.length === 1) {
|
|
104
|
-
const touch = e.targetTouches[0];
|
|
105
|
-
state.nx = touch.clientX - state.position.x;
|
|
106
|
-
state.ny = touch.clientY - state.position.y;
|
|
107
|
-
state.xPum = state.startLeft + state.nx;
|
|
108
|
-
state.yPum = state.startTop + state.ny;
|
|
109
|
-
const rightLocation = state.screenWidth - state.elWidth - state.boundary.right;
|
|
110
|
-
if (Math.abs(state.xPum) > rightLocation) {
|
|
111
|
-
state.xPum = rightLocation;
|
|
112
|
-
} else if (state.xPum <= state.boundary.left) {
|
|
113
|
-
state.xPum = state.boundary.left;
|
|
114
|
-
}
|
|
115
|
-
if (state.yPum < state.boundary.top) {
|
|
116
|
-
state.yPum = state.boundary.top;
|
|
117
|
-
} else if (state.yPum > state.screenHeight - state.elHeight - state.boundary.bottom) {
|
|
118
|
-
state.yPum = state.screenHeight - state.elHeight - state.boundary.bottom;
|
|
119
|
-
}
|
|
120
|
-
if (props.direction != "y") {
|
|
121
|
-
target.style.left = state.xPum + "px";
|
|
122
|
-
}
|
|
123
|
-
if (props.direction != "x") {
|
|
124
|
-
target.style.top = state.yPum + "px";
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
function touchEnd(e) {
|
|
129
|
-
const target = e.currentTarget;
|
|
130
|
-
const touch = e.changedTouches[0];
|
|
131
|
-
let currX = touch.clientX;
|
|
132
|
-
const rightLocation = state.screenWidth - state.elWidth - state.boundary.right;
|
|
133
|
-
if (currX > rightLocation) {
|
|
134
|
-
currX = rightLocation;
|
|
135
|
-
} else if (currX < state.boundary.left) {
|
|
136
|
-
currX = state.boundary.left;
|
|
137
|
-
} else {
|
|
138
|
-
currX = currX < state.screenWidth / 2 ? state.boundary.left : rightLocation;
|
|
139
|
-
}
|
|
140
|
-
if (props.direction != "y" && props.attract) {
|
|
141
|
-
if (currX < state.screenWidth / 2) {
|
|
142
|
-
requestAniFrame(() => {
|
|
143
|
-
goLeft(target);
|
|
144
|
-
});
|
|
145
|
-
} else {
|
|
146
|
-
requestAniFrame(() => {
|
|
147
|
-
goRight(target, rightLocation);
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
if (props.direction != "x") {
|
|
152
|
-
target.style.top = state.yPum + "px";
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
function touchStart(e) {
|
|
156
|
-
const target = e.currentTarget;
|
|
157
|
-
const touches = e.touches[0];
|
|
158
|
-
const touch = e.targetTouches[0];
|
|
159
|
-
state.startTop = target.offsetTop;
|
|
160
|
-
state.startLeft = target.offsetLeft;
|
|
161
|
-
state.position.x = touches.clientX;
|
|
162
|
-
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;
|
|
11
|
+
const { componentName: f, create: d } = a("drag");
|
|
12
|
+
var h = y(d({ props: { attract: { type: Boolean, default: false }, direction: { type: String, default: "all" }, boundary: { type: Object, default: () => ({ top: 0, left: 0, right: 0, bottom: 0 }) } }, setup(i2, { emit: l2 }) {
|
|
13
|
+
const u2 = t(), c2 = e({ keepAlive: false, elWidth: 0, elHeight: 0, screenWidth: 0, screenHeight: 0, startTop: 0, startLeft: 0, nx: 0, ny: 0, xPum: 0, yPum: 0, position: { x: 0, y: 0 }, boundary: { top: 0, left: 0, right: 0, bottom: 0 } }), a2 = o(() => ({ [f]: true }));
|
|
14
|
+
function y2(t2) {
|
|
15
|
+
c2.boundary.left ? +t2.style.left.split("px")[0] > c2.boundary.left ? (t2.style.left = +t2.style.left.split("px")[0] - 10 + "px", p(() => {
|
|
16
|
+
y2(t2);
|
|
17
|
+
})) : t2.style.left = `${c2.boundary.left}px` : +t2.style.left.split("px")[0] > 10 ? (t2.style.left = +t2.style.left.split("px")[0] - 10 + "px", p(() => {
|
|
18
|
+
y2(t2);
|
|
19
|
+
})) : t2.style.left = "0px";
|
|
20
|
+
}
|
|
21
|
+
function d2(t2, e2) {
|
|
22
|
+
e2 - parseInt(t2.style.left.split("px")[0]) > 10 ? (t2.style.left = parseInt(t2.style.left.split("px")[0]) + 10 + "px", p(() => {
|
|
23
|
+
d2(t2, e2);
|
|
24
|
+
})) : t2.style.left = e2 + "px";
|
|
25
|
+
}
|
|
26
|
+
function h2(t2) {
|
|
27
|
+
t2.preventDefault();
|
|
28
|
+
const e2 = t2.currentTarget;
|
|
29
|
+
if (t2.targetTouches.length === 1) {
|
|
30
|
+
const o2 = t2.targetTouches[0];
|
|
31
|
+
c2.nx = o2.clientX - c2.position.x, c2.ny = o2.clientY - c2.position.y, c2.xPum = c2.startLeft + c2.nx, c2.yPum = c2.startTop + c2.ny;
|
|
32
|
+
const n2 = c2.screenWidth - c2.elWidth - c2.boundary.right;
|
|
33
|
+
Math.abs(c2.xPum) > n2 ? c2.xPum = n2 : c2.xPum <= c2.boundary.left && (c2.xPum = c2.boundary.left), c2.yPum < c2.boundary.top ? c2.yPum = c2.boundary.top : c2.yPum > c2.screenHeight - c2.elHeight - c2.boundary.bottom && (c2.yPum = c2.screenHeight - c2.elHeight - c2.boundary.bottom), i2.direction != "y" && (e2.style.left = c2.xPum + "px"), i2.direction != "x" && (e2.style.top = c2.yPum + "px");
|
|
167
34
|
}
|
|
168
|
-
onMounted(() => {
|
|
169
|
-
getInfo();
|
|
170
|
-
state.boundary = props.boundary;
|
|
171
|
-
});
|
|
172
|
-
onActivated(() => {
|
|
173
|
-
if (state.keepAlive) {
|
|
174
|
-
state.keepAlive = false;
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
onDeactivated(() => {
|
|
178
|
-
state.keepAlive = true;
|
|
179
|
-
myDrag.removeEventListener("touchstart", touchStart);
|
|
180
|
-
myDrag.removeEventListener("touchmove", touchMove);
|
|
181
|
-
myDrag.removeEventListener("touchend", touchEnd);
|
|
182
|
-
});
|
|
183
|
-
return {
|
|
184
|
-
classes,
|
|
185
|
-
myDrag,
|
|
186
|
-
touchStart,
|
|
187
|
-
touchMove,
|
|
188
|
-
touchEnd
|
|
189
|
-
};
|
|
190
35
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
36
|
+
function m(t2) {
|
|
37
|
+
const e2 = t2.currentTarget;
|
|
38
|
+
let o2 = t2.changedTouches[0].clientX;
|
|
39
|
+
const n2 = c2.screenWidth - c2.elWidth - c2.boundary.right;
|
|
40
|
+
o2 = o2 > n2 ? n2 : o2 < c2.boundary.left || o2 < c2.screenWidth / 2 ? c2.boundary.left : n2, i2.direction != "y" && i2.attract && (o2 < c2.screenWidth / 2 ? p(() => {
|
|
41
|
+
y2(e2);
|
|
42
|
+
}) : p(() => {
|
|
43
|
+
d2(e2, n2);
|
|
44
|
+
})), i2.direction != "x" && (e2.style.top = c2.yPum + "px");
|
|
45
|
+
}
|
|
46
|
+
function x(t2) {
|
|
47
|
+
const e2 = t2.currentTarget, o2 = t2.touches[0], n2 = t2.targetTouches[0];
|
|
48
|
+
c2.startTop = e2.offsetTop, c2.startLeft = e2.offsetLeft, c2.position.x = o2.clientX, c2.position.y = o2.clientY, c2.nx = n2.clientX - c2.position.x, c2.ny = n2.clientY - c2.position.y, c2.xPum = c2.startLeft + c2.nx, c2.yPum = c2.startTop + c2.ny;
|
|
49
|
+
}
|
|
50
|
+
return n(() => {
|
|
51
|
+
!function() {
|
|
52
|
+
const t2 = document.documentElement;
|
|
53
|
+
c2.elWidth = u2.value.offsetWidth, c2.elHeight = u2.value.offsetHeight, c2.screenWidth = t2.clientWidth || 375, c2.screenHeight = t2.clientHeight || 667;
|
|
54
|
+
}(), c2.boundary = i2.boundary;
|
|
55
|
+
}), r(() => {
|
|
56
|
+
c2.keepAlive && (c2.keepAlive = false);
|
|
57
|
+
}), s(() => {
|
|
58
|
+
c2.keepAlive = true, u2.removeEventListener("touchstart", x), u2.removeEventListener("touchmove", h2), u2.removeEventListener("touchend", m);
|
|
59
|
+
}), { classes: a2, myDrag: u2, touchStart: x, touchMove: h2, touchEnd: m };
|
|
60
|
+
} }), [["render", function(t2, e2, o2, n2, r2, s2) {
|
|
61
|
+
return i(), l("view", { class: u(t2.classes), ref: "myDrag", onTouchstart: e2[0] || (e2[0] = (e3) => t2.touchStart(e3)), onTouchmove: e2[1] || (e2[1] = (e3) => t2.touchMove(e3)), onTouchend: e2[2] || (e2[2] = (e3) => t2.touchEnd(e3)) }, [c(t2.$slots, "default")], 34);
|
|
62
|
+
}]]);
|
|
63
|
+
export { h as default };
|
|
@@ -1,164 +1,29 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.22
|
|
2
|
+
* @nutui/nutui v3.1.22 Fri Jun 24 2022 18:11:16 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { ref, watch, resolveComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, Fragment, renderList, normalizeClass, withDirectives, vModelText, createTextVNode, createVNode } from "vue";
|
|
7
|
-
import { c as
|
|
8
|
-
import { _ as
|
|
6
|
+
import { ref as e, watch as a, resolveComponent as t, openBlock as u, createElementBlock as l, createElementVNode as n, toDisplayString as r, Fragment as c, renderList as i, normalizeClass as d, withDirectives as o, vModelText as p, createTextVNode as m, createVNode as s } from "vue";
|
|
7
|
+
import { c as v } from "./component.js";
|
|
8
|
+
import { _ as h } from "./plugin-vue_export-helper.js";
|
|
9
9
|
import "../locale/lang";
|
|
10
|
-
const { componentName, create, translate } =
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
cardAmountMax: {
|
|
32
|
-
type: Number,
|
|
33
|
-
default: 9999
|
|
34
|
-
},
|
|
35
|
-
cardBuyMin: {
|
|
36
|
-
type: Number,
|
|
37
|
-
default: 1
|
|
38
|
-
},
|
|
39
|
-
cardBuyMax: {
|
|
40
|
-
type: Number,
|
|
41
|
-
default: 9999
|
|
42
|
-
},
|
|
43
|
-
modelValue: {
|
|
44
|
-
type: Number,
|
|
45
|
-
default: 0
|
|
46
|
-
},
|
|
47
|
-
placeholder: {
|
|
48
|
-
type: String,
|
|
49
|
-
default: ""
|
|
50
|
-
},
|
|
51
|
-
suffix: {
|
|
52
|
-
type: String,
|
|
53
|
-
default: "\xA5"
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
emits: ["inputChange", "changeStep", "inputClick", "change", "update:modelValue"],
|
|
57
|
-
setup(props, { emit }) {
|
|
58
|
-
const currentIndex = ref(null);
|
|
59
|
-
const currentValue = ref(null);
|
|
60
|
-
const inputValue = ref();
|
|
61
|
-
const stepValue = ref(props.cardAmountMin);
|
|
62
|
-
const money = ref(props.modelValue);
|
|
63
|
-
const handleClick = (item, index2) => {
|
|
64
|
-
currentIndex.value = index2;
|
|
65
|
-
inputValue.value = "";
|
|
66
|
-
stepValue.value = props.cardAmountMin;
|
|
67
|
-
currentValue.value = item.price;
|
|
68
|
-
emit("change", item);
|
|
69
|
-
emit("update:modelValue", item.price);
|
|
70
|
-
};
|
|
71
|
-
const change = (event) => {
|
|
72
|
-
let input = event.target;
|
|
73
|
-
let val = input.value.replace(/[^\d]/g, "");
|
|
74
|
-
inputValue.value = val;
|
|
75
|
-
currentValue.value = val;
|
|
76
|
-
if (Number(val) > props.cardAmountMax) {
|
|
77
|
-
inputValue.value = props.cardAmountMax;
|
|
78
|
-
currentValue.value = props.cardAmountMax;
|
|
79
|
-
}
|
|
80
|
-
if (Number(val) < props.cardAmountMin) {
|
|
81
|
-
inputValue.value = props.cardAmountMin;
|
|
82
|
-
currentValue.value = props.cardAmountMin;
|
|
83
|
-
}
|
|
84
|
-
emit("inputChange", Number(inputValue.value));
|
|
85
|
-
emit("update:modelValue", Number(inputValue.value));
|
|
86
|
-
};
|
|
87
|
-
const inputClick = () => {
|
|
88
|
-
currentIndex.value = "input";
|
|
89
|
-
stepValue.value = props.cardAmountMin;
|
|
90
|
-
emit("update:modelValue", 0);
|
|
91
|
-
emit("inputClick");
|
|
92
|
-
};
|
|
93
|
-
const changeStep = (value) => {
|
|
94
|
-
stepValue.value = value;
|
|
95
|
-
emit("changeStep", stepValue.value, currentValue.value);
|
|
96
|
-
};
|
|
97
|
-
watch(() => props.modelValue, (value) => {
|
|
98
|
-
money.value = value;
|
|
99
|
-
});
|
|
100
|
-
return {
|
|
101
|
-
handleClick,
|
|
102
|
-
changeStep,
|
|
103
|
-
change,
|
|
104
|
-
inputClick,
|
|
105
|
-
stepValue,
|
|
106
|
-
currentIndex,
|
|
107
|
-
inputValue,
|
|
108
|
-
money,
|
|
109
|
-
translate
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
const _hoisted_1 = { class: "nut-ecard" };
|
|
114
|
-
const _hoisted_2 = { class: "nut-ecard__title" };
|
|
115
|
-
const _hoisted_3 = { class: "nut-ecard__list" };
|
|
116
|
-
const _hoisted_4 = ["onClick"];
|
|
117
|
-
const _hoisted_5 = { class: "nut-ecard__list__input--con" };
|
|
118
|
-
const _hoisted_6 = ["placeholder"];
|
|
119
|
-
const _hoisted_7 = { class: "nut-ecard__list__step" };
|
|
120
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
121
|
-
const _component_nut_inputnumber = resolveComponent("nut-inputnumber");
|
|
122
|
-
return openBlock(), createElementBlock("view", _hoisted_1, [
|
|
123
|
-
createElementVNode("view", _hoisted_2, toDisplayString(_ctx.chooseText || _ctx.translate("chooseText")), 1),
|
|
124
|
-
createElementVNode("view", _hoisted_3, [
|
|
125
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.dataList, (item, index2) => {
|
|
126
|
-
return openBlock(), createElementBlock("view", {
|
|
127
|
-
key: index2,
|
|
128
|
-
class: normalizeClass(["nut-ecard__list__item", _ctx.currentIndex == index2 ? "active" : ""]),
|
|
129
|
-
onClick: ($event) => _ctx.handleClick(item, index2)
|
|
130
|
-
}, toDisplayString(item.price), 11, _hoisted_4);
|
|
131
|
-
}), 128)),
|
|
132
|
-
createElementVNode("view", {
|
|
133
|
-
class: normalizeClass(["nut-ecard__list__input", _ctx.currentIndex == "input" ? "active" : ""]),
|
|
134
|
-
onClick: _cache[2] || (_cache[2] = (...args) => _ctx.inputClick && _ctx.inputClick(...args))
|
|
135
|
-
}, [
|
|
136
|
-
createElementVNode("view", null, toDisplayString(_ctx.otherValueText || _ctx.translate("otherValueText")), 1),
|
|
137
|
-
createElementVNode("view", _hoisted_5, [
|
|
138
|
-
withDirectives(createElementVNode("input", {
|
|
139
|
-
class: "nut-ecard__list__input--input",
|
|
140
|
-
type: "text",
|
|
141
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.inputValue = $event),
|
|
142
|
-
onInput: _cache[1] || (_cache[1] = (...args) => _ctx.change && _ctx.change(...args)),
|
|
143
|
-
placeholder: _ctx.placeholder || _ctx.translate("placeholder")
|
|
144
|
-
}, null, 40, _hoisted_6), [
|
|
145
|
-
[vModelText, _ctx.inputValue]
|
|
146
|
-
]),
|
|
147
|
-
createTextVNode(" " + toDisplayString(_ctx.suffix), 1)
|
|
148
|
-
])
|
|
149
|
-
], 2),
|
|
150
|
-
createElementVNode("view", _hoisted_7, [
|
|
151
|
-
createElementVNode("view", null, toDisplayString(_ctx.suffix) + toDisplayString(_ctx.money), 1),
|
|
152
|
-
createVNode(_component_nut_inputnumber, {
|
|
153
|
-
modelValue: _ctx.stepValue,
|
|
154
|
-
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => _ctx.stepValue = $event),
|
|
155
|
-
min: _ctx.cardBuyMin,
|
|
156
|
-
max: _ctx.cardBuyMax,
|
|
157
|
-
onChange: _ctx.changeStep
|
|
158
|
-
}, null, 8, ["modelValue", "min", "max", "onChange"])
|
|
159
|
-
])
|
|
160
|
-
])
|
|
161
|
-
]);
|
|
162
|
-
}
|
|
163
|
-
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
164
|
-
export { index as default };
|
|
10
|
+
const { componentName: _, create: x, translate: g } = v("ecard"), f = x({ props: { chooseText: { type: String, default: "" }, otherValueText: { type: String, default: "" }, dataList: { type: [Object, Array], default: () => [] }, cardAmountMin: { type: Number, default: 1 }, cardAmountMax: { type: Number, default: 9999 }, cardBuyMin: { type: Number, default: 1 }, cardBuyMax: { type: Number, default: 9999 }, modelValue: { type: [Number, String], default: 0 }, placeholder: { type: String, default: "" }, suffix: { type: String, default: "\xA5" } }, emits: ["inputChange", "changeStep", "inputClick", "change", "update:modelValue"], setup(t2, { emit: u2 }) {
|
|
11
|
+
const l2 = e(null), n2 = e(null), r2 = e(""), c2 = e(t2.cardAmountMin), i2 = e(t2.modelValue);
|
|
12
|
+
return a(() => t2.modelValue, (e2) => {
|
|
13
|
+
i2.value = e2;
|
|
14
|
+
}), { handleClick: (e2, a2) => {
|
|
15
|
+
l2.value = a2, c2.value = t2.cardAmountMin, n2.value = e2.price, u2("change", e2), u2("update:modelValue", e2.price);
|
|
16
|
+
}, changeStep: (e2) => {
|
|
17
|
+
c2.value = e2, u2("changeStep", c2.value, n2.value);
|
|
18
|
+
}, change: (e2) => {
|
|
19
|
+
let a2 = e2.target.value.replace(/[^\d]/g, "");
|
|
20
|
+
r2.value = a2, n2.value = a2, Number(a2) > t2.cardAmountMax && (r2.value = t2.cardAmountMax, n2.value = t2.cardAmountMax), Number(a2) < t2.cardAmountMin && (r2.value = t2.cardAmountMin, n2.value = t2.cardAmountMin), u2("inputChange", Number(r2.value)), u2("update:modelValue", Number(r2.value));
|
|
21
|
+
}, inputClick: () => {
|
|
22
|
+
l2.value = "input", c2.value = t2.cardAmountMin, n2.value = r2.value, u2("update:modelValue", r2.value), u2("inputClick");
|
|
23
|
+
}, stepValue: c2, currentIndex: l2, inputValue: r2, money: i2, translate: g };
|
|
24
|
+
} }), V = { class: "nut-ecard" }, y = { class: "nut-ecard__title" }, M = { class: "nut-ecard__list" }, C = ["onClick"], A = { class: "nut-ecard__list__input--con" }, b = ["placeholder"], k = { class: "nut-ecard__list__step" };
|
|
25
|
+
var N = h(f, [["render", function(e2, a2, v2, h2, _2, x2) {
|
|
26
|
+
const g2 = t("nut-inputnumber");
|
|
27
|
+
return u(), l("view", V, [n("view", y, r(e2.chooseText || e2.translate("chooseText")), 1), n("view", M, [(u(true), l(c, null, i(e2.dataList, (a3, t2) => (u(), l("view", { key: t2, class: d(["nut-ecard__list__item", e2.currentIndex == t2 ? "active" : ""]), onClick: (u2) => e2.handleClick(a3, t2) }, r(a3.price), 11, C))), 128)), n("view", { class: d(["nut-ecard__list__input", e2.currentIndex == "input" ? "active" : ""]), onClick: a2[2] || (a2[2] = (...a3) => e2.inputClick && e2.inputClick(...a3)) }, [n("view", null, r(e2.otherValueText || e2.translate("otherValueText")), 1), n("view", A, [o(n("input", { class: "nut-ecard__list__input--input", type: "text", "onUpdate:modelValue": a2[0] || (a2[0] = (a3) => e2.inputValue = a3), onInput: a2[1] || (a2[1] = (...a3) => e2.change && e2.change(...a3)), placeholder: e2.placeholder || e2.translate("placeholder") }, null, 40, b), [[p, e2.inputValue]]), m(" " + r(e2.suffix), 1)])], 2), n("view", k, [n("view", null, r(e2.suffix) + r(e2.money), 1), s(g2, { modelValue: e2.stepValue, "onUpdate:modelValue": a2[3] || (a2[3] = (a3) => e2.stepValue = a3), min: e2.cardBuyMin, max: e2.cardBuyMax, onChange: e2.changeStep }, null, 8, ["modelValue", "min", "max", "onChange"])])])]);
|
|
28
|
+
}]]);
|
|
29
|
+
export { N as default };
|