tntd 2.7.2 → 2.7.4

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 (428) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +72 -0
  3. package/es/actions/index.js +12 -0
  4. package/es/actions/index.js.map +1 -0
  5. package/es/actions/index.less +70 -0
  6. package/es/affix/index.js +2 -1
  7. package/es/alert/index.js +2 -1
  8. package/es/anchor/index.js +2 -1
  9. package/es/array-input/icon.js +6 -24
  10. package/es/array-input/index.js +119 -203
  11. package/es/auth-context/index.js +2 -1
  12. package/es/auto-complete/index.js +2 -1
  13. package/es/avatar/index.js +2 -1
  14. package/es/back-top/index.js +2 -1
  15. package/es/badge/index.js +2 -1
  16. package/es/breadcrumb/index.js +2 -1
  17. package/es/button/index.js +2 -1
  18. package/es/calendar/index.js +2 -1
  19. package/es/card/index.js +2 -1
  20. package/es/carousel/index.js +2 -1
  21. package/es/cascader/index.js +2 -1
  22. package/es/check-card/group.js +149 -0
  23. package/es/check-card/group.js.map +1 -0
  24. package/es/check-card/index.js +120 -0
  25. package/es/check-card/index.js.map +1 -0
  26. package/es/check-card/index.less +179 -0
  27. package/es/checkbox/checkbox-group.js +2 -1
  28. package/es/checkbox/index.js +2 -1
  29. package/es/col/index.js +2 -1
  30. package/es/collapse/index.js +2 -1
  31. package/es/color-picker/ColorPicker.js +81 -127
  32. package/es/color-picker/ColorPicker.js.map +1 -1
  33. package/es/color-picker/index.js +5 -8
  34. package/es/color-picker/index.less +5 -1
  35. package/es/columns/index.js +30 -66
  36. package/es/columns/style/index.js +2 -1
  37. package/es/comment/index.js +2 -1
  38. package/es/config-provider/DisabledContext.js +5 -9
  39. package/es/config-provider/SizeContext.js +3 -7
  40. package/es/config-provider/config-provider.js +2 -1
  41. package/es/ellipsis/index.js +13 -3
  42. package/es/ellipsis/index.js.map +1 -1
  43. package/es/ellipsis/index.less +2 -2
  44. package/es/handle/index.js +20 -9
  45. package/es/handle/index.js.map +1 -1
  46. package/es/handle/index.less +1 -1
  47. package/es/index.js +7 -0
  48. package/es/index.js.map +1 -1
  49. package/es/index.less +5 -0
  50. package/es/locale/en_US.js +3 -1
  51. package/es/locale/en_US.js.map +1 -1
  52. package/es/locale/zh_CN.js +3 -1
  53. package/es/locale/zh_CN.js.map +1 -1
  54. package/es/mention/index.js +4 -0
  55. package/es/mention/index.js.map +1 -0
  56. package/es/page/Box.js +1 -1
  57. package/es/page/Box.js.map +1 -1
  58. package/es/page/index.js +2 -2
  59. package/es/page/index.js.map +1 -1
  60. package/es/page/index.less +5 -5
  61. package/es/prev-locale.js +1 -1
  62. package/es/prev-locale.js.map +1 -1
  63. package/es/query-form/Field/SelectInput.js +2 -2
  64. package/es/query-form/Field/SelectInput.js.map +1 -1
  65. package/es/query-form/Field/index.js +2 -1
  66. package/es/query-form/Field/index.js.map +1 -1
  67. package/es/query-list-scene/QueryForm.js +2 -2
  68. package/es/query-list-scene/QueryForm.js.map +1 -1
  69. package/es/segmented/index.js +50 -0
  70. package/es/segmented/index.js.map +1 -0
  71. package/es/segmented/index.less +138 -0
  72. package/es/switch/switch.js.map +1 -1
  73. package/es/table/constants.js +53 -0
  74. package/es/table/constants.js.map +1 -1
  75. package/es/table/context.js.map +1 -1
  76. package/es/table/hooks/use-column-setting.js.map +1 -1
  77. package/es/table/table.js +107 -6
  78. package/es/table/table.js.map +1 -1
  79. package/es/table/table.less +3 -1
  80. package/es/table/total-shower.js +6 -0
  81. package/es/table/total-shower.js.map +1 -0
  82. package/es/title/index.js +5 -5
  83. package/es/title/index.js.map +1 -1
  84. package/es/title/index.less +10 -10
  85. package/es/tntd-form/Form.js +13 -1
  86. package/es/tntd-form/Form.js.map +1 -1
  87. package/es/tntd-form/TntdForm/components/Item.js +42 -30
  88. package/es/tntd-form/TntdForm/components/ItemComp.js +167 -158
  89. package/es/tntd-form/TntdForm/components/List.js +89 -78
  90. package/es/tntd-form/TntdForm/index.js +38 -33
  91. package/es/tntd-form/TntdForm/interface.js +1 -2
  92. package/es/tntd-form/TntdForm/store.js +1 -2
  93. package/es/tntd-form/TntdForm/utils.js +158 -168
  94. package/es/tntd-form/tntd-form.stories.js +7 -5
  95. package/es/tntd-form/tntd-form.stories.js.map +1 -1
  96. package/es/tntd-layout/HeaderActions.js +1 -1
  97. package/es/tntd-layout/HeaderActions.js.map +1 -1
  98. package/es/tntd-modal/index.js +54 -21
  99. package/es/tntd-modal/index.js.map +1 -1
  100. package/es/tntd-modal/index.less +83 -63
  101. package/es/tree-select/index.js.map +1 -1
  102. package/es/utils/index.js +1 -0
  103. package/es/utils/index.js.map +1 -1
  104. package/es/utils/simple-template.js +11 -0
  105. package/es/utils/simple-template.js.map +1 -0
  106. package/es/water-mark/index.js +99 -0
  107. package/es/water-mark/index.js.map +1 -0
  108. package/lib/actions/index.d.ts +15 -0
  109. package/lib/actions/index.d.ts.map +1 -0
  110. package/lib/actions/index.js +17 -0
  111. package/lib/actions/index.js.map +1 -0
  112. package/lib/actions/index.less +70 -0
  113. package/lib/check-card/group.d.ts +130 -0
  114. package/lib/check-card/group.d.ts.map +1 -0
  115. package/lib/check-card/group.js +179 -0
  116. package/lib/check-card/group.js.map +1 -0
  117. package/lib/check-card/index.d.ts +136 -0
  118. package/lib/check-card/index.d.ts.map +1 -0
  119. package/lib/check-card/index.js +148 -0
  120. package/lib/check-card/index.js.map +1 -0
  121. package/lib/check-card/index.less +179 -0
  122. package/lib/color-picker/ColorPicker.js +1 -1
  123. package/lib/color-picker/ColorPicker.js.map +1 -1
  124. package/lib/color-picker/index.less +5 -1
  125. package/lib/ellipsis/index.d.ts.map +1 -1
  126. package/lib/ellipsis/index.js +13 -3
  127. package/lib/ellipsis/index.js.map +1 -1
  128. package/lib/ellipsis/index.less +2 -2
  129. package/lib/handle/index.d.ts.map +1 -1
  130. package/lib/handle/index.js +20 -9
  131. package/lib/handle/index.js.map +1 -1
  132. package/lib/handle/index.less +1 -1
  133. package/lib/index.d.ts +7 -0
  134. package/lib/index.d.ts.map +1 -1
  135. package/lib/index.js +11 -1
  136. package/lib/index.js.map +1 -1
  137. package/lib/index.less +5 -0
  138. package/lib/locale/default.d.ts +1 -0
  139. package/lib/locale/default.d.ts.map +1 -1
  140. package/lib/locale/en_US.d.ts +1 -0
  141. package/lib/locale/en_US.d.ts.map +1 -1
  142. package/lib/locale/en_US.js +3 -1
  143. package/lib/locale/en_US.js.map +1 -1
  144. package/lib/locale/zh_CN.d.ts +1 -0
  145. package/lib/locale/zh_CN.d.ts.map +1 -1
  146. package/lib/locale/zh_CN.js +3 -1
  147. package/lib/locale/zh_CN.js.map +1 -1
  148. package/lib/mention/index.js +25 -0
  149. package/lib/page/Box.js +1 -1
  150. package/lib/page/Box.js.map +1 -1
  151. package/lib/page/index.js +2 -2
  152. package/lib/page/index.js.map +1 -1
  153. package/lib/page/index.less +5 -5
  154. package/lib/prev-locale.js +1 -1
  155. package/lib/prev-locale.js.map +1 -1
  156. package/lib/query-form/Field/SelectInput.d.ts.map +1 -1
  157. package/lib/query-form/Field/SelectInput.js +2 -2
  158. package/lib/query-form/Field/SelectInput.js.map +1 -1
  159. package/lib/query-form/Field/index.d.ts.map +1 -1
  160. package/lib/query-form/Field/index.js +2 -1
  161. package/lib/query-form/Field/index.js.map +1 -1
  162. package/lib/query-list-scene/QueryForm.d.ts +1 -1
  163. package/lib/query-list-scene/QueryForm.d.ts.map +1 -1
  164. package/lib/query-list-scene/QueryForm.js +2 -2
  165. package/lib/query-list-scene/QueryForm.js.map +1 -1
  166. package/lib/segmented/index.d.ts +23 -0
  167. package/lib/segmented/index.d.ts.map +1 -0
  168. package/lib/segmented/index.js +78 -0
  169. package/lib/segmented/index.js.map +1 -0
  170. package/lib/segmented/index.less +138 -0
  171. package/lib/switch/switch.d.ts +1 -1
  172. package/lib/switch/switch.d.ts.map +1 -1
  173. package/lib/switch/switch.js.map +1 -1
  174. package/lib/table/constants.d.ts +2 -0
  175. package/lib/table/constants.d.ts.map +1 -1
  176. package/lib/table/constants.js +54 -1
  177. package/lib/table/constants.js.map +1 -1
  178. package/lib/table/context.d.ts +1 -0
  179. package/lib/table/context.d.ts.map +1 -1
  180. package/lib/table/context.js.map +1 -1
  181. package/lib/table/hooks/use-column-setting.d.ts +4 -1
  182. package/lib/table/hooks/use-column-setting.d.ts.map +1 -1
  183. package/lib/table/hooks/use-column-setting.js.map +1 -1
  184. package/lib/table/table.d.ts +2 -1
  185. package/lib/table/table.d.ts.map +1 -1
  186. package/lib/table/table.js +107 -6
  187. package/lib/table/table.js.map +1 -1
  188. package/lib/table/table.less +3 -1
  189. package/lib/table/total-shower.d.ts +9 -0
  190. package/lib/table/total-shower.d.ts.map +1 -0
  191. package/lib/table/total-shower.js +13 -0
  192. package/lib/table/total-shower.js.map +1 -0
  193. package/lib/title/index.d.ts +11 -1
  194. package/lib/title/index.d.ts.map +1 -1
  195. package/lib/title/index.js +5 -5
  196. package/lib/title/index.js.map +1 -1
  197. package/lib/title/index.less +10 -10
  198. package/lib/tntd-form/Form.d.ts.map +1 -1
  199. package/lib/tntd-form/Form.js +12 -0
  200. package/lib/tntd-form/Form.js.map +1 -1
  201. package/lib/tntd-form/TntdForm/components/Item.js +55 -61
  202. package/lib/tntd-form/TntdForm/components/ItemComp.js +203 -190
  203. package/lib/tntd-form/TntdForm/components/List.js +118 -111
  204. package/lib/tntd-form/TntdForm/index.js +61 -67
  205. package/lib/tntd-form/TntdForm/interface.js +4 -2
  206. package/lib/tntd-form/TntdForm/store.js +8 -7
  207. package/lib/tntd-form/TntdForm/utils.js +182 -184
  208. package/lib/tntd-form/tntd-form.stories.d.ts.map +1 -1
  209. package/lib/tntd-form/tntd-form.stories.js +7 -5
  210. package/lib/tntd-form/tntd-form.stories.js.map +1 -1
  211. package/lib/tntd-layout/HeaderActions.js +1 -1
  212. package/lib/tntd-layout/HeaderActions.js.map +1 -1
  213. package/lib/tntd-modal/index.d.ts +15 -2
  214. package/lib/tntd-modal/index.d.ts.map +1 -1
  215. package/lib/tntd-modal/index.js +58 -23
  216. package/lib/tntd-modal/index.js.map +1 -1
  217. package/lib/tntd-modal/index.less +83 -63
  218. package/lib/tree-select/index.d.ts +7 -5
  219. package/lib/tree-select/index.d.ts.map +1 -1
  220. package/lib/tree-select/index.js.map +1 -1
  221. package/lib/utils/index.d.ts +1 -0
  222. package/lib/utils/index.d.ts.map +1 -1
  223. package/lib/utils/index.js +1 -0
  224. package/lib/utils/index.js.map +1 -1
  225. package/lib/utils/simple-template.d.ts +9 -0
  226. package/lib/utils/simple-template.d.ts.map +1 -0
  227. package/lib/utils/simple-template.js +15 -0
  228. package/lib/utils/simple-template.js.map +1 -0
  229. package/lib/water-mark/index.d.ts +49 -0
  230. package/lib/water-mark/index.d.ts.map +1 -0
  231. package/lib/water-mark/index.js +129 -0
  232. package/lib/water-mark/index.js.map +1 -0
  233. package/package.json +21 -3
  234. package/es/_util/colors.js +0 -3
  235. package/es/_util/colors.js.map +0 -1
  236. package/es/_util/easings.js +0 -9
  237. package/es/_util/easings.js.map +0 -1
  238. package/es/_util/getDataOrAriaProps.js +0 -8
  239. package/es/_util/getDataOrAriaProps.js.map +0 -1
  240. package/es/_util/getScroll.js +0 -14
  241. package/es/_util/getScroll.js.map +0 -1
  242. package/es/_util/interopDefault.js +0 -5
  243. package/es/_util/interopDefault.js.map +0 -1
  244. package/es/_util/isNumeric.js +0 -4
  245. package/es/_util/isNumeric.js.map +0 -1
  246. package/es/_util/motion.js +0 -22
  247. package/es/_util/motion.js.map +0 -1
  248. package/es/_util/openAnimation.js +0 -51
  249. package/es/_util/openAnimation.js.map +0 -1
  250. package/es/_util/raf.js +0 -25
  251. package/es/_util/raf.js.map +0 -1
  252. package/es/_util/reactNode.js +0 -6
  253. package/es/_util/reactNode.js.map +0 -1
  254. package/es/_util/ref.js +0 -15
  255. package/es/_util/ref.js.map +0 -1
  256. package/es/_util/responsiveObserve.js +0 -82
  257. package/es/_util/responsiveObserve.js.map +0 -1
  258. package/es/_util/scrollTo.js +0 -29
  259. package/es/_util/scrollTo.js.map +0 -1
  260. package/es/_util/styleChecker.js +0 -12
  261. package/es/_util/styleChecker.js.map +0 -1
  262. package/es/_util/throttleByAnimationFrame.js +0 -40
  263. package/es/_util/throttleByAnimationFrame.js.map +0 -1
  264. package/es/_util/transButton.js +0 -103
  265. package/es/_util/transButton.js.map +0 -1
  266. package/es/_util/triggerEvent.js +0 -8
  267. package/es/_util/triggerEvent.js.map +0 -1
  268. package/es/_util/type.js +0 -3
  269. package/es/_util/type.js.map +0 -1
  270. package/es/_util/warning.js +0 -5
  271. package/es/_util/warning.js.map +0 -1
  272. package/es/_util/wave.js +0 -228
  273. package/es/_util/wave.js.map +0 -1
  274. package/es/config-provider/context.js +0 -41
  275. package/es/config-provider/context.js.map +0 -1
  276. package/es/tntd-form/__tests__/demo-extend.test.js +0 -3
  277. package/es/tntd-form/__tests__/demo-extend.test.js.map +0 -1
  278. package/es/tntd-form/__tests__/demo.test.js +0 -3
  279. package/es/tntd-form/__tests__/demo.test.js.map +0 -1
  280. package/es/tntd-form/__tests__/image.test.js +0 -5
  281. package/es/tntd-form/__tests__/image.test.js.map +0 -1
  282. package/es/tntd-form/__tests__/index.test.js +0 -957
  283. package/es/tntd-form/__tests__/index.test.js.map +0 -1
  284. package/es/tntd-form/__tests__/list-noStyle.test.js +0 -41
  285. package/es/tntd-form/__tests__/list-noStyle.test.js.map +0 -1
  286. package/es/tntd-form/__tests__/list.test.js +0 -164
  287. package/es/tntd-form/__tests__/list.test.js.map +0 -1
  288. package/es/tntd-form/__tests__/ref.test.js +0 -45
  289. package/es/tntd-form/__tests__/ref.test.js.map +0 -1
  290. package/es/tntd-form/__tests__/type.test.js +0 -74
  291. package/es/tntd-form/__tests__/type.test.js.map +0 -1
  292. package/lib/_util/colors.d.ts +0 -3
  293. package/lib/_util/colors.d.ts.map +0 -1
  294. package/lib/_util/colors.js +0 -7
  295. package/lib/_util/colors.js.map +0 -1
  296. package/lib/_util/easings.d.ts +0 -2
  297. package/lib/_util/easings.d.ts.map +0 -1
  298. package/lib/_util/easings.js +0 -14
  299. package/lib/_util/easings.js.map +0 -1
  300. package/lib/_util/getDataOrAriaProps.d.ts +0 -2
  301. package/lib/_util/getDataOrAriaProps.d.ts.map +0 -1
  302. package/lib/_util/getDataOrAriaProps.js +0 -13
  303. package/lib/_util/getDataOrAriaProps.js.map +0 -1
  304. package/lib/_util/getScroll.d.ts +0 -2
  305. package/lib/_util/getScroll.d.ts.map +0 -1
  306. package/lib/_util/getScroll.js +0 -18
  307. package/lib/_util/getScroll.js.map +0 -1
  308. package/lib/_util/interopDefault.d.ts +0 -2
  309. package/lib/_util/interopDefault.d.ts.map +0 -1
  310. package/lib/_util/interopDefault.js +0 -9
  311. package/lib/_util/interopDefault.js.map +0 -1
  312. package/lib/_util/isNumeric.d.ts +0 -3
  313. package/lib/_util/isNumeric.d.ts.map +0 -1
  314. package/lib/_util/isNumeric.js +0 -7
  315. package/lib/_util/isNumeric.js.map +0 -1
  316. package/lib/_util/motion.d.ts +0 -24
  317. package/lib/_util/motion.d.ts.map +0 -1
  318. package/lib/_util/motion.js +0 -17
  319. package/lib/_util/motion.js.map +0 -1
  320. package/lib/_util/openAnimation.d.ts +0 -7
  321. package/lib/_util/openAnimation.d.ts.map +0 -1
  322. package/lib/_util/openAnimation.js +0 -58
  323. package/lib/_util/openAnimation.js.map +0 -1
  324. package/lib/_util/raf.d.ts +0 -10
  325. package/lib/_util/raf.d.ts.map +0 -1
  326. package/lib/_util/raf.js +0 -34
  327. package/lib/_util/raf.js.map +0 -1
  328. package/lib/_util/reactNode.d.ts +0 -3
  329. package/lib/_util/reactNode.d.ts.map +0 -1
  330. package/lib/_util/reactNode.js +0 -31
  331. package/lib/_util/reactNode.js.map +0 -1
  332. package/lib/_util/ref.d.ts +0 -4
  333. package/lib/_util/ref.d.ts.map +0 -1
  334. package/lib/_util/ref.js +0 -22
  335. package/lib/_util/ref.js.map +0 -1
  336. package/lib/_util/responsiveObserve.d.ts +0 -14
  337. package/lib/_util/responsiveObserve.d.ts.map +0 -1
  338. package/lib/_util/responsiveObserve.js +0 -83
  339. package/lib/_util/responsiveObserve.js.map +0 -1
  340. package/lib/_util/scrollTo.d.ts +0 -11
  341. package/lib/_util/scrollTo.d.ts.map +0 -1
  342. package/lib/_util/scrollTo.js +0 -34
  343. package/lib/_util/scrollTo.js.map +0 -1
  344. package/lib/_util/styleChecker.d.ts +0 -4
  345. package/lib/_util/styleChecker.d.ts.map +0 -1
  346. package/lib/_util/styleChecker.js +0 -14
  347. package/lib/_util/styleChecker.js.map +0 -1
  348. package/lib/_util/throttleByAnimationFrame.d.ts +0 -6
  349. package/lib/_util/throttleByAnimationFrame.d.ts.map +0 -1
  350. package/lib/_util/throttleByAnimationFrame.js +0 -49
  351. package/lib/_util/throttleByAnimationFrame.js.map +0 -1
  352. package/lib/_util/transButton.d.ts +0 -21
  353. package/lib/_util/transButton.d.ts.map +0 -1
  354. package/lib/_util/transButton.js +0 -112
  355. package/lib/_util/transButton.js.map +0 -1
  356. package/lib/_util/triggerEvent.d.ts +0 -2
  357. package/lib/_util/triggerEvent.d.ts.map +0 -1
  358. package/lib/_util/triggerEvent.js +0 -12
  359. package/lib/_util/triggerEvent.js.map +0 -1
  360. package/lib/_util/type.d.ts +0 -4
  361. package/lib/_util/type.d.ts.map +0 -1
  362. package/lib/_util/type.js +0 -9
  363. package/lib/_util/type.js.map +0 -1
  364. package/lib/_util/warning.d.ts +0 -5
  365. package/lib/_util/warning.d.ts.map +0 -1
  366. package/lib/_util/warning.js +0 -28
  367. package/lib/_util/warning.js.map +0 -1
  368. package/lib/_util/wave.d.ts +0 -26
  369. package/lib/_util/wave.d.ts.map +0 -1
  370. package/lib/_util/wave.js +0 -249
  371. package/lib/_util/wave.js.map +0 -1
  372. package/lib/config-provider/context.d.ts +0 -61
  373. package/lib/config-provider/context.d.ts.map +0 -1
  374. package/lib/config-provider/context.js +0 -64
  375. package/lib/config-provider/context.js.map +0 -1
  376. package/lib/tntd-form/TntdForm/components/Item.d.ts +0 -5
  377. package/lib/tntd-form/TntdForm/components/Item.d.ts.map +0 -1
  378. package/lib/tntd-form/TntdForm/components/Item.js.map +0 -1
  379. package/lib/tntd-form/TntdForm/components/ItemComp.d.ts +0 -5
  380. package/lib/tntd-form/TntdForm/components/ItemComp.d.ts.map +0 -1
  381. package/lib/tntd-form/TntdForm/components/ItemComp.js.map +0 -1
  382. package/lib/tntd-form/TntdForm/components/List.d.ts +0 -5
  383. package/lib/tntd-form/TntdForm/components/List.d.ts.map +0 -1
  384. package/lib/tntd-form/TntdForm/components/List.js.map +0 -1
  385. package/lib/tntd-form/TntdForm/index.d.ts +0 -10
  386. package/lib/tntd-form/TntdForm/index.d.ts.map +0 -1
  387. package/lib/tntd-form/TntdForm/index.js.map +0 -1
  388. package/lib/tntd-form/TntdForm/interface.d.ts +0 -93
  389. package/lib/tntd-form/TntdForm/interface.d.ts.map +0 -1
  390. package/lib/tntd-form/TntdForm/interface.js.map +0 -1
  391. package/lib/tntd-form/TntdForm/store.d.ts +0 -4
  392. package/lib/tntd-form/TntdForm/store.d.ts.map +0 -1
  393. package/lib/tntd-form/TntdForm/store.js.map +0 -1
  394. package/lib/tntd-form/TntdForm/utils.d.ts +0 -48
  395. package/lib/tntd-form/TntdForm/utils.d.ts.map +0 -1
  396. package/lib/tntd-form/TntdForm/utils.js.map +0 -1
  397. package/lib/tntd-form/__tests__/demo-extend.test.d.ts +0 -2
  398. package/lib/tntd-form/__tests__/demo-extend.test.d.ts.map +0 -1
  399. package/lib/tntd-form/__tests__/demo-extend.test.js +0 -5
  400. package/lib/tntd-form/__tests__/demo-extend.test.js.map +0 -1
  401. package/lib/tntd-form/__tests__/demo.test.d.ts +0 -2
  402. package/lib/tntd-form/__tests__/demo.test.d.ts.map +0 -1
  403. package/lib/tntd-form/__tests__/demo.test.js +0 -8
  404. package/lib/tntd-form/__tests__/demo.test.js.map +0 -1
  405. package/lib/tntd-form/__tests__/image.test.d.ts +0 -2
  406. package/lib/tntd-form/__tests__/image.test.d.ts.map +0 -1
  407. package/lib/tntd-form/__tests__/image.test.js +0 -7
  408. package/lib/tntd-form/__tests__/image.test.js.map +0 -1
  409. package/lib/tntd-form/__tests__/index.test.d.ts +0 -2
  410. package/lib/tntd-form/__tests__/index.test.d.ts.map +0 -1
  411. package/lib/tntd-form/__tests__/index.test.js +0 -981
  412. package/lib/tntd-form/__tests__/index.test.js.map +0 -1
  413. package/lib/tntd-form/__tests__/list-noStyle.test.d.ts +0 -2
  414. package/lib/tntd-form/__tests__/list-noStyle.test.d.ts.map +0 -1
  415. package/lib/tntd-form/__tests__/list-noStyle.test.js +0 -46
  416. package/lib/tntd-form/__tests__/list-noStyle.test.js.map +0 -1
  417. package/lib/tntd-form/__tests__/list.test.d.ts +0 -2
  418. package/lib/tntd-form/__tests__/list.test.d.ts.map +0 -1
  419. package/lib/tntd-form/__tests__/list.test.js +0 -169
  420. package/lib/tntd-form/__tests__/list.test.js.map +0 -1
  421. package/lib/tntd-form/__tests__/ref.test.d.ts +0 -2
  422. package/lib/tntd-form/__tests__/ref.test.d.ts.map +0 -1
  423. package/lib/tntd-form/__tests__/ref.test.js +0 -50
  424. package/lib/tntd-form/__tests__/ref.test.js.map +0 -1
  425. package/lib/tntd-form/__tests__/type.test.d.ts +0 -2
  426. package/lib/tntd-form/__tests__/type.test.d.ts.map +0 -1
  427. package/lib/tntd-form/__tests__/type.test.js +0 -98
  428. package/lib/tntd-form/__tests__/type.test.js.map +0 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) rookie
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,72 @@
1
+ # 组件介绍
2
+ tntd是基于 TNT Design 设计体系的 React UI 组件库,主要用于研发企业级中后台产品。
3
+
4
+
5
+ ## 如何从 `tntd v1.0` 迁移到 `tntd v2.0`
6
+
7
+ ### 安装 `tntd` 最新版本
8
+
9
+ ```
10
+ npm install tntd
11
+ ```
12
+
13
+ ### 更改配置
14
+
15
+ 1. 添加 .babelrc 中的 import 插件配置,实现按需引入
16
+
17
+ ```diff title=".babelrc"
18
+ + [
19
+ + "import",
20
+ + {
21
+ + "libraryName": "tntd",
22
+ + libraryDirectory: 'es',
23
+ + },
24
+ + "tntd"
25
+ + ],
26
+ ```
27
+
28
+ 2. 更改 webpack.config.js 中的主题配置
29
+
30
+ ```diff title="webpack.config.js"
31
+ {
32
+ loader: "less-loader",
33
+ options: {
34
+ javascriptEnabled: true,
35
+ ...
36
+ modifyVars: {
37
+ - hack: "true; @import \"~@tntd/antd-cover/tnt.less\";"
38
+ + hack: "true; @import \"~tntd/themes/default/variables.less\";"
39
+ }
40
+ }
41
+ }
42
+ ```
43
+
44
+ 3. 修改导入名称
45
+
46
+ Layout, Icon, Select 等 tntd 1.0 组件和 antd 组件名称存在冲突,请按下方例子进行重命名:
47
+
48
+ ```diff
49
+ - import { Layout, Icon, Select } from 'tntd'
50
+ + import { TntdLayout, TntdIcon, TntdSelect } from 'tntd'
51
+ ```
52
+
53
+ 4. 更改配置
54
+
55
+ ```jsx
56
+ // 使用全新的空状态插画
57
+ import { renderEmpty } from 'tntd'
58
+ // 使用内置语言包替换 antd
59
+ // 英文语言包
60
+ const enUS = import 'tntd/es/locale/en_US'
61
+ // 中文语言包
62
+ const zhCN = import 'tntd/es/locale/zh_CN'
63
+
64
+ export const App = () => {
65
+ return (
66
+ // 使用空状态插画及语言包
67
+ <ConfigProvider locale={zhCN} renderEmpty={renderEmpty}>
68
+ ...
69
+ </ConfigProvider>
70
+ )
71
+ }
72
+ ```
@@ -0,0 +1,12 @@
1
+ import classNames from 'classnames';
2
+ import React from 'react';
3
+ import './index.less';
4
+ const ProCardActions = (props) => {
5
+ const { actions, prefixCls } = props;
6
+ if (Array.isArray(actions) && (actions === null || actions === void 0 ? void 0 : actions.length)) {
7
+ return (React.createElement("ul", { className: classNames(`${prefixCls}-actions`) }, actions.map((action, index) => (React.createElement("li", { style: { width: `${100 / actions.length}%`, padding: 0, margin: 0 }, key: `action-${index}`, className: classNames(`${prefixCls}-actions-item`) }, action)))));
8
+ }
9
+ return React.createElement("ul", { className: classNames(`${prefixCls}-actions`) }, actions);
10
+ };
11
+ export default ProCardActions;
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/actions/index.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,cAAc,CAAA;AAarB,MAAM,cAAc,GAAkC,CAAC,KAAK,EAAE,EAAE;IAC9D,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,KAAK,CAAA;IAEpC,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,KAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,CAAA,EAAE;QAC7C,OAAO,CACL,4BAAI,SAAS,EAAE,UAAU,CAAC,GAAG,SAAS,UAAU,CAAC,IAC9C,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAC9B,4BACE,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,GAAG,GAAG,OAAO,CAAC,MAAM,GAAG,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EACnE,GAAG,EAAE,UAAU,KAAK,EAAE,EACtB,SAAS,EAAE,UAAU,CAAC,GAAG,SAAS,eAAe,CAAC,IAEjD,MAAM,CACJ,CACN,CAAC,CACC,CACN,CAAA;KACF;IACD,OAAO,4BAAI,SAAS,EAAE,UAAU,CAAC,GAAG,SAAS,UAAU,CAAC,IAAG,OAAO,CAAM,CAAA;AAC1E,CAAC,CAAA;AAED,eAAe,cAAc,CAAA","sourcesContent":["import classNames from 'classnames'\nimport React from 'react'\nimport './index.less'\n\nexport interface ProCardActionsProps {\n /**\n * 自定义前缀\n *\n * @ignore\n */\n prefixCls?: string\n /** 操作按钮 */\n actions?: React.ReactNode[] | React.ReactNode\n}\n\nconst ProCardActions: React.FC<ProCardActionsProps> = (props) => {\n const { actions, prefixCls } = props\n\n if (Array.isArray(actions) && actions?.length) {\n return (\n <ul className={classNames(`${prefixCls}-actions`)}>\n {actions.map((action, index) => (\n <li\n style={{ width: `${100 / actions.length}%`, padding: 0, margin: 0 }}\n key={`action-${index}`}\n className={classNames(`${prefixCls}-actions-item`)}\n >\n {action}\n </li>\n ))}\n </ul>\n )\n }\n return <ul className={classNames(`${prefixCls}-actions`)}>{actions}</ul>\n}\n\nexport default ProCardActions\n"]}
@@ -0,0 +1,70 @@
1
+ .tntd-card-actions {
2
+ margin-block:0;
3
+ margin-inline:0;
4
+ padding-block:0;
5
+ padding-inline:0;
6
+ list-style:none;
7
+ display:flex;
8
+ gap:8px;
9
+ background:#ffffff;
10
+ border-block-start:1px solid rgba(5,5,5,0.06);
11
+ min-height:42px;
12
+ }
13
+ .tntd-card-actions>* {
14
+ align-items:center;
15
+ justify-content:center;
16
+ flex:1;
17
+ display:flex;
18
+ cursor:pointer;
19
+ color:rgba(42,46,54,0.65);
20
+ transition:color 0.3s;
21
+ }
22
+ .tntd-card-actions>*:hover {
23
+ color:#468fff;
24
+ }
25
+ .tntd-card-actions>li>div {
26
+ flex:1;
27
+ width:100%;
28
+ margin-block:12px;
29
+ margin-inline:0;
30
+ color:rgba(42,46,54,0.65);
31
+ text-align:center;
32
+ }
33
+ .tntd-card-actions>li>div a {
34
+ color:rgba(42,46,54,0.65);
35
+ transition:color 0.3s;
36
+ }
37
+ .tntd-card-actions>li>div a:hover {
38
+ color:#468fff;
39
+ }
40
+ .tntd-card-actions>li>div div {
41
+ position:relative;
42
+ display:block;
43
+ min-width:32px;
44
+ font-size:14px;
45
+ line-height:1.5714285714285714;
46
+ cursor:pointer;
47
+ }
48
+ .tntd-card-actions>li>div div:hover {
49
+ color:#468fff;
50
+ transition:color 0.3s;
51
+ }
52
+ .tntd-card-actions>li>div div a:not(.ant-btn),
53
+ .tntd-card-actions>li>div div >.anticon {
54
+ display:inline-block;
55
+ width:100%;
56
+ color:rgba(42,46,54,0.65);
57
+ line-height:22px;
58
+ transition:color 0.3s;
59
+ }
60
+ .tntd-card-actions>li>div div a:not(.ant-btn):hover,
61
+ .tntd-card-actions>li>div div >.anticon:hover {
62
+ color:#468fff;
63
+ }
64
+ .tntd-card-actions>li>div div .anticon {
65
+ font-size:16px;
66
+ line-height:22px;
67
+ }
68
+ .tntd-card-actions>li>div:not(:last-child) {
69
+ border-inline-end:1px solid rgba(5,5,5,0.06);
70
+ }
package/es/affix/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import Affix from 'antd/es/affix';
2
2
  import 'antd/es/affix/style';
3
3
  export * from 'antd/es/affix';
4
- export default Affix;
4
+ export default Affix;
5
+ //# sourceMappingURL=index.js.map
package/es/alert/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import Alert from 'antd/es/alert';
2
2
  import 'antd/es/alert/style';
3
3
  export * from 'antd/es/alert';
4
- export default Alert;
4
+ export default Alert;
5
+ //# sourceMappingURL=index.js.map
@@ -1,4 +1,5 @@
1
1
  import Anchor from 'antd/es/anchor';
2
2
  import 'antd/es/anchor/style';
3
3
  export * from 'antd/es/anchor';
4
- export default Anchor;
4
+ export default Anchor;
5
+ //# sourceMappingURL=index.js.map
@@ -1,25 +1,7 @@
1
1
  import React from 'react';
2
- export const plusIcon = React.createElement("svg", {
3
- viewBox: "64 64 896 896",
4
- focusable: "false",
5
- "data-icon": "plus-circle",
6
- width: "1em",
7
- height: "1em",
8
- fill: "currentColor",
9
- "aria-hidden": "true"
10
- }, React.createElement("path", {
11
- d: "M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"
12
- }), React.createElement("path", {
13
- d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
14
- }));
15
- export const deleteIcon = React.createElement("svg", {
16
- viewBox: "64 64 896 896",
17
- focusable: "false",
18
- "data-icon": "delete",
19
- width: "1em",
20
- height: "1em",
21
- fill: "currentColor",
22
- "aria-hidden": "true"
23
- }, React.createElement("path", {
24
- d: "M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"
25
- }));
2
+ export const plusIcon = (React.createElement("svg", { viewBox: "64 64 896 896", focusable: "false", "data-icon": "plus-circle", width: "1em", height: "1em", fill: "currentColor", "aria-hidden": "true" },
3
+ React.createElement("path", { d: "M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z" }),
4
+ React.createElement("path", { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" })));
5
+ export const deleteIcon = (React.createElement("svg", { viewBox: "64 64 896 896", focusable: "false", "data-icon": "delete", width: "1em", height: "1em", fill: "currentColor", "aria-hidden": "true" },
6
+ React.createElement("path", { d: "M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z" })));
7
+ //# sourceMappingURL=icon.js.map
@@ -1,17 +1,15 @@
1
- import _sumBy from "lodash/sumBy";
2
- import _sum from "lodash/sum";
3
- import _set from "lodash/set";
4
- import _isFunction from "lodash/isFunction";
5
- import _isArray from "lodash/isArray";
6
- import _get from "lodash/get";
7
- var __rest = this && this.__rest || function (s, e) {
8
- var t = {};
9
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
10
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
11
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
12
- }
13
- return t;
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
14
11
  };
12
+ import { get, isArray, isFunction, set, sum, sumBy } from 'lodash';
15
13
  import React, { isValidElement, useCallback, useEffect, useState } from 'react';
16
14
  import { deleteIcon, plusIcon } from './icon';
17
15
  import Col from '../col';
@@ -19,198 +17,116 @@ import Row from '../row';
19
17
  import Table from '../table';
20
18
  import Tooltip from '../tooltip';
21
19
  import './index.less';
22
- const {
23
- Column
24
- } = Table;
25
- const getWidth = span => 1000 / span;
26
- export default function ArrayInput({
27
- children,
28
- defaultValue,
29
- value,
30
- onChange,
31
- mode = 'list',
32
- gutter = 10,
33
- require = false,
34
- deleteTip = '',
35
- plusTip = '',
36
- addText = '添加'
37
- }) {
38
- if (!_isFunction(children)) {
39
- throw new Error('ArrayInput的children必须是函数');
40
- }
41
- const [_value, setValue] = useState(value || defaultValue);
42
- useEffect(() => {
43
- setValue(value);
44
- }, [value]);
45
- const _onChange = useCallback(value => {
46
- if (onChange) {
47
- onChange(value);
48
- } else {
49
- setValue(value);
20
+ const { Column } = Table;
21
+ const getWidth = (span) => 1000 / span;
22
+ export default function ArrayInput({ children, defaultValue, value, onChange, mode = 'list', gutter = 10, require = false, deleteTip = '', plusTip = '', addText = '添加', }) {
23
+ if (!isFunction(children)) {
24
+ throw new Error('ArrayInput的children必须是函数');
50
25
  }
51
- }, []);
52
- let inValue = _value || [];
53
- if (require && inValue.length === 0) {
54
- inValue = [{}];
55
- }
56
- const changeValue = (index, name, value) => {
57
- inValue[index] = Object.assign(Object.assign({}, inValue[index]), {
58
- [name]: value
59
- });
60
- _onChange([...inValue]);
61
- };
62
- const onAdd = index => {
63
- if (index === undefined) {
64
- _onChange([...inValue, {}]);
65
- } else {
66
- inValue.splice(index + 1, 0, {});
67
- _onChange([...inValue]);
26
+ const [_value, setValue] = useState(value || defaultValue);
27
+ useEffect(() => {
28
+ setValue(value);
29
+ }, [value]);
30
+ const _onChange = useCallback((value) => {
31
+ if (onChange) {
32
+ onChange(value);
33
+ }
34
+ else {
35
+ setValue(value);
36
+ }
37
+ }, []);
38
+ let inValue = _value || [];
39
+ if (require && inValue.length === 0) {
40
+ inValue = [{}];
68
41
  }
69
- };
70
- const onDelete = i => {
71
- inValue.splice(i, 1);
72
- _onChange([...inValue]);
73
- };
74
- if (mode === 'list') {
75
- return React.createElement("div", {
76
- className: "tntd-array-input"
77
- }, inValue.map((item, index) => {
78
- let fields = children(item, index);
79
- if (!_isArray(fields)) {
80
- fields = _get(fields, 'props.children', []);
81
- }
82
- return React.createElement(Row, {
83
- gutter: gutter,
84
- key: index,
85
- className: "tntd-array-input-item"
86
- }, fields.map((field, i) => {
87
- if (!isValidElement(field)) {
88
- return field ? React.createElement(Col, {
89
- span: 4,
90
- key: i
91
- }, field) : '';
42
+ const changeValue = (index, name, value) => {
43
+ inValue[index] = Object.assign(Object.assign({}, inValue[index]), { [name]: value });
44
+ _onChange([...inValue]);
45
+ };
46
+ const onAdd = (index) => {
47
+ if (index === undefined) {
48
+ _onChange([...inValue, {}]);
92
49
  }
93
- const _a = field === null || field === void 0 ? void 0 : field.props,
94
- {
95
- name,
96
- span = 4,
97
- onChange: fieldChange
98
- } = _a,
99
- other = __rest(_a, ["name", "span", "onChange"]);
100
- return React.createElement(Col, {
101
- span: span,
102
- key: i
103
- }, React.cloneElement(field, Object.assign({
104
- value: item[name] || undefined,
105
- onChange: e => {
106
- fieldChange && fieldChange(e, index, changeValue);
107
- const newValue = e.target ? e.target.value : e;
108
- changeValue(index, name, newValue);
109
- }
110
- }, other)));
111
- }), React.createElement(Col, {
112
- span: 24 - _sum(fields.map(f => _get(f, 'props.span', 4))) % 24
113
- }, React.createElement("span", {
114
- className: "tntd-array-input-action"
115
- }, plusTip ? React.createElement(Tooltip, {
116
- title: plusTip,
117
- placement: "left"
118
- }, React.createElement("span", {
119
- className: "mr10",
120
- onClick: () => onAdd(index)
121
- }, plusIcon)) : React.createElement("span", {
122
- className: "mr10",
123
- onClick: () => onAdd(index)
124
- }, plusIcon), deleteTip ? React.createElement(Tooltip, {
125
- title: deleteTip,
126
- placement: "right"
127
- }, React.createElement("span", {
128
- onClick: () => onDelete(index)
129
- }, deleteIcon)) : React.createElement("span", {
130
- onClick: () => onDelete(index)
131
- }, deleteIcon))));
132
- }), inValue.length === 0 && React.createElement("a", {
133
- onClick: () => onAdd()
134
- }, addText));
135
- } else {
136
- let fields = children({}, 0);
137
- if (!_isArray(fields)) {
138
- fields = _get(fields, 'props.children', []);
50
+ else {
51
+ inValue.splice(index + 1, 0, {});
52
+ _onChange([...inValue]);
53
+ }
54
+ };
55
+ const onDelete = (i) => {
56
+ inValue.splice(i, 1);
57
+ _onChange([...inValue]);
58
+ };
59
+ if (mode === 'list') {
60
+ return (React.createElement("div", { className: "tntd-array-input" },
61
+ inValue.map((item, index) => {
62
+ let fields = children(item, index);
63
+ if (!isArray(fields)) {
64
+ fields = get(fields, 'props.children', []);
65
+ }
66
+ return (React.createElement(Row, { gutter: gutter, key: index, className: "tntd-array-input-item" },
67
+ fields.map((field, i) => {
68
+ if (!isValidElement(field)) {
69
+ return field ? (React.createElement(Col, { span: 4, key: i }, field)) : ('');
70
+ }
71
+ const _a = field === null || field === void 0 ? void 0 : field.props, { name, span = 4, onChange: fieldChange } = _a, other = __rest(_a, ["name", "span", "onChange"]);
72
+ return (React.createElement(Col, { span: span, key: i }, React.cloneElement(field, Object.assign({ value: item[name] || undefined, onChange: (e) => {
73
+ fieldChange && fieldChange(e, index, changeValue);
74
+ const newValue = e.target ? e.target.value : e;
75
+ changeValue(index, name, newValue);
76
+ } }, other))));
77
+ }),
78
+ React.createElement(Col, { span: 24 - (sum(fields.map((f) => get(f, 'props.span', 4))) % 24) },
79
+ React.createElement("span", { className: "tntd-array-input-action" },
80
+ plusTip ? (React.createElement(Tooltip, { title: plusTip, placement: "left" },
81
+ React.createElement("span", { className: "mr10", onClick: () => onAdd(index) }, plusIcon))) : (React.createElement("span", { className: "mr10", onClick: () => onAdd(index) }, plusIcon)),
82
+ deleteTip ? (React.createElement(Tooltip, { title: deleteTip, placement: "right" },
83
+ React.createElement("span", { onClick: () => onDelete(index) }, deleteIcon))) : (React.createElement("span", { onClick: () => onDelete(index) }, deleteIcon))))));
84
+ }),
85
+ inValue.length === 0 && React.createElement("a", { onClick: () => onAdd() }, addText)));
139
86
  }
140
- const dataSource = inValue.map((value, index) => {
141
- const fields = children(value, index);
142
- const back = {};
143
- fields.forEach(field => {
144
- var _a;
145
- const name = (_a = field === null || field === void 0 ? void 0 : field.props) === null || _a === void 0 ? void 0 : _a.name;
146
- name && _set(back, name, field);
147
- });
148
- return back;
149
- });
150
- return React.createElement("div", {
151
- className: "tntd-array-input"
152
- }, React.createElement(Table, {
153
- dataSource: dataSource,
154
- pagination: false,
155
- locale: {
156
- emptyText: React.createElement("a", {
157
- onClick: () => onAdd()
158
- }, addText)
159
- }
160
- }, fields.map(field => {
161
- const {
162
- name,
163
- span,
164
- title
165
- } = (field === null || field === void 0 ? void 0 : field.props) || {};
166
- return React.createElement(Column, {
167
- key: name,
168
- dataIndex: name,
169
- title: title,
170
- width: getWidth(span || 24 / (fields.length + 1)),
171
- render: (field, row, index) => {
172
- if (!isValidElement(field)) {
173
- return field;
174
- }
175
- const {
176
- onChange: fieldChange
177
- } = field.props;
178
- return React.cloneElement(field, {
179
- value: inValue[index][name] || undefined,
180
- onChange: e => {
181
- fieldChange && fieldChange(e, index, changeValue);
182
- const newValue = e.target ? e.target.value : e;
183
- changeValue(index, name, newValue);
184
- }
185
- });
87
+ else {
88
+ let fields = children({}, 0);
89
+ if (!isArray(fields)) {
90
+ fields = get(fields, 'props.children', []);
186
91
  }
187
- });
188
- }), React.createElement(Column, {
189
- key: "action",
190
- dataIndex: "action",
191
- title: "\u64CD\u4F5C",
192
- width: getWidth(24 - _sumBy(fields, 'props.span') % 24),
193
- render: (text, row, index) => {
194
- return React.createElement("span", {
195
- className: "tntd-array-input-action"
196
- }, plusTip ? React.createElement(Tooltip, {
197
- title: plusTip,
198
- placement: "left"
199
- }, React.createElement("span", {
200
- className: "mr10",
201
- onClick: () => onAdd(index)
202
- }, plusIcon)) : React.createElement("span", {
203
- className: "mr10",
204
- onClick: () => onAdd(index)
205
- }, plusIcon), deleteTip ? React.createElement(Tooltip, {
206
- title: deleteTip,
207
- placement: "right"
208
- }, React.createElement("span", {
209
- onClick: () => onDelete(index)
210
- }, deleteIcon)) : React.createElement("span", {
211
- onClick: () => onDelete(index)
212
- }, deleteIcon));
213
- }
214
- })));
215
- }
216
- }
92
+ const dataSource = inValue.map((value, index) => {
93
+ const fields = children(value, index);
94
+ const back = {};
95
+ fields.forEach((field) => {
96
+ var _a;
97
+ const name = (_a = field === null || field === void 0 ? void 0 : field.props) === null || _a === void 0 ? void 0 : _a.name;
98
+ name && set(back, name, field);
99
+ });
100
+ return back;
101
+ });
102
+ return (React.createElement("div", { className: "tntd-array-input" },
103
+ React.createElement(Table, { dataSource: dataSource, pagination: false, locale: {
104
+ emptyText: React.createElement("a", { onClick: () => onAdd() }, addText),
105
+ } },
106
+ fields.map((field) => {
107
+ const { name, span, title } = (field === null || field === void 0 ? void 0 : field.props) || {};
108
+ return (React.createElement(Column, { key: name, dataIndex: name, title: title, width: getWidth(span || 24 / (fields.length + 1)), render: (field, row, index) => {
109
+ if (!isValidElement(field)) {
110
+ return field;
111
+ }
112
+ const { onChange: fieldChange } = field.props;
113
+ return React.cloneElement(field, {
114
+ value: inValue[index][name] || undefined,
115
+ onChange: (e) => {
116
+ fieldChange && fieldChange(e, index, changeValue);
117
+ const newValue = e.target ? e.target.value : e;
118
+ changeValue(index, name, newValue);
119
+ },
120
+ });
121
+ } }));
122
+ }),
123
+ React.createElement(Column, { key: "action", dataIndex: "action", title: "\u64CD\u4F5C", width: getWidth(24 - (sumBy(fields, 'props.span') % 24)), render: (text, row, index) => {
124
+ return (React.createElement("span", { className: "tntd-array-input-action" },
125
+ plusTip ? (React.createElement(Tooltip, { title: plusTip, placement: "left" },
126
+ React.createElement("span", { className: "mr10", onClick: () => onAdd(index) }, plusIcon))) : (React.createElement("span", { className: "mr10", onClick: () => onAdd(index) }, plusIcon)),
127
+ deleteTip ? (React.createElement(Tooltip, { title: deleteTip, placement: "right" },
128
+ React.createElement("span", { onClick: () => onDelete(index) }, deleteIcon))) : (React.createElement("span", { onClick: () => onDelete(index) }, deleteIcon))));
129
+ } }))));
130
+ }
131
+ }
132
+ //# sourceMappingURL=index.js.map
@@ -1,2 +1,3 @@
1
1
  import { createContext } from 'react';
2
- export default createContext(() => true);
2
+ export default createContext(() => true);
3
+ //# sourceMappingURL=index.js.map
@@ -1,4 +1,5 @@
1
1
  import AutoComplete from 'antd/es/auto-complete';
2
2
  import 'antd/es/auto-complete/style';
3
3
  export * from 'antd/es/auto-complete';
4
- export default AutoComplete;
4
+ export default AutoComplete;
5
+ //# sourceMappingURL=index.js.map
@@ -1,4 +1,5 @@
1
1
  import Avatar from 'antd/es/avatar';
2
2
  import 'antd/es/avatar/style';
3
3
  export * from 'antd/es/avatar';
4
- export default Avatar;
4
+ export default Avatar;
5
+ //# sourceMappingURL=index.js.map
@@ -1,4 +1,5 @@
1
1
  import BackTop from 'antd/es/back-top';
2
2
  import 'antd/es/back-top/style';
3
3
  export * from 'antd/es/back-top';
4
- export default BackTop;
4
+ export default BackTop;
5
+ //# sourceMappingURL=index.js.map
package/es/badge/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import Badge from 'antd/es/badge';
2
2
  import 'antd/es/badge/style';
3
3
  export * from 'antd/es/badge';
4
- export default Badge;
4
+ export default Badge;
5
+ //# sourceMappingURL=index.js.map
@@ -1,4 +1,5 @@
1
1
  import Breadcrumb from 'antd/es/breadcrumb';
2
2
  import 'antd/es/breadcrumb/style';
3
3
  export * from 'antd/es/breadcrumb';
4
- export default Breadcrumb;
4
+ export default Breadcrumb;
5
+ //# sourceMappingURL=index.js.map
@@ -1,4 +1,5 @@
1
1
  import Button from 'antd/es/button';
2
2
  import 'antd/es/button/style';
3
3
  export * from 'antd/es/button';
4
- export default Button;
4
+ export default Button;
5
+ //# sourceMappingURL=index.js.map
@@ -1,4 +1,5 @@
1
1
  import Calendar from 'antd/es/calendar';
2
2
  import 'antd/es/calendar/style';
3
3
  export * from 'antd/es/calendar';
4
- export default Calendar;
4
+ export default Calendar;
5
+ //# sourceMappingURL=index.js.map