@oceanbase/ui 0.4.19 → 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.
@@ -10,7 +10,7 @@
10
10
  border: 1px solid @colorBorder;
11
11
  box-sizing: border-box;
12
12
  display: flex;
13
- border-radius: ~'@{borderRadius}px';
13
+ border-radius: @borderRadius;
14
14
  transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
15
15
  // FIXED: 存在不生效情况
16
16
  .@{prefix}-picker {
@@ -1,10 +1,7 @@
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
- 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
- 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
2
  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; }
5
3
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
4
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
- import { genLargeStyle } from '@oceanbase/design';
8
5
  import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
9
6
  export var genCompactStyle = function genCompactStyle(componentCls) {
10
7
  var subComponentCls = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
@@ -24,13 +21,13 @@ export var genFooterToolbarStyle = function genFooterToolbarStyle(token) {
24
21
  borderRadius = token.borderRadius,
25
22
  boxShadowSecondary = token.boxShadowSecondary,
26
23
  controlHeightLG = token.controlHeightLG;
27
- return _defineProperty({}, "".concat(componentCls), _objectSpread({
24
+ return _defineProperty({}, "".concat(componentCls), {
28
25
  width: '100%',
29
26
  backgroundColor: colorBgBase,
30
27
  borderRadius: borderRadius,
31
28
  boxShadow: boxShadowSecondary,
32
29
  borderBlockStart: 'none'
33
- }, genLargeStyle(token)));
30
+ });
34
31
  };
35
32
  export default (function (prefixCls) {
36
33
  var useStyle = genComponentStyleHook('FooterToolbar', function (token) {
@@ -45,7 +45,7 @@
45
45
  color: @colorTextSecondary;
46
46
  font-size: 12px;
47
47
  background-color: #f5f6fa;
48
- border-radius: ~'@{borderRadius}px';
48
+ border-radius: @borderRadius;
49
49
 
50
50
  .@{iconPrefixCls} {
51
51
  font-size: 12px;
@@ -10,7 +10,7 @@
10
10
  font-size: 14px;
11
11
  line-height: 1.5714285714285714;
12
12
  list-style: none;
13
- border-radius: ~'@{borderRadius}px';
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: ~'@{borderRadius}px';
195
+ border-radius: @borderRadius;
196
196
 
197
197
  &.@{prefix}-index {
198
198
  border-inline-end: 1px solid rgba(255, 255, 255, 0.05);
@@ -4,7 +4,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  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; }
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
6
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
- import { genLargeStyle } from '@oceanbase/design';
8
7
  import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
9
8
  import { genFooterToolbarStyle } from "../../FooterToolbar/style";
10
9
  export var genPageContainerStyle = function genPageContainerStyle(token) {
@@ -41,11 +40,11 @@ export var genPageContainerStyle = function genPageContainerStyle(token) {
41
40
  cursor: 'pointer',
42
41
  fontSize: token.fontSizeLG,
43
42
  marginTop: token.marginXXS
44
- }), "".concat(antCls, "-page-header-heading-extra"), _objectSpread({
43
+ }), "".concat(antCls, "-page-header-heading-extra"), {
45
44
  height: height,
46
45
  lineHeight: lineHeight,
47
46
  marginBlock: 0
48
- }, genLargeStyle(token))), "".concat(antCls, "-page-header-footer"), {
47
+ }), "".concat(antCls, "-page-header-footer"), {
49
48
  marginBlockStart: 0
50
49
  })), "".concat(componentCls, "-children-container"), _defineProperty({
51
50
  paddingInline: paddingLG,
@@ -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
- declare const ProCard: typeof AntProCard;
4
+ export type ProCardType = typeof AntProCard;
5
+ declare const ProCard: ProCardType;
5
6
  export default ProCard;
@@ -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 { theme } from '@oceanbase/design';
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 ghost = _ref.ghost,
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, {
@@ -10,7 +10,7 @@
10
10
  border: 1px solid @colorBorder;
11
11
  box-sizing: border-box;
12
12
  display: flex;
13
- border-radius: ~'@{borderRadius}px';
13
+ border-radius: @borderRadius;
14
14
  transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
15
15
  // FIXED: 存在不生效情况
16
16
  .@{prefix}-picker {
@@ -24,7 +24,6 @@ __export(style_exports, {
24
24
  genFooterToolbarStyle: () => genFooterToolbarStyle
25
25
  });
26
26
  module.exports = __toCommonJS(style_exports);
27
- var import_design = require("@oceanbase/design");
28
27
  var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
29
28
  var genCompactStyle = (componentCls, subComponentCls = "") => {
30
29
  return {
@@ -49,8 +48,7 @@ var genFooterToolbarStyle = (token) => {
49
48
  backgroundColor: colorBgBase,
50
49
  borderRadius,
51
50
  boxShadow: boxShadowSecondary,
52
- borderBlockStart: "none",
53
- ...(0, import_design.genLargeStyle)(token)
51
+ borderBlockStart: "none"
54
52
  }
55
53
  };
56
54
  };
@@ -45,7 +45,7 @@
45
45
  color: @colorTextSecondary;
46
46
  font-size: 12px;
47
47
  background-color: #f5f6fa;
48
- border-radius: ~'@{borderRadius}px';
48
+ border-radius: @borderRadius;
49
49
 
50
50
  .@{iconPrefixCls} {
51
51
  font-size: 12px;
@@ -10,7 +10,7 @@
10
10
  font-size: 14px;
11
11
  line-height: 1.5714285714285714;
12
12
  list-style: none;
13
- border-radius: ~'@{borderRadius}px';
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: ~'@{borderRadius}px';
195
+ border-radius: @borderRadius;
196
196
 
197
197
  &.@{prefix}-index {
198
198
  border-inline-end: 1px solid rgba(255, 255, 255, 0.05);
@@ -23,7 +23,6 @@ __export(style_exports, {
23
23
  genPageContainerStyle: () => genPageContainerStyle
24
24
  });
25
25
  module.exports = __toCommonJS(style_exports);
26
- var import_design = require("@oceanbase/design");
27
26
  var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
28
27
  var import_style = require("../../FooterToolbar/style");
29
28
  var genPageContainerStyle = (token) => {
@@ -72,9 +71,7 @@ var genPageContainerStyle = (token) => {
72
71
  [`${antCls}-page-header-heading-extra`]: {
73
72
  height,
74
73
  lineHeight,
75
- marginBlock: 0,
76
- // extra operation style
77
- ...(0, import_design.genLargeStyle)(token)
74
+ marginBlock: 0
78
75
  },
79
76
  [`${antCls}-page-header-footer`]: {
80
77
  marginBlockStart: 0
@@ -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
- declare const ProCard: typeof AntProCard;
4
+ export type ProCardType = typeof AntProCard;
5
+ declare const ProCard: ProCardType;
5
6
  export default ProCard;
@@ -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 import_design2 = require("@oceanbase/design");
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 { getPrefixCls, iconPrefixCls } = (0, import_react.useContext)(import_design.ConfigProvider.ConfigContext);
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 } = import_design2.theme.useToken();
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": "0.4.19",
3
+ "version": "1.0.0-alpha.1",
4
4
  "description": "The UI library based on OceanBase Design",
5
5
  "keywords": [
6
6
  "oceanbase",
@@ -41,12 +41,12 @@
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": "^0.4.16",
45
- "@oceanbase/icons": "^0.4.7",
46
- "@oceanbase/util": "^0.4.4",
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
- "dayjs": "^1.11.13",
49
+ "dayjs": "^1.11.18",
50
50
  "diff": "^5.2.0",
51
51
  "highlight.js": "^11.11.1",
52
52
  "highlightjs-solidity": "^2.0.6",
@@ -70,5 +70,5 @@
70
70
  "react": ">=16.9.0",
71
71
  "react-dom": ">=16.9.0"
72
72
  },
73
- "gitHead": "42879f277f4c72e7254f121861f9e8b8a8e024ce"
73
+ "gitHead": "47b1ebfa75581585b83252085dddd33fc2c072a5"
74
74
  }