@dtjoy/dt-design 1.0.6 → 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.
Files changed (188) hide show
  1. package/esm/_util/easings.js +9 -0
  2. package/esm/_util/extendsObject.js +17 -0
  3. package/esm/_util/getScroll.js +32 -0
  4. package/esm/_util/hooks/index.js +4 -1
  5. package/esm/_util/hooks/useForceUpdate.js +6 -0
  6. package/esm/_util/hooks/useProxyImperativeHandle.js +31 -0
  7. package/esm/_util/hooks/useSyncState.js +20 -0
  8. package/esm/_util/scrollTo.js +38 -0
  9. package/esm/_util/warning.js +5 -5
  10. package/esm/blockHeader/index.js +13 -15
  11. package/esm/blockHeader/style/index.less +143 -143
  12. package/esm/button/index.js +2 -2
  13. package/esm/collapsible/index.js +53 -55
  14. package/esm/collapsibleActionItems/index.js +2 -2
  15. package/esm/flex/index.js +1 -1
  16. package/esm/flex/style/index.less +76 -76
  17. package/esm/flex/utils.js +1 -1
  18. package/esm/formList/index.js +13 -11
  19. package/esm/formList/style/index.less +45 -45
  20. package/esm/index.js +3 -1
  21. package/esm/overflowList/index.js +4 -3
  22. package/esm/resize/index.js +1 -1
  23. package/esm/resizeObserver/index.js +3 -2
  24. package/esm/splitter/Panel.js +3 -3
  25. package/esm/splitter/SplitBar.js +8 -7
  26. package/esm/splitter/Splitter.js +5 -4
  27. package/esm/splitter/hooks/useItems.js +2 -2
  28. package/esm/splitter/hooks/useResize.js +5 -5
  29. package/esm/statusTag/index.js +8 -8
  30. package/esm/style/index.less +1 -1
  31. package/esm/style/themes/index.less +2 -2
  32. package/esm/style/themes/variable.less +4 -0
  33. package/esm/table/InternalTable.js +429 -0
  34. package/esm/table/RcTable/VirtualTable.js +9 -0
  35. package/esm/table/RcTable/index.js +9 -0
  36. package/esm/table/Table.js +28 -0
  37. package/esm/table/TableMeasureRowContext.js +3 -0
  38. package/esm/table/hooks/useContainerWidth.js +14 -0
  39. package/esm/table/index.js +2 -0
  40. package/esm/table/interface.js +4 -0
  41. package/esm/table/style/bordered.less +141 -0
  42. package/esm/table/style/fixed.less +88 -0
  43. package/esm/table/style/index.js +2 -0
  44. package/esm/table/style/index.less +150 -0
  45. package/esm/table/style/selection.less +90 -0
  46. package/esm/table/style/sticky.less +55 -0
  47. package/esm/table/style/virtual.less +65 -0
  48. package/esm/table/util.js +33 -0
  49. package/lib/_util/easings.js +15 -0
  50. package/lib/_util/extendsObject.js +20 -0
  51. package/lib/_util/getScroll.js +39 -0
  52. package/lib/_util/hooks/index.js +33 -0
  53. package/lib/_util/hooks/useForceUpdate.js +12 -0
  54. package/lib/_util/hooks/useProxyImperativeHandle.js +40 -0
  55. package/lib/_util/hooks/useSyncState.js +19 -0
  56. package/lib/_util/scrollTo.js +44 -0
  57. package/lib/_util/warning.js +7 -8
  58. package/lib/blockHeader/index.js +13 -12
  59. package/lib/blockHeader/style/index.less +143 -143
  60. package/lib/button/index.js +2 -2
  61. package/lib/collapsible/index.js +49 -49
  62. package/lib/collapsibleActionItems/index.js +2 -2
  63. package/lib/flex/index.js +2 -2
  64. package/lib/flex/style/index.less +76 -76
  65. package/lib/flex/utils.js +2 -2
  66. package/lib/formList/index.js +10 -10
  67. package/lib/formList/style/index.less +45 -45
  68. package/lib/index.js +21 -2
  69. package/lib/overflowList/index.js +4 -3
  70. package/lib/resize/index.js +1 -1
  71. package/lib/resizeObserver/index.js +3 -2
  72. package/lib/splitter/Panel.js +3 -3
  73. package/lib/splitter/SplitBar.js +8 -7
  74. package/lib/splitter/Splitter.js +5 -4
  75. package/lib/splitter/hooks/useItems.js +2 -2
  76. package/lib/splitter/hooks/useResize.js +5 -5
  77. package/lib/statusTag/index.js +8 -8
  78. package/lib/style/index.less +1 -1
  79. package/lib/style/themes/index.less +2 -2
  80. package/lib/style/themes/variable.less +4 -0
  81. package/lib/table/InternalTable.js +395 -0
  82. package/lib/table/RcTable/VirtualTable.js +17 -0
  83. package/lib/table/RcTable/index.js +17 -0
  84. package/lib/table/Table.js +37 -0
  85. package/lib/{_util/zindexContext.js → table/TableMeasureRowContext.js} +2 -5
  86. package/lib/table/hooks/useContainerWidth.js +20 -0
  87. package/lib/table/index.js +9 -0
  88. package/lib/table/interface.js +8 -0
  89. package/lib/table/style/bordered.less +141 -0
  90. package/lib/table/style/fixed.less +88 -0
  91. package/lib/table/style/index.js +4 -0
  92. package/lib/table/style/index.less +150 -0
  93. package/lib/table/style/selection.less +90 -0
  94. package/lib/table/style/sticky.less +55 -0
  95. package/lib/table/style/virtual.less +65 -0
  96. package/lib/table/util.js +44 -0
  97. package/package.json +82 -66
  98. package/esm/_util/convertToTooltipProps.d.ts +0 -4
  99. package/esm/_util/convertToTooltipProps.js +0 -15
  100. package/esm/_util/gapSize.d.ts +0 -3
  101. package/esm/_util/hooks/index.d.ts +0 -1
  102. package/esm/_util/hooks/useOrientation.d.ts +0 -2
  103. package/esm/_util/hooks/useZIndex.d.ts +0 -8
  104. package/esm/_util/hooks/useZIndex.js +0 -51
  105. package/esm/_util/index.d.ts +0 -3
  106. package/esm/_util/isNonNullable.d.ts +0 -2
  107. package/esm/_util/type.d.ts +0 -52
  108. package/esm/_util/warning.d.ts +0 -31
  109. package/esm/_util/zindexContext.d.ts +0 -3
  110. package/esm/_util/zindexContext.js +0 -6
  111. package/esm/blockHeader/index.d.ts +0 -48
  112. package/esm/blockHeader/style/index.d.ts +0 -2
  113. package/esm/button/index.d.ts +0 -10
  114. package/esm/button/style/index.d.ts +0 -2
  115. package/esm/collapsible/index.d.ts +0 -97
  116. package/esm/collapsible/style/index.d.ts +0 -1
  117. package/esm/collapsibleActionItems/index.d.ts +0 -24
  118. package/esm/collapsibleActionItems/style/index.d.ts +0 -2
  119. package/esm/flex/index.d.ts +0 -7
  120. package/esm/flex/interface.d.ts +0 -16
  121. package/esm/flex/style/index.d.ts +0 -2
  122. package/esm/flex/utils.d.ts +0 -7
  123. package/esm/formList/index.d.ts +0 -77
  124. package/esm/formList/style/index.d.ts +0 -2
  125. package/esm/index.d.ts +0 -14
  126. package/esm/overflowList/index.d.ts +0 -39
  127. package/esm/overflowList/style/index.d.ts +0 -2
  128. package/esm/resize/index.d.ts +0 -8
  129. package/esm/resizeObserver/index.d.ts +0 -45
  130. package/esm/splitter/Panel.d.ts +0 -7
  131. package/esm/splitter/SplitBar.d.ts +0 -24
  132. package/esm/splitter/Splitter.d.ts +0 -5
  133. package/esm/splitter/hooks/sizeUtil.d.ts +0 -3
  134. package/esm/splitter/hooks/useItems.d.ts +0 -14
  135. package/esm/splitter/hooks/useResizable.d.ts +0 -10
  136. package/esm/splitter/hooks/useResize.d.ts +0 -6
  137. package/esm/splitter/hooks/useSizes.d.ts +0 -4
  138. package/esm/splitter/index.d.ts +0 -8
  139. package/esm/splitter/interface.d.ts +0 -69
  140. package/esm/splitter/style/index.d.ts +0 -2
  141. package/esm/statusTag/index.d.ts +0 -28
  142. package/esm/statusTag/style/index.d.ts +0 -2
  143. package/esm/style/index.d.ts +0 -1
  144. package/lib/_util/convertToTooltipProps.d.ts +0 -4
  145. package/lib/_util/convertToTooltipProps.js +0 -21
  146. package/lib/_util/gapSize.d.ts +0 -3
  147. package/lib/_util/hooks/index.d.ts +0 -1
  148. package/lib/_util/hooks/useOrientation.d.ts +0 -2
  149. package/lib/_util/hooks/useZIndex.d.ts +0 -8
  150. package/lib/_util/hooks/useZIndex.js +0 -59
  151. package/lib/_util/index.d.ts +0 -3
  152. package/lib/_util/isNonNullable.d.ts +0 -2
  153. package/lib/_util/type.d.ts +0 -52
  154. package/lib/_util/warning.d.ts +0 -31
  155. package/lib/_util/zindexContext.d.ts +0 -3
  156. package/lib/blockHeader/index.d.ts +0 -48
  157. package/lib/blockHeader/style/index.d.ts +0 -2
  158. package/lib/button/index.d.ts +0 -10
  159. package/lib/button/style/index.d.ts +0 -2
  160. package/lib/collapsible/index.d.ts +0 -97
  161. package/lib/collapsible/style/index.d.ts +0 -1
  162. package/lib/collapsibleActionItems/index.d.ts +0 -24
  163. package/lib/collapsibleActionItems/style/index.d.ts +0 -2
  164. package/lib/flex/index.d.ts +0 -7
  165. package/lib/flex/interface.d.ts +0 -16
  166. package/lib/flex/style/index.d.ts +0 -2
  167. package/lib/flex/utils.d.ts +0 -7
  168. package/lib/formList/index.d.ts +0 -77
  169. package/lib/formList/style/index.d.ts +0 -2
  170. package/lib/index.d.ts +0 -14
  171. package/lib/overflowList/index.d.ts +0 -39
  172. package/lib/overflowList/style/index.d.ts +0 -2
  173. package/lib/resize/index.d.ts +0 -8
  174. package/lib/resizeObserver/index.d.ts +0 -45
  175. package/lib/splitter/Panel.d.ts +0 -7
  176. package/lib/splitter/SplitBar.d.ts +0 -24
  177. package/lib/splitter/Splitter.d.ts +0 -5
  178. package/lib/splitter/hooks/sizeUtil.d.ts +0 -3
  179. package/lib/splitter/hooks/useItems.d.ts +0 -14
  180. package/lib/splitter/hooks/useResizable.d.ts +0 -10
  181. package/lib/splitter/hooks/useResize.d.ts +0 -6
  182. package/lib/splitter/hooks/useSizes.d.ts +0 -4
  183. package/lib/splitter/index.d.ts +0 -8
  184. package/lib/splitter/interface.d.ts +0 -69
  185. package/lib/splitter/style/index.d.ts +0 -2
  186. package/lib/statusTag/index.d.ts +0 -28
  187. package/lib/statusTag/style/index.d.ts +0 -2
  188. package/lib/style/index.d.ts +0 -1
@@ -1,48 +0,0 @@
1
- import React, { ReactNode } from 'react';
2
- import './style';
3
- import { LabelTooltipType } from '../_util';
4
- import type { CollapsibleProps } from '../collapsible';
5
- export declare type SizeType = 'small' | 'middle' | 'large';
6
- export interface IBlockHeaderProps extends CollapsibleProps {
7
- /** 标题 */
8
- title: ReactNode;
9
- /** 标题前的图标,默认是一个色块 */
10
- addonBefore?: ReactNode;
11
- /** 标题后的提示说明文字 */
12
- description?: ReactNode;
13
- /** 默认展示为问号的tooltip */
14
- tooltip?: LabelTooltipType;
15
- /** 后缀自定义内容块 */
16
- addonAfter?: ReactNode;
17
- /**
18
- * 小标题 font-size: 12px; line-height: 32px
19
- * 中标题 font-size: 14px; line-height: 40px
20
- * 大标题 font-size: 16px; line-height: 40px
21
- * 默认 中标题
22
- */
23
- size?: SizeType;
24
- /** 自定义 Bottom 值 */
25
- spaceBottom?: number;
26
- /** 标题一行的样式类名 */
27
- className?: string;
28
- /** 标题的样式类名 */
29
- style?: React.CSSProperties;
30
- /** 展示内容(children)的样式类名 */
31
- contentClassName?: string;
32
- /** 展示内容(children)的样式 */
33
- contentStyle?: React.CSSProperties;
34
- /** 是否显示背景, 默认 true */
35
- background?: boolean;
36
- /** 当前展开状态 */
37
- expand?: boolean;
38
- /** 是否默认展开内容, 默认为 undefined */
39
- defaultExpand?: boolean;
40
- /** 展开/收起的内容 */
41
- children?: ReactNode;
42
- /** 展开/收起时的回调 */
43
- onExpand?: (expand: boolean) => void;
44
- /** 标题的样式 */
45
- titleStyle?: React.CSSProperties;
46
- }
47
- declare const BlockHeader: React.FC<IBlockHeaderProps>;
48
- export default BlockHeader;
@@ -1,2 +0,0 @@
1
- import '../../style';
2
- import './index.less';
@@ -1,10 +0,0 @@
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
- declare 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;
@@ -1,2 +0,0 @@
1
- import '../../style/index.less';
2
- import './index.less';
@@ -1,97 +0,0 @@
1
- import React from 'react';
2
- import './style';
3
- interface BaseComponentProps {
4
- /**
5
- * 类名
6
- */
7
- className?: string;
8
- /**
9
- * 样式
10
- */
11
- style?: React.CSSProperties;
12
- /**
13
- * id
14
- */
15
- id?: string;
16
- 'data-*'?: string;
17
- }
18
- export interface CollapsibleProps extends BaseComponentProps {
19
- /**
20
- * 是否开启动画
21
- */
22
- motion?: boolean;
23
- /**
24
- * 子元素
25
- */
26
- children?: React.ReactNode;
27
- /**
28
- * 是否展开内容区域
29
- */
30
- isOpen?: boolean;
31
- /**
32
- * 动画执行的时间
33
- */
34
- duration?: number;
35
- /**
36
- * 是否保留隐藏的面板 DOM 树,默认销毁
37
- */
38
- keepDOM?: boolean;
39
- /**
40
- * 配合 keepDOM 使用,为 true 时挂载时不会渲染组件
41
- */
42
- lazyRender?: boolean;
43
- /**
44
- * 折叠高度
45
- */
46
- collapseHeight?: number;
47
- /**
48
- * 当 reCalcKey 改变时,将重新计算子节点的高度,用于优化动态渲染时的计算
49
- */
50
- reCalcKey?: number | string;
51
- /**
52
- * 动画结束的回调
53
- */
54
- onMotionEnd?: () => void;
55
- /**
56
- * 是否开启淡入淡出
57
- */
58
- fade?: boolean;
59
- }
60
- interface CollapsibleState {
61
- domInRenderTree: boolean;
62
- domHeight: number;
63
- visible: boolean;
64
- isTransitioning: boolean;
65
- cacheIsOpen: boolean;
66
- }
67
- declare class Collapsible extends React.Component<CollapsibleProps, CollapsibleState> {
68
- static defaultProps: {
69
- isOpen: boolean;
70
- duration: number;
71
- motion: boolean;
72
- keepDOM: boolean;
73
- lazyRender: boolean;
74
- collapseHeight: number;
75
- fade: boolean;
76
- };
77
- prefixCls: string;
78
- foundation: any;
79
- private domRef;
80
- private resizeObserver;
81
- private hasBeenRendered;
82
- static displayName: string;
83
- constructor(props: CollapsibleProps);
84
- private handleResize;
85
- private isChildrenInRenderTree;
86
- static getEntryInfo: (entry: ResizeObserverEntry) => {
87
- isShown: boolean;
88
- height: number;
89
- };
90
- private getDataAttr;
91
- componentDidMount(): void;
92
- static getDerivedStateFromProps(props: CollapsibleProps, prevState: CollapsibleState): Partial<CollapsibleState>;
93
- componentDidUpdate(prevProps: Readonly<CollapsibleProps>, prevState: Readonly<CollapsibleState>): void;
94
- componentWillUnmount(): void;
95
- render(): React.JSX.Element;
96
- }
97
- export default Collapsible;
@@ -1 +0,0 @@
1
- import './index.less';
@@ -1,24 +0,0 @@
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 declare 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;
@@ -1,2 +0,0 @@
1
- import '../../style/index.less';
2
- import './index.less';
@@ -1,7 +0,0 @@
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;
@@ -1,16 +0,0 @@
1
- import type React from 'react';
2
- import { SizeType } from 'antd/es/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
- }
@@ -1,2 +0,0 @@
1
- import '../../style/index.less';
2
- import './index.less';
@@ -1,7 +0,0 @@
1
- import 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;
@@ -1,77 +0,0 @@
1
- import React, { ReactNode } from 'react';
2
- import { type FormListFieldData, type TableProps } from 'antd';
3
- import type { FormItemProps, FormListProps, RuleObject, RuleRender } from 'antd/lib/form';
4
- import type { ColumnType as TableColumnType } from 'antd/lib/table';
5
- import './style';
6
- declare type NotNullRowSelection = NonNullable<TableProps<any>['rowSelection']>;
7
- /**
8
- * Override NamePath parameters type
9
- */
10
- declare type OverrideParameters = (string | number)[];
11
- declare type RcFormInstance = Parameters<RuleRender>[0];
12
- declare type RawPanelRender = NonNullable<TableProps<any>['footer']>;
13
- /**
14
- * Override PanelRender type
15
- */
16
- declare type PanelRenderFunc = (...args: Parameters<FormListProps['children']>) => ReturnType<RawPanelRender>;
17
- /**
18
- * Form.Table 组件类型
19
- */
20
- export interface IFormTableProps
21
- /**
22
- * Support all FormListProps except children for which is re-defined in this component
23
- * and prefixCls for which is not expected to be supported
24
- */
25
- extends Pick<FormListProps, 'name' | 'rules' | 'initialValue'>,
26
- /**
27
- * Support all TableProps except
28
- * - re-define columns and re-defined rowSelection
29
- * - and pagination which is expect to be not supported in Form.Table
30
- * - and className which is renamed to tableClassName
31
- * - and rowKey, dataSource for which are defined and not allowed to be modified
32
- * - and footer, title, summary for which are re-defined to pass form's operation
33
- */
34
- Omit<TableProps<any>, 'columns' | 'rowSelection' | 'pagination' | 'className' | 'rowKey' | 'dataSource' | 'footer' | 'title' | 'summary'> {
35
- /**
36
- * 表格列的配置描述
37
- */
38
- columns?: ColumnType[] | ((...args: Parameters<FormListProps['children']>) => ColumnType[]);
39
- /**
40
- * Table 的 className
41
- */
42
- tableClassName?: TableProps<any>['className'];
43
- /**
44
- * 表格行是否可选择
45
- */
46
- rowSelection?: Omit<NotNullRowSelection, 'getCheckboxProps'> & {
47
- getCheckboxProps?: (field: FormListFieldData) => ReturnType<NonNullable<NotNullRowSelection['getCheckboxProps']>>;
48
- };
49
- title?: PanelRenderFunc;
50
- footer?: PanelRenderFunc;
51
- summary?: PanelRenderFunc;
52
- }
53
- export interface ColumnType
54
- /**
55
- * Support all FormItemProps, and re-defined `rules` and `dependencies`
56
- */
57
- extends Omit<FormItemProps, 'rules' | 'dependencies' | 'prefixCls' | 'children'>,
58
- /**
59
- * Support all TableColumnType, and re-defined `render`
60
- */
61
- Omit<TableColumnType<FormListFieldData>, 'render'> {
62
- /**
63
- * 设置依赖字段, 支持通过回调函数获取当前字段名
64
- */
65
- dependencies?: ((namePath: OverrideParameters) => FormItemProps['dependencies']) | FormItemProps['dependencies'];
66
- /**
67
- * 校验规则,设置字段的校验逻辑,支持通过回调函数获取当前字段名
68
- */
69
- rules?: (RuleObject | ((form: RcFormInstance, namePath: OverrideParameters) => RuleObject))[];
70
- /**
71
- * 渲染函数
72
- * @param formInstance 只有在设置了 `dependencies` 的情况下才有该参数
73
- */
74
- render?: (fieldData: FormListFieldData, namePath: OverrideParameters, formInstance?: RcFormInstance) => ReactNode;
75
- }
76
- export default function InternalTable({ name, rules, initialValue, ...tableProps }: IFormTableProps): React.JSX.Element;
77
- export {};
@@ -1,2 +0,0 @@
1
- import '../../style/index.less';
2
- import './index.less';
package/lib/index.d.ts DELETED
@@ -1,14 +0,0 @@
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';
@@ -1,39 +0,0 @@
1
- import React, { Component, ReactElement, ReactNode } from 'react';
2
- import './style';
3
- export declare type OverflowItem<T = Record<string, any>> = T;
4
- export interface OverflowListProps<T = Record<string, any>> {
5
- items: OverflowItem<T>[];
6
- visibleItemRenderer: (item: OverflowItem<T>, index: number) => ReactElement;
7
- overflowRenderer: (overflowItems: OverflowItem<T>[]) => ReactNode | ReactNode[];
8
- className?: string;
9
- style?: React.CSSProperties;
10
- renderMode?: 'collapse' | 'scroll';
11
- collapseFrom?: 'start' | 'end';
12
- minVisibleItems?: number;
13
- onOverflow?: (overflowItems: OverflowItem<T>[]) => void;
14
- }
15
- interface OverflowListState {
16
- visibleCount: number;
17
- isMeasuring: boolean;
18
- }
19
- declare class OverflowList<T extends object> extends Component<OverflowListProps<T>, OverflowListState> {
20
- static defaultProps: {
21
- items: never[];
22
- collapseFrom: string;
23
- minVisibleItems: number;
24
- renderMode: string;
25
- };
26
- static displayName: string;
27
- private containerRef;
28
- private overflowRef;
29
- private itemRefs;
30
- private prefixCls;
31
- constructor(props: OverflowListProps<T>);
32
- componentDidMount(): void;
33
- componentUpdate(prevProps: OverflowListProps<T>): void;
34
- private measureAndAdjust;
35
- private getOverflowItems;
36
- renderCollapse(): React.JSX.Element;
37
- render(): React.JSX.Element;
38
- }
39
- export default OverflowList;
@@ -1,2 +0,0 @@
1
- import '../../style/index.less';
2
- import './index.less';
@@ -1,8 +0,0 @@
1
- import React, { ReactNode } from 'react';
2
- export interface ResizeProps {
3
- observerEle?: HTMLElement | null;
4
- children?: ReactNode;
5
- onResize?: () => void;
6
- }
7
- declare const Resize: React.FC<ResizeProps>;
8
- export default Resize;
@@ -1,45 +0,0 @@
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 {};
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import { 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;
@@ -1,24 +0,0 @@
1
- import React from 'react';
2
- export declare 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;
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import type { SplitterProps } from './interface';
3
- import './style/index.less';
4
- declare const Splitter: React.FC<React.PropsWithChildren<SplitterProps>>;
5
- export default Splitter;
@@ -1,3 +0,0 @@
1
- declare type SizeUnit = number | undefined;
2
- export declare function autoPtgSizes(ptgSizes: SizeUnit[], minPtgSizes: SizeUnit[], maxPtgSizes: SizeUnit[]): number[];
3
- export {};
@@ -1,14 +0,0 @@
1
- import * as React from 'react';
2
- import type { PanelProps } from '../interface';
3
- export declare 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;
@@ -1,10 +0,0 @@
1
- import type { ShowCollapsibleIconMode } from '../SplitBar';
2
- import type { ItemType } from './useItems';
3
- export declare 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[];
@@ -1,6 +0,0 @@
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];
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { 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)[]>>];
@@ -1,8 +0,0 @@
1
- import Panel from './Panel';
2
- import SplitterComp from './Splitter';
3
- export type { SplitterProps } from './interface';
4
- declare type CompoundedComponent = typeof SplitterComp & {
5
- Panel: typeof Panel;
6
- };
7
- declare const Splitter: CompoundedComponent;
8
- export default Splitter;
@@ -1,69 +0,0 @@
1
- /// <reference types="react" />
2
- import { 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
- }
@@ -1,2 +0,0 @@
1
- import '../../style';
2
- import './index.less';
@@ -1,28 +0,0 @@
1
- import React, { CSSProperties, HTMLAttributes, ReactNode } from 'react';
2
- import './style';
3
- export declare const PRESET_COLOR_TYPES: readonly ["blue", "yellow", "green", "gray", "red", "purple", "cyan", "pink"];
4
- export declare const STATUS_TAG_TYPES: readonly ["default", "outline", "fill"];
5
- export declare type PresetColorType = (typeof PRESET_COLOR_TYPES)[number] | (string & {});
6
- export declare type StatusTagType = (typeof STATUS_TAG_TYPES)[number];
7
- export interface IStatusTagProps extends HTMLAttributes<HTMLDivElement> {
8
- /** 状态类型 */
9
- type?: StatusTagType;
10
- /** 是否圆角 */
11
- rounded?: boolean;
12
- /** 状态颜色(支持预设值/自定义十六进制/RGB) */
13
- color?: PresetColorType;
14
- /** 是否加载中 */
15
- loading?: boolean;
16
- /** 自定义图标 */
17
- icon?: ReactNode;
18
- /** 背景颜色(仅fill类型生效),未设置时使用color的0.15透明度 */
19
- background?: string;
20
- /** 类名 */
21
- className?: string;
22
- /** 子节点 */
23
- children?: ReactNode;
24
- /** 自定义样式 */
25
- style?: CSSProperties;
26
- }
27
- declare const StatusTag: React.FC<IStatusTagProps>;
28
- export default StatusTag;
@@ -1,2 +0,0 @@
1
- import '../../style/index.less';
2
- import './index.less';
@@ -1 +0,0 @@
1
- import './index.less';