@nutui/nutui 4.3.15-beta.1 → 4.3.15-beta.2

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 (312) hide show
  1. package/dist/nutui.es.js +1 -13
  2. package/dist/nutui.umd.js +19829 -1
  3. package/dist/packages/{Interceptor-CBzqGJrl.js → Interceptor-aNUpilAP.js} +1 -1
  4. package/dist/packages/actionsheet/ActionSheet.js +17 -11
  5. package/dist/packages/address/Address.js +139 -121
  6. package/dist/packages/addresslist/AddressList.js +22 -11
  7. package/dist/packages/animate/Animate.js +1 -1
  8. package/dist/packages/avatar/Avatar.js +1 -1
  9. package/dist/packages/avatarcropper/AvatarCropper.js +329 -126
  10. package/dist/packages/avatargroup/AvatarGroup.js +17 -10
  11. package/dist/packages/backtop/Backtop.js +42 -88
  12. package/dist/packages/badge/Badge.js +4 -2
  13. package/dist/packages/barrage/Barrage.js +76 -130
  14. package/dist/packages/button/Button.js +15 -8
  15. package/dist/packages/calendar/Calendar.js +173 -152
  16. package/dist/packages/calendarcard/CalendarCard.js +33 -61
  17. package/dist/packages/card/Card.js +12 -4
  18. package/dist/packages/cascader/Cascader.js +49 -37
  19. package/dist/packages/category/Category.js +13 -12
  20. package/dist/packages/categorypane/CategoryPane.js +13 -8
  21. package/dist/packages/cell/Cell.js +10 -16
  22. package/dist/packages/cellgroup/CellGroup.js +4 -2
  23. package/dist/packages/checkbox/Checkbox.js +1 -1
  24. package/dist/packages/circleprogress/CircleProgress.js +53 -69
  25. package/dist/packages/col/Col.js +1 -1
  26. package/dist/packages/collapse/Collapse.js +1 -1
  27. package/dist/packages/collapseitem/CollapseItem.js +74 -39
  28. package/dist/packages/comment/Comment.js +46 -24
  29. package/dist/packages/configprovider/ConfigProvider.js +1 -1
  30. package/dist/packages/countdown/Countdown.js +2 -2
  31. package/dist/packages/countup/Countup.js +53 -66
  32. package/dist/packages/datepicker/DatePicker.js +12 -7
  33. package/dist/packages/dialog/Dialog.js +27 -97
  34. package/dist/packages/dialog/index.mjs +1 -2
  35. package/dist/packages/divider/Divider.js +1 -1
  36. package/dist/packages/drag/Drag.js +91 -55
  37. package/dist/packages/ecard/Ecard.js +19 -16
  38. package/dist/packages/elevator/Elevator.js +86 -73
  39. package/dist/packages/ellipsis/Ellipsis.js +223 -121
  40. package/dist/packages/empty/Empty.js +5 -3
  41. package/dist/packages/fixednav/FixedNav.js +12 -7
  42. package/dist/packages/form/Form.js +2 -2
  43. package/dist/packages/formitem/FormItem.js +3 -1
  44. package/dist/packages/grid/Grid.js +1 -1
  45. package/dist/packages/griditem/GridItem.js +5 -15
  46. package/dist/packages/imagepreview/ImagePreview.js +192 -400
  47. package/dist/packages/imagepreview/index.mjs +1 -2
  48. package/dist/packages/{index-BOB4ytqZ.js → index-IxPZmHlb.js} +2 -2
  49. package/dist/packages/index-m0Wcof-q.js +69 -0
  50. package/dist/packages/{index-wLaOjIn1.js → index.taro-CNxLoYer.js} +6 -7
  51. package/dist/packages/index.taro.vue_vue_type_script_setup_true_lang-JJ7hr71Y.js +17 -0
  52. package/dist/packages/indicator/Indicator.js +2 -2
  53. package/dist/packages/input/Input.js +87 -70
  54. package/dist/packages/inputnumber/InputNumber.js +22 -14
  55. package/dist/packages/invoice/Invoice.js +3 -2
  56. package/dist/packages/list/List.js +114 -56
  57. package/dist/packages/menu/Menu.js +45 -40
  58. package/dist/packages/menuitem/MenuItem.js +53 -47
  59. package/dist/packages/navbar/Navbar.js +31 -17
  60. package/dist/packages/noticebar/Noticebar.js +68 -43
  61. package/dist/packages/notify/Notify.js +10 -157
  62. package/dist/packages/notify/index.mjs +1 -2
  63. package/dist/packages/numberkeyboard/NumberKeyboard.js +103 -109
  64. package/dist/packages/overlay/Overlay.js +6 -34
  65. package/dist/packages/pagination/Pagination.js +8 -5
  66. package/dist/packages/picker/Picker.js +113 -26
  67. package/dist/packages/popover/Popover.js +158 -88
  68. package/dist/packages/popup/Popup.js +1 -1
  69. package/dist/packages/price/Price.js +16 -3
  70. package/dist/packages/progress/Progress.js +7 -4
  71. package/dist/packages/radio/Radio.js +11 -12
  72. package/dist/packages/radiogroup/RadioGroup.js +2 -2
  73. package/dist/packages/{raf-c01wDYCo.js → raf-CzJhCkQo.js} +0 -9
  74. package/dist/packages/range/Range.js +139 -71
  75. package/dist/packages/rate/Rate.js +15 -49
  76. package/dist/packages/row/Row.js +1 -1
  77. package/dist/packages/searchbar/Searchbar.js +35 -27
  78. package/dist/packages/shortpassword/ShortPassword.js +51 -43
  79. package/dist/packages/sidenavbar/SideNavbar.js +3 -14
  80. package/dist/packages/sidenavbaritem/SideNavbarItem.js +2 -2
  81. package/dist/packages/signature/Signature.js +148 -106
  82. package/dist/packages/skeleton/Skeleton.js +6 -3
  83. package/dist/packages/sku/Sku.js +66 -42
  84. package/dist/packages/space/Space.js +2 -2
  85. package/dist/packages/step/Step.js +5 -2
  86. package/dist/packages/steps/Steps.js +1 -1
  87. package/dist/packages/sticky/Sticky.js +32 -71
  88. package/dist/packages/subsidenavbar/SubSideNavbar.js +13 -5
  89. package/dist/packages/swipe/Swipe.js +37 -14
  90. package/dist/packages/swipegroup/SwipeGroup.js +2 -2
  91. package/dist/packages/swiper/Swiper.js +73 -24
  92. package/dist/packages/switch/Switch.js +6 -4
  93. package/dist/packages/tabbar/Tabbar.js +23 -24
  94. package/dist/packages/tabbaritem/TabbarItem.js +8 -3
  95. package/dist/packages/table/Table.js +10 -6
  96. package/dist/packages/tabs/Tabs.js +146 -150
  97. package/dist/packages/tag/Tag.js +5 -5
  98. package/dist/packages/textarea/Textarea.js +144 -69
  99. package/dist/packages/timedetail/TimeDetail.js +2 -2
  100. package/dist/packages/timepannel/TimePannel.js +2 -2
  101. package/dist/packages/timeselect/TimeSelect.js +9 -11
  102. package/dist/packages/toast/Toast.js +50 -186
  103. package/dist/packages/toast/index.mjs +1 -2
  104. package/dist/packages/tour/Tour.js +145 -99
  105. package/dist/packages/trendarrow/TrendArrow.js +7 -4
  106. package/dist/packages/uploader/Uploader.js +263 -106
  107. package/dist/packages/{util-D1pvnUYu.js → util-2G3mRQeF.js} +5 -17
  108. package/dist/packages/watermark/Watermark.js +95 -35
  109. package/dist/smartips/web-types.json +376 -775
  110. package/dist/style.css +1 -1
  111. package/dist/styles/themes/default.scss +0 -1
  112. package/dist/styles/themes/jda.scss +0 -1
  113. package/dist/styles/themes/jdb.scss +0 -1
  114. package/dist/styles/themes/jddkh.scss +0 -1
  115. package/dist/styles/themes/jdt.scss +0 -1
  116. package/dist/types/__VUE/actionsheet/{index.vue.d.ts → index.taro.vue.d.ts} +5 -112
  117. package/dist/types/__VUE/address/{index.vue.d.ts → index.taro.vue.d.ts} +139 -412
  118. package/dist/types/__VUE/addresslist/components/{GeneralShell.vue.d.ts → GeneralShell.taro.vue.d.ts} +45 -134
  119. package/dist/types/__VUE/addresslist/components/ItemContents.taro.vue.d.ts +27 -0
  120. package/dist/types/__VUE/addresslist/{index.vue.d.ts → index.taro.vue.d.ts} +85 -155
  121. package/dist/types/__VUE/animate/{index.d.ts → index.taro.d.ts} +2 -2
  122. package/dist/types/__VUE/avatarcropper/{index.vue.d.ts → index.taro.vue.d.ts} +90 -147
  123. package/dist/types/__VUE/backtop/{backtop.vue.d.ts → backtop.taro.vue.d.ts} +8 -19
  124. package/dist/types/__VUE/backtop/{index.d.ts → index.taro.d.ts} +2 -2
  125. package/dist/types/__VUE/badge/{index.d.ts → index.taro.d.ts} +2 -2
  126. package/dist/types/__VUE/barrage/{index.vue.d.ts → index.taro.vue.d.ts} +10 -5
  127. package/dist/types/__VUE/button/{button.vue.d.ts → button.taro.vue.d.ts} +7 -1
  128. package/dist/types/__VUE/button/{index.d.ts → index.taro.d.ts} +2 -2
  129. package/dist/types/__VUE/calendar/{index.vue.d.ts → index.taro.vue.d.ts} +59 -94
  130. package/dist/types/__VUE/calendarcard/{index.d.ts → index.taro.d.ts} +2 -2
  131. package/dist/types/__VUE/calendaritem/{index.vue.d.ts → index.taro.vue.d.ts} +22 -4
  132. package/dist/types/__VUE/card/{index.vue.d.ts → index.taro.vue.d.ts} +13 -13
  133. package/dist/types/__VUE/cascader/{cascader-item.vue.d.ts → cascader-item.taro.vue.d.ts} +47 -229
  134. package/dist/types/__VUE/cascader/{index.vue.d.ts → index.taro.vue.d.ts} +50 -287
  135. package/dist/types/__VUE/category/{index.vue.d.ts → index.taro.vue.d.ts} +2 -2
  136. package/dist/types/__VUE/cell/{cell.vue.d.ts → cell.taro.vue.d.ts} +0 -15
  137. package/dist/types/__VUE/cell/{index.d.ts → index.taro.d.ts} +2 -2
  138. package/dist/types/__VUE/cellgroup/{index.d.ts → index.taro.d.ts} +2 -2
  139. package/dist/types/__VUE/circleprogress/{circle-progress.vue.d.ts → circle-progress.taro.vue.d.ts} +0 -4
  140. package/dist/types/__VUE/circleprogress/{index.d.ts → index.taro.d.ts} +2 -2
  141. package/dist/types/__VUE/col/{index.d.ts → index.taro.d.ts} +2 -2
  142. package/dist/types/__VUE/collapse/{index.d.ts → index.taro.d.ts} +2 -2
  143. package/dist/types/__VUE/collapseitem/collapse-item.taro.vue.d.ts +94 -0
  144. package/dist/types/__VUE/collapseitem/{index.d.ts → index.taro.d.ts} +2 -2
  145. package/dist/types/__VUE/comment/components/CmtBottom.taro.vue.d.ts +47 -0
  146. package/dist/types/__VUE/comment/components/CmtHeader.taro.vue.d.ts +122 -0
  147. package/dist/types/__VUE/comment/components/{CmtImages.vue.d.ts → CmtImages.taro.vue.d.ts} +2 -55
  148. package/dist/types/__VUE/comment/index.taro.vue.d.ts +333 -0
  149. package/dist/types/__VUE/countdown/{index.d.ts → index.taro.d.ts} +2 -2
  150. package/dist/types/__VUE/countup/{index.vue.d.ts → index.taro.vue.d.ts} +5 -7
  151. package/dist/types/__VUE/datepicker/{index.vue.d.ts → index.taro.vue.d.ts} +31 -2
  152. package/dist/types/__VUE/dialog/{index.vue.d.ts → index.taro.vue.d.ts} +52 -85
  153. package/dist/types/__VUE/divider/{index.d.ts → index.taro.d.ts} +2 -2
  154. package/dist/types/__VUE/drag/{index.vue.d.ts → index.taro.vue.d.ts} +2 -0
  155. package/dist/types/__VUE/elevator/{index.vue.d.ts → index.taro.vue.d.ts} +40 -5
  156. package/dist/types/__VUE/ellipsis/{index.vue.d.ts → index.taro.vue.d.ts} +11 -6
  157. package/dist/types/__VUE/empty/{index.d.ts → index.taro.d.ts} +2 -2
  158. package/dist/types/__VUE/fixednav/{index.vue.d.ts → index.taro.vue.d.ts} +2 -55
  159. package/dist/types/__VUE/form/{index.d.ts → index.taro.d.ts} +2 -2
  160. package/dist/types/__VUE/formitem/{index.d.ts → index.taro.d.ts} +2 -2
  161. package/dist/types/__VUE/grid/{index.d.ts → index.taro.d.ts} +2 -2
  162. package/dist/types/__VUE/griditem/{grid-item.vue.d.ts → grid-item.taro.vue.d.ts} +3 -21
  163. package/dist/types/__VUE/griditem/{index.d.ts → index.taro.d.ts} +2 -2
  164. package/dist/types/__VUE/imagepreview/index.taro.vue.d.ts +732 -0
  165. package/dist/types/__VUE/indicator/{index.d.ts → index.taro.d.ts} +2 -2
  166. package/dist/types/__VUE/input/{index.d.ts → index.taro.d.ts} +2 -2
  167. package/dist/types/__VUE/input/{input.vue.d.ts → input.taro.vue.d.ts} +14 -6
  168. package/dist/types/__VUE/inputnumber/{index.d.ts → index.taro.d.ts} +2 -2
  169. package/dist/types/__VUE/invoice/{index.d.ts → index.taro.d.ts} +2 -2
  170. package/dist/types/__VUE/layout/{index.d.ts → index.taro.d.ts} +1 -1
  171. package/dist/types/__VUE/list/{index.vue.d.ts → index.taro.vue.d.ts} +32 -4
  172. package/dist/types/__VUE/menu/index.taro.vue.d.ts +104 -0
  173. package/dist/types/__VUE/menuitem/{index.vue.d.ts → index.taro.vue.d.ts} +22 -114
  174. package/dist/types/__VUE/navbar/{index.d.ts → index.taro.d.ts} +2 -2
  175. package/dist/types/__VUE/noticebar/{index.vue.d.ts → index.taro.vue.d.ts} +9 -116
  176. package/dist/types/__VUE/notify/{index.vue.d.ts → index.taro.vue.d.ts} +2 -66
  177. package/dist/types/__VUE/numberkeyboard/{index.vue.d.ts → index.taro.vue.d.ts} +14 -60
  178. package/dist/types/__VUE/overlay/{index.d.ts → index.taro.d.ts} +2 -2
  179. package/dist/types/__VUE/picker/{index.vue.d.ts → index.taro.vue.d.ts} +31 -2
  180. package/dist/types/__VUE/popover/{index.vue.d.ts → index.taro.vue.d.ts} +4 -56
  181. package/dist/types/__VUE/popup/{index.vue.d.ts → index.taro.vue.d.ts} +3 -56
  182. package/dist/types/__VUE/price/{index.d.ts → index.taro.d.ts} +2 -2
  183. package/dist/types/__VUE/progress/{index.d.ts → index.taro.d.ts} +2 -2
  184. package/dist/types/__VUE/radio/{index.d.ts → index.taro.d.ts} +2 -2
  185. package/dist/types/__VUE/radiogroup/{index.d.ts → index.taro.d.ts} +2 -2
  186. package/dist/types/__VUE/range/{index.vue.d.ts → index.taro.vue.d.ts} +3 -2
  187. package/dist/types/__VUE/rate/{index.d.ts → index.taro.d.ts} +2 -2
  188. package/dist/types/__VUE/rate/rate.taro.vue.d.ts +95 -0
  189. package/dist/types/__VUE/row/{index.d.ts → index.taro.d.ts} +2 -2
  190. package/dist/types/__VUE/scroll-view/index.taro.vue.d.ts +9 -0
  191. package/dist/types/__VUE/searchbar/{index.vue.d.ts → index.taro.vue.d.ts} +23 -121
  192. package/dist/types/__VUE/shortpassword/{index.vue.d.ts → index.taro.vue.d.ts} +5 -112
  193. package/dist/types/__VUE/sidenavbar/{index.vue.d.ts → index.taro.vue.d.ts} +0 -9
  194. package/dist/types/__VUE/signature/{index.vue.d.ts → index.taro.vue.d.ts} +53 -31
  195. package/dist/types/__VUE/skeleton/{index.d.ts → index.taro.d.ts} +2 -2
  196. package/dist/types/__VUE/sku/components/{SkuHeader.vue.d.ts → SkuHeader.taro.vue.d.ts} +6 -6
  197. package/dist/types/__VUE/sku/{index.vue.d.ts → index.taro.vue.d.ts} +25 -62
  198. package/dist/types/__VUE/step/{index.d.ts → index.taro.d.ts} +2 -2
  199. package/dist/types/__VUE/steps/{index.d.ts → index.taro.d.ts} +2 -2
  200. package/dist/types/__VUE/sticky/{index.vue.d.ts → index.taro.vue.d.ts} +7 -26
  201. package/dist/types/__VUE/subsidenavbar/index.taro.vue.d.ts +45 -0
  202. package/dist/types/__VUE/swipe/{index.d.ts → index.taro.d.ts} +2 -2
  203. package/dist/types/__VUE/swipegroup/{index.d.ts → index.taro.d.ts} +2 -2
  204. package/dist/types/__VUE/swiper/{index.vue.d.ts → index.taro.vue.d.ts} +6 -5
  205. package/dist/types/__VUE/switch/{index.d.ts → index.taro.d.ts} +2 -2
  206. package/dist/types/__VUE/tabbar/{index.d.ts → index.taro.d.ts} +2 -2
  207. package/dist/types/__VUE/tabbaritem/{index.d.ts → index.taro.d.ts} +2 -2
  208. package/dist/types/__VUE/table/{index.vue.d.ts → index.taro.vue.d.ts} +2 -55
  209. package/dist/types/__VUE/tabs/{index.vue.d.ts → index.taro.vue.d.ts} +27 -118
  210. package/dist/types/__VUE/tag/{index.d.ts → index.taro.d.ts} +2 -2
  211. package/dist/types/__VUE/textarea/{index.d.ts → index.taro.d.ts} +2 -2
  212. package/dist/types/__VUE/textarea/{textarea.vue.d.ts → textarea.taro.vue.d.ts} +1 -1
  213. package/dist/types/__VUE/timeselect/{index.vue.d.ts → index.taro.vue.d.ts} +3 -66
  214. package/dist/types/__VUE/toast/{index.vue.d.ts → index.taro.vue.d.ts} +16 -12
  215. package/dist/types/__VUE/tour/{index.vue.d.ts → index.taro.vue.d.ts} +13 -121
  216. package/dist/types/__VUE/trendarrow/{index.d.ts → index.taro.d.ts} +2 -2
  217. package/dist/types/__VUE/uploader/{index.vue.d.ts → index.taro.vue.d.ts} +268 -286
  218. package/dist/types/__VUE/watermark/{index.d.ts → index.taro.d.ts} +2 -2
  219. package/dist/types/index.d.ts +145 -155
  220. package/package.json +19 -96
  221. package/dist/nutui.js +0 -15856
  222. package/dist/packages/audio/Audio.js +0 -271
  223. package/dist/packages/audio/index.mjs +0 -2
  224. package/dist/packages/audiooperate/AudioOperate.js +0 -125
  225. package/dist/packages/audiooperate/index.mjs +0 -2
  226. package/dist/packages/image/Image.js +0 -167
  227. package/dist/packages/image/index.mjs +0 -2
  228. package/dist/packages/index-B1qsj2XR.js +0 -33
  229. package/dist/packages/index-BvmDLUYP.js +0 -31
  230. package/dist/packages/index-aiGQ-EiA.js +0 -8
  231. package/dist/packages/infiniteloading/InfiniteLoading.js +0 -184
  232. package/dist/packages/infiniteloading/index.mjs +0 -2
  233. package/dist/packages/mountComponent-CLi4Nz91.js +0 -39
  234. package/dist/packages/pullrefresh/PullRefresh.js +0 -240
  235. package/dist/packages/pullrefresh/index.mjs +0 -2
  236. package/dist/packages/types-BMA1Y94E.js +0 -4
  237. package/dist/packages/video/Video.js +0 -449
  238. package/dist/packages/video/index.mjs +0 -2
  239. package/dist/types/__VUE/addresslist/components/ItemContents.vue.d.ts +0 -134
  240. package/dist/types/__VUE/audio/index.vue.d.ts +0 -323
  241. package/dist/types/__VUE/audio/types.d.ts +0 -3
  242. package/dist/types/__VUE/audiooperate/index.vue.d.ts +0 -229
  243. package/dist/types/__VUE/collapseitem/collapse-item.vue.d.ts +0 -201
  244. package/dist/types/__VUE/comment/components/CmtBottom.vue.d.ts +0 -208
  245. package/dist/types/__VUE/comment/components/CmtHeader.vue.d.ts +0 -248
  246. package/dist/types/__VUE/comment/index.vue.d.ts +0 -728
  247. package/dist/types/__VUE/dialog/index.d.ts +0 -45
  248. package/dist/types/__VUE/image/image.vue.d.ts +0 -111
  249. package/dist/types/__VUE/image/index.d.ts +0 -6
  250. package/dist/types/__VUE/image/types.d.ts +0 -2
  251. package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +0 -267
  252. package/dist/types/__VUE/imagepreview/index.d.ts +0 -36
  253. package/dist/types/__VUE/imagepreview/index.vue.d.ts +0 -1088
  254. package/dist/types/__VUE/infiniteloading/index.vue.d.ts +0 -140
  255. package/dist/types/__VUE/menu/index.vue.d.ts +0 -210
  256. package/dist/types/__VUE/notify/index.d.ts +0 -22
  257. package/dist/types/__VUE/pullrefresh/index.vue.d.ts +0 -200
  258. package/dist/types/__VUE/rate/rate.vue.d.ts +0 -208
  259. package/dist/types/__VUE/subsidenavbar/index.vue.d.ts +0 -152
  260. package/dist/types/__VUE/toast/index.d.ts +0 -12
  261. package/dist/types/__VUE/video/index.vue.d.ts +0 -149
  262. package/dist/packages/{index-Do4_KY74.js → index.taro-Do4_KY74.js} +0 -0
  263. package/dist/types/__VUE/animate/{animate.vue.d.ts → animate.taro.vue.d.ts} +0 -0
  264. package/dist/types/__VUE/avatar/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  265. package/dist/types/__VUE/avatargroup/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  266. package/dist/types/__VUE/badge/{badge.vue.d.ts → badge.taro.vue.d.ts} +0 -0
  267. package/dist/types/__VUE/calendarcard/{calendar-card.vue.d.ts → calendar-card.taro.vue.d.ts} +0 -0
  268. package/dist/types/__VUE/calendarcard/{icon.d.ts → icon.taro.d.ts} +0 -0
  269. package/dist/types/__VUE/categorypane/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  270. package/dist/types/__VUE/cellgroup/{cell-group.vue.d.ts → cell-group.taro.vue.d.ts} +0 -0
  271. package/dist/types/__VUE/checkbox/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  272. package/dist/types/__VUE/checkboxgroup/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  273. package/dist/types/__VUE/col/{col.vue.d.ts → col.taro.vue.d.ts} +0 -0
  274. package/dist/types/__VUE/collapse/{collapse.vue.d.ts → collapse.taro.vue.d.ts} +0 -0
  275. package/dist/types/__VUE/configprovider/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  276. package/dist/types/__VUE/countdown/{countdown.vue.d.ts → countdown.taro.vue.d.ts} +0 -0
  277. package/dist/types/__VUE/divider/{divider.vue.d.ts → divider.taro.vue.d.ts} +0 -0
  278. package/dist/types/__VUE/ecard/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  279. package/dist/types/__VUE/empty/{empty.vue.d.ts → empty.taro.vue.d.ts} +0 -0
  280. package/dist/types/__VUE/form/{form.vue.d.ts → form.taro.vue.d.ts} +0 -0
  281. package/dist/types/__VUE/formitem/{form-item.vue.d.ts → form-item.taro.vue.d.ts} +0 -0
  282. package/dist/types/__VUE/grid/{grid.vue.d.ts → grid.taro.vue.d.ts} +0 -0
  283. package/dist/types/__VUE/indicator/{indicator.vue.d.ts → indicator.taro.vue.d.ts} +0 -0
  284. package/dist/types/__VUE/inputnumber/{input-number.vue.d.ts → input-number.taro.vue.d.ts} +0 -0
  285. package/dist/types/__VUE/invoice/{invoice.vue.d.ts → invoice.taro.vue.d.ts} +0 -0
  286. package/dist/types/__VUE/layout/{layout.vue.d.ts → layout.taro.vue.d.ts} +0 -0
  287. package/dist/types/__VUE/navbar/{navbar.vue.d.ts → navbar.taro.vue.d.ts} +0 -0
  288. package/dist/types/__VUE/overlay/{overlay.vue.d.ts → overlay.taro.vue.d.ts} +0 -0
  289. package/dist/types/__VUE/pagination/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  290. package/dist/types/__VUE/price/{price.vue.d.ts → price.taro.vue.d.ts} +0 -0
  291. package/dist/types/__VUE/progress/{progress.vue.d.ts → progress.taro.vue.d.ts} +0 -0
  292. package/dist/types/__VUE/radio/{radio.vue.d.ts → radio.taro.vue.d.ts} +0 -0
  293. package/dist/types/__VUE/radiogroup/{radio-group.vue.d.ts → radio-group.taro.vue.d.ts} +0 -0
  294. package/dist/types/__VUE/row/{row.vue.d.ts → row.taro.vue.d.ts} +0 -0
  295. package/dist/types/__VUE/sidenavbaritem/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  296. package/dist/types/__VUE/skeleton/{skeleton.vue.d.ts → skeleton.taro.vue.d.ts} +2 -2
  297. package/dist/types/__VUE/sku/components/{SkuStepper.vue.d.ts → SkuStepper.taro.vue.d.ts} +0 -0
  298. package/dist/types/__VUE/space/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  299. package/dist/types/__VUE/step/{step.vue.d.ts → step.taro.vue.d.ts} +0 -0
  300. package/dist/types/__VUE/steps/{steps.vue.d.ts → steps.taro.vue.d.ts} +0 -0
  301. package/dist/types/__VUE/swipe/{swipe.vue.d.ts → swipe.taro.vue.d.ts} +0 -0
  302. package/dist/types/__VUE/swipegroup/{swipe-group.vue.d.ts → swipe-group.taro.vue.d.ts} +0 -0
  303. package/dist/types/__VUE/swiperitem/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  304. package/dist/types/__VUE/switch/{switch.vue.d.ts → switch.taro.vue.d.ts} +0 -0
  305. package/dist/types/__VUE/tabbar/{tabbar.vue.d.ts → tabbar.taro.vue.d.ts} +0 -0
  306. package/dist/types/__VUE/tabbaritem/{tabbar-item.vue.d.ts → tabbar-item.taro.vue.d.ts} +0 -0
  307. package/dist/types/__VUE/tabpane/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  308. package/dist/types/__VUE/tag/{tag.vue.d.ts → tag.taro.vue.d.ts} +0 -0
  309. package/dist/types/__VUE/timedetail/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  310. package/dist/types/__VUE/timepannel/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  311. package/dist/types/__VUE/trendarrow/{trend-arrow.vue.d.ts → trend-arrow.taro.vue.d.ts} +1 -1
  312. package/dist/types/__VUE/watermark/{watermark.vue.d.ts → watermark.taro.vue.d.ts} +2 -2
@@ -38,20 +38,63 @@ var __async = (__this, __arguments, generator) => {
38
38
  step((generator = generator.apply(__this, __arguments)).next());
39
39
  });
40
40
  };
41
- import { reactive, ref, computed, watch, toRefs, resolveComponent, openBlock, createElementBlock, Fragment, createElementVNode, normalizeClass, renderSlot, withDirectives, normalizeStyle, createVNode, withCtx, createTextVNode, toDisplayString, vShow } from "vue";
41
+ import { reactive, ref, computed, onMounted, watch, toRefs, resolveComponent, openBlock, createElementBlock, Fragment, createElementVNode, normalizeClass, renderSlot, createTextVNode, withModifiers, toDisplayString, withDirectives, normalizeStyle, createVNode, withCtx, vShow } from "vue";
42
42
  import { Button as _sfc_main$1 } from "../button/Button.js";
43
43
  import { c as createComponent } from "../component-DQf3CENX.js";
44
- import { d as preventDefault, e as clamp } from "../util-D1pvnUYu.js";
45
- import { Refresh2, Retweet } from "@nutui/icons-vue";
44
+ import { a as preventDefault, c as clamp } from "../util-2G3mRQeF.js";
45
+ import { IconFont } from "@nutui/icons-vue-taro";
46
46
  import { u as useTouch } from "../index-I8tfW3Kf.js";
47
- import { u as useRect } from "../index-B1qsj2XR.js";
47
+ import Taro, { useReady } from "@tarojs/taro";
48
48
  import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
49
+ const compareVersion = (v1Old, v2Old) => {
50
+ const v1 = v1Old.split(".");
51
+ const v2 = v2Old.split(".");
52
+ const len = Math.max(v1.length, v2.length);
53
+ while (v1.length < len) {
54
+ v1.push("0");
55
+ }
56
+ while (v2.length < len) {
57
+ v2.push("0");
58
+ }
59
+ for (let i = 0; i < len; i++) {
60
+ const num1 = parseInt(v1[i]);
61
+ const num2 = parseInt(v2[i]);
62
+ if (num1 > num2) {
63
+ return 1;
64
+ } else if (num1 < num2) {
65
+ return -1;
66
+ }
67
+ }
68
+ return 0;
69
+ };
70
+ const isWeapp = () => {
71
+ return process.env.TARO_ENV === "weapp";
72
+ };
73
+ function _easyCanvasContextBase(systemInfo, lowCallback, highCallback, targetVersion = "1.9.90") {
74
+ if (isWeapp() && compareVersion(systemInfo.SDKVersion, targetVersion) >= 0) {
75
+ highCallback();
76
+ } else {
77
+ lowCallback();
78
+ }
79
+ }
80
+ function easySetFillStyle(systemInfo, canvasContext, color) {
81
+ _easyCanvasContextBase(
82
+ systemInfo,
83
+ () => {
84
+ canvasContext.setFillStyle(color);
85
+ },
86
+ () => {
87
+ if (typeof color === "string") {
88
+ canvasContext.fillStyle = color;
89
+ }
90
+ }
91
+ );
92
+ }
49
93
  const { create } = createComponent("avatar-cropper");
50
94
  const _sfc_main = create({
51
95
  components: {
52
96
  NutButton: _sfc_main$1,
53
- Refresh2,
54
- Retweet
97
+ IconFont
55
98
  },
56
99
  props: {
57
100
  maxZoom: {
@@ -81,6 +124,14 @@ const _sfc_main = create({
81
124
  shape: {
82
125
  type: String,
83
126
  default: "square"
127
+ },
128
+ sizeType: {
129
+ type: Array,
130
+ default: () => ["original", "compressed"]
131
+ },
132
+ sourceType: {
133
+ type: Array,
134
+ default: () => ["album", "camera"]
84
135
  }
85
136
  },
86
137
  emits: ["confirm", "cancel"],
@@ -95,19 +146,16 @@ const _sfc_main = create({
95
146
  moving: false,
96
147
  zooming: false,
97
148
  displayWidth: 0,
98
- displayHeight: 0
149
+ displayHeight: 0,
150
+ cropperWidth: 0,
151
+ cropperHeight: 0
99
152
  });
100
- const defDrawImage = {
101
- img: new Image(),
102
- // 规定要使用的图像
103
- sx: 0,
104
- // 开始剪切的 x 坐标位置
105
- sy: 0,
106
- // 开始剪切的 y 坐标位置
107
- swidth: 0,
108
- // 被剪切区域的宽度
109
- sheight: 0,
110
- // 被剪切区域的高度
153
+ const canvasAll = {
154
+ canvasId: `canvas-${Date.now()}`,
155
+ cropperCanvas: null,
156
+ cropperCanvasContext: null
157
+ };
158
+ const drawImage = ref({
111
159
  x: 0,
112
160
  // 在画布上x的坐标位置
113
161
  y: 0,
@@ -116,105 +164,193 @@ const _sfc_main = create({
116
164
  // 要使用的图像的宽度
117
165
  height: 0
118
166
  // 要使用的图像的高度
119
- };
120
- const drawImage = ref(__spreadValues({}, defDrawImage));
121
- const cropperPopupRef = ref();
122
- const canvasRef = ref();
123
- const inputImageRef = ref();
124
- const devicePixelRatio = window.devicePixelRatio || 1;
167
+ });
168
+ let canvasImage = null;
125
169
  const touch = useTouch();
170
+ const systemInfo = Taro.getSystemInfoSync();
171
+ const showCanvas2D = computed(() => {
172
+ return Taro.getEnv() === "ALIPAY" && parseInt(Taro.SDKVersion.replace(/\./g, "")) >= 270 || systemInfo.SDKVersion && parseInt(systemInfo.SDKVersion.replace(/\./g, "")) >= 290 && Taro.getEnv() === "WEAPP";
173
+ });
174
+ const showPixelRatio = Taro.getEnv() === "WEB" || showCanvas2D.value;
175
+ const pixelRatio = showPixelRatio ? systemInfo.pixelRatio : 1;
176
+ state.displayWidth = systemInfo.windowWidth * pixelRatio;
177
+ state.displayHeight = systemInfo.windowHeight * pixelRatio;
178
+ state.cropperWidth = state.cropperHeight = state.displayWidth - props.space * pixelRatio * 2;
179
+ useReady(() => {
180
+ if (showCanvas2D.value) {
181
+ const { canvasId } = canvasAll;
182
+ Taro.createSelectorQuery().select(`#${canvasId}`).node(({ node: canvas }) => {
183
+ canvas.width = state.displayWidth;
184
+ canvas.height = state.displayHeight;
185
+ canvasAll.cropperCanvas = canvas;
186
+ }).exec();
187
+ }
188
+ });
189
+ onMounted(() => {
190
+ const { canvasId } = canvasAll;
191
+ canvasAll.cropperCanvasContext = Taro.createCanvasContext(canvasId);
192
+ });
126
193
  const isAngle = computed(() => {
127
194
  return state.angle === 90 || state.angle === 270;
128
195
  });
129
196
  const highlightStyle = computed(() => {
130
- const { swidth } = drawImage.value;
131
- const width = swidth / devicePixelRatio + "px";
197
+ const { cropperWidth } = state;
198
+ const width = cropperWidth / pixelRatio + "px";
132
199
  const height = width;
133
200
  return {
134
201
  width,
135
202
  height
136
203
  };
137
204
  });
205
+ const canvasStyle = computed(() => {
206
+ const { displayWidth, displayHeight } = state;
207
+ return {
208
+ width: `${displayWidth / pixelRatio}px`,
209
+ height: `${displayHeight / pixelRatio}px`
210
+ };
211
+ });
212
+ const cutCanvasStyle = computed(() => {
213
+ const { displayWidth, displayHeight, cropperWidth } = state;
214
+ return {
215
+ top: `${(displayHeight / pixelRatio - cropperWidth / pixelRatio) / 2}px`,
216
+ left: `${(displayWidth / pixelRatio - cropperWidth / pixelRatio) / 2}px`,
217
+ width: `${cropperWidth / pixelRatio}px`,
218
+ height: `${cropperWidth / pixelRatio}px`
219
+ };
220
+ });
138
221
  const maxMoveX = computed(() => {
139
- const { displayWidth, scale } = state;
140
- const { swidth, height } = drawImage.value;
222
+ const { displayWidth, scale, cropperWidth } = state;
223
+ const { height } = drawImage.value;
141
224
  if (isAngle.value) {
142
- return Math.max(0, (height * scale - swidth) / 2);
225
+ return Math.max(0, (height * scale - cropperWidth) / 2);
143
226
  }
144
- return Math.max(0, (displayWidth * scale - swidth) / 2);
227
+ return Math.max(0, (displayWidth * scale - cropperWidth) / 2);
145
228
  });
146
229
  const maxMoveY = computed(() => {
147
- const { displayWidth, scale } = state;
148
- const { swidth, height } = drawImage.value;
230
+ const { displayWidth, scale, cropperWidth } = state;
231
+ const { height } = drawImage.value;
149
232
  if (isAngle.value) {
150
- return Math.max(0, (displayWidth * scale - swidth) / 2);
233
+ return Math.max(0, (displayWidth * scale - cropperWidth) / 2);
151
234
  }
152
- return Math.max(0, (height * scale - swidth) / 2);
235
+ return Math.max(0, (height * scale - cropperWidth) / 2);
153
236
  });
154
- const fileToDataURL = (file) => {
237
+ const dataURLToImage = (dataURL) => {
155
238
  return new Promise((resolve) => {
156
- const reader = new FileReader();
157
- reader.onloadend = (e) => resolve(e.target.result);
158
- reader.readAsDataURL(file);
239
+ const img = new Image();
240
+ img.onload = () => resolve(img);
241
+ img.src = dataURL;
159
242
  });
160
243
  };
161
- const dataURLToImage = (dataURL) => {
244
+ const dataURLToCanvasImage = (canvas, dataURL) => {
245
+ if (!canvas) {
246
+ return Promise.reject(new Error("Invalid canvas element"));
247
+ }
162
248
  return new Promise((resolve) => {
163
- const img = new Image();
249
+ const img = canvas.createImage();
164
250
  img.onload = () => resolve(img);
165
251
  img.src = dataURL;
166
252
  });
167
253
  };
168
- const draw = () => {
169
- const { img, width, height, x, y, swidth } = drawImage.value;
170
- const { moveX, moveY, scale } = state;
171
- const canvas = canvasRef.value;
172
- if (!canvas) return;
254
+ const canvas2dDraw = (ctx) => {
255
+ if (!ctx) return;
256
+ const { width, height, x, y } = drawImage.value;
257
+ const { moveX, moveY, scale, angle, displayWidth, displayHeight } = state;
258
+ ctx.clearRect(0, 0, displayWidth, displayHeight);
259
+ ctx.translate(displayWidth / 2 + moveX, displayHeight / 2 + moveY);
260
+ ctx.rotate(Math.PI / 180 * angle);
261
+ ctx.scale(scale, scale);
262
+ ctx.drawImage(canvasImage, x, y, width, height);
263
+ };
264
+ const webDraw = () => {
265
+ const { displayWidth, displayHeight } = state;
266
+ const canvasDom = document.getElementById(canvasAll.canvasId);
267
+ let canvas = canvasDom;
268
+ if ((canvasDom == null ? void 0 : canvasDom.tagName) !== "CANVAS") {
269
+ canvas = canvasDom == null ? void 0 : canvasDom.getElementsByTagName("canvas")[0];
270
+ canvas.width = displayWidth;
271
+ canvas.height = displayHeight;
272
+ }
173
273
  const ctx = canvas.getContext("2d");
174
- canvas.width = state.displayWidth;
175
- canvas.height = state.displayHeight;
176
- ctx.clearRect(0, 0, canvas.width, canvas.height);
177
- ctx.fillStyle = "#666";
178
- ctx.fillRect(0, 0, canvas.width, canvas.height);
179
- ctx.fillStyle = "#000";
180
- ctx.fillRect(props.space * devicePixelRatio, (canvas.height - swidth) / 2, swidth, swidth);
181
- ctx.translate(canvas.width / 2 + moveX, canvas.height / 2 + moveY);
182
- ctx.rotate(Math.PI / 180 * state.angle);
274
+ canvas2dDraw(ctx);
275
+ };
276
+ const canvas2dContextDraw = () => {
277
+ const { cropperCanvas } = canvasAll;
278
+ let ctx = cropperCanvas.getContext("2d");
279
+ ctx && ctx.resetTransform();
280
+ canvas2dDraw(ctx);
281
+ };
282
+ const draw = () => {
283
+ if (Taro.getEnv() === "WEB") {
284
+ webDraw();
285
+ return;
286
+ }
287
+ if (showCanvas2D.value) {
288
+ canvas2dContextDraw();
289
+ return;
290
+ }
291
+ const { width, height, x, y } = drawImage.value;
292
+ const { moveX, moveY, scale, angle, displayWidth, displayHeight, cropperWidth } = state;
293
+ const { cropperCanvasContext } = canvasAll;
294
+ let ctx = cropperCanvasContext;
295
+ if (!ctx) return;
296
+ ctx.clearRect(0, 0, displayWidth, displayHeight);
297
+ easySetFillStyle(systemInfo, ctx, "#666");
298
+ ctx.fillRect(0, 0, displayWidth, displayHeight);
299
+ ctx.stroke();
300
+ ctx.fill();
301
+ easySetFillStyle(systemInfo, ctx, "#000");
302
+ ctx.fillRect(props.space, (displayHeight - cropperWidth) / 2, cropperWidth, cropperWidth);
303
+ ctx.stroke();
304
+ ctx.fill();
305
+ ctx.translate(displayWidth / 2 + moveX, displayHeight / 2 + moveY);
306
+ ctx.rotate(Math.PI / 180 * angle);
183
307
  ctx.scale(scale, scale);
184
- ctx.drawImage(img, x, y, width, height);
308
+ ctx.drawImage(canvasImage, x, y, width, height);
309
+ ctx.draw();
185
310
  };
186
- const setDrawImg = (image) => {
187
- const rect = useRect(cropperPopupRef.value);
188
- const { width: clientWidth, height: clientHeight } = rect;
189
- const canvasWidth = state.displayWidth = clientWidth * devicePixelRatio;
190
- const canvasHeight = state.displayHeight = clientHeight * devicePixelRatio;
191
- let drawImg = __spreadValues({}, defDrawImage);
311
+ const setDrawImg = (image) => __async(this, null, function* () {
312
+ const { displayWidth, cropperWidth } = state;
313
+ let drawImg = __spreadValues({}, drawImage.value);
192
314
  const { width: imgWidth, height: imgHeight } = image;
193
- drawImg.img = image;
315
+ canvasImage = image.path;
316
+ if (Taro.getEnv() === "WEB") {
317
+ canvasImage = yield dataURLToImage(image.path);
318
+ }
319
+ if (showCanvas2D.value) {
320
+ canvasImage = yield dataURLToCanvasImage(canvasAll.cropperCanvas, image.path);
321
+ }
194
322
  const isPortrait = imgHeight > imgWidth;
195
323
  const rate = isPortrait ? imgWidth / imgHeight : imgHeight / imgWidth;
196
- drawImg.width = canvasWidth;
197
- drawImg.height = isPortrait ? canvasWidth / rate : canvasWidth * rate;
324
+ drawImg.width = displayWidth;
325
+ drawImg.height = isPortrait ? displayWidth / rate : displayWidth * rate;
198
326
  drawImg.x = -drawImg.width / 2;
199
327
  drawImg.y = -drawImg.height / 2;
200
- drawImg.swidth = canvasWidth - props.space * 2 * devicePixelRatio;
201
- drawImg.sheight = isPortrait ? drawImg.swidth / rate : drawImg.swidth * rate;
202
- drawImg.sx = props.space * devicePixelRatio;
203
- drawImg.sy = (canvasHeight - drawImg.swidth) / 2;
204
328
  drawImage.value = drawImg;
205
- state.defScale = drawImg.swidth / (isPortrait ? drawImg.width : drawImg.height);
329
+ state.defScale = cropperWidth / (isPortrait ? drawImg.width : drawImg.height);
206
330
  resetScale();
207
- };
208
- const inputImageChange = (event) => __async(this, null, function* () {
209
- state.visible = true;
210
- const $el = event.target;
211
- let { files } = $el;
212
- if (!(files == null ? void 0 : files.length)) return;
213
- const base64 = yield fileToDataURL(files[0]);
214
- const image = yield dataURLToImage(base64);
215
- setDrawImg(image);
331
+ yield Promise.resolve();
216
332
  draw();
217
333
  });
334
+ const chooseImage = () => {
335
+ Taro.chooseImage({
336
+ count: 1,
337
+ // 可以指定是原图还是压缩图,默认二者都有
338
+ sizeType: props.sizeType,
339
+ sourceType: props.sourceType,
340
+ success: (res) => {
341
+ const { tempFiles } = res;
342
+ !!tempFiles.length && imageChange(tempFiles[0]);
343
+ }
344
+ });
345
+ };
346
+ const imageChange = (file) => __async(this, null, function* () {
347
+ Taro.getImageInfo({
348
+ src: file.path
349
+ }).then((res) => {
350
+ state.visible = true;
351
+ setDrawImg(res);
352
+ });
353
+ });
218
354
  const resetScale = () => {
219
355
  setScale(state.defScale);
220
356
  state.moveX = 0;
@@ -304,23 +440,83 @@ const _sfc_main = create({
304
440
  const cancel = (isEmit = true) => {
305
441
  state.visible = false;
306
442
  resetScale();
307
- inputImageRef.value.value = "";
308
443
  isEmit && emit("cancel");
309
444
  };
310
- const confirm = () => {
311
- const canvas = canvasRef.value;
312
- const { sx, sy, swidth } = drawImage.value;
313
- const width = swidth;
314
- const height = swidth;
445
+ const confirmWEB = () => {
446
+ const { cropperWidth, displayHeight } = state;
447
+ const canvasDom = document.getElementById(canvasAll.canvasId);
448
+ let canvas = canvasDom;
449
+ if ((canvasDom == null ? void 0 : canvasDom.tagName) !== "CANVAS") {
450
+ canvas = canvasDom == null ? void 0 : canvasDom.getElementsByTagName("canvas")[0];
451
+ }
452
+ const width = cropperWidth;
453
+ const height = cropperWidth;
315
454
  const croppedCanvas = document.createElement("canvas");
316
455
  const croppedCtx = croppedCanvas.getContext("2d");
317
456
  croppedCanvas.width = width;
318
457
  croppedCanvas.height = height;
319
- canvas && croppedCtx.drawImage(canvas, sx, sy, width, height, 0, 0, width, height);
458
+ canvas && croppedCtx.drawImage(
459
+ canvas,
460
+ props.space * pixelRatio,
461
+ (displayHeight - cropperWidth) / 2,
462
+ width,
463
+ height,
464
+ 0,
465
+ 0,
466
+ width,
467
+ height
468
+ );
320
469
  const imageDataURL = croppedCanvas.toDataURL("image/png");
321
470
  emit("confirm", imageDataURL);
322
471
  cancel(false);
323
472
  };
473
+ const confirmCanvas2D = () => {
474
+ const { cropperWidth, displayHeight } = state;
475
+ const { cropperCanvas } = canvasAll;
476
+ const pixelRatio2 = Taro.getEnv() === "ALIPAY" ? 1 : systemInfo.pixelRatio;
477
+ Taro.canvasToTempFilePath({
478
+ canvas: cropperCanvas,
479
+ x: props.space,
480
+ y: (displayHeight - cropperWidth) / pixelRatio2 / 2,
481
+ width: cropperWidth / pixelRatio2,
482
+ height: cropperWidth / pixelRatio2,
483
+ destWidth: cropperWidth,
484
+ destHeight: cropperWidth,
485
+ success: (res) => __async(this, null, function* () {
486
+ let filePath = res.tempFilePath;
487
+ emit("confirm", filePath);
488
+ cancel(false);
489
+ return;
490
+ })
491
+ });
492
+ };
493
+ const confirm = () => {
494
+ if (Taro.getEnv() === "WEB") {
495
+ confirmWEB();
496
+ return;
497
+ }
498
+ if (showCanvas2D.value) {
499
+ confirmCanvas2D();
500
+ return;
501
+ }
502
+ const { cropperWidth, displayHeight } = state;
503
+ const { canvasId } = canvasAll;
504
+ Taro.canvasToTempFilePath({
505
+ canvasId,
506
+ x: props.space,
507
+ y: (displayHeight - cropperWidth) / 2,
508
+ width: cropperWidth,
509
+ height: cropperWidth,
510
+ destWidth: cropperWidth * systemInfo.pixelRatio,
511
+ destHeight: cropperWidth * systemInfo.pixelRatio,
512
+ success: (res) => __async(this, null, function* () {
513
+ let filePath = res.tempFilePath;
514
+ emit("confirm", filePath);
515
+ cancel(false);
516
+ return;
517
+ })
518
+ });
519
+ };
324
520
  watch(
325
521
  () => state.scale,
326
522
  () => {
@@ -357,12 +553,12 @@ const _sfc_main = create({
357
553
  rotate,
358
554
  confirm
359
555
  });
360
- return __spreadProps(__spreadValues({}, toRefs(state)), {
361
- cropperPopupRef,
362
- canvasRef,
363
- inputImageRef,
556
+ return __spreadProps(__spreadValues(__spreadValues({}, toRefs(state)), toRefs(canvasAll)), {
557
+ showCanvas2D,
364
558
  highlightStyle,
365
- inputImageChange,
559
+ canvasStyle,
560
+ cutCanvasStyle,
561
+ chooseImage,
366
562
  reset,
367
563
  rotate,
368
564
  cancel,
@@ -373,56 +569,54 @@ const _sfc_main = create({
373
569
  });
374
570
  }
375
571
  });
376
- const _hoisted_1 = ["data-edit-text"];
377
- const _hoisted_2 = {
378
- ref: "cropperPopupRef",
379
- class: "nut-cropper-popup"
380
- };
572
+ const _hoisted_1 = { class: "nut-cropper-popup" };
573
+ const _hoisted_2 = ["id", "canvas-id", "type"];
381
574
  const _hoisted_3 = {
382
- ref: "canvasRef",
383
- class: "nut-cropper-popup__canvas"
384
- };
385
- const _hoisted_4 = {
386
575
  key: 1,
387
576
  class: "flex-sb"
388
577
  };
389
578
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
390
579
  const _component_nut_button = resolveComponent("nut-button");
391
- const _component_Refresh2 = resolveComponent("Refresh2");
392
- const _component_Retweet = resolveComponent("Retweet");
580
+ const _component_IconFont = resolveComponent("IconFont");
393
581
  return openBlock(), createElementBlock(Fragment, null, [
394
- createElementVNode("div", {
395
- class: normalizeClass(["nut-avatar-cropper", { round: _ctx.shape === "round" }]),
396
- "data-edit-text": _ctx.editText
582
+ createElementVNode("view", {
583
+ class: normalizeClass(["nut-avatar-cropper taro", { round: _ctx.shape === "round" }])
397
584
  }, [
398
585
  renderSlot(_ctx.$slots, "default"),
399
- createElementVNode("input", {
400
- ref: "inputImageRef",
401
- type: "file",
402
- accept: "image/*",
403
- class: "nut-avatar-cropper__input",
404
- onChange: _cache[0] || (_cache[0] = (...args) => _ctx.inputImageChange && _ctx.inputImageChange(...args))
405
- }, null, 544)
406
- ], 10, _hoisted_1),
407
- withDirectives(createElementVNode("div", _hoisted_2, [
408
- createElementVNode("canvas", _hoisted_3, null, 512),
409
- createElementVNode("div", {
586
+ _cache[9] || (_cache[9] = createTextVNode()),
587
+ createElementVNode("view", {
588
+ class: "nut-avatar-cropper__edit-text",
589
+ onClick: _cache[0] || (_cache[0] = withModifiers((...args) => _ctx.chooseImage && _ctx.chooseImage(...args), ["stop"]))
590
+ }, toDisplayString(_ctx.editText), 1)
591
+ ], 2),
592
+ _cache[15] || (_cache[15] = createTextVNode()),
593
+ withDirectives(createElementVNode("view", _hoisted_1, [
594
+ createElementVNode("canvas", {
595
+ id: _ctx.canvasId,
596
+ "canvas-id": _ctx.canvasId,
597
+ type: _ctx.showCanvas2D ? "2d" : void 0,
598
+ style: normalizeStyle(_ctx.canvasStyle),
599
+ class: "nut-cropper-popup__canvas"
600
+ }, null, 12, _hoisted_2),
601
+ _cache[13] || (_cache[13] = createTextVNode()),
602
+ createElementVNode("view", {
410
603
  class: "nut-cropper-popup__highlight",
411
604
  onTouchstart: _cache[1] || (_cache[1] = (...args) => _ctx.onTouchStart && _ctx.onTouchStart(...args)),
412
605
  onTouchmove: _cache[2] || (_cache[2] = (...args) => _ctx.onTouchMove && _ctx.onTouchMove(...args)),
413
606
  onTouchend: _cache[3] || (_cache[3] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args)),
414
607
  onTouchcancel: _cache[4] || (_cache[4] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args))
415
608
  }, [
416
- createElementVNode("div", {
609
+ createElementVNode("view", {
417
610
  class: normalizeClass(["highlight", { highlight__round: _ctx.shape === "round" }]),
418
611
  style: normalizeStyle(_ctx.highlightStyle)
419
612
  }, null, 6)
420
613
  ], 32),
421
- createElementVNode("div", {
614
+ _cache[14] || (_cache[14] = createTextVNode()),
615
+ createElementVNode("view", {
422
616
  class: normalizeClass(["nut-cropper-popup__toolbar", [_ctx.toolbarPosition]])
423
617
  }, [
424
- _ctx.$slots.toolbar ? renderSlot(_ctx.$slots, "toolbar", { key: 0 }) : (openBlock(), createElementBlock("div", _hoisted_4, [
425
- createElementVNode("div", {
618
+ _ctx.$slots.toolbar ? renderSlot(_ctx.$slots, "toolbar", { key: 0 }) : (openBlock(), createElementBlock("view", _hoisted_3, [
619
+ createElementVNode("view", {
426
620
  class: "nut-cropper-popup__toolbar-item",
427
621
  onClick: _cache[5] || (_cache[5] = ($event) => _ctx.cancel())
428
622
  }, [
@@ -433,19 +627,28 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
433
627
  _: 1
434
628
  })
435
629
  ]),
436
- createElementVNode("div", {
630
+ _cache[10] || (_cache[10] = createTextVNode()),
631
+ createElementVNode("view", {
437
632
  class: "nut-cropper-popup__toolbar-item",
438
633
  onClick: _cache[6] || (_cache[6] = (...args) => _ctx.reset && _ctx.reset(...args))
439
634
  }, [
440
- createVNode(_component_Refresh2, { color: "#fff" })
635
+ createVNode(_component_IconFont, {
636
+ name: "refresh2",
637
+ color: "#fff"
638
+ })
441
639
  ]),
442
- createElementVNode("div", {
640
+ _cache[11] || (_cache[11] = createTextVNode()),
641
+ createElementVNode("view", {
443
642
  class: "nut-cropper-popup__toolbar-item",
444
643
  onClick: _cache[7] || (_cache[7] = (...args) => _ctx.rotate && _ctx.rotate(...args))
445
644
  }, [
446
- createVNode(_component_Retweet, { color: "#fff" })
645
+ createVNode(_component_IconFont, {
646
+ name: "retweet",
647
+ color: "#fff"
648
+ })
447
649
  ]),
448
- createElementVNode("div", {
650
+ _cache[12] || (_cache[12] = createTextVNode()),
651
+ createElementVNode("view", {
449
652
  class: "nut-cropper-popup__toolbar-item",
450
653
  onClick: _cache[8] || (_cache[8] = (...args) => _ctx.confirm && _ctx.confirm(...args))
451
654
  }, [
@@ -463,7 +666,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
463
666
  ])
464
667
  ], 64);
465
668
  }
466
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
669
+ const index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
467
670
  export {
468
- index as default
671
+ index_taro as default
469
672
  };
@@ -1,6 +1,7 @@
1
- import { ref, computed, onMounted, nextTick, unref, onUnmounted, provide, resolveComponent, openBlock, createElementBlock, normalizeStyle, renderSlot, createBlock, withCtx, createTextVNode, toDisplayString, createCommentVNode } from "vue";
1
+ import { ref, computed, onMounted, nextTick, unref, onUnmounted, provide, resolveComponent, openBlock, createElementBlock, normalizeStyle, renderSlot, createTextVNode, createBlock, withCtx, toDisplayString, createCommentVNode } from "vue";
2
+ import Taro from "@tarojs/taro";
2
3
  import { c as createComponent } from "../component-DQf3CENX.js";
3
- import { N as NutAvatar, A as AVATAR_KEY } from "../index-Do4_KY74.js";
4
+ import { N as NutAvatar, A as AVATAR_KEY } from "../index.taro-Do4_KY74.js";
4
5
  import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
5
6
  const { create } = createComponent("avatar-group");
6
7
  const _sfc_main = create({
@@ -52,9 +53,6 @@ const _sfc_main = create({
52
53
  });
53
54
  const foldAvatar = (element) => {
54
55
  let count = 0;
55
- if (element && element.$el) {
56
- element = element.$el;
57
- }
58
56
  const children = element.children;
59
57
  if (props.zIndex === "right") {
60
58
  for (let i = 0; i < Number(props.maxCount); i++) {
@@ -64,7 +62,13 @@ const _sfc_main = create({
64
62
  }
65
63
  for (let i = Number(props.maxCount); i < children.length; i++) {
66
64
  const child = children[i];
67
- if (child.className.includes("avater-fold")) {
65
+ let className;
66
+ if (Taro.getEnv() === "WEB") {
67
+ className = child.className;
68
+ } else {
69
+ className = child.props.class;
70
+ }
71
+ if (className.includes("avater-fold")) {
68
72
  continue;
69
73
  }
70
74
  child.style.display = "none";
@@ -92,8 +96,10 @@ const _sfc_main = create({
92
96
  if (props.maxCount) {
93
97
  nextTick(() => {
94
98
  let element = unref(avatarGroupRef);
95
- if (element && element.$el) {
96
- element = element.$el;
99
+ if (Taro.getEnv() === "WEB") {
100
+ if (element && element.$el) {
101
+ element = element.$el;
102
+ }
97
103
  }
98
104
  foldAvatar(element);
99
105
  observer.value = watchDefaultSlot(element);
@@ -123,6 +129,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
123
129
  style: normalizeStyle(_ctx.styles)
124
130
  }, [
125
131
  renderSlot(_ctx.$slots, "default"),
132
+ _cache[0] || (_cache[0] = createTextVNode()),
126
133
  _ctx.foldCount > 0 ? (openBlock(), createBlock(_component_nut_avatar, {
127
134
  key: 0,
128
135
  class: "avater-fold",
@@ -139,7 +146,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
139
146
  }, 8, ["color", "bg-color", "size", "shape", "style"])) : createCommentVNode("", true)
140
147
  ], 4);
141
148
  }
142
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
149
+ const index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
143
150
  export {
144
- index as default
151
+ index_taro as default
145
152
  };