@nutui/nutui-react 0.1.1 → 1.1.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (288) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +120 -55
  3. package/dist/esm/ActionSheet/style/css.js +1 -0
  4. package/dist/esm/ActionSheet/style/index.js +1 -1
  5. package/dist/esm/ActionSheet.js +1 -10
  6. package/dist/esm/Address/style/css.js +1 -0
  7. package/dist/esm/Address/style/index.js +1 -1
  8. package/dist/esm/Address.js +34 -0
  9. package/dist/esm/AnimatingNumbers/style/css.js +1 -0
  10. package/dist/esm/AnimatingNumbers/style/index.js +1 -1
  11. package/dist/esm/Avatar/style/css.js +1 -0
  12. package/dist/esm/Avatar/style/index.js +1 -1
  13. package/dist/esm/BackTop/style/css.js +1 -0
  14. package/dist/esm/BackTop/style/index.js +1 -1
  15. package/dist/esm/Badge/style/css.js +1 -0
  16. package/dist/esm/Badge/style/index.js +1 -1
  17. package/dist/esm/Barrage/style/css.js +1 -0
  18. package/dist/esm/Barrage/style/index.js +1 -1
  19. package/dist/esm/Barrage.js +1 -0
  20. package/dist/esm/Button/style/css.js +1 -0
  21. package/dist/esm/Button/style/index.js +1 -1
  22. package/dist/esm/Button.js +110 -4
  23. package/dist/esm/Calendar/style/css.js +1 -0
  24. package/dist/esm/Calendar/style/index.js +1 -1
  25. package/dist/esm/CalendarItem/style/css.js +1 -0
  26. package/dist/esm/CalendarItem/style/index.js +1 -1
  27. package/dist/esm/Cell/style/css.js +1 -0
  28. package/dist/esm/Cell/style/index.js +1 -1
  29. package/dist/esm/Cell.js +1 -1
  30. package/dist/esm/CellGroup/style/css.js +1 -0
  31. package/dist/esm/CellGroup/style/index.js +1 -1
  32. package/dist/esm/Checkbox/style/css.js +1 -0
  33. package/dist/esm/Checkbox/style/index.js +1 -1
  34. package/dist/esm/CheckboxGroup/style/css.js +1 -0
  35. package/dist/esm/CheckboxGroup/style/index.js +1 -1
  36. package/dist/esm/CircleProgress/style/css.js +1 -0
  37. package/dist/esm/CircleProgress/style/index.js +1 -1
  38. package/dist/esm/Col/style/css.js +1 -0
  39. package/dist/esm/Col/style/index.js +1 -1
  40. package/dist/esm/Collapse/style/css.js +1 -0
  41. package/dist/esm/Collapse/style/index.js +1 -1
  42. package/dist/esm/CollapseItem/style/css.js +1 -0
  43. package/dist/esm/CollapseItem/style/index.js +1 -1
  44. package/dist/esm/Dialog/style/css.js +1 -0
  45. package/dist/esm/Dialog/style/index.js +1 -1
  46. package/dist/esm/Divider/style/css.js +1 -0
  47. package/dist/esm/Divider/style/index.js +1 -1
  48. package/dist/esm/Drag/style/css.js +1 -0
  49. package/dist/esm/Drag/style/index.js +1 -1
  50. package/dist/esm/Drag.js +11 -30
  51. package/dist/esm/Elevator/style/css.js +1 -0
  52. package/dist/esm/Elevator/style/index.js +1 -1
  53. package/dist/esm/FixedNav/style/css.js +1 -0
  54. package/dist/esm/FixedNav/style/index.js +1 -1
  55. package/dist/esm/FixedNav.js +7 -7
  56. package/dist/esm/Icon/style/css.js +1 -0
  57. package/dist/esm/Icon/style/index.js +1 -1
  58. package/dist/esm/Icon.js +70 -4
  59. package/dist/esm/Infiniteloading/style/css.js +1 -0
  60. package/dist/esm/Infiniteloading/style/index.js +1 -1
  61. package/dist/esm/Input/style/css.js +1 -0
  62. package/dist/esm/Input/style/index.js +1 -1
  63. package/dist/esm/InputNumber/style/css.js +1 -0
  64. package/dist/esm/InputNumber/style/index.js +1 -1
  65. package/dist/esm/Layout/style/css.js +1 -0
  66. package/dist/esm/Layout/style/index.js +1 -1
  67. package/dist/esm/NavBar/style/css.js +1 -0
  68. package/dist/esm/NavBar/style/index.js +1 -1
  69. package/dist/esm/NoticeBar/style/css.js +1 -0
  70. package/dist/esm/NoticeBar/style/index.js +1 -1
  71. package/dist/esm/Notify/style/css.js +1 -0
  72. package/dist/esm/Notify/style/index.js +1 -1
  73. package/dist/esm/Overlay/style/css.js +1 -0
  74. package/dist/esm/Overlay/style/index.js +1 -1
  75. package/dist/esm/Pagination/style/css.js +1 -0
  76. package/dist/esm/Pagination/style/index.js +1 -1
  77. package/dist/esm/Picker/style/css.js +1 -0
  78. package/dist/esm/Picker/style/index.js +1 -1
  79. package/dist/esm/Picker.js +0 -3
  80. package/dist/esm/Popover/style/css.js +1 -0
  81. package/dist/esm/Popover/style/index.js +1 -1
  82. package/dist/esm/Popup/style/css.js +1 -0
  83. package/dist/esm/Popup/style/index.js +1 -1
  84. package/dist/esm/Popup.js +2 -1
  85. package/dist/esm/Price/style/css.js +1 -0
  86. package/dist/esm/Price/style/index.js +1 -1
  87. package/dist/esm/Radio/style/css.js +1 -0
  88. package/dist/esm/Radio/style/index.js +1 -1
  89. package/dist/esm/RadioGroup/style/css.js +1 -0
  90. package/dist/esm/RadioGroup/style/index.js +1 -1
  91. package/dist/esm/Range/style/css.js +1 -0
  92. package/dist/esm/Range/style/index.js +1 -1
  93. package/dist/esm/Range.js +1 -4
  94. package/dist/esm/Rate/style/css.js +1 -0
  95. package/dist/esm/Rate/style/index.js +1 -1
  96. package/dist/esm/Row/style/css.js +1 -0
  97. package/dist/esm/Row/style/index.js +1 -1
  98. package/dist/esm/ShortPassword/style/css.js +1 -0
  99. package/dist/esm/ShortPassword/style/index.js +1 -1
  100. package/dist/esm/Signature/style/css.js +1 -0
  101. package/dist/esm/Signature/style/index.js +1 -1
  102. package/dist/esm/Signature.js +1 -2
  103. package/dist/esm/Step/style/css.js +1 -0
  104. package/dist/esm/Step/style/index.js +1 -1
  105. package/dist/esm/Steps/style/css.js +1 -0
  106. package/dist/esm/Steps/style/index.js +1 -1
  107. package/dist/esm/Swiper/style/css.js +1 -0
  108. package/dist/esm/Swiper/style/index.js +1 -1
  109. package/dist/esm/SwiperItem/style/css.js +1 -0
  110. package/dist/esm/SwiperItem/style/index.js +1 -1
  111. package/dist/esm/Switch/style/css.js +1 -0
  112. package/dist/esm/Switch/style/index.js +1 -1
  113. package/dist/esm/Tabbar/style/css.js +1 -0
  114. package/dist/esm/Tabbar/style/index.js +1 -1
  115. package/dist/esm/TabbarItem/style/css.js +1 -0
  116. package/dist/esm/TabbarItem/style/index.js +1 -1
  117. package/dist/esm/Tag/style/css.js +1 -0
  118. package/dist/esm/Tag/style/index.js +1 -1
  119. package/dist/esm/TextArea/style/css.js +1 -0
  120. package/dist/esm/TextArea/style/index.js +1 -1
  121. package/dist/esm/Toast/style/css.js +1 -0
  122. package/dist/esm/Toast/style/index.js +1 -1
  123. package/dist/esm/Toast.js +294 -7
  124. package/dist/esm/Uploader/style/css.js +1 -0
  125. package/dist/esm/Uploader/style/index.js +1 -1
  126. package/dist/esm/nutui-react.es.js +22 -22
  127. package/dist/nutui.react.es.js +10348 -10346
  128. package/dist/nutui.react.umd.js +19 -19
  129. package/dist/packages/cell/cell.scss +2 -0
  130. package/dist/packages/dialog/dialog.scss +8 -0
  131. package/dist/packages/fixednav/fixednav.scss +3 -0
  132. package/dist/packages/infiniteloading/infiniteloading.scss +1 -0
  133. package/dist/packages/input/input.scss +1 -0
  134. package/dist/packages/inputnumber/inputnumber.scss +1 -0
  135. package/dist/packages/range/range.scss +1 -0
  136. package/dist/packages/signature/signature.scss +1 -0
  137. package/dist/packages/step/step.scss +1 -0
  138. package/dist/packages/tag/tag.scss +1 -0
  139. package/dist/packages/toast/toast.scss +2 -0
  140. package/dist/packages/uploader/uploader.scss +2 -0
  141. package/dist/style.css +1 -1
  142. package/dist/style.es.js +1 -1
  143. package/dist/styles/themes/default.scss +22 -22
  144. package/dist/styles/variables.scss +3 -3
  145. package/dist/{esm/types/src/packages → types}/actionsheet/actionsheet.d.ts +0 -0
  146. package/dist/{esm/types/src/packages → types}/actionsheet/index.d.ts +0 -0
  147. package/dist/{esm/types/src/packages → types}/address/address.d.ts +0 -0
  148. package/dist/{esm/types/src/packages → types}/address/customRender.d.ts +0 -0
  149. package/dist/{esm/types/src/packages → types}/address/existRender.d.ts +0 -0
  150. package/dist/{esm/types/src/packages → types}/address/index.d.ts +0 -0
  151. package/dist/{esm/types/src/packages → types}/animatingnumbers/animatingnumbers.d.ts +0 -0
  152. package/dist/{esm/types/src/packages → types}/animatingnumbers/countup.d.ts +0 -0
  153. package/dist/{esm/types/src/packages → types}/animatingnumbers/index.d.ts +0 -0
  154. package/dist/{esm/types/src/packages → types}/avatar/avatar.d.ts +0 -0
  155. package/dist/{esm/types/src/packages → types}/avatar/index.d.ts +0 -0
  156. package/dist/{esm/types/src/packages → types}/backtop/backtop.d.ts +0 -0
  157. package/dist/{esm/types/src/packages → types}/backtop/index.d.ts +0 -0
  158. package/dist/{esm/types/src/packages → types}/badge/badge.d.ts +0 -0
  159. package/dist/{esm/types/src/packages → types}/badge/index.d.ts +0 -0
  160. package/dist/{esm/types/src/packages → types}/barrage/barrage.d.ts +0 -0
  161. package/dist/{esm/types/src/packages → types}/barrage/index.d.ts +0 -0
  162. package/dist/{esm/types/src/packages → types}/button/button.d.ts +0 -0
  163. package/dist/{esm/types/src/packages → types}/button/index.d.ts +0 -0
  164. package/dist/{esm/types/src/packages → types}/calendar/calendar.d.ts +0 -0
  165. package/dist/{esm/types/src/packages → types}/calendar/index.d.ts +0 -0
  166. package/dist/{esm/types/src/packages → types}/calendaritem/calendaritem.d.ts +0 -0
  167. package/dist/{esm/types/src/packages → types}/calendaritem/index.d.ts +0 -0
  168. package/dist/{esm/types/src/packages → types}/cell/cell.d.ts +0 -0
  169. package/dist/{esm/types/src/packages → types}/cell/index.d.ts +0 -0
  170. package/dist/{esm/types/src/packages → types}/cellgroup/cellgroup.d.ts +0 -0
  171. package/dist/{esm/types/src/packages → types}/cellgroup/index.d.ts +0 -0
  172. package/dist/{esm/types/src/packages → types}/checkbox/checkbox.d.ts +0 -0
  173. package/dist/{esm/types/src/packages → types}/checkbox/index.d.ts +0 -0
  174. package/dist/{esm/types/src/packages → types}/checkboxgroup/checkboxgroup.d.ts +0 -0
  175. package/dist/{esm/types/src/packages → types}/checkboxgroup/index.d.ts +0 -0
  176. package/dist/{esm/types/src/packages → types}/circleprogress/circleprogress.d.ts +0 -0
  177. package/dist/{esm/types/src/packages → types}/circleprogress/index.d.ts +0 -0
  178. package/dist/{esm/types/src/packages → types}/col/col.d.ts +0 -0
  179. package/dist/{esm/types/src/packages → types}/col/index.d.ts +0 -0
  180. package/dist/{esm/types/src/packages → types}/collapse/collapse.d.ts +0 -0
  181. package/dist/{esm/types/src/packages → types}/collapse/index.d.ts +0 -0
  182. package/dist/{esm/types/src/packages → types}/collapseitem/collapseitem.d.ts +0 -0
  183. package/dist/{esm/types/src/packages → types}/collapseitem/index.d.ts +0 -0
  184. package/dist/{esm/types/src/packages → types}/dialog/Confirm.d.ts +0 -0
  185. package/dist/{esm/types/src/packages → types}/dialog/Content.d.ts +0 -0
  186. package/dist/{esm/types/src/packages → types}/dialog/DialogWrap.d.ts +0 -0
  187. package/dist/{esm/types/src/packages → types}/dialog/DialogWrapper.d.ts +0 -0
  188. package/dist/{esm/types/src/packages → types}/dialog/Mask.d.ts +0 -0
  189. package/dist/{esm/types/src/packages → types}/dialog/config.d.ts +0 -0
  190. package/dist/{esm/types/src/packages → types}/dialog/dialog.d.ts +0 -0
  191. package/dist/{esm/types/src/packages → types}/dialog/index.d.ts +0 -0
  192. package/dist/{esm/types/src/packages → types}/divider/divider.d.ts +0 -0
  193. package/dist/{esm/types/src/packages → types}/divider/index.d.ts +0 -0
  194. package/dist/{esm/types/src/packages → types}/drag/drag.d.ts +0 -0
  195. package/dist/{esm/types/src/packages → types}/drag/index.d.ts +0 -0
  196. package/dist/{esm/types/src/packages → types}/elevator/elevator.d.ts +0 -0
  197. package/dist/{esm/types/src/packages → types}/elevator/index.d.ts +0 -0
  198. package/dist/{esm/types/src/packages → types}/fixednav/fixednav.d.ts +2 -2
  199. package/dist/{esm/types/src/packages → types}/fixednav/index.d.ts +0 -0
  200. package/dist/{esm/types/src/packages → types}/icon/icon.d.ts +0 -0
  201. package/dist/{esm/types/src/packages → types}/icon/index.d.ts +0 -0
  202. package/dist/{esm/types/src/packages → types}/infiniteloading/index.d.ts +0 -0
  203. package/dist/{esm/types/src/packages → types}/infiniteloading/infiniteloading.d.ts +0 -0
  204. package/dist/{esm/types/src/packages → types}/input/index.d.ts +0 -0
  205. package/dist/{esm/types/src/packages → types}/input/input.d.ts +0 -0
  206. package/dist/{esm/types/src/packages → types}/input/util.d.ts +0 -0
  207. package/dist/{esm/types/src/packages → types}/inputnumber/index.d.ts +0 -0
  208. package/dist/{esm/types/src/packages → types}/inputnumber/inputnumber.d.ts +0 -0
  209. package/dist/{esm/types/src/packages → types}/layout/index.d.ts +0 -0
  210. package/dist/{esm/types/src/packages → types}/layout/layout.d.ts +0 -0
  211. package/dist/{esm/types/src/packages → types}/navbar/index.d.ts +0 -0
  212. package/dist/{esm/types/src/packages → types}/navbar/navbar.d.ts +0 -0
  213. package/dist/{esm/types/src/packages → types}/noticebar/index.d.ts +0 -0
  214. package/dist/{esm/types/src/packages → types}/noticebar/noticebar.d.ts +0 -0
  215. package/dist/{esm/types/src/packages → types}/notify/Notification.d.ts +0 -0
  216. package/dist/{esm/types/src/packages → types}/notify/index.d.ts +0 -0
  217. package/dist/{esm/types/src/packages → types}/notify/notify.d.ts +0 -0
  218. package/dist/{esm/types/src/packages → types}/nutui.react.d.ts +23 -23
  219. package/dist/{esm/types/src/packages → types}/overlay/index.d.ts +0 -0
  220. package/dist/{esm/types/src/packages → types}/overlay/overlay.d.ts +0 -0
  221. package/dist/{esm/types/src/packages → types}/pagination/index.d.ts +0 -0
  222. package/dist/{esm/types/src/packages → types}/pagination/pagination.d.ts +0 -0
  223. package/dist/{esm/types/src/packages → types}/picker/index.d.ts +0 -0
  224. package/dist/{esm/types/src/packages → types}/picker/picker.d.ts +0 -0
  225. package/dist/{esm/types/src/packages → types}/picker/pickerSlot.d.ts +0 -0
  226. package/dist/{esm/types/src/packages → types}/popover/Trigger.d.ts +0 -0
  227. package/dist/{esm/types/src/packages → types}/popover/index.d.ts +0 -0
  228. package/dist/{esm/types/src/packages → types}/popover/popover.d.ts +0 -0
  229. package/dist/{esm/types/src/packages → types}/popup/index.d.ts +0 -0
  230. package/dist/{esm/types/src/packages → types}/popup/popup.d.ts +0 -0
  231. package/dist/{esm/types/src/packages → types}/price/index.d.ts +0 -0
  232. package/dist/{esm/types/src/packages → types}/price/price.d.ts +0 -0
  233. package/dist/{esm/types/src/packages → types}/radio/context.d.ts +0 -0
  234. package/dist/{esm/types/src/packages → types}/radio/index.d.ts +0 -0
  235. package/dist/{esm/types/src/packages → types}/radio/radio.d.ts +0 -0
  236. package/dist/{esm/types/src/packages → types}/radiogroup/index.d.ts +0 -0
  237. package/dist/{esm/types/src/packages → types}/radiogroup/radiogroup.d.ts +0 -0
  238. package/dist/{esm/types/src/packages → types}/range/index.d.ts +0 -0
  239. package/dist/{esm/types/src/packages → types}/range/range.d.ts +0 -0
  240. package/dist/{esm/types/src/packages → types}/rate/index.d.ts +0 -0
  241. package/dist/{esm/types/src/packages → types}/rate/rate.d.ts +0 -0
  242. package/dist/{esm/types/src/packages → types}/row/UserContext.d.ts +0 -0
  243. package/dist/{esm/types/src/packages → types}/row/index.d.ts +0 -0
  244. package/dist/{esm/types/src/packages → types}/row/row.d.ts +0 -0
  245. package/dist/{esm/types/src/packages → types}/shortpassword/index.d.ts +0 -0
  246. package/dist/{esm/types/src/packages → types}/shortpassword/shortpassword.d.ts +0 -0
  247. package/dist/{esm/types/src/packages → types}/signature/index.d.ts +0 -0
  248. package/dist/{esm/types/src/packages → types}/signature/signature.d.ts +0 -0
  249. package/dist/{esm/types/src/packages → types}/step/index.d.ts +0 -0
  250. package/dist/{esm/types/src/packages → types}/step/step.d.ts +0 -0
  251. package/dist/{esm/types/src/packages → types}/steps/UserContext.d.ts +0 -0
  252. package/dist/{esm/types/src/packages → types}/steps/index.d.ts +0 -0
  253. package/dist/{esm/types/src/packages → types}/steps/steps.d.ts +0 -0
  254. package/dist/{esm/types/src/packages → types}/swiper/UserContext.d.ts +0 -0
  255. package/dist/{esm/types/src/packages → types}/swiper/index.d.ts +0 -0
  256. package/dist/{esm/types/src/packages → types}/swiper/swiper.d.ts +0 -0
  257. package/dist/{esm/types/src/packages → types}/swiperitem/index.d.ts +0 -0
  258. package/dist/{esm/types/src/packages → types}/swiperitem/swiperitem.d.ts +0 -0
  259. package/dist/{esm/types/src/packages → types}/switch/index.d.ts +0 -0
  260. package/dist/{esm/types/src/packages → types}/switch/switch.d.ts +0 -0
  261. package/dist/{esm/types/src/packages → types}/tabbar/index.d.ts +0 -0
  262. package/dist/{esm/types/src/packages → types}/tabbar/tabbar.d.ts +0 -0
  263. package/dist/types/tabbaritem/index.d.ts +2 -0
  264. package/dist/{esm/types/src/packages/tabbaritem/tabbarItem.d.ts → types/tabbaritem/tabbaritem.d.ts} +0 -0
  265. package/dist/{esm/types/src/packages → types}/tag/index.d.ts +0 -0
  266. package/dist/{esm/types/src/packages → types}/tag/tag.d.ts +0 -0
  267. package/dist/{esm/types/src/packages → types}/textarea/index.d.ts +0 -0
  268. package/dist/{esm/types/src/packages → types}/textarea/textarea.d.ts +0 -0
  269. package/dist/{esm/types/src/packages → types}/toast/Notification.d.ts +0 -0
  270. package/dist/{esm/types/src/packages → types}/toast/index.d.ts +0 -0
  271. package/dist/{esm/types/src/packages → types}/toast/toast.d.ts +0 -0
  272. package/dist/{esm/types/src/packages → types}/uploader/index.d.ts +0 -0
  273. package/dist/{esm/types/src/packages → types}/uploader/upload.d.ts +0 -0
  274. package/dist/{esm/types/src/packages → types}/uploader/uploader.d.ts +0 -0
  275. package/package.json +12 -12
  276. package/dist/esm/button-345fb015.js +0 -110
  277. package/dist/esm/icon-63c0d58f.js +0 -70
  278. package/dist/esm/toast-420b65b7.js +0 -294
  279. package/dist/esm/types/src/packages/nutui.react.build.d.ts +0 -56
  280. package/dist/esm/types/src/packages/tabbaritem/index.d.ts +0 -2
  281. package/dist/esm/types/src/utils/bem.d.ts +0 -2
  282. package/dist/esm/types/src/utils/create/bem.d.ts +0 -2
  283. package/dist/esm/types/src/utils/create/index.d.ts +0 -1
  284. package/dist/esm/types/src/utils/date.d.ts +0 -49
  285. package/dist/esm/types/src/utils/index.d.ts +0 -1
  286. package/dist/esm/types/src/utils/raf.d.ts +0 -2
  287. package/dist/esm/types/src/utils/useRect/index.d.ts +0 -17
  288. package/dist/esm/types/src/utils/useTouch/index.d.ts +0 -16
package/dist/esm/Toast.js CHANGED
@@ -1,8 +1,295 @@
1
- import { T as Toast } from './toast-420b65b7.js';
2
- export { T as default } from './toast-420b65b7.js';
3
- import 'react';
4
- import 'react-dom';
5
- import './bem-893ad28d.js';
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
+
9
+ 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; }
10
+
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
+
13
+ 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); }; }
14
+
15
+ 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; } }
16
+
17
+ import * as React from 'react';
18
+ import * as ReactDOM from 'react-dom';
19
+ import { c as cn } from './bem-893ad28d.js';
20
+ import Icon from './Icon.js';
21
+ import classNames from 'classnames';
6
22
  import '@bem-react/classname';
7
- import './icon-63c0d58f.js';
8
- import 'classnames';
23
+
24
+ var Notification = /*#__PURE__*/function (_React$PureComponent) {
25
+ _inherits(Notification, _React$PureComponent);
26
+
27
+ var _super = _createSuper(Notification);
28
+
29
+ function Notification(props) {
30
+ var _this;
31
+
32
+ _classCallCheck(this, Notification);
33
+
34
+ _this = _super.call(this, props);
35
+
36
+ _defineProperty(_assertThisInitialized(_this), "closeTimer", void 0);
37
+
38
+ _this.close = _this.close.bind(_assertThisInitialized(_this));
39
+ _this.startCloseTimer = _this.startCloseTimer.bind(_assertThisInitialized(_this));
40
+ _this.clearCloseTimer = _this.clearCloseTimer.bind(_assertThisInitialized(_this));
41
+ _this.close = _this.close.bind(_assertThisInitialized(_this));
42
+ _this.clickCover = _this.clickCover.bind(_assertThisInitialized(_this));
43
+ _this.state = {
44
+ show: true
45
+ };
46
+ return _this;
47
+ }
48
+
49
+ _createClass(Notification, [{
50
+ key: "close",
51
+ value: function close() {
52
+ this.setState({
53
+ show: false
54
+ });
55
+ this.clearCloseTimer();
56
+ this.props.onClose();
57
+ }
58
+ }, {
59
+ key: "startCloseTimer",
60
+ value: function startCloseTimer() {
61
+ var _this2 = this;
62
+
63
+ var duration = this.props.duration;
64
+
65
+ if (duration) {
66
+ this.closeTimer = window.setTimeout(function () {
67
+ _this2.close();
68
+ }, duration * 1000);
69
+ }
70
+ }
71
+ }, {
72
+ key: "clearCloseTimer",
73
+ value: function clearCloseTimer() {
74
+ if (this.closeTimer) {
75
+ clearTimeout(this.closeTimer);
76
+ this.closeTimer = -1;
77
+ }
78
+ }
79
+ }, {
80
+ key: "clickCover",
81
+ value: function clickCover() {
82
+ var closeOnClickOverlay = this.props.closeOnClickOverlay;
83
+
84
+ if (closeOnClickOverlay) {
85
+ this.close();
86
+ }
87
+ }
88
+ }, {
89
+ key: "componentDidMount",
90
+ value: function componentDidMount() {
91
+ this.startCloseTimer();
92
+ }
93
+ }, {
94
+ key: "componentWillUnmount",
95
+ value: function componentWillUnmount() {
96
+ this.clearCloseTimer();
97
+ }
98
+ }, {
99
+ key: "render",
100
+ value: function render() {
101
+ var _classNames,
102
+ _this3 = this;
103
+
104
+ var _this$props = this.props,
105
+ style = _this$props.style,
106
+ icon = _this$props.icon,
107
+ msg = _this$props.msg,
108
+ bottom = _this$props.bottom,
109
+ center = _this$props.center,
110
+ bgColor = _this$props.bgColor,
111
+ coverColor = _this$props.coverColor,
112
+ textAlignCenter = _this$props.textAlignCenter,
113
+ size = _this$props.size,
114
+ customClass = _this$props.customClass,
115
+ cover = _this$props.cover,
116
+ type = _this$props.type;
117
+ this.state;
118
+ var toastBem = cn('toast');
119
+ var classes = classNames((_classNames = {}, _defineProperty(_classNames, 'nut-toast-center', center), _defineProperty(_classNames, 'nut-toast-has-icon', icon), _defineProperty(_classNames, 'nut-toast-cover', cover), _defineProperty(_classNames, 'nut-toast-loading', type === 'loading'), _defineProperty(_classNames, "customClass", customClass), _defineProperty(_classNames, 'nut-toast-' + size, true), _classNames));
120
+ return React.createElement(React.Fragment, null, React.createElement("div", {
121
+ className: "".concat(toastBem(), " ").concat(classes),
122
+ style: {
123
+ bottom: center ? 'auto' : bottom + 'px',
124
+ backgroundColor: cover ? coverColor : ''
125
+ },
126
+ onClick: function onClick() {
127
+ _this3.clickCover();
128
+ }
129
+ }, React.createElement("div", {
130
+ className: toastBem('inner'),
131
+ style: {
132
+ textAlign: textAlignCenter ? 'center' : 'left',
133
+ backgroundColor: bgColor
134
+ }
135
+ }, icon ? React.createElement("p", {
136
+ className: toastBem('icon-wrapper')
137
+ }, React.createElement(Icon, {
138
+ name: icon ? icon : '',
139
+ size: "20"
140
+ })) : null, React.createElement("span", {
141
+ className: toastBem('text')
142
+ }, msg))));
143
+ }
144
+ }]);
145
+
146
+ return Notification;
147
+ }(React.PureComponent);
148
+
149
+ _defineProperty(Notification, "newInstance", void 0);
150
+
151
+ Notification.newInstance = function (properties, callback) {
152
+ var element = document.createElement('div');
153
+
154
+ if (properties.id) {
155
+ element.setAttribute('id', "".concat(properties.id));
156
+ }
157
+
158
+ document.body.appendChild(element);
159
+ var called = false;
160
+
161
+ function ref(instance) {
162
+ if (called) {
163
+ return;
164
+ }
165
+
166
+ called = true;
167
+ callback({
168
+ component: instance,
169
+ destroy: function destroy() {
170
+ ReactDOM.unmountComponentAtNode(element);
171
+ element && element.parentNode && element.parentNode.removeChild(element);
172
+ }
173
+ });
174
+ }
175
+
176
+ ReactDOM.render(React.createElement(Notification, _objectSpread(_objectSpread({}, properties), {}, {
177
+ ref: ref
178
+ })), element);
179
+ };
180
+
181
+ var messageInstance = null;
182
+ var options = {
183
+ msg: '',
184
+ id: '',
185
+ duration: 1.5,
186
+ center: true,
187
+ type: 'text',
188
+ customClass: '',
189
+ bottom: 30,
190
+ size: 'base',
191
+ icon: '',
192
+ textAlignCenter: true,
193
+ loadingRotate: true,
194
+ bgColor: 'rgba(0, 0, 0, .8)',
195
+ onClose: function onClose() {},
196
+ cover: false,
197
+ coverColor: 'rgba(0, 0, 0, 0)',
198
+ closeOnClickOverlay: false // 是否点击遮罩可关闭
199
+
200
+ };
201
+
202
+ function getInstance(props, callback) {
203
+ if (messageInstance) {
204
+ messageInstance.destroy();
205
+ messageInstance = null;
206
+ }
207
+
208
+ Notification.newInstance(props, function (notification) {
209
+ return callback && callback(notification);
210
+ });
211
+ }
212
+
213
+ function notice(opts) {
214
+ function close() {
215
+ if (messageInstance) {
216
+ messageInstance.destroy();
217
+ messageInstance = null;
218
+ }
219
+ }
220
+
221
+ opts = _objectSpread(_objectSpread(_objectSpread({}, options), opts), {}, {
222
+ onClose: close
223
+ });
224
+ getInstance(opts, function (notification) {
225
+ messageInstance = notification;
226
+ });
227
+ }
228
+
229
+ var errorMsg = function errorMsg(msg) {
230
+ if (!msg) {
231
+ console.warn('[NutUI Toast]: msg不能为空');
232
+ return;
233
+ }
234
+ };
235
+
236
+ var Toast = {
237
+ text: function text(msg) {
238
+ var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
239
+ errorMsg(msg);
240
+ return notice(_objectSpread({
241
+ msg: msg,
242
+ type: 'text'
243
+ }, option));
244
+ },
245
+ success: function success(msg) {
246
+ var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
247
+ errorMsg(msg);
248
+ return notice(_objectSpread({
249
+ msg: msg,
250
+ icon: 'success',
251
+ type: 'success'
252
+ }, option));
253
+ },
254
+ fail: function fail(msg) {
255
+ var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
256
+ errorMsg(msg);
257
+ return notice(_objectSpread({
258
+ msg: msg,
259
+ icon: 'failure',
260
+ type: 'fail'
261
+ }, option));
262
+ },
263
+ loading: function loading(msg) {
264
+ var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
265
+ errorMsg(msg);
266
+ return notice(_objectSpread({
267
+ msg: msg,
268
+ icon: 'loading',
269
+ type: 'loading'
270
+ }, option));
271
+ },
272
+ warn: function warn(msg) {
273
+ var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
274
+ errorMsg(msg);
275
+ return notice(_objectSpread({
276
+ msg: msg,
277
+ icon: 'tips',
278
+ type: 'warn'
279
+ }, option));
280
+ },
281
+ customIcon: function customIcon(msg) {
282
+ var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
283
+ errorMsg(msg);
284
+ return notice(_objectSpread({
285
+ msg: msg
286
+ }, option));
287
+ },
288
+ hide: function hide() {
289
+ if (messageInstance) {
290
+ messageInstance.destroy();
291
+ messageInstance = null;
292
+ }
293
+ }
294
+ };
295
+ export { Toast as default };
@@ -0,0 +1 @@
1
+ require('../../../packages/uploader/uploader.css')
@@ -1 +1 @@
1
- import '../../../packages/uploader/uploader.scss'
1
+ require('../../../packages/uploader/uploader.scss')
@@ -9,47 +9,47 @@ export { default as Divider } from './Divider.js';
9
9
  export { default as Layout } from './Layout.js';
10
10
  export { default as Row } from './Row.js';
11
11
  export { default as Col } from './Col.js';
12
- export { default as Drag } from './Drag.js';
13
- export { default as Collapse } from './Collapse.js';
14
12
  export { default as Toast } from './Toast.js';
15
- export { default as BackTop } from './BackTop.js';
16
- export { default as Range } from './Range.js';
17
- export { default as Infiniteloading } from './Infiniteloading.js';
18
- export { default as Steps } from './Steps.js';
19
- export { default as Step } from './Step.js';
20
- export { default as CircleProgress } from './CircleProgress.js';
13
+ export { default as Dialog } from './Dialog.js';
21
14
  export { default as Popup } from './Popup.js';
22
15
  export { default as ActionSheet } from './ActionSheet.js';
16
+ export { default as Picker } from './Picker.js';
17
+ export { default as Infiniteloading } from './Infiniteloading.js';
18
+ export { default as Popover } from './Popover.js';
19
+ export { default as Collapse } from './Collapse.js';
20
+ export { default as CollapseItem } from './CollapseItem.js';
21
+ export { default as Range } from './Range.js';
22
+ export { default as CircleProgress } from './CircleProgress.js';
23
23
  export { default as NoticeBar } from './NoticeBar.js';
24
24
  export { default as Notify } from './Notify.js';
25
- export { default as Dialog } from './Dialog.js';
26
25
  export { default as Switch } from './Switch.js';
27
- export { default as CollapseItem } from './CollapseItem.js';
28
- export { default as Swiper } from './Swiper.js';
29
- export { default as SwiperItem } from './SwiperItem.js';
30
26
  export { default as NavBar } from './NavBar.js';
31
27
  export { default as Tabbar } from './Tabbar.js';
32
28
  export { default as TabbarItem } from './TabbarItem.js';
33
- export { default as InputNumber } from './InputNumber.js';
34
29
  export { default as Elevator } from './Elevator.js';
35
30
  export { default as FixedNav } from './FixedNav.js';
36
31
  export { default as Pagination } from './Pagination.js';
32
+ export { default as Steps } from './Steps.js';
33
+ export { default as Step } from './Step.js';
34
+ export { default as Swiper } from './Swiper.js';
35
+ export { default as SwiperItem } from './SwiperItem.js';
36
+ export { default as BackTop } from './BackTop.js';
37
37
  export { default as Rate } from './Rate.js';
38
- export { default as Uploader } from './Uploader.js';
39
38
  export { default as Input } from './Input.js';
40
39
  export { default as TextArea } from './TextArea.js';
40
+ export { default as InputNumber } from './InputNumber.js';
41
+ export { default as ShortPassword } from './ShortPassword.js';
42
+ export { default as Radio } from './Radio.js';
43
+ export { default as RadioGroup } from './RadioGroup.js';
41
44
  export { default as Checkbox } from './Checkbox.js';
42
45
  export { default as CheckboxGroup } from './CheckboxGroup.js';
43
46
  export { default as Tag } from './Tag.js';
44
- export { default as Popover } from './Popover.js';
45
47
  export { default as Badge } from './Badge.js';
46
- export { default as AnimatingNumbers } from './AnimatingNumbers.js';
47
- export { default as Radio } from './Radio.js';
48
- export { default as RadioGroup } from './RadioGroup.js';
49
- export { default as ShortPassword } from './ShortPassword.js';
48
+ export { default as Uploader } from './Uploader.js';
50
49
  export { default as Calendar } from './Calendar.js';
51
50
  export { default as CalendarItem } from './CalendarItem.js';
52
- export { default as Picker } from './Picker.js';
53
- export { default as Signature } from './Signature.js';
54
- export { default as Barrage } from './Barrage.js';
55
51
  export { default as Address } from './Address.js';
52
+ export { default as Barrage } from './Barrage.js';
53
+ export { default as Signature } from './Signature.js';
54
+ export { default as Drag } from './Drag.js';
55
+ export { default as AnimatingNumbers } from './AnimatingNumbers.js';