@nutui/nutui-react 1.5.2-beta.0 → 1.5.2-beta.1

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 (349) hide show
  1. package/dist/esm/ActionSheet/style/index.js +2 -0
  2. package/dist/esm/ActionSheet.js +92 -0
  3. package/dist/esm/Address/style/index.js +4 -0
  4. package/dist/esm/Address.js +622 -0
  5. package/dist/esm/Animate/style/index.js +2 -0
  6. package/dist/esm/Animate.js +55 -0
  7. package/dist/esm/AnimatingNumbers/style/index.js +3 -0
  8. package/dist/esm/AnimatingNumbers.js +127 -0
  9. package/dist/esm/Audio/style/index.js +4 -0
  10. package/dist/esm/Audio.js +266 -0
  11. package/dist/esm/Avatar/style/index.js +2 -0
  12. package/dist/esm/Avatar.js +132 -0
  13. package/dist/esm/AvatarContext-15733596.js +3 -0
  14. package/dist/esm/AvatarGroup/style/index.js +2 -0
  15. package/dist/esm/AvatarGroup.js +43 -0
  16. package/dist/esm/BackTop/style/index.js +2 -0
  17. package/dist/esm/BackTop.js +139 -0
  18. package/dist/esm/Badge/style/index.js +2 -0
  19. package/dist/esm/Badge.js +73 -0
  20. package/dist/esm/Barrage/style/index.js +2 -0
  21. package/dist/esm/Barrage.js +99 -0
  22. package/dist/esm/Button/style/index.js +2 -0
  23. package/dist/esm/Button.js +109 -0
  24. package/dist/esm/Calendar/style/index.js +2 -0
  25. package/dist/esm/Calendar.js +129 -0
  26. package/dist/esm/CalendarItem/style/index.js +2 -0
  27. package/dist/esm/CalendarItem.js +676 -0
  28. package/dist/esm/Card/style/index.js +4 -0
  29. package/dist/esm/Card.js +63 -0
  30. package/dist/esm/Cascader/style/index.js +3 -0
  31. package/dist/esm/Cascader.js +673 -0
  32. package/dist/esm/Cell/style/index.js +2 -0
  33. package/dist/esm/Cell.js +103 -0
  34. package/dist/esm/CellGroup/style/index.js +2 -0
  35. package/dist/esm/CellGroup.js +5 -0
  36. package/dist/esm/Checkbox/style/index.js +3 -0
  37. package/dist/esm/Checkbox.js +8 -0
  38. package/dist/esm/CheckboxGroup/style/index.js +2 -0
  39. package/dist/esm/CheckboxGroup.js +113 -0
  40. package/dist/esm/CircleProgress/style/index.js +2 -0
  41. package/dist/esm/CircleProgress.js +116 -0
  42. package/dist/esm/Col/style/index.js +2 -0
  43. package/dist/esm/Col.js +58 -0
  44. package/dist/esm/Collapse/style/index.js +2 -0
  45. package/dist/esm/Collapse.js +99 -0
  46. package/dist/esm/CollapseItem/style/index.js +2 -0
  47. package/dist/esm/CollapseItem.js +148 -0
  48. package/dist/esm/ConfigProvider/style/index.js +2 -0
  49. package/dist/esm/ConfigProvider.js +187 -0
  50. package/dist/esm/CountDown/style/index.js +2 -0
  51. package/dist/esm/CountDown.js +249 -0
  52. package/dist/esm/DatePicker/style/index.js +2 -0
  53. package/dist/esm/DatePicker.js +310 -0
  54. package/dist/esm/Dialog/style/index.js +3 -0
  55. package/dist/esm/Dialog.js +296 -0
  56. package/dist/esm/Divider/style/index.js +2 -0
  57. package/dist/esm/Divider.js +36 -0
  58. package/dist/esm/Drag/style/index.js +2 -0
  59. package/dist/esm/Drag.js +120 -0
  60. package/dist/esm/Elevator/style/index.js +2 -0
  61. package/dist/esm/Elevator.js +236 -0
  62. package/dist/esm/Ellipsis/style/index.js +2 -0
  63. package/dist/esm/Ellipsis.js +177 -0
  64. package/dist/esm/Empty/style/index.js +2 -0
  65. package/dist/esm/Empty.js +82 -0
  66. package/dist/esm/FixedNav/style/index.js +3 -0
  67. package/dist/esm/FixedNav.js +105 -0
  68. package/dist/esm/Form/style/index.js +2 -0
  69. package/dist/esm/Form.js +219 -0
  70. package/dist/esm/FormItem/style/index.js +2 -0
  71. package/dist/esm/FormItem.js +5 -0
  72. package/dist/esm/Grid/style/index.js +2 -0
  73. package/dist/esm/Grid.js +83 -0
  74. package/dist/esm/GridItem/style/index.js +2 -0
  75. package/dist/esm/GridItem.js +125 -0
  76. package/dist/esm/Icon/style/index.js +4 -0
  77. package/dist/esm/Icon.js +5 -0
  78. package/dist/esm/Image/style/index.js +2 -0
  79. package/dist/esm/Image.js +170 -0
  80. package/dist/esm/ImagePreview/style/index.js +4 -0
  81. package/dist/esm/ImagePreview.js +226 -0
  82. package/dist/esm/Indicator/style/index.js +2 -0
  83. package/dist/esm/Indicator.js +52 -0
  84. package/dist/esm/Infiniteloading/style/index.js +2 -0
  85. package/dist/esm/Infiniteloading.js +217 -0
  86. package/dist/esm/Input/style/index.js +2 -0
  87. package/dist/esm/Input.js +363 -0
  88. package/dist/esm/InputNumber/style/index.js +2 -0
  89. package/dist/esm/InputNumber.js +277 -0
  90. package/dist/esm/Layout/style/index.js +2 -0
  91. package/dist/esm/Layout.js +14 -0
  92. package/dist/esm/Menu/style/index.js +3 -0
  93. package/dist/esm/Menu.js +154 -0
  94. package/dist/esm/MenuItem/style/index.js +3 -0
  95. package/dist/esm/MenuItem.js +177 -0
  96. package/dist/esm/NavBar/style/index.js +2 -0
  97. package/dist/esm/NavBar.js +116 -0
  98. package/dist/esm/NoticeBar/style/index.js +2 -0
  99. package/dist/esm/NoticeBar.js +570 -0
  100. package/dist/esm/Notify/style/index.js +2 -0
  101. package/dist/esm/Notify.js +236 -0
  102. package/dist/esm/NumberKeyboard/style/index.js +2 -0
  103. package/dist/esm/NumberKeyboard.js +249 -0
  104. package/dist/esm/Overlay/style/index.js +2 -0
  105. package/dist/esm/Overlay.js +6 -0
  106. package/dist/esm/Pagination/style/index.js +2 -0
  107. package/dist/esm/Pagination.js +170 -0
  108. package/dist/esm/Picker/style/index.js +2 -0
  109. package/dist/esm/Picker.js +496 -0
  110. package/dist/esm/Popover/style/index.js +3 -0
  111. package/dist/esm/Popover.js +225 -0
  112. package/dist/esm/Popup/style/index.js +3 -0
  113. package/dist/esm/Popup.js +195 -0
  114. package/dist/esm/Price/style/index.js +2 -0
  115. package/dist/esm/Price.js +86 -0
  116. package/dist/esm/Progress/style/index.js +2 -0
  117. package/dist/esm/Progress.js +124 -0
  118. package/dist/esm/PullToRefresh/style/index.js +2 -0
  119. package/dist/esm/PullToRefresh.js +277 -0
  120. package/dist/esm/Radio/style/index.js +3 -0
  121. package/dist/esm/Radio.js +6 -0
  122. package/dist/esm/RadioGroup/style/index.js +2 -0
  123. package/dist/esm/RadioGroup.js +123 -0
  124. package/dist/esm/Range/style/index.js +2 -0
  125. package/dist/esm/Range.js +407 -0
  126. package/dist/esm/Rate/style/index.js +2 -0
  127. package/dist/esm/Rate.js +123 -0
  128. package/dist/esm/Row/style/index.js +2 -0
  129. package/dist/esm/Row.js +50 -0
  130. package/dist/esm/SearchBar/style/index.js +2 -0
  131. package/dist/esm/SearchBar.js +237 -0
  132. package/dist/esm/ShortPassword/style/index.js +3 -0
  133. package/dist/esm/ShortPassword.js +193 -0
  134. package/dist/esm/SideNavBar/style/index.js +2 -0
  135. package/dist/esm/SideNavBar.js +58 -0
  136. package/dist/esm/SideNavBarItem/style/index.js +2 -0
  137. package/dist/esm/SideNavBarItem.js +25 -0
  138. package/dist/esm/Signature/style/index.js +2 -0
  139. package/dist/esm/Signature.js +155 -0
  140. package/dist/esm/Skeleton/style/index.js +2 -0
  141. package/dist/esm/Skeleton.js +100 -0
  142. package/dist/esm/Step/style/index.js +2 -0
  143. package/dist/esm/Step.js +89 -0
  144. package/dist/esm/Steps/style/index.js +2 -0
  145. package/dist/esm/Steps.js +40 -0
  146. package/dist/esm/Sticky/style/index.js +2 -0
  147. package/dist/esm/Sticky.js +192 -0
  148. package/dist/esm/SubSideNavBar/style/index.js +2 -0
  149. package/dist/esm/SubSideNavBar.js +79 -0
  150. package/dist/esm/Swipe/style/index.js +2 -0
  151. package/dist/esm/Swipe.js +232 -0
  152. package/dist/esm/Swiper/style/index.js +2 -0
  153. package/dist/esm/Swiper.js +492 -0
  154. package/dist/esm/SwiperItem/style/index.js +2 -0
  155. package/dist/esm/SwiperItem.js +38 -0
  156. package/dist/esm/Switch/style/index.js +2 -0
  157. package/dist/esm/Switch.js +73 -0
  158. package/dist/esm/TabPane/style/index.js +2 -0
  159. package/dist/esm/TabPane.js +6 -0
  160. package/dist/esm/Tabbar/style/index.js +2 -0
  161. package/dist/esm/Tabbar.js +70 -0
  162. package/dist/esm/TabbarItem/style/index.js +2 -0
  163. package/dist/esm/TabbarItem.js +80 -0
  164. package/dist/esm/Table/style/index.js +2 -0
  165. package/dist/esm/Table.js +142 -0
  166. package/dist/esm/Tabs/style/index.js +4 -0
  167. package/dist/esm/Tabs.js +9 -0
  168. package/dist/esm/Tag/style/index.js +2 -0
  169. package/dist/esm/Tag.js +111 -0
  170. package/dist/esm/TextArea/style/index.js +2 -0
  171. package/dist/esm/TextArea.js +150 -0
  172. package/dist/esm/TimeDetail/style/index.js +2 -0
  173. package/dist/esm/TimeDetail.js +69 -0
  174. package/dist/esm/TimePannel/style/index.js +2 -0
  175. package/dist/esm/TimePannel.js +31 -0
  176. package/dist/esm/TimeSelect/style/index.js +4 -0
  177. package/dist/esm/TimeSelect.js +173 -0
  178. package/dist/esm/Toast/style/index.js +2 -0
  179. package/dist/esm/Toast.js +271 -0
  180. package/dist/esm/TrendArrow/style/index.js +2 -0
  181. package/dist/esm/TrendArrow.js +101 -0
  182. package/dist/esm/Uploader/style/index.js +4 -0
  183. package/dist/esm/Uploader.js +568 -0
  184. package/dist/esm/UserContext-101ad4a4.js +3 -0
  185. package/dist/esm/UserContext-2629d479.js +3 -0
  186. package/dist/esm/UserContext-b33bcf21.js +3 -0
  187. package/dist/esm/Video/style/index.js +2 -0
  188. package/dist/esm/Video.js +92 -0
  189. package/dist/esm/VirtualList/style/index.js +2 -0
  190. package/dist/esm/VirtualList.js +315 -0
  191. package/dist/esm/WaterMark/style/index.js +2 -0
  192. package/dist/esm/WaterMark.js +113 -0
  193. package/dist/esm/bem-3b438e61.js +8 -0
  194. package/dist/esm/cellgroup-fcc72767.js +34 -0
  195. package/dist/esm/checkbox-44e13cd0.js +137 -0
  196. package/dist/esm/date-c7aad4c0.js +97 -0
  197. package/dist/esm/formitem-8a73a5fb.js +157 -0
  198. package/dist/esm/get-scroll-parent-5f85dee8.js +24 -0
  199. package/dist/esm/grid.context-2ee27d95.js +6 -0
  200. package/dist/esm/icon-4ef1581c.js +70 -0
  201. package/dist/esm/index-030b7245.js +11 -0
  202. package/dist/esm/nutui-react.es.js +94 -0
  203. package/dist/esm/offsetContext-3ab00d40.js +16 -0
  204. package/dist/esm/overlay-de6c79d5.js +83 -0
  205. package/dist/esm/radio-9f141e6b.js +118 -0
  206. package/dist/esm/render-bbebb760.js +79 -0
  207. package/dist/esm/tabpane-01075e6c.js +29 -0
  208. package/dist/esm/tabs-e1b4e4b1.js +181 -0
  209. package/dist/esm/typings-f27b58f4.js +8 -0
  210. package/dist/esm/useClientRect-56bb675b.js +39 -0
  211. package/dist/esm/useTouch-cf73a407.js +99 -0
  212. package/dist/locales/base.d.ts +129 -0
  213. package/dist/locales/base.js +5 -0
  214. package/dist/locales/en-US.d.ts +3 -0
  215. package/dist/locales/en-US.js +135 -0
  216. package/dist/locales/id-ID.d.ts +3 -0
  217. package/dist/locales/id-ID.js +135 -0
  218. package/dist/locales/zh-CN.d.ts +3 -0
  219. package/dist/locales/zh-CN.js +137 -0
  220. package/dist/locales/zh-TW.d.ts +3 -0
  221. package/dist/locales/zh-TW.js +135 -0
  222. package/dist/locales/zh-UG.d.ts +3 -0
  223. package/dist/locales/zh-UG.js +135 -0
  224. package/dist/nutui.react.mjs +1 -1
  225. package/dist/nutui.react.umd.js +1 -1
  226. package/dist/packages/actionsheet/actionsheet.scss +103 -0
  227. package/dist/packages/address/address.scss +243 -0
  228. package/dist/packages/animate/animate.scss +284 -0
  229. package/dist/packages/animatingnumbers/animatingnumbers.scss +0 -0
  230. package/dist/packages/animatingnumbers/countup.scss +45 -0
  231. package/dist/packages/audio/audio.scss +93 -0
  232. package/dist/packages/avatar/avatar.scss +58 -0
  233. package/dist/packages/avatargroup/avatargroup.scss +14 -0
  234. package/dist/packages/backtop/backtop.scss +29 -0
  235. package/dist/packages/badge/badge.scss +53 -0
  236. package/dist/packages/barrage/barrage.scss +60 -0
  237. package/dist/packages/button/button.scss +245 -0
  238. package/dist/packages/calendar/calendar.scss +265 -0
  239. package/dist/packages/calendaritem/calendaritem.scss +0 -0
  240. package/dist/packages/card/card.scss +83 -0
  241. package/dist/packages/cascader/cascader.scss +108 -0
  242. package/dist/packages/cell/cell.scss +107 -0
  243. package/dist/packages/cellgroup/cellgroup.scss +46 -0
  244. package/dist/packages/checkbox/checkbox.scss +49 -0
  245. package/dist/packages/checkboxgroup/checkboxgroup.scss +33 -0
  246. package/dist/packages/circleprogress/circleprogress.scss +33 -0
  247. package/dist/packages/col/col.scss +24 -0
  248. package/dist/packages/collapse/collapse.scss +0 -0
  249. package/dist/packages/collapseitem/collapseitem.scss +161 -0
  250. package/dist/packages/configprovider/configprovider.scss +0 -0
  251. package/dist/packages/countdown/countdown.scss +3 -0
  252. package/dist/packages/datepicker/datepicker.scss +0 -0
  253. package/dist/packages/dialog/dialog.scss +135 -0
  254. package/dist/packages/divider/divider.scss +73 -0
  255. package/dist/packages/drag/drag.scss +10 -0
  256. package/dist/packages/elevator/elevator.scss +124 -0
  257. package/dist/packages/ellipsis/ellipsis.scss +17 -0
  258. package/dist/packages/empty/empty.scss +42 -0
  259. package/dist/packages/fixednav/fixednav.scss +141 -0
  260. package/dist/packages/form/form.scss +31 -0
  261. package/dist/packages/formitem/formitem.scss +100 -0
  262. package/dist/packages/grid/grid.scss +10 -0
  263. package/dist/packages/griditem/griditem.scss +108 -0
  264. package/dist/packages/icon/icon.scss +132 -0
  265. package/dist/packages/image/image.scss +53 -0
  266. package/dist/packages/imagepreview/imagepreview.scss +51 -0
  267. package/dist/packages/indicator/indicator.scss +70 -0
  268. package/dist/packages/infiniteloading/infiniteloading.scss +69 -0
  269. package/dist/packages/input/input.scss +203 -0
  270. package/dist/packages/inputnumber/inputnumber.scss +79 -0
  271. package/dist/packages/layout/layout.scss +2 -0
  272. package/dist/packages/menu/menu.scss +75 -0
  273. package/dist/packages/menuitem/menuitem.scss +120 -0
  274. package/dist/packages/navbar/navbar.scss +185 -0
  275. package/dist/packages/noticebar/noticebar.scss +156 -0
  276. package/dist/packages/notify/notify.scss +93 -0
  277. package/dist/packages/numberkeyboard/numberkeyboard.scss +147 -0
  278. package/dist/packages/overlay/overlay.scss +75 -0
  279. package/dist/packages/pagination/pagination.scss +81 -0
  280. package/dist/packages/picker/picker.scss +225 -0
  281. package/dist/packages/popover/popover.scss +288 -0
  282. package/dist/packages/popup/popup.scss +201 -0
  283. package/dist/packages/price/price.scss +37 -0
  284. package/dist/packages/progress/progress.scss +114 -0
  285. package/dist/packages/pulltorefresh/pulltorefresh.scss +26 -0
  286. package/dist/packages/radio/radio.scss +84 -0
  287. package/dist/packages/radiogroup/radiogroup.scss +86 -0
  288. package/dist/packages/range/range.scss +224 -0
  289. package/dist/packages/rate/rate.scss +36 -0
  290. package/dist/packages/row/row.scss +83 -0
  291. package/dist/packages/searchbar/searchbar.scss +146 -0
  292. package/dist/packages/shortpassword/shortpassword.scss +203 -0
  293. package/dist/packages/sidenavbar/sidenavbar.scss +100 -0
  294. package/dist/packages/sidenavbaritem/sidenavbaritem.scss +25 -0
  295. package/dist/packages/signature/signature.scss +39 -0
  296. package/dist/packages/skeleton/skeleton.scss +70 -0
  297. package/dist/packages/step/step.scss +274 -0
  298. package/dist/packages/steps/steps.scss +7 -0
  299. package/dist/packages/sticky/sticky.scss +3 -0
  300. package/dist/packages/subsidenavbar/subsidenavbar.scss +35 -0
  301. package/dist/packages/swipe/swipe.scss +33 -0
  302. package/dist/packages/swiper/swiper.scss +45 -0
  303. package/dist/packages/swiperitem/swiperitem.scss +3 -0
  304. package/dist/packages/switch/switch.scss +87 -0
  305. package/dist/packages/tabbar/tabbar.scss +46 -0
  306. package/dist/packages/tabbaritem/tabbaritem.scss +97 -0
  307. package/dist/packages/table/table.scss +152 -0
  308. package/dist/packages/tabpane/tabpane.scss +23 -0
  309. package/dist/packages/tabs/tabs.scss +284 -0
  310. package/dist/packages/tag/tag.scss +67 -0
  311. package/dist/packages/textarea/textarea.scss +60 -0
  312. package/dist/packages/timedetail/timedetail.scss +45 -0
  313. package/dist/packages/timepannel/timepannel.scss +17 -0
  314. package/dist/packages/timeselect/timeselect.scss +73 -0
  315. package/dist/packages/toast/toast.scss +98 -0
  316. package/dist/packages/trendarrow/trendarrow.scss +17 -0
  317. package/dist/packages/uploader/uploader.scss +237 -0
  318. package/dist/packages/video/video.scss +18 -0
  319. package/dist/packages/virtuallist/virtuallist.scss +87 -0
  320. package/dist/packages/watermark/watermark.scss +13 -0
  321. package/dist/style.css +1 -0
  322. package/dist/style.mjs +9 -0
  323. package/dist/styles/animation/drop.scss +24 -0
  324. package/dist/styles/animation/ease.scss +23 -0
  325. package/dist/styles/animation/fade.scss +20 -0
  326. package/dist/styles/animation/icon.scss +245 -0
  327. package/dist/styles/animation/index.scss +7 -0
  328. package/dist/styles/animation/rotate.scss +10 -0
  329. package/dist/styles/animation/zoom.scss +26 -0
  330. package/dist/styles/font/config.json +175 -0
  331. package/dist/styles/font/demo.css +539 -0
  332. package/dist/styles/font/demo_index.html +3063 -0
  333. package/dist/styles/font/iconfont.css +515 -0
  334. package/dist/styles/font/iconfont.eot +0 -0
  335. package/dist/styles/font/iconfont.js +68 -0
  336. package/dist/styles/font/iconfont.json +884 -0
  337. package/dist/styles/font/iconfont.svg +356 -0
  338. package/dist/styles/font/iconfont.ttf +0 -0
  339. package/dist/styles/font/iconfont.woff +0 -0
  340. package/dist/styles/font/iconfont.woff2 +0 -0
  341. package/dist/styles/mixins/index.scss +2 -0
  342. package/dist/styles/mixins/make-animation.scss +24 -0
  343. package/dist/styles/mixins/text-ellipsis.scss +20 -0
  344. package/dist/styles/theme-dark.scss +26 -0
  345. package/dist/styles/theme-default.scss +40 -0
  346. package/dist/styles/themes/default.scss +97 -0
  347. package/dist/styles/variables.scss +2610 -0
  348. package/dist/types/index.d.ts +2201 -0
  349. package/package.json +1 -1
@@ -0,0 +1,97 @@
1
+ var Utils = {
2
+ /**
3
+ * 是否为闫年
4
+ * @return {Boolse} true|false
5
+ */
6
+ isLeapYear: function isLeapYear(y) {
7
+ return y % 4 == 0 && y % 100 != 0 || y % 400 == 0;
8
+ },
9
+ /**
10
+ * 返回星期数
11
+ * @return {String}
12
+ */
13
+ getWhatDay: function getWhatDay(year, month, day) {
14
+ var date = new Date("".concat(year, "/").concat(month, "/").concat(day));
15
+ var index = date.getDay();
16
+ var dayNames = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
17
+ return dayNames[index];
18
+ },
19
+ /**
20
+ * 返回星期数
21
+ * @return {Number}
22
+ */
23
+ getMonthPreDay: function getMonthPreDay(year, month) {
24
+ var date = new Date("".concat(year, "/").concat(month, "/01"));
25
+ var day = date.getDay();
26
+ if (day == 0) {
27
+ day = 7;
28
+ }
29
+ return day;
30
+ },
31
+ /**
32
+ * 返回月份天数
33
+ * @return {Number}
34
+ */
35
+ getMonthDays: function getMonthDays(year, month) {
36
+ if (/^0/.test(month)) {
37
+ month = month.split('')[1];
38
+ }
39
+ return [0, 31, this.isLeapYear(Number(year)) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month];
40
+ },
41
+ /**
42
+ * 补齐数字位数
43
+ * @return {string}
44
+ */
45
+ getNumTwoBit: function getNumTwoBit(n) {
46
+ n = Number(n);
47
+ return (n > 9 ? '' : '0') + n;
48
+ },
49
+ /**
50
+ * 日期对象转成字符串
51
+ * @return {string}
52
+ */
53
+ date2Str: function date2Str(date, split) {
54
+ split = split || '-';
55
+ var y = date.getFullYear();
56
+ var m = this.getNumTwoBit(date.getMonth() + 1);
57
+ var d = this.getNumTwoBit(date.getDate());
58
+ return [y, m, d].join(split);
59
+ },
60
+ /**
61
+ * 返回日期格式字符串
62
+ * @param {Number} 0返回今天的日期、1返回明天的日期,2返回后天得日期,依次类推
63
+ * @return {string} '2014-12-31'
64
+ */
65
+ getDay: function getDay(i) {
66
+ i = i || 0;
67
+ var date = new Date();
68
+ var diff = i * (1000 * 60 * 60 * 24);
69
+ date = new Date(date.getTime() + diff);
70
+ return this.date2Str(date);
71
+ },
72
+ /**
73
+ * 时间比较
74
+ * @return {Boolean}
75
+ */
76
+ compareDate: function compareDate(date1, date2) {
77
+ var startTime = new Date(date1.replace('-', '/').replace('-', '/'));
78
+ var endTime = new Date(date2.replace('-', '/').replace('-', '/'));
79
+ if (startTime >= endTime) {
80
+ return false;
81
+ }
82
+ return true;
83
+ },
84
+ /**
85
+ * 时间是否相等
86
+ * @return {Boolean}
87
+ */
88
+ isEqual: function isEqual(date1, date2) {
89
+ var startTime = new Date(date1).getTime();
90
+ var endTime = new Date(date2).getTime();
91
+ if (startTime == endTime) {
92
+ return true;
93
+ }
94
+ return false;
95
+ }
96
+ };
97
+ export { Utils as U };
@@ -0,0 +1,157 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/createClass";
3
+ import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
4
+ import _inherits from "@babel/runtime/helpers/inherits";
5
+ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
+ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
9
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
10
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
11
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
12
+ import React__default, { createContext } from 'react';
13
+ import Cell from './Cell.js';
14
+ import { C as ComponentDefaults } from './typings-f27b58f4.js';
15
+ var FormItemContext = createContext({});
16
+ var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
17
+ name: '',
18
+ label: '',
19
+ className: '',
20
+ rules: [{
21
+ required: false,
22
+ message: ''
23
+ }],
24
+ disabled: false,
25
+ labelWidth: 90,
26
+ errorMessageAlign: 'left',
27
+ showErrorLine: true,
28
+ showErrorMessage: true,
29
+ initialValue: ''
30
+ });
31
+ var FormItem = /*#__PURE__*/function (_React__default$Compo) {
32
+ _inherits(FormItem, _React__default$Compo);
33
+ var _super = _createSuper(FormItem);
34
+ function FormItem() {
35
+ var _this;
36
+ _classCallCheck(this, FormItem);
37
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
38
+ args[_key] = arguments[_key];
39
+ }
40
+ _this = _super.call.apply(_super, [this].concat(args));
41
+ _defineProperty(_assertThisInitialized(_this), "cancelRegister", void 0);
42
+ _defineProperty(_assertThisInitialized(_this), "isInitialValue", false);
43
+ // children添加value属性和onChange事件
44
+ _defineProperty(_assertThisInitialized(_this), "getControlled", function (children) {
45
+ var _children$props, _children$props2;
46
+ var _this$context = _this.context,
47
+ getFieldValue = _this$context.getFieldValue,
48
+ setFieldsValue = _this$context.setFieldsValue;
49
+ var name = _this.props.name;
50
+ var type = children.type.NAME;
51
+ var defaultvalue = _this.props.initialValue || ((_children$props = children.props) === null || _children$props === void 0 ? void 0 : _children$props.defaultValue) || ((_children$props2 = children.props) === null || _children$props2 === void 0 ? void 0 : _children$props2.value);
52
+ if (defaultvalue && !_this.isInitialValue) {
53
+ setFieldsValue(_defineProperty({}, name, defaultvalue));
54
+ _this.isInitialValue = true;
55
+ }
56
+ return {
57
+ value: getFieldValue(name),
58
+ defaultValue: getFieldValue(name),
59
+ onChange: function onChange(event) {
60
+ var originOnChange = children.props.onChange;
61
+ if (originOnChange) {
62
+ originOnChange(event);
63
+ }
64
+ var newValue = event;
65
+ switch (type) {
66
+ case 'checkbox':
67
+ newValue = event.target.value;
68
+ break;
69
+ }
70
+ setFieldsValue(_defineProperty({}, name, newValue));
71
+ }
72
+ };
73
+ });
74
+ _defineProperty(_assertThisInitialized(_this), "onStoreChange", function () {
75
+ _this.forceUpdate();
76
+ });
77
+ _defineProperty(_assertThisInitialized(_this), "renderLayout", function (childNode) {
78
+ var _this$context$errList, _this$context$errList2;
79
+ var _defaultProps$_this$p = _objectSpread(_objectSpread({}, defaultProps), _this.props),
80
+ label = _defaultProps$_this$p.label,
81
+ name = _defaultProps$_this$p.name,
82
+ _defaultProps$_this$p2 = _defaultProps$_this$p.rules,
83
+ rules = _defaultProps$_this$p2 === void 0 ? [{
84
+ required: false,
85
+ message: ''
86
+ }] : _defaultProps$_this$p2,
87
+ className = _defaultProps$_this$p.className,
88
+ labelWidth = _defaultProps$_this$p.labelWidth,
89
+ errorMessageAlign = _defaultProps$_this$p.errorMessageAlign,
90
+ showErrorLine = _defaultProps$_this$p.showErrorLine,
91
+ showErrorMessage = _defaultProps$_this$p.showErrorMessage;
92
+ var item = ((_this$context$errList = _this.context.errList) === null || _this$context$errList === void 0 ? void 0 : _this$context$errList.length) > 0 && ((_this$context$errList2 = _this.context.errList) === null || _this$context$errList2 === void 0 ? void 0 : _this$context$errList2.filter(function (item) {
93
+ return item.field === name;
94
+ }));
95
+ var starPositon = _this.context.starPositon;
96
+ var renderStar = rules.length > 0 && rules[0].required && React__default.createElement("i", {
97
+ className: "required"
98
+ });
99
+ var renderLabel = starPositon === 'Right' ? React__default.createElement(React__default.Fragment, null, label, renderStar) : React__default.createElement(React__default.Fragment, null, renderStar, label);
100
+ return React__default.createElement(Cell, {
101
+ className: "nut-form-item ".concat(className)
102
+ }, label ? React__default.createElement("div", {
103
+ className: "nut-cell__title nut-form-item__label",
104
+ style: {
105
+ width: _this.pxCheck(labelWidth)
106
+ }
107
+ }, renderLabel) : null, React__default.createElement("div", {
108
+ className: "nut-cell__value nut-form-item__body"
109
+ }, React__default.createElement("div", {
110
+ className: "nut-form-item__body__slots"
111
+ }, childNode), item.length > 0 && React__default.createElement("div", {
112
+ className: "nut-form-item__body__tips",
113
+ style: {
114
+ textAlign: errorMessageAlign
115
+ }
116
+ }, item[0].message)));
117
+ });
118
+ _defineProperty(_assertThisInitialized(_this), "pxCheck", function (value) {
119
+ return Number.isNaN(Number(value)) ? String(value) : "".concat(value, "px");
120
+ });
121
+ return _this;
122
+ }
123
+ _createClass(FormItem, [{
124
+ key: "componentDidMount",
125
+ value: function componentDidMount() {
126
+ // 注册组件实例到FormStore
127
+ this.cancelRegister = this.context.registerField(this);
128
+ }
129
+ }, {
130
+ key: "componentWillUnmount",
131
+ value: function componentWillUnmount() {
132
+ if (this.cancelRegister) {
133
+ this.cancelRegister();
134
+ }
135
+ }
136
+ }, {
137
+ key: "render",
138
+ value: function render() {
139
+ var _this$props = this.props,
140
+ children = _this$props.children,
141
+ initialValue = _this$props.initialValue;
142
+ var c = Array.isArray(children) ? children[0] : children;
143
+ var restCNode = c;
144
+ if (initialValue) {
145
+ restCNode = React__default.cloneElement(c, {
146
+ defaultValue: initialValue
147
+ });
148
+ }
149
+ var returnChildNode = React__default.cloneElement(restCNode, this.getControlled(restCNode));
150
+ return this.renderLayout(returnChildNode);
151
+ }
152
+ }]);
153
+ return FormItem;
154
+ }(React__default.Component);
155
+ _defineProperty(FormItem, "defaultProps", defaultProps);
156
+ _defineProperty(FormItem, "contextType", FormItemContext);
157
+ export { FormItemContext as F, FormItem as a };
@@ -0,0 +1,24 @@
1
+ var canUseDom = !!(typeof window !== 'undefined' && typeof document !== 'undefined' && window.document && window.document.createElement);
2
+ var defaultRoot = canUseDom ? window : undefined;
3
+ var overflowStylePatterns = ['scroll', 'auto', 'overlay'];
4
+ function isElement(node) {
5
+ var ELEMENT_NODE_TYPE = 1;
6
+ return node.nodeType === ELEMENT_NODE_TYPE;
7
+ }
8
+ function getScrollParent(el) {
9
+ var root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultRoot;
10
+ var node = el;
11
+ while (node && node !== root && isElement(node)) {
12
+ if (node === document.body) {
13
+ return root;
14
+ }
15
+ var _window$getComputedSt = window.getComputedStyle(node),
16
+ overflowY = _window$getComputedSt.overflowY;
17
+ if (overflowStylePatterns.includes(overflowY) && node.scrollHeight > node.clientHeight) {
18
+ return node;
19
+ }
20
+ node = node.parentNode;
21
+ }
22
+ return root;
23
+ }
24
+ export { canUseDom as c, getScrollParent as g };
@@ -0,0 +1,6 @@
1
+ import React__default from 'react';
2
+ var gridContext = {
3
+ onClick: function onClick(item, index) {}
4
+ };
5
+ var GridContext = React__default.createContext(gridContext);
6
+ export { GridContext as G };
@@ -0,0 +1,70 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["name", "size", "classPrefix", "color", "tag", "children", "className", "fontClassName", "style", "onClick"];
4
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
5
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
+ import React__default from 'react';
7
+ import { c as cn } from './bem-3b438e61.js';
8
+ var defaultProps = {
9
+ name: '',
10
+ size: '',
11
+ classPrefix: 'nut-icon',
12
+ fontClassName: 'nutui-iconfont',
13
+ color: '',
14
+ tag: 'i',
15
+ onClick: function onClick(e) {},
16
+ className: ''
17
+ };
18
+ function pxCheck(value) {
19
+ if (value === '') {
20
+ return value;
21
+ }
22
+ if (Number.isNaN(Number(value))) {
23
+ return String(value);
24
+ }
25
+ return "".concat(value, "px");
26
+ }
27
+ function Icon(props) {
28
+ var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
29
+ name = _defaultProps$props.name,
30
+ size = _defaultProps$props.size,
31
+ classPrefix = _defaultProps$props.classPrefix,
32
+ color = _defaultProps$props.color,
33
+ tag = _defaultProps$props.tag,
34
+ children = _defaultProps$props.children,
35
+ className = _defaultProps$props.className,
36
+ fontClassName = _defaultProps$props.fontClassName,
37
+ style = _defaultProps$props.style,
38
+ onClick = _defaultProps$props.onClick,
39
+ rest = _objectWithoutProperties(_defaultProps$props, _excluded);
40
+ var isImage = name ? name.indexOf('/') !== -1 : false;
41
+ var type = isImage ? 'img' : tag;
42
+ var b = cn('icon');
43
+ var handleClick = function handleClick(e) {
44
+ if (onClick) {
45
+ onClick(e);
46
+ }
47
+ };
48
+ var hasSrc = function hasSrc() {
49
+ if (isImage) return {
50
+ src: name
51
+ };
52
+ return {};
53
+ };
54
+ var styles = {};
55
+ var checkedSize = pxCheck(size);
56
+ if (checkedSize) {
57
+ styles.width = styles.height = styles.fontSize = checkedSize;
58
+ }
59
+ return React__default.createElement(type, _objectSpread(_objectSpread({
60
+ className: isImage ? "".concat(b('img'), " ").concat(className || '', " ") : "".concat(fontClassName, " ").concat(b(null), " ").concat(classPrefix, "-").concat(name, " ").concat(className || ''),
61
+ style: _objectSpread(_objectSpread({
62
+ color: color
63
+ }, styles), style)
64
+ }, rest), {}, {
65
+ onClick: handleClick
66
+ }, hasSrc()), children);
67
+ }
68
+ Icon.defaultProps = defaultProps;
69
+ Icon.displayName = 'NutIcon';
70
+ export { Icon as I };
@@ -0,0 +1,11 @@
1
+ import _typeof from "@babel/runtime/helpers/typeof";
2
+ var isObject = function isObject(val) {
3
+ return val !== null && _typeof(val) === 'object';
4
+ };
5
+ var isFunction = function isFunction(val) {
6
+ return typeof val === 'function';
7
+ };
8
+ var isPromise = function isPromise(val) {
9
+ return isObject(val) && isFunction(val.then) && isFunction(val["catch"]);
10
+ };
11
+ export { isObject as a, isPromise as i };
@@ -0,0 +1,94 @@
1
+ export { default as Button } from './Button.js';
2
+ export { default as Cell } from './Cell.js';
3
+ export { default as CellGroup } from './CellGroup.js';
4
+ export { default as ConfigProvider } from './ConfigProvider.js';
5
+ export { default as Icon } from './Icon.js';
6
+ export { default as Image } from './Image.js';
7
+ export { default as Overlay } from './Overlay.js';
8
+ export { default as Popup } from './Popup.js';
9
+ export { default as Col } from './Col.js';
10
+ export { default as Divider } from './Divider.js';
11
+ export { default as Grid } from './Grid.js';
12
+ export { default as GridItem } from './GridItem.js';
13
+ export { default as Layout } from './Layout.js';
14
+ export { default as Row } from './Row.js';
15
+ export { default as Sticky } from './Sticky.js';
16
+ export { default as Elevator } from './Elevator.js';
17
+ export { default as FixedNav } from './FixedNav.js';
18
+ export { default as Indicator } from './Indicator.js';
19
+ export { default as Menu } from './Menu.js';
20
+ export { default as MenuItem } from './MenuItem.js';
21
+ export { default as NavBar } from './NavBar.js';
22
+ export { default as Pagination } from './Pagination.js';
23
+ export { default as SideNavBar } from './SideNavBar.js';
24
+ export { default as SideNavBarItem } from './SideNavBarItem.js';
25
+ export { default as SubSideNavBar } from './SubSideNavBar.js';
26
+ export { default as Tabbar } from './Tabbar.js';
27
+ export { default as TabbarItem } from './TabbarItem.js';
28
+ export { default as TabPane } from './TabPane.js';
29
+ export { default as Tabs } from './Tabs.js';
30
+ export { default as Calendar } from './Calendar.js';
31
+ export { default as CalendarItem } from './CalendarItem.js';
32
+ export { default as Cascader } from './Cascader.js';
33
+ export { default as Checkbox } from './Checkbox.js';
34
+ export { default as CheckboxGroup } from './CheckboxGroup.js';
35
+ export { default as DatePicker } from './DatePicker.js';
36
+ export { default as Form } from './Form.js';
37
+ export { default as FormItem } from './FormItem.js';
38
+ export { default as Input } from './Input.js';
39
+ export { default as InputNumber } from './InputNumber.js';
40
+ export { default as NumberKeyboard } from './NumberKeyboard.js';
41
+ export { default as Picker } from './Picker.js';
42
+ export { default as Radio } from './Radio.js';
43
+ export { default as RadioGroup } from './RadioGroup.js';
44
+ export { default as Range } from './Range.js';
45
+ export { default as Rate } from './Rate.js';
46
+ export { default as SearchBar } from './SearchBar.js';
47
+ export { default as ShortPassword } from './ShortPassword.js';
48
+ export { default as TextArea } from './TextArea.js';
49
+ export { default as Uploader } from './Uploader.js';
50
+ export { default as ActionSheet } from './ActionSheet.js';
51
+ export { default as BackTop } from './BackTop.js';
52
+ export { default as Dialog } from './Dialog.js';
53
+ export { default as Drag } from './Drag.js';
54
+ export { default as Infiniteloading } from './Infiniteloading.js';
55
+ export { default as Notify } from './Notify.js';
56
+ export { default as PullToRefresh } from './PullToRefresh.js';
57
+ export { default as Swipe } from './Swipe.js';
58
+ export { default as Switch } from './Switch.js';
59
+ export { default as Toast } from './Toast.js';
60
+ export { default as Animate } from './Animate.js';
61
+ export { default as AnimatingNumbers } from './AnimatingNumbers.js';
62
+ export { default as Audio } from './Audio.js';
63
+ export { default as Avatar } from './Avatar.js';
64
+ export { default as AvatarGroup } from './AvatarGroup.js';
65
+ export { default as Badge } from './Badge.js';
66
+ export { default as CircleProgress } from './CircleProgress.js';
67
+ export { default as Collapse } from './Collapse.js';
68
+ export { default as CollapseItem } from './CollapseItem.js';
69
+ export { default as CountDown } from './CountDown.js';
70
+ export { default as Ellipsis } from './Ellipsis.js';
71
+ export { default as Empty } from './Empty.js';
72
+ export { default as ImagePreview } from './ImagePreview.js';
73
+ export { default as NoticeBar } from './NoticeBar.js';
74
+ export { default as Popover } from './Popover.js';
75
+ export { default as Price } from './Price.js';
76
+ export { default as Progress } from './Progress.js';
77
+ export { default as Skeleton } from './Skeleton.js';
78
+ export { default as Step } from './Step.js';
79
+ export { default as Steps } from './Steps.js';
80
+ export { default as Swiper } from './Swiper.js';
81
+ export { default as SwiperItem } from './SwiperItem.js';
82
+ export { default as Table } from './Table.js';
83
+ export { default as Tag } from './Tag.js';
84
+ export { default as TrendArrow } from './TrendArrow.js';
85
+ export { default as Video } from './Video.js';
86
+ export { default as VirtualList } from './VirtualList.js';
87
+ export { default as WaterMark } from './WaterMark.js';
88
+ export { default as Address } from './Address.js';
89
+ export { default as Barrage } from './Barrage.js';
90
+ export { default as Card } from './Card.js';
91
+ export { default as Signature } from './Signature.js';
92
+ export { default as TimeDetail } from './TimeDetail.js';
93
+ export { default as TimePannel } from './TimePannel.js';
94
+ export { default as TimeSelect } from './TimeSelect.js';
@@ -0,0 +1,16 @@
1
+ import { createContext } from 'react';
2
+ var handleClick = function handleClick(e) {
3
+ e.stopPropagation();
4
+ var isIcon = e.target.className.includes('arrow-icon');
5
+ var isTitle = e.target.className.includes('__title') || isIcon;
6
+ var currentClass = e.currentTarget.className;
7
+ var isShow = currentClass.includes('nutShow');
8
+ var arrowIcon = e.currentTarget.querySelector('.arrow-icon');
9
+ var iconClass = arrowIcon.className;
10
+ if (isTitle) {
11
+ e.currentTarget.className = isShow ? currentClass.replace('nutShow', 'nutHide') : currentClass.replace('nutHide', 'nutShow');
12
+ arrowIcon.className = isShow ? iconClass.replace('arrow-down', 'arrow-up') : iconClass.replace('arrow-up', 'arrow-down');
13
+ }
14
+ };
15
+ var OffsetContext = createContext(20);
16
+ export { OffsetContext as O, handleClick as h };
@@ -0,0 +1,83 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
+ var _excluded = ["children", "zIndex", "duration", "overlayClass", "closeOnClickOverlay", "visible", "lockScroll", "overlayStyle"];
5
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
+ import React__default, { useState, useRef, useEffect } from 'react';
8
+ import classNames from 'classnames';
9
+ import { c as cn } from './bem-3b438e61.js';
10
+ var defaultOverlayProps = {
11
+ zIndex: 1000,
12
+ duration: 0.3,
13
+ overlayClass: '',
14
+ closeOnClickOverlay: true,
15
+ visible: false,
16
+ lockScroll: true,
17
+ overlayStyle: {}
18
+ };
19
+ var Overlay = function Overlay(props) {
20
+ var _defaultOverlayProps$ = _objectSpread(_objectSpread({}, defaultOverlayProps), props),
21
+ children = _defaultOverlayProps$.children,
22
+ zIndex = _defaultOverlayProps$.zIndex,
23
+ duration = _defaultOverlayProps$.duration,
24
+ overlayClass = _defaultOverlayProps$.overlayClass,
25
+ closeOnClickOverlay = _defaultOverlayProps$.closeOnClickOverlay,
26
+ visible = _defaultOverlayProps$.visible,
27
+ lockScroll = _defaultOverlayProps$.lockScroll,
28
+ overlayStyle = _defaultOverlayProps$.overlayStyle,
29
+ rest = _objectWithoutProperties(_defaultOverlayProps$, _excluded);
30
+ var _useState = useState(visible),
31
+ _useState2 = _slicedToArray(_useState, 2),
32
+ show = _useState2[0],
33
+ setShow = _useState2[1];
34
+ var renderRef = useRef(true);
35
+ var intervalRef = useRef(0);
36
+ useEffect(function () {
37
+ visible && setShow(visible);
38
+ lock();
39
+ }, [visible]);
40
+ useEffect(function () {
41
+ return function () {
42
+ clearTimeout(intervalRef.current);
43
+ document.body.classList.remove('nut-overflow-hidden');
44
+ };
45
+ }, []);
46
+ var b = cn('overlay');
47
+ var classes = classNames({
48
+ 'overlay-fade-leave-active': !renderRef.current && !visible,
49
+ 'overlay-fade-enter-active': visible,
50
+ 'first-render': renderRef.current && !visible,
51
+ 'hidden-render': !visible
52
+ }, overlayClass, b(''));
53
+ var styles = _objectSpread({
54
+ zIndex: zIndex,
55
+ animationDuration: "".concat(props.duration, "s")
56
+ }, overlayStyle);
57
+ var lock = function lock() {
58
+ if (lockScroll && visible) {
59
+ document.body.classList.add('nut-overflow-hidden');
60
+ } else {
61
+ document.body.classList.remove('nut-overflow-hidden');
62
+ }
63
+ };
64
+ var handleClick = function handleClick(e) {
65
+ if (closeOnClickOverlay) {
66
+ props.onClick && props.onClick(e);
67
+ renderRef.current = false;
68
+ var id = window.setTimeout(function () {
69
+ setShow(!visible);
70
+ }, duration * 1000 * 0.8);
71
+ intervalRef.current = id;
72
+ }
73
+ };
74
+ return React__default.createElement(React__default.Fragment, null, React__default.createElement("div", _objectSpread(_objectSpread({
75
+ className: classes,
76
+ style: styles
77
+ }, rest), {}, {
78
+ onClick: handleClick
79
+ }), children));
80
+ };
81
+ Overlay.defaultProps = defaultOverlayProps;
82
+ Overlay.displayName = 'NutOverlay';
83
+ export { Overlay as O, defaultOverlayProps as d };