@oceanbase/design 0.4.16 → 1.0.0-alpha.0

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 (46) hide show
  1. package/dist/design.min.js +1 -1
  2. package/es/_util/genStyle.d.ts +0 -2
  3. package/es/_util/genStyle.js +0 -77
  4. package/es/badge/style/index.js +0 -1
  5. package/es/button/style/index.js +1 -30
  6. package/es/card/style/index.js +4 -2
  7. package/es/config-provider/index.js +1 -5
  8. package/es/empty/style/index.js +2 -7
  9. package/es/form/FormItem.d.ts +2 -1
  10. package/es/form/FormItem.js +1 -0
  11. package/es/index.d.ts +0 -1
  12. package/es/index.js +1 -2
  13. package/es/result/style/index.js +2 -5
  14. package/es/table/style/index.js +8 -31
  15. package/es/tabs/index.d.ts +8 -6
  16. package/es/tabs/index.js +10 -7
  17. package/es/tabs/style/index.js +2 -3
  18. package/es/theme/default.js +62 -39
  19. package/es/theme/style/aliyun.less +125 -125
  20. package/es/theme/style/compact.less +135 -135
  21. package/es/theme/style/dark.less +136 -136
  22. package/es/theme/style/default.less +135 -135
  23. package/es/typography/style/index.js +2 -6
  24. package/lib/_util/genStyle.d.ts +0 -2
  25. package/lib/_util/genStyle.js +2 -118
  26. package/lib/badge/style/index.js +0 -1
  27. package/lib/button/style/index.js +1 -37
  28. package/lib/card/style/index.js +9 -1
  29. package/lib/config-provider/index.js +1 -8
  30. package/lib/empty/style/index.js +0 -5
  31. package/lib/form/FormItem.d.ts +2 -1
  32. package/lib/form/FormItem.js +6 -0
  33. package/lib/index.d.ts +0 -1
  34. package/lib/index.js +0 -3
  35. package/lib/result/style/index.js +0 -4
  36. package/lib/table/style/index.js +1 -58
  37. package/lib/tabs/index.d.ts +8 -6
  38. package/lib/tabs/index.js +68 -62
  39. package/lib/tabs/style/index.js +6 -4
  40. package/lib/theme/default.js +62 -38
  41. package/lib/theme/style/aliyun.less +125 -125
  42. package/lib/theme/style/compact.less +135 -135
  43. package/lib/theme/style/dark.less +136 -136
  44. package/lib/theme/style/default.less +135 -135
  45. package/lib/typography/style/index.js +2 -9
  46. package/package.json +4 -4
@@ -1,4 +1,2 @@
1
1
  import type { CSSObject } from '@ant-design/cssinjs';
2
- import type { FullToken } from 'antd/es/theme/internal';
3
2
  export declare const genCompactStyle: (componentCls: string, subComponentCls?: string) => CSSObject;
4
- export declare const genLargeStyle: (token: FullToken<any>) => CSSObject;
@@ -1,6 +1,4 @@
1
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 ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
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; }
5
3
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
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); }
@@ -15,79 +13,4 @@ export var genCompactStyle = function genCompactStyle(componentCls) {
15
13
  borderStartStartRadius: 0,
16
14
  borderEndStartRadius: 0
17
15
  });
18
- };
19
- export var genLargeStyle = function genLargeStyle(token) {
20
- var antCls = token.antCls,
21
- iconCls = token.iconCls,
22
- fontSize = token.fontSize,
23
- lineWidth = token.lineWidth,
24
- borderRadiusLG = token.borderRadiusLG,
25
- controlHeight = token.controlHeight,
26
- controlHeightSM = token.controlHeightSM,
27
- controlHeightLG = token.controlHeightLG;
28
- var height = controlHeightLG;
29
- var lineHeight = "".concat(controlHeightLG, "px");
30
- return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(antCls, "-btn"), _objectSpread({
31
- // limit min width for icon button
32
- minWidth: controlHeightLG,
33
- height: height,
34
- fontSize: fontSize,
35
- borderRadius: borderRadiusLG
36
- }, genCompactStyle("".concat(antCls, "-btn")))), "".concat(antCls, "-radio-group"), _defineProperty({}, "".concat(antCls, "-radio-button-wrapper"), _defineProperty(_defineProperty({
37
- height: height,
38
- lineHeight: "".concat(height - lineWidth * 2, "px"),
39
- fontSize: fontSize
40
- }, "&:first-child", {
41
- borderStartStartRadius: borderRadiusLG,
42
- borderEndStartRadius: borderRadiusLG
43
- }), "&:last-child", {
44
- borderStartEndRadius: borderRadiusLG,
45
- borderEndEndRadius: borderRadiusLG
46
- }))), "".concat(antCls, "-select"), _objectSpread(_objectSpread({
47
- height: height,
48
- fontSize: fontSize
49
- }, genCompactStyle("".concat(antCls, "-select"), "".concat(antCls, "-select-selector"))), {}, _defineProperty(_defineProperty({}, "".concat(antCls, "-select-selector"), {
50
- borderRadius: borderRadiusLG
51
- }), "".concat(antCls, "-select-selection-item"), {
52
- fontSize: fontSize
53
- }))), "".concat(antCls, "-select-multiple ").concat(antCls, "-select-selection-wrap"), {
54
- // ref: https://github.com/oceanbase/oceanbase-design/pull/881
55
- height: '100%'
56
- }), "".concat(antCls, "-input-wrapper"), _defineProperty(_defineProperty({
57
- fontSize: fontSize
58
- }, "".concat(iconCls), {
59
- fontSize: fontSize
60
- }), "".concat(antCls, "-input-affix-wrapper"), {
61
- borderStartEndRadius: 0,
62
- borderEndEndRadius: 0
63
- })), "".concat(antCls, "-input-affix-wrapper"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({
64
- height: height,
65
- borderRadius: borderRadiusLG
66
- }, "&:not(".concat(antCls, "-input-affix-wrapper-lg)"), {
67
- lineHeight: "".concat(controlHeight - lineWidth * 2, "px")
68
- }), "".concat(antCls, "-input"), {
69
- height: "".concat(controlHeight - lineWidth * 2, "px")
70
- }), "".concat(antCls, "-input-lg"), {
71
- height: controlHeightSM
72
- }), "".concat(antCls, "-input-sm"), {
73
- height: "".concat(controlHeightLG - lineWidth * 2, "px")
74
- })), "".concat(antCls, "-input"), _objectSpread({
75
- height: height,
76
- fontSize: fontSize,
77
- borderRadius: borderRadiusLG
78
- }, genCompactStyle("".concat(antCls, "-input")))), "".concat(antCls, "-input-search-button"), {
79
- height: height,
80
- lineHeight: lineHeight,
81
- borderStartEndRadius: borderRadiusLG,
82
- borderEndEndRadius: borderRadiusLG
83
- }), "".concat(antCls, "-input-group-addon"), {
84
- fontSize: fontSize,
85
- borderStartEndRadius: borderRadiusLG,
86
- borderEndEndRadius: borderRadiusLG
87
- }), "".concat(antCls, "-picker"), _objectSpread(_objectSpread({
88
- height: height,
89
- borderRadius: borderRadiusLG
90
- }, genCompactStyle("".concat(antCls, "-picker"))), {}, _defineProperty({}, "".concat(antCls, "-picker-input>input"), {
91
- fontSize: fontSize
92
- })));
93
16
  };
@@ -16,7 +16,6 @@ export var genBadgeStyle = function genBadgeStyle(token) {
16
16
  }, "&".concat(componentCls, "-status-default"), {
17
17
  backgroundColor: token.colorFill
18
18
  })), "".concat(componentCls, "-status-icon"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
19
- fontSize: token.fontSizeSM,
20
19
  // remove dot style
21
20
  backgroundColor: 'transparent'
22
21
  }, '&::after', {
@@ -1,35 +1,6 @@
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
1
  import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
6
2
  export var genButtonStyle = function genButtonStyle(token) {
7
- var componentCls = token.componentCls;
8
- // primary button className
9
- var primaryBtnCls = "".concat(componentCls).concat(componentCls, "-primary:not([disabled]):not(").concat(componentCls, "-disabled):not(").concat(componentCls, "-dangerous):not(").concat(componentCls, "-background-ghost)");
10
- var primaryAndCompactItemBtnCls = "".concat(componentCls, "-compact-item").concat(primaryBtnCls);
11
- return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls), {
12
- // remove box-shadow for button
13
- boxShadow: 'none !important'
14
- }), "".concat(primaryBtnCls), _defineProperty(_defineProperty({
15
- background: 'linear-gradient(-59deg, #002BFF 0%, #0080FF 100%)',
16
- border: 'none'
17
- }, '&:hover', {
18
- background: 'linear-gradient(120deg, #1AA0FF 0%, #1A53FF 100%)'
19
- }), '&:active', {
20
- background: 'linear-gradient(120deg, #0060E6 0%, #0013E6 100%)'
21
- })), "".concat(primaryBtnCls).concat(componentCls, "-compact-last-item"), _defineProperty(_defineProperty({
22
- background: 'linear-gradient(-59deg, #002BFF 0%, #002BFF 100%)'
23
- }, '&:hover', {
24
- background: 'linear-gradient(120deg, #1AA0FF 0%, #1A53FF 100%)'
25
- }), '&:active', {
26
- background: 'linear-gradient(120deg, #0060E6 0%, #0013E6 100%)'
27
- })), "".concat(primaryAndCompactItemBtnCls, "+").concat(primaryAndCompactItemBtnCls, ":before"), {
28
- height: '100%',
29
- top: 0
30
- }), "".concat(primaryAndCompactItemBtnCls, ":hover"), {
31
- zIndex: 0
32
- });
3
+ return {};
33
4
  };
34
5
  export default (function (prefixCls, isAliyun) {
35
6
  var useStyle = genComponentStyleHook('Button', function (token) {
@@ -30,10 +30,12 @@ export var genCardStyle = function genCardStyle(token) {
30
30
  var tableComponentCls = "".concat(antCls, "-table");
31
31
  return _ref2 = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref2, "".concat(componentCls), _defineProperty({}, "".concat(componentCls, ":not(").concat(componentCls, "-bordered):not(").concat(componentCls, "-type-inner)"), {
32
32
  boxShadow: 'none'
33
- })), "".concat(componentCls).concat(componentCls, "-no-divider"), _defineProperty({}, "".concat(componentCls, "-head"), {
33
+ })), "".concat(componentCls).concat(componentCls, "-no-divider"), _defineProperty({}, "".concat(componentCls, "-head"), _defineProperty({
34
34
  // should not remove border-bottom to avoid tabs inkbar display correctly
35
35
  borderBottomColor: 'transparent'
36
- })), "".concat(componentCls).concat(componentCls, "-no-divider:not(").concat(componentCls, "-contain-tabs)"), _defineProperty({}, "".concat(componentCls, "-body"), {
36
+ }, tabsComponentCls, _defineProperty({}, "&".concat(tabsComponentCls, "-top, &").concat(tabsComponentCls, "-bottom"), _defineProperty({}, "".concat(tabsComponentCls, "-nav::before"), {
37
+ border: 'none'
38
+ }))))), "".concat(componentCls).concat(componentCls, "-no-divider:not(").concat(componentCls, "-contain-tabs)"), _defineProperty({}, "".concat(componentCls, "-body"), {
37
39
  padding: "0 ".concat(paddingLG, "px ").concat(paddingLG, "px ").concat(paddingLG, "px")
38
40
  })), "".concat(componentCls, "-small").concat(componentCls, "-no-divider:not(").concat(componentCls, "-contain-tabs)"), _defineProperty({}, "".concat(componentCls, "-body"), {
39
41
  padding: "0 ".concat(paddingSM, "px ").concat(paddingSM, "px ").concat(paddingSM, "px")
@@ -79,11 +79,7 @@ var ConfigProvider = function ConfigProvider(_ref) {
79
79
  }, parentContext.form, form),
80
80
  spin: merge({}, parentContext.spin, spin),
81
81
  table: merge({}, parentContext.table, table),
82
- tabs: merge({}, {
83
- indicatorSize: function indicatorSize(origin) {
84
- return origin >= 24 ? origin - 16 : origin;
85
- }
86
- }, parentContext.tabs, tabs),
82
+ tabs: merge({}, parentContext.tabs, tabs),
87
83
  theme: merge({}, mergedTheme, {
88
84
  token:
89
85
  // custom fontFamily
@@ -1,18 +1,15 @@
1
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 ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
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; }
5
3
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
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); }
7
5
  import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
8
- import { genLargeStyle } from "../../_util/genStyle";
9
6
  export var genEmptyStyle = function genEmptyStyle(token) {
10
7
  var antCls = token.antCls,
11
8
  componentCls = token.componentCls,
12
9
  colorTextTertiary = token.colorTextTertiary,
13
10
  colorText = token.colorText,
14
11
  colorTextSecondary = token.colorTextSecondary;
15
- return _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls), _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-image"), {
12
+ return _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls), _defineProperty(_defineProperty({}, "".concat(componentCls, "-image"), {
16
13
  height: 160,
17
14
  marginBottom: 0
18
15
  }), "".concat(componentCls, "-description"), _defineProperty(_defineProperty(_defineProperty({
@@ -58,9 +55,7 @@ export var genEmptyStyle = function genEmptyStyle(token) {
58
55
  color: colorTextTertiary,
59
56
  fontSize: token.fontSizeSM,
60
57
  marginTop: token.marginXS
61
- }))))), "".concat(componentCls, "-footer"), _objectSpread({
62
- marginTop: token.marginLG
63
- }, genLargeStyle(token)))), "".concat(componentCls, "-horizontal"), _defineProperty({
58
+ })))))), "".concat(componentCls, "-horizontal"), _defineProperty({
64
59
  display: 'flex',
65
60
  justifyContent: 'center',
66
61
  alignItems: 'center'
@@ -4,11 +4,12 @@ import type { FormItemProps as AntFormItemProps } from 'antd/es/form';
4
4
  import type { TooltipProps } from '../tooltip';
5
5
  declare const AntFormItem: (<Values = any>(props: AntFormItemProps<Values>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) & {
6
6
  useStatus: () => {
7
- status?: "" | "error" | "warning" | "success" | "validating";
7
+ status?: "" | "warning" | "error" | "success" | "validating";
8
8
  errors: React.ReactNode[];
9
9
  warnings: React.ReactNode[];
10
10
  };
11
11
  };
12
+ export * from 'antd/es/form/FormItem';
12
13
  export type WrapperTooltipProps = Omit<TooltipProps, 'mouseFollow'> & {
13
14
  icon?: React.ReactElement;
14
15
  };
@@ -20,6 +20,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
20
20
  import { Fragment as _Fragment } from "react/jsx-runtime";
21
21
  import { jsxs as _jsxs } from "react/jsx-runtime";
22
22
  var AntFormItem = AntForm.Item;
23
+ export * from 'antd/es/form/FormItem';
23
24
  var FormItem = function FormItem(_ref) {
24
25
  var _children$type;
25
26
  var children = _ref.children,
package/es/index.d.ts CHANGED
@@ -74,4 +74,3 @@ declare const useToken: () => {
74
74
  };
75
75
  export { useToken };
76
76
  export type { PresetStatusColorType } from 'antd/es/_util/colors';
77
- export { genLargeStyle } from './_util/genStyle';
package/es/index.js CHANGED
@@ -37,5 +37,4 @@ export { default as Lottie } from "./lottie";
37
37
  export { default as theme } from "./theme";
38
38
  import theme from "./theme";
39
39
  var useToken = theme.useToken;
40
- export { useToken };
41
- export { genLargeStyle } from "./_util/genStyle";
40
+ export { useToken };
@@ -1,21 +1,18 @@
1
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 ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
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; }
5
3
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
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); }
7
5
  import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
8
- import { genLargeStyle } from "../../_util/genStyle";
9
6
  export var genResultStyle = function genResultStyle(token) {
10
7
  var componentCls = token.componentCls;
11
- return _defineProperty({}, "".concat(componentCls), _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-title"), {
8
+ return _defineProperty({}, "".concat(componentCls), _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-title"), {
12
9
  fontWeight: token.fontWeightStrong,
13
10
  fontSize: token.fontSizeHeading4,
14
11
  lineHeight: token.lineHeightHeading4
15
12
  }), "".concat(componentCls, "-subtitle"), {
16
13
  maxWidth: 600,
17
14
  margin: '0px auto'
18
- }), "".concat(componentCls, "-extra"), _objectSpread({}, genLargeStyle(token))), "".concat(componentCls, "-content"), {
15
+ }), "".concat(componentCls, "-content"), {
19
16
  maxWidth: 1000,
20
17
  margin: '0px auto',
21
18
  marginTop: token.marginLG,
@@ -4,7 +4,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
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
5
  import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
6
6
  export var genTableStyle = function genTableStyle(token) {
7
- var _$concat2, _ref;
7
+ var _ref;
8
8
  var antCls = token.antCls,
9
9
  componentCls = token.componentCls,
10
10
  colorText = token.colorText,
@@ -36,15 +36,7 @@ export var genTableStyle = function genTableStyle(token) {
36
36
  backgroundColor: "".concat(colorBorderSecondary, " !important")
37
37
  }), "".concat(componentCls, "-cell-scrollbar"), {
38
38
  boxShadow: "0 1px 0 1px ".concat(colorBgBase)
39
- })), "".concat(componentCls, "-tbody"), (_$concat2 = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_$concat2, "tr:nth-child(2n + 1):not(".concat(componentCls, "-placeholder):not(").concat(componentCls, "-row-selected):not(").concat(antCls, "-descriptions-row) > td"), {
40
- backgroundColor: colorBgBase
41
- }), "tr:nth-child(2n):not(".concat(componentCls, "-placeholder):not(").concat(componentCls, "-row-selected):not(").concat(componentCls, "-expanded-row):not(").concat(antCls, "-descriptions-row) > td"), {
42
- backgroundColor: colorFillQuaternary
43
- }), "tr:not(".concat(componentCls, "-placeholder):not(").concat(componentCls, "-expanded-row):not(").concat(antCls, "-descriptions-row):hover > td"), {
44
- backgroundColor: "".concat(colorPrimaryBg, " !important")
45
- }), "tr".concat(componentCls, "-row-selected > td"), {
46
- backgroundColor: "".concat(colorPrimaryBg, " !important")
47
- }), "".concat(componentCls, "-tbody-virtual-scrollbar ").concat(componentCls, "-tbody-virtual-scrollbar-thumb"), {
39
+ })), "".concat(componentCls, "-tbody"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-tbody-virtual-scrollbar ").concat(componentCls, "-tbody-virtual-scrollbar-thumb"), {
48
40
  background: "".concat(token.colorFillSecondary, " !important")
49
41
  }), "tr".concat(componentCls, "-expand-row-by-click"), {
50
42
  cursor: 'pointer'
@@ -61,7 +53,7 @@ export var genTableStyle = function genTableStyle(token) {
61
53
  display: 'flex',
62
54
  justifyContent: 'center',
63
55
  alignItems: 'center'
64
- }), _defineProperty(_$concat2, "tr > td > ".concat(componentCls, "-wrapper:only-child ").concat(componentCls), _defineProperty(_defineProperty(_defineProperty(_defineProperty({
56
+ }), "tr > td > ".concat(componentCls, "-wrapper:only-child ").concat(componentCls), _defineProperty(_defineProperty(_defineProperty(_defineProperty({
65
57
  borderBottom: 'none'
66
58
  }, "".concat(componentCls, "-thead > tr > th"), {
67
59
  backgroundColor: token.colorFillQuaternary
@@ -71,17 +63,11 @@ export var genTableStyle = function genTableStyle(token) {
71
63
  borderRadius: 0
72
64
  }), "".concat(componentCls, "-empty-wrapper"), {
73
65
  minHeight: 'auto'
74
- }))))), "".concat(componentCls, "-wrapper ").concat(componentCls).concat(componentCls, "-middle"), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty({}, "".concat(componentCls, "-empty-wrapper"), {
66
+ })))), "".concat(componentCls, "-wrapper ").concat(componentCls).concat(componentCls, "-middle"), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty({}, "".concat(componentCls, "-empty-wrapper"), {
75
67
  minHeight: 260 - token.paddingXS * 2
76
68
  }))), "".concat(componentCls, "-wrapper ").concat(componentCls).concat(componentCls, "-small"), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty({}, "".concat(componentCls, "-empty-wrapper"), {
77
69
  minHeight: 160 - token.paddingXXS * 2
78
- }))), "".concat(componentCls, "-wrapper ").concat(componentCls).concat(componentCls, "-scroll-horizontal, ").concat(componentCls, "-wrapper ").concat(componentCls).concat(componentCls, "-fixed-header"), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty(_defineProperty({}, "tr:nth-child(2n + 1):not(".concat(componentCls, "-placeholder):not(").concat(componentCls, "-row-selected):not(").concat(antCls, "-descriptions-row) > td"), {
79
- backgroundColor: colorFillQuaternary
80
- }), "tr:nth-child(2n):not(".concat(componentCls, "-placeholder):not(").concat(componentCls, "-row-selected):not(").concat(componentCls, "-expanded-row):not(").concat(antCls, "-descriptions-row) > td"), {
81
- backgroundColor: colorBgBase
82
- }))), "".concat(componentCls, "-wrapper ").concat(componentCls).concat(componentCls, "-bordered"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-thead > tr"), _defineProperty({}, 'th', {
83
- backgroundColor: colorFillQuaternary
84
- })), "".concat(componentCls, "-footer"), {
70
+ }))), "".concat(componentCls, "-wrapper ").concat(componentCls).concat(componentCls, "-bordered"), _defineProperty({}, "".concat(componentCls, "-footer"), {
85
71
  borderRadius: "0px 0px ".concat(token.borderRadiusLG, "px ").concat(token.borderRadiusLG, "px")
86
72
  })), "".concat(componentCls, "-wrapper").concat(componentCls, "-inner-bordered ").concat(componentCls, "-bordered"), _defineProperty({}, "".concat(componentCls, "-container"), _defineProperty({
87
73
  borderInlineStart: 'none',
@@ -95,18 +81,9 @@ export var genTableStyle = function genTableStyle(token) {
95
81
  }), "&".concat(componentCls, "-selection-column, &").concat(componentCls, "-row-expand-icon-cell"), _defineProperty({}, "& + td, & + th", {
96
82
  paddingLeft: token.paddingXS
97
83
  }))))), "".concat(componentCls, "-wrapper:not(").concat(componentCls, "-expandable):not(").concat(componentCls, "-has-footer) ").concat(componentCls, ":not(").concat(componentCls, "-bordered):not(").concat(componentCls, "-empty)"), {
98
- borderBottom: "1px solid ".concat(colorBorderSecondary),
99
84
  borderBottomLeftRadius: 0,
100
85
  borderBottomRightRadius: 0
101
- }), "".concat(componentCls, "-wrapper:not(").concat(componentCls, "-expandable)"), _defineProperty({}, "".concat(componentCls, ":not(").concat(componentCls, "-bordered)"), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty({}, "tr:not(".concat(componentCls, "-measure-row) > td"), {
102
- border: 'none'
103
- })))), "".concat(componentCls, "-wrapper").concat(componentCls, "-expandable"), _defineProperty(_defineProperty({}, "".concat(componentCls), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty(_defineProperty(_defineProperty({}, "tr:nth-child(n):not(".concat(componentCls, "-placeholder):not(").concat(componentCls, "-row-selected):not(").concat(componentCls, "-expanded-row)"), _defineProperty(_defineProperty({}, '& > td', {
104
- backgroundColor: colorBgBase
105
- }), '&:hover', {
106
- td: {
107
- backgroundColor: colorPrimaryBg
108
- }
109
- })), "".concat(componentCls, "-expanded-row > td"), _defineProperty(_defineProperty({}, "& > *:not(".concat(componentCls, "-wrapper):not(").concat(componentCls, "-expanded-row-fixed)"), {
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)"), {
110
87
  marginLeft: token.marginXL + token.lineWidth * 2
111
88
  }), "& > *".concat(componentCls, "-expanded-row-fixed"), {
112
89
  paddingLeft: token.marginXL + token.lineWidth * 2 + token.padding
@@ -114,7 +91,7 @@ export var genTableStyle = function genTableStyle(token) {
114
91
  marginLeft: token.margin + token.lineWidth * 2
115
92
  }))), "".concat(componentCls, "-middle, ").concat(componentCls, "-small"), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty({}, "tr > td > ".concat(componentCls, "-wrapper:only-child ").concat(componentCls), {
116
93
  marginLeft: token.margin + token.lineWidth * 2 + token.margin
117
- })))), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref, "".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)"), {
94
+ })))), "".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)"), {
118
95
  marginLeft: token.marginXL + token.marginXL + token.lineWidth * 2
119
96
  }), "& > *".concat(componentCls, "-expanded-row-fixed"), {
120
97
  paddingLeft: token.marginXL + token.marginXL + token.lineWidth * 2 + token.padding
@@ -125,7 +102,7 @@ export var genTableStyle = function genTableStyle(token) {
125
102
  })))), "".concat(componentCls, "-wrapper ").concat(antCls, "-spin-blur"), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty({}, "".concat(componentCls, "-placeholder"), {
126
103
  // hide empty when Table loading
127
104
  visibility: 'hidden'
128
- }))), "".concat(componentCls, "-wrapper"), _defineProperty({}, "".concat(componentCls, "-pagination"), _defineProperty(_defineProperty({}, "&".concat(antCls, "-pagination"), {
105
+ }))), _defineProperty(_defineProperty(_defineProperty(_ref, "".concat(componentCls, "-wrapper"), _defineProperty({}, "".concat(componentCls, "-pagination"), _defineProperty(_defineProperty({}, "&".concat(antCls, "-pagination"), {
129
106
  padding: "".concat(padding, "px 0"),
130
107
  margin: '0 !important'
131
108
  }), "".concat(componentCls, "-batch-operation-bar"), _defineProperty({
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
- import type { TabsProps as AntTabsProps, TabsPosition as AntTabsPosition } from 'antd/es/tabs';
2
+ import type { TabsProps as AntTabsProps, TabsPosition as AntTabsPosition, TabsRef } from 'antd/es/tabs';
3
3
  import type { Tab as AntTab } from 'rc-tabs/es/interface';
4
+ import { genTabsStyle } from './style';
5
+ import TabPane from './TabPane';
4
6
  import type { TabPaneProps } from './TabPane';
5
7
  import type { BadgeProps } from '../badge';
6
8
  export * from 'antd/es/tabs';
@@ -17,13 +19,13 @@ export type Tab = {
17
19
  badge?: BadgeType;
18
20
  } & (AntTab | AntTabOptional);
19
21
  export interface TabsProps extends Omit<AntTabsProps, 'items'> {
22
+ divider?: boolean;
20
23
  items?: Tab[];
21
24
  }
22
25
  export type TabsPosition = AntTabsPosition;
23
- declare const Tabs: {
24
- ({ children, items, type, tabPosition, prefixCls: customizePrefixCls, className, ...restProps }: TabsProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
25
- TabPane: React.FC<TabPaneProps>;
26
- genTabsStyle: (token: Partial<import("./style").TabsToken>) => import("@ant-design/cssinjs").CSSObject;
27
- displayName: string;
26
+ type CompoundedComponent = React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<TabsRef>> & {
27
+ TabPane: typeof TabPane;
28
+ genTabsStyle: typeof genTabsStyle;
28
29
  };
30
+ declare const Tabs: CompoundedComponent;
29
31
  export default Tabs;
package/es/tabs/index.js CHANGED
@@ -1,15 +1,15 @@
1
- var _excluded = ["children", "items", "type", "tabPosition", "prefixCls", "className"];
1
+ var _excluded = ["children", "divider", "items", "type", "tabPosition", "prefixCls", "className"];
2
2
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ 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
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; }
5
6
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
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); }
7
- 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); }
8
8
  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
9
  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
- import { isNullValue } from '@oceanbase/util';
11
- import { Divider, Space, Tabs as AntTabs, Tag } from 'antd';
12
10
  import React, { useCallback, useContext } from 'react';
11
+ import { Divider, Space, Tabs as AntTabs, Tag } from 'antd';
12
+ import { isNullValue } from '@oceanbase/util';
13
13
  import classNames from 'classnames';
14
14
  import Badge from "../badge";
15
15
  import ConfigProvider from "../config-provider";
@@ -22,9 +22,11 @@ export * from 'antd/es/tabs';
22
22
  var isReactNode = function isReactNode(item) {
23
23
  return /*#__PURE__*/React.isValidElement(item);
24
24
  };
25
- var Tabs = function Tabs(_ref) {
25
+ var Tabs = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
26
26
  var _newItems;
27
27
  var children = _ref.children,
28
+ _ref$divider = _ref.divider,
29
+ divider = _ref$divider === void 0 ? false : _ref$divider,
28
30
  items = _ref.items,
29
31
  type = _ref.type,
30
32
  tabPosition = _ref.tabPosition,
@@ -36,7 +38,7 @@ var Tabs = function Tabs(_ref) {
36
38
  var prefixCls = getPrefixCls('tabs', customizePrefixCls);
37
39
  var _useStyle = useStyle(prefixCls),
38
40
  wrapSSR = _useStyle.wrapSSR;
39
- var tabsCls = classNames(className);
41
+ var tabsCls = classNames(className, _defineProperty({}, "".concat(prefixCls, "-no-divider"), !divider));
40
42
  var isHorizontal = !tabPosition || tabPosition === 'top' || tabPosition === 'bottom';
41
43
  var dividerList = (items === null || items === void 0 ? void 0 : items.filter(function (item) {
42
44
  return item.divider;
@@ -80,13 +82,14 @@ var Tabs = function Tabs(_ref) {
80
82
  return item;
81
83
  });
82
84
  return wrapSSR( /*#__PURE__*/_jsx(AntTabs, _objectSpread({
85
+ ref: ref,
83
86
  items: newItems,
84
87
  type: type,
85
88
  tabPosition: tabPosition,
86
89
  prefixCls: customizePrefixCls,
87
90
  className: tabsCls
88
91
  }, restProps)));
89
- };
92
+ });
90
93
  Tabs.TabPane = TabPane;
91
94
  Tabs.genTabsStyle = genTabsStyle;
92
95
  if (process.env.NODE_ENV !== 'production') {
@@ -10,10 +10,9 @@ export var genTabsStyle = function genTabsStyle(token) {
10
10
  colorInfoBg = token.colorInfoBg,
11
11
  colorTextSecondary = token.colorTextSecondary,
12
12
  colorFillQuaternary = token.colorFillQuaternary;
13
- return _defineProperty({}, componentCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "&".concat(componentCls, "-top, &").concat(componentCls, "-bottom"), _defineProperty({}, "".concat(componentCls, "-nav::before"), {
14
- // 页签位置为 top 和 bottom 时,去掉分割线
13
+ return _defineProperty({}, componentCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "&".concat(componentCls, "-no-divider"), _defineProperty({}, "&".concat(componentCls, "-top, &").concat(componentCls, "-bottom"), _defineProperty({}, "".concat(componentCls, "-nav::before"), {
15
14
  border: 'none'
16
- })), "".concat(componentCls, "-tab"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-tab-tag"), {
15
+ }))), "".concat(componentCls, "-tab"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-tab-tag"), {
17
16
  color: colorTextSecondary,
18
17
  fontFamily: 'PingFangSC',
19
18
  fontSize: 12,