@ccs-ui/rc-pro 1.1.24-beta-2 → 1.1.24-beta-4

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.
@@ -2,7 +2,7 @@
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, "request" | "auth" | "onRequestBefore" | "onCancel"> & {
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;
@@ -20,17 +20,18 @@ export default /*#__PURE__*/memo(function (props) {
20
20
  }
21
21
  },
22
22
  children: /*#__PURE__*/_jsx("div", {
23
+ id: id,
23
24
  style: {
24
25
  display: active ? 'block' : 'none'
25
26
  },
26
27
  className: "ccs-tab-item",
27
- id: id,
28
28
  "data-display": active,
29
29
  children: /*#__PURE__*/_jsx(Scrollbars, {
30
30
  style: {
31
31
  display: active ? 'block' : 'none'
32
32
  },
33
33
  autoHide: true,
34
+ className: "ccs-table-item-scroll",
34
35
  children: /*#__PURE__*/_jsx("div", {
35
36
  style: {
36
37
  margin: 16
@@ -438,15 +438,17 @@ function SearchComponent(_ref) {
438
438
  var hasBorder = titleBordered === true;
439
439
  return /*#__PURE__*/_jsx(_Fragment, {
440
440
  children: /*#__PURE__*/_jsxs(Card, {
441
- bodyStyle: {
442
- padding: 16
443
- },
444
441
  style: _objectSpread({
445
442
  borderRadius: 0,
446
443
  boxShadow: 'none'
447
444
  }, hasBorder ? {
448
445
  borderBottom: 0
449
446
  } : {}),
447
+ styles: {
448
+ body: {
449
+ padding: 16
450
+ }
451
+ },
450
452
  bordered: hasBorder,
451
453
  title: title,
452
454
  children: [(onHasMore() || expandForm) && renderMoreForm(), /*#__PURE__*/_jsxs("div", {
@@ -48,6 +48,22 @@ var onTableInModalOrDrawer = function onTableInModalOrDrawer(node) {
48
48
  }
49
49
  return onTableInModalOrDrawer(parent);
50
50
  };
51
+ var onTableInTabItem = function onTableInTabItem(node) {
52
+ var _parent$classList6;
53
+ var parent = node.parentNode;
54
+ if (!parent) return false;
55
+ if ( // 通过指定dom吸顶
56
+ (_parent$classList6 = parent.classList) !== null && _parent$classList6 !== void 0 && _parent$classList6.contains('ccs-table-item-scroll')) {
57
+ return {
58
+ getContainer: function getContainer() {
59
+ return parent;
60
+ }
61
+ };
62
+ }
63
+ return onTableInTabItem(parent);
64
+ };
65
+
66
+ // ccs-table-item-scroll
51
67
 
52
68
  // 根据ID查找树形节点
53
69
  var getDataById = function getDataById(data, rowKey, id) {
@@ -297,18 +313,18 @@ var InternalProTable = function InternalProTable(props) {
297
313
  // }, 200);
298
314
 
299
315
  useEffect(function () {
300
- // 判断当前dom所处的滚动区域
316
+ // 判断是否在弹出框中
301
317
  var inMd = onTableInModalOrDrawer(tableRef.current);
302
318
  if (inMd) {
303
319
  stickyRef.current = inMd;
304
- } else {
305
- var _parentNode;
306
- var node = (_parentNode = tableRef.current.parentNode) === null || _parentNode === void 0 ? void 0 : _parentNode.parentNode;
307
- stickyRef.current = {
308
- getContainer: function getContainer() {
309
- return watermark ? node.parentNode : node;
310
- }
311
- };
320
+ return;
321
+ }
322
+
323
+ // 判断在tab中
324
+ var inTab = onTableInTabItem(tableRef.current);
325
+ if (inTab) {
326
+ stickyRef.current = inTab;
327
+ return;
312
328
  }
313
329
 
314
330
  // // 监听resize
@@ -458,7 +474,7 @@ var InternalProTable = function InternalProTable(props) {
458
474
  table: table,
459
475
  event$: event$,
460
476
  treeRef: treeRef,
461
- sticky: stickyRef.current,
477
+ sticky: stickyRef.current || true,
462
478
  parentFieldName: parentFieldName,
463
479
  setData: setData,
464
480
  onSearchAfter: onSearchAfter,
@@ -472,7 +488,7 @@ var InternalProTable = function InternalProTable(props) {
472
488
  data: data,
473
489
  event$: event$,
474
490
  size: isInModalOrDrawer ? 'small' : 'middle',
475
- sticky: stickyRef.current
491
+ sticky: stickyRef.current || true
476
492
  }, table), {}, {
477
493
  columns: columns,
478
494
  showSorterTooltip: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccs-ui/rc-pro",
3
- "version": "1.1.24-beta-2",
3
+ "version": "1.1.24-beta-4",
4
4
  "description": "修复table双滚动条问题;",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -54,7 +54,7 @@
54
54
  "@ant-design/compatible": "^5.1.2",
55
55
  "@ant-design/icons": "^5.1.4",
56
56
  "ahooks": "^3.7.7",
57
- "antd": "^5.11.0",
57
+ "antd": "^5.16.2",
58
58
  "antd-img-crop": "^4.12.2",
59
59
  "classnames": "^2.3.2",
60
60
  "dayjs": "^1.11.7",