tntd 2.8.0-beta.8 → 2.8.1

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 (314) hide show
  1. package/es/array-input/index.js +57 -42
  2. package/es/array-input/index.js.map +1 -1
  3. package/es/array-input/index.less +4 -1
  4. package/es/button/button.js +3 -7
  5. package/es/button/button.js.map +1 -1
  6. package/es/button/button.less +7 -0
  7. package/es/button/index.js +1 -0
  8. package/es/button/index.js.map +1 -1
  9. package/es/collapse/collapse.less +3 -3
  10. package/es/descriptions/descriptions.js +85 -24
  11. package/es/descriptions/descriptions.js.map +1 -1
  12. package/es/descriptions/descriptions.less +63 -62
  13. package/es/descriptions/style/index.less +1 -0
  14. package/es/drawer/drawer.js +118 -13
  15. package/es/drawer/drawer.js.map +1 -1
  16. package/es/drawer/index.js +1 -1
  17. package/es/drawer/index.js.map +1 -1
  18. package/es/drawer/index.less +153 -0
  19. package/es/drawer/style/drawer.less +2 -4
  20. package/es/form/form.js +8 -3
  21. package/es/form/form.js.map +1 -1
  22. package/es/form/form.less +42 -0
  23. package/es/form/style/index.less +6 -6
  24. package/es/handle-icon/index.js +201 -0
  25. package/es/handle-icon/index.js.map +1 -0
  26. package/es/handle-icon/index.less +53 -0
  27. package/es/icon/style/style.less +1 -1
  28. package/es/index.js +1 -0
  29. package/es/index.js.map +1 -1
  30. package/es/input/input.js +10 -6
  31. package/es/input/input.js.map +1 -1
  32. package/es/input/style/mixin.less +1 -1
  33. package/es/locale/en_US.js +8 -1
  34. package/es/locale/en_US.js.map +1 -1
  35. package/es/locale/zh_CN.js +8 -1
  36. package/es/locale/zh_CN.js.map +1 -1
  37. package/es/mentions/style/index.less +1 -0
  38. package/es/modal/style/confirm.less +6 -10
  39. package/es/modal/style/modal.less +4 -2
  40. package/es/notification/assets/index.js +2 -0
  41. package/es/notification/assets/index.js.map +1 -0
  42. package/es/notification/assets/svg-error-tip.js +145 -0
  43. package/es/notification/assets/svg-error-tip.js.map +1 -0
  44. package/es/notification/assets/svg-success-tip.js +162 -0
  45. package/es/notification/assets/svg-success-tip.js.map +1 -0
  46. package/es/notification/index.js +1 -1
  47. package/es/notification/index.js.map +1 -1
  48. package/es/notification/notification.js +80 -0
  49. package/es/notification/notification.js.map +1 -0
  50. package/es/notification/notification.less +34 -0
  51. package/es/notification/style/index.less +1 -0
  52. package/es/page-container/index.js +1 -1
  53. package/es/page-container/index.js.map +1 -1
  54. package/es/page-loading/index.js +1 -1
  55. package/es/page-loading/index.js.map +1 -1
  56. package/es/select/select.js +5 -3
  57. package/es/select/select.js.map +1 -1
  58. package/es/select/style/index.less +7 -6
  59. package/es/spin/index.js +3 -2
  60. package/es/spin/index.js.map +1 -1
  61. package/es/spin/spin.js +36 -0
  62. package/es/spin/spin.js.map +1 -0
  63. package/es/spin/spin.less +9 -0
  64. package/es/style/themes/default.less +1 -1
  65. package/es/table/expand.less +49 -0
  66. package/es/table/hooks/index.js +2 -1
  67. package/es/table/hooks/index.js.map +1 -1
  68. package/es/table/hooks/use-expand-fixed.js +80 -0
  69. package/es/table/hooks/use-expand-fixed.js.map +1 -0
  70. package/es/table/index.js +1 -0
  71. package/es/table/index.js.map +1 -1
  72. package/es/table/style/index.less +77 -39
  73. package/es/table/style/size.less +1 -0
  74. package/es/table/table.js +43 -8
  75. package/es/table/table.js.map +1 -1
  76. package/es/table/table.less +5 -5
  77. package/es/table/table.stories.js +413 -2
  78. package/es/table/table.stories.js.map +1 -1
  79. package/es/table/utils.js +11 -0
  80. package/es/table/utils.js.map +1 -1
  81. package/es/table-container/index.js +1 -1
  82. package/es/table-container/index.js.map +1 -1
  83. package/es/table-container/index.less +10 -10
  84. package/es/tabs-container/index.js +1 -1
  85. package/es/tabs-container/index.js.map +1 -1
  86. package/es/tag/color.less +53 -0
  87. package/es/tag/index.js +11 -2
  88. package/es/tag/index.js.map +1 -1
  89. package/es/tag/tag.js +171 -0
  90. package/es/tag/tag.js.map +1 -0
  91. package/es/tag/tag.less +228 -0
  92. package/es/title/index.js +4 -3
  93. package/es/title/index.js.map +1 -1
  94. package/es/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +5 -11
  95. package/es/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js.map +1 -1
  96. package/es/tntd-cascader/AntdCascader/index.less +12 -2
  97. package/es/tntd-cascader/rc-cascader/OptionList/Column.js +3 -2
  98. package/es/tntd-cascader/rc-cascader/OptionList/Column.js.map +1 -1
  99. package/es/tntd-cascader/rc-cascader/OptionList/index.js +1 -0
  100. package/es/tntd-cascader/rc-cascader/OptionList/index.js.map +1 -1
  101. package/es/tntd-form/FormItem/ItemHolder.js +1 -6
  102. package/es/tntd-form/FormItem/ItemHolder.js.map +1 -1
  103. package/es/tntd-form/FormItemLabel.js +2 -0
  104. package/es/tntd-form/FormItemLabel.js.map +1 -1
  105. package/es/tntd-select/index.js +9 -4
  106. package/es/tntd-select/index.js.map +1 -1
  107. package/es/tooltip/index.js +3 -2
  108. package/es/tooltip/index.js.map +1 -1
  109. package/es/tooltip/index.less +29 -0
  110. package/es/tooltip/tooltip.js +33 -0
  111. package/es/tooltip/tooltip.js.map +1 -0
  112. package/lib/array-input/index.d.ts +1 -12
  113. package/lib/array-input/index.d.ts.map +1 -1
  114. package/lib/array-input/index.js +62 -55
  115. package/lib/array-input/index.js.map +1 -1
  116. package/lib/array-input/index.less +4 -1
  117. package/lib/button/button.d.ts.map +1 -1
  118. package/lib/button/button.js +2 -14
  119. package/lib/button/button.js.map +1 -1
  120. package/lib/button/button.less +7 -0
  121. package/lib/button/index.d.ts +1 -0
  122. package/lib/button/index.d.ts.map +1 -1
  123. package/lib/button/index.js +6 -5
  124. package/lib/button/index.js.map +1 -1
  125. package/lib/collapse/collapse.less +3 -3
  126. package/lib/descriptions/descriptions.d.ts +11 -6
  127. package/lib/descriptions/descriptions.d.ts.map +1 -1
  128. package/lib/descriptions/descriptions.js +92 -30
  129. package/lib/descriptions/descriptions.js.map +1 -1
  130. package/lib/descriptions/descriptions.less +63 -62
  131. package/lib/descriptions/style/index.less +1 -0
  132. package/lib/drawer/drawer.d.ts +28 -2
  133. package/lib/drawer/drawer.d.ts.map +1 -1
  134. package/lib/drawer/drawer.js +125 -13
  135. package/lib/drawer/drawer.js.map +1 -1
  136. package/lib/drawer/index.d.ts +1 -1
  137. package/lib/drawer/index.d.ts.map +1 -1
  138. package/lib/drawer/index.js +5 -5
  139. package/lib/drawer/index.js.map +1 -1
  140. package/lib/drawer/index.less +153 -0
  141. package/lib/drawer/style/drawer.less +2 -4
  142. package/lib/form/form.d.ts +1 -0
  143. package/lib/form/form.d.ts.map +1 -1
  144. package/lib/form/form.js +9 -3
  145. package/lib/form/form.js.map +1 -1
  146. package/lib/form/form.less +42 -0
  147. package/lib/form/style/index.less +6 -6
  148. package/lib/handle-icon/index.d.ts +7 -0
  149. package/lib/handle-icon/index.d.ts.map +1 -0
  150. package/lib/handle-icon/index.js +221 -0
  151. package/lib/handle-icon/index.js.map +1 -0
  152. package/lib/handle-icon/index.less +53 -0
  153. package/lib/icon/style/style.less +1 -1
  154. package/lib/index.d.ts +1 -0
  155. package/lib/index.d.ts.map +1 -1
  156. package/lib/index.js +7 -0
  157. package/lib/index.js.map +1 -1
  158. package/lib/input/input.js +8 -4
  159. package/lib/input/input.js.map +1 -1
  160. package/lib/input/style/mixin.less +1 -1
  161. package/lib/locale/default.d.ts +7 -0
  162. package/lib/locale/default.d.ts.map +1 -1
  163. package/lib/locale/en_US.d.ts +7 -0
  164. package/lib/locale/en_US.d.ts.map +1 -1
  165. package/lib/locale/en_US.js +8 -1
  166. package/lib/locale/en_US.js.map +1 -1
  167. package/lib/locale/zh_CN.d.ts +7 -0
  168. package/lib/locale/zh_CN.d.ts.map +1 -1
  169. package/lib/locale/zh_CN.js +8 -1
  170. package/lib/locale/zh_CN.js.map +1 -1
  171. package/lib/mentions/style/index.less +1 -0
  172. package/lib/modal/style/confirm.less +6 -10
  173. package/lib/modal/style/modal.less +4 -2
  174. package/lib/notification/assets/index.d.ts +3 -0
  175. package/lib/notification/assets/index.d.ts.map +1 -0
  176. package/lib/notification/assets/index.js +20 -0
  177. package/lib/notification/assets/index.js.map +1 -0
  178. package/lib/notification/assets/svg-error-tip.d.ts +4 -0
  179. package/lib/notification/assets/svg-error-tip.d.ts.map +1 -0
  180. package/lib/notification/assets/svg-error-tip.js +154 -0
  181. package/lib/notification/assets/svg-error-tip.js.map +1 -0
  182. package/lib/notification/assets/svg-success-tip.d.ts +4 -0
  183. package/lib/notification/assets/svg-success-tip.d.ts.map +1 -0
  184. package/lib/notification/assets/svg-success-tip.js +171 -0
  185. package/lib/notification/assets/svg-success-tip.js.map +1 -0
  186. package/lib/notification/index.d.ts +1 -1
  187. package/lib/notification/index.d.ts.map +1 -1
  188. package/lib/notification/index.js +7 -8
  189. package/lib/notification/index.js.map +1 -1
  190. package/lib/notification/notification.d.ts +9 -0
  191. package/lib/notification/notification.d.ts.map +1 -0
  192. package/lib/notification/notification.js +105 -0
  193. package/lib/notification/notification.js.map +1 -0
  194. package/lib/notification/notification.less +34 -0
  195. package/lib/notification/style/index.less +1 -0
  196. package/lib/page-container/index.js +1 -1
  197. package/lib/page-container/index.js.map +1 -1
  198. package/lib/page-loading/index.js +1 -1
  199. package/lib/page-loading/index.js.map +1 -1
  200. package/lib/segmented/index.d.ts +1 -1
  201. package/lib/select/select.d.ts.map +1 -1
  202. package/lib/select/select.js +4 -2
  203. package/lib/select/select.js.map +1 -1
  204. package/lib/select/style/index.less +7 -6
  205. package/lib/spin/index.d.ts +3 -2
  206. package/lib/spin/index.d.ts.map +1 -1
  207. package/lib/spin/index.js +4 -6
  208. package/lib/spin/index.js.map +1 -1
  209. package/lib/spin/spin.d.ts +9 -0
  210. package/lib/spin/spin.d.ts.map +1 -0
  211. package/lib/spin/spin.js +44 -0
  212. package/lib/spin/spin.js.map +1 -0
  213. package/lib/spin/spin.less +9 -0
  214. package/lib/style/themes/default.less +1 -1
  215. package/lib/svg-components/illustration-403.d.ts +1 -1
  216. package/lib/svg-components/illustration-404.d.ts +1 -1
  217. package/lib/svg-components/illustration-500.d.ts +1 -1
  218. package/lib/svg-components/illustration-empty.d.ts +1 -1
  219. package/lib/svg-components/illustration-failure.d.ts +1 -1
  220. package/lib/svg-components/illustration-no-access.d.ts +1 -1
  221. package/lib/svg-components/illustration-no-chart.d.ts +1 -1
  222. package/lib/svg-components/illustration-no-result.d.ts +1 -1
  223. package/lib/svg-components/illustration-offline.d.ts +1 -1
  224. package/lib/svg-components/illustration-success.d.ts +1 -1
  225. package/lib/table/assets/image-loading-background.d.ts +1 -1
  226. package/lib/table/assets/image-loading.d.ts +1 -1
  227. package/lib/table/expand.less +49 -0
  228. package/lib/table/hooks/index.d.ts +1 -0
  229. package/lib/table/hooks/index.d.ts.map +1 -1
  230. package/lib/table/hooks/index.js +11 -0
  231. package/lib/table/hooks/index.js.map +1 -1
  232. package/lib/table/hooks/use-expand-fixed.d.ts +4 -0
  233. package/lib/table/hooks/use-expand-fixed.d.ts.map +1 -0
  234. package/lib/table/hooks/use-expand-fixed.js +110 -0
  235. package/lib/table/hooks/use-expand-fixed.js.map +1 -0
  236. package/lib/table/index.d.ts +1 -0
  237. package/lib/table/index.d.ts.map +1 -1
  238. package/lib/table/index.js +1 -0
  239. package/lib/table/index.js.map +1 -1
  240. package/lib/table/style/index.less +77 -39
  241. package/lib/table/style/size.less +1 -0
  242. package/lib/table/table.d.ts +3 -1
  243. package/lib/table/table.d.ts.map +1 -1
  244. package/lib/table/table.js +43 -4
  245. package/lib/table/table.js.map +1 -1
  246. package/lib/table/table.less +5 -5
  247. package/lib/table/table.stories.d.ts +106 -29
  248. package/lib/table/table.stories.d.ts.map +1 -1
  249. package/lib/table/table.stories.js +426 -3
  250. package/lib/table/table.stories.js.map +1 -1
  251. package/lib/table/utils.d.ts +1 -0
  252. package/lib/table/utils.d.ts.map +1 -1
  253. package/lib/table/utils.js +13 -0
  254. package/lib/table/utils.js.map +1 -1
  255. package/lib/table-container/index.js +1 -1
  256. package/lib/table-container/index.js.map +1 -1
  257. package/lib/table-container/index.less +10 -10
  258. package/lib/tabs-container/index.js +1 -1
  259. package/lib/tabs-container/index.js.map +1 -1
  260. package/lib/tag/color.less +53 -0
  261. package/lib/tag/index.d.ts +3 -2
  262. package/lib/tag/index.d.ts.map +1 -1
  263. package/lib/tag/index.js +15 -9
  264. package/lib/tag/index.js.map +1 -1
  265. package/lib/tag/tag.d.ts +41 -0
  266. package/lib/tag/tag.d.ts.map +1 -0
  267. package/lib/tag/tag.js +183 -0
  268. package/lib/tag/tag.js.map +1 -0
  269. package/lib/tag/tag.less +228 -0
  270. package/lib/title/index.d.ts +1 -0
  271. package/lib/title/index.d.ts.map +1 -1
  272. package/lib/title/index.js +3 -2
  273. package/lib/title/index.js.map +1 -1
  274. package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.d.ts.map +1 -1
  275. package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +5 -11
  276. package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js.map +1 -1
  277. package/lib/tntd-cascader/AntdCascader/config/utils.d.ts +1 -1
  278. package/lib/tntd-cascader/AntdCascader/index.less +12 -2
  279. package/lib/tntd-cascader/rc-cascader/OptionList/Column.d.ts +1 -1
  280. package/lib/tntd-cascader/rc-cascader/OptionList/Column.d.ts.map +1 -1
  281. package/lib/tntd-cascader/rc-cascader/OptionList/Column.js +3 -2
  282. package/lib/tntd-cascader/rc-cascader/OptionList/Column.js.map +1 -1
  283. package/lib/tntd-cascader/rc-cascader/OptionList/index.d.ts.map +1 -1
  284. package/lib/tntd-cascader/rc-cascader/OptionList/index.js +1 -0
  285. package/lib/tntd-cascader/rc-cascader/OptionList/index.js.map +1 -1
  286. package/lib/tntd-form/FormItem/ItemHolder.js +1 -6
  287. package/lib/tntd-form/FormItem/ItemHolder.js.map +1 -1
  288. package/lib/tntd-form/FormItemLabel.d.ts.map +1 -1
  289. package/lib/tntd-form/FormItemLabel.js +2 -0
  290. package/lib/tntd-form/FormItemLabel.js.map +1 -1
  291. package/lib/tntd-rc-select/_util/PurePanel.d.ts +1 -1
  292. package/lib/tntd-select/index.d.ts.map +1 -1
  293. package/lib/tntd-select/index.js +8 -3
  294. package/lib/tntd-select/index.js.map +1 -1
  295. package/lib/tooltip/index.d.ts +3 -2
  296. package/lib/tooltip/index.d.ts.map +1 -1
  297. package/lib/tooltip/index.js +3 -2
  298. package/lib/tooltip/index.js.map +1 -1
  299. package/lib/tooltip/index.less +29 -0
  300. package/lib/tooltip/tooltip.d.ts +9 -0
  301. package/lib/tooltip/tooltip.d.ts.map +1 -0
  302. package/lib/tooltip/tooltip.js +53 -0
  303. package/lib/tooltip/tooltip.js.map +1 -0
  304. package/package.json +4 -3
  305. package/themes/default/variables.less +2 -2
  306. package/themes/default/variablesVar.less +2 -2
  307. package/es/array-input/icon.js +0 -25
  308. package/es/array-input/icon.js.map +0 -1
  309. package/es/drawer/drawer.less +0 -20
  310. package/lib/array-input/icon.d.ts +0 -4
  311. package/lib/array-input/icon.d.ts.map +0 -1
  312. package/lib/array-input/icon.js +0 -32
  313. package/lib/array-input/icon.js.map +0 -1
  314. package/lib/drawer/drawer.less +0 -20
@@ -0,0 +1,53 @@
1
+ @preset-colors-custom: grey, green, red, gold, lightblue, bluegrey, purplegrey, purple, lightpurple, lightgreen, pink, rose, orange, magenta, volcano, yellow, cyan, lime, geekblue, tnt-pink, tnt-orange, tnt-purple;
2
+
3
+
4
+ @grey-7: @text-color-secondary;
5
+ @grey-5: #8b919e;
6
+ @grey-4: @border-color-base;
7
+ @grey-1: @tag-default-bg;
8
+
9
+ @rose-7:#D8395E;
10
+ @rose-5: #EE3E67;
11
+ @rose-4: #FEA3B4;
12
+ @rose-1: #FFF1F3;
13
+
14
+ @lightblue-7: #1AA9E6;
15
+ @lightblue-5: #36BFFA;
16
+ @lightblue-4: #8FE0FF;
17
+ @lightblue-1: #F0F9FF;
18
+
19
+ @bluegrey-7: #486FBB;
20
+ @bluegrey-5: #628FE4;
21
+ @bluegrey-4: #A1BCEF;
22
+ @bluegrey-1: #F4F8FF;
23
+
24
+ @purplegrey-7: #4E5BA6;
25
+ @purplegrey-5: #717BBC;
26
+ @purplegrey-4: #AFB5D9;
27
+ @purplegrey-1: #F8F9FC;
28
+
29
+ @tnt-purple-7: #6E54D4;
30
+ @tnt-purple-5: #7A5AF8;
31
+ @tnt-purple-4: #BDB4FE;
32
+ @tnt-purple-1: #F4F3FF;
33
+
34
+ @lightpurple-7: #5161D7;
35
+ @lightpurple-5: #6172F3;
36
+ @lightpurple-4: #A4BCFD;
37
+ @lightpurple-1: #EEF4FF;
38
+
39
+ @lightgreen-7: #2E9C98;
40
+ @lightgreen-5: #3AB4AF;
41
+ @lightgreen-4: #8CE0DD;
42
+ @lightgreen-1: #F1FBFB;
43
+
44
+ @tnt-pink-7: #D03E93;
45
+ @tnt-pink-5: #E844B7;
46
+ @tnt-pink-4: #FAA7E0;
47
+ @tnt-pink-1: #FDF2FA;
48
+
49
+ @tnt-orange-7:#DF5F28;
50
+ @tnt-orange-5:#F47345;
51
+ @tnt-orange-4: #FEB173;
52
+ @tnt-orange-1: #FFF6ED;
53
+
@@ -1,5 +1,6 @@
1
- import Tag from 'antd/lib/tag';
2
1
  import './style';
3
- export * from 'antd/lib/tag';
2
+ import './tag.less';
3
+ import { Tag } from './tag';
4
+ export * from './tag';
4
5
  export default Tag;
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tag/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,SAAS,CAAA;AAEhB,cAAc,aAAa,CAAA;AAE3B,eAAe,GAAG,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tag/index.ts"],"names":[],"mappings":"AAQA,OAAO,SAAS,CAAA;AAChB,OAAO,YAAY,CAAA;AACnB,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAE3B,cAAc,OAAO,CAAA;AAErB,eAAe,GAAG,CAAA"}
package/lib/tag/index.js CHANGED
@@ -1,24 +1,30 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  var _exportNames = {};
8
7
  exports["default"] = void 0;
9
- var _tag = _interopRequireWildcard(require("antd/lib/tag"));
10
- Object.keys(_tag).forEach(function (key) {
8
+ require("./style");
9
+ require("./tag.less");
10
+ var _tag2 = require("./tag");
11
+ Object.keys(_tag2).forEach(function (key) {
11
12
  if (key === "default" || key === "__esModule") return;
12
13
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
13
- if (key in exports && exports[key] === _tag[key]) return;
14
+ if (key in exports && exports[key] === _tag2[key]) return;
14
15
  Object.defineProperty(exports, key, {
15
16
  enumerable: true,
16
17
  get: function get() {
17
- return _tag[key];
18
+ return _tag2[key];
18
19
  }
19
20
  });
20
21
  });
21
- require("./style");
22
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
23
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
24
- var _default = exports["default"] = _tag["default"];
22
+ /*
23
+ * @Author: 周泽飞 zefei.zhou@tongdun.net
24
+ * @Date: 2024-02-29 14:21:28
25
+ * @LastEditors: 周泽飞 zefei.zhou@tongdun.net
26
+ * @LastEditTime: 2024-05-24 23:01:30
27
+ * @FilePath: /tntd/packages/tntd/src/tag/index.ts
28
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
29
+ */
30
+ var _default = exports["default"] = _tag2.Tag;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tag/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,sDAA6B;AAE7B,mBAAgB;AAEhB,8CAA2B;AAE3B,kBAAe,aAAG,CAAA","sourcesContent":["import Tag from 'antd/lib/tag'\n\nimport './style'\n\nexport * from 'antd/lib/tag'\n\nexport default Tag\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tag/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;GAOG;AACH,mBAAgB;AAChB,sBAAmB;AACnB,+BAA2B;AAE3B,wCAAqB;AAErB,kBAAe,SAAG,CAAA","sourcesContent":["/*\n * @Author: 周泽飞 zefei.zhou@tongdun.net\n * @Date: 2024-02-29 14:21:28\n * @LastEditors: 周泽飞 zefei.zhou@tongdun.net\n * @LastEditTime: 2024-05-24 23:01:30\n * @FilePath: /tntd/packages/tntd/src/tag/index.ts\n * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE\n */\nimport './style'\nimport './tag.less'\nimport { Tag } from './tag'\n\nexport * from './tag'\n\nexport default Tag\n"]}
@@ -0,0 +1,41 @@
1
+ import React from 'react';
2
+ import type { TagProps as AntdTagProps } from 'antd/lib/tag';
3
+ import type { CheckableTagProps as AntdCheckableTagProps } from 'antd/lib/tag';
4
+ import { default as AntdTag } from 'antd/lib/tag';
5
+ export * from 'antd/lib/tag';
6
+ export declare enum TagColors {
7
+ grey = "grey",
8
+ rose = "rose",
9
+ lightblue = "lightblue",
10
+ bluegrey = "bluegrey",
11
+ purplegrey = "purplegrey",
12
+ lightpurple = "lightpurple",
13
+ lightgreen = "lightgreen",
14
+ 'tnt-pink' = "tnt-pink",
15
+ 'tnt-orange' = "tnt-orange",
16
+ 'tnt-purple' = "tnt-purple"
17
+ }
18
+ export interface TagProps extends AntdTagProps {
19
+ color?: TagColors | string;
20
+ size?: 'small' | 'middle' | 'large';
21
+ border?: boolean;
22
+ addonContent?: React.ReactNode;
23
+ addonPosition?: 'prefix' | 'suffix';
24
+ addonType?: 'success' | 'info' | 'warning' | 'error';
25
+ ellipsisOptions?: {
26
+ Popover?: boolean;
27
+ emptyText?: string;
28
+ widthLimit?: number | string;
29
+ lines?: number;
30
+ [key: string]: unknown;
31
+ };
32
+ }
33
+ export interface CheckableTagProps extends AntdCheckableTagProps {
34
+ disabled?: boolean;
35
+ border?: boolean;
36
+ }
37
+ interface TagComponent extends React.ForwardRefExoticComponent<TagProps & React.RefAttributes<AntdTag>> {
38
+ CheckableTag: React.FC<CheckableTagProps>;
39
+ }
40
+ export declare const Tag: TagComponent;
41
+ //# sourceMappingURL=tag.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../src/tag/tag.tsx"],"names":[],"mappings":"AAQA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAClD,OAAO,KAAK,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,aAAa,CAAA;AAC3D,OAAO,KAAK,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAE7E,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,aAAa,CAAA;AAMhD,cAAc,aAAa,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ports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _exportNames = {
7
+ TagColors: true,
8
+ Tag: true
9
+ };
10
+ exports.TagColors = exports.Tag = void 0;
11
+ var _react = _interopRequireWildcard(require("react"));
12
+ var _configProvider = require("antd/lib/config-provider");
13
+ var _tag = _interopRequireWildcard(require("antd/lib/tag"));
14
+ Object.keys(_tag).forEach(function (key) {
15
+ if (key === "default" || key === "__esModule") return;
16
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
17
+ if (key in exports && exports[key] === _tag[key]) return;
18
+ Object.defineProperty(exports, key, {
19
+ enumerable: true,
20
+ get: function get() {
21
+ return _tag[key];
22
+ }
23
+ });
24
+ });
25
+ var _classnames = _interopRequireDefault(require("classnames"));
26
+ var _ellipsis = _interopRequireDefault(require("../ellipsis"));
27
+ var _icon = _interopRequireDefault(require("../icon"));
28
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
29
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
30
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
31
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
32
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
33
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
34
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
35
+ var __rest = void 0 && (void 0).__rest || function (s, e) {
36
+ var t = {};
37
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
38
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
39
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
40
+ }
41
+ return t;
42
+ };
43
+ /*
44
+ * @Author: 周泽飞 zefei.zhou@tongdun.net
45
+ * @Date: 2024-03-04 19:15:22
46
+ * @LastEditors: 周泽飞 zefei.zhou@tongdun.net
47
+ * @LastEditTime: 2024-03-11 10:10:31
48
+ * @FilePath: /tntd/packages/tntd/src/tag/tag.tsx
49
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
50
+ */
51
+
52
+ var TagColors;
53
+ (function (TagColors) {
54
+ TagColors["grey"] = "grey";
55
+ TagColors["rose"] = "rose";
56
+ TagColors["lightblue"] = "lightblue";
57
+ TagColors["bluegrey"] = "bluegrey";
58
+ TagColors["purplegrey"] = "purplegrey";
59
+ TagColors["lightpurple"] = "lightpurple";
60
+ TagColors["lightgreen"] = "lightgreen";
61
+ TagColors["tnt-pink"] = "tnt-pink";
62
+ TagColors["tnt-orange"] = "tnt-orange";
63
+ TagColors["tnt-purple"] = "tnt-purple";
64
+ })(TagColors || (exports.TagColors = TagColors = {}));
65
+ // 内置的状态
66
+ var statusMap = {
67
+ success: {
68
+ icon: 'check-circle',
69
+ color: 'green'
70
+ },
71
+ info: {
72
+ icon: 'info-circle',
73
+ color: 'blue'
74
+ },
75
+ error: {
76
+ icon: 'close-circle',
77
+ color: 'red'
78
+ },
79
+ warning: {
80
+ icon: 'info-circle',
81
+ color: 'orange'
82
+ }
83
+ };
84
+ var getDisplayEllipsisOptions = function getDisplayEllipsisOptions(props, prefixCls) {
85
+ var _a;
86
+ var _ref = props || {},
87
+ ellipsisOptions = _ref.ellipsisOptions,
88
+ addonContent = _ref.addonContent,
89
+ addonType = _ref.addonType,
90
+ addonPosition = _ref.addonPosition,
91
+ children = _ref.children;
92
+ var options = Object.assign({}, ellipsisOptions);
93
+ var addonContentInfo = null;
94
+ if (addonContent) {
95
+ addonContentInfo = addonContent;
96
+ } else if (addonType && statusMap[addonType]) {
97
+ addonContentInfo = _react["default"].createElement(_icon["default"], {
98
+ type: (_a = statusMap[addonType]) === null || _a === void 0 ? void 0 : _a.icon
99
+ });
100
+ }
101
+ if (addonContentInfo) {
102
+ addonContentInfo = _react["default"].createElement("span", {
103
+ className: "".concat(prefixCls, "-addon")
104
+ }, addonContentInfo);
105
+ if (addonPosition === 'prefix') {
106
+ options.prefix = addonContentInfo;
107
+ }
108
+ if (addonPosition === 'suffix') {
109
+ options.suffix = addonContentInfo;
110
+ }
111
+ if (options.Popover === true) {
112
+ options.content = children;
113
+ } else {
114
+ options.title = children;
115
+ }
116
+ options.contentInfo = addonContentInfo;
117
+ }
118
+ return options;
119
+ };
120
+ var Tag = exports.Tag = (0, _react.forwardRef)(function (props, ref) {
121
+ var _a;
122
+ var className = props.className,
123
+ _props$border = props.border,
124
+ border = _props$border === void 0 ? true : _props$border,
125
+ size = props.size,
126
+ addonType = props.addonType,
127
+ addonContent = props.addonContent,
128
+ _props$addonPosition = props.addonPosition,
129
+ addonPosition = _props$addonPosition === void 0 ? 'prefix' : _props$addonPosition,
130
+ ellipsisOptions = props.ellipsisOptions,
131
+ children = props.children,
132
+ restProps = __rest(props, ["className", "border", "size", "addonType", "addonContent", "addonPosition", "ellipsisOptions", "children"]);
133
+ var _ref2 = props || {},
134
+ color = _ref2.color;
135
+ if (!color && addonType) {
136
+ color = (_a = statusMap[addonType]) === null || _a === void 0 ? void 0 : _a.color;
137
+ }
138
+ return _react["default"].createElement(_configProvider.ConfigConsumer, null, function (_ref3) {
139
+ var getPrefixCls = _ref3.getPrefixCls;
140
+ var _a, _b, _c, _d, _e;
141
+ var prefixCls = getPrefixCls('tag');
142
+ var displayEllipsisOptions = getDisplayEllipsisOptions({
143
+ ellipsisOptions: ellipsisOptions,
144
+ addonContent: addonContent,
145
+ addonType: addonType,
146
+ addonPosition: addonPosition,
147
+ children: children
148
+ }, prefixCls);
149
+ // 只有一个icon时 padding距离存在差异
150
+ var onlyIcon = _react["default"].isValidElement(children) && _react["default"].Children.only(children) && (children === null || children === void 0 ? void 0 : children.type) instanceof Function && ((_c = (_b = (_a = children === null || children === void 0 ? void 0 : children.type) === null || _a === void 0 ? void 0 : _a.name) === null || _b === void 0 ? void 0 : _b.toLowerCase) === null || _c === void 0 ? void 0 : _c.call(_b)) === 'icon';
151
+ // 前缀是图片 只处理一层节点下是图片的,否则就用户自定义样式
152
+ var addonIsImg = _react["default"].isValidElement(addonContent) && (addonContent === null || addonContent === void 0 ? void 0 : addonContent.type) && typeof (addonContent === null || addonContent === void 0 ? void 0 : addonContent.type) === 'string' && ((_e = (_d = addonContent === null || addonContent === void 0 ? void 0 : addonContent.type) === null || _d === void 0 ? void 0 : _d.toLowerCase) === null || _e === void 0 ? void 0 : _e.call(_d)) === 'img';
153
+ return _react["default"].createElement(_tag["default"], Object.assign({
154
+ className: (0, _classnames["default"])(_defineProperty({}, "".concat(prefixCls, "-").concat(color), color && !!TagColors[color]), 'tnt-tag', "".concat(prefixCls, "-").concat(size || 'middle'), _defineProperty({}, "".concat(prefixCls, "-no-border"), !border), _defineProperty({}, "".concat(prefixCls, "-only-child"), !children || onlyIcon), _defineProperty({}, "".concat(prefixCls, "-addon-img"), !!addonIsImg), className || '')
155
+ }, restProps, {
156
+ color: !TagColors[color] ? color : '',
157
+ ref: ref
158
+ }), !addonContent && !addonType && !ellipsisOptions && children, (!!addonContent || !!addonType || !!ellipsisOptions) && _react["default"].createElement("span", {
159
+ className: "".concat(prefixCls, "-addon-wrap")
160
+ }, !!children && _react["default"].createElement(_ellipsis["default"], Object.assign({}, displayEllipsisOptions), children), !children && (displayEllipsisOptions === null || displayEllipsisOptions === void 0 ? void 0 : displayEllipsisOptions.contentInfo)));
161
+ });
162
+ });
163
+ Tag.CheckableTag = (0, _react.forwardRef)(function (props, ref) {
164
+ // 默认没有border
165
+ var _a = props || {},
166
+ onChange = _a.onChange,
167
+ disabled = _a.disabled,
168
+ _a$border = _a.border,
169
+ border = _a$border === void 0 ? false : _a$border,
170
+ className = _a.className,
171
+ rest = __rest(_a, ["onChange", "disabled", "border", "className"]);
172
+ return _react["default"].createElement(_configProvider.ConfigConsumer, null, function (_ref4) {
173
+ var getPrefixCls = _ref4.getPrefixCls;
174
+ var prefixCls = getPrefixCls('tag-checkable');
175
+ return _react["default"].createElement(_tag["default"].CheckableTag, Object.assign({}, !disabled && {
176
+ onChange: onChange
177
+ }, {
178
+ className: (0, _classnames["default"])('tnt-tag', _defineProperty(_defineProperty({}, "".concat(prefixCls, "-disabled"), disabled), "".concat(prefixCls, "-border"), !!border))
179
+ }, rest, {
180
+ ref: ref
181
+ }));
182
+ });
183
+ });
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tag.js","sourceRoot":"","sources":["../../src/tag/tag.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;GAOG;AACH,+CAAkD;AAGlD,6DAAwD;AACxD,sDAAgD;AAEhD,4DA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2024-03-04 19:15:22\n * @LastEditors: 周泽飞 zefei.zhou@tongdun.net\n * @LastEditTime: 2024-03-11 10:10:31\n * @FilePath: /tntd/packages/tntd/src/tag/tag.tsx\n * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE\n */\nimport React, { useMemo, forwardRef } from 'react'\nimport type { TagProps as AntdTagProps } from 'antd/lib/tag'\nimport type { CheckableTagProps as AntdCheckableTagProps } from 'antd/lib/tag'\nimport { ConfigConsumer } from 'antd/lib/config-provider'\nimport { default as AntdTag } from 'antd/lib/tag'\nimport type AntdCheckableTag from 'antd/lib/tag/CheckableTag'\nimport classNames from 'classnames'\nimport Ellipsis from '../ellipsis'\nimport Icon from '../icon'\n\nexport * from 'antd/lib/tag'\n\nexport enum TagColors {\n grey = 'grey',\n rose = 'rose',\n lightblue = 'lightblue',\n bluegrey = 'bluegrey',\n purplegrey = 'purplegrey',\n lightpurple = 'lightpurple',\n lightgreen = 'lightgreen',\n 'tnt-pink' = 'tnt-pink',\n 'tnt-orange' = 'tnt-orange',\n 'tnt-purple' = 'tnt-purple',\n}\n\n// 内置的状态\nconst statusMap = {\n success: {\n icon: 'check-circle',\n color: 'green',\n },\n info: {\n icon: 'info-circle',\n color: 'blue',\n },\n error: {\n icon: 'close-circle',\n color: 'red',\n },\n warning: {\n icon: 'info-circle',\n color: 'orange',\n },\n}\n\nexport interface TagProps extends AntdTagProps {\n color?: TagColors | string\n size?: 'small' | 'middle' | 'large'\n border?: boolean\n addonContent?: React.ReactNode\n addonPosition?: 'prefix' | 'suffix'\n addonType?: 'success' | 'info' | 'warning' | 'error'\n ellipsisOptions?: {\n Popover?: boolean\n emptyText?: string\n widthLimit?: number | string\n lines?: number\n [key: string]: unknown\n }\n}\n\nexport interface CheckableTagProps extends AntdCheckableTagProps {\n disabled?: boolean\n border?: boolean\n}\n\ninterface TagComponent\n extends React.ForwardRefExoticComponent<TagProps & React.RefAttributes<AntdTag>> {\n CheckableTag: React.FC<CheckableTagProps>\n}\n\nconst getDisplayEllipsisOptions = (props: TagProps, prefixCls: string) => {\n const { ellipsisOptions, addonContent, addonType, addonPosition, children } = props || {}\n const options = {\n ...ellipsisOptions,\n }\n\n let addonContentInfo = null\n if (addonContent) {\n addonContentInfo = addonContent\n } else if (addonType && statusMap[addonType]) {\n addonContentInfo = <Icon type={statusMap[addonType]?.icon} />\n }\n\n if (addonContentInfo) {\n addonContentInfo = <span className={`${prefixCls}-addon`}>{addonContentInfo}</span>\n if (addonPosition === 'prefix') {\n options.prefix = addonContentInfo\n }\n\n if (addonPosition === 'suffix') {\n options.suffix = addonContentInfo\n }\n\n if (options.Popover === true) {\n options.content = children\n } else {\n options.title = children\n }\n options.contentInfo = addonContentInfo\n }\n\n return options\n}\n\nexport const Tag = forwardRef<AntdTag, TagProps & { capitalize?: boolean }>((props, ref) => {\n const {\n className,\n border = true,\n size,\n addonType,\n addonContent,\n addonPosition = 'prefix',\n ellipsisOptions,\n children,\n ...restProps\n } = props\n\n let { color } = props || {}\n if (!color && addonType) {\n color = statusMap[addonType]?.color\n }\n\n return (\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n const prefixCls = getPrefixCls('tag')\n\n const displayEllipsisOptions = getDisplayEllipsisOptions(\n {\n ellipsisOptions,\n addonContent,\n addonType,\n addonPosition,\n children,\n },\n prefixCls\n )\n\n // 只有一个icon时 padding距离存在差异\n const onlyIcon =\n React.isValidElement(children) &&\n React.Children.only(children) &&\n children?.type instanceof Function &&\n children?.type?.name?.toLowerCase?.() === 'icon'\n\n // 前缀是图片 只处理一层节点下是图片的,否则就用户自定义样式\n const addonIsImg =\n React.isValidElement(addonContent) &&\n addonContent?.type &&\n typeof addonContent?.type === 'string' &&\n addonContent?.type?.toLowerCase?.() === 'img'\n\n return (\n <AntdTag\n className={classNames(\n {\n [`${prefixCls}-${color}`]: color && !!TagColors[color as keyof typeof TagColors],\n },\n 'tnt-tag',\n `${prefixCls}-${size || 'middle'}`,\n {\n [`${prefixCls}-no-border`]: !border,\n },\n {\n [`${prefixCls}-only-child`]: !children || onlyIcon,\n },\n {\n [`${prefixCls}-addon-img`]: !!addonIsImg,\n },\n className || ''\n )}\n {...restProps}\n color={!TagColors[color as keyof typeof TagColors] ? color : ''}\n ref={ref}\n >\n {!addonContent && !addonType && !ellipsisOptions && children}\n {(!!addonContent || !!addonType || !!ellipsisOptions) && (\n <span className={`${prefixCls}-addon-wrap`}>\n {!!children && <Ellipsis {...displayEllipsisOptions}>{children}</Ellipsis>}\n {!children && displayEllipsisOptions?.contentInfo}\n </span>\n )}\n </AntdTag>\n )\n }}\n </ConfigConsumer>\n )\n}) as TagComponent\n\nTag.CheckableTag = forwardRef<AntdCheckableTag, CheckableTagProps>(\n (props: CheckableTagProps, ref) => {\n // 默认没有border\n const { onChange, disabled, border = false, className, ...rest } = props || {}\n return (\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n const prefixCls = getPrefixCls('tag-checkable')\n return (\n <AntdTag.CheckableTag\n {...(!disabled && { onChange })}\n className={classNames('tnt-tag', {\n [`${prefixCls}-disabled`]: disabled,\n [`${prefixCls}-border`]: !!border,\n })}\n {...rest}\n ref={ref}\n />\n )\n }}\n </ConfigConsumer>\n )\n }\n)\n"]}
@@ -0,0 +1,228 @@
1
+ @import '../style/mixins/index';
2
+ @import './color.less';
3
+ @tag-prefix-cls: ~'@{ant-prefix}-tag';
4
+ // 默认
5
+ @tag-height: 20px;
6
+ @tag-small-size: 0 7px;
7
+ @tag-middle-size: 0 7px;
8
+ @tag-large-size: 3px 12px;
9
+
10
+ // img tag
11
+ @tag-img-small-size: 1px 5px 1px 3px;
12
+ @tag-img-middle-size: 2px 6px 2px 3px;
13
+ @tag-img-large-size: 3px 12px 3px 4px;
14
+
15
+ // 只有icon的尺寸
16
+ @tag-only-icon-small-size: 5px;
17
+ @tag-only-icon-middle-size: 6px;
18
+ @tag-only-icon-large-size: 7px;
19
+
20
+ .tnt-tag.@{tag-prefix-cls} {
21
+ line-height: @tag-height;
22
+
23
+ .@{iconfont-css-prefix}-close {
24
+ // .iconfont-size-under-12px(10px);
25
+ vertical-align: middle;
26
+ line-height: 1;
27
+ }
28
+
29
+ .anticon{
30
+ font-size: @font-size-sm;
31
+ }
32
+
33
+ // 头像插件 可以为icon 图片
34
+ .@{tag-prefix-cls}-addon-wrap{
35
+ display: inline-block;
36
+ vertical-align: middle;
37
+ margin-top: -1px;
38
+ .@{tag-prefix-cls}-addon{
39
+ .iconfont-size-under-12px(12px);
40
+ display: flex;
41
+ align-items: center;
42
+ justify-content: center;
43
+ }
44
+
45
+ .tntd-ellipsis,.tnt-ellipsis{
46
+ align-items: center;
47
+ .@{tag-prefix-cls}-addon{
48
+ >*{
49
+ border-radius: 100%;
50
+ overflow: hidden;
51
+ display: block;
52
+ }
53
+ +*{
54
+ margin-left: 4px;
55
+ }
56
+ }
57
+ }
58
+ }
59
+
60
+ &-small{
61
+ padding: @tag-small-size;
62
+ }
63
+ &-middle{
64
+ padding: @tag-middle-size;
65
+ }
66
+ &-large{
67
+ padding: @tag-large-size;
68
+ font-size: 14px;
69
+ }
70
+
71
+ // 不带边框
72
+ &.@{tag-prefix-cls}-no-border{
73
+ border-color:transparent;
74
+ }
75
+
76
+ // 只有一个icon
77
+ &.@{tag-prefix-cls}-only-child{
78
+ line-height: @font-size-sm;
79
+ &.@{tag-prefix-cls}-small{
80
+ padding: @tag-only-icon-small-size;
81
+ }
82
+ &.@{tag-prefix-cls}-middle{
83
+ padding: @tag-only-icon-middle-size;
84
+ }
85
+ &.@{tag-prefix-cls}-large{
86
+ padding: @tag-only-icon-large-size;
87
+ }
88
+ }
89
+
90
+ // 带图片
91
+ &.@{tag-prefix-cls}-addon-img{
92
+ &.@{tag-prefix-cls}-small{
93
+ padding: @tag-img-small-size;
94
+ .@{tag-prefix-cls}-addon{
95
+ width: 16px;
96
+ height: 16px;
97
+ }
98
+ }
99
+ &.@{tag-prefix-cls}-middle{
100
+ padding: @tag-img-middle-size;
101
+ .@{tag-prefix-cls}-addon{
102
+ width: 18px;
103
+ height: 18px;
104
+ }
105
+ }
106
+ &.@{tag-prefix-cls}-large{
107
+ padding: @tag-img-large-size;
108
+ .@{tag-prefix-cls}-addon{
109
+ width: 20px;
110
+ height: 20px;
111
+ }
112
+ }
113
+ }
114
+
115
+ &.@{tag-prefix-cls}-blue {
116
+ color: @blue-6;
117
+ background: @blue-1;
118
+ border-color: @blue-3;
119
+ >.@{iconfont-css-prefix}-close {
120
+ color: @blue-5;
121
+ }
122
+ &.@{tag-prefix-cls}-no-border{
123
+ border-color:transparent;
124
+ }
125
+ }
126
+ &.@{tag-prefix-cls}-blue-inverse {
127
+ color: @text-color-inverse;
128
+ background: @blue-6;
129
+ border-color: @blue-6;
130
+ >.@{iconfont-css-prefix}-close {
131
+ color: @text-color-inverse;
132
+ }
133
+ &.@{tag-prefix-cls}-no-border{
134
+ border-color:transparent;
135
+ }
136
+ }
137
+
138
+ // mixin to iterate over colors and create CSS class for each one
139
+ .make-color-classes(@i: length(@preset-colors-custom)) when (@i > 0) {
140
+ .make-color-classes(@i - 1);
141
+ @color: extract(@preset-colors-custom, @i);
142
+ @lightColor: '@{color}-1';
143
+ @lightBorderColor: '@{color}-4';
144
+ @darkColor: '@{color}-7';
145
+ @closeColor:'@{color}-5';
146
+ &.@{tag-prefix-cls}-@{color} {
147
+ color: @@darkColor;
148
+ background: @@lightColor;
149
+ border-color: @@lightBorderColor;
150
+ >.@{iconfont-css-prefix}-close {
151
+ color: @@closeColor;
152
+ }
153
+ &.@{tag-prefix-cls}-no-border{
154
+ border-color:transparent;
155
+ }
156
+ }
157
+ &.@{tag-prefix-cls}-@{color}-inverse {
158
+ color: @text-color-inverse;
159
+ background: @@darkColor;
160
+ border-color: @@darkColor;
161
+ >.@{iconfont-css-prefix}-close {
162
+ color: @text-color-inverse;
163
+ }
164
+ &.@{tag-prefix-cls}-no-border{
165
+ border-color:transparent;
166
+ }
167
+ }
168
+ }
169
+
170
+ .make-color-classes();
171
+
172
+
173
+
174
+ // 可选
175
+ &.@{tag-prefix-cls}-checkable {
176
+ background-color: @tag-default-bg;
177
+ border-color: transparent;
178
+ padding: 2px 12px;
179
+ cursor: pointer;
180
+ &-border{
181
+ border-color: @border-color-base;
182
+ // 非disabled
183
+ &:not(.@{tag-prefix-cls}-checkable-disabled):hover {
184
+ border-color: @primary-3;
185
+ }
186
+ }
187
+
188
+ &:not(.@{tag-prefix-cls}-checkable-disabled):hover {
189
+ color: @primary-6;
190
+ background-color: @primary-1;
191
+ transition: all 0.3s @ease-in-out-circ;
192
+ }
193
+
194
+ &:active,
195
+ &-checked {
196
+ color: @primary-6;
197
+ background-color: @primary-1;
198
+ &.@{tag-prefix-cls}-checkable-border{
199
+ border-color: @primary-3;
200
+ }
201
+ }
202
+
203
+ &-checked {
204
+ &.@{tag-prefix-cls}-checkable-disabled:hover {
205
+ color: @primary-6;
206
+ }
207
+ }
208
+
209
+ &:not(&-checked){
210
+ &.@{tag-prefix-cls}-checkable-disabled:hover {
211
+ color: inherit;
212
+ }
213
+ }
214
+
215
+ &-disabled{
216
+ opacity: 0.5;
217
+ cursor: not-allowed;
218
+ &:hover{
219
+ opacity: 0.5;
220
+ color: inherit;
221
+ }
222
+ }
223
+ }
224
+
225
+ }
226
+
227
+
228
+
@@ -3,6 +3,7 @@ import './index.less';
3
3
  export interface TitleProps extends ComponentProps<'div'> {
4
4
  title?: string;
5
5
  subTitle?: string;
6
+ className?: string;
6
7
  size?: 'default' | 'small' | 'middle' | 'large';
7
8
  extra?: React.ReactNode;
8
9
  number?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/title/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAM,cAAc,EAAE,MAAM,OAAO,CAAA;AAGjD,OAAO,cAAc,CAAA;AAErB,MAAM,WAAW,UAAW,SAAQ,cAAc,CAAC,KAAK,CAAC;IACvD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IAC/C,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;gCAEsB,UAAU;AAAjC,wBAwBC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/title/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAM,cAAc,EAAE,MAAM,OAAO,CAAA;AAGjD,OAAO,cAAc,CAAA;AAErB,MAAM,WAAW,UAAW,SAAQ,cAAc,CAAC,KAAK,CAAC;IACvD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IAC/C,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;gCAEsB,UAAU;AAAjC,wBA+BC"}
@@ -27,9 +27,10 @@ var _default = exports["default"] = function _default(props) {
27
27
  extra = _a.extra,
28
28
  number = _a.number,
29
29
  simple = _a.simple,
30
- rest = __rest(_a, ["title", "subTitle", "size", "extra", "number", "simple"]);
30
+ className = _a.className,
31
+ rest = __rest(_a, ["title", "subTitle", "size", "extra", "number", "simple", "className"]);
31
32
  return _react["default"].createElement("div", Object.assign({
32
- className: (0, _classnames["default"])('tntd-title', size, {
33
+ className: (0, _classnames["default"])('tntd-title', className, size, {
33
34
  'has-number': number
34
35
  }, {
35
36
  'is-simple': simple
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/title/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAiD;AACjD,4DAA2B;AAC3B,oCAAuC;AACvC,wBAAqB;AAWrB,kBAAe,CAAC,KAAiB,EAAE,EAAE;IACnC,MAAM,KAQF,KAAK,IAAI,EAAE,EART,EACJ,KAAK,GAAG,MAAM,EACd,QAAQ,EACR,IAAI,GAAG,SAAS,EAChB,KAAK,EACL,MAAM,EACN,MAAM,OAEO,EADV,IAAI,cAPH,0DAQL,CAAc,CAAA;IAEf,OAAO,CACL,qDACE,SAAS,EAAE,IAAA,oBAAE,EAAC,YAAY,EAAE,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,IAChF,IAAI;QAER,uCAAK,SAAS,EAAC,iBAAiB;YAC7B,MAAM,IAAI,qCAAG,SAAS,EAAC,OAAO,IAAE,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,CAAK;YACzE,0CAAK,IAAA,oBAAY,EAAC,KAAK,CAAC,CAAM;YAC9B,4CAAO,QAAQ,CAAQ,CACnB;QACL,KAAK,IAAI,uCAAK,SAAS,EAAC,kBAAkB,IAAE,KAAK,CAAO,CACrD,CACP,CAAA;AACH,CAAC,CAAA","sourcesContent":["import React, { FC, ComponentProps } from 'react'\nimport cn from 'classnames'\nimport { doUpperTitle } from '../utils'\nimport './index.less'\n\nexport interface TitleProps extends ComponentProps<'div'> {\n title?: string\n subTitle?: string\n size?: 'default' | 'small' | 'middle' | 'large'\n extra?: React.ReactNode\n number?: number\n simple?: boolean\n}\n\nexport default (props: TitleProps) => {\n const {\n title = '暂无标题',\n subTitle,\n size = 'default',\n extra,\n number,\n simple,\n ...rest\n } = props || {}\n\n return (\n <div\n className={cn('tntd-title', size, { 'has-number': number }, { 'is-simple': simple })}\n {...rest}\n >\n <div className=\"tntd-title-text\">\n {number && <i className=\"count\">{number <= 9 ? `0${number}` : number}</i>}\n <h3>{doUpperTitle(title)}</h3>\n <span>{subTitle}</span>\n </div>\n {extra && <div className=\"tntd-title-extra\">{extra}</div>}\n </div>\n )\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/title/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAiD;AACjD,4DAA2B;AAC3B,oCAAuC;AACvC,wBAAqB;AAYrB,kBAAe,CAAC,KAAiB,EAAE,EAAE;IACnC,MAAM,KASF,KAAK,IAAI,EAAE,EATT,EACJ,KAAK,GAAG,MAAM,EACd,QAAQ,EACR,IAAI,GAAG,SAAS,EAChB,KAAK,EACL,MAAM,EACN,MAAM,EACN,SAAS,OAEI,EADV,IAAI,cARH,uEASL,CAAc,CAAA;IAEf,OAAO,CACL,qDACE,SAAS,EAAE,IAAA,oBAAE,EACX,YAAY,EACZ,SAAS,EACT,IAAI,EACJ,EAAE,YAAY,EAAE,MAAM,EAAE,EACxB,EAAE,WAAW,EAAE,MAAM,EAAE,CACxB,IACG,IAAI;QAER,uCAAK,SAAS,EAAC,iBAAiB;YAC7B,MAAM,IAAI,qCAAG,SAAS,EAAC,OAAO,IAAE,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,CAAK;YACzE,0CAAK,IAAA,oBAAY,EAAC,KAAK,CAAC,CAAM;YAC9B,4CAAO,QAAQ,CAAQ,CACnB;QACL,KAAK,IAAI,uCAAK,SAAS,EAAC,kBAAkB,IAAE,KAAK,CAAO,CACrD,CACP,CAAA;AACH,CAAC,CAAA","sourcesContent":["import React, { FC, ComponentProps } from 'react'\nimport cn from 'classnames'\nimport { doUpperTitle } from '../utils'\nimport './index.less'\n\nexport interface TitleProps extends ComponentProps<'div'> {\n title?: string\n subTitle?: string\n className?: string\n size?: 'default' | 'small' | 'middle' | 'large'\n extra?: React.ReactNode\n number?: number\n simple?: boolean\n}\n\nexport default (props: TitleProps) => {\n const {\n title = '暂无标题',\n subTitle,\n size = 'default',\n extra,\n number,\n simple,\n className,\n ...rest\n } = props || {}\n\n return (\n <div\n className={cn(\n 'tntd-title',\n className,\n size,\n { 'has-number': number },\n { 'is-simple': simple }\n )}\n {...rest}\n >\n <div className=\"tntd-title-text\">\n {number && <i className=\"count\">{number <= 9 ? `0${number}` : number}</i>}\n <h3>{doUpperTitle(title)}</h3>\n <span>{subTitle}</span>\n </div>\n {extra && <div className=\"tntd-title-extra\">{extra}</div>}\n </div>\n )\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"defaultRenderEmpty.d.ts","sourceRoot":"","sources":["../../../../src/tntd-cascader/AntdCascader/component/defaultRenderEmpty.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,QAAA,MAAM,kBAAkB,kBAAmB,MAAM,sBAwBhD,CAAA;AAED,oBAAY,kBAAkB,GAAG,OAAO,kBAAkB,CAAA;AAE1D,eAAe,kBAAkB,CAAA"}
1
+ {"version":3,"file":"defaultRenderEmpty.d.ts","sourceRoot":"","sources":["../../../../src/tntd-cascader/AntdCascader/component/defaultRenderEmpty.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,QAAA,MAAM,kBAAkB,kBAAmB,MAAM,sBAkBhD,CAAA;AAED,oBAAY,kBAAkB,GAAG,OAAO,kBAAkB,CAAA;AAE1D,eAAe,kBAAkB,CAAA"}