@ecoding/components.antd 0.3.23 → 0.3.24

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,4 +1,5 @@
1
1
  import React from 'react';
2
+ import type { FilterValue, SorterResult, TableCurrentDataSource, TablePaginationConfig } from 'antd/lib/table/interface';
2
3
  interface IProps {
3
4
  className?: string;
4
5
  header?: React.ReactNode;
@@ -13,6 +14,7 @@ interface IProps {
13
14
  operationColumn?: any[];
14
15
  pagination?: any;
15
16
  offsetY?: number;
17
+ onChange?: (pagination: TablePaginationConfig, filters: Record<string, FilterValue | null>, sorter: SorterResult<any> | SorterResult<any>[], extra: TableCurrentDataSource<any>) => void;
16
18
  filterTitle?: string;
17
19
  columnsTitle?: string;
18
20
  selectType?: "checkbox" | "radio";
@@ -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, searchInputArea, loading, rowKey, dataSource, pagination, offsetY, columns, operationColumn, bordered, selectChangeHandler, selectType, columnsTitle, filterTitle }) => {
5
+ const TablePro = memo(({ className, header, buttonArea, filterArea, searchInputArea, loading, rowKey, dataSource, pagination, offsetY, columns, operationColumn, bordered, selectChangeHandler, selectType, onChange, columnsTitle, filterTitle }) => {
6
6
  const ref = useRef(null);
7
7
  const disColumnRef = useRef([]);
8
8
  const [y, setY] = useState('100%');
@@ -85,7 +85,7 @@ const TablePro = memo(({ className, header, buttonArea, filterArea, searchInputA
85
85
  } },
86
86
  React.createElement(Button, { type: "text", icon: React.createElement(MenuOutlined, null) }, columnsTitle))) : null)),
87
87
  dataSource ? (React.createElement("div", { style: { height: '100%', overflow: 'hidden' }, ref: ref },
88
- React.createElement(Table, { rowSelection: selectType ? rowSelection : undefined, bordered: bordered, rowKey: rowKey, columns: showColumns, dataSource: dataSource, scroll: { y }, loading: loading, pagination: pagination || false }))) : null));
88
+ React.createElement(Table, { rowSelection: selectType ? rowSelection : undefined, bordered: bordered, rowKey: rowKey, columns: showColumns, dataSource: dataSource, scroll: { y }, loading: loading, pagination: pagination || false, onChange: onChange || undefined }))) : null));
89
89
  });
90
90
  TablePro.defaultProps = {
91
91
  filterTitle: "筛选",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecoding/components.antd",
3
- "version": "0.3.23",
3
+ "version": "0.3.24",
4
4
  "author": "cxc",
5
5
  "homepage": "",
6
6
  "license": "MIT",
@@ -43,5 +43,5 @@
43
43
  "antd": "^5.8.4",
44
44
  "axios": "^1.1.2"
45
45
  },
46
- "gitHead": "8d992a9a73e5362d1aed37a30df808f9dffd3d40"
46
+ "gitHead": "12e5f8602bbab65800e9517cd1495db686877fe2"
47
47
  }