@oceanbase/design 1.0.0-alpha.1 → 1.0.0-alpha.10

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 (324) hide show
  1. package/dist/design.min.css +1 -1
  2. package/dist/design.min.js +1 -1
  3. package/dist/reset.css +2 -1
  4. package/dist/static/Inter-Medium.ea234620.woff2 +0 -0
  5. package/dist/static/Inter-Regular.34ba43c9.woff2 +0 -0
  6. package/dist/static/Inter-SemiBold.95439fb4.woff2 +0 -0
  7. package/es/_util/genComponentStyleHook.d.ts +21 -4
  8. package/es/_util/genComponentStyleHook.js +68 -20
  9. package/es/alert/index.d.ts +2 -2
  10. package/es/alert/index.js +22 -6
  11. package/es/alert/style/index.d.ts +2 -5
  12. package/es/alert/style/index.js +157 -67
  13. package/es/app/index.d.ts +8 -0
  14. package/es/app/index.js +43 -1
  15. package/es/app/style/index.d.ts +6 -0
  16. package/es/app/style/index.js +9 -0
  17. package/es/badge/index.js +15 -7
  18. package/es/badge/style/index.d.ts +2 -5
  19. package/es/badge/style/index.js +13 -18
  20. package/es/button/index.js +10 -4
  21. package/es/button/style/index.d.ts +4 -5
  22. package/es/button/style/index.js +40 -7
  23. package/es/card/index.d.ts +11 -0
  24. package/es/card/index.js +151 -9
  25. package/es/card/style/index.d.ts +2 -5
  26. package/es/card/style/index.js +83 -18
  27. package/es/checkbox/index.js +9 -2
  28. package/es/checkbox/style/index.d.ts +2 -5
  29. package/es/checkbox/style/index.js +14 -11
  30. package/es/config-provider/context.d.ts +11 -0
  31. package/es/config-provider/context.js +2 -1
  32. package/es/config-provider/index.d.ts +4 -3
  33. package/es/config-provider/index.js +92 -40
  34. package/es/descriptions/index.d.ts +10 -0
  35. package/es/descriptions/index.js +62 -5
  36. package/es/descriptions/style/index.d.ts +3 -6
  37. package/es/descriptions/style/index.js +70 -10
  38. package/es/drawer/index.js +10 -7
  39. package/es/drawer/style/index.d.ts +2 -5
  40. package/es/drawer/style/index.js +44 -17
  41. package/es/dropdown/dropdown-button.js +26 -6
  42. package/es/dropdown/style/index.d.ts +6 -0
  43. package/es/{_util/genStyle.js → dropdown/style/index.js} +14 -11
  44. package/es/empty/index.js +4 -3
  45. package/es/empty/style/index.d.ts +2 -5
  46. package/es/empty/style/index.js +10 -10
  47. package/es/fonts/Inter-Medium.woff2 +0 -0
  48. package/es/fonts/Inter-Regular.woff2 +0 -0
  49. package/es/fonts/Inter-SemiBold.woff2 +0 -0
  50. package/es/form/FormItem.d.ts +1 -0
  51. package/es/form/FormItem.js +26 -11
  52. package/es/form/index.js +9 -2
  53. package/es/form/style/index.d.ts +2 -5
  54. package/es/form/style/index.js +19 -8
  55. package/es/index.d.ts +4 -3
  56. package/es/index.js +1 -1
  57. package/es/input/Input.d.ts +2 -0
  58. package/es/input/Input.js +30 -7
  59. package/es/input/Password.js +24 -5
  60. package/es/input/Search.js +24 -5
  61. package/es/input/TextArea.js +24 -5
  62. package/es/input/style/index.d.ts +6 -0
  63. package/es/input/style/index.js +32 -0
  64. package/es/input-number/index.d.ts +2 -1
  65. package/es/input-number/index.js +18 -4
  66. package/es/input-number/style/index.d.ts +6 -0
  67. package/es/input-number/style/index.js +19 -0
  68. package/es/locale/en-US.js +4 -1
  69. package/es/locale/index.d.ts +2 -0
  70. package/es/locale/ja-JP.d.ts +3 -0
  71. package/es/locale/ja-JP.js +31 -0
  72. package/es/locale/zh-CN.js +4 -1
  73. package/es/locale/zh-TW.js +4 -1
  74. package/es/modal/Modal.js +29 -8
  75. package/es/modal/style/index.d.ts +2 -5
  76. package/es/modal/style/index.js +67 -26
  77. package/es/radio/index.js +9 -2
  78. package/es/radio/style/index.d.ts +2 -5
  79. package/es/radio/style/index.js +16 -10
  80. package/es/result/index.d.ts +2 -2
  81. package/es/result/index.js +14 -6
  82. package/es/result/style/index.d.ts +2 -5
  83. package/es/result/style/index.js +3 -6
  84. package/es/segmented/index.d.ts +1 -0
  85. package/es/segmented/index.js +24 -9
  86. package/es/segmented/style/index.d.ts +1 -4
  87. package/es/segmented/style/index.js +4 -6
  88. package/es/select/index.js +9 -2
  89. package/es/select/style/index.d.ts +2 -5
  90. package/es/select/style/index.js +6 -7
  91. package/es/slider/index.js +9 -2
  92. package/es/slider/style/index.d.ts +2 -5
  93. package/es/slider/style/index.js +11 -11
  94. package/es/space/index.js +9 -2
  95. package/es/space/style/index.d.ts +2 -5
  96. package/es/space/style/index.js +3 -6
  97. package/es/spin/index.js +9 -2
  98. package/es/spin/style/index.d.ts +2 -5
  99. package/es/spin/style/index.js +27 -27
  100. package/es/static-function/index.js +13 -4
  101. package/es/style/cssVariables.d.ts +25 -0
  102. package/es/style/cssVariables.js +48 -0
  103. package/es/style/cssVariablesMeta.d.ts +24 -0
  104. package/es/style/cssVariablesMeta.js +974 -0
  105. package/es/style/global.d.ts +8 -0
  106. package/es/style/global.js +121 -0
  107. package/es/style/reset.css +2 -1
  108. package/es/switch/index.js +9 -2
  109. package/es/switch/style/index.d.ts +2 -5
  110. package/es/switch/style/index.js +3 -6
  111. package/es/table/index.d.ts +1 -4
  112. package/es/table/index.js +67 -34
  113. package/es/table/style/index.d.ts +2 -5
  114. package/es/table/style/index.js +58 -36
  115. package/es/tabs/index.js +9 -2
  116. package/es/tabs/style/index.d.ts +2 -5
  117. package/es/tabs/style/index.js +10 -10
  118. package/es/tag/index.d.ts +1 -0
  119. package/es/tag/index.js +17 -4
  120. package/es/tag/style/index.d.ts +3 -8
  121. package/es/tag/style/index.js +39 -35
  122. package/es/theme/compact.d.ts +1 -1
  123. package/es/theme/compact.js +2 -6
  124. package/es/theme/dark.d.ts +1 -48
  125. package/es/theme/default.d.ts +48 -2
  126. package/es/theme/default.js +324 -62
  127. package/es/theme/index.d.ts +20 -57
  128. package/es/theme/interface.d.ts +130 -0
  129. package/es/theme/interface.js +4 -1
  130. package/es/theme/style/aliyun.less +41 -41
  131. package/es/theme/style/compact.less +166 -137
  132. package/es/theme/style/dark.less +58 -58
  133. package/es/theme/style/default.less +169 -140
  134. package/es/tooltip/index.js +4 -4
  135. package/es/tooltip/style/index.d.ts +2 -5
  136. package/es/tooltip/style/index.js +10 -13
  137. package/es/tree-select/index.js +9 -2
  138. package/es/tree-select/style/index.d.ts +2 -5
  139. package/es/tree-select/style/index.js +3 -6
  140. package/es/typography/Link.js +9 -2
  141. package/es/typography/Paragraph.js +9 -2
  142. package/es/typography/Text.d.ts +1 -0
  143. package/es/typography/Text.js +12 -4
  144. package/es/typography/Title.js +9 -2
  145. package/es/typography/hooks/useClassName.d.ts +1 -1
  146. package/es/typography/hooks/useClassName.js +2 -2
  147. package/es/typography/index.d.ts +12 -1
  148. package/es/typography/index.js +2 -1
  149. package/es/typography/style/index.d.ts +2 -5
  150. package/es/typography/style/index.js +36 -28
  151. package/lib/_util/genComponentStyleHook.d.ts +21 -4
  152. package/lib/_util/genComponentStyleHook.js +50 -31
  153. package/lib/alert/index.d.ts +2 -2
  154. package/lib/alert/index.js +20 -11
  155. package/lib/alert/style/index.d.ts +2 -5
  156. package/lib/alert/style/index.js +174 -79
  157. package/lib/app/index.d.ts +8 -0
  158. package/lib/app/index.js +36 -1
  159. package/lib/app/style/index.d.ts +6 -0
  160. package/lib/{_util/getWeakenBorderColor.js → app/style/index.js} +15 -10
  161. package/lib/badge/index.js +32 -23
  162. package/lib/badge/style/index.d.ts +2 -5
  163. package/lib/badge/style/index.js +14 -16
  164. package/lib/button/index.js +5 -4
  165. package/lib/button/style/index.d.ts +4 -5
  166. package/lib/button/style/index.js +48 -9
  167. package/lib/card/index.d.ts +11 -0
  168. package/lib/card/index.js +160 -12
  169. package/lib/card/style/index.d.ts +2 -5
  170. package/lib/card/style/index.js +132 -21
  171. package/lib/checkbox/index.js +4 -3
  172. package/lib/checkbox/style/index.d.ts +2 -5
  173. package/lib/checkbox/style/index.js +10 -8
  174. package/lib/config-provider/DefaultRenderEmpty.js +4 -3
  175. package/lib/config-provider/context.d.ts +11 -0
  176. package/lib/config-provider/index.d.ts +4 -3
  177. package/lib/config-provider/index.js +133 -30
  178. package/lib/descriptions/hooks/useItems.js +5 -4
  179. package/lib/descriptions/index.d.ts +10 -0
  180. package/lib/descriptions/index.js +54 -6
  181. package/lib/descriptions/style/index.d.ts +3 -6
  182. package/lib/descriptions/style/index.js +117 -7
  183. package/lib/drawer/index.js +46 -35
  184. package/lib/drawer/style/index.d.ts +2 -5
  185. package/lib/drawer/style/index.js +44 -14
  186. package/lib/dropdown/dropdown-button.js +26 -3
  187. package/lib/dropdown/index.js +2 -2
  188. package/lib/dropdown/style/index.d.ts +6 -0
  189. package/lib/dropdown/style/index.js +46 -0
  190. package/lib/empty/colored.js +413 -327
  191. package/lib/empty/database.js +267 -222
  192. package/lib/empty/default.js +16 -21
  193. package/lib/empty/guide.js +201 -184
  194. package/lib/empty/index.js +25 -20
  195. package/lib/empty/style/index.d.ts +2 -5
  196. package/lib/empty/style/index.js +9 -10
  197. package/lib/fonts/Inter-Medium.woff2 +0 -0
  198. package/lib/fonts/Inter-Regular.woff2 +0 -0
  199. package/lib/fonts/Inter-SemiBold.woff2 +0 -0
  200. package/lib/form/FormItem.d.ts +1 -0
  201. package/lib/form/FormItem.js +19 -8
  202. package/lib/form/index.js +8 -5
  203. package/lib/form/style/index.d.ts +2 -5
  204. package/lib/form/style/index.js +28 -7
  205. package/lib/grid/col.js +2 -1
  206. package/lib/grid/row.js +2 -1
  207. package/lib/index.d.ts +4 -3
  208. package/lib/index.js +3 -1
  209. package/lib/input/Input.d.ts +2 -0
  210. package/lib/input/Input.js +37 -13
  211. package/lib/input/Password.js +22 -4
  212. package/lib/input/Search.js +32 -12
  213. package/lib/input/TextArea.js +22 -4
  214. package/lib/input/style/index.d.ts +6 -0
  215. package/lib/input/style/index.js +74 -0
  216. package/lib/input-number/index.d.ts +2 -1
  217. package/lib/input-number/index.js +19 -3
  218. package/lib/input-number/style/index.d.ts +6 -0
  219. package/lib/{_util/genStyle.js → input-number/style/index.js} +22 -17
  220. package/lib/list/index.js +3 -2
  221. package/lib/locale/en-US.js +3 -0
  222. package/lib/locale/index.d.ts +2 -0
  223. package/lib/locale/ja-JP.d.ts +3 -0
  224. package/lib/locale/ja-JP.js +63 -0
  225. package/lib/locale/zh-CN.js +3 -0
  226. package/lib/locale/zh-TW.js +3 -0
  227. package/lib/lottie/index.js +2 -1
  228. package/lib/modal/Modal.js +35 -11
  229. package/lib/modal/Progress.js +9 -5
  230. package/lib/modal/style/index.d.ts +2 -5
  231. package/lib/modal/style/index.js +81 -24
  232. package/lib/radio/index.js +4 -3
  233. package/lib/radio/style/index.d.ts +2 -5
  234. package/lib/radio/style/index.js +17 -8
  235. package/lib/result/403.js +156 -121
  236. package/lib/result/404.js +328 -267
  237. package/lib/result/500.js +295 -257
  238. package/lib/result/Error.js +127 -99
  239. package/lib/result/Processing.js +246 -213
  240. package/lib/result/Success.js +233 -169
  241. package/lib/result/Warning.js +611 -515
  242. package/lib/result/index.d.ts +2 -2
  243. package/lib/result/index.js +14 -13
  244. package/lib/result/style/index.d.ts +2 -5
  245. package/lib/result/style/index.js +3 -6
  246. package/lib/segmented/index.d.ts +1 -0
  247. package/lib/segmented/index.js +17 -6
  248. package/lib/segmented/style/index.d.ts +1 -4
  249. package/lib/segmented/style/index.js +4 -6
  250. package/lib/select/index.js +4 -3
  251. package/lib/select/style/index.d.ts +2 -5
  252. package/lib/select/style/index.js +7 -7
  253. package/lib/slider/index.js +4 -3
  254. package/lib/slider/style/index.d.ts +2 -5
  255. package/lib/slider/style/index.js +12 -11
  256. package/lib/space/index.js +3 -2
  257. package/lib/space/style/index.d.ts +2 -5
  258. package/lib/space/style/index.js +3 -6
  259. package/lib/spin/index.js +7 -6
  260. package/lib/spin/style/index.d.ts +2 -5
  261. package/lib/spin/style/index.js +26 -28
  262. package/lib/static-function/index.js +7 -1
  263. package/lib/style/cssVariables.d.ts +25 -0
  264. package/lib/style/cssVariables.js +261 -0
  265. package/lib/style/cssVariablesMeta.d.ts +24 -0
  266. package/lib/style/cssVariablesMeta.js +1059 -0
  267. package/lib/style/global.d.ts +8 -0
  268. package/lib/style/global.js +176 -0
  269. package/lib/style/reset.css +2 -1
  270. package/lib/switch/index.js +4 -3
  271. package/lib/switch/style/index.d.ts +2 -5
  272. package/lib/switch/style/index.js +3 -6
  273. package/lib/table/index.d.ts +1 -4
  274. package/lib/table/index.js +114 -68
  275. package/lib/table/style/index.d.ts +2 -5
  276. package/lib/table/style/index.js +68 -32
  277. package/lib/tabs/index.js +12 -7
  278. package/lib/tabs/style/index.d.ts +2 -5
  279. package/lib/tabs/style/index.js +12 -8
  280. package/lib/tag/index.d.ts +1 -0
  281. package/lib/tag/index.js +18 -8
  282. package/lib/tag/style/index.d.ts +3 -8
  283. package/lib/tag/style/index.js +45 -36
  284. package/lib/theme/compact.d.ts +1 -1
  285. package/lib/theme/compact.js +1 -5
  286. package/lib/theme/dark.d.ts +1 -48
  287. package/lib/theme/default.d.ts +48 -2
  288. package/lib/theme/default.js +403 -61
  289. package/lib/theme/index.d.ts +20 -57
  290. package/lib/theme/interface.d.ts +130 -0
  291. package/lib/theme/style/aliyun.less +41 -41
  292. package/lib/theme/style/compact.less +166 -137
  293. package/lib/theme/style/dark.less +58 -58
  294. package/lib/theme/style/default.less +169 -140
  295. package/lib/tooltip/MouseTooltip.js +43 -39
  296. package/lib/tooltip/ReactStickyMouseTooltip.js +5 -4
  297. package/lib/tooltip/index.js +17 -13
  298. package/lib/tooltip/style/index.d.ts +2 -5
  299. package/lib/tooltip/style/index.js +10 -13
  300. package/lib/tree-select/index.js +4 -3
  301. package/lib/tree-select/style/index.d.ts +2 -5
  302. package/lib/tree-select/style/index.js +3 -6
  303. package/lib/typography/Link.js +7 -6
  304. package/lib/typography/Paragraph.js +7 -6
  305. package/lib/typography/Text.d.ts +1 -0
  306. package/lib/typography/Text.js +9 -8
  307. package/lib/typography/Title.js +7 -6
  308. package/lib/typography/hooks/useClassName.d.ts +1 -1
  309. package/lib/typography/hooks/useClassName.js +3 -2
  310. package/lib/typography/index.d.ts +12 -1
  311. package/lib/typography/index.js +6 -5
  312. package/lib/typography/style/index.d.ts +2 -5
  313. package/lib/typography/style/index.js +34 -26
  314. package/package.json +10 -9
  315. package/dist/static/Inter.f6bcdfb6.woff2 +0 -0
  316. package/es/_util/genStyle.d.ts +0 -2
  317. package/es/_util/getWeakenBorderColor.d.ts +0 -1
  318. package/es/_util/getWeakenBorderColor.js +0 -4
  319. package/es/fonts/Inter.woff2 +0 -0
  320. package/es/global.css +0 -48
  321. package/lib/_util/genStyle.d.ts +0 -2
  322. package/lib/_util/getWeakenBorderColor.d.ts +0 -1
  323. package/lib/fonts/Inter.woff2 +0 -0
  324. package/lib/global.css +0 -48
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import 'antd/dist/reset.css';
3
+ export interface GlobalStyleProps {
4
+ prefixCls?: string;
5
+ }
6
+ declare const GlobalStyle: React.FC<GlobalStyleProps>;
7
+ export { GlobalStyle };
8
+ export default GlobalStyle;
@@ -0,0 +1,121 @@
1
+ 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); }
2
+ 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; }
3
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
4
+ 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); }
5
+ import React from 'react';
6
+ import { useStyleRegister } from '@ant-design/cssinjs';
7
+ import themeConfig from "../theme";
8
+ import interRegular from "../fonts/Inter-Regular.woff2";
9
+ import interMedium from "../fonts/Inter-Medium.woff2";
10
+ import interSemibold from "../fonts/Inter-SemiBold.woff2";
11
+ import consolas from "../fonts/Consolas.woff2";
12
+ import helveticaNeue from "../fonts/HelveticaNeue.woff2";
13
+ import 'antd/dist/reset.css';
14
+ import { Fragment as _Fragment } from "react/jsx-runtime";
15
+ import { jsx as _jsx } from "react/jsx-runtime";
16
+ var genGlobalStyle = function genGlobalStyle(token, prefixCls) {
17
+ var antCls = ".".concat(prefixCls);
18
+ var buttonComponentCls = "".concat(antCls, "-btn");
19
+ var typographyComponentCls = "".concat(antCls, "-typography");
20
+ var menuComponentCls = "".concat(antCls, "-menu");
21
+ return [{
22
+ '@font-face': {
23
+ fontFamily: 'Inter',
24
+ fontStyle: 'lighter',
25
+ fontWeight: 300,
26
+ // load priority: local font > self-hosting font > remote font
27
+ src: "local('Inter'), url(".concat(interRegular, ") format('woff2'), url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*ucHoQ4exBNYAAAAARtAAAAgAemfOAQ/Inter-Regular.woff2') format('woff2')"),
28
+ fontDisplay: 'swap'
29
+ }
30
+ }, {
31
+ '@font-face': {
32
+ fontFamily: 'Inter',
33
+ fontStyle: 'normal',
34
+ fontWeight: 400,
35
+ src: "local('Inter'), url(".concat(interMedium, ") format('woff2'), url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*GboAQ56sQbkAAAAARwAAAAgAemfOAQ/Inter-Medium.woff2') format('woff2')"),
36
+ fontDisplay: 'swap'
37
+ }
38
+ }, {
39
+ '@font-face': {
40
+ fontFamily: 'Inter',
41
+ fontStyle: 'medium',
42
+ fontWeight: 500,
43
+ src: "local('Inter'), url(".concat(interMedium, ") format('woff2'), url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*GboAQ56sQbkAAAAARwAAAAgAemfOAQ/Inter-Medium.woff2') format('woff2')"),
44
+ fontDisplay: 'swap'
45
+ }
46
+ }, {
47
+ '@font-face': {
48
+ fontFamily: 'Inter',
49
+ fontStyle: 'semibold',
50
+ fontWeight: 600,
51
+ src: "local('Inter'), url(".concat(interSemibold, ") format('woff2'), url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*tcOIT5gLQl4AAAAARwAAAAgAemfOAQ/Inter-SemiBold.woff2') format('woff2')"),
52
+ fontDisplay: 'swap'
53
+ }
54
+ }, {
55
+ '@font-face': {
56
+ fontFamily: 'Consolas',
57
+ src: "local('Consolas'), url(".concat(consolas, ") format('woff2'), url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*R8bMTqAdGWgAAAAAAAAAAAAADmfOAQ/Consolas.woff2') format('woff2')"),
58
+ fontDisplay: 'swap'
59
+ }
60
+ }, {
61
+ '@font-face': {
62
+ fontFamily: 'Helvetica Neue',
63
+ src: "local('Helvetica Neue'), url(".concat(helveticaNeue, ") format('woff2'), url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*3EzqR6aYJMkAAAAAAAAAAAAADmfOAQ/HelveticaNeue.woff2') format('woff2')"),
64
+ fontDisplay: 'swap'
65
+ }
66
+ }, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
67
+ 'pre, code, kbd, samp': {
68
+ fontFamily: token.fontFamilyCode
69
+ },
70
+ 'input::placeholder': {
71
+ // affact all placeholder excluding select
72
+ fontWeight: token.fontWeightWeak
73
+ },
74
+ '*': {
75
+ scrollbarColor: "".concat(token.colorFillSecondary, " transparent")
76
+ },
77
+ '.rc-virtual-list-scrollbar-thumb': {
78
+ background: "".concat(token.colorFillSecondary, " !important")
79
+ }
80
+ }, "[style*='font-size: 12px']", {
81
+ fontWeight: token.fontWeightWeak
82
+ }), 'a[href], a[data-aspm-param^="obcloud_openLink="]', _defineProperty({}, "&:not([disabled]):not([class^=\"".concat(prefixCls, "-\"]):hover"), {
83
+ textDecoration: 'underline'
84
+ })), "".concat(buttonComponentCls).concat(buttonComponentCls, "-link:not(").concat(buttonComponentCls, "-disabled)"), {
85
+ '&[href], &[data-aspm-param^="obcloud_openLink="]': {
86
+ '&:hover': {
87
+ textDecoration: 'underline'
88
+ }
89
+ }
90
+ }), "".concat(typographyComponentCls, ":not(").concat(typographyComponentCls, "-disabled)"), {
91
+ '&[href], &[data-aspm-param^="obcloud_openLink="]': {
92
+ '&:hover': {
93
+ textDecoration: 'underline'
94
+ }
95
+ }
96
+ }), "".concat(menuComponentCls), _defineProperty({}, "".concat(menuComponentCls, "-item"), _defineProperty({}, "".concat(menuComponentCls, "-title-content"), {
97
+ 'a:hover': {
98
+ textDecoration: 'none'
99
+ }
100
+ })))];
101
+ };
102
+ var GlobalStyle = function GlobalStyle(_ref2) {
103
+ var _ref2$prefixCls = _ref2.prefixCls,
104
+ prefixCls = _ref2$prefixCls === void 0 ? 'ant' : _ref2$prefixCls;
105
+ var _themeConfig$useToken = themeConfig.useToken(),
106
+ theme = _themeConfig$useToken.theme,
107
+ token = _themeConfig$useToken.token;
108
+ var wrapSSR = useStyleRegister({
109
+ theme: theme,
110
+ token: token,
111
+ path: ['global'],
112
+ hashId: '',
113
+ // Empty hashId for global styles
114
+ order: -1000 // Inject before other styles
115
+ }, function () {
116
+ return genGlobalStyle(token, prefixCls);
117
+ });
118
+ return wrapSSR( /*#__PURE__*/_jsx(_Fragment, {}));
119
+ };
120
+ export { GlobalStyle };
121
+ export default GlobalStyle;
@@ -1 +1,2 @@
1
- @import '~antd/dist/reset.css';
1
+ /* antd/dist/reset.css is imported in global.tsx */
2
+ /* reserve this file for compatibility with antd */
@@ -5,6 +5,12 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
5
5
  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; }
6
6
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
7
  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); }
8
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
9
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
10
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
11
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
12
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
13
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
14
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
9
15
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
10
16
  import { Switch as AntSwitch } from 'antd';
@@ -22,9 +28,10 @@ var InternalSwitch = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
22
28
  getPrefixCls = _useContext.getPrefixCls;
23
29
  var prefixCls = getPrefixCls('switch', customizePrefixCls);
24
30
  var _useStyle = useStyle(prefixCls),
25
- wrapSSR = _useStyle.wrapSSR;
31
+ _useStyle2 = _slicedToArray(_useStyle, 1),
32
+ wrapCSSVar = _useStyle2[0];
26
33
  var switchCls = classNames(className);
27
- return wrapSSR( /*#__PURE__*/_jsx(AntSwitch, _objectSpread({
34
+ return wrapCSSVar( /*#__PURE__*/_jsx(AntSwitch, _objectSpread({
28
35
  ref: ref,
29
36
  prefixCls: customizePrefixCls,
30
37
  className: switchCls
@@ -1,9 +1,6 @@
1
1
  /// <reference types="react" />
2
- import type { FullToken, GenerateStyle } from 'antd/es/theme/internal';
2
+ import type { FullToken, GenerateStyle } from '../../theme/interface';
3
3
  export type SwitchToken = FullToken<'Switch'>;
4
4
  export declare const genSwitchStyle: GenerateStyle<SwitchToken>;
5
- declare const _default: (prefixCls: string) => {
6
- wrapSSR: (node: import("react").ReactNode) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
7
- hashId: string;
8
- };
5
+ declare const _default: (prefixCls: string, rootCls?: string) => readonly [(node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>, string, string];
9
6
  export default _default;
@@ -2,16 +2,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2
2
  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; }
3
3
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
4
4
  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); }
5
- import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
5
+ import { genStyleHooks } from "../../_util/genComponentStyleHook";
6
6
  export var genSwitchStyle = function genSwitchStyle(token) {
7
7
  var componentCls = token.componentCls;
8
8
  return _defineProperty({}, "".concat(componentCls, ":not(").concat(componentCls, "-checked):not(").concat(componentCls, "-disabled):not(").concat(componentCls, "-loading)"), {
9
9
  background: token.colorTextTertiary
10
10
  });
11
11
  };
12
- export default (function (prefixCls) {
13
- var useStyle = genComponentStyleHook('Switch', function (token) {
14
- return [genSwitchStyle(token)];
15
- });
16
- return useStyle(prefixCls);
12
+ export default genStyleHooks('Switch', function (token) {
13
+ return [genSwitchStyle(token)];
17
14
  });
@@ -41,10 +41,7 @@ declare const _default: (<RecordType extends AnyObject = AnyObject>(props: Table
41
41
  Column: <RecordType extends import("antd/es/_util/type").AnyObject>(_: import("antd").TableColumnProps<RecordType>) => null;
42
42
  ColumnGroup: <RecordType_1 extends import("antd/es/_util/type").AnyObject>(_: import("antd/es/table/ColumnGroup").ColumnGroupProps<RecordType_1>) => null;
43
43
  Summary: typeof Summary;
44
- useStyle: (prefixCls: string) => {
45
- wrapSSR: (node: ReactNode) => ReactElement<any, string | React.JSXElementConstructor<any>>;
46
- hashId: string;
47
- };
44
+ useStyle: (prefixCls: string, rootCls?: string) => readonly [(node: ReactElement<any, string | React.JSXElementConstructor<any>>) => ReactElement<any, string | React.JSXElementConstructor<any>>, string, string];
48
45
  useDefaultPagination: (pagination?: false | import("antd").TablePaginationConfig) => false | import("antd").TablePaginationConfig;
49
46
  };
50
47
  export default _default;
package/es/table/index.js CHANGED
@@ -24,6 +24,7 @@ import useStyle from "./style";
24
24
  import useDefaultPagination from "./hooks/useDefaultPagination";
25
25
  import useMergedState from 'rc-util/lib/hooks/useMergedState';
26
26
  import enUS from "../locale/en-US";
27
+ import theme from "../theme";
27
28
  import { jsx as _jsx } from "react/jsx-runtime";
28
29
  import { jsxs as _jsxs } from "react/jsx-runtime";
29
30
  export * from 'antd/es/table';
@@ -45,12 +46,15 @@ function Table(props, ref) {
45
46
  collapseText = props.collapseText,
46
47
  openText = props.openText,
47
48
  expandable = props.expandable,
49
+ scroll = props.scroll,
48
50
  _props$hiddenCancelBt = props.hiddenCancelBtn,
49
51
  hiddenCancelBtn = _props$hiddenCancelBt === void 0 ? false : _props$hiddenCancelBt,
50
52
  customizePrefixCls = props.prefixCls,
51
53
  className = props.className;
52
54
  var extendedContext = useContext(ConfigProvider.ExtendedConfigContext);
53
55
  var pagination = useDefaultPagination(customPagination);
56
+ var _theme$useToken = theme.useToken(),
57
+ token = _theme$useToken.token;
54
58
  var _useContext = useContext(ConfigProvider.ConfigContext),
55
59
  getPrefixCls = _useContext.getPrefixCls,
56
60
  locale = _useContext.locale,
@@ -66,7 +70,8 @@ function Table(props, ref) {
66
70
  restLocale = _objectWithoutProperties(_customLocale$batchOp, _excluded);
67
71
  var prefixCls = getPrefixCls('table', customizePrefixCls);
68
72
  var _useStyle = useStyle(prefixCls),
69
- wrapSSR = _useStyle.wrapSSR;
73
+ _useStyle2 = _slicedToArray(_useStyle, 1),
74
+ wrapCSSVar = _useStyle2[0];
70
75
  var tableCls = classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-expandable"), !isEmpty(expandable)), "".concat(prefixCls, "-selectable"), !!rowSelection), "".concat(prefixCls, "-has-footer"), !!footer), "".concat(prefixCls, "-inner-bordered"), innerBordered), className);
71
76
  var _useState = useState(false),
72
77
  _useState2 = _slicedToArray(_useState, 2),
@@ -113,6 +118,9 @@ function Table(props, ref) {
113
118
  }
114
119
  return item;
115
120
  });
121
+ var hasEllipsisColumn = newColumns.some(function (item) {
122
+ return item.ellipsis;
123
+ });
116
124
  var handleSelectedData = function handleSelectedData(selectedRowKeys, selectedRows, info) {
117
125
  setCurrentSelectedRowKeys(selectedRowKeys);
118
126
  setCurrentSelectedRows(selectedRows);
@@ -181,40 +189,65 @@ function Table(props, ref) {
181
189
  })]
182
190
  });
183
191
  };
184
- return wrapSSR( /*#__PURE__*/_jsx(AntTable, _objectSpread(_objectSpread({}, props), {}, {
185
- ref: ref,
186
- prefixCls: customizePrefixCls,
187
- className: tableCls,
188
- locale: _objectSpread(_objectSpread({}, restLocale), {}, {
189
- emptyText: /*#__PURE__*/_jsx("div", {
190
- className: "".concat(prefixCls, "-empty-wrapper"),
191
- children: typeof emptyText === 'function' ? emptyText() : emptyText
192
- })
193
- }),
194
- size: size,
195
- bordered: bordered || innerBordered,
196
- columns: newColumns,
197
- rowClassName: function rowClassName() {
198
- return classNames(typeof _rowClassName === 'function' ? _rowClassName.apply(void 0, arguments) : _rowClassName, _defineProperty({}, "".concat(prefixCls, "-expand-row-by-click"), expandable === null || expandable === void 0 ? void 0 : expandable.expandRowByClick));
199
- },
200
- expandable: expandable ? _objectSpread({
201
- columnWidth: !size || size === 'large' ? 40 : 32
202
- }, expandable) : undefined,
203
- rowSelection: rowSelection ? _objectSpread(_objectSpread({
204
- columnWidth: table === null || table === void 0 ? void 0 : table.selectionColumnWidth
205
- }, rowSelection), {}, {
206
- onChange: function onChange(selectedRowKeys, selectedRows, info) {
207
- var _rowSelection$onChang2;
208
- handleSelectedData(selectedRowKeys, selectedRows, info);
209
- rowSelection === null || rowSelection === void 0 || (_rowSelection$onChang2 = rowSelection.onChange) === null || _rowSelection$onChang2 === void 0 || _rowSelection$onChang2.call(rowSelection, selectedRowKeys, selectedRows, info);
192
+ return wrapCSSVar( /*#__PURE__*/_jsx(ConfigProvider, {
193
+ theme: {
194
+ components: {
195
+ Button: {
196
+ fontSize: token.fontSizeSM,
197
+ controlHeight: token.controlHeightSM,
198
+ paddingInline: token.paddingXS
199
+ },
200
+ Pagination: {
201
+ fontSize: token.fontSizeSM,
202
+ controlHeight: token.controlHeightSM
203
+ },
204
+ Select: {
205
+ fontSize: token.fontSizeSM,
206
+ controlHeight: token.controlHeightSM,
207
+ // control select padding by inputPaddingHorizontalBase
208
+ paddingSM: token.paddingXS
209
+ }
210
210
  }
211
- }) : undefined,
212
- footer: footer,
213
- pagination: pagination === false ? false : _objectSpread(_objectSpread({}, pagination), {}, {
214
- hideOnSinglePage: toolAlertRender || toolOptionsRender || toolSelectedContent || pagination !== null && pagination !== void 0 && pagination.showSizeChanger ? false : (pagination === null || pagination === void 0 ? void 0 : pagination.hideOnSinglePage) !== undefined ? pagination === null || pagination === void 0 ? void 0 : pagination.hideOnSinglePage : extendedContext.hideOnSinglePage,
215
- showTotal: renderOptionsBar
216
- })
217
- })));
211
+ },
212
+ children: /*#__PURE__*/_jsx(AntTable, _objectSpread(_objectSpread({}, props), {}, {
213
+ ref: ref,
214
+ prefixCls: customizePrefixCls,
215
+ className: tableCls,
216
+ locale: _objectSpread(_objectSpread({}, restLocale), {}, {
217
+ emptyText: /*#__PURE__*/_jsx("div", {
218
+ className: "".concat(prefixCls, "-empty-wrapper"),
219
+ children: typeof emptyText === 'function' ? emptyText() : emptyText
220
+ })
221
+ }),
222
+ size: size,
223
+ bordered: bordered || innerBordered,
224
+ columns: newColumns,
225
+ rowClassName: function rowClassName() {
226
+ return classNames(typeof _rowClassName === 'function' ? _rowClassName.apply(void 0, arguments) : _rowClassName, _defineProperty({}, "".concat(prefixCls, "-expand-row-by-click"), expandable === null || expandable === void 0 ? void 0 : expandable.expandRowByClick));
227
+ },
228
+ expandable: expandable ? _objectSpread({
229
+ columnWidth: !size || size === 'large' ? 40 : 32
230
+ }, expandable) : undefined,
231
+ rowSelection: rowSelection ? _objectSpread(_objectSpread({
232
+ columnWidth: table === null || table === void 0 ? void 0 : table.selectionColumnWidth
233
+ }, rowSelection), {}, {
234
+ onChange: function onChange(selectedRowKeys, selectedRows, info) {
235
+ var _rowSelection$onChang2;
236
+ handleSelectedData(selectedRowKeys, selectedRows, info);
237
+ rowSelection === null || rowSelection === void 0 || (_rowSelection$onChang2 = rowSelection.onChange) === null || _rowSelection$onChang2 === void 0 || _rowSelection$onChang2.call(rowSelection, selectedRowKeys, selectedRows, info);
238
+ }
239
+ }) : undefined,
240
+ scroll: _objectSpread({
241
+ // enable auto x scroll when there is no ellipsis column
242
+ x: hasEllipsisColumn ? undefined : 'max-content'
243
+ }, scroll),
244
+ footer: footer,
245
+ pagination: pagination === false ? false : _objectSpread(_objectSpread({}, pagination), {}, {
246
+ hideOnSinglePage: toolAlertRender || toolOptionsRender || toolSelectedContent || pagination !== null && pagination !== void 0 && pagination.showSizeChanger ? false : (pagination === null || pagination === void 0 ? void 0 : pagination.hideOnSinglePage) !== undefined ? pagination === null || pagination === void 0 ? void 0 : pagination.hideOnSinglePage : extendedContext.hideOnSinglePage,
247
+ showTotal: renderOptionsBar
248
+ })
249
+ }))
250
+ }));
218
251
  }
219
252
  var ForwardTable = /*#__PURE__*/React.forwardRef(Table);
220
253
  export default Object.assign(ForwardTable, {
@@ -1,10 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import type { CSSObject } from '@ant-design/cssinjs';
3
- import type { FullToken } from 'antd/es/theme/internal';
3
+ import type { FullToken } from '../../theme/interface';
4
4
  export type TableToken = FullToken<'Table'>;
5
5
  export declare const genTableStyle: (token: TableToken) => CSSObject;
6
- declare const _default: (prefixCls: string) => {
7
- wrapSSR: (node: import("react").ReactNode) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
8
- hashId: string;
9
- };
6
+ declare const _default: (prefixCls: string, rootCls?: string) => readonly [(node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>, string, string];
10
7
  export default _default;
@@ -2,11 +2,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2
2
  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; }
3
3
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
4
4
  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); }
5
- import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
5
+ import { unit } from '@ant-design/cssinjs';
6
+ import { genStyleHooks } from "../../_util/genComponentStyleHook";
6
7
  export var genTableStyle = function genTableStyle(token) {
7
8
  var _ref;
8
9
  var antCls = token.antCls,
9
10
  componentCls = token.componentCls,
11
+ iconCls = token.iconCls,
10
12
  colorText = token.colorText,
11
13
  colorBgBase = token.colorBgBase,
12
14
  colorTextSecondary = token.colorTextSecondary,
@@ -17,7 +19,8 @@ export var genTableStyle = function genTableStyle(token) {
17
19
  colorBorderSecondary = token.colorBorderSecondary,
18
20
  padding = token.padding,
19
21
  marginLG = token.marginLG,
20
- marginXS = token.marginXS;
22
+ marginXS = token.marginXS,
23
+ calc = token.calc;
21
24
  return _ref = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref, "".concat(componentCls, "-wrapper ").concat(componentCls), _defineProperty(_defineProperty(_defineProperty({
22
25
  color: colorText,
23
26
  backgroundColor: colorBgBase,
@@ -26,9 +29,8 @@ export var genTableStyle = function genTableStyle(token) {
26
29
  borderBottom: "1px solid ".concat(colorBorderSecondary),
27
30
  borderRadius: 0
28
31
  }), "".concat(componentCls, "-thead > tr"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, 'th', {
29
- // 弱化列标题
30
32
  color: colorTextSecondary,
31
- fontWeight: 'normal',
33
+ fontWeight: token.fontWeight,
32
34
  backgroundColor: colorBgBase
33
35
  }), "th".concat(componentCls, "-column-has-sorters"), {
34
36
  backgroundColor: colorBgBase
@@ -36,8 +38,10 @@ export var genTableStyle = function genTableStyle(token) {
36
38
  backgroundColor: "".concat(colorBorderSecondary, " !important")
37
39
  }), "".concat(componentCls, "-cell-scrollbar"), {
38
40
  boxShadow: "0 1px 0 1px ".concat(colorBgBase)
39
- })), "".concat(componentCls, "-tbody"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-tbody-virtual-scrollbar ").concat(componentCls, "-tbody-virtual-scrollbar-thumb"), {
41
+ })), "".concat(componentCls, "-tbody"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-tbody-virtual-scrollbar ").concat(componentCls, "-tbody-virtual-scrollbar-thumb"), {
40
42
  background: "".concat(token.colorFillSecondary, " !important")
43
+ }), "".concat(componentCls, "-row-indent+").concat(iconCls), {
44
+ marginInlineEnd: token.marginXS
41
45
  }), "tr".concat(componentCls, "-expand-row-by-click"), {
42
46
  cursor: 'pointer'
43
47
  }), "tr > td:has(".concat(componentCls, "-row-expand-icon-expanded)"), _defineProperty({
@@ -45,11 +49,24 @@ export var genTableStyle = function genTableStyle(token) {
45
49
  }, "& ~ td", {
46
50
  borderBottom: 'none'
47
51
  })), "tr > td", {
48
- transition: "background ".concat(token.motionDurationMid)
49
- }), "".concat(componentCls, "-placeholder td"), {
50
- borderBottom: 'none'
51
- }), "".concat(componentCls, "-empty-wrapper"), {
52
- minHeight: 360 - token.paddingSM * 2,
52
+ fontWeight: token.fontWeight,
53
+ transition: "background ".concat(token.motionDurationMid),
54
+ a: {
55
+ fontWeight: token.fontWeightStrong,
56
+ // work for ProTable link style
57
+ fontSize: token.fontSizeSM
58
+ }
59
+ }), "".concat(antCls, "-btn:not(").concat(antCls, "-btn-sm):not(").concat(antCls, "-btn-lg)"), _defineProperty(_defineProperty(_defineProperty({
60
+ height: token.controlHeightSM,
61
+ fontSize: token.fontSizeSM
62
+ }, "&:not(".concat(antCls, "-btn-icon-only):not(").concat(antCls, "-btn-circle)"), {
63
+ paddingInline: token.paddingXS
64
+ }), "&".concat(antCls, "-btn-icon-only"), {
65
+ width: token.controlHeightSM
66
+ }), "&".concat(antCls, "-btn-circle"), {
67
+ minWidth: token.controlHeightSM
68
+ })), "".concat(componentCls, "-placeholder td"), {}), "".concat(componentCls, "-empty-wrapper"), {
69
+ minHeight: calc(360).sub(calc(token.paddingSM).mul(2).equal()).equal(),
53
70
  display: 'flex',
54
71
  justifyContent: 'center',
55
72
  alignItems: 'center'
@@ -64,18 +81,17 @@ export var genTableStyle = function genTableStyle(token) {
64
81
  }), "".concat(componentCls, "-empty-wrapper"), {
65
82
  minHeight: 'auto'
66
83
  })))), "".concat(componentCls, "-wrapper ").concat(componentCls).concat(componentCls, "-middle"), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty({}, "".concat(componentCls, "-empty-wrapper"), {
67
- minHeight: 260 - token.paddingXS * 2
84
+ minHeight: calc(260).sub(calc(token.paddingXS).mul(2).equal()).equal()
68
85
  }))), "".concat(componentCls, "-wrapper ").concat(componentCls).concat(componentCls, "-small"), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty({}, "".concat(componentCls, "-empty-wrapper"), {
69
- minHeight: 160 - token.paddingXXS * 2
86
+ minHeight: calc(160).sub(calc(token.paddingXXS).mul(2).equal()).equal()
70
87
  }))), "".concat(componentCls, "-wrapper ").concat(componentCls).concat(componentCls, "-bordered"), _defineProperty({}, "".concat(componentCls, "-footer"), {
71
- borderRadius: "0px 0px ".concat(token.borderRadiusLG, "px ").concat(token.borderRadiusLG, "px")
88
+ borderRadius: "0px 0px ".concat(unit(token.borderRadiusLG), " ").concat(unit(token.borderRadiusLG))
72
89
  })), "".concat(componentCls, "-wrapper").concat(componentCls, "-inner-bordered ").concat(componentCls, "-bordered"), _defineProperty({}, "".concat(componentCls, "-container"), _defineProperty({
73
90
  borderInlineStart: 'none',
74
91
  borderTop: 'none'
75
92
  }, "".concat(componentCls, "-thead > tr > th, ").concat(componentCls, "-tbody > tr > td"), _defineProperty({}, '&:last-child', {
76
93
  borderInlineEnd: 'none'
77
94
  })))), "".concat(componentCls, "-wrapper ").concat(componentCls, ":not(").concat(componentCls, "-bordered)"), _defineProperty({}, "".concat(componentCls, "-thead, ").concat(componentCls, "-tbody"), _defineProperty({}, 'td, th', _defineProperty(_defineProperty({}, "&".concat(componentCls, "-row-expand-icon-cell"), {
78
- backgroundColor: colorBgBase,
79
95
  // 设置 paddingRight 即可
80
96
  paddingRight: token.paddingXS
81
97
  }), "&".concat(componentCls, "-selection-column, &").concat(componentCls, "-row-expand-icon-cell"), _defineProperty({}, "& + td, & + th", {
@@ -83,38 +99,47 @@ export var genTableStyle = function genTableStyle(token) {
83
99
  }))))), "".concat(componentCls, "-wrapper:not(").concat(componentCls, "-expandable):not(").concat(componentCls, "-has-footer) ").concat(componentCls, ":not(").concat(componentCls, "-bordered):not(").concat(componentCls, "-empty)"), {
84
100
  borderBottomLeftRadius: 0,
85
101
  borderBottomRightRadius: 0
86
- }), "".concat(componentCls, "-wrapper").concat(componentCls, "-expandable"), _defineProperty(_defineProperty({}, "".concat(componentCls), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-expanded-row > td"), _defineProperty(_defineProperty({}, "& > *:not(".concat(componentCls, "-wrapper):not(").concat(componentCls, "-expanded-row-fixed)"), {
87
- marginLeft: token.marginXL + token.lineWidth * 2
102
+ }), "".concat(componentCls, "-wrapper").concat(componentCls, "-expandable"), _defineProperty(_defineProperty({}, "".concat(componentCls), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-expanded-row > td"), _defineProperty(_defineProperty({}, "& > *:not(".concat(componentCls, "-wrapper):not(").concat(componentCls, "-expanded-row-fixed)"), {
103
+ marginLeft: calc(token.marginXL).add(calc(token.lineWidth).mul(2).equal()).equal()
88
104
  }), "& > *".concat(componentCls, "-expanded-row-fixed"), {
89
- paddingLeft: token.marginXL + token.lineWidth * 2 + token.padding
105
+ paddingLeft: calc(token.marginXL).add(calc(token.lineWidth).mul(2).equal()).add(token.padding).equal(),
106
+ margin: "-".concat(unit(token.marginXS), " -").concat(unit(token.margin))
90
107
  })), "tr > td > ".concat(componentCls, "-wrapper:only-child ").concat(componentCls), {
91
- marginLeft: token.margin + token.lineWidth * 2
108
+ marginLeft: calc(token.margin).add(calc(token.lineWidth).mul(2).equal()).equal()
109
+ }), "tr > td > ".concat(componentCls, "-expanded-row-fixed > ").concat(componentCls, "-wrapper:only-child ").concat(componentCls), {
110
+ marginLeft: -token.padding
92
111
  }))), "".concat(componentCls, "-middle, ").concat(componentCls, "-small"), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty({}, "tr > td > ".concat(componentCls, "-wrapper:only-child ").concat(componentCls), {
93
- marginLeft: token.margin + token.lineWidth * 2 + token.margin
112
+ marginLeft: calc(token.margin).add(calc(token.lineWidth).mul(2).equal()).add(token.margin).equal()
94
113
  })))), "".concat(componentCls, "-wrapper").concat(componentCls, "-expandable").concat(componentCls, "-selectable"), _defineProperty(_defineProperty({}, "".concat(componentCls), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-expanded-row > td"), _defineProperty(_defineProperty({}, "& > *:not(".concat(componentCls, "-wrapper):not(").concat(componentCls, "-expanded-row-fixed)"), {
95
- marginLeft: token.marginXL + token.marginXL + token.lineWidth * 2
114
+ marginLeft: calc(token.marginXL).add(token.marginXL).add(calc(token.lineWidth).mul(2).equal()).equal()
96
115
  }), "& > *".concat(componentCls, "-expanded-row-fixed"), {
97
- paddingLeft: token.marginXL + token.marginXL + token.lineWidth * 2 + token.padding
116
+ paddingLeft: calc(token.marginXL).add(token.marginXL).add(calc(token.lineWidth).mul(2).equal()).add(token.padding).equal()
98
117
  })), "tr > td > ".concat(componentCls, "-wrapper:only-child ").concat(componentCls), {
99
- marginLeft: token.margin + token.marginXL + token.lineWidth * 2
118
+ marginLeft: calc(token.margin).add(token.marginXL).add(calc(token.lineWidth).mul(2).equal()).equal()
100
119
  }))), "".concat(componentCls, "-middle, ").concat(componentCls, "-small"), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty({}, "tr > td > ".concat(componentCls, "-wrapper:only-child ").concat(componentCls), {
101
- marginLeft: token.margin + token.marginXL + token.lineWidth * 2 + token.margin
120
+ marginLeft: calc(token.margin).add(token.marginXL).add(calc(token.lineWidth).mul(2).equal()).add(token.margin).equal()
102
121
  })))), "".concat(componentCls, "-wrapper ").concat(antCls, "-spin-blur"), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty({}, "".concat(componentCls, "-placeholder"), {
103
122
  // hide empty when Table loading
104
123
  visibility: 'hidden'
105
- }))), _defineProperty(_defineProperty(_defineProperty(_ref, "".concat(componentCls, "-wrapper"), _defineProperty({}, "".concat(componentCls, "-pagination"), _defineProperty(_defineProperty({}, "&".concat(antCls, "-pagination"), {
106
- padding: "".concat(padding, "px 0"),
124
+ }))), _defineProperty(_defineProperty(_defineProperty(_ref, "".concat(componentCls, "-wrapper"), _defineProperty({}, "".concat(componentCls, "-pagination"), _defineProperty(_defineProperty({}, "&".concat(antCls, "-pagination"), _defineProperty(_defineProperty({
125
+ fontSize: token.fontSizeSM,
126
+ padding: "".concat(unit(token.paddingSM), " 0"),
107
127
  margin: '0 !important'
108
- }), "".concat(componentCls, "-batch-operation-bar"), _defineProperty({
128
+ }, "".concat(antCls, "-pagination-item, ").concat(antCls, "-pagination-total-text, ").concat(antCls, "-pagination-prev, ").concat(antCls, "-pagination-next"), {
129
+ height: token.controlHeightSM,
130
+ minWidth: token.controlHeightSM,
131
+ lineHeight: unit(calc(token.controlHeightSM).sub(calc(token.lineWidth).mul(2)).equal())
132
+ }), "".concat(antCls, "-pagination-options ").concat(antCls, "-select-single"), _defineProperty({
133
+ height: token.controlHeightSM
134
+ }, "".concat(antCls, "-select-selector"), {
135
+ paddingInline: calc(token.paddingXS).sub(token.lineWidth).equal()
136
+ }))), "".concat(componentCls, "-batch-operation-bar"), _defineProperty({
109
137
  position: 'absolute',
110
138
  left: 0,
111
139
  display: 'inline-block',
112
140
  marginRight: marginLG
113
- }, "".concat(componentCls, "-batch-operation-selection"), _defineProperty({
114
- color: colorTextSecondary,
115
- fontWeight: 500
116
- }, "".concat(componentCls, "-batch-operation-selection-count"), {
117
- margin: "0 ".concat(marginXS, "px"),
141
+ }, "".concat(componentCls, "-batch-operation-selection"), _defineProperty({}, "".concat(componentCls, "-batch-operation-selection-count"), {
142
+ margin: "0 ".concat(unit(marginXS)),
118
143
  color: colorLink
119
144
  }))))), "".concat(antCls, "-popover").concat(componentCls, "-batch-operation-selection-popover"), _defineProperty({}, "".concat(antCls, "-popover-inner"), {
120
145
  padding: 0
@@ -122,9 +147,6 @@ export var genTableStyle = function genTableStyle(token) {
122
147
  minHeight: 'auto'
123
148
  })));
124
149
  };
125
- export default (function (prefixCls) {
126
- var useStyle = genComponentStyleHook('Table', function (token) {
127
- return [genTableStyle(token)];
128
- });
129
- return useStyle(prefixCls);
150
+ export default genStyleHooks('Table', function (token) {
151
+ return [genTableStyle(token)];
130
152
  });
package/es/tabs/index.js CHANGED
@@ -5,6 +5,12 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
5
5
  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; }
6
6
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
7
  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); }
8
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
9
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
10
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
11
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
12
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
13
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
14
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
9
15
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
10
16
  import React, { useCallback, useContext } from 'react';
@@ -37,7 +43,8 @@ var Tabs = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
37
43
  getPrefixCls = _useContext.getPrefixCls;
38
44
  var prefixCls = getPrefixCls('tabs', customizePrefixCls);
39
45
  var _useStyle = useStyle(prefixCls),
40
- wrapSSR = _useStyle.wrapSSR;
46
+ _useStyle2 = _slicedToArray(_useStyle, 1),
47
+ wrapCSSVar = _useStyle2[0];
41
48
  var tabsCls = classNames(className, _defineProperty({}, "".concat(prefixCls, "-no-divider"), !divider));
42
49
  var isHorizontal = !tabPosition || tabPosition === 'top' || tabPosition === 'bottom';
43
50
  var dividerList = (items === null || items === void 0 ? void 0 : items.filter(function (item) {
@@ -81,7 +88,7 @@ var Tabs = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
81
88
  }
82
89
  return item;
83
90
  });
84
- return wrapSSR( /*#__PURE__*/_jsx(AntTabs, _objectSpread({
91
+ return wrapCSSVar( /*#__PURE__*/_jsx(AntTabs, _objectSpread({
85
92
  ref: ref,
86
93
  items: newItems,
87
94
  type: type,
@@ -1,10 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import type { CSSObject } from '@ant-design/cssinjs';
3
- import type { FullToken } from 'antd/es/theme/internal';
3
+ import type { FullToken } from '../../theme/interface';
4
4
  export type TabsToken = FullToken<'Tabs'>;
5
5
  export declare const genTabsStyle: (token: Partial<TabsToken>) => CSSObject;
6
- declare const _default: (prefixCls: string) => {
7
- wrapSSR: (node: import("react").ReactNode) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
8
- hashId: string;
9
- };
6
+ declare const _default: (prefixCls: string, rootCls?: string) => readonly [(node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>, string, string];
10
7
  export default _default;