doui-react 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (775) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +28 -0
  3. package/es/api/component/class-name.d.ts +3 -0
  4. package/es/api/component/class-name.js +15 -0
  5. package/es/api/component/common.d.ts +22 -0
  6. package/es/api/component/common.js +144 -0
  7. package/es/api/component/dom.d.ts +2 -0
  8. package/es/api/component/dom.js +7 -0
  9. package/es/api/component/global-style.d.ts +3 -0
  10. package/es/api/component/global-style.js +16 -0
  11. package/es/api/component/index.d.ts +9 -0
  12. package/es/api/component/index.js +9 -0
  13. package/es/api/component/react-dom.d.ts +3 -0
  14. package/es/api/component/react-dom.js +72 -0
  15. package/es/api/component/sort.d.ts +2 -0
  16. package/es/api/component/sort.js +20 -0
  17. package/es/api/component/style.d.ts +4 -0
  18. package/es/api/component/style.js +33 -0
  19. package/es/api/component/url.d.ts +33 -0
  20. package/es/api/component/url.js +126 -0
  21. package/es/api/component/validate-input.d.ts +8 -0
  22. package/es/api/component/validate-input.js +16 -0
  23. package/es/api/index.d.ts +2 -0
  24. package/es/api/index.js +2 -0
  25. package/es/api/type/common.d.ts +24 -0
  26. package/es/api/type/common.js +1 -0
  27. package/es/api/type/index.d.ts +5 -0
  28. package/es/api/type/index.js +2 -0
  29. package/es/button/component/index.d.ts +2 -0
  30. package/es/button/component/index.js +87 -0
  31. package/es/button/index.d.ts +2 -0
  32. package/es/button/index.js +2 -0
  33. package/es/button/type/index.d.ts +31 -0
  34. package/es/button/type/index.js +1 -0
  35. package/es/checkbox/component/checkbox-group.d.ts +2 -0
  36. package/es/checkbox/component/checkbox-group.js +66 -0
  37. package/es/checkbox/component/checkbox.d.ts +2 -0
  38. package/es/checkbox/component/checkbox.js +8 -0
  39. package/es/checkbox/component/index.d.ts +2 -0
  40. package/es/checkbox/component/index.js +10 -0
  41. package/es/checkbox/component/use-checkbox.d.ts +12 -0
  42. package/es/checkbox/component/use-checkbox.js +43 -0
  43. package/es/checkbox/component/utils.d.ts +13 -0
  44. package/es/checkbox/component/utils.js +40 -0
  45. package/es/checkbox/index.d.ts +2 -0
  46. package/es/checkbox/index.js +2 -0
  47. package/es/checkbox/style/index.d.ts +5 -0
  48. package/es/checkbox/style/index.js +11 -0
  49. package/es/checkbox/type/index.d.ts +18 -0
  50. package/es/checkbox/type/index.js +1 -0
  51. package/es/config/index.d.ts +0 -0
  52. package/es/config/index.js +0 -0
  53. package/es/date-picker/component/index.d.ts +3 -0
  54. package/es/date-picker/component/index.js +38 -0
  55. package/es/date-picker/index.d.ts +2 -0
  56. package/es/date-picker/index.js +2 -0
  57. package/es/date-picker/style/index.d.ts +4 -0
  58. package/es/date-picker/style/index.js +7 -0
  59. package/es/date-picker/type/index.d.ts +21 -0
  60. package/es/date-picker/type/index.js +1 -0
  61. package/es/empty/component/index.d.ts +2 -0
  62. package/es/empty/component/index.js +17 -0
  63. package/es/empty/index.d.ts +2 -0
  64. package/es/empty/index.js +2 -0
  65. package/es/empty/type/index.d.ts +9 -0
  66. package/es/empty/type/index.js +1 -0
  67. package/es/form/component/constant.d.ts +15 -0
  68. package/es/form/component/constant.js +15 -0
  69. package/es/form/component/form-content.d.ts +10 -0
  70. package/es/form/component/form-content.js +280 -0
  71. package/es/form/component/form-item-map.d.ts +40 -0
  72. package/es/form/component/form-item-map.js +120 -0
  73. package/es/form/component/form-item.d.ts +7 -0
  74. package/es/form/component/form-item.js +219 -0
  75. package/es/form/component/form-list.d.ts +36 -0
  76. package/es/form/component/form-list.js +190 -0
  77. package/es/form/component/form.d.ts +2 -0
  78. package/es/form/component/form.js +40 -0
  79. package/es/form/component/index.d.ts +15 -0
  80. package/es/form/component/index.js +14 -0
  81. package/es/form/component/submit-button.d.ts +2 -0
  82. package/es/form/component/submit-button.js +47 -0
  83. package/es/form/component/use-debug.d.ts +1 -0
  84. package/es/form/component/use-debug.js +16 -0
  85. package/es/form/component/utils.d.ts +95 -0
  86. package/es/form/component/utils.js +435 -0
  87. package/es/form/component/validator-item.d.ts +7 -0
  88. package/es/form/component/validator-item.js +53 -0
  89. package/es/form/hook/index.d.ts +16 -0
  90. package/es/form/hook/index.js +116 -0
  91. package/es/form/hook/list-provider.d.ts +6 -0
  92. package/es/form/hook/list-provider.js +16 -0
  93. package/es/form/hook/provider.d.ts +23 -0
  94. package/es/form/hook/provider.js +21 -0
  95. package/es/form/hook/use-form.d.ts +2 -0
  96. package/es/form/hook/use-form.js +335 -0
  97. package/es/form/index.d.ts +3 -0
  98. package/es/form/index.js +3 -0
  99. package/es/form/style/form-item.d.ts +3 -0
  100. package/es/form/style/form-item.js +38 -0
  101. package/es/form/style/index.d.ts +7 -0
  102. package/es/form/style/index.js +13 -0
  103. package/es/form/type/form-item.d.ts +141 -0
  104. package/es/form/type/form-item.js +1 -0
  105. package/es/form/type/form-list.d.ts +91 -0
  106. package/es/form/type/form-list.js +1 -0
  107. package/es/form/type/index.d.ts +134 -0
  108. package/es/form/type/index.js +3 -0
  109. package/es/grid/component/index.d.ts +2 -0
  110. package/es/grid/component/index.js +76 -0
  111. package/es/grid/component/pagination.d.ts +50 -0
  112. package/es/grid/component/pagination.js +54 -0
  113. package/es/grid/component/utils.d.ts +2 -0
  114. package/es/grid/component/utils.js +7 -0
  115. package/es/grid/index.d.ts +2 -0
  116. package/es/grid/index.js +2 -0
  117. package/es/grid/style/index.d.ts +11 -0
  118. package/es/grid/style/index.js +26 -0
  119. package/es/grid/type/index.d.ts +67 -0
  120. package/es/grid/type/index.js +1 -0
  121. package/es/highlight-text/component/index.d.ts +2 -0
  122. package/es/highlight-text/component/index.js +71 -0
  123. package/es/highlight-text/index.d.ts +2 -0
  124. package/es/highlight-text/index.js +2 -0
  125. package/es/highlight-text/style/index.d.ts +4 -0
  126. package/es/highlight-text/style/index.js +7 -0
  127. package/es/highlight-text/type/index.d.ts +18 -0
  128. package/es/highlight-text/type/index.js +1 -0
  129. package/es/hooks/hook/common.d.ts +1 -0
  130. package/es/hooks/hook/common.js +12 -0
  131. package/es/hooks/hook/index.d.ts +7 -0
  132. package/es/hooks/hook/index.js +7 -0
  133. package/es/hooks/hook/use-debounce.d.ts +4 -0
  134. package/es/hooks/hook/use-debounce.js +23 -0
  135. package/es/hooks/hook/use-deep.d.ts +9 -0
  136. package/es/hooks/hook/use-deep.js +64 -0
  137. package/es/hooks/hook/use-fetch.d.ts +8 -0
  138. package/es/hooks/hook/use-fetch.js +164 -0
  139. package/es/hooks/hook/use-list-operation.d.ts +5 -0
  140. package/es/hooks/hook/use-list-operation.js +70 -0
  141. package/es/hooks/hook/use-loading.d.ts +7 -0
  142. package/es/hooks/hook/use-loading.js +59 -0
  143. package/es/hooks/hook/use-window-resize.d.ts +5 -0
  144. package/es/hooks/hook/use-window-resize.js +16 -0
  145. package/es/hooks/index.d.ts +2 -0
  146. package/es/hooks/index.js +2 -0
  147. package/es/hooks/type/index.d.ts +2 -0
  148. package/es/hooks/type/index.js +2 -0
  149. package/es/hooks/type/use-fetch.d.ts +31 -0
  150. package/es/hooks/type/use-fetch.js +1 -0
  151. package/es/hooks/type/use-list-operation.d.ts +34 -0
  152. package/es/hooks/type/use-list-operation.js +1 -0
  153. package/es/icon/component/down.d.ts +2 -0
  154. package/es/icon/component/down.js +42 -0
  155. package/es/icon/component/index.d.ts +2 -0
  156. package/es/icon/component/index.js +5 -0
  157. package/es/icon/component/up.d.ts +2 -0
  158. package/es/icon/component/up.js +41 -0
  159. package/es/icon/hook/index.d.ts +477 -0
  160. package/es/icon/hook/index.js +60 -0
  161. package/es/icon/index.d.ts +2 -0
  162. package/es/icon/index.js +2 -0
  163. package/es/icon/style/index.d.ts +4 -0
  164. package/es/icon/style/index.js +10 -0
  165. package/es/icon/type/index.d.ts +14 -0
  166. package/es/icon/type/index.js +1 -0
  167. package/es/index.d.ts +25 -0
  168. package/es/index.js +25 -0
  169. package/es/input/component/index.d.ts +12 -0
  170. package/es/input/component/index.js +25 -0
  171. package/es/input/component/input.d.ts +2 -0
  172. package/es/input/component/input.js +8 -0
  173. package/es/input/component/number.d.ts +4 -0
  174. package/es/input/component/number.js +50 -0
  175. package/es/input/component/password.d.ts +2 -0
  176. package/es/input/component/password.js +8 -0
  177. package/es/input/component/text-area.d.ts +2 -0
  178. package/es/input/component/text-area.js +16 -0
  179. package/es/input/component/utils.d.ts +15 -0
  180. package/es/input/component/utils.js +102 -0
  181. package/es/input/index.d.ts +2 -0
  182. package/es/input/index.js +2 -0
  183. package/es/input/style/index.d.ts +6 -0
  184. package/es/input/style/index.js +11 -0
  185. package/es/input/type/index.d.ts +41 -0
  186. package/es/input/type/index.js +1 -0
  187. package/es/modal-prompt/component/index.d.ts +5 -0
  188. package/es/modal-prompt/component/index.js +60 -0
  189. package/es/modal-prompt/component/open-loading.d.ts +2 -0
  190. package/es/modal-prompt/component/open-loading.js +21 -0
  191. package/es/modal-prompt/component/utils.d.ts +4 -0
  192. package/es/modal-prompt/component/utils.js +49 -0
  193. package/es/modal-prompt/index.d.ts +2 -0
  194. package/es/modal-prompt/index.js +2 -0
  195. package/es/modal-prompt/style/index.d.ts +5 -0
  196. package/es/modal-prompt/style/index.js +9 -0
  197. package/es/modal-prompt/type/index.d.ts +36 -0
  198. package/es/modal-prompt/type/index.js +1 -0
  199. package/es/open-modal/component/constant.d.ts +1 -0
  200. package/es/open-modal/component/constant.js +3 -0
  201. package/es/open-modal/component/footer.d.ts +2 -0
  202. package/es/open-modal/component/footer.js +34 -0
  203. package/es/open-modal/component/index.d.ts +4 -0
  204. package/es/open-modal/component/index.js +9 -0
  205. package/es/open-modal/component/modal.d.ts +10 -0
  206. package/es/open-modal/component/modal.js +37 -0
  207. package/es/open-modal/component/title.d.ts +6 -0
  208. package/es/open-modal/component/title.js +12 -0
  209. package/es/open-modal/component/use-modal.d.ts +14 -0
  210. package/es/open-modal/component/use-modal.js +177 -0
  211. package/es/open-modal/component/utils.d.ts +11 -0
  212. package/es/open-modal/component/utils.js +109 -0
  213. package/es/open-modal/hook/index.d.ts +7 -0
  214. package/es/open-modal/hook/index.js +17 -0
  215. package/es/open-modal/hook/use-modal.d.ts +6 -0
  216. package/es/open-modal/hook/use-modal.js +27 -0
  217. package/es/open-modal/index.d.ts +3 -0
  218. package/es/open-modal/index.js +3 -0
  219. package/es/open-modal/style/index.d.ts +5 -0
  220. package/es/open-modal/style/index.js +18 -0
  221. package/es/open-modal/style/wrap.d.ts +2 -0
  222. package/es/open-modal/style/wrap.js +6 -0
  223. package/es/open-modal/type/index.d.ts +91 -0
  224. package/es/open-modal/type/index.js +1 -0
  225. package/es/portal/component/index.d.ts +2 -0
  226. package/es/portal/component/index.js +40 -0
  227. package/es/portal/index.d.ts +2 -0
  228. package/es/portal/index.js +2 -0
  229. package/es/portal/type/index.d.ts +13 -0
  230. package/es/portal/type/index.js +1 -0
  231. package/es/radio/component/abstract-box.d.ts +380 -0
  232. package/es/radio/component/abstract-box.js +90 -0
  233. package/es/radio/component/index.d.ts +2 -0
  234. package/es/radio/component/index.js +10 -0
  235. package/es/radio/component/radio.d.ts +2 -0
  236. package/es/radio/component/radio.js +10 -0
  237. package/es/radio/component/redio-group.d.ts +2 -0
  238. package/es/radio/component/redio-group.js +50 -0
  239. package/es/radio/component/use-box-options.d.ts +6 -0
  240. package/es/radio/component/use-box-options.js +20 -0
  241. package/es/radio/component/use-radio.d.ts +23 -0
  242. package/es/radio/component/use-radio.js +21 -0
  243. package/es/radio/component/utils.d.ts +7 -0
  244. package/es/radio/component/utils.js +25 -0
  245. package/es/radio/index.d.ts +2 -0
  246. package/es/radio/index.js +2 -0
  247. package/es/radio/style/index.d.ts +7 -0
  248. package/es/radio/style/index.js +15 -0
  249. package/es/radio/type/index.d.ts +32 -0
  250. package/es/radio/type/index.js +1 -0
  251. package/es/select/component/constant.d.ts +1 -0
  252. package/es/select/component/constant.js +1 -0
  253. package/es/select/component/index.d.ts +3 -0
  254. package/es/select/component/index.js +16 -0
  255. package/es/select/component/loading.d.ts +1 -0
  256. package/es/select/component/loading.js +13 -0
  257. package/es/select/component/use-select-options.d.ts +11 -0
  258. package/es/select/component/use-select-options.js +80 -0
  259. package/es/select/component/use-select.d.ts +2 -0
  260. package/es/select/component/use-select.js +136 -0
  261. package/es/select/component/utils.d.ts +14 -0
  262. package/es/select/component/utils.js +142 -0
  263. package/es/select/index.d.ts +2 -0
  264. package/es/select/index.js +2 -0
  265. package/es/select/style/index.d.ts +4 -0
  266. package/es/select/style/index.js +7 -0
  267. package/es/select/type/index.d.ts +105 -0
  268. package/es/select/type/index.js +1 -0
  269. package/es/stack/component/center-stack.d.ts +2 -0
  270. package/es/stack/component/center-stack.js +32 -0
  271. package/es/stack/component/h-stack.d.ts +2 -0
  272. package/es/stack/component/h-stack.js +39 -0
  273. package/es/stack/component/index.d.ts +3 -0
  274. package/es/stack/component/index.js +3 -0
  275. package/es/stack/component/v-stack.d.ts +2 -0
  276. package/es/stack/component/v-stack.js +36 -0
  277. package/es/stack/index.d.ts +2 -0
  278. package/es/stack/index.js +2 -0
  279. package/es/stack/style/index.d.ts +21 -0
  280. package/es/stack/style/index.js +49 -0
  281. package/es/stack/type/index.d.ts +54 -0
  282. package/es/stack/type/index.js +1 -0
  283. package/es/switch/component/index.d.ts +2 -0
  284. package/es/switch/component/index.js +60 -0
  285. package/es/switch/index.d.ts +2 -0
  286. package/es/switch/index.js +2 -0
  287. package/es/switch/style/index.d.ts +5 -0
  288. package/es/switch/style/index.js +13 -0
  289. package/es/switch/type/index.d.ts +27 -0
  290. package/es/switch/type/index.js +1 -0
  291. package/es/table/component/action-button.d.ts +2 -0
  292. package/es/table/component/action-button.js +95 -0
  293. package/es/table/component/actions.d.ts +2 -0
  294. package/es/table/component/actions.js +35 -0
  295. package/es/table/component/constant.d.ts +1 -0
  296. package/es/table/component/constant.js +5 -0
  297. package/es/table/component/editor.d.ts +2 -0
  298. package/es/table/component/editor.js +35 -0
  299. package/es/table/component/filter.d.ts +3 -0
  300. package/es/table/component/filter.js +55 -0
  301. package/es/table/component/index.d.ts +7 -0
  302. package/es/table/component/index.js +4 -0
  303. package/es/table/component/link.d.ts +2 -0
  304. package/es/table/component/link.js +20 -0
  305. package/es/table/component/sort.d.ts +6 -0
  306. package/es/table/component/sort.js +17 -0
  307. package/es/table/component/switch.d.ts +2 -0
  308. package/es/table/component/switch.js +27 -0
  309. package/es/table/component/table-body.d.ts +6 -0
  310. package/es/table/component/table-body.js +88 -0
  311. package/es/table/component/table.d.ts +10 -0
  312. package/es/table/component/table.js +235 -0
  313. package/es/table/component/time.d.ts +2 -0
  314. package/es/table/component/time.js +12 -0
  315. package/es/table/component/utils.d.ts +120 -0
  316. package/es/table/component/utils.js +222 -0
  317. package/es/table/component/wrapper.d.ts +6 -0
  318. package/es/table/component/wrapper.js +30 -0
  319. package/es/table/hook/index.d.ts +7 -0
  320. package/es/table/hook/index.js +17 -0
  321. package/es/table/hook/search.d.ts +5 -0
  322. package/es/table/hook/search.js +131 -0
  323. package/es/table/index.d.ts +3 -0
  324. package/es/table/index.js +3 -0
  325. package/es/table/style/index.d.ts +9 -0
  326. package/es/table/style/index.js +16 -0
  327. package/es/table/type/action.d.ts +48 -0
  328. package/es/table/type/action.js +1 -0
  329. package/es/table/type/column.d.ts +110 -0
  330. package/es/table/type/column.js +1 -0
  331. package/es/table/type/index.d.ts +113 -0
  332. package/es/table/type/index.js +11 -0
  333. package/es/tabs/component/constant.d.ts +2 -0
  334. package/es/tabs/component/constant.js +2 -0
  335. package/es/tabs/component/index.d.ts +2 -0
  336. package/es/tabs/component/index.js +18 -0
  337. package/es/tabs/component/utils.d.ts +24 -0
  338. package/es/tabs/component/utils.js +55 -0
  339. package/es/tabs/index.d.ts +2 -0
  340. package/es/tabs/index.js +2 -0
  341. package/es/tabs/style/index.d.ts +5 -0
  342. package/es/tabs/style/index.js +10 -0
  343. package/es/tabs/type/index.d.ts +20 -0
  344. package/es/tabs/type/index.js +1 -0
  345. package/es/text/component/index.d.ts +3 -0
  346. package/es/text/component/index.js +57 -0
  347. package/es/text/component/use-text.d.ts +4 -0
  348. package/es/text/component/use-text.js +24 -0
  349. package/es/text/component/utils.d.ts +3 -0
  350. package/es/text/component/utils.js +9 -0
  351. package/es/text/index.d.ts +2 -0
  352. package/es/text/index.js +2 -0
  353. package/es/text/style/index.d.ts +5 -0
  354. package/es/text/style/index.js +8 -0
  355. package/es/text/type/index.d.ts +19 -0
  356. package/es/text/type/index.js +1 -0
  357. package/es/tooltip/component/index.d.ts +48 -0
  358. package/es/tooltip/component/index.js +19 -0
  359. package/es/tooltip/index.d.ts +2 -0
  360. package/es/tooltip/index.js +2 -0
  361. package/es/tooltip/type/index.d.ts +8 -0
  362. package/es/tooltip/type/index.js +1 -0
  363. package/es/tree/component/index.d.ts +2 -0
  364. package/es/tree/component/index.js +23 -0
  365. package/es/tree/component/utils.d.ts +1 -0
  366. package/es/tree/component/utils.js +3 -0
  367. package/es/tree/index.d.ts +2 -0
  368. package/es/tree/index.js +2 -0
  369. package/es/tree/style/index.d.ts +4 -0
  370. package/es/tree/style/index.js +7 -0
  371. package/es/tree/type/index.d.ts +2 -0
  372. package/es/tree/type/index.js +1 -0
  373. package/es/tree-select/component/index.d.ts +2 -0
  374. package/es/tree-select/component/index.js +15 -0
  375. package/es/tree-select/component/use-tree-select.d.ts +2 -0
  376. package/es/tree-select/component/use-tree-select.js +59 -0
  377. package/es/tree-select/index.d.ts +2 -0
  378. package/es/tree-select/index.js +2 -0
  379. package/es/tree-select/style/index.d.ts +5 -0
  380. package/es/tree-select/style/index.js +15 -0
  381. package/es/tree-select/type/index.d.ts +23 -0
  382. package/es/tree-select/type/index.js +1 -0
  383. package/es/virtual-list/component/index.d.ts +2 -0
  384. package/es/virtual-list/component/index.js +28 -0
  385. package/es/virtual-list/index.d.ts +2 -0
  386. package/es/virtual-list/index.js +2 -0
  387. package/es/virtual-list/type/index.d.ts +17 -0
  388. package/es/virtual-list/type/index.js +1 -0
  389. package/lib/api/component/class-name.d.ts +3 -0
  390. package/lib/api/component/class-name.js +23 -0
  391. package/lib/api/component/common.d.ts +22 -0
  392. package/lib/api/component/common.js +163 -0
  393. package/lib/api/component/dom.d.ts +2 -0
  394. package/lib/api/component/dom.js +14 -0
  395. package/lib/api/component/global-style.d.ts +3 -0
  396. package/lib/api/component/global-style.js +23 -0
  397. package/lib/api/component/index.d.ts +9 -0
  398. package/lib/api/component/index.js +104 -0
  399. package/lib/api/component/react-dom.d.ts +3 -0
  400. package/lib/api/component/react-dom.js +80 -0
  401. package/lib/api/component/sort.d.ts +2 -0
  402. package/lib/api/component/sort.js +28 -0
  403. package/lib/api/component/style.d.ts +4 -0
  404. package/lib/api/component/style.js +43 -0
  405. package/lib/api/component/url.d.ts +33 -0
  406. package/lib/api/component/url.js +133 -0
  407. package/lib/api/component/validate-input.d.ts +8 -0
  408. package/lib/api/component/validate-input.js +24 -0
  409. package/lib/api/index.d.ts +2 -0
  410. package/lib/api/index.js +27 -0
  411. package/lib/api/type/common.d.ts +24 -0
  412. package/lib/api/type/common.js +5 -0
  413. package/lib/api/type/index.d.ts +5 -0
  414. package/lib/api/type/index.js +16 -0
  415. package/lib/button/component/index.d.ts +2 -0
  416. package/lib/button/component/index.js +94 -0
  417. package/lib/button/index.d.ts +2 -0
  418. package/lib/button/index.js +27 -0
  419. package/lib/button/type/index.d.ts +31 -0
  420. package/lib/button/type/index.js +5 -0
  421. package/lib/checkbox/component/checkbox-group.d.ts +2 -0
  422. package/lib/checkbox/component/checkbox-group.js +73 -0
  423. package/lib/checkbox/component/checkbox.d.ts +2 -0
  424. package/lib/checkbox/component/checkbox.js +15 -0
  425. package/lib/checkbox/component/index.d.ts +2 -0
  426. package/lib/checkbox/component/index.js +17 -0
  427. package/lib/checkbox/component/use-checkbox.d.ts +12 -0
  428. package/lib/checkbox/component/use-checkbox.js +50 -0
  429. package/lib/checkbox/component/utils.d.ts +13 -0
  430. package/lib/checkbox/component/utils.js +47 -0
  431. package/lib/checkbox/index.d.ts +2 -0
  432. package/lib/checkbox/index.js +27 -0
  433. package/lib/checkbox/style/index.d.ts +5 -0
  434. package/lib/checkbox/style/index.js +18 -0
  435. package/lib/checkbox/type/index.d.ts +18 -0
  436. package/lib/checkbox/type/index.js +5 -0
  437. package/lib/config/index.d.ts +0 -0
  438. package/lib/config/index.js +1 -0
  439. package/lib/date-picker/component/index.d.ts +3 -0
  440. package/lib/date-picker/component/index.js +46 -0
  441. package/lib/date-picker/index.d.ts +2 -0
  442. package/lib/date-picker/index.js +27 -0
  443. package/lib/date-picker/style/index.d.ts +4 -0
  444. package/lib/date-picker/style/index.js +14 -0
  445. package/lib/date-picker/type/index.d.ts +21 -0
  446. package/lib/date-picker/type/index.js +5 -0
  447. package/lib/empty/component/index.d.ts +2 -0
  448. package/lib/empty/component/index.js +24 -0
  449. package/lib/empty/index.d.ts +2 -0
  450. package/lib/empty/index.js +27 -0
  451. package/lib/empty/type/index.d.ts +9 -0
  452. package/lib/empty/type/index.js +5 -0
  453. package/lib/form/component/constant.d.ts +15 -0
  454. package/lib/form/component/constant.js +21 -0
  455. package/lib/form/component/form-content.d.ts +10 -0
  456. package/lib/form/component/form-content.js +288 -0
  457. package/lib/form/component/form-item-map.d.ts +40 -0
  458. package/lib/form/component/form-item-map.js +128 -0
  459. package/lib/form/component/form-item.d.ts +7 -0
  460. package/lib/form/component/form-item.js +227 -0
  461. package/lib/form/component/form-list.d.ts +36 -0
  462. package/lib/form/component/form-list.js +201 -0
  463. package/lib/form/component/form.d.ts +2 -0
  464. package/lib/form/component/form.js +47 -0
  465. package/lib/form/component/index.d.ts +15 -0
  466. package/lib/form/component/index.js +20 -0
  467. package/lib/form/component/submit-button.d.ts +2 -0
  468. package/lib/form/component/submit-button.js +54 -0
  469. package/lib/form/component/use-debug.d.ts +1 -0
  470. package/lib/form/component/use-debug.js +22 -0
  471. package/lib/form/component/utils.d.ts +95 -0
  472. package/lib/form/component/utils.js +467 -0
  473. package/lib/form/component/validator-item.d.ts +7 -0
  474. package/lib/form/component/validator-item.js +60 -0
  475. package/lib/form/hook/index.d.ts +16 -0
  476. package/lib/form/hook/index.js +163 -0
  477. package/lib/form/hook/list-provider.d.ts +6 -0
  478. package/lib/form/hook/list-provider.js +24 -0
  479. package/lib/form/hook/provider.d.ts +23 -0
  480. package/lib/form/hook/provider.js +30 -0
  481. package/lib/form/hook/use-form.d.ts +2 -0
  482. package/lib/form/hook/use-form.js +342 -0
  483. package/lib/form/index.d.ts +3 -0
  484. package/lib/form/index.js +38 -0
  485. package/lib/form/style/form-item.d.ts +3 -0
  486. package/lib/form/style/form-item.js +46 -0
  487. package/lib/form/style/index.d.ts +7 -0
  488. package/lib/form/style/index.js +32 -0
  489. package/lib/form/type/form-item.d.ts +141 -0
  490. package/lib/form/type/form-item.js +5 -0
  491. package/lib/form/type/form-list.d.ts +91 -0
  492. package/lib/form/type/form-list.js +5 -0
  493. package/lib/form/type/index.d.ts +134 -0
  494. package/lib/form/type/index.js +27 -0
  495. package/lib/grid/component/index.d.ts +2 -0
  496. package/lib/grid/component/index.js +83 -0
  497. package/lib/grid/component/pagination.d.ts +50 -0
  498. package/lib/grid/component/pagination.js +62 -0
  499. package/lib/grid/component/utils.d.ts +2 -0
  500. package/lib/grid/component/utils.js +14 -0
  501. package/lib/grid/index.d.ts +2 -0
  502. package/lib/grid/index.js +27 -0
  503. package/lib/grid/style/index.d.ts +11 -0
  504. package/lib/grid/style/index.js +33 -0
  505. package/lib/grid/type/index.d.ts +67 -0
  506. package/lib/grid/type/index.js +5 -0
  507. package/lib/highlight-text/component/index.d.ts +2 -0
  508. package/lib/highlight-text/component/index.js +78 -0
  509. package/lib/highlight-text/index.d.ts +2 -0
  510. package/lib/highlight-text/index.js +27 -0
  511. package/lib/highlight-text/style/index.d.ts +4 -0
  512. package/lib/highlight-text/style/index.js +14 -0
  513. package/lib/highlight-text/type/index.d.ts +18 -0
  514. package/lib/highlight-text/type/index.js +5 -0
  515. package/lib/hooks/hook/common.d.ts +1 -0
  516. package/lib/hooks/hook/common.js +18 -0
  517. package/lib/hooks/hook/index.d.ts +7 -0
  518. package/lib/hooks/hook/index.js +82 -0
  519. package/lib/hooks/hook/use-debounce.d.ts +4 -0
  520. package/lib/hooks/hook/use-debounce.js +32 -0
  521. package/lib/hooks/hook/use-deep.d.ts +9 -0
  522. package/lib/hooks/hook/use-deep.js +76 -0
  523. package/lib/hooks/hook/use-fetch.d.ts +8 -0
  524. package/lib/hooks/hook/use-fetch.js +171 -0
  525. package/lib/hooks/hook/use-list-operation.d.ts +5 -0
  526. package/lib/hooks/hook/use-list-operation.js +80 -0
  527. package/lib/hooks/hook/use-loading.d.ts +7 -0
  528. package/lib/hooks/hook/use-loading.js +66 -0
  529. package/lib/hooks/hook/use-window-resize.d.ts +5 -0
  530. package/lib/hooks/hook/use-window-resize.js +22 -0
  531. package/lib/hooks/index.d.ts +2 -0
  532. package/lib/hooks/index.js +27 -0
  533. package/lib/hooks/type/index.d.ts +2 -0
  534. package/lib/hooks/type/index.js +27 -0
  535. package/lib/hooks/type/use-fetch.d.ts +31 -0
  536. package/lib/hooks/type/use-fetch.js +5 -0
  537. package/lib/hooks/type/use-list-operation.d.ts +34 -0
  538. package/lib/hooks/type/use-list-operation.js +5 -0
  539. package/lib/icon/component/down.d.ts +2 -0
  540. package/lib/icon/component/down.js +50 -0
  541. package/lib/icon/component/index.d.ts +2 -0
  542. package/lib/icon/component/index.js +27 -0
  543. package/lib/icon/component/up.d.ts +2 -0
  544. package/lib/icon/component/up.js +49 -0
  545. package/lib/icon/hook/index.d.ts +477 -0
  546. package/lib/icon/hook/index.js +67 -0
  547. package/lib/icon/index.d.ts +2 -0
  548. package/lib/icon/index.js +27 -0
  549. package/lib/icon/style/index.d.ts +4 -0
  550. package/lib/icon/style/index.js +17 -0
  551. package/lib/icon/type/index.d.ts +14 -0
  552. package/lib/icon/type/index.js +5 -0
  553. package/lib/index.d.ts +25 -0
  554. package/lib/index.js +345 -0
  555. package/lib/input/component/index.d.ts +12 -0
  556. package/lib/input/component/index.js +33 -0
  557. package/lib/input/component/input.d.ts +2 -0
  558. package/lib/input/component/input.js +15 -0
  559. package/lib/input/component/number.d.ts +4 -0
  560. package/lib/input/component/number.js +57 -0
  561. package/lib/input/component/password.d.ts +2 -0
  562. package/lib/input/component/password.js +15 -0
  563. package/lib/input/component/text-area.d.ts +2 -0
  564. package/lib/input/component/text-area.js +23 -0
  565. package/lib/input/component/utils.d.ts +15 -0
  566. package/lib/input/component/utils.js +114 -0
  567. package/lib/input/index.d.ts +2 -0
  568. package/lib/input/index.js +27 -0
  569. package/lib/input/style/index.d.ts +6 -0
  570. package/lib/input/style/index.js +18 -0
  571. package/lib/input/type/index.d.ts +41 -0
  572. package/lib/input/type/index.js +5 -0
  573. package/lib/modal-prompt/component/index.d.ts +5 -0
  574. package/lib/modal-prompt/component/index.js +85 -0
  575. package/lib/modal-prompt/component/open-loading.d.ts +2 -0
  576. package/lib/modal-prompt/component/open-loading.js +28 -0
  577. package/lib/modal-prompt/component/utils.d.ts +4 -0
  578. package/lib/modal-prompt/component/utils.js +57 -0
  579. package/lib/modal-prompt/index.d.ts +2 -0
  580. package/lib/modal-prompt/index.js +27 -0
  581. package/lib/modal-prompt/style/index.d.ts +5 -0
  582. package/lib/modal-prompt/style/index.js +16 -0
  583. package/lib/modal-prompt/type/index.d.ts +36 -0
  584. package/lib/modal-prompt/type/index.js +5 -0
  585. package/lib/open-modal/component/constant.d.ts +1 -0
  586. package/lib/open-modal/component/constant.js +10 -0
  587. package/lib/open-modal/component/footer.d.ts +2 -0
  588. package/lib/open-modal/component/footer.js +41 -0
  589. package/lib/open-modal/component/index.d.ts +4 -0
  590. package/lib/open-modal/component/index.js +30 -0
  591. package/lib/open-modal/component/modal.d.ts +10 -0
  592. package/lib/open-modal/component/modal.js +44 -0
  593. package/lib/open-modal/component/title.d.ts +6 -0
  594. package/lib/open-modal/component/title.js +18 -0
  595. package/lib/open-modal/component/use-modal.d.ts +14 -0
  596. package/lib/open-modal/component/use-modal.js +184 -0
  597. package/lib/open-modal/component/utils.d.ts +11 -0
  598. package/lib/open-modal/component/utils.js +117 -0
  599. package/lib/open-modal/hook/index.d.ts +7 -0
  600. package/lib/open-modal/hook/index.js +40 -0
  601. package/lib/open-modal/hook/use-modal.d.ts +6 -0
  602. package/lib/open-modal/hook/use-modal.js +34 -0
  603. package/lib/open-modal/index.d.ts +3 -0
  604. package/lib/open-modal/index.js +38 -0
  605. package/lib/open-modal/style/index.d.ts +5 -0
  606. package/lib/open-modal/style/index.js +25 -0
  607. package/lib/open-modal/style/wrap.d.ts +2 -0
  608. package/lib/open-modal/style/wrap.js +13 -0
  609. package/lib/open-modal/type/index.d.ts +91 -0
  610. package/lib/open-modal/type/index.js +5 -0
  611. package/lib/portal/component/index.d.ts +2 -0
  612. package/lib/portal/component/index.js +47 -0
  613. package/lib/portal/index.d.ts +2 -0
  614. package/lib/portal/index.js +27 -0
  615. package/lib/portal/type/index.d.ts +13 -0
  616. package/lib/portal/type/index.js +5 -0
  617. package/lib/radio/component/abstract-box.d.ts +380 -0
  618. package/lib/radio/component/abstract-box.js +98 -0
  619. package/lib/radio/component/index.d.ts +2 -0
  620. package/lib/radio/component/index.js +17 -0
  621. package/lib/radio/component/radio.d.ts +2 -0
  622. package/lib/radio/component/radio.js +17 -0
  623. package/lib/radio/component/redio-group.d.ts +2 -0
  624. package/lib/radio/component/redio-group.js +57 -0
  625. package/lib/radio/component/use-box-options.d.ts +6 -0
  626. package/lib/radio/component/use-box-options.js +27 -0
  627. package/lib/radio/component/use-radio.d.ts +23 -0
  628. package/lib/radio/component/use-radio.js +28 -0
  629. package/lib/radio/component/utils.d.ts +7 -0
  630. package/lib/radio/component/utils.js +33 -0
  631. package/lib/radio/index.d.ts +2 -0
  632. package/lib/radio/index.js +27 -0
  633. package/lib/radio/style/index.d.ts +7 -0
  634. package/lib/radio/style/index.js +22 -0
  635. package/lib/radio/type/index.d.ts +32 -0
  636. package/lib/radio/type/index.js +5 -0
  637. package/lib/select/component/constant.d.ts +1 -0
  638. package/lib/select/component/constant.js +7 -0
  639. package/lib/select/component/index.d.ts +3 -0
  640. package/lib/select/component/index.js +29 -0
  641. package/lib/select/component/loading.d.ts +1 -0
  642. package/lib/select/component/loading.js +20 -0
  643. package/lib/select/component/use-select-options.d.ts +11 -0
  644. package/lib/select/component/use-select-options.js +88 -0
  645. package/lib/select/component/use-select.d.ts +2 -0
  646. package/lib/select/component/use-select.js +143 -0
  647. package/lib/select/component/utils.d.ts +14 -0
  648. package/lib/select/component/utils.js +152 -0
  649. package/lib/select/index.d.ts +2 -0
  650. package/lib/select/index.js +27 -0
  651. package/lib/select/style/index.d.ts +4 -0
  652. package/lib/select/style/index.js +14 -0
  653. package/lib/select/type/index.d.ts +105 -0
  654. package/lib/select/type/index.js +5 -0
  655. package/lib/stack/component/center-stack.d.ts +2 -0
  656. package/lib/stack/component/center-stack.js +39 -0
  657. package/lib/stack/component/h-stack.d.ts +2 -0
  658. package/lib/stack/component/h-stack.js +46 -0
  659. package/lib/stack/component/index.d.ts +3 -0
  660. package/lib/stack/component/index.js +38 -0
  661. package/lib/stack/component/v-stack.d.ts +2 -0
  662. package/lib/stack/component/v-stack.js +43 -0
  663. package/lib/stack/index.d.ts +2 -0
  664. package/lib/stack/index.js +27 -0
  665. package/lib/stack/style/index.d.ts +21 -0
  666. package/lib/stack/style/index.js +59 -0
  667. package/lib/stack/type/index.d.ts +54 -0
  668. package/lib/stack/type/index.js +5 -0
  669. package/lib/switch/component/index.d.ts +2 -0
  670. package/lib/switch/component/index.js +67 -0
  671. package/lib/switch/index.d.ts +2 -0
  672. package/lib/switch/index.js +27 -0
  673. package/lib/switch/style/index.d.ts +5 -0
  674. package/lib/switch/style/index.js +20 -0
  675. package/lib/switch/type/index.d.ts +27 -0
  676. package/lib/switch/type/index.js +5 -0
  677. package/lib/table/component/action-button.d.ts +2 -0
  678. package/lib/table/component/action-button.js +102 -0
  679. package/lib/table/component/actions.d.ts +2 -0
  680. package/lib/table/component/actions.js +42 -0
  681. package/lib/table/component/constant.d.ts +1 -0
  682. package/lib/table/component/constant.js +12 -0
  683. package/lib/table/component/editor.d.ts +2 -0
  684. package/lib/table/component/editor.js +42 -0
  685. package/lib/table/component/filter.d.ts +3 -0
  686. package/lib/table/component/filter.js +62 -0
  687. package/lib/table/component/index.d.ts +7 -0
  688. package/lib/table/component/index.js +10 -0
  689. package/lib/table/component/link.d.ts +2 -0
  690. package/lib/table/component/link.js +27 -0
  691. package/lib/table/component/sort.d.ts +6 -0
  692. package/lib/table/component/sort.js +24 -0
  693. package/lib/table/component/switch.d.ts +2 -0
  694. package/lib/table/component/switch.js +34 -0
  695. package/lib/table/component/table-body.d.ts +6 -0
  696. package/lib/table/component/table-body.js +95 -0
  697. package/lib/table/component/table.d.ts +10 -0
  698. package/lib/table/component/table.js +243 -0
  699. package/lib/table/component/time.d.ts +2 -0
  700. package/lib/table/component/time.js +19 -0
  701. package/lib/table/component/utils.d.ts +120 -0
  702. package/lib/table/component/utils.js +235 -0
  703. package/lib/table/component/wrapper.d.ts +6 -0
  704. package/lib/table/component/wrapper.js +37 -0
  705. package/lib/table/hook/index.d.ts +7 -0
  706. package/lib/table/hook/index.js +40 -0
  707. package/lib/table/hook/search.d.ts +5 -0
  708. package/lib/table/hook/search.js +138 -0
  709. package/lib/table/index.d.ts +3 -0
  710. package/lib/table/index.js +38 -0
  711. package/lib/table/style/index.d.ts +9 -0
  712. package/lib/table/style/index.js +23 -0
  713. package/lib/table/type/action.d.ts +48 -0
  714. package/lib/table/type/action.js +5 -0
  715. package/lib/table/type/column.d.ts +110 -0
  716. package/lib/table/type/column.js +5 -0
  717. package/lib/table/type/index.d.ts +113 -0
  718. package/lib/table/type/index.js +27 -0
  719. package/lib/tabs/component/constant.d.ts +2 -0
  720. package/lib/tabs/component/constant.js +8 -0
  721. package/lib/tabs/component/index.d.ts +2 -0
  722. package/lib/tabs/component/index.js +25 -0
  723. package/lib/tabs/component/utils.d.ts +24 -0
  724. package/lib/tabs/component/utils.js +63 -0
  725. package/lib/tabs/index.d.ts +2 -0
  726. package/lib/tabs/index.js +27 -0
  727. package/lib/tabs/style/index.d.ts +5 -0
  728. package/lib/tabs/style/index.js +17 -0
  729. package/lib/tabs/type/index.d.ts +20 -0
  730. package/lib/tabs/type/index.js +5 -0
  731. package/lib/text/component/index.d.ts +3 -0
  732. package/lib/text/component/index.js +78 -0
  733. package/lib/text/component/use-text.d.ts +4 -0
  734. package/lib/text/component/use-text.js +31 -0
  735. package/lib/text/component/utils.d.ts +3 -0
  736. package/lib/text/component/utils.js +15 -0
  737. package/lib/text/index.d.ts +2 -0
  738. package/lib/text/index.js +27 -0
  739. package/lib/text/style/index.d.ts +5 -0
  740. package/lib/text/style/index.js +15 -0
  741. package/lib/text/type/index.d.ts +19 -0
  742. package/lib/text/type/index.js +5 -0
  743. package/lib/tooltip/component/index.d.ts +48 -0
  744. package/lib/tooltip/component/index.js +28 -0
  745. package/lib/tooltip/index.d.ts +2 -0
  746. package/lib/tooltip/index.js +27 -0
  747. package/lib/tooltip/type/index.d.ts +8 -0
  748. package/lib/tooltip/type/index.js +5 -0
  749. package/lib/tree/component/index.d.ts +2 -0
  750. package/lib/tree/component/index.js +30 -0
  751. package/lib/tree/component/utils.d.ts +1 -0
  752. package/lib/tree/component/utils.js +9 -0
  753. package/lib/tree/index.d.ts +2 -0
  754. package/lib/tree/index.js +27 -0
  755. package/lib/tree/style/index.d.ts +4 -0
  756. package/lib/tree/style/index.js +14 -0
  757. package/lib/tree/type/index.d.ts +2 -0
  758. package/lib/tree/type/index.js +5 -0
  759. package/lib/tree-select/component/index.d.ts +2 -0
  760. package/lib/tree-select/component/index.js +22 -0
  761. package/lib/tree-select/component/use-tree-select.d.ts +2 -0
  762. package/lib/tree-select/component/use-tree-select.js +66 -0
  763. package/lib/tree-select/index.d.ts +2 -0
  764. package/lib/tree-select/index.js +27 -0
  765. package/lib/tree-select/style/index.d.ts +5 -0
  766. package/lib/tree-select/style/index.js +22 -0
  767. package/lib/tree-select/type/index.d.ts +23 -0
  768. package/lib/tree-select/type/index.js +5 -0
  769. package/lib/virtual-list/component/index.d.ts +2 -0
  770. package/lib/virtual-list/component/index.js +35 -0
  771. package/lib/virtual-list/index.d.ts +2 -0
  772. package/lib/virtual-list/index.js +27 -0
  773. package/lib/virtual-list/type/index.d.ts +17 -0
  774. package/lib/virtual-list/type/index.js +5 -0
  775. package/package.json +147 -0
@@ -0,0 +1,467 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.focusFirstInput = focusFirstInput;
8
+ exports.generateCollectionKey = generateCollectionKey;
9
+ exports.generateFormItem = generateFormItem;
10
+ exports.generateListItemName = generateListItemName;
11
+ exports.getComponentProps = getComponentProps;
12
+ exports.getContextWrapper = getContextWrapper;
13
+ exports.getFormItemId = getFormItemId;
14
+ exports.getFormItemProps = getFormItemProps;
15
+ exports.getFormProps = getFormProps;
16
+ exports.hasItemLoading = hasItemLoading;
17
+ exports.isEmpty = isEmpty;
18
+ exports.isValueNotExistInOptions = isValueNotExistInOptions;
19
+ exports.noStyle = noStyle;
20
+ exports.parseFormFailedError = parseFormFailedError;
21
+ exports.parseValueWhenLabelInValue = parseValueWhenLabelInValue;
22
+ exports.removeFormListFormItems = removeFormListFormItems;
23
+ exports.removePrefixNameIfNeed = removePrefixNameIfNeed;
24
+ exports.removeTableEditorFormItems = removeTableEditorFormItems;
25
+ exports.scrollToFieldOnAdd = scrollToFieldOnAdd;
26
+ exports.setContextWrapper = setContextWrapper;
27
+ exports.transformKeyToPath = transformKeyToPath;
28
+ exports.transformNameToPath = transformNameToPath;
29
+ exports.transformOptions = transformOptions;
30
+ exports.transformPathToName = transformPathToName;
31
+ exports.updateNotExistValue = updateNotExistValue;
32
+ exports.validateFormOnMount = validateFormOnMount;
33
+ var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
34
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
35
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
36
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
37
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
38
+ var _api = require("../../api");
39
+ var _utils = require("../../select/component/utils");
40
+ var _text = require("../../text");
41
+ var _tooltip = require("../../tooltip");
42
+ var _icons = require("@ant-design/icons");
43
+ var _util = require("antd/lib/form/util");
44
+ var _delay = _interopRequireDefault(require("delay"));
45
+ var _lodash = _interopRequireDefault(require("lodash"));
46
+ var _constant = require("./constant");
47
+ var _jsxRuntime = require("@emotion/react/jsx-runtime");
48
+ var _excluded = ["onValidateFailed", "initialValues", "form"],
49
+ _excluded2 = ["tooltip"],
50
+ _excluded3 = ["className", "style"],
51
+ _excluded4 = ["children"];
52
+ /* eslint-disable max-lines */
53
+ function getFormProps(props) {
54
+ var _props$form;
55
+ var _$pick = _lodash.default.pick(props, _constant.antdFormPropsKeys),
56
+ onValidateFailed = _$pick.onValidateFailed,
57
+ initialValues = _$pick.initialValues,
58
+ form = _$pick.form,
59
+ formProps = (0, _objectWithoutProperties2.default)(_$pick, _excluded);
60
+ return _lodash.default.merge({
61
+ form: form,
62
+ name: (_props$form = props.form) === null || _props$form === void 0 ? void 0 : _props$form.getName(),
63
+ component: 'div',
64
+ autoComplete: 'off',
65
+ labelWrap: true,
66
+ validateMessages: {
67
+ required: '${label} is required.'
68
+ },
69
+ validateTrigger: ['onChange', 'onBlur'],
70
+ onFinishFailed: function onFinishFailed(error) {
71
+ var errorInfo = parseFormFailedError(error);
72
+ onValidateFailed === null || onValidateFailed === void 0 || onValidateFailed(errorInfo);
73
+ }
74
+ }, formProps);
75
+ }
76
+ function getFormItemProps(props) {
77
+ var _props$initialValue;
78
+ var _$pick2 = _lodash.default.pick(props, _constant.antdFormItemKeys),
79
+ tooltip = _$pick2.tooltip,
80
+ pickProps = (0, _objectWithoutProperties2.default)(_$pick2, _excluded2);
81
+ var name = removePrefixNameIfNeed(props.formListContext, props.name);
82
+ return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, pickProps), {}, {
83
+ name: name,
84
+ tooltip: generateTooltipWithIcon(tooltip),
85
+ initialValue: (_props$initialValue = props.initialValue) !== null && _props$initialValue !== void 0 ? _props$initialValue : props.defaultValue
86
+ });
87
+ }
88
+ function generateTooltipWithIcon(tooltip) {
89
+ if (!tooltip) {
90
+ return;
91
+ }
92
+ var _getTooltipProps = (0, _tooltip.getTooltipProps)((0, _text.generateTooltip)(tooltip)),
93
+ className = _getTooltipProps.className,
94
+ style = _getTooltipProps.style,
95
+ tooltipProps = (0, _objectWithoutProperties2.default)(_getTooltipProps, _excluded3);
96
+ return (0, _objectSpread2.default)({
97
+ icon: (0, _jsxRuntime.jsx)(_icons.InfoCircleOutlined, {
98
+ className: className,
99
+ style: style
100
+ })
101
+ }, tooltipProps);
102
+ }
103
+ function getComponentProps(props) {
104
+ var keys = [].concat((0, _toConsumableArray2.default)(_constant.antdFormItemKeys), ['formListContext', 'formItemContext', 'children', 'validator', 'removeErrorOnBlur', 'preserveStatus']);
105
+ return _lodash.default.omit(props, keys);
106
+ }
107
+ function generateFormItem(props) {
108
+ var item = props.item,
109
+ formListContext = props.formListContext;
110
+ var processedItem = processFormItemProps(item, formListContext);
111
+ return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, processedItem), {}, {
112
+ rules: generateRules((0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
113
+ item: processedItem
114
+ })),
115
+ type: item.type || 'input',
116
+ dependencies: transformNameToPath(item.dependencies)
117
+ });
118
+ }
119
+ function processFormItemProps(_ref, formListContext) {
120
+ var children = _ref.children,
121
+ item = (0, _objectWithoutProperties2.default)(_ref, _excluded4);
122
+ if (children) {
123
+ item.render = function (params) {
124
+ var props = _lodash.default.pick(params, ['refs', 'id', 'value', 'onChange', 'onBlur', 'onFocus']);
125
+ return (0, _api.renderComponentByType)(children, props);
126
+ };
127
+ }
128
+
129
+ // 将嵌套的 name 转换 antd form 的 name
130
+ _lodash.default.set(item, 'name', transformNameToPath(item.name));
131
+
132
+ // 挂载 formListContext 属性,并拼接 name
133
+ if (!_lodash.default.isEmpty(formListContext)) {
134
+ item.formListContext = formListContext;
135
+ item.isListField = true;
136
+ _lodash.default.set(item, 'name', generateListItemName(formListContext.name, item.name));
137
+ }
138
+ return item;
139
+ }
140
+ function generateListItemName(listName, name) {
141
+ return _lodash.default.flattenDeep([listName, name]).filter(function (x) {
142
+ return !_lodash.default.isNil(x);
143
+ });
144
+ }
145
+ function removePrefixNameIfNeed(formListContext, name) {
146
+ var listName = formListContext === null || formListContext === void 0 ? void 0 : formListContext.name;
147
+ return listName ? _lodash.default.drop(name, _lodash.default.castArray(listName).length) : name;
148
+ }
149
+ function generateRules(_ref2) {
150
+ var item = _ref2.item,
151
+ form = _ref2.form,
152
+ items = _ref2.items,
153
+ isFormList = _ref2.isFormList;
154
+ var rules = _lodash.default.clone(item.rules || []);
155
+ var params = {
156
+ form: form,
157
+ items: items
158
+ };
159
+ if (item.required && !item.rules) {
160
+ var message = generateRequiredMessage(item);
161
+ rules.push({
162
+ required: true,
163
+ message: message
164
+ });
165
+ }
166
+ if (item.validator) {
167
+ rules.push({
168
+ validator: item.validator
169
+ });
170
+ }
171
+ if (!isFormList && !item.removeErrorOnBlur) {
172
+ rules.push({
173
+ validator: function validator() {
174
+ return form.callMethod(_constant.registerMethods.getInternalErrors, item.name);
175
+ }
176
+ });
177
+ }
178
+ if (item.requiredInOptions) {
179
+ var _message = _lodash.default.isString(item.requiredInOptions) ? item.requiredInOptions : 'The value does not exist.';
180
+ var validator = function validator(_ref3) {
181
+ var _form$getItems;
182
+ var value = _ref3.value;
183
+ var options = (_form$getItems = form.getItems(item.name)) === null || _form$getItems === void 0 ? void 0 : _form$getItems.options;
184
+ if (!isEmpty(value) && isValueNotExistInOptions(value, options)) {
185
+ return _message;
186
+ }
187
+ };
188
+ rules.push({
189
+ validator: validator
190
+ });
191
+ }
192
+ return _lodash.default.map(rules, function (r) {
193
+ var rule = _lodash.default.clone(r);
194
+ var originValidator = r.validator;
195
+ if (originValidator) {
196
+ rule.validator = /*#__PURE__*/function () {
197
+ var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(__, value) {
198
+ var res;
199
+ return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
200
+ while (1) switch (_context.prev = _context.next) {
201
+ case 0:
202
+ _context.next = 2;
203
+ return originValidator((0, _objectSpread2.default)({
204
+ value: value,
205
+ item: item
206
+ }, params));
207
+ case 2:
208
+ res = _context.sent;
209
+ return _context.abrupt("return", res ? Promise.reject(res) : Promise.resolve());
210
+ case 4:
211
+ case "end":
212
+ return _context.stop();
213
+ }
214
+ }, _callee);
215
+ }));
216
+ return function (_x, _x2) {
217
+ return _ref4.apply(this, arguments);
218
+ };
219
+ }();
220
+ }
221
+ return rule;
222
+ });
223
+ }
224
+ function generateRequiredMessage(item) {
225
+ if (_lodash.default.isString(item.required)) {
226
+ return item.required;
227
+ }
228
+ if (!item.label) {
229
+ return 'The value is required.';
230
+ }
231
+ }
232
+ function isValueNotExistInOptions(value, options) {
233
+ var optionsValue = (0, _utils.getOptionsValue)(options);
234
+ var values = parseValueWhenLabelInValue(value);
235
+ return !(0, _api.includesNonStrictMode)(optionsValue, values);
236
+ }
237
+ function isEmpty(value) {
238
+ var arr = (0, _lodash.default)(value).castArray().reject(_lodash.default.isNil).value();
239
+ return _lodash.default.isEmpty(arr);
240
+ }
241
+ function parseValueWhenLabelInValue(value) {
242
+ return _lodash.default.castArray(value).map(function (x) {
243
+ return _lodash.default.isPlainObject(x) ? x === null || x === void 0 ? void 0 : x.value : x;
244
+ });
245
+ }
246
+ function updateNotExistValue(_ref5) {
247
+ var form = _ref5.form,
248
+ value = _ref5.value,
249
+ name = _ref5.name,
250
+ options = _ref5.options,
251
+ _ref5$filterNotExistV = _ref5.filterNotExistValue,
252
+ filterNotExistValue = _ref5$filterNotExistV === void 0 ? false : _ref5$filterNotExistV,
253
+ labelInValue = _ref5.labelInValue;
254
+ if (filterNotExistValue === false || !isValueNotExistInOptions(value, options)) {
255
+ return;
256
+ }
257
+ var namePath = transformPathToName(name);
258
+ // 多选
259
+ if (_lodash.default.isArray(value)) {
260
+ var filteredValue = _lodash.default.filter(value, function (item) {
261
+ return !isValueNotExistInOptions(item, options);
262
+ });
263
+ form.setValue(namePath, filteredValue);
264
+ return true;
265
+ }
266
+
267
+ // 单选
268
+ if (filterNotExistValue === true) {
269
+ form.reset(namePath);
270
+ } else {
271
+ var val = filterNotExistValue === 'useFirstOption' ? getFirstOptionValue(options, labelInValue) : filterNotExistValue;
272
+ form.setValue(namePath, val);
273
+ }
274
+ return true;
275
+ }
276
+ function getFirstOptionValue(options, labelInValue) {
277
+ if (!options) {
278
+ return;
279
+ }
280
+ var value = _lodash.default.first((0, _utils.getOptionsValue)(options));
281
+ return labelInValue ? {
282
+ value: value
283
+ } : value;
284
+ }
285
+ function validateFormOnMount(_x3, _x4) {
286
+ return _validateFormOnMount.apply(this, arguments);
287
+ }
288
+ function _validateFormOnMount() {
289
+ _validateFormOnMount = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(_ref6, validateOnMount) {
290
+ var form, items, fields;
291
+ return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
292
+ while (1) switch (_context2.prev = _context2.next) {
293
+ case 0:
294
+ form = _ref6.form, items = _ref6.items;
295
+ fields = [];
296
+ _lodash.default.forEach(items, function (item) {
297
+ if (validateOnMount || _lodash.default.some(item.rules, 'validateOnMount')) {
298
+ fields.push(item.name);
299
+ }
300
+ });
301
+ if (!_lodash.default.isEmpty(fields)) {
302
+ _context2.next = 5;
303
+ break;
304
+ }
305
+ return _context2.abrupt("return");
306
+ case 5:
307
+ _context2.next = 7;
308
+ return form.validate(fields);
309
+ case 7:
310
+ case "end":
311
+ return _context2.stop();
312
+ }
313
+ }, _callee2);
314
+ }));
315
+ return _validateFormOnMount.apply(this, arguments);
316
+ }
317
+ function transformNameToPath(name) {
318
+ if (_lodash.default.isString(name) && _lodash.default.includes(name, '.')) {
319
+ return _lodash.default.toPath(name);
320
+ }
321
+ if (_lodash.default.isArray(name)) {
322
+ return _lodash.default.map(name, transformNameToPath);
323
+ }
324
+ return name;
325
+ }
326
+ function transformPathToName(path) {
327
+ if (_lodash.default.isNil(path)) {
328
+ return;
329
+ }
330
+ if (_lodash.default.isArray(path)) {
331
+ return (0, _lodash.default)(path).map(transformPathToName).reject(_lodash.default.isNil).join('.');
332
+ }
333
+ return path.toString();
334
+ }
335
+ function transformKeyToPath(params) {
336
+ var result = {};
337
+ _lodash.default.forEach(params, function (value, key) {
338
+ return _lodash.default.set(result, key, value);
339
+ });
340
+ return result;
341
+ }
342
+ function parseFormFailedError(error) {
343
+ var errorInfo = {};
344
+ error.errorFields.forEach(function (item) {
345
+ var key = item.name.join('.');
346
+ errorInfo[key] = item.errors[0];
347
+ });
348
+ return errorInfo;
349
+ }
350
+ function noStyle(item) {
351
+ return !item.name && !!item.render;
352
+ }
353
+ function transformOptions(item, values, params) {
354
+ var options = item.options,
355
+ type = item.type;
356
+ if (!type || !_lodash.default.isFunction(options)) {
357
+ return options;
358
+ }
359
+ if (['select', 'treeSelect'].includes(type)) {
360
+ return function () {
361
+ var search = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
362
+ return options(values, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, params), {}, {
363
+ search: search
364
+ }));
365
+ };
366
+ }
367
+ return options(values, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, params), {}, {
368
+ search: ''
369
+ }));
370
+ }
371
+ function focusFirstInput(_ref7) {
372
+ var _parseFocusFirst;
373
+ var form = _ref7.form,
374
+ items = _ref7.items,
375
+ focusFirstOnMount = _ref7.focusFirstOnMount;
376
+ var name = (_parseFocusFirst = parseFocusFirst(focusFirstOnMount)) !== null && _parseFocusFirst !== void 0 ? _parseFocusFirst : _lodash.default.get(items, '0.name');
377
+ if (!name) {
378
+ return;
379
+ }
380
+ form.focus(name);
381
+ return true;
382
+ }
383
+ function parseFocusFirst(focusFirstOnMount) {
384
+ if (focusFirstOnMount === true) {
385
+ return;
386
+ }
387
+ return focusFirstOnMount;
388
+ }
389
+ function scrollToFieldOnAdd(_x5) {
390
+ return _scrollToFieldOnAdd.apply(this, arguments);
391
+ }
392
+ function _scrollToFieldOnAdd() {
393
+ _scrollToFieldOnAdd = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee3(_ref8) {
394
+ var name, form, insertIndex, _ref8$focusFirstOnAdd, focusFirstOnAdd, prefixName, insertItems, focusFirstOnMount;
395
+ return (0, _regeneratorRuntime2.default)().wrap(function _callee3$(_context3) {
396
+ while (1) switch (_context3.prev = _context3.next) {
397
+ case 0:
398
+ name = _ref8.name, form = _ref8.form, insertIndex = _ref8.insertIndex, _ref8$focusFirstOnAdd = _ref8.focusFirstOnAdd, focusFirstOnAdd = _ref8$focusFirstOnAdd === void 0 ? true : _ref8$focusFirstOnAdd;
399
+ if (form) {
400
+ _context3.next = 3;
401
+ break;
402
+ }
403
+ return _context3.abrupt("return");
404
+ case 3:
405
+ _context3.next = 5;
406
+ return (0, _delay.default)(50);
407
+ case 5:
408
+ // 等待 form.setItems 完成
409
+ prefixName = "".concat(transformPathToName(name), ".").concat(insertIndex);
410
+ insertItems = form.getItems().filter(function (item) {
411
+ var _transformPathToName;
412
+ return (_transformPathToName = transformPathToName(item.name)) === null || _transformPathToName === void 0 ? void 0 : _transformPathToName.startsWith(prefixName);
413
+ });
414
+ focusFirstOnMount = _lodash.default.isString(focusFirstOnAdd) ? "".concat(prefixName, ".").concat(focusFirstOnAdd) : focusFirstOnAdd;
415
+ focusFirstInput({
416
+ form: form,
417
+ items: insertItems,
418
+ focusFirstOnMount: focusFirstOnMount
419
+ });
420
+ case 9:
421
+ case "end":
422
+ return _context3.stop();
423
+ }
424
+ }, _callee3);
425
+ }));
426
+ return _scrollToFieldOnAdd.apply(this, arguments);
427
+ }
428
+ function setContextWrapper(setContext) {
429
+ return function (nameOrParams, value) {
430
+ if (_lodash.default.isString(nameOrParams)) {
431
+ setContext(function (state) {
432
+ return _lodash.default.set(state, nameOrParams, value);
433
+ });
434
+ return;
435
+ }
436
+ nameOrParams && setContext(nameOrParams);
437
+ };
438
+ }
439
+ function getContextWrapper(context) {
440
+ return function (name) {
441
+ return name ? _lodash.default.get(context, name) : context;
442
+ };
443
+ }
444
+ function generateCollectionKey(name) {
445
+ return _lodash.default.camelCase(name);
446
+ }
447
+ function removeFormListFormItems(name, collectionItems) {
448
+ var namePath = transformPathToName(name);
449
+ return _lodash.default.omitBy(collectionItems, function (item) {
450
+ var _item$formListContext;
451
+ return transformPathToName((_item$formListContext = item.formListContext) === null || _item$formListContext === void 0 ? void 0 : _item$formListContext.name) === namePath;
452
+ });
453
+ }
454
+ function removeTableEditorFormItems(name, collectionItems) {
455
+ var namePath = transformPathToName(name);
456
+ return _lodash.default.omitBy(collectionItems, function (item) {
457
+ return _lodash.default.startsWith(transformPathToName(item.name), namePath);
458
+ });
459
+ }
460
+ function getFormItemId(name, form) {
461
+ return (0, _util.getFieldId)(_lodash.default.castArray(name), form.getName());
462
+ }
463
+ function hasItemLoading(items) {
464
+ return _lodash.default.some(items, {
465
+ loading: true
466
+ });
467
+ }
@@ -0,0 +1,7 @@
1
+ import { FunctionReturn } from "../../api";
2
+ import { FormContext, FormItemProps } from "..";
3
+ export interface ValidatorItemProps extends Omit<FormItemProps, 'validator'> {
4
+ validator?: (props: FormContext) => FunctionReturn<boolean | void>;
5
+ shouldTriggerValidate?: any;
6
+ }
7
+ export declare function ValidatorItem({ validator, shouldTriggerValidate, ...props }: ValidatorItemProps): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.ValidatorItem = ValidatorItem;
8
+ var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
9
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
10
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
11
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
12
+ var _ = require("./..");
13
+ var _reactUse = require("react-use");
14
+ var _constant = require("./constant");
15
+ var _formItem = require("./form-item");
16
+ var _jsxRuntime = require("@emotion/react/jsx-runtime");
17
+ var _excluded = ["validator", "shouldTriggerValidate"];
18
+ function ValidatorItem(_ref) {
19
+ var validator = _ref.validator,
20
+ shouldTriggerValidate = _ref.shouldTriggerValidate,
21
+ props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
22
+ var context = (0, _.useFormContext)();
23
+ function validate() {
24
+ return _validate.apply(this, arguments);
25
+ }
26
+ function _validate() {
27
+ _validate = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
28
+ var res;
29
+ return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
30
+ while (1) switch (_context.prev = _context.next) {
31
+ case 0:
32
+ _context.next = 2;
33
+ return validator === null || validator === void 0 ? void 0 : validator(context);
34
+ case 2:
35
+ res = _context.sent;
36
+ return _context.abrupt("return", res === false ? 'error' : '');
37
+ case 4:
38
+ case "end":
39
+ return _context.stop();
40
+ }
41
+ }, _callee);
42
+ }));
43
+ return _validate.apply(this, arguments);
44
+ }
45
+ (0, _reactUse.useUpdateEffect)(function () {
46
+ context.form.callMethod(_constant.registerMethods.triggerValidate);
47
+ // eslint-disable-next-line react-hooks/exhaustive-deps
48
+ }, [shouldTriggerValidate]);
49
+ return (0, _jsxRuntime.jsx)(_formItem.FormItem, (0, _objectSpread2.default)((0, _objectSpread2.default)({
50
+ name: "__validatorItem__"
51
+ }, props), {}, {
52
+ hidden: true,
53
+ noStyle: true,
54
+ __noCollectState__: true,
55
+ validator: validate,
56
+ render: function render() {
57
+ return (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {});
58
+ }
59
+ }));
60
+ }
@@ -0,0 +1,16 @@
1
+ import { FunctionReturn } from "../../api";
2
+ import { FormProps, FormValues } from "..";
3
+ import { FormItemSelectProps } from "../component/form-item-map";
4
+ import { SelectCallbackProps } from "../../select";
5
+ import { DependencyList } from 'react';
6
+ export * from './list-provider';
7
+ export * from './provider';
8
+ export * from './use-form';
9
+ export declare function useFormValueChange<T>(fn: (values: FormValues) => FunctionReturn<T>, deps?: DependencyList): T | undefined;
10
+ interface UseValidateFormProps extends Pick<FormProps, 'onValidate'> {
11
+ validateOnly?: boolean;
12
+ }
13
+ export declare function useValidateForm({ onValidate, validateOnly }?: UseValidateFormProps): boolean;
14
+ export interface ValidateNotExistValueProps extends FormItemSelectProps, SelectCallbackProps {
15
+ }
16
+ export declare function useValidateNotExistValue({ loading, value, options, ...props }: ValidateNotExistValueProps): void;