@oceanbase/ui 1.0.0-alpha.0 → 1.0.0-alpha.1
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.css +1 -1
- package/dist/ui.min.js +1 -1
- package/es/DateRanger/index.less +1 -1
- package/es/GraphToolbar/index.less +1 -1
- package/es/Highlight/index.less +2 -2
- package/es/ProCard/index.d.ts +2 -1
- package/es/ProCard/index.js +12 -8
- package/lib/DateRanger/index.less +1 -1
- package/lib/GraphToolbar/index.less +1 -1
- package/lib/Highlight/index.less +2 -2
- package/lib/ProCard/index.d.ts +2 -1
- package/lib/ProCard/index.js +16 -5
- package/package.json +5 -5
package/es/DateRanger/index.less
CHANGED
package/es/Highlight/index.less
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
font-size: 14px;
|
|
11
11
|
line-height: 1.5714285714285714;
|
|
12
12
|
list-style: none;
|
|
13
|
-
border-radius:
|
|
13
|
+
border-radius: @borderRadius;
|
|
14
14
|
|
|
15
15
|
&:not(:hover) .@{prefix}-copy {
|
|
16
16
|
visibility: hidden;
|
|
@@ -192,7 +192,7 @@
|
|
|
192
192
|
overflow-x: auto;
|
|
193
193
|
color: #c0c5ce;
|
|
194
194
|
background: #2b303b;
|
|
195
|
-
border-radius:
|
|
195
|
+
border-radius: @borderRadius;
|
|
196
196
|
|
|
197
197
|
&.@{prefix}-index {
|
|
198
198
|
border-inline-end: 1px solid rgba(255, 255, 255, 0.05);
|
package/es/ProCard/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ProCard as AntProCard } from '@ant-design/pro-components';
|
|
2
2
|
import type { ProCardProps } from '@ant-design/pro-components';
|
|
3
3
|
export { ProCardProps };
|
|
4
|
-
|
|
4
|
+
export type ProCardType = typeof AntProCard;
|
|
5
|
+
declare const ProCard: ProCardType;
|
|
5
6
|
export default ProCard;
|
package/es/ProCard/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["ghost", "title", "tabs", "headerBordered", "bodyStyle", "prefixCls", "className"];
|
|
1
|
+
var _excluded = ["bordered", "ghost", "title", "tabs", "headerBordered", "bodyStyle", "prefixCls", "className", "style"];
|
|
2
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
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
4
|
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,26 +9,28 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
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 React, { useContext } from 'react';
|
|
11
11
|
import { ProCard as AntProCard } from '@ant-design/pro-components';
|
|
12
|
-
import { ConfigProvider } from '@oceanbase/design';
|
|
12
|
+
import { ConfigProvider, theme } from '@oceanbase/design';
|
|
13
13
|
import { isHorizontalPaddingZero } from '@oceanbase/design/es/_util';
|
|
14
|
-
import {
|
|
14
|
+
import { CaretRightFilled } from '@oceanbase/icons';
|
|
15
15
|
import classNames from 'classnames';
|
|
16
16
|
import useStyle from "./style";
|
|
17
|
-
import { CaretRightFilled } from '@oceanbase/icons';
|
|
18
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
18
|
// @ts-ignore
|
|
20
19
|
var ProCard = function ProCard(_ref) {
|
|
21
|
-
var
|
|
20
|
+
var bordered = _ref.bordered,
|
|
21
|
+
ghost = _ref.ghost,
|
|
22
22
|
title = _ref.title,
|
|
23
23
|
tabs = _ref.tabs,
|
|
24
24
|
headerBordered = _ref.headerBordered,
|
|
25
25
|
bodyStyle = _ref.bodyStyle,
|
|
26
26
|
customizePrefixCls = _ref.prefixCls,
|
|
27
27
|
className = _ref.className,
|
|
28
|
+
style = _ref.style,
|
|
28
29
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
29
30
|
var _useContext = useContext(ConfigProvider.ConfigContext),
|
|
30
31
|
getPrefixCls = _useContext.getPrefixCls,
|
|
31
|
-
iconPrefixCls = _useContext.iconPrefixCls
|
|
32
|
+
iconPrefixCls = _useContext.iconPrefixCls,
|
|
33
|
+
contextCard = _useContext.card;
|
|
32
34
|
var prefixCls = getPrefixCls('pro-card', customizePrefixCls);
|
|
33
35
|
var _useStyle = useStyle(prefixCls),
|
|
34
36
|
wrapSSR = _useStyle.wrapSSR;
|
|
@@ -37,17 +39,19 @@ var ProCard = function ProCard(_ref) {
|
|
|
37
39
|
|
|
38
40
|
// ProCard body no horizontal padding
|
|
39
41
|
var noBodyHorizontalPadding = isHorizontalPaddingZero(bodyStyle === null || bodyStyle === void 0 ? void 0 : bodyStyle.padding) || ghost;
|
|
40
|
-
var proCardCls = classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-has-title"), !!title), "".concat(prefixCls, "-no-body-horizontal-padding"), noBodyHorizontalPadding), "".concat(prefixCls, "-no-divider"), !headerBordered), "".concat(prefixCls, "-contain-tabs"), !!tabs), className);
|
|
42
|
+
var proCardCls = classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-has-title"), !!title), "".concat(prefixCls, "-no-body-horizontal-padding"), noBodyHorizontalPadding), "".concat(prefixCls, "-no-divider"), !headerBordered), "".concat(prefixCls, "-contain-tabs"), !!tabs), contextCard === null || contextCard === void 0 ? void 0 : contextCard.className, className);
|
|
41
43
|
return wrapSSR( /*#__PURE__*/_jsx(AntProCard, _objectSpread({
|
|
42
44
|
prefixCls: customizePrefixCls,
|
|
45
|
+
bordered: bordered !== null && bordered !== void 0 ? bordered : contextCard !== null && contextCard !== void 0 && contextCard.variant ? (contextCard === null || contextCard === void 0 ? void 0 : contextCard.variant) === 'outlined' : undefined,
|
|
43
46
|
ghost: ghost,
|
|
44
47
|
title: title,
|
|
45
48
|
tabs: _typeof(tabs) === 'object' ? _objectSpread({
|
|
46
49
|
size: 'large'
|
|
47
50
|
}, tabs) : tabs,
|
|
48
|
-
headerBordered: headerBordered,
|
|
51
|
+
headerBordered: headerBordered !== null && headerBordered !== void 0 ? headerBordered : contextCard === null || contextCard === void 0 ? void 0 : contextCard.divided,
|
|
49
52
|
bodyStyle: bodyStyle,
|
|
50
53
|
className: proCardCls,
|
|
54
|
+
style: _objectSpread(_objectSpread({}, contextCard === null || contextCard === void 0 ? void 0 : contextCard.style), style),
|
|
51
55
|
collapsibleIconRender: function collapsibleIconRender(_ref2) {
|
|
52
56
|
var collapsed = _ref2.collapsed;
|
|
53
57
|
return /*#__PURE__*/_jsx(CaretRightFilled, {
|
package/lib/Highlight/index.less
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
font-size: 14px;
|
|
11
11
|
line-height: 1.5714285714285714;
|
|
12
12
|
list-style: none;
|
|
13
|
-
border-radius:
|
|
13
|
+
border-radius: @borderRadius;
|
|
14
14
|
|
|
15
15
|
&:not(:hover) .@{prefix}-copy {
|
|
16
16
|
visibility: hidden;
|
|
@@ -192,7 +192,7 @@
|
|
|
192
192
|
overflow-x: auto;
|
|
193
193
|
color: #c0c5ce;
|
|
194
194
|
background: #2b303b;
|
|
195
|
-
border-radius:
|
|
195
|
+
border-radius: @borderRadius;
|
|
196
196
|
|
|
197
197
|
&.@{prefix}-index {
|
|
198
198
|
border-inline-end: 1px solid rgba(255, 255, 255, 0.05);
|
package/lib/ProCard/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ProCard as AntProCard } from '@ant-design/pro-components';
|
|
2
2
|
import type { ProCardProps } from '@ant-design/pro-components';
|
|
3
3
|
export { ProCardProps };
|
|
4
|
-
|
|
4
|
+
export type ProCardType = typeof AntProCard;
|
|
5
|
+
declare const ProCard: ProCardType;
|
|
5
6
|
export default ProCard;
|
package/lib/ProCard/index.js
CHANGED
|
@@ -36,11 +36,11 @@ 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
|
|
39
|
+
var import_icons = require("@oceanbase/icons");
|
|
40
40
|
var import_classnames = __toESM(require("classnames"));
|
|
41
41
|
var import_style = __toESM(require("./style"));
|
|
42
|
-
var import_icons = require("@oceanbase/icons");
|
|
43
42
|
var ProCard = ({
|
|
43
|
+
bordered,
|
|
44
44
|
ghost,
|
|
45
45
|
title,
|
|
46
46
|
tabs,
|
|
@@ -48,12 +48,17 @@ var ProCard = ({
|
|
|
48
48
|
bodyStyle,
|
|
49
49
|
prefixCls: customizePrefixCls,
|
|
50
50
|
className,
|
|
51
|
+
style,
|
|
51
52
|
...restProps
|
|
52
53
|
}) => {
|
|
53
|
-
const {
|
|
54
|
+
const {
|
|
55
|
+
getPrefixCls,
|
|
56
|
+
iconPrefixCls,
|
|
57
|
+
card: contextCard
|
|
58
|
+
} = (0, import_react.useContext)(import_design.ConfigProvider.ConfigContext);
|
|
54
59
|
const prefixCls = getPrefixCls("pro-card", customizePrefixCls);
|
|
55
60
|
const { wrapSSR } = (0, import_style.default)(prefixCls);
|
|
56
|
-
const { token } =
|
|
61
|
+
const { token } = import_design.theme.useToken();
|
|
57
62
|
const noBodyHorizontalPadding = (0, import_util.isHorizontalPaddingZero)(bodyStyle == null ? void 0 : bodyStyle.padding) || ghost;
|
|
58
63
|
const proCardCls = (0, import_classnames.default)(
|
|
59
64
|
{
|
|
@@ -62,6 +67,7 @@ var ProCard = ({
|
|
|
62
67
|
[`${prefixCls}-no-divider`]: !headerBordered,
|
|
63
68
|
[`${prefixCls}-contain-tabs`]: !!tabs
|
|
64
69
|
},
|
|
70
|
+
contextCard == null ? void 0 : contextCard.className,
|
|
65
71
|
className
|
|
66
72
|
);
|
|
67
73
|
return wrapSSR(
|
|
@@ -69,15 +75,20 @@ var ProCard = ({
|
|
|
69
75
|
import_pro_components.ProCard,
|
|
70
76
|
{
|
|
71
77
|
prefixCls: customizePrefixCls,
|
|
78
|
+
bordered: bordered ?? ((contextCard == null ? void 0 : contextCard.variant) ? (contextCard == null ? void 0 : contextCard.variant) === "outlined" : void 0),
|
|
72
79
|
ghost,
|
|
73
80
|
title,
|
|
74
81
|
tabs: typeof tabs === "object" ? {
|
|
75
82
|
size: "large",
|
|
76
83
|
...tabs
|
|
77
84
|
} : tabs,
|
|
78
|
-
headerBordered,
|
|
85
|
+
headerBordered: headerBordered ?? (contextCard == null ? void 0 : contextCard.divided),
|
|
79
86
|
bodyStyle,
|
|
80
87
|
className: proCardCls,
|
|
88
|
+
style: {
|
|
89
|
+
...contextCard == null ? void 0 : contextCard.style,
|
|
90
|
+
...style
|
|
91
|
+
},
|
|
81
92
|
collapsibleIconRender: ({ collapsed }) => {
|
|
82
93
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
83
94
|
import_icons.CaretRightFilled,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oceanbase/ui",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.1",
|
|
4
4
|
"description": "The UI library based on OceanBase Design",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"oceanbase",
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"@ant-design/cssinjs": "^1.24.0",
|
|
42
42
|
"@ant-design/pro-components": "^2.8.10",
|
|
43
43
|
"@antv/g6": "3.4.10",
|
|
44
|
-
"@oceanbase/design": "^1.0.0-alpha.
|
|
45
|
-
"@oceanbase/icons": "^0.
|
|
46
|
-
"@oceanbase/util": "^0.
|
|
44
|
+
"@oceanbase/design": "^1.0.0-alpha.1",
|
|
45
|
+
"@oceanbase/icons": "^1.0.0-alpha.0",
|
|
46
|
+
"@oceanbase/util": "^1.0.0-alpha.0",
|
|
47
47
|
"ahooks": "^2.10.14",
|
|
48
48
|
"classnames": "^2.5.1",
|
|
49
49
|
"dayjs": "^1.11.18",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"react": ">=16.9.0",
|
|
71
71
|
"react-dom": ">=16.9.0"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "47b1ebfa75581585b83252085dddd33fc2c072a5"
|
|
74
74
|
}
|