@oceanbase/design 0.4.14 → 0.4.15

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.
@@ -26,7 +26,7 @@ var FormItem = function FormItem(_ref) {
26
26
  label = _ref.label,
27
27
  tooltip = _ref.tooltip,
28
28
  action = _ref.action,
29
- layout = _ref.layout,
29
+ externalLayout = _ref.layout,
30
30
  customizePrefixCls = _ref.prefixCls,
31
31
  className = _ref.className,
32
32
  restProps = _objectWithoutProperties(_ref, _excluded);
@@ -37,7 +37,9 @@ var FormItem = function FormItem(_ref) {
37
37
  wrapSSR = _useStyle.wrapSSR;
38
38
  var formItemCls = classNames(className);
39
39
  var _useContext2 = useContext(FormContext),
40
+ contextLayout = _useContext2.layout,
40
41
  vertical = _useContext2.vertical;
42
+ var layout = externalLayout || contextLayout;
41
43
  var typeList = useTooltipTypeList();
42
44
  // tooltip config
43
45
  if (_typeof(tooltip) === 'object' && ! /*#__PURE__*/React.isValidElement(tooltip)) {
@@ -58,7 +60,7 @@ var FormItem = function FormItem(_ref) {
58
60
  }
59
61
  return wrapSSR( /*#__PURE__*/_jsx(AntFormItem, _objectSpread(_objectSpread({
60
62
  layout: layout,
61
- label: action && (vertical || layout === 'vertical') ? /*#__PURE__*/_jsxs(_Fragment, {
63
+ label: action && (layout === 'vertical' || vertical) ? /*#__PURE__*/_jsxs(_Fragment, {
62
64
  children: [label, action && /*#__PURE__*/_jsx("span", {
63
65
  className: "".concat(prefixCls, "-item-action"),
64
66
  children: action
@@ -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 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;
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;
43
43
  Summary: typeof Summary;
44
44
  useStyle: (prefixCls: string) => {
45
45
  wrapSSR: (node: ReactNode) => ReactElement<any, string | React.JSXElementConstructor<any>>;
@@ -46,7 +46,7 @@ var FormItem = ({
46
46
  label,
47
47
  tooltip,
48
48
  action,
49
- layout,
49
+ layout: externalLayout,
50
50
  prefixCls: customizePrefixCls,
51
51
  className,
52
52
  ...restProps
@@ -56,7 +56,14 @@ var FormItem = ({
56
56
  const prefixCls = getPrefixCls("form", customizePrefixCls);
57
57
  const { wrapSSR } = (0, import_style.default)(prefixCls);
58
58
  const formItemCls = (0, import_classnames.default)(className);
59
- const { vertical } = (0, import_react.useContext)(import_context.FormContext);
59
+ const {
60
+ layout: contextLayout,
61
+ // compatible with vertical for version < antd 27.0.0
62
+ // ref: https://github.com/ant-design/ant-design/pull/54611
63
+ // @ts-ignore
64
+ vertical
65
+ } = (0, import_react.useContext)(import_context.FormContext);
66
+ const layout = externalLayout || contextLayout;
60
67
  const typeList = (0, import_useTooltipTypeList.useTooltipTypeList)();
61
68
  if (typeof tooltip === "object" && !import_react.default.isValidElement(tooltip)) {
62
69
  const { icon, type, overlayInnerStyle, ...restTooltipProps } = tooltip;
@@ -75,7 +82,7 @@ var FormItem = ({
75
82
  AntFormItem,
76
83
  {
77
84
  layout,
78
- label: action && (vertical || layout === "vertical") ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, label, action && /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefixCls}-item-action` }, action)) : label,
85
+ label: action && (layout === "vertical" || vertical) ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, label, action && /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefixCls}-item-action` }, action)) : label,
79
86
  tooltip,
80
87
  required: (0, import_lodash.isPlainObject)(children) && ((_a = children.type) == null ? void 0 : _a.__ANT_SWITCH) ? true : void 0,
81
88
  prefixCls: customizePrefixCls,
@@ -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 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;
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;
43
43
  Summary: typeof Summary;
44
44
  useStyle: (prefixCls: string) => {
45
45
  wrapSSR: (node: ReactNode) => ReactElement<any, string | React.JSXElementConstructor<any>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oceanbase/design",
3
- "version": "0.4.14",
3
+ "version": "0.4.15",
4
4
  "description": "The Design System of OceanBase",
5
5
  "keywords": [
6
6
  "oceanbase",
@@ -46,7 +46,7 @@
46
46
  "@oceanbase/icons": "^0.4.7",
47
47
  "@oceanbase/util": "^0.4.4",
48
48
  "ahooks": "^2.10.14",
49
- "antd": "^5.26.7",
49
+ "antd": "^5.27.0",
50
50
  "classnames": "^2.5.1",
51
51
  "lodash": "^4.17.21",
52
52
  "lottie-web": "^5.13.0",
@@ -54,8 +54,8 @@
54
54
  "rc-util": "^5.44.4"
55
55
  },
56
56
  "devDependencies": {
57
- "@babel/cli": "^7.28.0",
58
- "@babel/preset-env": "^7.28.0",
57
+ "@babel/cli": "^7.28.3",
58
+ "@babel/preset-env": "^7.28.3",
59
59
  "antd-token-previewer": "^2.0.8",
60
60
  "rc-select": "^14.16.8",
61
61
  "rc-slider": "^11.1.8",
@@ -66,5 +66,5 @@
66
66
  "react": ">=16.9.0",
67
67
  "react-dom": ">=16.9.0"
68
68
  },
69
- "gitHead": "e5b9f06614070e38c9d6a77244da2320679e3ffa"
69
+ "gitHead": "b88518b0f25b30d616d829813ba50eff7830499a"
70
70
  }