@oceanbase/design 0.2.15 → 0.2.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.
|
@@ -30,6 +30,8 @@ var ConfigProvider = function ConfigProvider(_ref) {
|
|
|
30
30
|
navigate = _ref.navigate,
|
|
31
31
|
spin = _ref.spin,
|
|
32
32
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
33
|
+
// inherit from parent ConfigProvider
|
|
34
|
+
var parentContext = React.useContext(ExtendedConfigContext);
|
|
33
35
|
return /*#__PURE__*/React.createElement(AntConfigProvider, _extends({
|
|
34
36
|
spin: spin,
|
|
35
37
|
theme: _objectSpread(_objectSpread({}, theme), {}, {
|
|
@@ -42,7 +44,7 @@ var ConfigProvider = function ConfigProvider(_ref) {
|
|
|
42
44
|
})
|
|
43
45
|
}, restProps), /*#__PURE__*/React.createElement(ExtendedConfigContext.Provider, {
|
|
44
46
|
value: {
|
|
45
|
-
navigate: navigate
|
|
47
|
+
navigate: navigate === undefined ? parentContext.navigate : navigate
|
|
46
48
|
}
|
|
47
49
|
}, /*#__PURE__*/React.createElement(App, null, children, /*#__PURE__*/React.createElement(StaticFunction, null))));
|
|
48
50
|
};
|
package/es/form/FormItem.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export type WrapperTooltipProps = Omit<TooltipProps, 'mouseFollow'> & {
|
|
|
8
8
|
export type LabelTooltipType = WrapperTooltipProps | React.ReactNode;
|
|
9
9
|
declare const FormItem: (<Values = any>(props: AntFormItemProps<Values>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) & {
|
|
10
10
|
useStatus: () => {
|
|
11
|
-
status?: "" | "success" | "
|
|
11
|
+
status?: "" | "success" | "error" | "warning" | "validating";
|
|
12
12
|
errors: ReactNode[];
|
|
13
13
|
warnings: ReactNode[];
|
|
14
14
|
};
|
package/es/spin/style/index.js
CHANGED
|
@@ -6,21 +6,21 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
|
|
|
6
6
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
7
|
import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
|
|
8
8
|
var genSizeStyle = function genSizeStyle(spinDotSize, token) {
|
|
9
|
-
var
|
|
9
|
+
var _$concat;
|
|
10
10
|
var componentCls = token.componentCls,
|
|
11
11
|
colorText = token.colorText;
|
|
12
12
|
var spinDotWidth = spinDotSize;
|
|
13
13
|
var spinDotHight = spinDotWidth * (295 / 397);
|
|
14
|
-
return
|
|
14
|
+
return _defineProperty({}, "&".concat(componentCls, "-oceanbase"), (_$concat = {}, _defineProperty(_$concat, "".concat(componentCls, "-dot"), {
|
|
15
15
|
width: spinDotWidth,
|
|
16
16
|
height: spinDotHight
|
|
17
|
-
}), _defineProperty(
|
|
17
|
+
}), _defineProperty(_$concat, "".concat(componentCls, "-text"), {
|
|
18
18
|
width: spinDotWidth,
|
|
19
19
|
color: colorText
|
|
20
|
-
}),
|
|
20
|
+
}), _$concat));
|
|
21
21
|
};
|
|
22
22
|
var genNestedSizeStyle = function genNestedSizeStyle(spinDotSize, token) {
|
|
23
|
-
var _$
|
|
23
|
+
var _$concat2;
|
|
24
24
|
var componentCls = token.componentCls,
|
|
25
25
|
fontSize = token.fontSize;
|
|
26
26
|
var spinDotWidth = spinDotSize;
|
|
@@ -31,22 +31,22 @@ var genNestedSizeStyle = function genNestedSizeStyle(spinDotSize, token) {
|
|
|
31
31
|
var dotMarginLeft = -spinDotWidth / 2;
|
|
32
32
|
var dotMarginTop = -spinDotHight / 2;
|
|
33
33
|
var textPaddingTop = (spinDotHight - fontSize) / 2 + 2;
|
|
34
|
-
return _defineProperty({}, "&".concat(componentCls, "-oceanbase"), (_$
|
|
34
|
+
return _defineProperty({}, "&".concat(componentCls, "-oceanbase"), (_$concat2 = {}, _defineProperty(_$concat2, "".concat(componentCls, "-dot"), {
|
|
35
35
|
marginLeft: dotMarginLeft,
|
|
36
36
|
marginTop: dotMarginTop
|
|
37
|
-
}), _defineProperty(_$
|
|
37
|
+
}), _defineProperty(_$concat2, "".concat(componentCls, "-text"), {
|
|
38
38
|
paddingTop: textPaddingTop
|
|
39
|
-
}), _defineProperty(_$
|
|
39
|
+
}), _defineProperty(_$concat2, "&".concat(componentCls, "-show-text ").concat(componentCls, "-dot"), {
|
|
40
40
|
marginTop: dotMarginTop - 10
|
|
41
|
-
}), _$
|
|
41
|
+
}), _$concat2));
|
|
42
42
|
};
|
|
43
43
|
export var genSpinStyle = function genSpinStyle(token) {
|
|
44
|
-
var _$
|
|
44
|
+
var _$concat3, _div$concat, _ref3;
|
|
45
45
|
var componentCls = token.componentCls,
|
|
46
46
|
spinDotSize = token.spinDotSize,
|
|
47
47
|
spinDotSizeSM = token.spinDotSizeSM,
|
|
48
48
|
spinDotSizeLG = token.spinDotSizeLG;
|
|
49
|
-
return _ref3 = {}, _defineProperty(_ref3, "".concat(componentCls), (_$
|
|
49
|
+
return _ref3 = {}, _defineProperty(_ref3, "".concat(componentCls), (_$concat3 = {}, _defineProperty(_$concat3, "&", genSizeStyle(spinDotSize, token)), _defineProperty(_$concat3, "&-sm", genSizeStyle(spinDotSizeSM, token)), _defineProperty(_$concat3, "&-lg", genSizeStyle(spinDotSizeLG, token)), _$concat3)), _defineProperty(_ref3, "".concat(componentCls, "-nested-loading"), _defineProperty({}, "> div > ".concat(componentCls), (_div$concat = {}, _defineProperty(_div$concat, "&", genNestedSizeStyle(spinDotSize, token)), _defineProperty(_div$concat, "&-sm", genNestedSizeStyle(spinDotSizeSM, token)), _defineProperty(_div$concat, "&-lg", genNestedSizeStyle(spinDotSizeLG, token)), _div$concat))), _ref3;
|
|
50
50
|
};
|
|
51
51
|
export default (function (prefixCls) {
|
|
52
52
|
var useStyle = genComponentStyleHook('Spin', function (token) {
|
|
@@ -46,6 +46,7 @@ var ExtendedConfigContext = import_react.default.createContext({
|
|
|
46
46
|
var { defaultSeed, components } = import_theme.default;
|
|
47
47
|
var ConfigProvider = ({ children, theme, navigate, spin, ...restProps }) => {
|
|
48
48
|
var _a;
|
|
49
|
+
const parentContext = import_react.default.useContext(ExtendedConfigContext);
|
|
49
50
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
50
51
|
import_antd.ConfigProvider,
|
|
51
52
|
{
|
|
@@ -77,7 +78,7 @@ var ConfigProvider = ({ children, theme, navigate, spin, ...restProps }) => {
|
|
|
77
78
|
ExtendedConfigContext.Provider,
|
|
78
79
|
{
|
|
79
80
|
value: {
|
|
80
|
-
navigate
|
|
81
|
+
navigate: navigate === void 0 ? parentContext.navigate : navigate
|
|
81
82
|
}
|
|
82
83
|
},
|
|
83
84
|
/* @__PURE__ */ import_react.default.createElement(import_antd.App, null, children, /* @__PURE__ */ import_react.default.createElement(import_static_function.default, null))
|
package/lib/form/FormItem.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export type WrapperTooltipProps = Omit<TooltipProps, 'mouseFollow'> & {
|
|
|
8
8
|
export type LabelTooltipType = WrapperTooltipProps | React.ReactNode;
|
|
9
9
|
declare const FormItem: (<Values = any>(props: AntFormItemProps<Values>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) & {
|
|
10
10
|
useStatus: () => {
|
|
11
|
-
status?: "" | "success" | "
|
|
11
|
+
status?: "" | "success" | "error" | "warning" | "validating";
|
|
12
12
|
errors: ReactNode[];
|
|
13
13
|
warnings: ReactNode[];
|
|
14
14
|
};
|
package/lib/spin/style/index.js
CHANGED
|
@@ -29,13 +29,16 @@ var genSizeStyle = (spinDotSize, token) => {
|
|
|
29
29
|
const spinDotWidth = spinDotSize;
|
|
30
30
|
const spinDotHight = spinDotWidth * (295 / 397);
|
|
31
31
|
return {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
// only work for oceanbase indicator
|
|
33
|
+
[`&${componentCls}-oceanbase`]: {
|
|
34
|
+
[`${componentCls}-dot`]: {
|
|
35
|
+
width: spinDotWidth,
|
|
36
|
+
height: spinDotHight
|
|
37
|
+
},
|
|
38
|
+
[`${componentCls}-text`]: {
|
|
39
|
+
width: spinDotWidth,
|
|
40
|
+
color: colorText
|
|
41
|
+
}
|
|
39
42
|
}
|
|
40
43
|
};
|
|
41
44
|
};
|
|
@@ -47,6 +50,7 @@ var genNestedSizeStyle = (spinDotSize, token) => {
|
|
|
47
50
|
const dotMarginTop = -spinDotHight / 2;
|
|
48
51
|
const textPaddingTop = (spinDotHight - fontSize) / 2 + 2;
|
|
49
52
|
return {
|
|
53
|
+
// only work for oceanbase indicator
|
|
50
54
|
[`&${componentCls}-oceanbase`]: {
|
|
51
55
|
[`${componentCls}-dot`]: {
|
|
52
56
|
marginLeft: dotMarginLeft,
|
|
@@ -64,11 +68,10 @@ var genNestedSizeStyle = (spinDotSize, token) => {
|
|
|
64
68
|
var genSpinStyle = (token) => {
|
|
65
69
|
const { componentCls, spinDotSize, spinDotSizeSM, spinDotSizeLG } = token;
|
|
66
70
|
return {
|
|
67
|
-
// only work for oceanbase indicator
|
|
68
71
|
[`${componentCls}`]: {
|
|
69
|
-
[
|
|
70
|
-
[`&-sm
|
|
71
|
-
[`&-lg
|
|
72
|
+
[`&`]: genSizeStyle(spinDotSize, token),
|
|
73
|
+
[`&-sm`]: genSizeStyle(spinDotSizeSM, token),
|
|
74
|
+
[`&-lg`]: genSizeStyle(spinDotSizeLG, token)
|
|
72
75
|
},
|
|
73
76
|
[`${componentCls}-nested-loading`]: {
|
|
74
77
|
[`> div > ${componentCls}`]: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oceanbase/design",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.16",
|
|
4
4
|
"description": "The Design System of OceanBase",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"OceanBase",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@oceanbase/icons": "^0.2.5",
|
|
41
41
|
"@oceanbase/util": "^0.2.7",
|
|
42
42
|
"ahooks": "^2.10.14",
|
|
43
|
-
"antd": "^5.
|
|
43
|
+
"antd": "^5.9.0",
|
|
44
44
|
"classnames": "^2.3.2",
|
|
45
45
|
"lodash": "^4.17.21",
|
|
46
46
|
"lottie-web": "^5.12.2",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"react": "^16.9.0",
|
|
57
57
|
"react-dom": "^16.9.0"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "52f5d009120b001c9c0408ec96ff954e120b20f1"
|
|
60
60
|
}
|