@oceanbase/design 1.0.0-alpha.8 → 1.0.0-alpha.9
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/design.min.js +1 -1
- package/es/card/index.d.ts +2 -0
- package/es/card/index.js +33 -13
- package/es/card/style/index.js +36 -20
- package/es/checkbox/style/index.js +5 -3
- package/es/config-provider/index.js +3 -1
- package/es/descriptions/hooks/useItems.d.ts +9 -9
- package/es/descriptions/index.d.ts +10 -0
- package/es/descriptions/index.js +59 -3
- package/es/descriptions/style/index.js +48 -5
- package/es/drawer/style/index.js +11 -5
- package/es/slider/style/index.js +3 -2
- package/es/style/cssVariables.d.ts +25 -0
- package/es/style/cssVariables.js +48 -0
- package/es/style/cssVariablesMeta.d.ts +24 -0
- package/es/style/cssVariablesMeta.js +974 -0
- package/es/table/index.js +8 -0
- package/es/table/style/index.js +9 -3
- package/es/tag/style/index.js +1 -1
- package/es/theme/default.d.ts +44 -0
- package/es/theme/default.js +159 -40
- package/es/theme/interface.d.ts +43 -0
- package/es/theme/style/compact.less +43 -24
- package/es/theme/style/default.less +43 -24
- package/lib/card/index.d.ts +2 -0
- package/lib/card/index.js +27 -12
- package/lib/card/style/index.js +61 -29
- package/lib/checkbox/style/index.js +4 -3
- package/lib/config-provider/index.js +3 -0
- package/lib/descriptions/hooks/useItems.d.ts +9 -9
- package/lib/descriptions/index.d.ts +10 -0
- package/lib/descriptions/index.js +49 -2
- package/lib/descriptions/style/index.js +85 -4
- package/lib/drawer/style/index.js +9 -4
- package/lib/slider/style/index.js +5 -2
- package/lib/style/cssVariables.d.ts +25 -0
- package/lib/style/cssVariables.js +261 -0
- package/lib/style/cssVariablesMeta.d.ts +24 -0
- package/lib/style/cssVariablesMeta.js +1059 -0
- package/lib/table/index.js +7 -0
- package/lib/table/style/index.js +10 -1
- package/lib/tag/style/index.js +1 -1
- package/lib/theme/default.d.ts +44 -0
- package/lib/theme/default.js +232 -42
- package/lib/theme/interface.d.ts +43 -0
- package/lib/theme/style/compact.less +43 -24
- package/lib/theme/style/default.less +43 -24
- package/package.json +2 -2
package/es/card/index.d.ts
CHANGED
|
@@ -6,7 +6,9 @@ export interface CardTabListType extends AntCardTabListType {
|
|
|
6
6
|
tag?: React.ReactNode;
|
|
7
7
|
}
|
|
8
8
|
export interface CardProps extends AntCardProps {
|
|
9
|
+
subTitle?: React.ReactNode;
|
|
9
10
|
divided?: boolean;
|
|
11
|
+
gray?: boolean;
|
|
10
12
|
tabList?: CardTabListType[];
|
|
11
13
|
collapsible?: boolean;
|
|
12
14
|
defaultCollapsed?: boolean;
|
package/es/card/index.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 = ["children", "size", "title", "tabList", "tabProps", "divided", "prefixCls", "bodyStyle", "styles", "className", "collapsible", "defaultCollapsed", "collapsed", "onCollapse"
|
|
2
|
+
var _excluded = ["children", "size", "title", "subTitle", "extra", "tabList", "tabProps", "tabBarExtraContent", "divided", "gray", "prefixCls", "bodyStyle", "styles", "className", "collapsible", "defaultCollapsed", "collapsed", "onCollapse"];
|
|
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; }
|
|
@@ -23,6 +23,7 @@ import { isHorizontalPaddingZero } from "../_util";
|
|
|
23
23
|
import theme from "../theme";
|
|
24
24
|
import useStyle, { genTableStyle } from "./style";
|
|
25
25
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
26
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
26
27
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
27
28
|
export * from 'antd/es/card/Card';
|
|
28
29
|
export * from 'antd/es/card';
|
|
@@ -31,9 +32,13 @@ var Card = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
31
32
|
var children = _ref.children,
|
|
32
33
|
size = _ref.size,
|
|
33
34
|
title = _ref.title,
|
|
35
|
+
subTitle = _ref.subTitle,
|
|
36
|
+
extra = _ref.extra,
|
|
34
37
|
tabList = _ref.tabList,
|
|
35
38
|
tabProps = _ref.tabProps,
|
|
39
|
+
tabBarExtraContent = _ref.tabBarExtraContent,
|
|
36
40
|
outerDivided = _ref.divided,
|
|
41
|
+
gray = _ref.gray,
|
|
37
42
|
customizePrefixCls = _ref.prefixCls,
|
|
38
43
|
bodyStyle = _ref.bodyStyle,
|
|
39
44
|
styles = _ref.styles,
|
|
@@ -42,12 +47,10 @@ var Card = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
42
47
|
defaultCollapsed = _ref.defaultCollapsed,
|
|
43
48
|
outerCollapsed = _ref.collapsed,
|
|
44
49
|
onCollapse = _ref.onCollapse,
|
|
45
|
-
extra = _ref.extra,
|
|
46
50
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
47
51
|
var _useContext = useContext(ConfigProvider.ConfigContext),
|
|
48
52
|
getPrefixCls = _useContext.getPrefixCls,
|
|
49
|
-
contextCard = _useContext.card
|
|
50
|
-
iconPrefixCls = _useContext.iconPrefixCls;
|
|
53
|
+
contextCard = _useContext.card;
|
|
51
54
|
var _theme$useToken = theme.useToken(),
|
|
52
55
|
token = _theme$useToken.token;
|
|
53
56
|
var divided = (_ref2 = outerDivided !== null && outerDivided !== void 0 ? outerDivided : contextCard === null || contextCard === void 0 ? void 0 : contextCard.divided) !== null && _ref2 !== void 0 ? _ref2 : true;
|
|
@@ -68,12 +71,30 @@ var Card = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
68
71
|
onCollapse === null || onCollapse === void 0 || onCollapse(newCollapsed);
|
|
69
72
|
}, [collapsed, outerCollapsed, onCollapse]);
|
|
70
73
|
var cardTitle = useMemo(function () {
|
|
71
|
-
if (!collapsible) {
|
|
74
|
+
if (!collapsible && !subTitle) {
|
|
72
75
|
return title;
|
|
73
76
|
}
|
|
74
77
|
if (!title) {
|
|
75
78
|
return null;
|
|
76
79
|
}
|
|
80
|
+
var titleContent = /*#__PURE__*/_jsxs(_Fragment, {
|
|
81
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
82
|
+
children: title
|
|
83
|
+
}), subTitle && /*#__PURE__*/_jsx("span", {
|
|
84
|
+
className: "".concat(prefixCls, "-sub-title"),
|
|
85
|
+
children: subTitle
|
|
86
|
+
})]
|
|
87
|
+
});
|
|
88
|
+
if (!collapsible) {
|
|
89
|
+
return /*#__PURE__*/_jsx("div", {
|
|
90
|
+
className: "".concat(prefixCls, "-title-wrapper"),
|
|
91
|
+
style: {
|
|
92
|
+
display: 'flex',
|
|
93
|
+
alignItems: 'center'
|
|
94
|
+
},
|
|
95
|
+
children: titleContent
|
|
96
|
+
});
|
|
97
|
+
}
|
|
77
98
|
return /*#__PURE__*/_jsxs("div", {
|
|
78
99
|
className: "".concat(prefixCls, "-title-wrapper"),
|
|
79
100
|
onClick: handleCollapse,
|
|
@@ -90,15 +111,13 @@ var Card = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
90
111
|
color: token.colorIcon,
|
|
91
112
|
marginRight: token.marginXS
|
|
92
113
|
}
|
|
93
|
-
}),
|
|
94
|
-
children: title
|
|
95
|
-
})]
|
|
114
|
+
}), titleContent]
|
|
96
115
|
});
|
|
97
|
-
}, [collapsible, title, collapsed, prefixCls, token, handleCollapse]);
|
|
116
|
+
}, [collapsible, title, subTitle, collapsed, prefixCls, token, handleCollapse]);
|
|
98
117
|
|
|
99
118
|
// card body no horizontal padding
|
|
100
119
|
var noBodyHorizontalPadding = isHorizontalPaddingZero(bodyStyle === null || bodyStyle === void 0 ? void 0 : bodyStyle.padding) || isHorizontalPaddingZero(styles === null || styles === void 0 || (_styles$body = styles.body) === null || _styles$body === void 0 ? void 0 : _styles$body.padding);
|
|
101
|
-
var cardCls = classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-has-
|
|
120
|
+
var cardCls = classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-has-head"), !!(title || extra || tabList || tabBarExtraContent)), "".concat(prefixCls, "-no-divider"), !divided), "".concat(prefixCls, "-gray"), gray), "".concat(prefixCls, "-no-body-horizontal-padding"), noBodyHorizontalPadding), "".concat(prefixCls, "-collapsible"), collapsible), "".concat(prefixCls, "-collapsed"), collapsed), className);
|
|
102
121
|
var newTabList = tabList === null || tabList === void 0 ? void 0 : tabList.map(function (item) {
|
|
103
122
|
if (!isNullValue(item.tag)) {
|
|
104
123
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
@@ -118,15 +137,16 @@ var Card = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
118
137
|
ref: ref,
|
|
119
138
|
size: size,
|
|
120
139
|
title: cardTitle,
|
|
140
|
+
extra: extra,
|
|
121
141
|
tabList: newTabList,
|
|
142
|
+
tabBarExtraContent: tabBarExtraContent,
|
|
122
143
|
tabProps: _objectSpread({
|
|
123
|
-
size: 'middle'
|
|
144
|
+
size: size === 'small' ? 'small' : 'middle'
|
|
124
145
|
}, tabProps),
|
|
125
146
|
prefixCls: customizePrefixCls,
|
|
126
147
|
bodyStyle: _objectSpread({}, bodyStyle),
|
|
127
148
|
styles: styles,
|
|
128
|
-
className: cardCls
|
|
129
|
-
extra: extra
|
|
149
|
+
className: cardCls
|
|
130
150
|
}, restProps), {}, {
|
|
131
151
|
children: children
|
|
132
152
|
})));
|
package/es/card/style/index.js
CHANGED
|
@@ -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 { unit } from '@ant-design/cssinjs';
|
|
8
7
|
import { genTabsStyle } from "../../tabs/style";
|
|
9
8
|
import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
|
|
10
9
|
export var genTableStyle = function genTableStyle(padding, token) {
|
|
@@ -30,7 +29,14 @@ export var genCardStyle = function genCardStyle(token) {
|
|
|
30
29
|
paddingLG = token.paddingLG,
|
|
31
30
|
calc = token.calc;
|
|
32
31
|
var tableComponentCls = "".concat(antCls, "-table");
|
|
33
|
-
return _ref2 = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref2, "".concat(componentCls), _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-
|
|
32
|
+
return _ref2 = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref2, "".concat(componentCls), _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-head"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-sub-title"), {
|
|
33
|
+
marginInlineStart: token.marginXS,
|
|
34
|
+
fontWeight: 'normal',
|
|
35
|
+
fontSize: token.fontSize,
|
|
36
|
+
color: token.colorTextDescription
|
|
37
|
+
}), tabsComponentCls, _defineProperty({}, "&".concat(tabsComponentCls, "-top, &").concat(tabsComponentCls, "-bottom"), _defineProperty({}, "".concat(tabsComponentCls, "-nav::before"), {
|
|
38
|
+
border: 'none'
|
|
39
|
+
})))), "".concat(componentCls, "-body"), {
|
|
34
40
|
paddingTop: token.padding
|
|
35
41
|
}), "".concat(componentCls, ":not(").concat(componentCls, "-bordered):not(").concat(componentCls, "-type-inner)"), {
|
|
36
42
|
boxShadow: 'none'
|
|
@@ -40,41 +46,43 @@ export var genCardStyle = function genCardStyle(token) {
|
|
|
40
46
|
borderRadius: token.borderRadius
|
|
41
47
|
}, "".concat(componentCls).concat(componentCls, "-bordered"), {
|
|
42
48
|
borderRadius: token.borderRadiusSM
|
|
43
|
-
})))), "".concat(componentCls).concat(componentCls, "-no-divider"), _defineProperty({}, "".concat(componentCls, "-
|
|
44
|
-
|
|
45
|
-
|
|
49
|
+
})))), "".concat(componentCls).concat(componentCls, "-has-head").concat(componentCls, "-no-divider:not(").concat(componentCls, "-contain-tabs)"), _defineProperty({}, "".concat(componentCls, "-body"), {
|
|
50
|
+
paddingTop: 0
|
|
51
|
+
})), "".concat(componentCls, ":not(").concat(componentCls, "-has-head)"), _defineProperty({}, "".concat(componentCls, "-body"), {
|
|
52
|
+
paddingTop: paddingLG
|
|
53
|
+
})), "".concat(componentCls).concat(componentCls, "-no-divider"), _defineProperty({}, "".concat(componentCls, "-head"), {
|
|
54
|
+
// hide bottom border by setting borderBottomColor to transparent
|
|
55
|
+
borderBottomColor: 'transparent'
|
|
56
|
+
})), "".concat(componentCls).concat(componentCls, "-no-divider:not(").concat(componentCls, "-contain-tabs)"), _defineProperty({}, "".concat(componentCls, "-head"), {
|
|
46
57
|
paddingTop: token.paddingLG,
|
|
47
58
|
paddingBottom: token.padding
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
}))
|
|
51
|
-
|
|
59
|
+
})), "".concat(componentCls).concat(componentCls, "-small:not(").concat(componentCls, "-has-head)"), _defineProperty({}, "".concat(componentCls, "-body"), {
|
|
60
|
+
paddingTop: paddingSM
|
|
61
|
+
})), "".concat(componentCls).concat(componentCls, "-small").concat(componentCls, "-no-divider:not(").concat(componentCls, "-contain-tabs)"), _defineProperty({}, "".concat(componentCls, "-head"), {
|
|
62
|
+
paddingTop: token.paddingSM,
|
|
63
|
+
paddingBottom: token.paddingXS
|
|
52
64
|
})), "".concat(componentCls, "-small"), _defineProperty({}, "".concat(componentCls, "-body"), {
|
|
53
65
|
paddingTop: token.paddingXS
|
|
54
|
-
})), "".concat(componentCls, "-small").concat(componentCls, "-no-divider:not(").concat(componentCls, "-contain-tabs)"), _defineProperty({}, "".concat(componentCls, "-body"), {
|
|
55
|
-
padding: "0 ".concat(unit(paddingSM), " ").concat(unit(paddingSM), " ").concat(unit(paddingSM))
|
|
56
66
|
})), "".concat(componentCls, "-small").concat(componentCls, "-contain-tabs >").concat(componentCls, "-head"), _defineProperty({}, "".concat(componentCls, "-head-title, ").concat(componentCls, "-head-extra"), {
|
|
57
67
|
paddingTop: token.paddingXS
|
|
58
|
-
})), "".concat(componentCls).concat(componentCls, "-contain-tabs"), _defineProperty({}, "".concat(componentCls, "-head"), _objectSpread(
|
|
68
|
+
})), "".concat(componentCls).concat(componentCls, "-contain-tabs"), _defineProperty({}, "".concat(componentCls, "-head"), _objectSpread({}, genTabsStyle(_objectSpread(_objectSpread({}, token), {}, {
|
|
59
69
|
componentCls: tabsComponentCls,
|
|
60
70
|
prefixCls: tabsPrefixCls
|
|
61
|
-
}))),
|
|
62
|
-
paddingBlock: token.padding
|
|
63
|
-
})))))), "".concat(componentCls).concat(componentCls, "-contain-grid"), _defineProperty({}, "".concat(componentCls, "-head"), {
|
|
71
|
+
}))))), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref2, "".concat(componentCls).concat(componentCls, "-contain-grid"), _defineProperty({}, "".concat(componentCls, "-head"), {
|
|
64
72
|
// work for Card containing Card.Grid
|
|
65
73
|
marginBottom: -1
|
|
66
74
|
})), "".concat(componentCls, ":not(").concat(componentCls, "-contain-grid)"), _defineProperty({}, "".concat(componentCls, "-head"), {
|
|
67
75
|
// work for Card not containing Card.Grid
|
|
68
76
|
marginBottom: 0
|
|
69
|
-
})), "&".concat(componentCls, "-has-
|
|
77
|
+
})), "&".concat(componentCls, "-has-head").concat(componentCls, "-no-divider:not(").concat(componentCls, "-contain-tabs)"), _defineProperty({}, "".concat(componentCls, "-body"), _defineProperty({}, "& > ".concat(tableComponentCls, "-wrapper ").concat(tableComponentCls, ":not(").concat(tableComponentCls, "-bordered):first-child"), {
|
|
70
78
|
marginTop: calc(token.marginSM).mul(-1).equal()
|
|
71
|
-
}))),
|
|
79
|
+
}))), "".concat(componentCls).concat(componentCls, "-no-body-horizontal-padding"), genTableStyle(paddingLG, token)), "".concat(componentCls).concat(componentCls, "-no-body-horizontal-padding").concat(componentCls, "-small"), genTableStyle(paddingSM, token)), "".concat(componentCls).concat(componentCls, "-collapsible"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-title-wrapper"), _defineProperty({
|
|
72
80
|
userSelect: 'none'
|
|
73
81
|
}, "".concat(componentCls, "-collapsible-icon"), {
|
|
74
82
|
fontSize: token.fontSizeLG
|
|
75
83
|
})), "".concat(componentCls, "-body"), {
|
|
76
84
|
overflow: 'hidden'
|
|
77
|
-
})), "".concat(componentCls).concat(componentCls, "-collapsible").concat(componentCls, "-collapsed"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-body"), {
|
|
85
|
+
})), "".concat(componentCls).concat(componentCls, "-collapsible").concat(componentCls, "-collapsed"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-body"), {
|
|
78
86
|
maxHeight: 0,
|
|
79
87
|
paddingTop: 0,
|
|
80
88
|
paddingBottom: 0,
|
|
@@ -83,8 +91,16 @@ export var genCardStyle = function genCardStyle(token) {
|
|
|
83
91
|
border: 'none',
|
|
84
92
|
margin: 0
|
|
85
93
|
}), "".concat(componentCls, "-head"), {
|
|
86
|
-
|
|
87
|
-
}))
|
|
94
|
+
borderBottomColor: 'transparent'
|
|
95
|
+
}), "&".concat(componentCls, "-no-divider"), _defineProperty({}, "".concat(componentCls, "-head"), {
|
|
96
|
+
paddingBottom: paddingLG
|
|
97
|
+
})), "&".concat(componentCls, "-no-divider").concat(componentCls, "-small"), _defineProperty({}, "".concat(componentCls, "-head"), {
|
|
98
|
+
paddingBottom: paddingSM
|
|
99
|
+
}))), "".concat(componentCls).concat(componentCls, "-gray"), {
|
|
100
|
+
boxShadow: 'none',
|
|
101
|
+
borderRadius: token.borderRadiusMD,
|
|
102
|
+
backgroundColor: token.colorFillQuaternary
|
|
103
|
+
});
|
|
88
104
|
};
|
|
89
105
|
export default (function (prefixCls, tabsPrefixCls) {
|
|
90
106
|
var useStyle = genComponentStyleHook('Card', function (token) {
|
|
@@ -2,18 +2,20 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2
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; }
|
|
3
3
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
4
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); }
|
|
5
|
+
import { unit } from '@ant-design/cssinjs';
|
|
5
6
|
import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
|
|
6
7
|
export var genCheckboxStyle = function genCheckboxStyle(token) {
|
|
7
8
|
var componentCls = token.componentCls,
|
|
8
9
|
fontSize = token.fontSize,
|
|
9
|
-
fontSizeLG = token.fontSizeLG,
|
|
10
10
|
lineHeight = token.lineHeight,
|
|
11
|
+
lineWidth = token.lineWidth,
|
|
12
|
+
controlInteractiveSize = token.controlInteractiveSize,
|
|
11
13
|
calc = token.calc;
|
|
12
|
-
var translateY = calc(
|
|
14
|
+
var translateY = calc(fontSize).mul(lineHeight).sub(controlInteractiveSize).sub(lineWidth).div(2).equal();
|
|
13
15
|
return _defineProperty({}, "".concat(componentCls, "-wrapper"), _defineProperty({}, "".concat(componentCls), _defineProperty({
|
|
14
16
|
alignSelf: 'baseline'
|
|
15
17
|
}, "".concat(componentCls, "-inner"), {
|
|
16
|
-
transform: "translate(0px, ".concat(translateY, ")")
|
|
18
|
+
transform: "translate(0px, ".concat(unit(translateY), ")")
|
|
17
19
|
})));
|
|
18
20
|
};
|
|
19
21
|
export default (function (prefixCls) {
|
|
@@ -28,6 +28,7 @@ import darkTheme from "../theme/dark";
|
|
|
28
28
|
import compactTheme from "../theme/compact";
|
|
29
29
|
import DefaultRenderEmpty from "./DefaultRenderEmpty";
|
|
30
30
|
import GlobalStyle from "../style/global";
|
|
31
|
+
import CssVariablesStyle from "../style/cssVariables";
|
|
31
32
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
32
33
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
33
34
|
export * from "./navigate";
|
|
@@ -127,6 +128,7 @@ var ConfigProvider = function ConfigProvider(_ref3) {
|
|
|
127
128
|
return onExpand(record, e);
|
|
128
129
|
},
|
|
129
130
|
style: {
|
|
131
|
+
// marginRight: mergedTheme.token?.marginXS || 8,
|
|
130
132
|
transition: "transform 0.2s",
|
|
131
133
|
transform: expanded ? 'rotate(90deg)' : undefined,
|
|
132
134
|
color: ((_mergedTheme$token7 = mergedTheme.token) === null || _mergedTheme$token7 === void 0 ? void 0 : _mergedTheme$token7.colorIcon) || ((_mergedTheme$token8 = mergedTheme.token) === null || _mergedTheme$token8 === void 0 ? void 0 : _mergedTheme$token8.colorTextSecondary)
|
|
@@ -153,7 +155,7 @@ var ConfigProvider = function ConfigProvider(_ref3) {
|
|
|
153
155
|
injectStaticFunction: false
|
|
154
156
|
},
|
|
155
157
|
children: /*#__PURE__*/_jsxs(StyleProvider, _objectSpread(_objectSpread({}, mergedStyleProviderProps), {}, {
|
|
156
|
-
children: [/*#__PURE__*/_jsx(GlobalStyle, {
|
|
158
|
+
children: [/*#__PURE__*/_jsx(CssVariablesStyle, {}), /*#__PURE__*/_jsx(GlobalStyle, {
|
|
157
159
|
prefixCls: restProps.prefixCls
|
|
158
160
|
}), /*#__PURE__*/_jsxs(App, _objectSpread(_objectSpread({
|
|
159
161
|
component: false
|
|
@@ -3,19 +3,19 @@ import type { DescriptionsItemType } from '..';
|
|
|
3
3
|
export default function useItems(items?: DescriptionsItemType[], children?: React.ReactNode, bordered?: boolean): {
|
|
4
4
|
children: string | number | boolean | Iterable<React.ReactNode> | import("@emotion/react/jsx-runtime").JSX.Element;
|
|
5
5
|
key?: React.Key;
|
|
6
|
+
classNames?: Partial<Record<"content" | "label", string>>;
|
|
7
|
+
styles?: Partial<Record<"content" | "label", React.CSSProperties>>;
|
|
8
|
+
className?: string;
|
|
9
|
+
style?: React.CSSProperties;
|
|
6
10
|
label?: React.ReactNode;
|
|
7
11
|
span?: number | "filled" | {
|
|
8
|
-
xs?: number;
|
|
9
|
-
sm?: number;
|
|
10
|
-
md?: number;
|
|
11
|
-
lg?: number;
|
|
12
|
-
xl?: number;
|
|
13
12
|
xxl?: number;
|
|
13
|
+
xl?: number;
|
|
14
|
+
lg?: number;
|
|
15
|
+
md?: number;
|
|
16
|
+
sm?: number;
|
|
17
|
+
xs?: number;
|
|
14
18
|
};
|
|
15
|
-
style?: React.CSSProperties;
|
|
16
|
-
classNames?: Partial<Record<"label" | "content", string>>;
|
|
17
|
-
styles?: Partial<Record<"label" | "content", React.CSSProperties>>;
|
|
18
|
-
className?: string;
|
|
19
19
|
labelStyle?: React.CSSProperties;
|
|
20
20
|
contentStyle?: React.CSSProperties;
|
|
21
21
|
}[];
|
|
@@ -9,6 +9,16 @@ export interface DescriptionsItemType extends AntDescriptionsItemType {
|
|
|
9
9
|
}
|
|
10
10
|
export interface DescriptionsProps extends AntDescriptionsProps {
|
|
11
11
|
items?: DescriptionsItemType[];
|
|
12
|
+
/** Whether the descriptions is collapsible */
|
|
13
|
+
collapsible?: boolean;
|
|
14
|
+
/** Whether the descriptions is collapsed (controlled mode) */
|
|
15
|
+
collapsed?: boolean;
|
|
16
|
+
/** Default collapsed state (uncontrolled mode) */
|
|
17
|
+
defaultCollapsed?: boolean;
|
|
18
|
+
/** Callback when collapsed state changes */
|
|
19
|
+
onCollapse?: (collapsed: boolean) => void;
|
|
20
|
+
/** Content alignment, when set to 'left', all content values will be aligned to the left based on the longest label width */
|
|
21
|
+
contentAlign?: 'left';
|
|
12
22
|
}
|
|
13
23
|
type CompoundedComponent = React.FC<DescriptionsProps> & {
|
|
14
24
|
Item: typeof DescriptionsItem;
|
package/es/descriptions/index.js
CHANGED
|
@@ -1,20 +1,29 @@
|
|
|
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 = ["children", "bordered", "layout", "colon", "items", "prefixCls", "className"];
|
|
2
|
+
var _excluded = ["children", "bordered", "layout", "colon", "items", "title", "prefixCls", "className", "column", "collapsible", "collapsed", "defaultCollapsed", "onCollapse", "contentAlign"];
|
|
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; }
|
|
6
6
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
7
|
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); }
|
|
8
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
9
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
11
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
12
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
13
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
14
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
15
|
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
16
|
import { Descriptions as AntDescriptions } from 'antd';
|
|
11
17
|
import classNames from 'classnames';
|
|
12
|
-
import React, { useContext } from 'react';
|
|
18
|
+
import React, { useContext, useState, useCallback, useMemo } from 'react';
|
|
19
|
+
import { CaretRightFilled } from '@oceanbase/icons';
|
|
13
20
|
import ConfigProvider from "../config-provider";
|
|
21
|
+
import theme from "../theme";
|
|
14
22
|
import DescriptionsItem from "./Item";
|
|
15
23
|
import useItems from "./hooks/useItems";
|
|
16
24
|
import useStyle from "./style";
|
|
17
25
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
26
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
27
|
export * from 'antd/es/descriptions';
|
|
19
28
|
var Descriptions = function Descriptions(_ref) {
|
|
20
29
|
var children = _ref.children,
|
|
@@ -24,22 +33,69 @@ var Descriptions = function Descriptions(_ref) {
|
|
|
24
33
|
_ref$colon = _ref.colon,
|
|
25
34
|
colon = _ref$colon === void 0 ? layout === 'vertical' ? false : undefined : _ref$colon,
|
|
26
35
|
items = _ref.items,
|
|
36
|
+
title = _ref.title,
|
|
27
37
|
customizePrefixCls = _ref.prefixCls,
|
|
28
38
|
className = _ref.className,
|
|
39
|
+
_ref$column = _ref.column,
|
|
40
|
+
column = _ref$column === void 0 ? 3 : _ref$column,
|
|
41
|
+
collapsible = _ref.collapsible,
|
|
42
|
+
outerCollapsed = _ref.collapsed,
|
|
43
|
+
defaultCollapsed = _ref.defaultCollapsed,
|
|
44
|
+
onCollapse = _ref.onCollapse,
|
|
45
|
+
contentAlign = _ref.contentAlign,
|
|
29
46
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
30
47
|
var _useContext = useContext(ConfigProvider.ConfigContext),
|
|
31
48
|
getPrefixCls = _useContext.getPrefixCls;
|
|
49
|
+
var _theme$useToken = theme.useToken(),
|
|
50
|
+
token = _theme$useToken.token;
|
|
32
51
|
var prefixCls = getPrefixCls('descriptions', customizePrefixCls);
|
|
33
52
|
var typographyPrefixCls = getPrefixCls('typography', customizePrefixCls);
|
|
34
53
|
var _useStyle = useStyle(prefixCls, typographyPrefixCls),
|
|
35
54
|
wrapSSR = _useStyle.wrapSSR;
|
|
36
|
-
var
|
|
55
|
+
var _useState = useState(defaultCollapsed !== null && defaultCollapsed !== void 0 ? defaultCollapsed : false),
|
|
56
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
57
|
+
internalCollapsed = _useState2[0],
|
|
58
|
+
setInternalCollapsed = _useState2[1];
|
|
59
|
+
var collapsed = outerCollapsed !== undefined ? outerCollapsed : internalCollapsed;
|
|
60
|
+
var handleCollapse = useCallback(function () {
|
|
61
|
+
var newCollapsed = !collapsed;
|
|
62
|
+
if (outerCollapsed === undefined) {
|
|
63
|
+
setInternalCollapsed(newCollapsed);
|
|
64
|
+
}
|
|
65
|
+
onCollapse === null || onCollapse === void 0 || onCollapse(newCollapsed);
|
|
66
|
+
}, [collapsed, outerCollapsed, onCollapse]);
|
|
37
67
|
var newItems = useItems(items, children, bordered);
|
|
68
|
+
var descriptionsTitle = useMemo(function () {
|
|
69
|
+
if (!collapsible) {
|
|
70
|
+
return title;
|
|
71
|
+
}
|
|
72
|
+
if (!title) {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
76
|
+
className: "".concat(prefixCls, "-title-wrapper"),
|
|
77
|
+
onClick: handleCollapse,
|
|
78
|
+
children: [/*#__PURE__*/_jsx(CaretRightFilled, {
|
|
79
|
+
className: "".concat(prefixCls, "-collapsible-icon"),
|
|
80
|
+
style: {
|
|
81
|
+
transition: "transform ".concat(token.motionDurationMid),
|
|
82
|
+
transform: collapsed ? undefined : 'rotate(90deg)',
|
|
83
|
+
color: token.colorIcon,
|
|
84
|
+
marginRight: token.marginXS
|
|
85
|
+
}
|
|
86
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
87
|
+
children: title
|
|
88
|
+
})]
|
|
89
|
+
});
|
|
90
|
+
}, [collapsible, title, collapsed, prefixCls, token, handleCollapse]);
|
|
91
|
+
var descriptionsCls = classNames(className, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-vertical"), layout === 'vertical'), "".concat(prefixCls, "-horizontal"), layout === 'horizontal'), "".concat(prefixCls, "-collapsible"), collapsible), "".concat(prefixCls, "-collapsed"), collapsible && collapsed), "".concat(prefixCls, "-content-align-left"), contentAlign === 'left'));
|
|
38
92
|
return wrapSSR( /*#__PURE__*/_jsx(AntDescriptions, _objectSpread({
|
|
39
93
|
layout: layout,
|
|
40
94
|
colon: colon,
|
|
41
95
|
bordered: bordered,
|
|
96
|
+
column: column,
|
|
42
97
|
items: newItems,
|
|
98
|
+
title: descriptionsTitle,
|
|
43
99
|
prefixCls: customizePrefixCls,
|
|
44
100
|
className: descriptionsCls
|
|
45
101
|
}, restProps)));
|
|
@@ -34,18 +34,61 @@ export var genDescriptionsStyle = function genDescriptionsStyle(token) {
|
|
|
34
34
|
var componentCls = token.componentCls,
|
|
35
35
|
typographyComponentCls = token.typographyComponentCls,
|
|
36
36
|
calc = token.calc;
|
|
37
|
-
return _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls), _objectSpread(_objectSpread(
|
|
37
|
+
return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls), _objectSpread(_objectSpread(_defineProperty(_defineProperty({}, "".concat(componentCls, "-header"), {
|
|
38
|
+
marginBottom: token.margin
|
|
39
|
+
}), "".concat(componentCls, "-title-wrapper"), _defineProperty({
|
|
40
|
+
cursor: 'pointer',
|
|
41
|
+
display: 'flex',
|
|
42
|
+
alignItems: 'center',
|
|
43
|
+
userSelect: 'none'
|
|
44
|
+
}, "".concat(componentCls, "-collapsible-icon"), {
|
|
45
|
+
fontSize: token.fontSizeLG
|
|
46
|
+
})), genVerticalStyle('default', token)), {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-row > th, ").concat(componentCls, "-row > td"), {
|
|
47
|
+
paddingRight: token.paddingLG
|
|
48
|
+
}), "".concat(componentCls, "-item-label"), _defineProperty({
|
|
38
49
|
fontWeight: token.fontWeightWeak
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
}, "".concat(typographyComponentCls, "-edit-content"), {
|
|
50
|
+
}, "&".concat(componentCls, "-item-no-colon::after"), {
|
|
51
|
+
display: 'none'
|
|
52
|
+
})), "".concat(componentCls, "-item-container"), _defineProperty({}, "".concat(componentCls, "-item-content"), _defineProperty({}, "".concat(typographyComponentCls, "-edit-content"), {
|
|
42
53
|
insetInlineStart: 0,
|
|
43
54
|
marginTop: 0,
|
|
44
55
|
marginBottom: 0
|
|
45
56
|
}))), "".concat(componentCls, "-item-container:has(", "".concat(typographyComponentCls, "-edit-content"), ")"), {
|
|
46
57
|
alignItems: 'center',
|
|
47
58
|
height: calc(token.fontSize).mul(token.lineHeight).equal()
|
|
48
|
-
}))), "".concat(componentCls).concat(componentCls, "-middle"),
|
|
59
|
+
}))), "".concat(componentCls).concat(componentCls, "-middle"), _objectSpread(_defineProperty({}, "".concat(componentCls, "-header"), {
|
|
60
|
+
marginBottom: token.marginSM
|
|
61
|
+
}), genVerticalStyle('middle', token))), "".concat(componentCls).concat(componentCls, "-small"), _objectSpread(_defineProperty({}, "".concat(componentCls, "-header"), {
|
|
62
|
+
marginBottom: token.marginXS
|
|
63
|
+
}), genVerticalStyle('small', token))), "".concat(componentCls).concat(componentCls, "-collapsed"), _defineProperty({}, "".concat(componentCls, "-view"), {
|
|
64
|
+
display: 'none'
|
|
65
|
+
})), "".concat(componentCls).concat(componentCls, "-content-align-left:not(").concat(componentCls, "-bordered)"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-view"), {
|
|
66
|
+
display: 'block'
|
|
67
|
+
}), "".concat(componentCls, "-view > table"), {
|
|
68
|
+
display: 'grid',
|
|
69
|
+
gridTemplateColumns: 'auto 1fr'
|
|
70
|
+
}), "".concat(componentCls, "-view > table > tbody"), {
|
|
71
|
+
display: 'contents'
|
|
72
|
+
}), "".concat(componentCls, "-row"), {
|
|
73
|
+
display: 'contents'
|
|
74
|
+
}), "".concat(componentCls, "-row > td").concat(componentCls, "-item"), {
|
|
75
|
+
display: 'contents'
|
|
76
|
+
}), "".concat(componentCls, "-item-container"), {
|
|
77
|
+
display: 'contents'
|
|
78
|
+
}), "".concat(componentCls, "-item-label"), {
|
|
79
|
+
whiteSpace: 'nowrap',
|
|
80
|
+
paddingBottom: token.padding,
|
|
81
|
+
paddingInlineEnd: token.paddingLG
|
|
82
|
+
}), "".concat(componentCls, "-item-content"), {
|
|
83
|
+
paddingBottom: token.padding
|
|
84
|
+
})), "".concat(componentCls).concat(componentCls, "-content-align-left").concat(componentCls, "-bordered"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-view > table"), {
|
|
85
|
+
tableLayout: 'auto'
|
|
86
|
+
}), "".concat(componentCls, "-row"), _defineProperty(_defineProperty({}, "& > th", {
|
|
87
|
+
whiteSpace: 'nowrap',
|
|
88
|
+
width: 1
|
|
89
|
+
}), "& > td", {
|
|
90
|
+
width: '100%'
|
|
91
|
+
})));
|
|
49
92
|
};
|
|
50
93
|
export default (function (prefixCls, typographyPrefixCls) {
|
|
51
94
|
var useStyle = genComponentStyleHook('Descriptions', function (token) {
|
package/es/drawer/style/index.js
CHANGED
|
@@ -7,22 +7,28 @@ import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
|
|
|
7
7
|
export var genDrawerStyle = function genDrawerStyle(token) {
|
|
8
8
|
var componentCls = token.componentCls,
|
|
9
9
|
antCls = token.antCls,
|
|
10
|
+
iconCls = token.iconCls,
|
|
10
11
|
fontSizeHeading3 = token.fontSizeHeading3,
|
|
11
12
|
colorSplit = token.colorSplit,
|
|
12
13
|
calc = token.calc;
|
|
13
14
|
var contentPadding = token.paddingLG;
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
return _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls), _defineProperty({}, "".concat(componentCls, "-content"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
15
|
+
var boxShadowTop = '0 -1px 2px 0 rgba(19, 33, 57, 0.1)';
|
|
16
|
+
var boxShadowBottom = '0 1px 2px 0 rgba(19, 33, 57, 0.1)';
|
|
17
|
+
return _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls), _defineProperty({}, "".concat(componentCls, "-content"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
18
|
+
// to avoid x scroll
|
|
19
|
+
overflow: 'initial'
|
|
20
|
+
}, "".concat(componentCls, "-header"), _defineProperty(_defineProperty({
|
|
17
21
|
position: 'relative',
|
|
18
22
|
padding: "".concat(unit(token.padding), " ").concat(unit(token.paddingLG)),
|
|
19
23
|
borderBottom: 'none',
|
|
20
24
|
transition: "box-shadow ".concat(token.motionDurationMid),
|
|
21
25
|
// ensure header box-shadow cover body content
|
|
22
26
|
zIndex: 10
|
|
23
|
-
}, "".concat(componentCls, "-title"), {
|
|
27
|
+
}, "".concat(componentCls, "-title"), _defineProperty({
|
|
24
28
|
fontSize: fontSizeHeading3
|
|
25
|
-
}
|
|
29
|
+
}, iconCls, {
|
|
30
|
+
fontSize: token.fontSizeLG
|
|
31
|
+
})), '&::after', {
|
|
26
32
|
content: '""',
|
|
27
33
|
position: 'absolute',
|
|
28
34
|
bottom: 0,
|
package/es/slider/style/index.js
CHANGED
|
@@ -2,6 +2,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2
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; }
|
|
3
3
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
4
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); }
|
|
5
|
+
import { unit } from '@ant-design/cssinjs';
|
|
5
6
|
import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
|
|
6
7
|
export var genSliderStyle = function genSliderStyle(token) {
|
|
7
8
|
var componentCls = token.componentCls,
|
|
@@ -12,8 +13,8 @@ export var genSliderStyle = function genSliderStyle(token) {
|
|
|
12
13
|
_token$handleLineWidt = token.handleLineWidth,
|
|
13
14
|
handleLineWidth = _token$handleLineWidt === void 0 ? 2 : _token$handleLineWidt,
|
|
14
15
|
calc = token.calc;
|
|
15
|
-
var dotSizeHalf = calc(dotSize).div(2).equal();
|
|
16
|
-
var handleOffset = calc(handleSize).add(calc(handleLineWidth).mul(2).equal()).div(2).equal();
|
|
16
|
+
var dotSizeHalf = unit(calc(dotSize).div(2).equal());
|
|
17
|
+
var handleOffset = unit(calc(handleSize).add(calc(handleLineWidth).mul(2).equal()).div(2).equal());
|
|
17
18
|
return _defineProperty({}, "".concat(componentCls).concat(componentCls, "-horizontal"), _defineProperty({}, "".concat(componentCls, "-mark"), _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-mark-text[style*=\"left: 0%;\"]"), {
|
|
18
19
|
transform: "translateX(calc(0% - ".concat(dotSizeHalf, ")) !important")
|
|
19
20
|
}), "".concat(componentCls, "-mark-text[style*=\"left: 100%;\"]"), {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OceanBase Design System - CSS Variables Style
|
|
3
|
+
* 使用 @ant-design/cssinjs 动态注入 CSS 变量
|
|
4
|
+
* 根据主题 token 值动态生成
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import type { CSSInterpolation } from '@ant-design/cssinjs';
|
|
8
|
+
import type { GlobalToken } from '../theme/interface';
|
|
9
|
+
/**
|
|
10
|
+
* 根据 token 生成 CSS 变量样式
|
|
11
|
+
*/
|
|
12
|
+
declare const genCssVariablesStyle: (token: GlobalToken, prefix?: string) => CSSInterpolation;
|
|
13
|
+
export interface CssVariablesStyleProps {
|
|
14
|
+
/**
|
|
15
|
+
* CSS 变量前缀,默认为 'ob'
|
|
16
|
+
*/
|
|
17
|
+
prefix?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* CSS 变量注入组件
|
|
21
|
+
* 使用 @ant-design/cssinjs 动态注入 CSS 变量
|
|
22
|
+
*/
|
|
23
|
+
declare const CssVariablesStyle: React.FC<CssVariablesStyleProps>;
|
|
24
|
+
export { CssVariablesStyle, genCssVariablesStyle };
|
|
25
|
+
export default CssVariablesStyle;
|