@ebscn/ui 0.0.10 → 1.0.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 (438) hide show
  1. package/README.md +44 -0
  2. package/cjs/components/alphabet-keyboard/alphabet-keyboard.css +143 -0
  3. package/cjs/components/alphabet-keyboard/alphabet-keyboard.d.ts +11 -0
  4. package/cjs/components/alphabet-keyboard/alphabet-keyboard.js +139 -0
  5. package/cjs/components/alphabet-keyboard/index.d.ts +4 -0
  6. package/cjs/components/alphabet-keyboard/index.js +9 -0
  7. package/cjs/components/button/button.css +152 -0
  8. package/cjs/components/button/button.d.ts +40 -0
  9. package/cjs/components/button/button.js +215 -0
  10. package/cjs/components/button/index.d.ts +4 -0
  11. package/cjs/components/button/index.js +9 -0
  12. package/cjs/components/card/card.css +37 -0
  13. package/cjs/components/card/card.d.ts +17 -0
  14. package/cjs/components/card/card.js +40 -0
  15. package/cjs/components/card/index.d.ts +4 -0
  16. package/cjs/components/card/index.js +10 -0
  17. package/cjs/components/checkbox/checkbox.css +92 -0
  18. package/cjs/components/checkbox/checkbox.d.ts +44 -0
  19. package/cjs/components/checkbox/checkbox.js +106 -0
  20. package/cjs/components/checkbox/group-context.d.ts +8 -0
  21. package/cjs/components/checkbox/group-context.js +8 -0
  22. package/cjs/components/checkbox/group.d.ts +10 -0
  23. package/cjs/components/checkbox/group.js +48 -0
  24. package/cjs/components/checkbox/index.d.ts +26 -0
  25. package/cjs/components/checkbox/index.js +14 -0
  26. package/cjs/components/checkbox/native-input.d.ts +10 -0
  27. package/cjs/components/checkbox/native-input.js +38 -0
  28. package/cjs/components/grid/grid.css +15 -0
  29. package/cjs/components/grid/grid.d.ts +15 -0
  30. package/cjs/components/grid/grid.js +45 -0
  31. package/cjs/components/grid/index.d.ts +7 -0
  32. package/cjs/components/grid/index.js +12 -0
  33. package/cjs/components/icons/check-icon.d.ts +4 -0
  34. package/cjs/components/icons/check-icon.js +30 -0
  35. package/cjs/components/icons/check-only-icon.d.ts +4 -0
  36. package/cjs/components/icons/check-only-icon.js +21 -0
  37. package/cjs/components/icons/clear-icon.d.ts +4 -0
  38. package/cjs/components/icons/clear-icon.js +41 -0
  39. package/cjs/components/icons/indeterminate-icon.d.ts +4 -0
  40. package/cjs/components/icons/indeterminate-icon.js +29 -0
  41. package/cjs/components/icons/index.d.ts +8 -0
  42. package/cjs/components/icons/index.js +62 -0
  43. package/cjs/components/icons/loading-icon.d.ts +4 -0
  44. package/cjs/components/icons/loading-icon.js +89 -0
  45. package/cjs/components/icons/search-icon.d.ts +4 -0
  46. package/cjs/components/icons/search-icon.js +43 -0
  47. package/cjs/components/icons/spin-icon.d.ts +4 -0
  48. package/cjs/components/icons/spin-icon.js +32 -0
  49. package/cjs/components/icons/uncheck-icon.d.ts +4 -0
  50. package/cjs/components/icons/uncheck-icon.js +26 -0
  51. package/cjs/components/imageViewer/imageViewer.d.ts +4 -0
  52. package/cjs/components/imageViewer/imageViewer.js +35 -0
  53. package/cjs/components/imageViewer/index.js +9 -0
  54. package/cjs/components/marketTag/index.d.ts +4 -0
  55. package/cjs/components/marketTag/index.js +9 -0
  56. package/cjs/components/marketTag/marketTag.css +14 -0
  57. package/cjs/components/marketTag/marketTag.d.ts +11 -0
  58. package/cjs/components/marketTag/marketTag.js +27 -0
  59. package/cjs/components/number-keyboard/index.d.ts +4 -0
  60. package/cjs/components/number-keyboard/index.js +9 -0
  61. package/cjs/components/number-keyboard/number-keyboard.css +77 -0
  62. package/cjs/components/number-keyboard/number-keyboard.d.ts +13 -0
  63. package/cjs/components/number-keyboard/number-keyboard.js +93 -0
  64. package/cjs/components/pdfLink/index.d.ts +3 -0
  65. package/cjs/components/pdfLink/index.js +10 -0
  66. package/cjs/components/pdfLink/pdfLink.css +11 -0
  67. package/cjs/components/pdfLink/pdfLink.d.ts +8 -0
  68. package/cjs/components/pdfLink/pdfLink.js +102 -0
  69. package/cjs/components/protocol/index.d.ts +3 -0
  70. package/cjs/components/protocol/index.js +10 -0
  71. package/cjs/components/protocol/protocol.css +46 -0
  72. package/cjs/components/protocol/protocol.d.ts +15 -0
  73. package/cjs/components/protocol/protocol.js +120 -0
  74. package/cjs/components/radio/group-context.d.ts +8 -0
  75. package/cjs/components/radio/group-context.js +8 -0
  76. package/cjs/components/radio/group.d.ts +10 -0
  77. package/cjs/components/radio/group.js +43 -0
  78. package/cjs/components/radio/index.d.ts +8 -0
  79. package/cjs/components/radio/index.js +13 -0
  80. package/cjs/components/radio/radio.css +92 -0
  81. package/cjs/components/radio/radio.d.ts +19 -0
  82. package/cjs/components/radio/radio.js +92 -0
  83. package/cjs/components/search/index.d.ts +3 -0
  84. package/cjs/components/search/index.js +10 -0
  85. package/cjs/components/search/search.css +53 -0
  86. package/cjs/components/search/search.d.ts +15 -0
  87. package/cjs/components/search/search.js +110 -0
  88. package/cjs/components/stock-count-keyboard/index.d.ts +4 -0
  89. package/cjs/components/stock-count-keyboard/index.js +9 -0
  90. package/cjs/components/stock-count-keyboard/stock-count-keyboard.css +74 -0
  91. package/cjs/components/stock-count-keyboard/stock-count-keyboard.d.ts +9 -0
  92. package/cjs/components/stock-count-keyboard/stock-count-keyboard.js +82 -0
  93. package/cjs/components/stock-keyboard/index.d.ts +4 -0
  94. package/cjs/components/stock-keyboard/index.js +9 -0
  95. package/cjs/components/stock-keyboard/stock-keyboard.css +111 -0
  96. package/cjs/components/stock-keyboard/stock-keyboard.d.ts +12 -0
  97. package/cjs/components/stock-keyboard/stock-keyboard.js +107 -0
  98. package/cjs/components/switch/index.d.ts +4 -0
  99. package/cjs/components/switch/index.js +10 -0
  100. package/cjs/components/switch/switch.css +104 -0
  101. package/cjs/components/switch/switch.d.ts +16 -0
  102. package/cjs/components/switch/switch.js +213 -0
  103. package/cjs/components/toastLoading/index.d.ts +4 -0
  104. package/cjs/components/toastLoading/index.js +9 -0
  105. package/cjs/components/toastLoading/toastLoading.css +27 -0
  106. package/cjs/components/toastLoading/toastLoading.d.ts +7 -0
  107. package/cjs/components/toastLoading/toastLoading.js +35 -0
  108. package/cjs/global/global.css +289 -0
  109. package/cjs/global/index.d.ts +1 -0
  110. package/cjs/global/index.js +11 -0
  111. package/cjs/global/theme-dark.css +18 -0
  112. package/cjs/global/theme-default.css +48 -0
  113. package/cjs/index.d.ts +18 -0
  114. package/cjs/index.js +149 -0
  115. package/cjs/utils/attach-properties-to-component.d.ts +1 -0
  116. package/cjs/utils/attach-properties-to-component.js +15 -0
  117. package/cjs/utils/bound.d.ts +1 -0
  118. package/cjs/utils/bound.js +16 -0
  119. package/cjs/utils/can-use-dom.d.ts +1 -0
  120. package/cjs/utils/can-use-dom.js +7 -0
  121. package/cjs/utils/convert-px.d.ts +1 -0
  122. package/cjs/utils/convert-px.js +33 -0
  123. package/cjs/utils/create-icon-component.d.ts +2 -0
  124. package/cjs/utils/create-icon-component.js +12 -0
  125. package/cjs/utils/dev-log.d.ts +3 -0
  126. package/cjs/utils/dev-log.js +45 -0
  127. package/cjs/utils/generate-int-array.d.ts +1 -0
  128. package/cjs/utils/generate-int-array.js +13 -0
  129. package/cjs/utils/get-container.d.ts +2 -0
  130. package/cjs/utils/get-container.js +10 -0
  131. package/cjs/utils/get-scroll-parent.d.ts +3 -0
  132. package/cjs/utils/get-scroll-parent.js +30 -0
  133. package/cjs/utils/is-dev.d.ts +1 -0
  134. package/cjs/utils/is-dev.js +7 -0
  135. package/cjs/utils/is-node-with-content.d.ts +4 -0
  136. package/cjs/utils/is-node-with-content.js +9 -0
  137. package/cjs/utils/matrix.d.ts +10 -0
  138. package/cjs/utils/matrix.js +47 -0
  139. package/cjs/utils/measure-css-length.d.ts +1 -0
  140. package/cjs/utils/measure-css-length.js +29 -0
  141. package/cjs/utils/merge-locale.d.ts +1 -0
  142. package/cjs/utils/merge-locale.js +21 -0
  143. package/cjs/utils/native-props.d.ts +8 -0
  144. package/cjs/utils/native-props.js +38 -0
  145. package/cjs/utils/nearest.d.ts +1 -0
  146. package/cjs/utils/nearest.js +11 -0
  147. package/cjs/utils/noop.d.ts +1 -0
  148. package/cjs/utils/noop.js +8 -0
  149. package/cjs/utils/reduce-and-restore-motion.d.ts +4 -0
  150. package/cjs/utils/reduce-and-restore-motion.js +44 -0
  151. package/cjs/utils/render-imperatively.d.ts +13 -0
  152. package/cjs/utils/render-imperatively.js +207 -0
  153. package/cjs/utils/render-to-body.d.ts +2 -0
  154. package/cjs/utils/render-to-body.js +19 -0
  155. package/cjs/utils/render-to-container.d.ts +3 -0
  156. package/cjs/utils/render-to-container.js +16 -0
  157. package/cjs/utils/render.d.ts +9 -0
  158. package/cjs/utils/render.js +196 -0
  159. package/cjs/utils/replace-message.d.ts +1 -0
  160. package/cjs/utils/replace-message.js +13 -0
  161. package/cjs/utils/rubberband.d.ts +2 -0
  162. package/cjs/utils/rubberband.js +20 -0
  163. package/cjs/utils/should-render.d.ts +10 -0
  164. package/cjs/utils/should-render.js +20 -0
  165. package/cjs/utils/shuffle.d.ts +6 -0
  166. package/cjs/utils/shuffle.js +29 -0
  167. package/cjs/utils/sleep.d.ts +1 -0
  168. package/cjs/utils/sleep.js +12 -0
  169. package/cjs/utils/supports-passive.d.ts +1 -0
  170. package/cjs/utils/supports-passive.js +19 -0
  171. package/cjs/utils/to-css-length.d.ts +1 -0
  172. package/cjs/utils/to-css-length.js +9 -0
  173. package/cjs/utils/traverse-react-node.d.ts +2 -0
  174. package/cjs/utils/traverse-react-node.js +23 -0
  175. package/cjs/utils/tree.d.ts +1 -0
  176. package/cjs/utils/tree.js +24 -0
  177. package/cjs/utils/undefined-fallback.d.ts +3 -0
  178. package/cjs/utils/undefined-fallback.js +17 -0
  179. package/cjs/utils/use-drag-and-pinch.d.ts +1 -0
  180. package/cjs/utils/use-drag-and-pinch.js +8 -0
  181. package/cjs/utils/use-initialized.d.ts +1 -0
  182. package/cjs/utils/use-initialized.js +14 -0
  183. package/cjs/utils/use-inner-visible.d.ts +1 -0
  184. package/cjs/utils/use-inner-visible.js +17 -0
  185. package/cjs/utils/use-isomorphic-update-layout-effect.d.ts +2 -0
  186. package/cjs/utils/use-isomorphic-update-layout-effect.js +8 -0
  187. package/cjs/utils/use-lock-scroll.d.ts +2 -0
  188. package/cjs/utils/use-lock-scroll.js +84 -0
  189. package/cjs/utils/use-mutation-effect.d.ts +2 -0
  190. package/cjs/utils/use-mutation-effect.js +21 -0
  191. package/cjs/utils/use-props-value.d.ts +8 -0
  192. package/cjs/utils/use-props-value.js +30 -0
  193. package/cjs/utils/use-ref-state.d.ts +2 -0
  194. package/cjs/utils/use-ref-state.js +17 -0
  195. package/cjs/utils/use-resize-effect.d.ts +2 -0
  196. package/cjs/utils/use-resize-effect.js +29 -0
  197. package/cjs/utils/use-tab-list-scroll.d.ts +5 -0
  198. package/cjs/utils/use-tab-list-scroll.js +67 -0
  199. package/cjs/utils/use-touch.d.ts +17 -0
  200. package/cjs/utils/use-touch.js +69 -0
  201. package/cjs/utils/validate.d.ts +8 -0
  202. package/cjs/utils/validate.js +39 -0
  203. package/cjs/utils/with-cache.d.ts +1 -0
  204. package/cjs/utils/with-cache.js +15 -0
  205. package/cjs/utils/with-default-props.d.ts +2 -0
  206. package/cjs/utils/with-default-props.js +32 -0
  207. package/cjs/utils/with-func-props.d.ts +5 -0
  208. package/cjs/utils/with-func-props.js +38 -0
  209. package/cjs/utils/with-stop-propagation.d.ts +4 -0
  210. package/cjs/utils/with-stop-propagation.js +37 -0
  211. package/es/components/alphabet-keyboard/alphabet-keyboard.css +143 -0
  212. package/es/components/alphabet-keyboard/alphabet-keyboard.d.ts +11 -0
  213. package/es/components/alphabet-keyboard/alphabet-keyboard.js +132 -0
  214. package/es/components/alphabet-keyboard/index.d.ts +4 -0
  215. package/es/components/alphabet-keyboard/index.js +3 -0
  216. package/es/components/button/button.css +152 -0
  217. package/es/components/button/button.d.ts +40 -0
  218. package/es/components/button/button.js +206 -0
  219. package/es/components/button/index.d.ts +4 -0
  220. package/es/components/button/index.js +3 -0
  221. package/es/components/card/card.css +37 -0
  222. package/es/components/card/card.d.ts +17 -0
  223. package/es/components/card/card.js +33 -0
  224. package/es/components/card/index.d.ts +4 -0
  225. package/es/components/card/index.js +3 -0
  226. package/es/components/checkbox/checkbox.css +92 -0
  227. package/es/components/checkbox/checkbox.d.ts +44 -0
  228. package/es/components/checkbox/checkbox.js +97 -0
  229. package/es/components/checkbox/group-context.d.ts +8 -0
  230. package/es/components/checkbox/group-context.js +2 -0
  231. package/es/components/checkbox/group.d.ts +10 -0
  232. package/es/components/checkbox/group.js +40 -0
  233. package/es/components/checkbox/index.d.ts +26 -0
  234. package/es/components/checkbox/index.js +7 -0
  235. package/es/components/checkbox/native-input.d.ts +10 -0
  236. package/es/components/checkbox/native-input.js +29 -0
  237. package/es/components/grid/grid.css +15 -0
  238. package/es/components/grid/grid.d.ts +15 -0
  239. package/es/components/grid/grid.js +36 -0
  240. package/es/components/grid/index.d.ts +7 -0
  241. package/es/components/grid/index.js +6 -0
  242. package/es/components/icons/check-icon.d.ts +4 -0
  243. package/es/components/icons/check-icon.js +22 -0
  244. package/es/components/icons/check-only-icon.d.ts +4 -0
  245. package/es/components/icons/check-only-icon.js +13 -0
  246. package/es/components/icons/clear-icon.d.ts +4 -0
  247. package/es/components/icons/clear-icon.js +33 -0
  248. package/es/components/icons/indeterminate-icon.d.ts +4 -0
  249. package/es/components/icons/indeterminate-icon.js +21 -0
  250. package/es/components/icons/index.d.ts +8 -0
  251. package/es/components/icons/index.js +8 -0
  252. package/es/components/icons/loading-icon.d.ts +4 -0
  253. package/es/components/icons/loading-icon.js +81 -0
  254. package/es/components/icons/search-icon.d.ts +4 -0
  255. package/es/components/icons/search-icon.js +35 -0
  256. package/es/components/icons/spin-icon.d.ts +4 -0
  257. package/es/components/icons/spin-icon.js +24 -0
  258. package/es/components/icons/uncheck-icon.d.ts +4 -0
  259. package/es/components/icons/uncheck-icon.js +18 -0
  260. package/es/components/imageViewer/imageViewer.d.ts +4 -0
  261. package/es/components/imageViewer/imageViewer.js +28 -0
  262. package/es/components/imageViewer/index.d.ts +7 -0
  263. package/es/components/imageViewer/index.js +2 -0
  264. package/es/components/marketTag/index.d.ts +4 -0
  265. package/es/components/marketTag/index.js +3 -0
  266. package/es/components/marketTag/marketTag.css +14 -0
  267. package/es/components/marketTag/marketTag.d.ts +11 -0
  268. package/es/components/marketTag/marketTag.js +19 -0
  269. package/es/components/number-keyboard/index.d.ts +4 -0
  270. package/es/components/number-keyboard/index.js +3 -0
  271. package/es/components/number-keyboard/number-keyboard.css +77 -0
  272. package/es/components/number-keyboard/number-keyboard.d.ts +13 -0
  273. package/es/components/number-keyboard/number-keyboard.js +85 -0
  274. package/es/components/pdfLink/index.d.ts +3 -0
  275. package/es/components/pdfLink/index.js +3 -0
  276. package/es/components/pdfLink/pdfLink.css +11 -0
  277. package/es/components/pdfLink/pdfLink.d.ts +8 -0
  278. package/es/components/pdfLink/pdfLink.js +94 -0
  279. package/es/components/protocol/index.d.ts +3 -0
  280. package/es/components/protocol/index.js +3 -0
  281. package/es/components/protocol/protocol.css +46 -0
  282. package/es/components/protocol/protocol.d.ts +15 -0
  283. package/es/components/protocol/protocol.js +112 -0
  284. package/es/components/radio/group-context.d.ts +8 -0
  285. package/es/components/radio/group-context.js +2 -0
  286. package/es/components/radio/group.d.ts +10 -0
  287. package/es/components/radio/group.js +35 -0
  288. package/es/components/radio/index.d.ts +8 -0
  289. package/es/components/radio/index.js +7 -0
  290. package/es/components/radio/radio.css +92 -0
  291. package/es/components/radio/radio.d.ts +19 -0
  292. package/es/components/radio/radio.js +82 -0
  293. package/es/components/search/index.d.ts +3 -0
  294. package/es/components/search/index.js +3 -0
  295. package/es/components/search/search.css +53 -0
  296. package/es/components/search/search.d.ts +15 -0
  297. package/es/components/search/search.js +102 -0
  298. package/es/components/stock-count-keyboard/index.d.ts +4 -0
  299. package/es/components/stock-count-keyboard/index.js +3 -0
  300. package/es/components/stock-count-keyboard/stock-count-keyboard.css +74 -0
  301. package/es/components/stock-count-keyboard/stock-count-keyboard.d.ts +9 -0
  302. package/es/components/stock-count-keyboard/stock-count-keyboard.js +74 -0
  303. package/es/components/stock-keyboard/index.d.ts +4 -0
  304. package/es/components/stock-keyboard/index.js +3 -0
  305. package/es/components/stock-keyboard/stock-keyboard.css +111 -0
  306. package/es/components/stock-keyboard/stock-keyboard.d.ts +12 -0
  307. package/es/components/stock-keyboard/stock-keyboard.js +99 -0
  308. package/es/components/switch/index.d.ts +4 -0
  309. package/es/components/switch/index.js +3 -0
  310. package/es/components/switch/switch.css +104 -0
  311. package/es/components/switch/switch.d.ts +16 -0
  312. package/es/components/switch/switch.js +204 -0
  313. package/es/components/toastLoading/index.d.ts +4 -0
  314. package/es/components/toastLoading/index.js +3 -0
  315. package/es/components/toastLoading/toastLoading.css +27 -0
  316. package/es/components/toastLoading/toastLoading.d.ts +7 -0
  317. package/es/components/toastLoading/toastLoading.js +27 -0
  318. package/es/global/global.css +289 -0
  319. package/es/global/index.d.ts +1 -0
  320. package/es/global/index.js +9 -0
  321. package/es/global/theme-dark.css +18 -0
  322. package/es/global/theme-default.css +48 -0
  323. package/es/index.d.ts +18 -0
  324. package/es/index.js +18 -0
  325. package/es/utils/attach-properties-to-component.d.ts +1 -0
  326. package/es/utils/attach-properties-to-component.js +9 -0
  327. package/es/utils/bound.d.ts +1 -0
  328. package/es/utils/bound.js +10 -0
  329. package/es/utils/can-use-dom.d.ts +1 -0
  330. package/es/utils/can-use-dom.js +1 -0
  331. package/es/utils/convert-px.d.ts +1 -0
  332. package/es/utils/convert-px.js +27 -0
  333. package/es/utils/create-icon-component.d.ts +2 -0
  334. package/es/utils/create-icon-component.js +6 -0
  335. package/es/utils/dev-log.d.ts +3 -0
  336. package/es/utils/dev-log.js +37 -0
  337. package/es/utils/generate-int-array.d.ts +1 -0
  338. package/es/utils/generate-int-array.js +7 -0
  339. package/es/utils/get-container.d.ts +2 -0
  340. package/es/utils/get-container.js +4 -0
  341. package/es/utils/get-scroll-parent.d.ts +3 -0
  342. package/es/utils/get-scroll-parent.js +24 -0
  343. package/es/utils/is-dev.d.ts +1 -0
  344. package/es/utils/is-dev.js +1 -0
  345. package/es/utils/is-node-with-content.d.ts +4 -0
  346. package/es/utils/is-node-with-content.js +3 -0
  347. package/es/utils/matrix.d.ts +10 -0
  348. package/es/utils/matrix.js +32 -0
  349. package/es/utils/measure-css-length.d.ts +1 -0
  350. package/es/utils/measure-css-length.js +23 -0
  351. package/es/utils/merge-locale.d.ts +1 -0
  352. package/es/utils/merge-locale.js +15 -0
  353. package/es/utils/native-props.d.ts +8 -0
  354. package/es/utils/native-props.js +31 -0
  355. package/es/utils/nearest.d.ts +1 -0
  356. package/es/utils/nearest.js +5 -0
  357. package/es/utils/noop.d.ts +1 -0
  358. package/es/utils/noop.js +1 -0
  359. package/es/utils/reduce-and-restore-motion.d.ts +4 -0
  360. package/es/utils/reduce-and-restore-motion.js +35 -0
  361. package/es/utils/render-imperatively.d.ts +13 -0
  362. package/es/utils/render-imperatively.js +199 -0
  363. package/es/utils/render-to-body.d.ts +2 -0
  364. package/es/utils/render-to-body.js +13 -0
  365. package/es/utils/render-to-container.d.ts +3 -0
  366. package/es/utils/render-to-container.js +10 -0
  367. package/es/utils/render.d.ts +9 -0
  368. package/es/utils/render.js +187 -0
  369. package/es/utils/replace-message.d.ts +1 -0
  370. package/es/utils/replace-message.js +7 -0
  371. package/es/utils/rubberband.d.ts +2 -0
  372. package/es/utils/rubberband.js +13 -0
  373. package/es/utils/should-render.d.ts +10 -0
  374. package/es/utils/should-render.js +12 -0
  375. package/es/utils/shuffle.d.ts +6 -0
  376. package/es/utils/shuffle.js +23 -0
  377. package/es/utils/sleep.d.ts +1 -0
  378. package/es/utils/sleep.js +5 -0
  379. package/es/utils/supports-passive.d.ts +1 -0
  380. package/es/utils/supports-passive.js +13 -0
  381. package/es/utils/to-css-length.d.ts +1 -0
  382. package/es/utils/to-css-length.js +3 -0
  383. package/es/utils/traverse-react-node.d.ts +2 -0
  384. package/es/utils/traverse-react-node.js +16 -0
  385. package/es/utils/tree.d.ts +1 -0
  386. package/es/utils/tree.js +18 -0
  387. package/es/utils/undefined-fallback.d.ts +3 -0
  388. package/es/utils/undefined-fallback.js +11 -0
  389. package/es/utils/use-drag-and-pinch.d.ts +1 -0
  390. package/es/utils/use-drag-and-pinch.js +2 -0
  391. package/es/utils/use-initialized.d.ts +1 -0
  392. package/es/utils/use-initialized.js +8 -0
  393. package/es/utils/use-inner-visible.d.ts +1 -0
  394. package/es/utils/use-inner-visible.js +11 -0
  395. package/es/utils/use-isomorphic-update-layout-effect.d.ts +2 -0
  396. package/es/utils/use-isomorphic-update-layout-effect.js +2 -0
  397. package/es/utils/use-lock-scroll.d.ts +2 -0
  398. package/es/utils/use-lock-scroll.js +78 -0
  399. package/es/utils/use-mutation-effect.d.ts +2 -0
  400. package/es/utils/use-mutation-effect.js +15 -0
  401. package/es/utils/use-props-value.d.ts +8 -0
  402. package/es/utils/use-props-value.js +24 -0
  403. package/es/utils/use-ref-state.d.ts +2 -0
  404. package/es/utils/use-ref-state.js +11 -0
  405. package/es/utils/use-resize-effect.d.ts +2 -0
  406. package/es/utils/use-resize-effect.js +23 -0
  407. package/es/utils/use-tab-list-scroll.d.ts +5 -0
  408. package/es/utils/use-tab-list-scroll.js +60 -0
  409. package/es/utils/use-touch.d.ts +17 -0
  410. package/es/utils/use-touch.js +63 -0
  411. package/es/utils/validate.d.ts +8 -0
  412. package/es/utils/validate.js +26 -0
  413. package/es/utils/with-cache.d.ts +1 -0
  414. package/es/utils/with-cache.js +9 -0
  415. package/es/utils/with-default-props.d.ts +2 -0
  416. package/es/utils/with-default-props.js +25 -0
  417. package/es/utils/with-func-props.d.ts +5 -0
  418. package/es/utils/with-func-props.js +32 -0
  419. package/es/utils/with-stop-propagation.d.ts +4 -0
  420. package/es/utils/with-stop-propagation.js +30 -0
  421. package/package.json +48 -20
  422. package/__vendor/__vendor.js +0 -1
  423. package/handRead/handRead.d.ts +0 -6
  424. package/handRead/handRead.js +0 -302
  425. package/handRead/index.d.ts +0 -25
  426. package/handRead/index.js +0 -11
  427. package/imageViewer/imageViewer.d.ts +0 -3
  428. package/imageViewer/imageViewer.js +0 -28
  429. package/imageViewer/index.js +0 -8
  430. package/index.d.ts +0 -6
  431. package/index.js +0 -14
  432. package/keyboard/index.d.ts +0 -13
  433. package/keyboard/index.js +0 -7
  434. package/keyboard/keyboard.d.ts +0 -2
  435. package/keyboard/keyboard.js +0 -87
  436. package/style.css +0 -1
  437. package/utils/isEqual.d.ts +0 -5
  438. /package/{imageViewer → cjs/components/imageViewer}/index.d.ts +0 -0
@@ -0,0 +1,143 @@
1
+ .ebscn-alphabet-keyboard {
2
+ position: fixed;
3
+ bottom: 0;
4
+ transform: translateY(101%);
5
+ display: flex;
6
+ flex-wrap: wrap;
7
+ width: 100%;
8
+ transition: all 0.5s;
9
+ align-content: flex-start;
10
+ background: #d2d5db;
11
+ }
12
+ .ebscn-alphabet-keyboard .ebscn-alphabet-keyboard-firstline,
13
+ .ebscn-alphabet-keyboard .ebscn-alphabet-keyboard-secondline,
14
+ .ebscn-alphabet-keyboard .ebscn-alphabet-keyboard-thirdline,
15
+ .ebscn-alphabet-keyboard .ebscn-alphabet-keyboard-firthline {
16
+ display: flex;
17
+ justify-content: space-between;
18
+ width: 100%;
19
+ padding-top: 3.2%;
20
+ }
21
+ .ebscn-alphabet-keyboard .ebscn-alphabet-keyboard-firstline-key,
22
+ .ebscn-alphabet-keyboard .ebscn-alphabet-keyboard-secondline-key,
23
+ .ebscn-alphabet-keyboard .ebscn-alphabet-keyboard-thirdline-key,
24
+ .ebscn-alphabet-keyboard .ebscn-alphabet-keyboard-firthline-key {
25
+ display: flex;
26
+ align-items: center;
27
+ justify-content: center;
28
+ width: 8.4%;
29
+ height: 42px;
30
+ background: var(--ebscn-color-white);
31
+ border-radius: 5px;
32
+ box-shadow: 0px 0.5px 0px 0px #888888;
33
+ font-size: 23px;
34
+ font-weight: 400;
35
+ text-align: center;
36
+ color: var(--ebscn-color-text);
37
+ margin-right: 1.6%;
38
+ }
39
+ .ebscn-alphabet-keyboard .ebscn-alphabet-keyboard-firstline-key:active,
40
+ .ebscn-alphabet-keyboard .ebscn-alphabet-keyboard-secondline-key:active,
41
+ .ebscn-alphabet-keyboard .ebscn-alphabet-keyboard-thirdline-key:active,
42
+ .ebscn-alphabet-keyboard .ebscn-alphabet-keyboard-firthline-key:active {
43
+ background: var(--ebscn-color-border);
44
+ }
45
+ .ebscn-alphabet-keyboard .ebscn-alphabet-keyboard-firstline {
46
+ padding-left: 0.8%;
47
+ padding-right: 0.8%;
48
+ }
49
+ .ebscn-alphabet-keyboard .ebscn-alphabet-keyboard-secondline {
50
+ padding-left: 5.73%;
51
+ padding-right: 5.73%;
52
+ }
53
+ .ebscn-alphabet-keyboard .ebscn-alphabet-keyboard-thirdline {
54
+ padding-left: 0.8%;
55
+ padding-right: 0.8%;
56
+ }
57
+ .ebscn-alphabet-keyboard .ebscn-alphabet-keyboard-thirdline-capital {
58
+ display: flex;
59
+ align-items: center;
60
+ justify-content: center;
61
+ width: 11.2%;
62
+ height: 42px;
63
+ background: #adb3bd;
64
+ border-radius: 5px;
65
+ box-shadow: 0px 0.5px 0px 0px #888888;
66
+ margin-right: 3.73%;
67
+ }
68
+ .ebscn-alphabet-keyboard .ebscn-alphabet-keyboard-thirdline-capital:active {
69
+ background: #CACBD0;
70
+ }
71
+ .ebscn-alphabet-keyboard .ebscn-alphabet-keyboard-thirdline-delete {
72
+ display: flex;
73
+ align-items: center;
74
+ justify-content: center;
75
+ width: 11.2%;
76
+ height: 42px;
77
+ border-radius: 5px;
78
+ box-shadow: 0px 0.5px 0px 0px #888888;
79
+ margin-left: 2.26%;
80
+ background: url(./images/delete.png) #adb3bd no-repeat center;
81
+ background-size: 24px 24px;
82
+ }
83
+ .ebscn-alphabet-keyboard .ebscn-alphabet-keyboard-thirdline-delete:active {
84
+ background: #CACBD0;
85
+ }
86
+ .ebscn-alphabet-keyboard .ebscn-alphabet-keyboard-firthline {
87
+ padding-left: 0.8%;
88
+ padding-right: 0.8%;
89
+ padding-bottom: 1.06%;
90
+ }
91
+ .ebscn-alphabet-keyboard .ebscn-alphabet-keyboard-firthline-function {
92
+ display: flex;
93
+ align-items: center;
94
+ justify-content: center;
95
+ width: 11.2%;
96
+ height: 42px;
97
+ background: #adb3bd;
98
+ border-radius: 5px;
99
+ box-shadow: 0px 0.5px 0px 0px #888888;
100
+ }
101
+ .ebscn-alphabet-keyboard .ebscn-alphabet-keyboard-firthline-function:active {
102
+ background: #CACBD0;
103
+ }
104
+ .ebscn-alphabet-keyboard .ebscn-alphabet-keyboard-firthline-space {
105
+ display: flex;
106
+ align-items: center;
107
+ justify-content: center;
108
+ width: 48.4%;
109
+ height: 42px;
110
+ background: var(--ebscn-color-white);
111
+ border-radius: 5px;
112
+ box-shadow: 0px 0.5px 0px 0px #888888;
113
+ }
114
+ .ebscn-alphabet-keyboard .ebscn-alphabet-keyboard-firthline-space:active {
115
+ background: var(--ebscn-color-border);
116
+ }
117
+ .ebscn-alphabet-keyboard .ebscn-alphabet-keyboard-firthline-confirm {
118
+ display: flex;
119
+ align-items: center;
120
+ justify-content: center;
121
+ width: 23.46%;
122
+ height: 42px;
123
+ background: var(--ebscn-color-primary);
124
+ border-radius: 5px;
125
+ box-shadow: 0px 0.5px 0px 0px #888888;
126
+ font-size: 16px;
127
+ font-weight: 400;
128
+ text-align: center;
129
+ color: var(--ebscn-color-white);
130
+ line-height: 22.5px;
131
+ }
132
+ .ebscn-alphabet-keyboard .ebscn-alphabet-keyboard-firthline-confirm:active {
133
+ background-color: #D03B21;
134
+ }
135
+ .ebscn-alphabet-keyboard .ebscn-alphabet-keyboard-firthline img {
136
+ height: 20%;
137
+ }
138
+ @supports (bottom: env(safe-area-inset-bottom)) or (constant(safe-area-inset-bottom)) {
139
+ .keyboard {
140
+ height: calc(216px + env(safe-area-inset-bottom));
141
+ height: calc(216px + constant(safe-area-inset-bottom));
142
+ }
143
+ }
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { NativeProps } from '../../utils/native-props';
3
+ export type AlphabetKeyboardProps = {
4
+ visible?: boolean;
5
+ onInput: Function;
6
+ onDelete: Function;
7
+ onClose: Function;
8
+ onChangeKeyBoard: Function;
9
+ onConfirm: Function;
10
+ } & NativeProps;
11
+ export declare function AlphabetKeyboard(p: AlphabetKeyboardProps): JSX.Element;
@@ -0,0 +1,132 @@
1
+ import { useEffect, useRef, useState } from "react";
2
+ import React from "react";
3
+ import { withNativeProps } from '../../utils/native-props';
4
+ import { mergeProps } from '../../utils/with-default-props';
5
+ var classPrefix = 'ebscn-alphabet-keyboard';
6
+ var defaultProps = {
7
+ visible: false
8
+ };
9
+ export function AlphabetKeyboard(p) {
10
+ var keyboardRef = useRef(null);
11
+ var props = mergeProps(defaultProps, p);
12
+ var visible = props.visible,
13
+ onInput = props.onInput,
14
+ onDelete = props.onDelete,
15
+ onClose = props.onClose,
16
+ onChangeKeyBoard = props.onChangeKeyBoard,
17
+ onConfirm = props.onConfirm;
18
+ var firstKeys = ['q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p'];
19
+ var firstKeysBig = ['Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P'];
20
+ var secondKeys = ['a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l'];
21
+ var secondKeysBig = ['A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L'];
22
+ var thirdKeys = ['↑', 'z', 'x', 'c', 'v', 'b', 'n', 'm', '×'];
23
+ var thirdKeysBig = ['↑', 'Z', 'X', 'C', 'V', 'B', 'N', 'M', '×'];
24
+ var firthKeys = ['123', '⌨', '空格', '确定'];
25
+ var _a = useState(false),
26
+ isBig = _a[0],
27
+ setIsBIG = _a[1];
28
+ var appearTimer = useRef(null);
29
+ var hideTimer = useRef(null);
30
+ var lastVisible = useRef(null);
31
+ var keyFlag = useRef(0);
32
+ useEffect(function () {
33
+ if (!visible) {
34
+ if (lastVisible.current) {
35
+ // 键盘已实例化,调用隐藏即可
36
+ hideKeyBoard();
37
+ }
38
+ // 未实例化,为初始化,不需处理
39
+ } else {
40
+ showKeyBoard();
41
+ lastVisible.current = visible; // 记录当前键盘状态
42
+ }
43
+ }, [visible]);
44
+ function hideKeyBoard() {
45
+ keyboardRef.current.style.transform = 'translateY(100%)';
46
+ if (appearTimer.current) clearTimeout(appearTimer.current);
47
+ if (!hideTimer.current) {
48
+ hideTimer.current = setTimeout(function () {
49
+ keyboardRef.current.style.display = 'none';
50
+ }, 500);
51
+ }
52
+ }
53
+ function showKeyBoard() {
54
+ keyboardRef.current.style.display = '';
55
+ if (hideTimer.current) clearTimeout(hideTimer.current);
56
+ appearTimer.current = setTimeout(function () {
57
+ keyboardRef.current.style.transform = 'translateY(0)';
58
+ }, 20);
59
+ }
60
+ function onKeyPress(key) {
61
+ switch (key) {
62
+ case 'X':
63
+ return onDelete === null || onDelete === void 0 ? void 0 : onDelete();
64
+ case '123':
65
+ return onChangeKeyBoard === null || onChangeKeyBoard === void 0 ? void 0 : onChangeKeyBoard();
66
+ case '⌨':
67
+ return onClose === null || onClose === void 0 ? void 0 : onClose();
68
+ case '确定':
69
+ return onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
70
+ case '空格':
71
+ return onInput === null || onInput === void 0 ? void 0 : onInput(' ');
72
+ default:
73
+ return onInput === null || onInput === void 0 ? void 0 : onInput(key);
74
+ }
75
+ }
76
+ return withNativeProps(props, React.createElement("div", {
77
+ ref: keyboardRef,
78
+ className: "".concat(classPrefix)
79
+ }, React.createElement("div", {
80
+ className: "".concat(classPrefix, "-firstline")
81
+ }, (isBig == false ? firstKeys : firstKeysBig).map(function (item, index) {
82
+ return React.createElement("div", {
83
+ key: item || index,
84
+ className: "".concat(classPrefix, "-firstline-key"),
85
+ onClick: function () {
86
+ if (visible) {
87
+ onKeyPress(item);
88
+ }
89
+ }
90
+ }, item);
91
+ })), React.createElement("div", {
92
+ className: "".concat(classPrefix, "-secondline")
93
+ }, (isBig == false ? secondKeys : secondKeysBig).map(function (item, index) {
94
+ return React.createElement("div", {
95
+ key: item || index,
96
+ className: "".concat(classPrefix, "-secondline-key"),
97
+ onClick: function () {
98
+ if (visible) {
99
+ onKeyPress(item);
100
+ }
101
+ }
102
+ }, item);
103
+ })), React.createElement("div", {
104
+ className: "".concat(classPrefix, "-thirdline")
105
+ }, (isBig == false ? thirdKeys : thirdKeysBig).map(function (item, index) {
106
+ return React.createElement("div", {
107
+ key: item || index,
108
+ className: item == '↑' ? "".concat(classPrefix, "-thirdline-capital") : item == '×' ? "".concat(classPrefix, "-thirdline-delete") : "".concat(classPrefix, "-thirdline-key"),
109
+ onClick: function () {
110
+ if (visible) {
111
+ onKeyPress(item);
112
+ }
113
+ ;
114
+ if (item == '↑') {
115
+ isBig == false ? setIsBIG(true) : setIsBIG(false);
116
+ }
117
+ }
118
+ }, item !== '×' ? item : '');
119
+ })), React.createElement("div", {
120
+ className: "".concat(classPrefix, "-firthline")
121
+ }, firthKeys.map(function (item, index) {
122
+ return React.createElement("div", {
123
+ key: item || index,
124
+ className: item == '123' || item == '⌨' ? "".concat(classPrefix, "-firthline-function") : item == '空格' ? "".concat(classPrefix, "-firthline-space") : "".concat(classPrefix, "-firthline-confirm"),
125
+ onClick: function () {
126
+ if (visible) {
127
+ onKeyPress(item);
128
+ }
129
+ }
130
+ }, item);
131
+ }))));
132
+ }
@@ -0,0 +1,4 @@
1
+ import "./alphabet-keyboard.less";
2
+ import { AlphabetKeyboard } from "./alphabet-keyboard";
3
+ export type { AlphabetKeyboardProps } from "./alphabet-keyboard";
4
+ export default AlphabetKeyboard;
@@ -0,0 +1,3 @@
1
+ import "./alphabet-keyboard.css";
2
+ import { AlphabetKeyboard } from "./alphabet-keyboard";
3
+ export default AlphabetKeyboard;
@@ -0,0 +1,152 @@
1
+ @keyframes loading-rotate {
2
+ 100% {
3
+ transform: rotate(1turn);
4
+ }
5
+ }
6
+ .ebscn-button {
7
+ --border-width: 1px;
8
+ --border-radius: 24px;
9
+ --text-color: var(--ebscn-color-text-light-solid);
10
+ --background-color: var(--color);
11
+ --before-background-color: var(--ebscn-color-text-dark-solid);
12
+ color: var(--text-color);
13
+ background-color: var(--background-color);
14
+ position: relative;
15
+ display: inline-block;
16
+ box-sizing: border-box;
17
+ height: auto;
18
+ margin: 0;
19
+ font-size: var(--ebscn-font-size-9);
20
+ line-height: 1.4;
21
+ text-align: center;
22
+ border: var(--border-width) solid var(--color);
23
+ border-radius: var(--border-radius);
24
+ cursor: pointer;
25
+ transition: opacity ease 0.15s;
26
+ -webkit-user-select: none;
27
+ user-select: none;
28
+ }
29
+ .ebscn-button:focus {
30
+ outline: none;
31
+ }
32
+ .ebscn-button::before {
33
+ position: absolute;
34
+ top: 0;
35
+ left: 0;
36
+ transform: translate(calc(var(--border-width) * -1), calc(var(--border-width) * -1));
37
+ width: 100%;
38
+ height: 100%;
39
+ background-color: var(--before-background-color);
40
+ border: var(--border-width) solid var(--before-background-color);
41
+ border-radius: var(--border-radius);
42
+ opacity: 0;
43
+ content: ' ';
44
+ box-sizing: content-box;
45
+ }
46
+ .ebscn-button:active::before,
47
+ .ebscn-button-loading::before {
48
+ opacity: 0.1;
49
+ }
50
+ .ebscn-button-loading-icon {
51
+ animation: loading-rotate 1s linear infinite;
52
+ }
53
+ .ebscn-button-fill-outline {
54
+ --background-color: transparent;
55
+ --border-color: var(--color);
56
+ --border-width: 1px;
57
+ --text-color: var(--color);
58
+ --before-background-color: var(--color);
59
+ }
60
+ .ebscn-button-fill-outline::before {
61
+ opacity: 0;
62
+ }
63
+ .ebscn-button-fill-outline-loading::before,
64
+ .ebscn-button-fill-outline:active::before {
65
+ opacity: 0.1;
66
+ }
67
+ .ebscn-button-fill-none {
68
+ --text-color: var(--ebscn-color-text);
69
+ --background-color: transparent;
70
+ --border-width: 0px;
71
+ }
72
+ .ebscn-button-fill-none::before {
73
+ display: none;
74
+ }
75
+ .ebscn-button-fill-none-loading::before,
76
+ .ebscn-button-fill-none:active::before {
77
+ display: none;
78
+ }
79
+ .ebscn-button-block {
80
+ display: block;
81
+ width: 100%;
82
+ }
83
+ .ebscn-button-disabled {
84
+ --before-background-color: var(--ebscn-color-text-light-solid);
85
+ cursor: not-allowed;
86
+ }
87
+ .ebscn-button-fill-solid-disabled .ebscn-button-text {
88
+ opacity: 0.7;
89
+ }
90
+ .ebscn-button-fill-solid-disabled::before {
91
+ opacity: 0.5;
92
+ }
93
+ .ebscn-button-fill-outline-disabled .ebscn-button-text {
94
+ opacity: 0.4;
95
+ }
96
+ .ebscn-button-fill-outline-disabled:active::before,
97
+ .ebscn-button-fill-outline-disabled::before {
98
+ border: var(--border-width) solid var(--before-background-color);
99
+ opacity: 0.7;
100
+ }
101
+ .ebscn-button-fill-none-disabled .ebscn-button-text {
102
+ color: var(--ebscn-color-light);
103
+ }
104
+ .ebscn-button-333 {
105
+ border-color: #ccc;
106
+ }
107
+ .ebscn-button.ebscn-button-mini {
108
+ --border-radius: 12px;
109
+ padding-left: 12px;
110
+ padding-right: 12px;
111
+ height: 24px;
112
+ font-size: var(--ebscn-font-size-4);
113
+ }
114
+ .ebscn-button.ebscn-button-small {
115
+ --border-radius: 15px;
116
+ width: 79px;
117
+ height: 28px;
118
+ font-size: var(--ebscn-font-size-6);
119
+ }
120
+ .ebscn-button.ebscn-button-halfMiddle {
121
+ --border-radius: 21px;
122
+ width: 131.5px;
123
+ height: 40px;
124
+ font-size: var(--ebscn-font-size-8);
125
+ }
126
+ .ebscn-button.ebscn-button-middle {
127
+ --border-radius: 24px;
128
+ width: 275px;
129
+ height: 40px;
130
+ font-size: var(--ebscn-font-size-10);
131
+ }
132
+ .ebscn-button.ebscn-button-large {
133
+ height: 46px;
134
+ font-size: var(--ebscn-font-size-10);
135
+ }
136
+ .ebscn-button-loading {
137
+ vertical-align: sub;
138
+ }
139
+ .ebscn-button-loading-icon-left {
140
+ margin-left: 4px;
141
+ }
142
+ .ebscn-button-loading-icon-right {
143
+ margin-right: 4px;
144
+ }
145
+ .ebscn-button-loading-wrapper {
146
+ display: flex;
147
+ align-items: center;
148
+ justify-content: center;
149
+ }
150
+ .ebscn-button-loading-wrapper > .ebscn-loading {
151
+ opacity: 0.6;
152
+ }
@@ -0,0 +1,40 @@
1
+ import type { ButtonHTMLAttributes, CSSProperties, DetailedHTMLProps, ReactNode } from 'react';
2
+ import React from 'react';
3
+ import { NativeProps } from '../../utils/native-props';
4
+ type NativeButtonProps = DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;
5
+ export type ButtonProps = {
6
+ color?: 'primary' | 'sell' | 'financial' | string;
7
+ fill?: 'solid' | 'outline' | 'none';
8
+ size?: 'mini' | 'small' | 'halfMiddle' | 'middle' | 'large';
9
+ block?: boolean;
10
+ loading?: boolean | 'auto';
11
+ loadingText?: string;
12
+ loadingIcon?: ReactNode;
13
+ loadingIconPos?: 'left' | 'right';
14
+ disabled?: boolean;
15
+ type?: 'submit' | 'button' | 'reset';
16
+ onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void | Promise<void> | unknown;
17
+ children?: ReactNode;
18
+ } & Pick<NativeButtonProps, 'onMouseDown' | 'onMouseUp' | 'onTouchStart' | 'onTouchEnd' | 'id'> & NativeProps;
19
+ export type ButtonRef = {
20
+ nativeElement: HTMLButtonElement | null;
21
+ };
22
+ export declare const Button: React.ForwardRefExoticComponent<{
23
+ color?: string | undefined;
24
+ fill?: "none" | "solid" | "outline" | undefined;
25
+ size?: "small" | "large" | "middle" | "mini" | "halfMiddle" | undefined;
26
+ block?: boolean | undefined;
27
+ loading?: boolean | "auto" | undefined;
28
+ loadingText?: string | undefined;
29
+ loadingIcon?: ReactNode;
30
+ loadingIconPos?: "left" | "right" | undefined;
31
+ disabled?: boolean | undefined;
32
+ type?: "reset" | "submit" | "button" | undefined;
33
+ onClick?: ((event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void | Promise<void> | unknown) | undefined;
34
+ children?: ReactNode;
35
+ } & Pick<NativeButtonProps, "id" | "onMouseDown" | "onMouseUp" | "onTouchStart" | "onTouchEnd"> & {
36
+ className?: string | undefined;
37
+ style?: (CSSProperties & Partial<Record<never, string>>) | undefined;
38
+ tabIndex?: number | undefined;
39
+ } & React.AriaAttributes & React.RefAttributes<ButtonRef>>;
40
+ export {};
@@ -0,0 +1,206 @@
1
+ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) {
3
+ return value instanceof P ? value : new P(function (resolve) {
4
+ resolve(value);
5
+ });
6
+ }
7
+ return new (P || (P = Promise))(function (resolve, reject) {
8
+ function fulfilled(value) {
9
+ try {
10
+ step(generator.next(value));
11
+ } catch (e) {
12
+ reject(e);
13
+ }
14
+ }
15
+ function rejected(value) {
16
+ try {
17
+ step(generator["throw"](value));
18
+ } catch (e) {
19
+ reject(e);
20
+ }
21
+ }
22
+ function step(result) {
23
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
24
+ }
25
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
26
+ });
27
+ };
28
+ var __generator = this && this.__generator || function (thisArg, body) {
29
+ var _ = {
30
+ label: 0,
31
+ sent: function () {
32
+ if (t[0] & 1) throw t[1];
33
+ return t[1];
34
+ },
35
+ trys: [],
36
+ ops: []
37
+ },
38
+ f,
39
+ y,
40
+ t,
41
+ g;
42
+ return g = {
43
+ next: verb(0),
44
+ "throw": verb(1),
45
+ "return": verb(2)
46
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
47
+ return this;
48
+ }), g;
49
+ function verb(n) {
50
+ return function (v) {
51
+ return step([n, v]);
52
+ };
53
+ }
54
+ function step(op) {
55
+ if (f) throw new TypeError("Generator is already executing.");
56
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
57
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
58
+ if (y = 0, t) op = [op[0] & 2, t.value];
59
+ switch (op[0]) {
60
+ case 0:
61
+ case 1:
62
+ t = op;
63
+ break;
64
+ case 4:
65
+ _.label++;
66
+ return {
67
+ value: op[1],
68
+ done: false
69
+ };
70
+ case 5:
71
+ _.label++;
72
+ y = op[1];
73
+ op = [0];
74
+ continue;
75
+ case 7:
76
+ op = _.ops.pop();
77
+ _.trys.pop();
78
+ continue;
79
+ default:
80
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
81
+ _ = 0;
82
+ continue;
83
+ }
84
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
85
+ _.label = op[1];
86
+ break;
87
+ }
88
+ if (op[0] === 6 && _.label < t[1]) {
89
+ _.label = t[1];
90
+ t = op;
91
+ break;
92
+ }
93
+ if (t && _.label < t[2]) {
94
+ _.label = t[2];
95
+ _.ops.push(op);
96
+ break;
97
+ }
98
+ if (t[2]) _.ops.pop();
99
+ _.trys.pop();
100
+ continue;
101
+ }
102
+ op = body.call(thisArg, _);
103
+ } catch (e) {
104
+ op = [6, e];
105
+ y = 0;
106
+ } finally {
107
+ f = t = 0;
108
+ }
109
+ if (op[0] & 5) throw op[1];
110
+ return {
111
+ value: op[0] ? op[1] : void 0,
112
+ done: true
113
+ };
114
+ }
115
+ };
116
+ import { LoadingIcon } from '@ebscn/ui';
117
+ import classNames from 'classnames';
118
+ import React, { forwardRef, useImperativeHandle, useRef, useState } from 'react';
119
+ import { withNativeProps } from '../../utils/native-props';
120
+ import { isPromise } from '../../utils/validate';
121
+ import { mergeProps } from '../../utils/with-default-props';
122
+ var classPrefix = "ebscn-button";
123
+ var defaultProps = {
124
+ color: 'primary',
125
+ fill: 'solid',
126
+ block: false,
127
+ loading: false,
128
+ disabled: false,
129
+ size: 'middle',
130
+ loadingIconPos: 'left'
131
+ };
132
+ export var Button = forwardRef(function (p, ref) {
133
+ var _a;
134
+ var _b, _c;
135
+ defaultProps.loadingIcon = React.createElement(LoadingIcon, {
136
+ className: "".concat(classPrefix, "-loading-icon")
137
+ });
138
+ var props = mergeProps(defaultProps, p);
139
+ var _d = useState(false),
140
+ innerLoading = _d[0],
141
+ setInnerLoading = _d[1];
142
+ var nativeButtonRef = useRef(null);
143
+ var loading = props.loading === 'auto' ? innerLoading : props.loading;
144
+ var disabled = props.disabled;
145
+ useImperativeHandle(ref, function () {
146
+ return {
147
+ get nativeElement() {
148
+ return nativeButtonRef.current;
149
+ }
150
+ };
151
+ });
152
+ var handleClick = function (e) {
153
+ return __awaiter(void 0, void 0, void 0, function () {
154
+ var promise, e_1;
155
+ return __generator(this, function (_a) {
156
+ switch (_a.label) {
157
+ case 0:
158
+ if (!props.onClick) return [2 /*return*/];
159
+ promise = props.onClick(e);
160
+ if (!isPromise(promise)) return [3 /*break*/, 4];
161
+ _a.label = 1;
162
+ case 1:
163
+ _a.trys.push([1, 3,, 4]);
164
+ setInnerLoading(true);
165
+ return [4 /*yield*/, promise];
166
+ case 2:
167
+ _a.sent();
168
+ setInnerLoading(false);
169
+ return [3 /*break*/, 4];
170
+ case 3:
171
+ e_1 = _a.sent();
172
+ setInnerLoading(false);
173
+ throw e_1;
174
+ case 4:
175
+ return [2 /*return*/];
176
+ }
177
+ });
178
+ });
179
+ };
180
+ var colorRecord = {
181
+ primary: 'var(--ebscn-color-primary,#e84225)',
182
+ sell: 'var(--ebscn-color-blue, #4c7cf1)',
183
+ financial: 'var(--ebscn-color-orange, #ff6800)'
184
+ };
185
+ var style = {
186
+ '--color': (_b = colorRecord[props.color || 'primary']) !== null && _b !== void 0 ? _b : props.color
187
+ };
188
+ return withNativeProps(props, React.createElement("button", {
189
+ style: style,
190
+ ref: nativeButtonRef,
191
+ type: props.type,
192
+ onClick: handleClick,
193
+ className: classNames(classPrefix, (_a = {}, _a["".concat(classPrefix, "-").concat((_c = props.color) === null || _c === void 0 ? void 0 : _c.replace('#', ''))] = props.color, _a["".concat(classPrefix, "-block")] = props.block || props.size === 'large', _a["".concat(classPrefix, "-disabled")] = disabled, _a["".concat(classPrefix, "-fill-solid")] = props.fill === 'solid', _a["".concat(classPrefix, "-fill-outline")] = props.fill === 'outline', _a["".concat(classPrefix, "-fill-none-disabled")] = props.fill === 'none' && disabled, _a["".concat(classPrefix, "-fill-solid-disabled")] = props.fill === 'solid' && disabled, _a["".concat(classPrefix, "-fill-outline-disabled")] = props.fill === 'outline' && disabled, _a["".concat(classPrefix, "-fill-none")] = props.fill === 'none', _a["".concat(classPrefix, "-mini")] = props.size === 'mini', _a["".concat(classPrefix, "-small")] = props.size === 'small', _a["".concat(classPrefix, "-halfMiddle")] = props.size === 'halfMiddle', _a["".concat(classPrefix, "-middle")] = props.size === 'middle', _a["".concat(classPrefix, "-large")] = props.size === 'large', _a["".concat(classPrefix, "-loading")] = loading, _a["".concat(classPrefix, "-fill-none-loading")] = props.fill === 'none' && loading, _a["".concat(classPrefix, "-fill-solid-loading")] = props.fill === 'solid' && loading, _a["".concat(classPrefix, "-fill-outline-loading")] = props.fill === 'outline' && loading, _a)),
194
+ disabled: disabled,
195
+ onMouseDown: props.onMouseDown,
196
+ onMouseUp: props.onMouseUp,
197
+ onTouchStart: props.onTouchStart,
198
+ onTouchEnd: props.onTouchEnd
199
+ }, loading ? React.createElement("div", {
200
+ className: "".concat(classPrefix, "-loading-wrapper")
201
+ }, props.loadingIconPos === 'left' ? props.loadingIcon : null, React.createElement("span", {
202
+ className: classNames("".concat(classPrefix, "-text"), "".concat(classPrefix, "-loading-icon-").concat(props.loadingIconPos))
203
+ }, props.loadingText || props.children), props.loadingIconPos === 'right' ? props.loadingIcon : null) : React.createElement("span", {
204
+ className: "".concat(classPrefix, "-text")
205
+ }, props.children)));
206
+ });