@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
|
@@ -2,18 +2,16 @@ import classnames from 'classnames';
|
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
import { useLocation } from 'react-router';
|
|
4
4
|
import { useOutlet } from 'react-router-dom';
|
|
5
|
-
import CcsBreadcrumb from "../breadcrumb";
|
|
6
5
|
import { findMenusByUrl } from "../layout-keep-alive";
|
|
7
6
|
import CcsResult from "../result";
|
|
8
7
|
import "./index.less";
|
|
9
8
|
import Page from "./page";
|
|
10
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
|
|
10
|
+
function SinglePage(_ref) {
|
|
12
11
|
var appName = _ref.appName,
|
|
13
12
|
_ref$menuItems = _ref.menuItems,
|
|
14
13
|
menuItems = _ref$menuItems === void 0 ? [] : _ref$menuItems,
|
|
15
|
-
className = _ref.className
|
|
16
|
-
history = _ref.history;
|
|
14
|
+
className = _ref.className;
|
|
17
15
|
var location = useLocation();
|
|
18
16
|
var pathname = location.pathname;
|
|
19
17
|
var outlet = useOutlet();
|
|
@@ -29,17 +27,16 @@ export default function SinglePage(_ref) {
|
|
|
29
27
|
setTimeout(function () {
|
|
30
28
|
document.title = "".concat((menu === null || menu === void 0 ? void 0 : menu.label) || (menu === null || menu === void 0 ? void 0 : menu.url), " - ").concat(appName);
|
|
31
29
|
}, 10);
|
|
32
|
-
var breadcrumb = menus.map(function (m
|
|
30
|
+
var breadcrumb = menus.map(function (m) {
|
|
33
31
|
return {
|
|
34
32
|
key: m.key,
|
|
35
|
-
title: m.label
|
|
36
|
-
href:
|
|
33
|
+
title: m.label
|
|
34
|
+
// href: m.url,
|
|
37
35
|
};
|
|
38
36
|
});
|
|
39
37
|
breadcrumb.unshift({
|
|
40
38
|
key: '-1',
|
|
41
|
-
title: '首页'
|
|
42
|
-
href: '/'
|
|
39
|
+
title: '首页'
|
|
43
40
|
});
|
|
44
41
|
return {
|
|
45
42
|
auth: ((_menu$btnAuth = menu.btnAuth) === null || _menu$btnAuth === void 0 ? void 0 : _menu$btnAuth.map(function (b) {
|
|
@@ -54,17 +51,14 @@ export default function SinglePage(_ref) {
|
|
|
54
51
|
children: menuInfo !== null && menuInfo !== void 0 && menuInfo.auth ? /*#__PURE__*/_jsx(Page, {
|
|
55
52
|
location: location,
|
|
56
53
|
urlAuthList: menuInfo.auth,
|
|
57
|
-
|
|
58
|
-
history: history,
|
|
59
|
-
className: "ccs-breadcrumb",
|
|
60
|
-
items: menuInfo.breadcrumb
|
|
61
|
-
}),
|
|
54
|
+
breadcrumb: menuInfo.breadcrumb,
|
|
62
55
|
children: outlet
|
|
63
|
-
}) : /*#__PURE__*/_jsx(CcsResult.
|
|
64
|
-
|
|
65
|
-
marginTop: 100
|
|
66
|
-
},
|
|
67
|
-
iconWidth: 200
|
|
56
|
+
}) : /*#__PURE__*/_jsx(CcsResult.Page404, {
|
|
57
|
+
subTitle: "\u9875\u9762\u4E0D\u5B58\u5728"
|
|
68
58
|
})
|
|
69
59
|
});
|
|
70
|
-
}
|
|
60
|
+
}
|
|
61
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
62
|
+
SinglePage.displayName = 'CcsSinglePage';
|
|
63
|
+
}
|
|
64
|
+
export default SinglePage;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { JSXElementConstructor, ReactElement
|
|
1
|
+
import { JSXElementConstructor, ReactElement } from 'react';
|
|
2
2
|
import { Location } from 'react-router';
|
|
3
|
-
import {
|
|
4
|
-
export type SinglePageProps = Pick<
|
|
3
|
+
import { CacheRouter } from '../layout-keep-alive';
|
|
4
|
+
export type SinglePageProps = Pick<CacheRouter, 'breadcrumb' | 'urlAuthList'> & {
|
|
5
5
|
/** router location */
|
|
6
6
|
location: Location;
|
|
7
|
-
/** 面包屑 */
|
|
8
|
-
breadcrumbNode: ReactNode;
|
|
9
7
|
/** children */
|
|
10
8
|
children: ReactElement<any, string | JSXElementConstructor<any>> | null;
|
|
11
9
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Breadcrumb } from 'antd';
|
|
1
2
|
import { memo, useRef } from 'react';
|
|
2
3
|
import Scrollbars from 'react-custom-scrollbars';
|
|
3
4
|
import { PageContext } from "../context";
|
|
@@ -9,7 +10,8 @@ export default /*#__PURE__*/memo(function (props) {
|
|
|
9
10
|
var children = props.children,
|
|
10
11
|
_props$urlAuthList = props.urlAuthList,
|
|
11
12
|
urlAuthList = _props$urlAuthList === void 0 ? [] : _props$urlAuthList,
|
|
12
|
-
|
|
13
|
+
_props$breadcrumb = props.breadcrumb,
|
|
14
|
+
breadcrumb = _props$breadcrumb === void 0 ? [] : _props$breadcrumb;
|
|
13
15
|
var dialogHolderRef = useRef(null);
|
|
14
16
|
return /*#__PURE__*/_jsx(PageContext.Provider, {
|
|
15
17
|
value: {
|
|
@@ -27,7 +29,10 @@ export default /*#__PURE__*/memo(function (props) {
|
|
|
27
29
|
children: /*#__PURE__*/_jsxs(Scrollbars, {
|
|
28
30
|
autoHide: true,
|
|
29
31
|
className: "ccs-sticky-scroll",
|
|
30
|
-
children: [
|
|
32
|
+
children: [/*#__PURE__*/_jsx(Breadcrumb, {
|
|
33
|
+
items: breadcrumb,
|
|
34
|
+
className: "ccs-breadcrumb"
|
|
35
|
+
}), children, /*#__PURE__*/_jsx(DialogElementsHolder, {
|
|
31
36
|
ref: dialogHolderRef
|
|
32
37
|
}, "modal-drawer-holder")]
|
|
33
38
|
})
|
package/es/loading/index.d.ts
CHANGED
|
@@ -7,5 +7,8 @@ type CcsLoadingProps = {
|
|
|
7
7
|
/** loading 文字说明 */
|
|
8
8
|
loadingTip?: string;
|
|
9
9
|
};
|
|
10
|
-
declare const Loading:
|
|
10
|
+
declare const Loading: {
|
|
11
|
+
({ loading, loadingTip }: CcsLoadingProps): import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
displayName: string;
|
|
13
|
+
};
|
|
11
14
|
export default Loading;
|
package/es/loading/index.js
CHANGED
|
@@ -11,7 +11,7 @@ var Loading = function Loading(_ref) {
|
|
|
11
11
|
position: 'absolute',
|
|
12
12
|
inset: 0,
|
|
13
13
|
background: 'rgba(0, 0, 0, 0.1)',
|
|
14
|
-
zIndex:
|
|
14
|
+
zIndex: 9999
|
|
15
15
|
},
|
|
16
16
|
children: /*#__PURE__*/_jsxs("div", {
|
|
17
17
|
style: {
|
|
@@ -37,4 +37,7 @@ var Loading = function Loading(_ref) {
|
|
|
37
37
|
})
|
|
38
38
|
}) : null;
|
|
39
39
|
};
|
|
40
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
41
|
+
Loading.displayName = 'CcsLoading';
|
|
42
|
+
}
|
|
40
43
|
export default Loading;
|
package/es/pro-table/head.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { FormInstance } from 'antd
|
|
2
|
-
import { ReactElement } from 'react';
|
|
3
|
-
import { PropsWithElementChildren } from '../ccs';
|
|
1
|
+
import { FormInstance } from 'antd';
|
|
2
|
+
import React, { ReactElement } from 'react';
|
|
4
3
|
import { CcsProTableProps } from './table';
|
|
5
|
-
type PropsType<T> = Pick<CcsProTableProps<T>, 'toolbar' | 'formItems' | 'formInitValues' | 'expandForm' | '
|
|
4
|
+
type PropsType<T> = Pick<CcsProTableProps<T>, 'toolbar' | 'formItems' | 'formInitValues' | 'expandForm' | 'formItemLabelWidth'> & {
|
|
6
5
|
/** 更多查询条件 */
|
|
7
6
|
hasMore?: boolean;
|
|
8
|
-
form: FormInstance<any>;
|
|
9
7
|
/** table 操作栏 */
|
|
10
|
-
tableOperation
|
|
8
|
+
tableOperation?: ReactElement;
|
|
9
|
+
/** 查询 */
|
|
11
10
|
onSearch: () => void;
|
|
11
|
+
/** form */
|
|
12
|
+
formRef: React.RefObject<FormInstance<any>>;
|
|
12
13
|
};
|
|
13
14
|
/** 操作按钮、查询,重置、列筛选、 */
|
|
14
|
-
declare function HeadComponent<T>({
|
|
15
|
+
declare function HeadComponent<T>({ toolbar, expandForm, formItems, formInitValues, formItemLabelWidth, tableOperation, formRef, onSearch, }: PropsType<T>): import("react/jsx-runtime").JSX.Element;
|
|
15
16
|
export default HeadComponent;
|
package/es/pro-table/head.js
CHANGED
|
@@ -6,9 +6,9 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import { DownOutlined, UpOutlined } from '@ant-design/icons';
|
|
8
8
|
import { useUpdateEffect } from 'ahooks';
|
|
9
|
-
import { Button,
|
|
9
|
+
import { Button, Form, theme } from 'antd';
|
|
10
10
|
import _debounce from 'lodash.debounce';
|
|
11
|
-
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
11
|
+
import React, { useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
12
12
|
import { CcsResizeObserver } from '..';
|
|
13
13
|
import { getShowDpends } from "./_utils";
|
|
14
14
|
import HeadFormItem from "./form-item";
|
|
@@ -17,10 +17,7 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
17
17
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
18
18
|
/** 操作按钮、查询,重置、列筛选、 */
|
|
19
19
|
function HeadComponent(_ref) {
|
|
20
|
-
var
|
|
21
|
-
title = _ref.title,
|
|
22
|
-
toolbar = _ref.toolbar,
|
|
23
|
-
children = _ref.children,
|
|
20
|
+
var toolbar = _ref.toolbar,
|
|
24
21
|
_ref$expandForm = _ref.expandForm,
|
|
25
22
|
expandForm = _ref$expandForm === void 0 ? false : _ref$expandForm,
|
|
26
23
|
_ref$formItems = _ref.formItems,
|
|
@@ -28,20 +25,29 @@ function HeadComponent(_ref) {
|
|
|
28
25
|
formInitValues = _ref.formInitValues,
|
|
29
26
|
formItemLabelWidth = _ref.formItemLabelWidth,
|
|
30
27
|
tableOperation = _ref.tableOperation,
|
|
28
|
+
formRef = _ref.formRef,
|
|
31
29
|
onSearch = _ref.onSearch;
|
|
30
|
+
var _Form$useForm = Form.useForm(),
|
|
31
|
+
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
32
|
+
form = _Form$useForm2[0];
|
|
32
33
|
var formItemsRef = useRef(null);
|
|
34
|
+
// 根据位置判断是否换行ref
|
|
35
|
+
var endItemRef = useRef(null);
|
|
33
36
|
// 查询条件是否展开
|
|
34
37
|
var _useState = useState(expandForm),
|
|
35
38
|
_useState2 = _slicedToArray(_useState, 2),
|
|
36
39
|
isExpand = _useState2[0],
|
|
37
40
|
setIsExpand = _useState2[1];
|
|
38
|
-
var _useState3 = useState(
|
|
41
|
+
var _useState3 = useState(false),
|
|
39
42
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
hasMore = _useState4[0],
|
|
44
|
+
onToggle = _useState4[1];
|
|
42
45
|
useUpdateEffect(function () {
|
|
43
46
|
setIsExpand(expandForm);
|
|
44
47
|
}, [expandForm]);
|
|
48
|
+
useImperativeHandle(formRef, function () {
|
|
49
|
+
return form;
|
|
50
|
+
});
|
|
45
51
|
|
|
46
52
|
// 处理form item 依赖
|
|
47
53
|
var allFormItems = useMemo(function () {
|
|
@@ -54,33 +60,26 @@ function HeadComponent(_ref) {
|
|
|
54
60
|
return formItems;
|
|
55
61
|
}, [formItems]);
|
|
56
62
|
|
|
57
|
-
//
|
|
58
|
-
var
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}, 500);
|
|
63
|
+
// 判断是否有更多条件无法一行显示
|
|
64
|
+
var onEventMore = function onEventMore() {
|
|
65
|
+
var _endItemRef$current, _formItemsRef$current;
|
|
66
|
+
if (!endItemRef.current || !formItemsRef.current || isExpand) return;
|
|
67
|
+
var hasMore = ((_endItemRef$current = endItemRef.current) === null || _endItemRef$current === void 0 || (_endItemRef$current = _endItemRef$current.getClientRects()[0]) === null || _endItemRef$current === void 0 ? void 0 : _endItemRef$current.top) !== ((_formItemsRef$current = formItemsRef.current) === null || _formItemsRef$current === void 0 || (_formItemsRef$current = _formItemsRef$current.getClientRects()[0]) === null || _formItemsRef$current === void 0 ? void 0 : _formItemsRef$current.top);
|
|
68
|
+
onToggle(hasMore);
|
|
69
|
+
};
|
|
65
70
|
|
|
66
71
|
// 监听dom尺寸变化
|
|
67
|
-
var
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
var scrollHeight = ((_formItemsRef$current = formItemsRef.current) === null || _formItemsRef$current === void 0 ? void 0 : _formItemsRef$current.scrollHeight) || 0;
|
|
71
|
-
if (scrollHeight === 0) return;
|
|
72
|
-
var hm = scrollHeight > 40 ? 'more' : 'visible';
|
|
73
|
-
resizeFn(hm);
|
|
72
|
+
var resizeFn = function resizeFn(e) {
|
|
73
|
+
if (e.width === 0) return;
|
|
74
|
+
onEventMore();
|
|
74
75
|
};
|
|
76
|
+
|
|
77
|
+
// 监听容器尺寸变化
|
|
78
|
+
var onResize = _debounce(resizeFn, 500);
|
|
75
79
|
useEffect(function () {
|
|
76
|
-
|
|
77
|
-
var scrollHeight = ((_formItemsRef$current2 = formItemsRef.current) === null || _formItemsRef$current2 === void 0 ? void 0 : _formItemsRef$current2.scrollHeight) || 0;
|
|
78
|
-
setVisible(scrollHeight > 40 ? 'more' : 'visible');
|
|
80
|
+
onEventMore();
|
|
79
81
|
}, []);
|
|
80
82
|
|
|
81
|
-
// 是否有更多
|
|
82
|
-
var hasMore = itemLen > 1 && visible === 'more';
|
|
83
|
-
|
|
84
83
|
// 操作按钮
|
|
85
84
|
var renderSearchBtn = /*#__PURE__*/_jsxs("div", {
|
|
86
85
|
style: {
|
|
@@ -102,9 +101,6 @@ function HeadComponent(_ref) {
|
|
|
102
101
|
onClick: function onClick() {
|
|
103
102
|
return form.submit();
|
|
104
103
|
},
|
|
105
|
-
style: {
|
|
106
|
-
marginLeft: !hasMore ? 10 : undefined
|
|
107
|
-
},
|
|
108
104
|
children: "\u67E5\u8BE2"
|
|
109
105
|
}), toolbar ? null : tableOperation]
|
|
110
106
|
});
|
|
@@ -170,77 +166,35 @@ function HeadComponent(_ref) {
|
|
|
170
166
|
// 获取Input的高度
|
|
171
167
|
var token = theme.useToken().token;
|
|
172
168
|
var controlHeight = token.rootValue ? "".concat((token.controlHeight / token.rootValue).toFixed(3), "rem") : token.controlHeight;
|
|
173
|
-
return /*#__PURE__*/
|
|
174
|
-
children:
|
|
169
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
170
|
+
children: allFormItems.length > 0 && /*#__PURE__*/_jsxs(_Fragment, {
|
|
175
171
|
children: [/*#__PURE__*/_jsx(CcsResizeObserver.Target, {
|
|
176
172
|
targetRef: formItemsRef,
|
|
177
173
|
onResize: onResize
|
|
178
|
-
}), /*#__PURE__*/
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
height: isExpand ? 'auto' : controlHeight
|
|
201
|
-
},
|
|
202
|
-
className: "ccs-pl-adaptation-form",
|
|
203
|
-
ref: formItemsRef,
|
|
204
|
-
children: [renderFormItems(), isExpand && renderSearchBtn]
|
|
205
|
-
}), !isExpand && /*#__PURE__*/_jsx("div", {
|
|
206
|
-
style: {
|
|
207
|
-
flex: '0 0 auto'
|
|
208
|
-
},
|
|
209
|
-
children: renderSearchBtn
|
|
210
|
-
})]
|
|
211
|
-
})
|
|
212
|
-
})]
|
|
213
|
-
}), toolbar && /*#__PURE__*/_jsxs(Card, {
|
|
214
|
-
styles: {
|
|
215
|
-
cover: {
|
|
216
|
-
borderRadius: 0
|
|
217
|
-
},
|
|
218
|
-
body: {
|
|
219
|
-
display: 'flex',
|
|
220
|
-
justifyContent: 'space-between',
|
|
221
|
-
width: '100%',
|
|
222
|
-
padding: '12px 16px',
|
|
223
|
-
alignContent: 'center'
|
|
224
|
-
}
|
|
225
|
-
},
|
|
226
|
-
style: {
|
|
227
|
-
borderRadius: 0,
|
|
228
|
-
borderLeft: 0,
|
|
229
|
-
borderBottom: 0,
|
|
230
|
-
borderRight: 0
|
|
231
|
-
},
|
|
232
|
-
children: [/*#__PURE__*/_jsx("div", {
|
|
233
|
-
style: {
|
|
234
|
-
flex: '1 1 auto'
|
|
235
|
-
},
|
|
236
|
-
children: toolbar
|
|
237
|
-
}), /*#__PURE__*/_jsx("div", {
|
|
238
|
-
style: {
|
|
239
|
-
flex: '0 0 auto'
|
|
240
|
-
},
|
|
241
|
-
children: tableOperation
|
|
174
|
+
}), /*#__PURE__*/_jsxs(Form, {
|
|
175
|
+
initialValues: formInitValues,
|
|
176
|
+
form: form,
|
|
177
|
+
onFinish: onSearch,
|
|
178
|
+
layout: "inline",
|
|
179
|
+
style: formStyles,
|
|
180
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
181
|
+
style: {
|
|
182
|
+
justifyContent: isExpand && hasMore ? 'flex-start' : 'flex-end',
|
|
183
|
+
height: isExpand ? 'auto' : controlHeight
|
|
184
|
+
},
|
|
185
|
+
className: "ccs-pl-adaptation-form",
|
|
186
|
+
ref: formItemsRef,
|
|
187
|
+
children: [renderFormItems(), /*#__PURE__*/_jsx("div", {
|
|
188
|
+
ref: endItemRef
|
|
189
|
+
}), isExpand && renderSearchBtn]
|
|
190
|
+
}), !isExpand && /*#__PURE__*/_jsx("div", {
|
|
191
|
+
style: {
|
|
192
|
+
flex: '0 0 auto'
|
|
193
|
+
},
|
|
194
|
+
children: renderSearchBtn
|
|
195
|
+
})]
|
|
242
196
|
})]
|
|
243
|
-
})
|
|
197
|
+
})
|
|
244
198
|
});
|
|
245
199
|
}
|
|
246
200
|
export default HeadComponent;
|
package/es/pro-table/index.d.ts
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import './index.less';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
type TableTreeProps<T> = Omit<CcsProTableProps<T>, 'onSearchAfter'> & {
|
|
2
|
+
import SelectionAlert from './selection-alert';
|
|
3
|
+
import TableSummary from './summary';
|
|
4
|
+
import { CcsProTableProps } from './table';
|
|
5
|
+
type TableProps<T> = Omit<CcsProTableProps<T>, 'parentFieldName'>;
|
|
6
|
+
type TableTreeProps<T> = CcsProTableProps<T> & {
|
|
8
7
|
/** 父级值字段 */
|
|
9
8
|
parentFieldName: string;
|
|
10
|
-
/** 请求后格式化结果 */
|
|
11
|
-
onSearchAfter?: (data: any, eventType?: SearchEventType) => any;
|
|
12
9
|
};
|
|
13
10
|
/**
|
|
14
11
|
* 查询表格组件
|
|
@@ -19,5 +16,8 @@ type TableTreeProps<T> = Omit<CcsProTableProps<T>, 'onSearchAfter'> & {
|
|
|
19
16
|
declare const ProTable: {
|
|
20
17
|
<T extends object = any>(props: TableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
21
18
|
Tree: <T_1 extends object = any>(props: TableTreeProps<T_1>) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
SelectionAlert: typeof SelectionAlert;
|
|
20
|
+
Summary: typeof TableSummary;
|
|
21
|
+
displayName: string;
|
|
22
22
|
};
|
|
23
23
|
export default ProTable;
|
package/es/pro-table/index.js
CHANGED
|
@@ -5,6 +5,8 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
import "./index.less";
|
|
8
|
+
import SelectionAlert from "./selection-alert";
|
|
9
|
+
import TableSummary from "./summary";
|
|
8
10
|
import InternalProTable from "./table";
|
|
9
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
12
|
/**
|
|
@@ -24,9 +26,12 @@ var ProTable = function ProTable(props) {
|
|
|
24
26
|
* @returns
|
|
25
27
|
*/
|
|
26
28
|
var ProTableTree = function ProTableTree(props) {
|
|
27
|
-
return /*#__PURE__*/_jsx(InternalProTable, _objectSpread(
|
|
28
|
-
onSearchAfter: props.onSearchAfter
|
|
29
|
-
}));
|
|
29
|
+
return /*#__PURE__*/_jsx(InternalProTable, _objectSpread({}, props));
|
|
30
30
|
};
|
|
31
31
|
ProTable.Tree = ProTableTree;
|
|
32
|
+
ProTable.SelectionAlert = SelectionAlert;
|
|
33
|
+
ProTable.Summary = TableSummary;
|
|
34
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
35
|
+
ProTable.displayName = 'CcsProTable';
|
|
36
|
+
}
|
|
32
37
|
export default ProTable;
|
package/es/pro-table/index.less
CHANGED
|
@@ -49,6 +49,10 @@
|
|
|
49
49
|
&-table-content {
|
|
50
50
|
position: relative;
|
|
51
51
|
flex: auto;
|
|
52
|
+
|
|
53
|
+
.ant-table-title {
|
|
54
|
+
padding: 0 !important;
|
|
55
|
+
}
|
|
52
56
|
}
|
|
53
57
|
|
|
54
58
|
&-adaptation {
|
|
@@ -61,13 +65,14 @@
|
|
|
61
65
|
&-adaptation-form {
|
|
62
66
|
flex: 1 1 auto;
|
|
63
67
|
display: flex;
|
|
68
|
+
justify-content: flex-end;
|
|
64
69
|
flex-wrap: wrap;
|
|
65
70
|
gap: 16px 10px;
|
|
66
71
|
overflow: hidden;
|
|
67
72
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
73
|
+
&::-webkit-scrollbar {
|
|
74
|
+
display: none;
|
|
75
|
+
}
|
|
71
76
|
}
|
|
72
77
|
|
|
73
78
|
.ant-form-item {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TagProps } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
interface PropsType {
|
|
4
|
+
data: any[];
|
|
5
|
+
color?: TagProps['color'];
|
|
6
|
+
fieldNames: {
|
|
7
|
+
key: string;
|
|
8
|
+
label: string;
|
|
9
|
+
};
|
|
10
|
+
onClear: (key?: React.Key) => void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* 显示table行选中项
|
|
14
|
+
* @param PropsType
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
17
|
+
export default function SelectionAlert({ data, color, fieldNames, onClear, }: PropsType): import("react/jsx-runtime").JSX.Element | undefined;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { DeleteOutlined } from '@ant-design/icons';
|
|
2
|
+
import { Button, Space, Tag } from 'antd';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
/**
|
|
7
|
+
* 显示table行选中项
|
|
8
|
+
* @param PropsType
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
export default function SelectionAlert(_ref) {
|
|
12
|
+
var data = _ref.data,
|
|
13
|
+
color = _ref.color,
|
|
14
|
+
_ref$fieldNames = _ref.fieldNames,
|
|
15
|
+
fieldNames = _ref$fieldNames === void 0 ? {
|
|
16
|
+
key: 'key',
|
|
17
|
+
label: 'label'
|
|
18
|
+
} : _ref$fieldNames,
|
|
19
|
+
onClear = _ref.onClear;
|
|
20
|
+
if (!data || data.length === 0) {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
return /*#__PURE__*/_jsxs(Space, {
|
|
24
|
+
size: 4,
|
|
25
|
+
style: {
|
|
26
|
+
padding: '6px 12px'
|
|
27
|
+
},
|
|
28
|
+
wrap: true,
|
|
29
|
+
children: [data.map(function () {
|
|
30
|
+
var row = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
31
|
+
return /*#__PURE__*/_jsx(Tag, {
|
|
32
|
+
color: color,
|
|
33
|
+
closable: true,
|
|
34
|
+
onClose: function onClose(e) {
|
|
35
|
+
onClear(row[fieldNames.key]);
|
|
36
|
+
e.preventDefault();
|
|
37
|
+
},
|
|
38
|
+
children: row[fieldNames.label || 'name']
|
|
39
|
+
}, row[fieldNames.key || 'key']);
|
|
40
|
+
}), data.length > 1 && /*#__PURE__*/_jsx(Button, {
|
|
41
|
+
size: "small",
|
|
42
|
+
onClick: function onClick(e) {
|
|
43
|
+
onClear();
|
|
44
|
+
e.preventDefault();
|
|
45
|
+
},
|
|
46
|
+
icon: /*#__PURE__*/_jsx(DeleteOutlined, {}),
|
|
47
|
+
danger: true,
|
|
48
|
+
type: "text",
|
|
49
|
+
children: "\u6E05\u7A7A"
|
|
50
|
+
})]
|
|
51
|
+
});
|
|
52
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import CCS from '..';
|
|
2
|
+
interface PropsType {
|
|
3
|
+
data: Record<string, any>;
|
|
4
|
+
columns: CCS.TableColumns;
|
|
5
|
+
hasRowSelection: boolean;
|
|
6
|
+
}
|
|
7
|
+
export default function TableSummary({ data, columns, hasRowSelection, }: PropsType): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Table } from 'antd';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
var SummaryIndex = -1;
|
|
5
|
+
export default function TableSummary(_ref) {
|
|
6
|
+
var _ref$data = _ref.data,
|
|
7
|
+
data = _ref$data === void 0 ? {} : _ref$data,
|
|
8
|
+
columns = _ref.columns,
|
|
9
|
+
hasRowSelection = _ref.hasRowSelection;
|
|
10
|
+
SummaryIndex = -1;
|
|
11
|
+
var renderCell = function renderCell(cs) {
|
|
12
|
+
return cs.map(function (d) {
|
|
13
|
+
if (d.children && d.children.length > 0) {
|
|
14
|
+
return renderCell(d.children);
|
|
15
|
+
}
|
|
16
|
+
SummaryIndex += 1;
|
|
17
|
+
return /*#__PURE__*/_jsx(Table.Summary.Cell, {
|
|
18
|
+
index: 0,
|
|
19
|
+
children: data[d.dataIndex]
|
|
20
|
+
}, SummaryIndex);
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
if (hasRowSelection) SummaryIndex += 1;
|
|
24
|
+
return /*#__PURE__*/_jsx(Table.Summary, {
|
|
25
|
+
fixed: true,
|
|
26
|
+
children: /*#__PURE__*/_jsxs(Table.Summary.Row, {
|
|
27
|
+
children: [hasRowSelection && /*#__PURE__*/_jsx(Table.Summary.Cell, {
|
|
28
|
+
index: SummaryIndex
|
|
29
|
+
}), renderCell(columns)]
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
}
|