@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,237 @@
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 };
@@ -0,0 +1,3 @@
1
+ import '../../Icon/style'
2
+ import '../../Popup/style'
3
+ import '../../../packages/shortpassword/shortpassword.scss'
@@ -0,0 +1,193 @@
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 };
@@ -0,0 +1,2 @@
1
+ import '../../Popup/style'
2
+ import '../../../packages/sidenavbar/sidenavbar.scss'
@@ -0,0 +1,58 @@
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 };
@@ -0,0 +1,2 @@
1
+
2
+ import '../../../packages/sidenavbaritem/sidenavbaritem.scss'
@@ -0,0 +1,25 @@
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 };
@@ -0,0 +1,2 @@
1
+ import '../../Button/style'
2
+ import '../../../packages/signature/signature.scss'