@dtjoy/dt-design 1.0.5 → 1.0.7
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/esm/_util/easings.js +9 -0
- package/esm/_util/extendsObject.js +17 -0
- package/esm/_util/getScroll.js +32 -0
- package/esm/_util/hooks/index.js +4 -1
- package/esm/_util/hooks/useForceUpdate.js +6 -0
- package/esm/_util/hooks/useProxyImperativeHandle.js +31 -0
- package/esm/_util/hooks/useSyncState.js +20 -0
- package/esm/_util/scrollTo.js +38 -0
- package/esm/_util/warning.js +63 -0
- package/esm/blockHeader/index.js +10 -8
- package/esm/blockHeader/style/index.less +143 -143
- package/esm/button/index.js +7 -15
- package/esm/button/style/index.less +52 -127
- package/esm/button/style/mixin.less +34 -42
- package/esm/collapsible/index.js +53 -55
- package/esm/collapsibleActionItems/index.js +2 -2
- package/esm/flex/index.js +1 -1
- package/esm/flex/style/index.less +76 -76
- package/esm/flex/utils.js +1 -1
- package/esm/formList/index.js +13 -11
- package/esm/formList/style/index.less +45 -45
- package/esm/index.js +3 -1
- package/esm/overflowList/index.js +4 -3
- package/esm/resize/index.js +1 -1
- package/esm/resizeObserver/index.js +3 -2
- package/esm/splitter/Panel.js +3 -3
- package/esm/splitter/SplitBar.js +8 -7
- package/esm/splitter/Splitter.js +5 -4
- package/esm/splitter/hooks/useItems.js +2 -2
- package/esm/splitter/hooks/useResize.js +5 -5
- package/esm/statusTag/index.js +8 -8
- package/esm/style/index.less +1 -1
- package/esm/style/themes/index.less +2 -2
- package/esm/style/themes/variable.less +4 -0
- package/esm/table/InternalTable.js +429 -0
- package/esm/table/RcTable/VirtualTable.js +9 -0
- package/esm/table/RcTable/index.js +9 -0
- package/esm/table/Table.js +28 -0
- package/esm/table/TableMeasureRowContext.js +3 -0
- package/esm/table/hooks/useContainerWidth.js +14 -0
- package/esm/table/index.js +2 -0
- package/esm/table/interface.js +4 -0
- package/esm/table/style/bordered.less +141 -0
- package/esm/table/style/fixed.less +88 -0
- package/esm/table/style/index.js +2 -0
- package/esm/table/style/index.less +150 -0
- package/esm/table/style/selection.less +90 -0
- package/esm/table/style/sticky.less +55 -0
- package/esm/table/style/virtual.less +65 -0
- package/esm/table/util.js +33 -0
- package/lib/_util/easings.js +15 -0
- package/lib/_util/extendsObject.js +20 -0
- package/lib/_util/getScroll.js +39 -0
- package/lib/_util/hooks/index.js +33 -0
- package/lib/_util/hooks/useForceUpdate.js +12 -0
- package/lib/_util/hooks/useProxyImperativeHandle.js +40 -0
- package/lib/_util/hooks/useSyncState.js +19 -0
- package/lib/_util/scrollTo.js +44 -0
- package/lib/_util/warning.js +75 -0
- package/lib/blockHeader/index.js +10 -8
- package/lib/blockHeader/style/index.less +143 -143
- package/lib/button/index.js +6 -14
- package/lib/button/style/index.less +52 -127
- package/lib/button/style/mixin.less +34 -42
- package/lib/collapsible/index.js +49 -49
- package/lib/collapsibleActionItems/index.js +2 -2
- package/lib/flex/index.js +2 -2
- package/lib/flex/style/index.less +76 -76
- package/lib/flex/utils.js +2 -2
- package/lib/formList/index.js +10 -10
- package/lib/formList/style/index.less +45 -45
- package/lib/index.js +21 -2
- package/lib/overflowList/index.js +4 -3
- package/lib/resize/index.js +1 -1
- package/lib/resizeObserver/index.js +3 -2
- package/lib/splitter/Panel.js +3 -3
- package/lib/splitter/SplitBar.js +8 -7
- package/lib/splitter/Splitter.js +5 -4
- package/lib/splitter/hooks/useItems.js +2 -2
- package/lib/splitter/hooks/useResize.js +5 -5
- package/lib/statusTag/index.js +8 -8
- package/lib/style/index.less +1 -1
- package/lib/style/themes/index.less +2 -2
- package/lib/style/themes/variable.less +4 -0
- package/lib/table/InternalTable.js +395 -0
- package/lib/table/RcTable/VirtualTable.js +17 -0
- package/lib/table/RcTable/index.js +17 -0
- package/lib/table/Table.js +37 -0
- package/lib/table/TableMeasureRowContext.js +10 -0
- package/lib/table/hooks/useContainerWidth.js +20 -0
- package/lib/table/index.js +9 -0
- package/lib/table/interface.js +8 -0
- package/lib/table/style/bordered.less +141 -0
- package/lib/table/style/fixed.less +88 -0
- package/lib/table/style/index.js +4 -0
- package/lib/table/style/index.less +150 -0
- package/lib/table/style/selection.less +90 -0
- package/lib/table/style/sticky.less +55 -0
- package/lib/table/style/virtual.less +65 -0
- package/lib/table/util.js +44 -0
- package/package.json +82 -66
- package/esm/_util/gapSize.d.ts +0 -3
- package/esm/_util/hooks/index.d.ts +0 -1
- package/esm/_util/hooks/useOrientation.d.ts +0 -2
- package/esm/_util/index.d.ts +0 -3
- package/esm/_util/isNonNullable.d.ts +0 -2
- package/esm/_util/type.d.ts +0 -52
- package/esm/blockHeader/index.d.ts +0 -47
- package/esm/blockHeader/style/index.d.ts +0 -2
- package/esm/button/index.d.ts +0 -10
- package/esm/button/style/index.d.ts +0 -2
- package/esm/collapsible/index.d.ts +0 -97
- package/esm/collapsible/style/index.d.ts +0 -1
- package/esm/collapsibleActionItems/index.d.ts +0 -24
- package/esm/collapsibleActionItems/style/index.d.ts +0 -2
- package/esm/flex/index.d.ts +0 -7
- package/esm/flex/interface.d.ts +0 -16
- package/esm/flex/style/index.d.ts +0 -2
- package/esm/flex/utils.d.ts +0 -7
- package/esm/formList/index.d.ts +0 -77
- package/esm/formList/style/index.d.ts +0 -2
- package/esm/index.d.ts +0 -14
- package/esm/overflowList/index.d.ts +0 -39
- package/esm/overflowList/style/index.d.ts +0 -2
- package/esm/resize/index.d.ts +0 -8
- package/esm/resizeObserver/index.d.ts +0 -45
- package/esm/splitter/Panel.d.ts +0 -7
- package/esm/splitter/SplitBar.d.ts +0 -24
- package/esm/splitter/Splitter.d.ts +0 -5
- package/esm/splitter/hooks/sizeUtil.d.ts +0 -3
- package/esm/splitter/hooks/useItems.d.ts +0 -14
- package/esm/splitter/hooks/useResizable.d.ts +0 -10
- package/esm/splitter/hooks/useResize.d.ts +0 -6
- package/esm/splitter/hooks/useSizes.d.ts +0 -4
- package/esm/splitter/index.d.ts +0 -8
- package/esm/splitter/interface.d.ts +0 -69
- package/esm/splitter/style/index.d.ts +0 -2
- package/esm/statusTag/index.d.ts +0 -28
- package/esm/statusTag/style/index.d.ts +0 -2
- package/esm/style/index.d.ts +0 -1
- package/lib/_util/gapSize.d.ts +0 -3
- package/lib/_util/hooks/index.d.ts +0 -1
- package/lib/_util/hooks/useOrientation.d.ts +0 -2
- package/lib/_util/index.d.ts +0 -3
- package/lib/_util/isNonNullable.d.ts +0 -2
- package/lib/_util/type.d.ts +0 -52
- package/lib/blockHeader/index.d.ts +0 -47
- package/lib/blockHeader/style/index.d.ts +0 -2
- package/lib/button/index.d.ts +0 -10
- package/lib/button/style/index.d.ts +0 -2
- package/lib/collapsible/index.d.ts +0 -97
- package/lib/collapsible/style/index.d.ts +0 -1
- package/lib/collapsibleActionItems/index.d.ts +0 -24
- package/lib/collapsibleActionItems/style/index.d.ts +0 -2
- package/lib/flex/index.d.ts +0 -7
- package/lib/flex/interface.d.ts +0 -16
- package/lib/flex/style/index.d.ts +0 -2
- package/lib/flex/utils.d.ts +0 -7
- package/lib/formList/index.d.ts +0 -77
- package/lib/formList/style/index.d.ts +0 -2
- package/lib/index.d.ts +0 -14
- package/lib/overflowList/index.d.ts +0 -39
- package/lib/overflowList/style/index.d.ts +0 -2
- package/lib/resize/index.d.ts +0 -8
- package/lib/resizeObserver/index.d.ts +0 -45
- package/lib/splitter/Panel.d.ts +0 -7
- package/lib/splitter/SplitBar.d.ts +0 -24
- package/lib/splitter/Splitter.d.ts +0 -5
- package/lib/splitter/hooks/sizeUtil.d.ts +0 -3
- package/lib/splitter/hooks/useItems.d.ts +0 -14
- package/lib/splitter/hooks/useResizable.d.ts +0 -10
- package/lib/splitter/hooks/useResize.d.ts +0 -6
- package/lib/splitter/hooks/useSizes.d.ts +0 -4
- package/lib/splitter/index.d.ts +0 -8
- package/lib/splitter/interface.d.ts +0 -69
- package/lib/splitter/style/index.d.ts +0 -2
- package/lib/statusTag/index.d.ts +0 -28
- package/lib/statusTag/style/index.d.ts +0 -2
- package/lib/style/index.d.ts +0 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = scrollTo;
|
|
7
|
+
var _raf = _interopRequireDefault(require("@rc-component/util/lib/raf"));
|
|
8
|
+
var _easings = require("./easings");
|
|
9
|
+
var _getScroll = _interopRequireWildcard(require("./getScroll"));
|
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
11
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
function scrollTo(y, options = {}) {
|
|
14
|
+
const {
|
|
15
|
+
getContainer = () => window,
|
|
16
|
+
callback,
|
|
17
|
+
duration = 450
|
|
18
|
+
} = options;
|
|
19
|
+
const container = getContainer();
|
|
20
|
+
const scrollTop = (0, _getScroll.default)(container);
|
|
21
|
+
const startTime = Date.now();
|
|
22
|
+
let rafId;
|
|
23
|
+
const frameFunc = () => {
|
|
24
|
+
const timestamp = Date.now();
|
|
25
|
+
const time = timestamp - startTime;
|
|
26
|
+
const nextScrollTop = (0, _easings.easeInOutCubic)(time > duration ? duration : time, scrollTop, y, duration);
|
|
27
|
+
if ((0, _getScroll.isWindow)(container)) {
|
|
28
|
+
container.scrollTo(window.pageXOffset, nextScrollTop);
|
|
29
|
+
} else if (container instanceof Document || container.constructor.name === 'HTMLDocument') {
|
|
30
|
+
container.documentElement.scrollTop = nextScrollTop;
|
|
31
|
+
} else {
|
|
32
|
+
container.scrollTop = nextScrollTop;
|
|
33
|
+
}
|
|
34
|
+
if (time < duration) {
|
|
35
|
+
rafId = (0, _raf.default)(frameFunc);
|
|
36
|
+
} else if (typeof callback === 'function') {
|
|
37
|
+
callback();
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
rafId = (0, _raf.default)(frameFunc);
|
|
41
|
+
return () => {
|
|
42
|
+
_raf.default.cancel(rafId);
|
|
43
|
+
};
|
|
44
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.devUseWarning = exports.default = exports.WarningContext = void 0;
|
|
7
|
+
exports.noop = noop;
|
|
8
|
+
exports.resetWarned = resetWarned;
|
|
9
|
+
var React = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _util = require("@rc-component/util");
|
|
11
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
|
+
function noop() {}
|
|
14
|
+
const {
|
|
15
|
+
resetWarned: rcResetWarned
|
|
16
|
+
} = _util.warning;
|
|
17
|
+
let deprecatedWarnList = null;
|
|
18
|
+
function resetWarned() {
|
|
19
|
+
deprecatedWarnList = null;
|
|
20
|
+
rcResetWarned();
|
|
21
|
+
}
|
|
22
|
+
let _warning = noop;
|
|
23
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
24
|
+
_warning = (valid, component, message) => {
|
|
25
|
+
(0, _util.warning)(valid, `[antd: ${component}] ${message}`);
|
|
26
|
+
|
|
27
|
+
// StrictMode will inject console which will not throw warning in React 17.
|
|
28
|
+
if (process.env.NODE_ENV === 'test') {
|
|
29
|
+
resetWarned();
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const warning = _warning;
|
|
34
|
+
const WarningContext = exports.WarningContext = /*#__PURE__*/React.createContext({});
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* This is a hook but we not named as `useWarning`
|
|
38
|
+
* since this is only used in development.
|
|
39
|
+
* We should always wrap this in `if (process.env.NODE_ENV !== 'production')` condition
|
|
40
|
+
*/
|
|
41
|
+
const devUseWarning = exports.devUseWarning = process.env.NODE_ENV !== 'production' ? component => {
|
|
42
|
+
const {
|
|
43
|
+
strict
|
|
44
|
+
} = React.useContext(WarningContext);
|
|
45
|
+
const typeWarning = (valid, type, message) => {
|
|
46
|
+
if (!valid) {
|
|
47
|
+
if (strict === false && type === 'deprecated') {
|
|
48
|
+
const existWarning = deprecatedWarnList;
|
|
49
|
+
if (!deprecatedWarnList) {
|
|
50
|
+
deprecatedWarnList = {};
|
|
51
|
+
}
|
|
52
|
+
deprecatedWarnList[component] = deprecatedWarnList[component] || [];
|
|
53
|
+
if (!deprecatedWarnList[component].includes(message || '')) {
|
|
54
|
+
deprecatedWarnList[component].push(message || '');
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Warning for the first time
|
|
58
|
+
if (!existWarning) {
|
|
59
|
+
console.warn('[antd] There exists deprecated usage in your code:', deprecatedWarnList);
|
|
60
|
+
}
|
|
61
|
+
} else {
|
|
62
|
+
warning(valid, component, message);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
typeWarning.deprecated = (valid, oldProp, newProp, message = '') => {
|
|
67
|
+
typeWarning(valid, 'deprecated', `\`${oldProp}\` is deprecated. Please use \`${newProp}\` instead.${message ? ` ${message}` : ''}`);
|
|
68
|
+
};
|
|
69
|
+
return typeWarning;
|
|
70
|
+
} : () => {
|
|
71
|
+
const noopWarning = () => {};
|
|
72
|
+
noopWarning.deprecated = noop;
|
|
73
|
+
return noopWarning;
|
|
74
|
+
};
|
|
75
|
+
var _default = exports.default = warning;
|
package/lib/blockHeader/index.js
CHANGED
|
@@ -8,7 +8,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _icons = require("@ant-design/icons");
|
|
9
9
|
var _antd = require("antd");
|
|
10
10
|
var _configProvider = require("antd/es/config-provider");
|
|
11
|
-
var
|
|
11
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
12
12
|
require("./style");
|
|
13
13
|
var _util = require("../_util");
|
|
14
14
|
var _collapsible = _interopRequireDefault(require("../collapsible"));
|
|
@@ -21,8 +21,9 @@ function isControlled(props) {
|
|
|
21
21
|
}
|
|
22
22
|
const prefixCls = (0, _configProvider.globalConfig)().getPrefixCls('block-header');
|
|
23
23
|
const preTitleRowCls = `${prefixCls}__title`;
|
|
24
|
-
const BlockHeader =
|
|
24
|
+
const BlockHeader = props => {
|
|
25
25
|
const {
|
|
26
|
+
id,
|
|
26
27
|
title,
|
|
27
28
|
description = '',
|
|
28
29
|
tooltip,
|
|
@@ -49,7 +50,7 @@ const BlockHeader = function (props) {
|
|
|
49
50
|
// 只有在有了 children 并且设置了 expand/defaultExpand 的时候才能够展开收起
|
|
50
51
|
const showCollapse = (typeof expand === 'boolean' || typeof defaultExpand === 'boolean') && children;
|
|
51
52
|
const tooltipProps = (0, _util.toTooltipProps)(tooltip);
|
|
52
|
-
let bottomStyle;
|
|
53
|
+
let bottomStyle = {};
|
|
53
54
|
if (spaceBottom) bottomStyle = showCollapse && !currentExpand ? {
|
|
54
55
|
marginBottom: 0
|
|
55
56
|
} : {
|
|
@@ -61,13 +62,14 @@ const BlockHeader = function (props) {
|
|
|
61
62
|
onExpand?.(expand);
|
|
62
63
|
};
|
|
63
64
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
64
|
-
|
|
65
|
+
id: id,
|
|
66
|
+
className: (0, _clsx.default)(`${prefixCls}`, className),
|
|
65
67
|
style: {
|
|
66
68
|
...bottomStyle,
|
|
67
69
|
...style
|
|
68
70
|
}
|
|
69
71
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
70
|
-
className: (0,
|
|
72
|
+
className: (0, _clsx.default)(preTitleRowCls, `${preTitleRowCls}--${size}`, {
|
|
71
73
|
[`${preTitleRowCls}--background`]: background,
|
|
72
74
|
[`${preTitleRowCls}--pointer`]: showCollapse
|
|
73
75
|
}),
|
|
@@ -82,7 +84,7 @@ const BlockHeader = function (props) {
|
|
|
82
84
|
}, title), tooltipProps?.title ? /*#__PURE__*/_react.default.createElement("div", {
|
|
83
85
|
className: `title__tooltip`
|
|
84
86
|
}, /*#__PURE__*/_react.default.createElement(_antd.Tooltip, _extends({}, tooltipProps, {
|
|
85
|
-
className: (0,
|
|
87
|
+
className: (0, _clsx.default)(tooltipProps?.className)
|
|
86
88
|
}), /*#__PURE__*/_react.default.createElement(_icons.QuestionCircleOutlined, null))) : null, description ? /*#__PURE__*/_react.default.createElement("div", {
|
|
87
89
|
className: `title__description`
|
|
88
90
|
}, description) : null), addonAfter && /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -92,14 +94,14 @@ const BlockHeader = function (props) {
|
|
|
92
94
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
93
95
|
className: "collapse__text"
|
|
94
96
|
}, currentExpand ? '收起' : '展开'), /*#__PURE__*/_react.default.createElement(_icons.UpOutlined, {
|
|
95
|
-
className: (0,
|
|
97
|
+
className: (0, _clsx.default)('collapse__icon', {
|
|
96
98
|
'collapse__icon--up': currentExpand,
|
|
97
99
|
'collapse__icon--down': !currentExpand
|
|
98
100
|
})
|
|
99
101
|
}))), /*#__PURE__*/_react.default.createElement(_collapsible.default, {
|
|
100
102
|
isOpen: !currentExpand
|
|
101
103
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
102
|
-
className: (0,
|
|
104
|
+
className: (0, _clsx.default)(`${prefixCls}__content`, contentClassName, {
|
|
103
105
|
[`${prefixCls}__content--active`]: currentExpand || !showCollapse
|
|
104
106
|
}),
|
|
105
107
|
style: contentStyle
|
|
@@ -1,143 +1,143 @@
|
|
|
1
|
-
@import '../../style/themes/index.less';
|
|
2
|
-
|
|
3
|
-
@card_prefix: ~'@{ant-prefix}-block-header';
|
|
4
|
-
|
|
5
|
-
.@{card_prefix} {
|
|
6
|
-
&__title {
|
|
7
|
-
border-radius: 4px;
|
|
8
|
-
display: flex;
|
|
9
|
-
align-items: center;
|
|
10
|
-
justify-content: space-between;
|
|
11
|
-
&--large {
|
|
12
|
-
.title__box {
|
|
13
|
-
line-height: 24px;
|
|
14
|
-
.title__text {
|
|
15
|
-
font-size: 16px;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
&--middle {
|
|
20
|
-
.title__box {
|
|
21
|
-
line-height: 22px;
|
|
22
|
-
.title__text {
|
|
23
|
-
font-size: 14px;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
&--small {
|
|
28
|
-
.title__box {
|
|
29
|
-
line-height: 20px;
|
|
30
|
-
.title__text {
|
|
31
|
-
font-size: 12px;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
&--background {
|
|
36
|
-
padding: 0 12px;
|
|
37
|
-
background-color: #f9f9fa;
|
|
38
|
-
&.@{card_prefix}__title {
|
|
39
|
-
&--middle,
|
|
40
|
-
&--large {
|
|
41
|
-
height: 40px;
|
|
42
|
-
}
|
|
43
|
-
&--small {
|
|
44
|
-
height: 32px;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
&--pointer {
|
|
49
|
-
cursor: pointer;
|
|
50
|
-
}
|
|
51
|
-
.title {
|
|
52
|
-
&__box {
|
|
53
|
-
flex: 1;
|
|
54
|
-
display: flex;
|
|
55
|
-
align-items: center;
|
|
56
|
-
}
|
|
57
|
-
&__addon-before {
|
|
58
|
-
margin-right: 8px;
|
|
59
|
-
color: @primary-color;
|
|
60
|
-
&--middle {
|
|
61
|
-
.addon-before--default {
|
|
62
|
-
width: 4px;
|
|
63
|
-
height: 16px;
|
|
64
|
-
background-color: @primary-color;
|
|
65
|
-
}
|
|
66
|
-
font-size: 20px;
|
|
67
|
-
}
|
|
68
|
-
&--small {
|
|
69
|
-
.addon-before--default {
|
|
70
|
-
width: 4px;
|
|
71
|
-
height: 16px;
|
|
72
|
-
background-color: @primary-color;
|
|
73
|
-
}
|
|
74
|
-
font-size: 16px;
|
|
75
|
-
}
|
|
76
|
-
&--large {
|
|
77
|
-
.addon-before--default {
|
|
78
|
-
width: 4px;
|
|
79
|
-
height: 20px;
|
|
80
|
-
background-color: @primary-color;
|
|
81
|
-
}
|
|
82
|
-
font-size: 24px;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
&__tooltip {
|
|
86
|
-
display: flex;
|
|
87
|
-
margin-right: 4px;
|
|
88
|
-
font-size: 14px;
|
|
89
|
-
color: #b1b4c5;
|
|
90
|
-
cursor: pointer;
|
|
91
|
-
}
|
|
92
|
-
&__text {
|
|
93
|
-
color: @text-color;
|
|
94
|
-
font-weight: 500;
|
|
95
|
-
margin-right: 4px;
|
|
96
|
-
}
|
|
97
|
-
&__description {
|
|
98
|
-
display: flex;
|
|
99
|
-
align-items: center;
|
|
100
|
-
color: @label-color;
|
|
101
|
-
font-size: 12px;
|
|
102
|
-
}
|
|
103
|
-
&__addon-after {
|
|
104
|
-
color: @label-color;
|
|
105
|
-
}
|
|
106
|
-
&__collapse {
|
|
107
|
-
color: @label-color;
|
|
108
|
-
display: flex;
|
|
109
|
-
align-items: center;
|
|
110
|
-
cursor: pointer;
|
|
111
|
-
user-select: none;
|
|
112
|
-
.collapse {
|
|
113
|
-
&__text {
|
|
114
|
-
font-size: 12px;
|
|
115
|
-
margin: 0 4px;
|
|
116
|
-
}
|
|
117
|
-
&__icon {
|
|
118
|
-
font-size: 16px;
|
|
119
|
-
transition: transform 0.4s;
|
|
120
|
-
&--down {
|
|
121
|
-
transform: rotate(-180deg);
|
|
122
|
-
}
|
|
123
|
-
&--up {
|
|
124
|
-
transform: rotate(0deg);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
&__content {
|
|
132
|
-
padding: 16px 24px;
|
|
133
|
-
|
|
134
|
-
// opacity: 0;
|
|
135
|
-
// height: 0;
|
|
136
|
-
// overflow: hidden;
|
|
137
|
-
// transition: opacity 0.5s ease, height 0.5s ease;
|
|
138
|
-
&--active {
|
|
139
|
-
// opacity: 1;
|
|
140
|
-
// height: auto;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
1
|
+
@import '../../style/themes/index.less';
|
|
2
|
+
|
|
3
|
+
@card_prefix: ~'@{ant-prefix}-block-header';
|
|
4
|
+
|
|
5
|
+
.@{card_prefix} {
|
|
6
|
+
&__title {
|
|
7
|
+
border-radius: 4px;
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: space-between;
|
|
11
|
+
&--large {
|
|
12
|
+
.title__box {
|
|
13
|
+
line-height: 24px;
|
|
14
|
+
.title__text {
|
|
15
|
+
font-size: 16px;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
&--middle {
|
|
20
|
+
.title__box {
|
|
21
|
+
line-height: 22px;
|
|
22
|
+
.title__text {
|
|
23
|
+
font-size: 14px;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
&--small {
|
|
28
|
+
.title__box {
|
|
29
|
+
line-height: 20px;
|
|
30
|
+
.title__text {
|
|
31
|
+
font-size: 12px;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
&--background {
|
|
36
|
+
padding: 0 12px;
|
|
37
|
+
background-color: #f9f9fa;
|
|
38
|
+
&.@{card_prefix}__title {
|
|
39
|
+
&--middle,
|
|
40
|
+
&--large {
|
|
41
|
+
height: 40px;
|
|
42
|
+
}
|
|
43
|
+
&--small {
|
|
44
|
+
height: 32px;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
&--pointer {
|
|
49
|
+
cursor: pointer;
|
|
50
|
+
}
|
|
51
|
+
.title {
|
|
52
|
+
&__box {
|
|
53
|
+
flex: 1;
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
}
|
|
57
|
+
&__addon-before {
|
|
58
|
+
margin-right: 8px;
|
|
59
|
+
color: @primary-color;
|
|
60
|
+
&--middle {
|
|
61
|
+
.addon-before--default {
|
|
62
|
+
width: 4px;
|
|
63
|
+
height: 16px;
|
|
64
|
+
background-color: @primary-color;
|
|
65
|
+
}
|
|
66
|
+
font-size: 20px;
|
|
67
|
+
}
|
|
68
|
+
&--small {
|
|
69
|
+
.addon-before--default {
|
|
70
|
+
width: 4px;
|
|
71
|
+
height: 16px;
|
|
72
|
+
background-color: @primary-color;
|
|
73
|
+
}
|
|
74
|
+
font-size: 16px;
|
|
75
|
+
}
|
|
76
|
+
&--large {
|
|
77
|
+
.addon-before--default {
|
|
78
|
+
width: 4px;
|
|
79
|
+
height: 20px;
|
|
80
|
+
background-color: @primary-color;
|
|
81
|
+
}
|
|
82
|
+
font-size: 24px;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
&__tooltip {
|
|
86
|
+
display: flex;
|
|
87
|
+
margin-right: 4px;
|
|
88
|
+
font-size: 14px;
|
|
89
|
+
color: #b1b4c5;
|
|
90
|
+
cursor: pointer;
|
|
91
|
+
}
|
|
92
|
+
&__text {
|
|
93
|
+
color: @text-color;
|
|
94
|
+
font-weight: 500;
|
|
95
|
+
margin-right: 4px;
|
|
96
|
+
}
|
|
97
|
+
&__description {
|
|
98
|
+
display: flex;
|
|
99
|
+
align-items: center;
|
|
100
|
+
color: @label-color;
|
|
101
|
+
font-size: 12px;
|
|
102
|
+
}
|
|
103
|
+
&__addon-after {
|
|
104
|
+
color: @label-color;
|
|
105
|
+
}
|
|
106
|
+
&__collapse {
|
|
107
|
+
color: @label-color;
|
|
108
|
+
display: flex;
|
|
109
|
+
align-items: center;
|
|
110
|
+
cursor: pointer;
|
|
111
|
+
user-select: none;
|
|
112
|
+
.collapse {
|
|
113
|
+
&__text {
|
|
114
|
+
font-size: 12px;
|
|
115
|
+
margin: 0 4px;
|
|
116
|
+
}
|
|
117
|
+
&__icon {
|
|
118
|
+
font-size: 16px;
|
|
119
|
+
transition: transform 0.4s;
|
|
120
|
+
&--down {
|
|
121
|
+
transform: rotate(-180deg);
|
|
122
|
+
}
|
|
123
|
+
&--up {
|
|
124
|
+
transform: rotate(0deg);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
&__content {
|
|
132
|
+
padding: 16px 24px;
|
|
133
|
+
|
|
134
|
+
// opacity: 0;
|
|
135
|
+
// height: 0;
|
|
136
|
+
// overflow: hidden;
|
|
137
|
+
// transition: opacity 0.5s ease, height 0.5s ease;
|
|
138
|
+
&--active {
|
|
139
|
+
// opacity: 1;
|
|
140
|
+
// height: auto;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
package/lib/button/index.js
CHANGED
|
@@ -3,31 +3,23 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default =
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _antd = require("antd");
|
|
9
|
-
var
|
|
10
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
11
10
|
require("./style");
|
|
12
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
12
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
14
13
|
function Button({
|
|
15
14
|
className,
|
|
16
|
-
icon,
|
|
17
|
-
children,
|
|
18
15
|
size = 'middle',
|
|
19
16
|
type,
|
|
20
17
|
...rest
|
|
21
18
|
}) {
|
|
22
|
-
const prefixCls = (0, _configProvider.globalConfig)().getPrefixCls('btn');
|
|
23
|
-
const typeClassName = type ? `${prefixCls}--${type}` : '';
|
|
24
19
|
return /*#__PURE__*/_react.default.createElement(_antd.Button, _extends({
|
|
25
|
-
className: (0,
|
|
20
|
+
className: (0, _clsx.default)(className),
|
|
26
21
|
size: size,
|
|
27
22
|
type: type
|
|
28
|
-
}, rest)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
className: `${prefixCls}__text ${prefixCls}__text--${size}`
|
|
32
|
-
}, children));
|
|
33
|
-
}
|
|
23
|
+
}, rest));
|
|
24
|
+
}
|
|
25
|
+
var _default = exports.default = Button;
|