@dtjoy/dt-design 1.0.7 → 1.0.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/esm/_util/easings.d.ts +1 -0
- package/esm/_util/extendsObject.d.ts +4 -0
- package/esm/_util/gapSize.d.ts +3 -0
- package/esm/_util/getScroll.d.ts +3 -0
- package/esm/_util/hooks/index.d.ts +4 -0
- package/esm/_util/hooks/useForceUpdate.d.ts +2 -0
- package/esm/_util/hooks/useOrientation.d.ts +2 -0
- package/esm/_util/hooks/useProxyImperativeHandle.d.ts +4 -0
- package/esm/_util/hooks/useSyncState.d.ts +3 -0
- package/esm/_util/index.d.ts +3 -0
- package/esm/_util/isNonNullable.d.ts +2 -0
- package/esm/_util/scrollTo.d.ts +10 -0
- package/esm/_util/type.d.ts +52 -0
- package/esm/_util/warning.d.ts +31 -0
- package/esm/blockHeader/index.d.ts +54 -0
- package/esm/blockHeader/index.js +6 -2
- package/esm/blockHeader/style/index.d.ts +2 -0
- package/esm/button/index.d.ts +10 -0
- package/esm/button/style/index.d.ts +2 -0
- package/esm/collapsible/index.d.ts +102 -0
- package/esm/collapsible/style/index.d.ts +1 -0
- package/esm/collapsibleActionItems/index.d.ts +24 -0
- package/esm/collapsibleActionItems/style/index.d.ts +2 -0
- package/esm/flex/index.d.ts +7 -0
- package/esm/flex/interface.d.ts +16 -0
- package/esm/flex/style/index.d.ts +2 -0
- package/esm/flex/utils.d.ts +7 -0
- package/esm/formList/index.d.ts +78 -0
- package/esm/formList/style/index.d.ts +2 -0
- package/esm/index.d.ts +17 -0
- package/esm/overflowList/index.d.ts +40 -0
- package/esm/overflowList/style/index.d.ts +2 -0
- package/esm/resize/index.d.ts +9 -0
- package/esm/resizeObserver/index.d.ts +45 -0
- package/esm/splitter/Panel.d.ts +7 -0
- package/esm/splitter/SplitBar.d.ts +24 -0
- package/esm/splitter/Splitter.d.ts +5 -0
- package/esm/splitter/hooks/sizeUtil.d.ts +3 -0
- package/esm/splitter/hooks/useItems.d.ts +14 -0
- package/esm/splitter/hooks/useResizable.d.ts +10 -0
- package/esm/splitter/hooks/useResize.d.ts +6 -0
- package/esm/splitter/hooks/useSizes.d.ts +4 -0
- package/esm/splitter/index.d.ts +8 -0
- package/esm/splitter/interface.d.ts +69 -0
- package/esm/splitter/style/index.d.ts +2 -0
- package/esm/statusTag/index.d.ts +29 -0
- package/esm/statusTag/style/index.d.ts +2 -0
- package/esm/style/index.d.ts +1 -0
- package/esm/table/InternalTable.d.ts +32 -0
- package/esm/table/RcTable/VirtualTable.d.ts +2 -0
- package/esm/table/RcTable/index.d.ts +2 -0
- package/esm/table/Table.d.ts +17 -0
- package/esm/table/TableMeasureRowContext.d.ts +3 -0
- package/esm/table/hooks/useContainerWidth.d.ts +1 -0
- package/esm/table/index.d.ts +7 -0
- package/esm/table/interface.d.ts +196 -0
- package/esm/table/style/index.d.ts +2 -0
- package/esm/table/util.d.ts +14 -0
- package/lib/_util/easings.d.ts +1 -0
- package/lib/_util/extendsObject.d.ts +4 -0
- package/lib/_util/gapSize.d.ts +3 -0
- package/lib/_util/getScroll.d.ts +3 -0
- package/lib/_util/hooks/index.d.ts +4 -0
- package/lib/_util/hooks/useForceUpdate.d.ts +2 -0
- package/lib/_util/hooks/useOrientation.d.ts +2 -0
- package/lib/_util/hooks/useProxyImperativeHandle.d.ts +4 -0
- package/lib/_util/hooks/useSyncState.d.ts +3 -0
- package/lib/_util/index.d.ts +3 -0
- package/lib/_util/isNonNullable.d.ts +2 -0
- package/lib/_util/scrollTo.d.ts +10 -0
- package/lib/_util/type.d.ts +52 -0
- package/lib/_util/warning.d.ts +31 -0
- package/lib/blockHeader/index.d.ts +54 -0
- package/lib/blockHeader/index.js +6 -2
- package/lib/blockHeader/style/index.d.ts +2 -0
- package/lib/button/index.d.ts +10 -0
- package/lib/button/style/index.d.ts +2 -0
- package/lib/collapsible/index.d.ts +102 -0
- package/lib/collapsible/style/index.d.ts +1 -0
- package/lib/collapsibleActionItems/index.d.ts +24 -0
- package/lib/collapsibleActionItems/style/index.d.ts +2 -0
- package/lib/flex/index.d.ts +7 -0
- package/lib/flex/interface.d.ts +16 -0
- package/lib/flex/style/index.d.ts +2 -0
- package/lib/flex/utils.d.ts +7 -0
- package/lib/formList/index.d.ts +78 -0
- package/lib/formList/style/index.d.ts +2 -0
- package/lib/index.d.ts +17 -0
- package/lib/overflowList/index.d.ts +40 -0
- package/lib/overflowList/style/index.d.ts +2 -0
- package/lib/resize/index.d.ts +9 -0
- package/lib/resizeObserver/index.d.ts +45 -0
- package/lib/splitter/Panel.d.ts +7 -0
- package/lib/splitter/SplitBar.d.ts +24 -0
- package/lib/splitter/Splitter.d.ts +5 -0
- package/lib/splitter/hooks/sizeUtil.d.ts +3 -0
- package/lib/splitter/hooks/useItems.d.ts +14 -0
- package/lib/splitter/hooks/useResizable.d.ts +10 -0
- package/lib/splitter/hooks/useResize.d.ts +6 -0
- package/lib/splitter/hooks/useSizes.d.ts +4 -0
- package/lib/splitter/index.d.ts +8 -0
- package/lib/splitter/interface.d.ts +69 -0
- package/lib/splitter/style/index.d.ts +2 -0
- package/lib/statusTag/index.d.ts +29 -0
- package/lib/statusTag/style/index.d.ts +2 -0
- package/lib/style/index.d.ts +1 -0
- package/lib/table/InternalTable.d.ts +32 -0
- package/lib/table/RcTable/VirtualTable.d.ts +2 -0
- package/lib/table/RcTable/index.d.ts +2 -0
- package/lib/table/Table.d.ts +17 -0
- package/lib/table/TableMeasureRowContext.d.ts +3 -0
- package/lib/table/hooks/useContainerWidth.d.ts +1 -0
- package/lib/table/index.d.ts +7 -0
- package/lib/table/interface.d.ts +196 -0
- package/lib/table/style/index.d.ts +2 -0
- package/lib/table/util.d.ts +14 -0
- package/package.json +1 -1
|
@@ -0,0 +1,54 @@
|
|
|
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
|
+
/** 是否保留 DOM 结构, 默认 false */
|
|
49
|
+
keepDOM?: boolean;
|
|
50
|
+
/** 是否懒加载, 默认 false */
|
|
51
|
+
lazy?: boolean;
|
|
52
|
+
}
|
|
53
|
+
declare const BlockHeader: React.FC<IBlockHeaderProps>;
|
|
54
|
+
export default BlockHeader;
|
package/lib/blockHeader/index.js
CHANGED
|
@@ -42,7 +42,9 @@ const BlockHeader = props => {
|
|
|
42
42
|
className: "addon-before--default"
|
|
43
43
|
}),
|
|
44
44
|
onExpand,
|
|
45
|
-
titleStyle
|
|
45
|
+
titleStyle,
|
|
46
|
+
keepDOM,
|
|
47
|
+
lazy
|
|
46
48
|
} = props;
|
|
47
49
|
const [internalExpand, setInternalExpand] = (0, _react.useState)(defaultExpand);
|
|
48
50
|
const currentExpand = isControlled(props) ? expand : internalExpand;
|
|
@@ -99,7 +101,9 @@ const BlockHeader = props => {
|
|
|
99
101
|
'collapse__icon--down': !currentExpand
|
|
100
102
|
})
|
|
101
103
|
}))), /*#__PURE__*/_react.default.createElement(_collapsible.default, {
|
|
102
|
-
isOpen: !currentExpand
|
|
104
|
+
isOpen: !currentExpand,
|
|
105
|
+
keepDOM: keepDOM,
|
|
106
|
+
lazyRender: lazy
|
|
103
107
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
104
108
|
className: (0, _clsx.default)(`${prefixCls}__content`, contentClassName, {
|
|
105
109
|
[`${prefixCls}__content--active`]: currentExpand || !showCollapse
|
|
@@ -0,0 +1,10 @@
|
|
|
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;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './style';
|
|
3
|
+
import type { ConfigConsumerProps } from 'antd/lib/config-provider';
|
|
4
|
+
interface BaseComponentProps {
|
|
5
|
+
/**
|
|
6
|
+
* 类名
|
|
7
|
+
*/
|
|
8
|
+
className?: string;
|
|
9
|
+
/**
|
|
10
|
+
* 样式
|
|
11
|
+
*/
|
|
12
|
+
style?: React.CSSProperties;
|
|
13
|
+
/**
|
|
14
|
+
* id
|
|
15
|
+
*/
|
|
16
|
+
id?: string;
|
|
17
|
+
'data-*'?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface CollapsibleProps extends BaseComponentProps {
|
|
20
|
+
/**
|
|
21
|
+
* 是否开启动画
|
|
22
|
+
*/
|
|
23
|
+
motion?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* 子元素
|
|
26
|
+
*/
|
|
27
|
+
children?: React.ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* 是否展开内容区域
|
|
30
|
+
*/
|
|
31
|
+
isOpen?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* 动画执行的时间
|
|
34
|
+
*/
|
|
35
|
+
duration?: number;
|
|
36
|
+
/**
|
|
37
|
+
* 是否保留隐藏的面板 DOM 树,默认销毁
|
|
38
|
+
*/
|
|
39
|
+
keepDOM?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* 配合 keepDOM 使用,为 true 时挂载时不会渲染组件
|
|
42
|
+
*/
|
|
43
|
+
lazyRender?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* 折叠高度
|
|
46
|
+
*/
|
|
47
|
+
collapseHeight?: number;
|
|
48
|
+
/**
|
|
49
|
+
* 当 reCalcKey 改变时,将重新计算子节点的高度,用于优化动态渲染时的计算
|
|
50
|
+
*/
|
|
51
|
+
reCalcKey?: number | string;
|
|
52
|
+
/**
|
|
53
|
+
* 动画结束的回调
|
|
54
|
+
*/
|
|
55
|
+
onMotionEnd?: () => void;
|
|
56
|
+
/**
|
|
57
|
+
* 是否开启淡入淡出
|
|
58
|
+
*/
|
|
59
|
+
fade?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* 样式前缀
|
|
62
|
+
*/
|
|
63
|
+
prefixCls?: string;
|
|
64
|
+
}
|
|
65
|
+
interface CollapsibleState {
|
|
66
|
+
domInRenderTree: boolean;
|
|
67
|
+
domHeight: number;
|
|
68
|
+
visible: boolean;
|
|
69
|
+
isTransitioning: boolean;
|
|
70
|
+
cacheIsOpen: boolean;
|
|
71
|
+
}
|
|
72
|
+
declare class Collapsible extends React.Component<CollapsibleProps, CollapsibleState> {
|
|
73
|
+
static defaultProps: {
|
|
74
|
+
isOpen: boolean;
|
|
75
|
+
duration: number;
|
|
76
|
+
motion: boolean;
|
|
77
|
+
keepDOM: boolean;
|
|
78
|
+
lazyRender: boolean;
|
|
79
|
+
collapseHeight: number;
|
|
80
|
+
fade: boolean;
|
|
81
|
+
};
|
|
82
|
+
static displayName: string;
|
|
83
|
+
foundation: any;
|
|
84
|
+
private domRef;
|
|
85
|
+
private resizeObserver;
|
|
86
|
+
private hasBeenRendered;
|
|
87
|
+
constructor(props: CollapsibleProps);
|
|
88
|
+
static getEntryInfo: (entry: ResizeObserverEntry) => {
|
|
89
|
+
isShown: boolean;
|
|
90
|
+
height: number;
|
|
91
|
+
};
|
|
92
|
+
static getDerivedStateFromProps(props: CollapsibleProps, prevState: CollapsibleState): Partial<CollapsibleState>;
|
|
93
|
+
componentDidMount(): void;
|
|
94
|
+
componentDidUpdate(prevProps: Readonly<CollapsibleProps>, prevState: Readonly<CollapsibleState>): void;
|
|
95
|
+
componentWillUnmount(): void;
|
|
96
|
+
renderCollapsible: ({ getPrefixCls }: ConfigConsumerProps) => React.JSX.Element;
|
|
97
|
+
render(): React.JSX.Element;
|
|
98
|
+
private handleResize;
|
|
99
|
+
private isChildrenInRenderTree;
|
|
100
|
+
private getDataAttr;
|
|
101
|
+
}
|
|
102
|
+
export default Collapsible;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './index.less';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { ButtonProps } from "..";
|
|
4
|
+
import type { DropDownProps } from 'antd';
|
|
5
|
+
import './style';
|
|
6
|
+
export type ActionItem = {
|
|
7
|
+
key: React.Key;
|
|
8
|
+
name: ReactNode;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
render?: () => ReactNode;
|
|
11
|
+
};
|
|
12
|
+
interface ICollapsibleActionItems {
|
|
13
|
+
maxCount?: number;
|
|
14
|
+
actionItems: ActionItem[];
|
|
15
|
+
className?: string;
|
|
16
|
+
divider?: ReactNode;
|
|
17
|
+
collapseIcon?: ReactNode;
|
|
18
|
+
dropdownProps?: Partial<DropDownProps>;
|
|
19
|
+
buttonProps?: Partial<ButtonProps>;
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
onItemClick?: (key: React.Key) => void;
|
|
22
|
+
}
|
|
23
|
+
declare const CollapsibleActionItems: React.FC<ICollapsibleActionItems>;
|
|
24
|
+
export default CollapsibleActionItems;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './style';
|
|
3
|
+
import type { FlexProps } from './interface';
|
|
4
|
+
declare const Flex: React.ForwardRefExoticComponent<FlexProps<import("../_util/type").AnyObject> & {
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
} & React.RefAttributes<HTMLElement>>;
|
|
7
|
+
export default Flex;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { SizeType } from 'antd/lib/config-provider/SizeContext';
|
|
3
|
+
import type { Orientation } from '../_util/hooks';
|
|
4
|
+
import type { AnyObject, CustomComponent, LiteralUnion } from '../_util/type';
|
|
5
|
+
export interface FlexProps<P = AnyObject> extends React.HTMLAttributes<HTMLElement> {
|
|
6
|
+
prefixCls?: string;
|
|
7
|
+
rootClassName?: string;
|
|
8
|
+
vertical?: boolean;
|
|
9
|
+
orientation?: Orientation;
|
|
10
|
+
wrap?: boolean | React.CSSProperties['flexWrap'];
|
|
11
|
+
justify?: React.CSSProperties['justifyContent'];
|
|
12
|
+
align?: React.CSSProperties['alignItems'];
|
|
13
|
+
flex?: React.CSSProperties['flex'];
|
|
14
|
+
gap?: LiteralUnion<SizeType, React.CSSProperties['gap']>;
|
|
15
|
+
component?: CustomComponent<P>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { FlexProps } from './interface';
|
|
3
|
+
export declare const flexWrapValues: React.CSSProperties['flexWrap'][];
|
|
4
|
+
export declare const justifyContentValues: React.CSSProperties['justifyContent'][];
|
|
5
|
+
export declare const alignItemsValues: React.CSSProperties['alignItems'][];
|
|
6
|
+
declare const createFlexClassNames: (prefixCls: string, props: FlexProps) => string;
|
|
7
|
+
export default createFlexClassNames;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { FormListFieldData, TableProps } from 'antd';
|
|
4
|
+
import type { FormItemProps, FormListProps, RuleObject, RuleRender } from 'antd/lib/form';
|
|
5
|
+
import type { ColumnType as TableColumnType } from 'antd/lib/table';
|
|
6
|
+
import './style';
|
|
7
|
+
type NotNullRowSelection = NonNullable<TableProps<any>['rowSelection']>;
|
|
8
|
+
/**
|
|
9
|
+
* Override NamePath parameters type
|
|
10
|
+
*/
|
|
11
|
+
type OverrideParameters = (string | number)[];
|
|
12
|
+
type RcFormInstance = Parameters<RuleRender>[0];
|
|
13
|
+
type RawPanelRender = NonNullable<TableProps<any>['footer']>;
|
|
14
|
+
/**
|
|
15
|
+
* Override PanelRender type
|
|
16
|
+
*/
|
|
17
|
+
type PanelRenderFunc = (...args: Parameters<FormListProps['children']>) => ReturnType<RawPanelRender>;
|
|
18
|
+
/**
|
|
19
|
+
* Form.Table 组件类型
|
|
20
|
+
*/
|
|
21
|
+
export interface IFormTableProps
|
|
22
|
+
/**
|
|
23
|
+
* Support all FormListProps except children for which is re-defined in this component
|
|
24
|
+
* and prefixCls for which is not expected to be supported
|
|
25
|
+
*/
|
|
26
|
+
extends Pick<FormListProps, 'name' | 'rules' | 'initialValue'>,
|
|
27
|
+
/**
|
|
28
|
+
* Support all TableProps except
|
|
29
|
+
* - re-define columns and re-defined rowSelection
|
|
30
|
+
* - and pagination which is expect to be not supported in Form.Table
|
|
31
|
+
* - and className which is renamed to tableClassName
|
|
32
|
+
* - and rowKey, dataSource for which are defined and not allowed to be modified
|
|
33
|
+
* - and footer, title, summary for which are re-defined to pass form's operation
|
|
34
|
+
*/
|
|
35
|
+
Omit<TableProps<any>, 'columns' | 'rowSelection' | 'pagination' | 'className' | 'rowKey' | 'dataSource' | 'footer' | 'title' | 'summary'> {
|
|
36
|
+
/**
|
|
37
|
+
* 表格列的配置描述
|
|
38
|
+
*/
|
|
39
|
+
columns?: ColumnType[] | ((...args: Parameters<FormListProps['children']>) => ColumnType[]);
|
|
40
|
+
/**
|
|
41
|
+
* Table 的 className
|
|
42
|
+
*/
|
|
43
|
+
tableClassName?: TableProps<any>['className'];
|
|
44
|
+
/**
|
|
45
|
+
* 表格行是否可选择
|
|
46
|
+
*/
|
|
47
|
+
rowSelection?: Omit<NotNullRowSelection, 'getCheckboxProps'> & {
|
|
48
|
+
getCheckboxProps?: (field: FormListFieldData) => ReturnType<NonNullable<NotNullRowSelection['getCheckboxProps']>>;
|
|
49
|
+
};
|
|
50
|
+
title?: PanelRenderFunc;
|
|
51
|
+
footer?: PanelRenderFunc;
|
|
52
|
+
summary?: PanelRenderFunc;
|
|
53
|
+
}
|
|
54
|
+
export interface ColumnType
|
|
55
|
+
/**
|
|
56
|
+
* Support all FormItemProps, and re-defined `rules` and `dependencies`
|
|
57
|
+
*/
|
|
58
|
+
extends Omit<FormItemProps, 'rules' | 'dependencies' | 'prefixCls' | 'children'>,
|
|
59
|
+
/**
|
|
60
|
+
* Support all TableColumnType, and re-defined `render`
|
|
61
|
+
*/
|
|
62
|
+
Omit<TableColumnType<FormListFieldData>, 'render'> {
|
|
63
|
+
/**
|
|
64
|
+
* 设置依赖字段, 支持通过回调函数获取当前字段名
|
|
65
|
+
*/
|
|
66
|
+
dependencies?: ((namePath: OverrideParameters) => FormItemProps['dependencies']) | FormItemProps['dependencies'];
|
|
67
|
+
/**
|
|
68
|
+
* 校验规则,设置字段的校验逻辑,支持通过回调函数获取当前字段名
|
|
69
|
+
*/
|
|
70
|
+
rules?: (RuleObject | ((form: RcFormInstance, namePath: OverrideParameters) => RuleObject))[];
|
|
71
|
+
/**
|
|
72
|
+
* 渲染函数
|
|
73
|
+
* @param formInstance 只有在设置了 `dependencies` 的情况下才有该参数
|
|
74
|
+
*/
|
|
75
|
+
render?: (fieldData: FormListFieldData, namePath: OverrideParameters, formInstance?: RcFormInstance) => ReactNode;
|
|
76
|
+
}
|
|
77
|
+
export default function InternalTable({ name, rules, initialValue, ...tableProps }: IFormTableProps): React.JSX.Element;
|
|
78
|
+
export {};
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { default as BlockHeader } from './blockHeader';
|
|
2
|
+
export type { ButtonProps } from './button';
|
|
3
|
+
export { default as Button } from './button';
|
|
4
|
+
export { default as Collapsible } from './collapsible';
|
|
5
|
+
export { default as CollapsibleActionItems } from './collapsibleActionItems';
|
|
6
|
+
export { default as Flex } from './flex';
|
|
7
|
+
export type { FlexProps } from './flex/interface';
|
|
8
|
+
export { default as FormList } from './formList';
|
|
9
|
+
export * from './formList';
|
|
10
|
+
export { default as OverflowList } from './overflowList';
|
|
11
|
+
export { default as Resize } from './resize';
|
|
12
|
+
export { default as Splitter } from './splitter';
|
|
13
|
+
export * from './splitter';
|
|
14
|
+
export { default as StatusTag } from './statusTag';
|
|
15
|
+
export * from './statusTag';
|
|
16
|
+
export { default as Table } from './table';
|
|
17
|
+
export type { ColumnGroupType as TableColumnGroupType, ColumnProps as TableColumnProps, ColumnsType as TableColumnsType, ColumnType as TableColumnType, TablePaginationConfig, TableProps, } from './table';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import React, { Component } from 'react';
|
|
3
|
+
import './style';
|
|
4
|
+
export type OverflowItem<T = Record<string, any>> = T;
|
|
5
|
+
export interface OverflowListProps<T = Record<string, any>> {
|
|
6
|
+
items: OverflowItem<T>[];
|
|
7
|
+
visibleItemRenderer: (item: OverflowItem<T>, index: number) => ReactElement;
|
|
8
|
+
overflowRenderer: (overflowItems: OverflowItem<T>[]) => ReactNode | ReactNode[];
|
|
9
|
+
className?: string;
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
renderMode?: 'collapse' | 'scroll';
|
|
12
|
+
collapseFrom?: 'start' | 'end';
|
|
13
|
+
minVisibleItems?: number;
|
|
14
|
+
onOverflow?: (overflowItems: OverflowItem<T>[]) => void;
|
|
15
|
+
}
|
|
16
|
+
interface OverflowListState {
|
|
17
|
+
visibleCount: number;
|
|
18
|
+
isMeasuring: boolean;
|
|
19
|
+
}
|
|
20
|
+
declare class OverflowList<T extends object> extends Component<OverflowListProps<T>, OverflowListState> {
|
|
21
|
+
static defaultProps: {
|
|
22
|
+
items: never[];
|
|
23
|
+
collapseFrom: string;
|
|
24
|
+
minVisibleItems: number;
|
|
25
|
+
renderMode: string;
|
|
26
|
+
};
|
|
27
|
+
static displayName: string;
|
|
28
|
+
private containerRef;
|
|
29
|
+
private overflowRef;
|
|
30
|
+
private itemRefs;
|
|
31
|
+
private prefixCls;
|
|
32
|
+
constructor(props: OverflowListProps<T>);
|
|
33
|
+
componentDidMount(): void;
|
|
34
|
+
componentUpdate(prevProps: OverflowListProps<T>): void;
|
|
35
|
+
private measureAndAdjust;
|
|
36
|
+
private getOverflowItems;
|
|
37
|
+
renderCollapse(): React.JSX.Element;
|
|
38
|
+
render(): React.JSX.Element;
|
|
39
|
+
}
|
|
40
|
+
export default OverflowList;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface BaseProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
style?: React.CSSProperties;
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}
|
|
7
|
+
export interface ResizeEntry {
|
|
8
|
+
contentRect: DOMRectReadOnly;
|
|
9
|
+
target: Element;
|
|
10
|
+
}
|
|
11
|
+
export interface ReactResizeObserverProps extends BaseProps {
|
|
12
|
+
onResize?: (entries: ResizeEntry[]) => void;
|
|
13
|
+
observeParent?: boolean;
|
|
14
|
+
observerProperty?: ObserverProperty;
|
|
15
|
+
delayTick?: number;
|
|
16
|
+
children: React.ReactElement;
|
|
17
|
+
}
|
|
18
|
+
export declare enum ObserverProperty {
|
|
19
|
+
Width = "width",
|
|
20
|
+
Height = "height",
|
|
21
|
+
All = "all"
|
|
22
|
+
}
|
|
23
|
+
export default class ReactResizeObserver extends React.Component<ReactResizeObserverProps> {
|
|
24
|
+
static defaultProps: {
|
|
25
|
+
onResize: () => void;
|
|
26
|
+
observeParent: boolean;
|
|
27
|
+
observerProperty: ObserverProperty;
|
|
28
|
+
delayTick: number;
|
|
29
|
+
};
|
|
30
|
+
observer: ResizeObserver | null;
|
|
31
|
+
childNode: HTMLElement | null;
|
|
32
|
+
element: Element | null;
|
|
33
|
+
_parentNode: HTMLElement | null;
|
|
34
|
+
formerPropertyValue: Map<Element, number>;
|
|
35
|
+
constructor(props: ReactResizeObserverProps);
|
|
36
|
+
getElement: () => Element | null;
|
|
37
|
+
handleResizeEventTriggered: (entries: ResizeEntry[]) => void;
|
|
38
|
+
observeElement: (force?: boolean) => void;
|
|
39
|
+
mergeRef: (ref: React.Ref<any>, node: HTMLElement) => void;
|
|
40
|
+
componentDidMount(): void;
|
|
41
|
+
componentDidUpdate(prevProps: ReactResizeObserverProps): void;
|
|
42
|
+
componentWillUnmount(): void;
|
|
43
|
+
render(): React.ReactElement;
|
|
44
|
+
}
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { InternalPanelProps, PanelProps } from './interface';
|
|
3
|
+
export declare const InternalPanel: React.ForwardRefExoticComponent<InternalPanelProps & {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const Panel: React.FC<React.PropsWithChildren<PanelProps>>;
|
|
7
|
+
export default Panel;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type ShowCollapsibleIconMode = boolean | 'auto';
|
|
3
|
+
export interface SplitBarProps {
|
|
4
|
+
index: number;
|
|
5
|
+
active: boolean;
|
|
6
|
+
prefixCls: string;
|
|
7
|
+
resizable: boolean;
|
|
8
|
+
startCollapsible: boolean;
|
|
9
|
+
endCollapsible: boolean;
|
|
10
|
+
showStartCollapsibleIcon: ShowCollapsibleIconMode;
|
|
11
|
+
showEndCollapsibleIcon: ShowCollapsibleIconMode;
|
|
12
|
+
onOffsetStart: (index: number) => void;
|
|
13
|
+
onOffsetUpdate: (index: number, offsetX: number, offsetY: number, lazyEnd?: boolean) => void;
|
|
14
|
+
onOffsetEnd: (lazyEnd?: boolean) => void;
|
|
15
|
+
onCollapse: (index: number, type: 'start' | 'end') => void;
|
|
16
|
+
vertical: boolean;
|
|
17
|
+
ariaNow: number;
|
|
18
|
+
ariaMin: number;
|
|
19
|
+
ariaMax: number;
|
|
20
|
+
lazy?: boolean;
|
|
21
|
+
containerSize: number;
|
|
22
|
+
}
|
|
23
|
+
declare const SplitBar: React.FC<SplitBarProps>;
|
|
24
|
+
export default SplitBar;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { PanelProps } from '../interface';
|
|
3
|
+
export type ItemType = Omit<PanelProps, 'collapsible'> & {
|
|
4
|
+
collapsible: {
|
|
5
|
+
start?: boolean;
|
|
6
|
+
end?: boolean;
|
|
7
|
+
showCollapsibleIcon: 'auto' | boolean;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Convert `children` into `items`.
|
|
12
|
+
*/
|
|
13
|
+
declare function useItems(children: React.ReactNode): ItemType[];
|
|
14
|
+
export default useItems;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ShowCollapsibleIconMode } from '../SplitBar';
|
|
2
|
+
import type { ItemType } from './useItems';
|
|
3
|
+
export type ResizableInfo = {
|
|
4
|
+
resizable: boolean;
|
|
5
|
+
startCollapsible: boolean;
|
|
6
|
+
endCollapsible: boolean;
|
|
7
|
+
showStartCollapsibleIcon: ShowCollapsibleIconMode;
|
|
8
|
+
showEndCollapsibleIcon: ShowCollapsibleIconMode;
|
|
9
|
+
};
|
|
10
|
+
export default function useResizable(items: ItemType[], pxSizes: number[], isRTL: boolean): ResizableInfo[];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ItemType } from './useItems';
|
|
2
|
+
import type { ResizableInfo } from './useResizable';
|
|
3
|
+
/**
|
|
4
|
+
* Handle user drag resize logic.
|
|
5
|
+
*/
|
|
6
|
+
export default function useResize(items: ItemType[], resizableInfos: ResizableInfo[], percentSizes: number[], containerSize: number | undefined, updateSizes: (sizes: number[]) => void, isRTL: boolean): readonly [(index: number) => void, (index: number, offset: number) => number[], () => void, (index: number, type: 'start' | 'end') => number[], number | undefined];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PanelProps } from '../interface';
|
|
3
|
+
export declare function getPtg(str: string): number;
|
|
4
|
+
export default function useSizes(items: PanelProps[], containerSize?: number): readonly [(string | number | undefined)[], number[], number[], number[], number[], React.Dispatch<React.SetStateAction<(string | number | undefined)[]>>];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import Panel from './Panel';
|
|
2
|
+
import SplitterComp from './Splitter';
|
|
3
|
+
export type { SplitterProps } from './interface';
|
|
4
|
+
type CompoundedComponent = typeof SplitterComp & {
|
|
5
|
+
Panel: typeof Panel;
|
|
6
|
+
};
|
|
7
|
+
declare const Splitter: CompoundedComponent;
|
|
8
|
+
export default Splitter;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ShowCollapsibleIconMode } from './SplitBar';
|
|
3
|
+
export interface SplitterProps {
|
|
4
|
+
prefixCls?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
style?: React.CSSProperties;
|
|
7
|
+
rootClassName?: string;
|
|
8
|
+
layout?: 'horizontal' | 'vertical';
|
|
9
|
+
onResizeStart?: (sizes: number[]) => void;
|
|
10
|
+
onResize?: (sizes: number[]) => void;
|
|
11
|
+
onResizeEnd?: (sizes: number[]) => void;
|
|
12
|
+
onCollapse?: (collapsed: boolean[], sizes: number[]) => void;
|
|
13
|
+
lazy?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface PanelProps {
|
|
16
|
+
className?: string;
|
|
17
|
+
style?: React.CSSProperties;
|
|
18
|
+
min?: number | string;
|
|
19
|
+
max?: number | string;
|
|
20
|
+
size?: number | string;
|
|
21
|
+
collapsible?: boolean | {
|
|
22
|
+
start?: boolean;
|
|
23
|
+
end?: boolean;
|
|
24
|
+
showCollapsibleIcon?: ShowCollapsibleIconMode;
|
|
25
|
+
};
|
|
26
|
+
resizable?: boolean;
|
|
27
|
+
defaultSize?: number | string;
|
|
28
|
+
}
|
|
29
|
+
export interface InternalPanelProps extends PanelProps {
|
|
30
|
+
className?: string;
|
|
31
|
+
prefixCls?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface UseResizeProps extends Pick<SplitterProps, 'onResize'> {
|
|
34
|
+
basicsState: number[];
|
|
35
|
+
items: PanelProps[];
|
|
36
|
+
panelsRef: React.RefObject<(HTMLDivElement | null)[]>;
|
|
37
|
+
reverse: boolean;
|
|
38
|
+
setBasicsState: React.Dispatch<React.SetStateAction<number[]>>;
|
|
39
|
+
}
|
|
40
|
+
export interface UseResize {
|
|
41
|
+
setSize: (data: {
|
|
42
|
+
size: number;
|
|
43
|
+
index: number;
|
|
44
|
+
}[]) => void;
|
|
45
|
+
setOffset: (offset: number, containerSize: number, index: number) => void;
|
|
46
|
+
}
|
|
47
|
+
export interface UseHandleProps extends Pick<SplitterProps, 'layout' | 'onResizeStart' | 'onResizeEnd'> {
|
|
48
|
+
basicsState: number[];
|
|
49
|
+
containerRef?: React.RefObject<HTMLDivElement | null>;
|
|
50
|
+
setOffset: UseResize['setOffset'];
|
|
51
|
+
setResizing: React.Dispatch<React.SetStateAction<boolean>>;
|
|
52
|
+
}
|
|
53
|
+
export interface UseHandle {
|
|
54
|
+
onStart: (x: number, y: number, index: number) => void;
|
|
55
|
+
}
|
|
56
|
+
export interface UseCollapsibleProps {
|
|
57
|
+
basicsState: number[];
|
|
58
|
+
collapsible?: PanelProps['collapsible'];
|
|
59
|
+
index: number;
|
|
60
|
+
reverse: boolean;
|
|
61
|
+
setSize?: UseResize['setSize'];
|
|
62
|
+
}
|
|
63
|
+
export interface UseCollapsible {
|
|
64
|
+
nextIcon: boolean;
|
|
65
|
+
overlap: boolean;
|
|
66
|
+
previousIcon: boolean;
|
|
67
|
+
onFold: (type: 'previous' | 'next') => void;
|
|
68
|
+
setOldBasics: () => void;
|
|
69
|
+
}
|