@ccs-ui/rc-pro 1.1.5 → 1.1.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.
- package/es/auth/auth-dropdown.d.ts +2 -2
- package/es/auth/index.d.ts +4 -4
- package/es/ccs.d.ts +36 -36
- package/es/color-picker/index.d.ts +2 -2
- package/es/color-picker/index.js +1 -1
- package/es/context/index.d.ts +6 -6
- package/es/dialog/HookDrawer.d.ts +2 -2
- package/es/dialog/HookDrawer.js +32 -21
- package/es/dialog/HookModal.d.ts +3 -3
- package/es/dialog/HookModal.js +31 -21
- package/es/dialog/button.d.ts +2 -2
- package/es/dialog/context.d.ts +3 -3
- package/es/dialog/drawer-footer.d.ts +2 -2
- package/es/dialog/form.d.ts +4 -4
- package/es/dialog/hook.d.ts +10 -10
- package/es/dialog/index.d.ts +2 -2
- package/es/full-screen/index.d.ts +2 -2
- package/es/interval-button/index.d.ts +2 -2
- package/es/keep-alive-tabs/index.d.ts +2 -2
- package/es/keep-alive-tabs/page.d.ts +2 -2
- package/es/loading/index.d.ts +2 -2
- package/es/pro-grid/context.d.ts +2 -2
- package/es/pro-grid/index.d.ts +8 -8
- package/es/pro-table/index.d.ts +6 -6
- package/es/pro-table/search.d.ts +2 -2
- package/es/pro-tabs/index.d.ts +2 -2
- package/es/status-tag/index.d.ts +2 -2
- package/es/theme.d.ts +2 -7
- package/es/trigger/index.d.ts +2 -2
- package/es/utils/index.d.ts +2 -2
- package/es/virtual-list/index.d.ts +12 -12
- package/package.json +1 -1
|
@@ -20,7 +20,7 @@ type MenuDividerAuthType = MenuDividerType & {
|
|
|
20
20
|
children?: DropdownMenuItemType[];
|
|
21
21
|
};
|
|
22
22
|
type DropdownMenuItemType = MenuItemAuthType | SubMenuAuthType | MenuItemGroupAuthType | MenuDividerAuthType;
|
|
23
|
-
|
|
23
|
+
type CcsAuthDropdownProps = Omit<DropDownProps, 'overlay' | 'children'> & {
|
|
24
24
|
/** 权限标识 */
|
|
25
25
|
auth?: string;
|
|
26
26
|
/** dropdown 菜单数据 */
|
|
@@ -29,7 +29,7 @@ interface CcsAuthDropdownProps extends Omit<DropDownProps, 'overlay' | 'children
|
|
|
29
29
|
children: ChildrenType;
|
|
30
30
|
/** 点击事件 */
|
|
31
31
|
onClick?: (info: MenuInfo) => void;
|
|
32
|
-
}
|
|
32
|
+
};
|
|
33
33
|
/**
|
|
34
34
|
* 带权限的Dropdown组件
|
|
35
35
|
*/
|
package/es/auth/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ButtonProps } from 'antd';
|
|
2
2
|
import { ReactElement, ReactNode } from 'react';
|
|
3
3
|
import CCS from '..';
|
|
4
|
-
export
|
|
4
|
+
export type CcsAuthGroupProps = {
|
|
5
5
|
/** 按钮尺寸 */
|
|
6
6
|
size?: ButtonProps['size'];
|
|
7
7
|
/** 默认显示按钮数量 */
|
|
@@ -16,13 +16,13 @@ export interface CcsAuthGroupProps {
|
|
|
16
16
|
moreText?: string;
|
|
17
17
|
/** 点击事件 */
|
|
18
18
|
onClick?: (key: string) => void;
|
|
19
|
-
}
|
|
20
|
-
export
|
|
19
|
+
};
|
|
20
|
+
export type CcsAuthProps = {
|
|
21
21
|
/** 权限标识 */
|
|
22
22
|
auth?: string;
|
|
23
23
|
/** component children */
|
|
24
24
|
children: ReactElement;
|
|
25
|
-
}
|
|
25
|
+
};
|
|
26
26
|
export declare function ModalConfirm({ modalRef }: {
|
|
27
27
|
modalRef: any;
|
|
28
28
|
}): import("react/jsx-runtime").JSX.Element;
|
package/es/ccs.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { ButtonProps, MenuProps, ThemeConfig } from 'antd';
|
|
|
2
2
|
import { Rule } from 'antd/es/form';
|
|
3
3
|
import { ColumnsType } from 'antd/es/table';
|
|
4
4
|
import { MutableRefObject, ReactElement, ReactNode } from 'react';
|
|
5
|
-
|
|
5
|
+
type MenuTreeNodeData = {
|
|
6
6
|
buttonUrlId: number;
|
|
7
7
|
createTime: string;
|
|
8
8
|
icon?: string;
|
|
@@ -17,13 +17,13 @@ interface MenuTreeNodeData {
|
|
|
17
17
|
updateTime: string;
|
|
18
18
|
urlName: string;
|
|
19
19
|
urlPath: string;
|
|
20
|
-
}
|
|
21
|
-
|
|
20
|
+
};
|
|
21
|
+
type MenuParentType = {
|
|
22
22
|
key: string;
|
|
23
23
|
url: string;
|
|
24
24
|
name: string;
|
|
25
|
-
}
|
|
26
|
-
|
|
25
|
+
};
|
|
26
|
+
type MenuTreeNode = {
|
|
27
27
|
nodeId: string;
|
|
28
28
|
nodeName: string;
|
|
29
29
|
icon: string;
|
|
@@ -32,14 +32,14 @@ interface MenuTreeNode {
|
|
|
32
32
|
children?: MenuTreeNode[];
|
|
33
33
|
topUrl?: string;
|
|
34
34
|
parents?: MenuParentType[];
|
|
35
|
-
}
|
|
36
|
-
|
|
35
|
+
};
|
|
36
|
+
type UserDetail = {
|
|
37
37
|
/** 头像 */
|
|
38
38
|
avatar?: string;
|
|
39
39
|
/** 用户名 */
|
|
40
40
|
workerName: string;
|
|
41
|
-
}
|
|
42
|
-
|
|
41
|
+
};
|
|
42
|
+
type TableData<T> = {
|
|
43
43
|
/** loading */
|
|
44
44
|
loading?: boolean;
|
|
45
45
|
/** 总条数 */
|
|
@@ -50,35 +50,35 @@ interface TableData<T> {
|
|
|
50
50
|
pageNo?: number;
|
|
51
51
|
/** Array List 数据 */
|
|
52
52
|
result?: T[];
|
|
53
|
-
}
|
|
54
|
-
|
|
53
|
+
};
|
|
54
|
+
type HttpResult<T = any> = {
|
|
55
55
|
code: string;
|
|
56
56
|
success: boolean;
|
|
57
57
|
data: T;
|
|
58
58
|
msg: string;
|
|
59
|
-
}
|
|
60
|
-
|
|
59
|
+
};
|
|
60
|
+
type PageType<T> = {
|
|
61
61
|
hasNext: boolean;
|
|
62
62
|
totalNum: number;
|
|
63
63
|
pageNo: number;
|
|
64
64
|
pageSize: number;
|
|
65
65
|
result: T[];
|
|
66
|
-
}
|
|
67
|
-
|
|
66
|
+
};
|
|
67
|
+
type HttpPageResult<T = any> = Omit<HttpResult<T>, 'data'> & {
|
|
68
68
|
data: PageType<T>;
|
|
69
|
-
}
|
|
70
|
-
|
|
69
|
+
};
|
|
70
|
+
type HttpListResult<T = any> = Omit<HttpResult<T>, 'data'> & {
|
|
71
71
|
data: T[];
|
|
72
|
-
}
|
|
73
|
-
|
|
72
|
+
};
|
|
73
|
+
type OrderProp = {
|
|
74
74
|
ascending: boolean;
|
|
75
75
|
prop: string;
|
|
76
|
-
}
|
|
77
|
-
|
|
76
|
+
};
|
|
77
|
+
type QueryLimit = {
|
|
78
78
|
fetchSize: number;
|
|
79
79
|
startIndex: number;
|
|
80
|
-
}
|
|
81
|
-
|
|
80
|
+
};
|
|
81
|
+
type PageQuery<T = any> = {
|
|
82
82
|
/** 查询的开始行数和取多少行,从0开始 */
|
|
83
83
|
limit?: QueryLimit;
|
|
84
84
|
/** 排序字段,一般前端不传,由后端指定 */
|
|
@@ -89,22 +89,22 @@ interface PageQuery<T = any> {
|
|
|
89
89
|
pageSize?: number;
|
|
90
90
|
/** 查询条件 */
|
|
91
91
|
query: T;
|
|
92
|
-
}
|
|
93
|
-
|
|
92
|
+
};
|
|
93
|
+
type ListQuery<T = any> = {
|
|
94
94
|
/** 查询的开始行数和取多少行,从0开始 */
|
|
95
95
|
limit?: QueryLimit;
|
|
96
96
|
/** 排序字段,一般前端不传,由后端指定 */
|
|
97
97
|
orderProps?: OrderProp[];
|
|
98
98
|
/** 查询条件 */
|
|
99
99
|
query: T;
|
|
100
|
-
}
|
|
100
|
+
};
|
|
101
101
|
type RecordType = Record<string, any>;
|
|
102
|
-
|
|
102
|
+
type RouteHistory = {
|
|
103
103
|
menuName: string;
|
|
104
104
|
pathName: string;
|
|
105
105
|
time: Date;
|
|
106
|
-
}
|
|
107
|
-
|
|
106
|
+
};
|
|
107
|
+
type TableDataType<T> = {
|
|
108
108
|
/** loading */
|
|
109
109
|
loading?: boolean;
|
|
110
110
|
/** 总条数 */
|
|
@@ -115,8 +115,8 @@ interface TableDataType<T> {
|
|
|
115
115
|
pageNo?: number;
|
|
116
116
|
/** Array List 数据 */
|
|
117
117
|
result?: T[];
|
|
118
|
-
}
|
|
119
|
-
|
|
118
|
+
};
|
|
119
|
+
type TableInstance<T = any> = {
|
|
120
120
|
/** 获取form表单数据 */
|
|
121
121
|
formValues: Record<string, any>;
|
|
122
122
|
/** 获取当前表单数据 */
|
|
@@ -131,8 +131,8 @@ interface TableInstance<T = any> {
|
|
|
131
131
|
onReset: () => void;
|
|
132
132
|
/** 改变data 数据 */
|
|
133
133
|
onChangeData: React.Dispatch<React.SetStateAction<TableDataType<T>>>;
|
|
134
|
-
}
|
|
135
|
-
|
|
134
|
+
};
|
|
135
|
+
type AuthButtonItem = {
|
|
136
136
|
key: string;
|
|
137
137
|
label: string;
|
|
138
138
|
auth?: string;
|
|
@@ -142,8 +142,8 @@ interface AuthButtonItem {
|
|
|
142
142
|
danger?: boolean;
|
|
143
143
|
icon?: ReactNode;
|
|
144
144
|
confirm?: string;
|
|
145
|
-
}
|
|
146
|
-
|
|
145
|
+
};
|
|
146
|
+
type TriggerChildrenProps<T = any> = {
|
|
147
147
|
/** 选中值 */
|
|
148
148
|
value?: T;
|
|
149
149
|
/** 选择框loading状态 */
|
|
@@ -154,7 +154,7 @@ interface TriggerChildrenProps<T = any> {
|
|
|
154
154
|
onChange?: ({}: T) => void;
|
|
155
155
|
/** 选择框显示名称 */
|
|
156
156
|
onChangeLabel?: (text: string | undefined) => void;
|
|
157
|
-
}
|
|
157
|
+
};
|
|
158
158
|
type ShowDependType = {
|
|
159
159
|
name: string;
|
|
160
160
|
value: any;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
2
|
import { RGBColor } from 'react-color';
|
|
3
3
|
import './index.less';
|
|
4
|
-
export
|
|
4
|
+
export type PropsType = {
|
|
5
5
|
/** 指定选中项 */
|
|
6
6
|
value?: RGBColor;
|
|
7
7
|
/** 占位 */
|
|
@@ -10,7 +10,7 @@ export interface PropsType {
|
|
|
10
10
|
style?: CSSProperties;
|
|
11
11
|
/** 选择完成后的回调 */
|
|
12
12
|
onChange?: (value: RGBColor) => void;
|
|
13
|
-
}
|
|
13
|
+
};
|
|
14
14
|
/**
|
|
15
15
|
* 颜色选择组件
|
|
16
16
|
*/
|
package/es/color-picker/index.js
CHANGED
|
@@ -12,7 +12,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
13
|
/* eslint-disable @typescript-eslint/ban-types */
|
|
14
14
|
import { Popover } from 'antd';
|
|
15
|
-
import
|
|
15
|
+
import { useState } from 'react';
|
|
16
16
|
import { SketchPicker } from 'react-color';
|
|
17
17
|
import "./index.less";
|
|
18
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
package/es/context/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export type CcsTabProps = Omit<TabPaneProps, 'tab'> & {
|
|
|
17
17
|
key: string;
|
|
18
18
|
label: React.ReactNode;
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
type CcsTabsContextType = {
|
|
21
21
|
/** 当前激活tab面板的key */
|
|
22
22
|
activeKey: string;
|
|
23
23
|
/** tab间传递的参数 */
|
|
@@ -28,7 +28,7 @@ interface CcsTabsContextType {
|
|
|
28
28
|
onRemoveTabs: (key: string | string[]) => void;
|
|
29
29
|
/** 改变tab间传递的参数 */
|
|
30
30
|
onTabChange: (tab: CcsTabsChangeProps) => void;
|
|
31
|
-
}
|
|
31
|
+
};
|
|
32
32
|
type PageContextType = {
|
|
33
33
|
/** ID */
|
|
34
34
|
id: string;
|
|
@@ -41,16 +41,16 @@ type PageContextType = {
|
|
|
41
41
|
/** 获取按钮权限 */
|
|
42
42
|
onAuth: (code: string) => boolean;
|
|
43
43
|
};
|
|
44
|
-
|
|
44
|
+
type GlobalContextPropsType = {
|
|
45
45
|
userDetail: CCS.UserDetail;
|
|
46
46
|
children: React.ReactElement;
|
|
47
|
-
}
|
|
47
|
+
};
|
|
48
48
|
type GlobalContextType = Omit<GlobalContextPropsType, 'children'>;
|
|
49
|
-
|
|
49
|
+
type FnContextType<T = Store> = {
|
|
50
50
|
locationKey: string;
|
|
51
51
|
formInitialValues: T;
|
|
52
52
|
close: () => void;
|
|
53
|
-
}
|
|
53
|
+
};
|
|
54
54
|
declare const GlobalContext: React.Context<GlobalContextType>;
|
|
55
55
|
declare const DrawerAndModalContext: React.Context<FnContextType<any>>;
|
|
56
56
|
declare const PageContext: React.Context<PageContextType>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CcsDialogDrawer, CcsDialogDrawerProps } from './hook';
|
|
3
|
-
export
|
|
3
|
+
export type HookDrawerProps = {
|
|
4
4
|
afterClose: () => void;
|
|
5
5
|
config: CcsDialogDrawerProps;
|
|
6
|
-
}
|
|
6
|
+
};
|
|
7
7
|
declare const _default: import("react").ForwardRefExoticComponent<HookDrawerProps & import("react").RefAttributes<CcsDialogDrawer>>;
|
|
8
8
|
export default _default;
|
package/es/dialog/HookDrawer.js
CHANGED
|
@@ -19,7 +19,7 @@ import { DialogContentContext } from "./context";
|
|
|
19
19
|
import DialogForm from "./form";
|
|
20
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
21
|
var HookDrawer = function HookDrawer(_ref, ref) {
|
|
22
|
-
var
|
|
22
|
+
var _innerConfig$styles;
|
|
23
23
|
var hookAfterClose = _ref.afterClose,
|
|
24
24
|
config = _ref.config;
|
|
25
25
|
var _useState = useState(function () {
|
|
@@ -39,6 +39,17 @@ var HookDrawer = function HookDrawer(_ref, ref) {
|
|
|
39
39
|
var afterClose = function afterClose() {
|
|
40
40
|
hookAfterClose();
|
|
41
41
|
};
|
|
42
|
+
var auth = innerConfig.auth,
|
|
43
|
+
form = innerConfig.form,
|
|
44
|
+
content = innerConfig.content,
|
|
45
|
+
className = innerConfig.className,
|
|
46
|
+
rootStyle = innerConfig.rootStyle,
|
|
47
|
+
getContainer = innerConfig.getContainer,
|
|
48
|
+
request = innerConfig.request,
|
|
49
|
+
onAfterOk = innerConfig.onAfterOk,
|
|
50
|
+
onAfterCancel = innerConfig.onAfterCancel,
|
|
51
|
+
onClose = innerConfig.onClose,
|
|
52
|
+
onRequestBefore = innerConfig.onRequestBefore;
|
|
42
53
|
var close = function close(e) {
|
|
43
54
|
setInnerConfig(function (c) {
|
|
44
55
|
return _objectSpread(_objectSpread({}, c), {}, {
|
|
@@ -47,19 +58,19 @@ var HookDrawer = function HookDrawer(_ref, ref) {
|
|
|
47
58
|
});
|
|
48
59
|
if ((e === null || e === void 0 ? void 0 : e.type) === 'click') {
|
|
49
60
|
// 通过点击关闭按钮或取消按钮关闭
|
|
50
|
-
if (
|
|
51
|
-
|
|
61
|
+
if (onAfterCancel) {
|
|
62
|
+
onAfterCancel(e);
|
|
52
63
|
}
|
|
53
64
|
} else {
|
|
54
65
|
// 通过调用closeDialog关闭
|
|
55
|
-
if (
|
|
56
|
-
|
|
66
|
+
if (onAfterOk) {
|
|
67
|
+
onAfterOk(e);
|
|
57
68
|
}
|
|
58
69
|
}
|
|
59
70
|
|
|
60
71
|
// 入参有onClose
|
|
61
|
-
if (
|
|
62
|
-
|
|
72
|
+
if (onClose) {
|
|
73
|
+
onClose(e);
|
|
63
74
|
}
|
|
64
75
|
};
|
|
65
76
|
useImperativeHandle(ref, function () {
|
|
@@ -81,7 +92,7 @@ var HookDrawer = function HookDrawer(_ref, ref) {
|
|
|
81
92
|
};
|
|
82
93
|
var isCrInProp = ('getContainer' in innerConfig);
|
|
83
94
|
var styles = innerConfig.styles || {};
|
|
84
|
-
if (
|
|
95
|
+
if (form) {
|
|
85
96
|
styles.body = {
|
|
86
97
|
padding: 0
|
|
87
98
|
};
|
|
@@ -95,19 +106,19 @@ var HookDrawer = function HookDrawer(_ref, ref) {
|
|
|
95
106
|
}
|
|
96
107
|
}, innerConfig), {}, {
|
|
97
108
|
onClose: close,
|
|
98
|
-
className: classNames('ccs-dialog-drawer',
|
|
109
|
+
className: classNames('ccs-dialog-drawer', className),
|
|
99
110
|
styles: styles,
|
|
100
111
|
rootStyle: _objectSpread(_objectSpread({}, !isCrInProp ? {
|
|
101
112
|
position: 'absolute'
|
|
102
|
-
} : {}),
|
|
103
|
-
getContainer: isCrInProp ?
|
|
104
|
-
extra:
|
|
105
|
-
request:
|
|
113
|
+
} : {}), rootStyle),
|
|
114
|
+
getContainer: isCrInProp ? getContainer : onGetContainer,
|
|
115
|
+
extra: request ? /*#__PURE__*/_jsx(DialogSelfButton, {
|
|
116
|
+
request: request,
|
|
106
117
|
onCancel: close,
|
|
107
118
|
formRef: formRef,
|
|
108
|
-
onRequestBefore:
|
|
109
|
-
auth:
|
|
110
|
-
formInitialValues:
|
|
119
|
+
onRequestBefore: onRequestBefore,
|
|
120
|
+
auth: auth,
|
|
121
|
+
formInitialValues: form === null || form === void 0 ? void 0 : form.initialValues
|
|
111
122
|
}) : /*#__PURE__*/_jsx(DialogButtonHolder, {
|
|
112
123
|
ref: buttonRef
|
|
113
124
|
}),
|
|
@@ -121,16 +132,16 @@ var HookDrawer = function HookDrawer(_ref, ref) {
|
|
|
121
132
|
buttonType: 'drawer',
|
|
122
133
|
closeDialog: close,
|
|
123
134
|
drawerFooterRef: footerRef,
|
|
124
|
-
formInitialValues: (
|
|
135
|
+
formInitialValues: (form === null || form === void 0 ? void 0 : form.initialValues) || {}
|
|
125
136
|
},
|
|
126
|
-
children:
|
|
137
|
+
children: form ? /*#__PURE__*/_jsx(DialogForm, {
|
|
127
138
|
ref: formRef,
|
|
128
|
-
formProps:
|
|
139
|
+
formProps: form,
|
|
129
140
|
styles: _objectSpread({
|
|
130
141
|
padding: 24
|
|
131
142
|
}, (_innerConfig$styles = innerConfig.styles) === null || _innerConfig$styles === void 0 ? void 0 : _innerConfig$styles.body),
|
|
132
|
-
children:
|
|
133
|
-
}) :
|
|
143
|
+
children: content
|
|
144
|
+
}) : content
|
|
134
145
|
})
|
|
135
146
|
}));
|
|
136
147
|
};
|
package/es/dialog/HookModal.d.ts
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import { FormProps } from 'antd';
|
|
3
3
|
import { DialogFormRef } from './form';
|
|
4
4
|
import { CcsDialogModal, CcsDialogModalProps } from './hook';
|
|
5
|
-
export declare const DialogSelfButton: ({ auth, formRef, formInitialValues, request, onCancel, onRequestBefore, }: Pick<CcsDialogModalProps, "auth" | "request" | "
|
|
5
|
+
export declare const DialogSelfButton: ({ auth, formRef, formInitialValues, request, onCancel, onRequestBefore, }: Pick<CcsDialogModalProps, "auth" | "request" | "onRequestBefore" | "onCancel"> & {
|
|
6
6
|
formRef: React.RefObject<DialogFormRef>;
|
|
7
7
|
formInitialValues: FormProps['initialValues'];
|
|
8
8
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export
|
|
9
|
+
export type HookModalProps = {
|
|
10
10
|
afterClose: () => void;
|
|
11
11
|
config: CcsDialogModalProps;
|
|
12
|
-
}
|
|
12
|
+
};
|
|
13
13
|
declare const _default: import("react").ForwardRefExoticComponent<HookModalProps & import("react").RefAttributes<CcsDialogModal>>;
|
|
14
14
|
export default _default;
|
package/es/dialog/HookModal.js
CHANGED
|
@@ -105,7 +105,6 @@ export var DialogSelfButton = function DialogSelfButton(_ref2) {
|
|
|
105
105
|
});
|
|
106
106
|
};
|
|
107
107
|
var HookModal = function HookModal(_ref3, ref) {
|
|
108
|
-
var _config$form, _config$form2;
|
|
109
108
|
var hookAfterClose = _ref3.afterClose,
|
|
110
109
|
config = _ref3.config;
|
|
111
110
|
var _useState3 = useState(function () {
|
|
@@ -138,6 +137,18 @@ var HookModal = function HookModal(_ref3, ref) {
|
|
|
138
137
|
if (config.destroyOnClose !== false) hookAfterClose();
|
|
139
138
|
(_innerConfig$afterClo = innerConfig.afterClose) === null || _innerConfig$afterClo === void 0 ? void 0 : _innerConfig$afterClo.call(innerConfig);
|
|
140
139
|
};
|
|
140
|
+
var auth = innerConfig.auth,
|
|
141
|
+
form = innerConfig.form,
|
|
142
|
+
title = innerConfig.title,
|
|
143
|
+
content = innerConfig.content,
|
|
144
|
+
_innerConfig$styles = innerConfig.styles,
|
|
145
|
+
styles = _innerConfig$styles === void 0 ? {} : _innerConfig$styles,
|
|
146
|
+
className = innerConfig.className,
|
|
147
|
+
request = innerConfig.request,
|
|
148
|
+
onCancel = innerConfig.onCancel,
|
|
149
|
+
onRequestBefore = innerConfig.onRequestBefore,
|
|
150
|
+
onAfterOk = innerConfig.onAfterOk,
|
|
151
|
+
onAfterCancel = innerConfig.onAfterCancel;
|
|
141
152
|
var close = function close(e) {
|
|
142
153
|
setInnerConfig(function (c) {
|
|
143
154
|
return _objectSpread(_objectSpread({}, c), {}, {
|
|
@@ -146,19 +157,19 @@ var HookModal = function HookModal(_ref3, ref) {
|
|
|
146
157
|
});
|
|
147
158
|
if ((e === null || e === void 0 ? void 0 : e.type) === 'click') {
|
|
148
159
|
// 通过点击关闭按钮或取消按钮关闭
|
|
149
|
-
if (
|
|
150
|
-
|
|
160
|
+
if (onAfterCancel) {
|
|
161
|
+
onAfterCancel(e);
|
|
151
162
|
}
|
|
152
163
|
} else {
|
|
153
164
|
// 通过调用closeDialog关闭
|
|
154
|
-
if (
|
|
155
|
-
|
|
165
|
+
if (onAfterOk) {
|
|
166
|
+
onAfterOk(e);
|
|
156
167
|
}
|
|
157
168
|
}
|
|
158
169
|
|
|
159
170
|
// 入参有onClose
|
|
160
|
-
if (
|
|
161
|
-
|
|
171
|
+
if (onCancel) {
|
|
172
|
+
onCancel(e);
|
|
162
173
|
}
|
|
163
174
|
};
|
|
164
175
|
useImperativeHandle(ref, function () {
|
|
@@ -171,28 +182,27 @@ var HookModal = function HookModal(_ref3, ref) {
|
|
|
171
182
|
}
|
|
172
183
|
};
|
|
173
184
|
});
|
|
174
|
-
var styles = innerConfig.styles || {};
|
|
175
185
|
return /*#__PURE__*/_jsx(Modal, _objectSpread(_objectSpread({
|
|
176
186
|
onCancel: close,
|
|
177
187
|
afterClose: afterClose
|
|
178
188
|
}, innerConfig), {}, {
|
|
179
189
|
styles: _objectSpread({
|
|
180
|
-
footer: !
|
|
190
|
+
footer: !request ? {
|
|
181
191
|
padding: 0
|
|
182
192
|
} : undefined
|
|
183
193
|
}, styles),
|
|
184
|
-
className: classNames('ccs-dialog-modal',
|
|
185
|
-
footer:
|
|
194
|
+
className: classNames('ccs-dialog-modal', className),
|
|
195
|
+
footer: request ? /*#__PURE__*/_jsx("div", {
|
|
186
196
|
style: {
|
|
187
197
|
padding: '8px 16px'
|
|
188
198
|
},
|
|
189
199
|
children: /*#__PURE__*/_jsx(DialogSelfButton, {
|
|
190
|
-
auth:
|
|
191
|
-
request:
|
|
200
|
+
auth: auth,
|
|
201
|
+
request: request,
|
|
192
202
|
onCancel: close,
|
|
193
203
|
formRef: formRef,
|
|
194
|
-
onRequestBefore:
|
|
195
|
-
formInitialValues:
|
|
204
|
+
onRequestBefore: onRequestBefore,
|
|
205
|
+
formInitialValues: form === null || form === void 0 ? void 0 : form.initialValues
|
|
196
206
|
})
|
|
197
207
|
}) : /*#__PURE__*/_jsx(DialogButtonHolder, {
|
|
198
208
|
ref: buttonRef
|
|
@@ -218,7 +228,7 @@ var HookModal = function HookModal(_ref3, ref) {
|
|
|
218
228
|
});
|
|
219
229
|
});
|
|
220
230
|
},
|
|
221
|
-
children:
|
|
231
|
+
children: title
|
|
222
232
|
}),
|
|
223
233
|
modalRender: function modalRender(modal) {
|
|
224
234
|
return /*#__PURE__*/_jsx(DragModal, {
|
|
@@ -232,14 +242,14 @@ var HookModal = function HookModal(_ref3, ref) {
|
|
|
232
242
|
buttonRef: buttonRef,
|
|
233
243
|
buttonType: 'modal',
|
|
234
244
|
Buttons: CcsDialogButtons,
|
|
235
|
-
formInitialValues: (
|
|
245
|
+
formInitialValues: (form === null || form === void 0 ? void 0 : form.initialValues) || {},
|
|
236
246
|
closeDialog: close
|
|
237
247
|
},
|
|
238
|
-
children:
|
|
248
|
+
children: form ? /*#__PURE__*/_jsx(DialogForm, {
|
|
239
249
|
ref: formRef,
|
|
240
|
-
formProps:
|
|
241
|
-
children:
|
|
242
|
-
}) :
|
|
250
|
+
formProps: form,
|
|
251
|
+
children: content
|
|
252
|
+
}) : content
|
|
243
253
|
})
|
|
244
254
|
}));
|
|
245
255
|
};
|
package/es/dialog/button.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
export
|
|
2
|
+
export type DialogButtonsProps = {
|
|
3
3
|
okText?: string;
|
|
4
4
|
cancelText?: string;
|
|
5
5
|
okAuth?: string;
|
|
@@ -7,7 +7,7 @@ export interface DialogButtonsProps {
|
|
|
7
7
|
children?: ReactNode;
|
|
8
8
|
hideCancel?: boolean;
|
|
9
9
|
onOk?: (values?: any) => void;
|
|
10
|
-
}
|
|
10
|
+
};
|
|
11
11
|
export type DialogButtonRef = {
|
|
12
12
|
onSetButtons: (e: React.ReactElement) => void;
|
|
13
13
|
};
|
package/es/dialog/context.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Store } from 'antd/es/form/interface';
|
|
2
2
|
import React, { ReactElement, RefObject } from 'react';
|
|
3
3
|
import { DialogButtonRef, DialogButtonsProps } from './button';
|
|
4
|
-
|
|
4
|
+
type DialogContextType<T = Store> = {
|
|
5
5
|
/** 表单初始值 */
|
|
6
6
|
formInitialValues: T;
|
|
7
7
|
/** 按钮组件 */
|
|
@@ -14,7 +14,7 @@ export interface DialogContextType<T = Store> {
|
|
|
14
14
|
drawerFooterRef?: RefObject<DialogButtonRef>;
|
|
15
15
|
/** 关闭弹框,可以设置返回值 */
|
|
16
16
|
closeDialog: (e?: any) => void;
|
|
17
|
-
}
|
|
17
|
+
};
|
|
18
18
|
declare const DialogContentContext: React.Context<DialogContextType<any>>;
|
|
19
19
|
declare const useDialogContext: <T = Store>() => DialogContextType<T>;
|
|
20
|
-
export { useDialogContext, DialogContentContext };
|
|
20
|
+
export { DialogContextType, useDialogContext, DialogContentContext };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
|
|
2
|
+
type DialogButtonsProps = {
|
|
3
3
|
okText?: string;
|
|
4
4
|
cancelText?: string;
|
|
5
5
|
okAuth?: string;
|
|
@@ -7,6 +7,6 @@ interface DialogButtonsProps {
|
|
|
7
7
|
children?: ReactNode;
|
|
8
8
|
hideCancel?: boolean;
|
|
9
9
|
onOk?: (values?: any) => void;
|
|
10
|
-
}
|
|
10
|
+
};
|
|
11
11
|
export default function CcsDrawerFooter({ okText, okAuth, loading, children, hideCancel, cancelText, onOk, }: DialogButtonsProps): null;
|
|
12
12
|
export {};
|
package/es/dialog/form.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { FormInstance, FormProps } from 'antd';
|
|
2
2
|
import React, { CSSProperties, ReactNode } from 'react';
|
|
3
|
-
|
|
3
|
+
type PropsType = {
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
formProps: FormProps;
|
|
6
6
|
styles?: CSSProperties;
|
|
7
|
-
}
|
|
8
|
-
export
|
|
7
|
+
};
|
|
8
|
+
export type DialogFormRef = {
|
|
9
9
|
formInstance: FormInstance;
|
|
10
|
-
}
|
|
10
|
+
};
|
|
11
11
|
/**
|
|
12
12
|
* 添加form实例
|
|
13
13
|
* @returns
|
package/es/dialog/hook.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { DrawerProps, FormProps, ModalFuncProps } from 'antd';
|
|
2
2
|
import React, { ReactNode } from 'react';
|
|
3
3
|
import CCS from '..';
|
|
4
|
-
export
|
|
4
|
+
export type CcsDialogModal = {
|
|
5
5
|
destroy: () => void;
|
|
6
6
|
update: (config: ModalFuncProps) => void;
|
|
7
|
-
}
|
|
8
|
-
export
|
|
7
|
+
};
|
|
8
|
+
export type CcsDialogDrawer = {
|
|
9
9
|
destroy: () => void;
|
|
10
10
|
update: (config: DrawerProps) => void;
|
|
11
|
-
}
|
|
11
|
+
};
|
|
12
12
|
type ModalFunc = (props: ModalFuncProps) => {
|
|
13
13
|
destroy: () => void;
|
|
14
14
|
update: (configUpdate: ModalFuncProps) => void;
|
|
@@ -29,9 +29,9 @@ export type CcsDialogModalProps = ModalFuncProps & {
|
|
|
29
29
|
/** 关闭后销毁组件,默认true */
|
|
30
30
|
destroyOnClose?: boolean;
|
|
31
31
|
/** 通过closeDialog方法关闭dialog */
|
|
32
|
-
|
|
32
|
+
onAfterOk?: (e: any) => void;
|
|
33
33
|
/** 通过点击关闭按钮或取消按钮关闭 */
|
|
34
|
-
|
|
34
|
+
onAfterCancel?: (e: any) => void;
|
|
35
35
|
};
|
|
36
36
|
export type CcsDialogDrawerProps = Omit<DrawerProps, 'extra'> & {
|
|
37
37
|
/** antd form */
|
|
@@ -45,16 +45,16 @@ export type CcsDialogDrawerProps = Omit<DrawerProps, 'extra'> & {
|
|
|
45
45
|
/** request执行前参数处理 */
|
|
46
46
|
onRequestBefore?: (values: any) => any;
|
|
47
47
|
/** 通过closeDialog方法关闭dialog */
|
|
48
|
-
|
|
48
|
+
onAfterOk?: (e: any) => void;
|
|
49
49
|
/** 通过点击关闭按钮或取消按钮关闭 */
|
|
50
|
-
|
|
50
|
+
onAfterCancel?: (e: any) => void;
|
|
51
51
|
};
|
|
52
52
|
export type ModalDialog = (...args: Parameters<ModalFunc>) => ReturnType<ModalFunc>;
|
|
53
53
|
export type DrawerDialog = (...args: Parameters<ModalFunc>) => ReturnType<DrawerFunc>;
|
|
54
|
-
export
|
|
54
|
+
export type CcsDialogType = {
|
|
55
55
|
openDrawer: (props: CcsDialogDrawerProps) => ReturnType<DrawerDialog>;
|
|
56
56
|
openModal: (props: CcsDialogModalProps) => ReturnType<ModalDialog>;
|
|
57
57
|
contextHolder: React.JSX.Element;
|
|
58
|
-
}
|
|
58
|
+
};
|
|
59
59
|
export default function useCcsDialog(): CcsDialogType;
|
|
60
60
|
export {};
|
package/es/dialog/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { useDialogContext } from './context';
|
|
|
4
4
|
import CcsDrawerFooter from './drawer-footer';
|
|
5
5
|
import useCcsDialog from './hook';
|
|
6
6
|
import './index.less';
|
|
7
|
-
|
|
7
|
+
type DialogInterface = {
|
|
8
8
|
/** 获取openModal,openDrawer方法 */
|
|
9
9
|
useDialog: typeof useCcsDialog;
|
|
10
10
|
/** dialog 实例 */
|
|
@@ -13,6 +13,6 @@ interface DialogInterface {
|
|
|
13
13
|
Buttons: typeof CcsDialogButtons;
|
|
14
14
|
/** drawer footer */
|
|
15
15
|
DrawerFooter: typeof CcsDrawerFooter;
|
|
16
|
-
}
|
|
16
|
+
};
|
|
17
17
|
declare const CcsDialog: typeof ThemeDialog & DialogInterface;
|
|
18
18
|
export default CcsDialog;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ButtonProps } from 'antd';
|
|
2
|
-
|
|
2
|
+
type CcsIntervalButton = ButtonProps & {
|
|
3
3
|
/** 计时数 */
|
|
4
4
|
num?: number;
|
|
5
5
|
/** 包含字符串`num`的文本内容 */
|
|
6
6
|
disabledText?: string;
|
|
7
7
|
/** 缓存key */
|
|
8
8
|
cacheKey?: string;
|
|
9
|
-
}
|
|
9
|
+
};
|
|
10
10
|
/**
|
|
11
11
|
* 倒计时按钮组件
|
|
12
12
|
* @param PropsType
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import CCS from '../';
|
|
2
2
|
import './index.less';
|
|
3
|
-
|
|
3
|
+
type PropsType = {
|
|
4
4
|
maxLen?: number;
|
|
5
5
|
appName: string;
|
|
6
6
|
menus: CCS.MenuTreeNode[];
|
|
7
7
|
className?: string;
|
|
8
8
|
history: any;
|
|
9
|
-
}
|
|
9
|
+
};
|
|
10
10
|
declare const _default: ({ maxLen, appName, history, menus, className, }: PropsType) => import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Location } from 'history';
|
|
2
2
|
import { JSXElementConstructor, ReactElement } from 'react';
|
|
3
|
-
export
|
|
3
|
+
export type CachePageProps = {
|
|
4
4
|
/** 选中状态 */
|
|
5
5
|
active: boolean;
|
|
6
6
|
/** router location */
|
|
@@ -12,6 +12,6 @@ export interface CachePageProps {
|
|
|
12
12
|
children: ReactElement<any, string | JSXElementConstructor<any>> | null;
|
|
13
13
|
/** 销毁页面 */
|
|
14
14
|
onDestroy: (path: string) => void;
|
|
15
|
-
}
|
|
15
|
+
};
|
|
16
16
|
declare const _default: import("react").MemoExoticComponent<(props: CachePageProps) => import("react/jsx-runtime").JSX.Element>;
|
|
17
17
|
export default _default;
|
package/es/loading/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
type CcsLoadingProps = {
|
|
2
2
|
/**
|
|
3
3
|
* loading 状态
|
|
4
4
|
* @default false
|
|
@@ -6,6 +6,6 @@ interface CcsLoadingProps {
|
|
|
6
6
|
loading?: boolean;
|
|
7
7
|
/** loading 文字说明 */
|
|
8
8
|
loadingTip?: string;
|
|
9
|
-
}
|
|
9
|
+
};
|
|
10
10
|
declare const Loading: ({ loading, loadingTip }: CcsLoadingProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
11
11
|
export default Loading;
|
package/es/pro-grid/context.d.ts
CHANGED
package/es/pro-grid/index.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { CardProps } from 'antd';
|
|
2
2
|
import { CSSProperties, FC, ReactNode } from 'react';
|
|
3
3
|
import './index.less';
|
|
4
|
-
|
|
4
|
+
type ClassProps = {
|
|
5
5
|
className?: string;
|
|
6
6
|
style?: CSSProperties;
|
|
7
|
-
}
|
|
8
|
-
|
|
7
|
+
};
|
|
8
|
+
type CcsProGridProps = ClassProps & {
|
|
9
9
|
title?: string;
|
|
10
10
|
titleExtra?: ReactNode;
|
|
11
11
|
bordered?: boolean;
|
|
12
12
|
hideTitle?: boolean;
|
|
13
13
|
children?: ReactNode;
|
|
14
|
-
}
|
|
15
|
-
|
|
14
|
+
};
|
|
15
|
+
type ColProps = CardProps & {
|
|
16
16
|
colSpan?: string | number;
|
|
17
17
|
colStyle?: CSSProperties;
|
|
18
18
|
colClassName?: string;
|
|
19
|
-
}
|
|
20
|
-
|
|
19
|
+
};
|
|
20
|
+
type GridInstance = FC<CcsProGridProps> & {
|
|
21
21
|
Col: typeof GridCol;
|
|
22
|
-
}
|
|
22
|
+
};
|
|
23
23
|
declare const GridCol: ({ colSpan, colClassName, colStyle, ...otherProps }: ColProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
24
|
declare const ProGrid: GridInstance;
|
|
25
25
|
export default ProGrid;
|
package/es/pro-table/index.d.ts
CHANGED
|
@@ -8,10 +8,10 @@ export type ShowDependType = {
|
|
|
8
8
|
value: any;
|
|
9
9
|
};
|
|
10
10
|
type SearchEventType = 'search' | 'reset' | 'reload' | 'changePage' | 'initSearch';
|
|
11
|
-
|
|
11
|
+
type SearchBeforeType = ParamType & {
|
|
12
12
|
query: ParamType;
|
|
13
|
-
}
|
|
14
|
-
export
|
|
13
|
+
};
|
|
14
|
+
export type CcsTableProps<T> = TableProps<T> & {
|
|
15
15
|
data?: CCS.TableData<T>;
|
|
16
16
|
/** request 方法 */
|
|
17
17
|
request?: (params: any) => void;
|
|
@@ -29,8 +29,8 @@ export interface CcsTableProps<T> extends TableProps<T> {
|
|
|
29
29
|
event$?: any;
|
|
30
30
|
/** style */
|
|
31
31
|
style?: CSSProperties;
|
|
32
|
-
}
|
|
33
|
-
export
|
|
32
|
+
};
|
|
33
|
+
export type CcsProTableProps<T> = {
|
|
34
34
|
/** api权限标识 */
|
|
35
35
|
auth?: string | 'ignore';
|
|
36
36
|
/** 是否初始查询,默认true */
|
|
@@ -71,7 +71,7 @@ export interface CcsProTableProps<T> {
|
|
|
71
71
|
onSearchBefore?: (params: SearchBeforeType, eventType?: SearchEventType) => SearchBeforeType;
|
|
72
72
|
/** 请求后格式化结果 */
|
|
73
73
|
onSearchAfter?: (data: any, eventType?: SearchEventType) => any;
|
|
74
|
-
}
|
|
74
|
+
};
|
|
75
75
|
export declare const classPrefix = "ccs-pl";
|
|
76
76
|
/**
|
|
77
77
|
* 布局组件 包括form、查询、toolbar、table 自动初始化数据
|
package/es/pro-table/search.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { EventEmitter } from 'ahooks/lib/useEventEmitter';
|
|
|
2
2
|
import { FormInstance } from 'antd/lib/form';
|
|
3
3
|
import { ReactElement } from 'react';
|
|
4
4
|
import { CcsProTableProps } from './';
|
|
5
|
-
|
|
5
|
+
type PropsType<T> = Pick<CcsProTableProps<T>, 'toolbar' | 'formItems' | 'formInitValues' | 'expandForm' | 'disableCollapseForm' | 'formItemLabelWidth' | 'title'> & {
|
|
6
6
|
/** 显示列 */
|
|
7
7
|
columns?: any;
|
|
8
8
|
/** 更多查询条件 */
|
|
@@ -16,7 +16,7 @@ interface PropsType<T> extends Pick<CcsProTableProps<T>, 'toolbar' | 'formItems'
|
|
|
16
16
|
onReset: () => void;
|
|
17
17
|
onSearch: () => void;
|
|
18
18
|
event$: EventEmitter<any>;
|
|
19
|
-
}
|
|
19
|
+
};
|
|
20
20
|
/** 操作按钮、查询,重置、列筛选、 */
|
|
21
21
|
declare function SearchComponent<T>({ form, title, event$, toolbar, columns, children, expandForm, titleBordered, formItems, formInitValues, isInModalOrDrawer, formItemLabelWidth, disableCollapseForm, onReset, onSearch, }: PropsType<T>): import("react/jsx-runtime").JSX.Element;
|
|
22
22
|
export default SearchComponent;
|
package/es/pro-tabs/index.d.ts
CHANGED
package/es/status-tag/index.d.ts
CHANGED
package/es/theme.d.ts
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
import { ThemeConfig } from 'antd';
|
|
2
2
|
import { ReactElement } from 'react';
|
|
3
3
|
import { GlobalConfig } from './ccs';
|
|
4
|
-
interface AppThemeProps {
|
|
5
|
-
theme: GlobalConfig['AppTheme'];
|
|
6
|
-
themeConfig?: ThemeConfig;
|
|
7
|
-
children: ReactElement;
|
|
8
|
-
}
|
|
9
4
|
/** 主题设置 */
|
|
10
|
-
|
|
5
|
+
type AppThemeProps = {
|
|
11
6
|
theme: GlobalConfig['AppTheme'];
|
|
12
7
|
themeConfig?: ThemeConfig;
|
|
13
8
|
children: ReactElement;
|
|
14
|
-
}
|
|
9
|
+
};
|
|
15
10
|
/** 主题设置 */
|
|
16
11
|
export default function AppTheme({ theme, themeConfig, children, }: AppThemeProps): import("react/jsx-runtime").JSX.Element;
|
|
17
12
|
export {};
|
package/es/trigger/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CSSProperties, ReactElement } from 'react';
|
|
2
2
|
import { SizeType } from 'antd/es/config-provider/SizeContext';
|
|
3
3
|
import './index.less';
|
|
4
|
-
export
|
|
4
|
+
export type CcsTriggerProps = {
|
|
5
5
|
/** 下拉框宽度 */
|
|
6
6
|
width?: number;
|
|
7
7
|
/** 下拉框高度 */
|
|
@@ -38,7 +38,7 @@ export interface CcsTriggerProps {
|
|
|
38
38
|
popupContainer?: boolean;
|
|
39
39
|
/** Form.Item onChange */
|
|
40
40
|
onChange?: (value?: any) => void;
|
|
41
|
-
}
|
|
41
|
+
};
|
|
42
42
|
/**
|
|
43
43
|
* 适用于Form.Item中的 trigger组件,其内容自行定义,遵循ant form 自定义组件规范
|
|
44
44
|
* @param CcsTriggerPropsType
|
package/es/utils/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import dayjs from 'dayjs';
|
|
2
|
-
|
|
2
|
+
type DayjsType = dayjs.Dayjs & {
|
|
3
3
|
fromNow(withoutSuffix?: boolean): string;
|
|
4
4
|
from(compared: dayjs.ConfigType, withoutSuffix?: boolean): string;
|
|
5
5
|
toNow(withoutSuffix?: boolean): string;
|
|
6
6
|
to(compared: dayjs.ConfigType, withoutSuffix?: boolean): string;
|
|
7
|
-
}
|
|
7
|
+
};
|
|
8
8
|
export default class utils {
|
|
9
9
|
/**
|
|
10
10
|
* 是函数?
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { CSSProperties, ReactNode, RefObject } from 'react';
|
|
2
|
-
|
|
2
|
+
type Position = {
|
|
3
3
|
left: number;
|
|
4
4
|
top: number;
|
|
5
|
-
}
|
|
6
|
-
export
|
|
5
|
+
};
|
|
6
|
+
export type RowRendererProps = {
|
|
7
7
|
rowHeight: number;
|
|
8
8
|
index: number;
|
|
9
|
-
}
|
|
10
|
-
export
|
|
9
|
+
};
|
|
10
|
+
export type VirtualInstance = {
|
|
11
11
|
scrollTop: (top: number) => void;
|
|
12
|
-
}
|
|
13
|
-
export
|
|
12
|
+
};
|
|
13
|
+
export type VirtualListProps = {
|
|
14
14
|
/** 容器高度 */
|
|
15
15
|
height?: number;
|
|
16
16
|
/** 记录条数 */
|
|
@@ -34,11 +34,11 @@ export interface VirtualListProps {
|
|
|
34
34
|
rowRenderer: ({ rowHeight, index }: RowRendererProps) => ReactNode;
|
|
35
35
|
/** scroll event */
|
|
36
36
|
onScroll?: (position: Position) => void;
|
|
37
|
-
}
|
|
38
|
-
export
|
|
37
|
+
};
|
|
38
|
+
export type VirtualListItemProps = Pick<VirtualListProps, 'rowHeight' | 'rowRenderer'> & {
|
|
39
39
|
index: number;
|
|
40
|
-
}
|
|
41
|
-
export
|
|
40
|
+
};
|
|
41
|
+
export type ListItemProps = {
|
|
42
42
|
prefix: ReactNode;
|
|
43
43
|
title: ReactNode;
|
|
44
44
|
extra?: ReactNode;
|
|
@@ -47,6 +47,6 @@ export interface ListItemProps {
|
|
|
47
47
|
className?: string;
|
|
48
48
|
description?: ReactNode;
|
|
49
49
|
onClick?: () => void;
|
|
50
|
-
}
|
|
50
|
+
};
|
|
51
51
|
declare const VirtualList: ({ height, rowCount, rowHeight, className, style, virtualRef, onScroll, rowRenderer, autoHideScroll, overscanRowCount, rowCountChangeScrollTop, }: VirtualListProps) => import("react/jsx-runtime").JSX.Element;
|
|
52
52
|
export default VirtualList;
|