@ccs-ui/rc-pro 2.3.6-beta-27 → 2.3.6-beta-28

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.
@@ -6,12 +6,12 @@ type PropsType<T> = Pick<CcsProTableProps<T>, 'toolbar' | 'formItems' | 'formIni
6
6
  /** 更多查询条件 */
7
7
  hasMore?: boolean;
8
8
  /** table 操作栏 */
9
- tableOperation: ReactElement;
9
+ tableOperation?: ReactElement;
10
10
  /** 查询 */
11
11
  onSearch: () => void;
12
12
  /** form */
13
13
  formRef: React.RefObject<FormInstance<any>>;
14
14
  };
15
15
  /** 操作按钮、查询,重置、列筛选、 */
16
- declare function HeadComponent<T>({ title, toolbar, expandForm, formItems, formInitValues, formItemLabelWidth, tableOperation, formRef, onSearch, }: PropsType<T>): import("react/jsx-runtime").JSX.Element;
16
+ declare function HeadComponent<T>({ title, toolbar, expandForm, formItems, formInitValues, formItemLabelWidth, tableOperation, formRef, children, onSearch, }: PropsType<T>): import("react/jsx-runtime").JSX.Element;
17
17
  export default HeadComponent;
@@ -27,15 +27,14 @@ function HeadComponent(_ref) {
27
27
  formItemLabelWidth = _ref.formItemLabelWidth,
28
28
  tableOperation = _ref.tableOperation,
29
29
  formRef = _ref.formRef,
30
+ children = _ref.children,
30
31
  onSearch = _ref.onSearch;
31
32
  var _Form$useForm = Form.useForm(),
32
33
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
33
34
  form = _Form$useForm2[0];
34
35
  var formItemsRef = useRef(null);
35
-
36
36
  // 根据位置判断是否换行ref
37
37
  var endItemRef = useRef(null);
38
-
39
38
  // 查询条件是否展开
40
39
  var _useState = useState(expandForm),
41
40
  _useState2 = _slicedToArray(_useState, 2),
@@ -170,8 +169,8 @@ function HeadComponent(_ref) {
170
169
  var token = theme.useToken().token;
171
170
  var controlHeight = token.rootValue ? "".concat((token.controlHeight / token.rootValue).toFixed(3), "rem") : token.controlHeight;
172
171
  var adaptationRef = useRef(null);
173
- return /*#__PURE__*/_jsx(_Fragment, {
174
- children: allFormItems.length > 0 && /*#__PURE__*/_jsxs(_Fragment, {
172
+ return /*#__PURE__*/_jsxs(_Fragment, {
173
+ children: [allFormItems.length > 0 && /*#__PURE__*/_jsxs(_Fragment, {
175
174
  children: [/*#__PURE__*/_jsx(CcsResizeObserver.Target, {
176
175
  targetRef: formItemsRef,
177
176
  onResize: onResize
@@ -212,7 +211,7 @@ function HeadComponent(_ref) {
212
211
  })]
213
212
  })
214
213
  })]
215
- })
214
+ }), children]
216
215
  });
217
216
  }
218
217
  export default HeadComponent;
@@ -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 数据区域 */
@@ -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 (table !== null && table !== void 0 && table.bordered) {
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
- }) : /*#__PURE__*/_jsx(_Fragment, {});
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: [!(!formItems.length && !toolbar) && isAuth && /*#__PURE__*/_jsxs(TableSelectionContext.Provider, {
623
+ children: [isAuth && /*#__PURE__*/_jsxs(TableSelectionContext.Provider, {
623
624
  value: {
624
625
  selectedRows: selectedRows
625
626
  },
@@ -634,7 +635,7 @@ var InternalProTable = function InternalProTable(props) {
634
635
  title: props.title,
635
636
  tableOperation: renderTableOperation,
636
637
  children: toolbarExtra
637
- }), toolbar && /*#__PURE__*/_jsxs(Card, {
638
+ }), (toolbar || formItems.length === 0 && renderTableOperation) && /*#__PURE__*/_jsxs(Card, {
638
639
  styles: {
639
640
  cover: {
640
641
  borderRadius: 0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccs-ui/rc-pro",
3
- "version": "2.3.6-beta-27",
3
+ "version": "2.3.6-beta-28",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "author": {