@ccs-ui/rc-pro 2.3.6-beta-27 → 2.3.6-beta-29
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/pro-table/head.d.ts +2 -3
- package/es/pro-table/head.js +0 -2
- package/es/pro-table/table.d.ts +2 -0
- package/es/pro-table/table.js +10 -9
- package/package.json +1 -1
package/es/pro-table/head.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { FormInstance } from 'antd';
|
|
2
2
|
import React, { ReactElement } from 'react';
|
|
3
|
-
import { PropsWithElementChildren } from '../ccs';
|
|
4
3
|
import { CcsProTableProps } from './table';
|
|
5
|
-
type PropsType<T> = Pick<CcsProTableProps<T>, 'toolbar' | 'formItems' | 'formInitValues' | 'expandForm' | 'title' | 'formItemLabelWidth'> &
|
|
4
|
+
type PropsType<T> = Pick<CcsProTableProps<T>, 'toolbar' | 'formItems' | 'formInitValues' | 'expandForm' | 'title' | 'formItemLabelWidth'> & {
|
|
6
5
|
/** 更多查询条件 */
|
|
7
6
|
hasMore?: boolean;
|
|
8
7
|
/** table 操作栏 */
|
|
9
|
-
tableOperation
|
|
8
|
+
tableOperation?: ReactElement;
|
|
10
9
|
/** 查询 */
|
|
11
10
|
onSearch: () => void;
|
|
12
11
|
/** form */
|
package/es/pro-table/head.js
CHANGED
|
@@ -32,10 +32,8 @@ function HeadComponent(_ref) {
|
|
|
32
32
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
33
33
|
form = _Form$useForm2[0];
|
|
34
34
|
var formItemsRef = useRef(null);
|
|
35
|
-
|
|
36
35
|
// 根据位置判断是否换行ref
|
|
37
36
|
var endItemRef = useRef(null);
|
|
38
|
-
|
|
39
37
|
// 查询条件是否展开
|
|
40
38
|
var _useState = useState(expandForm),
|
|
41
39
|
_useState2 = _slicedToArray(_useState, 2),
|
package/es/pro-table/table.d.ts
CHANGED
|
@@ -73,6 +73,8 @@ export type CcsProTableProps<RecordType> = Pick<PropsWithCss, 'className'> & Pro
|
|
|
73
73
|
toolbar?: ReactElement;
|
|
74
74
|
/** 操作按钮扩展 */
|
|
75
75
|
toolbarExtra?: ReactElement;
|
|
76
|
+
/** 边框 */
|
|
77
|
+
bordered?: boolean;
|
|
76
78
|
/** 展开查询条件,默认false */
|
|
77
79
|
expandForm?: boolean;
|
|
78
80
|
/** table 数据区域 */
|
package/es/pro-table/table.js
CHANGED
|
@@ -32,8 +32,8 @@ import "./index.less";
|
|
|
32
32
|
import TableOperation from "./operation";
|
|
33
33
|
import TableTree from "./tree";
|
|
34
34
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
35
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
36
35
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
36
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
37
37
|
function onSetObj(target, paths, value) {
|
|
38
38
|
while (paths.length > 0) {
|
|
39
39
|
var path = paths.shift();
|
|
@@ -75,6 +75,7 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
75
75
|
_props$formItems = props.formItems,
|
|
76
76
|
formItems = _props$formItems === void 0 ? [] : _props$formItems,
|
|
77
77
|
leafNode = props.leafNode,
|
|
78
|
+
bordered = props.bordered,
|
|
78
79
|
parentFieldName = props.parentFieldName,
|
|
79
80
|
_props$formInitValues = props.formInitValues,
|
|
80
81
|
formInitValues = _props$formInitValues === void 0 ? {} : _props$formInitValues;
|
|
@@ -567,7 +568,7 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
567
568
|
var _antTheme$useToken = antTheme.useToken(),
|
|
568
569
|
token = _antTheme$useToken.token;
|
|
569
570
|
var rootStyle = styles.root || {};
|
|
570
|
-
if (
|
|
571
|
+
if (bordered) {
|
|
571
572
|
rootStyle = _objectSpread({
|
|
572
573
|
border: "1px solid ".concat(token.colorBorderSecondary),
|
|
573
574
|
borderRadius: 4
|
|
@@ -608,7 +609,7 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
608
609
|
columns: columns,
|
|
609
610
|
tableRef: tableRef,
|
|
610
611
|
onFullScreen: onFullScreen
|
|
611
|
-
}) :
|
|
612
|
+
}) : undefined;
|
|
612
613
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
613
614
|
children: [/*#__PURE__*/_jsx(CcsResizeObserver.Target, {
|
|
614
615
|
targetRef: tableContentRef,
|
|
@@ -619,7 +620,7 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
619
620
|
overflow: (table === null || table === void 0 || (_table$scroll2 = table.scroll) === null || _table$scroll2 === void 0 ? void 0 : _table$scroll2.y) === 'auto' ? 'hidden' : 'unset'
|
|
620
621
|
}),
|
|
621
622
|
ref: containerRef,
|
|
622
|
-
children: [
|
|
623
|
+
children: [isAuth && /*#__PURE__*/_jsxs(TableSelectionContext.Provider, {
|
|
623
624
|
value: {
|
|
624
625
|
selectedRows: selectedRows
|
|
625
626
|
},
|
|
@@ -632,9 +633,8 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
632
633
|
formItemLabelWidth: props.formItemLabelWidth,
|
|
633
634
|
onSearch: _onSearch,
|
|
634
635
|
title: props.title,
|
|
635
|
-
tableOperation: renderTableOperation
|
|
636
|
-
|
|
637
|
-
}), toolbar && /*#__PURE__*/_jsxs(Card, {
|
|
636
|
+
tableOperation: renderTableOperation
|
|
637
|
+
}), (toolbar || formItems.length === 0 && renderTableOperation) && /*#__PURE__*/_jsxs(Card, {
|
|
638
638
|
styles: {
|
|
639
639
|
cover: {
|
|
640
640
|
borderRadius: 0
|
|
@@ -651,7 +651,8 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
651
651
|
borderRadius: 0,
|
|
652
652
|
borderLeft: 0,
|
|
653
653
|
borderBottom: 0,
|
|
654
|
-
borderRight: 0
|
|
654
|
+
borderRight: 0,
|
|
655
|
+
borderTop: formItems.length === 0 ? 0 : undefined
|
|
655
656
|
},
|
|
656
657
|
children: [/*#__PURE__*/_jsx("div", {
|
|
657
658
|
style: {
|
|
@@ -664,7 +665,7 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
664
665
|
},
|
|
665
666
|
children: renderTableOperation
|
|
666
667
|
})]
|
|
667
|
-
}),
|
|
668
|
+
}), toolbarExtra]
|
|
668
669
|
}), /*#__PURE__*/_jsxs("div", {
|
|
669
670
|
className: "".concat(classPrefix, "-table-content"),
|
|
670
671
|
style: _objectSpread(_objectSpread({}, styles === null || styles === void 0 ? void 0 : styles.table), {}, {
|