@oceanbase/design 0.4.13 → 0.4.14

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.
@@ -1,7 +1,10 @@
1
- import type { ModalFuncProps, ModalProps } from 'antd/es/modal';
1
+ import type { ModalFuncProps, ModalProps as AntModalProps } from 'antd/es/modal';
2
2
  import React from 'react';
3
+ export interface ModalProps extends AntModalProps {
4
+ extra?: React.ReactNode;
5
+ }
3
6
  declare const Modal: {
4
- ({ footer, prefixCls: customizePrefixCls, className, ...restProps }: ModalProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
7
+ ({ extra, footer, prefixCls: customizePrefixCls, className, ...restProps }: ModalProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
5
8
  info(props: ModalFuncProps): {
6
9
  destroy: () => void;
7
10
  update: (configUpdate: import("antd/es/modal/confirm").ConfigUpdate) => void;
package/es/modal/Modal.js CHANGED
@@ -1,5 +1,5 @@
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
- var _excluded = ["footer", "prefixCls", "className"];
2
+ var _excluded = ["extra", "footer", "prefixCls", "className"];
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; }
@@ -11,11 +11,14 @@ import { Modal as AntModal } from 'antd';
11
11
  import classNames from 'classnames';
12
12
  import React, { useContext } from 'react';
13
13
  import ConfigProvider from "../config-provider";
14
+ import Space from "../space";
14
15
  import { modal } from "../static-function";
15
16
  import useStyle from "./style";
16
17
  import { jsx as _jsx } from "react/jsx-runtime";
18
+ import { jsxs as _jsxs } from "react/jsx-runtime";
17
19
  var Modal = function Modal(_ref) {
18
- var footer = _ref.footer,
20
+ var extra = _ref.extra,
21
+ footer = _ref.footer,
19
22
  customizePrefixCls = _ref.prefixCls,
20
23
  className = _ref.className,
21
24
  restProps = _objectWithoutProperties(_ref, _excluded);
@@ -30,7 +33,17 @@ var Modal = function Modal(_ref) {
30
33
  // convert false to null to hide .ant-modal-footer dom
31
34
  // ref: https://github.com/ant-design/ant-design/blob/master/components/modal/Modal.tsx#L105
32
35
  ,
33
- footer: footer === false ? null : footer,
36
+ footer: footer === false ? null : extra ? function (originNode) {
37
+ return /*#__PURE__*/_jsxs("div", {
38
+ className: "".concat(prefixCls, "-footer-content"),
39
+ children: [/*#__PURE__*/_jsx("div", {
40
+ className: "".concat(prefixCls, "-footer-extra"),
41
+ children: extra
42
+ }), /*#__PURE__*/_jsx(Space, {
43
+ children: originNode
44
+ })]
45
+ });
46
+ } : footer,
34
47
  prefixCls: customizePrefixCls,
35
48
  className: modalCls
36
49
  }, restProps)));
@@ -18,9 +18,17 @@ export var genModalStyle = function genModalStyle(token) {
18
18
  var titleHeight = fontSizeHeading5 * lineHeightHeading5;
19
19
  return _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, ":not(").concat(componentCls, "-confirm)"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-header"), {
20
20
  marginBottom: marginLG
21
- }), "".concat(componentCls, "-footer"), {
21
+ }), "".concat(componentCls, "-footer"), _defineProperty({
22
22
  marginTop: marginLG
23
- })), "".concat(componentCls).concat(componentCls, "-progress"), _defineProperty({}, "".concat(componentCls, "-content"), _defineProperty(_defineProperty(_defineProperty({
23
+ }, "".concat(componentCls, "-footer-content"), _defineProperty({
24
+ display: 'flex',
25
+ justifyContent: 'space-between',
26
+ alignItems: 'center'
27
+ }, "".concat(componentCls, "-footer-extra"), {
28
+ marginInlineEnd: token.margin,
29
+ // make extra align to start
30
+ textAlign: 'start'
31
+ })))), "".concat(componentCls).concat(componentCls, "-progress"), _defineProperty({}, "".concat(componentCls, "-content"), _defineProperty(_defineProperty(_defineProperty({
24
32
  padding: "".concat(token.paddingXL + token.padding, "px ").concat(token.paddingLG + token.padding, "px")
25
33
  }, "".concat(componentCls, "-header"), _defineProperty({
26
34
  textAlign: 'center',
@@ -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>>;
@@ -39,9 +39,7 @@ export var genTagStyle = function genTagStyle(token) {
39
39
  paddingInline: token.paddingXS,
40
40
  borderColor: getTagBorderColor(token.colorBorder),
41
41
  fontSize: token.fontSizeSM
42
- }, "".concat(antCls, "-typography"), _defineProperty({
43
- fontSize: token.fontSizeSM
44
- }, "".concat(componentCls, "-icon"), {
42
+ }, "".concat(antCls, "-typography"), _defineProperty({}, "".concat(componentCls, "-icon"), {
45
43
  marginInlineEnd: paddingInline
46
44
  })), '&-ellipsis', {
47
45
  maxWidth: '100%',
@@ -1,7 +1,10 @@
1
- import type { ModalFuncProps, ModalProps } from 'antd/es/modal';
1
+ import type { ModalFuncProps, ModalProps as AntModalProps } from 'antd/es/modal';
2
2
  import React from 'react';
3
+ export interface ModalProps extends AntModalProps {
4
+ extra?: React.ReactNode;
5
+ }
3
6
  declare const Modal: {
4
- ({ footer, prefixCls: customizePrefixCls, className, ...restProps }: ModalProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
7
+ ({ extra, footer, prefixCls: customizePrefixCls, className, ...restProps }: ModalProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
5
8
  info(props: ModalFuncProps): {
6
9
  destroy: () => void;
7
10
  update: (configUpdate: import("antd/es/modal/confirm").ConfigUpdate) => void;
@@ -36,9 +36,16 @@ var import_antd = require("antd");
36
36
  var import_classnames = __toESM(require("classnames"));
37
37
  var import_react = __toESM(require("react"));
38
38
  var import_config_provider = __toESM(require("../config-provider"));
39
+ var import_space = __toESM(require("../space"));
39
40
  var import_static_function = require("../static-function");
40
41
  var import_style = __toESM(require("./style"));
41
- var Modal = ({ footer, prefixCls: customizePrefixCls, className, ...restProps }) => {
42
+ var Modal = ({
43
+ extra,
44
+ footer,
45
+ prefixCls: customizePrefixCls,
46
+ className,
47
+ ...restProps
48
+ }) => {
42
49
  const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
43
50
  const prefixCls = getPrefixCls("modal", customizePrefixCls);
44
51
  const { wrapSSR } = (0, import_style.default)(prefixCls);
@@ -48,7 +55,7 @@ var Modal = ({ footer, prefixCls: customizePrefixCls, className, ...restProps })
48
55
  import_antd.Modal,
49
56
  {
50
57
  destroyOnClose: true,
51
- footer: footer === false ? null : footer,
58
+ footer: footer === false ? null : extra ? (originNode) => /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-footer-content` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-footer-extra` }, extra), /* @__PURE__ */ import_react.default.createElement(import_space.default, null, originNode)) : footer,
52
59
  prefixCls: customizePrefixCls,
53
60
  className: modalCls,
54
61
  ...restProps
@@ -46,7 +46,17 @@ var genModalStyle = (token) => {
46
46
  marginBottom: marginLG
47
47
  },
48
48
  [`${componentCls}-footer`]: {
49
- marginTop: marginLG
49
+ marginTop: marginLG,
50
+ [`${componentCls}-footer-content`]: {
51
+ display: "flex",
52
+ justifyContent: "space-between",
53
+ alignItems: "center",
54
+ [`${componentCls}-footer-extra`]: {
55
+ marginInlineEnd: token.margin,
56
+ // make extra align to start
57
+ textAlign: "start"
58
+ }
59
+ }
50
60
  }
51
61
  },
52
62
  /* Modal.Progress */
@@ -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>>;
@@ -59,7 +59,6 @@ var genTagStyle = (token) => {
59
59
  borderColor: getTagBorderColor(token.colorBorder),
60
60
  fontSize: token.fontSizeSM,
61
61
  [`${antCls}-typography`]: {
62
- fontSize: token.fontSizeSM,
63
62
  [`${componentCls}-icon`]: {
64
63
  marginInlineEnd: paddingInline
65
64
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oceanbase/design",
3
- "version": "0.4.13",
3
+ "version": "0.4.14",
4
4
  "description": "The Design System of OceanBase",
5
5
  "keywords": [
6
6
  "oceanbase",
@@ -39,14 +39,14 @@
39
39
  "build": "father build && cp src/style/reset.css dist/"
40
40
  },
41
41
  "dependencies": {
42
- "@ant-design/cssinjs": "^1.23.0",
42
+ "@ant-design/cssinjs": "^1.24.0",
43
43
  "@ctrl/tinycolor": "^4.1.0",
44
44
  "@inline-svg-unique-id/react": "^1.2.3",
45
45
  "@oceanbase/aliyun-theme": "^0.1.6",
46
46
  "@oceanbase/icons": "^0.4.7",
47
47
  "@oceanbase/util": "^0.4.4",
48
48
  "ahooks": "^2.10.14",
49
- "antd": "^5.26.4",
49
+ "antd": "^5.26.7",
50
50
  "classnames": "^2.5.1",
51
51
  "lodash": "^4.17.21",
52
52
  "lottie-web": "^5.13.0",
@@ -66,5 +66,5 @@
66
66
  "react": ">=16.9.0",
67
67
  "react-dom": ">=16.9.0"
68
68
  },
69
- "gitHead": "2d9213d7c374b9dc207ebd40663f1c50828e72b7"
69
+ "gitHead": "e5b9f06614070e38c9d6a77244da2320679e3ffa"
70
70
  }