@ccs-ui/rc-pro 2.0.5 → 2.0.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.
@@ -1,7 +1,7 @@
1
1
  import { FormProps } from 'antd';
2
2
  import { DialogFormRef } from './form';
3
3
  import { CcsDialogModalProps } from './hook';
4
- declare const DialogRequestButton: ({ auth, formRef, extraBtn, formInitialValues, request, onCancel, onRequestBefore, }: Pick<CcsDialogModalProps, "onCancel" | "auth" | "request" | "extraBtn" | "onRequestBefore"> & {
4
+ declare const DialogRequestButton: ({ auth, formRef, extraBtn, formInitialValues, request, onCancel, onRequestBefore, }: Pick<CcsDialogModalProps, "auth" | "request" | "onCancel" | "extraBtn" | "onRequestBefore"> & {
5
5
  formRef: React.RefObject<DialogFormRef>;
6
6
  formInitialValues: FormProps['initialValues'];
7
7
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { FormProps } from 'antd';
2
2
  import { DialogFormRef } from './form';
3
3
  import { CcsDialogModalProps } from './hook';
4
- declare const DialogSelfOkButton: ({ auth, formRef, extraBtn, formInitialValues, onCancel, onOk, }: Pick<CcsDialogModalProps, "onCancel" | "auth" | "onOk" | "extraBtn"> & {
4
+ declare const DialogSelfOkButton: ({ auth, formRef, extraBtn, formInitialValues, onCancel, onOk, }: Pick<CcsDialogModalProps, "auth" | "onOk" | "onCancel" | "extraBtn"> & {
5
5
  formRef: React.RefObject<DialogFormRef>;
6
6
  formInitialValues: FormProps['initialValues'];
7
7
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,3 @@
1
- type PropsType = {
2
- onFullScreen?: (isFull: boolean) => void;
3
- };
4
- declare const _default: ({ onFullScreen }: PropsType) => import("react/jsx-runtime").JSX.Element;
5
- export default _default;
1
+ export default function FullScreen({ onFullScreen, }: {
2
+ onFullScreen: (isFull: boolean) => void;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -9,32 +9,21 @@ import { Button, Tooltip } from 'antd';
9
9
  import { useState } from 'react';
10
10
  import { classPrefix } from "../pro-table/table";
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
12
- export default (function (_ref) {
12
+ export default function FullScreen(_ref) {
13
13
  var onFullScreen = _ref.onFullScreen;
14
14
  var _useState = useState(false),
15
15
  _useState2 = _slicedToArray(_useState, 2),
16
16
  isFull = _useState2[0],
17
17
  setIsFull = _useState2[1];
18
- var handleOnFullScreen = function handleOnFullScreen(full) {
19
- var display = full ? 'none' : '';
20
- var header = document.getElementsByClassName('ccs-layout-header');
21
- if (header && header.length > 0) header[0].style.display = display;
22
- var menu = document.getElementsByClassName('ccs-layout-menu');
23
- if (menu && menu.length > 0) menu[0].style.display = display;
24
- var alive = document.getElementsByClassName('ccs-keep-alive');
25
- if (alive && alive.length > 0) {
26
- var tabs = alive[0].getElementsByClassName('ant-tabs');
27
- if (tabs && tabs.length > 0) tabs[0].style.display = display;
28
- }
29
- var inf = !isFull;
30
- setIsFull(inf);
31
- if (onFullScreen) onFullScreen(inf);
18
+ var handleOnFullScreen = function handleOnFullScreen() {
19
+ setIsFull(!isFull);
20
+ onFullScreen(!isFull);
32
21
  };
33
22
  return /*#__PURE__*/_jsx(Tooltip, {
34
23
  title: isFull ? '取消全屏' : '全屏',
35
24
  children: isFull ? /*#__PURE__*/_jsx(Button, {
36
25
  onClick: function onClick() {
37
- return handleOnFullScreen(false);
26
+ return handleOnFullScreen();
38
27
  },
39
28
  icon: /*#__PURE__*/_jsx(FullscreenExitOutlined, {
40
29
  className: "".concat(classPrefix, "-icon")
@@ -45,7 +34,7 @@ export default (function (_ref) {
45
34
  }
46
35
  }) : /*#__PURE__*/_jsx(Button, {
47
36
  onClick: function onClick() {
48
- return handleOnFullScreen(true);
37
+ return handleOnFullScreen();
49
38
  },
50
39
  icon: /*#__PURE__*/_jsx(FullscreenOutlined, {
51
40
  className: "".concat(classPrefix, "-icon")
@@ -57,4 +46,4 @@ export default (function (_ref) {
57
46
  className: "ccs-pl-fullbtn"
58
47
  })
59
48
  });
60
- });
49
+ }
@@ -1,5 +1,17 @@
1
+ import { JSXElementConstructor, ReactElement } from 'react';
1
2
  import CCS from '..';
3
+ import { MenuType } from '../ccs';
2
4
  import './index.less';
5
+ export type CacheComponent = {
6
+ key: string;
7
+ label: string;
8
+ locationKey: string;
9
+ urlAuthList: string[];
10
+ timestamp: number;
11
+ outlet: ReactElement<any, string | JSXElementConstructor<any>> | null;
12
+ children?: ReactElement<any, string | JSXElementConstructor<any>> | null;
13
+ breadcrumb: MenuType['breadcrumb'];
14
+ };
3
15
  type PropsType = {
4
16
  maxLen?: number;
5
17
  appName: string;
@@ -136,7 +136,9 @@ export default function KeepAliveTabs(_ref) {
136
136
  if (!component) {
137
137
  var _ref3 = curMenu || {},
138
138
  _ref3$urlAuthList = _ref3.urlAuthList,
139
- urlAuthList = _ref3$urlAuthList === void 0 ? [] : _ref3$urlAuthList;
139
+ urlAuthList = _ref3$urlAuthList === void 0 ? [] : _ref3$urlAuthList,
140
+ _ref3$breadcrumb = _ref3.breadcrumb,
141
+ breadcrumb = _ref3$breadcrumb === void 0 ? [] : _ref3$breadcrumb;
140
142
  components.current = [].concat(_toConsumableArray(components.current), [{
141
143
  locationKey: locationKey,
142
144
  key: pathname,
@@ -145,7 +147,8 @@ export default function KeepAliveTabs(_ref) {
145
147
  outlet: curMenu ? outlet : /*#__PURE__*/_jsx(Empty, {
146
148
  description: "\u672A\u77E5\u9875\u9762"
147
149
  }),
148
- urlAuthList: urlAuthList
150
+ urlAuthList: urlAuthList,
151
+ breadcrumb: breadcrumb
149
152
  }]);
150
153
  }
151
154
 
@@ -224,13 +227,15 @@ export default function KeepAliveTabs(_ref) {
224
227
  var key = _ref4.key,
225
228
  urlAuthList = _ref4.urlAuthList,
226
229
  timestamp = _ref4.timestamp,
227
- outlet = _ref4.outlet;
230
+ outlet = _ref4.outlet,
231
+ breadcrumb = _ref4.breadcrumb;
228
232
  return /*#__PURE__*/_jsx(Page, {
229
233
  active: key === pathname,
230
234
  location: location,
231
235
  onDestroy: onDestroy,
232
236
  urlAuthList: urlAuthList,
233
237
  timestamp: timestamp,
238
+ breadcrumb: breadcrumb,
234
239
  children: outlet
235
240
  }, key);
236
241
  })]
@@ -70,7 +70,7 @@
70
70
  }
71
71
 
72
72
  .ccs-table-item-scroll > div {
73
- padding: 16px;
73
+ padding: 10px 16px 16px 16px;
74
74
  flex-direction: column;
75
75
  display: none;
76
76
  }
@@ -1,16 +1,11 @@
1
- import { JSXElementConstructor, ReactElement } from 'react';
1
+ /// <reference types="react" />
2
2
  import { Location } from 'react-router';
3
- export type CachePageProps = {
3
+ import { CacheComponent } from '.';
4
+ export type CachePageProps = Pick<CacheComponent, 'breadcrumb' | 'urlAuthList' | 'children' | 'timestamp'> & {
4
5
  /** 选中状态 */
5
6
  active: boolean;
6
7
  /** router location */
7
8
  location: Location;
8
- /** 时间戳 */
9
- timestamp: number;
10
- /** 按钮权限列表 */
11
- urlAuthList: string[];
12
- /** children */
13
- children: ReactElement<any, string | JSXElementConstructor<any>> | null;
14
9
  /** 销毁页面 */
15
10
  onDestroy: (path: string) => void;
16
11
  };
@@ -1,14 +1,17 @@
1
+ import { Breadcrumb } from 'antd';
1
2
  import classNames from 'classnames';
2
3
  import { memo, useRef } from 'react';
3
4
  import Scrollbars from 'react-custom-scrollbars';
4
5
  import { PageContext } from "../context";
5
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
+ import { jsxs as _jsxs } from "react/jsx-runtime";
6
8
  export default /*#__PURE__*/memo(function (props) {
7
9
  var locationRef = useRef(props.location);
8
10
  var children = props.children,
9
11
  active = props.active,
10
12
  urlAuthList = props.urlAuthList,
11
- onDestroy = props.onDestroy;
13
+ onDestroy = props.onDestroy,
14
+ breadcrumb = props.breadcrumb;
12
15
  var id = "_tab_content_".concat(locationRef.current.key);
13
16
  return /*#__PURE__*/_jsx(PageContext.Provider, {
14
17
  value: {
@@ -27,12 +30,15 @@ export default /*#__PURE__*/memo(function (props) {
27
30
  },
28
31
  className: "ccs-tab-item",
29
32
  "data-display": active,
30
- children: /*#__PURE__*/_jsx(Scrollbars, {
33
+ children: /*#__PURE__*/_jsxs(Scrollbars, {
31
34
  autoHide: true,
32
35
  className: classNames('ccs-table-item-scroll', {
33
36
  'route-avtive': active
34
37
  }),
35
- children: children
38
+ children: [/*#__PURE__*/_jsx(Breadcrumb, {
39
+ items: breadcrumb,
40
+ className: "ccs-breadcrumb"
41
+ }), children]
36
42
  })
37
43
  })
38
44
  });
@@ -1,42 +1,19 @@
1
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
5
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
7
- import { useUpdate, useUpdateEffect } from 'ahooks';
8
- import { Breadcrumb } from 'antd';
9
1
  import classnames from 'classnames';
10
- import { useMemo, useRef } from 'react';
2
+ import { useMemo } from 'react';
11
3
  import { useLocation } from 'react-router';
12
4
  import { useOutlet } from 'react-router-dom';
13
5
  import CcsResult from "../result";
14
6
  import "./index.less";
15
7
  import Page from "./page";
16
8
  import { jsx as _jsx } from "react/jsx-runtime";
17
- import { jsxs as _jsxs } from "react/jsx-runtime";
18
9
  export default function SinglePage(_ref) {
19
10
  var appName = _ref.appName,
20
11
  _ref$menus = _ref.menus,
21
12
  menus = _ref$menus === void 0 ? [] : _ref$menus,
22
13
  className = _ref.className;
23
- var components = useRef([]);
24
14
  var location = useLocation();
25
15
  var pathname = location.pathname;
26
16
  var outlet = useOutlet();
27
- var update = useUpdate();
28
-
29
- // 菜单改变,更新用户权限信息
30
- useUpdateEffect(function () {
31
- components.current.forEach(function (component) {
32
- var menu = menus.find(function (m) {
33
- return m.menuUrl === component.key;
34
- });
35
- component.urlAuthList = (menu === null || menu === void 0 ? void 0 : menu.urlAuthList) || [];
36
- component.timestamp = new Date().getTime();
37
- });
38
- update();
39
- }, [menus]);
40
17
 
41
18
  // 当前菜单
42
19
  var menuInfo = useMemo(function () {
@@ -55,32 +32,22 @@ export default function SinglePage(_ref) {
55
32
  }, 10);
56
33
  return {
57
34
  auth: menu.urlAuthList || [],
58
- breadcrumbs: menu.breadcrumb,
35
+ breadcrumb: menu.breadcrumb,
59
36
  menu: menu
60
37
  };
61
38
  }, [pathname, menus]);
62
- return /*#__PURE__*/_jsxs("div", {
39
+ return /*#__PURE__*/_jsx("div", {
63
40
  className: classnames(className, "ccs-single-page"),
64
- children: [/*#__PURE__*/_jsx("div", {
65
- className: "page-breadcrumb",
66
- children: /*#__PURE__*/_jsx("div", {
67
- className: "breadcrumb-name",
68
- children: menuInfo !== null && menuInfo !== void 0 && menuInfo.breadcrumbs ? /*#__PURE__*/_jsx(Breadcrumb, {
69
- items: _toConsumableArray(menuInfo === null || menuInfo === void 0 ? void 0 : menuInfo.breadcrumbs)
70
- }) : '未知页面'
71
- })
72
- }), /*#__PURE__*/_jsx("div", {
73
- className: "page-content",
74
- children: menuInfo !== null && menuInfo !== void 0 && menuInfo.auth ? /*#__PURE__*/_jsx(Page, {
75
- location: location,
76
- urlAuthList: menuInfo.auth,
77
- children: outlet
78
- }) : /*#__PURE__*/_jsx(CcsResult.NotFound, {
79
- style: {
80
- marginTop: 100
81
- },
82
- iconWidth: 200
83
- })
84
- })]
41
+ children: menuInfo !== null && menuInfo !== void 0 && menuInfo.auth ? /*#__PURE__*/_jsx(Page, {
42
+ location: location,
43
+ urlAuthList: menuInfo.auth,
44
+ breadcrumb: menuInfo.breadcrumb,
45
+ children: outlet
46
+ }) : /*#__PURE__*/_jsx(CcsResult.NotFound, {
47
+ style: {
48
+ marginTop: 100
49
+ },
50
+ iconWidth: 200
51
+ })
85
52
  });
86
53
  }
@@ -3,37 +3,10 @@
3
3
  display: flex;
4
4
  flex-direction: column;
5
5
 
6
- .page-breadcrumb {
7
- position: relative;
8
- flex: 0 0 34px;
9
- line-height: 34px;
10
-
11
- &::after {
12
- content: '';
13
- position: absolute;
14
- left: 0;
15
- right: 0;
16
- top: 0;
17
- bottom: 0;
18
- }
19
- }
20
-
21
- .breadcrumb-name {
22
- padding: 6px 16px;
23
- position: absolute;
24
- left: 0;
25
- right: 0;
26
- top: 0;
27
- bottom: 0;
28
- z-index: 11;
29
- }
30
-
31
- .page-content {
32
- flex: 1 1 auto;
33
- }
34
-
35
6
  .ccs-table-item-scroll > div {
36
7
  display: flex;
8
+ flex-direction: column;
9
+ padding: 10px 16px 16px 16px;
37
10
  }
38
11
  }
39
12
 
@@ -41,39 +14,8 @@
41
14
  .page-content {
42
15
  background-color: #fff;
43
16
  }
44
-
45
- .page-breadcrumb {
46
- position: relative;
47
- flex: 0 0 34px;
48
- line-height: 34px;
49
-
50
- &::after {
51
- background: #fff;
52
- opacity: 0.1;
53
- }
54
- }
55
-
56
- .breadcrumb-name {
57
- .ant-breadcrumb,
58
- .ant-breadcrumb-separator,
59
- .ant-breadcrumb-link {
60
- color: rgba(255, 255, 255, 85%);
61
- }
62
- }
63
17
  }
64
18
 
65
- .light-theme {
66
- .page-breadcrumb {
67
- &::after {
68
- background-color: #fff;
69
- }
70
- }
71
- }
72
-
73
- .dark-theme {
74
- .page-breadcrumb {
75
- &::after {
76
- background-color: #252525;
77
- }
78
- }
19
+ .ccs-breadcrumb {
20
+ margin-bottom: 10px;
79
21
  }
@@ -1,10 +1,9 @@
1
1
  import { JSXElementConstructor, ReactElement } from 'react';
2
2
  import { Location } from 'react-router';
3
- export type SinglePageProps = {
3
+ import { MenuType } from '../ccs';
4
+ export type SinglePageProps = Pick<MenuType, 'breadcrumb' | 'urlAuthList'> & {
4
5
  /** router location */
5
6
  location: Location;
6
- /** 按钮权限列表 */
7
- urlAuthList: string[];
8
7
  /** children */
9
8
  children: ReactElement<any, string | JSXElementConstructor<any>> | null;
10
9
  };
@@ -1,11 +1,16 @@
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";
4
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
+ import { jsxs as _jsxs } from "react/jsx-runtime";
5
7
  export default /*#__PURE__*/memo(function (props) {
6
8
  var locationRef = useRef(props.location);
7
9
  var children = props.children,
8
- urlAuthList = props.urlAuthList;
10
+ _props$urlAuthList = props.urlAuthList,
11
+ urlAuthList = _props$urlAuthList === void 0 ? [] : _props$urlAuthList,
12
+ _props$breadcrumb = props.breadcrumb,
13
+ breadcrumb = _props$breadcrumb === void 0 ? [] : _props$breadcrumb;
9
14
  return /*#__PURE__*/_jsx(PageContext.Provider, {
10
15
  value: {
11
16
  id: '',
@@ -18,10 +23,13 @@ export default /*#__PURE__*/memo(function (props) {
18
23
  return urlAuthList.includes(e);
19
24
  }
20
25
  },
21
- children: /*#__PURE__*/_jsx(Scrollbars, {
26
+ children: /*#__PURE__*/_jsxs(Scrollbars, {
22
27
  autoHide: true,
23
28
  className: "ccs-table-item-scroll",
24
- children: children
29
+ children: [/*#__PURE__*/_jsx(Breadcrumb, {
30
+ items: breadcrumb,
31
+ className: "ccs-breadcrumb"
32
+ }), children]
25
33
  })
26
34
  });
27
35
  });
@@ -193,6 +193,15 @@
193
193
  .ant-table-wrapper .ant-table .ant-table-header {
194
194
  border-radius: 0;
195
195
  }
196
+
197
+ .css-table-full {
198
+ position: fixed;
199
+ left: 0;
200
+ right: 0;
201
+ top: 0;
202
+ bottom: 0;
203
+ z-index: 9999;
204
+ }
196
205
  }
197
206
 
198
207
  // modal drawer ccs-pl 中取消table content padding
@@ -5,10 +5,10 @@ type PropsType = {
5
5
  /** 显示列 */
6
6
  columns?: any;
7
7
  tableRowSize: TableProps['size'];
8
- isInModalOrDrawer: boolean;
9
8
  tableRef: React.MutableRefObject<TableRefType | undefined>;
10
9
  onReset: () => void;
10
+ onFullScreen: (isFull: boolean) => void;
11
11
  onChangeRowSize: (e: TableProps['size']) => void;
12
12
  };
13
- export default function TableOperation({ columns, tableRef, tableRowSize, isInModalOrDrawer, onReset, onChangeRowSize, }: PropsType): import("react/jsx-runtime").JSX.Element;
13
+ export default function TableOperation({ columns, tableRef, tableRowSize, onReset, onFullScreen, onChangeRowSize, }: PropsType): import("react/jsx-runtime").JSX.Element;
14
14
  export {};
@@ -20,8 +20,8 @@ export default function TableOperation(_ref) {
20
20
  var columns = _ref.columns,
21
21
  tableRef = _ref.tableRef,
22
22
  tableRowSize = _ref.tableRowSize,
23
- isInModalOrDrawer = _ref.isInModalOrDrawer,
24
23
  onReset = _ref.onReset,
24
+ onFullScreen = _ref.onFullScreen,
25
25
  onChangeRowSize = _ref.onChangeRowSize;
26
26
  var _useState = useState(columns),
27
27
  _useState2 = _slicedToArray(_useState, 2),
@@ -123,9 +123,6 @@ export default function TableOperation(_ref) {
123
123
  })]
124
124
  });
125
125
  };
126
- var onFullScreen = function onFullScreen() {
127
- // tableRef.current?.onFullScreen();
128
- };
129
126
  return /*#__PURE__*/_jsxs(_Fragment, {
130
127
  children: [/*#__PURE__*/_jsx(Tooltip, {
131
128
  title: "\u91CD\u7F6E",
@@ -190,7 +187,7 @@ export default function TableOperation(_ref) {
190
187
  }
191
188
  })
192
189
  })
193
- }), !isInModalOrDrawer && /*#__PURE__*/_jsx(CcsFullScreenButton, {
190
+ }), /*#__PURE__*/_jsx(CcsFullScreenButton, {
194
191
  onFullScreen: onFullScreen
195
192
  })]
196
193
  });
@@ -123,8 +123,11 @@ var InternalProTable = function InternalProTable(props) {
123
123
  // 监听容器尺寸变化
124
124
  var size = useSize(containerRef);
125
125
  useEffect(function () {
126
- var _table$scroll, _tableRef$current;
127
- if ((table === null || table === void 0 || (_table$scroll = table.scroll) === null || _table$scroll === void 0 ? void 0 : _table$scroll.y) === 'auto') (_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 || _tableRef$current.onFixedThead();
126
+ var _table$scroll, _tableContentRef$curr;
127
+ if ((table === null || table === void 0 || (_table$scroll = table.scroll) === null || _table$scroll === void 0 ? void 0 : _table$scroll.y) === 'auto' && ((_tableContentRef$curr = tableContentRef.current) === null || _tableContentRef$curr === void 0 ? void 0 : _tableContentRef$curr.clientHeight) !== 0) {
128
+ var _tableRef$current;
129
+ (_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 || _tableRef$current.onFixedThead();
130
+ }
128
131
  }, [size === null || size === void 0 ? void 0 : size.height]);
129
132
 
130
133
  // 获取数据
@@ -406,9 +409,6 @@ var InternalProTable = function InternalProTable(props) {
406
409
  }
407
410
  onRequest('changePage', paginationTable.current || 0, paginationTable.pageSize || 10);
408
411
  };
409
-
410
- // 判断是否在弹出框中
411
- var isInModalOrDrawer = _typeof(stickyRef.current) === 'object' && stickyRef.current.isInDialog || false;
412
412
  var renderTable = function renderTable() {
413
413
  if (!table) return null;
414
414
  if (!isAuth) {
@@ -513,6 +513,15 @@ var InternalProTable = function InternalProTable(props) {
513
513
  borderRadius: 4
514
514
  }, rootStyle);
515
515
  }
516
+ var onFullScreen = function onFullScreen(isFull) {
517
+ var _ref4 = containerRef.current || {},
518
+ classList = _ref4.classList;
519
+ if (isFull) {
520
+ classList === null || classList === void 0 || classList.add('css-table-full');
521
+ } else {
522
+ classList === null || classList === void 0 || classList.remove('css-table-full');
523
+ }
524
+ };
516
525
  return /*#__PURE__*/_jsxs("div", {
517
526
  className: classNames(classPrefix, className, _defineProperty({}, 'dark-table', isDark)),
518
527
  style: _objectSpread(_objectSpread({}, rootStyle), {}, {
@@ -532,14 +541,14 @@ var InternalProTable = function InternalProTable(props) {
532
541
  formItemLabelWidth: props.formItemLabelWidth,
533
542
  onSearch: _onSearch,
534
543
  tableOperation: (table === null || table === void 0 ? void 0 : table.isEnableToolbar) !== false ? /*#__PURE__*/_jsx(TableOperation, {
535
- isInModalOrDrawer: isInModalOrDrawer,
536
544
  onChangeRowSize: function onChangeRowSize(e) {
537
545
  return setTableRowSize(e);
538
546
  },
539
547
  tableRowSize: tableRowSize,
540
548
  onReset: _onReset,
541
549
  columns: columns,
542
- tableRef: tableRef
550
+ tableRef: tableRef,
551
+ onFullScreen: onFullScreen
543
552
  }) : /*#__PURE__*/_jsx(_Fragment, {}),
544
553
  children: newToolbarExtra
545
554
  }), /*#__PURE__*/_jsxs("div", {
@@ -9,8 +9,6 @@ type TableProps<T> = Omit<CcsTableProps<T>, 'request' | 'requestParam' | 'title'
9
9
  export type TableRefType = {
10
10
  /** 列筛选 */
11
11
  onColumnFilter: (e: any) => void;
12
- /** 全屏 */
13
- onFullScreen: () => void;
14
12
  /** 计算固定表头宽度 */
15
13
  onFixedThead: () => void;
16
14
  };
package/es/table/index.js CHANGED
@@ -11,7 +11,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
11
11
  import { useDebounceFn, useUpdate } from 'ahooks';
12
12
  import { Table, Tooltip, theme } from 'antd';
13
13
  import classNames from 'classnames';
14
- import { useEffect, useImperativeHandle, useRef } from 'react';
14
+ import { useEffect, useImperativeHandle } from 'react';
15
15
  import { Resizable } from 'react-resizable';
16
16
  import "./index.less";
17
17
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -57,9 +57,6 @@ var CustomTable = function CustomTable(props) {
57
57
  className = _props$className === void 0 ? '' : _props$className,
58
58
  tableContentRef = props.tableContentRef,
59
59
  restProps = _objectWithoutProperties(props, _excluded2);
60
-
61
- // 固定表头获取table可视高度
62
- var ref = useRef(null);
63
60
  var update = useUpdate();
64
61
  var _ref = data || DEFAULT_PAGE,
65
62
  totalNum = _ref.totalNum,
@@ -70,18 +67,20 @@ var CustomTable = function CustomTable(props) {
70
67
  // table 固定表头,内容滚动
71
68
  var _useDebounceFn = useDebounceFn(function () {
72
69
  if ((scroll === null || scroll === void 0 ? void 0 : scroll.y) === 'auto') {
73
- var _ref$current, _ref$current2, _ref$current3, _tableContentRef$curr;
74
- var tableBody = ref.current.getElementsByClassName('ant-table-body')[0];
70
+ var _tableContentRef$curr;
71
+ var tableTarget = tableContentRef === null || tableContentRef === void 0 ? void 0 : tableContentRef.current;
72
+ if (!tableTarget) return;
73
+ var tableBody = tableTarget.getElementsByClassName('ant-table-body')[0];
75
74
  if (!tableBody) return;
76
75
  var headerHeight = 0,
77
76
  pageHeight = 0,
78
77
  footerHeight = 0;
79
- var _pagination = (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.getElementsByClassName('ant-pagination');
78
+ var _pagination = tableTarget.getElementsByClassName('ant-pagination');
80
79
  if (_pagination && _pagination.length > 0) {
81
80
  pageHeight = _pagination[0].clientHeight;
82
81
  }
83
- var header = (_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.getElementsByClassName('ant-table-header');
84
- var footer = (_ref$current3 = ref.current) === null || _ref$current3 === void 0 ? void 0 : _ref$current3.getElementsByClassName('ant-table-footer');
82
+ var header = tableTarget.getElementsByClassName('ant-table-header');
83
+ var footer = tableTarget.getElementsByClassName('ant-table-footer');
85
84
  if (footer && footer.length > 0) {
86
85
  footerHeight = footer[0].clientHeight;
87
86
  }
@@ -116,7 +115,6 @@ var CustomTable = function CustomTable(props) {
116
115
  });
117
116
  update();
118
117
  },
119
- onFullScreen: onFixedThead,
120
118
  onFixedThead: onFixedThead
121
119
  };
122
120
  });
@@ -184,39 +182,36 @@ var CustomTable = function CustomTable(props) {
184
182
  style: _objectSpread(_objectSpread({}, style), {}, {
185
183
  background: token.colorBgContainer
186
184
  }),
187
- children: /*#__PURE__*/_jsx("div", {
188
- ref: ref,
189
- children: /*#__PURE__*/_jsx(Table, _objectSpread(_objectSpread({
190
- rowKey: rowKey,
191
- dataSource: result,
192
- pagination: pagination === false ? false : _objectSpread({
193
- total: totalNum,
194
- pageSize: pageSize,
195
- current: pageNo,
196
- showSizeChanger: true,
197
- showQuickJumper: true,
198
- showTotal: function showTotal() {
199
- return "\u5171".concat(totalNum, "\u6761\u8BB0\u5F55");
200
- },
201
- pageSizeOptions: ['10', '20', '30', '50', '100'],
202
- size: restProps.size === 'small' ? 'small' : 'default',
203
- simple: restProps.size === 'small'
204
- }, pagination),
205
- rowSelection: rowSelection ? _objectSpread(_objectSpread({}, rowSelection), {}, {
206
- columnWidth: 60
207
- }) : undefined,
208
- columns: filterColumns(),
209
- components: {
210
- header: {
211
- cell: ResizableTitle
212
- }
185
+ children: /*#__PURE__*/_jsx(Table, _objectSpread(_objectSpread({
186
+ rowKey: rowKey,
187
+ dataSource: result,
188
+ pagination: pagination === false ? false : _objectSpread({
189
+ total: totalNum,
190
+ pageSize: pageSize,
191
+ current: pageNo,
192
+ showSizeChanger: true,
193
+ showQuickJumper: true,
194
+ showTotal: function showTotal() {
195
+ return "\u5171".concat(totalNum, "\u6761\u8BB0\u5F55");
196
+ },
197
+ pageSizeOptions: ['10', '20', '30', '50', '100'],
198
+ size: restProps.size === 'small' ? 'small' : 'default',
199
+ simple: restProps.size === 'small'
200
+ }, pagination),
201
+ rowSelection: rowSelection ? _objectSpread(_objectSpread({}, rowSelection), {}, {
202
+ columnWidth: 60
203
+ }) : undefined,
204
+ columns: filterColumns(),
205
+ components: {
206
+ header: {
207
+ cell: ResizableTitle
213
208
  }
214
- }, restProps), {}, {
215
- size: restProps.size || 'middle',
216
- className: classNames(_defineProperty(_defineProperty(_defineProperty({}, 'ccs-table-nodata', !result || result.length === 0), 'ccs-table-wrapper', !rowSelection), "className", className)),
217
- scroll: scroll
218
- }))
219
- })
209
+ }
210
+ }, restProps), {}, {
211
+ size: restProps.size || 'middle',
212
+ className: classNames(_defineProperty(_defineProperty(_defineProperty({}, 'ccs-table-nodata', !result || result.length === 0), 'ccs-table-wrapper', !rowSelection), "className", className)),
213
+ scroll: scroll
214
+ }))
220
215
  });
221
216
  };
222
217
  export default CustomTable;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccs-ui/rc-pro",
3
- "version": "2.0.5",
3
+ "version": "2.0.7",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "author": {