@nutui/nutui 3.1.21-beta.3 → 3.1.22-beta.3

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 (284) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/dist/nutui.es.js +4024 -18197
  3. package/dist/nutui.umd.js +4017 -18290
  4. package/dist/packages/_es/ActionSheet.js +26 -157
  5. package/dist/packages/_es/Address.js +119 -542
  6. package/dist/packages/_es/AddressList.js +113 -611
  7. package/dist/packages/_es/Audio.js +62 -274
  8. package/dist/packages/_es/AudioOperate.js +18 -107
  9. package/dist/packages/_es/Avatar.js +42 -165
  10. package/dist/packages/_es/AvatarGroup.js +14 -73
  11. package/dist/packages/_es/BackTop.js +43 -156
  12. package/dist/packages/_es/Badge.js +14 -86
  13. package/dist/packages/_es/Barrage.js +41 -113
  14. package/dist/packages/_es/Button.js +23 -128
  15. package/dist/packages/_es/Calendar.js +24 -237
  16. package/dist/packages/_es/CalendarItem.js +1 -1
  17. package/dist/packages/_es/Card.js +10 -107
  18. package/dist/packages/_es/Cascader.js +156 -500
  19. package/dist/packages/_es/Category.js +15 -58
  20. package/dist/packages/_es/CategoryPane.js +11 -111
  21. package/dist/packages/_es/Cell.js +21 -98
  22. package/dist/packages/_es/CellGroup.js +9 -44
  23. package/dist/packages/_es/Checkbox.js +31 -113
  24. package/dist/packages/_es/CheckboxGroup.js +29 -58
  25. package/dist/packages/_es/CircleProgress.js +28 -151
  26. package/dist/packages/_es/Col.js +14 -56
  27. package/dist/packages/_es/Collapse.js +24 -85
  28. package/dist/packages/_es/CollapseItem.js +70 -261
  29. package/dist/packages/_es/Comment.js +64 -434
  30. package/dist/packages/_es/CountDown.js +61 -242
  31. package/dist/packages/_es/CountUp.js +149 -548
  32. package/dist/packages/_es/DatePicker.js +107 -322
  33. package/dist/packages/_es/Dialog.js +69 -259
  34. package/dist/packages/_es/Divider.js +32 -45
  35. package/dist/packages/_es/Drag.js +56 -197
  36. package/dist/packages/_es/Ecard.js +24 -159
  37. package/dist/packages/_es/Elevator.js +63 -194
  38. package/dist/packages/_es/Empty.js +12 -71
  39. package/dist/packages/_es/FixedNav.js +15 -122
  40. package/dist/packages/_es/Form.js +64 -146
  41. package/dist/packages/_es/FormItem.js +15 -110
  42. package/dist/packages/_es/Grid.js +5 -6
  43. package/dist/packages/_es/GridItem.js +33 -144
  44. package/dist/packages/_es/Icon.js +15 -40
  45. package/dist/packages/_es/ImagePreview.js +74 -298
  46. package/dist/packages/_es/Indicator.js +15 -62
  47. package/dist/packages/_es/InfiniteLoading.js +66 -258
  48. package/dist/packages/_es/Input.js +51 -413
  49. package/dist/packages/_es/InputNumber.js +41 -160
  50. package/dist/packages/_es/Layout.js +4 -5
  51. package/dist/packages/_es/List.js +23 -109
  52. package/dist/packages/_es/Menu.js +30 -114
  53. package/dist/packages/_es/MenuItem.js +34 -161
  54. package/dist/packages/_es/Navbar.js +30 -94
  55. package/dist/packages/_es/NoticeBar.js +83 -387
  56. package/dist/packages/_es/Notify.js +81 -236
  57. package/dist/packages/_es/NumberKeyboard.js +41 -262
  58. package/dist/packages/_es/OldPicker.js +140 -464
  59. package/dist/packages/_es/OverLay.js +32 -105
  60. package/dist/packages/_es/Pagination.js +39 -157
  61. package/dist/packages/_es/Picker.js +138 -457
  62. package/dist/packages/_es/Popover.js +344 -185
  63. package/dist/packages/_es/Popup.js +64 -300
  64. package/dist/packages/_es/Price.js +16 -118
  65. package/dist/packages/_es/Progress.js +14 -146
  66. package/dist/packages/_es/PullRefresh.js +92 -346
  67. package/dist/packages/_es/Radio.js +22 -90
  68. package/dist/packages/_es/RadioGroup.js +8 -37
  69. package/dist/packages/_es/Range.js +92 -417
  70. package/dist/packages/_es/Rate.js +16 -139
  71. package/dist/packages/_es/Row.js +22 -64
  72. package/dist/packages/_es/SearchBar.js +46 -181
  73. package/dist/packages/_es/ShortPassword.js +35 -225
  74. package/dist/packages/_es/SideNavBar.js +33 -89
  75. package/dist/packages/_es/SideNavBarItem.js +11 -46
  76. package/dist/packages/_es/Signature.js +46 -165
  77. package/dist/packages/_es/Skeleton.js +20 -136
  78. package/dist/packages/_es/Sku.js +93 -499
  79. package/dist/packages/_es/Step.js +25 -119
  80. package/dist/packages/_es/Steps.js +18 -53
  81. package/dist/packages/_es/Sticky.js +53 -138
  82. package/dist/packages/_es/SubSideNavBar.js +26 -90
  83. package/dist/packages/_es/Swipe.js +46 -183
  84. package/dist/packages/_es/Swiper.js +121 -414
  85. package/dist/packages/_es/SwiperItem.js +22 -50
  86. package/dist/packages/_es/Switch.js +21 -116
  87. package/dist/packages/_es/TabPane.js +12 -35
  88. package/dist/packages/_es/Tabbar.js +17 -72
  89. package/dist/packages/_es/TabbarItem.js +29 -150
  90. package/dist/packages/_es/Table.js +27 -186
  91. package/dist/packages/_es/Tabs.js +51 -204
  92. package/dist/packages/_es/Tag.js +20 -97
  93. package/dist/packages/_es/TextArea.js +42 -160
  94. package/dist/packages/_es/TimeDetail.js +23 -84
  95. package/dist/packages/_es/TimePannel.js +19 -52
  96. package/dist/packages/_es/TimeSelect.js +15 -103
  97. package/dist/packages/_es/Toast.js +80 -319
  98. package/dist/packages/_es/Uploader.js +112 -459
  99. package/dist/packages/_es/Video.js +83 -340
  100. package/dist/packages/_es/common.js +38 -128
  101. package/dist/packages/_es/component.js +35 -76
  102. package/dist/packages/_es/index.js +5 -6
  103. package/dist/packages/_es/index2.js +9 -30
  104. package/dist/packages/_es/index3.js +6 -8
  105. package/dist/packages/_es/index4.js +13 -58
  106. package/dist/packages/_es/index5.js +120 -675
  107. package/dist/packages/_es/plugin-vue_export-helper.js +7 -8
  108. package/dist/packages/_es/pxCheck.js +3 -5
  109. package/dist/packages/_es/raf.js +8 -15
  110. package/dist/packages/addresslist/index.scss +2 -2
  111. package/dist/packages/button/index.scss +2 -1
  112. package/dist/packages/card/index.scss +1 -1
  113. package/dist/packages/cell/index.scss +15 -0
  114. package/dist/packages/checkbox/index.scss +6 -0
  115. package/dist/packages/dialog/index.scss +1 -2
  116. package/dist/packages/divider/index.scss +9 -0
  117. package/dist/packages/elevator/index.scss +21 -0
  118. package/dist/packages/formitem/index.scss +1 -0
  119. package/dist/packages/input/index.scss +13 -1
  120. package/dist/packages/locale/index.d.ts +8 -3
  121. package/dist/packages/locale/{locale/lang → lang}/baseLang.d.ts +1 -0
  122. package/dist/packages/locale/lang/baseLang.js +3 -3
  123. package/dist/packages/locale/{locale/lang → lang}/en-US.d.ts +16 -0
  124. package/dist/packages/locale/lang/en-US.js +5 -89
  125. package/dist/packages/locale/lang/id-ID.d.ts +104 -0
  126. package/dist/packages/locale/lang/id-ID.js +12 -0
  127. package/dist/packages/locale/lang/index.js +16 -38
  128. package/dist/packages/locale/{locale/lang → lang}/zh-CN.d.ts +16 -0
  129. package/dist/packages/locale/lang/zh-CN.js +5 -89
  130. package/dist/packages/locale/{locale/lang → lang}/zh-TW.d.ts +16 -0
  131. package/dist/packages/locale/lang/zh-TW.js +5 -89
  132. package/dist/packages/menuitem/index.scss +0 -1
  133. package/dist/packages/navbar/index.scss +8 -1
  134. package/dist/packages/popover/index.scss +402 -81
  135. package/dist/packages/popup/index.scss +3 -0
  136. package/dist/packages/radio/index.scss +1 -0
  137. package/dist/packages/searchbar/index.scss +4 -0
  138. package/dist/packages/switch/index.scss +3 -3
  139. package/dist/packages/tabbar/index.scss +2 -2
  140. package/dist/packages/tabpane/index.scss +5 -2
  141. package/dist/packages/tabs/index.scss +3 -0
  142. package/dist/packages/timeselect/index.scss +3 -2
  143. package/dist/smartips/attributes.json +188 -44
  144. package/dist/smartips/tags.json +65 -27
  145. package/dist/style.css +1 -1
  146. package/dist/styles/themes/default.scss +48 -48
  147. package/dist/styles/themes/jdb.scss +48 -48
  148. package/dist/styles/themes/jdt.scss +48 -48
  149. package/dist/styles/variables-jdb.scss +25 -8
  150. package/dist/styles/variables-jdt.scss +25 -8
  151. package/dist/styles/variables.scss +25 -7
  152. package/dist/types/__VUE/actionsheet/{index.d.ts → index.vue.d.ts} +62 -114
  153. package/dist/types/__VUE/address/{index.d.ts → index.vue.d.ts} +81 -151
  154. package/dist/types/__VUE/addresslist/components/{GeneralShell.d.ts → GeneralShell.vue.d.ts} +6 -7
  155. package/dist/types/__VUE/addresslist/components/{ItemContents.d.ts → ItemContents.vue.d.ts} +9 -11
  156. package/dist/types/__VUE/addresslist/components/{LongPressShell.d.ts → LongPressShell.vue.d.ts} +6 -7
  157. package/dist/types/__VUE/addresslist/components/{SwipeShell.d.ts → SwipeShell.vue.d.ts} +6 -7
  158. package/dist/types/__VUE/addresslist/{index.d.ts → index.vue.d.ts} +14 -23
  159. package/dist/types/__VUE/audio/index.vue.d.ts +102 -0
  160. package/dist/types/__VUE/audiooperate/index.vue.d.ts +88 -0
  161. package/dist/types/__VUE/avatar/{index.d.ts → index.vue.d.ts} +17 -30
  162. package/dist/types/__VUE/avatargroup/{index.d.ts → index.vue.d.ts} +20 -35
  163. package/dist/types/__VUE/backtop/{index.d.ts → index.vue.d.ts} +18 -34
  164. package/dist/types/__VUE/badge/{index.d.ts → index.vue.d.ts} +20 -33
  165. package/dist/types/__VUE/barrage/{index.d.ts → index.vue.d.ts} +15 -26
  166. package/dist/types/__VUE/button/{index.d.ts → index.vue.d.ts} +33 -50
  167. package/dist/types/__VUE/button/type.d.ts +7 -0
  168. package/dist/types/__VUE/calendar/{index.d.ts → index.vue.d.ts} +32 -57
  169. package/dist/types/__VUE/calendaritem/{index.d.ts → index.vue.d.ts} +33 -58
  170. package/dist/types/__VUE/card/{index.d.ts → index.vue.d.ts} +19 -34
  171. package/dist/types/__VUE/cascader/{cascader-item.d.ts → cascader-item.vue.d.ts} +22 -23
  172. package/dist/types/__VUE/cascader/{index.d.ts → index.vue.d.ts} +62 -98
  173. package/dist/types/__VUE/category/{index.d.ts → index.vue.d.ts} +7 -10
  174. package/dist/types/__VUE/categorypane/{index.d.ts → index.vue.d.ts} +10 -15
  175. package/dist/types/__VUE/cell/{index.d.ts → index.vue.d.ts} +38 -39
  176. package/dist/types/__VUE/cellgroup/{index.d.ts → index.vue.d.ts} +8 -11
  177. package/dist/types/__VUE/checkbox/common.d.ts +59 -0
  178. package/dist/types/__VUE/checkbox/{index.d.ts → index.vue.d.ts} +36 -40
  179. package/dist/types/__VUE/checkboxgroup/{index.d.ts → index.vue.d.ts} +15 -11
  180. package/dist/types/__VUE/circleprogress/{index.d.ts → index.vue.d.ts} +18 -31
  181. package/dist/types/__VUE/col/{index.d.ts → index.vue.d.ts} +7 -10
  182. package/dist/types/__VUE/collapse/{index.d.ts → index.vue.d.ts} +24 -40
  183. package/dist/types/__VUE/collapseitem/{index.d.ts → index.vue.d.ts} +22 -30
  184. package/dist/types/__VUE/comment/components/{CmtBottom.d.ts → CmtBottom.vue.d.ts} +10 -15
  185. package/dist/types/__VUE/comment/components/{CmtHeader.d.ts → CmtHeader.vue.d.ts} +10 -15
  186. package/dist/types/__VUE/comment/components/{CmtImages.d.ts → CmtImages.vue.d.ts} +10 -15
  187. package/dist/types/__VUE/comment/{index.d.ts → index.vue.d.ts} +21 -38
  188. package/dist/types/__VUE/countdown/{index.d.ts → index.vue.d.ts} +21 -35
  189. package/dist/types/__VUE/countup/{index.d.ts → index.vue.d.ts} +41 -74
  190. package/dist/types/__VUE/datepicker/{index.d.ts → index.vue.d.ts} +71 -125
  191. package/dist/types/__VUE/datepicker/type.d.ts +6 -0
  192. package/dist/types/__VUE/dialog/index.d.ts +44 -302
  193. package/dist/types/__VUE/dialog/index.vue.d.ts +263 -0
  194. package/dist/types/__VUE/divider/{index.d.ts → index.vue.d.ts} +15 -15
  195. package/dist/types/__VUE/drag/{index.d.ts → index.vue.d.ts} +9 -19
  196. package/dist/types/__VUE/ecard/{index.d.ts → index.vue.d.ts} +25 -44
  197. package/dist/types/__VUE/elevator/{index.d.ts → index.vue.d.ts} +39 -14
  198. package/dist/types/__VUE/empty/{index.d.ts → index.vue.d.ts} +9 -14
  199. package/dist/types/__VUE/fixednav/{index.d.ts → index.vue.d.ts} +18 -34
  200. package/dist/types/__VUE/form/{index.d.ts → index.vue.d.ts} +5 -6
  201. package/dist/types/__VUE/formitem/{index.d.ts → index.vue.d.ts} +29 -55
  202. package/dist/types/__VUE/grid/common.d.ts +3 -3
  203. package/dist/types/__VUE/grid/{index.d.ts → index.vue.d.ts} +24 -40
  204. package/dist/types/__VUE/griditem/{index.d.ts → index.vue.d.ts} +19 -26
  205. package/dist/types/__VUE/icon/{index.d.ts → index.vue.d.ts} +15 -26
  206. package/dist/types/__VUE/imagepreview/index.d.ts +20 -121
  207. package/dist/types/__VUE/imagepreview/index.vue.d.ts +108 -0
  208. package/dist/types/__VUE/indicator/{index.d.ts → index.vue.d.ts} +13 -24
  209. package/dist/types/__VUE/infiniteloading/{index.d.ts → index.vue.d.ts} +26 -47
  210. package/dist/types/__VUE/input/{index.d.ts → index.vue.d.ts} +81 -144
  211. package/dist/types/__VUE/input/type.d.ts +13 -0
  212. package/dist/types/__VUE/inputnumber/{index.d.ts → index.vue.d.ts} +22 -39
  213. package/dist/types/__VUE/layout/{index.d.ts → index.vue.d.ts} +1 -1
  214. package/dist/types/__VUE/list/{index.d.ts → index.vue.d.ts} +10 -14
  215. package/dist/types/__VUE/menu/{index.d.ts → index.vue.d.ts} +16 -14
  216. package/dist/types/__VUE/menuitem/{index.d.ts → index.vue.d.ts} +20 -24
  217. package/dist/types/__VUE/menuitem/type.d.ts +8 -0
  218. package/dist/types/__VUE/navbar/{index.d.ts → index.vue.d.ts} +48 -26
  219. package/dist/types/__VUE/noticebar/{index.d.ts → index.vue.d.ts} +35 -64
  220. package/dist/types/__VUE/notify/index.d.ts +12 -109
  221. package/dist/types/__VUE/notify/index.vue.d.ts +101 -0
  222. package/dist/types/__VUE/numberkeyboard/{index.d.ts → index.vue.d.ts} +41 -43
  223. package/dist/types/__VUE/oldpicker/{Column.d.ts → Column.vue.d.ts} +17 -22
  224. package/dist/types/__VUE/oldpicker/{index.d.ts → index.vue.d.ts} +75 -128
  225. package/dist/types/__VUE/overlay/{index.d.ts → index.vue.d.ts} +19 -30
  226. package/dist/types/__VUE/pagination/{index.d.ts → index.vue.d.ts} +21 -38
  227. package/dist/types/__VUE/picker/{Column.d.ts → Column.vue.d.ts} +16 -18
  228. package/dist/types/__VUE/picker/{index.d.ts → index.vue.d.ts} +79 -129
  229. package/dist/types/__VUE/popover/{index.d.ts → index.vue.d.ts} +85 -109
  230. package/dist/types/__VUE/popover/type.d.ts +6 -0
  231. package/dist/types/__VUE/popup/{index.d.ts → index.vue.d.ts} +45 -80
  232. package/dist/types/__VUE/price/{index.d.ts → index.vue.d.ts} +17 -30
  233. package/dist/types/__VUE/progress/{index.d.ts → index.vue.d.ts} +29 -53
  234. package/dist/types/__VUE/pullrefresh/{index.d.ts → index.vue.d.ts} +18 -46
  235. package/dist/types/__VUE/radio/{index.d.ts → index.vue.d.ts} +19 -34
  236. package/dist/types/__VUE/radiogroup/{index.d.ts → index.vue.d.ts} +10 -15
  237. package/dist/types/__VUE/range/{index.d.ts → index.vue.d.ts} +35 -47
  238. package/dist/types/__VUE/range/type.d.ts +5 -0
  239. package/dist/types/__VUE/rate/{index.d.ts → index.vue.d.ts} +30 -55
  240. package/dist/types/__VUE/row/{index.d.ts → index.vue.d.ts} +16 -25
  241. package/dist/types/__VUE/searchbar/{index.d.ts → index.vue.d.ts} +62 -32
  242. package/dist/types/__VUE/shortpassword/{index.d.ts → index.vue.d.ts} +25 -44
  243. package/dist/types/__VUE/sidenavbar/{index.d.ts → index.vue.d.ts} +6 -7
  244. package/dist/types/__VUE/sidenavbaritem/{index.d.ts → index.vue.d.ts} +8 -11
  245. package/dist/types/__VUE/signature/{index.d.ts → index.vue.d.ts} +13 -22
  246. package/dist/types/__VUE/skeleton/common.d.ts +3 -5
  247. package/dist/types/__VUE/skeleton/{index.d.ts → index.vue.d.ts} +24 -43
  248. package/dist/types/__VUE/sku/components/{SkuHeader.d.ts → SkuHeader.vue.d.ts} +6 -7
  249. package/dist/types/__VUE/sku/components/{SkuOperate.d.ts → SkuOperate.vue.d.ts} +14 -23
  250. package/dist/types/__VUE/sku/components/{SkuSelect.d.ts → SkuSelect.vue.d.ts} +6 -7
  251. package/dist/types/__VUE/sku/components/{SkuStepper.d.ts → SkuStepper.vue.d.ts} +12 -19
  252. package/dist/types/__VUE/sku/{index.d.ts → index.vue.d.ts} +66 -124
  253. package/dist/types/__VUE/step/{index.d.ts → index.vue.d.ts} +14 -23
  254. package/dist/types/__VUE/steps/{index.d.ts → index.vue.d.ts} +9 -14
  255. package/dist/types/__VUE/sticky/{index.d.ts → index.vue.d.ts} +14 -21
  256. package/dist/types/__VUE/subsidenavbar/{index.d.ts → index.vue.d.ts} +10 -15
  257. package/dist/types/__VUE/swipe/{index.d.ts → index.vue.d.ts} +11 -18
  258. package/dist/types/__VUE/swiper/{index.d.ts → index.vue.d.ts} +30 -50
  259. package/dist/types/__VUE/swiperitem/{index.d.ts → index.vue.d.ts} +2 -2
  260. package/dist/types/__VUE/switch/{index.d.ts → index.vue.d.ts} +28 -51
  261. package/dist/types/__VUE/tabbar/{index.d.ts → index.vue.d.ts} +17 -30
  262. package/dist/types/__VUE/tabbaritem/{index.d.ts → index.vue.d.ts} +25 -40
  263. package/dist/types/__VUE/table/common.d.ts +1 -1
  264. package/dist/types/__VUE/table/{index.d.ts → index.vue.d.ts} +14 -23
  265. package/dist/types/__VUE/tabpane/{index.d.ts → index.vue.d.ts} +11 -15
  266. package/dist/types/__VUE/tabs/common.d.ts +6 -2
  267. package/dist/types/__VUE/tabs/{index.d.ts → index.vue.d.ts} +30 -42
  268. package/dist/types/__VUE/tag/{index.d.ts → index.vue.d.ts} +21 -34
  269. package/dist/types/__VUE/tag/type.d.ts +5 -0
  270. package/dist/types/__VUE/textarea/{index.d.ts → index.vue.d.ts} +26 -45
  271. package/dist/types/__VUE/timedetail/{index.d.ts → index.vue.d.ts} +8 -11
  272. package/dist/types/__VUE/timepannel/{index.d.ts → index.vue.d.ts} +8 -11
  273. package/dist/types/__VUE/timeselect/{index.d.ts → index.vue.d.ts} +25 -29
  274. package/dist/types/__VUE/toast/index.d.ts +12 -145
  275. package/dist/types/__VUE/toast/index.vue.d.ts +134 -0
  276. package/dist/types/__VUE/uploader/{index.d.ts → index.vue.d.ts} +59 -106
  277. package/dist/types/__VUE/uploader/type.d.ts +18 -0
  278. package/dist/types/__VUE/video/{index.d.ts → index.vue.d.ts} +9 -26
  279. package/dist/types/index.d.ts +7 -2
  280. package/dist/types/nutui.d.ts +92 -92
  281. package/package.json +7 -3
  282. package/dist/packages/locale/locale/index.d.ts +0 -8
  283. package/dist/types/__VUE/audio/index.d.ts +0 -92
  284. package/dist/types/__VUE/audiooperate/index.d.ts +0 -68
@@ -1,153 +1,71 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.21-beta.3 Wed May 18 2022 18:19:57 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.22-beta.3 Wed Jun 15 2022 20:12:30 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { g as getPropByPath, i as isPromise, c as createComponent } from "./component.js";
7
- import { computed, reactive, provide, watch, resolveComponent, openBlock, createElementBlock, withModifiers, createVNode, withCtx, renderSlot } from "vue";
8
- import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
6
+ import { i as e, g as r, a as t, c as o } from "./component.js";
7
+ import { computed as l, reactive as s, provide as n, watch as a, resolveComponent as i, openBlock as m, createElementBlock as p, withModifiers as u, createVNode as c, withCtx as d, renderSlot as f } from "vue";
8
+ import { _ as h } from "./plugin-vue_export-helper.js";
9
9
  import "../locale/lang";
10
- const component = {
11
- props: {
12
- modelValue: {
13
- type: Object,
14
- default: {}
15
- }
16
- },
17
- components: {},
18
- emits: ["validate"],
19
- setup(props, { emit, slots }) {
20
- const formErrorTip = computed(() => reactive({}));
21
- provide("formErrorTip", formErrorTip);
22
- const clearErrorTips = (value = props.modelValue) => {
23
- Object.keys(formErrorTip.value).forEach((item) => {
24
- formErrorTip.value[item] = "";
25
- });
26
- };
27
- const reset = () => {
28
- clearErrorTips();
29
- };
30
- watch(() => props.modelValue, (value) => {
31
- clearErrorTips(value);
32
- }, { immediate: true });
33
- const findFormItem = (vnodes) => {
34
- let task = [];
35
- vnodes.forEach((vnode, index2) => {
36
- var _a, _b, _c;
37
- let type = vnode.type;
38
- type = type.name || type;
39
- if (type == "nut-form-item") {
40
- task.push({
41
- prop: (_a = vnode.props) == null ? void 0 : _a["prop"],
42
- rules: ((_b = vnode.props) == null ? void 0 : _b["rules"]) || []
43
- });
44
- } else if (Array.isArray(vnode.children) && ((_c = vnode.children) == null ? void 0 : _c.length)) {
45
- task = task.concat(findFormItem(vnode.children));
46
- }
47
- });
48
- return task;
49
- };
50
- const tipMessage = (errorMsg) => {
51
- if (errorMsg.message) {
52
- emit("validate", errorMsg);
53
- }
54
- formErrorTip.value[errorMsg.prop] = errorMsg.message;
55
- };
56
- const checkRule = (item) => {
57
- const { rules, prop } = item;
58
- const _Promise = (errorMsg) => {
59
- return new Promise((resolve, reject) => {
60
- tipMessage(errorMsg);
61
- resolve(errorMsg);
62
- });
63
- };
64
- if (!prop) {
65
- console.warn("[NutUI] <FormItem> \u4F7F\u7528 rules \u6821\u9A8C\u89C4\u5219\u65F6 , \u5FC5\u987B\u8BBE\u7F6E prop \u53C2\u6570");
66
- }
67
- let value = getPropByPath(props.modelValue, prop || "");
68
- tipMessage({ prop, message: "" });
69
- let _rules = [...rules];
70
- while (_rules.length) {
71
- const { required, validator, regex, message } = _rules.shift();
72
- const errorMsg = { prop, message };
73
- if (required) {
74
- if (!value) {
75
- return _Promise(errorMsg);
76
- }
77
- }
78
- if (regex && !regex.test(String(value))) {
79
- return _Promise(errorMsg);
80
- }
81
- if (validator) {
82
- const result = validator(value);
83
- if (isPromise(result)) {
84
- return new Promise((r, j) => {
85
- result.then((res) => {
86
- if (!res) {
87
- tipMessage(errorMsg);
88
- r(errorMsg);
89
- } else {
90
- r(true);
91
- }
92
- });
10
+ const v = { props: { modelValue: { type: Object, default: {} } }, components: {}, emits: ["validate"], setup(o2, { emit: i2, slots: m2 }) {
11
+ const p2 = l(() => s({}));
12
+ n("formErrorTip", p2);
13
+ const u2 = (e2 = o2.modelValue) => {
14
+ Object.keys(p2.value).forEach((e3) => {
15
+ p2.value[e3] = "";
16
+ });
17
+ };
18
+ a(() => o2.modelValue, (e2) => {
19
+ u2();
20
+ }, { immediate: true });
21
+ const c2 = (r2) => {
22
+ let t2 = [];
23
+ return r2.forEach((r3, o3) => {
24
+ var _a, _b, _c, _d;
25
+ let l2 = r3.type;
26
+ l2 = l2.name || l2, l2 == "nut-form-item" ? t2.push({ prop: (_a = r3.props) == null ? void 0 : _a.prop, rules: ((_b = r3.props) == null ? void 0 : _b.rules) || [] }) : Array.isArray(r3.children) && ((_c = r3.children) == null ? void 0 : _c.length) ? t2 = t2.concat(c2(r3.children)) : e(r3.children) && Object.keys(r3.children) && ((_d = r3.children) == null ? void 0 : _d.default) && (r3.children = r3.children.default(), t2 = t2.concat(c2(r3.children)));
27
+ }), t2;
28
+ }, d2 = (e2) => {
29
+ e2.message && i2("validate", e2), p2.value[e2.prop] = e2.message;
30
+ }, f2 = (e2) => {
31
+ const { rules: l2, prop: s2 } = e2, n2 = (e3) => new Promise((r2, t2) => {
32
+ d2(e3), r2(e3);
33
+ });
34
+ let a2 = r(o2.modelValue, s2 || "");
35
+ d2({ prop: s2, message: "" });
36
+ let i3 = [...l2];
37
+ for (; i3.length; ) {
38
+ const { required: e3, validator: r2, regex: o3, message: l3 } = i3.shift(), m3 = { prop: s2, message: l3 };
39
+ if (e3 && !a2)
40
+ return n2(m3);
41
+ if (o3 && !o3.test(String(a2)))
42
+ return n2(m3);
43
+ if (r2) {
44
+ const e4 = r2(a2);
45
+ if (t(e4))
46
+ return new Promise((r3, t2) => {
47
+ e4.then((e5) => {
48
+ e5 ? r3(true) : (d2(m3), r3(m3));
93
49
  });
94
- } else {
95
- if (!result) {
96
- return _Promise(errorMsg);
97
- }
98
- }
99
- }
50
+ });
51
+ if (!e4)
52
+ return n2(m3);
100
53
  }
101
- return Promise.resolve(true);
102
- };
103
- const validate = (customProp = "") => {
104
- return new Promise((resolve, reject) => {
105
- let task = findFormItem(slots.default());
106
- let errors = task.map((item) => {
107
- if (customProp) {
108
- if (customProp == item.prop) {
109
- return checkRule(item);
110
- } else {
111
- return Promise.resolve(true);
112
- }
113
- } else {
114
- return checkRule(item);
115
- }
116
- });
117
- Promise.all(errors).then((errorRes) => {
118
- errorRes = errorRes.filter((item) => item != true);
119
- const res = { valid: true, errors: [] };
120
- if (errorRes.length) {
121
- res.valid = false;
122
- res.errors = errorRes;
123
- }
124
- resolve(res);
125
- });
126
- });
127
- };
128
- const onSubmit = () => {
129
- validate();
130
- return false;
131
- };
132
- return { validate, reset, onSubmit, formErrorTip };
133
- }
134
- };
135
- const { create } = createComponent("form");
136
- const _sfc_main = create(component);
137
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
138
- const _component_nut_cell_group = resolveComponent("nut-cell-group");
139
- return openBlock(), createElementBlock("form", {
140
- class: "nut-form",
141
- action: "#",
142
- onSubmit: _cache[0] || (_cache[0] = withModifiers((...args) => _ctx.onSubmit && _ctx.onSubmit(...args), ["prevent"]))
143
- }, [
144
- createVNode(_component_nut_cell_group, null, {
145
- default: withCtx(() => [
146
- renderSlot(_ctx.$slots, "default")
147
- ]),
148
- _: 3
149
- })
150
- ], 32);
151
- }
152
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
153
- export { index as default };
54
+ }
55
+ return Promise.resolve(true);
56
+ }, h2 = (e2 = "") => new Promise((r2, t2) => {
57
+ let o3 = c2(m2.default()).map((r3) => e2 ? e2 == r3.prop ? f2(r3) : Promise.resolve(true) : f2(r3));
58
+ Promise.all(o3).then((e3) => {
59
+ const t3 = { valid: true, errors: [] };
60
+ (e3 = e3.filter((e4) => e4 != 1)).length && (t3.valid = false, t3.errors = e3), r2(t3);
61
+ });
62
+ });
63
+ return { validate: h2, reset: () => {
64
+ u2();
65
+ }, onSubmit: () => (h2(), false), formErrorTip: p2 };
66
+ } }, { create: g } = o("form");
67
+ var y = h(g(v), [["render", function(e2, r2, t2, o2, l2, s2) {
68
+ const n2 = i("nut-cell-group");
69
+ return m(), p("form", { class: "nut-form", action: "#", onSubmit: r2[0] || (r2[0] = u(() => false, ["prevent"])) }, [c(n2, null, { default: d(() => [f(e2.$slots, "default")]), _: 3 })], 32);
70
+ }]]);
71
+ export { y as default };
@@ -1,115 +1,20 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.21-beta.3 Wed May 18 2022 18:19:57 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.22-beta.3 Wed Jun 15 2022 20:12:30 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { p as pxCheck } from "./pxCheck.js";
7
- import { inject, provide, computed, resolveComponent, openBlock, createBlock, normalizeClass, normalizeStyle, withCtx, createElementBlock, toDisplayString, createCommentVNode, createElementVNode, renderSlot } from "vue";
8
- import { c as createComponent } from "./component.js";
9
- import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
6
+ import { p as e } from "./pxCheck.js";
7
+ import { inject as t, provide as r, computed as l, resolveComponent as o, openBlock as s, createBlock as a, normalizeClass as n, normalizeStyle as i, withCtx as p, createElementBlock as u, renderSlot as y, createTextVNode as m, toDisplayString as d, createCommentVNode as f, createElementVNode as g } from "vue";
8
+ import { c } from "./component.js";
9
+ import { _ as b } from "./plugin-vue_export-helper.js";
10
10
  import "../locale/lang";
11
- const { componentName, create } = createComponent("form-item");
12
- const _sfc_main = create({
13
- inheritAttrs: false,
14
- props: {
15
- prop: {
16
- type: String,
17
- default: ""
18
- },
19
- label: {
20
- type: String,
21
- default: ""
22
- },
23
- rules: {
24
- type: Array,
25
- default: () => {
26
- return [];
27
- }
28
- },
29
- required: {
30
- type: Boolean,
31
- default: false
32
- },
33
- showErrorMessage: {
34
- type: Boolean,
35
- default: true
36
- },
37
- showErrorLine: {
38
- type: Boolean,
39
- default: true
40
- },
41
- labelWidth: {
42
- type: [String, Number],
43
- default: ""
44
- },
45
- labelAlign: {
46
- type: String,
47
- default: ""
48
- },
49
- errorMessageAlign: {
50
- type: String,
51
- default: ""
52
- },
53
- bodyAlign: {
54
- type: String,
55
- default: ""
56
- }
57
- },
58
- components: {},
59
- emits: [""],
60
- setup(props, { emit }) {
61
- const parent = inject("formErrorTip");
62
- provide("form", {
63
- props
64
- });
65
- const labelStyle = computed(() => {
66
- return {
67
- width: pxCheck(props.labelWidth),
68
- textAlign: props.labelAlign
69
- };
70
- });
71
- const bodyStyle = computed(() => {
72
- return {
73
- textAlign: props.bodyAlign
74
- };
75
- });
76
- const errorMessageStyle = computed(() => {
77
- return {
78
- textAlign: props.errorMessageAlign
79
- };
80
- });
81
- return { parent, labelStyle, bodyStyle, errorMessageStyle };
82
- }
83
- });
84
- const _hoisted_1 = { class: "nut-cell__value nut-form-item__body" };
85
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
86
- const _component_nut_cell = resolveComponent("nut-cell");
87
- return openBlock(), createBlock(_component_nut_cell, {
88
- class: normalizeClass(["nut-form-item", [{ error: _ctx.parent[_ctx.prop], line: _ctx.showErrorLine }, _ctx.$attrs.class]]),
89
- style: normalizeStyle(_ctx.$attrs.style)
90
- }, {
91
- default: withCtx(() => [
92
- _ctx.label ? (openBlock(), createElementBlock("view", {
93
- key: 0,
94
- class: normalizeClass(["nut-cell__title nut-form-item__label", { required: _ctx.required }]),
95
- style: normalizeStyle(_ctx.labelStyle)
96
- }, toDisplayString(_ctx.label), 7)) : createCommentVNode("", true),
97
- createElementVNode("view", _hoisted_1, [
98
- createElementVNode("view", {
99
- class: "nut-form-item__body__slots",
100
- style: normalizeStyle(_ctx.bodyStyle)
101
- }, [
102
- renderSlot(_ctx.$slots, "default")
103
- ], 4),
104
- _ctx.parent[_ctx.prop] && _ctx.showErrorMessage ? (openBlock(), createElementBlock("view", {
105
- key: 0,
106
- class: "nut-form-item__body__tips",
107
- style: normalizeStyle(_ctx.errorMessageStyle)
108
- }, toDisplayString(_ctx.parent[_ctx.prop]), 5)) : createCommentVNode("", true)
109
- ])
110
- ]),
111
- _: 3
112
- }, 8, ["class", "style"]);
113
- }
114
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
115
- export { index as default };
11
+ const { componentName: _, create: S } = c("form-item"), A = S({ inheritAttrs: false, props: { prop: { type: String, default: "" }, label: { type: String, default: "" }, rules: { type: Array, default: () => [] }, required: { type: Boolean, default: false }, showErrorMessage: { type: Boolean, default: true }, showErrorLine: { type: Boolean, default: true }, labelWidth: { type: [String, Number], default: "" }, labelAlign: { type: String, default: "" }, errorMessageAlign: { type: String, default: "" }, bodyAlign: { type: String, default: "" } }, components: {}, emits: [""], setup(o2, { emit: s2 }) {
12
+ const a2 = t("formErrorTip");
13
+ r("form", { props: o2 });
14
+ return { parent: a2, labelStyle: l(() => ({ width: e(o2.labelWidth), textAlign: o2.labelAlign })), bodyStyle: l(() => ({ textAlign: o2.bodyAlign })), errorMessageStyle: l(() => ({ textAlign: o2.errorMessageAlign })) };
15
+ } }), h = { class: "nut-cell__value nut-form-item__body" };
16
+ var w = b(A, [["render", function(e2, t2, r2, l2, c2, b2) {
17
+ const _2 = o("nut-cell");
18
+ return s(), a(_2, { class: n(["nut-form-item", [{ error: e2.parent[e2.prop], line: e2.showErrorLine }, e2.$attrs.class]]), style: i(e2.$attrs.style) }, { default: p(() => [e2.label ? (s(), u("view", { key: 0, class: n(["nut-cell__title nut-form-item__label", { required: e2.required }]), style: i(e2.labelStyle) }, [y(e2.$slots, "label", {}, () => [m(d(e2.label), 1)])], 6)) : f("", true), g("view", h, [g("view", { class: "nut-form-item__body__slots", style: i(e2.bodyStyle) }, [y(e2.$slots, "default")], 4), e2.parent[e2.prop] && e2.showErrorMessage ? (s(), u("view", { key: 0, class: "nut-form-item__body__tips", style: i(e2.errorMessageStyle) }, d(e2.parent[e2.prop]), 5)) : f("", true)])]), _: 3 }, 8, ["class", "style"]);
19
+ }]]);
20
+ export { w as default };
@@ -1,13 +1,12 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.21-beta.3 Wed May 18 2022 18:19:57 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.22-beta.3 Wed Jun 15 2022 20:12:30 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { c as createComponent } from "./component.js";
7
- import { c as component } from "./common.js";
6
+ import { c as o } from "./component.js";
7
+ import { c as m } from "./common.js";
8
8
  import "vue";
9
9
  import "../locale/lang";
10
10
  import "./pxCheck.js";
11
- const { create } = createComponent("grid");
12
- const _sfc_main = create(component);
13
- export { _sfc_main as default };
11
+ const { create: r } = o("grid"), t = r(m);
12
+ export { t as default };
@@ -1,150 +1,39 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.21-beta.3 Wed May 18 2022 18:19:57 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.22-beta.3 Wed Jun 15 2022 20:12:30 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { inject, getCurrentInstance, onUnmounted, computed, ref, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot, Fragment, createBlock, toDisplayString } from "vue";
7
- import { u as useRouter } from "./index.js";
8
- import { c as createComponent } from "./component.js";
9
- import { p as pxCheck } from "./pxCheck.js";
10
- import { G as GRID_KEY } from "./common.js";
11
- import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
6
+ import { inject as e, getCurrentInstance as t, onUnmounted as o, computed as r, ref as n, resolveComponent as i, openBlock as l, createElementBlock as c, normalizeClass as s, normalizeStyle as a, createElementVNode as u, renderSlot as p, Fragment as m, createBlock as d, toDisplayString as f } from "vue";
7
+ import { u as g } from "./index.js";
8
+ import { c as y } from "./component.js";
9
+ import { p as $ } from "./pxCheck.js";
10
+ import { G as k } from "./common.js";
11
+ import { _ as x } from "./plugin-vue_export-helper.js";
12
12
  import "../locale/lang";
13
- function useInject(key) {
14
- const parent = inject(key, null);
15
- if (parent) {
16
- const instance = getCurrentInstance();
17
- const { add, remove, internalChildren } = parent;
18
- add(instance);
19
- onUnmounted(() => remove(instance));
20
- const index2 = computed(() => internalChildren.indexOf(instance));
21
- return {
22
- parent,
23
- index: index2
24
- };
25
- }
26
- return {
27
- parent: null,
28
- index: ref(-1)
29
- };
30
- }
31
- const { create, componentName } = createComponent("grid-item");
32
- const _sfc_main = create({
33
- props: {
34
- text: {
35
- type: String
36
- },
37
- icon: {
38
- type: String
39
- },
40
- iconSize: {
41
- type: [Number, String]
42
- },
43
- iconColor: {
44
- type: String
45
- },
46
- to: {
47
- type: [String, Object]
48
- },
49
- url: {
50
- type: String,
51
- default: ""
52
- },
53
- replace: {
54
- type: Boolean,
55
- default: false
13
+ const { create: C, componentName: S } = y("grid-item"), v = C({ props: { text: { type: String }, icon: { type: String }, iconSize: { type: [Number, String] }, iconColor: { type: String }, to: { type: [String, Object] }, url: { type: String, default: "" }, replace: { type: Boolean, default: false } }, emits: ["click"], setup(i2, { emit: l2 }) {
14
+ const c2 = function(i3) {
15
+ const l3 = e(i3, null);
16
+ if (l3) {
17
+ const e2 = t(), { add: n2, remove: i4, internalChildren: c3 } = l3;
18
+ return n2(e2), o(() => i4(e2)), { parent: l3, index: r(() => c3.indexOf(e2)) };
56
19
  }
57
- },
58
- emits: ["click"],
59
- setup(props, { emit }) {
60
- const Parent = useInject(GRID_KEY);
61
- if (!Parent.parent)
62
- return;
63
- const index2 = Parent.index;
64
- const parent = Parent.parent.props;
65
- const rootClass = computed(() => {
66
- const prefixCls = componentName;
67
- return {
68
- [prefixCls]: true
69
- };
70
- });
71
- const rootStyle = computed(() => {
72
- const style = {
73
- flexBasis: `${100 / +parent.columnNum}%`
74
- };
75
- if (parent.square) {
76
- style.paddingTop = `${100 / +parent.columnNum}%`;
77
- } else if (parent.gutter) {
78
- style.paddingRight = pxCheck(parent.gutter);
79
- if (index2.value >= parent.columnNum) {
80
- style.marginTop = pxCheck(parent.gutter);
81
- }
82
- }
83
- return style;
84
- });
85
- const contentClass = computed(() => {
86
- const prefixCls = `${componentName}__content`;
87
- return {
88
- [`${prefixCls}`]: true,
89
- [`${prefixCls}--border`]: parent.border,
90
- [`${prefixCls}--surround`]: parent.border && parent.gutter,
91
- [`${prefixCls}--center`]: parent.center,
92
- [`${prefixCls}--square`]: parent.square,
93
- [`${prefixCls}--reverse`]: parent.reverse,
94
- [`${prefixCls}--${parent.direction}`]: !!parent.direction,
95
- [`${prefixCls}--clickable`]: parent.clickable || props.to || props.url
96
- };
97
- });
98
- const iconProps = computed(() => {
99
- return {
100
- name: props.icon,
101
- size: props.iconSize || parent.iconSize,
102
- color: props.iconColor || parent.iconColor
103
- };
104
- });
105
- const router = useRouter();
106
- const handleClick = (event) => {
107
- emit("click", event);
108
- if (props.to && router) {
109
- router[props.replace ? "replace" : "push"](props.to);
110
- } else if (props.url) {
111
- props.replace ? location.replace(props.url) : location.href = props.url;
112
- }
113
- };
114
- return {
115
- rootClass,
116
- rootStyle,
117
- contentClass,
118
- iconProps,
119
- handleClick
120
- };
121
- }
122
- });
123
- const _hoisted_1 = {
124
- key: 3,
125
- class: "nut-grid-item__text"
126
- };
127
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
128
- const _component_nut_icon = resolveComponent("nut-icon");
129
- return openBlock(), createElementBlock("view", {
130
- class: normalizeClass(_ctx.rootClass),
131
- style: normalizeStyle(_ctx.rootStyle),
132
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
133
- }, [
134
- createElementVNode("view", {
135
- class: normalizeClass(_ctx.contentClass)
136
- }, [
137
- _ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
138
- _ctx.$slots.icon ? renderSlot(_ctx.$slots, "icon", { key: 0 }) : (openBlock(), createBlock(_component_nut_icon, {
139
- key: 1,
140
- name: _ctx.iconProps.name,
141
- size: _ctx.iconProps.size,
142
- color: _ctx.iconProps.color
143
- }, null, 8, ["name", "size", "color"])),
144
- _ctx.$slots.text ? renderSlot(_ctx.$slots, "text", { key: 2 }) : (openBlock(), createElementBlock("view", _hoisted_1, toDisplayString(_ctx.text), 1))
145
- ], 64))
146
- ], 2)
147
- ], 6);
148
- }
149
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
150
- export { index as default };
20
+ return { parent: null, index: n(-1) };
21
+ }(k);
22
+ if (!c2.parent)
23
+ return;
24
+ const s2 = c2.index, a2 = c2.parent.props, u2 = r(() => ({ [S]: true })), p2 = r(() => {
25
+ const e2 = { flexBasis: 100 / +a2.columnNum + "%" };
26
+ return a2.square ? e2.paddingTop = 100 / +a2.columnNum + "%" : a2.gutter && (e2.paddingRight = $(a2.gutter), s2.value >= a2.columnNum && (e2.marginTop = $(a2.gutter))), e2;
27
+ }), m2 = r(() => {
28
+ const e2 = `${S}__content`;
29
+ return { [`${e2}`]: true, [`${e2}--border`]: a2.border, [`${e2}--surround`]: a2.border && a2.gutter, [`${e2}--center`]: a2.center, [`${e2}--square`]: a2.square, [`${e2}--reverse`]: a2.reverse, [`${e2}--${a2.direction}`]: !!a2.direction, [`${e2}--clickable`]: a2.clickable || i2.to || i2.url };
30
+ }), d2 = r(() => ({ name: i2.icon, size: i2.iconSize || a2.iconSize, color: i2.iconColor || a2.iconColor })), f2 = g();
31
+ return { rootClass: u2, rootStyle: p2, contentClass: m2, iconProps: d2, handleClick: (e2) => {
32
+ l2("click", e2), i2.to && f2 ? f2[i2.replace ? "replace" : "push"](i2.to) : i2.url && (i2.replace ? location.replace(i2.url) : location.href = i2.url);
33
+ } };
34
+ } }), h = { key: 3, class: "nut-grid-item__text" };
35
+ var b = x(v, [["render", function(e2, t2, o2, r2, n2, g2) {
36
+ const y2 = i("nut-icon");
37
+ return l(), c("view", { class: s(e2.rootClass), style: a(e2.rootStyle), onClick: t2[0] || (t2[0] = (...t3) => e2.handleClick && e2.handleClick(...t3)) }, [u("view", { class: s(e2.contentClass) }, [e2.$slots.default ? p(e2.$slots, "default", { key: 0 }) : (l(), c(m, { key: 1 }, [e2.$slots.icon ? p(e2.$slots, "icon", { key: 0 }) : (l(), d(y2, { key: 1, name: e2.iconProps.name, size: e2.iconProps.size, color: e2.iconProps.color }, null, 8, ["name", "size", "color"])), e2.$slots.text ? p(e2.$slots, "text", { key: 2 }) : (l(), c("view", h, f(e2.text), 1))], 64))], 2)], 6);
38
+ }]]);
39
+ export { b as default };
@@ -1,45 +1,20 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.21-beta.3 Wed May 18 2022 18:19:57 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.22-beta.3 Wed Jun 15 2022 20:12:30 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { h } from "vue";
7
- import { c as createComponent } from "./component.js";
8
- import { p as pxCheck } from "./pxCheck.js";
6
+ import { h as t } from "vue";
7
+ import { c as e } from "./component.js";
8
+ import { p as i } from "./pxCheck.js";
9
9
  import "../locale/lang";
10
- const { componentName, create } = createComponent("icon");
11
- const _sfc_main = create({
12
- props: {
13
- name: { type: String, default: "" },
14
- size: { type: [String, Number], default: "" },
15
- classPrefix: { type: String, default: "nut-icon" },
16
- fontClassName: { type: String, default: "nutui-iconfont" },
17
- color: { type: String, default: "" },
18
- tag: { type: String, default: "i" }
19
- },
20
- emits: ["click"],
21
- setup(props, { emit, slots }) {
22
- const handleClick = (event) => {
23
- emit("click", event);
24
- };
25
- const isImage = () => {
26
- return props.name ? props.name.indexOf("/") !== -1 : false;
27
- };
28
- return () => {
29
- var _a;
30
- const _isImage = isImage();
31
- return h(_isImage ? "img" : props.tag, {
32
- class: _isImage ? `${componentName}__img` : `${props.fontClassName} ${componentName} ${props.classPrefix}-${props.name}`,
33
- style: {
34
- color: props.color,
35
- fontSize: pxCheck(props.size),
36
- width: pxCheck(props.size),
37
- height: pxCheck(props.size)
38
- },
39
- onClick: handleClick,
40
- src: _isImage ? props.name : ""
41
- }, (_a = slots.default) == null ? void 0 : _a.call(slots));
42
- };
43
- }
44
- });
45
- export { _sfc_main as default };
10
+ const { componentName: n, create: o } = e("icon"), a = o({ props: { name: { type: String, default: "" }, size: { type: [String, Number], default: "" }, classPrefix: { type: String, default: "nut-icon" }, fontClassName: { type: String, default: "nutui-iconfont" }, color: { type: String, default: "" }, tag: { type: String, default: "i" } }, emits: ["click"], setup(e2, { emit: o2, slots: a2 }) {
11
+ const s = (t2) => {
12
+ o2("click", t2);
13
+ };
14
+ return () => {
15
+ var _a;
16
+ const o3 = !!e2.name && e2.name.indexOf("/") !== -1;
17
+ return t(o3 ? "img" : e2.tag, { class: o3 ? `${n}__img` : `${e2.fontClassName} ${n} ${e2.classPrefix}-${e2.name}`, style: { color: e2.color, fontSize: i(e2.size), width: i(e2.size), height: i(e2.size) }, onClick: s, src: o3 ? e2.name : "" }, (_a = a2.default) == null ? void 0 : _a.call(a2));
18
+ };
19
+ } });
20
+ export { a as default };