@oceanbase/design 0.4.18 → 0.4.19

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.
@@ -2,7 +2,7 @@ import type { ButtonProps as AntButtonProps } from 'antd/es/button';
2
2
  import React from 'react';
3
3
  export * from 'antd/es/button';
4
4
  export type ButtonProps = AntButtonProps;
5
- declare const _default: React.ForwardRefExoticComponent<AntButtonProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>> & {
5
+ declare const _default: React.ForwardRefExoticComponent<AntButtonProps & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>> & {
6
6
  Group: React.FC<import("antd/es/button").ButtonGroupProps>;
7
7
  __ANT_BUTTON: boolean;
8
8
  };
@@ -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
- xxl?: number;
9
- xl?: number;
10
- lg?: number;
11
- md?: number;
12
- sm?: number;
13
8
  xs?: number;
9
+ sm?: number;
10
+ md?: number;
11
+ lg?: number;
12
+ xl?: number;
13
+ xxl?: number;
14
14
  };
15
15
  style?: React.CSSProperties;
16
- className?: string;
17
16
  classNames?: Partial<Record<"label" | "content", string>>;
18
17
  styles?: Partial<Record<"label" | "content", React.CSSProperties>>;
18
+ className?: string;
19
19
  labelStyle?: React.CSSProperties;
20
20
  contentStyle?: React.CSSProperties;
21
21
  }[];
@@ -4,7 +4,7 @@ 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?: "" | "success" | "warning" | "error" | "validating";
8
8
  errors: React.ReactNode[];
9
9
  warnings: React.ReactNode[];
10
10
  };
@@ -13,12 +13,12 @@ export default _objectSpread(_objectSpread({}, jaJP), {}, {
13
13
  total: '合計 ${total} 件'
14
14
  }),
15
15
  Drawer: {
16
- okText: '確定',
16
+ okText: 'OK',
17
17
  cancelText: 'キャンセル'
18
18
  },
19
19
  Table: _objectSpread(_objectSpread({}, jaJP.Table), {}, {
20
20
  batchOperationBar: {
21
- selected: '選択済み',
21
+ selected: '選択中',
22
22
  object: '件',
23
23
  cancel: 'キャンセル',
24
24
  collapse: '折りたたむ',
@@ -6,6 +6,7 @@ import type { SegmentedRawOption } from 'rc-segmented';
6
6
  export * from 'antd/es/segmented';
7
7
  type BadgeType = BadgeProps | BadgeProps['count'];
8
8
  export type SegmentedLabeledOption = AntSegmentedLabeledOption & {
9
+ icon?: React.ReactNode;
9
10
  ellipsis?: EllipsisConfig;
10
11
  badge?: BadgeType;
11
12
  };
@@ -1,5 +1,5 @@
1
1
  var _excluded = ["prefixCls", "options"],
2
- _excluded2 = ["label", "badge"];
2
+ _excluded2 = ["label", "icon", "badge", "ellipsis"];
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
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; }
@@ -39,16 +39,24 @@ var Segmented = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
39
39
  }, []);
40
40
  var newOptions = options === null || options === void 0 ? void 0 : options.map(function (item) {
41
41
  if (_typeof(item) === 'object') {
42
- var label = item.label,
43
- badge = item.badge,
44
- restItem = _objectWithoutProperties(item, _excluded2);
42
+ var _ref2 = item,
43
+ label = _ref2.label,
44
+ icon = _ref2.icon,
45
+ badge = _ref2.badge,
46
+ _ref2$ellipsis = _ref2.ellipsis,
47
+ ellipsis = _ref2$ellipsis === void 0 ? {
48
+ tooltip: true
49
+ } : _ref2$ellipsis,
50
+ restItem = _objectWithoutProperties(_ref2, _excluded2);
45
51
  return _objectSpread(_objectSpread({}, restItem), {}, {
46
52
  label: /*#__PURE__*/_jsxs(Flex, {
47
- gap: 4,
48
53
  align: "center",
49
54
  justify: "center",
50
- children: [item !== null && item !== void 0 && item.ellipsis ? /*#__PURE__*/_jsx(Typography.Text, {
51
- ellipsis: item.ellipsis,
55
+ children: [icon && /*#__PURE__*/_jsx("span", {
56
+ className: "".concat(prefixCls, "-item-icon"),
57
+ children: icon
58
+ }), ellipsis ? /*#__PURE__*/_jsx(Typography.Text, {
59
+ ellipsis: ellipsis,
52
60
  children: label
53
61
  }) : label, badge && renderBadge(badge)]
54
62
  })
@@ -13,6 +13,7 @@ export var genSegmentedStyle = function genSegmentedStyle(token) {
13
13
  })), '&:active', _defineProperty({}, "".concat(antCls, "-badge >").concat(antCls, "-badge-count"), {
14
14
  backgroundColor: colorFillSecondary
15
15
  })))), ">".concat(componentCls, "-item"), _defineProperty({}, ">".concat(componentCls, "-item-label"), _defineProperty({}, "".concat(antCls, "-badge >").concat(antCls, "-badge-count"), {
16
+ marginInlineStart: 4,
16
17
  backgroundColor: colorFillSecondary,
17
18
  color: 'inherit',
18
19
  boxShadow: 'none'
@@ -38,8 +38,8 @@ declare const _default: (<RecordType extends AnyObject = AnyObject>(props: Table
38
38
  SELECTION_ALL: "SELECT_ALL";
39
39
  SELECTION_INVERT: "SELECT_INVERT";
40
40
  SELECTION_NONE: "SELECT_NONE";
41
- Column: <RecordType_1 extends import("antd/es/_util/type").AnyObject>(_: import("antd").TableColumnProps<RecordType_1>) => null;
42
- ColumnGroup: <RecordType_2 extends import("antd/es/_util/type").AnyObject>(_: import("antd/es/table/ColumnGroup").ColumnGroupProps<RecordType_2>) => null;
41
+ Column: <RecordType extends import("antd/es/_util/type").AnyObject>(_: import("antd").TableColumnProps<RecordType>) => null;
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
44
  useStyle: (prefixCls: string) => {
45
45
  wrapSSR: (node: ReactNode) => ReactElement<any, string | React.JSXElementConstructor<any>>;
@@ -41,14 +41,17 @@ export var genTypographyStyle = function genTypographyStyle(token) {
41
41
  }
42
42
  }), "".concat(componentCls).concat(componentCls, "-edit-content"), _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-div&"), {
43
43
  insetInlineStart: -token.paddingSM,
44
+ insetBlockStart: 0,
44
45
  marginTop: -marginOffset,
45
46
  marginBottom: "calc(1em - ".concat(marginOffset, "px)")
46
47
  }), "".concat(componentCls, "-span&"), {
47
48
  insetInlineStart: -token.paddingSM,
49
+ insetBlockStart: 0,
48
50
  marginTop: -marginOffset,
49
51
  marginBottom: -marginOffset
50
52
  }), "".concat(componentCls, "-h1&, ").concat(componentCls, "-h2&, ").concat(componentCls, "-h3&, ").concat(componentCls, "-h4&, ").concat(componentCls, "-h5&"), {
51
53
  insetInlineStart: -token.paddingSM,
54
+ insetBlockStart: 0,
52
55
  marginTop: "".concat(-marginOffset, "px !important"),
53
56
  marginBottom: "".concat(-marginOffset, "px !important")
54
57
  }));
@@ -2,7 +2,7 @@ import type { ButtonProps as AntButtonProps } from 'antd/es/button';
2
2
  import React from 'react';
3
3
  export * from 'antd/es/button';
4
4
  export type ButtonProps = AntButtonProps;
5
- declare const _default: React.ForwardRefExoticComponent<AntButtonProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>> & {
5
+ declare const _default: React.ForwardRefExoticComponent<AntButtonProps & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>> & {
6
6
  Group: React.FC<import("antd/es/button").ButtonGroupProps>;
7
7
  __ANT_BUTTON: boolean;
8
8
  };
@@ -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
- xxl?: number;
9
- xl?: number;
10
- lg?: number;
11
- md?: number;
12
- sm?: number;
13
8
  xs?: number;
9
+ sm?: number;
10
+ md?: number;
11
+ lg?: number;
12
+ xl?: number;
13
+ xxl?: number;
14
14
  };
15
15
  style?: React.CSSProperties;
16
- className?: string;
17
16
  classNames?: Partial<Record<"label" | "content", string>>;
18
17
  styles?: Partial<Record<"label" | "content", React.CSSProperties>>;
18
+ className?: string;
19
19
  labelStyle?: React.CSSProperties;
20
20
  contentStyle?: React.CSSProperties;
21
21
  }[];
@@ -4,7 +4,7 @@ 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?: "" | "success" | "warning" | "error" | "validating";
8
8
  errors: React.ReactNode[];
9
9
  warnings: React.ReactNode[];
10
10
  };
@@ -44,13 +44,13 @@ var ja_JP_default = {
44
44
  total: "合計 ${total} 件"
45
45
  },
46
46
  Drawer: {
47
- okText: "確定",
47
+ okText: "OK",
48
48
  cancelText: "キャンセル"
49
49
  },
50
50
  Table: {
51
51
  ...import_ja_JP.default.Table,
52
52
  batchOperationBar: {
53
- selected: "選択済み",
53
+ selected: "選択中",
54
54
  object: "件",
55
55
  cancel: "キャンセル",
56
56
  collapse: "折りたたむ",
@@ -6,6 +6,7 @@ import type { SegmentedRawOption } from 'rc-segmented';
6
6
  export * from 'antd/es/segmented';
7
7
  type BadgeType = BadgeProps | BadgeProps['count'];
8
8
  export type SegmentedLabeledOption = AntSegmentedLabeledOption & {
9
+ icon?: React.ReactNode;
9
10
  ellipsis?: EllipsisConfig;
10
11
  badge?: BadgeType;
11
12
  };
@@ -57,11 +57,18 @@ var Segmented = import_react.default.forwardRef(
57
57
  }, []);
58
58
  const newOptions = options == null ? void 0 : options.map((item) => {
59
59
  if (typeof item === "object") {
60
- const { label, badge, ...restItem } = item;
60
+ const {
61
+ label,
62
+ icon,
63
+ badge,
64
+ ellipsis = { tooltip: true },
65
+ ...restItem
66
+ } = item;
61
67
  return {
62
68
  ...restItem,
63
- label: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd.Flex, { gap: 4, align: "center", justify: "center", children: [
64
- (item == null ? void 0 : item.ellipsis) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_typography.default.Text, { ellipsis: item.ellipsis, children: label }) : label,
69
+ label: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd.Flex, { align: "center", justify: "center", children: [
70
+ icon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${prefixCls}-item-icon`, children: icon }),
71
+ ellipsis ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_typography.default.Text, { ellipsis, children: label }) : label,
65
72
  badge && renderBadge(badge)
66
73
  ] })
67
74
  };
@@ -45,6 +45,7 @@ var genSegmentedStyle = (token) => {
45
45
  [`>${componentCls}-item`]: {
46
46
  [`>${componentCls}-item-label`]: {
47
47
  [`${antCls}-badge >${antCls}-badge-count`]: {
48
+ marginInlineStart: 4,
48
49
  backgroundColor: colorFillSecondary,
49
50
  color: "inherit",
50
51
  boxShadow: "none"
@@ -38,8 +38,8 @@ declare const _default: (<RecordType extends AnyObject = AnyObject>(props: Table
38
38
  SELECTION_ALL: "SELECT_ALL";
39
39
  SELECTION_INVERT: "SELECT_INVERT";
40
40
  SELECTION_NONE: "SELECT_NONE";
41
- Column: <RecordType_1 extends import("antd/es/_util/type").AnyObject>(_: import("antd").TableColumnProps<RecordType_1>) => null;
42
- ColumnGroup: <RecordType_2 extends import("antd/es/_util/type").AnyObject>(_: import("antd/es/table/ColumnGroup").ColumnGroupProps<RecordType_2>) => null;
41
+ Column: <RecordType extends import("antd/es/_util/type").AnyObject>(_: import("antd").TableColumnProps<RecordType>) => null;
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
44
  useStyle: (prefixCls: string) => {
45
45
  wrapSSR: (node: ReactNode) => ReactElement<any, string | React.JSXElementConstructor<any>>;
@@ -65,16 +65,19 @@ var genTypographyStyle = (token) => {
65
65
  [`${componentCls}${componentCls}-edit-content`]: {
66
66
  [`${componentCls}-div&`]: {
67
67
  insetInlineStart: -token.paddingSM,
68
+ insetBlockStart: 0,
68
69
  marginTop: -marginOffset,
69
70
  marginBottom: `calc(1em - ${marginOffset}px)`
70
71
  },
71
72
  [`${componentCls}-span&`]: {
72
73
  insetInlineStart: -token.paddingSM,
74
+ insetBlockStart: 0,
73
75
  marginTop: -marginOffset,
74
76
  marginBottom: -marginOffset
75
77
  },
76
78
  [`${componentCls}-h1&, ${componentCls}-h2&, ${componentCls}-h3&, ${componentCls}-h4&, ${componentCls}-h5&`]: {
77
79
  insetInlineStart: -token.paddingSM,
80
+ insetBlockStart: 0,
78
81
  marginTop: `${-marginOffset}px !important`,
79
82
  marginBottom: `${-marginOffset}px !important`
80
83
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oceanbase/design",
3
- "version": "0.4.18",
3
+ "version": "0.4.19",
4
4
  "description": "The Design System of OceanBase",
5
5
  "keywords": [
6
6
  "oceanbase",
@@ -65,5 +65,5 @@
65
65
  "react": ">=16.9.0",
66
66
  "react-dom": ">=16.9.0"
67
67
  },
68
- "gitHead": "0cbec46be9880f5620e5a9420ca4d09a60f009f3"
68
+ "gitHead": "ca53c6686a0e6b1b16c84672d8bdd15a720d9a03"
69
69
  }