@oceanbase/ui 0.4.15 → 0.4.16
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.
- package/dist/ui.min.js +1 -1
- package/es/ProCard/index.js +18 -2
- package/lib/ProCard/index.js +17 -1
- package/package.json +3 -3
package/es/ProCard/index.js
CHANGED
|
@@ -11,8 +11,10 @@ import React, { useContext } from 'react';
|
|
|
11
11
|
import { ProCard as AntProCard } from '@ant-design/pro-components';
|
|
12
12
|
import { ConfigProvider } from '@oceanbase/design';
|
|
13
13
|
import { isHorizontalPaddingZero } from '@oceanbase/design/es/_util';
|
|
14
|
+
import { theme } from '@oceanbase/design';
|
|
14
15
|
import classNames from 'classnames';
|
|
15
16
|
import useStyle from "./style";
|
|
17
|
+
import { CaretRightFilled } from '@oceanbase/icons';
|
|
16
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
19
|
// @ts-ignore
|
|
18
20
|
var ProCard = function ProCard(_ref) {
|
|
@@ -25,10 +27,13 @@ var ProCard = function ProCard(_ref) {
|
|
|
25
27
|
className = _ref.className,
|
|
26
28
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
27
29
|
var _useContext = useContext(ConfigProvider.ConfigContext),
|
|
28
|
-
getPrefixCls = _useContext.getPrefixCls
|
|
30
|
+
getPrefixCls = _useContext.getPrefixCls,
|
|
31
|
+
iconPrefixCls = _useContext.iconPrefixCls;
|
|
29
32
|
var prefixCls = getPrefixCls('pro-card', customizePrefixCls);
|
|
30
33
|
var _useStyle = useStyle(prefixCls),
|
|
31
34
|
wrapSSR = _useStyle.wrapSSR;
|
|
35
|
+
var _theme$useToken = theme.useToken(),
|
|
36
|
+
token = _theme$useToken.token;
|
|
32
37
|
|
|
33
38
|
// ProCard body no horizontal padding
|
|
34
39
|
var noBodyHorizontalPadding = isHorizontalPaddingZero(bodyStyle === null || bodyStyle === void 0 ? void 0 : bodyStyle.padding) || ghost;
|
|
@@ -42,7 +47,18 @@ var ProCard = function ProCard(_ref) {
|
|
|
42
47
|
}, tabs) : tabs,
|
|
43
48
|
headerBordered: headerBordered,
|
|
44
49
|
bodyStyle: bodyStyle,
|
|
45
|
-
className: proCardCls
|
|
50
|
+
className: proCardCls,
|
|
51
|
+
collapsibleIconRender: function collapsibleIconRender(_ref2) {
|
|
52
|
+
var collapsed = _ref2.collapsed;
|
|
53
|
+
return /*#__PURE__*/_jsx(CaretRightFilled, {
|
|
54
|
+
className: "".concat(iconPrefixCls, " ").concat(iconPrefixCls, "-right ").concat(prefixCls, "-collapsible-icon"),
|
|
55
|
+
style: {
|
|
56
|
+
transition: 'transform 0.2s',
|
|
57
|
+
transform: collapsed ? undefined : 'rotate(90deg)',
|
|
58
|
+
color: token.colorTextSecondary
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
46
62
|
}, restProps)));
|
|
47
63
|
};
|
|
48
64
|
if (process.env.NODE_ENV !== 'production') {
|
package/lib/ProCard/index.js
CHANGED
|
@@ -36,8 +36,10 @@ var import_react = __toESM(require("react"));
|
|
|
36
36
|
var import_pro_components = require("@ant-design/pro-components");
|
|
37
37
|
var import_design = require("@oceanbase/design");
|
|
38
38
|
var import_util = require("@oceanbase/design/es/_util");
|
|
39
|
+
var import_design2 = require("@oceanbase/design");
|
|
39
40
|
var import_classnames = __toESM(require("classnames"));
|
|
40
41
|
var import_style = __toESM(require("./style"));
|
|
42
|
+
var import_icons = require("@oceanbase/icons");
|
|
41
43
|
var ProCard = ({
|
|
42
44
|
ghost,
|
|
43
45
|
title,
|
|
@@ -48,9 +50,10 @@ var ProCard = ({
|
|
|
48
50
|
className,
|
|
49
51
|
...restProps
|
|
50
52
|
}) => {
|
|
51
|
-
const { getPrefixCls } = (0, import_react.useContext)(import_design.ConfigProvider.ConfigContext);
|
|
53
|
+
const { getPrefixCls, iconPrefixCls } = (0, import_react.useContext)(import_design.ConfigProvider.ConfigContext);
|
|
52
54
|
const prefixCls = getPrefixCls("pro-card", customizePrefixCls);
|
|
53
55
|
const { wrapSSR } = (0, import_style.default)(prefixCls);
|
|
56
|
+
const { token } = import_design2.theme.useToken();
|
|
54
57
|
const noBodyHorizontalPadding = (0, import_util.isHorizontalPaddingZero)(bodyStyle == null ? void 0 : bodyStyle.padding) || ghost;
|
|
55
58
|
const proCardCls = (0, import_classnames.default)(
|
|
56
59
|
{
|
|
@@ -75,6 +78,19 @@ var ProCard = ({
|
|
|
75
78
|
headerBordered,
|
|
76
79
|
bodyStyle,
|
|
77
80
|
className: proCardCls,
|
|
81
|
+
collapsibleIconRender: ({ collapsed }) => {
|
|
82
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
83
|
+
import_icons.CaretRightFilled,
|
|
84
|
+
{
|
|
85
|
+
className: `${iconPrefixCls} ${iconPrefixCls}-right ${prefixCls}-collapsible-icon`,
|
|
86
|
+
style: {
|
|
87
|
+
transition: "transform 0.2s",
|
|
88
|
+
transform: collapsed ? void 0 : "rotate(90deg)",
|
|
89
|
+
color: token.colorTextSecondary
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
},
|
|
78
94
|
...restProps
|
|
79
95
|
}
|
|
80
96
|
)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oceanbase/ui",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.16",
|
|
4
4
|
"description": "The UI library based on OceanBase Design",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"oceanbase",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@ant-design/cssinjs": "^1.23.0",
|
|
43
43
|
"@ant-design/pro-components": "^2.8.9",
|
|
44
44
|
"@antv/g6": "3.4.10",
|
|
45
|
-
"@oceanbase/design": "^0.4.
|
|
45
|
+
"@oceanbase/design": "^0.4.13",
|
|
46
46
|
"@oceanbase/icons": "^0.4.7",
|
|
47
47
|
"@oceanbase/util": "^0.4.4",
|
|
48
48
|
"ahooks": "^2.10.14",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"react": ">=16.9.0",
|
|
72
72
|
"react-dom": ">=16.9.0"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "2d9213d7c374b9dc207ebd40663f1c50828e72b7"
|
|
75
75
|
}
|