@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.
Files changed (237) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/README.md +3 -4
  3. package/dist/nutui.es.js +4203 -19263
  4. package/dist/nutui.umd.js +4208 -19368
  5. package/dist/packages/_es/ActionSheet.js +17 -167
  6. package/dist/packages/_es/Address.js +110 -552
  7. package/dist/packages/_es/AddressList.js +113 -613
  8. package/dist/packages/_es/Animate.js +22 -0
  9. package/dist/packages/_es/Audio.js +53 -274
  10. package/dist/packages/_es/AudioOperate.js +13 -121
  11. package/dist/packages/_es/Avatar.js +38 -177
  12. package/dist/packages/_es/AvatarGroup.js +14 -73
  13. package/dist/packages/_es/BackTop.js +43 -156
  14. package/dist/packages/_es/Badge.js +14 -86
  15. package/dist/packages/_es/Barrage.js +41 -120
  16. package/dist/packages/_es/Button.js +23 -128
  17. package/dist/packages/_es/Calendar.js +30 -237
  18. package/dist/packages/_es/CalendarItem.js +2 -1
  19. package/dist/packages/_es/Card.js +10 -107
  20. package/dist/packages/_es/Cascader.js +147 -523
  21. package/dist/packages/_es/Category.js +15 -58
  22. package/dist/packages/_es/CategoryPane.js +11 -111
  23. package/dist/packages/_es/Cell.js +21 -100
  24. package/dist/packages/_es/CellGroup.js +9 -44
  25. package/dist/packages/_es/Checkbox.js +31 -113
  26. package/dist/packages/_es/CheckboxGroup.js +29 -58
  27. package/dist/packages/_es/CircleProgress.js +28 -151
  28. package/dist/packages/_es/Col.js +14 -56
  29. package/dist/packages/_es/Collapse.js +32 -84
  30. package/dist/packages/_es/CollapseItem.js +59 -272
  31. package/dist/packages/_es/Comment.js +64 -434
  32. package/dist/packages/_es/ConfigProvider.js +13 -0
  33. package/dist/packages/_es/CountDown.js +56 -256
  34. package/dist/packages/_es/CountUp.js +140 -556
  35. package/dist/packages/_es/DatePicker.js +98 -332
  36. package/dist/packages/_es/Dialog.js +60 -271
  37. package/dist/packages/_es/Divider.js +13 -82
  38. package/dist/packages/_es/Drag.js +56 -197
  39. package/dist/packages/_es/Ecard.js +24 -159
  40. package/dist/packages/_es/Elevator.js +58 -212
  41. package/dist/packages/_es/Ellipsis.js +64 -0
  42. package/dist/packages/_es/Empty.js +12 -71
  43. package/dist/packages/_es/FixedNav.js +15 -122
  44. package/dist/packages/_es/Form.js +64 -151
  45. package/dist/packages/_es/FormItem.js +15 -110
  46. package/dist/packages/_es/Grid.js +5 -6
  47. package/dist/packages/_es/GridItem.js +33 -144
  48. package/dist/packages/_es/Icon.js +15 -40
  49. package/dist/packages/_es/Image.js +31 -0
  50. package/dist/packages/_es/ImagePreview.js +77 -309
  51. package/dist/packages/_es/Indicator.js +15 -62
  52. package/dist/packages/_es/InfiniteLoading.js +57 -268
  53. package/dist/packages/_es/Input.js +51 -413
  54. package/dist/packages/_es/InputNumber.js +41 -160
  55. package/dist/packages/_es/Layout.js +4 -5
  56. package/dist/packages/_es/List.js +18 -124
  57. package/dist/packages/_es/Menu.js +45 -118
  58. package/dist/packages/_es/MenuItem.js +37 -162
  59. package/dist/packages/_es/Navbar.js +30 -192
  60. package/dist/packages/_es/NoticeBar.js +74 -397
  61. package/dist/packages/_es/Notify.js +72 -246
  62. package/dist/packages/_es/NumberKeyboard.js +41 -272
  63. package/dist/packages/_es/OldPicker.js +131 -474
  64. package/dist/packages/_es/OverLay.js +24 -113
  65. package/dist/packages/_es/Pagination.js +39 -157
  66. package/dist/packages/_es/Picker.js +129 -469
  67. package/dist/packages/_es/Popover.js +318 -975
  68. package/dist/packages/_es/Popup.js +55 -313
  69. package/dist/packages/_es/Price.js +16 -118
  70. package/dist/packages/_es/Progress.js +14 -146
  71. package/dist/packages/_es/PullRefresh.js +84 -354
  72. package/dist/packages/_es/Radio.js +22 -90
  73. package/dist/packages/_es/RadioGroup.js +8 -37
  74. package/dist/packages/_es/Range.js +83 -427
  75. package/dist/packages/_es/Rate.js +35 -137
  76. package/dist/packages/_es/Row.js +22 -64
  77. package/dist/packages/_es/SearchBar.js +37 -257
  78. package/dist/packages/_es/ShortPassword.js +35 -225
  79. package/dist/packages/_es/SideNavBar.js +24 -99
  80. package/dist/packages/_es/SideNavBarItem.js +11 -46
  81. package/dist/packages/_es/Signature.js +41 -179
  82. package/dist/packages/_es/Skeleton.js +20 -136
  83. package/dist/packages/_es/Sku.js +84 -509
  84. package/dist/packages/_es/Step.js +20 -133
  85. package/dist/packages/_es/Steps.js +18 -53
  86. package/dist/packages/_es/Sticky.js +53 -138
  87. package/dist/packages/_es/SubSideNavBar.js +17 -100
  88. package/dist/packages/_es/Swipe.js +41 -197
  89. package/dist/packages/_es/Swiper.js +121 -433
  90. package/dist/packages/_es/SwiperItem.js +22 -53
  91. package/dist/packages/_es/Switch.js +21 -116
  92. package/dist/packages/_es/TabPane.js +12 -39
  93. package/dist/packages/_es/Tabbar.js +17 -72
  94. package/dist/packages/_es/TabbarItem.js +29 -151
  95. package/dist/packages/_es/Table.js +18 -196
  96. package/dist/packages/_es/Tabs.js +43 -217
  97. package/dist/packages/_es/Tag.js +20 -97
  98. package/dist/packages/_es/TextArea.js +42 -160
  99. package/dist/packages/_es/TimeDetail.js +18 -98
  100. package/dist/packages/_es/TimePannel.js +14 -66
  101. package/dist/packages/_es/TimeSelect.js +15 -103
  102. package/dist/packages/_es/Toast.js +71 -329
  103. package/dist/packages/_es/Uploader.js +104 -468
  104. package/dist/packages/_es/Video.js +74 -350
  105. package/dist/packages/_es/common.js +38 -128
  106. package/dist/packages/_es/component.js +35 -76
  107. package/dist/packages/_es/index.js +5 -6
  108. package/dist/packages/_es/index2.js +9 -30
  109. package/dist/packages/_es/index3.js +6 -8
  110. package/dist/packages/_es/index4.js +13 -58
  111. package/dist/packages/_es/index5.js +164 -682
  112. package/dist/packages/_es/plugin-vue_export-helper.js +7 -8
  113. package/dist/packages/_es/pxCheck.js +3 -5
  114. package/dist/packages/_es/raf.js +8 -15
  115. package/dist/packages/animate/index.scss +299 -0
  116. package/dist/packages/button/index.scss +2 -1
  117. package/dist/packages/cell/index.scss +18 -1
  118. package/dist/packages/checkbox/index.scss +16 -0
  119. package/dist/packages/configprovider/index.scss +2 -0
  120. package/dist/packages/dialog/index.scss +1 -0
  121. package/dist/packages/elevator/index.scss +21 -0
  122. package/dist/packages/ellipsis/index.scss +12 -0
  123. package/dist/packages/formitem/index.scss +12 -0
  124. package/dist/packages/griditem/index.scss +11 -0
  125. package/dist/packages/image/index.scss +39 -0
  126. package/dist/packages/imagepreview/index.scss +21 -2
  127. package/dist/packages/input/index.scss +26 -1
  128. package/dist/packages/inputnumber/index.scss +21 -0
  129. package/dist/packages/locale/lang/baseLang.d.ts +1 -0
  130. package/dist/packages/locale/lang/baseLang.js +3 -3
  131. package/dist/packages/locale/lang/en-US.d.ts +8 -0
  132. package/dist/packages/locale/lang/en-US.js +5 -97
  133. package/dist/packages/locale/lang/id-ID.d.ts +8 -0
  134. package/dist/packages/locale/lang/id-ID.js +5 -97
  135. package/dist/packages/locale/lang/index.js +16 -38
  136. package/dist/packages/locale/lang/zh-CN.d.ts +8 -0
  137. package/dist/packages/locale/lang/zh-CN.js +5 -97
  138. package/dist/packages/locale/lang/zh-TW.d.ts +8 -0
  139. package/dist/packages/locale/lang/zh-TW.js +5 -97
  140. package/dist/packages/menu/index.scss +45 -36
  141. package/dist/packages/menuitem/index.scss +4 -0
  142. package/dist/packages/navbar/index.scss +9 -0
  143. package/dist/packages/pagination/index.scss +19 -0
  144. package/dist/packages/radio/index.scss +19 -0
  145. package/dist/packages/range/index.scss +19 -0
  146. package/dist/packages/rate/index.scss +1 -1
  147. package/dist/packages/searchbar/index.scss +21 -0
  148. package/dist/packages/switch/index.scss +4 -3
  149. package/dist/packages/tabbar/index.scss +5 -0
  150. package/dist/packages/tabbaritem/index.scss +7 -0
  151. package/dist/packages/tabpane/index.scss +6 -0
  152. package/dist/packages/tabs/index.scss +22 -0
  153. package/dist/packages/textarea/index.scss +8 -0
  154. package/dist/smartips/attributes.json +192 -12
  155. package/dist/smartips/tags.json +70 -10
  156. package/dist/smartips/web-types.json +6945 -0
  157. package/dist/style.css +1 -1
  158. package/dist/style.es.js +1 -1
  159. package/dist/styles/font/config.json +3 -1
  160. package/dist/styles/font/demo_index.html +49 -3
  161. package/dist/styles/font/iconfont.css +11 -3
  162. package/dist/styles/font/iconfont.js +15 -15
  163. package/dist/styles/font/iconfont.json +14 -0
  164. package/dist/styles/font/iconfont.ttf +0 -0
  165. package/dist/styles/font/iconfont.woff +0 -0
  166. package/dist/styles/font/iconfont.woff2 +0 -0
  167. package/dist/styles/themes/default.scss +54 -50
  168. package/dist/styles/themes/jdb.scss +54 -50
  169. package/dist/styles/themes/jdt.scss +54 -50
  170. package/dist/styles/variables-jdb.scss +22 -1
  171. package/dist/styles/variables-jdt.scss +22 -1
  172. package/dist/styles/variables.scss +22 -1
  173. package/dist/types/__VUE/actionsheet/index.vue.d.ts +2 -2
  174. package/dist/types/__VUE/address/index.vue.d.ts +4 -4
  175. package/dist/types/__VUE/addresslist/components/ItemContents.vue.d.ts +1 -0
  176. package/dist/types/__VUE/animate/index.vue.d.ts +48 -0
  177. package/dist/types/__VUE/animate/type.d.ts +6 -0
  178. package/dist/types/__VUE/audiooperate/index.vue.d.ts +1 -0
  179. package/dist/types/__VUE/avatar/index.vue.d.ts +5 -5
  180. package/dist/types/__VUE/avatargroup/index.vue.d.ts +2 -2
  181. package/dist/types/__VUE/badge/index.vue.d.ts +4 -4
  182. package/dist/types/__VUE/button/index.vue.d.ts +6 -6
  183. package/dist/types/__VUE/calendaritem/index.vue.d.ts +10 -2
  184. package/dist/types/__VUE/cascader/index.vue.d.ts +3 -3
  185. package/dist/types/__VUE/cell/index.vue.d.ts +11 -4
  186. package/dist/types/__VUE/checkbox/common.d.ts +59 -0
  187. package/dist/types/__VUE/checkbox/index.vue.d.ts +20 -7
  188. package/dist/types/__VUE/checkboxgroup/index.vue.d.ts +7 -0
  189. package/dist/types/__VUE/circleprogress/index.vue.d.ts +2 -2
  190. package/dist/types/__VUE/collapse/index.vue.d.ts +3 -1
  191. package/dist/types/__VUE/comment/index.vue.d.ts +2 -2
  192. package/dist/types/__VUE/configprovider/common.d.ts +20 -0
  193. package/dist/types/__VUE/configprovider/index.vue.d.ts +33 -0
  194. package/dist/types/__VUE/datepicker/index.vue.d.ts +2 -2
  195. package/dist/types/__VUE/dialog/index.d.ts +9 -2
  196. package/dist/types/__VUE/dialog/index.vue.d.ts +25 -10
  197. package/dist/types/__VUE/ecard/index.vue.d.ts +3 -3
  198. package/dist/types/__VUE/elevator/index.vue.d.ts +29 -0
  199. package/dist/types/__VUE/ellipsis/index.vue.d.ts +72 -0
  200. package/dist/types/__VUE/empty/index.vue.d.ts +2 -2
  201. package/dist/types/__VUE/fixednav/index.vue.d.ts +2 -2
  202. package/dist/types/__VUE/formitem/index.vue.d.ts +3 -10
  203. package/dist/types/__VUE/grid/index.vue.d.ts +4 -4
  204. package/dist/types/__VUE/griditem/index.vue.d.ts +1 -1
  205. package/dist/types/__VUE/image/index.vue.d.ts +105 -0
  206. package/dist/types/__VUE/image/type.d.ts +6 -0
  207. package/dist/types/__VUE/imagepreview/index.vue.d.ts +36 -2
  208. package/dist/types/__VUE/input/index.vue.d.ts +6 -6
  209. package/dist/types/__VUE/inputnumber/index.vue.d.ts +2 -2
  210. package/dist/types/__VUE/menu/index.vue.d.ts +29 -2
  211. package/dist/types/__VUE/menuitem/index.vue.d.ts +12 -3
  212. package/dist/types/__VUE/noticebar/index.vue.d.ts +3 -3
  213. package/dist/types/__VUE/notify/index.vue.d.ts +2 -2
  214. package/dist/types/__VUE/oldpicker/index.vue.d.ts +2 -2
  215. package/dist/types/__VUE/picker/Column.vue.d.ts +1 -1
  216. package/dist/types/__VUE/picker/index.vue.d.ts +3 -3
  217. package/dist/types/__VUE/popover/index.vue.d.ts +6 -6
  218. package/dist/types/__VUE/popup/index.vue.d.ts +2 -2
  219. package/dist/types/__VUE/radio/index.vue.d.ts +4 -4
  220. package/dist/types/__VUE/range/index.vue.d.ts +4 -4
  221. package/dist/types/__VUE/rate/common.d.ts +149 -0
  222. package/dist/types/__VUE/rate/index.vue.d.ts +15 -5
  223. package/dist/types/__VUE/skeleton/index.vue.d.ts +4 -4
  224. package/dist/types/__VUE/sku/index.vue.d.ts +2 -2
  225. package/dist/types/__VUE/step/index.vue.d.ts +2 -2
  226. package/dist/types/__VUE/sticky/index.vue.d.ts +4 -4
  227. package/dist/types/__VUE/swiper/index.vue.d.ts +4 -4
  228. package/dist/types/__VUE/tabbar/index.vue.d.ts +2 -2
  229. package/dist/types/__VUE/tag/index.vue.d.ts +2 -2
  230. package/dist/types/__VUE/timeselect/index.vue.d.ts +10 -2
  231. package/dist/types/__VUE/toast/index.vue.d.ts +5 -5
  232. package/dist/types/__VUE/uploader/index.vue.d.ts +6 -6
  233. package/dist/types/__VUE/uploader/uploader.d.ts +1 -0
  234. package/dist/types/__VUE/video/index.vue.d.ts +1 -1
  235. package/dist/types/index.d.ts +1 -1
  236. package/dist/types/nutui.d.ts +5 -1
  237. package/package.json +6 -3
@@ -1,204 +1,63 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.22-beta.0 Tue May 31 2022 21:47:10 GMT+0800 (中国标准时间)
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 createComponent } from "./component.js";
8
- import { r as requestAniFrame } from "./raf.js";
9
- import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
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 } = createComponent("drag");
12
- const _sfc_main = create({
13
- props: {
14
- attract: {
15
- type: Boolean,
16
- default: false
17
- },
18
- direction: {
19
- type: String,
20
- default: "all"
21
- },
22
- boundary: {
23
- type: Object,
24
- default: () => {
25
- return {
26
- top: 0,
27
- left: 0,
28
- right: 0,
29
- bottom: 0
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
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
193
- return openBlock(), createElementBlock("view", {
194
- class: normalizeClass(_ctx.classes),
195
- ref: "myDrag",
196
- onTouchstart: _cache[0] || (_cache[0] = ($event) => _ctx.touchStart($event)),
197
- onTouchmove: _cache[1] || (_cache[1] = ($event) => _ctx.touchMove($event)),
198
- onTouchend: _cache[2] || (_cache[2] = ($event) => _ctx.touchEnd($event))
199
- }, [
200
- renderSlot(_ctx.$slots, "default")
201
- ], 34);
202
- }
203
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
204
- export { index as default };
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-beta.0 Tue May 31 2022 21:47:10 GMT+0800 (中国标准时间)
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 createComponent } from "./component.js";
8
- import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
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 } = createComponent("ecard");
11
- const _sfc_main = create({
12
- props: {
13
- chooseText: {
14
- type: String,
15
- default: ""
16
- },
17
- otherValueText: {
18
- type: String,
19
- default: ""
20
- },
21
- dataList: {
22
- type: [Object, Array],
23
- default: () => {
24
- return [];
25
- }
26
- },
27
- cardAmountMin: {
28
- type: Number,
29
- default: 1
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 };