@uiw/doc 4.9.10 → 4.10.2

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 (492) hide show
  1. package/package.json +1 -1
  2. package/web/asset-manifest.json +293 -293
  3. package/web/index.html +1 -1
  4. package/web/static/css/{1059.e3a148be.chunk.css → 1059.68d3e67d.chunk.css} +2 -2
  5. package/web/static/css/{1169.e3a148be.chunk.css.map → 1059.68d3e67d.chunk.css.map} +1 -1
  6. package/web/static/css/{1169.e3a148be.chunk.css → 1061.68d3e67d.chunk.css} +2 -2
  7. package/web/static/css/{1059.e3a148be.chunk.css.map → 1061.68d3e67d.chunk.css.map} +1 -1
  8. package/web/static/css/{1061.e3a148be.chunk.css → 1169.68d3e67d.chunk.css} +2 -2
  9. package/web/static/css/{1317.e3a148be.chunk.css.map → 1169.68d3e67d.chunk.css.map} +1 -1
  10. package/web/static/css/{1317.e3a148be.chunk.css → 1317.68d3e67d.chunk.css} +2 -2
  11. package/web/static/css/{1061.e3a148be.chunk.css.map → 1317.68d3e67d.chunk.css.map} +1 -1
  12. package/web/static/css/1584.68d3e67d.chunk.css +2 -0
  13. package/web/static/css/1584.68d3e67d.chunk.css.map +1 -0
  14. package/web/static/css/1619.68d3e67d.chunk.css +2 -0
  15. package/web/static/css/1619.68d3e67d.chunk.css.map +1 -0
  16. package/web/static/css/{163.e3a148be.chunk.css → 163.68d3e67d.chunk.css} +2 -2
  17. package/web/static/css/{163.e3a148be.chunk.css.map → 163.68d3e67d.chunk.css.map} +1 -1
  18. package/web/static/css/1820.68d3e67d.chunk.css +2 -0
  19. package/web/static/css/1820.68d3e67d.chunk.css.map +1 -0
  20. package/web/static/css/2156.68d3e67d.chunk.css +2 -0
  21. package/web/static/css/2156.68d3e67d.chunk.css.map +1 -0
  22. package/web/static/css/2190.68d3e67d.chunk.css +2 -0
  23. package/web/static/css/2190.68d3e67d.chunk.css.map +1 -0
  24. package/web/static/css/{221.e3a148be.chunk.css → 221.68d3e67d.chunk.css} +2 -2
  25. package/web/static/css/{221.e3a148be.chunk.css.map → 221.68d3e67d.chunk.css.map} +1 -1
  26. package/web/static/css/2230.68d3e67d.chunk.css +2 -0
  27. package/web/static/css/2230.68d3e67d.chunk.css.map +1 -0
  28. package/web/static/css/2316.68d3e67d.chunk.css +2 -0
  29. package/web/static/css/2316.68d3e67d.chunk.css.map +1 -0
  30. package/web/static/css/2367.68d3e67d.chunk.css +2 -0
  31. package/web/static/css/2367.68d3e67d.chunk.css.map +1 -0
  32. package/web/static/css/2411.68d3e67d.chunk.css +2 -0
  33. package/web/static/css/2411.68d3e67d.chunk.css.map +1 -0
  34. package/web/static/css/2582.68d3e67d.chunk.css +2 -0
  35. package/web/static/css/2582.68d3e67d.chunk.css.map +1 -0
  36. package/web/static/css/2595.68d3e67d.chunk.css +2 -0
  37. package/web/static/css/2595.68d3e67d.chunk.css.map +1 -0
  38. package/web/static/css/2737.68d3e67d.chunk.css +2 -0
  39. package/web/static/css/2737.68d3e67d.chunk.css.map +1 -0
  40. package/web/static/css/2782.68d3e67d.chunk.css +2 -0
  41. package/web/static/css/2782.68d3e67d.chunk.css.map +1 -0
  42. package/web/static/css/3313.68d3e67d.chunk.css +2 -0
  43. package/web/static/css/3313.68d3e67d.chunk.css.map +1 -0
  44. package/web/static/css/3518.68d3e67d.chunk.css +2 -0
  45. package/web/static/css/3518.68d3e67d.chunk.css.map +1 -0
  46. package/web/static/css/3812.68d3e67d.chunk.css +2 -0
  47. package/web/static/css/3812.68d3e67d.chunk.css.map +1 -0
  48. package/web/static/css/3917.68d3e67d.chunk.css +2 -0
  49. package/web/static/css/3917.68d3e67d.chunk.css.map +1 -0
  50. package/web/static/css/4010.68d3e67d.chunk.css +2 -0
  51. package/web/static/css/4010.68d3e67d.chunk.css.map +1 -0
  52. package/web/static/css/4098.68d3e67d.chunk.css +2 -0
  53. package/web/static/css/4098.68d3e67d.chunk.css.map +1 -0
  54. package/web/static/css/4128.68d3e67d.chunk.css +2 -0
  55. package/web/static/css/4128.68d3e67d.chunk.css.map +1 -0
  56. package/web/static/css/4188.68d3e67d.chunk.css +2 -0
  57. package/web/static/css/4188.68d3e67d.chunk.css.map +1 -0
  58. package/web/static/css/{4396.dff7ced8.chunk.css → 4396.2422fe7f.chunk.css} +2 -2
  59. package/web/static/css/{4396.dff7ced8.chunk.css.map → 4396.2422fe7f.chunk.css.map} +1 -1
  60. package/web/static/css/4405.68d3e67d.chunk.css +2 -0
  61. package/web/static/css/4405.68d3e67d.chunk.css.map +1 -0
  62. package/web/static/css/4503.68d3e67d.chunk.css +2 -0
  63. package/web/static/css/4503.68d3e67d.chunk.css.map +1 -0
  64. package/web/static/css/4648.68d3e67d.chunk.css +2 -0
  65. package/web/static/css/4648.68d3e67d.chunk.css.map +1 -0
  66. package/web/static/css/4948.68d3e67d.chunk.css +2 -0
  67. package/web/static/css/4948.68d3e67d.chunk.css.map +1 -0
  68. package/web/static/css/5244.68d3e67d.chunk.css +2 -0
  69. package/web/static/css/5244.68d3e67d.chunk.css.map +1 -0
  70. package/web/static/css/5308.68d3e67d.chunk.css +2 -0
  71. package/web/static/css/5308.68d3e67d.chunk.css.map +1 -0
  72. package/web/static/css/5393.68d3e67d.chunk.css +2 -0
  73. package/web/static/css/5393.68d3e67d.chunk.css.map +1 -0
  74. package/web/static/css/5408.68d3e67d.chunk.css +2 -0
  75. package/web/static/css/5408.68d3e67d.chunk.css.map +1 -0
  76. package/web/static/css/5595.68d3e67d.chunk.css +2 -0
  77. package/web/static/css/5595.68d3e67d.chunk.css.map +1 -0
  78. package/web/static/css/5865.68d3e67d.chunk.css +2 -0
  79. package/web/static/css/5865.68d3e67d.chunk.css.map +1 -0
  80. package/web/static/css/{643.e3a148be.chunk.css → 643.68d3e67d.chunk.css} +2 -2
  81. package/web/static/css/{694.e3a148be.chunk.css.map → 643.68d3e67d.chunk.css.map} +1 -1
  82. package/web/static/css/6510.68d3e67d.chunk.css +2 -0
  83. package/web/static/css/6510.68d3e67d.chunk.css.map +1 -0
  84. package/web/static/css/6715.68d3e67d.chunk.css +2 -0
  85. package/web/static/css/6715.68d3e67d.chunk.css.map +1 -0
  86. package/web/static/css/6730.68d3e67d.chunk.css +2 -0
  87. package/web/static/css/6730.68d3e67d.chunk.css.map +1 -0
  88. package/web/static/css/{694.e3a148be.chunk.css → 694.68d3e67d.chunk.css} +2 -2
  89. package/web/static/css/{643.e3a148be.chunk.css.map → 694.68d3e67d.chunk.css.map} +1 -1
  90. package/web/static/css/7104.68d3e67d.chunk.css +2 -0
  91. package/web/static/css/7104.68d3e67d.chunk.css.map +1 -0
  92. package/web/static/css/7157.68d3e67d.chunk.css +2 -0
  93. package/web/static/css/7157.68d3e67d.chunk.css.map +1 -0
  94. package/web/static/css/7390.68d3e67d.chunk.css +2 -0
  95. package/web/static/css/7390.68d3e67d.chunk.css.map +1 -0
  96. package/web/static/css/748.68d3e67d.chunk.css +2 -0
  97. package/web/static/css/748.68d3e67d.chunk.css.map +1 -0
  98. package/web/static/css/7541.68d3e67d.chunk.css +2 -0
  99. package/web/static/css/7541.68d3e67d.chunk.css.map +1 -0
  100. package/web/static/css/7761.68d3e67d.chunk.css +2 -0
  101. package/web/static/css/7761.68d3e67d.chunk.css.map +1 -0
  102. package/web/static/css/7834.68d3e67d.chunk.css +2 -0
  103. package/web/static/css/7834.68d3e67d.chunk.css.map +1 -0
  104. package/web/static/css/7875.68d3e67d.chunk.css +2 -0
  105. package/web/static/css/7875.68d3e67d.chunk.css.map +1 -0
  106. package/web/static/css/7884.68d3e67d.chunk.css +2 -0
  107. package/web/static/css/7884.68d3e67d.chunk.css.map +1 -0
  108. package/web/static/css/8023.68d3e67d.chunk.css +2 -0
  109. package/web/static/css/8023.68d3e67d.chunk.css.map +1 -0
  110. package/web/static/css/8073.68d3e67d.chunk.css +2 -0
  111. package/web/static/css/8073.68d3e67d.chunk.css.map +1 -0
  112. package/web/static/css/8566.68d3e67d.chunk.css +2 -0
  113. package/web/static/css/8566.68d3e67d.chunk.css.map +1 -0
  114. package/web/static/css/875.68d3e67d.chunk.css +2 -0
  115. package/web/static/css/875.68d3e67d.chunk.css.map +1 -0
  116. package/web/static/css/9121.68d3e67d.chunk.css +2 -0
  117. package/web/static/css/9121.68d3e67d.chunk.css.map +1 -0
  118. package/web/static/css/9253.68d3e67d.chunk.css +2 -0
  119. package/web/static/css/9253.68d3e67d.chunk.css.map +1 -0
  120. package/web/static/css/9260.68d3e67d.chunk.css +2 -0
  121. package/web/static/css/9260.68d3e67d.chunk.css.map +1 -0
  122. package/web/static/css/9384.68d3e67d.chunk.css +2 -0
  123. package/web/static/css/9384.68d3e67d.chunk.css.map +1 -0
  124. package/web/static/css/9503.68d3e67d.chunk.css +2 -0
  125. package/web/static/css/9503.68d3e67d.chunk.css.map +1 -0
  126. package/web/static/css/9673.68d3e67d.chunk.css +2 -0
  127. package/web/static/css/9673.68d3e67d.chunk.css.map +1 -0
  128. package/web/static/css/9763.68d3e67d.chunk.css +2 -0
  129. package/web/static/css/9763.68d3e67d.chunk.css.map +1 -0
  130. package/web/static/css/9776.68d3e67d.chunk.css +2 -0
  131. package/web/static/css/9776.68d3e67d.chunk.css.map +1 -0
  132. package/web/static/css/9777.68d3e67d.chunk.css +2 -0
  133. package/web/static/css/9777.68d3e67d.chunk.css.map +1 -0
  134. package/web/static/css/9853.68d3e67d.chunk.css +2 -0
  135. package/web/static/css/9853.68d3e67d.chunk.css.map +1 -0
  136. package/web/static/css/{main.ffb4825d.css → main.57a5e574.css} +2 -2
  137. package/web/static/css/main.57a5e574.css.map +1 -0
  138. package/web/static/js/1043.349c6913.chunk.js +3 -0
  139. package/web/static/js/{1043.b6314c0a.chunk.js.LICENSE.txt → 1043.349c6913.chunk.js.LICENSE.txt} +0 -0
  140. package/web/static/js/1043.349c6913.chunk.js.map +1 -0
  141. package/web/static/js/1059.8d93d764.chunk.js +2 -0
  142. package/web/static/js/{2782.4177c657.chunk.js.map → 1059.8d93d764.chunk.js.map} +1 -1
  143. package/web/static/js/{6715.287b1279.chunk.js → 1061.bafae318.chunk.js} +2 -2
  144. package/web/static/js/1061.bafae318.chunk.js.map +1 -0
  145. package/web/static/js/1127.d65f8357.chunk.js +2 -0
  146. package/web/static/js/1127.d65f8357.chunk.js.map +1 -0
  147. package/web/static/js/{1820.6430dc26.chunk.js → 1169.4742ac85.chunk.js} +2 -2
  148. package/web/static/js/{9673.87ea6a7b.chunk.js.map → 1169.4742ac85.chunk.js.map} +1 -1
  149. package/web/static/js/{1061.2de80fcd.chunk.js → 1317.7b8f76ae.chunk.js} +2 -2
  150. package/web/static/js/{4503.e501a88a.chunk.js.map → 1317.7b8f76ae.chunk.js.map} +1 -1
  151. package/web/static/js/{1169.d986f6de.chunk.js → 1584.418b6349.chunk.js} +2 -2
  152. package/web/static/js/1584.418b6349.chunk.js.map +1 -0
  153. package/web/static/js/{7104.47f5dfec.chunk.js → 1619.9c818bd8.chunk.js} +2 -2
  154. package/web/static/js/{5244.3b905501.chunk.js.map → 1619.9c818bd8.chunk.js.map} +1 -1
  155. package/web/static/js/{163.48b6d67e.chunk.js → 163.6837d31d.chunk.js} +2 -2
  156. package/web/static/js/163.6837d31d.chunk.js.map +1 -0
  157. package/web/static/js/1820.b2763759.chunk.js +2 -0
  158. package/web/static/js/{2230.58b26a2d.chunk.js.map → 1820.b2763759.chunk.js.map} +1 -1
  159. package/web/static/js/2156.daa2586e.chunk.js +2 -0
  160. package/web/static/js/2156.daa2586e.chunk.js.map +1 -0
  161. package/web/static/js/{2316.9dec5f16.chunk.js → 2190.e0254e40.chunk.js} +2 -2
  162. package/web/static/js/2190.e0254e40.chunk.js.map +1 -0
  163. package/web/static/js/{221.6b5b2fe5.chunk.js → 221.eea92a59.chunk.js} +2 -2
  164. package/web/static/js/221.eea92a59.chunk.js.map +1 -0
  165. package/web/static/js/{2737.e8d3ead5.chunk.js → 2230.7a6c8cd8.chunk.js} +2 -2
  166. package/web/static/js/{1619.c5b10dbd.chunk.js.map → 2230.7a6c8cd8.chunk.js.map} +1 -1
  167. package/web/static/js/{2156.d32cfe3e.chunk.js → 2316.db72b41c.chunk.js} +2 -2
  168. package/web/static/js/{3313.5999c1b9.chunk.js.map → 2316.db72b41c.chunk.js.map} +1 -1
  169. package/web/static/js/2367.9ee69370.chunk.js +2 -0
  170. package/web/static/js/2367.9ee69370.chunk.js.map +1 -0
  171. package/web/static/js/2411.dc48e7bf.chunk.js +2 -0
  172. package/web/static/js/2411.dc48e7bf.chunk.js.map +1 -0
  173. package/web/static/js/{2411.66af5e4c.chunk.js → 2582.b6f142f5.chunk.js} +2 -2
  174. package/web/static/js/2582.b6f142f5.chunk.js.map +1 -0
  175. package/web/static/js/{2595.ceb152f2.chunk.js → 2595.3c01356b.chunk.js} +2 -2
  176. package/web/static/js/{4010.6db3b560.chunk.js.map → 2595.3c01356b.chunk.js.map} +1 -1
  177. package/web/static/js/2737.60b2a241.chunk.js +2 -0
  178. package/web/static/js/{2367.234da486.chunk.js.map → 2737.60b2a241.chunk.js.map} +1 -1
  179. package/web/static/js/2782.3d0e3e80.chunk.js +2 -0
  180. package/web/static/js/{7761.9173e2e1.chunk.js.map → 2782.3d0e3e80.chunk.js.map} +1 -1
  181. package/web/static/js/{2230.58b26a2d.chunk.js → 3313.ef6bf434.chunk.js} +2 -2
  182. package/web/static/js/3313.ef6bf434.chunk.js.map +1 -0
  183. package/web/static/js/3518.8040e47f.chunk.js +2 -0
  184. package/web/static/js/3518.8040e47f.chunk.js.map +1 -0
  185. package/web/static/js/3812.bc0af0bb.chunk.js +2 -0
  186. package/web/static/js/3812.bc0af0bb.chunk.js.map +1 -0
  187. package/web/static/js/3917.519fc58c.chunk.js +2 -0
  188. package/web/static/js/3917.519fc58c.chunk.js.map +1 -0
  189. package/web/static/js/{5308.c2b3bc72.chunk.js → 4010.beda51de.chunk.js} +2 -2
  190. package/web/static/js/4010.beda51de.chunk.js.map +1 -0
  191. package/web/static/js/4036.46baa59c.chunk.js +2 -0
  192. package/web/static/js/4036.46baa59c.chunk.js.map +1 -0
  193. package/web/static/js/4098.d140db1b.chunk.js +2 -0
  194. package/web/static/js/4098.d140db1b.chunk.js.map +1 -0
  195. package/web/static/js/4128.7cd288b0.chunk.js +2 -0
  196. package/web/static/js/4128.7cd288b0.chunk.js.map +1 -0
  197. package/web/static/js/{4010.6db3b560.chunk.js → 4188.d265b102.chunk.js} +2 -2
  198. package/web/static/js/4188.d265b102.chunk.js.map +1 -0
  199. package/web/static/js/4396.9e016c63.chunk.js +2 -0
  200. package/web/static/js/4396.9e016c63.chunk.js.map +1 -0
  201. package/web/static/js/{4396.d552cfe3.chunk.js → 4405.186e7fd9.chunk.js} +2 -2
  202. package/web/static/js/4405.186e7fd9.chunk.js.map +1 -0
  203. package/web/static/js/{9384.8e822042.chunk.js → 4503.3fb07ae2.chunk.js} +2 -2
  204. package/web/static/js/{2411.66af5e4c.chunk.js.map → 4503.3fb07ae2.chunk.js.map} +1 -1
  205. package/web/static/js/{4405.c204a3d7.chunk.js → 4648.d6c2126d.chunk.js} +2 -2
  206. package/web/static/js/{1059.90585733.chunk.js.map → 4648.d6c2126d.chunk.js.map} +1 -1
  207. package/web/static/js/{4877.2a1eff17.chunk.js → 4877.61f21bf4.chunk.js} +2 -2
  208. package/web/static/js/{4877.2a1eff17.chunk.js.map → 4877.61f21bf4.chunk.js.map} +1 -1
  209. package/web/static/js/{4128.61fc39cb.chunk.js → 4948.dff3b80c.chunk.js} +2 -2
  210. package/web/static/js/4948.dff3b80c.chunk.js.map +1 -0
  211. package/web/static/js/5183.7b46ce4a.js +3 -0
  212. package/web/static/js/{516.4f77e6c7.js.LICENSE.txt → 5183.7b46ce4a.js.LICENSE.txt} +1 -1
  213. package/web/static/js/5183.7b46ce4a.js.map +1 -0
  214. package/web/static/js/{5408.3dc527f7.chunk.js → 5244.608b4c80.chunk.js} +2 -2
  215. package/web/static/js/5244.608b4c80.chunk.js.map +1 -0
  216. package/web/static/js/5253.0a82cabf.chunk.js +2 -0
  217. package/web/static/js/5253.0a82cabf.chunk.js.map +1 -0
  218. package/web/static/js/{9777.90dbd095.chunk.js → 5308.4a4aa5a9.chunk.js} +2 -2
  219. package/web/static/js/{1317.6d4b9297.chunk.js.map → 5308.4a4aa5a9.chunk.js.map} +1 -1
  220. package/web/static/js/{3812.305ecc37.chunk.js → 5393.c81d552c.chunk.js} +2 -2
  221. package/web/static/js/5393.c81d552c.chunk.js.map +1 -0
  222. package/web/static/js/{5244.3b905501.chunk.js → 5408.584807af.chunk.js} +2 -2
  223. package/web/static/js/5408.584807af.chunk.js.map +1 -0
  224. package/web/static/js/{7761.9173e2e1.chunk.js → 5595.9370354a.chunk.js} +2 -2
  225. package/web/static/js/5595.9370354a.chunk.js.map +1 -0
  226. package/web/static/js/{5865.ca7ef99e.chunk.js → 5865.898599aa.chunk.js} +2 -2
  227. package/web/static/js/5865.898599aa.chunk.js.map +1 -0
  228. package/web/static/js/{643.7ec13dc3.chunk.js → 643.deb50ab9.chunk.js} +2 -2
  229. package/web/static/js/643.deb50ab9.chunk.js.map +1 -0
  230. package/web/static/js/6510.e40cde6e.chunk.js +2 -0
  231. package/web/static/js/6510.e40cde6e.chunk.js.map +1 -0
  232. package/web/static/js/{6566.75acebe9.chunk.js → 6566.f7efbc17.chunk.js} +2 -2
  233. package/web/static/js/{6566.75acebe9.chunk.js.map → 6566.f7efbc17.chunk.js.map} +1 -1
  234. package/web/static/js/{2367.234da486.chunk.js → 6715.fb4ea4c4.chunk.js} +2 -2
  235. package/web/static/js/{5595.6d07e12f.chunk.js.map → 6715.fb4ea4c4.chunk.js.map} +1 -1
  236. package/web/static/js/6730.85ac4657.chunk.js +2 -0
  237. package/web/static/js/6730.85ac4657.chunk.js.map +1 -0
  238. package/web/static/js/{694.0bb59e65.chunk.js → 694.a0a07e64.chunk.js} +2 -2
  239. package/web/static/js/694.a0a07e64.chunk.js.map +1 -0
  240. package/web/static/js/{3917.ec9cb6d1.chunk.js → 7104.e2466efa.chunk.js} +2 -2
  241. package/web/static/js/{5393.50e4a031.chunk.js.map → 7104.e2466efa.chunk.js.map} +1 -1
  242. package/web/static/js/{2582.7015fb11.chunk.js → 7157.1533756d.chunk.js} +2 -2
  243. package/web/static/js/{8073.7479be04.chunk.js.map → 7157.1533756d.chunk.js.map} +1 -1
  244. package/web/static/js/7217.6128cabc.chunk.js +2 -0
  245. package/web/static/js/7217.6128cabc.chunk.js.map +1 -0
  246. package/web/static/js/{7157.a7f5348a.chunk.js → 7390.17e03376.chunk.js} +2 -2
  247. package/web/static/js/7390.17e03376.chunk.js.map +1 -0
  248. package/web/static/js/{748.69f720a3.chunk.js → 748.3995d5b1.chunk.js} +2 -2
  249. package/web/static/js/748.3995d5b1.chunk.js.map +1 -0
  250. package/web/static/js/7541.8a3e98e8.chunk.js +2 -0
  251. package/web/static/js/{7104.47f5dfec.chunk.js.map → 7541.8a3e98e8.chunk.js.map} +1 -1
  252. package/web/static/js/{8023.e725f7dd.chunk.js → 7761.b041c399.chunk.js} +2 -2
  253. package/web/static/js/{7834.2f837df7.chunk.js.map → 7761.b041c399.chunk.js.map} +1 -1
  254. package/web/static/js/{7541.6ec1ccbd.chunk.js → 7834.90321cfc.chunk.js} +2 -2
  255. package/web/static/js/{4396.d552cfe3.chunk.js.map → 7834.90321cfc.chunk.js.map} +1 -1
  256. package/web/static/js/{7875.7ea581ed.chunk.js → 7875.b3655b54.chunk.js} +2 -2
  257. package/web/static/js/7875.b3655b54.chunk.js.map +1 -0
  258. package/web/static/js/{7884.169e89d6.chunk.js → 7884.8b4eeda6.chunk.js} +2 -2
  259. package/web/static/js/{8566.a4c19dba.chunk.js.map → 7884.8b4eeda6.chunk.js.map} +1 -1
  260. package/web/static/js/8023.14f69466.chunk.js +2 -0
  261. package/web/static/js/8023.14f69466.chunk.js.map +1 -0
  262. package/web/static/js/{8566.a4c19dba.chunk.js → 8073.1cc27e20.chunk.js} +2 -2
  263. package/web/static/js/8073.1cc27e20.chunk.js.map +1 -0
  264. package/web/static/js/8566.e87e1df8.chunk.js +2 -0
  265. package/web/static/js/8566.e87e1df8.chunk.js.map +1 -0
  266. package/web/static/js/{875.64279ea7.chunk.js → 875.1455109f.chunk.js} +2 -2
  267. package/web/static/js/875.1455109f.chunk.js.map +1 -0
  268. package/web/static/js/9121.bc38ef00.chunk.js +2 -0
  269. package/web/static/js/9121.bc38ef00.chunk.js.map +1 -0
  270. package/web/static/js/9137.f4e2b7b0.chunk.js +2 -0
  271. package/web/static/js/9137.f4e2b7b0.chunk.js.map +1 -0
  272. package/web/static/js/{9200.2bc62823.chunk.js → 9200.0a1f7353.chunk.js} +2 -2
  273. package/web/static/js/9200.0a1f7353.chunk.js.map +1 -0
  274. package/web/static/js/{2782.4177c657.chunk.js → 9253.a47fa280.chunk.js} +2 -2
  275. package/web/static/js/9253.a47fa280.chunk.js.map +1 -0
  276. package/web/static/js/{9260.06d0bd83.chunk.js → 9260.8fda343b.chunk.js} +2 -2
  277. package/web/static/js/{2737.e8d3ead5.chunk.js.map → 9260.8fda343b.chunk.js.map} +1 -1
  278. package/web/static/js/9384.d614be5c.chunk.js +2 -0
  279. package/web/static/js/9384.d614be5c.chunk.js.map +1 -0
  280. package/web/static/js/{9429.b142ace4.chunk.js → 9429.3b8debbf.chunk.js} +2 -2
  281. package/web/static/js/{9429.b142ace4.chunk.js.map → 9429.3b8debbf.chunk.js.map} +1 -1
  282. package/web/static/js/{9776.e9c3b31c.chunk.js → 9503.717ea617.chunk.js} +2 -2
  283. package/web/static/js/9503.717ea617.chunk.js.map +1 -0
  284. package/web/static/js/9673.38c02b53.chunk.js +2 -0
  285. package/web/static/js/{7541.6ec1ccbd.chunk.js.map → 9673.38c02b53.chunk.js.map} +1 -1
  286. package/web/static/js/{9673.87ea6a7b.chunk.js → 9763.45af4bae.chunk.js} +2 -2
  287. package/web/static/js/{4405.c204a3d7.chunk.js.map → 9763.45af4bae.chunk.js.map} +1 -1
  288. package/web/static/js/{9253.c8a3645c.chunk.js → 9776.3d376dc8.chunk.js} +2 -2
  289. package/web/static/js/9776.3d376dc8.chunk.js.map +1 -0
  290. package/web/static/js/9777.ee9694db.chunk.js +2 -0
  291. package/web/static/js/9777.ee9694db.chunk.js.map +1 -0
  292. package/web/static/js/{9121.efc0e8ad.chunk.js → 9853.9f7133a2.chunk.js} +2 -2
  293. package/web/static/js/9853.9f7133a2.chunk.js.map +1 -0
  294. package/web/static/js/main.d836800f.js +2 -0
  295. package/web/static/js/main.d836800f.js.map +1 -0
  296. package/web/static/css/1584.e3a148be.chunk.css +0 -2
  297. package/web/static/css/1584.e3a148be.chunk.css.map +0 -1
  298. package/web/static/css/1619.e3a148be.chunk.css +0 -2
  299. package/web/static/css/1619.e3a148be.chunk.css.map +0 -1
  300. package/web/static/css/1820.e3a148be.chunk.css +0 -2
  301. package/web/static/css/1820.e3a148be.chunk.css.map +0 -1
  302. package/web/static/css/2156.e3a148be.chunk.css +0 -2
  303. package/web/static/css/2156.e3a148be.chunk.css.map +0 -1
  304. package/web/static/css/2190.e3a148be.chunk.css +0 -2
  305. package/web/static/css/2190.e3a148be.chunk.css.map +0 -1
  306. package/web/static/css/2230.e3a148be.chunk.css +0 -2
  307. package/web/static/css/2230.e3a148be.chunk.css.map +0 -1
  308. package/web/static/css/2316.e3a148be.chunk.css +0 -2
  309. package/web/static/css/2316.e3a148be.chunk.css.map +0 -1
  310. package/web/static/css/2367.e3a148be.chunk.css +0 -2
  311. package/web/static/css/2367.e3a148be.chunk.css.map +0 -1
  312. package/web/static/css/2411.e3a148be.chunk.css +0 -2
  313. package/web/static/css/2411.e3a148be.chunk.css.map +0 -1
  314. package/web/static/css/2582.e3a148be.chunk.css +0 -2
  315. package/web/static/css/2582.e3a148be.chunk.css.map +0 -1
  316. package/web/static/css/2595.e3a148be.chunk.css +0 -2
  317. package/web/static/css/2595.e3a148be.chunk.css.map +0 -1
  318. package/web/static/css/2737.e3a148be.chunk.css +0 -2
  319. package/web/static/css/2737.e3a148be.chunk.css.map +0 -1
  320. package/web/static/css/2782.e3a148be.chunk.css +0 -2
  321. package/web/static/css/2782.e3a148be.chunk.css.map +0 -1
  322. package/web/static/css/3313.e3a148be.chunk.css +0 -2
  323. package/web/static/css/3313.e3a148be.chunk.css.map +0 -1
  324. package/web/static/css/3518.e3a148be.chunk.css +0 -2
  325. package/web/static/css/3518.e3a148be.chunk.css.map +0 -1
  326. package/web/static/css/3812.e3a148be.chunk.css +0 -2
  327. package/web/static/css/3812.e3a148be.chunk.css.map +0 -1
  328. package/web/static/css/3917.e3a148be.chunk.css +0 -2
  329. package/web/static/css/3917.e3a148be.chunk.css.map +0 -1
  330. package/web/static/css/4010.e3a148be.chunk.css +0 -2
  331. package/web/static/css/4010.e3a148be.chunk.css.map +0 -1
  332. package/web/static/css/4098.e3a148be.chunk.css +0 -2
  333. package/web/static/css/4098.e3a148be.chunk.css.map +0 -1
  334. package/web/static/css/4128.e3a148be.chunk.css +0 -2
  335. package/web/static/css/4128.e3a148be.chunk.css.map +0 -1
  336. package/web/static/css/4188.e3a148be.chunk.css +0 -2
  337. package/web/static/css/4188.e3a148be.chunk.css.map +0 -1
  338. package/web/static/css/4405.e3a148be.chunk.css +0 -2
  339. package/web/static/css/4405.e3a148be.chunk.css.map +0 -1
  340. package/web/static/css/4503.e3a148be.chunk.css +0 -2
  341. package/web/static/css/4503.e3a148be.chunk.css.map +0 -1
  342. package/web/static/css/4648.e3a148be.chunk.css +0 -2
  343. package/web/static/css/4648.e3a148be.chunk.css.map +0 -1
  344. package/web/static/css/4948.e3a148be.chunk.css +0 -2
  345. package/web/static/css/4948.e3a148be.chunk.css.map +0 -1
  346. package/web/static/css/5244.e3a148be.chunk.css +0 -2
  347. package/web/static/css/5244.e3a148be.chunk.css.map +0 -1
  348. package/web/static/css/5308.e3a148be.chunk.css +0 -2
  349. package/web/static/css/5308.e3a148be.chunk.css.map +0 -1
  350. package/web/static/css/5393.e3a148be.chunk.css +0 -2
  351. package/web/static/css/5393.e3a148be.chunk.css.map +0 -1
  352. package/web/static/css/5408.e3a148be.chunk.css +0 -2
  353. package/web/static/css/5408.e3a148be.chunk.css.map +0 -1
  354. package/web/static/css/5595.e3a148be.chunk.css +0 -2
  355. package/web/static/css/5595.e3a148be.chunk.css.map +0 -1
  356. package/web/static/css/5865.e3a148be.chunk.css +0 -2
  357. package/web/static/css/5865.e3a148be.chunk.css.map +0 -1
  358. package/web/static/css/6510.e3a148be.chunk.css +0 -2
  359. package/web/static/css/6510.e3a148be.chunk.css.map +0 -1
  360. package/web/static/css/6715.e3a148be.chunk.css +0 -2
  361. package/web/static/css/6715.e3a148be.chunk.css.map +0 -1
  362. package/web/static/css/6730.e3a148be.chunk.css +0 -2
  363. package/web/static/css/6730.e3a148be.chunk.css.map +0 -1
  364. package/web/static/css/7104.e3a148be.chunk.css +0 -2
  365. package/web/static/css/7104.e3a148be.chunk.css.map +0 -1
  366. package/web/static/css/7157.e3a148be.chunk.css +0 -2
  367. package/web/static/css/7157.e3a148be.chunk.css.map +0 -1
  368. package/web/static/css/7390.e3a148be.chunk.css +0 -2
  369. package/web/static/css/7390.e3a148be.chunk.css.map +0 -1
  370. package/web/static/css/748.e3a148be.chunk.css +0 -2
  371. package/web/static/css/748.e3a148be.chunk.css.map +0 -1
  372. package/web/static/css/7541.e3a148be.chunk.css +0 -2
  373. package/web/static/css/7541.e3a148be.chunk.css.map +0 -1
  374. package/web/static/css/7761.e3a148be.chunk.css +0 -2
  375. package/web/static/css/7761.e3a148be.chunk.css.map +0 -1
  376. package/web/static/css/7834.e3a148be.chunk.css +0 -2
  377. package/web/static/css/7834.e3a148be.chunk.css.map +0 -1
  378. package/web/static/css/7875.e3a148be.chunk.css +0 -2
  379. package/web/static/css/7875.e3a148be.chunk.css.map +0 -1
  380. package/web/static/css/7884.e3a148be.chunk.css +0 -2
  381. package/web/static/css/7884.e3a148be.chunk.css.map +0 -1
  382. package/web/static/css/8023.e3a148be.chunk.css +0 -2
  383. package/web/static/css/8023.e3a148be.chunk.css.map +0 -1
  384. package/web/static/css/8073.e3a148be.chunk.css +0 -2
  385. package/web/static/css/8073.e3a148be.chunk.css.map +0 -1
  386. package/web/static/css/8566.e3a148be.chunk.css +0 -2
  387. package/web/static/css/8566.e3a148be.chunk.css.map +0 -1
  388. package/web/static/css/875.e3a148be.chunk.css +0 -2
  389. package/web/static/css/875.e3a148be.chunk.css.map +0 -1
  390. package/web/static/css/9121.e3a148be.chunk.css +0 -2
  391. package/web/static/css/9121.e3a148be.chunk.css.map +0 -1
  392. package/web/static/css/9253.e3a148be.chunk.css +0 -2
  393. package/web/static/css/9253.e3a148be.chunk.css.map +0 -1
  394. package/web/static/css/9260.e3a148be.chunk.css +0 -2
  395. package/web/static/css/9260.e3a148be.chunk.css.map +0 -1
  396. package/web/static/css/9384.e3a148be.chunk.css +0 -2
  397. package/web/static/css/9384.e3a148be.chunk.css.map +0 -1
  398. package/web/static/css/9503.e3a148be.chunk.css +0 -2
  399. package/web/static/css/9503.e3a148be.chunk.css.map +0 -1
  400. package/web/static/css/9673.e3a148be.chunk.css +0 -2
  401. package/web/static/css/9673.e3a148be.chunk.css.map +0 -1
  402. package/web/static/css/9763.e3a148be.chunk.css +0 -2
  403. package/web/static/css/9763.e3a148be.chunk.css.map +0 -1
  404. package/web/static/css/9776.e3a148be.chunk.css +0 -2
  405. package/web/static/css/9776.e3a148be.chunk.css.map +0 -1
  406. package/web/static/css/9777.e3a148be.chunk.css +0 -2
  407. package/web/static/css/9777.e3a148be.chunk.css.map +0 -1
  408. package/web/static/css/9853.e3a148be.chunk.css +0 -2
  409. package/web/static/css/9853.e3a148be.chunk.css.map +0 -1
  410. package/web/static/css/main.ffb4825d.css.map +0 -1
  411. package/web/static/js/1043.b6314c0a.chunk.js +0 -3
  412. package/web/static/js/1043.b6314c0a.chunk.js.map +0 -1
  413. package/web/static/js/1059.90585733.chunk.js +0 -2
  414. package/web/static/js/1061.2de80fcd.chunk.js.map +0 -1
  415. package/web/static/js/1127.687bbdbb.chunk.js +0 -2
  416. package/web/static/js/1127.687bbdbb.chunk.js.map +0 -1
  417. package/web/static/js/1169.d986f6de.chunk.js.map +0 -1
  418. package/web/static/js/1317.6d4b9297.chunk.js +0 -2
  419. package/web/static/js/1584.558ef9a8.chunk.js +0 -2
  420. package/web/static/js/1584.558ef9a8.chunk.js.map +0 -1
  421. package/web/static/js/1619.c5b10dbd.chunk.js +0 -2
  422. package/web/static/js/163.48b6d67e.chunk.js.map +0 -1
  423. package/web/static/js/1820.6430dc26.chunk.js.map +0 -1
  424. package/web/static/js/2156.d32cfe3e.chunk.js.map +0 -1
  425. package/web/static/js/2190.5a20a062.chunk.js +0 -2
  426. package/web/static/js/2190.5a20a062.chunk.js.map +0 -1
  427. package/web/static/js/221.6b5b2fe5.chunk.js.map +0 -1
  428. package/web/static/js/2316.9dec5f16.chunk.js.map +0 -1
  429. package/web/static/js/2582.7015fb11.chunk.js.map +0 -1
  430. package/web/static/js/2595.ceb152f2.chunk.js.map +0 -1
  431. package/web/static/js/3313.5999c1b9.chunk.js +0 -2
  432. package/web/static/js/3518.00703058.chunk.js +0 -2
  433. package/web/static/js/3518.00703058.chunk.js.map +0 -1
  434. package/web/static/js/3812.305ecc37.chunk.js.map +0 -1
  435. package/web/static/js/3917.ec9cb6d1.chunk.js.map +0 -1
  436. package/web/static/js/4036.7e4b2102.chunk.js +0 -2
  437. package/web/static/js/4036.7e4b2102.chunk.js.map +0 -1
  438. package/web/static/js/4098.8094389c.chunk.js +0 -2
  439. package/web/static/js/4098.8094389c.chunk.js.map +0 -1
  440. package/web/static/js/4128.61fc39cb.chunk.js.map +0 -1
  441. package/web/static/js/4188.1b69c498.chunk.js +0 -2
  442. package/web/static/js/4188.1b69c498.chunk.js.map +0 -1
  443. package/web/static/js/4503.e501a88a.chunk.js +0 -2
  444. package/web/static/js/4648.b7920b60.chunk.js +0 -2
  445. package/web/static/js/4648.b7920b60.chunk.js.map +0 -1
  446. package/web/static/js/4948.5e0e4e70.chunk.js +0 -2
  447. package/web/static/js/4948.5e0e4e70.chunk.js.map +0 -1
  448. package/web/static/js/516.4f77e6c7.js +0 -3
  449. package/web/static/js/516.4f77e6c7.js.map +0 -1
  450. package/web/static/js/5253.2285ee49.chunk.js +0 -2
  451. package/web/static/js/5253.2285ee49.chunk.js.map +0 -1
  452. package/web/static/js/5308.c2b3bc72.chunk.js.map +0 -1
  453. package/web/static/js/5393.50e4a031.chunk.js +0 -2
  454. package/web/static/js/5408.3dc527f7.chunk.js.map +0 -1
  455. package/web/static/js/5595.6d07e12f.chunk.js +0 -2
  456. package/web/static/js/5865.ca7ef99e.chunk.js.map +0 -1
  457. package/web/static/js/643.7ec13dc3.chunk.js.map +0 -1
  458. package/web/static/js/6510.911f0fb7.chunk.js +0 -2
  459. package/web/static/js/6510.911f0fb7.chunk.js.map +0 -1
  460. package/web/static/js/6715.287b1279.chunk.js.map +0 -1
  461. package/web/static/js/6730.50a27f2a.chunk.js +0 -2
  462. package/web/static/js/6730.50a27f2a.chunk.js.map +0 -1
  463. package/web/static/js/694.0bb59e65.chunk.js.map +0 -1
  464. package/web/static/js/7157.a7f5348a.chunk.js.map +0 -1
  465. package/web/static/js/7217.25bb58ee.chunk.js +0 -2
  466. package/web/static/js/7217.25bb58ee.chunk.js.map +0 -1
  467. package/web/static/js/7390.3b656003.chunk.js +0 -2
  468. package/web/static/js/7390.3b656003.chunk.js.map +0 -1
  469. package/web/static/js/748.69f720a3.chunk.js.map +0 -1
  470. package/web/static/js/7834.2f837df7.chunk.js +0 -2
  471. package/web/static/js/7875.7ea581ed.chunk.js.map +0 -1
  472. package/web/static/js/7884.169e89d6.chunk.js.map +0 -1
  473. package/web/static/js/8023.e725f7dd.chunk.js.map +0 -1
  474. package/web/static/js/8073.7479be04.chunk.js +0 -2
  475. package/web/static/js/875.64279ea7.chunk.js.map +0 -1
  476. package/web/static/js/9121.efc0e8ad.chunk.js.map +0 -1
  477. package/web/static/js/9137.2ff84339.chunk.js +0 -2
  478. package/web/static/js/9137.2ff84339.chunk.js.map +0 -1
  479. package/web/static/js/9200.2bc62823.chunk.js.map +0 -1
  480. package/web/static/js/9253.c8a3645c.chunk.js.map +0 -1
  481. package/web/static/js/9260.06d0bd83.chunk.js.map +0 -1
  482. package/web/static/js/9384.8e822042.chunk.js.map +0 -1
  483. package/web/static/js/9503.cce5eb44.chunk.js +0 -2
  484. package/web/static/js/9503.cce5eb44.chunk.js.map +0 -1
  485. package/web/static/js/9763.2df38ebb.chunk.js +0 -2
  486. package/web/static/js/9763.2df38ebb.chunk.js.map +0 -1
  487. package/web/static/js/9776.e9c3b31c.chunk.js.map +0 -1
  488. package/web/static/js/9777.90dbd095.chunk.js.map +0 -1
  489. package/web/static/js/9853.1d38659a.chunk.js +0 -2
  490. package/web/static/js/9853.1d38659a.chunk.js.map +0 -1
  491. package/web/static/js/main.657865d8.js +0 -2
  492. package/web/static/js/main.657865d8.js.map +0 -1
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6566],{36566:function(n,e,t){t.r(e),e.default="Form \u8868\u5355\n===\n\n\u7531\u8f93\u5165\u6846\u3001\u9009\u62e9\u5668\u3001\u5355\u9009\u6846\u3001\u591a\u9009\u6846\u7b49\u63a7\u4ef6\u7ec4\u6210\uff0c\u7528\u4ee5\u6536\u96c6\u3001\u6821\u9a8c\u3001\u63d0\u4ea4\u6570\u636e\u3002\n\n```jsx\nimport { Form, FormItem } from 'uiw';\n// or\nimport { Form, FormItem } from '@uiw/react-form';\n```\n\n### \u57fa\u672c\u7528\u6cd5\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true--\x3e\n```jsx\nimport ReactDOM from 'react-dom';\nimport { Form, Input, Row, Col, Slider, Button, Notify } from 'uiw';\n\nconst Demo = () => (\n <div>\n <Form\n onChange={({ initial, current }) => {\n console.log('onChange', initial, current);\n }}\n onSubmit={({initial, current}) => {\n if(current.name === initial.name) {\n Notify.error({\n title: '\u63d0\u4ea4\u5931\u8d25\uff01',\n description: `\u8868\u5355\u63d0\u4ea4\u5185\u5bb9\u4e3a\u7a7a\uff01`,\n });\n } else {\n Notify.success({\n title: '\u63d0\u4ea4\u6210\u529f\uff01',\n description: `\u59d3\u540d\u4e3a\uff1a${current.name}\uff0c\u63d0\u4ea4\u5b8c\u6210\uff0c\u5c06\u81ea\u52a8\u586b\u5145\u521d\u59cb\u5316\u503c\uff01`,\n });\n }\n }}\n fields={{\n name: {\n label: '\u59d3\u540d',\n children: <Input placeholder=\"\u8bf7\u8f93\u5165\u59d3\u540d\" />\n },\n }}\n >\n {({ fields, state, canSubmit }) => {\n return (\n <div>\n <Row>\n <Col style={{ maxWidth: 300 }}>{fields.name}</Col>\n </Row>\n <Row>\n <Col>\n <Button disabled={!canSubmit()} type=\"primary\" htmlType=\"submit\">\u63d0\u4ea4</Button>\n </Col>\n </Row>\n <Row>\n <Col>\n {JSON.stringify(state.current)}\n </Col>\n </Row>\n </div>\n )\n }}\n </Form>\n </div>\n)\nReactDOM.render(<Demo />, _mount_);\n```\n\n### \u81ea\u5b9a\u4e49\u6821\u9a8c\n\n\u4e00\u822c\u6821\u9a8c\u53ef\u4e0d\u9700\u5f15\u5165\u5916\u90e8\u5305\u89e3\u51b3\uff0c\u5982\u679c\u9047\u5230\u5927\u578b\u5de5\u7a0b\u8868\u5355\u6bd4\u8f83\u591a\u7684\u5730\u65b9\u63a8\u8350\u4f7f\u7528 [jquense/yup](https://github.com/jquense/yup)\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true--\x3e\n```jsx\nimport ReactDOM from 'react-dom';\nimport { Form, Input, Notify, Checkbox, Switch, RadioGroup, Radio, Textarea, Row, Col, Button } from 'uiw';\n\nconst Demo = () => (\n <Form\n onSubmit={({initial, current}) => {\n const errorObj = {};\n if (current.userName.startsWith('u')) {\n errorObj.userName = `\u59d3\u540d ${current.userName} \u4e0d\u80fd\u4ee5 \u2018u\u2019 \u5f00\u5934`;\n }\n if (!current.checkboxOne) {\n errorObj.checkboxOne = '\u4e00\u4e2a\u591a\u9009\u6761\u4ef6 \u4e3a\u5fc5\u586b';\n }\n if (!current.terms) {\n errorObj.terms = '\u5fc5\u987b\u7edf\u4e00\u670d\u52a1\u6761\u6b3e';\n }\n if(Object.keys(errorObj).length > 0) {\n const err = new Error();\n err.filed = errorObj;\n throw err;\n }\n Notify.success({\n title: '\u63d0\u4ea4\u6210\u529f\uff01',\n description: `\u59d3\u540d\u4e3a\uff1a${current.userName}\uff0c\u63d0\u4ea4\u5b8c\u6210\uff0c\u5c06\u81ea\u52a8\u586b\u5145\u521d\u59cb\u5316\u503c\uff01`,\n });\n }}\n onSubmitError={(error) => {\n if (error.filed) {\n return { ...error.filed };\n }\n return null;\n }}\n fields={{\n userName: {\n initialValue: 'uiw',\n label: '\u59d3\u540d',\n children: <Input type=\"text\" />,\n help: '\u4ee5\u201cu\u201d\u5f00\u5934\u7684\u540d\u5b57\u5c06\u5728\u6b64\u5904\u663e\u793a\u9519\u8bef\u4fe1\u606f'\n },\n age: {\n initialValue: '9',\n label: '\u5e74\u9f84',\n children: <Input type=\"number\" />\n },\n checkbox: {\n initialValue: ['\u56db\u5ddd\u83dc'],\n label: '\u9009\u62e9\u4f60\u60f3\u5403\u7684\u83dc',\n children: (\n <Checkbox.Group>\n <div>\u83dc\u7cfb</div>\n <Checkbox value=\"\u56db\u5ddd\u83dc\">\u56db\u5ddd\u83dc</Checkbox>\n <Checkbox value=\"\u6e56\u5317\u83dc\">\u6e56\u5317\u83dc</Checkbox>\n <Checkbox value=\"\u897f\u5317\u83dc\">\u897f\u5317\u83dc</Checkbox>\n <Checkbox value=\"\u65b0\u7586\u83dc\">\u65b0\u7586\u83dc</Checkbox>\n <Checkbox value=\"\u4e1c\u5317\u83dc\">\u4e1c\u5317\u83dc</Checkbox>\n <div style={{ marginTop: 10 }}>\u5bb6\u5e38\u83dc</div>\n <Checkbox value=\"\u7ea2\u70e7\u6b66\u660c\u9c7c\">\u7ea2\u70e7\u6b66\u660c\u9c7c</Checkbox>\n <Checkbox value=\"\u9ebb\u5a46\u8c46\u8150\">\u9ebb\u5a46\u8c46\u8150</Checkbox>\n <Checkbox value=\"\u5317\u4eac\u70e4\u9e2d\">\u5317\u4eac\u70e4\u9e2d</Checkbox>\n </Checkbox.Group>\n )\n },\n checkboxOne: {\n inline: true,\n label: '\u4e00\u4e2a\u591a\u9009\u6761\u4ef6',\n children: <Checkbox value=\"1\">\u56db\u5ddd\u83dc</Checkbox>\n },\n switch: {\n inline: true,\n initialValue: true,\n label: '\u5f00\u542f',\n children: <Switch size=\"small\" />\n },\n radioGroup: {\n inline: true,\n initialValue: '\u7537',\n label: '\u5355\u9009',\n children: (\n <RadioGroup name=\"other\">\n <Radio value=\"\u7537\">\u7537</Radio>\n <Radio value=\"\u5973\">\u5973</Radio>\n <Radio value=\"\u4eba\u5996\" disabled>\u4eba\u5996</Radio>\n <Radio value=\"\u672a\u77e5\">\u672a\u77e5</Radio>\n </RadioGroup>\n )\n },\n textarea: {\n initialValue: '',\n label: '\u591a\u884c\u6587\u672c\u8f93\u5165\u6846',\n children: <Textarea placeholder=\"\u8bf7\u8f93\u5165\u5185\u5bb9\" />\n },\n terms: {\n validator: (currentValue) => {\n return !currentValue ? '\u5fc5\u987b\u7edf\u4e00\u670d\u52a1\u6761\u6b3e' : null;\n },\n style: { marginBottom: 0 },\n children: <Checkbox value=\"1\">\u5df2\u9605\u8bfb\u5e76\u540c\u610f<a href=\"#\">\u670d\u52a1\u6761\u6b3e</a></Checkbox>\n }\n }}\n >\n {({ fields, state, canSubmit, resetForm }) => {\n console.log('fields:--\x3e', state);\n return (\n <div style={{ maxWidth: 500 }}>\n <Row gutter={10}>\n <Col>{fields.userName}</Col>\n <Col>{fields.age}</Col>\n </Row>\n <Row gutter={10}>\n <Col>{fields.checkbox}</Col>\n <Col>{fields.checkboxOne}</Col>\n </Row>\n <Row gutter={10}>\n <Col>{fields.radioGroup}</Col>\n </Row>\n <Row gutter={10}>\n <Col>{fields.switch}</Col>\n </Row>\n <Row gutter={10}>\n <Col>{fields.textarea}</Col>\n </Row>\n <Row gutter={10}>\n <Col style={{ padding: '5px 0 10px 0' }}>\n {fields.terms}\n </Col>\n </Row>\n <Row gutter={10}>\n <Col fixed>\n <Button disabled={!canSubmit()} type=\"primary\" htmlType=\"submit\">\u63d0\u4ea4</Button>\n <Button type=\"light\" onClick={resetForm}>\u91cd\u7f6e\u8868\u5355</Button>\n </Col>\n </Row>\n <Row>\n <Col>\n <pre style={{ padding: '10px 0 0 10px' }}>\n {JSON.stringify(state.current, null, 2)}\n </pre>\n </Col>\n </Row>\n </div>\n )\n }}\n </Form>\n)\nReactDOM.render(<Demo />, _mount_);\n```\n\n### \u6c34\u5e73\u767b\u5f55\u680f\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true--\x3e\n```jsx\nimport ReactDOM from 'react-dom';\nimport { Form, Input, Row, Col, Notify, Button } from 'uiw';\n\nconst Demo = () => (\n <div>\n <Form\n onSubmit={({initial, current}) => {\n const errorObj = {};\n if (!current.username) {\n errorObj.username = '\u7528\u6237\u540d\u4e0d\u80fd\u4e3a\u7a7a\uff01';\n }\n if (!current.password) {\n errorObj.password = '\u5bc6\u7801\u4e0d\u80fd\u4e3a\u7a7a\uff01';\n }\n if(Object.keys(errorObj).length > 0) {\n const err = new Error();\n err.filed = errorObj;\n Notify.error({ title: '\u63d0\u4ea4\u5931\u8d25\uff01', description: '\u8bf7\u786e\u8ba4\u63d0\u4ea4\u8868\u5355\u662f\u5426\u6b63\u786e\uff01' });\n throw err;\n }\n console.log('--\x3e>', initial, current);\n Notify.success({ title: '\u63d0\u4ea4\u6210\u529f\uff01', description: '\u606d\u559c\u4f60\u767b\u5f55\u6210\u529f\uff01' });\n }}\n onSubmitError={(error) => {\n if (error.filed) {\n return { ...error.filed };\n }\n return null;\n }}\n fields={{\n username: {\n labelClassName: 'fieldLabel',\n labelFor: 'username-inline',\n children: <Input preIcon=\"user\" id=\"username-inline\" />\n },\n password: {\n labelClassName: 'fieldLabel',\n labelFor: 'password-inline',\n children: <Input preIcon=\"lock\" id=\"password-inline\" type=\"password\" />\n },\n }}\n >\n {({ fields, state, canSubmit, resetForm }) => {\n console.log('fields:', state);\n return (\n <div>\n <Row gutter={10}>\n <Col fixed>{fields.username}</Col>\n <Col fixed>{fields.password}</Col>\n </Row>\n <Row gutter={10}>\n <Col>\n <Button disabled={!canSubmit()} type=\"primary\" htmlType=\"submit\">\u63d0\u4ea4</Button>\n <Button type=\"danger\" onClick={resetForm}>\u91cd\u7f6e\u8868\u5355</Button>\n </Col>\n </Row>\n </div>\n )\n }}\n </Form>\n </div>\n);\nReactDOM.render(<Demo />, _mount_);\n```\n\n## \u767b\u5f55\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true--\x3e\n```jsx\nimport ReactDOM from 'react-dom';\nimport { Form, Input, Row, Col, Checkbox, Notify, Button } from 'uiw';\n\nconst Demo = () => (\n <div>\n <Form\n onSubmit={({initial, current}) => {\n console.log('--\x3e>', initial, current);\n }}\n fields={{\n username: {\n labelClassName: 'fieldLabel',\n labelStyle: { width: 60 },\n labelFor: 'username',\n children: <Input preIcon=\"user\" id=\"username\" />\n },\n password: {\n labelClassName: 'fieldLabel',\n labelStyle: { width: 60 },\n labelFor: 'password',\n children: <Input preIcon=\"lock\" id=\"password\" type=\"password\" />\n },\n terms: {\n validator: (currentValue) => !currentValue ? '\u5fc5\u987b\u7edf\u4e00\u670d\u52a1\u6761\u6b3e' : null,\n children: <Checkbox value=\"1\">\u5df2\u9605\u8bfb\u5e76\u540c\u610f</Checkbox>\n }\n }}\n >\n {({ fields, state, canSubmit }) => {\n console.log('fields:', state);\n return (\n <div>\n <Row>\n <Col fixed>{fields.username}</Col>\n </Row>\n <Row>\n <Col fixed>{fields.password}</Col>\n </Row>\n <Row>\n <Col fixed align=\"middle\">{fields.terms}</Col>\n <Col fixed style={{ marginTop: -4 }}><a href=\"#\">\u670d\u52a1\u6761\u6b3e</a></Col>\n </Row>\n <Row>\n <Col fixed>\n <Button disabled={!canSubmit()} type=\"primary\" htmlType=\"submit\">\u63d0\u4ea4</Button>\n </Col>\n </Row>\n </div>\n )\n }}\n </Form>\n </div>\n)\nReactDOM.render(<Demo />, _mount_);\n```\n\n### \u8868\u5355\u63d0\u4ea4\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true--\x3e\n```jsx\nimport ReactDOM from 'react-dom';\nimport { Form, Input, Select, Row, Col, Button } from 'uiw';\n\nconst Demo = () => (\n <div>\n <Form\n onSubmit={({initial, current}) => {\n console.log('--\x3e>', initial, current);\n }}\n fields={{\n firstName: {\n labelClassName: 'fieldLabel',\n labelStyle: { width: 60 },\n inline: true,\n label: '\u59d3\u6c0f',\n children: <Input />\n },\n lastName: {\n labelClassName: 'fieldLabel',\n labelStyle: { width: 60 },\n initialValue: '\u5148\u751f',\n inline: true,\n label: '\u540d\u5b57',\n children: <Input />\n },\n email: {\n labelClassName: 'fieldLabel',\n labelStyle: { width: 60 },\n validator: (currentValue) => {\n return currentValue && currentValue.length < 2 ? 'Password must be 8+ characters' : null;\n },\n inline: true,\n label: 'Email',\n children: <Input />\n },\n select: {\n labelClassName: 'fieldLabel',\n labelStyle: { width: 60 },\n inline: true,\n label: '\u9009\u62e9\u5668',\n children: (\n <Select>\n <Select.Option>Choose an item...</Select.Option>\n <Select.Option value=\"1\">One</Select.Option>\n <Select.Option value=\"2\">Two</Select.Option>\n <Select.Option value=\"3\">Three</Select.Option>\n <Select.Option value=\"4\">Four</Select.Option>\n </Select>\n ),\n },\n }}\n >\n {({ fields, state, canSubmit }) => {\n console.log('fields:', state);\n return (\n <div>\n <Row gutter={10} style={{ marginBottom: 10 }}>\n <Col>{fields.firstName}</Col>\n <Col>{fields.lastName}</Col>\n </Row>\n <Row gutter={10}>\n <Col>{fields.email}</Col>\n <Col>{fields.select}</Col>\n </Row>\n <Row gutter={10}>\n <Col />\n <Col fixed align=\"bottom\"><Button disabled={!canSubmit()} type=\"primary\" htmlType=\"submit\">\u63d0\u4ea4</Button></Col>\n </Row>\n </div>\n )\n }}\n </Form>\n </div>\n)\nReactDOM.render(<Demo />, _mount_);\n```\n\n\n### \u81ea\u5b9a\u4e49\u63a7\u4ef6\u5e94\u7528\n\n\u4e0b\u9762\u5b9e\u4f8b\u662f\u5728 [`<Form />`](#/components/form) \u8868\u5355\u7ec4\u4ef6\u4e2d\uff0c\u5e94\u7528\u81ea\u5b9a\u4e49 `<CustomSelect />` \u63a7\u4ef6\u7ec4\u4ef6\u3002\n\n> \u26a0\ufe0f \u6ce8\u610f\uff0c\u81ea\u5b9a\u4e49\u63a7\u4ef6\u9700\u8981\u4e24\u4e2a\u5fc5\u8981\u7684 `props` \u53c2\u6570\uff0c`value` \u548c `onChange`\n\x3c!--rehype:style=border-left: 8px solid #ffe564;background-color: #ffe56440;padding: 12px 16px;--\x3e\n\n- `value` \u7528\u4e8e\u503c\u4f20\u9012\uff0c\n- `onChange(value)` \u7528\u4e8e\u503c\u53d8\u66f4\u9700\u8981\u6267\u884c\u7684\u56de\u8c03\u51fd\u6570\uff0c\u56de\u8c03\u51fd\u6570\u7b2c\u4e00\u4e2a\u53c2\u6570\u5fc5\u987b\u662f `value`\u3002\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true--\x3e\n```jsx\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport { Form, Row, Col, Dropdown, Menu, Icon, Button, Notify } from 'uiw';\n\n// \u81ea\u5b9a\u4e49\u7ec4\u4ef6\nfunction CustomSelect(props) {\n const { option = [], onChange } = props;\n const [value, setValue] = React.useState(props.value);\n const [isOpen, setIsOpen] = React.useState(false);\n\n React.useEffect(() => {\n if (value !== props.value) {\n setValue(props.value);\n }\n }, [props.value]);\n const label = option.find(item => value === item.value);\n return (\n <Dropdown\n trigger=\"click\"\n onVisibleChange={(open) => setIsOpen(open)}\n isOpen={isOpen}\n menu={\n <Menu bordered style={{ minWidth: 120 }}>\n {option.map((item, idx) => (\n <Menu.Item active={value === item.value} key={idx} text={item.label}\n onClick={() => {\n setValue(item.value);\n setIsOpen(false)\n onChange && onChange(item.value);\n }}\n />\n ))}\n </Menu>\n }\n >\n <Button\n style={{\n boxShadow: 'inset 0 0 0 1px rgba(16, 22, 26, 0.2), inset 0 -1px 0 rgba(16, 22, 26, 0.1)'\n }}\n type=\"link\"\n >\n {label.label}<Icon type={isOpen ? 'up' : 'down'} />\n </Button>\n </Dropdown>\n );\n}\n\n// \u81ea\u5b9a\u4e49\u7ec4\u4ef6\u5e94\u7528\u5b9e\u4f8b\nconst Demo = () => (\n <div>\n <Form\n onSubmitError={(error) => {\n if (error.filed) {\n return { ...error.filed };\n }\n return null;\n }}\n onSubmit={({initial, current}) => {\n console.log('~~~', current);\n const errorObj = {};\n if (!current.select) {\n errorObj.select = '\u5185\u5bb9\u4e3a\u7a7a\uff0c\u8bf7\u8f93\u5165\u5185\u5bb9';\n }\n if(Object.keys(errorObj).length > 0) {\n const err = new Error();\n err.filed = errorObj;\n Notify.error({ title: '\u63d0\u4ea4\u5931\u8d25\uff01', description: '\u8bf7\u786e\u8ba4\u63d0\u4ea4\u8868\u5355\u662f\u5426\u6b63\u786e\uff01' });\n throw err;\n }\n Notify.success({\n title: '\u63d0\u4ea4\u6210\u529f\uff01',\n description: `\u8868\u5355\u63d0\u4ea4\u6210\u529f\uff0c\u5185\u5bb9\u4e3a\uff1a${current.select}\uff0c\u5c06\u81ea\u52a8\u586b\u5145\u521d\u59cb\u5316\u503c\uff01`,\n });\n }}\n fields={{\n select: {\n initialValue: 0,\n children: (\n <CustomSelect option={[\n { label: '\u8bf7\u9009\u62e9', value: 0 },\n { label: '\u7ecf\u6d4e\u8231', value: 1 },\n { label: '\u8c6a\u534e\u7ecf\u6d4e\u8231', value: 2 },\n { label: '\u5546\u52a1\u8231', value: 3 },\n { label: '\u5934\u7b49\u8231', value: 4 },\n ]} />\n )\n },\n }}\n >\n {({ fields, state, canSubmit }) => {\n return (\n <div>\n <Row>\n <Col style={{ maxWidth: 300 }}>{fields.select}</Col>\n </Row>\n <Row>\n <Col fixed>\n <Button disabled={!canSubmit()} type=\"primary\" htmlType=\"submit\">\u63d0\u4ea4</Button>\n </Col>\n </Row>\n </div>\n )\n }}\n </Form>\n </div>\n)\nReactDOM.render(<Demo />, _mount_);\n```\n\n### FormItem \u7ad6\u6392\n\n\u5bf9\u7ec4\u4ef6 `FormItem` \u7ad6\u6392\u5c55\u793a\u793a\u4f8b\u3002\n\n> \u26a0\ufe0f \u6ce8\u610f\uff1a\u5f53\u524d\u53ea\u5c55\u793a\u6548\u679c\uff0c`FormItem` \u7ec4\u4ef6\u53ea\u5728 `Form` \u7ec4\u4ef6\u4e2d\u4f7f\u7528\u3002\n\x3c!--rehype:style=border-left: 8px solid #ffe564;background-color: #ffe56440;padding: 12px 16px;--\x3e\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true--\x3e\n```jsx\nimport ReactDOM from 'react-dom';\nimport { Form, FormItem } from 'uiw';\n\nconst Demo = () => (\n <Form>\n <FormItem\n label=\"\u53ef\u9009\u5b57\u6bb5\"\n labelFor=\"basic-input\"\n help={<span>\u5728\u4e0a\u9762\u7684\u5b57\u6bb5\u4e2d\u8f93\u5165\u4e00\u4e2a\u503c</span>}\n >\n <Input id=\"basic-input\" type=\"text\"/>\n </FormItem>\n <FormItem\n label=\"\u7528\u6237\u540d\"\n labelFor=\"username-input\"\n help=\"\u7528\u6237\u540d\u957f\u5ea6\u81f3\u5c11\u4e3a8\u4e2a\u5b57\u7b26\u4e32\u3002\"\n hasError={true}\n >\n <Input id=\"username-input\" type=\"text\"/>\n </FormItem>\n </Form>\n)\nReactDOM.render(<Demo />, _mount_);\n```\n\n### FormItem \u6a2a\u6392\n\n\u5bf9\u7ec4\u4ef6 `FormItem` \u6a2a\u6392\u5c55\u793a\u793a\u4f8b\u3002\n\n> \u26a0\ufe0f \u6ce8\u610f\uff1a\u5f53\u524d\u53ea\u5c55\u793a\u6548\u679c\uff0c`FormItem` \u7ec4\u4ef6\u53ea\u5728 `Form` \u7ec4\u4ef6\u4e2d\u4f7f\u7528\u3002\n\x3c!--rehype:style=border-left: 8px solid #ffe564;background-color: #ffe56440;padding: 12px 16px;--\x3e\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true--\x3e\n```jsx\nimport ReactDOM from 'react-dom';\nimport { Form, FormItem } from 'uiw';\n\nconst Demo = () => (\n <Form>\n <FormItem\n inline={true}\n label=\"\u53ef\u9009\u5b57\u6bb5\"\n labelFor=\"basic-input-inline\"\n help={<span>\u5728\u4e0a\u9762\u7684\u5b57\u6bb5\u4e2d\u8f93\u5165\u4e00\u4e2a\u503c</span>}\n onChange={() => {\n console.log('TEST::');\n }}\n >\n <Input id=\"basic-input-inline\" type=\"text\"/>\n </FormItem>\n <FormItem\n inline={true}\n label=\"\u7528\u6237\u540d\"\n labelFor=\"username-input-inline\"\n labelClassName=\"username\"\n help=\"\u7528\u6237\u540d\u957f\u5ea6\u81f3\u5c11\u4e3a8\u4e2a\u5b57\u7b26\u4e32\u3002\"\n hasError={true}\n >\n <Input id=\"username-input-inline\" type=\"text\"/>\n </FormItem>\n </Form>\n)\nReactDOM.render(<Demo />, _mount_);\n```\n\n## Form\n\n| \u53c2\u6570 | \u8bf4\u660e | \u7c7b\u578b | \u9ed8\u8ba4\u503c |\n|--------- |-------- |--------- |-------- |\n| fields | \u8bbe\u7f6e\u5b57\u6bb5 | object | - |\n| children | \u56de\u8c03 {`fields`, `state`, `canSubmit`, `resetForm`} | function | - |\n| onSubmit | \u5728 `onSubmit` \u4e4b\u540e\u6267\u884c | function({ initial, current }) | - |\n| afterSubmit `@3.0.0+` | \u63d0\u4ea4\u56de\u8c03 {`initial`, `current`} | function({ initial, current }) | - |\n| onChange | \u8868\u5355\u53d1\u751f\u6539\u53d8\u56de\u8c03\u51fd\u6570 {`initial`, `current`} | function({ initial, current }) | - |\n| onSubmitError | \u8c03\u7528 `onSubmit` \u629b\u51fa\u7684\u4efb\u4f55\u9519\u8bef\u3002\u4ece\u5b57\u6bb5\u540d\u79f0\u8fd4\u56de\u5bf9\u8c61\u6620\u5c04\u3002 | function | - |\n| resetOnSubmit | \u5728 `onSubmit` \u6210\u529f\u540e\u5c06\u8868\u5355\u91cd\u7f6e\u4e3a\u5176\u521d\u59cb\u72b6\u6001\u3002| bool | `true` |\n\n```js\n// => fields props\n{\n firstName: {\n initialValue: '\u738b',\n inline: true,\n label: '\u59d3',\n labelClassName: 'fieldLabel',\n labelStyle: { width: 60 },\n // \u9a8c\u8bc1\uff0c\u901a\u8fc7 `canSubmit()` \u65b9\u6cd5\u83b7\u5f97\uff0c\u63d0\u4ea4\u6309\u94ae\u662f\u5426\u88ab\u7981\u7528\n validator: (currentValue) => {},\n help: '\u5e2e\u52a9\u63d0\u793a\u4fe1\u606f\uff01',\n children: <Input type=\"number\" />\n },\n}\n```\n\n## FormItem\n\n| \u53c2\u6570 | \u8bf4\u660e | \u7c7b\u578b | \u9ed8\u8ba4\u503c |\n|--------- |-------- |--------- |-------- |\n| label | \u8868\u5355\u6807\u9898\u5c55\u793a | string | - |\n| labelClassName | \u8868\u5355\u6807\u9898\u6837\u5f0f\u540d\u79f0 | string | - |\n| labelStyle | \u8868\u5355\u6807\u9898\u6837\u5f0f | object | - |\n| labelFor | \u5217\u7684\u5bbd\u5ea6\u76f8\u5bf9\u4e8e\u540c\u4e00\u7f51\u683c\u4e2d\u5176\u4ed6\u5217\u7684\u6bd4\u7387 | number | - |\n| help | \u63d0\u793a\u4fe1\u606f | ReactNode | - |\n| hasError | \u5982\u679c\u4e3atrue\uff0c\u5219\u5e94\u7528\u9519\u8befCSS\u3002\u8f6c\u52a8\u8fb9\u6846\u5e76\u5e2e\u52a9\u6587\u5b57\u53d8\u7ea2\u3002 | number | - |"}}]);
2
- //# sourceMappingURL=6566.75acebe9.chunk.js.map
1
+ "use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6566],{36566:function(n,e,t){t.r(e),e.default="Form \u8868\u5355\n===\n\n\u7531\u8f93\u5165\u6846\u3001\u9009\u62e9\u5668\u3001\u5355\u9009\u6846\u3001\u591a\u9009\u6846\u7b49\u63a7\u4ef6\u7ec4\u6210\uff0c\u7528\u4ee5\u6536\u96c6\u3001\u6821\u9a8c\u3001\u63d0\u4ea4\u6570\u636e\u3002\n\n```jsx\nimport { Form, FormItem } from 'uiw';\n// or\nimport { Form, FormItem } from '@uiw/react-form';\n```\n\n### \u57fa\u672c\u7528\u6cd5\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true--\x3e\n```jsx\nimport ReactDOM from 'react-dom';\nimport { Form, Input, Row, Col, Slider, Button, Notify } from 'uiw';\n\nconst Demo = () => (\n <div>\n <Form\n onChange={({ initial, current }) => {\n console.log('onChange', initial, current);\n }}\n onSubmit={({initial, current}) => {\n if(current.name === initial.name) {\n Notify.error({\n title: '\u63d0\u4ea4\u5931\u8d25\uff01',\n description: `\u8868\u5355\u63d0\u4ea4\u5185\u5bb9\u4e3a\u7a7a\uff01`,\n });\n } else {\n Notify.success({\n title: '\u63d0\u4ea4\u6210\u529f\uff01',\n description: `\u59d3\u540d\u4e3a\uff1a${current.name}\uff0c\u63d0\u4ea4\u5b8c\u6210\uff0c\u5c06\u81ea\u52a8\u586b\u5145\u521d\u59cb\u5316\u503c\uff01`,\n });\n }\n }}\n fields={{\n name: {\n label: '\u59d3\u540d',\n children: <Input placeholder=\"\u8bf7\u8f93\u5165\u59d3\u540d\" />\n },\n }}\n >\n {({ fields, state, canSubmit }) => {\n return (\n <div>\n <Row>\n <Col style={{ maxWidth: 300 }}>{fields.name}</Col>\n </Row>\n <Row>\n <Col>\n <Button disabled={!canSubmit()} type=\"primary\" htmlType=\"submit\">\u63d0\u4ea4</Button>\n </Col>\n </Row>\n <Row>\n <Col>\n {JSON.stringify(state.current)}\n </Col>\n </Row>\n </div>\n )\n }}\n </Form>\n </div>\n)\nReactDOM.render(<Demo />, _mount_);\n```\n\n### \u81ea\u5b9a\u4e49\u6821\u9a8c\n\n\u4e00\u822c\u6821\u9a8c\u53ef\u4e0d\u9700\u5f15\u5165\u5916\u90e8\u5305\u89e3\u51b3\uff0c\u5982\u679c\u9047\u5230\u5927\u578b\u5de5\u7a0b\u8868\u5355\u6bd4\u8f83\u591a\u7684\u5730\u65b9\u63a8\u8350\u4f7f\u7528 [jquense/yup](https://github.com/jquense/yup)\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true--\x3e\n```jsx\nimport ReactDOM from 'react-dom';\nimport { Form, Input, Notify, Checkbox, Switch, RadioGroup, Radio, Textarea, Row, Col, Button } from 'uiw';\n\nconst Demo = () => (\n <Form\n onSubmit={({initial, current}) => {\n const errorObj = {};\n if (current.userName.startsWith('u')) {\n errorObj.userName = `\u59d3\u540d ${current.userName} \u4e0d\u80fd\u4ee5 \u2018u\u2019 \u5f00\u5934`;\n }\n if (!current.checkboxOne) {\n errorObj.checkboxOne = '\u4e00\u4e2a\u591a\u9009\u6761\u4ef6 \u4e3a\u5fc5\u586b';\n }\n if (!current.terms) {\n errorObj.terms = '\u5fc5\u987b\u7edf\u4e00\u670d\u52a1\u6761\u6b3e';\n }\n if(Object.keys(errorObj).length > 0) {\n const err = new Error();\n err.filed = errorObj;\n throw err;\n }\n Notify.success({\n title: '\u63d0\u4ea4\u6210\u529f\uff01',\n description: `\u59d3\u540d\u4e3a\uff1a${current.userName}\uff0c\u63d0\u4ea4\u5b8c\u6210\uff0c\u5c06\u81ea\u52a8\u586b\u5145\u521d\u59cb\u5316\u503c\uff01`,\n });\n }}\n onSubmitError={(error) => {\n if (error.filed) {\n return { ...error.filed };\n }\n return null;\n }}\n fields={{\n userName: {\n initialValue: 'uiw',\n label: '\u59d3\u540d',\n children: <Input type=\"text\" />,\n help: '\u4ee5\u201cu\u201d\u5f00\u5934\u7684\u540d\u5b57\u5c06\u5728\u6b64\u5904\u663e\u793a\u9519\u8bef\u4fe1\u606f'\n },\n age: {\n initialValue: '9',\n label: '\u5e74\u9f84',\n children: <Input type=\"number\" />\n },\n checkbox: {\n initialValue: ['\u56db\u5ddd\u83dc'],\n label: '\u9009\u62e9\u4f60\u60f3\u5403\u7684\u83dc',\n children: (\n <Checkbox.Group>\n <div>\u83dc\u7cfb</div>\n <Checkbox value=\"\u56db\u5ddd\u83dc\">\u56db\u5ddd\u83dc</Checkbox>\n <Checkbox value=\"\u6e56\u5317\u83dc\">\u6e56\u5317\u83dc</Checkbox>\n <Checkbox value=\"\u897f\u5317\u83dc\">\u897f\u5317\u83dc</Checkbox>\n <Checkbox value=\"\u65b0\u7586\u83dc\">\u65b0\u7586\u83dc</Checkbox>\n <Checkbox value=\"\u4e1c\u5317\u83dc\">\u4e1c\u5317\u83dc</Checkbox>\n <div style={{ marginTop: 10 }}>\u5bb6\u5e38\u83dc</div>\n <Checkbox value=\"\u7ea2\u70e7\u6b66\u660c\u9c7c\">\u7ea2\u70e7\u6b66\u660c\u9c7c</Checkbox>\n <Checkbox value=\"\u9ebb\u5a46\u8c46\u8150\">\u9ebb\u5a46\u8c46\u8150</Checkbox>\n <Checkbox value=\"\u5317\u4eac\u70e4\u9e2d\">\u5317\u4eac\u70e4\u9e2d</Checkbox>\n </Checkbox.Group>\n )\n },\n checkboxOne: {\n inline: true,\n label: '\u4e00\u4e2a\u591a\u9009\u6761\u4ef6',\n children: <Checkbox value=\"1\">\u56db\u5ddd\u83dc</Checkbox>\n },\n switch: {\n inline: true,\n initialValue: true,\n label: '\u5f00\u542f',\n children: <Switch size=\"small\" />\n },\n radioGroup: {\n inline: true,\n initialValue: '\u7537',\n label: '\u5355\u9009',\n children: (\n <RadioGroup name=\"other\">\n <Radio value=\"\u7537\">\u7537</Radio>\n <Radio value=\"\u5973\">\u5973</Radio>\n <Radio value=\"\u4eba\u5996\" disabled>\u4eba\u5996</Radio>\n <Radio value=\"\u672a\u77e5\">\u672a\u77e5</Radio>\n </RadioGroup>\n )\n },\n textarea: {\n initialValue: '',\n label: '\u591a\u884c\u6587\u672c\u8f93\u5165\u6846',\n children: <Textarea placeholder=\"\u8bf7\u8f93\u5165\u5185\u5bb9\" />\n },\n terms: {\n validator: (currentValue) => {\n return !currentValue ? '\u5fc5\u987b\u7edf\u4e00\u670d\u52a1\u6761\u6b3e' : null;\n },\n style: { marginBottom: 0 },\n children: <Checkbox value=\"1\">\u5df2\u9605\u8bfb\u5e76\u540c\u610f<a href=\"#\">\u670d\u52a1\u6761\u6b3e</a></Checkbox>\n }\n }}\n >\n {({ fields, state, canSubmit, resetForm }) => {\n console.log('fields:--\x3e', state);\n return (\n <div style={{ maxWidth: 500 }}>\n <Row gutter={10}>\n <Col>{fields.userName}</Col>\n <Col>{fields.age}</Col>\n </Row>\n <Row gutter={10}>\n <Col>{fields.checkbox}</Col>\n <Col>{fields.checkboxOne}</Col>\n </Row>\n <Row gutter={10}>\n <Col>{fields.radioGroup}</Col>\n </Row>\n <Row gutter={10}>\n <Col>{fields.switch}</Col>\n </Row>\n <Row gutter={10}>\n <Col>{fields.textarea}</Col>\n </Row>\n <Row gutter={10}>\n <Col style={{ padding: '5px 0 10px 0' }}>\n {fields.terms}\n </Col>\n </Row>\n <Row gutter={10}>\n <Col fixed>\n <Button disabled={!canSubmit()} type=\"primary\" htmlType=\"submit\">\u63d0\u4ea4</Button>\n <Button type=\"light\" onClick={resetForm}>\u91cd\u7f6e\u8868\u5355</Button>\n </Col>\n </Row>\n <Row>\n <Col>\n <pre style={{ padding: '10px 0 0 10px' }}>\n {JSON.stringify(state.current, null, 2)}\n </pre>\n </Col>\n </Row>\n </div>\n )\n }}\n </Form>\n)\nReactDOM.render(<Demo />, _mount_);\n```\n\n### \u6c34\u5e73\u767b\u5f55\u680f\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true--\x3e\n```jsx\nimport ReactDOM from 'react-dom';\nimport { Form, Input, Row, Col, Notify, Button } from 'uiw';\n\nconst Demo = () => (\n <div>\n <Form\n onSubmit={({initial, current}) => {\n const errorObj = {};\n if (!current.username) {\n errorObj.username = '\u7528\u6237\u540d\u4e0d\u80fd\u4e3a\u7a7a\uff01';\n }\n if (!current.password) {\n errorObj.password = '\u5bc6\u7801\u4e0d\u80fd\u4e3a\u7a7a\uff01';\n }\n if(Object.keys(errorObj).length > 0) {\n const err = new Error();\n err.filed = errorObj;\n Notify.error({ title: '\u63d0\u4ea4\u5931\u8d25\uff01', description: '\u8bf7\u786e\u8ba4\u63d0\u4ea4\u8868\u5355\u662f\u5426\u6b63\u786e\uff01' });\n throw err;\n }\n console.log('--\x3e>', initial, current);\n Notify.success({ title: '\u63d0\u4ea4\u6210\u529f\uff01', description: '\u606d\u559c\u4f60\u767b\u5f55\u6210\u529f\uff01' });\n }}\n onSubmitError={(error) => {\n if (error.filed) {\n return { ...error.filed };\n }\n return null;\n }}\n fields={{\n username: {\n labelClassName: 'fieldLabel',\n labelFor: 'username-inline',\n children: <Input preIcon=\"user\" id=\"username-inline\" />\n },\n password: {\n labelClassName: 'fieldLabel',\n labelFor: 'password-inline',\n children: <Input preIcon=\"lock\" id=\"password-inline\" type=\"password\" />\n },\n }}\n >\n {({ fields, state, canSubmit, resetForm }) => {\n console.log('fields:', state);\n return (\n <div>\n <Row gutter={10}>\n <Col fixed>{fields.username}</Col>\n <Col fixed>{fields.password}</Col>\n </Row>\n <Row gutter={10}>\n <Col>\n <Button disabled={!canSubmit()} type=\"primary\" htmlType=\"submit\">\u63d0\u4ea4</Button>\n <Button type=\"danger\" onClick={resetForm}>\u91cd\u7f6e\u8868\u5355</Button>\n </Col>\n </Row>\n </div>\n )\n }}\n </Form>\n </div>\n);\nReactDOM.render(<Demo />, _mount_);\n```\n\n## \u767b\u5f55\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true--\x3e\n```jsx\nimport ReactDOM from 'react-dom';\nimport { Form, Input, Row, Col, Checkbox, Notify, Button } from 'uiw';\n\nconst Demo = () => (\n <div>\n <Form\n onSubmit={({initial, current}) => {\n console.log('--\x3e>', initial, current);\n }}\n fields={{\n username: {\n labelClassName: 'fieldLabel',\n labelStyle: { width: 60 },\n labelFor: 'username',\n children: <Input preIcon=\"user\" id=\"username\" />\n },\n password: {\n labelClassName: 'fieldLabel',\n labelStyle: { width: 60 },\n labelFor: 'password',\n children: <Input preIcon=\"lock\" id=\"password\" type=\"password\" />\n },\n terms: {\n validator: (currentValue) => !currentValue ? '\u5fc5\u987b\u7edf\u4e00\u670d\u52a1\u6761\u6b3e' : null,\n children: <Checkbox value=\"1\">\u5df2\u9605\u8bfb\u5e76\u540c\u610f</Checkbox>\n }\n }}\n >\n {({ fields, state, canSubmit }) => {\n console.log('fields:', state);\n return (\n <div>\n <Row>\n <Col fixed>{fields.username}</Col>\n </Row>\n <Row>\n <Col fixed>{fields.password}</Col>\n </Row>\n <Row>\n <Col fixed align=\"middle\">{fields.terms}</Col>\n <Col fixed style={{ marginTop: -4 }}><a href=\"#\">\u670d\u52a1\u6761\u6b3e</a></Col>\n </Row>\n <Row>\n <Col fixed>\n <Button disabled={!canSubmit()} type=\"primary\" htmlType=\"submit\">\u63d0\u4ea4</Button>\n </Col>\n </Row>\n </div>\n )\n }}\n </Form>\n </div>\n)\nReactDOM.render(<Demo />, _mount_);\n```\n\n### \u8868\u5355\u63d0\u4ea4\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true--\x3e\n```jsx\nimport ReactDOM from 'react-dom';\nimport { Form, Input, Select, Row, Col, Button } from 'uiw';\n\nconst Demo = () => (\n <div>\n <Form\n onSubmit={({initial, current}) => {\n console.log('--\x3e>', initial, current);\n }}\n fields={{\n firstName: {\n labelClassName: 'fieldLabel',\n labelStyle: { width: 60 },\n inline: true,\n label: '\u59d3\u6c0f',\n children: <Input />\n },\n lastName: {\n labelClassName: 'fieldLabel',\n labelStyle: { width: 60 },\n initialValue: '\u5148\u751f',\n inline: true,\n label: '\u540d\u5b57',\n children: <Input />\n },\n email: {\n labelClassName: 'fieldLabel',\n labelStyle: { width: 60 },\n validator: (currentValue) => {\n return currentValue && currentValue.length < 2 ? 'Password must be 8+ characters' : null;\n },\n inline: true,\n label: 'Email',\n children: <Input />\n },\n select: {\n labelClassName: 'fieldLabel',\n labelStyle: { width: 60 },\n inline: true,\n label: '\u9009\u62e9\u5668',\n children: (\n <Select>\n <Select.Option>Choose an item...</Select.Option>\n <Select.Option value=\"1\">One</Select.Option>\n <Select.Option value=\"2\">Two</Select.Option>\n <Select.Option value=\"3\">Three</Select.Option>\n <Select.Option value=\"4\">Four</Select.Option>\n </Select>\n ),\n },\n }}\n >\n {({ fields, state, canSubmit }) => {\n console.log('fields:', state);\n return (\n <div>\n <Row gutter={10} style={{ marginBottom: 10 }}>\n <Col>{fields.firstName}</Col>\n <Col>{fields.lastName}</Col>\n </Row>\n <Row gutter={10}>\n <Col>{fields.email}</Col>\n <Col>{fields.select}</Col>\n </Row>\n <Row gutter={10}>\n <Col />\n <Col fixed align=\"bottom\"><Button disabled={!canSubmit()} type=\"primary\" htmlType=\"submit\">\u63d0\u4ea4</Button></Col>\n </Row>\n </div>\n )\n }}\n </Form>\n </div>\n)\nReactDOM.render(<Demo />, _mount_);\n```\n\n\n### \u81ea\u5b9a\u4e49\u63a7\u4ef6\u5e94\u7528\n\n\u4e0b\u9762\u5b9e\u4f8b\u662f\u5728 [`<Form />`](#/components/form) \u8868\u5355\u7ec4\u4ef6\u4e2d\uff0c\u5e94\u7528\u81ea\u5b9a\u4e49 `<CustomSelect />` \u63a7\u4ef6\u7ec4\u4ef6\u3002\n\n> \u26a0\ufe0f \u6ce8\u610f\uff0c\u81ea\u5b9a\u4e49\u63a7\u4ef6\u9700\u8981\u4e24\u4e2a\u5fc5\u8981\u7684 `props` \u53c2\u6570\uff0c`value` \u548c `onChange`\n\x3c!--rehype:style=border-left: 8px solid #ffe564;background-color: #ffe56440;padding: 12px 16px;--\x3e\n\n- `value` \u7528\u4e8e\u503c\u4f20\u9012\uff0c\n- `onChange(value)` \u7528\u4e8e\u503c\u53d8\u66f4\u9700\u8981\u6267\u884c\u7684\u56de\u8c03\u51fd\u6570\uff0c\u56de\u8c03\u51fd\u6570\u7b2c\u4e00\u4e2a\u53c2\u6570\u5fc5\u987b\u662f `value`\u3002\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true--\x3e\n```jsx\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport { Form, Row, Col, Dropdown, Menu, Icon, Button, Notify } from 'uiw';\n\n// \u81ea\u5b9a\u4e49\u7ec4\u4ef6\nfunction CustomSelect(props) {\n const { option = [], onChange } = props;\n const [value, setValue] = React.useState(props.value);\n const [isOpen, setIsOpen] = React.useState(false);\n\n React.useEffect(() => {\n if (value !== props.value) {\n setValue(props.value);\n }\n }, [props.value]);\n const label = option.find(item => value === item.value);\n return (\n <Dropdown\n trigger=\"click\"\n onVisibleChange={(open) => setIsOpen(open)}\n isOpen={isOpen}\n menu={\n <Menu bordered style={{ minWidth: 120 }}>\n {option.map((item, idx) => (\n <Menu.Item active={value === item.value} key={idx} text={item.label}\n onClick={() => {\n setValue(item.value);\n setIsOpen(false)\n onChange && onChange(item.value);\n }}\n />\n ))}\n </Menu>\n }\n >\n <Button\n style={{\n boxShadow: 'inset 0 0 0 1px rgba(16, 22, 26, 0.2), inset 0 -1px 0 rgba(16, 22, 26, 0.1)'\n }}\n type=\"link\"\n >\n {label.label}<Icon type={isOpen ? 'up' : 'down'} />\n </Button>\n </Dropdown>\n );\n}\n\n// \u81ea\u5b9a\u4e49\u7ec4\u4ef6\u5e94\u7528\u5b9e\u4f8b\nconst Demo = () => (\n <div>\n <Form\n onSubmitError={(error) => {\n if (error.filed) {\n return { ...error.filed };\n }\n return null;\n }}\n onSubmit={({initial, current}) => {\n console.log('~~~', current);\n const errorObj = {};\n if (!current.select) {\n errorObj.select = '\u5185\u5bb9\u4e3a\u7a7a\uff0c\u8bf7\u8f93\u5165\u5185\u5bb9';\n }\n if(Object.keys(errorObj).length > 0) {\n const err = new Error();\n err.filed = errorObj;\n Notify.error({ title: '\u63d0\u4ea4\u5931\u8d25\uff01', description: '\u8bf7\u786e\u8ba4\u63d0\u4ea4\u8868\u5355\u662f\u5426\u6b63\u786e\uff01' });\n throw err;\n }\n Notify.success({\n title: '\u63d0\u4ea4\u6210\u529f\uff01',\n description: `\u8868\u5355\u63d0\u4ea4\u6210\u529f\uff0c\u5185\u5bb9\u4e3a\uff1a${current.select}\uff0c\u5c06\u81ea\u52a8\u586b\u5145\u521d\u59cb\u5316\u503c\uff01`,\n });\n }}\n fields={{\n select: {\n initialValue: 0,\n children: (\n <CustomSelect option={[\n { label: '\u8bf7\u9009\u62e9', value: 0 },\n { label: '\u7ecf\u6d4e\u8231', value: 1 },\n { label: '\u8c6a\u534e\u7ecf\u6d4e\u8231', value: 2 },\n { label: '\u5546\u52a1\u8231', value: 3 },\n { label: '\u5934\u7b49\u8231', value: 4 },\n ]} />\n )\n },\n }}\n >\n {({ fields, state, canSubmit }) => {\n return (\n <div>\n <Row>\n <Col style={{ maxWidth: 300 }}>{fields.select}</Col>\n </Row>\n <Row>\n <Col fixed>\n <Button disabled={!canSubmit()} type=\"primary\" htmlType=\"submit\">\u63d0\u4ea4</Button>\n </Col>\n </Row>\n </div>\n )\n }}\n </Form>\n </div>\n)\nReactDOM.render(<Demo />, _mount_);\n```\n\n### FormItem \u7ad6\u6392\n\n\u5bf9\u7ec4\u4ef6 `FormItem` \u7ad6\u6392\u5c55\u793a\u793a\u4f8b\u3002\n\n> \u26a0\ufe0f \u6ce8\u610f\uff1a\u5f53\u524d\u53ea\u5c55\u793a\u6548\u679c\uff0c`FormItem` \u7ec4\u4ef6\u53ea\u5728 `Form` \u7ec4\u4ef6\u4e2d\u4f7f\u7528\u3002\n\x3c!--rehype:style=border-left: 8px solid #ffe564;background-color: #ffe56440;padding: 12px 16px;--\x3e\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true--\x3e\n```jsx\nimport ReactDOM from 'react-dom';\nimport { Form, FormItem } from 'uiw';\n\nconst Demo = () => (\n <Form>\n <FormItem\n label=\"\u53ef\u9009\u5b57\u6bb5\"\n labelFor=\"basic-input\"\n help={<span>\u5728\u4e0a\u9762\u7684\u5b57\u6bb5\u4e2d\u8f93\u5165\u4e00\u4e2a\u503c</span>}\n >\n <Input id=\"basic-input\" type=\"text\"/>\n </FormItem>\n <FormItem\n label=\"\u7528\u6237\u540d\"\n labelFor=\"username-input\"\n help=\"\u7528\u6237\u540d\u957f\u5ea6\u81f3\u5c11\u4e3a8\u4e2a\u5b57\u7b26\u4e32\u3002\"\n hasError={true}\n >\n <Input id=\"username-input\" type=\"text\"/>\n </FormItem>\n </Form>\n)\nReactDOM.render(<Demo />, _mount_);\n```\n\n### FormItem \u6a2a\u6392\n\n\u5bf9\u7ec4\u4ef6 `FormItem` \u6a2a\u6392\u5c55\u793a\u793a\u4f8b\u3002\n\n> \u26a0\ufe0f \u6ce8\u610f\uff1a\u5f53\u524d\u53ea\u5c55\u793a\u6548\u679c\uff0c`FormItem` \u7ec4\u4ef6\u53ea\u5728 `Form` \u7ec4\u4ef6\u4e2d\u4f7f\u7528\u3002\n\x3c!--rehype:style=border-left: 8px solid #ffe564;background-color: #ffe56440;padding: 12px 16px;--\x3e\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true--\x3e\n```jsx\nimport ReactDOM from 'react-dom';\nimport { Form, FormItem } from 'uiw';\n\nconst Demo = () => (\n <Form>\n <FormItem\n inline={true}\n label=\"\u53ef\u9009\u5b57\u6bb5\"\n labelFor=\"basic-input-inline\"\n help={<span>\u5728\u4e0a\u9762\u7684\u5b57\u6bb5\u4e2d\u8f93\u5165\u4e00\u4e2a\u503c</span>}\n onChange={() => {\n console.log('TEST::');\n }}\n >\n <Input id=\"basic-input-inline\" type=\"text\"/>\n </FormItem>\n <FormItem\n inline={true}\n label=\"\u7528\u6237\u540d\"\n labelFor=\"username-input-inline\"\n labelClassName=\"username\"\n help=\"\u7528\u6237\u540d\u957f\u5ea6\u81f3\u5c11\u4e3a8\u4e2a\u5b57\u7b26\u4e32\u3002\"\n hasError={true}\n >\n <Input id=\"username-input-inline\" type=\"text\"/>\n </FormItem>\n </Form>\n)\nReactDOM.render(<Demo />, _mount_);\n```\n\n## Form\n\n| \u53c2\u6570 | \u8bf4\u660e | \u7c7b\u578b | \u9ed8\u8ba4\u503c |\n|--------- |-------- |--------- |-------- |\n| fields | \u8bbe\u7f6e\u5b57\u6bb5 | object | - |\n| children | \u56de\u8c03 {`fields`, `state`, `canSubmit`, `resetForm`} | function | - |\n| onSubmit | \u63d0\u4ea4\u8868\u5355\u65f6\u8c03\u7528 | function({ initial, current }) | - |\n| afterSubmit `@3.0.0+` | \u63d0\u4ea4\u56de\u8c03 {`initial`, `current`} | function({ initial, current }) | - |\n| onChange | \u8868\u5355\u53d1\u751f\u6539\u53d8\u56de\u8c03\u51fd\u6570 {`initial`, `current`} | function({ initial, current }) | - |\n| onSubmitError | \u8c03\u7528 `onSubmit` \u629b\u51fa\u7684\u4efb\u4f55\u9519\u8bef\u3002\u4ece\u5b57\u6bb5\u540d\u79f0\u8fd4\u56de\u5bf9\u8c61\u6620\u5c04\u3002 | function | - |\n| resetOnSubmit | \u5728 `onSubmit` \u6210\u529f\u540e\u5c06\u8868\u5355\u91cd\u7f6e\u4e3a\u5176\u521d\u59cb\u72b6\u6001\u3002| bool | `true` |\n\n```js\n// => fields props\n{\n firstName: {\n initialValue: '\u738b',\n inline: true,\n label: '\u59d3',\n labelClassName: 'fieldLabel',\n labelStyle: { width: 60 },\n // \u9a8c\u8bc1\uff0c\u901a\u8fc7 `canSubmit()` \u65b9\u6cd5\u83b7\u5f97\uff0c\u63d0\u4ea4\u6309\u94ae\u662f\u5426\u88ab\u7981\u7528\n validator: (currentValue) => {},\n help: '\u5e2e\u52a9\u63d0\u793a\u4fe1\u606f\uff01',\n children: <Input type=\"number\" />\n },\n}\n```\n\n## FormItem\n\n| \u53c2\u6570 | \u8bf4\u660e | \u7c7b\u578b | \u9ed8\u8ba4\u503c |\n|--------- |-------- |--------- |-------- |\n| label | \u8868\u5355\u6807\u9898\u5c55\u793a | string | - |\n| labelClassName | \u8868\u5355\u6807\u9898\u6837\u5f0f\u540d\u79f0 | string | - |\n| labelStyle | \u8868\u5355\u6807\u9898\u6837\u5f0f | object | - |\n| labelFor | \u5217\u7684\u5bbd\u5ea6\u76f8\u5bf9\u4e8e\u540c\u4e00\u7f51\u683c\u4e2d\u5176\u4ed6\u5217\u7684\u6bd4\u7387 | number | - |\n| help | \u63d0\u793a\u4fe1\u606f | ReactNode | - |\n| hasError | \u5982\u679c\u4e3atrue\uff0c\u5219\u5e94\u7528\u9519\u8befCSS\u3002\u8f6c\u52a8\u8fb9\u6846\u5e76\u5e2e\u52a9\u6587\u5b57\u53d8\u7ea2\u3002 | number | - |"}}]);
2
+ //# sourceMappingURL=6566.f7efbc17.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"static/js/6566.75acebe9.chunk.js","mappings":"gHAAA","sources":["../../packages/react-form/README.md"],"sourcesContent":["export default \"Form 表单\\n===\\n\\n由输入框、选择器、单选框、多选框等控件组成,用以收集、校验、提交数据。\\n\\n```jsx\\nimport { Form, FormItem } from 'uiw';\\n// or\\nimport { Form, FormItem } from '@uiw/react-form';\\n```\\n\\n### 基本用法\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->\\n```jsx\\nimport ReactDOM from 'react-dom';\\nimport { Form, Input, Row, Col, Slider, Button, Notify } from 'uiw';\\n\\nconst Demo = () => (\\n <div>\\n <Form\\n onChange={({ initial, current }) => {\\n console.log('onChange', initial, current);\\n }}\\n onSubmit={({initial, current}) => {\\n if(current.name === initial.name) {\\n Notify.error({\\n title: '提交失败!',\\n description: `表单提交内容为空!`,\\n });\\n } else {\\n Notify.success({\\n title: '提交成功!',\\n description: `姓名为:${current.name},提交完成,将自动填充初始化值!`,\\n });\\n }\\n }}\\n fields={{\\n name: {\\n label: '姓名',\\n children: <Input placeholder=\\\"请输入姓名\\\" />\\n },\\n }}\\n >\\n {({ fields, state, canSubmit }) => {\\n return (\\n <div>\\n <Row>\\n <Col style={{ maxWidth: 300 }}>{fields.name}</Col>\\n </Row>\\n <Row>\\n <Col>\\n <Button disabled={!canSubmit()} type=\\\"primary\\\" htmlType=\\\"submit\\\">提交</Button>\\n </Col>\\n </Row>\\n <Row>\\n <Col>\\n {JSON.stringify(state.current)}\\n </Col>\\n </Row>\\n </div>\\n )\\n }}\\n </Form>\\n </div>\\n)\\nReactDOM.render(<Demo />, _mount_);\\n```\\n\\n### 自定义校验\\n\\n一般校验可不需引入外部包解决,如果遇到大型工程表单比较多的地方推荐使用 [jquense/yup](https://github.com/jquense/yup)\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->\\n```jsx\\nimport ReactDOM from 'react-dom';\\nimport { Form, Input, Notify, Checkbox, Switch, RadioGroup, Radio, Textarea, Row, Col, Button } from 'uiw';\\n\\nconst Demo = () => (\\n <Form\\n onSubmit={({initial, current}) => {\\n const errorObj = {};\\n if (current.userName.startsWith('u')) {\\n errorObj.userName = `姓名 ${current.userName} 不能以 ‘u’ 开头`;\\n }\\n if (!current.checkboxOne) {\\n errorObj.checkboxOne = '一个多选条件 为必填';\\n }\\n if (!current.terms) {\\n errorObj.terms = '必须统一服务条款';\\n }\\n if(Object.keys(errorObj).length > 0) {\\n const err = new Error();\\n err.filed = errorObj;\\n throw err;\\n }\\n Notify.success({\\n title: '提交成功!',\\n description: `姓名为:${current.userName},提交完成,将自动填充初始化值!`,\\n });\\n }}\\n onSubmitError={(error) => {\\n if (error.filed) {\\n return { ...error.filed };\\n }\\n return null;\\n }}\\n fields={{\\n userName: {\\n initialValue: 'uiw',\\n label: '姓名',\\n children: <Input type=\\\"text\\\" />,\\n help: '以“u”开头的名字将在此处显示错误信息'\\n },\\n age: {\\n initialValue: '9',\\n label: '年龄',\\n children: <Input type=\\\"number\\\" />\\n },\\n checkbox: {\\n initialValue: ['四川菜'],\\n label: '选择你想吃的菜',\\n children: (\\n <Checkbox.Group>\\n <div>菜系</div>\\n <Checkbox value=\\\"四川菜\\\">四川菜</Checkbox>\\n <Checkbox value=\\\"湖北菜\\\">湖北菜</Checkbox>\\n <Checkbox value=\\\"西北菜\\\">西北菜</Checkbox>\\n <Checkbox value=\\\"新疆菜\\\">新疆菜</Checkbox>\\n <Checkbox value=\\\"东北菜\\\">东北菜</Checkbox>\\n <div style={{ marginTop: 10 }}>家常菜</div>\\n <Checkbox value=\\\"红烧武昌鱼\\\">红烧武昌鱼</Checkbox>\\n <Checkbox value=\\\"麻婆豆腐\\\">麻婆豆腐</Checkbox>\\n <Checkbox value=\\\"北京烤鸭\\\">北京烤鸭</Checkbox>\\n </Checkbox.Group>\\n )\\n },\\n checkboxOne: {\\n inline: true,\\n label: '一个多选条件',\\n children: <Checkbox value=\\\"1\\\">四川菜</Checkbox>\\n },\\n switch: {\\n inline: true,\\n initialValue: true,\\n label: '开启',\\n children: <Switch size=\\\"small\\\" />\\n },\\n radioGroup: {\\n inline: true,\\n initialValue: '男',\\n label: '单选',\\n children: (\\n <RadioGroup name=\\\"other\\\">\\n <Radio value=\\\"男\\\">男</Radio>\\n <Radio value=\\\"女\\\">女</Radio>\\n <Radio value=\\\"人妖\\\" disabled>人妖</Radio>\\n <Radio value=\\\"未知\\\">未知</Radio>\\n </RadioGroup>\\n )\\n },\\n textarea: {\\n initialValue: '',\\n label: '多行文本输入框',\\n children: <Textarea placeholder=\\\"请输入内容\\\" />\\n },\\n terms: {\\n validator: (currentValue) => {\\n return !currentValue ? '必须统一服务条款' : null;\\n },\\n style: { marginBottom: 0 },\\n children: <Checkbox value=\\\"1\\\">已阅读并同意<a href=\\\"#\\\">服务条款</a></Checkbox>\\n }\\n }}\\n >\\n {({ fields, state, canSubmit, resetForm }) => {\\n console.log('fields:-->', state);\\n return (\\n <div style={{ maxWidth: 500 }}>\\n <Row gutter={10}>\\n <Col>{fields.userName}</Col>\\n <Col>{fields.age}</Col>\\n </Row>\\n <Row gutter={10}>\\n <Col>{fields.checkbox}</Col>\\n <Col>{fields.checkboxOne}</Col>\\n </Row>\\n <Row gutter={10}>\\n <Col>{fields.radioGroup}</Col>\\n </Row>\\n <Row gutter={10}>\\n <Col>{fields.switch}</Col>\\n </Row>\\n <Row gutter={10}>\\n <Col>{fields.textarea}</Col>\\n </Row>\\n <Row gutter={10}>\\n <Col style={{ padding: '5px 0 10px 0' }}>\\n {fields.terms}\\n </Col>\\n </Row>\\n <Row gutter={10}>\\n <Col fixed>\\n <Button disabled={!canSubmit()} type=\\\"primary\\\" htmlType=\\\"submit\\\">提交</Button>\\n <Button type=\\\"light\\\" onClick={resetForm}>重置表单</Button>\\n </Col>\\n </Row>\\n <Row>\\n <Col>\\n <pre style={{ padding: '10px 0 0 10px' }}>\\n {JSON.stringify(state.current, null, 2)}\\n </pre>\\n </Col>\\n </Row>\\n </div>\\n )\\n }}\\n </Form>\\n)\\nReactDOM.render(<Demo />, _mount_);\\n```\\n\\n### 水平登录栏\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->\\n```jsx\\nimport ReactDOM from 'react-dom';\\nimport { Form, Input, Row, Col, Notify, Button } from 'uiw';\\n\\nconst Demo = () => (\\n <div>\\n <Form\\n onSubmit={({initial, current}) => {\\n const errorObj = {};\\n if (!current.username) {\\n errorObj.username = '用户名不能为空!';\\n }\\n if (!current.password) {\\n errorObj.password = '密码不能为空!';\\n }\\n if(Object.keys(errorObj).length > 0) {\\n const err = new Error();\\n err.filed = errorObj;\\n Notify.error({ title: '提交失败!', description: '请确认提交表单是否正确!' });\\n throw err;\\n }\\n console.log('-->>', initial, current);\\n Notify.success({ title: '提交成功!', description: '恭喜你登录成功!' });\\n }}\\n onSubmitError={(error) => {\\n if (error.filed) {\\n return { ...error.filed };\\n }\\n return null;\\n }}\\n fields={{\\n username: {\\n labelClassName: 'fieldLabel',\\n labelFor: 'username-inline',\\n children: <Input preIcon=\\\"user\\\" id=\\\"username-inline\\\" />\\n },\\n password: {\\n labelClassName: 'fieldLabel',\\n labelFor: 'password-inline',\\n children: <Input preIcon=\\\"lock\\\" id=\\\"password-inline\\\" type=\\\"password\\\" />\\n },\\n }}\\n >\\n {({ fields, state, canSubmit, resetForm }) => {\\n console.log('fields:', state);\\n return (\\n <div>\\n <Row gutter={10}>\\n <Col fixed>{fields.username}</Col>\\n <Col fixed>{fields.password}</Col>\\n </Row>\\n <Row gutter={10}>\\n <Col>\\n <Button disabled={!canSubmit()} type=\\\"primary\\\" htmlType=\\\"submit\\\">提交</Button>\\n <Button type=\\\"danger\\\" onClick={resetForm}>重置表单</Button>\\n </Col>\\n </Row>\\n </div>\\n )\\n }}\\n </Form>\\n </div>\\n);\\nReactDOM.render(<Demo />, _mount_);\\n```\\n\\n## 登录\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->\\n```jsx\\nimport ReactDOM from 'react-dom';\\nimport { Form, Input, Row, Col, Checkbox, Notify, Button } from 'uiw';\\n\\nconst Demo = () => (\\n <div>\\n <Form\\n onSubmit={({initial, current}) => {\\n console.log('-->>', initial, current);\\n }}\\n fields={{\\n username: {\\n labelClassName: 'fieldLabel',\\n labelStyle: { width: 60 },\\n labelFor: 'username',\\n children: <Input preIcon=\\\"user\\\" id=\\\"username\\\" />\\n },\\n password: {\\n labelClassName: 'fieldLabel',\\n labelStyle: { width: 60 },\\n labelFor: 'password',\\n children: <Input preIcon=\\\"lock\\\" id=\\\"password\\\" type=\\\"password\\\" />\\n },\\n terms: {\\n validator: (currentValue) => !currentValue ? '必须统一服务条款' : null,\\n children: <Checkbox value=\\\"1\\\">已阅读并同意</Checkbox>\\n }\\n }}\\n >\\n {({ fields, state, canSubmit }) => {\\n console.log('fields:', state);\\n return (\\n <div>\\n <Row>\\n <Col fixed>{fields.username}</Col>\\n </Row>\\n <Row>\\n <Col fixed>{fields.password}</Col>\\n </Row>\\n <Row>\\n <Col fixed align=\\\"middle\\\">{fields.terms}</Col>\\n <Col fixed style={{ marginTop: -4 }}><a href=\\\"#\\\">服务条款</a></Col>\\n </Row>\\n <Row>\\n <Col fixed>\\n <Button disabled={!canSubmit()} type=\\\"primary\\\" htmlType=\\\"submit\\\">提交</Button>\\n </Col>\\n </Row>\\n </div>\\n )\\n }}\\n </Form>\\n </div>\\n)\\nReactDOM.render(<Demo />, _mount_);\\n```\\n\\n### 表单提交\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->\\n```jsx\\nimport ReactDOM from 'react-dom';\\nimport { Form, Input, Select, Row, Col, Button } from 'uiw';\\n\\nconst Demo = () => (\\n <div>\\n <Form\\n onSubmit={({initial, current}) => {\\n console.log('-->>', initial, current);\\n }}\\n fields={{\\n firstName: {\\n labelClassName: 'fieldLabel',\\n labelStyle: { width: 60 },\\n inline: true,\\n label: '姓氏',\\n children: <Input />\\n },\\n lastName: {\\n labelClassName: 'fieldLabel',\\n labelStyle: { width: 60 },\\n initialValue: '先生',\\n inline: true,\\n label: '名字',\\n children: <Input />\\n },\\n email: {\\n labelClassName: 'fieldLabel',\\n labelStyle: { width: 60 },\\n validator: (currentValue) => {\\n return currentValue && currentValue.length < 2 ? 'Password must be 8+ characters' : null;\\n },\\n inline: true,\\n label: 'Email',\\n children: <Input />\\n },\\n select: {\\n labelClassName: 'fieldLabel',\\n labelStyle: { width: 60 },\\n inline: true,\\n label: '选择器',\\n children: (\\n <Select>\\n <Select.Option>Choose an item...</Select.Option>\\n <Select.Option value=\\\"1\\\">One</Select.Option>\\n <Select.Option value=\\\"2\\\">Two</Select.Option>\\n <Select.Option value=\\\"3\\\">Three</Select.Option>\\n <Select.Option value=\\\"4\\\">Four</Select.Option>\\n </Select>\\n ),\\n },\\n }}\\n >\\n {({ fields, state, canSubmit }) => {\\n console.log('fields:', state);\\n return (\\n <div>\\n <Row gutter={10} style={{ marginBottom: 10 }}>\\n <Col>{fields.firstName}</Col>\\n <Col>{fields.lastName}</Col>\\n </Row>\\n <Row gutter={10}>\\n <Col>{fields.email}</Col>\\n <Col>{fields.select}</Col>\\n </Row>\\n <Row gutter={10}>\\n <Col />\\n <Col fixed align=\\\"bottom\\\"><Button disabled={!canSubmit()} type=\\\"primary\\\" htmlType=\\\"submit\\\">提交</Button></Col>\\n </Row>\\n </div>\\n )\\n }}\\n </Form>\\n </div>\\n)\\nReactDOM.render(<Demo />, _mount_);\\n```\\n\\n\\n### 自定义控件应用\\n\\n下面实例是在 [`<Form />`](#/components/form) 表单组件中,应用自定义 `<CustomSelect />` 控件组件。\\n\\n> ⚠️ 注意,自定义控件需要两个必要的 `props` 参数,`value` 和 `onChange`\\n<!--rehype:style=border-left: 8px solid #ffe564;background-color: #ffe56440;padding: 12px 16px;-->\\n\\n- `value` 用于值传递,\\n- `onChange(value)` 用于值变更需要执行的回调函数,回调函数第一个参数必须是 `value`。\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->\\n```jsx\\nimport React from 'react';\\nimport ReactDOM from 'react-dom';\\nimport { Form, Row, Col, Dropdown, Menu, Icon, Button, Notify } from 'uiw';\\n\\n// 自定义组件\\nfunction CustomSelect(props) {\\n const { option = [], onChange } = props;\\n const [value, setValue] = React.useState(props.value);\\n const [isOpen, setIsOpen] = React.useState(false);\\n\\n React.useEffect(() => {\\n if (value !== props.value) {\\n setValue(props.value);\\n }\\n }, [props.value]);\\n const label = option.find(item => value === item.value);\\n return (\\n <Dropdown\\n trigger=\\\"click\\\"\\n onVisibleChange={(open) => setIsOpen(open)}\\n isOpen={isOpen}\\n menu={\\n <Menu bordered style={{ minWidth: 120 }}>\\n {option.map((item, idx) => (\\n <Menu.Item active={value === item.value} key={idx} text={item.label}\\n onClick={() => {\\n setValue(item.value);\\n setIsOpen(false)\\n onChange && onChange(item.value);\\n }}\\n />\\n ))}\\n </Menu>\\n }\\n >\\n <Button\\n style={{\\n boxShadow: 'inset 0 0 0 1px rgba(16, 22, 26, 0.2), inset 0 -1px 0 rgba(16, 22, 26, 0.1)'\\n }}\\n type=\\\"link\\\"\\n >\\n {label.label}<Icon type={isOpen ? 'up' : 'down'} />\\n </Button>\\n </Dropdown>\\n );\\n}\\n\\n// 自定义组件应用实例\\nconst Demo = () => (\\n <div>\\n <Form\\n onSubmitError={(error) => {\\n if (error.filed) {\\n return { ...error.filed };\\n }\\n return null;\\n }}\\n onSubmit={({initial, current}) => {\\n console.log('~~~', current);\\n const errorObj = {};\\n if (!current.select) {\\n errorObj.select = '内容为空,请输入内容';\\n }\\n if(Object.keys(errorObj).length > 0) {\\n const err = new Error();\\n err.filed = errorObj;\\n Notify.error({ title: '提交失败!', description: '请确认提交表单是否正确!' });\\n throw err;\\n }\\n Notify.success({\\n title: '提交成功!',\\n description: `表单提交成功,内容为:${current.select},将自动填充初始化值!`,\\n });\\n }}\\n fields={{\\n select: {\\n initialValue: 0,\\n children: (\\n <CustomSelect option={[\\n { label: '请选择', value: 0 },\\n { label: '经济舱', value: 1 },\\n { label: '豪华经济舱', value: 2 },\\n { label: '商务舱', value: 3 },\\n { label: '头等舱', value: 4 },\\n ]} />\\n )\\n },\\n }}\\n >\\n {({ fields, state, canSubmit }) => {\\n return (\\n <div>\\n <Row>\\n <Col style={{ maxWidth: 300 }}>{fields.select}</Col>\\n </Row>\\n <Row>\\n <Col fixed>\\n <Button disabled={!canSubmit()} type=\\\"primary\\\" htmlType=\\\"submit\\\">提交</Button>\\n </Col>\\n </Row>\\n </div>\\n )\\n }}\\n </Form>\\n </div>\\n)\\nReactDOM.render(<Demo />, _mount_);\\n```\\n\\n### FormItem 竖排\\n\\n对组件 `FormItem` 竖排展示示例。\\n\\n> ⚠️ 注意:当前只展示效果,`FormItem` 组件只在 `Form` 组件中使用。\\n<!--rehype:style=border-left: 8px solid #ffe564;background-color: #ffe56440;padding: 12px 16px;-->\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->\\n```jsx\\nimport ReactDOM from 'react-dom';\\nimport { Form, FormItem } from 'uiw';\\n\\nconst Demo = () => (\\n <Form>\\n <FormItem\\n label=\\\"可选字段\\\"\\n labelFor=\\\"basic-input\\\"\\n help={<span>在上面的字段中输入一个值</span>}\\n >\\n <Input id=\\\"basic-input\\\" type=\\\"text\\\"/>\\n </FormItem>\\n <FormItem\\n label=\\\"用户名\\\"\\n labelFor=\\\"username-input\\\"\\n help=\\\"用户名长度至少为8个字符串。\\\"\\n hasError={true}\\n >\\n <Input id=\\\"username-input\\\" type=\\\"text\\\"/>\\n </FormItem>\\n </Form>\\n)\\nReactDOM.render(<Demo />, _mount_);\\n```\\n\\n### FormItem 横排\\n\\n对组件 `FormItem` 横排展示示例。\\n\\n> ⚠️ 注意:当前只展示效果,`FormItem` 组件只在 `Form` 组件中使用。\\n<!--rehype:style=border-left: 8px solid #ffe564;background-color: #ffe56440;padding: 12px 16px;-->\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->\\n```jsx\\nimport ReactDOM from 'react-dom';\\nimport { Form, FormItem } from 'uiw';\\n\\nconst Demo = () => (\\n <Form>\\n <FormItem\\n inline={true}\\n label=\\\"可选字段\\\"\\n labelFor=\\\"basic-input-inline\\\"\\n help={<span>在上面的字段中输入一个值</span>}\\n onChange={() => {\\n console.log('TEST::');\\n }}\\n >\\n <Input id=\\\"basic-input-inline\\\" type=\\\"text\\\"/>\\n </FormItem>\\n <FormItem\\n inline={true}\\n label=\\\"用户名\\\"\\n labelFor=\\\"username-input-inline\\\"\\n labelClassName=\\\"username\\\"\\n help=\\\"用户名长度至少为8个字符串。\\\"\\n hasError={true}\\n >\\n <Input id=\\\"username-input-inline\\\" type=\\\"text\\\"/>\\n </FormItem>\\n </Form>\\n)\\nReactDOM.render(<Demo />, _mount_);\\n```\\n\\n## Form\\n\\n| 参数 | 说明 | 类型 | 默认值 |\\n|--------- |-------- |--------- |-------- |\\n| fields | 设置字段 | object | - |\\n| children | 回调 {`fields`, `state`, `canSubmit`, `resetForm`} | function | - |\\n| onSubmit | 在 `onSubmit` 之后执行 | function({ initial, current }) | - |\\n| afterSubmit `@3.0.0+` | 提交回调 {`initial`, `current`} | function({ initial, current }) | - |\\n| onChange | 表单发生改变回调函数 {`initial`, `current`} | function({ initial, current }) | - |\\n| onSubmitError | 调用 `onSubmit` 抛出的任何错误。从字段名称返回对象映射。 | function | - |\\n| resetOnSubmit | 在 `onSubmit` 成功后将表单重置为其初始状态。| bool | `true` |\\n\\n```js\\n// => fields props\\n{\\n firstName: {\\n initialValue: '王',\\n inline: true,\\n label: '姓',\\n labelClassName: 'fieldLabel',\\n labelStyle: { width: 60 },\\n // 验证,通过 `canSubmit()` 方法获得,提交按钮是否被禁用\\n validator: (currentValue) => {},\\n help: '帮助提示信息!',\\n children: <Input type=\\\"number\\\" />\\n },\\n}\\n```\\n\\n## FormItem\\n\\n| 参数 | 说明 | 类型 | 默认值 |\\n|--------- |-------- |--------- |-------- |\\n| label | 表单标题展示 | string | - |\\n| labelClassName | 表单标题样式名称 | string | - |\\n| labelStyle | 表单标题样式 | object | - |\\n| labelFor | 列的宽度相对于同一网格中其他列的比率 | number | - |\\n| help | 提示信息 | ReactNode | - |\\n| hasError | 如果为true,则应用错误CSS。转动边框并帮助文字变红。 | number | - |\";"],"names":[],"sourceRoot":""}
1
+ {"version":3,"file":"static/js/6566.f7efbc17.chunk.js","mappings":"gHAAA","sources":["../../packages/react-form/README.md"],"sourcesContent":["export default \"Form 表单\\n===\\n\\n由输入框、选择器、单选框、多选框等控件组成,用以收集、校验、提交数据。\\n\\n```jsx\\nimport { Form, FormItem } from 'uiw';\\n// or\\nimport { Form, FormItem } from '@uiw/react-form';\\n```\\n\\n### 基本用法\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->\\n```jsx\\nimport ReactDOM from 'react-dom';\\nimport { Form, Input, Row, Col, Slider, Button, Notify } from 'uiw';\\n\\nconst Demo = () => (\\n <div>\\n <Form\\n onChange={({ initial, current }) => {\\n console.log('onChange', initial, current);\\n }}\\n onSubmit={({initial, current}) => {\\n if(current.name === initial.name) {\\n Notify.error({\\n title: '提交失败!',\\n description: `表单提交内容为空!`,\\n });\\n } else {\\n Notify.success({\\n title: '提交成功!',\\n description: `姓名为:${current.name},提交完成,将自动填充初始化值!`,\\n });\\n }\\n }}\\n fields={{\\n name: {\\n label: '姓名',\\n children: <Input placeholder=\\\"请输入姓名\\\" />\\n },\\n }}\\n >\\n {({ fields, state, canSubmit }) => {\\n return (\\n <div>\\n <Row>\\n <Col style={{ maxWidth: 300 }}>{fields.name}</Col>\\n </Row>\\n <Row>\\n <Col>\\n <Button disabled={!canSubmit()} type=\\\"primary\\\" htmlType=\\\"submit\\\">提交</Button>\\n </Col>\\n </Row>\\n <Row>\\n <Col>\\n {JSON.stringify(state.current)}\\n </Col>\\n </Row>\\n </div>\\n )\\n }}\\n </Form>\\n </div>\\n)\\nReactDOM.render(<Demo />, _mount_);\\n```\\n\\n### 自定义校验\\n\\n一般校验可不需引入外部包解决,如果遇到大型工程表单比较多的地方推荐使用 [jquense/yup](https://github.com/jquense/yup)\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->\\n```jsx\\nimport ReactDOM from 'react-dom';\\nimport { Form, Input, Notify, Checkbox, Switch, RadioGroup, Radio, Textarea, Row, Col, Button } from 'uiw';\\n\\nconst Demo = () => (\\n <Form\\n onSubmit={({initial, current}) => {\\n const errorObj = {};\\n if (current.userName.startsWith('u')) {\\n errorObj.userName = `姓名 ${current.userName} 不能以 ‘u’ 开头`;\\n }\\n if (!current.checkboxOne) {\\n errorObj.checkboxOne = '一个多选条件 为必填';\\n }\\n if (!current.terms) {\\n errorObj.terms = '必须统一服务条款';\\n }\\n if(Object.keys(errorObj).length > 0) {\\n const err = new Error();\\n err.filed = errorObj;\\n throw err;\\n }\\n Notify.success({\\n title: '提交成功!',\\n description: `姓名为:${current.userName},提交完成,将自动填充初始化值!`,\\n });\\n }}\\n onSubmitError={(error) => {\\n if (error.filed) {\\n return { ...error.filed };\\n }\\n return null;\\n }}\\n fields={{\\n userName: {\\n initialValue: 'uiw',\\n label: '姓名',\\n children: <Input type=\\\"text\\\" />,\\n help: '以“u”开头的名字将在此处显示错误信息'\\n },\\n age: {\\n initialValue: '9',\\n label: '年龄',\\n children: <Input type=\\\"number\\\" />\\n },\\n checkbox: {\\n initialValue: ['四川菜'],\\n label: '选择你想吃的菜',\\n children: (\\n <Checkbox.Group>\\n <div>菜系</div>\\n <Checkbox value=\\\"四川菜\\\">四川菜</Checkbox>\\n <Checkbox value=\\\"湖北菜\\\">湖北菜</Checkbox>\\n <Checkbox value=\\\"西北菜\\\">西北菜</Checkbox>\\n <Checkbox value=\\\"新疆菜\\\">新疆菜</Checkbox>\\n <Checkbox value=\\\"东北菜\\\">东北菜</Checkbox>\\n <div style={{ marginTop: 10 }}>家常菜</div>\\n <Checkbox value=\\\"红烧武昌鱼\\\">红烧武昌鱼</Checkbox>\\n <Checkbox value=\\\"麻婆豆腐\\\">麻婆豆腐</Checkbox>\\n <Checkbox value=\\\"北京烤鸭\\\">北京烤鸭</Checkbox>\\n </Checkbox.Group>\\n )\\n },\\n checkboxOne: {\\n inline: true,\\n label: '一个多选条件',\\n children: <Checkbox value=\\\"1\\\">四川菜</Checkbox>\\n },\\n switch: {\\n inline: true,\\n initialValue: true,\\n label: '开启',\\n children: <Switch size=\\\"small\\\" />\\n },\\n radioGroup: {\\n inline: true,\\n initialValue: '男',\\n label: '单选',\\n children: (\\n <RadioGroup name=\\\"other\\\">\\n <Radio value=\\\"男\\\">男</Radio>\\n <Radio value=\\\"女\\\">女</Radio>\\n <Radio value=\\\"人妖\\\" disabled>人妖</Radio>\\n <Radio value=\\\"未知\\\">未知</Radio>\\n </RadioGroup>\\n )\\n },\\n textarea: {\\n initialValue: '',\\n label: '多行文本输入框',\\n children: <Textarea placeholder=\\\"请输入内容\\\" />\\n },\\n terms: {\\n validator: (currentValue) => {\\n return !currentValue ? '必须统一服务条款' : null;\\n },\\n style: { marginBottom: 0 },\\n children: <Checkbox value=\\\"1\\\">已阅读并同意<a href=\\\"#\\\">服务条款</a></Checkbox>\\n }\\n }}\\n >\\n {({ fields, state, canSubmit, resetForm }) => {\\n console.log('fields:-->', state);\\n return (\\n <div style={{ maxWidth: 500 }}>\\n <Row gutter={10}>\\n <Col>{fields.userName}</Col>\\n <Col>{fields.age}</Col>\\n </Row>\\n <Row gutter={10}>\\n <Col>{fields.checkbox}</Col>\\n <Col>{fields.checkboxOne}</Col>\\n </Row>\\n <Row gutter={10}>\\n <Col>{fields.radioGroup}</Col>\\n </Row>\\n <Row gutter={10}>\\n <Col>{fields.switch}</Col>\\n </Row>\\n <Row gutter={10}>\\n <Col>{fields.textarea}</Col>\\n </Row>\\n <Row gutter={10}>\\n <Col style={{ padding: '5px 0 10px 0' }}>\\n {fields.terms}\\n </Col>\\n </Row>\\n <Row gutter={10}>\\n <Col fixed>\\n <Button disabled={!canSubmit()} type=\\\"primary\\\" htmlType=\\\"submit\\\">提交</Button>\\n <Button type=\\\"light\\\" onClick={resetForm}>重置表单</Button>\\n </Col>\\n </Row>\\n <Row>\\n <Col>\\n <pre style={{ padding: '10px 0 0 10px' }}>\\n {JSON.stringify(state.current, null, 2)}\\n </pre>\\n </Col>\\n </Row>\\n </div>\\n )\\n }}\\n </Form>\\n)\\nReactDOM.render(<Demo />, _mount_);\\n```\\n\\n### 水平登录栏\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->\\n```jsx\\nimport ReactDOM from 'react-dom';\\nimport { Form, Input, Row, Col, Notify, Button } from 'uiw';\\n\\nconst Demo = () => (\\n <div>\\n <Form\\n onSubmit={({initial, current}) => {\\n const errorObj = {};\\n if (!current.username) {\\n errorObj.username = '用户名不能为空!';\\n }\\n if (!current.password) {\\n errorObj.password = '密码不能为空!';\\n }\\n if(Object.keys(errorObj).length > 0) {\\n const err = new Error();\\n err.filed = errorObj;\\n Notify.error({ title: '提交失败!', description: '请确认提交表单是否正确!' });\\n throw err;\\n }\\n console.log('-->>', initial, current);\\n Notify.success({ title: '提交成功!', description: '恭喜你登录成功!' });\\n }}\\n onSubmitError={(error) => {\\n if (error.filed) {\\n return { ...error.filed };\\n }\\n return null;\\n }}\\n fields={{\\n username: {\\n labelClassName: 'fieldLabel',\\n labelFor: 'username-inline',\\n children: <Input preIcon=\\\"user\\\" id=\\\"username-inline\\\" />\\n },\\n password: {\\n labelClassName: 'fieldLabel',\\n labelFor: 'password-inline',\\n children: <Input preIcon=\\\"lock\\\" id=\\\"password-inline\\\" type=\\\"password\\\" />\\n },\\n }}\\n >\\n {({ fields, state, canSubmit, resetForm }) => {\\n console.log('fields:', state);\\n return (\\n <div>\\n <Row gutter={10}>\\n <Col fixed>{fields.username}</Col>\\n <Col fixed>{fields.password}</Col>\\n </Row>\\n <Row gutter={10}>\\n <Col>\\n <Button disabled={!canSubmit()} type=\\\"primary\\\" htmlType=\\\"submit\\\">提交</Button>\\n <Button type=\\\"danger\\\" onClick={resetForm}>重置表单</Button>\\n </Col>\\n </Row>\\n </div>\\n )\\n }}\\n </Form>\\n </div>\\n);\\nReactDOM.render(<Demo />, _mount_);\\n```\\n\\n## 登录\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->\\n```jsx\\nimport ReactDOM from 'react-dom';\\nimport { Form, Input, Row, Col, Checkbox, Notify, Button } from 'uiw';\\n\\nconst Demo = () => (\\n <div>\\n <Form\\n onSubmit={({initial, current}) => {\\n console.log('-->>', initial, current);\\n }}\\n fields={{\\n username: {\\n labelClassName: 'fieldLabel',\\n labelStyle: { width: 60 },\\n labelFor: 'username',\\n children: <Input preIcon=\\\"user\\\" id=\\\"username\\\" />\\n },\\n password: {\\n labelClassName: 'fieldLabel',\\n labelStyle: { width: 60 },\\n labelFor: 'password',\\n children: <Input preIcon=\\\"lock\\\" id=\\\"password\\\" type=\\\"password\\\" />\\n },\\n terms: {\\n validator: (currentValue) => !currentValue ? '必须统一服务条款' : null,\\n children: <Checkbox value=\\\"1\\\">已阅读并同意</Checkbox>\\n }\\n }}\\n >\\n {({ fields, state, canSubmit }) => {\\n console.log('fields:', state);\\n return (\\n <div>\\n <Row>\\n <Col fixed>{fields.username}</Col>\\n </Row>\\n <Row>\\n <Col fixed>{fields.password}</Col>\\n </Row>\\n <Row>\\n <Col fixed align=\\\"middle\\\">{fields.terms}</Col>\\n <Col fixed style={{ marginTop: -4 }}><a href=\\\"#\\\">服务条款</a></Col>\\n </Row>\\n <Row>\\n <Col fixed>\\n <Button disabled={!canSubmit()} type=\\\"primary\\\" htmlType=\\\"submit\\\">提交</Button>\\n </Col>\\n </Row>\\n </div>\\n )\\n }}\\n </Form>\\n </div>\\n)\\nReactDOM.render(<Demo />, _mount_);\\n```\\n\\n### 表单提交\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->\\n```jsx\\nimport ReactDOM from 'react-dom';\\nimport { Form, Input, Select, Row, Col, Button } from 'uiw';\\n\\nconst Demo = () => (\\n <div>\\n <Form\\n onSubmit={({initial, current}) => {\\n console.log('-->>', initial, current);\\n }}\\n fields={{\\n firstName: {\\n labelClassName: 'fieldLabel',\\n labelStyle: { width: 60 },\\n inline: true,\\n label: '姓氏',\\n children: <Input />\\n },\\n lastName: {\\n labelClassName: 'fieldLabel',\\n labelStyle: { width: 60 },\\n initialValue: '先生',\\n inline: true,\\n label: '名字',\\n children: <Input />\\n },\\n email: {\\n labelClassName: 'fieldLabel',\\n labelStyle: { width: 60 },\\n validator: (currentValue) => {\\n return currentValue && currentValue.length < 2 ? 'Password must be 8+ characters' : null;\\n },\\n inline: true,\\n label: 'Email',\\n children: <Input />\\n },\\n select: {\\n labelClassName: 'fieldLabel',\\n labelStyle: { width: 60 },\\n inline: true,\\n label: '选择器',\\n children: (\\n <Select>\\n <Select.Option>Choose an item...</Select.Option>\\n <Select.Option value=\\\"1\\\">One</Select.Option>\\n <Select.Option value=\\\"2\\\">Two</Select.Option>\\n <Select.Option value=\\\"3\\\">Three</Select.Option>\\n <Select.Option value=\\\"4\\\">Four</Select.Option>\\n </Select>\\n ),\\n },\\n }}\\n >\\n {({ fields, state, canSubmit }) => {\\n console.log('fields:', state);\\n return (\\n <div>\\n <Row gutter={10} style={{ marginBottom: 10 }}>\\n <Col>{fields.firstName}</Col>\\n <Col>{fields.lastName}</Col>\\n </Row>\\n <Row gutter={10}>\\n <Col>{fields.email}</Col>\\n <Col>{fields.select}</Col>\\n </Row>\\n <Row gutter={10}>\\n <Col />\\n <Col fixed align=\\\"bottom\\\"><Button disabled={!canSubmit()} type=\\\"primary\\\" htmlType=\\\"submit\\\">提交</Button></Col>\\n </Row>\\n </div>\\n )\\n }}\\n </Form>\\n </div>\\n)\\nReactDOM.render(<Demo />, _mount_);\\n```\\n\\n\\n### 自定义控件应用\\n\\n下面实例是在 [`<Form />`](#/components/form) 表单组件中,应用自定义 `<CustomSelect />` 控件组件。\\n\\n> ⚠️ 注意,自定义控件需要两个必要的 `props` 参数,`value` 和 `onChange`\\n<!--rehype:style=border-left: 8px solid #ffe564;background-color: #ffe56440;padding: 12px 16px;-->\\n\\n- `value` 用于值传递,\\n- `onChange(value)` 用于值变更需要执行的回调函数,回调函数第一个参数必须是 `value`。\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->\\n```jsx\\nimport React from 'react';\\nimport ReactDOM from 'react-dom';\\nimport { Form, Row, Col, Dropdown, Menu, Icon, Button, Notify } from 'uiw';\\n\\n// 自定义组件\\nfunction CustomSelect(props) {\\n const { option = [], onChange } = props;\\n const [value, setValue] = React.useState(props.value);\\n const [isOpen, setIsOpen] = React.useState(false);\\n\\n React.useEffect(() => {\\n if (value !== props.value) {\\n setValue(props.value);\\n }\\n }, [props.value]);\\n const label = option.find(item => value === item.value);\\n return (\\n <Dropdown\\n trigger=\\\"click\\\"\\n onVisibleChange={(open) => setIsOpen(open)}\\n isOpen={isOpen}\\n menu={\\n <Menu bordered style={{ minWidth: 120 }}>\\n {option.map((item, idx) => (\\n <Menu.Item active={value === item.value} key={idx} text={item.label}\\n onClick={() => {\\n setValue(item.value);\\n setIsOpen(false)\\n onChange && onChange(item.value);\\n }}\\n />\\n ))}\\n </Menu>\\n }\\n >\\n <Button\\n style={{\\n boxShadow: 'inset 0 0 0 1px rgba(16, 22, 26, 0.2), inset 0 -1px 0 rgba(16, 22, 26, 0.1)'\\n }}\\n type=\\\"link\\\"\\n >\\n {label.label}<Icon type={isOpen ? 'up' : 'down'} />\\n </Button>\\n </Dropdown>\\n );\\n}\\n\\n// 自定义组件应用实例\\nconst Demo = () => (\\n <div>\\n <Form\\n onSubmitError={(error) => {\\n if (error.filed) {\\n return { ...error.filed };\\n }\\n return null;\\n }}\\n onSubmit={({initial, current}) => {\\n console.log('~~~', current);\\n const errorObj = {};\\n if (!current.select) {\\n errorObj.select = '内容为空,请输入内容';\\n }\\n if(Object.keys(errorObj).length > 0) {\\n const err = new Error();\\n err.filed = errorObj;\\n Notify.error({ title: '提交失败!', description: '请确认提交表单是否正确!' });\\n throw err;\\n }\\n Notify.success({\\n title: '提交成功!',\\n description: `表单提交成功,内容为:${current.select},将自动填充初始化值!`,\\n });\\n }}\\n fields={{\\n select: {\\n initialValue: 0,\\n children: (\\n <CustomSelect option={[\\n { label: '请选择', value: 0 },\\n { label: '经济舱', value: 1 },\\n { label: '豪华经济舱', value: 2 },\\n { label: '商务舱', value: 3 },\\n { label: '头等舱', value: 4 },\\n ]} />\\n )\\n },\\n }}\\n >\\n {({ fields, state, canSubmit }) => {\\n return (\\n <div>\\n <Row>\\n <Col style={{ maxWidth: 300 }}>{fields.select}</Col>\\n </Row>\\n <Row>\\n <Col fixed>\\n <Button disabled={!canSubmit()} type=\\\"primary\\\" htmlType=\\\"submit\\\">提交</Button>\\n </Col>\\n </Row>\\n </div>\\n )\\n }}\\n </Form>\\n </div>\\n)\\nReactDOM.render(<Demo />, _mount_);\\n```\\n\\n### FormItem 竖排\\n\\n对组件 `FormItem` 竖排展示示例。\\n\\n> ⚠️ 注意:当前只展示效果,`FormItem` 组件只在 `Form` 组件中使用。\\n<!--rehype:style=border-left: 8px solid #ffe564;background-color: #ffe56440;padding: 12px 16px;-->\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->\\n```jsx\\nimport ReactDOM from 'react-dom';\\nimport { Form, FormItem } from 'uiw';\\n\\nconst Demo = () => (\\n <Form>\\n <FormItem\\n label=\\\"可选字段\\\"\\n labelFor=\\\"basic-input\\\"\\n help={<span>在上面的字段中输入一个值</span>}\\n >\\n <Input id=\\\"basic-input\\\" type=\\\"text\\\"/>\\n </FormItem>\\n <FormItem\\n label=\\\"用户名\\\"\\n labelFor=\\\"username-input\\\"\\n help=\\\"用户名长度至少为8个字符串。\\\"\\n hasError={true}\\n >\\n <Input id=\\\"username-input\\\" type=\\\"text\\\"/>\\n </FormItem>\\n </Form>\\n)\\nReactDOM.render(<Demo />, _mount_);\\n```\\n\\n### FormItem 横排\\n\\n对组件 `FormItem` 横排展示示例。\\n\\n> ⚠️ 注意:当前只展示效果,`FormItem` 组件只在 `Form` 组件中使用。\\n<!--rehype:style=border-left: 8px solid #ffe564;background-color: #ffe56440;padding: 12px 16px;-->\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->\\n```jsx\\nimport ReactDOM from 'react-dom';\\nimport { Form, FormItem } from 'uiw';\\n\\nconst Demo = () => (\\n <Form>\\n <FormItem\\n inline={true}\\n label=\\\"可选字段\\\"\\n labelFor=\\\"basic-input-inline\\\"\\n help={<span>在上面的字段中输入一个值</span>}\\n onChange={() => {\\n console.log('TEST::');\\n }}\\n >\\n <Input id=\\\"basic-input-inline\\\" type=\\\"text\\\"/>\\n </FormItem>\\n <FormItem\\n inline={true}\\n label=\\\"用户名\\\"\\n labelFor=\\\"username-input-inline\\\"\\n labelClassName=\\\"username\\\"\\n help=\\\"用户名长度至少为8个字符串。\\\"\\n hasError={true}\\n >\\n <Input id=\\\"username-input-inline\\\" type=\\\"text\\\"/>\\n </FormItem>\\n </Form>\\n)\\nReactDOM.render(<Demo />, _mount_);\\n```\\n\\n## Form\\n\\n| 参数 | 说明 | 类型 | 默认值 |\\n|--------- |-------- |--------- |-------- |\\n| fields | 设置字段 | object | - |\\n| children | 回调 {`fields`, `state`, `canSubmit`, `resetForm`} | function | - |\\n| onSubmit | 提交表单时调用 | function({ initial, current }) | - |\\n| afterSubmit `@3.0.0+` | 提交回调 {`initial`, `current`} | function({ initial, current }) | - |\\n| onChange | 表单发生改变回调函数 {`initial`, `current`} | function({ initial, current }) | - |\\n| onSubmitError | 调用 `onSubmit` 抛出的任何错误。从字段名称返回对象映射。 | function | - |\\n| resetOnSubmit | 在 `onSubmit` 成功后将表单重置为其初始状态。| bool | `true` |\\n\\n```js\\n// => fields props\\n{\\n firstName: {\\n initialValue: '王',\\n inline: true,\\n label: '姓',\\n labelClassName: 'fieldLabel',\\n labelStyle: { width: 60 },\\n // 验证,通过 `canSubmit()` 方法获得,提交按钮是否被禁用\\n validator: (currentValue) => {},\\n help: '帮助提示信息!',\\n children: <Input type=\\\"number\\\" />\\n },\\n}\\n```\\n\\n## FormItem\\n\\n| 参数 | 说明 | 类型 | 默认值 |\\n|--------- |-------- |--------- |-------- |\\n| label | 表单标题展示 | string | - |\\n| labelClassName | 表单标题样式名称 | string | - |\\n| labelStyle | 表单标题样式 | object | - |\\n| labelFor | 列的宽度相对于同一网格中其他列的比率 | number | - |\\n| help | 提示信息 | ReactNode | - |\\n| hasError | 如果为true,则应用错误CSS。转动边框并帮助文字变红。 | number | - |\";"],"names":[],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- (self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2367],{84934:function(e){function n(e){var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}n.keys=function(){return[]},n.resolve=n,n.id=84934,e.exports=n},86082:function(e,n,t){"use strict";t.d(n,{Z:function(){return j}});var r=t(50189),o=t(53782),i=t(11026),s=t(41473),c=t(24931),d=t(75752),a=t(64508),u=t(69286),l=["version","dependencies","codePen","codeSandbox"];function p(e){var n=e.version,t=e.dependencies,i=e.codePen,s=e.codeSandbox,c=(0,o.Z)(e,l),d=(0,r.Z)({},c);return i&&(d.codePenOption={title:"uiw".concat(n," - demo"),includeModule:["uiw"],js:(d.code||"").replace("_mount_",'document.getElementById("container")'),html:'<div id="container" style="padding: 24px"></div>',css_external:"https://unpkg.com/uiw@".concat(n,"/dist/uiw.min.css"),js_external:"https://unpkg.com/react@16.x/umd/react.development.js;https://unpkg.com/react-dom@16.x/umd/react-dom.development.js;https://unpkg.com/classnames@2.2.6/index.js;https://unpkg.com/uiw@".concat(n,"/dist/uiw.min.js;https://unpkg.com/@uiw/codepen-require-polyfill@1.0.2/index.js")}),s&&(d.codeSandboxOption={files:{"sandbox.config.json":{content:'{\n "template": "node",\n "container": {\n "startScript": "start",\n "node": "14"\n }\n }'},"public/index.html":{content:'<div id="container"></div>'},"src/index.js":{content:(d.code||"").replace("_mount_",'document.getElementById("container")')},".kktrc.js":{content:'import webpack from "webpack";\nimport lessModules from "@kkt/less-modules";\nexport default (conf, env, options) => {\nconf = lessModules(conf, env, options);\nreturn conf;\n};'},"package.json":{content:{name:"uiw-demo",description:"uiw v".concat(n," - demo"),dependencies:{react:"latest","react-dom":"latest",uiw:"latest"},devDependencies:{"@kkt/less-modules":"6.9.0",kkt:"6.9.0",typescript:"4.1.3"},license:"MIT",scripts:{start:"kkt start",build:"kkt build",test:"kkt test --env=jsdom"},browserslist:[">0.2%","not dead","not ie <= 11","not op_mini all"]}}}}),(0,u.jsx)(a.Z,(0,r.Z)((0,r.Z)({},d),{},{dependencies:t,style:{marginBottom:0}}))}var h=t(22755);function m(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.path,t=/^http/.test(n||"")?n:"https://github.com/uiwjs/uiw/blob/master/".concat(n);return(0,u.jsxs)(s.Fragment,{children:["\u72af\u4e86\u9519\u8bef\u8fd8\u662f\u60f3\u5bf9\u6587\u4ef6\u505a\u51fa\u8d21\u732e\uff1f",t&&(0,u.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",children:"\u5728Github\u4e0a\u7f16\u8f91\u672c\u9875\uff01"}),(0,u.jsx)("br",{}),(0,u.jsx)("a",{href:"https://github.com/uiwjs/uiw/issues",target:"_blank",rel:"noopener noreferrer",children:"\u53cd\u9988\u5efa\u8bae"}),(0,u.jsx)(h.iz,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/uiwjs/uiw/issues/new",children:"\u63d0\u4ea4bug"}),(0,u.jsx)(h.iz,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/uiwjs/uiw",children:"Github"}),(0,u.jsx)(h.iz,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/kktjs/kkt",children:"kkt"}),(0,u.jsx)(h.iz,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/kktjs/kkt-ssr",children:"@kkt/ssr"}),(0,u.jsx)(h.iz,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"http://uiw.gitee.io",children:"\u56fd\u5185\u955c\u50cf"})]})}var f="index_docinfo__3Vx8S",k="index_markdown__hcQCp",v=["inline","node"],x=function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return n.forEach((function(n){"text"===n.type?t+=n.value:n.children&&Array.isArray(n.children)&&(t+=e(n.children))})),t};function j(e){var n=e.renderPage,t=e.dependencies,a=e.path,l=(0,s.useState)(""),h=(0,i.Z)(l,2),j=h[0],b=h[1],g=d.i8||"2.0.0";return(0,s.useEffect)((function(){n&&n().then((function(e){b(e)})).catch((function(){}))}),[]),j?(0,u.jsxs)("div",{children:[(0,u.jsx)(c.Z,{source:j,className:k,components:{code:function(e){var n=e.inline,i=e.node,s=(0,o.Z)(e,v),c=s,d=c.noPreview,a=c.noScroll,l=c.bgWhite,h=c.noCode,m=c.codePen;if(n)return(0,u.jsx)("code",(0,r.Z)({},s));var f={noPreview:d,noScroll:a,bgWhite:l,noCode:h,codePen:m};return 0===Object.keys(f).filter((function(e){return void 0!==f[e]})).length?(0,u.jsx)("code",(0,r.Z)({},s)):(0,u.jsx)(p,{version:g,code:x(i.children),dependencies:t,noPreview:d,noScroll:a,bgWhite:l,noCode:h,codePen:m})}}}),(0,u.jsx)("div",{className:f,children:(0,u.jsx)(m,{path:a})})]}):null}},23472:function(e,n,t){"use strict";t.r(n);var r=t(27791),o=t(57135),i=t.n(o),s=(t(41473),t(22755)),c=t(86082),d=t(69286);n.default=function(){return(0,d.jsx)(c.Z,{path:"https://github.com/uiwjs/react-split/edit/master/README.md",dependencies:{Split:s.P,Divider:s.iz,Button:s.zx,Menu:s.v2},renderPage:(0,r.Z)(i().mark((function e(){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.e(486).then(t.bind(t,60486));case 2:return n=e.sent,e.abrupt("return",n.default||n);case 4:case"end":return e.stop()}}),e)})))})}}}]);
2
- //# sourceMappingURL=2367.234da486.chunk.js.map
1
+ (self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6715],{84934:function(e){function n(e){var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}n.keys=function(){return[]},n.resolve=n,n.id=84934,e.exports=n},86082:function(e,n,t){"use strict";t.d(n,{Z:function(){return j}});var r=t(50189),o=t(53782),i=t(11026),s=t(41473),c=t(24931),d=t(75752),a=t(64508),u=t(69286),l=["version","dependencies","codePen","codeSandbox"];function p(e){var n=e.version,t=e.dependencies,i=e.codePen,s=e.codeSandbox,c=(0,o.Z)(e,l),d=(0,r.Z)({},c);return i&&(d.codePenOption={title:"uiw".concat(n," - demo"),includeModule:["uiw"],js:(d.code||"").replace("_mount_",'document.getElementById("container")'),html:'<div id="container" style="padding: 24px"></div>',css_external:"https://unpkg.com/uiw@".concat(n,"/dist/uiw.min.css"),js_external:"https://unpkg.com/react@16.x/umd/react.development.js;https://unpkg.com/react-dom@16.x/umd/react-dom.development.js;https://unpkg.com/classnames@2.2.6/index.js;https://unpkg.com/uiw@".concat(n,"/dist/uiw.min.js;https://unpkg.com/@uiw/codepen-require-polyfill@1.0.2/index.js")}),s&&(d.codeSandboxOption={files:{"sandbox.config.json":{content:'{\n "template": "node",\n "container": {\n "startScript": "start",\n "node": "14"\n }\n }'},"public/index.html":{content:'<div id="container"></div>'},"src/index.js":{content:(d.code||"").replace("_mount_",'document.getElementById("container")')},".kktrc.js":{content:'import webpack from "webpack";\nimport lessModules from "@kkt/less-modules";\nexport default (conf, env, options) => {\nconf = lessModules(conf, env, options);\nreturn conf;\n};'},"package.json":{content:{name:"uiw-demo",description:"uiw v".concat(n," - demo"),dependencies:{react:"latest","react-dom":"latest",uiw:"latest"},devDependencies:{"@kkt/less-modules":"6.9.0",kkt:"6.9.0",typescript:"4.1.3"},license:"MIT",scripts:{start:"kkt start",build:"kkt build",test:"kkt test --env=jsdom"},browserslist:[">0.2%","not dead","not ie <= 11","not op_mini all"]}}}}),(0,u.jsx)(a.Z,(0,r.Z)((0,r.Z)({},d),{},{dependencies:t,style:{marginBottom:0}}))}var h=t(35123);function m(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.path,t=/^http/.test(n||"")?n:"https://github.com/uiwjs/uiw/blob/master/".concat(n);return(0,u.jsxs)(s.Fragment,{children:["\u72af\u4e86\u9519\u8bef\u8fd8\u662f\u60f3\u5bf9\u6587\u4ef6\u505a\u51fa\u8d21\u732e\uff1f",t&&(0,u.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",children:"\u5728Github\u4e0a\u7f16\u8f91\u672c\u9875\uff01"}),(0,u.jsx)("br",{}),(0,u.jsx)("a",{href:"https://github.com/uiwjs/uiw/issues",target:"_blank",rel:"noopener noreferrer",children:"\u53cd\u9988\u5efa\u8bae"}),(0,u.jsx)(h.iz,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/uiwjs/uiw/issues/new",children:"\u63d0\u4ea4bug"}),(0,u.jsx)(h.iz,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/uiwjs/uiw",children:"Github"}),(0,u.jsx)(h.iz,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/kktjs/kkt",children:"kkt"}),(0,u.jsx)(h.iz,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/kktjs/kkt-ssr",children:"@kkt/ssr"}),(0,u.jsx)(h.iz,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"http://uiw.gitee.io",children:"\u56fd\u5185\u955c\u50cf"})]})}var f="index_docinfo__3Vx8S",k="index_markdown__hcQCp",b=["inline","node"],x=function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return n.forEach((function(n){"text"===n.type?t+=n.value:n.children&&Array.isArray(n.children)&&(t+=e(n.children))})),t};function j(e){var n=e.renderPage,t=e.dependencies,a=e.path,l=(0,s.useState)(""),h=(0,i.Z)(l,2),j=h[0],v=h[1],g=d.i8||"2.0.0";return(0,s.useEffect)((function(){n&&n().then((function(e){v(e)})).catch((function(){}))}),[]),j?(0,u.jsxs)("div",{children:[(0,u.jsx)(c.Z,{source:j,className:k,components:{code:function(e){var n=e.inline,i=e.node,s=(0,o.Z)(e,b),c=s,d=c.noPreview,a=c.bordered,l=c.noScroll,h=c.bgWhite,m=c.noCode,f=c.codePen;if(n)return(0,u.jsx)("code",(0,r.Z)({},s));var k={noPreview:d,bordered:a,noScroll:l,bgWhite:h,noCode:m,codePen:f};return 0===Object.keys(k).filter((function(e){return void 0!==k[e]})).length?(0,u.jsx)("code",(0,r.Z)({},s)):(0,u.jsx)(p,{version:g,code:x(i.children),dependencies:t,noPreview:d,bordered:a,noScroll:l,bgWhite:h,noCode:m,codePen:f})}}}),(0,u.jsx)("div",{className:f,children:(0,u.jsx)(m,{path:a})})]}):null}},56238:function(e,n,t){"use strict";t.r(n);var r=t(27791),o=t(57135),i=t.n(o),s=(t(41473),t(86082)),c=t(69286);n.default=function(){return(0,c.jsx)(s.Z,{path:"https://github.com/uiwjs/uiw/tree/master/website/src/routes/guide/import/README.md",renderPage:(0,r.Z)(i().mark((function e(){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.e(1358).then(t.bind(t,71358));case 2:return n=e.sent,e.abrupt("return",n.default||n);case 4:case"end":return e.stop()}}),e)})))})}}}]);
2
+ //# sourceMappingURL=6715.fb4ea4c4.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"static/js/5595.6d07e12f.chunk.js","mappings":"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","sources":["../../node_modules/@babel/standalone|sync|nonrecursive","components/Markdown/Code.tsx","components/Markdown/Footer.tsx","webpack://website/./src/components/Markdown/index.module.less?6e49","components/Markdown/index.tsx","routes/components/list/index.tsx"],"sourcesContent":["function webpackEmptyContext(req) {\n\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\te.code = 'MODULE_NOT_FOUND';\n\tthrow e;\n}\nwebpackEmptyContext.keys = function() { return []; };\nwebpackEmptyContext.resolve = webpackEmptyContext;\nwebpackEmptyContext.id = 84934;\nmodule.exports = webpackEmptyContext;","import CodePreview, { CodePreviewProps } from '@uiw/react-code-preview';\n\nexport interface CodeProps extends CodePreviewProps {\n code: string;\n version: string;\n codePen: boolean;\n codeSandbox?: boolean;\n dependencies: any;\n}\n\nexport default function Code({ version, dependencies, codePen, codeSandbox, ...other }: CodeProps) {\n const props: CodePreviewProps = { ...other };\n if (codePen) {\n props.codePenOption = {\n title: `uiw${version} - demo`,\n includeModule: ['uiw'],\n js: (props.code || '').replace('_mount_', 'document.getElementById(\"container\")'),\n html: '<div id=\"container\" style=\"padding: 24px\"></div>',\n css_external: `https://unpkg.com/uiw@${version}/dist/uiw.min.css`,\n js_external: `https://unpkg.com/react@16.x/umd/react.development.js;https://unpkg.com/react-dom@16.x/umd/react-dom.development.js;https://unpkg.com/classnames@2.2.6/index.js;https://unpkg.com/uiw@${version}/dist/uiw.min.js;https://unpkg.com/@uiw/codepen-require-polyfill@1.0.2/index.js`,\n };\n }\n if (codeSandbox) {\n props.codeSandboxOption = {\n files: {\n 'sandbox.config.json': {\n content: `{\n \"template\": \"node\",\n \"container\": {\n \"startScript\": \"start\",\n \"node\": \"14\"\n }\n }`,\n },\n 'public/index.html': {\n content: `<div id=\"container\"></div>`,\n },\n 'src/index.js': {\n content: (props.code || '').replace('_mount_', 'document.getElementById(\"container\")'),\n },\n '.kktrc.js': {\n content: `import webpack from \"webpack\";\\nimport lessModules from \"@kkt/less-modules\";\\nexport default (conf, env, options) => {\\nconf = lessModules(conf, env, options);\\nreturn conf;\\n};`,\n },\n 'package.json': {\n content: {\n name: 'uiw-demo',\n description: `uiw v${version} - demo`,\n dependencies: {\n react: 'latest',\n 'react-dom': 'latest',\n uiw: 'latest',\n },\n devDependencies: {\n '@kkt/less-modules': '6.9.0',\n kkt: '6.9.0',\n typescript: '4.1.3',\n },\n license: 'MIT',\n scripts: {\n start: 'kkt start',\n build: 'kkt build',\n test: 'kkt test --env=jsdom',\n },\n browserslist: ['>0.2%', 'not dead', 'not ie <= 11', 'not op_mini all'],\n },\n },\n },\n };\n }\n return <CodePreview {...props} dependencies={dependencies} style={{ marginBottom: 0 }} />;\n}\n","import React, { Fragment } from 'react';\nimport { Divider } from 'uiw';\n\nexport type FooterProps = {\n path?: string;\n};\n\nexport default function (props: FooterProps = {}) {\n const { path } = props;\n const url = /^http/.test(path || '') ? path : `https://github.com/uiwjs/uiw/blob/master/${path}`;\n return (\n <Fragment>\n 犯了错误还是想对文件做出贡献?\n {url && (\n <a href={url} target=\"_blank\" rel=\"noopener noreferrer\">\n 在Github上编辑本页!\n </a>\n )}\n <br />\n <a href=\"https://github.com/uiwjs/uiw/issues\" target=\"_blank\" rel=\"noopener noreferrer\">\n 反馈建议\n </a>\n <Divider type=\"vertical\" />\n <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/uiwjs/uiw/issues/new\">\n 提交bug\n </a>\n <Divider type=\"vertical\" />\n <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/uiwjs/uiw\">\n Github\n </a>\n <Divider type=\"vertical\" />\n <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/kktjs/kkt\">\n kkt\n </a>\n <Divider type=\"vertical\" />\n <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/kktjs/kkt-ssr\">\n @kkt/ssr\n </a>\n <Divider type=\"vertical\" />\n <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"http://uiw.gitee.io\">\n 国内镜像\n </a>\n </Fragment>\n );\n}\n","// extracted by mini-css-extract-plugin\nexport default {\"docinfo\":\"index_docinfo__3Vx8S\",\"markdown\":\"index_markdown__hcQCp\"};","import { useEffect, useState } from 'react';\nimport MarkdownPreview from '@uiw/react-markdown-preview';\nimport pkg from 'uiw/package.json';\nimport Code from './Code';\nimport Footer from './Footer';\nimport styles from './index.module.less';\n\nexport type CreatePageProps<T> = {\n dependencies?: T;\n path: string;\n renderPage?: () => Promise<string>;\n};\n\nconst getCodeStr = (data: any[] = [], code: string = '') => {\n data.forEach((node) => {\n if (node.type === 'text') {\n code += node.value;\n } else if (node.children && Array.isArray(node.children)) {\n code += getCodeStr(node.children);\n }\n });\n return code;\n};\n\nexport default function CreatePage<T>(props: CreatePageProps<T>) {\n const { renderPage, dependencies, path } = props;\n const [mdStr, setMdStr] = useState('');\n\n const version = pkg.version || '2.0.0';\n useEffect(() => {\n if (renderPage) {\n renderPage()\n .then((str) => {\n setMdStr(str);\n })\n .catch(() => {});\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n if (!mdStr) {\n return null;\n }\n\n return (\n <div>\n <MarkdownPreview\n source={mdStr}\n className={styles.markdown}\n components={{\n /**\n * bgWhite 设置代码预览背景白色,否则为格子背景。\n * noCode 不显示代码编辑器。\n * noPreview 不显示代码预览效果。\n * noScroll 预览区域不显示滚动条。\n * codePen 显示 Codepen 按钮,要特别注意 包导入的问题,实例中的 import 主要用于 Codepen 使用。\n */\n code: ({ inline, node, ...props }) => {\n const { noPreview, noScroll, bgWhite, noCode, codePen } = props as any;\n if (inline) {\n return <code {...props} />;\n }\n const config = {\n noPreview,\n noScroll,\n bgWhite,\n noCode,\n codePen,\n } as any;\n if (Object.keys(config).filter((name) => config[name] !== undefined).length === 0) {\n return <code {...props} />;\n }\n return (\n <Code\n version={version}\n code={getCodeStr(node.children)}\n dependencies={dependencies}\n {...{ noPreview, noScroll, bgWhite, noCode, codePen }}\n />\n );\n },\n }}\n />\n <div className={styles.docinfo}>\n <Footer path={path} />\n </div>\n </div>\n );\n}\n","import React from 'react';\nimport { List } from 'uiw';\nimport Markdown from '../../../components/Markdown';\n\nexport default function Page() {\n return (\n <Markdown\n path=\"https://github.com/uiwjs/uiw/tree/master/packages/react-list/README.md\"\n dependencies={{ List }}\n renderPage={async () => {\n const md = await import('uiw/node_modules/@uiw/react-list/README.md');\n return md.default || md;\n }}\n />\n );\n}\n"],"names":["webpackEmptyContext","req","e","Error","code","keys","resolve","id","module","exports","Code","version","dependencies","codePen","codeSandbox","other","props","codePenOption","title","includeModule","js","replace","html","css_external","js_external","codeSandboxOption","files","content","name","description","react","uiw","devDependencies","kkt","typescript","license","scripts","start","build","test","browserslist","style","marginBottom","path","url","Fragment","href","target","rel","type","getCodeStr","data","forEach","node","value","children","Array","isArray","CreatePage","renderPage","useState","mdStr","setMdStr","pkg","useEffect","then","str","catch","source","className","styles","components","inline","noPreview","noScroll","bgWhite","noCode","config","Object","filter","undefined","length","Footer","Page","List","md","default"],"sourceRoot":""}
1
+ {"version":3,"file":"static/js/6715.fb4ea4c4.chunk.js","mappings":"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","sources":["../../node_modules/@babel/standalone|sync|nonrecursive","components/Markdown/Code.tsx","components/Markdown/Footer.tsx","webpack://website/./src/components/Markdown/index.module.less?6e49","components/Markdown/index.tsx","routes/guide/import/index.tsx"],"sourcesContent":["function webpackEmptyContext(req) {\n\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\te.code = 'MODULE_NOT_FOUND';\n\tthrow e;\n}\nwebpackEmptyContext.keys = function() { return []; };\nwebpackEmptyContext.resolve = webpackEmptyContext;\nwebpackEmptyContext.id = 84934;\nmodule.exports = webpackEmptyContext;","import CodePreview, { CodePreviewProps } from '@uiw/react-code-preview';\n\nexport interface CodeProps extends CodePreviewProps {\n code: string;\n version: string;\n codePen: boolean;\n codeSandbox?: boolean;\n dependencies: any;\n}\n\nexport default function Code({ version, dependencies, codePen, codeSandbox, ...other }: CodeProps) {\n const props: CodePreviewProps = { ...other };\n if (codePen) {\n props.codePenOption = {\n title: `uiw${version} - demo`,\n includeModule: ['uiw'],\n js: (props.code || '').replace('_mount_', 'document.getElementById(\"container\")'),\n html: '<div id=\"container\" style=\"padding: 24px\"></div>',\n css_external: `https://unpkg.com/uiw@${version}/dist/uiw.min.css`,\n js_external: `https://unpkg.com/react@16.x/umd/react.development.js;https://unpkg.com/react-dom@16.x/umd/react-dom.development.js;https://unpkg.com/classnames@2.2.6/index.js;https://unpkg.com/uiw@${version}/dist/uiw.min.js;https://unpkg.com/@uiw/codepen-require-polyfill@1.0.2/index.js`,\n };\n }\n if (codeSandbox) {\n props.codeSandboxOption = {\n files: {\n 'sandbox.config.json': {\n content: `{\n \"template\": \"node\",\n \"container\": {\n \"startScript\": \"start\",\n \"node\": \"14\"\n }\n }`,\n },\n 'public/index.html': {\n content: `<div id=\"container\"></div>`,\n },\n 'src/index.js': {\n content: (props.code || '').replace('_mount_', 'document.getElementById(\"container\")'),\n },\n '.kktrc.js': {\n content: `import webpack from \"webpack\";\\nimport lessModules from \"@kkt/less-modules\";\\nexport default (conf, env, options) => {\\nconf = lessModules(conf, env, options);\\nreturn conf;\\n};`,\n },\n 'package.json': {\n content: {\n name: 'uiw-demo',\n description: `uiw v${version} - demo`,\n dependencies: {\n react: 'latest',\n 'react-dom': 'latest',\n uiw: 'latest',\n },\n devDependencies: {\n '@kkt/less-modules': '6.9.0',\n kkt: '6.9.0',\n typescript: '4.1.3',\n },\n license: 'MIT',\n scripts: {\n start: 'kkt start',\n build: 'kkt build',\n test: 'kkt test --env=jsdom',\n },\n browserslist: ['>0.2%', 'not dead', 'not ie <= 11', 'not op_mini all'],\n },\n },\n },\n };\n }\n return <CodePreview {...props} dependencies={dependencies} style={{ marginBottom: 0 }} />;\n}\n","import React, { Fragment } from 'react';\nimport { Divider } from 'uiw';\n\nexport type FooterProps = {\n path?: string;\n};\n\nexport default function (props: FooterProps = {}) {\n const { path } = props;\n const url = /^http/.test(path || '') ? path : `https://github.com/uiwjs/uiw/blob/master/${path}`;\n return (\n <Fragment>\n 犯了错误还是想对文件做出贡献?\n {url && (\n <a href={url} target=\"_blank\" rel=\"noopener noreferrer\">\n 在Github上编辑本页!\n </a>\n )}\n <br />\n <a href=\"https://github.com/uiwjs/uiw/issues\" target=\"_blank\" rel=\"noopener noreferrer\">\n 反馈建议\n </a>\n <Divider type=\"vertical\" />\n <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/uiwjs/uiw/issues/new\">\n 提交bug\n </a>\n <Divider type=\"vertical\" />\n <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/uiwjs/uiw\">\n Github\n </a>\n <Divider type=\"vertical\" />\n <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/kktjs/kkt\">\n kkt\n </a>\n <Divider type=\"vertical\" />\n <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/kktjs/kkt-ssr\">\n @kkt/ssr\n </a>\n <Divider type=\"vertical\" />\n <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"http://uiw.gitee.io\">\n 国内镜像\n </a>\n </Fragment>\n );\n}\n","// extracted by mini-css-extract-plugin\nexport default {\"docinfo\":\"index_docinfo__3Vx8S\",\"markdown\":\"index_markdown__hcQCp\"};","import { useEffect, useState } from 'react';\nimport MarkdownPreview from '@uiw/react-markdown-preview';\nimport pkg from 'uiw/package.json';\nimport Code from './Code';\nimport Footer from './Footer';\nimport styles from './index.module.less';\n\nexport type CreatePageProps<T> = {\n dependencies?: T;\n path: string;\n renderPage?: () => Promise<string>;\n};\n\nconst getCodeStr = (data: any[] = [], code: string = '') => {\n data.forEach((node) => {\n if (node.type === 'text') {\n code += node.value;\n } else if (node.children && Array.isArray(node.children)) {\n code += getCodeStr(node.children);\n }\n });\n return code;\n};\n\nexport default function CreatePage<T>(props: CreatePageProps<T>) {\n const { renderPage, dependencies, path } = props;\n const [mdStr, setMdStr] = useState('');\n\n const version = pkg.version || '2.0.0';\n useEffect(() => {\n if (renderPage) {\n renderPage()\n .then((str) => {\n setMdStr(str);\n })\n .catch(() => {});\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n if (!mdStr) {\n return null;\n }\n\n return (\n <div>\n <MarkdownPreview\n source={mdStr}\n className={styles.markdown}\n components={{\n /**\n * bordered 边框\n * bgWhite 设置代码预览背景白色,否则为格子背景。\n * noCode 不显示代码编辑器。\n * noPreview 不显示代码预览效果。\n * noScroll 预览区域不显示滚动条。\n * codePen 显示 Codepen 按钮,要特别注意 包导入的问题,实例中的 import 主要用于 Codepen 使用。\n */\n code: ({ inline, node, ...props }) => {\n const { noPreview, bordered, noScroll, bgWhite, noCode, codePen } = props as any;\n if (inline) {\n return <code {...props} />;\n }\n const config = {\n noPreview,\n bordered,\n noScroll,\n bgWhite,\n noCode,\n codePen,\n } as any;\n if (Object.keys(config).filter((name) => config[name] !== undefined).length === 0) {\n return <code {...props} />;\n }\n return (\n <Code\n version={version}\n code={getCodeStr(node.children)}\n dependencies={dependencies}\n {...{ noPreview, bordered, noScroll, bgWhite, noCode, codePen }}\n />\n );\n },\n }}\n />\n <div className={styles.docinfo}>\n <Footer path={path} />\n </div>\n </div>\n );\n}\n","import React from 'react';\nimport Markdown from '../../../components/Markdown';\n\nexport default () => (\n <Markdown\n path=\"https://github.com/uiwjs/uiw/tree/master/website/src/routes/guide/import/README.md\"\n renderPage={async () => {\n const md = await import('./README.md');\n return md.default || md;\n }}\n />\n);\n"],"names":["webpackEmptyContext","req","e","Error","code","keys","resolve","id","module","exports","Code","version","dependencies","codePen","codeSandbox","other","props","codePenOption","title","includeModule","js","replace","html","css_external","js_external","codeSandboxOption","files","content","name","description","react","uiw","devDependencies","kkt","typescript","license","scripts","start","build","test","browserslist","style","marginBottom","path","url","Fragment","href","target","rel","type","getCodeStr","data","forEach","node","value","children","Array","isArray","CreatePage","renderPage","useState","mdStr","setMdStr","pkg","useEffect","then","str","catch","source","className","styles","components","inline","noPreview","bordered","noScroll","bgWhite","noCode","config","Object","filter","undefined","length","Footer","md","default"],"sourceRoot":""}
@@ -0,0 +1,2 @@
1
+ (self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6730],{84934:function(e){function n(e){var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}n.keys=function(){return[]},n.resolve=n,n.id=84934,e.exports=n},86082:function(e,n,t){"use strict";t.d(n,{Z:function(){return j}});var r=t(50189),o=t(53782),i=t(11026),s=t(41473),c=t(24931),d=t(75752),a=t(64508),u=t(69286),l=["version","dependencies","codePen","codeSandbox"];function p(e){var n=e.version,t=e.dependencies,i=e.codePen,s=e.codeSandbox,c=(0,o.Z)(e,l),d=(0,r.Z)({},c);return i&&(d.codePenOption={title:"uiw".concat(n," - demo"),includeModule:["uiw"],js:(d.code||"").replace("_mount_",'document.getElementById("container")'),html:'<div id="container" style="padding: 24px"></div>',css_external:"https://unpkg.com/uiw@".concat(n,"/dist/uiw.min.css"),js_external:"https://unpkg.com/react@16.x/umd/react.development.js;https://unpkg.com/react-dom@16.x/umd/react-dom.development.js;https://unpkg.com/classnames@2.2.6/index.js;https://unpkg.com/uiw@".concat(n,"/dist/uiw.min.js;https://unpkg.com/@uiw/codepen-require-polyfill@1.0.2/index.js")}),s&&(d.codeSandboxOption={files:{"sandbox.config.json":{content:'{\n "template": "node",\n "container": {\n "startScript": "start",\n "node": "14"\n }\n }'},"public/index.html":{content:'<div id="container"></div>'},"src/index.js":{content:(d.code||"").replace("_mount_",'document.getElementById("container")')},".kktrc.js":{content:'import webpack from "webpack";\nimport lessModules from "@kkt/less-modules";\nexport default (conf, env, options) => {\nconf = lessModules(conf, env, options);\nreturn conf;\n};'},"package.json":{content:{name:"uiw-demo",description:"uiw v".concat(n," - demo"),dependencies:{react:"latest","react-dom":"latest",uiw:"latest"},devDependencies:{"@kkt/less-modules":"6.9.0",kkt:"6.9.0",typescript:"4.1.3"},license:"MIT",scripts:{start:"kkt start",build:"kkt build",test:"kkt test --env=jsdom"},browserslist:[">0.2%","not dead","not ie <= 11","not op_mini all"]}}}}),(0,u.jsx)(a.Z,(0,r.Z)((0,r.Z)({},d),{},{dependencies:t,style:{marginBottom:0}}))}var h=t(35123);function m(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.path,t=/^http/.test(n||"")?n:"https://github.com/uiwjs/uiw/blob/master/".concat(n);return(0,u.jsxs)(s.Fragment,{children:["\u72af\u4e86\u9519\u8bef\u8fd8\u662f\u60f3\u5bf9\u6587\u4ef6\u505a\u51fa\u8d21\u732e\uff1f",t&&(0,u.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",children:"\u5728Github\u4e0a\u7f16\u8f91\u672c\u9875\uff01"}),(0,u.jsx)("br",{}),(0,u.jsx)("a",{href:"https://github.com/uiwjs/uiw/issues",target:"_blank",rel:"noopener noreferrer",children:"\u53cd\u9988\u5efa\u8bae"}),(0,u.jsx)(h.iz,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/uiwjs/uiw/issues/new",children:"\u63d0\u4ea4bug"}),(0,u.jsx)(h.iz,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/uiwjs/uiw",children:"Github"}),(0,u.jsx)(h.iz,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/kktjs/kkt",children:"kkt"}),(0,u.jsx)(h.iz,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/kktjs/kkt-ssr",children:"@kkt/ssr"}),(0,u.jsx)(h.iz,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"http://uiw.gitee.io",children:"\u56fd\u5185\u955c\u50cf"})]})}var f="index_docinfo__3Vx8S",k="index_markdown__hcQCp",x=["inline","node"],b=function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return n.forEach((function(n){"text"===n.type?t+=n.value:n.children&&Array.isArray(n.children)&&(t+=e(n.children))})),t};function j(e){var n=e.renderPage,t=e.dependencies,a=e.path,l=(0,s.useState)(""),h=(0,i.Z)(l,2),j=h[0],v=h[1],g=d.i8||"2.0.0";return(0,s.useEffect)((function(){n&&n().then((function(e){v(e)})).catch((function(){}))}),[]),j?(0,u.jsxs)("div",{children:[(0,u.jsx)(c.Z,{source:j,className:k,components:{code:function(e){var n=e.inline,i=e.node,s=(0,o.Z)(e,x),c=s,d=c.noPreview,a=c.bordered,l=c.noScroll,h=c.bgWhite,m=c.noCode,f=c.codePen;if(n)return(0,u.jsx)("code",(0,r.Z)({},s));var k={noPreview:d,bordered:a,noScroll:l,bgWhite:h,noCode:m,codePen:f};return 0===Object.keys(k).filter((function(e){return void 0!==k[e]})).length?(0,u.jsx)("code",(0,r.Z)({},s)):(0,u.jsx)(p,{version:g,code:b(i.children),dependencies:t,noPreview:d,bordered:a,noScroll:l,bgWhite:h,noCode:m,codePen:f})}}}),(0,u.jsx)("div",{className:f,children:(0,u.jsx)(m,{path:a})})]}):null}},29569:function(e,n,t){"use strict";t.r(n);var r=t(27791),o=t(57135),i=t.n(o),s=(t(41473),t(86082)),c=t(69286);n.default=function(){return(0,c.jsx)(s.Z,{path:"https://github.com/uiwjs/uiw/tree/master/website/src/routes/extensions/README.md",renderPage:(0,r.Z)(i().mark((function e(){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.e(2926).then(t.bind(t,2926));case 2:return n=e.sent,e.abrupt("return",n.default||n);case 4:case"end":return e.stop()}}),e)})))})}}}]);
2
+ //# sourceMappingURL=6730.85ac4657.chunk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"static/js/6730.85ac4657.chunk.js","mappings":"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","sources":["../../node_modules/@babel/standalone|sync|nonrecursive","components/Markdown/Code.tsx","components/Markdown/Footer.tsx","webpack://website/./src/components/Markdown/index.module.less?6e49","components/Markdown/index.tsx","routes/extensions/index.tsx"],"sourcesContent":["function webpackEmptyContext(req) {\n\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\te.code = 'MODULE_NOT_FOUND';\n\tthrow e;\n}\nwebpackEmptyContext.keys = function() { return []; };\nwebpackEmptyContext.resolve = webpackEmptyContext;\nwebpackEmptyContext.id = 84934;\nmodule.exports = webpackEmptyContext;","import CodePreview, { CodePreviewProps } from '@uiw/react-code-preview';\n\nexport interface CodeProps extends CodePreviewProps {\n code: string;\n version: string;\n codePen: boolean;\n codeSandbox?: boolean;\n dependencies: any;\n}\n\nexport default function Code({ version, dependencies, codePen, codeSandbox, ...other }: CodeProps) {\n const props: CodePreviewProps = { ...other };\n if (codePen) {\n props.codePenOption = {\n title: `uiw${version} - demo`,\n includeModule: ['uiw'],\n js: (props.code || '').replace('_mount_', 'document.getElementById(\"container\")'),\n html: '<div id=\"container\" style=\"padding: 24px\"></div>',\n css_external: `https://unpkg.com/uiw@${version}/dist/uiw.min.css`,\n js_external: `https://unpkg.com/react@16.x/umd/react.development.js;https://unpkg.com/react-dom@16.x/umd/react-dom.development.js;https://unpkg.com/classnames@2.2.6/index.js;https://unpkg.com/uiw@${version}/dist/uiw.min.js;https://unpkg.com/@uiw/codepen-require-polyfill@1.0.2/index.js`,\n };\n }\n if (codeSandbox) {\n props.codeSandboxOption = {\n files: {\n 'sandbox.config.json': {\n content: `{\n \"template\": \"node\",\n \"container\": {\n \"startScript\": \"start\",\n \"node\": \"14\"\n }\n }`,\n },\n 'public/index.html': {\n content: `<div id=\"container\"></div>`,\n },\n 'src/index.js': {\n content: (props.code || '').replace('_mount_', 'document.getElementById(\"container\")'),\n },\n '.kktrc.js': {\n content: `import webpack from \"webpack\";\\nimport lessModules from \"@kkt/less-modules\";\\nexport default (conf, env, options) => {\\nconf = lessModules(conf, env, options);\\nreturn conf;\\n};`,\n },\n 'package.json': {\n content: {\n name: 'uiw-demo',\n description: `uiw v${version} - demo`,\n dependencies: {\n react: 'latest',\n 'react-dom': 'latest',\n uiw: 'latest',\n },\n devDependencies: {\n '@kkt/less-modules': '6.9.0',\n kkt: '6.9.0',\n typescript: '4.1.3',\n },\n license: 'MIT',\n scripts: {\n start: 'kkt start',\n build: 'kkt build',\n test: 'kkt test --env=jsdom',\n },\n browserslist: ['>0.2%', 'not dead', 'not ie <= 11', 'not op_mini all'],\n },\n },\n },\n };\n }\n return <CodePreview {...props} dependencies={dependencies} style={{ marginBottom: 0 }} />;\n}\n","import React, { Fragment } from 'react';\nimport { Divider } from 'uiw';\n\nexport type FooterProps = {\n path?: string;\n};\n\nexport default function (props: FooterProps = {}) {\n const { path } = props;\n const url = /^http/.test(path || '') ? path : `https://github.com/uiwjs/uiw/blob/master/${path}`;\n return (\n <Fragment>\n 犯了错误还是想对文件做出贡献?\n {url && (\n <a href={url} target=\"_blank\" rel=\"noopener noreferrer\">\n 在Github上编辑本页!\n </a>\n )}\n <br />\n <a href=\"https://github.com/uiwjs/uiw/issues\" target=\"_blank\" rel=\"noopener noreferrer\">\n 反馈建议\n </a>\n <Divider type=\"vertical\" />\n <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/uiwjs/uiw/issues/new\">\n 提交bug\n </a>\n <Divider type=\"vertical\" />\n <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/uiwjs/uiw\">\n Github\n </a>\n <Divider type=\"vertical\" />\n <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/kktjs/kkt\">\n kkt\n </a>\n <Divider type=\"vertical\" />\n <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/kktjs/kkt-ssr\">\n @kkt/ssr\n </a>\n <Divider type=\"vertical\" />\n <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"http://uiw.gitee.io\">\n 国内镜像\n </a>\n </Fragment>\n );\n}\n","// extracted by mini-css-extract-plugin\nexport default {\"docinfo\":\"index_docinfo__3Vx8S\",\"markdown\":\"index_markdown__hcQCp\"};","import { useEffect, useState } from 'react';\nimport MarkdownPreview from '@uiw/react-markdown-preview';\nimport pkg from 'uiw/package.json';\nimport Code from './Code';\nimport Footer from './Footer';\nimport styles from './index.module.less';\n\nexport type CreatePageProps<T> = {\n dependencies?: T;\n path: string;\n renderPage?: () => Promise<string>;\n};\n\nconst getCodeStr = (data: any[] = [], code: string = '') => {\n data.forEach((node) => {\n if (node.type === 'text') {\n code += node.value;\n } else if (node.children && Array.isArray(node.children)) {\n code += getCodeStr(node.children);\n }\n });\n return code;\n};\n\nexport default function CreatePage<T>(props: CreatePageProps<T>) {\n const { renderPage, dependencies, path } = props;\n const [mdStr, setMdStr] = useState('');\n\n const version = pkg.version || '2.0.0';\n useEffect(() => {\n if (renderPage) {\n renderPage()\n .then((str) => {\n setMdStr(str);\n })\n .catch(() => {});\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n if (!mdStr) {\n return null;\n }\n\n return (\n <div>\n <MarkdownPreview\n source={mdStr}\n className={styles.markdown}\n components={{\n /**\n * bordered 边框\n * bgWhite 设置代码预览背景白色,否则为格子背景。\n * noCode 不显示代码编辑器。\n * noPreview 不显示代码预览效果。\n * noScroll 预览区域不显示滚动条。\n * codePen 显示 Codepen 按钮,要特别注意 包导入的问题,实例中的 import 主要用于 Codepen 使用。\n */\n code: ({ inline, node, ...props }) => {\n const { noPreview, bordered, noScroll, bgWhite, noCode, codePen } = props as any;\n if (inline) {\n return <code {...props} />;\n }\n const config = {\n noPreview,\n bordered,\n noScroll,\n bgWhite,\n noCode,\n codePen,\n } as any;\n if (Object.keys(config).filter((name) => config[name] !== undefined).length === 0) {\n return <code {...props} />;\n }\n return (\n <Code\n version={version}\n code={getCodeStr(node.children)}\n dependencies={dependencies}\n {...{ noPreview, bordered, noScroll, bgWhite, noCode, codePen }}\n />\n );\n },\n }}\n />\n <div className={styles.docinfo}>\n <Footer path={path} />\n </div>\n </div>\n );\n}\n","import React from 'react';\nimport Markdown from '../../components/Markdown';\n\nexport default () => (\n <Markdown\n path=\"https://github.com/uiwjs/uiw/tree/master/website/src/routes/extensions/README.md\"\n renderPage={async () => {\n const md = await import('./README.md');\n return md.default || md;\n }}\n />\n);\n"],"names":["webpackEmptyContext","req","e","Error","code","keys","resolve","id","module","exports","Code","version","dependencies","codePen","codeSandbox","other","props","codePenOption","title","includeModule","js","replace","html","css_external","js_external","codeSandboxOption","files","content","name","description","react","uiw","devDependencies","kkt","typescript","license","scripts","start","build","test","browserslist","style","marginBottom","path","url","Fragment","href","target","rel","type","getCodeStr","data","forEach","node","value","children","Array","isArray","CreatePage","renderPage","useState","mdStr","setMdStr","pkg","useEffect","then","str","catch","source","className","styles","components","inline","noPreview","bordered","noScroll","bgWhite","noCode","config","Object","filter","undefined","length","Footer","md","default"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- (self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[694],{84934:function(e){function n(e){var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}n.keys=function(){return[]},n.resolve=n,n.id=84934,e.exports=n},86082:function(e,n,t){"use strict";t.d(n,{Z:function(){return v}});var r=t(50189),o=t(53782),i=t(11026),s=t(41473),c=t(24931),d=t(75752),a=t(64508),u=t(69286),l=["version","dependencies","codePen","codeSandbox"];function p(e){var n=e.version,t=e.dependencies,i=e.codePen,s=e.codeSandbox,c=(0,o.Z)(e,l),d=(0,r.Z)({},c);return i&&(d.codePenOption={title:"uiw".concat(n," - demo"),includeModule:["uiw"],js:(d.code||"").replace("_mount_",'document.getElementById("container")'),html:'<div id="container" style="padding: 24px"></div>',css_external:"https://unpkg.com/uiw@".concat(n,"/dist/uiw.min.css"),js_external:"https://unpkg.com/react@16.x/umd/react.development.js;https://unpkg.com/react-dom@16.x/umd/react-dom.development.js;https://unpkg.com/classnames@2.2.6/index.js;https://unpkg.com/uiw@".concat(n,"/dist/uiw.min.js;https://unpkg.com/@uiw/codepen-require-polyfill@1.0.2/index.js")}),s&&(d.codeSandboxOption={files:{"sandbox.config.json":{content:'{\n "template": "node",\n "container": {\n "startScript": "start",\n "node": "14"\n }\n }'},"public/index.html":{content:'<div id="container"></div>'},"src/index.js":{content:(d.code||"").replace("_mount_",'document.getElementById("container")')},".kktrc.js":{content:'import webpack from "webpack";\nimport lessModules from "@kkt/less-modules";\nexport default (conf, env, options) => {\nconf = lessModules(conf, env, options);\nreturn conf;\n};'},"package.json":{content:{name:"uiw-demo",description:"uiw v".concat(n," - demo"),dependencies:{react:"latest","react-dom":"latest",uiw:"latest"},devDependencies:{"@kkt/less-modules":"6.9.0",kkt:"6.9.0",typescript:"4.1.3"},license:"MIT",scripts:{start:"kkt start",build:"kkt build",test:"kkt test --env=jsdom"},browserslist:[">0.2%","not dead","not ie <= 11","not op_mini all"]}}}}),(0,u.jsx)(a.Z,(0,r.Z)((0,r.Z)({},d),{},{dependencies:t,style:{marginBottom:0}}))}var h=t(22755);function f(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.path,t=/^http/.test(n||"")?n:"https://github.com/uiwjs/uiw/blob/master/".concat(n);return(0,u.jsxs)(s.Fragment,{children:["\u72af\u4e86\u9519\u8bef\u8fd8\u662f\u60f3\u5bf9\u6587\u4ef6\u505a\u51fa\u8d21\u732e\uff1f",t&&(0,u.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",children:"\u5728Github\u4e0a\u7f16\u8f91\u672c\u9875\uff01"}),(0,u.jsx)("br",{}),(0,u.jsx)("a",{href:"https://github.com/uiwjs/uiw/issues",target:"_blank",rel:"noopener noreferrer",children:"\u53cd\u9988\u5efa\u8bae"}),(0,u.jsx)(h.iz,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/uiwjs/uiw/issues/new",children:"\u63d0\u4ea4bug"}),(0,u.jsx)(h.iz,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/uiwjs/uiw",children:"Github"}),(0,u.jsx)(h.iz,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/kktjs/kkt",children:"kkt"}),(0,u.jsx)(h.iz,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/kktjs/kkt-ssr",children:"@kkt/ssr"}),(0,u.jsx)(h.iz,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"http://uiw.gitee.io",children:"\u56fd\u5185\u955c\u50cf"})]})}var m="index_docinfo__3Vx8S",k="index_markdown__hcQCp",x=["inline","node"],j=function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return n.forEach((function(n){"text"===n.type?t+=n.value:n.children&&Array.isArray(n.children)&&(t+=e(n.children))})),t};function v(e){var n=e.renderPage,t=e.dependencies,a=e.path,l=(0,s.useState)(""),h=(0,i.Z)(l,2),v=h[0],b=h[1],g=d.i8||"2.0.0";return(0,s.useEffect)((function(){n&&n().then((function(e){b(e)})).catch((function(){}))}),[]),v?(0,u.jsxs)("div",{children:[(0,u.jsx)(c.Z,{source:v,className:k,components:{code:function(e){var n=e.inline,i=e.node,s=(0,o.Z)(e,x),c=s,d=c.noPreview,a=c.noScroll,l=c.bgWhite,h=c.noCode,f=c.codePen;if(n)return(0,u.jsx)("code",(0,r.Z)({},s));var m={noPreview:d,noScroll:a,bgWhite:l,noCode:h,codePen:f};return 0===Object.keys(m).filter((function(e){return void 0!==m[e]})).length?(0,u.jsx)("code",(0,r.Z)({},s)):(0,u.jsx)(p,{version:g,code:j(i.children),dependencies:t,noPreview:d,noScroll:a,bgWhite:l,noCode:h,codePen:f})}}}),(0,u.jsx)("div",{className:m,children:(0,u.jsx)(f,{path:a})})]}):null}},53929:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return a}});var r=t(27791),o=t(57135),i=t.n(o),s=(t(41473),t(22755)),c=t(86082),d=t(69286);function a(){return(0,d.jsx)(c.Z,{path:"https://github.com/uiwjs/uiw/tree/master/packages/react-affix/README.md",dependencies:{Affix:s.D_,Button:s.zx},renderPage:(0,r.Z)(i().mark((function e(){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.e(5253).then(t.bind(t,45253));case 2:return n=e.sent,e.abrupt("return",n.default||n);case 4:case"end":return e.stop()}}),e)})))})}}}]);
2
- //# sourceMappingURL=694.0bb59e65.chunk.js.map
1
+ (self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[694],{84934:function(e){function n(e){var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}n.keys=function(){return[]},n.resolve=n,n.id=84934,e.exports=n},86082:function(e,n,t){"use strict";t.d(n,{Z:function(){return j}});var r=t(50189),o=t(53782),i=t(11026),s=t(41473),c=t(24931),d=t(75752),a=t(64508),u=t(69286),l=["version","dependencies","codePen","codeSandbox"];function p(e){var n=e.version,t=e.dependencies,i=e.codePen,s=e.codeSandbox,c=(0,o.Z)(e,l),d=(0,r.Z)({},c);return i&&(d.codePenOption={title:"uiw".concat(n," - demo"),includeModule:["uiw"],js:(d.code||"").replace("_mount_",'document.getElementById("container")'),html:'<div id="container" style="padding: 24px"></div>',css_external:"https://unpkg.com/uiw@".concat(n,"/dist/uiw.min.css"),js_external:"https://unpkg.com/react@16.x/umd/react.development.js;https://unpkg.com/react-dom@16.x/umd/react-dom.development.js;https://unpkg.com/classnames@2.2.6/index.js;https://unpkg.com/uiw@".concat(n,"/dist/uiw.min.js;https://unpkg.com/@uiw/codepen-require-polyfill@1.0.2/index.js")}),s&&(d.codeSandboxOption={files:{"sandbox.config.json":{content:'{\n "template": "node",\n "container": {\n "startScript": "start",\n "node": "14"\n }\n }'},"public/index.html":{content:'<div id="container"></div>'},"src/index.js":{content:(d.code||"").replace("_mount_",'document.getElementById("container")')},".kktrc.js":{content:'import webpack from "webpack";\nimport lessModules from "@kkt/less-modules";\nexport default (conf, env, options) => {\nconf = lessModules(conf, env, options);\nreturn conf;\n};'},"package.json":{content:{name:"uiw-demo",description:"uiw v".concat(n," - demo"),dependencies:{react:"latest","react-dom":"latest",uiw:"latest"},devDependencies:{"@kkt/less-modules":"6.9.0",kkt:"6.9.0",typescript:"4.1.3"},license:"MIT",scripts:{start:"kkt start",build:"kkt build",test:"kkt test --env=jsdom"},browserslist:[">0.2%","not dead","not ie <= 11","not op_mini all"]}}}}),(0,u.jsx)(a.Z,(0,r.Z)((0,r.Z)({},d),{},{dependencies:t,style:{marginBottom:0}}))}var h=t(35123);function f(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.path,t=/^http/.test(n||"")?n:"https://github.com/uiwjs/uiw/blob/master/".concat(n);return(0,u.jsxs)(s.Fragment,{children:["\u72af\u4e86\u9519\u8bef\u8fd8\u662f\u60f3\u5bf9\u6587\u4ef6\u505a\u51fa\u8d21\u732e\uff1f",t&&(0,u.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",children:"\u5728Github\u4e0a\u7f16\u8f91\u672c\u9875\uff01"}),(0,u.jsx)("br",{}),(0,u.jsx)("a",{href:"https://github.com/uiwjs/uiw/issues",target:"_blank",rel:"noopener noreferrer",children:"\u53cd\u9988\u5efa\u8bae"}),(0,u.jsx)(h.iz,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/uiwjs/uiw/issues/new",children:"\u63d0\u4ea4bug"}),(0,u.jsx)(h.iz,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/uiwjs/uiw",children:"Github"}),(0,u.jsx)(h.iz,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/kktjs/kkt",children:"kkt"}),(0,u.jsx)(h.iz,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/kktjs/kkt-ssr",children:"@kkt/ssr"}),(0,u.jsx)(h.iz,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"http://uiw.gitee.io",children:"\u56fd\u5185\u955c\u50cf"})]})}var m="index_docinfo__3Vx8S",k="index_markdown__hcQCp",x=["inline","node"],b=function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return n.forEach((function(n){"text"===n.type?t+=n.value:n.children&&Array.isArray(n.children)&&(t+=e(n.children))})),t};function j(e){var n=e.renderPage,t=e.dependencies,a=e.path,l=(0,s.useState)(""),h=(0,i.Z)(l,2),j=h[0],v=h[1],g=d.i8||"2.0.0";return(0,s.useEffect)((function(){n&&n().then((function(e){v(e)})).catch((function(){}))}),[]),j?(0,u.jsxs)("div",{children:[(0,u.jsx)(c.Z,{source:j,className:k,components:{code:function(e){var n=e.inline,i=e.node,s=(0,o.Z)(e,x),c=s,d=c.noPreview,a=c.bordered,l=c.noScroll,h=c.bgWhite,f=c.noCode,m=c.codePen;if(n)return(0,u.jsx)("code",(0,r.Z)({},s));var k={noPreview:d,bordered:a,noScroll:l,bgWhite:h,noCode:f,codePen:m};return 0===Object.keys(k).filter((function(e){return void 0!==k[e]})).length?(0,u.jsx)("code",(0,r.Z)({},s)):(0,u.jsx)(p,{version:g,code:b(i.children),dependencies:t,noPreview:d,bordered:a,noScroll:l,bgWhite:h,noCode:f,codePen:m})}}}),(0,u.jsx)("div",{className:m,children:(0,u.jsx)(f,{path:a})})]}):null}},53929:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return a}});var r=t(27791),o=t(57135),i=t.n(o),s=(t(41473),t(35123)),c=t(86082),d=t(69286);function a(){return(0,d.jsx)(c.Z,{path:"https://github.com/uiwjs/uiw/tree/master/packages/react-affix/README.md",dependencies:{Affix:s.D_,Button:s.zx},renderPage:(0,r.Z)(i().mark((function e(){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.e(5253).then(t.bind(t,45253));case 2:return n=e.sent,e.abrupt("return",n.default||n);case 4:case"end":return e.stop()}}),e)})))})}}}]);
2
+ //# sourceMappingURL=694.a0a07e64.chunk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"static/js/694.a0a07e64.chunk.js","mappings":"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","sources":["../../node_modules/@babel/standalone|sync|nonrecursive","components/Markdown/Code.tsx","components/Markdown/Footer.tsx","webpack://website/./src/components/Markdown/index.module.less?6e49","components/Markdown/index.tsx","routes/components/affix/index.tsx"],"sourcesContent":["function webpackEmptyContext(req) {\n\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\te.code = 'MODULE_NOT_FOUND';\n\tthrow e;\n}\nwebpackEmptyContext.keys = function() { return []; };\nwebpackEmptyContext.resolve = webpackEmptyContext;\nwebpackEmptyContext.id = 84934;\nmodule.exports = webpackEmptyContext;","import CodePreview, { CodePreviewProps } from '@uiw/react-code-preview';\n\nexport interface CodeProps extends CodePreviewProps {\n code: string;\n version: string;\n codePen: boolean;\n codeSandbox?: boolean;\n dependencies: any;\n}\n\nexport default function Code({ version, dependencies, codePen, codeSandbox, ...other }: CodeProps) {\n const props: CodePreviewProps = { ...other };\n if (codePen) {\n props.codePenOption = {\n title: `uiw${version} - demo`,\n includeModule: ['uiw'],\n js: (props.code || '').replace('_mount_', 'document.getElementById(\"container\")'),\n html: '<div id=\"container\" style=\"padding: 24px\"></div>',\n css_external: `https://unpkg.com/uiw@${version}/dist/uiw.min.css`,\n js_external: `https://unpkg.com/react@16.x/umd/react.development.js;https://unpkg.com/react-dom@16.x/umd/react-dom.development.js;https://unpkg.com/classnames@2.2.6/index.js;https://unpkg.com/uiw@${version}/dist/uiw.min.js;https://unpkg.com/@uiw/codepen-require-polyfill@1.0.2/index.js`,\n };\n }\n if (codeSandbox) {\n props.codeSandboxOption = {\n files: {\n 'sandbox.config.json': {\n content: `{\n \"template\": \"node\",\n \"container\": {\n \"startScript\": \"start\",\n \"node\": \"14\"\n }\n }`,\n },\n 'public/index.html': {\n content: `<div id=\"container\"></div>`,\n },\n 'src/index.js': {\n content: (props.code || '').replace('_mount_', 'document.getElementById(\"container\")'),\n },\n '.kktrc.js': {\n content: `import webpack from \"webpack\";\\nimport lessModules from \"@kkt/less-modules\";\\nexport default (conf, env, options) => {\\nconf = lessModules(conf, env, options);\\nreturn conf;\\n};`,\n },\n 'package.json': {\n content: {\n name: 'uiw-demo',\n description: `uiw v${version} - demo`,\n dependencies: {\n react: 'latest',\n 'react-dom': 'latest',\n uiw: 'latest',\n },\n devDependencies: {\n '@kkt/less-modules': '6.9.0',\n kkt: '6.9.0',\n typescript: '4.1.3',\n },\n license: 'MIT',\n scripts: {\n start: 'kkt start',\n build: 'kkt build',\n test: 'kkt test --env=jsdom',\n },\n browserslist: ['>0.2%', 'not dead', 'not ie <= 11', 'not op_mini all'],\n },\n },\n },\n };\n }\n return <CodePreview {...props} dependencies={dependencies} style={{ marginBottom: 0 }} />;\n}\n","import React, { Fragment } from 'react';\nimport { Divider } from 'uiw';\n\nexport type FooterProps = {\n path?: string;\n};\n\nexport default function (props: FooterProps = {}) {\n const { path } = props;\n const url = /^http/.test(path || '') ? path : `https://github.com/uiwjs/uiw/blob/master/${path}`;\n return (\n <Fragment>\n 犯了错误还是想对文件做出贡献?\n {url && (\n <a href={url} target=\"_blank\" rel=\"noopener noreferrer\">\n 在Github上编辑本页!\n </a>\n )}\n <br />\n <a href=\"https://github.com/uiwjs/uiw/issues\" target=\"_blank\" rel=\"noopener noreferrer\">\n 反馈建议\n </a>\n <Divider type=\"vertical\" />\n <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/uiwjs/uiw/issues/new\">\n 提交bug\n </a>\n <Divider type=\"vertical\" />\n <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/uiwjs/uiw\">\n Github\n </a>\n <Divider type=\"vertical\" />\n <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/kktjs/kkt\">\n kkt\n </a>\n <Divider type=\"vertical\" />\n <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/kktjs/kkt-ssr\">\n @kkt/ssr\n </a>\n <Divider type=\"vertical\" />\n <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"http://uiw.gitee.io\">\n 国内镜像\n </a>\n </Fragment>\n );\n}\n","// extracted by mini-css-extract-plugin\nexport default {\"docinfo\":\"index_docinfo__3Vx8S\",\"markdown\":\"index_markdown__hcQCp\"};","import { useEffect, useState } from 'react';\nimport MarkdownPreview from '@uiw/react-markdown-preview';\nimport pkg from 'uiw/package.json';\nimport Code from './Code';\nimport Footer from './Footer';\nimport styles from './index.module.less';\n\nexport type CreatePageProps<T> = {\n dependencies?: T;\n path: string;\n renderPage?: () => Promise<string>;\n};\n\nconst getCodeStr = (data: any[] = [], code: string = '') => {\n data.forEach((node) => {\n if (node.type === 'text') {\n code += node.value;\n } else if (node.children && Array.isArray(node.children)) {\n code += getCodeStr(node.children);\n }\n });\n return code;\n};\n\nexport default function CreatePage<T>(props: CreatePageProps<T>) {\n const { renderPage, dependencies, path } = props;\n const [mdStr, setMdStr] = useState('');\n\n const version = pkg.version || '2.0.0';\n useEffect(() => {\n if (renderPage) {\n renderPage()\n .then((str) => {\n setMdStr(str);\n })\n .catch(() => {});\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n if (!mdStr) {\n return null;\n }\n\n return (\n <div>\n <MarkdownPreview\n source={mdStr}\n className={styles.markdown}\n components={{\n /**\n * bordered 边框\n * bgWhite 设置代码预览背景白色,否则为格子背景。\n * noCode 不显示代码编辑器。\n * noPreview 不显示代码预览效果。\n * noScroll 预览区域不显示滚动条。\n * codePen 显示 Codepen 按钮,要特别注意 包导入的问题,实例中的 import 主要用于 Codepen 使用。\n */\n code: ({ inline, node, ...props }) => {\n const { noPreview, bordered, noScroll, bgWhite, noCode, codePen } = props as any;\n if (inline) {\n return <code {...props} />;\n }\n const config = {\n noPreview,\n bordered,\n noScroll,\n bgWhite,\n noCode,\n codePen,\n } as any;\n if (Object.keys(config).filter((name) => config[name] !== undefined).length === 0) {\n return <code {...props} />;\n }\n return (\n <Code\n version={version}\n code={getCodeStr(node.children)}\n dependencies={dependencies}\n {...{ noPreview, bordered, noScroll, bgWhite, noCode, codePen }}\n />\n );\n },\n }}\n />\n <div className={styles.docinfo}>\n <Footer path={path} />\n </div>\n </div>\n );\n}\n","import React from 'react';\nimport { Affix, Button } from 'uiw';\nimport Markdown from '../../../components/Markdown';\n\nexport default function Page() {\n return (\n <Markdown\n path=\"https://github.com/uiwjs/uiw/tree/master/packages/react-affix/README.md\"\n dependencies={{ Affix, Button }}\n renderPage={async () => {\n const md = await import('uiw/node_modules/@uiw/react-affix/README.md');\n return md.default || md;\n }}\n />\n );\n}\n"],"names":["webpackEmptyContext","req","e","Error","code","keys","resolve","id","module","exports","Code","version","dependencies","codePen","codeSandbox","other","props","codePenOption","title","includeModule","js","replace","html","css_external","js_external","codeSandboxOption","files","content","name","description","react","uiw","devDependencies","kkt","typescript","license","scripts","start","build","test","browserslist","style","marginBottom","path","url","Fragment","href","target","rel","type","getCodeStr","data","forEach","node","value","children","Array","isArray","CreatePage","renderPage","useState","mdStr","setMdStr","pkg","useEffect","then","str","catch","source","className","styles","components","inline","noPreview","bordered","noScroll","bgWhite","noCode","config","Object","filter","undefined","length","Footer","Page","Affix","Button","md","default"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- (self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[3917],{84934:function(e){function n(e){var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}n.keys=function(){return[]},n.resolve=n,n.id=84934,e.exports=n},86082:function(e,n,t){"use strict";t.d(n,{Z:function(){return v}});var r=t(50189),o=t(53782),i=t(11026),s=t(41473),c=t(24931),d=t(75752),a=t(64508),u=t(69286),l=["version","dependencies","codePen","codeSandbox"];function p(e){var n=e.version,t=e.dependencies,i=e.codePen,s=e.codeSandbox,c=(0,o.Z)(e,l),d=(0,r.Z)({},c);return i&&(d.codePenOption={title:"uiw".concat(n," - demo"),includeModule:["uiw"],js:(d.code||"").replace("_mount_",'document.getElementById("container")'),html:'<div id="container" style="padding: 24px"></div>',css_external:"https://unpkg.com/uiw@".concat(n,"/dist/uiw.min.css"),js_external:"https://unpkg.com/react@16.x/umd/react.development.js;https://unpkg.com/react-dom@16.x/umd/react-dom.development.js;https://unpkg.com/classnames@2.2.6/index.js;https://unpkg.com/uiw@".concat(n,"/dist/uiw.min.js;https://unpkg.com/@uiw/codepen-require-polyfill@1.0.2/index.js")}),s&&(d.codeSandboxOption={files:{"sandbox.config.json":{content:'{\n "template": "node",\n "container": {\n "startScript": "start",\n "node": "14"\n }\n }'},"public/index.html":{content:'<div id="container"></div>'},"src/index.js":{content:(d.code||"").replace("_mount_",'document.getElementById("container")')},".kktrc.js":{content:'import webpack from "webpack";\nimport lessModules from "@kkt/less-modules";\nexport default (conf, env, options) => {\nconf = lessModules(conf, env, options);\nreturn conf;\n};'},"package.json":{content:{name:"uiw-demo",description:"uiw v".concat(n," - demo"),dependencies:{react:"latest","react-dom":"latest",uiw:"latest"},devDependencies:{"@kkt/less-modules":"6.9.0",kkt:"6.9.0",typescript:"4.1.3"},license:"MIT",scripts:{start:"kkt start",build:"kkt build",test:"kkt test --env=jsdom"},browserslist:[">0.2%","not dead","not ie <= 11","not op_mini all"]}}}}),(0,u.jsx)(a.Z,(0,r.Z)((0,r.Z)({},d),{},{dependencies:t,style:{marginBottom:0}}))}var h=t(22755);function m(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.path,t=/^http/.test(n||"")?n:"https://github.com/uiwjs/uiw/blob/master/".concat(n);return(0,u.jsxs)(s.Fragment,{children:["\u72af\u4e86\u9519\u8bef\u8fd8\u662f\u60f3\u5bf9\u6587\u4ef6\u505a\u51fa\u8d21\u732e\uff1f",t&&(0,u.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",children:"\u5728Github\u4e0a\u7f16\u8f91\u672c\u9875\uff01"}),(0,u.jsx)("br",{}),(0,u.jsx)("a",{href:"https://github.com/uiwjs/uiw/issues",target:"_blank",rel:"noopener noreferrer",children:"\u53cd\u9988\u5efa\u8bae"}),(0,u.jsx)(h.iz,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/uiwjs/uiw/issues/new",children:"\u63d0\u4ea4bug"}),(0,u.jsx)(h.iz,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/uiwjs/uiw",children:"Github"}),(0,u.jsx)(h.iz,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/kktjs/kkt",children:"kkt"}),(0,u.jsx)(h.iz,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/kktjs/kkt-ssr",children:"@kkt/ssr"}),(0,u.jsx)(h.iz,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"http://uiw.gitee.io",children:"\u56fd\u5185\u955c\u50cf"})]})}var f="index_docinfo__3Vx8S",k="index_markdown__hcQCp",x=["inline","node"],j=function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return n.forEach((function(n){"text"===n.type?t+=n.value:n.children&&Array.isArray(n.children)&&(t+=e(n.children))})),t};function v(e){var n=e.renderPage,t=e.dependencies,a=e.path,l=(0,s.useState)(""),h=(0,i.Z)(l,2),v=h[0],b=h[1],g=d.i8||"2.0.0";return(0,s.useEffect)((function(){n&&n().then((function(e){b(e)})).catch((function(){}))}),[]),v?(0,u.jsxs)("div",{children:[(0,u.jsx)(c.Z,{source:v,className:k,components:{code:function(e){var n=e.inline,i=e.node,s=(0,o.Z)(e,x),c=s,d=c.noPreview,a=c.noScroll,l=c.bgWhite,h=c.noCode,m=c.codePen;if(n)return(0,u.jsx)("code",(0,r.Z)({},s));var f={noPreview:d,noScroll:a,bgWhite:l,noCode:h,codePen:m};return 0===Object.keys(f).filter((function(e){return void 0!==f[e]})).length?(0,u.jsx)("code",(0,r.Z)({},s)):(0,u.jsx)(p,{version:g,code:j(i.children),dependencies:t,noPreview:d,noScroll:a,bgWhite:l,noCode:h,codePen:m})}}}),(0,u.jsx)("div",{className:f,children:(0,u.jsx)(m,{path:a})})]}):null}},81423:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return d}});var r=t(27791),o=t(57135),i=t.n(o),s=(t(41473),t(86082)),c=t(69286);function d(){return(0,c.jsx)(s.Z,{path:"https://github.com/uiwjs/uiw/tree/master/website/src/routes/components/colors/README.md",renderPage:(0,r.Z)(i().mark((function e(){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.e(1127).then(t.bind(t,51127));case 2:return n=e.sent,e.abrupt("return",n.default||n);case 4:case"end":return e.stop()}}),e)})))})}}}]);
2
- //# sourceMappingURL=3917.ec9cb6d1.chunk.js.map
1
+ (self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[7104],{84934:function(e){function n(e){var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}n.keys=function(){return[]},n.resolve=n,n.id=84934,e.exports=n},86082:function(e,n,t){"use strict";t.d(n,{Z:function(){return x}});var r=t(50189),o=t(53782),i=t(11026),s=t(41473),c=t(24931),d=t(75752),a=t(64508),u=t(69286),l=["version","dependencies","codePen","codeSandbox"];function p(e){var n=e.version,t=e.dependencies,i=e.codePen,s=e.codeSandbox,c=(0,o.Z)(e,l),d=(0,r.Z)({},c);return i&&(d.codePenOption={title:"uiw".concat(n," - demo"),includeModule:["uiw"],js:(d.code||"").replace("_mount_",'document.getElementById("container")'),html:'<div id="container" style="padding: 24px"></div>',css_external:"https://unpkg.com/uiw@".concat(n,"/dist/uiw.min.css"),js_external:"https://unpkg.com/react@16.x/umd/react.development.js;https://unpkg.com/react-dom@16.x/umd/react-dom.development.js;https://unpkg.com/classnames@2.2.6/index.js;https://unpkg.com/uiw@".concat(n,"/dist/uiw.min.js;https://unpkg.com/@uiw/codepen-require-polyfill@1.0.2/index.js")}),s&&(d.codeSandboxOption={files:{"sandbox.config.json":{content:'{\n "template": "node",\n "container": {\n "startScript": "start",\n "node": "14"\n }\n }'},"public/index.html":{content:'<div id="container"></div>'},"src/index.js":{content:(d.code||"").replace("_mount_",'document.getElementById("container")')},".kktrc.js":{content:'import webpack from "webpack";\nimport lessModules from "@kkt/less-modules";\nexport default (conf, env, options) => {\nconf = lessModules(conf, env, options);\nreturn conf;\n};'},"package.json":{content:{name:"uiw-demo",description:"uiw v".concat(n," - demo"),dependencies:{react:"latest","react-dom":"latest",uiw:"latest"},devDependencies:{"@kkt/less-modules":"6.9.0",kkt:"6.9.0",typescript:"4.1.3"},license:"MIT",scripts:{start:"kkt start",build:"kkt build",test:"kkt test --env=jsdom"},browserslist:[">0.2%","not dead","not ie <= 11","not op_mini all"]}}}}),(0,u.jsx)(a.Z,(0,r.Z)((0,r.Z)({},d),{},{dependencies:t,style:{marginBottom:0}}))}var h=t(35123);function m(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.path,t=/^http/.test(n||"")?n:"https://github.com/uiwjs/uiw/blob/master/".concat(n);return(0,u.jsxs)(s.Fragment,{children:["\u72af\u4e86\u9519\u8bef\u8fd8\u662f\u60f3\u5bf9\u6587\u4ef6\u505a\u51fa\u8d21\u732e\uff1f",t&&(0,u.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",children:"\u5728Github\u4e0a\u7f16\u8f91\u672c\u9875\uff01"}),(0,u.jsx)("br",{}),(0,u.jsx)("a",{href:"https://github.com/uiwjs/uiw/issues",target:"_blank",rel:"noopener noreferrer",children:"\u53cd\u9988\u5efa\u8bae"}),(0,u.jsx)(h.iz,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/uiwjs/uiw/issues/new",children:"\u63d0\u4ea4bug"}),(0,u.jsx)(h.iz,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/uiwjs/uiw",children:"Github"}),(0,u.jsx)(h.iz,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/kktjs/kkt",children:"kkt"}),(0,u.jsx)(h.iz,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/kktjs/kkt-ssr",children:"@kkt/ssr"}),(0,u.jsx)(h.iz,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"http://uiw.gitee.io",children:"\u56fd\u5185\u955c\u50cf"})]})}var f="index_docinfo__3Vx8S",k="index_markdown__hcQCp",b=["inline","node"],v=function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return n.forEach((function(n){"text"===n.type?t+=n.value:n.children&&Array.isArray(n.children)&&(t+=e(n.children))})),t};function x(e){var n=e.renderPage,t=e.dependencies,a=e.path,l=(0,s.useState)(""),h=(0,i.Z)(l,2),x=h[0],j=h[1],g=d.i8||"2.0.0";return(0,s.useEffect)((function(){n&&n().then((function(e){j(e)})).catch((function(){}))}),[]),x?(0,u.jsxs)("div",{children:[(0,u.jsx)(c.Z,{source:x,className:k,components:{code:function(e){var n=e.inline,i=e.node,s=(0,o.Z)(e,b),c=s,d=c.noPreview,a=c.bordered,l=c.noScroll,h=c.bgWhite,m=c.noCode,f=c.codePen;if(n)return(0,u.jsx)("code",(0,r.Z)({},s));var k={noPreview:d,bordered:a,noScroll:l,bgWhite:h,noCode:m,codePen:f};return 0===Object.keys(k).filter((function(e){return void 0!==k[e]})).length?(0,u.jsx)("code",(0,r.Z)({},s)):(0,u.jsx)(p,{version:g,code:v(i.children),dependencies:t,noPreview:d,bordered:a,noScroll:l,bgWhite:h,noCode:m,codePen:f})}}}),(0,u.jsx)("div",{className:f,children:(0,u.jsx)(m,{path:a})})]}):null}},19848:function(e,n,t){"use strict";t.r(n);var r=t(27791),o=t(57135),i=t.n(o),s=(t(41473),t(86082)),c=t(69286);n.default=function(){return(0,c.jsx)(s.Z,{path:"https://github.com/uiwjs/uiw/tree/master/website/src/routes/guide/vscode/README.md",renderPage:(0,r.Z)(i().mark((function e(){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.e(3151).then(t.bind(t,63151));case 2:return n=e.sent,e.abrupt("return",n.default||n);case 4:case"end":return e.stop()}}),e)})))})}}}]);
2
+ //# sourceMappingURL=7104.e2466efa.chunk.js.map