tntd 2.6.9 → 2.6.11

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 (442) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +72 -0
  3. package/es/actions/index.js +26 -0
  4. package/es/actions/index.js.map +1 -0
  5. package/es/actions/index.less +70 -0
  6. package/es/cascader/index.js +5 -1
  7. package/es/cascader/index.js.map +1 -1
  8. package/es/check-card/group.js +197 -0
  9. package/es/check-card/group.js.map +1 -0
  10. package/es/check-card/index.js +163 -0
  11. package/es/check-card/index.js.map +1 -0
  12. package/es/check-card/index.less +179 -0
  13. package/es/checkbox/checkbox-group.js +5 -0
  14. package/es/checkbox/checkbox-group.js.map +1 -0
  15. package/es/checkbox/index.js +5 -0
  16. package/es/checkbox/index.js.map +1 -1
  17. package/es/color-picker/ColorPicker.js +1 -1
  18. package/es/color-picker/ColorPicker.js.map +1 -1
  19. package/es/color-picker/index.less +1 -1
  20. package/es/config-provider/DisabledContext.js +12 -0
  21. package/es/config-provider/DisabledContext.js.map +1 -0
  22. package/es/config-provider/SizeContext.js +9 -0
  23. package/es/config-provider/SizeContext.js.map +1 -0
  24. package/es/config-provider/index.js +4 -0
  25. package/es/config-provider/index.js.map +1 -1
  26. package/es/connect/index.js +29 -0
  27. package/es/connect/index.js.map +1 -0
  28. package/es/date-picker/index.js +15 -1
  29. package/es/date-picker/index.js.map +1 -1
  30. package/es/ellipsis/index.js +2 -2
  31. package/es/ellipsis/index.js.map +1 -1
  32. package/es/ellipsis/index.less +1 -1
  33. package/es/handle/index.js +1 -1
  34. package/es/handle/index.js.map +1 -1
  35. package/es/handle/index.less +1 -1
  36. package/es/index.js +8 -1
  37. package/es/index.js.map +1 -1
  38. package/es/index.less +5 -0
  39. package/es/input/input.js +19 -10
  40. package/es/input/input.js.map +1 -1
  41. package/es/input-number/index.js +3 -1
  42. package/es/input-number/index.js.map +1 -1
  43. package/es/locale/en_US.js +4 -2
  44. package/es/locale/en_US.js.map +1 -1
  45. package/es/locale/zh_CN.js +4 -2
  46. package/es/locale/zh_CN.js.map +1 -1
  47. package/es/page/Box.js +1 -1
  48. package/es/page/Box.js.map +1 -1
  49. package/es/page/index.js +1 -1
  50. package/es/page/index.js.map +1 -1
  51. package/es/page/index.less +5 -5
  52. package/es/prev-locale.js +1 -1
  53. package/es/prev-locale.js.map +1 -1
  54. package/es/preview-text/index.js +265 -0
  55. package/es/preview-text/index.js.map +1 -0
  56. package/es/preview-text/index.less +3 -0
  57. package/es/radio/index.js +3 -0
  58. package/es/radio/index.js.map +1 -1
  59. package/es/radio/radio-group.js +5 -0
  60. package/es/radio/radio-group.js.map +1 -0
  61. package/es/segmented/index.js +67 -0
  62. package/es/segmented/index.js.map +1 -0
  63. package/es/segmented/index.less +138 -0
  64. package/es/select/index.js.map +1 -1
  65. package/es/select/select.js +25 -3
  66. package/es/select/select.js.map +1 -1
  67. package/es/switch/index.js +2 -3
  68. package/es/switch/index.js.map +1 -1
  69. package/es/switch/switch.js +10 -0
  70. package/es/switch/switch.js.map +1 -0
  71. package/es/table/hooks/use-column-setting.js.map +1 -1
  72. package/es/table/table.js +40 -5
  73. package/es/table/table.js.map +1 -1
  74. package/es/table/total-shower.js +10 -0
  75. package/es/table/total-shower.js.map +1 -0
  76. package/es/time-picker/index.js +3 -1
  77. package/es/time-picker/index.js.map +1 -1
  78. package/es/title/index.js +9 -11
  79. package/es/title/index.js.map +1 -1
  80. package/es/title/index.less +10 -10
  81. package/es/tntd-form/ErrorList.js +87 -0
  82. package/es/tntd-form/ErrorList.js.map +1 -0
  83. package/es/tntd-form/Form.js +122 -0
  84. package/es/tntd-form/Form.js.map +1 -0
  85. package/es/tntd-form/FormItem/ItemHolder.js +144 -0
  86. package/es/tntd-form/FormItem/ItemHolder.js.map +1 -0
  87. package/es/tntd-form/FormItem/index.js +264 -0
  88. package/es/tntd-form/FormItem/index.js.map +1 -0
  89. package/es/tntd-form/FormItemInput.js +79 -0
  90. package/es/tntd-form/FormItemInput.js.map +1 -0
  91. package/es/tntd-form/FormItemLabel.js +98 -0
  92. package/es/tntd-form/FormItemLabel.js.map +1 -0
  93. package/es/tntd-form/FormList.js +40 -0
  94. package/es/tntd-form/FormList.js.map +1 -0
  95. package/es/tntd-form/_util/motion.js +47 -0
  96. package/es/tntd-form/_util/motion.js.map +1 -0
  97. package/es/tntd-form/_util/reactNode.js +16 -0
  98. package/es/tntd-form/_util/reactNode.js.map +1 -0
  99. package/es/tntd-form/_util/scrollTo.js +35 -0
  100. package/es/tntd-form/_util/scrollTo.js.map +1 -0
  101. package/es/tntd-form/_util/type.js +3 -0
  102. package/es/tntd-form/_util/type.js.map +1 -0
  103. package/es/tntd-form/_util/warning.js +5 -0
  104. package/es/tntd-form/_util/warning.js.map +1 -0
  105. package/es/tntd-form/_util/wave.js +168 -0
  106. package/es/tntd-form/_util/wave.js.map +1 -0
  107. package/es/tntd-form/context.js +40 -0
  108. package/es/tntd-form/context.js.map +1 -0
  109. package/es/tntd-form/hooks/useDebounce.js +13 -0
  110. package/es/tntd-form/hooks/useDebounce.js.map +1 -0
  111. package/es/tntd-form/hooks/useForm.js +40 -0
  112. package/es/tntd-form/hooks/useForm.js.map +1 -0
  113. package/es/tntd-form/hooks/useFormInstance.js +8 -0
  114. package/es/tntd-form/hooks/useFormInstance.js.map +1 -0
  115. package/es/tntd-form/hooks/useFormItemStatus.js +13 -0
  116. package/es/tntd-form/hooks/useFormItemStatus.js.map +1 -0
  117. package/es/tntd-form/hooks/useFrameState.js +37 -0
  118. package/es/tntd-form/hooks/useFrameState.js.map +1 -0
  119. package/es/tntd-form/hooks/useItemRef.js +20 -0
  120. package/es/tntd-form/hooks/useItemRef.js.map +1 -0
  121. package/es/tntd-form/index.js +17 -1
  122. package/es/tntd-form/index.js.map +1 -1
  123. package/es/tntd-form/interface.js +2 -0
  124. package/es/tntd-form/interface.js.map +1 -0
  125. package/es/tntd-form/style/components.less +16 -0
  126. package/es/tntd-form/style/horizontal.less +26 -0
  127. package/es/tntd-form/style/index.js +5 -0
  128. package/es/tntd-form/style/index.js.map +1 -0
  129. package/es/tntd-form/style/index.less +342 -0
  130. package/es/tntd-form/style/inline.less +40 -0
  131. package/es/tntd-form/style/mixin.less +90 -0
  132. package/es/tntd-form/style/rtl.less +204 -0
  133. package/es/tntd-form/style/status.less +45 -0
  134. package/es/tntd-form/style/vertical.less +95 -0
  135. package/es/tntd-form/tntd-form.stories.js +786 -0
  136. package/es/tntd-form/tntd-form.stories.js.map +1 -0
  137. package/es/tntd-form/util.js +18 -0
  138. package/es/tntd-form/util.js.map +1 -0
  139. package/es/tntd-form/validateMessagesContext.js +5 -0
  140. package/es/tntd-form/validateMessagesContext.js.map +1 -0
  141. package/es/tntd-modal/index.js +71 -56
  142. package/es/tntd-modal/index.js.map +1 -1
  143. package/es/tntd-modal/index.less +83 -63
  144. package/es/tree-select/index.js +4 -1
  145. package/es/tree-select/index.js.map +1 -1
  146. package/es/upload/index.js +8 -1
  147. package/es/upload/index.js.map +1 -1
  148. package/es/utils/index.js +1 -0
  149. package/es/utils/index.js.map +1 -1
  150. package/es/utils/simple-template.js +10 -0
  151. package/es/utils/simple-template.js.map +1 -0
  152. package/es/water-mark/index.js +110 -0
  153. package/es/water-mark/index.js.map +1 -0
  154. package/lib/actions/index.d.ts +15 -0
  155. package/lib/actions/index.d.ts.map +1 -0
  156. package/lib/actions/index.js +34 -0
  157. package/lib/actions/index.js.map +1 -0
  158. package/lib/actions/index.less +70 -0
  159. package/lib/cascader/index.d.ts +6 -1
  160. package/lib/cascader/index.d.ts.map +1 -1
  161. package/lib/cascader/index.js +10 -3
  162. package/lib/cascader/index.js.map +1 -1
  163. package/lib/check-card/group.d.ts +130 -0
  164. package/lib/check-card/group.d.ts.map +1 -0
  165. package/lib/check-card/group.js +236 -0
  166. package/lib/check-card/group.js.map +1 -0
  167. package/lib/check-card/index.d.ts +136 -0
  168. package/lib/check-card/index.d.ts.map +1 -0
  169. package/lib/check-card/index.js +178 -0
  170. package/lib/check-card/index.js.map +1 -0
  171. package/lib/check-card/index.less +179 -0
  172. package/lib/checkbox/checkbox-group.d.ts +8 -0
  173. package/lib/checkbox/checkbox-group.d.ts.map +1 -0
  174. package/lib/checkbox/checkbox-group.js +13 -0
  175. package/lib/checkbox/checkbox-group.js.map +1 -0
  176. package/lib/checkbox/index.d.ts +1 -0
  177. package/lib/checkbox/index.d.ts.map +1 -1
  178. package/lib/checkbox/index.js +16 -0
  179. package/lib/checkbox/index.js.map +1 -1
  180. package/lib/color-picker/ColorPicker.js +1 -1
  181. package/lib/color-picker/ColorPicker.js.map +1 -1
  182. package/lib/color-picker/index.less +1 -1
  183. package/lib/config-provider/DisabledContext.d.ts +10 -0
  184. package/lib/config-provider/DisabledContext.d.ts.map +1 -0
  185. package/lib/config-provider/DisabledContext.js +22 -0
  186. package/lib/config-provider/DisabledContext.js.map +1 -0
  187. package/lib/config-provider/SizeContext.d.ts +10 -0
  188. package/lib/config-provider/SizeContext.d.ts.map +1 -0
  189. package/lib/config-provider/SizeContext.js +23 -0
  190. package/lib/config-provider/SizeContext.js.map +1 -0
  191. package/lib/config-provider/index.d.ts +1 -0
  192. package/lib/config-provider/index.d.ts.map +1 -1
  193. package/lib/config-provider/index.js +15 -0
  194. package/lib/config-provider/index.js.map +1 -1
  195. package/lib/connect/index.d.ts +12 -0
  196. package/lib/connect/index.d.ts.map +1 -0
  197. package/lib/connect/index.js +50 -0
  198. package/lib/connect/index.js.map +1 -0
  199. package/lib/date-picker/index.d.ts +6 -1
  200. package/lib/date-picker/index.d.ts.map +1 -1
  201. package/lib/date-picker/index.js +29 -3
  202. package/lib/date-picker/index.js.map +1 -1
  203. package/lib/ellipsis/index.js +2 -2
  204. package/lib/ellipsis/index.js.map +1 -1
  205. package/lib/ellipsis/index.less +1 -1
  206. package/lib/handle/index.d.ts.map +1 -1
  207. package/lib/handle/index.js +1 -1
  208. package/lib/handle/index.js.map +1 -1
  209. package/lib/handle/index.less +1 -1
  210. package/lib/index.d.ts +7 -0
  211. package/lib/index.d.ts.map +1 -1
  212. package/lib/index.js +22 -0
  213. package/lib/index.js.map +1 -1
  214. package/lib/index.less +5 -0
  215. package/lib/input/input.d.ts +5 -0
  216. package/lib/input/input.d.ts.map +1 -1
  217. package/lib/input/input.js +18 -8
  218. package/lib/input/input.js.map +1 -1
  219. package/lib/input-number/index.d.ts +7 -2
  220. package/lib/input-number/index.d.ts.map +1 -1
  221. package/lib/input-number/index.js +4 -1
  222. package/lib/input-number/index.js.map +1 -1
  223. package/lib/locale/default.d.ts +1 -0
  224. package/lib/locale/default.d.ts.map +1 -1
  225. package/lib/locale/en_US.d.ts +1 -0
  226. package/lib/locale/en_US.d.ts.map +1 -1
  227. package/lib/locale/en_US.js +4 -2
  228. package/lib/locale/en_US.js.map +1 -1
  229. package/lib/locale/zh_CN.d.ts +1 -0
  230. package/lib/locale/zh_CN.d.ts.map +1 -1
  231. package/lib/locale/zh_CN.js +4 -2
  232. package/lib/locale/zh_CN.js.map +1 -1
  233. package/lib/page/Box.js +1 -1
  234. package/lib/page/Box.js.map +1 -1
  235. package/lib/page/index.js +1 -1
  236. package/lib/page/index.js.map +1 -1
  237. package/lib/page/index.less +5 -5
  238. package/lib/prev-locale.js +1 -1
  239. package/lib/prev-locale.js.map +1 -1
  240. package/lib/preview-text/index.d.ts +20 -0
  241. package/lib/preview-text/index.d.ts.map +1 -0
  242. package/lib/preview-text/index.js +278 -0
  243. package/lib/preview-text/index.js.map +1 -0
  244. package/lib/preview-text/index.less +3 -0
  245. package/lib/radio/index.d.ts.map +1 -1
  246. package/lib/radio/index.js +4 -0
  247. package/lib/radio/index.js.map +1 -1
  248. package/lib/radio/radio-group.d.ts +8 -0
  249. package/lib/radio/radio-group.d.ts.map +1 -0
  250. package/lib/radio/radio-group.js +13 -0
  251. package/lib/radio/radio-group.js.map +1 -0
  252. package/lib/segmented/index.d.ts +23 -0
  253. package/lib/segmented/index.d.ts.map +1 -0
  254. package/lib/segmented/index.js +80 -0
  255. package/lib/segmented/index.js.map +1 -0
  256. package/lib/segmented/index.less +138 -0
  257. package/lib/select/index.d.ts +2 -1
  258. package/lib/select/index.d.ts.map +1 -1
  259. package/lib/select/index.js.map +1 -1
  260. package/lib/select/select.d.ts +12 -0
  261. package/lib/select/select.d.ts.map +1 -1
  262. package/lib/select/select.js +25 -4
  263. package/lib/select/select.js.map +1 -1
  264. package/lib/svg-components/illustration-403.d.ts +1 -1
  265. package/lib/svg-components/illustration-404.d.ts +1 -1
  266. package/lib/svg-components/illustration-500.d.ts +1 -1
  267. package/lib/svg-components/illustration-empty.d.ts +1 -1
  268. package/lib/svg-components/illustration-failure.d.ts +1 -1
  269. package/lib/svg-components/illustration-no-access.d.ts +1 -1
  270. package/lib/svg-components/illustration-no-chart.d.ts +1 -1
  271. package/lib/svg-components/illustration-no-result.d.ts +1 -1
  272. package/lib/svg-components/illustration-offline.d.ts +1 -1
  273. package/lib/svg-components/illustration-success.d.ts +1 -1
  274. package/lib/switch/index.d.ts +2 -3
  275. package/lib/switch/index.d.ts.map +1 -1
  276. package/lib/switch/index.js +1 -2
  277. package/lib/switch/index.js.map +1 -1
  278. package/lib/switch/switch.d.ts +10 -0
  279. package/lib/switch/switch.d.ts.map +1 -0
  280. package/lib/switch/switch.js +37 -0
  281. package/lib/switch/switch.js.map +1 -0
  282. package/lib/table/assets/image-loading-background.d.ts +1 -1
  283. package/lib/table/assets/image-loading.d.ts +1 -1
  284. package/lib/table/hooks/use-column-setting.d.ts +4 -1
  285. package/lib/table/hooks/use-column-setting.d.ts.map +1 -1
  286. package/lib/table/hooks/use-column-setting.js.map +1 -1
  287. package/lib/table/table.d.ts.map +1 -1
  288. package/lib/table/table.js +44 -8
  289. package/lib/table/table.js.map +1 -1
  290. package/lib/table/total-shower.d.ts +9 -0
  291. package/lib/table/total-shower.d.ts.map +1 -0
  292. package/lib/table/total-shower.js +17 -0
  293. package/lib/table/total-shower.js.map +1 -0
  294. package/lib/time-picker/index.d.ts +7 -2
  295. package/lib/time-picker/index.d.ts.map +1 -1
  296. package/lib/time-picker/index.js +3 -1
  297. package/lib/time-picker/index.js.map +1 -1
  298. package/lib/title/index.d.ts +11 -1
  299. package/lib/title/index.d.ts.map +1 -1
  300. package/lib/title/index.js +8 -10
  301. package/lib/title/index.js.map +1 -1
  302. package/lib/title/index.less +10 -10
  303. package/lib/tntd-cascader/AntdCascader/config/utils.d.ts +1 -1
  304. package/lib/tntd-form/ErrorList.d.ts +13 -0
  305. package/lib/tntd-form/ErrorList.d.ts.map +1 -0
  306. package/lib/tntd-form/ErrorList.js +104 -0
  307. package/lib/tntd-form/ErrorList.js.map +1 -0
  308. package/lib/tntd-form/Form.d.ts +36 -0
  309. package/lib/tntd-form/Form.d.ts.map +1 -0
  310. package/lib/tntd-form/Form.js +160 -0
  311. package/lib/tntd-form/Form.js.map +1 -0
  312. package/lib/tntd-form/FormItem/ItemHolder.d.ts +18 -0
  313. package/lib/tntd-form/FormItem/ItemHolder.d.ts.map +1 -0
  314. package/lib/tntd-form/FormItem/ItemHolder.js +163 -0
  315. package/lib/tntd-form/FormItem/ItemHolder.js.map +1 -0
  316. package/lib/tntd-form/FormItem/index.d.ts +36 -0
  317. package/lib/tntd-form/FormItem/index.d.ts.map +1 -0
  318. package/lib/tntd-form/FormItem/index.js +301 -0
  319. package/lib/tntd-form/FormItem/index.js.map +1 -0
  320. package/lib/tntd-form/FormItemInput.d.ts +30 -0
  321. package/lib/tntd-form/FormItemInput.d.ts.map +1 -0
  322. package/lib/tntd-form/FormItemInput.js +92 -0
  323. package/lib/tntd-form/FormItemInput.js.map +1 -0
  324. package/lib/tntd-form/FormItemLabel.d.ts +24 -0
  325. package/lib/tntd-form/FormItemLabel.d.ts.map +1 -0
  326. package/lib/tntd-form/FormItemLabel.js +106 -0
  327. package/lib/tntd-form/FormItemLabel.js.map +1 -0
  328. package/lib/tntd-form/FormList.d.ts +26 -0
  329. package/lib/tntd-form/FormList.d.ts.map +1 -0
  330. package/lib/tntd-form/FormList.js +56 -0
  331. package/lib/tntd-form/FormList.js.map +1 -0
  332. package/lib/tntd-form/_util/motion.d.ts +9 -0
  333. package/lib/tntd-form/_util/motion.d.ts.map +1 -0
  334. package/lib/tntd-form/_util/motion.js +59 -0
  335. package/lib/tntd-form/_util/motion.js.map +1 -0
  336. package/lib/tntd-form/_util/reactNode.d.ts +9 -0
  337. package/lib/tntd-form/_util/reactNode.d.ts.map +1 -0
  338. package/lib/tntd-form/_util/reactNode.js +27 -0
  339. package/lib/tntd-form/_util/reactNode.js.map +1 -0
  340. package/lib/tntd-form/_util/scrollTo.d.ts +1 -0
  341. package/lib/tntd-form/_util/scrollTo.d.ts.map +1 -0
  342. package/lib/tntd-form/_util/scrollTo.js +35 -0
  343. package/lib/tntd-form/_util/scrollTo.js.map +1 -0
  344. package/lib/tntd-form/_util/type.d.ts +4 -0
  345. package/lib/tntd-form/_util/type.d.ts.map +1 -0
  346. package/lib/tntd-form/_util/type.js +21 -0
  347. package/lib/tntd-form/_util/type.js.map +1 -0
  348. package/lib/tntd-form/_util/warning.d.ts +5 -0
  349. package/lib/tntd-form/_util/warning.d.ts.map +1 -0
  350. package/lib/tntd-form/_util/warning.js +20 -0
  351. package/lib/tntd-form/_util/warning.js.map +1 -0
  352. package/lib/tntd-form/_util/wave.d.ts +1 -0
  353. package/lib/tntd-form/_util/wave.d.ts.map +1 -0
  354. package/lib/tntd-form/_util/wave.js +168 -0
  355. package/lib/tntd-form/_util/wave.js.map +1 -0
  356. package/lib/tntd-form/context.d.ts +51 -0
  357. package/lib/tntd-form/context.d.ts.map +1 -0
  358. package/lib/tntd-form/context.js +54 -0
  359. package/lib/tntd-form/context.js.map +1 -0
  360. package/lib/tntd-form/hooks/useDebounce.d.ts +2 -0
  361. package/lib/tntd-form/hooks/useDebounce.d.ts.map +1 -0
  362. package/lib/tntd-form/hooks/useDebounce.js +31 -0
  363. package/lib/tntd-form/hooks/useDebounce.js.map +1 -0
  364. package/lib/tntd-form/hooks/useForm.d.ts +16 -0
  365. package/lib/tntd-form/hooks/useForm.d.ts.map +1 -0
  366. package/lib/tntd-form/hooks/useForm.js +63 -0
  367. package/lib/tntd-form/hooks/useForm.js.map +1 -0
  368. package/lib/tntd-form/hooks/useFormInstance.d.ts +3 -0
  369. package/lib/tntd-form/hooks/useFormInstance.d.ts.map +1 -0
  370. package/lib/tntd-form/hooks/useFormInstance.js +13 -0
  371. package/lib/tntd-form/hooks/useFormInstance.js.map +1 -0
  372. package/lib/tntd-form/hooks/useFormItemStatus.d.ts +7 -0
  373. package/lib/tntd-form/hooks/useFormItemStatus.d.ts.map +1 -0
  374. package/lib/tntd-form/hooks/useFormItemStatus.js +20 -0
  375. package/lib/tntd-form/hooks/useFormItemStatus.js.map +1 -0
  376. package/lib/tntd-form/hooks/useFrameState.d.ts +4 -0
  377. package/lib/tntd-form/hooks/useFrameState.d.ts.map +1 -0
  378. package/lib/tntd-form/hooks/useFrameState.js +55 -0
  379. package/lib/tntd-form/hooks/useFrameState.js.map +1 -0
  380. package/lib/tntd-form/hooks/useItemRef.d.ts +4 -0
  381. package/lib/tntd-form/hooks/useItemRef.d.ts.map +1 -0
  382. package/lib/tntd-form/hooks/useItemRef.js +28 -0
  383. package/lib/tntd-form/hooks/useItemRef.js.map +1 -0
  384. package/lib/tntd-form/index.d.ts +23 -1
  385. package/lib/tntd-form/index.d.ts.map +1 -1
  386. package/lib/tntd-form/index.js +24 -8
  387. package/lib/tntd-form/index.js.map +1 -1
  388. package/lib/tntd-form/interface.d.ts +4 -0
  389. package/lib/tntd-form/interface.d.ts.map +1 -0
  390. package/lib/tntd-form/interface.js +7 -0
  391. package/lib/tntd-form/interface.js.map +1 -0
  392. package/lib/tntd-form/style/components.less +16 -0
  393. package/lib/tntd-form/style/horizontal.less +26 -0
  394. package/lib/tntd-form/style/index.d.ts +5 -0
  395. package/lib/tntd-form/style/index.d.ts.map +1 -0
  396. package/lib/tntd-form/style/index.js +6 -0
  397. package/lib/tntd-form/style/index.js.map +1 -0
  398. package/lib/tntd-form/style/index.less +342 -0
  399. package/lib/tntd-form/style/inline.less +40 -0
  400. package/lib/tntd-form/style/mixin.less +90 -0
  401. package/lib/tntd-form/style/rtl.less +204 -0
  402. package/lib/tntd-form/style/status.less +45 -0
  403. package/lib/tntd-form/style/vertical.less +95 -0
  404. package/lib/tntd-form/tntd-form.stories.d.ts +33 -0
  405. package/lib/tntd-form/tntd-form.stories.d.ts.map +1 -0
  406. package/lib/tntd-form/tntd-form.stories.js +888 -0
  407. package/lib/tntd-form/tntd-form.stories.js.map +1 -0
  408. package/lib/tntd-form/util.d.ts +4 -0
  409. package/lib/tntd-form/util.d.ts.map +1 -0
  410. package/lib/tntd-form/util.js +25 -0
  411. package/lib/tntd-form/util.js.map +1 -0
  412. package/lib/tntd-form/validateMessagesContext.d.ts +5 -0
  413. package/lib/tntd-form/validateMessagesContext.d.ts.map +1 -0
  414. package/lib/tntd-form/validateMessagesContext.js +12 -0
  415. package/lib/tntd-form/validateMessagesContext.js.map +1 -0
  416. package/lib/tntd-modal/index.d.ts +15 -2
  417. package/lib/tntd-modal/index.d.ts.map +1 -1
  418. package/lib/tntd-modal/index.js +76 -61
  419. package/lib/tntd-modal/index.js.map +1 -1
  420. package/lib/tntd-modal/index.less +83 -63
  421. package/lib/tree-select/index.d.ts +7 -1
  422. package/lib/tree-select/index.d.ts.map +1 -1
  423. package/lib/tree-select/index.js +9 -3
  424. package/lib/tree-select/index.js.map +1 -1
  425. package/lib/upload/index.d.ts +6 -1
  426. package/lib/upload/index.d.ts.map +1 -1
  427. package/lib/upload/index.js +11 -1
  428. package/lib/upload/index.js.map +1 -1
  429. package/lib/utils/index.d.ts +1 -0
  430. package/lib/utils/index.d.ts.map +1 -1
  431. package/lib/utils/index.js +12 -0
  432. package/lib/utils/index.js.map +1 -1
  433. package/lib/utils/simple-template.d.ts +9 -0
  434. package/lib/utils/simple-template.d.ts.map +1 -0
  435. package/lib/utils/simple-template.js +19 -0
  436. package/lib/utils/simple-template.js.map +1 -0
  437. package/lib/water-mark/index.d.ts +49 -0
  438. package/lib/water-mark/index.d.ts.map +1 -0
  439. package/lib/water-mark/index.js +142 -0
  440. package/lib/water-mark/index.js.map +1 -0
  441. package/package.json +26 -5
  442. package/themes/default/variables.less +43 -0
@@ -1 +1 @@
1
- {"version":3,"file":"table.js","sourceRoot":"","sources":["../../src/table/table.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6DAAwD;AACxD,4FAAmE;AAEnE,0DAAoD;AACpD,kEAAyC;AACzC,4EAAmD;AACnD,4DAAmC;AACnC,+CAA8C;AAE9C,uCAAwC;AACxC,mCAA0C;AAC1C,mCAA0C;AAenC,MAAM,KAAK,GAAG,CAAK,EAiBV,EAAE,EAAE;QAjBM,EACxB,SAAS,EACT,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,UAAU,EACV,OAAO,EACP,QAAQ,EACR,QAAQ,GAAG,CAAC,QAAQ,EACpB,OAAO,GAAG,KAAK,EACf,eAAe,GAAG,KAAK,EACvB,UAAU,GAAG;QACX,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,MAAM;KACvC,EACD,aAAa,GAAG,KAAK,EACrB,OAAO,OAEO,EADX,IAAI,cAhBiB,oKAiBzB,CADQ;IAEP,MAAM,cAAc,GAAG,IAAA,cAAM,EAAiB,IAAI,CAAC,CAAA;IACnD,4EAA4E;IAC5E,4BAA4B;IAC5B,cAAc;IACd,IAAI;IACJ,MAAM,iBAAiB,GAAG,IAAA,eAAO,EAC/B,GAAG,EAAE,CAAC,OAAO,IAAI,IAAA,wBAAgB,EAAI,QAA+B,CAAC,EACrE,CAAC,QAAQ,EAAE,OAAO,CAAC,CACpB,CAAA;IACD,MAAM,CAAC,cAAc,EAAE,aAAa,EAAE,gBAAgB,CAAC,GAAG,IAAA,wBAAgB,EACxE,iBAAiB,EACjB,UAAU,CACX,CAAA;IAED;;OAEG;IACH,oBAAoB;IACpB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QAAA,KAAK,SA6FjB;AAED,aAAK,CAAC,MAAM,GAAG,gBAAM,CAAA;AACrB,aAAK,CAAC,WAAW,GAAG,qBAAW,CAAA;AAC/B,aAAK,CAAC,WAAW,GAAG,OAAO,CAAA","sourcesContent":["import { ConfigConsumer } from 'antd/lib/config-provider'\nimport LocaleReceiver from 'antd/lib/locale-provider/LocaleReceiver'\nimport type { TableProps as AntdTableProps } from 'antd/lib/table'\nimport { default as AntdTable } from 'antd/lib/table'\nimport Column from 'antd/lib/table/Column'\nimport ColumnGroup from 'antd/lib/table/ColumnGroup'\nimport classNames from 'classnames'\nimport React, { useMemo, useRef } from 'react'\n\nimport { TableContext } from './context'\nimport { useColumnSetting } from './hooks'\nimport { normalizeColumns } from './utils'\n\nexport type TableProps<T> = Omit<AntdTableProps<T>, 'locale'> & {\n storageKey?: string\n enableToolbar?: boolean\n showCellBorders?: boolean\n striped?: boolean\n shadowed?: boolean\n locale?: AntdTableProps<T>['locale'] & {\n loadingDescription?: string\n emptyText?: string\n }\n refresh?(): void\n}\n\nexport const Table = <T,>({\n className,\n locale,\n bordered,\n size,\n storageKey,\n columns,\n children,\n shadowed = !bordered,\n striped = false,\n showCellBorders = false,\n pagination = {\n showTotal: (total) => `共 ${total} 条记录`,\n },\n enableToolbar = false,\n refresh,\n ...rest\n}: TableProps<T>) => {\n const tableContainer = useRef<HTMLDivElement>(null)\n // const [innerSize, setInnerSize] = useLocalStorage<TableProps<T>['size']>(\n // TABLE_SIZE_STORAGE_KEY,\n // 'default'\n // )\n const normalizedColumns = useMemo(\n () => columns || normalizeColumns<T>(children as React.ReactChildren),\n [children, columns]\n )\n const [displayColumns, columnSetting, setColumnSetting] = useColumnSetting(\n normalizedColumns,\n storageKey\n )\n\n /**\n * update the innerSize when props size changes\n */\n // useEffect(() => {\n // if (size) {\n // setInnerSize(size)\n // }\n // }, [setInnerSize, size])\n\n return (\n <TableContext.Provider\n value={{\n // size: innerSize,\n tableContainer,\n columnSetting,\n refresh,\n // setSize: setInnerSize,\n setColumnSetting,\n }}\n >\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n const prefixCls = getPrefixCls('table')\n\n return (\n <div ref={tableContainer}>\n <LocaleReceiver componentName=\"Table\" defaultLocale={locale}>\n {(localeObject) => {\n const locale = localeObject as Record<string, string>\n\n return (\n <AntdTable\n className={classNames(\n prefixCls,\n {\n [`${prefixCls}-borderless`]: !bordered,\n [`${prefixCls}-hide-cell-borders`]: !showCellBorders,\n [`${prefixCls}-size-small`]: size === 'small',\n [`${prefixCls}-size-middle`]: size === 'middle',\n [`${prefixCls}-size-middle`]: size === 'middle',\n [`${prefixCls}-striped`]: striped,\n [`${prefixCls}-shadowed`]: shadowed,\n },\n className\n )}\n locale={locale}\n bordered={bordered}\n size={size}\n columns={displayColumns}\n pagination={pagination}\n {...rest}\n />\n )\n }}\n </LocaleReceiver>\n </div>\n )\n }}\n </ConfigConsumer>\n </TableContext.Provider>\n )\n}\n\nTable.Column = Column\nTable.ColumnGroup = ColumnGroup\nTable.displayName = 'Table'\n"]}
1
+ {"version":3,"file":"table.js","sourceRoot":"","sources":["../../src/table/table.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6DAAwD;AACxD,4FAAmE;AAEnE,0DAAoD;AACpD,kEAAyC;AACzC,4EAAmD;AACnD,4DAAmC;AACnC,+CAA8C;AAC9C,2DAAkC;AAClC,uCAAwC;AACxC,mCAA0C;AAC1C,mCAA0C;AAC1C,iDAA4C;AAC5C,gDAA4C;AAe5C,MAAM,oBAAoB,GAAG,CAAC,MAAsD,EAAE,EAAE,CAAC,CAAC;IACxF,SAAS,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,8BAAC,0BAAW,IAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAI;CAC5E,CAAC,CAAA;AAEK,MAAM,KAAK,GAAG,CAAK,EAeV,EAAE,EAAE;QAfM,EACxB,SAAS,EACT,MAAM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ACD,SAAS,CACV,EACD,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,UAAU,EACnB,UAAU,EAAE,gBAAgB,IACxB,IAAI,EACR,CACH,CAAA;gBACH,CAAC,CACc,CACb,CACP,CAAA;QACH,CAAC,CACc,CACK,CACzB,CAAA;AACH,CAAC,CAAA;AA1HY,QAAA,KAAK,SA0HjB;AAED,aAAK,CAAC,MAAM,GAAG,gBAAM,CAAA;AACrB,aAAK,CAAC,WAAW,GAAG,qBAAW,CAAA;AAC/B,aAAK,CAAC,WAAW,GAAG,OAAO,CAAA","sourcesContent":["import { ConfigConsumer } from 'antd/lib/config-provider'\nimport LocaleReceiver from 'antd/lib/locale-provider/LocaleReceiver'\nimport type { TableProps as AntdTableProps } from 'antd/lib/table'\nimport { default as AntdTable } from 'antd/lib/table'\nimport Column from 'antd/lib/table/Column'\nimport ColumnGroup from 'antd/lib/table/ColumnGroup'\nimport classNames from 'classnames'\nimport React, { useMemo, useRef } from 'react'\nimport Ellipsis from '../ellipsis'\nimport { TableContext } from './context'\nimport { useColumnSetting } from './hooks'\nimport { normalizeColumns } from './utils'\nimport { TotalShower } from './total-shower'\nimport { getLanguage } from '../prev-locale'\n\nexport type TableProps<T> = Omit<AntdTableProps<T>, 'locale'> & {\n storageKey?: string\n enableToolbar?: boolean\n showCellBorders?: boolean\n striped?: boolean\n shadowed?: boolean\n locale?: AntdTableProps<T>['locale'] & {\n loadingDescription?: string\n emptyText?: string\n }\n refresh?(): void\n}\n\nconst getDefaultPagination = (locale: NonNullable<AntdTableProps<unknown>['locale']>) => ({\n showTotal: (total: number) => <TotalShower total={total} locale={locale} />,\n})\n\nexport const Table = <T,>({\n className,\n locale,\n bordered,\n size,\n storageKey,\n columns,\n children,\n shadowed = !bordered,\n striped = false,\n showCellBorders = false,\n pagination,\n enableToolbar = false,\n refresh,\n ...rest\n}: TableProps<T>) => {\n const tableContainer = useRef<HTMLDivElement>(null)\n // const [innerSize, setInnerSize] = useLocalStorage<TableProps<T>['size']>(\n // TABLE_SIZE_STORAGE_KEY,\n // 'default'\n // )\n const normalizedColumns = useMemo(\n () => columns || normalizeColumns<T>(children as React.ReactChildren),\n [children, columns]\n )\n const [displayColumns, columnSetting, setColumnSetting] = useColumnSetting(\n normalizedColumns,\n storageKey\n )\n\n const lang = getLanguage()\n const newColumns = displayColumns?.map((column) => {\n if (lang === 'cn') {\n return column\n } else {\n return {\n ellipsis: !column.sorter,\n ...column,\n title: () => {\n if (column.sorter) {\n return column.title\n } else {\n let widthLimitObj = {}\n if (column.width) {\n widthLimitObj = {\n widthLimit: column.width,\n }\n }\n return (\n <Ellipsis\n {...widthLimitObj}\n placement={column?.placement || 'topLeft'}\n title={column.title}\n />\n )\n }\n },\n }\n }\n })\n\n /**\n * update the innerSize when props size changes\n */\n // useEffect(() => {\n // if (size) {\n // setInnerSize(size)\n // }\n // }, [setInnerSize, size])\n\n return (\n <TableContext.Provider\n value={{\n // size: innerSize,\n tableContainer,\n columnSetting,\n refresh,\n // setSize: setInnerSize,\n setColumnSetting,\n }}\n >\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n const prefixCls = getPrefixCls('table')\n\n return (\n <div ref={tableContainer}>\n <LocaleReceiver componentName=\"Table\" defaultLocale={locale}>\n {(localeObject) => {\n const locale = localeObject as Record<string, string>\n const paginationConfig = pagination && getDefaultPagination(locale)\n return (\n <AntdTable\n className={classNames(\n prefixCls,\n {\n [`${prefixCls}-borderless`]: !bordered,\n [`${prefixCls}-hide-cell-borders`]: !showCellBorders,\n [`${prefixCls}-size-small`]: size === 'small',\n [`${prefixCls}-size-middle`]: size === 'middle',\n [`${prefixCls}-size-middle`]: size === 'middle',\n [`${prefixCls}-striped`]: striped,\n [`${prefixCls}-shadowed`]: shadowed,\n },\n className\n )}\n locale={locale}\n bordered={bordered}\n size={size}\n columns={newColumns}\n pagination={paginationConfig}\n {...rest}\n />\n )\n }}\n </LocaleReceiver>\n </div>\n )\n }}\n </ConfigConsumer>\n </TableContext.Provider>\n )\n}\n\nTable.Column = Column\nTable.ColumnGroup = ColumnGroup\nTable.displayName = 'Table'\n"]}
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import type { TableProps as AntdTableProps } from 'antd/lib/table';
3
+ export declare const TotalShower: ({ total, locale, }: {
4
+ total: number;
5
+ locale: import("antd/lib/table").TableLocale & {
6
+ total?: string | undefined;
7
+ };
8
+ }) => JSX.Element;
9
+ //# sourceMappingURL=total-shower.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"total-shower.d.ts","sourceRoot":"","sources":["../../src/table/total-shower.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,eAAe,CAAA;AAGjE,eAAO,MAAM,WAAW;WAIf,MAAM;;;;iBAMd,CAAA"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TotalShower = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _utils = require("../utils");
9
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
10
+ var TotalShower = function TotalShower(_ref) {
11
+ var total = _ref.total,
12
+ locale = _ref.locale;
13
+ return _react["default"].createElement(_react["default"].Fragment, null, (0, _utils.simpleTemplate)(locale.total, {
14
+ total: total
15
+ }));
16
+ };
17
+ exports.TotalShower = TotalShower;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"total-shower.js","sourceRoot":"","sources":["../../src/table/total-shower.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAAyB;AAGzB,oCAAyC;AAElC,MAAM,WAAW,GAAG,CAAC,EAC1B,KAAK,EACL,MAAM,GAMP,EAAE,EAAE;IACH,OAAO,8DAAG,IAAA,sBAAc,EAAC,MAAM,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,CAAI,CAAA;AACvD,CAAC,CAAA;AAVY,QAAA,WAAW,eAUvB","sourcesContent":["import React from 'react'\n\nimport type { TableProps as AntdTableProps } from 'antd/lib/table'\nimport { simpleTemplate } from '../utils'\n\nexport const TotalShower = ({\n total,\n locale,\n}: {\n total: number\n locale: AntdTableProps<unknown>['locale'] & {\n total?: string\n }\n}) => {\n return <>{simpleTemplate(locale.total, { total })}</>\n}\n"]}
@@ -1,5 +1,10 @@
1
- import TimePicker from 'antd/lib/time-picker';
1
+ /// <reference types="react" />
2
+ import type { TimePickerProps as AntdTimePickerProps } from 'antd/lib/time-picker';
2
3
  import 'antd/lib/time-picker/style';
3
4
  export * from 'antd/lib/time-picker';
4
- export default TimePicker;
5
+ export declare type TimePickerProps = AntdTimePickerProps & {
6
+ readonly?: boolean;
7
+ };
8
+ declare const _default: import("react").ForwardRefExoticComponent<AntdTimePickerProps & import("react").RefAttributes<unknown>>;
9
+ export default _default;
5
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/time-picker/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,qBAAqB,CAAA;AAE5C,OAAO,2BAA2B,CAAA;AAElC,cAAc,qBAAqB,CAAA;AAEnC,eAAe,UAAU,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/time-picker/index.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,eAAe,IAAI,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAIjF,OAAO,2BAA2B,CAAA;AAElC,cAAc,qBAAqB,CAAA;AAEnC,oBAAY,eAAe,GAAG,mBAAmB,GAAG;IAClD,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;;AAED,wBAA2E"}
@@ -18,8 +18,10 @@ Object.keys(_timePicker).forEach(function (key) {
18
18
  }
19
19
  });
20
20
  });
21
+ var _connect = require("../connect");
22
+ var _previewText = require("../preview-text");
21
23
  require("antd/lib/time-picker/style");
22
24
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
25
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
24
- var _default = _timePicker["default"];
26
+ var _default = (0, _connect.connectReadonlyComponent)(_timePicker["default"], _previewText.PreviewText.TimePicker);
25
27
  exports["default"] = _default;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/time-picker/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,sEAA4C;AAE5C,qCAAkC;AAElC,sDAAmC;AAEnC,kBAAe,qBAAU,CAAA","sourcesContent":["import TimePicker from 'antd/lib/time-picker'\n\nimport 'antd/lib/time-picker/style'\n\nexport * from 'antd/lib/time-picker'\n\nexport default TimePicker\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/time-picker/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,sEAA4C;AAE5C,wCAAqD;AACrD,kDAA6C;AAE7C,qCAAkC;AAElC,sDAAmC;AAMnC,kBAAe,IAAA,kCAAwB,EAAC,qBAAU,EAAE,0BAAW,CAAC,UAAU,CAAC,CAAA","sourcesContent":["import TimePicker from 'antd/lib/time-picker'\nimport type { TimePickerProps as AntdTimePickerProps } from 'antd/lib/time-picker'\nimport { connectReadonlyComponent } from '../connect'\nimport { PreviewText } from '../preview-text'\n\nimport 'antd/lib/time-picker/style'\n\nexport * from 'antd/lib/time-picker'\n\nexport type TimePickerProps = AntdTimePickerProps & {\n readonly?: boolean\n}\n\nexport default connectReadonlyComponent(TimePicker, PreviewText.TimePicker)\n"]}
@@ -1,3 +1,13 @@
1
- declare function _default(props: any): JSX.Element;
1
+ import React, { ComponentProps } from 'react';
2
+ import './index.less';
3
+ export interface TitleProps extends ComponentProps<'div'> {
4
+ title?: string;
5
+ subTitle?: string;
6
+ size?: 'default' | 'small' | 'middle' | 'large';
7
+ extra?: React.ReactNode;
8
+ number?: number;
9
+ simple?: boolean;
10
+ }
11
+ declare const _default: (props: TitleProps) => JSX.Element;
2
12
  export default _default;
3
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/title/index.js"],"names":[],"mappings":"AAIe,mDAyBd"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/title/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAM,cAAc,EAAE,MAAM,OAAO,CAAA;AAEjD,OAAO,cAAc,CAAA;AAErB,MAAM,WAAW,UAAW,SAAQ,cAAc,CAAC,KAAK,CAAC;IACvD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IAC/C,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;gCAEsB,UAAU;AAAjC,wBAwBC"}
@@ -28,21 +28,19 @@ var _default = function _default(props) {
28
28
  extra = _a.extra,
29
29
  number = _a.number,
30
30
  simple = _a.simple,
31
- style = _a.style,
32
- rest = __rest(_a, ["title", "subTitle", "size", "extra", "number", "simple", "style"]);
33
- return _react["default"].createElement("div", {
34
- className: (0, _classnames["default"])('tnt-title', size, {
31
+ rest = __rest(_a, ["title", "subTitle", "size", "extra", "number", "simple"]);
32
+ return _react["default"].createElement("div", Object.assign({
33
+ className: (0, _classnames["default"])('tntd-title', size, {
35
34
  'has-number': number
36
35
  }, {
37
36
  'is-simple': simple
38
- }),
39
- style: Object.assign({}, style)
40
- }, _react["default"].createElement("div", {
41
- className: "tnt-title-text"
37
+ })
38
+ }, rest), _react["default"].createElement("div", {
39
+ className: "tntd-title-text"
42
40
  }, number && _react["default"].createElement("i", {
43
- "class": "count"
41
+ className: "count"
44
42
  }, number <= 9 ? "0".concat(number) : number), _react["default"].createElement("h3", null, title), _react["default"].createElement("span", null, subTitle)), extra && _react["default"].createElement("div", {
45
- className: "tnt-title-extra"
43
+ className: "tntd-title-extra"
46
44
  }, extra));
47
45
  };
48
46
  exports["default"] = _default;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/title/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAyB;AACzB,4DAA2B;AAC3B,wBAAqB;AAErB,kBAAe,CAAC,KAAK,EAAE,EAAE;IACvB,MAAM,KASF,KAAK,IAAI,EAAE,EATT,EACJ,KAAK,GAAG,MAAM,EACd,QAAQ,EACR,IAAI,GAAG,SAAS,EAChB,KAAK,EACL,MAAM,EACN,MAAM,EACN,KAAK,OAEQ,EADV,IAAI,cARH,mEASL,CAAc,CAAA;IAEf,OAAO,CACL,uCACE,SAAS,EAAE,IAAA,oBAAE,EAAC,WAAW,EAAE,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,EACnF,KAAK,oBAAO,KAAK;QAEjB,uCAAK,SAAS,EAAC,gBAAgB;YAC5B,MAAM,IAAI,qCAAG,KAAK,EAAC,OAAO,IAAE,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,CAAK;YACrE,0CAAK,KAAK,CAAM;YAChB,4CAAO,QAAQ,CAAQ,CACnB;QACL,KAAK,IAAI,uCAAK,SAAS,EAAC,iBAAiB,IAAE,KAAK,CAAO,CACpD,CACP,CAAA;AACH,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport cn from 'classnames'\nimport './index.less'\n\nexport default (props) => {\n const {\n title = '暂无标题',\n subTitle,\n size = 'default',\n extra,\n number,\n simple,\n style,\n ...rest\n } = props || {}\n\n return (\n <div\n className={cn('tnt-title', size, { 'has-number': number }, { 'is-simple': simple })}\n style={{ ...style }}\n >\n <div className=\"tnt-title-text\">\n {number && <i class=\"count\">{number <= 9 ? `0${number}` : number}</i>}\n <h3>{title}</h3>\n <span>{subTitle}</span>\n </div>\n {extra && <div className=\"tnt-title-extra\">{extra}</div>}\n </div>\n )\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/title/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAiD;AACjD,4DAA2B;AAC3B,wBAAqB;AAWrB,kBAAe,CAAC,KAAiB,EAAE,EAAE;IACnC,MAAM,KAQF,KAAK,IAAI,EAAE,EART,EACJ,KAAK,GAAG,MAAM,EACd,QAAQ,EACR,IAAI,GAAG,SAAS,EAChB,KAAK,EACL,MAAM,EACN,MAAM,OAEO,EADV,IAAI,cAPH,0DAQL,CAAc,CAAA;IAEf,OAAO,CACL,qDACE,SAAS,EAAE,IAAA,oBAAE,EAAC,YAAY,EAAE,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,IAChF,IAAI;QAER,uCAAK,SAAS,EAAC,iBAAiB;YAC7B,MAAM,IAAI,qCAAG,SAAS,EAAC,OAAO,IAAE,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,CAAK;YACzE,0CAAK,KAAK,CAAM;YAChB,4CAAO,QAAQ,CAAQ,CACnB;QACL,KAAK,IAAI,uCAAK,SAAS,EAAC,kBAAkB,IAAE,KAAK,CAAO,CACrD,CACP,CAAA;AACH,CAAC,CAAA","sourcesContent":["import React, { FC, ComponentProps } from 'react'\nimport cn from 'classnames'\nimport './index.less'\n\nexport interface TitleProps extends ComponentProps<'div'> {\n title?: string\n subTitle?: string\n size?: 'default' | 'small' | 'middle' | 'large'\n extra?: React.ReactNode\n number?: number\n simple?: boolean\n}\n\nexport default (props: TitleProps) => {\n const {\n title = '暂无标题',\n subTitle,\n size = 'default',\n extra,\n number,\n simple,\n ...rest\n } = props || {}\n\n return (\n <div\n className={cn('tntd-title', size, { 'has-number': number }, { 'is-simple': simple })}\n {...rest}\n >\n <div className=\"tntd-title-text\">\n {number && <i className=\"count\">{number <= 9 ? `0${number}` : number}</i>}\n <h3>{title}</h3>\n <span>{subTitle}</span>\n </div>\n {extra && <div className=\"tntd-title-extra\">{extra}</div>}\n </div>\n )\n}\n"]}
@@ -1,4 +1,4 @@
1
- .tnt-title {
1
+ .tntd-title {
2
2
  & {
3
3
  position: relative;
4
4
  height: 32px;
@@ -8,7 +8,7 @@
8
8
  }
9
9
 
10
10
  &.has-number {
11
- .tnt-title-text {
11
+ .tntd-title-text {
12
12
  h3 {
13
13
  margin-left: 0;
14
14
  }
@@ -58,14 +58,14 @@
58
58
  .count {
59
59
  position: relative;
60
60
  top: -1px;
61
- color: #0089ff;
61
+ color: @primary-color;
62
62
  font-size: 22px;
63
63
  font-style: normal;
64
64
  margin-right: 12px;
65
65
  position: relative;
66
66
  vertical-align: top;
67
67
  font-weight: 400;
68
- font-family: Roboto, 'Helvetica Neue', Helvetica, Tahoma, Arial, 'PingFang SC',
68
+ font-family: 'OswaldLight', Roboto, 'Helvetica Neue', Helvetica, Tahoma, Arial, 'PingFang SC',
69
69
  'Microsoft YaHei' !important;
70
70
  letter-spacing: 1px;
71
71
  }
@@ -75,7 +75,7 @@
75
75
  content: '';
76
76
  width: 22px;
77
77
  height: 15px;
78
- border-top: 1px solid #0089ff;
78
+ border-top: 1px solid @primary-color;
79
79
  background-color: #fff;
80
80
  top: 45%;
81
81
  left: 58%;
@@ -88,7 +88,7 @@
88
88
  height: 28px;
89
89
  line-height: 28px;
90
90
  }
91
- .tnt-title-text {
91
+ .tntd-title-text {
92
92
  h3 {
93
93
  font-size: 14px;
94
94
  }
@@ -103,7 +103,7 @@
103
103
  height: 36px;
104
104
  line-height: 36px;
105
105
  }
106
- .tnt-title-text {
106
+ .tntd-title-text {
107
107
  h3 {
108
108
  font-size: 18px;
109
109
  }
@@ -118,7 +118,7 @@
118
118
  height: 40px;
119
119
  line-height: 40px;
120
120
  }
121
- .tnt-title-text {
121
+ .tntd-title-text {
122
122
  h3 {
123
123
  font-size: 20px;
124
124
  }
@@ -128,7 +128,7 @@
128
128
  }
129
129
  }
130
130
  }
131
- .tnt-title-text {
131
+ .tntd-title-text {
132
132
  & {
133
133
  position: relative;
134
134
  float: left;
@@ -161,7 +161,7 @@
161
161
  margin-right: 8px;
162
162
  }
163
163
  }
164
- .tnt-title-extra {
164
+ .tntd-title-extra {
165
165
  & {
166
166
  position: relative;
167
167
  float: right;
@@ -2,5 +2,5 @@ import type { SelectCommonPlacement, ValidateStatus } from '../interface';
2
2
  export declare const getTransitionDirection: (placement: SelectCommonPlacement | undefined) => "slide-down" | "slide-up";
3
3
  export declare const getTransitionName: (rootPrefixCls: string, motion: string, transitionName?: string | undefined) => string;
4
4
  export declare function getStatusClassNames(prefixCls: string, status?: ValidateStatus, hasFeedback?: boolean): string;
5
- export declare const getMergedStatus: (contextStatus?: "" | "success" | "error" | "warning" | "validating" | undefined, customStatus?: "" | "error" | "warning" | undefined) => "" | "success" | "error" | "warning" | "validating" | undefined;
5
+ export declare const getMergedStatus: (contextStatus?: "" | "validating" | "success" | "warning" | "error" | undefined, customStatus?: "" | "warning" | "error" | undefined) => "" | "validating" | "success" | "warning" | "error" | undefined;
6
6
  //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ import type { ValidateStatus } from './FormItem';
3
+ export interface ErrorListProps {
4
+ fieldId?: string;
5
+ help?: React.ReactNode;
6
+ helpStatus?: ValidateStatus;
7
+ errors?: React.ReactNode[];
8
+ warnings?: React.ReactNode[];
9
+ className?: string;
10
+ onVisibleChanged?: (visible: boolean) => void;
11
+ }
12
+ export default function ErrorList({ help, helpStatus, errors, warnings, className: rootClassName, fieldId, onVisibleChanged, }: ErrorListProps): JSX.Element;
13
+ //# sourceMappingURL=ErrorList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorList.d.ts","sourceRoot":"","sources":["../../src/tntd-form/ErrorList.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAuBhD,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,UAAU,CAAC,EAAE,cAAc,CAAA;IAC3B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,EAAE,CAAA;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,EAAE,CAAA;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;CAC9C;AAED,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,IAAI,EACJ,UAAU,EACV,MAAmB,EACnB,QAAqB,EACrB,SAAS,EAAE,aAAa,EACxB,OAAO,EACP,gBAAgB,GACjB,EAAE,cAAc,eAqFhB"}
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports["default"] = ErrorList;
8
+ var _classnames = _interopRequireDefault(require("classnames"));
9
+ var _rcMotion = _interopRequireWildcard(require("rc-motion"));
10
+ var React = _interopRequireWildcard(require("react"));
11
+ var _configProvider = require("../config-provider");
12
+ var _motion = _interopRequireDefault(require("./_util/motion"));
13
+ var _context = require("./context");
14
+ var _useDebounce = _interopRequireDefault(require("./hooks/useDebounce"));
15
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
16
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
18
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
19
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
20
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
21
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
22
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
23
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
24
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
25
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
26
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
27
+ var EMPTY_LIST = [];
28
+ function toErrorEntity(error, errorStatus, prefix) {
29
+ var index = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
30
+ return {
31
+ key: typeof error === 'string' ? error : "".concat(prefix, "-").concat(index),
32
+ error: error,
33
+ errorStatus: errorStatus
34
+ };
35
+ }
36
+ function ErrorList(_ref) {
37
+ var help = _ref.help,
38
+ helpStatus = _ref.helpStatus,
39
+ _ref$errors = _ref.errors,
40
+ errors = _ref$errors === void 0 ? EMPTY_LIST : _ref$errors,
41
+ _ref$warnings = _ref.warnings,
42
+ warnings = _ref$warnings === void 0 ? EMPTY_LIST : _ref$warnings,
43
+ rootClassName = _ref.className,
44
+ fieldId = _ref.fieldId,
45
+ onVisibleChanged = _ref.onVisibleChanged;
46
+ var _React$useContext = React.useContext(_context.FormItemPrefixContext),
47
+ prefixCls = _React$useContext.prefixCls;
48
+ // TODO
49
+ // @ts-ignore
50
+ var _React$useContext2 = React.useContext(_configProvider.ConfigContext),
51
+ getPrefixCls = _React$useContext2.getPrefixCls;
52
+ var baseClassName = "".concat(prefixCls, "-item-explain");
53
+ // TODO:
54
+ // @ts-ignore
55
+ var rootPrefixCls = getPrefixCls();
56
+ // We have to debounce here again since somewhere use ErrorList directly still need no shaking
57
+ // ref: https://github.com/ant-design/ant-design/issues/36336
58
+ var debounceErrors = (0, _useDebounce["default"])(errors);
59
+ var debounceWarnings = (0, _useDebounce["default"])(warnings);
60
+ var fullKeyList = React.useMemo(function () {
61
+ if (help !== undefined && help !== null) {
62
+ return [toErrorEntity(help, helpStatus, 'help')];
63
+ }
64
+ return [].concat(_toConsumableArray(debounceErrors.map(function (error, index) {
65
+ return toErrorEntity(error, 'error', 'error', index);
66
+ })), _toConsumableArray(debounceWarnings.map(function (warning, index) {
67
+ return toErrorEntity(warning, 'warning', 'warning', index);
68
+ })));
69
+ }, [help, helpStatus, debounceErrors, debounceWarnings]);
70
+ var helpProps = {};
71
+ if (fieldId) {
72
+ helpProps.id = "".concat(fieldId, "_help");
73
+ }
74
+ return React.createElement(_rcMotion["default"], {
75
+ motionDeadline: _motion["default"].motionDeadline,
76
+ motionName: "".concat(rootPrefixCls, "-show-help"),
77
+ visible: !!fullKeyList.length,
78
+ onVisibleChanged: onVisibleChanged
79
+ }, function (holderProps) {
80
+ var holderClassName = holderProps.className,
81
+ holderStyle = holderProps.style;
82
+ return React.createElement("div", Object.assign({}, helpProps, {
83
+ className: (0, _classnames["default"])(baseClassName, holderClassName, rootClassName),
84
+ style: holderStyle,
85
+ role: "alert"
86
+ }), React.createElement(_rcMotion.CSSMotionList, Object.assign({
87
+ keys: fullKeyList
88
+ }, _motion["default"], {
89
+ motionName: "".concat(rootPrefixCls, "-show-help-item"),
90
+ component: false
91
+ }), function (itemProps) {
92
+ var key = itemProps.key,
93
+ error = itemProps.error,
94
+ errorStatus = itemProps.errorStatus,
95
+ itemClassName = itemProps.className,
96
+ itemStyle = itemProps.style;
97
+ return React.createElement("div", {
98
+ key: key,
99
+ className: (0, _classnames["default"])(itemClassName, _defineProperty({}, "".concat(baseClassName, "-").concat(errorStatus), errorStatus)),
100
+ style: itemStyle
101
+ }, error);
102
+ }));
103
+ });
104
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorList.js","sourceRoot":"","sources":["../../src/tntd-form/ErrorList.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4DAAmC;AACnC,uDAAoD;AACpD,6CAA8B;AAC9B,wDAAkD;AAClD,4DAA2C;AAC3C,uCAAiD;AACjD,sEAA6C;AAG7C,MAAM,UAAU,GAAsB,EAAE,CAAA;AAQxC,SAAS,aAAa,CACpB,KAAsB,EACtB,WAAuC,EACvC,MAAc,EACd,QAAgB,CAAC;IAEjB,OAAO;QACL,GAAG,EAAE,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,KAAK,EAAE;QAC7D,KAAK;QACL,WAAW;KACZ,CAAA;AACH,CAAC;AAYD,SAAwB,SAAS,CAAC,EAChC,IAAI,EACJ,UAAU,EACV,MAAM,GAAG,UAAU,EACnB,QAAQ,GAAG,UAAU,EACrB,SAAS,EAAE,aAAa,EACx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S,IACR,cAAc,EAAE,gBAAc,CAAC,cAAc,EAC7C,UAAU,EAAE,GAAG,aAAa,YAAY,EACxC,OAAO,EAAE,CAAC,CAAC,WAAW,CAAC,MAAM,EAC7B,gBAAgB,EAAE,gBAAgB,IAEjC,CAAC,WAAW,EAAE,EAAE;QACf,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,WAAW,CAAA;QAEtE,OAAO,CACL,6CACM,SAAS,IACb,SAAS,EAAE,IAAA,oBAAU,EAAC,aAAa,EAAE,eAAe,EAAE,aAAa,CAAC,EACpE,KAAK,EAAE,WAAW,EAClB,IAAI,EAAC,OAAO;YAEZ,oBAAC,yBAAa,kBACZ,IAAI,EAAE,WAAW,IACb,gBAAc,IAClB,UAAU,EAAE,GAAG,aAAa,iBAAiB,EAC7C,SAAS,EAAE,KAAK,KAEf,CAAC,SAAS,EAAE,EAAE;gBACb,MAAM,EACJ,GAAG,EACH,KAAK,EACL,WAAW,EACX,SAAS,EAAE,aAAa,EACxB,KAAK,EAAE,SAAS,GACjB,GAAG,SAAS,CAAA;gBAEb,OAAO,CACL,6BACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,oBAAU,EAAC,aAAa,EAAE;wBACnC,CAAC,GAAG,aAAa,IAAI,WAAW,EAAE,CAAC,EAAE,WAAW;qBACjD,CAAC,EACF,KAAK,EAAE,SAAS,IAEf,KAAK,CACF,CACP,CAAA;YACH,CAAC,CACa,CACZ,CACP,CAAA;IACH,CAAC,CACS,CACb,CAAA;AACH,CAAC;AA7FD,4BA6FC","sourcesContent":["import classNames from 'classnames'\nimport CSSMotion, { CSSMotionList } from 'rc-motion'\nimport * as React from 'react'\nimport { ConfigContext } from '../config-provider'\nimport collapseMotion from './_util/motion'\nimport { FormItemPrefixContext } from './context'\nimport useDebounce from './hooks/useDebounce'\nimport type { ValidateStatus } from './FormItem'\n\nconst EMPTY_LIST: React.ReactNode[] = []\n\ninterface ErrorEntity {\n error: React.ReactNode\n errorStatus?: ValidateStatus\n key: string\n}\n\nfunction toErrorEntity(\n error: React.ReactNode,\n errorStatus: ValidateStatus | undefined,\n prefix: string,\n index: number = 0\n): ErrorEntity {\n return {\n key: typeof error === 'string' ? error : `${prefix}-${index}`,\n error,\n errorStatus,\n }\n}\n\nexport interface ErrorListProps {\n fieldId?: string\n help?: React.ReactNode\n helpStatus?: ValidateStatus\n errors?: React.ReactNode[]\n warnings?: React.ReactNode[]\n className?: string\n onVisibleChanged?: (visible: boolean) => void\n}\n\nexport default function ErrorList({\n help,\n helpStatus,\n errors = EMPTY_LIST,\n warnings = EMPTY_LIST,\n className: rootClassName,\n fieldId,\n onVisibleChanged,\n}: ErrorListProps) {\n const { prefixCls } = React.useContext(FormItemPrefixContext)\n // TODO\n // @ts-ignore\n const { getPrefixCls } = React.useContext(ConfigContext)\n\n const baseClassName = `${prefixCls}-item-explain`\n // TODO:\n // @ts-ignore\n const rootPrefixCls = getPrefixCls()\n\n // We have to debounce here again since somewhere use ErrorList directly still need no shaking\n // ref: https://github.com/ant-design/ant-design/issues/36336\n const debounceErrors = useDebounce(errors)\n const debounceWarnings = useDebounce(warnings)\n\n const fullKeyList = React.useMemo(() => {\n if (help !== undefined && help !== null) {\n return [toErrorEntity(help, helpStatus, 'help')]\n }\n\n return [\n ...debounceErrors.map((error, index) => toErrorEntity(error, 'error', 'error', index)),\n ...debounceWarnings.map((warning, index) =>\n toErrorEntity(warning, 'warning', 'warning', index)\n ),\n ]\n }, [help, helpStatus, debounceErrors, debounceWarnings])\n\n const helpProps: { id?: string } = {}\n\n if (fieldId) {\n helpProps.id = `${fieldId}_help`\n }\n\n return (\n <CSSMotion\n motionDeadline={collapseMotion.motionDeadline}\n motionName={`${rootPrefixCls}-show-help`}\n visible={!!fullKeyList.length}\n onVisibleChanged={onVisibleChanged}\n >\n {(holderProps) => {\n const { className: holderClassName, style: holderStyle } = holderProps\n\n return (\n <div\n {...helpProps}\n className={classNames(baseClassName, holderClassName, rootClassName)}\n style={holderStyle}\n role=\"alert\"\n >\n <CSSMotionList\n keys={fullKeyList}\n {...collapseMotion}\n motionName={`${rootPrefixCls}-show-help-item`}\n component={false}\n >\n {(itemProps) => {\n const {\n key,\n error,\n errorStatus,\n className: itemClassName,\n style: itemStyle,\n } = itemProps\n\n return (\n <div\n key={key}\n className={classNames(itemClassName, {\n [`${baseClassName}-${errorStatus}`]: errorStatus,\n })}\n style={itemStyle}\n >\n {error}\n </div>\n )\n }}\n </CSSMotionList>\n </div>\n )\n }}\n </CSSMotion>\n )\n}\n"]}
@@ -0,0 +1,36 @@
1
+ import { List, useWatch } from 'rc-field-form';
2
+ import type { FormProps as RcFormProps } from 'rc-field-form/lib/Form';
3
+ import * as React from 'react';
4
+ import type { Options } from 'scroll-into-view-if-needed';
5
+ import type { SizeType } from '../config-provider/SizeContext';
6
+ import type { ColProps } from '../col';
7
+ import useForm, { FormInstance } from './hooks/useForm';
8
+ import type { FormLabelAlign } from './interface';
9
+ export declare type RequiredMark = boolean | 'optional';
10
+ export declare type FormLayout = 'horizontal' | 'inline' | 'vertical';
11
+ export interface FormProps<Values = any> extends Omit<RcFormProps<Values>, 'form'> {
12
+ prefixCls?: string;
13
+ colon?: boolean;
14
+ name?: string;
15
+ layout?: FormLayout;
16
+ labelAlign?: FormLabelAlign;
17
+ labelWrap?: boolean;
18
+ labelCol?: ColProps;
19
+ wrapperCol?: ColProps;
20
+ form?: FormInstance<Values>;
21
+ size?: SizeType;
22
+ disabled?: boolean;
23
+ readonly?: boolean;
24
+ scrollToFirstError?: Options | boolean;
25
+ requiredMark?: RequiredMark;
26
+ /** @deprecated Will warning in future branch. Pls use `requiredMark` instead. */
27
+ hideRequiredMark?: boolean;
28
+ }
29
+ declare const Form: <Values = any>(props: FormProps<Values> & {
30
+ children?: React.ReactNode;
31
+ } & {
32
+ ref?: React.Ref<FormInstance<Values>> | undefined;
33
+ }) => React.ReactElement;
34
+ export { useForm, List, FormInstance, useWatch };
35
+ export default Form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AO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,kBAAkB,CAAC,EAAE,OAAO,GAAG,OAAO,CAAA;IACtC,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,iFAAiF;IACjF,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B;AAwID,QAAA,MAAM,IAAI;;;;MAEL,MAAM,YAAY,CAAA;AAEvB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAA;AAEhD,eAAe,IAAI,CAAA"}
@@ -0,0 +1,160 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "List", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _rcFieldForm.List;
10
+ }
11
+ });
12
+ exports["default"] = void 0;
13
+ Object.defineProperty(exports, "useForm", {
14
+ enumerable: true,
15
+ get: function get() {
16
+ return _useForm3["default"];
17
+ }
18
+ });
19
+ Object.defineProperty(exports, "useWatch", {
20
+ enumerable: true,
21
+ get: function get() {
22
+ return _rcFieldForm.useWatch;
23
+ }
24
+ });
25
+ var _classnames = _interopRequireDefault(require("classnames"));
26
+ var _rcFieldForm = _interopRequireWildcard(require("rc-field-form"));
27
+ var React = _interopRequireWildcard(require("react"));
28
+ var _configProvider = require("../config-provider");
29
+ var _DisabledContext = _interopRequireWildcard(require("../config-provider/DisabledContext"));
30
+ var _SizeContext = _interopRequireWildcard(require("../config-provider/SizeContext"));
31
+ var _context = require("./context");
32
+ var _validateMessagesContext = _interopRequireDefault(require("./validateMessagesContext"));
33
+ var _useForm3 = _interopRequireDefault(require("./hooks/useForm"));
34
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
35
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
36
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
37
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
38
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
39
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
40
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
41
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
42
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
43
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
44
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
45
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
46
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
47
+ var __rest = void 0 && (void 0).__rest || function (s, e) {
48
+ var t = {};
49
+ for (var p in s) {
50
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
51
+ }
52
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
53
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
54
+ }
55
+ return t;
56
+ };
57
+ var InternalForm = function InternalForm(props, ref) {
58
+ var _classNames;
59
+ var contextSize = React.useContext(_SizeContext["default"]);
60
+ var contextDisabled = React.useContext(_DisabledContext["default"]);
61
+ // TODO
62
+ // @ts-ignore
63
+ var _React$useContext = React.useContext(_configProvider.ConfigContext),
64
+ getPrefixCls = _React$useContext.getPrefixCls,
65
+ direction = _React$useContext.direction,
66
+ contextForm = _React$useContext.form;
67
+ var customizePrefixCls = props.prefixCls,
68
+ _props$className = props.className,
69
+ className = _props$className === void 0 ? '' : _props$className,
70
+ _props$size = props.size,
71
+ size = _props$size === void 0 ? contextSize : _props$size,
72
+ _props$disabled = props.disabled,
73
+ disabled = _props$disabled === void 0 ? contextDisabled : _props$disabled,
74
+ form = props.form,
75
+ colon = props.colon,
76
+ labelAlign = props.labelAlign,
77
+ labelWrap = props.labelWrap,
78
+ labelCol = props.labelCol,
79
+ wrapperCol = props.wrapperCol,
80
+ hideRequiredMark = props.hideRequiredMark,
81
+ _props$layout = props.layout,
82
+ layout = _props$layout === void 0 ? 'horizontal' : _props$layout,
83
+ scrollToFirstError = props.scrollToFirstError,
84
+ requiredMark = props.requiredMark,
85
+ onFinishFailed = props.onFinishFailed,
86
+ name = props.name,
87
+ readonly = props.readonly,
88
+ restFormProps = __rest(props, ["prefixCls", "className", "size", "disabled", "form", "colon", "labelAlign", "labelWrap", "labelCol", "wrapperCol", "hideRequiredMark", "layout", "scrollToFirstError", "requiredMark", "onFinishFailed", "name", "readonly"]);
89
+ var contextValidateMessages = React.useContext(_validateMessagesContext["default"]);
90
+ var mergedRequiredMark = (0, React.useMemo)(function () {
91
+ if (requiredMark !== undefined) {
92
+ return requiredMark;
93
+ }
94
+ if (contextForm && contextForm.requiredMark !== undefined) {
95
+ return contextForm.requiredMark;
96
+ }
97
+ if (hideRequiredMark) {
98
+ return false;
99
+ }
100
+ return true;
101
+ }, [hideRequiredMark, requiredMark, contextForm]);
102
+ var mergedColon = colon !== null && colon !== void 0 ? colon : contextForm === null || contextForm === void 0 ? void 0 : contextForm.colon;
103
+ var prefixCls = getPrefixCls('form', customizePrefixCls);
104
+ var formClassName = (0, _classnames["default"])(prefixCls, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-tntd"), true), _defineProperty(_classNames, "".concat(prefixCls, "-").concat(layout), true), _defineProperty(_classNames, "".concat(prefixCls, "-hide-required-mark"), mergedRequiredMark === false), _defineProperty(_classNames, "".concat(prefixCls, "-rtl"), direction === 'rtl'), _defineProperty(_classNames, "".concat(prefixCls, "-").concat(size), size), _classNames), className);
105
+ var _useForm = (0, _useForm3["default"])(form),
106
+ _useForm2 = _slicedToArray(_useForm, 1),
107
+ wrapForm = _useForm2[0];
108
+ var __INTERNAL__ = wrapForm.__INTERNAL__;
109
+ __INTERNAL__.name = name;
110
+ var formContextValue = (0, React.useMemo)(function () {
111
+ return {
112
+ name: name,
113
+ labelAlign: labelAlign,
114
+ labelCol: labelCol,
115
+ labelWrap: labelWrap,
116
+ wrapperCol: wrapperCol,
117
+ vertical: layout === 'vertical',
118
+ colon: mergedColon,
119
+ requiredMark: mergedRequiredMark,
120
+ itemRef: __INTERNAL__.itemRef,
121
+ form: wrapForm,
122
+ readonly: readonly
123
+ };
124
+ }, [name, labelAlign, labelCol, labelWrap, wrapperCol, layout, mergedColon, mergedRequiredMark, wrapForm, readonly]);
125
+ React.useImperativeHandle(ref, function () {
126
+ return wrapForm;
127
+ });
128
+ var onInternalFinishFailed = function onInternalFinishFailed(errorInfo) {
129
+ onFinishFailed === null || onFinishFailed === void 0 ? void 0 : onFinishFailed(errorInfo);
130
+ var defaultScrollToFirstError = {
131
+ block: 'nearest'
132
+ };
133
+ if (scrollToFirstError && errorInfo.errorFields.length) {
134
+ if (_typeof(scrollToFirstError) === 'object') {
135
+ defaultScrollToFirstError = scrollToFirstError;
136
+ }
137
+ wrapForm.scrollToField(errorInfo.errorFields[0].name, defaultScrollToFirstError);
138
+ }
139
+ };
140
+ return React.createElement(_DisabledContext.DisabledContextProvider, {
141
+ disabled: disabled
142
+ }, React.createElement(_SizeContext.SizeContextProvider, {
143
+ size: size
144
+ }, React.createElement(_context.FormProvider, Object.assign({}, {
145
+ // This is not list in API, we pass with spread
146
+ validateMessages: contextValidateMessages
147
+ }), React.createElement(_context.FormContext.Provider, {
148
+ value: formContextValue
149
+ }, React.createElement(_rcFieldForm["default"], Object.assign({
150
+ id: name
151
+ }, restFormProps, {
152
+ name: name,
153
+ onFinishFailed: onInternalFinishFailed,
154
+ form: wrapForm,
155
+ className: formClassName
156
+ }))))));
157
+ };
158
+ var Form = React.forwardRef(InternalForm);
159
+ var _default = Form;
160
+ exports["default"] = _default;