@gm-pc/react 1.27.0 → 1.27.1-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (399) hide show
  1. package/package.json +3 -3
  2. package/src/common/hooks/index.ts +5 -5
  3. package/src/common/hooks/use_form/index.ts +2 -2
  4. package/src/common/hooks/use_form/use_form.ts +184 -184
  5. package/src/common/hooks/use_form/utils.ts +23 -23
  6. package/src/common/hooks/use_mutation_observer.ts +19 -19
  7. package/src/common/utils/date.ts +28 -28
  8. package/src/common/utils/get_record_partical_object.ts +4 -4
  9. package/src/common/utils/index.ts +3 -3
  10. package/src/common/utils/utils.ts +16 -16
  11. package/src/component/affix/affix.tsx +31 -31
  12. package/src/component/affix/index.ts +2 -2
  13. package/src/component/affix/stories.tsx +16 -16
  14. package/src/component/affix/style.less +3 -3
  15. package/src/component/auto_complete/auto_complete.tsx +202 -202
  16. package/src/component/auto_complete/index.ts +6 -6
  17. package/src/component/auto_complete/stories.tsx +37 -37
  18. package/src/component/auto_full/auto_full.tsx +36 -36
  19. package/src/component/auto_full/index.ts +1 -1
  20. package/src/component/box/box.tsx +29 -29
  21. package/src/component/box/box_form.tsx +83 -83
  22. package/src/component/box/box_pagination.tsx +12 -12
  23. package/src/component/box/box_panel.tsx +91 -91
  24. package/src/component/box/box_table.tsx +57 -57
  25. package/src/component/box/index.ts +10 -10
  26. package/src/component/box/stories.tsx +119 -119
  27. package/src/component/box/style.less +41 -41
  28. package/src/component/button/button.tsx +94 -94
  29. package/src/component/button/button_text.tsx +33 -33
  30. package/src/component/button/index.ts +4 -4
  31. package/src/component/button/stories.tsx +131 -131
  32. package/src/component/button/style.less +158 -158
  33. package/src/component/calendar/calendar.tsx +25 -25
  34. package/src/component/calendar/content.tsx +87 -87
  35. package/src/component/calendar/day.tsx +106 -106
  36. package/src/component/calendar/head.tsx +244 -244
  37. package/src/component/calendar/index.ts +4 -4
  38. package/src/component/calendar/range_calendar.tsx +121 -121
  39. package/src/component/calendar/stories.tsx +54 -54
  40. package/src/component/calendar/style.less +136 -136
  41. package/src/component/calendar/types.ts +56 -56
  42. package/src/component/calendar/week.tsx +27 -27
  43. package/src/component/card/card.tsx +148 -148
  44. package/src/component/card/form_card.tsx +42 -42
  45. package/src/component/card/index.ts +2 -2
  46. package/src/component/card/stories.tsx +90 -90
  47. package/src/component/card/style.less +125 -125
  48. package/src/component/checkbox/checkbox.tsx +75 -75
  49. package/src/component/checkbox/checkbox_group.tsx +51 -51
  50. package/src/component/checkbox/index.ts +5 -5
  51. package/src/component/checkbox/stories.tsx +152 -152
  52. package/src/component/checkbox/style.less +73 -73
  53. package/src/component/checkbox/util.ts +19 -19
  54. package/src/component/collapse/collapse.tsx +27 -27
  55. package/src/component/collapse/index.ts +2 -2
  56. package/src/component/collapse/stories.tsx +21 -21
  57. package/src/component/color_picker/color_list.ts +34 -34
  58. package/src/component/color_picker/color_picker.tsx +43 -43
  59. package/src/component/color_picker/color_select.tsx +97 -97
  60. package/src/component/color_picker/index.ts +2 -2
  61. package/src/component/color_picker/stories.tsx +20 -20
  62. package/src/component/color_picker/style.less +41 -41
  63. package/src/component/config_provider/config_provider.tsx +16 -16
  64. package/src/component/config_provider/context.ts +10 -10
  65. package/src/component/config_provider/index.ts +3 -3
  66. package/src/component/controlled_form/context.tsx +18 -18
  67. package/src/component/controlled_form/controlled_form.tsx +141 -141
  68. package/src/component/controlled_form/index.ts +8 -8
  69. package/src/component/controlled_form/items/index.tsx +115 -115
  70. package/src/component/controlled_form/items/utils.ts +132 -132
  71. package/src/component/controlled_form/stories/components/date_range_filter.tsx +83 -83
  72. package/src/component/controlled_form/stories/components/index.ts +2 -2
  73. package/src/component/controlled_form/stories/components/search_filter.tsx +52 -52
  74. package/src/component/controlled_form/stories/stories.tsx +372 -372
  75. package/src/component/date_picker/date_picker.tsx +187 -187
  76. package/src/component/date_picker/index.ts +2 -2
  77. package/src/component/date_picker/overlay.tsx +115 -115
  78. package/src/component/date_picker/stories.tsx +109 -109
  79. package/src/component/date_picker/style.less +23 -23
  80. package/src/component/date_picker/time_select.tsx +58 -58
  81. package/src/component/date_picker/types.ts +7 -7
  82. package/src/component/date_range_picker/date_range_picker.tsx +144 -144
  83. package/src/component/date_range_picker/index.ts +2 -2
  84. package/src/component/date_range_picker/left.tsx +107 -107
  85. package/src/component/date_range_picker/overlay.tsx +204 -204
  86. package/src/component/date_range_picker/stories.tsx +181 -181
  87. package/src/component/date_range_picker/style.less +41 -41
  88. package/src/component/date_range_picker/time_range_select.tsx +144 -144
  89. package/src/component/date_range_picker/two.tsx +108 -108
  90. package/src/component/date_range_picker/types.ts +42 -42
  91. package/src/component/date_range_picker/util.ts +11 -11
  92. package/src/component/dialog/alert.tsx +38 -38
  93. package/src/component/dialog/confirm.tsx +120 -120
  94. package/src/component/dialog/delete_com.tsx +27 -27
  95. package/src/component/dialog/dialog.tsx +70 -70
  96. package/src/component/dialog/index.ts +16 -16
  97. package/src/component/dialog/prompt.tsx +95 -95
  98. package/src/component/dialog/stories.tsx +195 -195
  99. package/src/component/dialog/types.ts +70 -70
  100. package/src/component/divider/divider.tsx +25 -25
  101. package/src/component/divider/index.ts +2 -2
  102. package/src/component/divider/stories.tsx +14 -14
  103. package/src/component/divider/style.less +29 -29
  104. package/src/component/flex/flex.tsx +133 -133
  105. package/src/component/flex/index.ts +2 -2
  106. package/src/component/flex/stories.tsx +17 -17
  107. package/src/component/flex/style.less +105 -105
  108. package/src/component/flip_number/flip_number.tsx +209 -209
  109. package/src/component/flip_number/index.ts +2 -2
  110. package/src/component/flip_number/stories.tsx +28 -28
  111. package/src/component/flip_number/utils.ts +58 -58
  112. package/src/component/form/context.tsx +15 -15
  113. package/src/component/form/form.tsx +142 -142
  114. package/src/component/form/form_block.tsx +39 -39
  115. package/src/component/form/form_button.tsx +28 -28
  116. package/src/component/form/form_group.tsx +157 -157
  117. package/src/component/form/form_item.tsx +141 -141
  118. package/src/component/form/form_panel.tsx +63 -63
  119. package/src/component/form/index.ts +15 -15
  120. package/src/component/form/stories.tsx +448 -448
  121. package/src/component/form/style.less +159 -159
  122. package/src/component/form/types.ts +110 -110
  123. package/src/component/function_set/function_set.tsx +84 -84
  124. package/src/component/function_set/index.ts +2 -2
  125. package/src/component/function_set/overlay.tsx +41 -41
  126. package/src/component/function_set/stories.tsx +71 -71
  127. package/src/component/function_set/types.ts +15 -15
  128. package/src/component/function_set/utils.ts +21 -21
  129. package/src/component/grid/col.tsx +55 -55
  130. package/src/component/grid/index.ts +3 -3
  131. package/src/component/grid/mixin.less +48 -48
  132. package/src/component/grid/row.tsx +27 -27
  133. package/src/component/grid/stories.tsx +65 -65
  134. package/src/component/grid/style.less +27 -27
  135. package/src/component/grid/types.ts +35 -35
  136. package/src/component/grid/util.ts +12 -12
  137. package/src/component/icon_down_up/icon_down_up.tsx +22 -22
  138. package/src/component/icon_down_up/index.ts +2 -2
  139. package/src/component/icon_down_up/stories.tsx +21 -21
  140. package/src/component/icon_down_up/style.less +10 -10
  141. package/src/component/icon_expand/icon_expand.tsx +22 -22
  142. package/src/component/icon_expand/index.ts +1 -1
  143. package/src/component/img_uploader/img_uploader.tsx +168 -168
  144. package/src/component/img_uploader/index.ts +2 -2
  145. package/src/component/img_uploader/stories.tsx +58 -58
  146. package/src/component/img_uploader/style.less +22 -22
  147. package/src/component/input/index.ts +5 -5
  148. package/src/component/input/input.tsx +24 -24
  149. package/src/component/input/input_close.tsx +51 -51
  150. package/src/component/input/stories.tsx +56 -56
  151. package/src/component/input/style.less +33 -33
  152. package/src/component/input_number/index.ts +2 -2
  153. package/src/component/input_number/input_number.tsx +115 -115
  154. package/src/component/input_number/stories.tsx +27 -27
  155. package/src/component/input_number/style.less +10 -10
  156. package/src/component/input_number/utils.ts +44 -44
  157. package/src/component/label/index.tsx +19 -19
  158. package/src/component/label/stories.tsx +26 -26
  159. package/src/component/label/style.less +34 -34
  160. package/src/component/layout_root/index.ts +2 -2
  161. package/src/component/layout_root/layout_root.tsx +116 -116
  162. package/src/component/layout_root/types.ts +38 -38
  163. package/src/component/level_list/index.ts +2 -2
  164. package/src/component/level_list/level_item.tsx +79 -79
  165. package/src/component/level_list/level_list.tsx +123 -123
  166. package/src/component/level_list/stories/constants.ts +72 -72
  167. package/src/component/level_list/stories/stories.tsx +87 -87
  168. package/src/component/level_list/style.less +41 -41
  169. package/src/component/level_list/types.ts +36 -36
  170. package/src/component/level_list/utils.ts +19 -19
  171. package/src/component/level_select/index.ts +7 -7
  172. package/src/component/level_select/level_select.tsx +216 -216
  173. package/src/component/level_select/multiple_level_select.tsx +104 -104
  174. package/src/component/level_select/stories.tsx +102 -102
  175. package/src/component/level_select/types.ts +38 -38
  176. package/src/component/level_select/util.ts +20 -20
  177. package/src/component/list/base.tsx +129 -129
  178. package/src/component/list/index.ts +3 -3
  179. package/src/component/list/list.tsx +61 -61
  180. package/src/component/list/stories.tsx +113 -113
  181. package/src/component/list/style.less +58 -58
  182. package/src/component/list/types.ts +37 -37
  183. package/src/component/loading/index.ts +10 -10
  184. package/src/component/loading/loading.tsx +26 -26
  185. package/src/component/loading/loading_chunk.tsx +37 -37
  186. package/src/component/loading/loading_full_screen.tsx +45 -45
  187. package/src/component/loading/stories.tsx +43 -43
  188. package/src/component/loading/style.less +69 -69
  189. package/src/component/loading/types.ts +30 -30
  190. package/src/component/mask/index.ts +2 -2
  191. package/src/component/mask/mask.tsx +22 -22
  192. package/src/component/mask/style.less +10 -10
  193. package/src/component/modal/clean_modal.tsx +14 -14
  194. package/src/component/modal/index.ts +5 -5
  195. package/src/component/modal/modal.tsx +145 -145
  196. package/src/component/modal/right_side_modal.tsx +22 -22
  197. package/src/component/modal/stories.tsx +132 -132
  198. package/src/component/modal/style.less +138 -138
  199. package/src/component/modal/types.ts +27 -27
  200. package/src/component/more_select/base.tsx +408 -408
  201. package/src/component/more_select/index.ts +6 -6
  202. package/src/component/more_select/more_select.tsx +137 -137
  203. package/src/component/more_select/render_list_filter.ts +39 -39
  204. package/src/component/more_select/stories.tsx +323 -323
  205. package/src/component/more_select/style.less +72 -72
  206. package/src/component/more_select/types.ts +114 -114
  207. package/src/component/multiple_selection/index.ts +2 -2
  208. package/src/component/multiple_selection/multiple_selection.tsx +118 -118
  209. package/src/component/multiple_selection/stories.tsx +37 -37
  210. package/src/component/multiple_selection/style.less +57 -57
  211. package/src/component/n_progress/index.ts +1 -1
  212. package/src/component/n_progress/n_progress.tsx +39 -39
  213. package/src/component/n_progress/stories.tsx +25 -25
  214. package/src/component/n_progress/style.less +39 -39
  215. package/src/component/nav/a.tsx +7 -7
  216. package/src/component/nav/index.ts +10 -10
  217. package/src/component/nav/nav.tsx +114 -114
  218. package/src/component/nav/nav_item.tsx +98 -98
  219. package/src/component/nav/nav_single_item.tsx +28 -28
  220. package/src/component/nav/popup.tsx +100 -100
  221. package/src/component/nav/portal.ts +17 -17
  222. package/src/component/nav/stories.tsx +152 -152
  223. package/src/component/nav/style.less +246 -246
  224. package/src/component/nav/types.ts +93 -93
  225. package/src/component/pagination/index.ts +2 -2
  226. package/src/component/pagination/left.tsx +56 -56
  227. package/src/component/pagination/page_with_count.tsx +115 -115
  228. package/src/component/pagination/page_without_count.tsx +64 -64
  229. package/src/component/pagination/pagination.tsx +23 -23
  230. package/src/component/pagination/right.tsx +79 -79
  231. package/src/component/pagination/stories.tsx +63 -63
  232. package/src/component/pagination/style.less +51 -51
  233. package/src/component/pagination/types.ts +18 -18
  234. package/src/component/pagination/util.ts +7 -7
  235. package/src/component/popover/index.ts +2 -2
  236. package/src/component/popover/popover.tsx +279 -279
  237. package/src/component/popover/stories.tsx +104 -104
  238. package/src/component/popover/types.ts +25 -25
  239. package/src/component/popover/utils.ts +22 -22
  240. package/src/component/popup/element_in_viewport.ts +33 -33
  241. package/src/component/popup/index.ts +4 -4
  242. package/src/component/popup/popup.tsx +149 -149
  243. package/src/component/popup/popup_content_confirm.tsx +106 -106
  244. package/src/component/popup/style.less +107 -107
  245. package/src/component/price/constant.ts +4 -4
  246. package/src/component/price/event_bus.ts +13 -13
  247. package/src/component/price/index.ts +2 -2
  248. package/src/component/price/price.tsx +154 -154
  249. package/src/component/price/stories.tsx +22 -22
  250. package/src/component/progress/index.ts +2 -2
  251. package/src/component/progress/progress.tsx +53 -53
  252. package/src/component/progress/stories.tsx +20 -20
  253. package/src/component/progress/style.less +35 -35
  254. package/src/component/progress_circle/index.ts +2 -2
  255. package/src/component/progress_circle/progress_circle.tsx +85 -85
  256. package/src/component/progress_circle/stories.tsx +31 -31
  257. package/src/component/progress_circle/style.less +21 -21
  258. package/src/component/radio/index.ts +5 -5
  259. package/src/component/radio/radio.tsx +72 -72
  260. package/src/component/radio/radio_group.tsx +48 -48
  261. package/src/component/radio/stories.tsx +103 -103
  262. package/src/component/radio/style.less +56 -56
  263. package/src/component/radio/util.ts +19 -19
  264. package/src/component/recommend_input/index.ts +2 -2
  265. package/src/component/recommend_input/recommend_input.tsx +100 -100
  266. package/src/component/recommend_input/stories.tsx +47 -47
  267. package/src/component/recommend_input/style.less +25 -25
  268. package/src/component/select/index.ts +2 -2
  269. package/src/component/select/select.tsx +172 -172
  270. package/src/component/select/stories.tsx +140 -140
  271. package/src/component/select/style.less +4 -4
  272. package/src/component/select/types.ts +29 -29
  273. package/src/component/selection/index.ts +2 -2
  274. package/src/component/selection/selection.tsx +162 -162
  275. package/src/component/selection/stories.tsx +45 -45
  276. package/src/component/selection/style.less +65 -65
  277. package/src/component/steps/index.ts +2 -2
  278. package/src/component/steps/steps.tsx +61 -61
  279. package/src/component/steps/stories.tsx +18 -18
  280. package/src/component/steps/style.less +39 -39
  281. package/src/component/storage/index.ts +1 -1
  282. package/src/component/storage/storage.ts +7 -7
  283. package/src/component/storage/stories.tsx +7 -7
  284. package/src/component/switch/index.ts +2 -2
  285. package/src/component/switch/stories.tsx +39 -39
  286. package/src/component/switch/style.less +60 -60
  287. package/src/component/switch/switch.tsx +127 -127
  288. package/src/component/table_select/index.ts +2 -2
  289. package/src/component/table_select/stories.tsx +97 -97
  290. package/src/component/table_select/style.less +20 -20
  291. package/src/component/table_select/table_select.tsx +92 -92
  292. package/src/component/table_select/types.ts +30 -30
  293. package/src/component/table_select/util.ts +15 -15
  294. package/src/component/tabs/index.ts +2 -2
  295. package/src/component/tabs/stories.tsx +172 -172
  296. package/src/component/tabs/style.less +149 -149
  297. package/src/component/tabs/tabs.tsx +232 -232
  298. package/src/component/textarea/index.ts +3 -3
  299. package/src/component/textarea/stories.tsx +37 -37
  300. package/src/component/textarea/style.less +12 -12
  301. package/src/component/textarea/textarea.tsx +22 -22
  302. package/src/component/time_span/index.ts +4 -4
  303. package/src/component/time_span/stories.tsx +87 -87
  304. package/src/component/time_span/style.less +45 -45
  305. package/src/component/time_span/time_span.tsx +129 -129
  306. package/src/component/time_span/time_span_picker.tsx +71 -71
  307. package/src/component/time_span/types.ts +58 -58
  308. package/src/component/time_span/util.ts +18 -18
  309. package/src/component/tip/index.ts +2 -2
  310. package/src/component/tip/stories.tsx +44 -44
  311. package/src/component/tip/style.less +53 -53
  312. package/src/component/tip/tip.tsx +95 -95
  313. package/src/component/tip/types.ts +20 -20
  314. package/src/component/tooltip/index.ts +2 -2
  315. package/src/component/tooltip/stories.tsx +32 -32
  316. package/src/component/tooltip/tooltip.tsx +40 -40
  317. package/src/component/transfer/index.ts +2 -2
  318. package/src/component/transfer/stories.tsx +140 -140
  319. package/src/component/transfer/transfer.tsx +147 -147
  320. package/src/component/transfer/types.ts +42 -42
  321. package/src/component/tree/bottom.tsx +34 -34
  322. package/src/component/tree/find.tsx +73 -73
  323. package/src/component/tree/index.ts +2 -2
  324. package/src/component/tree/item.tsx +75 -75
  325. package/src/component/tree/list.tsx +123 -123
  326. package/src/component/tree/search.tsx +29 -29
  327. package/src/component/tree/stories.tsx +309 -309
  328. package/src/component/tree/style.less +35 -35
  329. package/src/component/tree/tree.tsx +238 -238
  330. package/src/component/tree/types.ts +155 -155
  331. package/src/component/tree/util.ts +208 -208
  332. package/src/component/uploader/default_container.tsx +24 -24
  333. package/src/component/uploader/default_image.tsx +15 -15
  334. package/src/component/uploader/index.ts +10 -10
  335. package/src/component/uploader/stories.tsx +53 -53
  336. package/src/component/uploader/style.less +22 -22
  337. package/src/component/uploader/types.ts +25 -25
  338. package/src/component/uploader/uploader.tsx +62 -62
  339. package/src/component/v_browser/context/browser.ts +7 -7
  340. package/src/component/v_browser/context/browserWindow.ts +7 -7
  341. package/src/component/v_browser/hooks/useWindowEffect.ts +53 -53
  342. package/src/component/v_browser/index.ts +4 -4
  343. package/src/component/v_browser/types.ts +46 -46
  344. package/src/component/v_browser/ui/iframe_portal.tsx +28 -28
  345. package/src/component/v_browser/ui/index.tsx +213 -213
  346. package/src/component/v_browser/ui/style.less +113 -113
  347. package/src/component/v_browser/ui/window_wrapper.tsx +74 -74
  348. package/src/component/v_browser/v_browser.stories.mdx +128 -128
  349. package/src/component/v_browser/v_browser.tsx +287 -287
  350. package/src/css/base.less +64 -64
  351. package/src/css/bg.less +52 -52
  352. package/src/css/border.less +40 -40
  353. package/src/css/cursor.less +19 -19
  354. package/src/css/display.less +16 -16
  355. package/src/css/distance.less +93 -93
  356. package/src/css/error.less +8 -8
  357. package/src/css/other.less +15 -15
  358. package/src/css/overflow.less +23 -23
  359. package/src/css/position.less +11 -11
  360. package/src/css/svg.less +48 -48
  361. package/src/css/text.less +127 -127
  362. package/src/css/var/mixin.less +75 -75
  363. package/src/css/var/variables.less +125 -125
  364. package/src/event_type.ts +11 -11
  365. package/src/index.less +64 -64
  366. package/src/index.ts +61 -61
  367. package/src/svg/calendar-month.svg +8 -8
  368. package/src/svg/calendar-year.svg +13 -13
  369. package/src/svg/calendar.svg +17 -17
  370. package/src/svg/check-detail.svg +18 -18
  371. package/src/svg/close-circle.svg +13 -13
  372. package/src/svg/close-square.svg +12 -12
  373. package/src/svg/closeup.svg +20 -20
  374. package/src/svg/delete.svg +10 -10
  375. package/src/svg/down-small.svg +1 -1
  376. package/src/svg/down.svg +1 -1
  377. package/src/svg/edit-box.svg +17 -17
  378. package/src/svg/edit-pen.svg +17 -17
  379. package/src/svg/empty.svg +27 -27
  380. package/src/svg/expand.svg +21 -21
  381. package/src/svg/left-small.svg +1 -1
  382. package/src/svg/more.svg +10 -10
  383. package/src/svg/next.svg +40 -40
  384. package/src/svg/pen.svg +12 -12
  385. package/src/svg/remove.svg +1 -1
  386. package/src/svg/right-small.svg +1 -1
  387. package/src/svg/search.svg +8 -8
  388. package/src/svg/setting.svg +17 -17
  389. package/src/svg/up-small.svg +1 -1
  390. package/src/svg/up.svg +1 -1
  391. package/src/svg/vbrowser-tab-delete.svg +8 -8
  392. package/src/svg/vbrowser-tab-left.svg +8 -8
  393. package/src/svg/vbrowser-tab-right.svg +8 -8
  394. package/src/types.ts +33 -33
  395. package/src/validator/index.ts +16 -16
  396. package/src/validator/rules.ts +61 -61
  397. package/src/validator/types.ts +10 -10
  398. package/src/validator/validator.ts +95 -95
  399. package/src/var.less +2 -2
@@ -1,448 +1,448 @@
1
- import React, { useRef } from 'react'
2
- import {
3
- Form,
4
- FormItem,
5
- FormButton,
6
- FormBlock,
7
- FormGroup,
8
- FormPanel,
9
- FormPanelMore,
10
- } from './index'
11
- import {
12
- Select,
13
- Switch,
14
- Validator,
15
- RadioGroup,
16
- Radio,
17
- CheckboxGroup,
18
- Checkbox,
19
- Input,
20
- InputNumber,
21
- Flex,
22
- Button,
23
- } from '../../index'
24
- import { observable } from 'mobx'
25
- import { observer } from 'mobx-react'
26
-
27
- const area = [
28
- {
29
- value: 0,
30
- text: '南山',
31
- },
32
- {
33
- value: 1,
34
- text: '福田',
35
- },
36
- ]
37
-
38
- const store = observable({
39
- name: '',
40
- desc: '',
41
- area: null,
42
- sex: 0,
43
- taste: [],
44
- isWork: false,
45
- height: null,
46
- setData(key: string, value: any) {
47
- // @ts-ignore
48
- this[key] = value
49
- },
50
- })
51
-
52
- const Tets = observer(() => {
53
- return (
54
- <FormBlock col={2}>
55
- <FormItem label='邀请码' required>
56
- <input
57
- type='text'
58
- value={store.name}
59
- onChange={(e) => store.setData('name', e.target.value)}
60
- />
61
- <div className='gm-text-desc gm-margin-top-5'>
62
- 可以允许商户在规定时间内自主修改已提交订单内容
63
- </div>
64
- </FormItem>
65
- <FormItem label='名字' required>
66
- <input
67
- type='text'
68
- value={store.name}
69
- onChange={(e) => store.setData('name', e.target.value)}
70
- />
71
- </FormItem>
72
- <FormItem label='地区地区地区'>
73
- <Select
74
- data={area}
75
- value={store.area}
76
- onChange={(value) => store.setData('area', value)}
77
- />
78
- </FormItem>
79
- <FormItem label='是否工作' required>
80
- <Switch
81
- checked={store.isWork}
82
- onChange={(checked) => store.setData('isWork', checked)}
83
- />
84
- </FormItem>
85
- <FormItem label='描述' required validate={Validator.create([], store.desc)}>
86
- <textarea
87
- value={store.desc}
88
- onChange={(e) => store.setData('desc', e.target.value)}
89
- />
90
- </FormItem>
91
- </FormBlock>
92
- )
93
- })
94
-
95
- export const ComReadme = () => (
96
- <div>
97
- <pre>
98
- ` 新UI表单约束较多 - 栏数。有 1栏(默认) 2栏 3栏。其中搜索区域 3栏,常规表单区域 1栏
99
- 和 2栏 - 栏宽。一个表单内是固定的,宽度默认 320, FormPanel特殊一栏默认是
100
- 400,具体情况可自定义 - Item 内自然撑开 -
101
- Item宽度。一般占一栏,可能占两栏,可能占三栏 -
102
- Item高度。一般占一行,其他看具体情况自然往下撑开 `
103
- </pre>
104
- </div>
105
- )
106
-
107
- export const ComFormWithDisabledCol = () => (
108
- <div>
109
- <pre>
110
- ` Form 包住。一栏用法需要提供 disableCol。 FormItem 包住表单元素 - 可以简单包住
111
- input 即可,FormItem 会自动去识别常用的表单元素,并添加 gm-form-control
112
- 类名,以便撑开 - children 可以是数组,FormItem 读到第一个表单元素,做上面的操作 `
113
- </pre>
114
- <Form disabledCol labelWidth='100px' onSubmit={() => console.log('onSubmit')}>
115
- <FormItem label='名字' required>
116
- <Input
117
- type='text'
118
- value={store.name}
119
- onChange={(e) => store.setData('name', e.target.value)}
120
- />
121
- </FormItem>
122
- <FormItem label='描述' required validate={Validator.create([], store.desc)}>
123
- <textarea
124
- value={store.desc}
125
- onChange={(e) => store.setData('desc', e.target.value)}
126
- />
127
- </FormItem>
128
- <FormItem label='地区'>
129
- <Select
130
- data={area}
131
- value={store.area}
132
- onChange={(value) => store.setData('area', value)}
133
- />
134
- </FormItem>
135
- <FormItem label='是否工作'>
136
- <Switch
137
- checked={store.isWork}
138
- onChange={(checked) => store.setData('isWork', checked)}
139
- />
140
- </FormItem>
141
- <FormItem label='性别'>
142
- <RadioGroup
143
- name='sex'
144
- value={store.sex}
145
- onChange={(value) => store.setData('sex', value)}
146
- >
147
- <Radio value={0}>男</Radio>
148
- <Radio value={1}>女</Radio>
149
- </RadioGroup>
150
- </FormItem>
151
- <FormItem label='兴趣'>
152
- <CheckboxGroup
153
- name='taste'
154
- value={store.taste}
155
- onChange={(value) => store.setData('taste', value)}
156
- >
157
- <Checkbox value={0}>阅读</Checkbox>
158
- <Checkbox value={1}>打篮球</Checkbox>
159
- <Checkbox value={2}>美食</Checkbox>
160
- <Checkbox value={3}>旅游</Checkbox>
161
- </CheckboxGroup>
162
- </FormItem>
163
- <FormItem label='自定义' unLabelTop>
164
- <div>
165
- 这里是自定义。没有上边距的情况下,label 要对齐,则提供 unLabelTop 去掉 label
166
- 的上边距
167
- </div>
168
- </FormItem>
169
- <FormItem label='身高'>
170
- <InputNumber
171
- value={store.height}
172
- onChange={(value) => store.setData('height', value)}
173
- />
174
- <div className='gm-text-desc gm-margin-top-5'>要填写升高,升高</div>
175
- <div>(这里演示多个 children 的情况)</div>
176
- </FormItem>
177
- <FormButton>
178
- <Button type='primary' htmlType='submit'>
179
- 提交
180
- </Button>
181
- </FormButton>
182
- </Form>
183
- </div>
184
- )
185
-
186
- export const ComFormBlock = () => (
187
- <Form labelWidth='100px' onSubmit={() => console.log('onSubmit')}>
188
- <FormBlock col={2}>
189
- <FormItem label='名字' required>
190
- <input
191
- type='text'
192
- value={store.name}
193
- onChange={(e) => store.setData('name', e.target.value)}
194
- />
195
- </FormItem>
196
- <FormItem label='地区'>
197
- <Select
198
- data={area}
199
- value={store.area}
200
- onChange={(value) => store.setData('area', value)}
201
- />
202
- </FormItem>
203
- <FormItem label='是否工作'>
204
- <Switch
205
- checked={store.isWork}
206
- onChange={(checked) => store.setData('isWork', checked)}
207
- />
208
- </FormItem>
209
- <FormItem label='身高'>
210
- <InputNumber
211
- value={store.height}
212
- onChange={(value) => store.setData('height', value)}
213
- />
214
- <div className='gm-text-desc gm-margin-top-5'>要填写升高,升高</div>
215
- <div>(这里演示多个 children 的情况)</div>
216
- </FormItem>
217
- <FormItem label='性别'>
218
- <RadioGroup
219
- name='sex'
220
- value={store.sex}
221
- onChange={(value) => store.setData('sex', value)}
222
- >
223
- <Radio value={0}>男</Radio>
224
- <Radio value={1}>女</Radio>
225
- </RadioGroup>
226
- </FormItem>
227
- <FormItem label='兴趣'>
228
- <CheckboxGroup
229
- name='taste'
230
- value={store.taste}
231
- onChange={(value) => store.setData('taste', value)}
232
- >
233
- <Checkbox value={0}>阅读</Checkbox>
234
- <Checkbox value={1}>打篮球</Checkbox>
235
- <Checkbox value={2}>美食</Checkbox>
236
- <Checkbox value={3}>旅游</Checkbox>
237
- </CheckboxGroup>
238
- </FormItem>
239
- </FormBlock>
240
- <FormItem col={2} label='描述' required validate={Validator.create([], store.desc)}>
241
- <textarea
242
- value={store.desc}
243
- onChange={(e) => store.setData('desc', e.target.value)}
244
- />
245
- </FormItem>
246
- <FormItem col={2} label='自定义' unLabelTop>
247
- <div>
248
- 这里是自定义。没有上边距的情况下,label 要对齐,则提供 unLabelTop 去掉 label
249
- 的上边距
250
- </div>
251
- </FormItem>
252
-
253
- <FormButton>
254
- <Button type='primary' htmlType='submit'>
255
- 提交
256
- </Button>
257
- </FormButton>
258
- </Form>
259
- )
260
-
261
- export const ComFormGroup = () => {
262
- const form1 = useRef(null)
263
- const form2 = useRef(null)
264
- return (
265
- <FormGroup
266
- formRefs={[form1, form2]}
267
- onCancel={() => console.log('Cancel')}
268
- onSubmit={() => {
269
- console.log('onSubmit')
270
- return new Promise((resolve) => {
271
- setTimeout(() => {
272
- resolve()
273
- }, 3000)
274
- })
275
- }}
276
- >
277
- <div>第一个表单</div>
278
- <Form ref={form1} labelWidth='100px' hasButtonInGroup>
279
- <FormItem label='名字' required>
280
- <input
281
- type='text'
282
- value={store.name}
283
- onChange={(e) => store.setData('name', e.target.value)}
284
- />
285
- </FormItem>
286
- </Form>
287
- <div>第二个表单</div>
288
- <Form ref={form2} labelWidth='100px' hasButtonInGroup>
289
- <FormItem label='描述' required validate={Validator.create([], store.desc)}>
290
- <textarea
291
- value={store.desc}
292
- onChange={(e) => store.setData('desc', e.target.value)}
293
- />
294
- </FormItem>
295
- <FormItem label='名字' required>
296
- <input
297
- type='text'
298
- value={store.name}
299
- onChange={(e) => store.setData('name', e.target.value)}
300
- />
301
- </FormItem>
302
- </Form>
303
- </FormGroup>
304
- )
305
- }
306
- export const ComFormPanel = () => {
307
- const form3 = useRef(null)
308
- const form4 = useRef(null)
309
- return (
310
- <FormGroup
311
- formRefs={[form3, form4]}
312
- onCancel={() => console.log('Cancel')}
313
- // onSubmit={() => console.log('onSubmit')}
314
- onSubmitValidated={() => console.log('onSubmitValidated')}
315
- >
316
- <FormPanel
317
- title='店铺设置'
318
- left={<Button type='primary'>搜索</Button>}
319
- right={<Button onClick={() => console.log('删除')}>删除</Button>}
320
- >
321
- <Form colWidth='400px' ref={form3} labelWidth='160px' hasButtonInGroup>
322
- <FormItem label='名字' colWidth='700px' required>
323
- <input
324
- type='text'
325
- className='gm-form-control'
326
- value={store.name}
327
- onChange={(e) => store.setData('name', e.target.value)}
328
- />
329
- </FormItem>
330
- <FormItem label='邀请码' required>
331
- <input
332
- type='text'
333
- value={store.name}
334
- onChange={(e) => store.setData('name', e.target.value)}
335
- />
336
- <div className='gm-text-desc gm-margin-top-5'>
337
- 可以允许商户在规定时间内自主修改已提交订单内容
338
- </div>
339
- </FormItem>
340
-
341
- <FormBlock col={2}>
342
- <FormItem
343
- label='名字'
344
- required
345
- tooltip={
346
- <div className='gm-padding-10 gm-bg' style={{ width: '455px' }}>
347
- <p style={{ marginBottom: '4px', fontSize: '12px' }}>
348
- 23333333333333333
349
- </p>
350
- <p style={{ marginBottom: 0, fontSize: '12px' }}>4555555555555555</p>
351
- </div>
352
- }
353
- >
354
- <Flex alignCenter>
355
- <input
356
- type='text'
357
- className='gm-form-control'
358
- value={store.name}
359
- onChange={(e) => store.setData('name', e.target.value)}
360
- />
361
- </Flex>
362
- </FormItem>
363
- <FormItem label='地区'>
364
- <Select
365
- data={area}
366
- value={store.area}
367
- onChange={(value) => store.setData('area', value)}
368
- />
369
- </FormItem>
370
- <FormItem label='描述' required validate={Validator.create([], store.desc)}>
371
- <textarea
372
- value={store.desc}
373
- onChange={(e) => store.setData('desc', e.target.value)}
374
- />
375
- </FormItem>
376
- <FormItem label='兴趣'>
377
- <CheckboxGroup
378
- style={{ width: '400px' }}
379
- name='taste'
380
- value={store.taste}
381
- onChange={(value) => store.setData('taste', value)}
382
- >
383
- <Checkbox value={0}>阅读</Checkbox>
384
- <Checkbox value={1}>打篮球</Checkbox>
385
- <Checkbox value={2}>美食</Checkbox>
386
- <Checkbox value={0}>阅读</Checkbox>
387
- <Checkbox value={1}>打篮球</Checkbox>
388
- <Checkbox value={2}>美食</Checkbox>
389
- </CheckboxGroup>
390
- </FormItem>
391
- </FormBlock>
392
- <FormPanelMore>
393
- <FormBlock col={2}>
394
- <FormItem label='邀请码' required>
395
- <input
396
- type='text'
397
- value={store.name}
398
- onChange={(e) => store.setData('name', e.target.value)}
399
- />
400
- <div className='gm-text-desc gm-margin-top-5'>
401
- 可以允许商户在规定时间内自主修改已提交订单内容
402
- </div>
403
- </FormItem>
404
- <FormItem label='名字' required>
405
- <input
406
- type='text'
407
- value={store.name}
408
- onChange={(e) => store.setData('name', e.target.value)}
409
- />
410
- </FormItem>
411
- <FormItem label={<span>地区地区地区</span>}>
412
- <Select
413
- data={area}
414
- value={store.area}
415
- onChange={(value) => store.setData('area', value)}
416
- />
417
- </FormItem>
418
- <FormItem label='是否工作' required>
419
- <Switch
420
- checked={store.isWork}
421
- onChange={(checked) => store.setData('isWork', checked)}
422
- />
423
- </FormItem>
424
- </FormBlock>
425
- </FormPanelMore>
426
- </Form>
427
- </FormPanel>
428
-
429
- <FormPanel
430
- title='店铺设置'
431
- left={
432
- <span className='gm-margin-left-10' onClick={() => console.log('搜索')}>
433
- 搜索
434
- </span>
435
- }
436
- right={<span onClick={() => console.log('删除')}>删除</span>}
437
- >
438
- <Form colWidth='400px' ref={form4} labelWidth='160px' hasButtonInGroup>
439
- <Tets />
440
- </Form>
441
- </FormPanel>
442
- </FormGroup>
443
- )
444
- }
445
-
446
- export default {
447
- title: '表单/Form',
448
- }
1
+ import React, { useRef } from 'react'
2
+ import {
3
+ Form,
4
+ FormItem,
5
+ FormButton,
6
+ FormBlock,
7
+ FormGroup,
8
+ FormPanel,
9
+ FormPanelMore,
10
+ } from './index'
11
+ import {
12
+ Select,
13
+ Switch,
14
+ Validator,
15
+ RadioGroup,
16
+ Radio,
17
+ CheckboxGroup,
18
+ Checkbox,
19
+ Input,
20
+ InputNumber,
21
+ Flex,
22
+ Button,
23
+ } from '../../index'
24
+ import { observable } from 'mobx'
25
+ import { observer } from 'mobx-react'
26
+
27
+ const area = [
28
+ {
29
+ value: 0,
30
+ text: '南山',
31
+ },
32
+ {
33
+ value: 1,
34
+ text: '福田',
35
+ },
36
+ ]
37
+
38
+ const store = observable({
39
+ name: '',
40
+ desc: '',
41
+ area: null,
42
+ sex: 0,
43
+ taste: [],
44
+ isWork: false,
45
+ height: null,
46
+ setData(key: string, value: any) {
47
+ // @ts-ignore
48
+ this[key] = value
49
+ },
50
+ })
51
+
52
+ const Tets = observer(() => {
53
+ return (
54
+ <FormBlock col={2}>
55
+ <FormItem label='邀请码' required>
56
+ <input
57
+ type='text'
58
+ value={store.name}
59
+ onChange={(e) => store.setData('name', e.target.value)}
60
+ />
61
+ <div className='gm-text-desc gm-margin-top-5'>
62
+ 可以允许商户在规定时间内自主修改已提交订单内容
63
+ </div>
64
+ </FormItem>
65
+ <FormItem label='名字' required>
66
+ <input
67
+ type='text'
68
+ value={store.name}
69
+ onChange={(e) => store.setData('name', e.target.value)}
70
+ />
71
+ </FormItem>
72
+ <FormItem label='地区地区地区'>
73
+ <Select
74
+ data={area}
75
+ value={store.area}
76
+ onChange={(value) => store.setData('area', value)}
77
+ />
78
+ </FormItem>
79
+ <FormItem label='是否工作' required>
80
+ <Switch
81
+ checked={store.isWork}
82
+ onChange={(checked) => store.setData('isWork', checked)}
83
+ />
84
+ </FormItem>
85
+ <FormItem label='描述' required validate={Validator.create([], store.desc)}>
86
+ <textarea
87
+ value={store.desc}
88
+ onChange={(e) => store.setData('desc', e.target.value)}
89
+ />
90
+ </FormItem>
91
+ </FormBlock>
92
+ )
93
+ })
94
+
95
+ export const ComReadme = () => (
96
+ <div>
97
+ <pre>
98
+ ` 新UI表单约束较多 - 栏数。有 1栏(默认) 2栏 3栏。其中搜索区域 3栏,常规表单区域 1栏
99
+ 和 2栏 - 栏宽。一个表单内是固定的,宽度默认 320, FormPanel特殊一栏默认是
100
+ 400,具体情况可自定义 - Item 内自然撑开 -
101
+ Item宽度。一般占一栏,可能占两栏,可能占三栏 -
102
+ Item高度。一般占一行,其他看具体情况自然往下撑开 `
103
+ </pre>
104
+ </div>
105
+ )
106
+
107
+ export const ComFormWithDisabledCol = () => (
108
+ <div>
109
+ <pre>
110
+ ` Form 包住。一栏用法需要提供 disableCol。 FormItem 包住表单元素 - 可以简单包住
111
+ input 即可,FormItem 会自动去识别常用的表单元素,并添加 gm-form-control
112
+ 类名,以便撑开 - children 可以是数组,FormItem 读到第一个表单元素,做上面的操作 `
113
+ </pre>
114
+ <Form disabledCol labelWidth='100px' onSubmit={() => console.log('onSubmit')}>
115
+ <FormItem label='名字' required>
116
+ <Input
117
+ type='text'
118
+ value={store.name}
119
+ onChange={(e) => store.setData('name', e.target.value)}
120
+ />
121
+ </FormItem>
122
+ <FormItem label='描述' required validate={Validator.create([], store.desc)}>
123
+ <textarea
124
+ value={store.desc}
125
+ onChange={(e) => store.setData('desc', e.target.value)}
126
+ />
127
+ </FormItem>
128
+ <FormItem label='地区'>
129
+ <Select
130
+ data={area}
131
+ value={store.area}
132
+ onChange={(value) => store.setData('area', value)}
133
+ />
134
+ </FormItem>
135
+ <FormItem label='是否工作'>
136
+ <Switch
137
+ checked={store.isWork}
138
+ onChange={(checked) => store.setData('isWork', checked)}
139
+ />
140
+ </FormItem>
141
+ <FormItem label='性别'>
142
+ <RadioGroup
143
+ name='sex'
144
+ value={store.sex}
145
+ onChange={(value) => store.setData('sex', value)}
146
+ >
147
+ <Radio value={0}>男</Radio>
148
+ <Radio value={1}>女</Radio>
149
+ </RadioGroup>
150
+ </FormItem>
151
+ <FormItem label='兴趣'>
152
+ <CheckboxGroup
153
+ name='taste'
154
+ value={store.taste}
155
+ onChange={(value) => store.setData('taste', value)}
156
+ >
157
+ <Checkbox value={0}>阅读</Checkbox>
158
+ <Checkbox value={1}>打篮球</Checkbox>
159
+ <Checkbox value={2}>美食</Checkbox>
160
+ <Checkbox value={3}>旅游</Checkbox>
161
+ </CheckboxGroup>
162
+ </FormItem>
163
+ <FormItem label='自定义' unLabelTop>
164
+ <div>
165
+ 这里是自定义。没有上边距的情况下,label 要对齐,则提供 unLabelTop 去掉 label
166
+ 的上边距
167
+ </div>
168
+ </FormItem>
169
+ <FormItem label='身高'>
170
+ <InputNumber
171
+ value={store.height}
172
+ onChange={(value) => store.setData('height', value)}
173
+ />
174
+ <div className='gm-text-desc gm-margin-top-5'>要填写升高,升高</div>
175
+ <div>(这里演示多个 children 的情况)</div>
176
+ </FormItem>
177
+ <FormButton>
178
+ <Button type='primary' htmlType='submit'>
179
+ 提交
180
+ </Button>
181
+ </FormButton>
182
+ </Form>
183
+ </div>
184
+ )
185
+
186
+ export const ComFormBlock = () => (
187
+ <Form labelWidth='100px' onSubmit={() => console.log('onSubmit')}>
188
+ <FormBlock col={2}>
189
+ <FormItem label='名字' required>
190
+ <input
191
+ type='text'
192
+ value={store.name}
193
+ onChange={(e) => store.setData('name', e.target.value)}
194
+ />
195
+ </FormItem>
196
+ <FormItem label='地区'>
197
+ <Select
198
+ data={area}
199
+ value={store.area}
200
+ onChange={(value) => store.setData('area', value)}
201
+ />
202
+ </FormItem>
203
+ <FormItem label='是否工作'>
204
+ <Switch
205
+ checked={store.isWork}
206
+ onChange={(checked) => store.setData('isWork', checked)}
207
+ />
208
+ </FormItem>
209
+ <FormItem label='身高'>
210
+ <InputNumber
211
+ value={store.height}
212
+ onChange={(value) => store.setData('height', value)}
213
+ />
214
+ <div className='gm-text-desc gm-margin-top-5'>要填写升高,升高</div>
215
+ <div>(这里演示多个 children 的情况)</div>
216
+ </FormItem>
217
+ <FormItem label='性别'>
218
+ <RadioGroup
219
+ name='sex'
220
+ value={store.sex}
221
+ onChange={(value) => store.setData('sex', value)}
222
+ >
223
+ <Radio value={0}>男</Radio>
224
+ <Radio value={1}>女</Radio>
225
+ </RadioGroup>
226
+ </FormItem>
227
+ <FormItem label='兴趣'>
228
+ <CheckboxGroup
229
+ name='taste'
230
+ value={store.taste}
231
+ onChange={(value) => store.setData('taste', value)}
232
+ >
233
+ <Checkbox value={0}>阅读</Checkbox>
234
+ <Checkbox value={1}>打篮球</Checkbox>
235
+ <Checkbox value={2}>美食</Checkbox>
236
+ <Checkbox value={3}>旅游</Checkbox>
237
+ </CheckboxGroup>
238
+ </FormItem>
239
+ </FormBlock>
240
+ <FormItem col={2} label='描述' required validate={Validator.create([], store.desc)}>
241
+ <textarea
242
+ value={store.desc}
243
+ onChange={(e) => store.setData('desc', e.target.value)}
244
+ />
245
+ </FormItem>
246
+ <FormItem col={2} label='自定义' unLabelTop>
247
+ <div>
248
+ 这里是自定义。没有上边距的情况下,label 要对齐,则提供 unLabelTop 去掉 label
249
+ 的上边距
250
+ </div>
251
+ </FormItem>
252
+
253
+ <FormButton>
254
+ <Button type='primary' htmlType='submit'>
255
+ 提交
256
+ </Button>
257
+ </FormButton>
258
+ </Form>
259
+ )
260
+
261
+ export const ComFormGroup = () => {
262
+ const form1 = useRef(null)
263
+ const form2 = useRef(null)
264
+ return (
265
+ <FormGroup
266
+ formRefs={[form1, form2]}
267
+ onCancel={() => console.log('Cancel')}
268
+ onSubmit={() => {
269
+ console.log('onSubmit')
270
+ return new Promise((resolve) => {
271
+ setTimeout(() => {
272
+ resolve()
273
+ }, 3000)
274
+ })
275
+ }}
276
+ >
277
+ <div>第一个表单</div>
278
+ <Form ref={form1} labelWidth='100px' hasButtonInGroup>
279
+ <FormItem label='名字' required>
280
+ <input
281
+ type='text'
282
+ value={store.name}
283
+ onChange={(e) => store.setData('name', e.target.value)}
284
+ />
285
+ </FormItem>
286
+ </Form>
287
+ <div>第二个表单</div>
288
+ <Form ref={form2} labelWidth='100px' hasButtonInGroup>
289
+ <FormItem label='描述' required validate={Validator.create([], store.desc)}>
290
+ <textarea
291
+ value={store.desc}
292
+ onChange={(e) => store.setData('desc', e.target.value)}
293
+ />
294
+ </FormItem>
295
+ <FormItem label='名字' required>
296
+ <input
297
+ type='text'
298
+ value={store.name}
299
+ onChange={(e) => store.setData('name', e.target.value)}
300
+ />
301
+ </FormItem>
302
+ </Form>
303
+ </FormGroup>
304
+ )
305
+ }
306
+ export const ComFormPanel = () => {
307
+ const form3 = useRef(null)
308
+ const form4 = useRef(null)
309
+ return (
310
+ <FormGroup
311
+ formRefs={[form3, form4]}
312
+ onCancel={() => console.log('Cancel')}
313
+ // onSubmit={() => console.log('onSubmit')}
314
+ onSubmitValidated={() => console.log('onSubmitValidated')}
315
+ >
316
+ <FormPanel
317
+ title='店铺设置'
318
+ left={<Button type='primary'>搜索</Button>}
319
+ right={<Button onClick={() => console.log('删除')}>删除</Button>}
320
+ >
321
+ <Form colWidth='400px' ref={form3} labelWidth='160px' hasButtonInGroup>
322
+ <FormItem label='名字' colWidth='700px' required>
323
+ <input
324
+ type='text'
325
+ className='gm-form-control'
326
+ value={store.name}
327
+ onChange={(e) => store.setData('name', e.target.value)}
328
+ />
329
+ </FormItem>
330
+ <FormItem label='邀请码' required>
331
+ <input
332
+ type='text'
333
+ value={store.name}
334
+ onChange={(e) => store.setData('name', e.target.value)}
335
+ />
336
+ <div className='gm-text-desc gm-margin-top-5'>
337
+ 可以允许商户在规定时间内自主修改已提交订单内容
338
+ </div>
339
+ </FormItem>
340
+
341
+ <FormBlock col={2}>
342
+ <FormItem
343
+ label='名字'
344
+ required
345
+ tooltip={
346
+ <div className='gm-padding-10 gm-bg' style={{ width: '455px' }}>
347
+ <p style={{ marginBottom: '4px', fontSize: '12px' }}>
348
+ 23333333333333333
349
+ </p>
350
+ <p style={{ marginBottom: 0, fontSize: '12px' }}>4555555555555555</p>
351
+ </div>
352
+ }
353
+ >
354
+ <Flex alignCenter>
355
+ <input
356
+ type='text'
357
+ className='gm-form-control'
358
+ value={store.name}
359
+ onChange={(e) => store.setData('name', e.target.value)}
360
+ />
361
+ </Flex>
362
+ </FormItem>
363
+ <FormItem label='地区'>
364
+ <Select
365
+ data={area}
366
+ value={store.area}
367
+ onChange={(value) => store.setData('area', value)}
368
+ />
369
+ </FormItem>
370
+ <FormItem label='描述' required validate={Validator.create([], store.desc)}>
371
+ <textarea
372
+ value={store.desc}
373
+ onChange={(e) => store.setData('desc', e.target.value)}
374
+ />
375
+ </FormItem>
376
+ <FormItem label='兴趣'>
377
+ <CheckboxGroup
378
+ style={{ width: '400px' }}
379
+ name='taste'
380
+ value={store.taste}
381
+ onChange={(value) => store.setData('taste', value)}
382
+ >
383
+ <Checkbox value={0}>阅读</Checkbox>
384
+ <Checkbox value={1}>打篮球</Checkbox>
385
+ <Checkbox value={2}>美食</Checkbox>
386
+ <Checkbox value={0}>阅读</Checkbox>
387
+ <Checkbox value={1}>打篮球</Checkbox>
388
+ <Checkbox value={2}>美食</Checkbox>
389
+ </CheckboxGroup>
390
+ </FormItem>
391
+ </FormBlock>
392
+ <FormPanelMore>
393
+ <FormBlock col={2}>
394
+ <FormItem label='邀请码' required>
395
+ <input
396
+ type='text'
397
+ value={store.name}
398
+ onChange={(e) => store.setData('name', e.target.value)}
399
+ />
400
+ <div className='gm-text-desc gm-margin-top-5'>
401
+ 可以允许商户在规定时间内自主修改已提交订单内容
402
+ </div>
403
+ </FormItem>
404
+ <FormItem label='名字' required>
405
+ <input
406
+ type='text'
407
+ value={store.name}
408
+ onChange={(e) => store.setData('name', e.target.value)}
409
+ />
410
+ </FormItem>
411
+ <FormItem label={<span>地区地区地区</span>}>
412
+ <Select
413
+ data={area}
414
+ value={store.area}
415
+ onChange={(value) => store.setData('area', value)}
416
+ />
417
+ </FormItem>
418
+ <FormItem label='是否工作' required>
419
+ <Switch
420
+ checked={store.isWork}
421
+ onChange={(checked) => store.setData('isWork', checked)}
422
+ />
423
+ </FormItem>
424
+ </FormBlock>
425
+ </FormPanelMore>
426
+ </Form>
427
+ </FormPanel>
428
+
429
+ <FormPanel
430
+ title='店铺设置'
431
+ left={
432
+ <span className='gm-margin-left-10' onClick={() => console.log('搜索')}>
433
+ 搜索
434
+ </span>
435
+ }
436
+ right={<span onClick={() => console.log('删除')}>删除</span>}
437
+ >
438
+ <Form colWidth='400px' ref={form4} labelWidth='160px' hasButtonInGroup>
439
+ <Tets />
440
+ </Form>
441
+ </FormPanel>
442
+ </FormGroup>
443
+ )
444
+ }
445
+
446
+ export default {
447
+ title: '表单/Form',
448
+ }