@ccs-ui/rc-pro 2.0.6 → 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, "request" | "auth" | "onCancel" | "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 +1,3 @@
1
- export default function FullScreen(): import("react/jsx-runtime").JSX.Element;
1
+ export default function FullScreen({ onFullScreen, }: {
2
+ onFullScreen: (isFull: boolean) => void;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -9,30 +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 FullScreen() {
12
+ export default function FullScreen(_ref) {
13
+ var onFullScreen = _ref.onFullScreen;
13
14
  var _useState = useState(false),
14
15
  _useState2 = _slicedToArray(_useState, 2),
15
16
  isFull = _useState2[0],
16
17
  setIsFull = _useState2[1];
17
- var handleOnFullScreen = function handleOnFullScreen(full) {
18
- var display = full ? 'none' : '';
19
- var header = document.getElementsByClassName('ccs-layout-header');
20
- if (header && header.length > 0) header[0].style.display = display;
21
- var menu = document.getElementsByClassName('ccs-layout-menu');
22
- if (menu && menu.length > 0) menu[0].style.display = display;
23
- var alive = document.getElementsByClassName('ccs-keep-alive');
24
- if (alive && alive.length > 0) {
25
- var tabs = alive[0].getElementsByClassName('ant-tabs');
26
- if (tabs && tabs.length > 0) tabs[0].style.display = display;
27
- }
28
- var inf = !isFull;
29
- setIsFull(inf);
18
+ var handleOnFullScreen = function handleOnFullScreen() {
19
+ setIsFull(!isFull);
20
+ onFullScreen(!isFull);
30
21
  };
31
22
  return /*#__PURE__*/_jsx(Tooltip, {
32
23
  title: isFull ? '取消全屏' : '全屏',
33
24
  children: isFull ? /*#__PURE__*/_jsx(Button, {
34
25
  onClick: function onClick() {
35
- return handleOnFullScreen(false);
26
+ return handleOnFullScreen();
36
27
  },
37
28
  icon: /*#__PURE__*/_jsx(FullscreenExitOutlined, {
38
29
  className: "".concat(classPrefix, "-icon")
@@ -43,7 +34,7 @@ export default function FullScreen() {
43
34
  }
44
35
  }) : /*#__PURE__*/_jsx(Button, {
45
36
  onClick: function onClick() {
46
- return handleOnFullScreen(true);
37
+ return handleOnFullScreen();
47
38
  },
48
39
  icon: /*#__PURE__*/_jsx(FullscreenOutlined, {
49
40
  className: "".concat(classPrefix, "-icon")
@@ -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
  }
@@ -6,7 +6,7 @@
6
6
  .ccs-table-item-scroll > div {
7
7
  display: flex;
8
8
  flex-direction: column;
9
- padding: 16px;
9
+ padding: 10px 16px 16px 16px;
10
10
  }
11
11
  }
12
12
 
@@ -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),
@@ -187,6 +187,8 @@ export default function TableOperation(_ref) {
187
187
  }
188
188
  })
189
189
  })
190
- }), !isInModalOrDrawer && /*#__PURE__*/_jsx(CcsFullScreenButton, {})]
190
+ }), /*#__PURE__*/_jsx(CcsFullScreenButton, {
191
+ onFullScreen: onFullScreen
192
+ })]
191
193
  });
192
194
  }
@@ -409,9 +409,6 @@ var InternalProTable = function InternalProTable(props) {
409
409
  }
410
410
  onRequest('changePage', paginationTable.current || 0, paginationTable.pageSize || 10);
411
411
  };
412
-
413
- // 判断是否在弹出框中
414
- var isInModalOrDrawer = _typeof(stickyRef.current) === 'object' && stickyRef.current.isInDialog || false;
415
412
  var renderTable = function renderTable() {
416
413
  if (!table) return null;
417
414
  if (!isAuth) {
@@ -516,6 +513,15 @@ var InternalProTable = function InternalProTable(props) {
516
513
  borderRadius: 4
517
514
  }, rootStyle);
518
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
+ };
519
525
  return /*#__PURE__*/_jsxs("div", {
520
526
  className: classNames(classPrefix, className, _defineProperty({}, 'dark-table', isDark)),
521
527
  style: _objectSpread(_objectSpread({}, rootStyle), {}, {
@@ -535,14 +541,14 @@ var InternalProTable = function InternalProTable(props) {
535
541
  formItemLabelWidth: props.formItemLabelWidth,
536
542
  onSearch: _onSearch,
537
543
  tableOperation: (table === null || table === void 0 ? void 0 : table.isEnableToolbar) !== false ? /*#__PURE__*/_jsx(TableOperation, {
538
- isInModalOrDrawer: isInModalOrDrawer,
539
544
  onChangeRowSize: function onChangeRowSize(e) {
540
545
  return setTableRowSize(e);
541
546
  },
542
547
  tableRowSize: tableRowSize,
543
548
  onReset: _onReset,
544
549
  columns: columns,
545
- tableRef: tableRef
550
+ tableRef: tableRef,
551
+ onFullScreen: onFullScreen
546
552
  }) : /*#__PURE__*/_jsx(_Fragment, {}),
547
553
  children: newToolbarExtra
548
554
  }), /*#__PURE__*/_jsxs("div", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccs-ui/rc-pro",
3
- "version": "2.0.6",
3
+ "version": "2.0.7",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "author": {