@nutui/nutui-react 1.5.1 → 1.5.2-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 (350) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/nutui.react.mjs +27 -22
  3. package/dist/nutui.react.umd.js +27 -22
  4. package/package.json +1 -1
  5. package/dist/esm/ActionSheet/style/index.js +0 -2
  6. package/dist/esm/ActionSheet.js +0 -92
  7. package/dist/esm/Address/style/index.js +0 -4
  8. package/dist/esm/Address.js +0 -622
  9. package/dist/esm/Animate/style/index.js +0 -2
  10. package/dist/esm/Animate.js +0 -55
  11. package/dist/esm/AnimatingNumbers/style/index.js +0 -3
  12. package/dist/esm/AnimatingNumbers.js +0 -127
  13. package/dist/esm/Audio/style/index.js +0 -4
  14. package/dist/esm/Audio.js +0 -266
  15. package/dist/esm/Avatar/style/index.js +0 -2
  16. package/dist/esm/Avatar.js +0 -132
  17. package/dist/esm/AvatarContext-15733596.js +0 -3
  18. package/dist/esm/AvatarGroup/style/index.js +0 -2
  19. package/dist/esm/AvatarGroup.js +0 -43
  20. package/dist/esm/BackTop/style/index.js +0 -2
  21. package/dist/esm/BackTop.js +0 -139
  22. package/dist/esm/Badge/style/index.js +0 -2
  23. package/dist/esm/Badge.js +0 -73
  24. package/dist/esm/Barrage/style/index.js +0 -2
  25. package/dist/esm/Barrage.js +0 -99
  26. package/dist/esm/Button/style/index.js +0 -2
  27. package/dist/esm/Button.js +0 -109
  28. package/dist/esm/Calendar/style/index.js +0 -2
  29. package/dist/esm/Calendar.js +0 -129
  30. package/dist/esm/CalendarItem/style/index.js +0 -2
  31. package/dist/esm/CalendarItem.js +0 -676
  32. package/dist/esm/Card/style/index.js +0 -4
  33. package/dist/esm/Card.js +0 -63
  34. package/dist/esm/Cascader/style/index.js +0 -3
  35. package/dist/esm/Cascader.js +0 -673
  36. package/dist/esm/Cell/style/index.js +0 -2
  37. package/dist/esm/Cell.js +0 -103
  38. package/dist/esm/CellGroup/style/index.js +0 -2
  39. package/dist/esm/CellGroup.js +0 -5
  40. package/dist/esm/Checkbox/style/index.js +0 -3
  41. package/dist/esm/Checkbox.js +0 -8
  42. package/dist/esm/CheckboxGroup/style/index.js +0 -2
  43. package/dist/esm/CheckboxGroup.js +0 -113
  44. package/dist/esm/CircleProgress/style/index.js +0 -2
  45. package/dist/esm/CircleProgress.js +0 -116
  46. package/dist/esm/Col/style/index.js +0 -2
  47. package/dist/esm/Col.js +0 -58
  48. package/dist/esm/Collapse/style/index.js +0 -2
  49. package/dist/esm/Collapse.js +0 -99
  50. package/dist/esm/CollapseItem/style/index.js +0 -2
  51. package/dist/esm/CollapseItem.js +0 -148
  52. package/dist/esm/ConfigProvider/style/index.js +0 -2
  53. package/dist/esm/ConfigProvider.js +0 -187
  54. package/dist/esm/CountDown/style/index.js +0 -2
  55. package/dist/esm/CountDown.js +0 -247
  56. package/dist/esm/DatePicker/style/index.js +0 -2
  57. package/dist/esm/DatePicker.js +0 -310
  58. package/dist/esm/Dialog/style/index.js +0 -3
  59. package/dist/esm/Dialog.js +0 -296
  60. package/dist/esm/Divider/style/index.js +0 -2
  61. package/dist/esm/Divider.js +0 -36
  62. package/dist/esm/Drag/style/index.js +0 -2
  63. package/dist/esm/Drag.js +0 -120
  64. package/dist/esm/Elevator/style/index.js +0 -2
  65. package/dist/esm/Elevator.js +0 -236
  66. package/dist/esm/Ellipsis/style/index.js +0 -2
  67. package/dist/esm/Ellipsis.js +0 -177
  68. package/dist/esm/Empty/style/index.js +0 -2
  69. package/dist/esm/Empty.js +0 -82
  70. package/dist/esm/FixedNav/style/index.js +0 -3
  71. package/dist/esm/FixedNav.js +0 -105
  72. package/dist/esm/Form/style/index.js +0 -2
  73. package/dist/esm/Form.js +0 -221
  74. package/dist/esm/FormItem/style/index.js +0 -2
  75. package/dist/esm/FormItem.js +0 -5
  76. package/dist/esm/Grid/style/index.js +0 -2
  77. package/dist/esm/Grid.js +0 -83
  78. package/dist/esm/GridItem/style/index.js +0 -2
  79. package/dist/esm/GridItem.js +0 -125
  80. package/dist/esm/Icon/style/index.js +0 -4
  81. package/dist/esm/Icon.js +0 -5
  82. package/dist/esm/Image/style/index.js +0 -2
  83. package/dist/esm/Image.js +0 -170
  84. package/dist/esm/ImagePreview/style/index.js +0 -4
  85. package/dist/esm/ImagePreview.js +0 -226
  86. package/dist/esm/Indicator/style/index.js +0 -2
  87. package/dist/esm/Indicator.js +0 -52
  88. package/dist/esm/Infiniteloading/style/index.js +0 -2
  89. package/dist/esm/Infiniteloading.js +0 -217
  90. package/dist/esm/Input/style/index.js +0 -2
  91. package/dist/esm/Input.js +0 -363
  92. package/dist/esm/InputNumber/style/index.js +0 -2
  93. package/dist/esm/InputNumber.js +0 -277
  94. package/dist/esm/Layout/style/index.js +0 -2
  95. package/dist/esm/Layout.js +0 -14
  96. package/dist/esm/Menu/style/index.js +0 -3
  97. package/dist/esm/Menu.js +0 -154
  98. package/dist/esm/MenuItem/style/index.js +0 -3
  99. package/dist/esm/MenuItem.js +0 -177
  100. package/dist/esm/NavBar/style/index.js +0 -2
  101. package/dist/esm/NavBar.js +0 -116
  102. package/dist/esm/NoticeBar/style/index.js +0 -2
  103. package/dist/esm/NoticeBar.js +0 -570
  104. package/dist/esm/Notify/style/index.js +0 -2
  105. package/dist/esm/Notify.js +0 -236
  106. package/dist/esm/NumberKeyboard/style/index.js +0 -2
  107. package/dist/esm/NumberKeyboard.js +0 -249
  108. package/dist/esm/Overlay/style/index.js +0 -2
  109. package/dist/esm/Overlay.js +0 -6
  110. package/dist/esm/Pagination/style/index.js +0 -2
  111. package/dist/esm/Pagination.js +0 -170
  112. package/dist/esm/Picker/style/index.js +0 -2
  113. package/dist/esm/Picker.js +0 -496
  114. package/dist/esm/Popover/style/index.js +0 -3
  115. package/dist/esm/Popover.js +0 -225
  116. package/dist/esm/Popup/style/index.js +0 -3
  117. package/dist/esm/Popup.js +0 -195
  118. package/dist/esm/Price/style/index.js +0 -2
  119. package/dist/esm/Price.js +0 -86
  120. package/dist/esm/Progress/style/index.js +0 -2
  121. package/dist/esm/Progress.js +0 -124
  122. package/dist/esm/PullToRefresh/style/index.js +0 -2
  123. package/dist/esm/PullToRefresh.js +0 -277
  124. package/dist/esm/Radio/style/index.js +0 -3
  125. package/dist/esm/Radio.js +0 -6
  126. package/dist/esm/RadioGroup/style/index.js +0 -2
  127. package/dist/esm/RadioGroup.js +0 -123
  128. package/dist/esm/Range/style/index.js +0 -2
  129. package/dist/esm/Range.js +0 -407
  130. package/dist/esm/Rate/style/index.js +0 -2
  131. package/dist/esm/Rate.js +0 -123
  132. package/dist/esm/Row/style/index.js +0 -2
  133. package/dist/esm/Row.js +0 -50
  134. package/dist/esm/SearchBar/style/index.js +0 -2
  135. package/dist/esm/SearchBar.js +0 -237
  136. package/dist/esm/ShortPassword/style/index.js +0 -3
  137. package/dist/esm/ShortPassword.js +0 -193
  138. package/dist/esm/SideNavBar/style/index.js +0 -2
  139. package/dist/esm/SideNavBar.js +0 -58
  140. package/dist/esm/SideNavBarItem/style/index.js +0 -2
  141. package/dist/esm/SideNavBarItem.js +0 -25
  142. package/dist/esm/Signature/style/index.js +0 -2
  143. package/dist/esm/Signature.js +0 -155
  144. package/dist/esm/Skeleton/style/index.js +0 -2
  145. package/dist/esm/Skeleton.js +0 -100
  146. package/dist/esm/Step/style/index.js +0 -2
  147. package/dist/esm/Step.js +0 -89
  148. package/dist/esm/Steps/style/index.js +0 -2
  149. package/dist/esm/Steps.js +0 -40
  150. package/dist/esm/Sticky/style/index.js +0 -2
  151. package/dist/esm/Sticky.js +0 -192
  152. package/dist/esm/SubSideNavBar/style/index.js +0 -2
  153. package/dist/esm/SubSideNavBar.js +0 -79
  154. package/dist/esm/Swipe/style/index.js +0 -2
  155. package/dist/esm/Swipe.js +0 -232
  156. package/dist/esm/Swiper/style/index.js +0 -2
  157. package/dist/esm/Swiper.js +0 -492
  158. package/dist/esm/SwiperItem/style/index.js +0 -2
  159. package/dist/esm/SwiperItem.js +0 -38
  160. package/dist/esm/Switch/style/index.js +0 -2
  161. package/dist/esm/Switch.js +0 -73
  162. package/dist/esm/TabPane/style/index.js +0 -2
  163. package/dist/esm/TabPane.js +0 -6
  164. package/dist/esm/Tabbar/style/index.js +0 -2
  165. package/dist/esm/Tabbar.js +0 -70
  166. package/dist/esm/TabbarItem/style/index.js +0 -2
  167. package/dist/esm/TabbarItem.js +0 -80
  168. package/dist/esm/Table/style/index.js +0 -2
  169. package/dist/esm/Table.js +0 -142
  170. package/dist/esm/Tabs/style/index.js +0 -4
  171. package/dist/esm/Tabs.js +0 -9
  172. package/dist/esm/Tag/style/index.js +0 -2
  173. package/dist/esm/Tag.js +0 -111
  174. package/dist/esm/TextArea/style/index.js +0 -2
  175. package/dist/esm/TextArea.js +0 -150
  176. package/dist/esm/TimeDetail/style/index.js +0 -2
  177. package/dist/esm/TimeDetail.js +0 -69
  178. package/dist/esm/TimePannel/style/index.js +0 -2
  179. package/dist/esm/TimePannel.js +0 -31
  180. package/dist/esm/TimeSelect/style/index.js +0 -4
  181. package/dist/esm/TimeSelect.js +0 -173
  182. package/dist/esm/Toast/style/index.js +0 -2
  183. package/dist/esm/Toast.js +0 -271
  184. package/dist/esm/TrendArrow/style/index.js +0 -2
  185. package/dist/esm/TrendArrow.js +0 -101
  186. package/dist/esm/Uploader/style/index.js +0 -4
  187. package/dist/esm/Uploader.js +0 -566
  188. package/dist/esm/UserContext-101ad4a4.js +0 -3
  189. package/dist/esm/UserContext-2629d479.js +0 -3
  190. package/dist/esm/UserContext-b33bcf21.js +0 -3
  191. package/dist/esm/Video/style/index.js +0 -2
  192. package/dist/esm/Video.js +0 -92
  193. package/dist/esm/VirtualList/style/index.js +0 -2
  194. package/dist/esm/VirtualList.js +0 -315
  195. package/dist/esm/WaterMark/style/index.js +0 -2
  196. package/dist/esm/WaterMark.js +0 -113
  197. package/dist/esm/bem-3b438e61.js +0 -8
  198. package/dist/esm/cellgroup-fcc72767.js +0 -34
  199. package/dist/esm/checkbox-44e13cd0.js +0 -137
  200. package/dist/esm/date-c7aad4c0.js +0 -97
  201. package/dist/esm/formitem-8a73a5fb.js +0 -157
  202. package/dist/esm/get-scroll-parent-5f85dee8.js +0 -24
  203. package/dist/esm/grid.context-2ee27d95.js +0 -6
  204. package/dist/esm/icon-4ef1581c.js +0 -70
  205. package/dist/esm/index-030b7245.js +0 -11
  206. package/dist/esm/nutui-react.es.js +0 -94
  207. package/dist/esm/offsetContext-3ab00d40.js +0 -16
  208. package/dist/esm/overlay-de6c79d5.js +0 -83
  209. package/dist/esm/radio-9f141e6b.js +0 -118
  210. package/dist/esm/render-bbebb760.js +0 -79
  211. package/dist/esm/tabpane-01075e6c.js +0 -29
  212. package/dist/esm/tabs-e1b4e4b1.js +0 -181
  213. package/dist/esm/typings-f27b58f4.js +0 -8
  214. package/dist/esm/useClientRect-56bb675b.js +0 -39
  215. package/dist/esm/useTouch-cf73a407.js +0 -99
  216. package/dist/locales/base.d.ts +0 -129
  217. package/dist/locales/base.js +0 -5
  218. package/dist/locales/en-US.d.ts +0 -3
  219. package/dist/locales/en-US.js +0 -135
  220. package/dist/locales/id-ID.d.ts +0 -3
  221. package/dist/locales/id-ID.js +0 -135
  222. package/dist/locales/zh-CN.d.ts +0 -3
  223. package/dist/locales/zh-CN.js +0 -137
  224. package/dist/locales/zh-TW.d.ts +0 -3
  225. package/dist/locales/zh-TW.js +0 -135
  226. package/dist/locales/zh-UG.d.ts +0 -3
  227. package/dist/locales/zh-UG.js +0 -135
  228. package/dist/packages/actionsheet/actionsheet.scss +0 -103
  229. package/dist/packages/address/address.scss +0 -243
  230. package/dist/packages/animate/animate.scss +0 -284
  231. package/dist/packages/animatingnumbers/animatingnumbers.scss +0 -0
  232. package/dist/packages/animatingnumbers/countup.scss +0 -45
  233. package/dist/packages/audio/audio.scss +0 -93
  234. package/dist/packages/avatar/avatar.scss +0 -58
  235. package/dist/packages/avatargroup/avatargroup.scss +0 -14
  236. package/dist/packages/backtop/backtop.scss +0 -29
  237. package/dist/packages/badge/badge.scss +0 -53
  238. package/dist/packages/barrage/barrage.scss +0 -60
  239. package/dist/packages/button/button.scss +0 -245
  240. package/dist/packages/calendar/calendar.scss +0 -265
  241. package/dist/packages/calendaritem/calendaritem.scss +0 -0
  242. package/dist/packages/card/card.scss +0 -83
  243. package/dist/packages/cascader/cascader.scss +0 -108
  244. package/dist/packages/cell/cell.scss +0 -107
  245. package/dist/packages/cellgroup/cellgroup.scss +0 -46
  246. package/dist/packages/checkbox/checkbox.scss +0 -49
  247. package/dist/packages/checkboxgroup/checkboxgroup.scss +0 -33
  248. package/dist/packages/circleprogress/circleprogress.scss +0 -33
  249. package/dist/packages/col/col.scss +0 -24
  250. package/dist/packages/collapse/collapse.scss +0 -0
  251. package/dist/packages/collapseitem/collapseitem.scss +0 -161
  252. package/dist/packages/configprovider/configprovider.scss +0 -0
  253. package/dist/packages/countdown/countdown.scss +0 -3
  254. package/dist/packages/datepicker/datepicker.scss +0 -0
  255. package/dist/packages/dialog/dialog.scss +0 -135
  256. package/dist/packages/divider/divider.scss +0 -73
  257. package/dist/packages/drag/drag.scss +0 -10
  258. package/dist/packages/elevator/elevator.scss +0 -124
  259. package/dist/packages/ellipsis/ellipsis.scss +0 -17
  260. package/dist/packages/empty/empty.scss +0 -42
  261. package/dist/packages/fixednav/fixednav.scss +0 -141
  262. package/dist/packages/form/form.scss +0 -31
  263. package/dist/packages/formitem/formitem.scss +0 -100
  264. package/dist/packages/grid/grid.scss +0 -10
  265. package/dist/packages/griditem/griditem.scss +0 -108
  266. package/dist/packages/icon/icon.scss +0 -132
  267. package/dist/packages/image/image.scss +0 -53
  268. package/dist/packages/imagepreview/imagepreview.scss +0 -51
  269. package/dist/packages/indicator/indicator.scss +0 -70
  270. package/dist/packages/infiniteloading/infiniteloading.scss +0 -69
  271. package/dist/packages/input/input.scss +0 -203
  272. package/dist/packages/inputnumber/inputnumber.scss +0 -79
  273. package/dist/packages/layout/layout.scss +0 -2
  274. package/dist/packages/menu/menu.scss +0 -75
  275. package/dist/packages/menuitem/menuitem.scss +0 -120
  276. package/dist/packages/navbar/navbar.scss +0 -185
  277. package/dist/packages/noticebar/noticebar.scss +0 -156
  278. package/dist/packages/notify/notify.scss +0 -93
  279. package/dist/packages/numberkeyboard/numberkeyboard.scss +0 -147
  280. package/dist/packages/overlay/overlay.scss +0 -75
  281. package/dist/packages/pagination/pagination.scss +0 -81
  282. package/dist/packages/picker/picker.scss +0 -225
  283. package/dist/packages/popover/popover.scss +0 -288
  284. package/dist/packages/popup/popup.scss +0 -201
  285. package/dist/packages/price/price.scss +0 -37
  286. package/dist/packages/progress/progress.scss +0 -114
  287. package/dist/packages/pulltorefresh/pulltorefresh.scss +0 -26
  288. package/dist/packages/radio/radio.scss +0 -84
  289. package/dist/packages/radiogroup/radiogroup.scss +0 -86
  290. package/dist/packages/range/range.scss +0 -224
  291. package/dist/packages/rate/rate.scss +0 -36
  292. package/dist/packages/row/row.scss +0 -83
  293. package/dist/packages/searchbar/searchbar.scss +0 -146
  294. package/dist/packages/shortpassword/shortpassword.scss +0 -203
  295. package/dist/packages/sidenavbar/sidenavbar.scss +0 -100
  296. package/dist/packages/sidenavbaritem/sidenavbaritem.scss +0 -25
  297. package/dist/packages/signature/signature.scss +0 -39
  298. package/dist/packages/skeleton/skeleton.scss +0 -70
  299. package/dist/packages/step/step.scss +0 -274
  300. package/dist/packages/steps/steps.scss +0 -7
  301. package/dist/packages/sticky/sticky.scss +0 -3
  302. package/dist/packages/subsidenavbar/subsidenavbar.scss +0 -35
  303. package/dist/packages/swipe/swipe.scss +0 -33
  304. package/dist/packages/swiper/swiper.scss +0 -45
  305. package/dist/packages/swiperitem/swiperitem.scss +0 -3
  306. package/dist/packages/switch/switch.scss +0 -87
  307. package/dist/packages/tabbar/tabbar.scss +0 -46
  308. package/dist/packages/tabbaritem/tabbaritem.scss +0 -97
  309. package/dist/packages/table/table.scss +0 -152
  310. package/dist/packages/tabpane/tabpane.scss +0 -23
  311. package/dist/packages/tabs/tabs.scss +0 -284
  312. package/dist/packages/tag/tag.scss +0 -67
  313. package/dist/packages/textarea/textarea.scss +0 -60
  314. package/dist/packages/timedetail/timedetail.scss +0 -45
  315. package/dist/packages/timepannel/timepannel.scss +0 -17
  316. package/dist/packages/timeselect/timeselect.scss +0 -73
  317. package/dist/packages/toast/toast.scss +0 -98
  318. package/dist/packages/trendarrow/trendarrow.scss +0 -17
  319. package/dist/packages/uploader/uploader.scss +0 -237
  320. package/dist/packages/video/video.scss +0 -18
  321. package/dist/packages/virtuallist/virtuallist.scss +0 -87
  322. package/dist/packages/watermark/watermark.scss +0 -13
  323. package/dist/style.css +0 -1
  324. package/dist/style.mjs +0 -9
  325. package/dist/styles/animation/drop.scss +0 -24
  326. package/dist/styles/animation/ease.scss +0 -23
  327. package/dist/styles/animation/fade.scss +0 -20
  328. package/dist/styles/animation/icon.scss +0 -245
  329. package/dist/styles/animation/index.scss +0 -7
  330. package/dist/styles/animation/rotate.scss +0 -10
  331. package/dist/styles/animation/zoom.scss +0 -26
  332. package/dist/styles/font/config.json +0 -175
  333. package/dist/styles/font/demo.css +0 -539
  334. package/dist/styles/font/demo_index.html +0 -3063
  335. package/dist/styles/font/iconfont.css +0 -515
  336. package/dist/styles/font/iconfont.eot +0 -0
  337. package/dist/styles/font/iconfont.js +0 -68
  338. package/dist/styles/font/iconfont.json +0 -884
  339. package/dist/styles/font/iconfont.svg +0 -356
  340. package/dist/styles/font/iconfont.ttf +0 -0
  341. package/dist/styles/font/iconfont.woff +0 -0
  342. package/dist/styles/font/iconfont.woff2 +0 -0
  343. package/dist/styles/mixins/index.scss +0 -2
  344. package/dist/styles/mixins/make-animation.scss +0 -24
  345. package/dist/styles/mixins/text-ellipsis.scss +0 -20
  346. package/dist/styles/theme-dark.scss +0 -26
  347. package/dist/styles/theme-default.scss +0 -40
  348. package/dist/styles/themes/default.scss +0 -97
  349. package/dist/styles/variables.scss +0 -2610
  350. package/dist/types/index.d.ts +0 -2198
@@ -1,237 +0,0 @@
1
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
- 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; }
4
- 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; }
5
- import React__default, { useRef, useState, useEffect } from 'react';
6
- import { c as cn } from './bem-3b438e61.js';
7
- import { useConfig } from './ConfigProvider.js';
8
- import Icon from './Icon.js';
9
- import { C as ComponentDefaults } from './typings-f27b58f4.js';
10
- import '@bem-react/classname';
11
- var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
12
- placeholder: '',
13
- shape: 'square',
14
- disabled: false,
15
- maxLength: 9999,
16
- clearable: true,
17
- clearIconSize: '12px',
18
- align: 'left',
19
- readonly: true,
20
- autoFocus: false,
21
- label: '',
22
- leftinIcon: React__default.createElement(Icon, {
23
- name: "search",
24
- size: "12"
25
- })
26
- });
27
- var SearchBar = function SearchBar(props) {
28
- var searchbarBem = cn('searchbar');
29
- var _useConfig = useConfig(),
30
- locale = _useConfig.locale;
31
- var searchRef = useRef(null);
32
- var _useState = useState(function () {
33
- return props.value;
34
- }),
35
- _useState2 = _slicedToArray(_useState, 2),
36
- value = _useState2[0],
37
- setValue = _useState2[1];
38
- var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
39
- placeholder = _defaultProps$props.placeholder,
40
- shape = _defaultProps$props.shape,
41
- className = _defaultProps$props.className,
42
- disabled = _defaultProps$props.disabled,
43
- maxLength = _defaultProps$props.maxLength,
44
- clearable = _defaultProps$props.clearable,
45
- clearIconSize = _defaultProps$props.clearIconSize,
46
- align = _defaultProps$props.align,
47
- readOnly = _defaultProps$props.readOnly,
48
- autoFocus = _defaultProps$props.autoFocus,
49
- label = _defaultProps$props.label,
50
- actionText = _defaultProps$props.actionText,
51
- leftinIcon = _defaultProps$props.leftinIcon,
52
- rightinIcon = _defaultProps$props.rightinIcon,
53
- leftoutIcon = _defaultProps$props.leftoutIcon,
54
- rightoutIcon = _defaultProps$props.rightoutIcon,
55
- onChange = _defaultProps$props.onChange,
56
- onFocus = _defaultProps$props.onFocus,
57
- onBlur = _defaultProps$props.onBlur,
58
- onClear = _defaultProps$props.onClear,
59
- onCancel = _defaultProps$props.onCancel,
60
- onSearch = _defaultProps$props.onSearch,
61
- onClickInput = _defaultProps$props.onClickInput,
62
- onClickLeftinIcon = _defaultProps$props.onClickLeftinIcon,
63
- onClickLeftoutIcon = _defaultProps$props.onClickLeftoutIcon,
64
- onClickRightinIcon = _defaultProps$props.onClickRightinIcon,
65
- onClickRightoutIcon = _defaultProps$props.onClickRightoutIcon,
66
- iconClassPrefix = _defaultProps$props.iconClassPrefix,
67
- iconFontClassName = _defaultProps$props.iconFontClassName;
68
- var alignClass = "".concat(align);
69
- var forceFocus = function forceFocus() {
70
- var searchSelf = searchRef.current;
71
- searchSelf && searchSelf.focus();
72
- };
73
- var change = function change(event) {
74
- var value = event.target.value;
75
- onChange && (onChange === null || onChange === void 0 ? void 0 : onChange(value, event));
76
- setValue(value);
77
- };
78
- var focus = function focus(event) {
79
- var value = event.target.value;
80
- onFocus && (onFocus === null || onFocus === void 0 ? void 0 : onFocus(value, event));
81
- };
82
- var blur = function blur(event) {
83
- var searchSelf = searchRef.current;
84
- searchSelf && searchSelf.blur();
85
- var value = event.target.value;
86
- onBlur && (onBlur === null || onBlur === void 0 ? void 0 : onBlur(value, event));
87
- };
88
- useEffect(function () {
89
- setValue(props.value);
90
- }, [props.value]);
91
- useEffect(function () {
92
- autoFocus && forceFocus();
93
- }, [autoFocus]);
94
- var renderField = function renderField() {
95
- return React__default.createElement("input", {
96
- className: "".concat(searchbarBem('input'), " ").concat(searchbarBem(alignClass), " ").concat(shape === 'round' ? searchbarBem('round') : '', " ").concat(clearable ? searchbarBem('input-clear') : ''),
97
- ref: searchRef,
98
- style: _objectSpread({}, props.style),
99
- value: value || '',
100
- placeholder: placeholder || locale.placeholder,
101
- disabled: disabled,
102
- readOnly: readOnly,
103
- maxLength: maxLength,
104
- onKeyPress: onKeypress,
105
- onChange: function onChange(e) {
106
- return change(e);
107
- },
108
- onFocus: function onFocus(e) {
109
- return focus(e);
110
- },
111
- onBlur: function onBlur(e) {
112
- return blur(e);
113
- },
114
- onClick: function onClick(e) {
115
- return clickInput(e);
116
- }
117
- });
118
- };
119
- var clickInput = function clickInput(e) {
120
- onClickInput && onClickInput(e);
121
- };
122
- var renderLeftinIcon = function renderLeftinIcon() {
123
- if (!leftinIcon) return null;
124
- return React__default.createElement("div", {
125
- className: "".concat(searchbarBem('leftin-icon'), " ").concat(searchbarBem('icon')),
126
- onClick: function onClick(e) {
127
- return clickLeftIcon('in-left', e);
128
- }
129
- }, leftinIcon);
130
- };
131
- var renderLeftoutIcon = function renderLeftoutIcon() {
132
- if (!leftoutIcon) return null;
133
- return React__default.createElement("div", {
134
- className: "".concat(searchbarBem('leftout-icon')),
135
- onClick: function onClick(e) {
136
- return clickLeftIcon('out-left', e);
137
- }
138
- }, leftoutIcon);
139
- };
140
- var clickLeftIcon = function clickLeftIcon(flag, event) {
141
- if (flag === 'in-left') {
142
- onClickLeftinIcon && onClickLeftinIcon(value, event);
143
- } else {
144
- onClickLeftoutIcon && onClickLeftoutIcon(value, event);
145
- }
146
- };
147
- var renderRightinIcon = function renderRightinIcon() {
148
- if (!rightinIcon) return null;
149
- return React__default.createElement("div", {
150
- className: "".concat(searchbarBem('rightin-icon'), " ").concat(searchbarBem('icon')),
151
- onClick: function onClick(e) {
152
- return clickRightIcon('in-right', e);
153
- }
154
- }, rightinIcon);
155
- };
156
- var renderRightoutIcon = function renderRightoutIcon() {
157
- if (!rightoutIcon) return null;
158
- return React__default.createElement("div", {
159
- className: "".concat(searchbarBem('rightout-icon')),
160
- onClick: function onClick(e) {
161
- return clickRightIcon('out-right', e);
162
- }
163
- }, rightoutIcon);
164
- };
165
- var clickRightIcon = function clickRightIcon(flag, event) {
166
- if (flag === 'in-left') {
167
- onClickRightinIcon && onClickRightinIcon(value, event);
168
- } else {
169
- onClickRightoutIcon && onClickRightoutIcon(value, event);
170
- }
171
- };
172
- var handleClear = function handleClear() {
173
- return React__default.createElement("div", {
174
- className: "".concat(searchbarBem('clear'), " ").concat(rightinIcon ? 'pos-right' : ''),
175
- onClick: function onClick(e) {
176
- return clearaVal(e);
177
- }
178
- }, React__default.createElement(Icon, {
179
- classPrefix: iconClassPrefix,
180
- fontClassName: iconFontClassName,
181
- name: "circle-close",
182
- size: clearIconSize,
183
- color: "#555"
184
- }));
185
- };
186
- var clearaVal = function clearaVal(event) {
187
- if (disabled || readOnly) {
188
- return;
189
- }
190
- setValue('');
191
- onClear && onClear(event);
192
- forceFocus();
193
- };
194
- var renderRightLabel = function renderRightLabel() {
195
- if (actionText) {
196
- return React__default.createElement("div", {
197
- className: searchbarBem('action-text'),
198
- onClick: search
199
- }, actionText);
200
- }
201
- return null;
202
- };
203
- var onKeypress = function onKeypress(e) {
204
- if (e.key === 'Enter') {
205
- var event = e.nativeEvent;
206
- if (typeof event.cancelable !== 'boolean' || event.cancelable) {
207
- event.preventDefault();
208
- }
209
- onSearch && onSearch(value);
210
- }
211
- };
212
- var search = function search() {
213
- onSearch && onSearch(value);
214
- };
215
- var renderLabel = function renderLabel() {
216
- if (label) {
217
- return React__default.createElement("div", {
218
- className: searchbarBem('label')
219
- }, label);
220
- }
221
- return null;
222
- };
223
- return React__default.createElement("div", {
224
- className: "".concat(searchbarBem(), " ").concat(disabled ? searchbarBem('disabled') : '', " ").concat(className || ''),
225
- style: _objectSpread(_objectSpread({}, props.style), {}, {
226
- background: props.background
227
- })
228
- }, renderLeftoutIcon(), renderLabel(), React__default.createElement("div", {
229
- className: "".concat(searchbarBem('content')),
230
- style: {
231
- background: props.inputBackground
232
- }
233
- }, renderLeftinIcon(), renderField(), renderRightinIcon(), clearable && value && handleClear()), renderRightoutIcon(), renderRightLabel());
234
- };
235
- SearchBar.defaultProps = defaultProps;
236
- SearchBar.displayName = 'NutSearchBar';
237
- export { SearchBar as default };
@@ -1,3 +0,0 @@
1
- import '../../Icon/style'
2
- import '../../Popup/style'
3
- import '../../../packages/shortpassword/shortpassword.scss'
@@ -1,193 +0,0 @@
1
- import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
5
- var _excluded = ["title", "desc", "tips", "visible", "modelValue", "errorMsg", "noButton", "closeOnClickOverlay", "length", "style", "className", "onChange", "onOk", "onTips", "onCancel", "onClose", "onComplete", "iconClassPrefix", "iconFontClassName", "autoFocus"];
6
- 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; }
7
- 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; }
8
- import React__default, { useRef, useState, useEffect } from 'react';
9
- import { c as cn } from './bem-3b438e61.js';
10
- import Popup from './Popup.js';
11
- import Icon from './Icon.js';
12
- import { useConfig } from './ConfigProvider.js';
13
- import { C as ComponentDefaults } from './typings-f27b58f4.js';
14
- import '@bem-react/classname';
15
- var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
16
- title: '',
17
- desc: '',
18
- tips: '',
19
- visible: false,
20
- modelValue: '',
21
- errorMsg: '',
22
- noButton: true,
23
- closeOnClickOverlay: true,
24
- length: 6,
25
- className: '',
26
- autoFocus: false,
27
- onChange: function onChange(value) {},
28
- onOk: function onOk(value) {},
29
- onCancel: function onCancel() {},
30
- onClose: function onClose() {},
31
- onTips: function onTips() {},
32
- onComplete: function onComplete(value) {}
33
- });
34
- var ShortPassword = function ShortPassword(props) {
35
- var _useConfig = useConfig(),
36
- locale = _useConfig.locale;
37
- var title = props.title,
38
- desc = props.desc,
39
- tips = props.tips,
40
- visible = props.visible,
41
- modelValue = props.modelValue,
42
- errorMsg = props.errorMsg,
43
- noButton = props.noButton,
44
- closeOnClickOverlay = props.closeOnClickOverlay,
45
- length = props.length,
46
- style = props.style,
47
- className = props.className,
48
- onChange = props.onChange,
49
- onOk = props.onOk,
50
- onTips = props.onTips,
51
- onCancel = props.onCancel,
52
- onClose = props.onClose,
53
- onComplete = props.onComplete,
54
- iconClassPrefix = props.iconClassPrefix,
55
- iconFontClassName = props.iconFontClassName,
56
- autoFocus = props.autoFocus,
57
- reset = _objectWithoutProperties(props, _excluded);
58
- var b = cn('shortpassword');
59
- var textInput = useRef(null);
60
- var range = function range(val) {
61
- return Math.min(Math.max(4, val), 6);
62
- };
63
- var _useState = useState(visible),
64
- _useState2 = _slicedToArray(_useState, 2),
65
- innerVisible = _useState2[0],
66
- setInnerVisible = _useState2[1];
67
- var _useState3 = useState(range(Number(length))),
68
- _useState4 = _slicedToArray(_useState3, 2),
69
- comLen = _useState4[0],
70
- setComLen = _useState4[1];
71
- var _useState5 = useState(''),
72
- _useState6 = _slicedToArray(_useState5, 2),
73
- inputValue = _useState6[0],
74
- setInputValue = _useState6[1];
75
- useEffect(function () {
76
- setInnerVisible(visible);
77
- }, [visible]);
78
- useEffect(function () {
79
- if (typeof modelValue !== 'undefined') {
80
- setInputValue(modelValue);
81
- }
82
- }, [modelValue]);
83
- var changeValue = function changeValue(e) {
84
- var inputValue = e.target.value;
85
- if (String(inputValue).length > comLen) {
86
- inputValue = inputValue.slice(0, comLen);
87
- }
88
- setInputValue(inputValue);
89
- if (String(inputValue).length === comLen) {
90
- onComplete && onComplete(inputValue);
91
- }
92
- onChange && onChange(inputValue);
93
- };
94
- var systemStyle = function systemStyle() {
95
- var u = navigator.userAgent;
96
- var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; // g
97
- var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); // ios终端
98
- var style = {};
99
- if (isIOS) {
100
- style = {
101
- paddingRight: '1200px'
102
- };
103
- }
104
- if (isAndroid) {
105
- style = {
106
- opacity: 0,
107
- zIndex: 10
108
- };
109
- }
110
- return style;
111
- };
112
- var focus = function focus() {
113
- if (textInput.current) {
114
- textInput.current.focus();
115
- }
116
- };
117
- var sure = function sure() {
118
- onOk && onOk(inputValue);
119
- };
120
- return React__default.createElement("div", null, React__default.createElement(Popup, {
121
- style: {
122
- padding: '32px 24px 28px 24px',
123
- borderRadius: '12px',
124
- textAlign: 'center'
125
- },
126
- visible: innerVisible,
127
- closeable: true,
128
- "close-on-click-overlay": closeOnClickOverlay,
129
- onClickOverlay: onClose,
130
- onClickCloseIcon: onClose
131
- }, React__default.createElement("div", _objectSpread({
132
- className: "".concat(b(), " ").concat(className),
133
- style: _objectSpread({}, style)
134
- }, reset), React__default.createElement("div", {
135
- className: b('title')
136
- }, title || locale.shortpassword.title), React__default.createElement("div", {
137
- className: b('subtitle')
138
- }, desc || locale.shortpassword.desc), React__default.createElement("div", {
139
- className: b('input')
140
- }, React__default.createElement("input", {
141
- ref: textInput,
142
- className: b('input-real'),
143
- type: "number",
144
- style: systemStyle(),
145
- maxLength: 6,
146
- value: inputValue,
147
- autoFocus: autoFocus,
148
- onChange: function onChange(e) {
149
- return changeValue(e);
150
- }
151
- }), React__default.createElement("div", {
152
- className: b('input-site')
153
- }), React__default.createElement("div", {
154
- className: b('input-fake'),
155
- onClick: function onClick() {
156
- return focus();
157
- }
158
- }, _toConsumableArray(new Array(comLen).keys()).map(function (item, index) {
159
- return React__default.createElement("div", {
160
- className: b('input-fake__li'),
161
- key: index
162
- }, String(inputValue).length > index ? React__default.createElement("div", {
163
- className: b('input-fake__li__icon')
164
- }) : null);
165
- }))), React__default.createElement("div", {
166
- className: b('message')
167
- }, React__default.createElement("div", {
168
- className: b('message__error')
169
- }, errorMsg), tips || locale.shortpassword.tips ? React__default.createElement("div", {
170
- className: b('message__forget')
171
- }, React__default.createElement(Icon, {
172
- classPrefix: iconClassPrefix,
173
- fontClassName: iconFontClassName,
174
- className: "icon",
175
- size: "11px",
176
- name: "tips"
177
- }), React__default.createElement("div", {
178
- onClick: onTips
179
- }, tips || locale.shortpassword.tips)) : null), !noButton ? React__default.createElement("div", {
180
- className: b('footer')
181
- }, React__default.createElement("div", {
182
- className: b('footer__cancel'),
183
- onClick: onCancel
184
- }, locale.cancel), React__default.createElement("div", {
185
- className: b('footer__sure'),
186
- onClick: function onClick() {
187
- return sure();
188
- }
189
- }, locale.confirm)) : null)));
190
- };
191
- ShortPassword.defaultProps = defaultProps;
192
- ShortPassword.displayName = 'NutShortPassword';
193
- export { ShortPassword as default };
@@ -1,2 +0,0 @@
1
- import '../../Popup/style'
2
- import '../../../packages/sidenavbar/sidenavbar.scss'
@@ -1,58 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["title", "visible", "width", "position", "children", "className", "showhead", "onClose"];
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 { useConfig } from './ConfigProvider.js';
8
- import Popup from './Popup.js';
9
- import { h as handleClick, O as OffsetContext } from './offsetContext-3ab00d40.js';
10
- var defaultProps = {
11
- showhead: false,
12
- position: 'left',
13
- width: '80%'
14
- };
15
- var SideNavBar = function SideNavBar(props) {
16
- useConfig();
17
- var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
18
- title = _defaultProps$props.title,
19
- visible = _defaultProps$props.visible,
20
- width = _defaultProps$props.width,
21
- position = _defaultProps$props.position,
22
- children = _defaultProps$props.children,
23
- className = _defaultProps$props.className,
24
- showhead = _defaultProps$props.showhead,
25
- onClose = _defaultProps$props.onClose,
26
- rest = _objectWithoutProperties(_defaultProps$props, _excluded);
27
- var offset = props.offset ? Number(props.offset) : 20;
28
- return React__default.createElement(Popup, {
29
- visible: visible,
30
- style: {
31
- width: width,
32
- height: '100%'
33
- },
34
- position: position,
35
- onClose: onClose
36
- }, React__default.createElement("div", _objectSpread({
37
- className: className ? "".concat(className, " nut-sidenavbar") : 'nut-sidenavbar'
38
- }, rest), React__default.createElement("div", {
39
- className: "nut-sidenavbar__content"
40
- }, React__default.createElement("div", {
41
- className: "nut-sidenavbar__list nutShow",
42
- onClick: handleClick
43
- }, React__default.createElement("div", {
44
- className: "nut-sidenavbar__title border-bt ",
45
- style: {
46
- paddingLeft: "".concat(offset, "px")
47
- }
48
- }, title, " ", React__default.createElement("i", {
49
- className: "arrow-icon arrow-down"
50
- })), React__default.createElement(OffsetContext.Provider, {
51
- value: offset
52
- }, React__default.createElement("div", {
53
- className: "nut-sidenavbar__content"
54
- }, children))))));
55
- };
56
- SideNavBar.defaultProps = defaultProps;
57
- SideNavBar.displayName = 'NutSideNavBar';
58
- export { SideNavBar as default };
@@ -1,2 +0,0 @@
1
-
2
- import '../../../packages/sidenavbaritem/sidenavbaritem.scss'
@@ -1,25 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["title", "ikey", "children", "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
- var SideNavBarItem = function SideNavBarItem(props) {
8
- var title = props.title,
9
- ikey = props.ikey,
10
- children = props.children,
11
- onClick = props.onClick,
12
- rest = _objectWithoutProperties(props, _excluded);
13
- var clickFn = function clickFn(e) {
14
- e.stopPropagation();
15
- onClick && onClick({
16
- title: title,
17
- ikey: ikey
18
- });
19
- };
20
- return React__default.createElement("div", _objectSpread({
21
- className: "nut-subsidenavbar__item border-bt",
22
- onClick: clickFn
23
- }, rest), title);
24
- };
25
- export { SideNavBarItem as default };
@@ -1,2 +0,0 @@
1
- import '../../Button/style'
2
- import '../../../packages/signature/signature.scss'