@ccs-ui/rc-pro 2.3.4 → 2.3.6-alpha-1
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/es/aj-captcha/index.d.ts +5 -2
- package/es/aj-captcha/index.js +6 -2
- package/es/auth/index.d.ts +3 -0
- package/es/auth/index.js +3 -0
- package/es/button/dropdown.js +5 -17
- package/es/button/group.js +47 -65
- package/es/button/index.d.ts +4 -11
- package/es/button/index.js +10 -13
- package/es/cascader/index.d.ts +6 -3
- package/es/cascader/index.js +11 -7
- package/es/ccs.d.ts +9 -10
- package/es/color-picker/index.d.ts +5 -1
- package/es/color-picker/index.js +6 -2
- package/es/context/index.d.ts +24 -2
- package/es/date-picker/index.d.ts +1 -0
- package/es/date-picker/index.js +3 -0
- package/es/dialog/HookDrawer.js +3 -1
- package/es/dialog/HookModal.js +3 -1
- package/es/dialog/context.d.ts +2 -1
- package/es/dialog/hook.d.ts +10 -0
- package/es/dialog/index.d.ts +3 -1
- package/es/dialog/index.js +3 -0
- package/es/editor/index.d.ts +1 -0
- package/es/editor/index.js +3 -0
- package/es/ellipsis/index.d.ts +21 -5
- package/es/ellipsis/index.js +117 -28
- package/es/ellipsis/index.less +5 -0
- package/es/ellipsis/useMeasure.d.ts +9 -0
- package/es/ellipsis/useMeasure.js +142 -0
- package/es/ellipsis/useResizeEffect.d.ts +2 -0
- package/es/ellipsis/useResizeEffect.js +28 -0
- package/es/ellipsis/withStopPropagation.d.ts +4 -0
- package/es/ellipsis/withStopPropagation.js +38 -0
- package/es/hooks/use-app.d.ts +7 -2
- package/es/hooks/use-app.js +8 -3
- package/es/hooks/use-selection.d.ts +28 -0
- package/es/hooks/use-selection.js +146 -0
- package/es/index.d.ts +3 -2
- package/es/index.js +3 -2
- package/es/interval-button/index.js +3 -0
- package/es/layout-keep-alive/index.d.ts +10 -13
- package/es/layout-keep-alive/index.js +98 -60
- package/es/layout-keep-alive/page.d.ts +3 -5
- package/es/layout-keep-alive/page.js +9 -5
- package/es/layout-single-page/index.d.ts +5 -3
- package/es/layout-single-page/index.js +14 -20
- package/es/layout-single-page/page.d.ts +3 -5
- package/es/layout-single-page/page.js +7 -2
- package/es/loading/index.d.ts +4 -1
- package/es/loading/index.js +4 -1
- package/es/pro-table/head.d.ts +8 -7
- package/es/pro-table/head.js +54 -100
- package/es/pro-table/index.d.ts +8 -8
- package/es/pro-table/index.js +8 -3
- package/es/pro-table/index.less +8 -3
- package/es/pro-table/selection-alert.d.ts +18 -0
- package/es/pro-table/selection-alert.js +52 -0
- package/es/pro-table/summary.d.ts +8 -0
- package/es/pro-table/summary.js +32 -0
- package/es/pro-table/table.d.ts +37 -30
- package/es/pro-table/table.js +485 -265
- package/es/pro-table/tree.d.ts +1 -1
- package/es/pro-table/tree.js +9 -15
- package/es/pro-tabs/index.d.ts +5 -2
- package/es/pro-tabs/index.js +16 -6
- package/es/resize-observer.d.ts +2 -2
- package/es/resize-observer.js +2 -2
- package/es/result/index.d.ts +11 -15
- package/es/result/index.js +57 -54
- package/es/select/ modal.d.ts +16 -0
- package/es/select/ modal.js +100 -0
- package/es/select/api.d.ts +25 -0
- package/es/select/api.js +67 -0
- package/es/select/customize.d.ts +35 -0
- package/es/select/customize.js +140 -0
- package/es/select/index.d.ts +20 -20
- package/es/select/index.js +70 -80
- package/es/status-tag/index.d.ts +5 -1
- package/es/status-tag/index.js +6 -2
- package/es/table/index.d.ts +5 -2
- package/es/table/index.js +82 -42
- package/es/table/index.less +27 -42
- package/es/trigger/index.d.ts +1 -0
- package/es/trigger/index.js +1 -0
- package/es/upload/index.d.ts +4 -3
- package/es/upload/index.js +6 -3
- package/es/water-mark/index.d.ts +4 -1
- package/es/water-mark/index.js +3 -0
- package/package.json +5 -4
package/es/pro-table/table.d.ts
CHANGED
|
@@ -1,36 +1,52 @@
|
|
|
1
1
|
import { TableProps } from 'antd';
|
|
2
2
|
import { ColumnGroupType, ColumnType } from 'antd/es/table';
|
|
3
3
|
import { TableSticky } from 'rc-table/lib/interface';
|
|
4
|
-
import React, { CSSProperties,
|
|
4
|
+
import React, { CSSProperties, ReactNode } from 'react';
|
|
5
5
|
import CCS from '..';
|
|
6
6
|
import { PropsWithCss, PropsWithNodeChildren, TableColumns } from '../ccs';
|
|
7
7
|
import { CcsFieldNamesType } from '../context';
|
|
8
|
+
import { EllipsisProps } from '../ellipsis';
|
|
8
9
|
import './index.less';
|
|
9
10
|
type ParamType = Record<string, any>;
|
|
10
11
|
export type ShowDependType = {
|
|
11
12
|
name: string;
|
|
12
13
|
value: any;
|
|
13
14
|
};
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
export declare enum TableEvent {
|
|
16
|
+
Search = "search",
|
|
17
|
+
Reset = "reset",
|
|
18
|
+
Reload = "reload",
|
|
19
|
+
ChangePage = "changePage",
|
|
20
|
+
InitSearch = "initSearch",
|
|
21
|
+
FullScreen = "fullScreen",
|
|
22
|
+
ColumnFilter = "columnFilter",
|
|
23
|
+
SelectedRows = "SelectedRows"
|
|
24
|
+
}
|
|
18
25
|
export type TableColumn<RecordType = any> = (Omit<ColumnGroupType<RecordType>, 'ellipsis'> | Omit<ColumnType<RecordType>, 'ellipsis'>) & {
|
|
26
|
+
dataIndex?: keyof RecordType;
|
|
19
27
|
/** 隐藏列 */
|
|
20
28
|
hidden?: boolean;
|
|
21
29
|
/** 省略显示行数,最大支持10行 */
|
|
22
|
-
ellipsis?: boolean | number;
|
|
30
|
+
ellipsis?: Omit<EllipsisProps, 'content'> | boolean | number;
|
|
23
31
|
};
|
|
24
32
|
type TableTitleType<T> = {
|
|
25
|
-
|
|
33
|
+
/** 选中Key */
|
|
34
|
+
selectedRowKeys?: React.Key[];
|
|
35
|
+
/** 选中记录 */
|
|
36
|
+
selectedRows?: T[];
|
|
37
|
+
/** table datasource */
|
|
26
38
|
data: T[];
|
|
27
|
-
|
|
39
|
+
/** 清空选择,传入key取消指定选中,否清空所有 */
|
|
40
|
+
onClear: (key?: React.Key) => void;
|
|
28
41
|
};
|
|
29
|
-
export type
|
|
42
|
+
export type TableExtraNode<T> = ReactNode | (({ selectedRowKeys, selectedRows, data, onClear, }: TableTitleType<T>) => ReactNode);
|
|
43
|
+
export type CcsTableProps<T> = Omit<TableProps<T>, 'columns' | 'title' | 'summary'> & {
|
|
30
44
|
data?: CCS.TableData<T>;
|
|
45
|
+
/** 为空时,默认一条数据 */
|
|
46
|
+
emptyDefaultOne?: boolean;
|
|
31
47
|
/** request 方法 */
|
|
32
48
|
request?: (params: any) => Promise<any>;
|
|
33
|
-
/** request 额外参数
|
|
49
|
+
/** request 额外参数 */
|
|
34
50
|
requestParam?: ParamType;
|
|
35
51
|
/** 接口字段指定,默认: */
|
|
36
52
|
fieldNames?: CcsFieldNamesType;
|
|
@@ -43,9 +59,12 @@ export type CcsTableProps<T> = Omit<TableProps<T>, 'columns' | 'title'> & {
|
|
|
43
59
|
/** 列配置 */
|
|
44
60
|
columns?: TableColumns<T>;
|
|
45
61
|
/** table title */
|
|
46
|
-
title?:
|
|
62
|
+
title?: TableExtraNode<T>;
|
|
63
|
+
/** table summary */
|
|
64
|
+
summary?: (data: readonly T[], columns: TableColumn<T>[]) => React.ReactNode;
|
|
47
65
|
};
|
|
48
|
-
export type
|
|
66
|
+
export type TableEventHandle = (eventName: TableEvent, options?: any) => void;
|
|
67
|
+
export type CcsProTableProps<RecordType = any> = Pick<PropsWithCss, 'className'> & PropsWithNodeChildren & {
|
|
49
68
|
/** api权限标识 */
|
|
50
69
|
auth?: string | 'ignore';
|
|
51
70
|
/** 是否初始查询,默认true */
|
|
@@ -59,9 +78,9 @@ export type CcsProTableProps<RecordType> = Pick<PropsWithCss, 'className'> & Pro
|
|
|
59
78
|
/** 查询form 初始值 */
|
|
60
79
|
formInitValues?: ParamType;
|
|
61
80
|
/** 按钮 操作部分 */
|
|
62
|
-
toolbar?:
|
|
63
|
-
/**
|
|
64
|
-
|
|
81
|
+
toolbar?: TableExtraNode<RecordType>;
|
|
82
|
+
/** 边框 */
|
|
83
|
+
bordered?: boolean;
|
|
65
84
|
/** 展开查询条件,默认false */
|
|
66
85
|
expandForm?: boolean;
|
|
67
86
|
/** table 数据区域 */
|
|
@@ -79,30 +98,18 @@ export type CcsProTableProps<RecordType> = Pick<PropsWithCss, 'className'> & Pro
|
|
|
79
98
|
proRef?: CCS.TableInstanceRef<RecordType>;
|
|
80
99
|
/** 显示序号 */
|
|
81
100
|
showNumber?: boolean;
|
|
82
|
-
/**
|
|
83
|
-
|
|
84
|
-
/** 请求前格式化参数 */
|
|
85
|
-
onSearchBefore?: (params: SearchBeforeType, eventType?: SearchEventType) => SearchBeforeType;
|
|
86
|
-
/** 请求后格式化结果 */
|
|
87
|
-
onSearchAfter?: (result: any, eventType?: SearchEventType) => any;
|
|
88
|
-
};
|
|
89
|
-
export type TableEventType = {
|
|
90
|
-
key: 'columnFilter' | 'fullScreen';
|
|
91
|
-
columnHiddenKeys?: any;
|
|
92
|
-
full?: any;
|
|
101
|
+
/** table 事件 */
|
|
102
|
+
onEvent?: TableEventHandle;
|
|
93
103
|
};
|
|
94
104
|
export type TableStickyProps = boolean | (TableSticky & {
|
|
95
105
|
isInDialog?: boolean;
|
|
96
106
|
});
|
|
97
107
|
export declare const classPrefix = "ccs-pl";
|
|
98
|
-
export declare const TableSelectionContext: React.Context<{
|
|
99
|
-
selectedRows?: any[] | undefined;
|
|
100
|
-
}>;
|
|
101
108
|
/**
|
|
102
109
|
* 布局组件 包括form、查询、toolbar、table 自动初始化数据
|
|
103
110
|
* @param CcsProTableType
|
|
104
111
|
* @param ref
|
|
105
112
|
* @returns
|
|
106
113
|
*/
|
|
107
|
-
declare const InternalProTable: <
|
|
114
|
+
declare const InternalProTable: <RecordType_1 extends object = any>(props: CcsProTableProps<RecordType_1>) => import("react/jsx-runtime").JSX.Element;
|
|
108
115
|
export default InternalProTable;
|