@dtjoy/dt-design 1.0.6 → 1.0.8
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.d.ts +1 -0
- package/esm/_util/easings.js +9 -0
- package/esm/_util/extendsObject.d.ts +4 -0
- package/esm/_util/extendsObject.js +17 -0
- package/esm/_util/gapSize.d.ts +3 -3
- package/esm/_util/getScroll.d.ts +3 -0
- package/esm/_util/getScroll.js +32 -0
- package/esm/_util/hooks/index.d.ts +4 -1
- package/esm/_util/hooks/index.js +4 -1
- package/esm/_util/hooks/useForceUpdate.d.ts +2 -0
- package/esm/_util/hooks/useForceUpdate.js +6 -0
- package/esm/_util/hooks/useOrientation.d.ts +2 -2
- package/esm/_util/hooks/useProxyImperativeHandle.d.ts +4 -0
- package/esm/_util/hooks/useProxyImperativeHandle.js +31 -0
- package/esm/_util/hooks/useSyncState.d.ts +3 -0
- package/esm/_util/hooks/useSyncState.js +20 -0
- package/esm/_util/index.d.ts +3 -3
- package/esm/_util/isNonNullable.d.ts +2 -2
- package/esm/_util/scrollTo.d.ts +10 -0
- package/esm/_util/scrollTo.js +38 -0
- package/esm/_util/type.d.ts +52 -52
- package/esm/_util/warning.d.ts +31 -31
- package/esm/_util/warning.js +5 -5
- package/esm/blockHeader/index.d.ts +50 -48
- package/esm/blockHeader/index.js +13 -15
- package/esm/blockHeader/style/index.d.ts +2 -2
- package/esm/blockHeader/style/index.less +143 -143
- package/esm/button/index.d.ts +10 -10
- package/esm/button/index.js +2 -2
- package/esm/button/style/index.d.ts +2 -2
- package/esm/collapsible/index.d.ts +102 -97
- package/esm/collapsible/index.js +53 -55
- package/esm/collapsible/style/index.d.ts +1 -1
- package/esm/collapsibleActionItems/index.d.ts +24 -24
- package/esm/collapsibleActionItems/index.js +2 -2
- package/esm/collapsibleActionItems/style/index.d.ts +2 -2
- package/esm/flex/index.d.ts +7 -7
- package/esm/flex/index.js +1 -1
- package/esm/flex/interface.d.ts +16 -16
- package/esm/flex/style/index.d.ts +2 -2
- package/esm/flex/style/index.less +76 -76
- package/esm/flex/utils.d.ts +7 -7
- package/esm/flex/utils.js +1 -1
- package/esm/formList/index.d.ts +78 -77
- package/esm/formList/index.js +13 -11
- package/esm/formList/style/index.d.ts +2 -2
- package/esm/formList/style/index.less +45 -45
- package/esm/index.d.ts +17 -14
- package/esm/index.js +3 -1
- package/esm/overflowList/index.d.ts +40 -39
- package/esm/overflowList/index.js +4 -3
- package/esm/overflowList/style/index.d.ts +2 -2
- package/esm/resize/index.d.ts +9 -8
- package/esm/resize/index.js +1 -1
- package/esm/resizeObserver/index.d.ts +45 -45
- package/esm/resizeObserver/index.js +3 -2
- package/esm/splitter/Panel.d.ts +7 -7
- package/esm/splitter/Panel.js +3 -3
- package/esm/splitter/SplitBar.d.ts +24 -24
- package/esm/splitter/SplitBar.js +8 -7
- package/esm/splitter/Splitter.d.ts +5 -5
- package/esm/splitter/Splitter.js +5 -4
- package/esm/splitter/hooks/sizeUtil.d.ts +3 -3
- package/esm/splitter/hooks/useItems.d.ts +14 -14
- package/esm/splitter/hooks/useItems.js +2 -2
- package/esm/splitter/hooks/useResizable.d.ts +10 -10
- package/esm/splitter/hooks/useResize.d.ts +6 -6
- package/esm/splitter/hooks/useResize.js +5 -5
- package/esm/splitter/hooks/useSizes.d.ts +4 -4
- package/esm/splitter/index.d.ts +8 -8
- package/esm/splitter/interface.d.ts +69 -69
- package/esm/splitter/style/index.d.ts +2 -2
- package/esm/statusTag/index.d.ts +29 -28
- package/esm/statusTag/index.js +8 -8
- package/esm/statusTag/style/index.d.ts +2 -2
- package/esm/style/index.d.ts +1 -1
- 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.d.ts +32 -0
- package/esm/table/InternalTable.js +429 -0
- package/esm/table/RcTable/VirtualTable.d.ts +2 -0
- package/esm/table/RcTable/VirtualTable.js +9 -0
- package/esm/table/RcTable/index.d.ts +2 -0
- package/esm/table/RcTable/index.js +9 -0
- package/esm/table/Table.d.ts +17 -0
- package/esm/table/Table.js +28 -0
- package/esm/table/TableMeasureRowContext.d.ts +3 -0
- package/esm/table/TableMeasureRowContext.js +3 -0
- package/esm/table/hooks/useContainerWidth.d.ts +1 -0
- package/esm/table/hooks/useContainerWidth.js +14 -0
- package/esm/table/index.d.ts +7 -0
- package/esm/table/index.js +2 -0
- package/esm/table/interface.d.ts +196 -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.d.ts +2 -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.d.ts +14 -0
- package/esm/table/util.js +33 -0
- package/lib/_util/easings.d.ts +1 -0
- package/lib/_util/easings.js +15 -0
- package/lib/_util/extendsObject.d.ts +4 -0
- package/lib/_util/extendsObject.js +20 -0
- package/lib/_util/gapSize.d.ts +3 -3
- package/lib/_util/getScroll.d.ts +3 -0
- package/lib/_util/getScroll.js +39 -0
- package/lib/_util/hooks/index.d.ts +4 -1
- package/lib/_util/hooks/index.js +33 -0
- package/lib/_util/hooks/useForceUpdate.d.ts +2 -0
- package/lib/_util/hooks/useForceUpdate.js +12 -0
- package/lib/_util/hooks/useOrientation.d.ts +2 -2
- package/lib/_util/hooks/useProxyImperativeHandle.d.ts +4 -0
- package/lib/_util/hooks/useProxyImperativeHandle.js +40 -0
- package/lib/_util/hooks/useSyncState.d.ts +3 -0
- package/lib/_util/hooks/useSyncState.js +19 -0
- package/lib/_util/index.d.ts +3 -3
- package/lib/_util/isNonNullable.d.ts +2 -2
- package/lib/_util/scrollTo.d.ts +10 -0
- package/lib/_util/scrollTo.js +44 -0
- package/lib/_util/type.d.ts +52 -52
- package/lib/_util/warning.d.ts +31 -31
- package/lib/_util/warning.js +7 -8
- package/lib/blockHeader/index.d.ts +50 -48
- package/lib/blockHeader/index.js +13 -12
- package/lib/blockHeader/style/index.d.ts +2 -2
- package/lib/blockHeader/style/index.less +143 -143
- package/lib/button/index.d.ts +10 -10
- package/lib/button/index.js +2 -2
- package/lib/button/style/index.d.ts +2 -2
- package/lib/collapsible/index.d.ts +102 -97
- package/lib/collapsible/index.js +49 -49
- package/lib/collapsible/style/index.d.ts +1 -1
- package/lib/collapsibleActionItems/index.d.ts +24 -24
- package/lib/collapsibleActionItems/index.js +2 -2
- package/lib/collapsibleActionItems/style/index.d.ts +2 -2
- package/lib/flex/index.d.ts +7 -7
- package/lib/flex/index.js +2 -2
- package/lib/flex/interface.d.ts +16 -16
- package/lib/flex/style/index.d.ts +2 -2
- package/lib/flex/style/index.less +76 -76
- package/lib/flex/utils.d.ts +7 -7
- package/lib/flex/utils.js +2 -2
- package/lib/formList/index.d.ts +78 -77
- package/lib/formList/index.js +10 -10
- package/lib/formList/style/index.d.ts +2 -2
- package/lib/formList/style/index.less +45 -45
- package/lib/index.d.ts +17 -14
- package/lib/index.js +21 -2
- package/lib/overflowList/index.d.ts +40 -39
- package/lib/overflowList/index.js +4 -3
- package/lib/overflowList/style/index.d.ts +2 -2
- package/lib/resize/index.d.ts +9 -8
- package/lib/resize/index.js +1 -1
- package/lib/resizeObserver/index.d.ts +45 -45
- package/lib/resizeObserver/index.js +3 -2
- package/lib/splitter/Panel.d.ts +7 -7
- package/lib/splitter/Panel.js +3 -3
- package/lib/splitter/SplitBar.d.ts +24 -24
- package/lib/splitter/SplitBar.js +8 -7
- package/lib/splitter/Splitter.d.ts +5 -5
- package/lib/splitter/Splitter.js +5 -4
- package/lib/splitter/hooks/sizeUtil.d.ts +3 -3
- package/lib/splitter/hooks/useItems.d.ts +14 -14
- package/lib/splitter/hooks/useItems.js +2 -2
- package/lib/splitter/hooks/useResizable.d.ts +10 -10
- package/lib/splitter/hooks/useResize.d.ts +6 -6
- package/lib/splitter/hooks/useResize.js +5 -5
- package/lib/splitter/hooks/useSizes.d.ts +4 -4
- package/lib/splitter/index.d.ts +8 -8
- package/lib/splitter/interface.d.ts +69 -69
- package/lib/splitter/style/index.d.ts +2 -2
- package/lib/statusTag/index.d.ts +29 -28
- package/lib/statusTag/index.js +8 -8
- package/lib/statusTag/style/index.d.ts +2 -2
- package/lib/style/index.d.ts +1 -1
- 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.d.ts +32 -0
- package/lib/table/InternalTable.js +395 -0
- package/lib/table/RcTable/VirtualTable.d.ts +2 -0
- package/lib/table/RcTable/VirtualTable.js +17 -0
- package/lib/table/RcTable/index.d.ts +2 -0
- package/lib/table/RcTable/index.js +17 -0
- package/lib/table/Table.d.ts +17 -0
- package/lib/table/Table.js +37 -0
- package/lib/table/TableMeasureRowContext.d.ts +3 -0
- package/lib/{_util/zindexContext.js → table/TableMeasureRowContext.js} +2 -5
- package/lib/table/hooks/useContainerWidth.d.ts +1 -0
- package/lib/table/hooks/useContainerWidth.js +20 -0
- package/lib/table/index.d.ts +7 -0
- package/lib/table/index.js +9 -0
- package/lib/table/interface.d.ts +196 -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.d.ts +2 -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.d.ts +14 -0
- package/lib/table/util.js +44 -0
- package/package.json +82 -66
- package/esm/_util/convertToTooltipProps.d.ts +0 -4
- package/esm/_util/convertToTooltipProps.js +0 -15
- package/esm/_util/hooks/useZIndex.d.ts +0 -8
- package/esm/_util/hooks/useZIndex.js +0 -51
- package/esm/_util/zindexContext.d.ts +0 -3
- package/esm/_util/zindexContext.js +0 -6
- package/lib/_util/convertToTooltipProps.d.ts +0 -4
- package/lib/_util/convertToTooltipProps.js +0 -21
- package/lib/_util/hooks/useZIndex.d.ts +0 -8
- package/lib/_util/hooks/useZIndex.js +0 -59
- package/lib/_util/zindexContext.d.ts +0 -3
package/lib/_util/warning.d.ts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export declare function noop(): void;
|
|
3
|
-
export declare function resetWarned(): void;
|
|
4
|
-
|
|
5
|
-
declare const warning: Warning;
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* - deprecated: Some API will be removed in future but still support now.
|
|
9
|
-
* - usage: Some API usage is not correct.
|
|
10
|
-
* - breaking: Breaking change like API is removed.
|
|
11
|
-
*/
|
|
12
|
-
type: 'deprecated' | 'usage' | 'breaking', message?: string) => void;
|
|
13
|
-
|
|
14
|
-
deprecated: (valid: boolean, oldProp: string, newProp: string, message?: string) => void;
|
|
15
|
-
};
|
|
16
|
-
export interface WarningContextProps {
|
|
17
|
-
/**
|
|
18
|
-
* @descCN 设置警告等级,设置 `false` 时会将废弃相关信息聚合为单条信息。
|
|
19
|
-
* @descEN Set the warning level. When set to `false`, discard related information will be aggregated into a single message.
|
|
20
|
-
* @since 5.10.0
|
|
21
|
-
*/
|
|
22
|
-
strict?: boolean;
|
|
23
|
-
}
|
|
24
|
-
export declare const WarningContext: React.Context<WarningContextProps>;
|
|
25
|
-
/**
|
|
26
|
-
* This is a hook but we not named as `useWarning`
|
|
27
|
-
* since this is only used in development.
|
|
28
|
-
* We should always wrap this in `if (process.env.NODE_ENV !== 'production')` condition
|
|
29
|
-
*/
|
|
30
|
-
export declare const devUseWarning: (component: string) => TypeWarning;
|
|
31
|
-
export default warning;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare function noop(): void;
|
|
3
|
+
export declare function resetWarned(): void;
|
|
4
|
+
type Warning = (valid: boolean, component: string, message?: string) => void;
|
|
5
|
+
declare const warning: Warning;
|
|
6
|
+
type BaseTypeWarning = (valid: boolean,
|
|
7
|
+
/**
|
|
8
|
+
* - deprecated: Some API will be removed in future but still support now.
|
|
9
|
+
* - usage: Some API usage is not correct.
|
|
10
|
+
* - breaking: Breaking change like API is removed.
|
|
11
|
+
*/
|
|
12
|
+
type: 'deprecated' | 'usage' | 'breaking', message?: string) => void;
|
|
13
|
+
type TypeWarning = BaseTypeWarning & {
|
|
14
|
+
deprecated: (valid: boolean, oldProp: string, newProp: string, message?: string) => void;
|
|
15
|
+
};
|
|
16
|
+
export interface WarningContextProps {
|
|
17
|
+
/**
|
|
18
|
+
* @descCN 设置警告等级,设置 `false` 时会将废弃相关信息聚合为单条信息。
|
|
19
|
+
* @descEN Set the warning level. When set to `false`, discard related information will be aggregated into a single message.
|
|
20
|
+
* @since 5.10.0
|
|
21
|
+
*/
|
|
22
|
+
strict?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare const WarningContext: React.Context<WarningContextProps>;
|
|
25
|
+
/**
|
|
26
|
+
* This is a hook but we not named as `useWarning`
|
|
27
|
+
* since this is only used in development.
|
|
28
|
+
* We should always wrap this in `if (process.env.NODE_ENV !== 'production')` condition
|
|
29
|
+
*/
|
|
30
|
+
export declare const devUseWarning: (component: string) => TypeWarning;
|
|
31
|
+
export default warning;
|
package/lib/_util/warning.js
CHANGED
|
@@ -7,14 +7,13 @@ exports.devUseWarning = exports.default = exports.WarningContext = void 0;
|
|
|
7
7
|
exports.noop = noop;
|
|
8
8
|
exports.resetWarned = resetWarned;
|
|
9
9
|
var React = _interopRequireWildcard(require("react"));
|
|
10
|
-
var
|
|
11
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
var _util = require("@rc-component/util");
|
|
12
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); }
|
|
13
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; }
|
|
14
13
|
function noop() {}
|
|
15
14
|
const {
|
|
16
15
|
resetWarned: rcResetWarned
|
|
17
|
-
} =
|
|
16
|
+
} = _util.warning;
|
|
18
17
|
let deprecatedWarnList = null;
|
|
19
18
|
function resetWarned() {
|
|
20
19
|
deprecatedWarnList = null;
|
|
@@ -23,7 +22,7 @@ function resetWarned() {
|
|
|
23
22
|
let _warning = noop;
|
|
24
23
|
if (process.env.NODE_ENV !== 'production') {
|
|
25
24
|
_warning = (valid, component, message) => {
|
|
26
|
-
(0,
|
|
25
|
+
(0, _util.warning)(valid, `[antd: ${component}] ${message}`);
|
|
27
26
|
|
|
28
27
|
// StrictMode will inject console which will not throw warning in React 17.
|
|
29
28
|
if (process.env.NODE_ENV === 'test') {
|
|
@@ -34,10 +33,10 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
34
33
|
const warning = _warning;
|
|
35
34
|
const WarningContext = exports.WarningContext = /*#__PURE__*/React.createContext({});
|
|
36
35
|
|
|
37
|
-
/**
|
|
38
|
-
* This is a hook but we not named as `useWarning`
|
|
39
|
-
* since this is only used in development.
|
|
40
|
-
* We should always wrap this in `if (process.env.NODE_ENV !== 'production')` condition
|
|
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
|
|
41
40
|
*/
|
|
42
41
|
const devUseWarning = exports.devUseWarning = process.env.NODE_ENV !== 'production' ? component => {
|
|
43
42
|
const {
|
|
@@ -1,48 +1,50 @@
|
|
|
1
|
-
import
|
|
2
|
-
import '
|
|
3
|
-
import
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
export interface IBlockHeaderProps
|
|
7
|
-
/**
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
|
|
32
|
-
/** 展示内容(children)
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import './style';
|
|
4
|
+
import type { SizeType } from 'antd/lib/config-provider/SizeContext';
|
|
5
|
+
import type { LabelTooltipType } from '../_util';
|
|
6
|
+
export interface IBlockHeaderProps {
|
|
7
|
+
/** id */
|
|
8
|
+
id?: string;
|
|
9
|
+
/** 标题 */
|
|
10
|
+
title: ReactNode;
|
|
11
|
+
/** 标题前的图标,默认是一个色块 */
|
|
12
|
+
addonBefore?: ReactNode;
|
|
13
|
+
/** 标题后的提示说明文字 */
|
|
14
|
+
description?: ReactNode;
|
|
15
|
+
/** 默认展示为问号的tooltip */
|
|
16
|
+
tooltip?: LabelTooltipType;
|
|
17
|
+
/** 后缀自定义内容块 */
|
|
18
|
+
addonAfter?: ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* 小标题 font-size: 12px; line-height: 32px
|
|
21
|
+
* 中标题 font-size: 14px; line-height: 40px
|
|
22
|
+
* 大标题 font-size: 16px; line-height: 40px
|
|
23
|
+
* 默认 中标题
|
|
24
|
+
*/
|
|
25
|
+
size?: SizeType;
|
|
26
|
+
/** 自定义 Bottom 值 */
|
|
27
|
+
spaceBottom?: number;
|
|
28
|
+
/** 标题一行的样式类名 */
|
|
29
|
+
className?: string;
|
|
30
|
+
/** 标题的样式类名 */
|
|
31
|
+
style?: React.CSSProperties;
|
|
32
|
+
/** 展示内容(children)的样式类名 */
|
|
33
|
+
contentClassName?: string;
|
|
34
|
+
/** 展示内容(children)的样式 */
|
|
35
|
+
contentStyle?: React.CSSProperties;
|
|
36
|
+
/** 是否显示背景, 默认 true */
|
|
37
|
+
background?: boolean;
|
|
38
|
+
/** 当前展开状态 */
|
|
39
|
+
expand?: boolean;
|
|
40
|
+
/** 是否默认展开内容, 默认为 undefined */
|
|
41
|
+
defaultExpand?: boolean;
|
|
42
|
+
/** 展开/收起的内容 */
|
|
43
|
+
children?: ReactNode;
|
|
44
|
+
/** 展开/收起时的回调 */
|
|
45
|
+
onExpand?: (expand: boolean) => void;
|
|
46
|
+
/** 标题的样式 */
|
|
47
|
+
titleStyle?: React.CSSProperties;
|
|
48
|
+
}
|
|
49
|
+
declare const BlockHeader: React.FC<IBlockHeaderProps>;
|
|
50
|
+
export default BlockHeader;
|
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,
|
|
@@ -41,8 +42,7 @@ const BlockHeader = function (props) {
|
|
|
41
42
|
className: "addon-before--default"
|
|
42
43
|
}),
|
|
43
44
|
onExpand,
|
|
44
|
-
titleStyle
|
|
45
|
-
...rest
|
|
45
|
+
titleStyle
|
|
46
46
|
} = props;
|
|
47
47
|
const [internalExpand, setInternalExpand] = (0, _react.useState)(defaultExpand);
|
|
48
48
|
const currentExpand = isControlled(props) ? expand : internalExpand;
|
|
@@ -50,7 +50,7 @@ const BlockHeader = function (props) {
|
|
|
50
50
|
// 只有在有了 children 并且设置了 expand/defaultExpand 的时候才能够展开收起
|
|
51
51
|
const showCollapse = (typeof expand === 'boolean' || typeof defaultExpand === 'boolean') && children;
|
|
52
52
|
const tooltipProps = (0, _util.toTooltipProps)(tooltip);
|
|
53
|
-
let bottomStyle;
|
|
53
|
+
let bottomStyle = {};
|
|
54
54
|
if (spaceBottom) bottomStyle = showCollapse && !currentExpand ? {
|
|
55
55
|
marginBottom: 0
|
|
56
56
|
} : {
|
|
@@ -62,13 +62,14 @@ const BlockHeader = function (props) {
|
|
|
62
62
|
onExpand?.(expand);
|
|
63
63
|
};
|
|
64
64
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
65
|
-
|
|
65
|
+
id: id,
|
|
66
|
+
className: (0, _clsx.default)(`${prefixCls}`, className),
|
|
66
67
|
style: {
|
|
67
68
|
...bottomStyle,
|
|
68
69
|
...style
|
|
69
70
|
}
|
|
70
71
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
71
|
-
className: (0,
|
|
72
|
+
className: (0, _clsx.default)(preTitleRowCls, `${preTitleRowCls}--${size}`, {
|
|
72
73
|
[`${preTitleRowCls}--background`]: background,
|
|
73
74
|
[`${preTitleRowCls}--pointer`]: showCollapse
|
|
74
75
|
}),
|
|
@@ -83,7 +84,7 @@ const BlockHeader = function (props) {
|
|
|
83
84
|
}, title), tooltipProps?.title ? /*#__PURE__*/_react.default.createElement("div", {
|
|
84
85
|
className: `title__tooltip`
|
|
85
86
|
}, /*#__PURE__*/_react.default.createElement(_antd.Tooltip, _extends({}, tooltipProps, {
|
|
86
|
-
className: (0,
|
|
87
|
+
className: (0, _clsx.default)(tooltipProps?.className)
|
|
87
88
|
}), /*#__PURE__*/_react.default.createElement(_icons.QuestionCircleOutlined, null))) : null, description ? /*#__PURE__*/_react.default.createElement("div", {
|
|
88
89
|
className: `title__description`
|
|
89
90
|
}, description) : null), addonAfter && /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -93,14 +94,14 @@ const BlockHeader = function (props) {
|
|
|
93
94
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
94
95
|
className: "collapse__text"
|
|
95
96
|
}, currentExpand ? '收起' : '展开'), /*#__PURE__*/_react.default.createElement(_icons.UpOutlined, {
|
|
96
|
-
className: (0,
|
|
97
|
+
className: (0, _clsx.default)('collapse__icon', {
|
|
97
98
|
'collapse__icon--up': currentExpand,
|
|
98
99
|
'collapse__icon--down': !currentExpand
|
|
99
100
|
})
|
|
100
|
-
}))), /*#__PURE__*/_react.default.createElement(_collapsible.default,
|
|
101
|
+
}))), /*#__PURE__*/_react.default.createElement(_collapsible.default, {
|
|
101
102
|
isOpen: !currentExpand
|
|
102
|
-
},
|
|
103
|
-
className: (0,
|
|
103
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
104
|
+
className: (0, _clsx.default)(`${prefixCls}__content`, contentClassName, {
|
|
104
105
|
[`${prefixCls}__content--active`]: currentExpand || !showCollapse
|
|
105
106
|
}),
|
|
106
107
|
style: contentStyle
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import '../../style';
|
|
2
|
-
import './index.less';
|
|
1
|
+
import '../../style';
|
|
2
|
+
import './index.less';
|
|
@@ -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.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ButtonProps as AntdButtonProps } from 'antd';
|
|
3
|
-
import { ButtonType as AntdButtonType } from 'antd/es/button';
|
|
4
|
-
import './style';
|
|
5
|
-
|
|
6
|
-
export interface ButtonProps extends Omit<AntdButtonProps, 'type'> {
|
|
7
|
-
type?: ButtonType;
|
|
8
|
-
}
|
|
9
|
-
declare const _default: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLElement>>;
|
|
10
|
-
export default _default;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ButtonProps as AntdButtonProps } from 'antd';
|
|
3
|
+
import type { ButtonType as AntdButtonType } from 'antd/es/button';
|
|
4
|
+
import './style';
|
|
5
|
+
type ButtonType = AntdButtonType | 'secondary' | 'tertiary';
|
|
6
|
+
export interface ButtonProps extends Omit<AntdButtonProps, 'type'> {
|
|
7
|
+
type?: ButtonType;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLElement>>;
|
|
10
|
+
export default _default;
|
package/lib/button/index.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _antd = require("antd");
|
|
9
|
-
var
|
|
9
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
10
10
|
require("./style");
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
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); }
|
|
@@ -17,7 +17,7 @@ function Button({
|
|
|
17
17
|
...rest
|
|
18
18
|
}) {
|
|
19
19
|
return /*#__PURE__*/_react.default.createElement(_antd.Button, _extends({
|
|
20
|
-
className: (0,
|
|
20
|
+
className: (0, _clsx.default)(className),
|
|
21
21
|
size: size,
|
|
22
22
|
type: type
|
|
23
23
|
}, rest));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import '../../style/index.less';
|
|
2
|
-
import './index.less';
|
|
1
|
+
import '../../style/index.less';
|
|
2
|
+
import './index.less';
|