@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
@@ -5,400 +5,96 @@ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
6
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
7
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
8
+ var __spreadValues = (a2, b2) => {
9
+ for (var prop in b2 || (b2 = {}))
10
+ if (__hasOwnProp.call(b2, prop))
11
+ __defNormalProp(a2, prop, b2[prop]);
12
12
  if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
13
+ for (var prop of __getOwnPropSymbols(b2)) {
14
+ if (__propIsEnum.call(b2, prop))
15
+ __defNormalProp(a2, prop, b2[prop]);
16
16
  }
17
- return a;
17
+ return a2;
18
18
  };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
19
+ var __spreadProps = (a2, b2) => __defProps(a2, __getOwnPropDescs(b2));
20
20
  /*!
21
- * @nutui/nutui v3.1.21-beta.3 Wed May 18 2022 18:19:57 GMT+0800 (中国标准时间)
21
+ * @nutui/nutui v3.1.22-beta.3 Wed Jun 15 2022 20:12:30 GMT+0800 (中国标准时间)
22
22
  * (c) 2022 @jdf2e.
23
23
  * Released under the MIT License.
24
24
  */
25
- import { h, ref, reactive, computed, watch, onMounted, onActivated, onDeactivated, onUnmounted, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, withDirectives, normalizeStyle, renderSlot, createBlock, createCommentVNode, createElementVNode, createTextVNode, toDisplayString, withModifiers, createVNode, vShow, Fragment, renderList } from "vue";
26
- import { c as createComponent } from "./component.js";
27
- import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
25
+ import { h as e, ref as t, reactive as l, computed as o, watch as i, onMounted as n, onActivated as s, onDeactivated as a, onUnmounted as c, toRefs as r, resolveComponent as d, openBlock as p, createElementBlock as u, normalizeClass as m, withDirectives as h, normalizeStyle as y, renderSlot as f, createBlock as g, createCommentVNode as k, createElementVNode as w, createTextVNode as v, toDisplayString as C, withModifiers as b, createVNode as S, vShow as I, Fragment as L, renderList as x } from "vue";
26
+ import { c as A } from "./component.js";
27
+ import { _ as B } from "./plugin-vue_export-helper.js";
28
28
  import "../locale/lang";
29
- const { componentName, create } = createComponent("noticebar");
30
- const _sfc_main = create({
31
- props: {
32
- direction: {
33
- type: String,
34
- default: "across"
35
- },
36
- list: {
37
- type: Array,
38
- default: () => {
39
- return [];
40
- }
41
- },
42
- standTime: {
43
- type: Number,
44
- default: 1e3
45
- },
46
- complexAm: {
47
- type: Boolean,
48
- default: false
49
- },
50
- height: {
51
- type: Number,
52
- default: 40
53
- },
54
- text: {
55
- type: String,
56
- default: ""
57
- },
58
- closeMode: {
59
- type: Boolean,
60
- default: false
61
- },
62
- wrapable: {
63
- type: Boolean,
64
- default: false
65
- },
66
- leftIcon: { type: String, default: "" },
67
- rightIcon: { type: String, default: "" },
68
- color: {
69
- type: String,
70
- default: ""
71
- },
72
- background: {
73
- type: String,
74
- default: ""
75
- },
76
- delay: {
77
- type: [String, Number],
78
- default: 1
79
- },
80
- scrollable: {
81
- type: Boolean,
82
- default: null
83
- },
84
- speed: {
85
- type: Number,
86
- default: 50
29
+ const { componentName: $, create: N } = A("noticebar"), T = N({ props: { direction: { type: String, default: "across" }, list: { type: Array, default: () => [] }, standTime: { type: Number, default: 1e3 }, complexAm: { type: Boolean, default: false }, height: { type: Number, default: 40 }, text: { type: String, default: "" }, closeMode: { type: Boolean, default: false }, wrapable: { type: Boolean, default: false }, leftIcon: { type: String, default: "" }, rightIcon: { type: String, default: "" }, color: { type: String, default: "" }, background: { type: String, default: "" }, delay: { type: [String, Number], default: 1 }, scrollable: { type: Boolean, default: null }, speed: { type: Number, default: 50 } }, components: { ScrollItem: function(t2) {
30
+ return t2.item.props.style = t2.style, t2.item.key = t2.key, e(t2.item);
31
+ } }, emits: ["click", "close"], setup(e2, { emit: d2, slots: p2 }) {
32
+ const u2 = t(null), m2 = t(null), h2 = l({ wrapWidth: 0, firstRound: true, duration: 0, offsetWidth: 0, showNoticeBar: true, animationClass: "", animate: false, scrollList: [], distance: 0, timer: null, keepAlive: false, isCanScroll: null }), y2 = o(() => ({ [$]: true })), f2 = o(() => h2.isCanScroll == null ? e2.wrapable : !h2.isCanScroll && !e2.wrapable), g2 = o(() => e2.leftIcon != "close"), k2 = o(() => {
33
+ let t2 = {};
34
+ return e2.color && (t2.color = e2.color), e2.background && (t2.background = e2.background), e2.direction == "vertical" && (t2.height = `${e2.height}px`), t2;
35
+ }), w2 = o(() => ({ animationDelay: (h2.firstRound ? e2.delay : 0) + "s", animationDuration: h2.duration + "s", transform: `translateX(${h2.firstRound ? 0 : h2.wrapWidth + "px"})` })), v2 = o(() => {
36
+ let t2 = "";
37
+ return e2.leftIcon && (t2 = e2.leftIcon), t2;
38
+ }), C2 = o(() => {
39
+ let t2 = {};
40
+ if (e2.complexAm)
41
+ t2 = { transform: `translateY(${h2.distance}px)` };
42
+ else if (h2.animate) {
43
+ let l2 = ~~(e2.height / e2.speed / 4);
44
+ t2 = { transition: `all ${l2 == 0 ? ~~(e2.height / e2.speed) : l2}s`, "margin-top": `-${e2.height}px` };
87
45
  }
88
- },
89
- components: {
90
- ScrollItem: function(props) {
91
- props.item.props.style = props.style;
92
- props.item.key = props.key;
93
- return h(props.item);
94
- }
95
- },
96
- emits: ["click", "close"],
97
- setup(props, { emit, slots }) {
98
- const wrap = ref(null);
99
- const content = ref(null);
100
- const state = reactive({
101
- wrapWidth: 0,
102
- firstRound: true,
103
- duration: 0,
104
- offsetWidth: 0,
105
- showNoticeBar: true,
106
- animationClass: "",
107
- animate: false,
108
- scrollList: [],
109
- distance: 0,
110
- timer: null,
111
- keepAlive: false,
112
- isCanScroll: null
113
- });
114
- const classes = computed(() => {
115
- const prefixCls = componentName;
116
- return {
117
- [prefixCls]: true
118
- };
119
- });
120
- const isEllipsis = computed(() => {
121
- if (state.isCanScroll == null) {
122
- return props.wrapable;
123
- } else {
124
- return !state.isCanScroll && !props.wrapable;
125
- }
126
- });
127
- const iconShow = computed(() => {
128
- if (props.leftIcon == "close") {
129
- return false;
130
- } else {
131
- return true;
132
- }
133
- });
134
- const barStyle = computed(() => {
135
- let style = {};
136
- props.color && (style.color = props.color);
137
- props.background && (style.background = props.background);
138
- if (props.direction == "vertical") {
139
- style.height = `${props.height}px`;
140
- }
141
- return style;
142
- });
143
- const contentStyle = computed(() => {
144
- return {
145
- animationDelay: (state.firstRound ? props.delay : 0) + "s",
146
- animationDuration: state.duration + "s",
147
- transform: `translateX(${state.firstRound ? 0 : state.wrapWidth + "px"})`
148
- };
149
- });
150
- const iconBg = computed(() => {
151
- let iconBg2 = "";
152
- if (props.leftIcon) {
153
- iconBg2 = props.leftIcon;
154
- }
155
- return iconBg2;
156
- });
157
- const horseLampStyle = computed(() => {
158
- let styles = {};
159
- if (props.complexAm) {
160
- styles = {
161
- transform: `translateY(${state.distance}px)`
162
- };
163
- } else {
164
- if (state.animate) {
165
- let a = ~~(props.height / props.speed / 4);
166
- styles = {
167
- transition: `all ${a == 0 ? ~~(props.height / props.speed) : a}s`,
168
- "margin-top": `-${props.height}px`
169
- };
170
- }
171
- }
172
- return styles;
173
- });
174
- watch(() => props.text, (value) => {
175
- initScrollWrap(value);
176
- });
177
- watch(() => props.list, (value) => {
178
- state.scrollList = [].concat(value);
179
- });
180
- const initScrollWrap = (value) => {
181
- if (state.showNoticeBar == false) {
46
+ return t2;
47
+ });
48
+ i(() => e2.text, (e3) => {
49
+ b2();
50
+ }), i(() => e2.list, (e3) => {
51
+ h2.scrollList = [].concat(e3);
52
+ });
53
+ const b2 = (t2) => {
54
+ h2.showNoticeBar != 0 && setTimeout(() => {
55
+ if (!u2.value || !m2.value)
182
56
  return;
183
- }
184
- setTimeout(() => {
185
- if (!wrap.value || !content.value) {
186
- return;
187
- }
188
- const wrapWidth = wrap.value.getBoundingClientRect().width;
189
- const offsetWidth = content.value.getBoundingClientRect().width;
190
- state.isCanScroll = props.scrollable == null ? offsetWidth > wrapWidth : props.scrollable;
191
- console.log(111, state.isCanScroll);
192
- if (state.isCanScroll) {
193
- state.wrapWidth = wrapWidth;
194
- state.offsetWidth = offsetWidth;
195
- state.duration = offsetWidth / props.speed;
196
- state.animationClass = "play";
197
- } else {
198
- state.animationClass = "";
199
- }
200
- }, 0);
201
- };
202
- const handleClick = (event) => {
203
- emit("click", event);
204
- };
205
- const onClickIcon = (event) => {
206
- if (props.closeMode) {
207
- state.showNoticeBar = !props.closeMode;
208
- }
209
- emit("close", event);
210
- };
211
- const onAnimationEnd = () => {
212
- state.firstRound = false;
213
- setTimeout(() => {
214
- state.duration = (state.offsetWidth + state.wrapWidth) / props.speed;
215
- state.animationClass = "play-infinite";
216
- }, 0);
217
- };
218
- const startRollEasy = () => {
219
- showhorseLamp();
220
- state.timer = setInterval(showhorseLamp, ~~(props.height / props.speed / 4 * 1e3) + props.standTime);
221
- };
222
- const showhorseLamp = () => {
223
- state.animate = true;
224
- setTimeout(() => {
225
- state.scrollList.push(state.scrollList[0]);
226
- state.scrollList.shift();
227
- state.animate = false;
228
- }, ~~(props.height / props.speed / 4 * 1e3));
229
- };
230
- const startRoll = () => {
231
- state.timer = setInterval(() => {
232
- let chunk = 100;
233
- for (let i = 0; i < chunk; i++) {
234
- scroll(i, i < chunk - 1 ? false : true);
235
- }
236
- }, props.standTime + 100 * props.speed);
237
- };
238
- const scroll = (n, last) => {
239
- setTimeout(() => {
240
- state.distance -= props.height / 100;
241
- if (last) {
242
- state.scrollList.push(state.scrollList[0]);
243
- state.scrollList.shift();
244
- state.distance = 0;
245
- }
246
- }, n * props.speed);
247
- };
248
- const go = (item) => {
249
- emit("click", item);
250
- };
251
- const handleClickIcon = () => {
252
- emit("close", state.scrollList[0]);
253
- };
254
- onMounted(() => {
255
- if (props.direction == "vertical") {
256
- if (slots.default) {
257
- state.scrollList = [].concat(slots.default()[0].children);
258
- } else {
259
- state.scrollList = [].concat(props.list);
260
- }
261
- setTimeout(() => {
262
- props.complexAm ? startRoll() : startRollEasy();
263
- }, props.standTime);
264
- } else {
265
- initScrollWrap(props.text);
266
- }
267
- });
268
- onActivated(() => {
269
- if (state.keepAlive) {
270
- state.keepAlive = false;
271
- }
272
- });
273
- onDeactivated(() => {
274
- state.keepAlive = true;
275
- clearInterval(state.timer);
276
- });
277
- onUnmounted(() => {
278
- clearInterval(state.timer);
279
- });
280
- return __spreadProps(__spreadValues(__spreadValues({}, toRefs(props)), toRefs(state)), {
281
- isEllipsis,
282
- classes,
283
- iconShow,
284
- barStyle,
285
- contentStyle,
286
- iconBg,
287
- horseLampStyle,
288
- wrap,
289
- content,
290
- handleClick,
291
- onClickIcon,
292
- onAnimationEnd,
293
- go,
294
- handleClickIcon,
295
- slots
296
- });
297
- }
298
- });
299
- const _hoisted_1 = {
300
- ref: "wrap",
301
- class: "wrap"
302
- };
303
- const _hoisted_2 = ["onClick"];
304
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
305
- const _component_nut_icon = resolveComponent("nut-icon");
306
- const _component_ScrollItem = resolveComponent("ScrollItem");
307
- return openBlock(), createElementBlock("view", {
308
- class: normalizeClass(_ctx.classes)
309
- }, [
310
- _ctx.direction == "across" ? withDirectives((openBlock(), createElementBlock("view", {
311
- key: 0,
312
- class: normalizeClass(["nut-noticebar-page", { withicon: _ctx.closeMode, close: _ctx.closeMode, wrapable: _ctx.wrapable }]),
313
- style: normalizeStyle(_ctx.barStyle),
314
- onClick: _cache[3] || (_cache[3] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
315
- }, [
316
- _ctx.iconShow ? (openBlock(), createElementBlock("view", {
317
- key: 0,
318
- class: "left-icon",
319
- style: normalizeStyle({ "background-image": `url(${_ctx.iconBg})` })
320
- }, [
321
- renderSlot(_ctx.$slots, "left-icon", {}, () => [
322
- !_ctx.iconBg ? (openBlock(), createBlock(_component_nut_icon, {
323
- key: 0,
324
- name: "notice",
325
- size: "16",
326
- color: _ctx.color
327
- }, null, 8, ["color"])) : createCommentVNode("", true)
328
- ])
329
- ], 4)) : createCommentVNode("", true),
330
- createElementVNode("view", _hoisted_1, [
331
- createElementVNode("view", {
332
- ref: "content",
333
- class: normalizeClass(["content", _ctx.animationClass, { "nut-ellipsis": _ctx.isEllipsis }]),
334
- style: normalizeStyle(_ctx.contentStyle),
335
- onAnimationend: _cache[0] || (_cache[0] = (...args) => _ctx.onAnimationEnd && _ctx.onAnimationEnd(...args)),
336
- onWebkitAnimationEnd: _cache[1] || (_cache[1] = (...args) => _ctx.onAnimationEnd && _ctx.onAnimationEnd(...args))
337
- }, [
338
- renderSlot(_ctx.$slots, "default", {}, () => [
339
- createTextVNode(toDisplayString(_ctx.text), 1)
340
- ])
341
- ], 38)
342
- ], 512),
343
- _ctx.closeMode || _ctx.rightIcon ? (openBlock(), createElementBlock("view", {
344
- key: 1,
345
- class: "right-icon",
346
- onClick: _cache[2] || (_cache[2] = withModifiers((...args) => _ctx.onClickIcon && _ctx.onClickIcon(...args), ["stop"]))
347
- }, [
348
- renderSlot(_ctx.$slots, "right-icon", {}, () => [
349
- createVNode(_component_nut_icon, {
350
- name: _ctx.rightIcon ? _ctx.rightIcon : "close",
351
- color: _ctx.color
352
- }, null, 8, ["name", "color"])
353
- ])
354
- ])) : createCommentVNode("", true)
355
- ], 6)), [
356
- [vShow, _ctx.showNoticeBar]
357
- ]) : createCommentVNode("", true),
358
- _ctx.scrollList.length > 0 && _ctx.direction == "vertical" ? (openBlock(), createElementBlock("view", {
359
- key: 1,
360
- class: "nut-noticebar-vertical",
361
- style: normalizeStyle(_ctx.barStyle)
362
- }, [
363
- _ctx.slots.default ? (openBlock(), createElementBlock("view", {
364
- key: 0,
365
- class: "horseLamp_list",
366
- style: normalizeStyle(_ctx.horseLampStyle)
367
- }, [
368
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.scrollList, (item, index2) => {
369
- return openBlock(), createBlock(_component_ScrollItem, {
370
- key: index2,
371
- style: normalizeStyle({ height: _ctx.height + "px", "line-height": _ctx.height + "px" }),
372
- item
373
- }, null, 8, ["style", "item"]);
374
- }), 128))
375
- ], 4)) : (openBlock(), createElementBlock("ul", {
376
- key: 1,
377
- class: "horseLamp_list",
378
- style: normalizeStyle(_ctx.horseLampStyle)
379
- }, [
380
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.scrollList, (item, index2) => {
381
- return openBlock(), createElementBlock("li", {
382
- class: "horseLamp_list_item",
383
- key: index2,
384
- style: normalizeStyle({ height: _ctx.height }),
385
- onClick: ($event) => _ctx.go(item)
386
- }, toDisplayString(item), 13, _hoisted_2);
387
- }), 128))
388
- ], 4)),
389
- createElementVNode("view", {
390
- class: "go",
391
- onClick: _cache[4] || (_cache[4] = ($event) => !_ctx.slots.rightIcon && _ctx.handleClickIcon())
392
- }, [
393
- _ctx.slots.rightIcon ? renderSlot(_ctx.$slots, "rightIcon", { key: 0 }) : _ctx.closeMode ? (openBlock(), createBlock(_component_nut_icon, {
394
- key: 1,
395
- type: "cross",
396
- color: _ctx.color,
397
- size: "11px"
398
- }, null, 8, ["color"])) : createCommentVNode("", true)
399
- ])
400
- ], 4)) : createCommentVNode("", true)
401
- ], 2);
402
- }
403
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
404
- export { index as default };
57
+ const t3 = u2.value.getBoundingClientRect().width, l2 = m2.value.getBoundingClientRect().width;
58
+ h2.isCanScroll = e2.scrollable == null ? l2 > t3 : e2.scrollable, h2.isCanScroll ? (h2.wrapWidth = t3, h2.offsetWidth = l2, h2.duration = l2 / e2.speed, h2.animationClass = "play") : h2.animationClass = "";
59
+ }, 0);
60
+ }, S2 = () => {
61
+ h2.animate = true, setTimeout(() => {
62
+ h2.scrollList.push(h2.scrollList[0]), h2.scrollList.shift(), h2.animate = false;
63
+ }, ~~(e2.height / e2.speed / 4 * 1e3));
64
+ }, I2 = (t2, l2) => {
65
+ setTimeout(() => {
66
+ h2.distance -= e2.height / 100, l2 && (h2.scrollList.push(h2.scrollList[0]), h2.scrollList.shift(), h2.distance = 0);
67
+ }, t2 * e2.speed);
68
+ };
69
+ return n(() => {
70
+ e2.direction == "vertical" ? (p2.default ? h2.scrollList = [].concat(p2.default()[0].children) : h2.scrollList = [].concat(e2.list), setTimeout(() => {
71
+ e2.complexAm ? h2.timer = setInterval(() => {
72
+ for (let e3 = 0; e3 < 100; e3++)
73
+ I2(e3, !(e3 < 99));
74
+ }, e2.standTime + 100 * e2.speed) : (S2(), h2.timer = setInterval(S2, ~~(e2.height / e2.speed / 4 * 1e3) + e2.standTime));
75
+ }, e2.standTime)) : b2(e2.text);
76
+ }), s(() => {
77
+ h2.keepAlive && (h2.keepAlive = false);
78
+ }), a(() => {
79
+ h2.keepAlive = true, clearInterval(h2.timer);
80
+ }), c(() => {
81
+ clearInterval(h2.timer);
82
+ }), __spreadProps(__spreadValues(__spreadValues({}, r(e2)), r(h2)), { isEllipsis: f2, classes: y2, iconShow: g2, barStyle: k2, contentStyle: w2, iconBg: v2, horseLampStyle: C2, wrap: u2, content: m2, handleClick: (e3) => {
83
+ d2("click", e3);
84
+ }, onClickIcon: (t2) => {
85
+ e2.closeMode && (h2.showNoticeBar = !e2.closeMode), d2("close", t2);
86
+ }, onAnimationEnd: () => {
87
+ h2.firstRound = false, setTimeout(() => {
88
+ h2.duration = (h2.offsetWidth + h2.wrapWidth) / e2.speed, h2.animationClass = "play-infinite";
89
+ }, 0);
90
+ }, go: (e3) => {
91
+ d2("click", e3);
92
+ }, handleClickIcon: () => {
93
+ d2("close", h2.scrollList[0]);
94
+ }, slots: p2 });
95
+ } }), E = { ref: "wrap", class: "wrap" }, W = ["onClick"];
96
+ var M = B(T, [["render", function(e2, t2, l2, o2, i2, n2) {
97
+ const s2 = d("nut-icon"), a2 = d("ScrollItem");
98
+ return p(), u("view", { class: m(e2.classes) }, [e2.direction == "across" ? h((p(), u("view", { key: 0, class: m(["nut-noticebar-page", { withicon: e2.closeMode, close: e2.closeMode, wrapable: e2.wrapable }]), style: y(e2.barStyle), onClick: t2[3] || (t2[3] = (...t3) => e2.handleClick && e2.handleClick(...t3)) }, [e2.iconShow ? (p(), u("view", { key: 0, class: "left-icon", style: y({ "background-image": `url(${e2.iconBg})` }) }, [f(e2.$slots, "left-icon", {}, () => [e2.iconBg ? k("", true) : (p(), g(s2, { key: 0, name: "notice", size: "16", color: e2.color }, null, 8, ["color"]))])], 4)) : k("", true), w("view", E, [w("view", { ref: "content", class: m(["content", e2.animationClass, { "nut-ellipsis": e2.isEllipsis }]), style: y(e2.contentStyle), onAnimationend: t2[0] || (t2[0] = (...t3) => e2.onAnimationEnd && e2.onAnimationEnd(...t3)), onWebkitAnimationEnd: t2[1] || (t2[1] = (...t3) => e2.onAnimationEnd && e2.onAnimationEnd(...t3)) }, [f(e2.$slots, "default", {}, () => [v(C(e2.text), 1)])], 38)], 512), e2.closeMode || e2.rightIcon ? (p(), u("view", { key: 1, class: "right-icon", onClick: t2[2] || (t2[2] = b((...t3) => e2.onClickIcon && e2.onClickIcon(...t3), ["stop"])) }, [f(e2.$slots, "right-icon", {}, () => [S(s2, { name: e2.rightIcon ? e2.rightIcon : "close", color: e2.color }, null, 8, ["name", "color"])])])) : k("", true)], 6)), [[I, e2.showNoticeBar]]) : k("", true), e2.scrollList.length > 0 && e2.direction == "vertical" ? (p(), u("view", { key: 1, class: "nut-noticebar-vertical", style: y(e2.barStyle) }, [e2.slots.default ? (p(), u("view", { key: 0, class: "horseLamp_list", style: y(e2.horseLampStyle) }, [(p(true), u(L, null, x(e2.scrollList, (t3, l3) => (p(), g(a2, { key: l3, style: y({ height: e2.height + "px", "line-height": e2.height + "px" }), item: t3 }, null, 8, ["style", "item"]))), 128))], 4)) : (p(), u("ul", { key: 1, class: "horseLamp_list", style: y(e2.horseLampStyle) }, [(p(true), u(L, null, x(e2.scrollList, (t3, l3) => (p(), u("li", { class: "horseLamp_list_item", key: l3, style: y({ height: e2.height }), onClick: (l4) => e2.go(t3) }, C(t3), 13, W))), 128))], 4)), w("view", { class: "go", onClick: t2[4] || (t2[4] = (t3) => !e2.slots.rightIcon && e2.handleClickIcon()) }, [e2.slots.rightIcon ? f(e2.$slots, "rightIcon", { key: 0 }) : e2.closeMode ? (p(), g(s2, { key: 1, type: "cross", color: e2.color, size: "11px" }, null, 8, ["color"])) : k("", true)])], 4)) : k("", true)], 2);
99
+ }]]);
100
+ export { M as default };