@nutui/nutui 4.0.0-beta.6 → 4.0.0-beta.7

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