@oceanbase/design 1.0.0-alpha.3 → 1.0.0-alpha.5

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 (74) hide show
  1. package/dist/design.min.js +1 -1
  2. package/es/alert/index.d.ts +2 -2
  3. package/es/alert/index.js +16 -4
  4. package/es/alert/style/index.js +155 -60
  5. package/es/badge/index.js +2 -3
  6. package/es/badge/style/index.js +1 -3
  7. package/es/card/index.d.ts +4 -0
  8. package/es/card/index.js +64 -7
  9. package/es/card/style/index.js +36 -10
  10. package/es/checkbox/style/index.js +4 -2
  11. package/es/config-provider/index.d.ts +2 -2
  12. package/es/config-provider/index.js +26 -2
  13. package/es/descriptions/hooks/useItems.d.ts +6 -6
  14. package/es/descriptions/style/index.js +3 -2
  15. package/es/drawer/style/index.js +28 -8
  16. package/es/empty/style/index.js +6 -4
  17. package/es/form/FormItem.d.ts +1 -0
  18. package/es/form/FormItem.js +14 -4
  19. package/es/form/style/index.js +15 -3
  20. package/es/input-number/index.d.ts +2 -1
  21. package/es/locale/ja-JP.d.ts +3 -0
  22. package/es/locale/ja-JP.js +28 -0
  23. package/es/modal/Modal.js +20 -6
  24. package/es/modal/style/index.js +64 -20
  25. package/es/radio/style/index.js +4 -2
  26. package/es/slider/style/index.js +7 -5
  27. package/es/spin/style/index.js +14 -11
  28. package/es/static-function/index.js +13 -4
  29. package/es/table/style/index.js +19 -19
  30. package/es/tabs/style/index.js +4 -2
  31. package/es/tag/index.d.ts +1 -0
  32. package/es/tag/index.js +3 -2
  33. package/es/tag/style/index.js +8 -2
  34. package/es/theme/default.js +9 -3
  35. package/es/theme/style/compact.less +7 -7
  36. package/es/theme/style/default.less +7 -7
  37. package/es/typography/style/index.js +25 -20
  38. package/lib/alert/index.d.ts +2 -2
  39. package/lib/alert/index.js +13 -3
  40. package/lib/alert/style/index.js +171 -72
  41. package/lib/badge/index.js +2 -2
  42. package/lib/badge/style/index.js +1 -3
  43. package/lib/card/index.d.ts +4 -0
  44. package/lib/card/index.js +61 -4
  45. package/lib/card/style/index.js +58 -11
  46. package/lib/checkbox/style/index.js +3 -2
  47. package/lib/config-provider/index.d.ts +2 -2
  48. package/lib/config-provider/index.js +35 -2
  49. package/lib/descriptions/hooks/useItems.d.ts +6 -6
  50. package/lib/descriptions/style/index.js +2 -2
  51. package/lib/drawer/style/index.js +28 -6
  52. package/lib/empty/style/index.js +5 -4
  53. package/lib/form/FormItem.d.ts +1 -0
  54. package/lib/form/FormItem.js +10 -2
  55. package/lib/form/style/index.js +20 -1
  56. package/lib/input-number/index.d.ts +2 -1
  57. package/lib/locale/ja-JP.d.ts +3 -0
  58. package/lib/locale/ja-JP.js +60 -0
  59. package/lib/modal/Modal.js +26 -6
  60. package/lib/modal/style/index.js +78 -18
  61. package/lib/radio/style/index.js +3 -2
  62. package/lib/slider/style/index.js +6 -5
  63. package/lib/spin/style/index.js +12 -11
  64. package/lib/static-function/index.js +7 -1
  65. package/lib/table/style/index.js +19 -19
  66. package/lib/tabs/style/index.js +5 -0
  67. package/lib/tag/index.d.ts +1 -0
  68. package/lib/tag/index.js +3 -1
  69. package/lib/tag/style/index.js +8 -0
  70. package/lib/theme/default.js +9 -3
  71. package/lib/theme/style/compact.less +7 -7
  72. package/lib/theme/style/default.less +7 -7
  73. package/lib/typography/style/index.js +24 -20
  74. package/package.json +5 -6
@@ -75,9 +75,13 @@ var ConfigProvider = function ConfigProvider(_ref3) {
75
75
  card: merge({}, parentContext.card, card),
76
76
  collapse: merge({}, {
77
77
  expandIcon: function expandIcon(_ref4) {
78
+ var _mergedTheme$token4, _mergedTheme$token5;
78
79
  var isActive = _ref4.isActive;
79
80
  return /*#__PURE__*/_jsx(CaretRightOutlined, {
80
- rotate: isActive ? 90 : 0
81
+ rotate: isActive ? 90 : 0,
82
+ style: {
83
+ color: ((_mergedTheme$token4 = mergedTheme.token) === null || _mergedTheme$token4 === void 0 ? void 0 : _mergedTheme$token4.colorIcon) || ((_mergedTheme$token5 = mergedTheme.token) === null || _mergedTheme$token5 === void 0 ? void 0 : _mergedTheme$token5.colorTextSecondary)
84
+ }
81
85
  });
82
86
  }
83
87
  }, parentContext.collapse, collapse),
@@ -85,7 +89,27 @@ var ConfigProvider = function ConfigProvider(_ref3) {
85
89
  requiredMark: 'optional'
86
90
  }, parentContext.form, form),
87
91
  spin: merge({}, parentContext.spin, spin),
88
- table: merge({}, parentContext.table, table),
92
+ table: merge({}, {
93
+ expandable: {
94
+ expandIcon: function expandIcon(_ref5) {
95
+ var _mergedTheme$token6, _mergedTheme$token7;
96
+ var expandable = _ref5.expandable,
97
+ expanded = _ref5.expanded,
98
+ onExpand = _ref5.onExpand,
99
+ record = _ref5.record;
100
+ return expandable && /*#__PURE__*/_jsx(CaretRightOutlined, {
101
+ onClick: function onClick(e) {
102
+ return onExpand(record, e);
103
+ },
104
+ style: {
105
+ transition: "transform 0.2s",
106
+ transform: expanded ? 'rotate(90deg)' : undefined,
107
+ color: ((_mergedTheme$token6 = mergedTheme.token) === null || _mergedTheme$token6 === void 0 ? void 0 : _mergedTheme$token6.colorIcon) || ((_mergedTheme$token7 = mergedTheme.token) === null || _mergedTheme$token7 === void 0 ? void 0 : _mergedTheme$token7.colorTextSecondary)
108
+ }
109
+ });
110
+ }
111
+ }
112
+ }, parentContext.table, table),
89
113
  tabs: merge({}, parentContext.tabs, tabs),
90
114
  theme: merge({}, mergedTheme, {
91
115
  token: _objectSpread(_objectSpread(_objectSpread({}, getLocaleTokenValue(mergedLocale, 'fontFamily', fontFamily, fontFamilyEn)), getLocaleTokenValue(mergedLocale, 'fontWeight', fontWeight, fontWeightEn)), getLocaleTokenValue(mergedLocale, 'fontWeightStrong', fontWeightStrong, fontWeightStrongEn))
@@ -5,17 +5,17 @@ export default function useItems(items?: DescriptionsItemType[], children?: Reac
5
5
  key?: React.Key;
6
6
  label?: React.ReactNode;
7
7
  span?: number | "filled" | {
8
- xs?: number;
9
- sm?: number;
10
- md?: number;
11
- lg?: number;
12
- xl?: number;
13
8
  xxl?: number;
9
+ xl?: number;
10
+ lg?: number;
11
+ md?: number;
12
+ sm?: number;
13
+ xs?: number;
14
14
  };
15
15
  style?: React.CSSProperties;
16
+ className?: string;
16
17
  classNames?: Partial<Record<"label" | "content", string>>;
17
18
  styles?: Partial<Record<"label" | "content", React.CSSProperties>>;
18
- className?: string;
19
19
  labelStyle?: React.CSSProperties;
20
20
  contentStyle?: React.CSSProperties;
21
21
  }[];
@@ -32,7 +32,8 @@ export var genVerticalStyle = function genVerticalStyle(size, token) {
32
32
  };
33
33
  export var genDescriptionsStyle = function genDescriptionsStyle(token) {
34
34
  var componentCls = token.componentCls,
35
- typographyComponentCls = token.typographyComponentCls;
35
+ typographyComponentCls = token.typographyComponentCls,
36
+ calc = token.calc;
36
37
  return _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls), _objectSpread(_objectSpread({}, genVerticalStyle('default', token)), {}, _defineProperty(_defineProperty({}, "".concat(componentCls, "-item-container"), _defineProperty({}, "".concat(componentCls, "-item-content"), _defineProperty({
37
38
  paddingRight: 12
38
39
  }, "".concat(typographyComponentCls, "-edit-content"), {
@@ -41,7 +42,7 @@ export var genDescriptionsStyle = function genDescriptionsStyle(token) {
41
42
  marginBottom: 0
42
43
  }))), "".concat(componentCls, "-item-container:has(", "".concat(typographyComponentCls, "-edit-content"), ")"), {
43
44
  alignItems: 'center',
44
- height: token.fontSize * token.lineHeight
45
+ height: calc(token.fontSize).mul(token.lineHeight).equal()
45
46
  }))), "".concat(componentCls).concat(componentCls, "-middle"), genVerticalStyle('middle', token)), "".concat(componentCls).concat(componentCls, "-small"), genVerticalStyle('small', token));
46
47
  };
47
48
  export default (function (prefixCls, typographyPrefixCls) {
@@ -2,20 +2,38 @@ 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 { unit } from '@ant-design/cssinjs';
5
6
  import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
6
7
  export var genDrawerStyle = function genDrawerStyle(token) {
7
8
  var componentCls = token.componentCls,
8
- antCls = token.antCls;
9
- var contentPadding = "".concat(token.paddingXS, "px ").concat(token.paddingLG, "px ").concat(token.paddingLG, "px ").concat(token.paddingLG, "px");
9
+ antCls = token.antCls,
10
+ fontSizeHeading3 = token.fontSizeHeading3,
11
+ colorSplit = token.colorSplit,
12
+ calc = token.calc;
13
+ var contentPadding = token.paddingLG;
10
14
  var boxShadowBottom = '0 2px 4px 0 rgba(54,69,99,0.04), 0 1px 6px -1px rgba(54,69,99,0.04), 0 1px 2px 0 rgba(54,69,99,0.06)';
11
15
  var boxShadowTop = '0 -2px 4px 0 rgba(54,69,99,0.04), 0 -1px 6px -1px rgba(54,69,99,0.04), 0 -1px 2px 0 rgba(54,69,99,0.06)';
12
- return _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls), _defineProperty({}, "".concat(componentCls, "-content"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-header"), {
13
- padding: "".concat(token.padding, "px ").concat(token.paddingLG, "px"),
16
+ return _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls), _defineProperty({}, "".concat(componentCls, "-content"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-header"), _defineProperty(_defineProperty({
17
+ position: 'relative',
18
+ padding: "".concat(unit(token.padding), " ").concat(unit(token.paddingLG)),
14
19
  borderBottom: 'none',
15
20
  transition: "box-shadow ".concat(token.motionDurationMid),
16
21
  // ensure header box-shadow cover body content
17
22
  zIndex: 10
18
- }), "".concat(componentCls, "-header-shadow"), {
23
+ }, "".concat(componentCls, "-title"), {
24
+ fontSize: fontSizeHeading3
25
+ }), '&::after', {
26
+ content: '""',
27
+ position: 'absolute',
28
+ bottom: 0,
29
+ left: 0,
30
+ right: 0,
31
+ height: '1px',
32
+ backgroundColor: colorSplit,
33
+ // 使用负margin让分割线贯通到content边缘
34
+ marginLeft: calc(token.paddingLG).mul(-1).equal(),
35
+ marginRight: calc(token.paddingLG).mul(-1).equal()
36
+ })), "".concat(componentCls, "-header-shadow"), {
19
37
  boxShadow: boxShadowBottom
20
38
  }), "".concat(componentCls, "-body"), {
21
39
  padding: 0,
@@ -26,7 +44,7 @@ export var genDrawerStyle = function genDrawerStyle(token) {
26
44
  overflow: 'auto'
27
45
  }), "".concat(componentCls, "-footer-container"), _defineProperty({
28
46
  position: 'sticky',
29
- padding: "".concat(token.padding, "px ").concat(token.paddingLG, "px"),
47
+ padding: "".concat(unit(token.padding), " ").concat(unit(token.paddingLG)),
30
48
  transition: "box-shadow ".concat(token.motionDurationMid),
31
49
  // ensure footer box-shadow cover body content
32
50
  zIndex: 10
@@ -35,12 +53,14 @@ export var genDrawerStyle = function genDrawerStyle(token) {
35
53
  display: 'flex',
36
54
  justifyContent: 'space-between',
37
55
  alignItems: 'center'
38
- })), "".concat(componentCls, "-footer-container-shadow"), {
56
+ })), "".concat(componentCls, "-footer-container-no-padding-top"), {
57
+ paddingTop: 0
58
+ }), "".concat(componentCls, "-footer-container-shadow"), {
39
59
  boxShadow: boxShadowTop
40
60
  }))), "".concat(componentCls).concat(componentCls, "-loading"), _defineProperty({}, "".concat(componentCls, "-body > ").concat(antCls, "-skeleton"), {
41
61
  padding: contentPadding
42
62
  })), "".concat(componentCls).concat(componentCls, "-with-footer"), _defineProperty({}, "".concat(componentCls, "-content"), _defineProperty({}, "".concat(componentCls, "-body-content"), {
43
- padding: "".concat(token.paddingXS, "px ").concat(token.paddingLG, "px")
63
+ paddingBottom: token.paddingXS
44
64
  })));
45
65
  };
46
66
  export default (function (prefixCls) {
@@ -2,13 +2,15 @@ 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 { unit } from '@ant-design/cssinjs';
5
6
  import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
6
7
  export var genEmptyStyle = function genEmptyStyle(token) {
7
8
  var antCls = token.antCls,
8
9
  componentCls = token.componentCls,
9
10
  colorTextTertiary = token.colorTextTertiary,
10
11
  colorText = token.colorText,
11
- colorTextSecondary = token.colorTextSecondary;
12
+ colorTextSecondary = token.colorTextSecondary,
13
+ calc = token.calc;
12
14
  return _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls), _defineProperty(_defineProperty({}, "".concat(componentCls, "-image"), {
13
15
  height: 160,
14
16
  marginBottom: 0
@@ -36,7 +38,7 @@ export var genEmptyStyle = function genEmptyStyle(token) {
36
38
  }, "".concat(antCls, "-steps-item-container"), _defineProperty(_defineProperty({}, "".concat(antCls, "-steps-item-icon"), _defineProperty({
37
39
  height: token.controlHeightSM,
38
40
  width: token.controlHeightSM,
39
- lineHeight: "".concat(token.controlHeightSM, "px"),
41
+ lineHeight: unit(token.controlHeightSM),
40
42
  backgroundColor: token.colorFillSecondary,
41
43
  // override default border color
42
44
  borderColor: token.colorFillSecondary
@@ -47,9 +49,9 @@ export var genEmptyStyle = function genEmptyStyle(token) {
47
49
  color: colorText,
48
50
  fontSize: token.fontSize,
49
51
  fontWeight: token.fontWeightStrong,
50
- lineHeight: "".concat(token.controlHeightSM, "px"),
52
+ lineHeight: unit(token.controlHeightSM),
51
53
  '&::after': {
52
- top: token.controlHeightSM / 2
54
+ top: calc(token.controlHeightSM).div(2).equal()
53
55
  }
54
56
  }), "".concat(antCls, "-steps-item-description"), {
55
57
  color: colorTextTertiary,
@@ -17,6 +17,7 @@ export type LabelTooltipType = WrapperTooltipProps | React.ReactNode;
17
17
  export interface FormItemProps extends AntFormItemProps {
18
18
  tooltip?: WrapperTooltipProps | ReactNode;
19
19
  action?: ReactNode;
20
+ description?: ReactNode;
20
21
  }
21
22
  type CompoundedComponent = React.FC<FormItemProps> & {
22
23
  useStatus: typeof AntFormItem.useStatus;
@@ -1,11 +1,11 @@
1
- var _excluded = ["children", "label", "tooltip", "action", "layout", "prefixCls", "className"],
1
+ var _excluded = ["children", "label", "tooltip", "action", "description", "layout", "prefixCls", "className"],
2
2
  _excluded2 = ["icon", "type", "overlayInnerStyle"];
3
3
  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; }
4
4
  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; }
5
+ 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); }
5
6
  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
7
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
8
  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 _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); }
9
9
  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; }
10
10
  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; }
11
11
  import React, { useContext } from 'react';
@@ -27,6 +27,7 @@ var FormItem = function FormItem(_ref) {
27
27
  label = _ref.label,
28
28
  tooltip = _ref.tooltip,
29
29
  action = _ref.action,
30
+ description = _ref.description,
30
31
  externalLayout = _ref.layout,
31
32
  customizePrefixCls = _ref.prefixCls,
32
33
  className = _ref.className,
@@ -36,7 +37,7 @@ var FormItem = function FormItem(_ref) {
36
37
  var prefixCls = getPrefixCls('form', customizePrefixCls);
37
38
  var _useStyle = useStyle(prefixCls),
38
39
  wrapSSR = _useStyle.wrapSSR;
39
- var formItemCls = classNames(className);
40
+ var formItemCls = classNames(className, _defineProperty({}, "".concat(prefixCls, "-item-has-description"), !!description));
40
41
  var _useContext2 = useContext(FormContext),
41
42
  contextLayout = _useContext2.layout,
42
43
  vertical = _useContext2.vertical;
@@ -59,6 +60,13 @@ var FormItem = function FormItem(_ref) {
59
60
  }, overlayInnerStyle)
60
61
  }, restTooltipProps);
61
62
  }
63
+
64
+ // description config - only show in vertical layout
65
+ var isVertical = layout === 'vertical' || vertical;
66
+ var descriptionContent = description && isVertical ? /*#__PURE__*/_jsx("div", {
67
+ className: "".concat(prefixCls, "-item-description"),
68
+ children: description
69
+ }) : null;
62
70
  return wrapSSR( /*#__PURE__*/_jsx(AntFormItem, _objectSpread(_objectSpread({
63
71
  layout: layout,
64
72
  label: action && (layout === 'vertical' || vertical) ? /*#__PURE__*/_jsxs(_Fragment, {
@@ -75,7 +83,9 @@ var FormItem = function FormItem(_ref) {
75
83
  prefixCls: customizePrefixCls,
76
84
  className: formItemCls
77
85
  }, restProps), {}, {
78
- children: children
86
+ children: /*#__PURE__*/_jsxs(_Fragment, {
87
+ children: [descriptionContent, children]
88
+ })
79
89
  })));
80
90
  };
81
91
  FormItem.useStatus = AntFormItem.useStatus;
@@ -4,13 +4,25 @@ 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 genFormStyle = function genFormStyle(token) {
7
- var componentCls = token.componentCls;
8
- return _defineProperty({}, "".concat(componentCls).concat(componentCls, "-vertical"), _defineProperty({}, "".concat(componentCls, "-item:not(").concat(componentCls, "-item-horizontal)"), _defineProperty({}, "".concat(componentCls, "-item-label > label"), _defineProperty({
7
+ var componentCls = token.componentCls,
8
+ calc = token.calc;
9
+ return _defineProperty(_defineProperty({}, componentCls, _defineProperty({}, "".concat(componentCls, "-item-extra"), {
10
+ paddingTop: token.paddingXXS,
11
+ fontSize: token.fontSizeSM
12
+ })), "".concat(componentCls).concat(componentCls, "-vertical"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-item:not(").concat(componentCls, "-item-horizontal)"), _defineProperty({}, "".concat(componentCls, "-item-label > label"), _defineProperty({
9
13
  width: '100%'
10
14
  }, "".concat(componentCls, "-item-action"), {
11
15
  position: 'absolute',
12
16
  right: 0
13
- }))));
17
+ }))), "".concat(componentCls, "-item-has-description"), _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-item-control-input"), {
18
+ minHeight: 'auto'
19
+ }), "".concat(componentCls, "-item-label"), {
20
+ paddingBottom: token.paddingXXS
21
+ }), "".concat(componentCls, "-item-description"), {
22
+ paddingBottom: calc(token.paddingXXS).add(2).equal(),
23
+ fontSize: token.fontSizeSM,
24
+ color: token.colorTextDescription
25
+ })));
14
26
  };
15
27
  export default (function (prefixCls) {
16
28
  var useStyle = genComponentStyleHook('Form', function (token) {
@@ -8,7 +8,8 @@ export interface InputNumberLocale {
8
8
  export interface InputNumberProps extends AntInputNumberProps {
9
9
  locale?: InputNumberLocale;
10
10
  }
11
- type CompoundedComponent = React.ForwardRefExoticComponent<InputNumberProps & React.RefAttributes<HTMLInputElement>> & {
11
+ type InputNumberRef = React.ComponentRef<typeof AntInputNumber>;
12
+ type CompoundedComponent = React.ForwardRefExoticComponent<InputNumberProps & React.RefAttributes<InputNumberRef>> & {
12
13
  _InternalPanelDoNotUseOrYouWillBeFired: typeof AntInputNumber._InternalPanelDoNotUseOrYouWillBeFired;
13
14
  };
14
15
  declare const InputNumber: CompoundedComponent;
@@ -0,0 +1,3 @@
1
+ import type { Locale } from '.';
2
+ declare const _default: Locale;
3
+ export default _default;
@@ -0,0 +1,28 @@
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
+ 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
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ 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
+ import jaJP from 'antd/es/locale/ja_JP';
8
+ export default _objectSpread(_objectSpread({}, jaJP), {}, {
9
+ global: _objectSpread(_objectSpread({}, jaJP.global), {}, {
10
+ inputPlaceholder: '入力してください'
11
+ }),
12
+ Pagination: _objectSpread(_objectSpread({}, jaJP.Pagination), {}, {
13
+ total: '合計 ${total} 件'
14
+ }),
15
+ Drawer: {
16
+ okText: '確定',
17
+ cancelText: 'キャンセル'
18
+ },
19
+ Table: _objectSpread(_objectSpread({}, jaJP.Table), {}, {
20
+ batchOperationBar: {
21
+ selected: '選択済み',
22
+ object: '件',
23
+ cancel: 'キャンセル',
24
+ collapse: '折りたたむ',
25
+ open: '展開'
26
+ }
27
+ })
28
+ });
package/es/modal/Modal.js CHANGED
@@ -8,6 +8,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
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
10
  import { Modal as AntModal } from 'antd';
11
+ import { ExclamationCircleOutlined, CloseCircleOutlined, CheckCircleOutlined, InfoCircleOutlined } from '@oceanbase/icons';
11
12
  import classNames from 'classnames';
12
13
  import React, { useContext } from 'react';
13
14
  import ConfigProvider from "../config-provider";
@@ -52,22 +53,35 @@ var Modal = function Modal(_ref) {
52
53
  // 替换 Modal 上的静态方法,支持消费 ConfigProvider 配置
53
54
  // 注意: 不能使用 Modal.info = modal.info 进行属性赋值,需要新建函数赋值,否则仍然无法消费 ConfigProvider 配置
54
55
  Modal.info = function (props) {
55
- return modal.info(props);
56
+ return modal.info(_objectSpread({
57
+ // use outlined icon
58
+ icon: /*#__PURE__*/_jsx(InfoCircleOutlined, {})
59
+ }, props));
56
60
  };
57
61
  Modal.success = function (props) {
58
- return modal.success(props);
62
+ return modal.success(_objectSpread({
63
+ icon: /*#__PURE__*/_jsx(CheckCircleOutlined, {})
64
+ }, props));
59
65
  };
60
66
  Modal.error = function (props) {
61
- return modal.error(props);
67
+ return modal.error(_objectSpread({
68
+ icon: /*#__PURE__*/_jsx(CloseCircleOutlined, {})
69
+ }, props));
62
70
  };
63
71
  Modal.warning = function (props) {
64
- return modal.warning(props);
72
+ return modal.warning(_objectSpread({
73
+ icon: /*#__PURE__*/_jsx(ExclamationCircleOutlined, {})
74
+ }, props));
65
75
  };
66
76
  Modal.warn = function (props) {
67
- return modal.warning(props);
77
+ return modal.warning(_objectSpread({
78
+ icon: /*#__PURE__*/_jsx(ExclamationCircleOutlined, {})
79
+ }, props));
68
80
  };
69
81
  Modal.confirm = function (props) {
70
- return modal.confirm(props);
82
+ return modal.confirm(_objectSpread({
83
+ icon: /*#__PURE__*/_jsx(ExclamationCircleOutlined, {})
84
+ }, props));
71
85
  };
72
86
  Modal.useModal = AntModal.useModal;
73
87
  Modal.destroyAll = AntModal.destroyAll;
@@ -6,21 +6,49 @@ import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
6
6
  export var genModalStyle = function genModalStyle(token) {
7
7
  var antCls = token.antCls,
8
8
  componentCls = token.componentCls,
9
- marginXXS = token.marginXXS,
10
9
  marginLG = token.marginLG,
11
- paddingMD = token.paddingMD,
12
- borderRadius = token.borderRadius,
13
- controlHeight = token.controlHeight,
14
10
  fontSizeHeading5 = token.fontSizeHeading5,
15
- lineHeightHeading5 = token.lineHeightHeading5;
11
+ lineHeightHeading5 = token.lineHeightHeading5,
12
+ fontSizeHeading3 = token.fontSizeHeading3,
13
+ colorSplit = token.colorSplit,
14
+ calc = token.calc;
16
15
  var top = 100;
17
16
  var bottom = 100;
18
- var titleHeight = fontSizeHeading5 * lineHeightHeading5;
19
- return _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, ":not(").concat(componentCls, "-confirm)"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-header"), {
20
- marginBottom: marginLG
21
- }), "".concat(componentCls, "-footer"), _defineProperty({
22
- marginTop: marginLG
23
- }, "".concat(componentCls, "-footer-content"), _defineProperty({
17
+ var titleHeight = calc(fontSizeHeading5).mul(lineHeightHeading5).equal();
18
+ return _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, ":not(").concat(componentCls, "-confirm):not(").concat(componentCls, "-progress)"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-content"), _defineProperty(_defineProperty(_defineProperty({
19
+ paddingBlock: token.padding
20
+ }, "".concat(componentCls, "-close"), {
21
+ marginTop: token.marginXXS,
22
+ marginRight: token.marginXXS
23
+ }), "".concat(componentCls, "-header"), _defineProperty(_defineProperty({
24
+ position: 'relative',
25
+ marginBottom: 0,
26
+ paddingBottom: token.padding
27
+ }, "".concat(componentCls, "-title"), {
28
+ fontSize: fontSizeHeading3
29
+ }), '&::after', {
30
+ content: '""',
31
+ position: 'absolute',
32
+ bottom: 0,
33
+ left: 0,
34
+ right: 0,
35
+ height: '1px',
36
+ backgroundColor: colorSplit,
37
+ // antd Modal content默认padding通常是24px,使用负margin让分割线贯通
38
+ // 如果antd使用其他padding值,可能需要调整
39
+ marginLeft: calc(token.paddingLG).mul(-1).equal(),
40
+ marginRight: calc(token.paddingLG).mul(-1).equal()
41
+ })), "".concat(componentCls, "-body"), {
42
+ paddingTop: token.paddingLG,
43
+ marginInline: calc(token.marginLG).mul(-1).equal(),
44
+ paddingInline: token.paddingLG
45
+ })), "".concat(componentCls, "-footer"), _defineProperty(_defineProperty({
46
+ paddingTop: token.paddingLG,
47
+ marginTop: 0
48
+ }, "".concat(antCls, "-btn"), {
49
+ height: 28,
50
+ minHeight: 28
51
+ }), "".concat(componentCls, "-footer-content"), _defineProperty({
24
52
  display: 'flex',
25
53
  justifyContent: 'space-between',
26
54
  alignItems: 'center'
@@ -28,13 +56,16 @@ export var genModalStyle = function genModalStyle(token) {
28
56
  marginInlineEnd: token.margin,
29
57
  // make extra align to start
30
58
  textAlign: 'start'
31
- })))), "".concat(componentCls).concat(componentCls, "-progress"), _defineProperty({}, "".concat(componentCls, "-content"), _defineProperty(_defineProperty(_defineProperty({
32
- padding: "".concat(token.paddingXL + token.padding, "px ").concat(token.paddingLG + token.padding, "px")
33
- }, "".concat(componentCls, "-header"), _defineProperty({
59
+ })))), "".concat(componentCls).concat(componentCls, "-progress"), _defineProperty({}, "".concat(componentCls, "-content"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({
60
+ padding: token.paddingLG
61
+ }, "".concat(componentCls, "-close"), {
62
+ marginTop: token.marginSM,
63
+ marginRight: token.marginXXS
64
+ }), "".concat(componentCls, "-header"), _defineProperty({
34
65
  textAlign: 'center',
35
66
  marginBottom: token.marginXXL
36
67
  }, "".concat(componentCls, "-title"), {
37
- fontSize: token.fontSizeHeading4
68
+ fontSize: fontSizeHeading3
38
69
  })), "".concat(componentCls, "-body"), _defineProperty(_defineProperty(_defineProperty({
39
70
  textAlign: 'center'
40
71
  }, "".concat(componentCls, "-progress-loading"), {
@@ -45,14 +76,27 @@ export var genModalStyle = function genModalStyle(token) {
45
76
  color: token.colorTextTertiary
46
77
  }), "".concat(antCls, "-alert"), {
47
78
  textAlign: 'left'
48
- })), "".concat(componentCls, "-footer"), {
79
+ })), "".concat(componentCls, "-footer"), _defineProperty({
49
80
  textAlign: 'center'
50
- }))), "".concat(componentCls, "-confirm"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-body ").concat(componentCls, "-confirm-title +").concat(componentCls, "-confirm-content"), {
51
- marginBlockStart: marginXXS,
81
+ }, "".concat(antCls, "-btn"), {
82
+ height: 28,
83
+ minHeight: 28
84
+ })))), "".concat(componentCls, "-confirm"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-content"), {
85
+ padding: token.paddingLG
86
+ }), "".concat(componentCls, "-body"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-confirm-title"), {
87
+ fontSize: fontSizeHeading3
88
+ }), "".concat(componentCls, "-confirm-body > ").concat(token.iconCls), {
89
+ height: calc(token.fontSizeHeading3).mul(token.lineHeight).equal()
90
+ }), "".concat(componentCls, "-confirm-paragraph"), {
91
+ rowGap: token.marginSM
92
+ }), "".concat(componentCls, "-confirm-content"), {
52
93
  color: token.colorTextSecondary
53
- }), "".concat(componentCls, "-confirm-btns"), {
94
+ }), "".concat(componentCls, "-confirm-btns"), _defineProperty({
54
95
  marginTop: marginLG
55
- }));
96
+ }, "".concat(antCls, "-btn"), {
97
+ height: 28,
98
+ minHeight: 28
99
+ }))));
56
100
  };
57
101
  export default (function (prefixCls) {
58
102
  var useStyle = genComponentStyleHook('Modal', function (token) {
@@ -8,11 +8,13 @@ export var genRadioStyle = function genRadioStyle(token) {
8
8
  radioSize = token.radioSize,
9
9
  fontSize = token.fontSize,
10
10
  fontSizeLG = token.fontSizeLG,
11
- lineHeight = token.lineHeight;
11
+ lineHeight = token.lineHeight,
12
+ calc = token.calc;
13
+ var marginBottom = calc(calc(fontSize).mul(lineHeight).equal()).sub(radioSize || fontSizeLG).div(-2).equal();
12
14
  return _defineProperty({}, "".concat(componentCls, "-wrapper"), _defineProperty({}, "".concat(componentCls), _defineProperty({
13
15
  alignSelf: 'baseline'
14
16
  }, "".concat(componentCls, "-inner"), {
15
- marginBottom: -(fontSize * lineHeight - (radioSize || fontSizeLG)) / 2
17
+ marginBottom: marginBottom
16
18
  })));
17
19
  };
18
20
  export default (function (prefixCls) {
@@ -2,7 +2,6 @@ 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 { toNumber } from 'lodash';
6
5
  import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
7
6
  export var genSliderStyle = function genSliderStyle(token) {
8
7
  var componentCls = token.componentCls,
@@ -11,13 +10,16 @@ export var genSliderStyle = function genSliderStyle(token) {
11
10
  _token$handleSize = token.handleSize,
12
11
  handleSize = _token$handleSize === void 0 ? 10 : _token$handleSize,
13
12
  _token$handleLineWidt = token.handleLineWidth,
14
- handleLineWidth = _token$handleLineWidt === void 0 ? 2 : _token$handleLineWidt;
13
+ handleLineWidth = _token$handleLineWidt === void 0 ? 2 : _token$handleLineWidt,
14
+ calc = token.calc;
15
+ var dotSizeHalf = calc(dotSize).div(2).equal();
16
+ var handleOffset = calc(handleSize).add(calc(handleLineWidth).mul(2).equal()).div(2).equal();
15
17
  return _defineProperty({}, "".concat(componentCls).concat(componentCls, "-horizontal"), _defineProperty({}, "".concat(componentCls, "-mark"), _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-mark-text[style*=\"left: 0%;\"]"), {
16
- transform: "translateX(calc(0% - ".concat(dotSize / 2, "px)) !important")
18
+ transform: "translateX(calc(0% - ".concat(dotSizeHalf, ")) !important")
17
19
  }), "".concat(componentCls, "-mark-text[style*=\"left: 100%;\"]"), {
18
- transform: "translateX(calc(-100% + ".concat(dotSize / 2, "px)) !important")
20
+ transform: "translateX(calc(-100% + ".concat(dotSizeHalf, ")) !important")
19
21
  }), "".concat(componentCls, "-mark-text[style=\"transform: translateX(-50%);\"]"), {
20
- transform: "translateX(calc(0% - ".concat((handleSize + toNumber(handleLineWidth) * 2) / 2, "px)) !important")
22
+ transform: "translateX(calc(0% - ".concat(handleOffset, ")) !important")
21
23
  })));
22
24
  };
23
25
  export default (function (prefixCls) {
@@ -7,9 +7,10 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
7
7
  import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
8
8
  var genSizeStyle = function genSizeStyle(spinDotSize, token) {
9
9
  var componentCls = token.componentCls,
10
- colorText = token.colorText;
10
+ colorText = token.colorText,
11
+ calc = token.calc;
11
12
  var spinDotWidth = spinDotSize;
12
- var spinDotHight = spinDotWidth * (295 / 397);
13
+ var spinDotHight = calc(spinDotWidth).mul(295).div(397).equal();
13
14
  return _defineProperty({}, "&".concat(componentCls, "-oceanbase"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-dot"), {
14
15
  width: spinDotWidth,
15
16
  height: spinDotHight
@@ -20,22 +21,23 @@ var genSizeStyle = function genSizeStyle(spinDotSize, token) {
20
21
  };
21
22
  var genNestedSizeStyle = function genNestedSizeStyle(spinDotSize, token) {
22
23
  var componentCls = token.componentCls,
23
- fontSize = token.fontSize;
24
+ fontSize = token.fontSize,
25
+ calc = token.calc;
24
26
  var spinDotWidth = spinDotSize;
25
27
  // oceanbase indicator is rectangle instead of square, should calculate actual height by ratio
26
28
  // width: 295px
27
29
  // height: 397px
28
- var spinDotHight = spinDotWidth * (295 / 397);
29
- var dotMarginLeft = -spinDotWidth / 2;
30
- var dotMarginTop = -spinDotHight / 2;
31
- var textPaddingTop = (spinDotHight - fontSize) / 2 + 2;
30
+ var spinDotHight = calc(spinDotWidth).mul(295).div(397).equal();
31
+ var dotMarginLeft = calc(spinDotWidth).div(-2).equal();
32
+ var dotMarginTop = calc(spinDotHight).div(-2).equal();
33
+ var textPaddingTop = calc(spinDotHight).sub(fontSize).div(2).add(2).equal();
32
34
  return _defineProperty({}, "&".concat(componentCls, "-oceanbase, & > ").concat(componentCls, "-oceanbase"), _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-dot"), {
33
35
  marginLeft: dotMarginLeft,
34
36
  marginTop: dotMarginTop
35
37
  }), "".concat(componentCls, "-text"), {
36
38
  paddingTop: textPaddingTop
37
39
  }), "&".concat(componentCls, "-show-text ").concat(componentCls, "-dot"), {
38
- marginTop: dotMarginTop - 10
40
+ marginTop: calc(dotMarginTop).sub(10).equal()
39
41
  }));
40
42
  };
41
43
  export var genSpinStyle = function genSpinStyle(token) {
@@ -50,16 +52,17 @@ export default (function (prefixCls) {
50
52
  // should expand by 2x for oceanbase indicator
51
53
  // because it's inner padding is smaller than antd default indicator
52
54
  // const ratio = 3;
55
+ var calc = token.calc;
53
56
  return [genSpinStyle(_objectSpread(_objectSpread({}, token), {}, {
54
57
  // https://github.com/ant-design/ant-design/blob/master/components/spin/style/index.tsx#L238
55
58
  // spinDotSize: (token.controlHeightLG / 2) * ratio,
56
59
  // spinDotSizeSM: token.controlHeightLG * 0.35 * ratio,
57
60
  // spinDotSizeLG: token.controlHeight * ratio,
58
- spinDotSize: token.controlHeight * 1.75,
61
+ spinDotSize: calc(token.controlHeight).mul(1.75).equal(),
59
62
  // 56,
60
- spinDotSizeSM: token.controlHeight * 1.125,
63
+ spinDotSizeSM: calc(token.controlHeight).mul(1.125).equal(),
61
64
  // 36
62
- spinDotSizeLG: token.controlHeight * 2.25 // 72
65
+ spinDotSizeLG: calc(token.controlHeight).mul(2.25).equal() // 72
63
66
  }))];
64
67
  });
65
68
  return useStyle(prefixCls);