@nutui/nutui 4.0.10-beta.1 → 4.0.10

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