tntd 2.8.0-beta.9 → 2.8.2

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 (308) 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 +31 -21
  15. package/es/drawer/drawer.js.map +1 -1
  16. package/es/drawer/index.less +11 -12
  17. package/es/form/form.js +8 -3
  18. package/es/form/form.js.map +1 -1
  19. package/es/form/form.less +42 -0
  20. package/es/form/style/index.less +6 -6
  21. package/es/handle/index.js +2 -1
  22. package/es/handle/index.js.map +1 -1
  23. package/es/handle-icon/index.js +202 -0
  24. package/es/handle-icon/index.js.map +1 -0
  25. package/es/handle-icon/index.less +53 -0
  26. package/es/icon/style/style.less +1 -1
  27. package/es/index.js +1 -0
  28. package/es/index.js.map +1 -1
  29. package/es/input/input.js +10 -6
  30. package/es/input/input.js.map +1 -1
  31. package/es/input/style/mixin.less +1 -1
  32. package/es/locale/en_US.js +3 -0
  33. package/es/locale/en_US.js.map +1 -1
  34. package/es/locale/zh_CN.js +3 -0
  35. package/es/locale/zh_CN.js.map +1 -1
  36. package/es/mentions/style/index.less +1 -0
  37. package/es/modal/style/confirm.less +6 -10
  38. package/es/modal/style/modal.less +4 -2
  39. package/es/notification/assets/index.js +2 -0
  40. package/es/notification/assets/index.js.map +1 -0
  41. package/es/notification/assets/svg-error-tip.js +145 -0
  42. package/es/notification/assets/svg-error-tip.js.map +1 -0
  43. package/es/notification/assets/svg-success-tip.js +162 -0
  44. package/es/notification/assets/svg-success-tip.js.map +1 -0
  45. package/es/notification/index.js +1 -1
  46. package/es/notification/index.js.map +1 -1
  47. package/es/notification/notification.js +80 -0
  48. package/es/notification/notification.js.map +1 -0
  49. package/es/notification/notification.less +34 -0
  50. package/es/notification/style/index.less +1 -0
  51. package/es/page-container/index.js +1 -1
  52. package/es/page-container/index.js.map +1 -1
  53. package/es/page-loading/index.js +1 -1
  54. package/es/page-loading/index.js.map +1 -1
  55. package/es/select/select.js +5 -3
  56. package/es/select/select.js.map +1 -1
  57. package/es/select/style/index.less +7 -6
  58. package/es/spin/index.js.map +1 -1
  59. package/es/spin/spin.js +36 -0
  60. package/es/spin/spin.js.map +1 -0
  61. package/es/spin/spin.less +9 -0
  62. package/es/style/themes/default.less +1 -1
  63. package/es/table/expand.less +49 -0
  64. package/es/table/hooks/index.js +2 -1
  65. package/es/table/hooks/index.js.map +1 -1
  66. package/es/table/hooks/use-expand-fixed.js +80 -0
  67. package/es/table/hooks/use-expand-fixed.js.map +1 -0
  68. package/es/table/index.js +1 -0
  69. package/es/table/index.js.map +1 -1
  70. package/es/table/style/index.less +77 -39
  71. package/es/table/style/size.less +1 -0
  72. package/es/table/table.js +43 -8
  73. package/es/table/table.js.map +1 -1
  74. package/es/table/table.less +5 -5
  75. package/es/table/table.stories.js +413 -2
  76. package/es/table/table.stories.js.map +1 -1
  77. package/es/table/utils.js +11 -0
  78. package/es/table/utils.js.map +1 -1
  79. package/es/table-container/index.js +1 -1
  80. package/es/table-container/index.js.map +1 -1
  81. package/es/table-container/index.less +10 -10
  82. package/es/tabs-container/index.js +1 -1
  83. package/es/tabs-container/index.js.map +1 -1
  84. package/es/tag/color.less +53 -0
  85. package/es/tag/index.js +11 -2
  86. package/es/tag/index.js.map +1 -1
  87. package/es/tag/tag.js +171 -0
  88. package/es/tag/tag.js.map +1 -0
  89. package/es/tag/tag.less +228 -0
  90. package/es/title/index.js +4 -3
  91. package/es/title/index.js.map +1 -1
  92. package/es/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +5 -11
  93. package/es/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js.map +1 -1
  94. package/es/tntd-cascader/AntdCascader/index.less +12 -2
  95. package/es/tntd-cascader/rc-cascader/OptionList/Column.js +3 -2
  96. package/es/tntd-cascader/rc-cascader/OptionList/Column.js.map +1 -1
  97. package/es/tntd-cascader/rc-cascader/OptionList/index.js +1 -0
  98. package/es/tntd-cascader/rc-cascader/OptionList/index.js.map +1 -1
  99. package/es/tntd-form/FormItem/ItemHolder.js +1 -6
  100. package/es/tntd-form/FormItem/ItemHolder.js.map +1 -1
  101. package/es/tntd-form/FormItemLabel.js +2 -0
  102. package/es/tntd-form/FormItemLabel.js.map +1 -1
  103. package/es/tntd-select/index.js +9 -4
  104. package/es/tntd-select/index.js.map +1 -1
  105. package/es/tooltip/index.js +3 -2
  106. package/es/tooltip/index.js.map +1 -1
  107. package/es/tooltip/index.less +29 -0
  108. package/es/tooltip/tooltip.js +33 -0
  109. package/es/tooltip/tooltip.js.map +1 -0
  110. package/lib/array-input/index.d.ts +1 -12
  111. package/lib/array-input/index.d.ts.map +1 -1
  112. package/lib/array-input/index.js +62 -55
  113. package/lib/array-input/index.js.map +1 -1
  114. package/lib/array-input/index.less +4 -1
  115. package/lib/button/button.d.ts.map +1 -1
  116. package/lib/button/button.js +2 -14
  117. package/lib/button/button.js.map +1 -1
  118. package/lib/button/button.less +7 -0
  119. package/lib/button/index.d.ts +1 -0
  120. package/lib/button/index.d.ts.map +1 -1
  121. package/lib/button/index.js +6 -5
  122. package/lib/button/index.js.map +1 -1
  123. package/lib/collapse/collapse.less +3 -3
  124. package/lib/descriptions/descriptions.d.ts +11 -6
  125. package/lib/descriptions/descriptions.d.ts.map +1 -1
  126. package/lib/descriptions/descriptions.js +92 -30
  127. package/lib/descriptions/descriptions.js.map +1 -1
  128. package/lib/descriptions/descriptions.less +63 -62
  129. package/lib/descriptions/style/index.less +1 -0
  130. package/lib/drawer/drawer.d.ts +3 -0
  131. package/lib/drawer/drawer.d.ts.map +1 -1
  132. package/lib/drawer/drawer.js +29 -19
  133. package/lib/drawer/drawer.js.map +1 -1
  134. package/lib/drawer/index.less +11 -12
  135. package/lib/form/form.d.ts +1 -0
  136. package/lib/form/form.d.ts.map +1 -1
  137. package/lib/form/form.js +9 -3
  138. package/lib/form/form.js.map +1 -1
  139. package/lib/form/form.less +42 -0
  140. package/lib/form/style/index.less +6 -6
  141. package/lib/handle/index.d.ts.map +1 -1
  142. package/lib/handle/index.js +2 -1
  143. package/lib/handle/index.js.map +1 -1
  144. package/lib/handle-icon/index.d.ts +7 -0
  145. package/lib/handle-icon/index.d.ts.map +1 -0
  146. package/lib/handle-icon/index.js +222 -0
  147. package/lib/handle-icon/index.js.map +1 -0
  148. package/lib/handle-icon/index.less +53 -0
  149. package/lib/icon/style/style.less +1 -1
  150. package/lib/index.d.ts +1 -0
  151. package/lib/index.d.ts.map +1 -1
  152. package/lib/index.js +7 -0
  153. package/lib/index.js.map +1 -1
  154. package/lib/input/input.js +8 -4
  155. package/lib/input/input.js.map +1 -1
  156. package/lib/input/style/mixin.less +1 -1
  157. package/lib/locale/default.d.ts +3 -0
  158. package/lib/locale/default.d.ts.map +1 -1
  159. package/lib/locale/en_US.d.ts +3 -0
  160. package/lib/locale/en_US.d.ts.map +1 -1
  161. package/lib/locale/en_US.js +3 -0
  162. package/lib/locale/en_US.js.map +1 -1
  163. package/lib/locale/zh_CN.d.ts +3 -0
  164. package/lib/locale/zh_CN.d.ts.map +1 -1
  165. package/lib/locale/zh_CN.js +3 -0
  166. package/lib/locale/zh_CN.js.map +1 -1
  167. package/lib/mentions/style/index.less +1 -0
  168. package/lib/modal/style/confirm.less +6 -10
  169. package/lib/modal/style/modal.less +4 -2
  170. package/lib/notification/assets/index.d.ts +3 -0
  171. package/lib/notification/assets/index.d.ts.map +1 -0
  172. package/lib/notification/assets/index.js +20 -0
  173. package/lib/notification/assets/index.js.map +1 -0
  174. package/lib/notification/assets/svg-error-tip.d.ts +4 -0
  175. package/lib/notification/assets/svg-error-tip.d.ts.map +1 -0
  176. package/lib/notification/assets/svg-error-tip.js +154 -0
  177. package/lib/notification/assets/svg-error-tip.js.map +1 -0
  178. package/lib/notification/assets/svg-success-tip.d.ts +4 -0
  179. package/lib/notification/assets/svg-success-tip.d.ts.map +1 -0
  180. package/lib/notification/assets/svg-success-tip.js +171 -0
  181. package/lib/notification/assets/svg-success-tip.js.map +1 -0
  182. package/lib/notification/index.d.ts +1 -1
  183. package/lib/notification/index.d.ts.map +1 -1
  184. package/lib/notification/index.js +7 -8
  185. package/lib/notification/index.js.map +1 -1
  186. package/lib/notification/notification.d.ts +9 -0
  187. package/lib/notification/notification.d.ts.map +1 -0
  188. package/lib/notification/notification.js +105 -0
  189. package/lib/notification/notification.js.map +1 -0
  190. package/lib/notification/notification.less +34 -0
  191. package/lib/notification/style/index.less +1 -0
  192. package/lib/page-container/index.js +1 -1
  193. package/lib/page-container/index.js.map +1 -1
  194. package/lib/page-loading/index.js +1 -1
  195. package/lib/page-loading/index.js.map +1 -1
  196. package/lib/segmented/index.d.ts +1 -1
  197. package/lib/select/select.d.ts.map +1 -1
  198. package/lib/select/select.js +4 -2
  199. package/lib/select/select.js.map +1 -1
  200. package/lib/select/style/index.less +7 -6
  201. package/lib/spin/index.d.ts.map +1 -1
  202. package/lib/spin/index.js.map +1 -1
  203. package/lib/spin/spin.d.ts +9 -0
  204. package/lib/spin/spin.d.ts.map +1 -0
  205. package/lib/spin/spin.js +44 -0
  206. package/lib/spin/spin.js.map +1 -0
  207. package/lib/spin/spin.less +9 -0
  208. package/lib/style/themes/default.less +1 -1
  209. package/lib/svg-components/illustration-403.d.ts +1 -1
  210. package/lib/svg-components/illustration-404.d.ts +1 -1
  211. package/lib/svg-components/illustration-500.d.ts +1 -1
  212. package/lib/svg-components/illustration-empty.d.ts +1 -1
  213. package/lib/svg-components/illustration-failure.d.ts +1 -1
  214. package/lib/svg-components/illustration-no-access.d.ts +1 -1
  215. package/lib/svg-components/illustration-no-chart.d.ts +1 -1
  216. package/lib/svg-components/illustration-no-result.d.ts +1 -1
  217. package/lib/svg-components/illustration-offline.d.ts +1 -1
  218. package/lib/svg-components/illustration-success.d.ts +1 -1
  219. package/lib/table/assets/image-loading-background.d.ts +1 -1
  220. package/lib/table/assets/image-loading.d.ts +1 -1
  221. package/lib/table/expand.less +49 -0
  222. package/lib/table/hooks/index.d.ts +1 -0
  223. package/lib/table/hooks/index.d.ts.map +1 -1
  224. package/lib/table/hooks/index.js +11 -0
  225. package/lib/table/hooks/index.js.map +1 -1
  226. package/lib/table/hooks/use-expand-fixed.d.ts +4 -0
  227. package/lib/table/hooks/use-expand-fixed.d.ts.map +1 -0
  228. package/lib/table/hooks/use-expand-fixed.js +110 -0
  229. package/lib/table/hooks/use-expand-fixed.js.map +1 -0
  230. package/lib/table/index.d.ts +1 -0
  231. package/lib/table/index.d.ts.map +1 -1
  232. package/lib/table/index.js +1 -0
  233. package/lib/table/index.js.map +1 -1
  234. package/lib/table/style/index.less +77 -39
  235. package/lib/table/style/size.less +1 -0
  236. package/lib/table/table.d.ts +3 -1
  237. package/lib/table/table.d.ts.map +1 -1
  238. package/lib/table/table.js +43 -4
  239. package/lib/table/table.js.map +1 -1
  240. package/lib/table/table.less +5 -5
  241. package/lib/table/table.stories.d.ts +106 -29
  242. package/lib/table/table.stories.d.ts.map +1 -1
  243. package/lib/table/table.stories.js +426 -3
  244. package/lib/table/table.stories.js.map +1 -1
  245. package/lib/table/utils.d.ts +1 -0
  246. package/lib/table/utils.d.ts.map +1 -1
  247. package/lib/table/utils.js +13 -0
  248. package/lib/table/utils.js.map +1 -1
  249. package/lib/table-container/index.js +1 -1
  250. package/lib/table-container/index.js.map +1 -1
  251. package/lib/table-container/index.less +10 -10
  252. package/lib/tabs-container/index.js +1 -1
  253. package/lib/tabs-container/index.js.map +1 -1
  254. package/lib/tag/color.less +53 -0
  255. package/lib/tag/index.d.ts +3 -2
  256. package/lib/tag/index.d.ts.map +1 -1
  257. package/lib/tag/index.js +15 -9
  258. package/lib/tag/index.js.map +1 -1
  259. package/lib/tag/tag.d.ts +41 -0
  260. package/lib/tag/tag.d.ts.map +1 -0
  261. package/lib/tag/tag.js +183 -0
  262. package/lib/tag/tag.js.map +1 -0
  263. package/lib/tag/tag.less +228 -0
  264. package/lib/title/index.d.ts +1 -0
  265. package/lib/title/index.d.ts.map +1 -1
  266. package/lib/title/index.js +3 -2
  267. package/lib/title/index.js.map +1 -1
  268. package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.d.ts.map +1 -1
  269. package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +5 -11
  270. package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js.map +1 -1
  271. package/lib/tntd-cascader/AntdCascader/config/utils.d.ts +1 -1
  272. package/lib/tntd-cascader/AntdCascader/index.less +12 -2
  273. package/lib/tntd-cascader/rc-cascader/OptionList/Column.d.ts +1 -1
  274. package/lib/tntd-cascader/rc-cascader/OptionList/Column.d.ts.map +1 -1
  275. package/lib/tntd-cascader/rc-cascader/OptionList/Column.js +3 -2
  276. package/lib/tntd-cascader/rc-cascader/OptionList/Column.js.map +1 -1
  277. package/lib/tntd-cascader/rc-cascader/OptionList/index.d.ts.map +1 -1
  278. package/lib/tntd-cascader/rc-cascader/OptionList/index.js +1 -0
  279. package/lib/tntd-cascader/rc-cascader/OptionList/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-form/FormItemLabel.d.ts.map +1 -1
  283. package/lib/tntd-form/FormItemLabel.js +2 -0
  284. package/lib/tntd-form/FormItemLabel.js.map +1 -1
  285. package/lib/tntd-rc-select/_util/PurePanel.d.ts +1 -1
  286. package/lib/tntd-select/index.d.ts.map +1 -1
  287. package/lib/tntd-select/index.js +8 -3
  288. package/lib/tntd-select/index.js.map +1 -1
  289. package/lib/tooltip/index.d.ts +3 -2
  290. package/lib/tooltip/index.d.ts.map +1 -1
  291. package/lib/tooltip/index.js +3 -2
  292. package/lib/tooltip/index.js.map +1 -1
  293. package/lib/tooltip/index.less +29 -0
  294. package/lib/tooltip/tooltip.d.ts +9 -0
  295. package/lib/tooltip/tooltip.d.ts.map +1 -0
  296. package/lib/tooltip/tooltip.js +53 -0
  297. package/lib/tooltip/tooltip.js.map +1 -0
  298. package/package.json +4 -3
  299. package/themes/default/variables.less +2 -2
  300. package/themes/default/variablesVar.less +2 -2
  301. package/es/array-input/icon.js +0 -25
  302. package/es/array-input/icon.js.map +0 -1
  303. package/es/drawer/drawer.less +0 -20
  304. package/lib/array-input/icon.d.ts +0 -4
  305. package/lib/array-input/icon.d.ts.map +0 -1
  306. package/lib/array-input/icon.js +0 -32
  307. package/lib/array-input/icon.js.map +0 -1
  308. package/lib/drawer/drawer.less +0 -20
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/table/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,aAAa,oBAyBhE"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/table/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,aAAa,oBAyBhE;AAID,wBAAgB,cAAc,CAAC,GAAG,SAAK,UAoCtC"}
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.makeRandomCode = makeRandomCode;
6
7
  exports.normalizeColumns = normalizeColumns;
7
8
  var _react = _interopRequireDefault(require("react"));
8
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -23,4 +24,16 @@ function normalizeColumns(elements) {
23
24
  columns.push(column);
24
25
  });
25
26
  return columns;
27
+ }
28
+ // 生成随机数,首位是字母
29
+ function makeRandomCode() {
30
+ var num = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
31
+ var numArr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
32
+ var charArr = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
33
+ var arr = [].concat(numArr, charArr);
34
+ var code = charArr[Math.floor(Math.random() * charArr.length)];
35
+ for (var i = 0; i < num - 1; i++) {
36
+ code += "".concat(arr[Math.floor(Math.random() * arr.length)]);
37
+ }
38
+ return code;
26
39
  }
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/table/utils.ts"],"names":[],"mappings":";;;;;;AACA,kDAAyB;AAEzB,SAAgB,gBAAgB,CAAI,QAA6B;IAC/D,MAAM,OAAO,GAAqB,EAAE,CAAA;IAEpC,eAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,EAAE;QAC3C,IAAI,CAAC,eAAK,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE;YAClC,OAAM;SACP;QAED,MAAM,MAAM,qBACN,OAAO,CAAC,KAAwB,CACrC,CAAA;QAED,IAAI,OAAO,CAAC,GAAG,EAAE;YACf,MAAM,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAA;SACzB;QAED,8DAA8D;QAC9D,IAAI,OAAO,CAAC,IAAI,IAAK,OAAO,CAAC,IAAY,CAAC,wBAAwB,EAAE;YAClE,MAAM,CAAC,QAAQ,GAAG,gBAAgB,CAAC,MAAM,CAAC,QAAiB,CAAC,CAAA;SAC7D;QAED,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACtB,CAAC,CAAC,CAAA;IAEF,OAAO,OAAO,CAAA;AAChB,CAAC;AAzBD,4CAyBC","sourcesContent":["import type { ColumnProps } from 'antd/lib/table'\nimport React from 'react'\n\nexport function normalizeColumns<T>(elements: React.ReactChildren) {\n const columns: ColumnProps<T>[] = []\n\n React.Children.forEach(elements, (element) => {\n if (!React.isValidElement(element)) {\n return\n }\n\n const column = {\n ...(element.props as ColumnProps<T>),\n }\n\n if (element.key) {\n column.key = element.key\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (element.type && (element.type as any).__ANT_TABLE_COLUMN_GROUP) {\n column.children = normalizeColumns(column.children as never)\n }\n\n columns.push(column)\n })\n\n return columns\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/table/utils.ts"],"names":[],"mappings":";;;;;;AACA,kDAAyB;AAEzB,SAAgB,gBAAgB,CAAI,QAA6B;IAC/D,MAAM,OAAO,GAAqB,EAAE,CAAA;IAEpC,eAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,EAAE;QAC3C,IAAI,CAAC,eAAK,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE;YAClC,OAAM;SACP;QAED,MAAM,MAAM,qBACN,OAAO,CAAC,KAAwB,CACrC,CAAA;QAED,IAAI,OAAO,CAAC,GAAG,EAAE;YACf,MAAM,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAA;SACzB;QAED,8DAA8D;QAC9D,IAAI,OAAO,CAAC,IAAI,IAAK,OAAO,CAAC,IAAY,CAAC,wBAAwB,EAAE;YAClE,MAAM,CAAC,QAAQ,GAAG,gBAAgB,CAAC,MAAM,CAAC,QAAiB,CAAC,CAAA;SAC7D;QAED,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACtB,CAAC,CAAC,CAAA;IAEF,OAAO,OAAO,CAAA;AAChB,CAAC;AAzBD,4CAyBC;AAED,cAAc;AAEd,SAAgB,cAAc,CAAC,GAAG,GAAG,EAAE;IACrC,MAAM,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;IAC7C,MAAM,OAAO,GAAG;QACd,GAAG;QACH,GAAG;QACH,GAAG;QACH,GAAG;QACH,GAAG;QACH,GAAG;QACH,GAAG;QACH,GAAG;QACH,GAAG;QACH,GAAG;QACH,GAAG;QACH,GAAG;QACH,GAAG;QACH,GAAG;QACH,GAAG;QACH,GAAG;QACH,GAAG;QACH,GAAG;QACH,GAAG;QACH,GAAG;QACH,GAAG;QACH,GAAG;QACH,GAAG;QACH,GAAG;QACH,GAAG;QACH,GAAG;KACJ,CAAA;IACD,MAAM,GAAG,GAAG,CAAC,GAAG,MAAM,EAAE,GAAG,OAAO,CAAC,CAAA;IACnC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAA;IAC9D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;QAChC,IAAI,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAA;KACzD;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AApCD,wCAoCC","sourcesContent":["import type { ColumnProps } from 'antd/lib/table'\nimport React from 'react'\n\nexport function normalizeColumns<T>(elements: React.ReactChildren) {\n const columns: ColumnProps<T>[] = []\n\n React.Children.forEach(elements, (element) => {\n if (!React.isValidElement(element)) {\n return\n }\n\n const column = {\n ...(element.props as ColumnProps<T>),\n }\n\n if (element.key) {\n column.key = element.key\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (element.type && (element.type as any).__ANT_TABLE_COLUMN_GROUP) {\n column.children = normalizeColumns(column.children as never)\n }\n\n columns.push(column)\n })\n\n return columns\n}\n\n// 生成随机数,首位是字母\n\nexport function makeRandomCode(num = 10) {\n const numArr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n const charArr = [\n 'a',\n 'b',\n 'c',\n 'd',\n 'e',\n 'f',\n 'g',\n 'h',\n 'i',\n 'j',\n 'k',\n 'l',\n 'm',\n 'n',\n 'o',\n 'p',\n 'q',\n 'r',\n 's',\n 't',\n 'u',\n 'v',\n 'w',\n 'x',\n 'y',\n 'z',\n ]\n const arr = [...numArr, ...charArr]\n let code = charArr[Math.floor(Math.random() * charArr.length)]\n for (let i = 0; i < num - 1; i++) {\n code += `${arr[Math.floor(Math.random() * arr.length)]}`\n }\n return code\n}\n"]}
@@ -12,7 +12,7 @@ var _default = exports["default"] = function _default(WrappedComponent) {
12
12
  var version = options.version,
13
13
  _options$className = options.className,
14
14
  className = _options$className === void 0 ? '' : _options$className;
15
- var currentVersion = version || localStorage.getItem('app_version') || 'v2';
15
+ var currentVersion = version || 'v2';
16
16
  return function (props) {
17
17
  return React.createElement("div", {
18
18
  className: (0, _classnames["default"])('tnt-table-v-container', 'tnt-current-' + currentVersion, className)
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/table-container/index.js"],"names":[],"mappings":";;;;;AAAA,4DAA2B;AAE3B,wBAAsB;AAEtB,kBAAe,CAAC,gBAAgB,EAAE,OAAO,GAAG,EAAE,EAAE,EAAE;IAC9C,MAAM,EAAE,OAAO,EAAE,SAAS,GAAG,EAAE,EAAE,GAAG,OAAO,CAAA;IAC3C,MAAM,cAAc,GAAG,OAAO,IAAI,YAAY,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,IAAI,CAAC;IAE9E,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CACd,6BAAK,SAAS,EAAE,IAAA,oBAAE,EAAC,uBAAuB,EAAE,cAAc,GAAG,cAAc,EAAE,SAAS,CAAC;QACnF,oBAAC,gBAAgB,oBAAK,KAAK,EAAM,OAAO,EAAI,CAC1C,CACT,CAAC;AACN,CAAC,CAAC","sourcesContent":["import cn from 'classnames'\n\nimport './index.less';\n\nexport default (WrappedComponent, options = {}) => {\n const { version, className = '' } = options\n const currentVersion = version || localStorage.getItem('app_version') || 'v2';\n\n return (props) => (\n <div className={cn('tnt-table-v-container', 'tnt-current-' + currentVersion, className)}>\n <WrappedComponent {...props} {...options} />\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/table-container/index.js"],"names":[],"mappings":";;;;;AAAA,4DAA2B;AAE3B,wBAAsB;AAEtB,kBAAe,CAAC,gBAAgB,EAAE,OAAO,GAAG,EAAE,EAAE,EAAE;IAC9C,MAAM,EAAE,OAAO,EAAE,SAAS,GAAG,EAAE,EAAE,GAAG,OAAO,CAAA;IAC3C,MAAM,cAAc,GAAG,OAAO,IAAI,IAAI,CAAC;IAEvC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CACd,6BAAK,SAAS,EAAE,IAAA,oBAAE,EAAC,uBAAuB,EAAE,cAAc,GAAG,cAAc,EAAE,SAAS,CAAC;QACnF,oBAAC,gBAAgB,oBAAK,KAAK,EAAM,OAAO,EAAI,CAC1C,CACT,CAAC;AACN,CAAC,CAAC","sourcesContent":["import cn from 'classnames'\n\nimport './index.less';\n\nexport default (WrappedComponent, options = {}) => {\n const { version, className = '' } = options\n const currentVersion = version || 'v2';\n\n return (props) => (\n <div className={cn('tnt-table-v-container', 'tnt-current-' + currentVersion, className)}>\n <WrappedComponent {...props} {...options} />\n </div>\n );\n};\n"]}
@@ -1,13 +1,13 @@
1
1
  .tnt-table-v-container.tnt-current-v3 {
2
- border-radius: 16px;
3
- background: #fff;
4
- box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.05);
5
- padding: 20px 16px 16px 16px;
6
- max-height: calc(-84px + 100vh) !important;
7
- overflow-y: auto;
2
+ border-radius: 16px;
3
+ background: #fff !important;
4
+ box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.05);
5
+ padding: 20px 16px 16px 16px;
6
+ max-height: calc(-84px + 100vh) !important;
7
+ overflow-y: auto;
8
8
 
9
- .tnt-querylistscene-content {
10
- padding: 0;
11
- background: transparent;
12
- }
9
+ .tnt-querylistscene-content {
10
+ padding: 0;
11
+ background: transparent;
12
+ }
13
13
  }
@@ -13,7 +13,7 @@ var _default = exports["default"] = function _default(WrappedComponent) {
13
13
  var version = options.version,
14
14
  _options$className = options.className,
15
15
  className = _options$className === void 0 ? '' : _options$className;
16
- var currentVersion = version || localStorage.getItem('app_version') || 'v2';
16
+ var currentVersion = version || 'v2';
17
17
  return function (props) {
18
18
  return _react["default"].createElement("div", {
19
19
  className: (0, _classnames["default"])('tnt-tabs-v-container', 'tnt-current-' + currentVersion, className)
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tabs-container/index.js"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AACzB,4DAA2B;AAE3B,wBAAsB;AAEtB,kBAAe,CAAC,gBAAgB,EAAE,OAAO,GAAG,EAAE,EAAE,EAAE;IAC9C,MAAM,EAAE,OAAO,EAAE,SAAS,GAAG,EAAE,EAAE,GAAG,OAAO,CAAA;IAC3C,MAAM,cAAc,GAAG,OAAO,IAAI,YAAY,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,IAAI,CAAC;IAE9E,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CACd,uCAAK,SAAS,EAAE,IAAA,oBAAE,EAAC,sBAAsB,EAAE,cAAc,GAAG,cAAc,EAAE,SAAS,CAAC;QAClF,8BAAC,gBAAgB,oBAAK,KAAK,EAAM,OAAO,EAAI,CAC1C,CACT,CAAC;AACN,CAAC,CAAC","sourcesContent":["import React from 'react'\nimport cn from 'classnames'\n\nimport './index.less';\n\nexport default (WrappedComponent, options = {}) => {\n const { version, className = '' } = options\n const currentVersion = version || localStorage.getItem('app_version') || 'v2';\n\n return (props) => (\n <div className={cn('tnt-tabs-v-container', 'tnt-current-' + currentVersion, className)}>\n <WrappedComponent {...props} {...options} />\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tabs-container/index.js"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AACzB,4DAA2B;AAE3B,wBAAsB;AAEtB,kBAAe,CAAC,gBAAgB,EAAE,OAAO,GAAG,EAAE,EAAE,EAAE;IAC9C,MAAM,EAAE,OAAO,EAAE,SAAS,GAAG,EAAE,EAAE,GAAG,OAAO,CAAA;IAC3C,MAAM,cAAc,GAAG,OAAO,IAAI,IAAI,CAAC;IAEvC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CACd,uCAAK,SAAS,EAAE,IAAA,oBAAE,EAAC,sBAAsB,EAAE,cAAc,GAAG,cAAc,EAAE,SAAS,CAAC;QAClF,8BAAC,gBAAgB,oBAAK,KAAK,EAAM,OAAO,EAAI,CAC1C,CACT,CAAC;AACN,CAAC,CAAC","sourcesContent":["import React from 'react'\nimport cn from 'classnames'\n\nimport './index.less';\n\nexport default (WrappedComponent, options = {}) => {\n const { version, className = '' } = options\n const currentVersion = version || 'v2';\n\n return (props) => (\n <div className={cn('tnt-tabs-v-container', 'tnt-current-' + currentVersion, className)}>\n <WrappedComponent {...props} {...options} />\n </div>\n );\n};\n"]}
@@ -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":[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KAAK,CAAC,yBAAyB,CAAC,QAAQ,GAAG,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAChF,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAA;CAC1C;AAoCD,eAAO,MAAM,GAAG,cAmFE,CAAA"}
package/lib/tag/tag.js ADDED
@@ -0,0 +1,183 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__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,4DAAmC;AACnC,2DAAkC;AAClC,mDAA0B;AAE1B,8CAA2B;AAE3B,IAAY,SAWX;AAXD,WAAY,SAAS;IACnB,0BAAa,CAAA;IACb,0BAAa,CAAA;IACb,oCAAuB,CAAA;IACvB,kCAAqB,CAAA;IACrB,sCAAyB,CAAA;IACzB,wCAA2B,CAAA;IAC3B,sCAAyB,CAAA;IACzB,kCAAuB,CAAA;IACvB,sCAA2B,CAAA;IAC3B,sCAA2B,CAAA;AAC7B,CAAC,EAXW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAWpB;AAED,QAAQ;AACR,MAAM,SAAS,GAAG;IAChB,OAAO,EAAE;QACP,IAAI,EAAE,cAAc;QACpB,KAAK,EAAE,OAAO;KACf;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,MAAM;KACd;IACD,KAAK,EAAE;QACL,IAAI,EAAE,cAAc;QACpB,KAAK,EAAE,KAAK;KACb;IACD,OAAO,EAAE;QACP,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,QAAQ;KAChB;CACF,CAAA;AA4BD,MAAM,yBAAyB,GAAG,CAAC,KAAe,EAAE,SAAiB,EAAE,EAAE;;IACvE,MAAM,EAAE,eAAe,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,KAAK,IAAI,EAAE,CAAA;IACzF,MAAM,OAAO,qBACR,eAAe,CACnB,CAAA;IAED,IAAI,gBAAgB,GAAG,IAAI,CAAA;IAC3B,IAAI,YAAY,EAAE;QAChB,gBAAgB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,GAAG,SAAS,WAAW,CAAC,EAAE,QAAQ;gBACnC,CAAC,GAAG,SAAS,SAAS,CAAC,EAAE,CAAC,CAAC,MAAM;aAClC,CAAC,IACE,IAAI,IACR,GAAG,EAAE,GAAG,IACR,CACH,CAAA;IACH,CAAC,CACc,CAClB,CAAA;AACH,CAAC,CACF,CAAA","sourcesContent":["/*\n * @Author: 周泽飞 zefei.zhou@tongdun.net\n * @Date: 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"]}