@magicbe/antd-crud 0.0.28 → 0.0.30

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.
@@ -28,14 +28,10 @@ import Field from "./Field";
28
28
  import { isObject, isString } from "lodash";
29
29
  import { useTableContext } from "./Context";
30
30
  var AddForm = React.forwardRef(function (_a, ref) {
31
- var _b;
32
31
  var default_data = _a.default_data;
33
32
  var form = AntdForm.useForm()[0];
34
33
  var columns = useTableContext().columns;
35
- var fields = (_b = columns === null || columns === void 0 ? void 0 : columns.filter(function (_a) {
36
- var dataIndex = _a.dataIndex;
37
- return !!dataIndex;
38
- })) === null || _b === void 0 ? void 0 : _b.filter(function (_a) {
34
+ var fields = columns === null || columns === void 0 ? void 0 : columns.filter(function (_a) {
39
35
  var add = _a.add, edit = _a.edit;
40
36
  return !!add;
41
37
  }).map(function (_a) {
@@ -28,14 +28,10 @@ import { useTableContext } from "./Context";
28
28
  import { isObject, isString } from "lodash";
29
29
  import Field from "./Field";
30
30
  var EditForm = React.forwardRef(function (_a, ref) {
31
- var _b;
32
- var _c = _a.default_data, default_data = _c === void 0 ? {} : _c;
31
+ var _b = _a.default_data, default_data = _b === void 0 ? {} : _b;
33
32
  var form = AntdForm.useForm()[0];
34
33
  var columns = useTableContext().columns;
35
- var fields = (_b = columns === null || columns === void 0 ? void 0 : columns.filter(function (_a) {
36
- var dataIndex = _a.dataIndex;
37
- return !!dataIndex;
38
- })) === null || _b === void 0 ? void 0 : _b.filter(function (_a) {
34
+ var fields = columns === null || columns === void 0 ? void 0 : columns.filter(function (_a) {
39
35
  var edit = _a.edit;
40
36
  return !!edit;
41
37
  }).map(function (_a) {
@@ -65,7 +65,7 @@ import { useTableContext } from "./Context";
65
65
  import AddForm from "./Add";
66
66
  import EditForm from "./Edit";
67
67
  var Table = function (_a, ref) {
68
- var _b = useTableContext(), getSources = _b.getSources, selectionType = _b.rowSelection, action = _b.action, content_ref = _b.content_ref, filter_ref = _b.filter_ref, _pagination_ = _b.pagination, props = __rest(_b, ["getSources", "rowSelection", "action", "content_ref", "filter_ref", "pagination"]);
68
+ var _b = useTableContext(), getSources = _b.getSources, selectionType = _b.rowSelection, action = _b.action, content_ref = _b.content_ref, filter_ref = _b.filter_ref, pageSizeOptions = _b.pageSizeOptions, _pagination_ = _b.pagination, props = __rest(_b, ["getSources", "rowSelection", "action", "content_ref", "filter_ref", "pageSizeOptions", "pagination"]);
69
69
  var _c = useState([]), sources = _c[0], setSources = _c[1];
70
70
  var _d = useState(), total = _d[0], setTotal = _d[1];
71
71
  var _e = useState(), page = _e[0], setPage = _e[1];
@@ -159,6 +159,7 @@ var Table = function (_a, ref) {
159
159
  current: page,
160
160
  total: total,
161
161
  pageSize: size,
162
+ pageSizeOptions: pageSizeOptions,
162
163
  showTotal: function (totle) { return "\u5171\u8BA1 ".concat(totle, " \u6761\u6570\u636E"); },
163
164
  showSizeChanger: true,
164
165
  showQuickJumper: true,
@@ -1,4 +1,4 @@
1
- import { type TableProps as AntdTableProps, type InputProps, type SelectProps, type CascaderProps, type DatePickerProps, type InputNumberProps, type CheckboxProps, type RadioProps, type SwitchProps, type TimePickerProps, TreeSelectProps } from "antd";
1
+ import { type TableProps as AntdTableProps, type InputProps, type SelectProps, type CascaderProps, type DatePickerProps, type InputNumberProps, type CheckboxProps, type RadioProps, type SwitchProps, type TimePickerProps, type TreeSelectProps, type PaginationProps } from "antd";
2
2
  import { type CheckboxGroupProps } from "antd/es/checkbox";
3
3
  import { FormInstance, Rule } from "antd/es/form";
4
4
  import { TextAreaProps } from "antd/es/input";
@@ -176,6 +176,7 @@ export interface ContentProps<RecordType = AnyObject> extends Omit<AntdTableProp
176
176
  rowSelection?: RowSelectionType;
177
177
  pagination?: false;
178
178
  drawer?: number | DrawerProps;
179
+ pageSizeOptions?: PaginationProps["pageSizeOptions"];
179
180
  }
180
181
  /**主体暴露 */
181
182
  export interface ContentRef {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magicbe/antd-crud",
3
- "version": "0.0.28",
3
+ "version": "0.0.30",
4
4
  "description": "antd crud table",
5
5
  "author": "wang quan",
6
6
  "private": false,