dcp-design-react 1.12.16 → 1.12.17
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/lib/anchor/style/index.less +101 -101
- package/lib/countup/style/index.less +22 -22
- package/lib/divider/style/index.less +68 -68
- package/lib/form/src/types.d.ts +1 -0
- package/lib/hooks/useEvent.d.ts +1 -1
- package/lib/index.esm.js +1 -1
- package/lib/index.full.js +1 -1
- package/lib/index.js +1 -1
- package/lib/style/index.css +0 -17
- package/lib/style/index.min.css +1 -1
- package/lib/style/mixins/reset.less +37 -37
- package/lib/table/src/body/DraggableTr.d.ts +1 -1
- package/lib/table/src/cell/index.d.ts +2 -1
- package/lib/table/src/context/index.d.ts +2 -3
- package/lib/table/src/edit/index.d.ts +1 -1
- package/lib/table/src/hooks/useImperativeMethod.d.ts +1 -2
- package/lib/table/src/hooks/useTableEffect.d.ts +1 -2
- package/lib/table/src/hooks/useTableLayout.d.ts +1 -2
- package/lib/table/src/hooks/useTableMemo.d.ts +1 -1
- package/lib/table/src/hooks/useTableRef.d.ts +4 -2
- package/lib/table/src/table/types.d.ts +9 -1
- package/lib/table/src/utils/index.d.ts +4 -2
- package/lib/table/style/table.less +357 -375
- package/package.json +1 -1
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: 焦质晔
|
|
3
|
-
* @Date: 2021-07-23 18:58:43
|
|
4
|
-
* @Last Modified by: 焦质晔
|
|
5
|
-
* @Last Modified time: 2021-07-23 18:58:43
|
|
6
|
-
*/
|
|
7
|
-
@import '../themes/index';
|
|
8
|
-
|
|
9
|
-
.reset-container() {
|
|
10
|
-
box-sizing: border-box;
|
|
11
|
-
margin: 0;
|
|
12
|
-
padding: 0;
|
|
13
|
-
color: @--text-color;
|
|
14
|
-
font-variant: @font-variant-base;
|
|
15
|
-
line-height: @--line-height-base;
|
|
16
|
-
list-style: none;
|
|
17
|
-
font-feature-settings: @font-feature-settings-base;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.box-sizing-content() {
|
|
21
|
-
box-sizing: border-box;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.text-overflow-cut() {
|
|
25
|
-
overflow: hidden;
|
|
26
|
-
text-overflow: ellipsis;
|
|
27
|
-
white-space: nowrap;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.text-ellipsis-2 () {
|
|
31
|
-
display: -webkit-box;
|
|
32
|
-
-webkit-box-orient: vertical;
|
|
33
|
-
-webkit-line-clamp: 2;
|
|
34
|
-
line-clamp: 2;
|
|
35
|
-
overflow: hidden;
|
|
36
|
-
text-overflow: ellipsis;
|
|
37
|
-
}
|
|
1
|
+
/*
|
|
2
|
+
* @Author: 焦质晔
|
|
3
|
+
* @Date: 2021-07-23 18:58:43
|
|
4
|
+
* @Last Modified by: 焦质晔
|
|
5
|
+
* @Last Modified time: 2021-07-23 18:58:43
|
|
6
|
+
*/
|
|
7
|
+
@import '../themes/index';
|
|
8
|
+
|
|
9
|
+
.reset-container() {
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
margin: 0;
|
|
12
|
+
padding: 0;
|
|
13
|
+
color: @--text-color;
|
|
14
|
+
font-variant: @font-variant-base;
|
|
15
|
+
line-height: @--line-height-base;
|
|
16
|
+
list-style: none;
|
|
17
|
+
font-feature-settings: @font-feature-settings-base;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.box-sizing-content() {
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.text-overflow-cut() {
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
text-overflow: ellipsis;
|
|
27
|
+
white-space: nowrap;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.text-ellipsis-2 () {
|
|
31
|
+
display: -webkit-box;
|
|
32
|
+
-webkit-box-orient: vertical;
|
|
33
|
+
-webkit-line-clamp: 2;
|
|
34
|
+
line-clamp: 2;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
text-overflow: ellipsis;
|
|
37
|
+
}
|
|
@@ -23,5 +23,5 @@ export type NodeType = {
|
|
|
23
23
|
data: IRecord;
|
|
24
24
|
props: IProps;
|
|
25
25
|
};
|
|
26
|
-
declare const DraggableTr: React.ForwardRefExoticComponent<IProps & React.RefAttributes<
|
|
26
|
+
declare const DraggableTr: React.ForwardRefExoticComponent<IProps & React.RefAttributes<HTMLTableRowElement>>;
|
|
27
27
|
export default DraggableTr;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { IColumn, IRecord, IRowKey } from '../table/types';
|
|
3
|
+
import { type CellEditRef } from '../edit';
|
|
3
4
|
type ICellProps = {
|
|
4
5
|
row: IRecord;
|
|
5
6
|
column: IColumn;
|
|
@@ -9,5 +10,5 @@ type ICellProps = {
|
|
|
9
10
|
showTitle?: boolean;
|
|
10
11
|
onUnmount?: () => void;
|
|
11
12
|
};
|
|
12
|
-
declare const Cell: React.ForwardRefExoticComponent<ICellProps & React.RefAttributes<
|
|
13
|
+
declare const Cell: React.ForwardRefExoticComponent<ICellProps & React.RefAttributes<CellEditRef>>;
|
|
13
14
|
export default Cell;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type {
|
|
2
|
+
import type { IColumn, IFetchParams, IPagination, IRecord, IRowColSpan, IRowKey, IRule, IMergeCellItem, IMergedCell } from '../table/types';
|
|
3
3
|
import type { ITableRef } from '../hooks/useTableRef';
|
|
4
4
|
import type { ITableState } from '../hooks/useTableState';
|
|
5
5
|
import type { ComponentSize } from '../../../_utils/types';
|
|
6
6
|
export type ITableContext = {
|
|
7
7
|
getRowKey: (row: IRecord, index: number) => IRowKey;
|
|
8
8
|
tableRef: React.MutableRefObject<ITableRef>;
|
|
9
|
-
tableBodyRef: React.RefObject<TableBodyRef>;
|
|
10
9
|
prefixCls: string;
|
|
11
10
|
$size: ComponentSize;
|
|
12
11
|
tableFlatData: IRecord[];
|
|
@@ -14,7 +13,7 @@ export type ITableContext = {
|
|
|
14
13
|
editableColumns: IColumn[];
|
|
15
14
|
leftFixedColumns: IColumn[];
|
|
16
15
|
rightFixedColumns: IColumn[];
|
|
17
|
-
|
|
16
|
+
expandIconIndex: string;
|
|
18
17
|
sorter: ITableState['sorter'];
|
|
19
18
|
filters: ITableState['filters'];
|
|
20
19
|
superFilters: ITableState['superFilters'];
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ITableRef } from './useTableRef';
|
|
3
|
-
import type { getRowKeyType, IColumn, IFetchParams, IPagination, IRecord, IRowKey, IRule, IValidItem, TableRef, ToolBoxRef,
|
|
3
|
+
import type { getRowKeyType, IColumn, IFetchParams, IPagination, IRecord, IRowKey, IRule, IValidItem, TableRef, ToolBoxRef, ColumnDefineRef } from '../table/types';
|
|
4
4
|
type IExtra = {
|
|
5
5
|
getRowKey: getRowKeyType;
|
|
6
6
|
tableRef: React.MutableRefObject<ITableRef>;
|
|
7
7
|
toolBoxRef: React.RefObject<ToolBoxRef>;
|
|
8
|
-
tableBodyRef: React.RefObject<TableBodyRef>;
|
|
9
8
|
columnFilterRef: React.RefObject<ColumnDefineRef>;
|
|
10
9
|
flattenColumns: IColumn[];
|
|
11
10
|
editableColumns: IColumn[];
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ITableRef } from './useTableRef';
|
|
3
|
-
import type {
|
|
3
|
+
import type { IColumn, IPagination, IRowKey, ITableProps, IDerivedRowKeys } from '../table/types';
|
|
4
4
|
import type { ComponentSize } from '../../../_utils/types';
|
|
5
5
|
type IExtra = {
|
|
6
6
|
tableRef: React.MutableRefObject<ITableRef>;
|
|
7
|
-
tableBodyRef: React.RefObject<TableBodyRef>;
|
|
8
7
|
$size: ComponentSize;
|
|
9
8
|
pagination: IPagination;
|
|
10
9
|
selectionKeys: IDerivedRowKeys;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { getRowKeyType } from '../table/types';
|
|
3
|
-
import type { IColumn, IMergeCellItem, IRecord, IRowKey, ITableProps
|
|
3
|
+
import type { IColumn, IMergeCellItem, IRecord, IRowKey, ITableProps } from '../table/types';
|
|
4
4
|
import type { ITableState } from './useTableState';
|
|
5
5
|
import type { ITableRef } from './useTableRef';
|
|
6
6
|
import type { ComponentSize } from '../../../_utils/types';
|
|
@@ -9,7 +9,6 @@ type IExtra = {
|
|
|
9
9
|
tableRef: React.MutableRefObject<ITableRef>;
|
|
10
10
|
topElementRef: React.RefObject<HTMLDivElement>;
|
|
11
11
|
tableElementRef: React.RefObject<HTMLDivElement>;
|
|
12
|
-
tableBodyRef: React.RefObject<TableBodyRef>;
|
|
13
12
|
$size: ComponentSize;
|
|
14
13
|
tableColumns: IColumn[];
|
|
15
14
|
flattenColumns: IColumn[];
|
|
@@ -29,7 +29,7 @@ declare const useTableMemo: <T extends ITableProps>(props: T, extra: IExtra) =>
|
|
|
29
29
|
rightFixedColumns: IColumn[];
|
|
30
30
|
tableRowHeight: number;
|
|
31
31
|
derivedMergeCells: IMergeCellItem[];
|
|
32
|
-
|
|
32
|
+
expandIconIndex: string;
|
|
33
33
|
showSummary: boolean;
|
|
34
34
|
showFooter: boolean;
|
|
35
35
|
isHeadGroup: boolean;
|
|
@@ -3,7 +3,7 @@ import TableManager from '../manager';
|
|
|
3
3
|
import Store from '../store';
|
|
4
4
|
import type { Nullable } from '../../../_utils/types';
|
|
5
5
|
import type { ScrollbarRef } from '../../../scrollbar/src/scrollbar';
|
|
6
|
-
import type { getRowKeyType, IColumn, IFieldAuthItem, InsertMode, IRecord, IRowKey, ITableProps } from '../table/types';
|
|
6
|
+
import type { getRowKeyType, IColumn, IFieldAuthItem, InsertMode, IRecord, IRowKey, ITableProps, TableBodyRef } from '../table/types';
|
|
7
7
|
export type ITableRef = {
|
|
8
8
|
props: ITableProps;
|
|
9
9
|
uid: string;
|
|
@@ -16,6 +16,7 @@ export type ITableRef = {
|
|
|
16
16
|
fieldAuth: Record<string, IFieldAuthItem>;
|
|
17
17
|
columnsDefined: boolean;
|
|
18
18
|
scrollBarRef: React.RefObject<ScrollbarRef>;
|
|
19
|
+
tableBodyRef: React.RefObject<TableBodyRef>;
|
|
19
20
|
store: Store;
|
|
20
21
|
resizeState: {
|
|
21
22
|
width: number;
|
|
@@ -53,7 +54,7 @@ declare const useTableRef: <T extends ITableProps>(props: T, { getRowKey }: IExt
|
|
|
53
54
|
setSummaries: (option: ITableRef['summaries']) => void;
|
|
54
55
|
setScrollXLoad: (value: boolean) => void;
|
|
55
56
|
setScrollYLoad: (value: boolean) => void;
|
|
56
|
-
setSelectionRows: (
|
|
57
|
+
setSelectionRows: (records: IRecord[]) => void;
|
|
57
58
|
setUnMounted: (value: boolean) => void;
|
|
58
59
|
clearElementStore: () => void;
|
|
59
60
|
props: ITableProps;
|
|
@@ -67,6 +68,7 @@ declare const useTableRef: <T extends ITableProps>(props: T, { getRowKey }: IExt
|
|
|
67
68
|
fieldAuth: Record<string, IFieldAuthItem>;
|
|
68
69
|
columnsDefined: boolean;
|
|
69
70
|
scrollBarRef: React.RefObject<ScrollbarRef>;
|
|
71
|
+
tableBodyRef: React.RefObject<TableBodyRef>;
|
|
70
72
|
store: Store;
|
|
71
73
|
resizeState: {
|
|
72
74
|
width: number;
|
|
@@ -253,6 +253,14 @@ export type ISummation = {
|
|
|
253
253
|
};
|
|
254
254
|
onChange?: (summationRows: Record<string, number | string>[]) => void;
|
|
255
255
|
};
|
|
256
|
+
export type ITreeDropEvent = {
|
|
257
|
+
node: IRecord;
|
|
258
|
+
dragNode: IRecord;
|
|
259
|
+
dragNodesKeys: IRowKey[];
|
|
260
|
+
dropPosition: number;
|
|
261
|
+
dropToGap?: boolean;
|
|
262
|
+
event: React.MouseEvent<HTMLElement>;
|
|
263
|
+
};
|
|
256
264
|
export type IExportExcel = {
|
|
257
265
|
fileName?: string;
|
|
258
266
|
fetch?: {
|
|
@@ -373,7 +381,7 @@ export type ITableProps = {
|
|
|
373
381
|
tableData: IRecord[];
|
|
374
382
|
}) => IRowColSpan | [number, number];
|
|
375
383
|
rowDraggable?: boolean;
|
|
376
|
-
beforeRowDrop?: (options:
|
|
384
|
+
beforeRowDrop?: (options: ITreeDropEvent, tableData: IRecord[]) => boolean;
|
|
377
385
|
initialSorter?: ISorter;
|
|
378
386
|
initialFilter?: IFilter;
|
|
379
387
|
rowSelection?: IRowSelection;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import dayjs, { Dayjs } from 'dayjs';
|
|
3
|
-
import type { IColumn, IDerivedRowKeys, IMergeCellItem, IRecord, IRowKey, ISorter } from '../table/types';
|
|
2
|
+
import dayjs, { type Dayjs } from 'dayjs';
|
|
3
|
+
import type { IColumn, IDerivedRowKeys, IFilter, IMergeCellItem, IRecord, IRowKey, ISorter } from '../table/types';
|
|
4
4
|
import type { Nullable, AnyObject } from '../../../_utils/types';
|
|
5
5
|
export declare const columnsFlatMap: (columns: IColumn[]) => IColumn[];
|
|
6
6
|
export declare const createFilterColumns: (columns: IColumn[]) => IColumn[];
|
|
@@ -36,6 +36,8 @@ export declare const formatDisplayPrecision: (value: number | string, precision:
|
|
|
36
36
|
export declare const stringToNumber: (value: string) => number | '';
|
|
37
37
|
export declare const getDate: (dateString: string | undefined, format: string) => dayjs.Dayjs | null;
|
|
38
38
|
export declare const formatDate: (date: Dayjs | Date | null, format: string) => string;
|
|
39
|
+
export declare const formatSorterValue: (sorter: ISorter) => ISorter;
|
|
40
|
+
export declare const formatFilterValue: (filters: IFilter, showFilterType: boolean) => IFilter;
|
|
39
41
|
export declare const createUidKey: (prefix?: string) => string;
|
|
40
42
|
export declare const getTextFromVNode: <T extends string | number>(node: React.ReactNode | T) => T[];
|
|
41
43
|
export declare const getTHeadTitle: (title: React.ReactNode | string) => string;
|