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