@nutui/nutui 4.0.0-beta.9 → 4.0.0

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 (539) hide show
  1. package/CHANGELOG.md +13 -940
  2. package/README.md +1 -1
  3. package/dist/nutui.es.js +103 -103
  4. package/dist/nutui.umd.js +7 -0
  5. package/dist/packages/_es/ActionSheet.js +2 -7
  6. package/dist/packages/_es/Address.js +7 -4
  7. package/dist/packages/_es/AddressList.js +164 -239
  8. package/dist/packages/_es/Audio.js +6 -0
  9. package/dist/packages/_es/AudioOperate.js +1 -0
  10. package/dist/packages/_es/Avatar.js +2 -0
  11. package/dist/packages/_es/AvatarGroup.js +1 -0
  12. package/dist/packages/_es/Badge.js +2 -2
  13. package/dist/packages/_es/Barrage.js +60 -42
  14. package/dist/packages/_es/Calendar.js +12 -12
  15. package/dist/packages/_es/CalendarItem.js +1 -1
  16. package/dist/packages/_es/Card.js +7 -14
  17. package/dist/packages/_es/Cascader.js +5 -4
  18. package/dist/packages/_es/Category.js +2 -0
  19. package/dist/packages/_es/CategoryPane.js +3 -0
  20. package/dist/packages/_es/Cell.js +1 -0
  21. package/dist/packages/_es/Collapse.js +7 -7
  22. package/dist/packages/_es/CollapseItem.js +6 -5
  23. package/dist/packages/_es/Comment.js +16 -13
  24. package/dist/packages/_es/ConfigProvider.js +34 -0
  25. package/dist/packages/_es/Countdown.js +8 -0
  26. package/dist/packages/_es/Countup.js +20 -5
  27. package/dist/packages/_es/DatePicker.js +2 -0
  28. package/dist/packages/_es/Dialog.js +8 -4
  29. package/dist/packages/_es/Ellipsis.js +3 -3
  30. package/dist/packages/_es/Empty.js +3 -0
  31. package/dist/packages/_es/Grid.js +1 -1
  32. package/dist/packages/_es/GridItem.js +2 -1
  33. package/dist/packages/_es/ImagePreview.js +6 -6
  34. package/dist/packages/_es/InfiniteLoading.js +1 -9
  35. package/dist/packages/_es/Input.js +30 -29
  36. package/dist/packages/_es/InputNumber.js +5 -5
  37. package/dist/packages/_es/Invoice.js +5 -3
  38. package/dist/packages/_es/List.js +1 -2
  39. package/dist/packages/_es/MenuItem.js +1 -1
  40. package/dist/packages/_es/Navbar.js +10 -4
  41. package/dist/packages/_es/Noticebar.js +23 -14
  42. package/dist/packages/_es/Notify.js +4 -2
  43. package/dist/packages/_es/NumberKeyboard.js +3 -3
  44. package/dist/packages/_es/Overlay.js +11 -5
  45. package/dist/packages/_es/Picker.js +4 -1
  46. package/dist/packages/_es/Popover.js +1 -2
  47. package/dist/packages/_es/Popup.js +1 -1
  48. package/dist/packages/_es/Price.js +1 -1
  49. package/dist/packages/_es/Progress.js +39 -36
  50. package/dist/packages/_es/PullRefresh.js +10 -13
  51. package/dist/packages/_es/Radio.js +1 -1
  52. package/dist/packages/_es/RadioGroup.js +1 -1
  53. package/dist/packages/_es/Rate.js +19 -18
  54. package/dist/packages/_es/Searchbar.js +25 -19
  55. package/dist/packages/_es/ShortPassword.js +12 -11
  56. package/dist/packages/_es/Signature.js +12 -1
  57. package/dist/packages/_es/Skeleton.js +12 -4
  58. package/dist/packages/_es/Sku.js +31 -13
  59. package/dist/packages/_es/Swiper.js +1 -4
  60. package/dist/packages/_es/Switch.js +4 -1
  61. package/dist/packages/_es/TabbarItem.js +5 -0
  62. package/dist/packages/_es/Table.js +90 -93
  63. package/dist/packages/_es/Tabs.js +5 -3
  64. package/dist/packages/_es/Textarea.js +25 -4
  65. package/dist/packages/_es/TimeDetail.js +0 -4
  66. package/dist/packages/_es/TimeSelect.js +2 -2
  67. package/dist/packages/_es/Toast.js +8 -1
  68. package/dist/packages/_es/Tour.js +9 -8
  69. package/dist/packages/_es/TrendArrow.js +2 -2
  70. package/dist/packages/_es/Uploader.js +19 -16
  71. package/dist/packages/_es/Video.js +18 -0
  72. package/dist/packages/_es/{common-ceb98554.js → common-b9a5e726.js} +8 -0
  73. package/dist/packages/_es/{index-350a8abd.js → index-2ae3ae87.js} +42 -5
  74. package/dist/packages/_es/{index-da7aa231.js → index-991c279f.js} +13 -3
  75. package/dist/packages/_es/{index.vue_vue_type_script_lang-1291fceb.js → index.vue_vue_type_script_lang-22dfc112.js} +1 -0
  76. package/dist/packages/_es/{index.vue_vue_type_script_lang-d4c88f85.js → index.vue_vue_type_script_lang-442e4704.js} +1 -0
  77. package/dist/packages/actionsheet/style.mjs +3 -2
  78. package/dist/packages/address/style.mjs +4 -3
  79. package/dist/packages/addresslist/index.scss +14 -3
  80. package/dist/packages/addresslist/style.mjs +3 -2
  81. package/dist/packages/animate/style.mjs +1 -0
  82. package/dist/packages/audio/index.scss +1 -1
  83. package/dist/packages/audio/style.mjs +2 -1
  84. package/dist/packages/audiooperate/style.mjs +2 -1
  85. package/dist/packages/avatar/index.scss +3 -1
  86. package/dist/packages/avatar/style.mjs +1 -0
  87. package/dist/packages/avatargroup/index.scss +1 -1
  88. package/dist/packages/avatargroup/style.mjs +1 -0
  89. package/dist/packages/backtop/style.mjs +1 -0
  90. package/dist/packages/badge/index.scss +7 -3
  91. package/dist/packages/badge/style.mjs +1 -0
  92. package/dist/packages/barrage/style.mjs +1 -0
  93. package/dist/packages/button/index.scss +63 -1
  94. package/dist/packages/button/style.mjs +1 -0
  95. package/dist/packages/calendar/index.scss +14 -5
  96. package/dist/packages/calendar/style.mjs +4 -3
  97. package/dist/packages/calendaritem/style.mjs +1 -0
  98. package/dist/packages/card/style.mjs +3 -2
  99. package/dist/packages/cascader/style.mjs +6 -5
  100. package/dist/packages/category/style.mjs +1 -0
  101. package/dist/packages/categorypane/style.mjs +1 -0
  102. package/dist/packages/cell/index.scss +2 -0
  103. package/dist/packages/cell/style.mjs +1 -0
  104. package/dist/packages/cellgroup/style.mjs +1 -0
  105. package/dist/packages/checkbox/style.mjs +1 -0
  106. package/dist/packages/checkboxgroup/style.mjs +1 -0
  107. package/dist/packages/circleprogress/style.mjs +1 -0
  108. package/dist/packages/col/style.mjs +1 -0
  109. package/dist/packages/collapse/style.mjs +1 -0
  110. package/dist/packages/collapseitem/style.mjs +1 -0
  111. package/dist/packages/comment/index.scss +12 -7
  112. package/dist/packages/comment/style.mjs +2 -1
  113. package/dist/packages/configprovider/style.mjs +1 -0
  114. package/dist/packages/countdown/style.mjs +1 -0
  115. package/dist/packages/countup/index.scss +1 -0
  116. package/dist/packages/countup/style.mjs +1 -0
  117. package/dist/packages/datepicker/style.mjs +4 -3
  118. package/dist/packages/dialog/style.mjs +4 -3
  119. package/dist/packages/divider/style.mjs +1 -0
  120. package/dist/packages/drag/style.mjs +1 -0
  121. package/dist/packages/ecard/index.scss +20 -2
  122. package/dist/packages/ecard/style.mjs +2 -1
  123. package/dist/packages/elevator/index.scss +14 -0
  124. package/dist/packages/elevator/style.mjs +1 -0
  125. package/dist/packages/ellipsis/style.mjs +1 -0
  126. package/dist/packages/empty/style.mjs +1 -0
  127. package/dist/packages/fixednav/style.mjs +2 -1
  128. package/dist/packages/form/style.mjs +2 -1
  129. package/dist/packages/formitem/style.mjs +2 -1
  130. package/dist/packages/grid/style.mjs +1 -0
  131. package/dist/packages/griditem/style.mjs +1 -0
  132. package/dist/packages/icon/index.scss +1 -0
  133. package/dist/packages/icon/style.mjs +1 -0
  134. package/dist/packages/image/style.mjs +1 -0
  135. package/dist/packages/imagepreview/style.mjs +6 -5
  136. package/dist/packages/indicator/index.scss +4 -4
  137. package/dist/packages/indicator/style.mjs +1 -0
  138. package/dist/packages/infiniteloading/style.mjs +1 -0
  139. package/dist/packages/input/index.scss +6 -2
  140. package/dist/packages/input/style.mjs +1 -0
  141. package/dist/packages/inputnumber/index.scss +5 -1
  142. package/dist/packages/inputnumber/style.mjs +1 -0
  143. package/dist/packages/invoice/style.mjs +8 -7
  144. package/dist/packages/layout/style.mjs +1 -0
  145. package/dist/packages/list/style.mjs +1 -0
  146. package/dist/packages/locale/lang/zh-CN.js +1 -1
  147. package/dist/packages/menu/style.mjs +1 -0
  148. package/dist/packages/menuitem/style.mjs +3 -2
  149. package/dist/packages/navbar/style.mjs +1 -0
  150. package/dist/packages/noticebar/index.scss +13 -10
  151. package/dist/packages/noticebar/style.mjs +1 -0
  152. package/dist/packages/notify/style.mjs +3 -2
  153. package/dist/packages/numberkeyboard/style.mjs +3 -2
  154. package/dist/packages/overlay/style.mjs +1 -0
  155. package/dist/packages/pagination/style.mjs +1 -0
  156. package/dist/packages/picker/style.mjs +3 -2
  157. package/dist/packages/popover/style.mjs +3 -2
  158. package/dist/packages/popup/style.mjs +2 -1
  159. package/dist/packages/price/style.mjs +1 -0
  160. package/dist/packages/progress/index.scss +8 -6
  161. package/dist/packages/progress/style.mjs +1 -0
  162. package/dist/packages/pullrefresh/index.scss +1 -1
  163. package/dist/packages/pullrefresh/style.mjs +1 -0
  164. package/dist/packages/radio/index.scss +14 -2
  165. package/dist/packages/radio/style.mjs +1 -0
  166. package/dist/packages/radiogroup/style.mjs +1 -0
  167. package/dist/packages/range/index.scss +6 -3
  168. package/dist/packages/range/style.mjs +1 -0
  169. package/dist/packages/rate/index.scss +5 -4
  170. package/dist/packages/rate/style.mjs +1 -0
  171. package/dist/packages/row/style.mjs +1 -0
  172. package/dist/packages/searchbar/index.scss +43 -24
  173. package/dist/packages/searchbar/style.mjs +1 -0
  174. package/dist/packages/shortpassword/style.mjs +3 -2
  175. package/dist/packages/sidenavbar/style.mjs +1 -0
  176. package/dist/packages/sidenavbaritem/style.mjs +1 -0
  177. package/dist/packages/signature/index.scss +2 -2
  178. package/dist/packages/signature/style.mjs +2 -1
  179. package/dist/packages/skeleton/style.mjs +2 -1
  180. package/dist/packages/sku/index.scss +16 -2
  181. package/dist/packages/sku/style.mjs +5 -4
  182. package/dist/packages/step/index.scss +1 -9
  183. package/dist/packages/step/style.mjs +1 -0
  184. package/dist/packages/steps/style.mjs +1 -0
  185. package/dist/packages/sticky/index.scss +1 -0
  186. package/dist/packages/sticky/style.mjs +1 -0
  187. package/dist/packages/subsidenavbar/style.mjs +1 -0
  188. package/dist/packages/swipe/style.mjs +1 -0
  189. package/dist/packages/swiper/style.mjs +1 -0
  190. package/dist/packages/swiperitem/style.mjs +1 -0
  191. package/dist/packages/switch/index.scss +7 -0
  192. package/dist/packages/switch/style.mjs +1 -0
  193. package/dist/packages/tabbar/style.mjs +1 -0
  194. package/dist/packages/tabbaritem/index.scss +6 -0
  195. package/dist/packages/tabbaritem/style.mjs +2 -1
  196. package/dist/packages/table/style.mjs +1 -0
  197. package/dist/packages/tabpane/style.mjs +1 -0
  198. package/dist/packages/tabs/style.mjs +2 -1
  199. package/dist/packages/tag/style.mjs +1 -0
  200. package/dist/packages/textarea/index.scss +7 -1
  201. package/dist/packages/textarea/style.mjs +1 -0
  202. package/dist/packages/timedetail/index.scss +14 -6
  203. package/dist/packages/timedetail/style.mjs +1 -0
  204. package/dist/packages/timepannel/style.mjs +1 -0
  205. package/dist/packages/timeselect/style.mjs +3 -2
  206. package/dist/packages/toast/style.mjs +1 -0
  207. package/dist/packages/tour/index.scss +3 -0
  208. package/dist/packages/tour/style.mjs +4 -3
  209. package/dist/packages/trendarrow/style.mjs +1 -0
  210. package/dist/packages/uploader/index.scss +21 -15
  211. package/dist/packages/uploader/style.mjs +3 -2
  212. package/dist/packages/video/style.mjs +1 -0
  213. package/dist/packages/watermark/style.mjs +1 -0
  214. package/dist/smartips/web-types.json +703 -784
  215. package/dist/style.css +1 -1
  216. package/dist/styles/reset.css +3 -0
  217. package/dist/styles/themes/default.scss +55 -56
  218. package/dist/styles/themes/jdb.scss +55 -55
  219. package/dist/styles/themes/jddkh.scss +55 -55
  220. package/dist/styles/themes/jdt.scss +55 -56
  221. package/dist/styles/variables-jdb.scss +7 -14
  222. package/dist/styles/variables-jddkh.scss +7 -13
  223. package/dist/styles/variables-jdt.scss +8 -14
  224. package/dist/styles/variables.scss +16 -26
  225. package/dist/types/__VUE/actionsheet/index.vue.d.ts +18 -9
  226. package/dist/types/__VUE/address/index.vue.d.ts +18 -0
  227. package/dist/types/__VUE/addresslist/components/GeneralShell.vue.d.ts +23 -7
  228. package/dist/types/__VUE/addresslist/components/ItemContents.vue.d.ts +2 -2
  229. package/dist/types/__VUE/addresslist/index.vue.d.ts +6 -6
  230. package/dist/types/__VUE/barrage/index.vue.d.ts +2 -4
  231. package/dist/types/__VUE/card/index.vue.d.ts +0 -21
  232. package/dist/types/__VUE/cascader/index.vue.d.ts +18 -0
  233. package/dist/types/__VUE/cell/index.vue.d.ts +1 -1
  234. package/dist/types/__VUE/collapse/index.vue.d.ts +5 -5
  235. package/dist/types/__VUE/comment/components/CmtBottom.vue.d.ts +2 -2
  236. package/dist/types/__VUE/comment/index.vue.d.ts +4 -4
  237. package/dist/types/__VUE/dialog/index.vue.d.ts +18 -0
  238. package/dist/types/__VUE/griditem/index.vue.d.ts +1 -1
  239. package/dist/types/__VUE/infiniteloading/index.vue.d.ts +0 -18
  240. package/dist/types/__VUE/input/index.vue.d.ts +6 -39
  241. package/dist/types/__VUE/noticebar/index.vue.d.ts +6 -20
  242. package/dist/types/__VUE/popover/index.vue.d.ts +0 -9
  243. package/dist/types/__VUE/popup/common.d.ts +8 -0
  244. package/dist/types/__VUE/popup/index.vue.d.ts +18 -0
  245. package/dist/types/__VUE/popup/props.d.ts +8 -0
  246. package/dist/types/__VUE/progress/index.vue.d.ts +1 -0
  247. package/dist/types/__VUE/pullrefresh/index.vue.d.ts +0 -9
  248. package/dist/types/__VUE/rate/index.vue.d.ts +17 -11
  249. package/dist/types/__VUE/searchbar/index.vue.d.ts +1 -1
  250. package/dist/types/__VUE/shortpassword/index.vue.d.ts +1 -1
  251. package/dist/types/__VUE/sku/index.vue.d.ts +18 -0
  252. package/dist/types/__VUE/swiper/index.vue.d.ts +0 -9
  253. package/dist/types/__VUE/table/common.d.ts +9 -9
  254. package/dist/types/__VUE/table/index.vue.d.ts +13 -11
  255. package/dist/types/__VUE/table/renderColumn.d.ts +9 -9
  256. package/dist/types/__VUE/textarea/index.vue.d.ts +5 -0
  257. package/dist/types/__VUE/timedetail/index.vue.d.ts +0 -9
  258. package/dist/types/__VUE/tour/index.vue.d.ts +9 -9
  259. package/dist/types/index.d.ts +1 -1
  260. package/package.json +10 -101
  261. package/dist/nutui.umd.cjs +0 -7
  262. package/dist/packages/_es/Loading-5f2ef345.js +0 -59
  263. package/dist/packages/_es/Loading-ff1ade5e.js +0 -59
  264. package/dist/packages/_es/_plugin-vue_export-helper-214bd398.js +0 -15
  265. package/dist/packages/_es/_plugin-vue_export-helper-3119770d.js +0 -15
  266. package/dist/packages/_es/_plugin-vue_export-helper-40ecb205.js +0 -15
  267. package/dist/packages/_es/_plugin-vue_export-helper-cabb815c.js +0 -15
  268. package/dist/packages/_es/common-1144cf18.js +0 -142
  269. package/dist/packages/_es/common-33d6538d.js +0 -142
  270. package/dist/packages/_es/common-38afc79e.js +0 -142
  271. package/dist/packages/_es/common-fcbd940e.js +0 -142
  272. package/dist/packages/_es/component-555f9132.js +0 -150
  273. package/dist/packages/_es/component-93f40b7f.js +0 -144
  274. package/dist/packages/_es/component-cb778481.js +0 -150
  275. package/dist/packages/_es/component-f9e4b05e.js +0 -144
  276. package/dist/packages/_es/index-122e380e.js +0 -15
  277. package/dist/packages/_es/index-15d5ca2c.js +0 -35
  278. package/dist/packages/_es/index-16f572cc.js +0 -52
  279. package/dist/packages/_es/index-18e7c77e.js +0 -38
  280. package/dist/packages/_es/index-22af3a75.js +0 -35
  281. package/dist/packages/_es/index-2d3e73a7.js +0 -239
  282. package/dist/packages/_es/index-375f2695.js +0 -15
  283. package/dist/packages/_es/index-57aa518c.js +0 -13
  284. package/dist/packages/_es/index-65e55319.js +0 -72
  285. package/dist/packages/_es/index-673e467d.js +0 -72
  286. package/dist/packages/_es/index-69b79b10.js +0 -52
  287. package/dist/packages/_es/index-7386d8ea.js +0 -35
  288. package/dist/packages/_es/index-75be4de5.js +0 -72
  289. package/dist/packages/_es/index-7653e348.js +0 -814
  290. package/dist/packages/_es/index-83f367f2.js +0 -15
  291. package/dist/packages/_es/index-a0ae7438.js +0 -72
  292. package/dist/packages/_es/index-abb46652.js +0 -13
  293. package/dist/packages/_es/index-bd90ef5b.js +0 -38
  294. package/dist/packages/_es/index-dd23f7fc.js +0 -35
  295. package/dist/packages/_es/index-ec1281d1.js +0 -15
  296. package/dist/packages/_es/index-ee55d99f.js +0 -814
  297. package/dist/packages/_es/index-f9640059.js +0 -239
  298. package/dist/packages/_es/index.taro-15624a72.js +0 -833
  299. package/dist/packages/_es/index.taro-2ce92fc8.js +0 -76
  300. package/dist/packages/_es/index.taro-356b6989.js +0 -238
  301. package/dist/packages/_es/index.taro-5564033f.js +0 -833
  302. package/dist/packages/_es/index.taro-be0723aa.js +0 -76
  303. package/dist/packages/_es/index.taro-da1bc684.js +0 -238
  304. package/dist/packages/_es/index.taro.vue_vue_type_script_lang-5696dfc0.js +0 -102
  305. package/dist/packages/_es/index.taro.vue_vue_type_script_lang-5b67ab83.js +0 -102
  306. package/dist/packages/_es/index.vue_vue_type_script_lang-164ba0ab.js +0 -102
  307. package/dist/packages/_es/index.vue_vue_type_script_lang-1c056efc.js +0 -156
  308. package/dist/packages/_es/index.vue_vue_type_script_lang-2c5dd6ac.js +0 -50
  309. package/dist/packages/_es/index.vue_vue_type_script_lang-3bc78a6d.js +0 -156
  310. package/dist/packages/_es/index.vue_vue_type_script_lang-630bc089.js +0 -50
  311. package/dist/packages/_es/index.vue_vue_type_script_lang-ba9e696d.js +0 -50
  312. package/dist/packages/_es/index.vue_vue_type_script_lang-cab1cdc4.js +0 -102
  313. package/dist/packages/_es/index.vue_vue_type_script_lang-f91aa3ff.js +0 -50
  314. package/dist/packages/_es/interceptor-5d3d8b0a.js +0 -34
  315. package/dist/packages/_es/interceptor-bf7033c2.js +0 -34
  316. package/dist/packages/_es/interceptor-ccd1403c.js +0 -34
  317. package/dist/packages/_es/interceptor-dbee5851.js +0 -34
  318. package/dist/packages/_es/mountComponent-1316c4a2.js +0 -44
  319. package/dist/packages/_es/mountComponent-3f8ea19f.js +0 -44
  320. package/dist/packages/_es/pxCheck-110c0d58.js +0 -11
  321. package/dist/packages/_es/pxCheck-42d1a00f.js +0 -11
  322. package/dist/packages/_es/pxCheck-62a0c829.js +0 -11
  323. package/dist/packages/_es/pxCheck-70f351cb.js +0 -11
  324. package/dist/packages/_es/raf-182636f4.js +0 -30
  325. package/dist/packages/_es/raf-2ee3bcbb.js +0 -30
  326. package/dist/packages/_es/raf-6ea498df.js +0 -21
  327. package/dist/packages/_es/raf-8518c796.js +0 -21
  328. package/dist/packages/_es/renderIcon-0d8f6335.js +0 -14
  329. package/dist/packages/_es/renderIcon-1be33355.js +0 -14
  330. package/dist/packages/_es/renderIcon-ba0fcba3.js +0 -14
  331. package/dist/packages/_es/renderIcon-bde9e715.js +0 -14
  332. package/dist/packages/_es/style.css +0 -16
  333. package/dist/packages/_es/style_icon-299fd467.js +0 -6
  334. package/dist/packages/_es/style_icon-8872f331.js +0 -6
  335. package/dist/packages/actionsheet/style.cjs +0 -3
  336. package/dist/packages/address/style.cjs +0 -4
  337. package/dist/packages/addresslist/style.cjs +0 -3
  338. package/dist/packages/animate/style.cjs +0 -1
  339. package/dist/packages/audio/style.cjs +0 -2
  340. package/dist/packages/audiooperate/style.cjs +0 -2
  341. package/dist/packages/avatar/style.cjs +0 -1
  342. package/dist/packages/avatargroup/style.cjs +0 -1
  343. package/dist/packages/backtop/style.cjs +0 -1
  344. package/dist/packages/badge/style.cjs +0 -1
  345. package/dist/packages/barrage/style.cjs +0 -1
  346. package/dist/packages/button/style.cjs +0 -1
  347. package/dist/packages/calendar/style.cjs +0 -4
  348. package/dist/packages/calendaritem/style.cjs +0 -1
  349. package/dist/packages/card/style.cjs +0 -3
  350. package/dist/packages/cascader/style.cjs +0 -6
  351. package/dist/packages/category/style.cjs +0 -1
  352. package/dist/packages/categorypane/style.cjs +0 -1
  353. package/dist/packages/cell/style.cjs +0 -1
  354. package/dist/packages/cellgroup/style.cjs +0 -1
  355. package/dist/packages/checkbox/style.cjs +0 -1
  356. package/dist/packages/checkboxgroup/style.cjs +0 -1
  357. package/dist/packages/circleprogress/style.cjs +0 -1
  358. package/dist/packages/col/style.cjs +0 -1
  359. package/dist/packages/collapse/style.cjs +0 -1
  360. package/dist/packages/collapseitem/style.cjs +0 -1
  361. package/dist/packages/comment/style.cjs +0 -2
  362. package/dist/packages/configprovider/style.cjs +0 -1
  363. package/dist/packages/countdown/style.cjs +0 -1
  364. package/dist/packages/countup/style.cjs +0 -1
  365. package/dist/packages/datepicker/style.cjs +0 -4
  366. package/dist/packages/dialog/style.cjs +0 -4
  367. package/dist/packages/divider/style.cjs +0 -1
  368. package/dist/packages/drag/style.cjs +0 -1
  369. package/dist/packages/ecard/style.cjs +0 -2
  370. package/dist/packages/elevator/style.cjs +0 -1
  371. package/dist/packages/ellipsis/style.cjs +0 -1
  372. package/dist/packages/empty/style.cjs +0 -1
  373. package/dist/packages/fixednav/style.cjs +0 -2
  374. package/dist/packages/form/style.cjs +0 -2
  375. package/dist/packages/formitem/style.cjs +0 -2
  376. package/dist/packages/grid/style.cjs +0 -1
  377. package/dist/packages/griditem/style.cjs +0 -1
  378. package/dist/packages/icon/style.cjs +0 -1
  379. package/dist/packages/image/style.cjs +0 -1
  380. package/dist/packages/imagepreview/style.cjs +0 -6
  381. package/dist/packages/indicator/style.cjs +0 -1
  382. package/dist/packages/infiniteloading/style.cjs +0 -1
  383. package/dist/packages/input/style.cjs +0 -1
  384. package/dist/packages/inputnumber/style.cjs +0 -1
  385. package/dist/packages/invoice/style.cjs +0 -8
  386. package/dist/packages/layout/style.cjs +0 -1
  387. package/dist/packages/list/style.cjs +0 -1
  388. package/dist/packages/locale/lang/baseLang-0e7bcba4.js +0 -10
  389. package/dist/packages/locale/lang/baseLang-5db74119.js +0 -10
  390. package/dist/packages/locale/lang/baseLang-6070c617.js +0 -10
  391. package/dist/packages/locale/lang/baseLang-8d65df5e.js +0 -10
  392. package/dist/packages/menu/style.cjs +0 -1
  393. package/dist/packages/menuitem/style.cjs +0 -3
  394. package/dist/packages/navbar/style.cjs +0 -1
  395. package/dist/packages/noticebar/style.cjs +0 -1
  396. package/dist/packages/notify/style.cjs +0 -3
  397. package/dist/packages/numberkeyboard/style.cjs +0 -3
  398. package/dist/packages/overlay/style.cjs +0 -1
  399. package/dist/packages/pagination/style.cjs +0 -1
  400. package/dist/packages/picker/style.cjs +0 -3
  401. package/dist/packages/popover/style.cjs +0 -3
  402. package/dist/packages/popup/style.cjs +0 -2
  403. package/dist/packages/price/style.cjs +0 -1
  404. package/dist/packages/progress/style.cjs +0 -1
  405. package/dist/packages/pullrefresh/style.cjs +0 -1
  406. package/dist/packages/radio/style.cjs +0 -1
  407. package/dist/packages/radiogroup/style.cjs +0 -1
  408. package/dist/packages/range/style.cjs +0 -1
  409. package/dist/packages/rate/style.cjs +0 -1
  410. package/dist/packages/row/style.cjs +0 -1
  411. package/dist/packages/searchbar/style.cjs +0 -1
  412. package/dist/packages/shortpassword/style.cjs +0 -3
  413. package/dist/packages/sidenavbar/style.cjs +0 -1
  414. package/dist/packages/sidenavbaritem/style.cjs +0 -1
  415. package/dist/packages/signature/style.cjs +0 -2
  416. package/dist/packages/skeleton/style.cjs +0 -2
  417. package/dist/packages/sku/style.cjs +0 -5
  418. package/dist/packages/step/style.cjs +0 -1
  419. package/dist/packages/steps/style.cjs +0 -1
  420. package/dist/packages/sticky/style.cjs +0 -1
  421. package/dist/packages/subsidenavbar/style.cjs +0 -1
  422. package/dist/packages/swipe/style.cjs +0 -1
  423. package/dist/packages/swiper/style.cjs +0 -1
  424. package/dist/packages/swiperitem/style.cjs +0 -1
  425. package/dist/packages/switch/style.cjs +0 -1
  426. package/dist/packages/tabbar/style.cjs +0 -1
  427. package/dist/packages/tabbaritem/style.cjs +0 -2
  428. package/dist/packages/table/style.cjs +0 -1
  429. package/dist/packages/tabpane/style.cjs +0 -1
  430. package/dist/packages/tabs/style.cjs +0 -2
  431. package/dist/packages/tag/style.cjs +0 -1
  432. package/dist/packages/textarea/style.cjs +0 -1
  433. package/dist/packages/timedetail/style.cjs +0 -1
  434. package/dist/packages/timepannel/style.cjs +0 -1
  435. package/dist/packages/timeselect/style.cjs +0 -3
  436. package/dist/packages/toast/style.cjs +0 -1
  437. package/dist/packages/tour/style.cjs +0 -4
  438. package/dist/packages/trendarrow/style.cjs +0 -1
  439. package/dist/packages/uploader/style.cjs +0 -3
  440. package/dist/packages/video/style.cjs +0 -1
  441. package/dist/packages/watermark/style.cjs +0 -1
  442. package/dist/smartips/attributes.json +0 -2814
  443. package/dist/smartips/tags.json +0 -1048
  444. package/dist/styles/theme-deafult.scss +0 -919
  445. package/dist/styles/theme-jdt.scss +0 -892
  446. package/dist/styles/variables-var.scss +0 -854
  447. package/dist/types/__VUE/actionsheet/index.taro.vue.d.ts +0 -292
  448. package/dist/types/__VUE/address/index.taro.vue.d.ts +0 -377
  449. package/dist/types/__VUE/addresslist/components/SwipeShell.vue.d.ts +0 -26
  450. package/dist/types/__VUE/addresslist/index.taro.vue.d.ts +0 -83
  451. package/dist/types/__VUE/animate/index.taro.vue.d.ts +0 -54
  452. package/dist/types/__VUE/avatar/index.taro.vue.d.ts +0 -76
  453. package/dist/types/__VUE/avatargroup/index.taro.vue.d.ts +0 -92
  454. package/dist/types/__VUE/backtop/index.taro.vue.d.ts +0 -76
  455. package/dist/types/__VUE/badge/index.taro.vue.d.ts +0 -93
  456. package/dist/types/__VUE/barrage/index.taro.vue.d.ts +0 -81
  457. package/dist/types/__VUE/button/index.taro.vue.d.ts +0 -117
  458. package/dist/types/__VUE/calendar/index.taro.vue.d.ts +0 -187
  459. package/dist/types/__VUE/calendaritem/index.taro.vue.d.ts +0 -217
  460. package/dist/types/__VUE/card/index.taro.vue.d.ts +0 -89
  461. package/dist/types/__VUE/cascader/cascader-item.taro.vue.d.ts +0 -77
  462. package/dist/types/__VUE/cascader/index.taro.vue.d.ts +0 -245
  463. package/dist/types/__VUE/category/index.taro.vue.d.ts +0 -42
  464. package/dist/types/__VUE/categorypane/index.taro.vue.d.ts +0 -54
  465. package/dist/types/__VUE/cell/index.taro.vue.d.ts +0 -124
  466. package/dist/types/__VUE/checkbox/index.taro.vue.d.ts +0 -12
  467. package/dist/types/__VUE/circleprogress/index.taro.vue.d.ts +0 -93
  468. package/dist/types/__VUE/collapse/index.taro.vue.d.ts +0 -38
  469. package/dist/types/__VUE/collapseitem/index.taro.vue.d.ts +0 -111
  470. package/dist/types/__VUE/comment/index.taro.vue.d.ts +0 -119
  471. package/dist/types/__VUE/configprovider/index.taro.vue.d.ts +0 -45
  472. package/dist/types/__VUE/countdown/index.taro.vue.d.ts +0 -103
  473. package/dist/types/__VUE/countup/index.taro.vue.d.ts +0 -213
  474. package/dist/types/__VUE/datepicker/index.taro.vue.d.ts +0 -232
  475. package/dist/types/__VUE/dialog/index.taro.vue.d.ts +0 -327
  476. package/dist/types/__VUE/divider/index.taro.vue.d.ts +0 -53
  477. package/dist/types/__VUE/drag/index.taro.vue.d.ts +0 -62
  478. package/dist/types/__VUE/ecard/index.taro.vue.d.ts +0 -128
  479. package/dist/types/__VUE/elevator/index.taro.vue.d.ts +0 -119
  480. package/dist/types/__VUE/ellipsis/index.taro.vue.d.ts +0 -103
  481. package/dist/types/__VUE/empty/index.taro.vue.d.ts +0 -46
  482. package/dist/types/__VUE/fixednav/index.taro.vue.d.ts +0 -105
  483. package/dist/types/__VUE/form/index.taro.vue.d.ts +0 -40
  484. package/dist/types/__VUE/formitem/index.taro.vue.d.ts +0 -114
  485. package/dist/types/__VUE/grid/index.taro.vue.d.ts +0 -84
  486. package/dist/types/__VUE/griditem/index.taro.vue.d.ts +0 -22
  487. package/dist/types/__VUE/icon/index.taro.vue.d.ts +0 -12
  488. package/dist/types/__VUE/image/index.taro.vue.d.ts +0 -32
  489. package/dist/types/__VUE/imagepreview/index.taro.vue.d.ts +0 -172
  490. package/dist/types/__VUE/indicator/index.taro.vue.d.ts +0 -70
  491. package/dist/types/__VUE/input/index.taro.vue.d.ts +0 -257
  492. package/dist/types/__VUE/inputnumber/index.taro.vue.d.ts +0 -116
  493. package/dist/types/__VUE/invoice/index.taro.vue.d.ts +0 -52
  494. package/dist/types/__VUE/layout/index.taro.vue.d.ts +0 -12
  495. package/dist/types/__VUE/list/index.taro.vue.d.ts +0 -58
  496. package/dist/types/__VUE/menu/index.taro.vue.d.ts +0 -93
  497. package/dist/types/__VUE/menuitem/index.taro.vue.d.ts +0 -89
  498. package/dist/types/__VUE/navbar/index.taro.vue.d.ts +0 -121
  499. package/dist/types/__VUE/noticebar/index.taro.vue.d.ts +0 -217
  500. package/dist/types/__VUE/notify/index.taro.vue.d.ts +0 -97
  501. package/dist/types/__VUE/numberkeyboard/index.taro.vue.d.ts +0 -132
  502. package/dist/types/__VUE/overlay/index.taro.vue.d.ts +0 -85
  503. package/dist/types/__VUE/pagination/index.taro.vue.d.ts +0 -111
  504. package/dist/types/__VUE/picker/index.taro.vue.d.ts +0 -14
  505. package/dist/types/__VUE/popover/index.taro.vue.d.ts +0 -201
  506. package/dist/types/__VUE/popup/index.taro.vue.d.ts +0 -201
  507. package/dist/types/__VUE/price/index.taro.vue.d.ts +0 -87
  508. package/dist/types/__VUE/progress/index.taro.vue.d.ts +0 -128
  509. package/dist/types/__VUE/radio/index.taro.vue.d.ts +0 -53
  510. package/dist/types/__VUE/range/index.taro.vue.d.ts +0 -158
  511. package/dist/types/__VUE/rate/index.taro.vue.d.ts +0 -124
  512. package/dist/types/__VUE/scrollView/index.taro.vue.d.ts +0 -14
  513. package/dist/types/__VUE/searchbar/index.taro.vue.d.ts +0 -177
  514. package/dist/types/__VUE/shortpassword/index.taro.vue.d.ts +0 -103
  515. package/dist/types/__VUE/sidenavbar/index.taro.vue.d.ts +0 -31
  516. package/dist/types/__VUE/signature/index.taro.vue.d.ts +0 -83
  517. package/dist/types/__VUE/skeleton/index.taro.vue.d.ts +0 -115
  518. package/dist/types/__VUE/sku/index.taro.vue.d.ts +0 -182
  519. package/dist/types/__VUE/steps/index.taro.vue.d.ts +0 -46
  520. package/dist/types/__VUE/sticky/index.taro.vue.d.ts +0 -47
  521. package/dist/types/__VUE/swipe/index.taro.vue.d.ts +0 -71
  522. package/dist/types/__VUE/swiper/index.taro.vue.d.ts +0 -176
  523. package/dist/types/__VUE/swiper/use-touch.d.ts +0 -16
  524. package/dist/types/__VUE/swiperitem/index.taro.vue.d.ts +0 -18
  525. package/dist/types/__VUE/switch/index.taro.vue.d.ts +0 -108
  526. package/dist/types/__VUE/tabbar/index.taro.vue.d.ts +0 -93
  527. package/dist/types/__VUE/tabbaritem/index.taro.vue.d.ts +0 -59
  528. package/dist/types/__VUE/table/index.taro.vue.d.ts +0 -78
  529. package/dist/types/__VUE/tabs/index.taro.vue.d.ts +0 -164
  530. package/dist/types/__VUE/tag/index.taro.vue.d.ts +0 -90
  531. package/dist/types/__VUE/textarea/index.taro.vue.d.ts +0 -122
  532. package/dist/types/__VUE/timedetail/index.taro.vue.d.ts +0 -47
  533. package/dist/types/__VUE/timepannel/index.taro.vue.d.ts +0 -42
  534. package/dist/types/__VUE/timeselect/index.taro.vue.d.ts +0 -91
  535. package/dist/types/__VUE/toast/index.taro.vue.d.ts +0 -184
  536. package/dist/types/__VUE/tour/index.taro.vue.d.ts +0 -192
  537. package/dist/types/__VUE/trendarrow/index.taro.vue.d.ts +0 -105
  538. package/dist/types/__VUE/uploader/index.taro.vue.d.ts +0 -260
  539. package/dist/types/__VUE/watermark/index.taro.vue.d.ts +0 -175
@@ -1,814 +0,0 @@
1
- /*!
2
- * @nutui/nutui v4.0.0-beta.6 Thu Dec 29 2022 18:47:23 GMT+0800 (中国标准时间)
3
- * (c) 2022 @jdf2e.
4
- * Released under the MIT License.
5
- */
6
- import { ref, computed, reactive, watch, toRefs, openBlock, createElementBlock, normalizeClass, createElementVNode, toDisplayString, createCommentVNode, renderSlot, Fragment, renderList, normalizeStyle, createTextVNode } from "vue";
7
- import { c as createComponent } from "./component-555f9132.js";
8
- import { r as requestAniFrame } from "./raf-2ee3bcbb.js";
9
- import { u as useExpose } from "./index-83f367f2.js";
10
- import { _ as _export_sfc } from "./_plugin-vue_export-helper-214bd398.js";
11
- const Utils = {
12
- isLeapYear: function(y) {
13
- return y % 4 == 0 && y % 100 != 0 || y % 400 == 0;
14
- },
15
- getWhatDay: function(year, month, day) {
16
- const date = new Date(year + "/" + month + "/" + day);
17
- const index = date.getDay();
18
- const dayNames = [
19
- "星期日",
20
- "星期一",
21
- "星期二",
22
- "星期三",
23
- "星期四",
24
- "星期五",
25
- "星期六"
26
- ];
27
- return dayNames[index];
28
- },
29
- getMonthPreDay: function(year, month) {
30
- const date = new Date(year + "/" + month + "/01");
31
- let day = date.getDay();
32
- if (day == 0) {
33
- day = 7;
34
- }
35
- return day;
36
- },
37
- getMonthDays: function(year, month) {
38
- if (/^0/.test(month)) {
39
- month = month.split("")[1];
40
- }
41
- return [
42
- 0,
43
- 31,
44
- this.isLeapYear(Number(year)) ? 29 : 28,
45
- 31,
46
- 30,
47
- 31,
48
- 30,
49
- 31,
50
- 31,
51
- 30,
52
- 31,
53
- 30,
54
- 31
55
- ][month];
56
- },
57
- getNumTwoBit: function(n) {
58
- n = Number(n);
59
- return (n > 9 ? "" : "0") + n;
60
- },
61
- date2Str: function(date, split) {
62
- split = split || "-";
63
- const y = date.getFullYear();
64
- const m = this.getNumTwoBit(date.getMonth() + 1);
65
- const d = this.getNumTwoBit(date.getDate());
66
- return [y, m, d].join(split);
67
- },
68
- getDay: function(i) {
69
- i = i || 0;
70
- let date = new Date();
71
- const diff = i * (1e3 * 60 * 60 * 24);
72
- date = new Date(date.getTime() + diff);
73
- return this.date2Str(date);
74
- },
75
- compareDate: function(date1, date2) {
76
- const startTime = new Date(date1.replace("-", "/").replace("-", "/"));
77
- const endTime = new Date(date2.replace("-", "/").replace("-", "/"));
78
- if (startTime >= endTime) {
79
- return false;
80
- }
81
- return true;
82
- },
83
- isEqual: function(date1, date2) {
84
- const startTime = new Date(date1).getTime();
85
- const endTime = new Date(date2).getTime();
86
- if (startTime == endTime) {
87
- return true;
88
- }
89
- return false;
90
- }
91
- };
92
- const { create, translate } = createComponent("calendar-item");
93
- const _sfc_main = create({
94
- props: {
95
- type: {
96
- type: String,
97
- default: "one"
98
- },
99
- isAutoBackFill: {
100
- type: Boolean,
101
- default: false
102
- },
103
- toDateAnimation: {
104
- type: Boolean,
105
- default: true
106
- },
107
- poppable: {
108
- type: Boolean,
109
- default: true
110
- },
111
- showTitle: {
112
- type: Boolean,
113
- default: true
114
- },
115
- showSubTitle: {
116
- type: Boolean,
117
- default: true
118
- },
119
- showToday: {
120
- type: Boolean,
121
- default: true
122
- },
123
- title: {
124
- type: String,
125
- default: ""
126
- },
127
- confirmText: {
128
- type: String,
129
- default: ""
130
- },
131
- startText: {
132
- type: String,
133
- default: ""
134
- },
135
- endText: {
136
- type: String,
137
- default: ""
138
- },
139
- defaultValue: {
140
- type: [String, Array],
141
- default: ""
142
- },
143
- startDate: {
144
- type: String,
145
- default: Utils.getDay(0)
146
- },
147
- endDate: {
148
- type: String,
149
- default: Utils.getDay(365)
150
- },
151
- firstDayOfWeek: {
152
- type: Number,
153
- default: 0
154
- }
155
- },
156
- emits: ["choose", "update", "close", "select"],
157
- setup(props, { emit, slots }) {
158
- const weekdays = translate("weekdays");
159
- const weeks = ref([...weekdays.slice(props.firstDayOfWeek, 7), ...weekdays.slice(0, props.firstDayOfWeek)]);
160
- const months = ref(null);
161
- const monthsPanel = ref(null);
162
- const weeksPanel = ref(null);
163
- const viewArea = ref(null);
164
- const viewHeight = ref(0);
165
- const compConthsData = computed(() => {
166
- return state.monthsData.slice(state.defaultRange[0], state.defaultRange[1]);
167
- });
168
- const showTopBtn = computed(() => {
169
- return slots.btn;
170
- });
171
- const topInfo = computed(() => {
172
- return slots.topInfo;
173
- });
174
- const bottomInfo = computed(() => {
175
- return slots.bottomInfo;
176
- });
177
- const state = reactive({
178
- yearMonthTitle: "",
179
- defaultRange: [],
180
- currDate: "",
181
- propStartDate: "",
182
- propEndDate: "",
183
- unLoadPrev: false,
184
- touchParams: {
185
- startY: 0,
186
- endY: 0,
187
- startTime: 0,
188
- endTime: 0,
189
- lastY: 0,
190
- lastTime: 0
191
- },
192
- transformY: 0,
193
- translateY: 0,
194
- scrollDistance: 0,
195
- defaultData: [],
196
- chooseData: [],
197
- monthsData: [],
198
- dayPrefix: "nut-calendar__day",
199
- startData: "",
200
- endData: "",
201
- isRange: props.type === "range",
202
- timer: 0,
203
- currentIndex: 0,
204
- avgHeight: 0,
205
- monthsNum: 0
206
- });
207
- const splitDate = (date) => {
208
- return date.split("-");
209
- };
210
- const isStart = (currDate) => {
211
- return Utils.isEqual(state.currDate[0], currDate);
212
- };
213
- const isEnd = (currDate) => {
214
- return Utils.isEqual(state.currDate[1], currDate);
215
- };
216
- const isMultiple = (currDate) => {
217
- if (state.currDate.length > 0) {
218
- return state.currDate.some((item) => {
219
- return Utils.isEqual(item, currDate);
220
- });
221
- } else {
222
- return false;
223
- }
224
- };
225
- const getCurrDate = (day, month) => {
226
- return month.curData[0] + "-" + month.curData[1] + "-" + Utils.getNumTwoBit(+day.day);
227
- };
228
- const getClass = (day, month) => {
229
- const currDate = getCurrDate(day, month);
230
- const { type } = props;
231
- if (day.type == "curr") {
232
- if (Utils.isEqual(state.currDate, currDate) || type == "range" && (isStart(currDate) || isEnd(currDate)) || type == "multiple" && isMultiple(currDate)) {
233
- return `${state.dayPrefix}--active`;
234
- } else if (state.propStartDate && Utils.compareDate(currDate, state.propStartDate) || state.propEndDate && Utils.compareDate(state.propEndDate, currDate)) {
235
- return `${state.dayPrefix}--disabled`;
236
- } else if (type == "range" && Array.isArray(state.currDate) && Object.values(state.currDate).length == 2 && Utils.compareDate(state.currDate[0], currDate) && Utils.compareDate(currDate, state.currDate[1])) {
237
- return `${state.dayPrefix}--choose`;
238
- } else {
239
- return null;
240
- }
241
- } else {
242
- return `${state.dayPrefix}--disabled`;
243
- }
244
- };
245
- const confirm = () => {
246
- const { type } = props;
247
- if (type == "range" && state.chooseData.length == 2 || type != "range") {
248
- let chooseData = state.chooseData.slice(0);
249
- emit("choose", chooseData);
250
- if (props.poppable) {
251
- emit("update");
252
- }
253
- }
254
- };
255
- const chooseDay = (day, month, isFirst = false) => {
256
- if (getClass(day, month) != `${state.dayPrefix}--disabled`) {
257
- const { type } = props;
258
- let days = [...month.curData];
259
- days[2] = typeof day.day == "number" ? Utils.getNumTwoBit(day.day) : day.day;
260
- days[3] = `${days[0]}-${days[1]}-${days[2]}`;
261
- days[4] = Utils.getWhatDay(+days[0], +days[1], +days[2]);
262
- if (type == "multiple") {
263
- if (state.currDate.length > 0) {
264
- let hasIndex = void 0;
265
- state.currDate.forEach((item, index) => {
266
- if (item == days[3]) {
267
- hasIndex = index;
268
- }
269
- });
270
- if (isFirst) {
271
- state.chooseData.push([...days]);
272
- } else {
273
- if (hasIndex !== void 0) {
274
- state.currDate.splice(hasIndex, 1);
275
- state.chooseData.splice(hasIndex, 1);
276
- } else {
277
- state.currDate.push(days[3]);
278
- state.chooseData.push([...days]);
279
- }
280
- }
281
- } else {
282
- state.currDate = [days[3]];
283
- state.chooseData = [[...days]];
284
- }
285
- } else if (type == "range") {
286
- let curDataLength = Object.values(state.currDate).length;
287
- if (curDataLength == 2 || curDataLength == 0) {
288
- state.currDate = [days[3]];
289
- } else {
290
- if (Utils.compareDate(state.currDate[0], days[3])) {
291
- Array.isArray(state.currDate) && state.currDate.push(days[3]);
292
- } else {
293
- Array.isArray(state.currDate) && state.currDate.unshift(days[3]);
294
- }
295
- }
296
- if (state.chooseData.length == 2 || !state.chooseData.length) {
297
- state.chooseData = [[...days]];
298
- } else {
299
- if (Utils.compareDate(state.chooseData[0][3], days[3])) {
300
- state.chooseData = [...state.chooseData, [...days]];
301
- } else {
302
- state.chooseData = [[...days], ...state.chooseData];
303
- }
304
- }
305
- } else {
306
- state.currDate = days[3];
307
- state.chooseData = [...days];
308
- }
309
- if (!isFirst) {
310
- emit("select", state.chooseData);
311
- if (props.isAutoBackFill || !props.poppable) {
312
- confirm();
313
- }
314
- }
315
- }
316
- };
317
- const getCurrData = (type) => {
318
- const monthData = type == "prev" ? state.monthsData[0] : state.monthsData[state.monthsData.length - 1];
319
- let year = parseInt(monthData.curData[0]);
320
- let month = parseInt(monthData.curData[1].toString().replace(/^0/, ""));
321
- switch (type) {
322
- case "prev":
323
- month == 1 && (year -= 1);
324
- month = month == 1 ? 12 : --month;
325
- break;
326
- case "next":
327
- month == 12 && (year += 1);
328
- month = month == 12 ? 1 : ++month;
329
- break;
330
- }
331
- return [year + "", Utils.getNumTwoBit(month), Utils.getMonthDays(String(year), String(month)) + ""];
332
- };
333
- const getDaysStatus = (days, type, dateInfo) => {
334
- let { year, month } = dateInfo;
335
- if (type == "prev" && days >= 7) {
336
- days -= 7;
337
- }
338
- return Array.from(Array(days), (v, k) => {
339
- return {
340
- day: String(k + 1),
341
- type,
342
- year,
343
- month
344
- };
345
- });
346
- };
347
- const getPreDaysStatus = (days, type, dateInfo, preCurrMonthDays) => {
348
- days = days - props.firstDayOfWeek;
349
- let { year, month } = dateInfo;
350
- if (type == "prev" && days >= 7) {
351
- days -= 7;
352
- }
353
- let months2 = Array.from(Array(preCurrMonthDays), (v, k) => {
354
- return {
355
- day: String(k + 1),
356
- type,
357
- year,
358
- month
359
- };
360
- });
361
- return months2.slice(preCurrMonthDays - days);
362
- };
363
- const getMonth = (curData, type) => {
364
- const preMonthDays = Utils.getMonthPreDay(+curData[0], +curData[1]);
365
- let preMonth = Number(curData[1]) - 1;
366
- let preYear = Number(curData[0]);
367
- if (preMonth <= 0) {
368
- preMonth = 12;
369
- preYear += 1;
370
- }
371
- const currMonthDays = Utils.getMonthDays(String(curData[0]), String(curData[1]));
372
- const preCurrMonthDays = Utils.getMonthDays(preYear + "", preMonth + "");
373
- const title = {
374
- year: curData[0],
375
- month: curData[1]
376
- };
377
- const monthInfo = {
378
- curData,
379
- title: translate("monthTitle", title.year, title.month),
380
- monthData: [
381
- ...getPreDaysStatus(
382
- preMonthDays,
383
- "prev",
384
- { month: preMonth + "", year: preYear + "" },
385
- preCurrMonthDays
386
- ),
387
- ...getDaysStatus(currMonthDays, "curr", title)
388
- ],
389
- cssHeight: 0,
390
- cssScrollHeight: 0
391
- };
392
- monthInfo.cssHeight = 39 + (monthInfo.monthData.length > 35 ? 384 : 320);
393
- let cssScrollHeight = 0;
394
- if (state.monthsData.length > 0) {
395
- cssScrollHeight = state.monthsData[state.monthsData.length - 1].cssScrollHeight + state.monthsData[state.monthsData.length - 1].cssHeight;
396
- }
397
- monthInfo.cssScrollHeight = cssScrollHeight;
398
- if (type == "next") {
399
- if (!state.endData || !Utils.compareDate(
400
- `${state.endData[0]}-${state.endData[1]}-${Utils.getMonthDays(state.endData[0], state.endData[1])}`,
401
- `${curData[0]}-${curData[1]}-${curData[2]}`
402
- )) {
403
- state.monthsData.push(monthInfo);
404
- }
405
- } else {
406
- if (!state.startData || !Utils.compareDate(
407
- `${curData[0]}-${curData[1]}-${curData[2]}`,
408
- `${state.startData[0]}-${state.startData[1]}-01`
409
- )) {
410
- state.monthsData.unshift(monthInfo);
411
- } else {
412
- state.unLoadPrev = true;
413
- }
414
- }
415
- };
416
- const initData = () => {
417
- let propStartDate = props.startDate ? props.startDate : Utils.getDay(0);
418
- let propEndDate = props.endDate ? props.endDate : Utils.getDay(365);
419
- state.propStartDate = propStartDate;
420
- state.propEndDate = propEndDate;
421
- state.startData = splitDate(propStartDate);
422
- state.endData = splitDate(propEndDate);
423
- if (props.defaultValue || Array.isArray(props.defaultValue) && props.defaultValue.length > 0) {
424
- state.currDate = props.type != "one" ? [...props.defaultValue] : props.defaultValue;
425
- }
426
- const startDate = {
427
- year: Number(state.startData[0]),
428
- month: Number(state.startData[1])
429
- };
430
- const endDate = {
431
- year: Number(state.endData[0]),
432
- month: Number(state.endData[1])
433
- };
434
- let monthsNum = endDate.month - startDate.month;
435
- if (endDate.year - startDate.year > 0) {
436
- monthsNum = monthsNum + 12 * (endDate.year - startDate.year);
437
- }
438
- if (monthsNum <= 0) {
439
- monthsNum = 1;
440
- }
441
- getMonth(state.startData, "next");
442
- let i = 1;
443
- do {
444
- getMonth(getCurrData("next"), "next");
445
- } while (i++ < monthsNum);
446
- state.monthsNum = monthsNum;
447
- if (props.type == "range" && Array.isArray(state.currDate)) {
448
- if (state.currDate.length > 0) {
449
- if (propStartDate && Utils.compareDate(state.currDate[0], propStartDate)) {
450
- state.currDate.splice(0, 1, propStartDate);
451
- }
452
- if (propEndDate && Utils.compareDate(propEndDate, state.currDate[1])) {
453
- state.currDate.splice(1, 1, propEndDate);
454
- }
455
- state.defaultData = [...splitDate(state.currDate[0]), ...splitDate(state.currDate[1])];
456
- }
457
- } else if (props.type == "multiple" && Array.isArray(state.currDate)) {
458
- if (state.currDate.length > 0) {
459
- let defaultArr = [];
460
- let obj = {};
461
- state.currDate.forEach((item) => {
462
- if (propStartDate && !Utils.compareDate(item, propStartDate) && propEndDate && !Utils.compareDate(propEndDate, item)) {
463
- if (!Object.hasOwnProperty.call(obj, item)) {
464
- defaultArr.push(item);
465
- obj[item] = item;
466
- }
467
- }
468
- });
469
- state.currDate = [...defaultArr];
470
- state.defaultData = [...splitDate(defaultArr[0])];
471
- }
472
- } else {
473
- if (state.currDate) {
474
- if (propStartDate && Utils.compareDate(state.currDate, propStartDate)) {
475
- state.currDate = propStartDate;
476
- } else if (propEndDate && !Utils.compareDate(state.currDate, propEndDate)) {
477
- state.currDate = propEndDate;
478
- }
479
- state.defaultData = [...splitDate(state.currDate)];
480
- }
481
- }
482
- let current = 0;
483
- let lastCurrent = 0;
484
- if (state.defaultData.length > 0) {
485
- state.monthsData.forEach((item, index) => {
486
- if (item.title == translate("monthTitle", state.defaultData[0], state.defaultData[1])) {
487
- current = index;
488
- }
489
- if (props.type == "range") {
490
- if (item.title == translate("monthTitle", state.defaultData[3], state.defaultData[4])) {
491
- lastCurrent = index;
492
- }
493
- }
494
- });
495
- }
496
- setDefaultRange(monthsNum, current);
497
- state.currentIndex = current;
498
- state.yearMonthTitle = state.monthsData[state.currentIndex].title;
499
- if (state.defaultData.length > 0) {
500
- if (props.type == "range") {
501
- chooseDay({ day: state.defaultData[2], type: "curr" }, state.monthsData[state.currentIndex], true);
502
- chooseDay({ day: state.defaultData[5], type: "curr" }, state.monthsData[lastCurrent], true);
503
- } else if (props.type == "multiple") {
504
- [...state.currDate].forEach((item) => {
505
- let dateArr = splitDate(item);
506
- let current2 = state.currentIndex;
507
- state.monthsData.forEach((item2, index) => {
508
- if (item2.title == translate("monthTitle", dateArr[0], dateArr[1])) {
509
- current2 = index;
510
- }
511
- });
512
- chooseDay({ day: dateArr[2], type: "curr" }, state.monthsData[current2], true);
513
- });
514
- } else {
515
- chooseDay({ day: state.defaultData[2], type: "curr" }, state.monthsData[state.currentIndex], true);
516
- }
517
- }
518
- let lastItem = state.monthsData[state.monthsData.length - 1];
519
- let containerHeight = lastItem.cssHeight + lastItem.cssScrollHeight;
520
- requestAniFrame(() => {
521
- if ((months == null ? void 0 : months.value) && (monthsPanel == null ? void 0 : monthsPanel.value) && (viewArea == null ? void 0 : viewArea.value)) {
522
- viewHeight.value = months.value.clientHeight;
523
- monthsPanel.value.style.height = `${containerHeight}px`;
524
- months.value.scrollTop = state.monthsData[state.currentIndex].cssScrollHeight;
525
- }
526
- });
527
- state.avgHeight = Math.floor(containerHeight / (monthsNum + 1));
528
- };
529
- const scrollToDate = (date) => {
530
- if (Utils.compareDate(date, state.propStartDate)) {
531
- date = state.propStartDate;
532
- } else if (!Utils.compareDate(date, state.propEndDate)) {
533
- date = state.propEndDate;
534
- }
535
- let dateArr = splitDate(date);
536
- state.monthsData.forEach((item, index) => {
537
- if (item.title == translate("monthTitle", dateArr[0], dateArr[1])) {
538
- if (months.value) {
539
- let distance = state.monthsData[index].cssScrollHeight - months.value.scrollTop;
540
- if (props.toDateAnimation) {
541
- let flag = 0;
542
- let interval = setInterval(() => {
543
- flag++;
544
- if (months.value) {
545
- let offset = distance / 10;
546
- months.value.scrollTop = months.value.scrollTop + offset;
547
- }
548
- if (flag >= 10) {
549
- clearInterval(interval);
550
- if (months.value) {
551
- months.value.scrollTop = state.monthsData[index].cssScrollHeight;
552
- }
553
- }
554
- }, 40);
555
- } else {
556
- months.value.scrollTop = state.monthsData[index].cssScrollHeight;
557
- }
558
- }
559
- }
560
- });
561
- };
562
- useExpose({
563
- scrollToDate
564
- });
565
- const setDefaultRange = (monthsNum, current) => {
566
- if (monthsNum >= 3) {
567
- if (current > 0 && current < monthsNum) {
568
- state.defaultRange = [current - 1, current + 3];
569
- } else if (current == 0) {
570
- state.defaultRange = [current, current + 4];
571
- } else if (current == monthsNum) {
572
- state.defaultRange = [current - 2, current + 2];
573
- }
574
- } else {
575
- state.defaultRange = [0, monthsNum + 2];
576
- }
577
- let defaultScrollTop = state.monthsData[state.defaultRange[0]].cssScrollHeight;
578
- state.translateY = defaultScrollTop;
579
- };
580
- const isActive = (day, month) => {
581
- return props.type == "range" && day.type == "curr" && getClass(day, month) == "nut-calendar__day--active";
582
- };
583
- const isStartTip = (day, month) => {
584
- return isActive(day, month) && isStart(getCurrDate(day, month));
585
- };
586
- const isEndTip = (day, month) => {
587
- if (state.currDate.length >= 2 && isEnd(getCurrDate(day, month))) {
588
- return isActive(day, month);
589
- }
590
- return false;
591
- };
592
- const rangeTip = () => {
593
- if (state.currDate.length >= 2) {
594
- return Utils.isEqual(state.currDate[0], state.currDate[1]);
595
- }
596
- };
597
- const isCurrDay = (dateInfo) => {
598
- const date = `${dateInfo.year}-${dateInfo.month}-${Number(dateInfo.day) < 10 ? "0" + dateInfo.day : dateInfo.day}`;
599
- return Utils.isEqual(date, Utils.date2Str(new Date()));
600
- };
601
- const mothsViewScroll = (e) => {
602
- if (state.monthsData.length <= 1) {
603
- return;
604
- }
605
- const currentScrollTop = e.target.scrollTop;
606
- let current = Math.floor(currentScrollTop / state.avgHeight);
607
- if (current == 0) {
608
- if (currentScrollTop >= state.monthsData[current + 1].cssScrollHeight) {
609
- current += 1;
610
- }
611
- } else if (current > 0 && current < state.monthsNum - 1) {
612
- if (currentScrollTop >= state.monthsData[current + 1].cssScrollHeight) {
613
- current += 1;
614
- }
615
- if (currentScrollTop < state.monthsData[current].cssScrollHeight) {
616
- current -= 1;
617
- }
618
- } else {
619
- const viewPosition = Math.round(currentScrollTop + viewHeight.value);
620
- if (viewPosition < state.monthsData[current].cssScrollHeight + state.monthsData[current].cssHeight && currentScrollTop > state.monthsData[current - 1].cssScrollHeight) {
621
- current -= 1;
622
- }
623
- if (current + 1 <= state.monthsNum && viewPosition >= state.monthsData[current + 1].cssScrollHeight + state.monthsData[current + 1].cssHeight) {
624
- current += 1;
625
- }
626
- if (current >= 1 && currentScrollTop < state.monthsData[current - 1].cssScrollHeight) {
627
- current -= 1;
628
- }
629
- }
630
- if (state.currentIndex !== current) {
631
- state.currentIndex = current;
632
- setDefaultRange(state.monthsNum, current);
633
- }
634
- state.yearMonthTitle = state.monthsData[current].title;
635
- };
636
- const resetRender = () => {
637
- state.chooseData.splice(0);
638
- state.monthsData.splice(0);
639
- initData();
640
- };
641
- initData();
642
- watch(
643
- () => props.defaultValue,
644
- (val) => {
645
- if (val) {
646
- if (props.poppable) {
647
- resetRender();
648
- }
649
- }
650
- }
651
- );
652
- return {
653
- weeks,
654
- compConthsData,
655
- showTopBtn,
656
- topInfo,
657
- bottomInfo,
658
- rangeTip,
659
- mothsViewScroll,
660
- getClass,
661
- isStartTip,
662
- isEndTip,
663
- chooseDay,
664
- isCurrDay,
665
- confirm,
666
- monthsPanel,
667
- months,
668
- weeksPanel,
669
- viewArea,
670
- ...toRefs(state),
671
- ...toRefs(props),
672
- translate
673
- };
674
- }
675
- });
676
- const _hoisted_1 = { class: "nut-calendar__header" };
677
- const _hoisted_2 = {
678
- key: 0,
679
- class: "nut-calendar__header-title"
680
- };
681
- const _hoisted_3 = {
682
- key: 1,
683
- class: "nut-calendar__header-slot"
684
- };
685
- const _hoisted_4 = {
686
- key: 2,
687
- class: "nut-calendar__header-subtitle"
688
- };
689
- const _hoisted_5 = {
690
- class: "nut-calendar__weekdays",
691
- ref: "weeksPanel"
692
- };
693
- const _hoisted_6 = {
694
- class: "nut-calendar__panel",
695
- ref: "monthsPanel"
696
- };
697
- const _hoisted_7 = { class: "nut-calendar__month-title" };
698
- const _hoisted_8 = { class: "nut-calendar__days" };
699
- const _hoisted_9 = ["onClick"];
700
- const _hoisted_10 = { class: "nut-calendar__day-value" };
701
- const _hoisted_11 = {
702
- key: 0,
703
- class: "nut-calendar__day-tips nut-calendar__day-tips--top"
704
- };
705
- const _hoisted_12 = {
706
- key: 1,
707
- class: "nut-calendar__day-tips nut-calendar__day-tips--bottom"
708
- };
709
- const _hoisted_13 = {
710
- key: 2,
711
- class: "nut-calendar__day-tips--curr"
712
- };
713
- const _hoisted_14 = {
714
- key: 4,
715
- class: "nut-calendar__day-tip"
716
- };
717
- const _hoisted_15 = {
718
- key: 0,
719
- class: "nut-calendar__footer"
720
- };
721
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
722
- return openBlock(), createElementBlock("view", {
723
- class: normalizeClass(["nut-calendar", {
724
- "nut-calendar--nopop": !_ctx.poppable,
725
- "nut-calendar--nofooter": _ctx.isAutoBackFill
726
- }])
727
- }, [
728
- createElementVNode("view", _hoisted_1, [
729
- _ctx.showTitle ? (openBlock(), createElementBlock("view", _hoisted_2, toDisplayString(_ctx.title || _ctx.translate("title")), 1)) : createCommentVNode("", true),
730
- _ctx.showTopBtn ? (openBlock(), createElementBlock("view", _hoisted_3, [
731
- renderSlot(_ctx.$slots, "btn")
732
- ])) : createCommentVNode("", true),
733
- _ctx.showSubTitle ? (openBlock(), createElementBlock("view", _hoisted_4, toDisplayString(_ctx.yearMonthTitle), 1)) : createCommentVNode("", true),
734
- createElementVNode("view", _hoisted_5, [
735
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.weeks, (item, index) => {
736
- return openBlock(), createElementBlock("view", {
737
- class: "nut-calendar__weekday",
738
- key: index
739
- }, toDisplayString(item), 1);
740
- }), 128))
741
- ], 512)
742
- ]),
743
- createElementVNode("view", {
744
- class: "nut-calendar__content",
745
- ref: "months",
746
- onScroll: _cache[0] || (_cache[0] = (...args) => _ctx.mothsViewScroll && _ctx.mothsViewScroll(...args))
747
- }, [
748
- createElementVNode("view", _hoisted_6, [
749
- createElementVNode("view", {
750
- class: "nut-calendar__body",
751
- ref: "viewArea",
752
- style: normalizeStyle({ transform: `translateY(${_ctx.translateY}px)` })
753
- }, [
754
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.compConthsData, (month, index) => {
755
- return openBlock(), createElementBlock("view", {
756
- class: "nut-calendar__month",
757
- key: index
758
- }, [
759
- createElementVNode("view", _hoisted_7, toDisplayString(month.title), 1),
760
- createElementVNode("view", _hoisted_8, [
761
- createElementVNode("view", {
762
- class: normalizeClass(["nut-calendar__days-item", _ctx.type === "range" ? "nut-calendar__days-item--range" : ""])
763
- }, [
764
- (openBlock(true), createElementBlock(Fragment, null, renderList(month.monthData, (day, i) => {
765
- return openBlock(), createElementBlock("view", {
766
- key: i,
767
- class: normalizeClass(["nut-calendar__day", _ctx.getClass(day, month)]),
768
- onClick: ($event) => _ctx.chooseDay(day, month)
769
- }, [
770
- createElementVNode("view", _hoisted_10, [
771
- renderSlot(_ctx.$slots, "day", {
772
- date: day.type == "curr" ? day : ""
773
- }, () => [
774
- createTextVNode(toDisplayString(day.type == "curr" ? day.day : ""), 1)
775
- ])
776
- ]),
777
- _ctx.topInfo ? (openBlock(), createElementBlock("view", _hoisted_11, [
778
- renderSlot(_ctx.$slots, "topInfo", {
779
- date: day.type == "curr" ? day : ""
780
- })
781
- ])) : createCommentVNode("", true),
782
- _ctx.bottomInfo ? (openBlock(), createElementBlock("view", _hoisted_12, [
783
- renderSlot(_ctx.$slots, "bottomInfo", {
784
- date: day.type == "curr" ? day : ""
785
- })
786
- ])) : createCommentVNode("", true),
787
- !_ctx.bottomInfo && _ctx.showToday && _ctx.isCurrDay(day) ? (openBlock(), createElementBlock("view", _hoisted_13, toDisplayString(_ctx.translate("today")), 1)) : createCommentVNode("", true),
788
- _ctx.isStartTip(day, month) ? (openBlock(), createElementBlock("view", {
789
- key: 3,
790
- class: normalizeClass(["nut-calendar__day-tip", { "nut-calendar__day-tips--top": _ctx.rangeTip() }])
791
- }, toDisplayString(_ctx.startText || _ctx.translate("start")), 3)) : createCommentVNode("", true),
792
- _ctx.isEndTip(day, month) ? (openBlock(), createElementBlock("view", _hoisted_14, toDisplayString(_ctx.endText || _ctx.translate("end")), 1)) : createCommentVNode("", true)
793
- ], 10, _hoisted_9);
794
- }), 128))
795
- ], 2)
796
- ])
797
- ]);
798
- }), 128))
799
- ], 4)
800
- ], 512)
801
- ], 544),
802
- _ctx.poppable && !_ctx.isAutoBackFill ? (openBlock(), createElementBlock("view", _hoisted_15, [
803
- createElementVNode("view", {
804
- class: "nut-calendar__confirm",
805
- onClick: _cache[1] || (_cache[1] = (...args) => _ctx.confirm && _ctx.confirm(...args))
806
- }, toDisplayString(_ctx.confirmText || _ctx.translate("confirm")), 1)
807
- ])) : createCommentVNode("", true)
808
- ], 2);
809
- }
810
- const CalendarItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
811
- export {
812
- CalendarItem as C,
813
- Utils as U
814
- };