@ecoding/components.antd 0.2.15 → 0.2.16

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,6 +6,7 @@ interface IProps {
6
6
  filterArea?: React.ReactElement;
7
7
  loading?: boolean;
8
8
  rowKey: string;
9
+ bordered?: boolean;
9
10
  dataSource: any;
10
11
  columns: any[];
11
12
  operationColumn?: any[];
@@ -2,7 +2,7 @@ import React, { memo, useEffect, useMemo, useRef, useState } from 'react';
2
2
  import { Popover, Button, Typography, Table } from 'antd';
3
3
  import { FilterOutlined, MenuOutlined } from '@ant-design/icons';
4
4
  import TableProColumns from "./columns";
5
- const TablePro = memo(({ className, header, buttonArea, filterArea, loading, rowKey, dataSource, pagination, offsetY, columns, operationColumn, columnsTitle, filterTitle }) => {
5
+ const TablePro = memo(({ className, header, buttonArea, filterArea, loading, rowKey, dataSource, pagination, offsetY, columns, operationColumn, bordered, columnsTitle, filterTitle }) => {
6
6
  const ref = useRef(null);
7
7
  const disColumnRef = useRef([]);
8
8
  const [y, setY] = useState('100%');
@@ -24,10 +24,7 @@ const TablePro = memo(({ className, header, buttonArea, filterArea, loading, row
24
24
  setOpenFilter(false);
25
25
  };
26
26
  const showColumns = useMemo(() => {
27
- if (dataSource && dataSource.length > 0) {
28
- return innerColumns.filter((c) => c.checked !== false).concat(operationColumn || []);
29
- }
30
- return [];
27
+ return innerColumns.filter((c) => c.checked !== false).concat(operationColumn || []);
31
28
  }, [innerColumns, dataSource]);
32
29
  useEffect(() => {
33
30
  if (disColumnRef.current && disColumnRef.current.length > 0 && columns.length > 0) {
@@ -70,10 +67,11 @@ const TablePro = memo(({ className, header, buttonArea, filterArea, loading, row
70
67
  } },
71
68
  React.createElement(Button, { type: "text", icon: React.createElement(MenuOutlined, null) }, columnsTitle))) : null)),
72
69
  dataSource ? (React.createElement("div", { style: { height: '100%', overflow: 'hidden' }, ref: ref },
73
- React.createElement(Table, { bordered: true, rowKey: rowKey, columns: showColumns, dataSource: dataSource, scroll: { y }, loading: loading, pagination: pagination || false }))) : null));
70
+ React.createElement(Table, { bordered: bordered, rowKey: rowKey, columns: showColumns, dataSource: dataSource, scroll: { y }, loading: loading, pagination: pagination || false }))) : null));
74
71
  });
75
72
  TablePro.defaultProps = {
76
73
  filterTitle: "筛选",
77
- columnsTitle: "显示列"
74
+ columnsTitle: "显示列",
75
+ bordered: false
78
76
  };
79
77
  export default TablePro;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecoding/components.antd",
3
- "version": "0.2.15",
3
+ "version": "0.2.16",
4
4
  "author": "cxc",
5
5
  "homepage": "",
6
6
  "license": "MIT",
@@ -44,5 +44,5 @@
44
44
  "dependencies": {
45
45
  "react-quill": "^2.0.0"
46
46
  },
47
- "gitHead": "cf08f1f36056c20b5e1aa37d8568c21a4a20bcf2"
47
+ "gitHead": "d43fb93777143fd7818502a8cee5b53b9f6ba88d"
48
48
  }