tntd 3.0.0-beta.2 → 3.0.0-beta.21

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 (373) hide show
  1. package/es/alert/alert.js +5 -4
  2. package/es/alert/alert.js.map +1 -1
  3. package/es/array-input/index.js +57 -42
  4. package/es/array-input/index.js.map +1 -1
  5. package/es/array-input/index.less +4 -1
  6. package/es/button/button.less +17 -12
  7. package/es/cascader/cascader.js +30 -0
  8. package/es/cascader/cascader.js.map +1 -0
  9. package/es/cascader/cascader.less +16 -0
  10. package/es/cascader/index.js +3 -6
  11. package/es/cascader/index.js.map +1 -1
  12. package/es/check-card/index.js +2 -3
  13. package/es/check-card/index.js.map +1 -1
  14. package/es/checkbox/checkbox.js +5 -5
  15. package/es/checkbox/checkbox.js.map +1 -1
  16. package/es/collapse/collapse.less +3 -3
  17. package/es/color-picker/ColorPicker.js +4 -6
  18. package/es/color-picker/ColorPicker.js.map +1 -1
  19. package/es/descriptions/descriptions.js +35 -17
  20. package/es/descriptions/descriptions.js.map +1 -1
  21. package/es/descriptions/descriptions.less +6 -2
  22. package/es/descriptions/style/index.less +1 -0
  23. package/es/drawer/drawer.js +34 -24
  24. package/es/drawer/drawer.js.map +1 -1
  25. package/es/drawer/index.less +8 -12
  26. package/es/drawer/style/drawer.less +2 -4
  27. package/es/form/form.js +5 -3
  28. package/es/form/form.js.map +1 -1
  29. package/es/form/form.less +12 -6
  30. package/es/form/style/index.less +6 -6
  31. package/es/handle/index.js +9 -6
  32. package/es/handle/index.js.map +1 -1
  33. package/es/handle/index.less +16 -0
  34. package/es/handle-icon/index.js +201 -0
  35. package/es/handle-icon/index.js.map +1 -0
  36. package/es/handle-icon/index.less +53 -0
  37. package/es/icon/style/style.less +1 -1
  38. package/es/index.js +5 -0
  39. package/es/index.js.map +1 -1
  40. package/es/input/input.js +10 -6
  41. package/es/input/input.js.map +1 -1
  42. package/es/input/style/mixin.less +2 -3
  43. package/es/locale/en_US.js +6 -0
  44. package/es/locale/en_US.js.map +1 -1
  45. package/es/locale/zh_CN.js +6 -0
  46. package/es/locale/zh_CN.js.map +1 -1
  47. package/es/modal/style/confirm.less +6 -10
  48. package/es/modal/style/modal.less +1 -1
  49. package/es/page-container/index.js +13 -0
  50. package/es/page-container/index.js.map +1 -0
  51. package/es/page-container/index.less +38 -0
  52. package/es/page-loading/index.js +29 -0
  53. package/es/page-loading/index.js.map +1 -0
  54. package/es/page-loading/index.less +38 -0
  55. package/es/page-loading/loading.gif +0 -0
  56. package/es/query-form/index.js +125 -109
  57. package/es/query-form/index.js.map +1 -1
  58. package/es/query-form/index.less +9 -12
  59. package/es/{query-form → query-form-backup}/Field/Composition/index.less +11 -3
  60. package/es/query-form-backup/index.less +90 -0
  61. package/es/query-list-scene/QueryForm.js +1 -3
  62. package/es/query-list-scene/QueryForm.js.map +1 -1
  63. package/es/query-list-scene/index.less +3 -3
  64. package/es/radio/radio.js +4 -4
  65. package/es/radio/radio.js.map +1 -1
  66. package/es/select/select.js +5 -3
  67. package/es/select/select.js.map +1 -1
  68. package/es/select/select.less +1 -1
  69. package/es/select/style/index.less +4 -4
  70. package/es/style/themes/default.less +3 -3
  71. package/es/table/expand.less +49 -0
  72. package/es/table/hooks/index.js +2 -1
  73. package/es/table/hooks/index.js.map +1 -1
  74. package/es/table/hooks/use-expand-fixed.js +78 -0
  75. package/es/table/hooks/use-expand-fixed.js.map +1 -0
  76. package/es/table/index.js +1 -0
  77. package/es/table/index.js.map +1 -1
  78. package/es/table/style/index.less +61 -68
  79. package/es/table/style/size.less +4 -4
  80. package/es/table/table.js +49 -15
  81. package/es/table/table.js.map +1 -1
  82. package/es/table/table.less +13 -22
  83. package/es/table/table.stories.js +413 -2
  84. package/es/table/table.stories.js.map +1 -1
  85. package/es/table/utils.js +11 -0
  86. package/es/table/utils.js.map +1 -1
  87. package/es/table-container/index.js +15 -0
  88. package/es/table-container/index.js.map +1 -0
  89. package/es/table-container/index.less +16 -0
  90. package/es/tabs/tabs.less +23 -25
  91. package/es/tabs-container/index.js +13 -0
  92. package/es/tabs-container/index.js.map +1 -0
  93. package/es/tabs-container/index.less +51 -0
  94. package/es/tag/color.less +28 -18
  95. package/es/tag/index.js +1 -1
  96. package/es/tag/index.js.map +1 -1
  97. package/es/tag/tag.less +41 -5
  98. package/es/title/index.js +4 -3
  99. package/es/title/index.js.map +1 -1
  100. package/es/tntd-action/Action.js +60 -13
  101. package/es/tntd-action/Action.js.map +1 -1
  102. package/es/tntd-action/index.js +5 -5
  103. package/es/tntd-action/index.js.map +1 -1
  104. package/es/tntd-action/index.less +5 -3
  105. package/es/tntd-cascader/AntdCascader/component/getIcons.js +7 -8
  106. package/es/tntd-cascader/AntdCascader/component/getIcons.js.map +1 -1
  107. package/es/tntd-cascader/AntdCascader/index.js +4 -5
  108. package/es/tntd-cascader/AntdCascader/index.js.map +1 -1
  109. package/es/tntd-form/FormItem/ItemHolder.js +1 -6
  110. package/es/tntd-form/FormItem/ItemHolder.js.map +1 -1
  111. package/es/tntd-rc-select/_util/getIcons.js +7 -8
  112. package/es/tntd-rc-select/_util/getIcons.js.map +1 -1
  113. package/es/tntd-select/index.js +9 -8
  114. package/es/tntd-select/index.js.map +1 -1
  115. package/es/tntd-select/index.less +7 -0
  116. package/es/tooltip/index.js +1 -0
  117. package/es/tooltip/index.js.map +1 -1
  118. package/es/tooltip/index.less +1 -2
  119. package/lib/alert/alert.d.ts.map +1 -1
  120. package/lib/alert/alert.js +4 -3
  121. package/lib/alert/alert.js.map +1 -1
  122. package/lib/array-input/index.d.ts +1 -12
  123. package/lib/array-input/index.d.ts.map +1 -1
  124. package/lib/array-input/index.js +62 -55
  125. package/lib/array-input/index.js.map +1 -1
  126. package/lib/array-input/index.less +4 -1
  127. package/lib/button/button.less +17 -12
  128. package/lib/cascader/cascader.d.ts +10 -0
  129. package/lib/cascader/cascader.d.ts.map +1 -0
  130. package/lib/cascader/cascader.js +49 -0
  131. package/lib/cascader/cascader.js.map +1 -0
  132. package/lib/cascader/cascader.less +16 -0
  133. package/lib/cascader/index.d.ts +3 -7
  134. package/lib/cascader/index.d.ts.map +1 -1
  135. package/lib/cascader/index.js +5 -10
  136. package/lib/cascader/index.js.map +1 -1
  137. package/lib/check-card/index.js +1 -2
  138. package/lib/check-card/index.js.map +1 -1
  139. package/lib/checkbox/checkbox.d.ts +2 -2
  140. package/lib/checkbox/checkbox.d.ts.map +1 -1
  141. package/lib/checkbox/checkbox.js +5 -5
  142. package/lib/checkbox/checkbox.js.map +1 -1
  143. package/lib/collapse/collapse.less +3 -3
  144. package/lib/color-picker/ColorPicker.d.ts.map +1 -1
  145. package/lib/color-picker/ColorPicker.js +2 -4
  146. package/lib/color-picker/ColorPicker.js.map +1 -1
  147. package/lib/descriptions/descriptions.d.ts.map +1 -1
  148. package/lib/descriptions/descriptions.js +38 -19
  149. package/lib/descriptions/descriptions.js.map +1 -1
  150. package/lib/descriptions/descriptions.less +6 -2
  151. package/lib/descriptions/style/index.less +1 -0
  152. package/lib/drawer/drawer.d.ts +5 -0
  153. package/lib/drawer/drawer.d.ts.map +1 -1
  154. package/lib/drawer/drawer.js +34 -23
  155. package/lib/drawer/drawer.js.map +1 -1
  156. package/lib/drawer/index.less +8 -12
  157. package/lib/drawer/style/drawer.less +2 -4
  158. package/lib/form/form.js +5 -3
  159. package/lib/form/form.js.map +1 -1
  160. package/lib/form/form.less +12 -6
  161. package/lib/form/style/index.less +6 -6
  162. package/lib/handle/index.d.ts.map +1 -1
  163. package/lib/handle/index.js +15 -10
  164. package/lib/handle/index.js.map +1 -1
  165. package/lib/handle/index.less +16 -0
  166. package/lib/handle-icon/index.d.ts +7 -0
  167. package/lib/handle-icon/index.d.ts.map +1 -0
  168. package/lib/handle-icon/index.js +221 -0
  169. package/lib/handle-icon/index.js.map +1 -0
  170. package/lib/handle-icon/index.less +53 -0
  171. package/lib/icon/style/style.less +1 -1
  172. package/lib/index.d.ts +5 -0
  173. package/lib/index.d.ts.map +1 -1
  174. package/lib/index.js +35 -0
  175. package/lib/index.js.map +1 -1
  176. package/lib/input/input.js +8 -4
  177. package/lib/input/input.js.map +1 -1
  178. package/lib/input/style/mixin.less +2 -3
  179. package/lib/locale/default.d.ts +6 -0
  180. package/lib/locale/default.d.ts.map +1 -1
  181. package/lib/locale/en_US.d.ts +6 -0
  182. package/lib/locale/en_US.d.ts.map +1 -1
  183. package/lib/locale/en_US.js +6 -0
  184. package/lib/locale/en_US.js.map +1 -1
  185. package/lib/locale/zh_CN.d.ts +6 -0
  186. package/lib/locale/zh_CN.d.ts.map +1 -1
  187. package/lib/locale/zh_CN.js +6 -0
  188. package/lib/locale/zh_CN.js.map +1 -1
  189. package/lib/modal/style/confirm.less +6 -10
  190. package/lib/modal/style/modal.less +1 -1
  191. package/lib/page-container/index.d.ts +4 -0
  192. package/lib/page-container/index.d.ts.map +1 -0
  193. package/lib/page-container/index.js +22 -0
  194. package/lib/page-container/index.js.map +1 -0
  195. package/lib/page-container/index.less +38 -0
  196. package/lib/{query-form/Field/Composition/Select.d.ts → page-loading/index.d.ts} +1 -1
  197. package/lib/page-loading/index.d.ts.map +1 -0
  198. package/lib/page-loading/index.js +34 -0
  199. package/lib/page-loading/index.js.map +1 -0
  200. package/lib/page-loading/index.less +38 -0
  201. package/lib/page-loading/loading.gif +0 -0
  202. package/lib/query-form/index.d.ts +7 -4
  203. package/lib/query-form/index.d.ts.map +1 -1
  204. package/lib/query-form/index.js +149 -137
  205. package/lib/query-form/index.js.map +1 -1
  206. package/lib/query-form/index.less +9 -12
  207. package/lib/{query-form → query-form-backup}/Field/Composition/index.less +11 -3
  208. package/lib/query-form-backup/index.less +90 -0
  209. package/lib/query-list-scene/QueryForm.js +2 -3
  210. package/lib/query-list-scene/QueryForm.js.map +1 -1
  211. package/lib/query-list-scene/index.less +3 -3
  212. package/lib/radio/radio.d.ts +2 -2
  213. package/lib/radio/radio.d.ts.map +1 -1
  214. package/lib/radio/radio.js +4 -4
  215. package/lib/radio/radio.js.map +1 -1
  216. package/lib/select/select.d.ts.map +1 -1
  217. package/lib/select/select.js +4 -2
  218. package/lib/select/select.js.map +1 -1
  219. package/lib/select/select.less +1 -1
  220. package/lib/select/style/index.less +4 -4
  221. package/lib/style/themes/default.less +3 -3
  222. package/lib/table/expand.less +49 -0
  223. package/lib/table/hooks/index.d.ts +1 -0
  224. package/lib/table/hooks/index.d.ts.map +1 -1
  225. package/lib/table/hooks/index.js +11 -0
  226. package/lib/table/hooks/index.js.map +1 -1
  227. package/lib/table/hooks/use-expand-fixed.d.ts +4 -0
  228. package/lib/table/hooks/use-expand-fixed.d.ts.map +1 -0
  229. package/lib/table/hooks/use-expand-fixed.js +108 -0
  230. package/lib/table/hooks/use-expand-fixed.js.map +1 -0
  231. package/lib/table/index.d.ts +1 -0
  232. package/lib/table/index.d.ts.map +1 -1
  233. package/lib/table/index.js +1 -0
  234. package/lib/table/index.js.map +1 -1
  235. package/lib/table/style/index.less +61 -68
  236. package/lib/table/style/size.less +4 -4
  237. package/lib/table/table.d.ts +3 -1
  238. package/lib/table/table.d.ts.map +1 -1
  239. package/lib/table/table.js +50 -13
  240. package/lib/table/table.js.map +1 -1
  241. package/lib/table/table.less +13 -22
  242. package/lib/table/table.stories.d.ts +106 -29
  243. package/lib/table/table.stories.d.ts.map +1 -1
  244. package/lib/table/table.stories.js +426 -3
  245. package/lib/table/table.stories.js.map +1 -1
  246. package/lib/table/utils.d.ts +1 -0
  247. package/lib/table/utils.d.ts.map +1 -1
  248. package/lib/table/utils.js +13 -0
  249. package/lib/table/utils.js.map +1 -1
  250. package/lib/table-container/index.d.ts +3 -0
  251. package/lib/table-container/index.d.ts.map +1 -0
  252. package/lib/table-container/index.js +25 -0
  253. package/lib/table-container/index.js.map +1 -0
  254. package/lib/table-container/index.less +16 -0
  255. package/lib/tabs/tabs.less +23 -25
  256. package/lib/tabs-container/index.d.ts +4 -0
  257. package/lib/tabs-container/index.d.ts.map +1 -0
  258. package/lib/tabs-container/index.js +22 -0
  259. package/lib/tabs-container/index.js.map +1 -0
  260. package/lib/tabs-container/index.less +51 -0
  261. package/lib/tag/color.less +28 -18
  262. package/lib/tag/index.js +1 -1
  263. package/lib/tag/index.js.map +1 -1
  264. package/lib/tag/tag.less +41 -5
  265. package/lib/title/index.d.ts +1 -0
  266. package/lib/title/index.d.ts.map +1 -1
  267. package/lib/title/index.js +3 -2
  268. package/lib/title/index.js.map +1 -1
  269. package/lib/tntd-action/Action.d.ts +1 -1
  270. package/lib/tntd-action/Action.js +65 -14
  271. package/lib/tntd-action/Action.js.map +1 -1
  272. package/lib/tntd-action/index.js +6 -8
  273. package/lib/tntd-action/index.js.map +1 -1
  274. package/lib/tntd-action/index.less +5 -3
  275. package/lib/tntd-cascader/AntdCascader/component/getIcons.js +2 -3
  276. package/lib/tntd-cascader/AntdCascader/component/getIcons.js.map +1 -1
  277. package/lib/tntd-cascader/AntdCascader/index.d.ts.map +1 -1
  278. package/lib/tntd-cascader/AntdCascader/index.js +1 -2
  279. package/lib/tntd-cascader/AntdCascader/index.js.map +1 -1
  280. package/lib/tntd-form/FormItem/ItemHolder.js +1 -6
  281. package/lib/tntd-form/FormItem/ItemHolder.js.map +1 -1
  282. package/lib/tntd-rc-select/_util/getIcons.js +2 -3
  283. package/lib/tntd-rc-select/_util/getIcons.js.map +1 -1
  284. package/lib/tntd-select/index.d.ts.map +1 -1
  285. package/lib/tntd-select/index.js +8 -7
  286. package/lib/tntd-select/index.js.map +1 -1
  287. package/lib/tntd-select/index.less +7 -0
  288. package/lib/tooltip/index.d.ts +1 -0
  289. package/lib/tooltip/index.d.ts.map +1 -1
  290. package/lib/tooltip/index.js +1 -0
  291. package/lib/tooltip/index.js.map +1 -1
  292. package/lib/tooltip/index.less +1 -2
  293. package/package.json +5 -4
  294. package/themes/common/css2.x.css +1 -0
  295. package/themes/common/css3.x.css +1 -0
  296. package/themes/default/lessVars3.x.less +4 -6
  297. package/themes/default/variables.less +3 -3
  298. package/themes/default/variablesVar.less +3 -3
  299. package/es/array-input/icon.js +0 -25
  300. package/es/array-input/icon.js.map +0 -1
  301. package/es/checkbox/checkbox-group.js +0 -5
  302. package/es/checkbox/checkbox-group.js.map +0 -1
  303. package/es/drawer/drawer.less +0 -20
  304. package/es/grid/RowContext.js +0 -3
  305. package/es/grid/RowContext.js.map +0 -1
  306. package/es/grid/col.js +0 -103
  307. package/es/grid/col.js.map +0 -1
  308. package/es/grid/hooks/useBreakpoint.js +0 -18
  309. package/es/grid/hooks/useBreakpoint.js.map +0 -1
  310. package/es/grid/row.js +0 -154
  311. package/es/grid/row.js.map +0 -1
  312. package/es/grid/style/rtl.less +0 -69
  313. package/es/modal/modal.less +0 -18
  314. package/es/query-form/Field/Composition/FieldPopover.js +0 -284
  315. package/es/query-form/Field/Composition/FieldPopover.js.map +0 -1
  316. package/es/query-form/Field/Composition/Select.js +0 -108
  317. package/es/query-form/Field/Composition/Select.js.map +0 -1
  318. package/es/query-form/Field/Composition/index.js +0 -275
  319. package/es/query-form/Field/Composition/index.js.map +0 -1
  320. package/es/query-form/Field/Composition/utils.js +0 -19
  321. package/es/query-form/Field/Composition/utils.js.map +0 -1
  322. package/es/radio/radio-group.js +0 -5
  323. package/es/radio/radio-group.js.map +0 -1
  324. package/es/steps/stepStyle/small.less +0 -5
  325. package/lib/array-input/icon.d.ts +0 -4
  326. package/lib/array-input/icon.d.ts.map +0 -1
  327. package/lib/array-input/icon.js +0 -32
  328. package/lib/array-input/icon.js.map +0 -1
  329. package/lib/checkbox/checkbox-group.d.ts +0 -8
  330. package/lib/checkbox/checkbox-group.d.ts.map +0 -1
  331. package/lib/checkbox/checkbox-group.js +0 -12
  332. package/lib/checkbox/checkbox-group.js.map +0 -1
  333. package/lib/drawer/drawer.less +0 -20
  334. package/lib/grid/RowContext.d.ts +0 -9
  335. package/lib/grid/RowContext.d.ts.map +0 -1
  336. package/lib/grid/RowContext.js +0 -9
  337. package/lib/grid/RowContext.js.map +0 -1
  338. package/lib/grid/col.d.ts +0 -29
  339. package/lib/grid/col.d.ts.map +0 -1
  340. package/lib/grid/col.js +0 -100
  341. package/lib/grid/col.js.map +0 -1
  342. package/lib/grid/hooks/useBreakpoint.d.ts +0 -4
  343. package/lib/grid/hooks/useBreakpoint.d.ts.map +0 -1
  344. package/lib/grid/hooks/useBreakpoint.js +0 -28
  345. package/lib/grid/hooks/useBreakpoint.js.map +0 -1
  346. package/lib/grid/row.d.ts +0 -21
  347. package/lib/grid/row.d.ts.map +0 -1
  348. package/lib/grid/row.js +0 -183
  349. package/lib/grid/row.js.map +0 -1
  350. package/lib/grid/style/rtl.less +0 -69
  351. package/lib/modal/modal.less +0 -18
  352. package/lib/query-form/Field/Composition/FieldPopover.d.ts +0 -17
  353. package/lib/query-form/Field/Composition/FieldPopover.d.ts.map +0 -1
  354. package/lib/query-form/Field/Composition/FieldPopover.js +0 -319
  355. package/lib/query-form/Field/Composition/FieldPopover.js.map +0 -1
  356. package/lib/query-form/Field/Composition/Select.d.ts.map +0 -1
  357. package/lib/query-form/Field/Composition/Select.js +0 -132
  358. package/lib/query-form/Field/Composition/Select.js.map +0 -1
  359. package/lib/query-form/Field/Composition/index.d.ts +0 -14
  360. package/lib/query-form/Field/Composition/index.d.ts.map +0 -1
  361. package/lib/query-form/Field/Composition/index.js +0 -330
  362. package/lib/query-form/Field/Composition/index.js.map +0 -1
  363. package/lib/query-form/Field/Composition/utils.d.ts +0 -6
  364. package/lib/query-form/Field/Composition/utils.d.ts.map +0 -1
  365. package/lib/query-form/Field/Composition/utils.js +0 -27
  366. package/lib/query-form/Field/Composition/utils.js.map +0 -1
  367. package/lib/radio/radio-group.d.ts +0 -8
  368. package/lib/radio/radio-group.d.ts.map +0 -1
  369. package/lib/radio/radio-group.js +0 -12
  370. package/lib/radio/radio-group.js.map +0 -1
  371. package/lib/steps/stepStyle/small.less +0 -5
  372. /package/es/{query-form → query-form-backup}/Field/Composition/FieldPopover.less +0 -0
  373. /package/lib/{query-form → query-form-backup}/Field/Composition/FieldPopover.less +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"ColorPicker.js","sourceRoot":"","sources":["../../src/color-picker/ColorPicker.js"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AACxE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AACpC,OAAO,EACL,WAAW,EACX,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,SAAS,EACT,cAAc,EACd,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,aAAa,GACd,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,MAAM,YAAY,CAAA;AAC3B,OAAO,EAAO,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAC3D,OAAO,MAAM,MAAM,WAAW,CAAA;AAE9B,MAAM,SAAS,GAAG,mBAAmB,CAAA;AAErC,MAAM,OAAO,GAAG;IACd,WAAW;IACX,WAAW;IACX,YAAY;IACZ,YAAY;IACZ,aAAa;IACb,YAAY;IACZ,SAAS;IACT,cAAc;IACd,eAAe;IACf,YAAY;IACZ,YAAY;IACZ,cAAc;IACd,aAAa;CACd,CAAA;AAED,MAAM,cAAc,GAAG;IACrB,YAAY,EAAE,CAAC,EAAyB,EAAE,EAAE;YAA7B,EAAE,MAAM,OAAiB,EAAZ,UAAU,cAAvB,UAAyB,CAAF;QACpC,IAAI,MAAM,EAAE;YACV,uBACE,YAAY,EAAE,MAAM,IACjB,UAAU,EACd;SACF;QACD,OAAO,UAAU,CAAA;IACnB,CAAC;CACF,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAenC;QAfmC,EAClC,KAAK,EAAE,MAAM,EACb,QAAQ,EACR,OAAO,EAAE,EAAE,EACX,UAAU,EACV,QAAQ,EACR,SAAS,EACT,IAAI,GAAG,QAAQ,EACf,KAA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,CACT,6BAAK,SAAS,EAAE,GAAG,SAAS,QAAQ;oBAClC,6BAAK,SAAS,EAAE,GAAG,SAAS,WAAW,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,GAAQ,CACzE,CACP,CAAC,CAAC,CAAC,CACF,6BAAK,SAAS,EAAE,GAAG,SAAS,cAAc,IAAG,WAAW,CAAO,CAChE;gBACD,8BAAM,SAAS,EAAE,GAAG,SAAS,MAAM;oBACjC,6BAAK,GAAG,EAAE,MAAM,GAAI,CACf;gBACN,UAAU,IAAI,CAAC,CAAC,KAAK,IAAI,CAAC,QAAQ,IAAI,CACrC,8BAAM,SAAS,EAAE,GAAG,SAAS,QAAQ,EAAE,OAAO,EAAE,OAAO;oBACrD,oBAAC,IAAI,IAAC,IAAI,EAAC,cAAc,EAAC,KAAK,EAAC,QAAQ,GAAG,CACtC,CACR,CACG,CACF,CACE,CACX,CAAA;AACH,CAAC","sourcesContent":["import React, { useState, useCallback, useEffect, useMemo } from 'react'\nimport { Popover, Icon } from 'antd'\nimport {\n AlphaPicker,\n BlockPicker,\n ChromePicker,\n CirclePicker,\n CompactPicker,\n GithubPicker,\n HuePicker,\n MaterialPicker,\n PhotoshopPicker,\n SketchPicker,\n SliderPicker,\n SwatchesPicker,\n TwitterPicker,\n} from 'react-color'\nimport cn from 'classnames'\nimport { get, isObject, upperFirst, toLower } from 'lodash'\nimport imgSrc from './tip.svg'\n\nconst prefixCls = 'tntd-color-picker'\n\nconst modeMap = {\n AlphaPicker,\n BlockPicker,\n ChromePicker,\n CirclePicker,\n CompactPicker,\n GithubPicker,\n HuePicker,\n MaterialPicker,\n PhotoshopPicker,\n SketchPicker,\n SliderPicker,\n SwatchesPicker,\n TwitterPicker,\n}\n\nconst propsFormatMap = {\n SketchPicker: ({ colors, ...otherProps }) => {\n if (colors) {\n return {\n presetColors: colors,\n ...otherProps,\n }\n }\n return otherProps\n },\n}\n\nexport default function ColorPicker({\n value: _value,\n onChange,\n visible: vs,\n allowClear,\n disabled,\n className,\n mode = 'sketch',\n style = {},\n size,\n placeholder,\n placement = 'bottomLeft',\n locale,\n simple,\n ...otherProps\n}) {\n const [visible, setVisible] = useState(vs)\n const [value, setValue] = useState(_value)\n\n useEffect(() => {\n setValue(_value)\n }, [_value])\n\n const handleChange = useCallback(\n (color) => {\n let value\n if (isObject(color?.rgb)) {\n value = `rgba(${color.rgb.r},${color.rgb.g},${color.rgb.b},${color.rgb.a})`\n }\n if (onChange) {\n onChange(value)\n } else {\n setValue(value)\n }\n },\n [onChange]\n )\n\n const domClick = useCallback(() => {\n setVisible(true)\n }, [])\n\n const doClear = useCallback(\n (e) => {\n e.stopPropagation()\n handleChange()\n },\n [handleChange]\n )\n\n const [ModePicker, propsFormat] = useMemo(() => {\n const modeKey = upperFirst(toLower(mode)) + 'Picker' || 'SketchPicker'\n const ModePicker = modeMap[modeKey] || SketchPicker\n return [ModePicker, propsFormatMap[modeKey] || ((p) => p)]\n }, [mode])\n\n return (\n <Popover\n placement={placement}\n trigger=\"click\"\n visible={visible && !disabled}\n onVisibleChange={setVisible}\n content={\n <ModePicker {...propsFormat(otherProps)} color={value} onChangeComplete={handleChange} />\n }\n overlayClassName={`${prefixCls}-pop`}\n >\n <div\n className={cn(prefixCls, className, {\n [`${prefixCls}-selected`]: !!value,\n [`${prefixCls}-disabled`]: disabled,\n [`${prefixCls}-active`]: visible && !disabled,\n [`${prefixCls}-simple`]: simple,\n [`${prefixCls}-sm`]: size === 'small',\n [`${prefixCls}-lg`]: size === 'large',\n })}\n style={style}\n onClick={domClick}\n >\n <div className={`${prefixCls}-inner`}>\n {!!value ? (\n <div className={`${prefixCls}-value`}>\n <div className={`${prefixCls}-value-bg`} style={{ background: value }}></div>\n </div>\n ) : (\n <div className={`${prefixCls}-placeholder`}>{placeholder}</div>\n )}\n <span className={`${prefixCls}-img`}>\n <img src={imgSrc} />\n </span>\n {allowClear && !!value && !disabled && (\n <span className={`${prefixCls}-clear`} onClick={doClear}>\n <Icon type=\"close-circle\" theme=\"filled\" />\n </span>\n )}\n </div>\n </div>\n </Popover>\n )\n}\n"]}
1
+ {"version":3,"file":"ColorPicker.js","sourceRoot":"","sources":["../../src/color-picker/ColorPicker.js"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AACxE,OAAO,EACL,WAAW,EACX,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,SAAS,EACT,cAAc,EACd,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,aAAa,GACd,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,MAAM,YAAY,CAAA;AAC3B,OAAO,EAAO,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAC3D,OAAO,OAAO,MAAM,YAAY,CAAA;AAChC,OAAO,IAAI,MAAM,SAAS,CAAA;AAC1B,OAAO,MAAM,MAAM,WAAW,CAAA;AAE9B,MAAM,SAAS,GAAG,mBAAmB,CAAA;AAErC,MAAM,OAAO,GAAG;IACd,WAAW;IACX,WAAW;IACX,YAAY;IACZ,YAAY;IACZ,aAAa;IACb,YAAY;IACZ,SAAS;IACT,cAAc;IACd,eAAe;IACf,YAAY;IACZ,YAAY;IACZ,cAAc;IACd,aAAa;CACd,CAAA;AAED,MAAM,cAAc,GAAG;IACrB,YAAY,EAAE,CAAC,EAAyB,EAAE,EAAE;YAA7B,EAAE,MAAM,OAAiB,EAAZ,UAAU,cAAvB,UAAyB,CAAF;QACpC,IAAI,MAAM,EAAE;YACV,uBACE,YAAY,EAAE,MAAM,IACjB,UAAU,EACd;SACF;QACD,OAAO,UAAU,CAAA;IACnB,CAAC;CACF,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAenC;QAfmC,EAClC,KAAK,EAAE,MAAM,EACb,QAAQ,EACR,OAAO,EAA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,SAAS,EAAE,GAAG,SAAS,QAAQ;gBACjC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CACT,6BAAK,SAAS,EAAE,GAAG,SAAS,QAAQ;oBAClC,6BAAK,SAAS,EAAE,GAAG,SAAS,WAAW,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,GAAQ,CACzE,CACP,CAAC,CAAC,CAAC,CACF,6BAAK,SAAS,EAAE,GAAG,SAAS,cAAc,IAAG,WAAW,CAAO,CAChE;gBACD,8BAAM,SAAS,EAAE,GAAG,SAAS,MAAM;oBACjC,6BAAK,GAAG,EAAE,MAAM,GAAI,CACf;gBACN,UAAU,IAAI,CAAC,CAAC,KAAK,IAAI,CAAC,QAAQ,IAAI,CACrC,8BAAM,SAAS,EAAE,GAAG,SAAS,QAAQ,EAAE,OAAO,EAAE,OAAO;oBACrD,oBAAC,IAAI,IAAC,IAAI,EAAC,cAAc,EAAC,KAAK,EAAC,QAAQ,GAAG,CACtC,CACR,CACG,CACF,CACE,CACX,CAAA;AACH,CAAC","sourcesContent":["import React, { useState, useCallback, useEffect, useMemo } from 'react'\nimport {\n AlphaPicker,\n BlockPicker,\n ChromePicker,\n CirclePicker,\n CompactPicker,\n GithubPicker,\n HuePicker,\n MaterialPicker,\n PhotoshopPicker,\n SketchPicker,\n SliderPicker,\n SwatchesPicker,\n TwitterPicker,\n} from 'react-color'\nimport cn from 'classnames'\nimport { get, isObject, upperFirst, toLower } from 'lodash'\nimport Popover from '../popover'\nimport Icon from '../icon'\nimport imgSrc from './tip.svg'\n\nconst prefixCls = 'tntd-color-picker'\n\nconst modeMap = {\n AlphaPicker,\n BlockPicker,\n ChromePicker,\n CirclePicker,\n CompactPicker,\n GithubPicker,\n HuePicker,\n MaterialPicker,\n PhotoshopPicker,\n SketchPicker,\n SliderPicker,\n SwatchesPicker,\n TwitterPicker,\n}\n\nconst propsFormatMap = {\n SketchPicker: ({ colors, ...otherProps }) => {\n if (colors) {\n return {\n presetColors: colors,\n ...otherProps,\n }\n }\n return otherProps\n },\n}\n\nexport default function ColorPicker({\n value: _value,\n onChange,\n visible: vs,\n allowClear,\n disabled,\n className,\n mode = 'sketch',\n style = {},\n size,\n placeholder,\n placement = 'bottomLeft',\n locale,\n simple,\n ...otherProps\n}) {\n const [visible, setVisible] = useState(vs)\n const [value, setValue] = useState(_value)\n\n useEffect(() => {\n setValue(_value)\n }, [_value])\n\n const handleChange = useCallback(\n (color) => {\n let value\n if (isObject(color?.rgb)) {\n value = `rgba(${color.rgb.r},${color.rgb.g},${color.rgb.b},${color.rgb.a})`\n }\n if (onChange) {\n onChange(value)\n } else {\n setValue(value)\n }\n },\n [onChange]\n )\n\n const domClick = useCallback(() => {\n setVisible(true)\n }, [])\n\n const doClear = useCallback(\n (e) => {\n e.stopPropagation()\n handleChange()\n },\n [handleChange]\n )\n\n const [ModePicker, propsFormat] = useMemo(() => {\n const modeKey = upperFirst(toLower(mode)) + 'Picker' || 'SketchPicker'\n const ModePicker = modeMap[modeKey] || SketchPicker\n return [ModePicker, propsFormatMap[modeKey] || ((p) => p)]\n }, [mode])\n\n return (\n <Popover\n placement={placement}\n trigger=\"click\"\n visible={visible && !disabled}\n onVisibleChange={setVisible}\n content={\n <ModePicker {...propsFormat(otherProps)} color={value} onChangeComplete={handleChange} />\n }\n overlayClassName={`${prefixCls}-pop`}\n >\n <div\n className={cn(prefixCls, className, {\n [`${prefixCls}-selected`]: !!value,\n [`${prefixCls}-disabled`]: disabled,\n [`${prefixCls}-active`]: visible && !disabled,\n [`${prefixCls}-simple`]: simple,\n [`${prefixCls}-sm`]: size === 'small',\n [`${prefixCls}-lg`]: size === 'large',\n })}\n style={style}\n onClick={domClick}\n >\n <div className={`${prefixCls}-inner`}>\n {!!value ? (\n <div className={`${prefixCls}-value`}>\n <div className={`${prefixCls}-value-bg`} style={{ background: value }}></div>\n </div>\n ) : (\n <div className={`${prefixCls}-placeholder`}>{placeholder}</div>\n )}\n <span className={`${prefixCls}-img`}>\n <img src={imgSrc} />\n </span>\n {allowClear && !!value && !disabled && (\n <span className={`${prefixCls}-clear`} onClick={doClear}>\n <Icon type=\"close-circle\" theme=\"filled\" />\n </span>\n )}\n </div>\n </div>\n </Popover>\n )\n}\n"]}
@@ -8,14 +8,15 @@ var __rest = this && this.__rest || function (s, e) {
8
8
  };
9
9
  /*
10
10
  * @Author: 周泽飞 zefei.zhou@tongdun.net
11
- * @Date: 2023-05-05 15:48:09
11
+ * @Date: 2024-06-08 11:59:04
12
12
  * @LastEditors: 周泽飞 zefei.zhou@tongdun.net
13
- * @LastEditTime: 2024-03-04 16:49:24
13
+ * @LastEditTime: 2024-06-26 19:08:00
14
14
  * @FilePath: /tntd/packages/tntd/src/descriptions/descriptions.tsx
15
15
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
16
16
  */
17
17
  import React, { forwardRef } from 'react';
18
18
  import classNames from 'classnames';
19
+ import toArray from 'rc-util/es/Children/toArray';
19
20
  import { ConfigConsumer } from 'antd/es/config-provider';
20
21
  import { default as AntdDescriptions } from 'antd/es/descriptions';
21
22
  import Ellipsis from '../ellipsis';
@@ -49,6 +50,19 @@ export const Descriptions = forwardRef((_a, ref) => {
49
50
  // 非垂直 且 同盾
50
51
  const tdDescriptions = layout !== 'vertical' && tdType;
51
52
  const tntPrefixCls = 'tnt-descriptions';
53
+ const flattenChildren = children => {
54
+ if (!children) {
55
+ return [];
56
+ }
57
+ return toArray(children).reduce(function (flatChildren, child) {
58
+ if (child && child.type === React.Fragment) {
59
+ return flatChildren.concat(flattenChildren(child.props.children));
60
+ }
61
+ flatChildren.push(child);
62
+ return flatChildren;
63
+ }, []);
64
+ };
65
+ children = flattenChildren(children);
52
66
  return React.createElement(AntdDescriptions, Object.assign({
53
67
  className: classNames(`${prefixCls}-${getLanguage()}`, {
54
68
  [tntPrefixCls]: tdDescriptions
@@ -69,19 +83,22 @@ export const Descriptions = forwardRef((_a, ref) => {
69
83
  labelPrefix,
70
84
  children: childContext
71
85
  } = childProps;
72
- return React.createElement("div", null, React.createElement(Ellipsis, {
73
- lines: ellipsisLine,
74
- className: "tnt-descriptions-item",
75
- prefix: React.createElement("div", {
76
- className: "tnt-descriptions-label-title"
77
- }, React.createElement(Ellipsis, {
78
- prefix: labelPrefix ? React.createElement("span", {
79
- className: "tnt-descriptions-label-tag"
80
- }, labelPrefix) : null,
86
+ return React.cloneElement(child, Object.assign(Object.assign({}, child.props), {
87
+ label: null,
88
+ children: React.createElement(Ellipsis, {
81
89
  lines: ellipsisLine,
82
- title: label
83
- })),
84
- title: childContext
90
+ className: "tnt-descriptions-item",
91
+ prefix: React.createElement("div", {
92
+ className: "tnt-descriptions-label-title"
93
+ }, React.createElement(Ellipsis, {
94
+ prefix: labelPrefix ? React.createElement("span", {
95
+ className: "tnt-descriptions-label-tag"
96
+ }, labelPrefix) : null,
97
+ lines: ellipsisLine,
98
+ title: label
99
+ })),
100
+ title: childContext
101
+ })
85
102
  }));
86
103
  }
87
104
  }), tdDescriptions && bordered && ellipsis && !hideTooltip && React.Children.map(children, child => {
@@ -90,7 +107,8 @@ export const Descriptions = forwardRef((_a, ref) => {
90
107
  const {
91
108
  label,
92
109
  labelPrefix,
93
- children: childContext
110
+ children: childContext,
111
+ ellipsis = true
94
112
  } = childProps;
95
113
  return React.cloneElement(child, Object.assign(Object.assign({}, child.props), {
96
114
  label: React.createElement(Ellipsis, {
@@ -100,10 +118,10 @@ export const Descriptions = forwardRef((_a, ref) => {
100
118
  lines: ellipsisLine,
101
119
  title: label
102
120
  }),
103
- children: React.createElement(Ellipsis, {
121
+ children: ellipsis ? React.createElement(Ellipsis, {
104
122
  lines: ellipsisLine,
105
123
  title: childContext
106
- })
124
+ }) : childContext
107
125
  }));
108
126
  }
109
127
  }), (!tdDescriptions || bordered && !ellipsis || hideTooltip) && children);
@@ -1 +1 @@
1
- {"version":3,"file":"descriptions.js","sourceRoot":"","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AQ;gBACR,CAAC,WAAW;gBACZ,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;oBACrC,IAAI,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE;wBAC/B,MAAM,UAAU,GAAG,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAQ,CAAA;wBAC7C,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,UAAU,CAAA;wBACjE,OAAO,KAAK,CAAC,YAAY,CAAC,KAAK,kCAC1B,KAAK,CAAC,KAAK,KACd,KAAK,EAAE,CACL,oBAAC,QAAQ,IACP,MAAM,EACJ,WAAW,CAAC,CAAC,CAAC,CACZ,8BAAM,SAAS,EAAC,4BAA4B,IAAE,WAAW,CAAQ,CAClE,CAAC,CAAC,CAAC,IAAI,EAEV,KAAK,EAAE,YAAY,EACnB,KAAK,EAAE,KAAK,GACZ,CACH,EACD,QAAQ,EAAE,oBAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,GAAI,IAChE,CAAA;qBACH;gBACH,CAAC,CAAC;YAGH,CAAC,CAAC,cAAc,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,IAAI,WAAW,CAAC,IAAI,QAAQ,CACvD,CACpB,CAAA;IACH,CAAC,CACc,CAClB,CAAA;AACH,CAAC,CACuB,CAAA;AAE1B,YAAY,CAAC,IAAI,GAAG,gBAAgB,CAAC,IAAI,CAAA","sourcesContent":["/*\n * @Author: 周泽飞 zefei.zhou@tongdun.net\n * @Date: 2023-05-05 15:48:09\n * @LastEditors: 周泽飞 zefei.zhou@tongdun.net\n * @LastEditTime: 2024-03-04 16:49:24\n * @FilePath: /tntd/packages/tntd/src/descriptions/descriptions.tsx\n * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE\n */\nimport React, { forwardRef } from 'react'\nimport type { DescriptionsProps as AntdDescriptionsProps } from 'antd/es/descriptions'\nimport type { DescriptionsItemProps as AntdDescriptionsItemProps } from 'antd/es/descriptions'\nimport classNames from 'classnames'\nimport { ConfigConsumer } from 'antd/es/config-provider'\nimport { default as AntdDescriptions } from 'antd/es/descriptions'\n\nimport Ellipsis from '../ellipsis'\nimport { doUpperTitle } from '../utils'\nimport { getLanguage } from '../prev-locale'\n\nexport * from 'antd/es/descriptions'\n\nexport interface DescriptionsProps extends AntdDescriptionsProps {\n tdType?: boolean\n ellipsis?: boolean\n ellipsisLine?: number\n hideTooltip?: boolean\n undoUpper?: boolean\n upperCaseIgnore?: Array<string>\n titleType?: string\n titleWeight?: boolean\n}\n\nexport interface DescriptionsItemProps extends AntdDescriptionsItemProps {\n labelPrefix?: React.ReactNode\n}\n\ndeclare const DescriptionsItem: React.FC<DescriptionsItemProps>\ninterface DescriptionsComponent\n extends React.ForwardRefExoticComponent<\n DescriptionsProps & React.RefAttributes<AntdDescriptions>\n > {\n Item: typeof DescriptionsItem\n}\n\nexport const Descriptions = forwardRef<\n AntdDescriptions,\n DescriptionsProps & { capitalize?: boolean }\n>(\n (\n {\n className,\n tdType = true,\n titleWeight,\n titleType,\n colon,\n children,\n undoUpper = false,\n upperCaseIgnore = [],\n title,\n ...rest\n },\n ref\n ) => {\n return (\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n const prefixCls = getPrefixCls('descriptions')\n const { layout, ellipsis, ellipsisLine = 1, hideTooltip = false, bordered } = rest || {}\n // 非垂直 且 同盾\n const tdDescriptions = layout !== 'vertical' && tdType\n\n const tntPrefixCls = 'tnt-descriptions'\n\n return (\n <AntdDescriptions\n className={classNames(\n `${prefixCls}-${getLanguage()}`,\n {\n [tntPrefixCls]: tdDescriptions,\n },\n `${tntPrefixCls}-title-theme${titleType ? '-' + titleType : ''}`,\n {\n [tntPrefixCls + '-title-weight']: titleWeight,\n },\n {\n [tntPrefixCls + '-ellipsis']: ellipsis,\n },\n className\n )}\n title={undoUpper ? title : doUpperTitle(title, upperCaseIgnore)} // 默认转大写\n {...rest}\n colon={tdDescriptions ? false : colon}\n ref={ref}\n >\n {/*同盾描述框 非边框 开启默认tooltip */}\n {tdDescriptions &&\n !bordered &&\n !hideTooltip &&\n React.Children.map(children, (child) => {\n if (React.isValidElement(child)) {\n const childProps = (child.props || {}) as any\n const { label, labelPrefix, children: childContext } = childProps\n return (\n <div>\n <Ellipsis\n lines={ellipsisLine}\n className=\"tnt-descriptions-item\"\n prefix={\n <div className=\"tnt-descriptions-label-title\">\n <Ellipsis\n prefix={\n labelPrefix ? (\n <span className=\"tnt-descriptions-label-tag\">\n {labelPrefix}\n </span>\n ) : null\n }\n lines={ellipsisLine}\n title={label}\n />\n </div>\n }\n title={childContext}\n />\n </div>\n )\n }\n })}\n\n {/*同盾描述框 有边框 不换行 开启默认tooltip */}\n {tdDescriptions &&\n bordered &&\n ellipsis &&\n !hideTooltip &&\n React.Children.map(children, (child) => {\n if (React.isValidElement(child)) {\n const childProps = (child.props || {}) as any\n const { label, labelPrefix, children: childContext } = childProps\n return React.cloneElement(child, {\n ...child.props,\n label: (\n <Ellipsis\n prefix={\n labelPrefix ? (\n <span className=\"tnt-descriptions-label-tag\">{labelPrefix}</span>\n ) : null\n }\n lines={ellipsisLine}\n title={label}\n />\n ),\n children: <Ellipsis lines={ellipsisLine} title={childContext} />,\n })\n }\n })}\n\n {/* 非同盾模式下 或者 带边框但换行 或者 不开启默认tooltip 走默认逻辑 */}\n {(!tdDescriptions || (bordered && !ellipsis) || hideTooltip) && children}\n </AntdDescriptions>\n )\n }}\n </ConfigConsumer>\n )\n }\n) as DescriptionsComponent\n\nDescriptions.Item = AntdDescriptions.Item\n"]}
1
+ {"version":3,"file":"descriptions.js","sourceRoot":"","sources":["../../src/descriptions/descriptions.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,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,EAAE,QAAQ,CAAC,CAAC,CAAC,CACnB,oBAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,GAAI,CACvD,CAAC,CAAC,CAAC,CACF,YAAY,CACb,IACD,CAAA;qBACH;gBACH,CAAC,CAAC;YAEH,CAAC,CAAC,cAAc,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,IAAI,WAAW,CAAC,IAAI,QAAQ,CACvD,CACpB,CAAA;IACH,CAAC,CACc,CAClB,CAAA;AACH,CAAC,CACuB,CAAA;AAE1B,YAAY,CAAC,IAAI,GAAG,gBAAgB,CAAC,IAAI,CAAA","sourcesContent":["/*\n * @Author: 周泽飞 zefei.zhou@tongdun.net\n * @Date: 2024-06-08 11:59:04\n * @LastEditors: 周泽飞 zefei.zhou@tongdun.net\n * @LastEditTime: 2024-06-26 19:08:00\n * @FilePath: /tntd/packages/tntd/src/descriptions/descriptions.tsx\n * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE\n */\nimport React, { forwardRef } from 'react'\nimport type { DescriptionsProps as AntdDescriptionsProps } from 'antd/es/descriptions'\nimport type { DescriptionsItemProps as AntdDescriptionsItemProps } from 'antd/es/descriptions'\nimport classNames from 'classnames'\nimport toArray from 'rc-util/es/Children/toArray'\nimport { ConfigConsumer } from 'antd/es/config-provider'\nimport { default as AntdDescriptions } from 'antd/es/descriptions'\n\nimport Ellipsis from '../ellipsis'\nimport { doUpperTitle } from '../utils'\nimport { getLanguage } from '../prev-locale'\n\nexport * from 'antd/es/descriptions'\n\nexport interface DescriptionsProps extends AntdDescriptionsProps {\n tdType?: boolean\n ellipsis?: boolean\n ellipsisLine?: number\n hideTooltip?: boolean\n undoUpper?: boolean\n upperCaseIgnore?: Array<string>\n titleType?: string\n titleWeight?: boolean\n}\n\nexport interface DescriptionsItemProps extends AntdDescriptionsItemProps {\n labelPrefix?: React.ReactNode\n}\n\ndeclare const DescriptionsItem: React.FC<DescriptionsItemProps>\ninterface DescriptionsComponent\n extends React.ForwardRefExoticComponent<\n DescriptionsProps & React.RefAttributes<AntdDescriptions>\n > {\n Item: typeof DescriptionsItem\n}\n\nexport const Descriptions = forwardRef<\n AntdDescriptions,\n DescriptionsProps & { capitalize?: boolean }\n>(\n (\n {\n className,\n tdType = true,\n titleWeight,\n titleType,\n colon,\n children,\n undoUpper = false,\n upperCaseIgnore = [],\n title,\n ...rest\n },\n ref\n ) => {\n return (\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n const prefixCls = getPrefixCls('descriptions')\n const { layout, ellipsis, ellipsisLine = 1, hideTooltip = false, bordered } = rest || {}\n // 非垂直 且 同盾\n const tdDescriptions = layout !== 'vertical' && tdType\n\n const tntPrefixCls = 'tnt-descriptions'\n\n const flattenChildren = (children: React.ReactNode): React.ReactNode[] => {\n if (!children) {\n return []\n }\n return toArray(children).reduce(function (\n flatChildren: React.ReactNode[],\n child: React.ReactNode\n ) {\n if (child && (child as any).type === React.Fragment) {\n return flatChildren.concat(flattenChildren((child as any).props.children))\n }\n\n flatChildren.push(child)\n return flatChildren\n },\n [])\n }\n\n children = flattenChildren(children)\n\n return (\n <AntdDescriptions\n className={classNames(\n `${prefixCls}-${getLanguage()}`,\n {\n [tntPrefixCls]: tdDescriptions,\n },\n `${tntPrefixCls}-title-theme${titleType ? '-' + titleType : ''}`,\n {\n [tntPrefixCls + '-title-weight']: titleWeight,\n },\n {\n [tntPrefixCls + '-ellipsis']: ellipsis,\n },\n className\n )}\n title={undoUpper ? title : doUpperTitle(title, upperCaseIgnore)} // 默认转大写\n {...rest}\n colon={tdDescriptions ? false : colon}\n ref={ref}\n >\n {/*同盾描述框 非边框 开启默认tooltip */}\n {tdDescriptions &&\n !bordered &&\n !hideTooltip &&\n React.Children.map(children, (child) => {\n if (React.isValidElement(child)) {\n const childProps = (child.props || {}) as any\n const { label, labelPrefix, children: childContext } = childProps\n return React.cloneElement(child, {\n ...child.props,\n label: null,\n children: (\n <Ellipsis\n lines={ellipsisLine}\n className=\"tnt-descriptions-item\"\n prefix={\n <div className=\"tnt-descriptions-label-title\">\n <Ellipsis\n prefix={\n labelPrefix ? (\n <span className=\"tnt-descriptions-label-tag\">\n {labelPrefix}\n </span>\n ) : null\n }\n lines={ellipsisLine}\n title={label}\n />\n </div>\n }\n title={childContext}\n />\n ),\n })\n }\n })}\n\n {/*同盾描述框 有边框 不换行 开启默认tooltip */}\n {tdDescriptions &&\n bordered &&\n ellipsis &&\n !hideTooltip &&\n React.Children.map(children, (child) => {\n if (React.isValidElement(child)) {\n const childProps = (child.props || {}) as any\n const {\n label,\n labelPrefix,\n children: childContext,\n ellipsis = true,\n } = childProps\n return React.cloneElement(child, {\n ...child.props,\n label: (\n <Ellipsis\n prefix={\n labelPrefix ? (\n <span className=\"tnt-descriptions-label-tag\">{labelPrefix}</span>\n ) : null\n }\n lines={ellipsisLine}\n title={label}\n />\n ),\n children: ellipsis ? (\n <Ellipsis lines={ellipsisLine} title={childContext} />\n ) : (\n childContext\n ),\n })\n }\n })}\n {/* 非同盾模式下 或者 带边框但换行 或者 不开启默认tooltip 走默认逻辑 */}\n {(!tdDescriptions || (bordered && !ellipsis) || hideTooltip) && children}\n </AntdDescriptions>\n )\n }}\n </ConfigConsumer>\n )\n }\n) as DescriptionsComponent\n\nDescriptions.Item = AntdDescriptions.Item\n"]}
@@ -36,7 +36,7 @@
36
36
  background-color: @primary-color;
37
37
  border-radius: @border-radius-base;//8px;
38
38
  position: absolute;
39
- top:6px;
39
+ top:5px;
40
40
  left:0;
41
41
  }
42
42
  }
@@ -109,11 +109,15 @@
109
109
  .@{descriptions-prefix-cls}-item-content{
110
110
  display: flex;
111
111
  width: 100%;
112
+ height:100%;
113
+ align-items: center;
112
114
  &>.tntd-ellipsis,>.tnt-ellipsis{
113
115
  width: 100%;
116
+ height: 100%;
117
+ align-items: center;
114
118
  .tnt-descriptions-label-title{
115
119
  max-width: 70%;
116
- margin-right: 4px;
120
+ margin-right: 8px;
117
121
  color: tint(@bg-color-spotilight, 50%);//#8B919E;
118
122
  overflow: hidden;
119
123
  text-overflow: ellipsis;
@@ -23,6 +23,7 @@
23
23
  table {
24
24
  width: 100%;
25
25
  table-layout: fixed;
26
+ border-collapse: collapse !important; // 在Table下 下边框不展示问题
26
27
  }
27
28
  }
28
29
 
@@ -10,29 +10,28 @@ import { ConfigConsumer } from 'antd/es/config-provider';
10
10
  import { default as AntdDrawer } from 'antd/es/drawer';
11
11
  import LocaleReceiver from 'antd/es/locale-provider/LocaleReceiver';
12
12
  import classNames from 'classnames';
13
+ import { doUpperTitle } from '../utils';
13
14
  import React, { useEffect } from 'react';
14
15
  import { Button } from '../button';
15
16
  import Icon from '../icon';
16
17
  const DefaultFooter = ({
17
18
  locale,
18
- onClose,
19
- onSubmit,
19
+ onCancel,
20
+ onOk,
20
21
  okText,
21
22
  okType,
22
23
  cancelText,
23
24
  confirmLoading,
24
25
  okButtonProps,
25
- cancelButtonProps
26
+ cancelButtonProps,
27
+ cancelType
26
28
  }) => {
27
29
  return React.createElement(React.Fragment, null, React.createElement(Button, Object.assign({
28
- onClick: onClose,
29
- style: {
30
- marginRight: 8
31
- },
32
- type: 'tertiary'
30
+ onClick: onCancel,
31
+ type: cancelType || 'default'
33
32
  }, cancelButtonProps), cancelText || (locale === null || locale === void 0 ? void 0 : locale.cancelText)), React.createElement(Button, Object.assign({
34
- onClick: onSubmit,
35
- type: okType,
33
+ onClick: onOk,
34
+ type: okType || 'primary',
36
35
  loading: confirmLoading
37
36
  }, okButtonProps), okText || (locale === null || locale === void 0 ? void 0 : locale.okText)));
38
37
  };
@@ -44,17 +43,25 @@ export const Drawer = _a => {
44
43
  showFooter,
45
44
  onClose,
46
45
  onSubmit,
46
+ onCancel,
47
+ onOk,
47
48
  okText = '',
48
49
  cancelText = '',
49
50
  locale,
50
51
  okType = 'primary',
52
+ cancelType = 'default',
51
53
  confirmLoading = false,
52
54
  okButtonProps = {},
53
55
  cancelButtonProps = {},
54
- clickOnBlankToClose = false
56
+ clickOnBlankToClose = false,
57
+ upperCaseIgnore,
58
+ unUpperConverted,
59
+ title
55
60
  } = _a,
56
- rest = __rest(_a, ["closable", "className", "footer", "showFooter", "onClose", "onSubmit", "okText", "cancelText", "locale", "okType", "confirmLoading", "okButtonProps", "cancelButtonProps", "clickOnBlankToClose"]);
61
+ rest = __rest(_a, ["closable", "className", "footer", "showFooter", "onClose", "onSubmit", "onCancel", "onOk", "okText", "cancelText", "locale", "okType", "cancelType", "confirmLoading", "okButtonProps", "cancelButtonProps", "clickOnBlankToClose", "upperCaseIgnore", "unUpperConverted", "title"]);
57
62
  const drawerDom = React.useRef(null);
63
+ const _onCancel = onCancel || onClose;
64
+ const _onOk = onOk || onSubmit;
58
65
  useEffect(() => {
59
66
  if (clickOnBlankToClose) {
60
67
  const handleOutsideClick = event => {
@@ -65,8 +72,8 @@ export const Drawer = _a => {
65
72
  isInDrawer = drawer.contains(targetElement) || targetElement === drawer;
66
73
  }
67
74
  drawerDom.current = null;
68
- if (rest.visible && !isInDrawer && onClose) {
69
- onClose();
75
+ if (rest.visible && !isInDrawer && _onCancel) {
76
+ _onCancel();
70
77
  }
71
78
  };
72
79
  document.removeEventListener('click', handleOutsideClick);
@@ -75,7 +82,7 @@ export const Drawer = _a => {
75
82
  document.removeEventListener('click', handleOutsideClick);
76
83
  };
77
84
  }
78
- }, [rest.visible, clickOnBlankToClose, onClose]);
85
+ }, [rest.visible, clickOnBlankToClose, _onCancel]);
79
86
  return React.createElement(ConfigConsumer, null, ({
80
87
  getPrefixCls
81
88
  }) => {
@@ -91,28 +98,31 @@ export const Drawer = _a => {
91
98
  }, React.createElement(AntdDrawer, Object.assign({
92
99
  className: classNames(prefixCls, 'tnt-drawer', className, {
93
100
  [`${prefixCls}-contain-closable`]: closable !== false,
94
- [`${prefixCls}-footer`]: showFooter
101
+ [`${prefixCls}-footer`]: showFooter || footer
95
102
  }),
96
103
  closable: false,
97
- onClose: onClose,
104
+ onClose: _onCancel,
98
105
  width: 480
99
- }, rest), React.createElement(React.Fragment, null, closable !== false && React.createElement(Icon, {
106
+ }, rest, {
107
+ title: !unUpperConverted ? doUpperTitle(title, upperCaseIgnore) : title
108
+ }), React.createElement(React.Fragment, null, closable !== false && React.createElement(Icon, {
100
109
  type: "close",
101
110
  className: `${prefixCls}-close`,
102
- onClick: onClose
103
- }), rest.children, showFooter && React.createElement("div", {
111
+ onClick: _onCancel
112
+ }), rest.children, (showFooter || footer) && React.createElement("div", {
104
113
  className: `${prefixCls}-footer-style`
105
- }, showFooter && !footer ? React.createElement(DefaultFooter, {
114
+ }, footer || React.createElement(DefaultFooter, {
106
115
  confirmLoading: confirmLoading,
107
116
  okButtonProps: okButtonProps,
108
117
  cancelButtonProps: cancelButtonProps,
109
118
  okType: okType,
110
119
  locale: locale,
111
120
  okText: okText,
121
+ cancelType: cancelType,
112
122
  cancelText: cancelText,
113
- onClose: onClose,
114
- onSubmit: onSubmit
115
- }) : footer))));
123
+ onOk: _onOk,
124
+ onCancel: _onCancel
125
+ })))));
116
126
  });
117
127
  });
118
128
  };
@@ -1 +1 @@
1
- {"version":3,"file":"drawer.js","sourceRoot":"","sources":["../../src/drawer/drawer.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAExD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,gBAAgB,CAAA;AACtD,OAAO,cAAc,MAAM,wCAAwC,CAAA;AACnE,OAAO,UAAU,MAAM,YAAY,CAAA;AAInC,OAAO,KAAK,EAAE,EAAM,SAAS,EAAU,MAAM,OAAO,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,IAAI,MAAM,SAAS,CAAA;AAC1B,MAAM,aAAa,GAAG,CAAC,EACrB,MAAM,EACN,OAAO,EACP,QAAQ,EACR,MAAM,EACN,MAAM,EAC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oBAER;wBACG,QAAQ,KAAK,KAAK,IAAI,CACrB,oBAAC,IAAI,IAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAE,GAAG,SAAS,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAI,CACzE;wBACA,IAAI,CAAC,QAAQ;wBACb,UAAU,IAAI,CACb,6BAAK,SAAS,EAAE,GAAG,SAAS,eAAe,IACxC,UAAU,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CACvB,oBAAC,aAAa,IACZ,cAAc,EAAE,cAAc,EAC9B,aAAa,EAAE,aAAa,EAC5B,iBAAiB,EAAE,iBAAiB,EACpC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC,CAAC,CAAC,CACF,MAAM,CACP,CACG,CACP,CACA,CACQ,CACT,CACP,CAAA;QACH,CAAC,CACc,CAClB,CAAA;IACH,CAAC,CACc,CAClB,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { ConfigConsumer } from 'antd/es/config-provider'\nimport type { DrawerProps as AntdDrawerProps } from 'antd/es/drawer'\nimport { default as AntdDrawer } from 'antd/es/drawer'\nimport LocaleReceiver from 'antd/es/locale-provider/LocaleReceiver'\nimport classNames from 'classnames'\nimport type { BaseButtonProps } from 'antd/es/button/button'\nimport type { TntButtonType } from '../button/button'\n\nimport React, { FC, useEffect, useRef } from 'react'\nimport { Button } from '../button'\nimport Icon from '../icon'\nconst DefaultFooter = ({\n locale,\n onClose,\n onSubmit,\n okText,\n okType,\n cancelText,\n confirmLoading,\n okButtonProps,\n cancelButtonProps,\n}: {\n locale?: {\n okText?: string\n cancelText?: string\n }\n onClose?: () => void\n onSubmit?: () => void\n okText: string\n cancelText: string\n okType?: TntButtonType\n confirmLoading?: boolean\n okButtonProps?: BaseButtonProps\n cancelButtonProps?: BaseButtonProps\n}) => {\n return (\n <>\n <Button onClick={onClose} style={{ marginRight: 8 }} type={'tertiary'} {...cancelButtonProps}>\n {cancelText || locale?.cancelText}\n </Button>\n <Button onClick={onSubmit} type={okType} loading={confirmLoading} {...okButtonProps}>\n {okText || locale?.okText}\n </Button>\n </>\n )\n}\n\ninterface CustomDrawerProps extends AntdDrawerProps {\n footer?: React.ReactNode\n showFooter?: boolean\n onClose?: () => void\n onSubmit?: () => void\n okText?: string\n cancelText?: string\n locale?: {\n okText?: string\n cancelText?: string\n }\n okType?: TntButtonType\n confirmLoading?: boolean\n okButtonProps?: BaseButtonProps\n cancelButtonProps?: BaseButtonProps\n clickOnBlankToClose: boolean\n}\n\nexport const Drawer: FC<CustomDrawerProps> = ({\n closable = true,\n className,\n footer,\n showFooter,\n onClose,\n onSubmit,\n okText = '',\n cancelText = '',\n locale,\n okType = 'primary',\n confirmLoading = false,\n okButtonProps = {},\n cancelButtonProps = {},\n clickOnBlankToClose = false,\n ...rest\n}) => {\n const drawerDom = React.useRef<EventTarget | null>(null)\n\n useEffect(() => {\n if (clickOnBlankToClose) {\n const handleOutsideClick = (event: Event) => {\n const drawer = drawerDom.current as Node\n const targetElement = event.target as Node\n\n let isInDrawer = false\n if (drawer && targetElement) {\n isInDrawer = drawer.contains(targetElement as Node) || targetElement === drawer\n }\n drawerDom.current = null\n if (rest.visible && !isInDrawer && onClose) {\n onClose()\n }\n }\n document.removeEventListener('click', handleOutsideClick)\n document.addEventListener('click', handleOutsideClick)\n return () => {\n document.removeEventListener('click', handleOutsideClick)\n }\n }\n }, [rest.visible, clickOnBlankToClose, onClose])\n\n return (\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n const prefixCls = getPrefixCls('drawer')\n return (\n <LocaleReceiver componentName=\"Drawer\" defaultLocale={locale}>\n {(locale) => {\n return (\n <div\n onClick={(event: React.MouseEvent<HTMLDivElement>) => {\n drawerDom.current = event.target\n }}\n >\n <AntdDrawer\n className={classNames(prefixCls, 'tnt-drawer', className, {\n [`${prefixCls}-contain-closable`]: closable !== false,\n [`${prefixCls}-footer`]: showFooter,\n })}\n closable={false}\n onClose={onClose}\n width={480}\n {...rest}\n >\n <>\n {closable !== false && (\n <Icon type=\"close\" className={`${prefixCls}-close`} onClick={onClose} />\n )}\n {rest.children}\n {showFooter && (\n <div className={`${prefixCls}-footer-style`}>\n {showFooter && !footer ? (\n <DefaultFooter\n confirmLoading={confirmLoading}\n okButtonProps={okButtonProps}\n cancelButtonProps={cancelButtonProps}\n okType={okType}\n locale={locale}\n okText={okText}\n cancelText={cancelText}\n onClose={onClose}\n onSubmit={onSubmit}\n />\n ) : (\n footer\n )}\n </div>\n )}\n </>\n </AntdDrawer>\n </div>\n )\n }}\n </LocaleReceiver>\n )\n }}\n </ConfigConsumer>\n )\n}\n"]}
1
+ {"version":3,"file":"drawer.js","sourceRoot":"","sources":["../../src/drawer/drawer.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAExD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,gBAAgB,CAAA;AACtD,OAAO,cAAc,MAAM,wCAAwC,CAAA;AACnE,OAAO,UAAU,MAAM,YAAY,CAAA;AAGnC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,KAAK,EAAE,EAAM,SAAS,EAAU,MAAM,OAAO,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,IAAI,MAAM,SAAS,CAAA;AAC1B,MAAM,aAAa,GAAG,CAAC,EACrB,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,MAAM,EACN,UAAU,EACV,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,UAAU,GAeX,EAAE,EAAE;IACH,OAAO,CACL;QACE,oBAAC,MAAM,kBAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,IAAI,SAAS,IAAM,iBAAiB,GAC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IACR,KAAK,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,KAAK;oBAEvE;wBACG,QAAQ,KAAK,KAAK,IAAI,CACrB,oBAAC,IAAI,IAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAE,GAAG,SAAS,QAAQ,EAAE,OAAO,EAAE,SAAS,GAAI,CAC3E;wBACA,IAAI,CAAC,QAAQ;wBACb,CAAC,UAAU,IAAI,MAAM,CAAC,IAAI,CACzB,6BAAK,SAAS,EAAE,GAAG,SAAS,eAAe,IACxC,MAAM,IAAI,CACT,oBAAC,aAAa,IACZ,cAAc,EAAE,cAAc,EAC9B,aAAa,EAAE,aAAa,EAC5B,iBAAiB,EAAE,iBAAiB,EACpC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,KAAK,EACX,QAAQ,EAAE,SAAS,GACnB,CACH,CACG,CACP,CACA,CACQ,CACT,CACP,CAAA;QACH,CAAC,CACc,CAClB,CAAA;IACH,CAAC,CACc,CAClB,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { ConfigConsumer } from 'antd/es/config-provider'\nimport type { DrawerProps as AntdDrawerProps } from 'antd/es/drawer'\nimport { default as AntdDrawer } from 'antd/es/drawer'\nimport LocaleReceiver from 'antd/es/locale-provider/LocaleReceiver'\nimport classNames from 'classnames'\nimport type { BaseButtonProps } from 'antd/es/button/button'\nimport type { TntButtonType } from '../button/button'\nimport { doUpperTitle } from '../utils'\nimport React, { FC, useEffect, useRef } from 'react'\nimport { Button } from '../button'\nimport Icon from '../icon'\nconst DefaultFooter = ({\n locale,\n onCancel,\n onOk,\n okText,\n okType,\n cancelText,\n confirmLoading,\n okButtonProps,\n cancelButtonProps,\n cancelType,\n}: {\n locale?: {\n okText?: string\n cancelText?: string\n }\n onCancel?: () => void\n onOk?: () => void\n okText: string\n cancelText: string\n okType?: TntButtonType\n cancelType: TntButtonType\n confirmLoading?: boolean\n okButtonProps?: BaseButtonProps\n cancelButtonProps?: BaseButtonProps\n}) => {\n return (\n <>\n <Button onClick={onCancel} type={cancelType || 'default'} {...cancelButtonProps}>\n {cancelText || locale?.cancelText}\n </Button>\n <Button onClick={onOk} type={okType || 'primary'} loading={confirmLoading} {...okButtonProps}>\n {okText || locale?.okText}\n </Button>\n </>\n )\n}\n\ninterface CustomDrawerProps extends AntdDrawerProps {\n footer?: React.ReactNode\n showFooter?: boolean\n onClose?: () => void\n onSubmit?: () => void\n onCancel?: () => void\n onOk?: () => void\n okText?: string\n cancelText?: string\n locale?: {\n okText?: string\n cancelText?: string\n }\n okType?: TntButtonType\n cancelType?: TntButtonType\n confirmLoading?: boolean\n okButtonProps?: BaseButtonProps\n cancelButtonProps?: BaseButtonProps\n clickOnBlankToClose: boolean\n upperCaseIgnore?: []\n unUpperConverted: boolean\n}\n\nexport const Drawer: FC<CustomDrawerProps> = ({\n closable = true,\n className,\n footer,\n showFooter,\n onClose,\n onSubmit,\n onCancel,\n onOk,\n okText = '',\n cancelText = '',\n locale,\n okType = 'primary',\n cancelType = 'default',\n confirmLoading = false,\n okButtonProps = {},\n cancelButtonProps = {},\n clickOnBlankToClose = false,\n upperCaseIgnore,\n unUpperConverted,\n title,\n ...rest\n}) => {\n const drawerDom = React.useRef<EventTarget | null>(null)\n const _onCancel = onCancel || onClose\n const _onOk = onOk || onSubmit\n\n useEffect(() => {\n if (clickOnBlankToClose) {\n const handleOutsideClick = (event: Event) => {\n const drawer = drawerDom.current as Node\n const targetElement = event.target as Node\n\n let isInDrawer = false\n if (drawer && targetElement) {\n isInDrawer = drawer.contains(targetElement as Node) || targetElement === drawer\n }\n drawerDom.current = null\n if (rest.visible && !isInDrawer && _onCancel) {\n _onCancel()\n }\n }\n document.removeEventListener('click', handleOutsideClick)\n document.addEventListener('click', handleOutsideClick)\n return () => {\n document.removeEventListener('click', handleOutsideClick)\n }\n }\n }, [rest.visible, clickOnBlankToClose, _onCancel])\n\n return (\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n const prefixCls = getPrefixCls('drawer')\n return (\n <LocaleReceiver componentName=\"Drawer\" defaultLocale={locale}>\n {(locale) => {\n return (\n <div\n onClick={(event: React.MouseEvent<HTMLDivElement>) => {\n drawerDom.current = event.target\n }}\n >\n <AntdDrawer\n className={classNames(prefixCls, 'tnt-drawer', className, {\n [`${prefixCls}-contain-closable`]: closable !== false,\n [`${prefixCls}-footer`]: showFooter || footer,\n })}\n closable={false}\n onClose={_onCancel}\n width={480}\n {...rest}\n title={!unUpperConverted ? doUpperTitle(title, upperCaseIgnore) : title}\n >\n <>\n {closable !== false && (\n <Icon type=\"close\" className={`${prefixCls}-close`} onClick={_onCancel} />\n )}\n {rest.children}\n {(showFooter || footer) && (\n <div className={`${prefixCls}-footer-style`}>\n {footer || (\n <DefaultFooter\n confirmLoading={confirmLoading}\n okButtonProps={okButtonProps}\n cancelButtonProps={cancelButtonProps}\n okType={okType}\n locale={locale}\n okText={okText}\n cancelType={cancelType}\n cancelText={cancelText}\n onOk={_onOk}\n onCancel={_onCancel}\n />\n )}\n </div>\n )}\n </>\n </AntdDrawer>\n </div>\n )\n }}\n </LocaleReceiver>\n )\n }}\n </ConfigConsumer>\n )\n}\n"]}
@@ -20,7 +20,7 @@
20
20
 
21
21
  .@{drawer-prefix-cls}-wrapper-body {
22
22
  margin-top: 48px;
23
- max-height: ~'calc(100vh - 50px)';
23
+ max-height: ~'calc(100vh - 48px)';
24
24
  }
25
25
 
26
26
  &-footer {
@@ -34,7 +34,7 @@
34
34
  }
35
35
 
36
36
  .@{drawer-prefix-cls}-wrapper-body {
37
- max-height: ~'calc(100vh - 98px)' !important;
37
+ max-height: ~'calc(100vh - 96px)' !important;
38
38
  margin-top: 48px !important;
39
39
  margin-bottom: 48px !important;
40
40
  }
@@ -42,16 +42,11 @@
42
42
  }
43
43
 
44
44
  .@{drawer-prefix-cls}-title {
45
- font-size: 14px;
46
- font-weight: 600;
45
+ font-size: 16px !important;
46
+ font-weight: 500 !important;
47
47
  }
48
48
 
49
49
  .@{drawer-prefix-cls}-close {
50
- color: fade(@text-color, 50%);
51
- width: 62px;
52
- top: -4px;
53
-
54
-
55
50
  position: absolute;
56
51
  top: -2px;
57
52
  right: 0;
@@ -133,11 +128,9 @@
133
128
  }
134
129
 
135
130
  .@{drawer-prefix-cls}-body {
136
- padding: @padding-lg !important;
137
-
131
+ padding: 24px !important;
138
132
  }
139
133
 
140
-
141
134
  .@{drawer-prefix-cls}-wrapper-body {
142
135
 
143
136
  .@{drawer-prefix-cls}-footer-style {
@@ -148,6 +141,9 @@
148
141
  padding: 8px 24px;
149
142
  background: #fff;
150
143
  text-align: right;
144
+ .@{ant-prefix}-btn {
145
+ margin-left: 15px;
146
+ }
151
147
  }
152
148
 
153
149
  }
@@ -168,7 +168,7 @@
168
168
  padding: 0;
169
169
  color: @text-color-secondary;
170
170
  font-weight: 700;
171
- font-size: 20px;
171
+ font-size: @font-size-lg;
172
172
  font-style: normal;
173
173
  line-height: 56px;
174
174
  text-align: center;
@@ -180,9 +180,7 @@
180
180
  cursor: pointer;
181
181
  transition: color @animation-duration-slow;
182
182
  text-rendering: auto;
183
- .tntd-anticon {
184
- font-size: 20px;
185
- }
183
+
186
184
  &:focus,
187
185
  &:hover {
188
186
  color: @icon-color-hover;
package/es/form/form.js CHANGED
@@ -40,7 +40,7 @@ Form.Item = forwardRef((_a, ref) => {
40
40
  });
41
41
  const Create = options => WrappedComponent => {
42
42
  const validateSubmitMap = {};
43
- const CustomFormWrapper = props => {
43
+ const CustomFormWrapper = (props, ref) => {
44
44
  const getFieldDecorator = props.form.getFieldDecorator;
45
45
  props.form.getFieldDecorator = (name, options) => {
46
46
  let opt = options || {};
@@ -52,7 +52,9 @@ const Create = options => WrappedComponent => {
52
52
  }
53
53
  return getFieldDecorator(name, opt);
54
54
  };
55
- return React.createElement(WrappedComponent, Object.assign({}, props));
55
+ return React.createElement(WrappedComponent, Object.assign({}, props, {
56
+ ref: ref
57
+ }));
56
58
  };
57
59
  return AntdForm.create(Object.assign(Object.assign({}, options), {
58
60
  onValuesChange: (props, changedValues, allValues) => {
@@ -72,7 +74,7 @@ const Create = options => WrappedComponent => {
72
74
  options.onValuesChange(props, changedValues, allValues);
73
75
  }
74
76
  }
75
- }))(CustomFormWrapper);
77
+ }))(forwardRef(CustomFormWrapper));
76
78
  };
77
79
  Form.createFormField = AntdForm.createFormField;
78
80
  Form.create = Create;
@@ -1 +1 @@
1
- {"version":3,"file":"form.js","sourceRoot":"","sources":["../../src/form/form.tsx"],"names":[],"mappings":";;;;;;;;;;;AAMA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAExD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,cAAc,CAAA;AAGlD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,aAAa,CAAA;AACpB,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,cAAc,cAAc,CAAA;AAW5B,MAAM,CAAC,MAAM,IAAI,GAAG,UAAU,CAA0B,CAAC,EAAW,EAAE,GAAG,EAAE,EAAE;QAAf,IAAI,cAAT,EAAW,CAAF;IAChE,OAAO,CACL,oBAAC,cAAc,QACZ,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE;QACpB,OAAO,oBAAC,QAAQ,oBAAK,IAAI,IAAE,SAAS,EAAE,UAAU,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;IAC5F,CAAC,CACc,CAClB,CAAA;AACH,CAAC,CAAkB,CAAA;AAEnB,IAAI,CAAC,IAAI,GAAG,UAAU,CAAkC,CAAC,EAAkB,EAAE,GAAG,EAAE,EAAE;QAA3B,EAAE,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AAE,EAAE;oBACzB,IAAI,iBAAiB,CAAC,IAAI,CAAC,EAAE;wBAC3B,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC;4BACnB,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE;yBAC9B,CAAC,CAAA;qBACH;gBACH,CAAC,CAAC,CAAA;aACH;YACD,IAAI,OAAO,IAAI,OAAO,CAAC,cAAc,EAAE;gBACrC,OAAO,CAAC,cAAc,CAAC,KAAK,EAAE,aAAa,EAAE,SAAS,CAAC,CAAA;aACxD;QACH,CAAC,IACD,CAAC,iBAAiB,CAAC,CAAA;AACvB,CAAC,CAAA;AAED,IAAI,CAAC,eAAe,GAAG,QAAQ,CAAC,eAAe,CAAA;AAC/C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA","sourcesContent":["import type {\n FormItemProps as AntdFormItemProps,\n FormProps as AntdFormProps,\n FormComponentProps,\n FormCreateOption,\n} from 'antd/es/form'\nimport React, { forwardRef } from 'react'\n\nimport { ConfigConsumer } from 'antd/es/config-provider'\n\nimport { default as AntdForm } from 'antd/es/form'\nimport type AntdFormItem from 'antd/es/form/FormItem'\n\nimport { doUpperTitle } from '../utils'\nimport './form.less'\nimport classNames from 'classnames'\nexport * from 'antd/es/form'\n\ninterface FormItemComponent\n extends React.ForwardRefExoticComponent<AntdFormItemProps & React.RefAttributes<AntdFormItem>> {}\ninterface FormComponent\n extends React.ForwardRefExoticComponent<AntdFormProps & React.RefAttributes<AntdForm>> {\n Item: FormItemComponent\n create: typeof AntdForm.create\n createFormField: typeof AntdForm.createFormField\n}\n\nexport const Form = forwardRef<AntdForm, AntdFormProps>(({ ...rest }, ref) => {\n return (\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n return <AntdForm {...rest} className={classNames(rest.className, 'tnt-form')} ref={ref} />\n }}\n </ConfigConsumer>\n )\n}) as FormComponent\n\nForm.Item = forwardRef<AntdFormItem, AntdFormItemProps>(({ label, ...rest }, ref) => {\n return (\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n return <AntdForm.Item {...rest} label={doUpperTitle(label)} ref={ref} />\n }}\n </ConfigConsumer>\n )\n})\n\n// 定义 create 函数的类型\ntype CreateFunction = <TOwnProps extends FormComponentProps<any>>(\n options?: FormCreateOption<TOwnProps>\n) => any\n\nconst Create: CreateFunction = (options: any) => (WrappedComponent: any) => {\n const validateSubmitMap: any = {}\n const CustomFormWrapper = (props: any) => {\n const getFieldDecorator = props.form.getFieldDecorator\n props.form.getFieldDecorator = (name: any, options: any) => {\n let opt = options || {}\n if (opt.validateSubmit) {\n opt = {\n ...options,\n validateTrigger: 'noEvent',\n }\n validateSubmitMap[name] = true\n }\n return getFieldDecorator(name, opt)\n }\n return <WrappedComponent {...props} />\n }\n\n return AntdForm.create({\n ...options,\n onValuesChange: (props: any, changedValues: any, allValues: any) => {\n const keys = Object.keys(changedValues)\n if (keys.length === 1) {\n keys.forEach((name: any) => {\n if (validateSubmitMap[name]) {\n props.form.setFields({\n [name]: { errors: undefined },\n })\n }\n })\n }\n if (options && options.onValuesChange) {\n options.onValuesChange(props, changedValues, allValues)\n }\n },\n })(CustomFormWrapper)\n}\n\nForm.createFormField = AntdForm.createFormField\nForm.create = Create\n"]}
1
+ {"version":3,"file":"form.js","sourceRoot":"","sources":["../../src/form/form.tsx"],"names":[],"mappings":";;;;;;;;;;;AAMA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAExD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,cAAc,CAAA;AAGlD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,aAAa,CAAA;AACpB,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,cAAc,cAAc,CAAA;AAW5B,MAAM,CAAC,MAAM,IAAI,GAAG,UAAU,CAA0B,CAAC,EAAW,EAAE,GAAG,EAAE,EAAE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,OAAO,iBAAiB,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;QACrC,CAAC,CAAA;QACD,OAAO,oBAAC,gBAAgB,oBAAK,KAAK,IAAE,GAAG,EAAE,GAAG,IAAI,CAAA;IAClD,CAAC,CAAA;IAED,OAAO,QAAQ,CAAC,MAAM,iCACjB,OAAO,KACV,cAAc,EAAE,CAAC,KAAU,EAAE,aAAkB,EAAE,SAAc,EAAE,EAAE;YACjE,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;YACvC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;gBACrB,IAAI,CAAC,OAAO,CAAC,CAAC,IAAS,EAAE,EAAE;oBACzB,IAAI,iBAAiB,CAAC,IAAI,CAAC,EAAE;wBAC3B,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC;4BACnB,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE;yBAC9B,CAAC,CAAA;qBACH;gBACH,CAAC,CAAC,CAAA;aACH;YACD,IAAI,OAAO,IAAI,OAAO,CAAC,cAAc,EAAE;gBACrC,OAAO,CAAC,cAAc,CAAC,KAAK,EAAE,aAAa,EAAE,SAAS,CAAC,CAAA;aACxD;QACH,CAAC,IACD,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAA;AACnC,CAAC,CAAA;AAED,IAAI,CAAC,eAAe,GAAG,QAAQ,CAAC,eAAe,CAAA;AAC/C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA","sourcesContent":["import type {\n FormItemProps as AntdFormItemProps,\n FormProps as AntdFormProps,\n FormComponentProps,\n FormCreateOption,\n} from 'antd/es/form'\nimport React, { forwardRef } from 'react'\n\nimport { ConfigConsumer } from 'antd/es/config-provider'\n\nimport { default as AntdForm } from 'antd/es/form'\nimport type AntdFormItem from 'antd/es/form/FormItem'\n\nimport { doUpperTitle } from '../utils'\nimport './form.less'\nimport classNames from 'classnames'\nexport * from 'antd/es/form'\n\ninterface FormItemComponent\n extends React.ForwardRefExoticComponent<AntdFormItemProps & React.RefAttributes<AntdFormItem>> {}\ninterface FormComponent\n extends React.ForwardRefExoticComponent<AntdFormProps & React.RefAttributes<AntdForm>> {\n Item: FormItemComponent\n create: typeof AntdForm.create\n createFormField: typeof AntdForm.createFormField\n}\n\nexport const Form = forwardRef<AntdForm, AntdFormProps>(({ ...rest }, ref) => {\n return (\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n return <AntdForm {...rest} className={classNames(rest.className, 'tnt-form')} ref={ref} />\n }}\n </ConfigConsumer>\n )\n}) as FormComponent\n\nForm.Item = forwardRef<AntdFormItem, AntdFormItemProps>(({ label, ...rest }, ref) => {\n return (\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n return <AntdForm.Item {...rest} label={doUpperTitle(label)} ref={ref} />\n }}\n </ConfigConsumer>\n )\n})\n\n// 定义 create 函数的类型\ntype CreateFunction = <TOwnProps extends FormComponentProps<any>>(\n options?: FormCreateOption<TOwnProps>\n) => any\n\nconst Create: CreateFunction = (options: any) => (WrappedComponent: any) => {\n const validateSubmitMap: any = {}\n const CustomFormWrapper = (props: any, ref: any) => {\n const getFieldDecorator = props.form.getFieldDecorator\n props.form.getFieldDecorator = (name: any, options: any) => {\n let opt = options || {}\n if (opt.validateSubmit) {\n opt = {\n ...options,\n validateTrigger: 'noEvent',\n }\n validateSubmitMap[name] = true\n }\n return getFieldDecorator(name, opt)\n }\n return <WrappedComponent {...props} ref={ref} />\n }\n\n return AntdForm.create({\n ...options,\n onValuesChange: (props: any, changedValues: any, allValues: any) => {\n const keys = Object.keys(changedValues)\n if (keys.length === 1) {\n keys.forEach((name: any) => {\n if (validateSubmitMap[name]) {\n props.form.setFields({\n [name]: { errors: undefined },\n })\n }\n })\n }\n if (options && options.onValuesChange) {\n options.onValuesChange(props, changedValues, allValues)\n }\n },\n })(forwardRef(CustomFormWrapper))\n}\n\nForm.createFormField = AntdForm.createFormField\nForm.create = Create\n"]}
package/es/form/form.less CHANGED
@@ -1,8 +1,8 @@
1
1
  @form-prefix-cls: ~'@{ant-prefix}-form';
2
2
 
3
- .tnt-form{
4
- .@{form-prefix-cls}-item{
5
- min-height: @input-height-base;
3
+ .tnt-form {
4
+ .@{form-prefix-cls}-item {
5
+ // min-height: @input-height-base;
6
6
 
7
7
  .@{form-prefix-cls}-item-required::before {
8
8
  top: 2px;
@@ -22,7 +22,7 @@
22
22
  line-height: @input-height-base;
23
23
  }
24
24
 
25
- &-children{
25
+ &-children {
26
26
  line-height: calc(@input-height-base - 2px);
27
27
  }
28
28
  }
@@ -31,6 +31,12 @@
31
31
  .@{form-prefix-cls}-extra {
32
32
  margin-top: 4px;
33
33
  }
34
- }
35
-
36
34
 
35
+ &.@{form-prefix-cls}-vertical{
36
+ .@{form-prefix-cls}-item {
37
+ &-label {
38
+ line-height: @line-height-base;
39
+ }
40
+ }
41
+ }
42
+ }
@@ -83,9 +83,9 @@
83
83
  position: relative;
84
84
  }
85
85
 
86
- &-with-help {
87
- margin-bottom: max(0, @form-item-margin-bottom - @form-explain-height - @form-help-margin-top);
88
- }
86
+ // &-with-help {
87
+ // margin-bottom: max(0, @form-item-margin-bottom - @form-explain-height - @form-help-margin-top);
88
+ // }
89
89
 
90
90
  &-label {
91
91
  display: inline-block;
@@ -310,9 +310,9 @@ form {
310
310
  }
311
311
 
312
312
  .@{form-prefix-cls}-vertical {
313
- .@{form-prefix-cls}-item {
314
- padding-bottom: 8px;
315
- }
313
+ // .@{form-prefix-cls}-item {
314
+ // padding-bottom: 8px;
315
+ // }
316
316
  .@{form-prefix-cls}-item-control {
317
317
  line-height: @line-height-base;
318
318
  }
@@ -8,7 +8,7 @@ var __rest = this && this.__rest || function (s, e) {
8
8
  };
9
9
  import React, { Fragment } from 'react';
10
10
  import LocaleReceiver from 'antd/es/locale-provider/LocaleReceiver';
11
- import Icon from '../tntd-icon';
11
+ import Icon from '../icon';
12
12
  import { doUpperTitle } from "../utils/lang";
13
13
  import Divider from '../divider';
14
14
  import Dropdown from '../dropdown';
@@ -25,10 +25,10 @@ export default (props => {
25
25
  type,
26
26
  num = 3,
27
27
  lang,
28
- divider = true,
29
- lessOneMoreFit,
28
+ divider = false,
29
+ lessOneMoreFit = true,
30
30
  popConfirmHandle,
31
- isIconBtn,
31
+ isIconBtn = false,
32
32
  stopPropagation = true,
33
33
  upperCaseIgnore = [],
34
34
  unUpperConverted = false
@@ -128,11 +128,14 @@ export default (props => {
128
128
  e.stopPropagation();
129
129
  }
130
130
  }
131
- }, rest), preChildPart, !!(lastChildPart === null || lastChildPart === void 0 ? void 0 : lastChildPart.length) && React.createElement(Dropdown, {
131
+ }, rest, {
132
+ className: `tnt-handle-wrap ${(rest === null || rest === void 0 ? void 0 : rest.className) || ''}`
133
+ }), preChildPart, !!(lastChildPart === null || lastChildPart === void 0 ? void 0 : lastChildPart.length) && React.createElement(Dropdown, {
132
134
  overlay: menu(lastChildPart || []),
133
135
  arrow: true
134
136
  }, type === 'icon' ? React.createElement(Icon, {
135
- type: "more"
137
+ type: "more",
138
+ className: 'tnt-handle-more'
136
139
  }) : React.createElement("a", {
137
140
  className: "ant-dropdown-more"
138
141
  }, locale === null || locale === void 0 ? void 0 : locale.more, React.createElement("i", {