@nutui/nutui 4.0.11 → 4.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nutui.es.js +1 -1
- package/dist/nutui.js +2 -2
- package/dist/nutui.umd.js +1 -1
- package/dist/packages/_es/ActionSheet.js +111 -78
- package/dist/packages/_es/Address.js +375 -250
- package/dist/packages/_es/AddressList.js +354 -269
- package/dist/packages/_es/Animate.js +58 -41
- package/dist/packages/_es/Audio.js +197 -128
- package/dist/packages/_es/AudioOperate.js +71 -60
- package/dist/packages/_es/Avatar.js +89 -66
- package/dist/packages/_es/AvatarGroup.js +31 -23
- package/dist/packages/_es/Backtop.js +99 -59
- package/dist/packages/_es/Badge.js +47 -36
- package/dist/packages/_es/Barrage.js +147 -68
- package/dist/packages/_es/Button.js +66 -47
- package/dist/packages/_es/Calendar.js +157 -135
- package/dist/packages/_es/CalendarItem.js +6 -6
- package/dist/packages/_es/Card.js +56 -42
- package/dist/packages/_es/Cascader.js +474 -315
- package/dist/packages/_es/Category.js +39 -29
- package/dist/packages/_es/CategoryPane.js +83 -57
- package/dist/packages/_es/Cell.js +71 -56
- package/dist/packages/_es/CellGroup.js +27 -19
- package/dist/packages/_es/Checkbox.js +156 -109
- package/dist/packages/_es/CheckboxGroup.js +59 -38
- package/dist/packages/_es/CircleProgress.js +96 -67
- package/dist/packages/_es/Col.js +31 -23
- package/dist/packages/_es/Collapse.js +58 -33
- package/dist/packages/_es/CollapseItem.js +108 -78
- package/dist/packages/_es/Comment.js +279 -207
- package/dist/packages/_es/ConfigProvider.js +55 -37
- package/dist/packages/_es/Countdown.js +212 -100
- package/dist/packages/_es/Countup.js +445 -232
- package/dist/packages/_es/DatePicker.js +265 -162
- package/dist/packages/_es/Dialog.js +213 -161
- package/dist/packages/_es/Divider.js +57 -42
- package/dist/packages/_es/Drag.js +153 -70
- package/dist/packages/_es/Ecard.js +104 -64
- package/dist/packages/_es/Elevator.js +219 -143
- package/dist/packages/_es/Ellipsis.js +178 -95
- package/dist/packages/_es/Empty.js +39 -23
- package/dist/packages/_es/FixedNav.js +116 -93
- package/dist/packages/_es/Form.js +178 -107
- package/dist/packages/_es/FormItem.js +61 -48
- package/dist/packages/_es/Grid.js +6 -5
- package/dist/packages/_es/GridItem.js +84 -58
- package/dist/packages/_es/Image.js +130 -90
- package/dist/packages/_es/ImagePreview.js +412 -256
- package/dist/packages/_es/Indicator.js +34 -30
- package/dist/packages/_es/InfiniteLoading.js +136 -83
- package/dist/packages/_es/Input.js +264 -160
- package/dist/packages/_es/InputNumber.js +117 -81
- package/dist/packages/_es/Interceptor-956b24fc.js +29 -0
- package/dist/packages/_es/Invoice.js +130 -104
- package/dist/packages/_es/Layout.js +4 -3
- package/dist/packages/_es/List.js +215 -117
- package/dist/packages/_es/Menu.js +150 -95
- package/dist/packages/_es/MenuItem.js +154 -109
- package/dist/packages/_es/Navbar.js +119 -103
- package/dist/packages/_es/Noticebar.js +312 -197
- package/dist/packages/_es/Notify.js +166 -110
- package/dist/packages/_es/NumberKeyboard.js +202 -127
- package/dist/packages/_es/Overlay.js +80 -52
- package/dist/packages/_es/Pagination.js +100 -70
- package/dist/packages/_es/Picker.js +437 -275
- package/dist/packages/_es/Popover.js +225 -122
- package/dist/packages/_es/Popup.js +4 -4
- package/dist/packages/_es/Price.js +82 -44
- package/dist/packages/_es/Progress.js +79 -63
- package/dist/packages/_es/PullRefresh.js +173 -95
- package/dist/packages/_es/Radio.js +4 -4
- package/dist/packages/_es/RadioGroup.js +3 -3
- package/dist/packages/_es/Range.js +347 -204
- package/dist/packages/_es/Rate.js +141 -92
- package/dist/packages/_es/Row.js +27 -21
- package/dist/packages/_es/Searchbar.js +174 -123
- package/dist/packages/_es/ShortPassword.js +93 -69
- package/dist/packages/_es/SideNavbar.js +80 -49
- package/dist/packages/_es/SideNavbarItem.js +32 -22
- package/dist/packages/_es/Signature.js +146 -83
- package/dist/packages/_es/Skeleton.js +130 -110
- package/dist/packages/_es/Sku.js +343 -250
- package/dist/packages/_es/Step.js +86 -59
- package/dist/packages/_es/Steps.js +31 -26
- package/dist/packages/_es/Sticky.js +4 -4
- package/dist/packages/_es/SubSideNavbar.js +74 -52
- package/dist/packages/_es/Swipe.js +155 -83
- package/dist/packages/_es/Swiper.js +311 -174
- package/dist/packages/_es/SwiperItem.js +44 -28
- package/dist/packages/_es/Switch.js +68 -55
- package/dist/packages/_es/TabPane.js +41 -30
- package/dist/packages/_es/Tabbar.js +52 -41
- package/dist/packages/_es/TabbarItem.js +82 -61
- package/dist/packages/_es/Table.js +165 -109
- package/dist/packages/_es/Tabs.js +388 -240
- package/dist/packages/_es/Tag.js +61 -44
- package/dist/packages/_es/Textarea.js +124 -80
- package/dist/packages/_es/TimeDetail.js +76 -49
- package/dist/packages/_es/TimePannel.js +48 -34
- package/dist/packages/_es/TimeSelect.js +68 -47
- package/dist/packages/_es/Toast.js +218 -144
- package/dist/packages/_es/Tour.js +192 -138
- package/dist/packages/_es/TrendArrow.js +77 -57
- package/dist/packages/_es/Uploader.js +359 -234
- package/dist/packages/_es/Video.js +316 -191
- package/dist/packages/_es/Watermark.js +117 -84
- package/dist/packages/_es/_plugin-vue_export-helper-cc2b3d55.js +10 -0
- package/dist/packages/_es/common-b9a5e726.js +145 -0
- package/dist/packages/_es/component-81a4c1d0.js +145 -0
- package/dist/packages/_es/index-29892cda.js +33 -0
- package/dist/packages/_es/index-43c34ac6.js +30 -0
- package/dist/packages/_es/index-54d03fc1.js +8 -0
- package/dist/packages/_es/index-79c5dc33.js +10 -0
- package/dist/packages/_es/index-7a7385e4.js +67 -0
- package/dist/packages/_es/index-87422be8.js +942 -0
- package/dist/packages/_es/index-da0a7662.js +259 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-22dfc112.js +46 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-a8856969.js +97 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-cc5c4086.js +151 -0
- package/dist/packages/_es/mountComponent-8b24c346.js +39 -0
- package/dist/packages/_es/pxCheck-c6b9f6b7.js +6 -0
- package/dist/packages/_es/raf-729dad54.js +25 -0
- package/dist/packages/_es/renderIcon-3d0fd47c.js +9 -0
- package/dist/packages/locale/lang/baseLang-3a8457ac.js +5 -0
- package/dist/packages/locale/lang/en-US.js +39 -36
- package/dist/packages/locale/lang/id-ID.js +39 -36
- package/dist/packages/locale/lang/index.js +44 -22
- package/dist/packages/locale/lang/zh-CN.js +38 -35
- package/dist/packages/locale/lang/zh-TW.js +38 -35
- package/dist/resolver/index.js +26 -1
- package/dist/resolver/index.mjs +17 -14
- package/dist/smartips/web-types.json +1 -1
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +48 -48
- package/dist/styles/themes/jdb.scss +48 -48
- package/dist/styles/themes/jddkh.scss +48 -48
- package/dist/styles/themes/jdt.scss +48 -48
- package/dist/types/index.d.ts +1 -1
- package/package.json +3 -4
- package/dist/packages/_es/Interceptor-6e26b757.js +0 -18
- package/dist/packages/_es/_plugin-vue_export-helper-dad06003.js +0 -9
- package/dist/packages/_es/common-d218746f.js +0 -116
- package/dist/packages/_es/component-234624bc.js +0 -89
- package/dist/packages/_es/index-14dfadc4.js +0 -561
- package/dist/packages/_es/index-192a3ef6.js +0 -29
- package/dist/packages/_es/index-360c5092.js +0 -210
- package/dist/packages/_es/index-496e6e05.js +0 -24
- package/dist/packages/_es/index-50eed3d9.js +0 -7
- package/dist/packages/_es/index-53ec2d4d.js +0 -34
- package/dist/packages/_es/index-fadb0974.js +0 -8
- package/dist/packages/_es/index.vue_vue_type_script_lang-1139b29a.js +0 -43
- package/dist/packages/_es/index.vue_vue_type_script_lang-43b774dd.js +0 -77
- package/dist/packages/_es/index.vue_vue_type_script_lang-f44c159d.js +0 -110
- package/dist/packages/_es/mountComponent-6d4ff200.js +0 -23
- package/dist/packages/_es/pxCheck-38173291.js +0 -4
- package/dist/packages/_es/raf-a74f1a06.js +0 -16
- package/dist/packages/_es/renderIcon-47498b32.js +0 -5
- package/dist/packages/locale/lang/baseLang-0bdc6353.js +0 -5
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { ref
|
|
2
|
-
import { c as
|
|
3
|
-
import { r as
|
|
4
|
-
import { _ as
|
|
1
|
+
import { ref, reactive, computed, onMounted, onActivated, onDeactivated, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
|
|
2
|
+
import { c as createComponent } from "./component-81a4c1d0.js";
|
|
3
|
+
import { r as requestAniFrame } from "./raf-729dad54.js";
|
|
4
|
+
import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
|
|
5
5
|
import "../locale/lang";
|
|
6
|
-
const { componentName
|
|
6
|
+
const { componentName, create } = createComponent("drag");
|
|
7
|
+
const _sfc_main = create({
|
|
7
8
|
props: {
|
|
8
9
|
attract: {
|
|
9
10
|
type: Boolean,
|
|
10
|
-
default:
|
|
11
|
+
default: false
|
|
11
12
|
},
|
|
12
13
|
direction: {
|
|
13
14
|
type: String,
|
|
@@ -15,17 +16,20 @@ const { componentName: A, create: $ } = E("drag"), X = $({
|
|
|
15
16
|
},
|
|
16
17
|
boundary: {
|
|
17
18
|
type: Object,
|
|
18
|
-
default: () =>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
default: () => {
|
|
20
|
+
return {
|
|
21
|
+
top: 0,
|
|
22
|
+
left: 0,
|
|
23
|
+
right: 0,
|
|
24
|
+
bottom: 0
|
|
25
|
+
};
|
|
26
|
+
}
|
|
24
27
|
}
|
|
25
28
|
},
|
|
26
|
-
setup(
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
+
setup(props) {
|
|
30
|
+
const myDrag = ref();
|
|
31
|
+
const state = reactive({
|
|
32
|
+
keepAlive: false,
|
|
29
33
|
elWidth: 0,
|
|
30
34
|
elHeight: 0,
|
|
31
35
|
screenWidth: 0,
|
|
@@ -43,76 +47,155 @@ const { componentName: A, create: $ } = E("drag"), X = $({
|
|
|
43
47
|
right: 0,
|
|
44
48
|
bottom: 0
|
|
45
49
|
}
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
});
|
|
51
|
+
const classes = computed(() => {
|
|
52
|
+
const prefixCls = componentName;
|
|
53
|
+
return {
|
|
54
|
+
[prefixCls]: true
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
function getInfo() {
|
|
58
|
+
const domElem = document.documentElement;
|
|
59
|
+
state.elWidth = myDrag.value.offsetWidth;
|
|
60
|
+
state.elHeight = myDrag.value.offsetHeight;
|
|
61
|
+
state.screenWidth = domElem.clientWidth || 375;
|
|
62
|
+
state.screenHeight = domElem.clientHeight || 667;
|
|
52
63
|
}
|
|
53
|
-
function
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
64
|
+
function goLeft(target) {
|
|
65
|
+
if (state.boundary.left) {
|
|
66
|
+
if (+target.style.left.split("px")[0] > state.boundary.left) {
|
|
67
|
+
target.style.left = +target.style.left.split("px")[0] - 10 + "px";
|
|
68
|
+
requestAniFrame(() => {
|
|
69
|
+
goLeft(target);
|
|
70
|
+
});
|
|
71
|
+
} else {
|
|
72
|
+
target.style.left = `${state.boundary.left}px`;
|
|
73
|
+
}
|
|
74
|
+
} else {
|
|
75
|
+
if (+target.style.left.split("px")[0] > 10) {
|
|
76
|
+
target.style.left = +target.style.left.split("px")[0] - 10 + "px";
|
|
77
|
+
requestAniFrame(() => {
|
|
78
|
+
goLeft(target);
|
|
79
|
+
});
|
|
80
|
+
} else {
|
|
81
|
+
target.style.left = "0px";
|
|
82
|
+
}
|
|
83
|
+
}
|
|
59
84
|
}
|
|
60
|
-
function
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
85
|
+
function goRight(target, rightLocation) {
|
|
86
|
+
if (rightLocation - parseInt(target.style.left.split("px")[0]) > 10) {
|
|
87
|
+
target.style.left = parseInt(target.style.left.split("px")[0]) + 10 + "px";
|
|
88
|
+
requestAniFrame(() => {
|
|
89
|
+
goRight(target, rightLocation);
|
|
90
|
+
});
|
|
91
|
+
} else {
|
|
92
|
+
target.style.left = rightLocation + "px";
|
|
93
|
+
}
|
|
64
94
|
}
|
|
65
|
-
function
|
|
95
|
+
function touchMove(e) {
|
|
66
96
|
e.preventDefault();
|
|
67
|
-
const
|
|
97
|
+
const target = e.currentTarget;
|
|
68
98
|
if (e.targetTouches.length === 1) {
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
99
|
+
const touch = e.targetTouches[0];
|
|
100
|
+
state.nx = touch.clientX - state.position.x;
|
|
101
|
+
state.ny = touch.clientY - state.position.y;
|
|
102
|
+
state.xPum = state.startLeft + state.nx;
|
|
103
|
+
state.yPum = state.startTop + state.ny;
|
|
104
|
+
const rightLocation = state.screenWidth - state.elWidth - state.boundary.right;
|
|
105
|
+
if (Math.abs(state.xPum) > rightLocation) {
|
|
106
|
+
state.xPum = rightLocation;
|
|
107
|
+
} else if (state.xPum <= state.boundary.left) {
|
|
108
|
+
state.xPum = state.boundary.left;
|
|
109
|
+
}
|
|
110
|
+
if (state.yPum < state.boundary.top) {
|
|
111
|
+
state.yPum = state.boundary.top;
|
|
112
|
+
} else if (state.yPum > state.screenHeight - state.elHeight - state.boundary.bottom) {
|
|
113
|
+
state.yPum = state.screenHeight - state.elHeight - state.boundary.bottom;
|
|
114
|
+
}
|
|
115
|
+
if (props.direction != "y") {
|
|
116
|
+
target.style.left = state.xPum + "px";
|
|
117
|
+
}
|
|
118
|
+
if (props.direction != "x") {
|
|
119
|
+
target.style.top = state.yPum + "px";
|
|
120
|
+
}
|
|
73
121
|
}
|
|
74
122
|
}
|
|
75
|
-
function
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
123
|
+
function touchEnd(e) {
|
|
124
|
+
const target = e.currentTarget;
|
|
125
|
+
const touch = e.changedTouches[0];
|
|
126
|
+
let currX = touch.clientX;
|
|
127
|
+
const rightLocation = state.screenWidth - state.elWidth - state.boundary.right;
|
|
128
|
+
if (currX > rightLocation) {
|
|
129
|
+
currX = rightLocation;
|
|
130
|
+
} else if (currX < state.boundary.left) {
|
|
131
|
+
currX = state.boundary.left;
|
|
132
|
+
} else {
|
|
133
|
+
currX = currX < state.screenWidth / 2 ? state.boundary.left : rightLocation;
|
|
134
|
+
}
|
|
135
|
+
if (props.direction != "y" && props.attract) {
|
|
136
|
+
if (currX < state.screenWidth / 2) {
|
|
137
|
+
requestAniFrame(() => {
|
|
138
|
+
goLeft(target);
|
|
139
|
+
});
|
|
140
|
+
} else {
|
|
141
|
+
requestAniFrame(() => {
|
|
142
|
+
goRight(target, rightLocation);
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
if (props.direction != "x") {
|
|
147
|
+
target.style.top = state.yPum + "px";
|
|
148
|
+
}
|
|
84
149
|
}
|
|
85
|
-
function
|
|
86
|
-
const
|
|
87
|
-
|
|
150
|
+
function touchStart(e) {
|
|
151
|
+
const target = e.currentTarget;
|
|
152
|
+
const touches = e.touches[0];
|
|
153
|
+
const touch = e.targetTouches[0];
|
|
154
|
+
state.startTop = target.offsetTop;
|
|
155
|
+
state.startLeft = target.offsetLeft;
|
|
156
|
+
state.position.x = touches.clientX;
|
|
157
|
+
state.position.y = touches.clientY;
|
|
158
|
+
state.nx = touch.clientX - state.position.x;
|
|
159
|
+
state.ny = touch.clientY - state.position.y;
|
|
160
|
+
state.xPum = state.startLeft + state.nx;
|
|
161
|
+
state.yPum = state.startTop + state.ny;
|
|
88
162
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
163
|
+
onMounted(() => {
|
|
164
|
+
getInfo();
|
|
165
|
+
state.boundary = props.boundary;
|
|
166
|
+
});
|
|
167
|
+
onActivated(() => {
|
|
168
|
+
if (state.keepAlive) {
|
|
169
|
+
state.keepAlive = false;
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
onDeactivated(() => {
|
|
173
|
+
state.keepAlive = true;
|
|
174
|
+
myDrag.value.removeEventListener("touchstart", touchStart);
|
|
175
|
+
myDrag.value.removeEventListener("touchmove", touchMove);
|
|
176
|
+
myDrag.value.removeEventListener("touchend", touchEnd);
|
|
177
|
+
});
|
|
178
|
+
return {
|
|
179
|
+
classes,
|
|
180
|
+
myDrag,
|
|
181
|
+
touchStart,
|
|
182
|
+
touchMove,
|
|
183
|
+
touchEnd
|
|
101
184
|
};
|
|
102
185
|
}
|
|
103
186
|
});
|
|
104
|
-
function
|
|
105
|
-
return
|
|
106
|
-
class:
|
|
187
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
188
|
+
return openBlock(), createElementBlock("view", {
|
|
189
|
+
class: normalizeClass(_ctx.classes),
|
|
107
190
|
ref: "myDrag",
|
|
108
|
-
onTouchstart:
|
|
109
|
-
onTouchmove:
|
|
110
|
-
onTouchend:
|
|
191
|
+
onTouchstart: _cache[0] || (_cache[0] = ($event) => _ctx.touchStart($event)),
|
|
192
|
+
onTouchmove: _cache[1] || (_cache[1] = ($event) => _ctx.touchMove($event)),
|
|
193
|
+
onTouchend: _cache[2] || (_cache[2] = ($event) => _ctx.touchEnd($event))
|
|
111
194
|
}, [
|
|
112
|
-
|
|
195
|
+
renderSlot(_ctx.$slots, "default")
|
|
113
196
|
], 34);
|
|
114
197
|
}
|
|
115
|
-
const
|
|
198
|
+
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
116
199
|
export {
|
|
117
|
-
|
|
200
|
+
index as default
|
|
118
201
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { ref
|
|
2
|
-
import { c as
|
|
3
|
-
import
|
|
4
|
-
import { _ as
|
|
1
|
+
import { ref, watch, resolveComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, Fragment, renderList, normalizeClass, withDirectives, vModelText, createTextVNode, createVNode } from "vue";
|
|
2
|
+
import { c as createComponent } from "./component-81a4c1d0.js";
|
|
3
|
+
import InputNumber from "./InputNumber.js";
|
|
4
|
+
import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
|
|
5
5
|
import "../locale/lang";
|
|
6
|
-
import "./pxCheck-
|
|
6
|
+
import "./pxCheck-c6b9f6b7.js";
|
|
7
7
|
import "@nutui/icons-vue";
|
|
8
|
-
const { create
|
|
8
|
+
const { create, translate } = createComponent("ecard");
|
|
9
|
+
const _sfc_main = create({
|
|
9
10
|
components: {
|
|
10
|
-
[
|
|
11
|
+
[InputNumber.name]: InputNumber
|
|
11
12
|
},
|
|
12
13
|
props: {
|
|
13
14
|
chooseText: {
|
|
@@ -52,77 +53,116 @@ const { create: I, translate: $ } = T("ecard"), L = I({
|
|
|
52
53
|
}
|
|
53
54
|
},
|
|
54
55
|
emits: ["inputChange", "changeStep", "inputClick", "change", "update:modelValue"],
|
|
55
|
-
setup(
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
56
|
+
setup(props, { emit }) {
|
|
57
|
+
const currentIndex = ref(null);
|
|
58
|
+
const currentValue = ref(null);
|
|
59
|
+
const inputValue = ref("");
|
|
60
|
+
const stepValue = ref(props.cardAmountMin);
|
|
61
|
+
const money = ref(props.modelValue);
|
|
62
|
+
const handleClick = (item, index2) => {
|
|
63
|
+
currentIndex.value = index2;
|
|
64
|
+
stepValue.value = props.cardAmountMin;
|
|
65
|
+
currentValue.value = item.price;
|
|
66
|
+
emit("change", item);
|
|
67
|
+
emit("update:modelValue", item.price);
|
|
65
68
|
};
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
(
|
|
69
|
-
|
|
69
|
+
const change = (event) => {
|
|
70
|
+
let input = event.target;
|
|
71
|
+
let val = input.value.replace(/[^\d]/g, "");
|
|
72
|
+
inputValue.value = val;
|
|
73
|
+
currentValue.value = val;
|
|
74
|
+
if (Number(val) > props.cardAmountMax) {
|
|
75
|
+
inputValue.value = props.cardAmountMax;
|
|
76
|
+
currentValue.value = props.cardAmountMax;
|
|
70
77
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
if (Number(val) < props.cardAmountMin) {
|
|
79
|
+
inputValue.value = props.cardAmountMin;
|
|
80
|
+
currentValue.value = props.cardAmountMin;
|
|
81
|
+
}
|
|
82
|
+
emit("inputChange", Number(inputValue.value));
|
|
83
|
+
emit("update:modelValue", Number(inputValue.value));
|
|
84
|
+
};
|
|
85
|
+
const inputClick = () => {
|
|
86
|
+
currentIndex.value = "input";
|
|
87
|
+
stepValue.value = props.cardAmountMin;
|
|
88
|
+
currentValue.value = inputValue.value;
|
|
89
|
+
emit("update:modelValue", inputValue.value);
|
|
90
|
+
emit("inputClick");
|
|
91
|
+
};
|
|
92
|
+
const changeStep = (value) => {
|
|
93
|
+
stepValue.value = value;
|
|
94
|
+
emit("changeStep", stepValue.value, currentValue.value);
|
|
95
|
+
};
|
|
96
|
+
watch(
|
|
97
|
+
() => props.modelValue,
|
|
98
|
+
(value) => {
|
|
99
|
+
money.value = value;
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
return {
|
|
103
|
+
handleClick,
|
|
104
|
+
changeStep,
|
|
105
|
+
change,
|
|
106
|
+
inputClick,
|
|
107
|
+
stepValue,
|
|
108
|
+
currentIndex,
|
|
109
|
+
inputValue,
|
|
110
|
+
money,
|
|
111
|
+
translate
|
|
81
112
|
};
|
|
82
113
|
}
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
114
|
+
});
|
|
115
|
+
const _hoisted_1 = { class: "nut-ecard" };
|
|
116
|
+
const _hoisted_2 = { class: "nut-ecard__title" };
|
|
117
|
+
const _hoisted_3 = { class: "nut-ecard__list" };
|
|
118
|
+
const _hoisted_4 = ["onClick"];
|
|
119
|
+
const _hoisted_5 = { class: "nut-ecard__list__input--con" };
|
|
120
|
+
const _hoisted_6 = ["placeholder"];
|
|
121
|
+
const _hoisted_7 = { class: "nut-ecard__list__step" };
|
|
122
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
123
|
+
const _component_nut_input_number = resolveComponent("nut-input-number");
|
|
124
|
+
return openBlock(), createElementBlock("view", _hoisted_1, [
|
|
125
|
+
createElementVNode("view", _hoisted_2, toDisplayString(_ctx.chooseText || _ctx.translate("chooseText")), 1),
|
|
126
|
+
createElementVNode("view", _hoisted_3, [
|
|
127
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.dataList, (item, index2) => {
|
|
128
|
+
return openBlock(), createElementBlock("view", {
|
|
129
|
+
key: index2,
|
|
130
|
+
class: normalizeClass(["nut-ecard__list__item", _ctx.currentIndex == index2 ? "active" : ""]),
|
|
131
|
+
onClick: ($event) => _ctx.handleClick(item, index2)
|
|
132
|
+
}, toDisplayString(item.price), 11, _hoisted_4);
|
|
133
|
+
}), 128)),
|
|
134
|
+
createElementVNode("view", {
|
|
135
|
+
class: normalizeClass(["nut-ecard__list__input", _ctx.currentIndex == "input" ? "active" : ""]),
|
|
136
|
+
onClick: _cache[2] || (_cache[2] = (...args) => _ctx.inputClick && _ctx.inputClick(...args))
|
|
97
137
|
}, [
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
138
|
+
createElementVNode("view", null, toDisplayString(_ctx.otherValueText || _ctx.translate("otherValueText")), 1),
|
|
139
|
+
createElementVNode("view", _hoisted_5, [
|
|
140
|
+
withDirectives(createElementVNode("input", {
|
|
101
141
|
class: "nut-ecard__list__input--input",
|
|
102
142
|
type: "text",
|
|
103
|
-
"onUpdate:modelValue":
|
|
104
|
-
onInput:
|
|
105
|
-
placeholder:
|
|
106
|
-
}, null, 40,
|
|
107
|
-
[
|
|
143
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.inputValue = $event),
|
|
144
|
+
onInput: _cache[1] || (_cache[1] = (...args) => _ctx.change && _ctx.change(...args)),
|
|
145
|
+
placeholder: _ctx.placeholder || _ctx.translate("placeholder")
|
|
146
|
+
}, null, 40, _hoisted_6), [
|
|
147
|
+
[vModelText, _ctx.inputValue]
|
|
108
148
|
]),
|
|
109
|
-
|
|
149
|
+
createTextVNode(" " + toDisplayString(_ctx.suffix), 1)
|
|
110
150
|
])
|
|
111
151
|
], 2),
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
modelValue:
|
|
116
|
-
"onUpdate:modelValue":
|
|
117
|
-
min:
|
|
118
|
-
max:
|
|
119
|
-
onChange:
|
|
152
|
+
createElementVNode("view", _hoisted_7, [
|
|
153
|
+
createElementVNode("view", null, toDisplayString(_ctx.suffix) + toDisplayString(_ctx.money), 1),
|
|
154
|
+
createVNode(_component_nut_input_number, {
|
|
155
|
+
modelValue: _ctx.stepValue,
|
|
156
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => _ctx.stepValue = $event),
|
|
157
|
+
min: _ctx.cardBuyMin,
|
|
158
|
+
max: _ctx.cardBuyMax,
|
|
159
|
+
onChange: _ctx.changeStep
|
|
120
160
|
}, null, 8, ["modelValue", "min", "max", "onChange"])
|
|
121
161
|
])
|
|
122
162
|
])
|
|
123
163
|
]);
|
|
124
164
|
}
|
|
125
|
-
const
|
|
165
|
+
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
126
166
|
export {
|
|
127
|
-
|
|
167
|
+
index as default
|
|
128
168
|
};
|