@teamias/rex-pro 0.1.1 → 0.1.2
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.
|
@@ -31,6 +31,10 @@ export default (function () {
|
|
|
31
31
|
var tableData = {
|
|
32
32
|
items: [{
|
|
33
33
|
key: 'parent_1075',
|
|
34
|
+
qweqwe: [{
|
|
35
|
+
type: 'group',
|
|
36
|
+
props: []
|
|
37
|
+
}],
|
|
34
38
|
id: [{
|
|
35
39
|
type: 'text',
|
|
36
40
|
props: {
|
|
@@ -681,6 +685,9 @@ export default (function () {
|
|
|
681
685
|
// tableHeaderUrl: '/tableProps',
|
|
682
686
|
// tableHeaderParams?: Record<string, unknown>;
|
|
683
687
|
tableHeaderConfig: [{
|
|
688
|
+
title: 'qweqwe',
|
|
689
|
+
dataIndex: 'qweqwe'
|
|
690
|
+
}, {
|
|
684
691
|
title: '编号/状态',
|
|
685
692
|
dataIndex: 'status_name',
|
|
686
693
|
key: 'status_name'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { IRexProTableProps, IRexProTableRef } from './types';
|
|
2
|
-
export declare const RexProTable: <TF extends Record<string, unknown>, TT extends Record<string, unknown>>({ toolbar, filterFormProps, tableProps, listTableProps, request, defaultPageSize, autoInitRequest, hidePagination, actionConfig, proTableRef, reload, }: IRexProTableProps<TF, TT> & {
|
|
2
|
+
export declare const RexProTable: <TF extends Record<string, unknown>, TT extends Record<string, unknown>>({ toolbar, filterFormProps, tableProps, listTableProps, request, defaultPageSize, autoInitRequest, hidePagination, pageSizeOptions, cardProps, actionConfig, proTableRef, reload, }: IRexProTableProps<TF, TT> & {
|
|
3
3
|
reload?: ((wait?: number | undefined) => Promise<void>) | undefined;
|
|
4
4
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -25,7 +25,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
25
25
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
26
26
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
27
27
|
var InlineRexProTable = function InlineRexProTable(_ref) {
|
|
28
|
-
var _state$dataSource;
|
|
28
|
+
var _cardProps$form, _cardProps$form2, _cardProps$form3, _cardProps$table, _cardProps$table2, _state$dataSource;
|
|
29
29
|
var toolbar = _ref.toolbar,
|
|
30
30
|
filterFormProps = _ref.filterFormProps,
|
|
31
31
|
tableProps = _ref.tableProps,
|
|
@@ -37,6 +37,9 @@ var InlineRexProTable = function InlineRexProTable(_ref) {
|
|
|
37
37
|
autoInitRequest = _ref$autoInitRequest === void 0 ? false : _ref$autoInitRequest,
|
|
38
38
|
_ref$hidePagination = _ref.hidePagination,
|
|
39
39
|
hidePagination = _ref$hidePagination === void 0 ? false : _ref$hidePagination,
|
|
40
|
+
_ref$pageSizeOptions = _ref.pageSizeOptions,
|
|
41
|
+
pageSizeOptions = _ref$pageSizeOptions === void 0 ? [10, 20, 50, 100] : _ref$pageSizeOptions,
|
|
42
|
+
cardProps = _ref.cardProps,
|
|
40
43
|
actionConfig = _ref.actionConfig,
|
|
41
44
|
proTableRef = _ref.proTableRef,
|
|
42
45
|
_reload = _ref.reload;
|
|
@@ -238,16 +241,17 @@ var InlineRexProTable = function InlineRexProTable(_ref) {
|
|
|
238
241
|
});
|
|
239
242
|
return /*#__PURE__*/_jsxs(Wrapper, {
|
|
240
243
|
className: "pro-rex-table-box",
|
|
241
|
-
children: [/*#__PURE__*/_jsx(Card, {
|
|
242
|
-
size: "small"
|
|
243
|
-
|
|
244
|
+
children: [/*#__PURE__*/_jsx(Card, _objectSpread(_objectSpread({
|
|
245
|
+
size: "small"
|
|
246
|
+
}, cardProps === null || cardProps === void 0 ? void 0 : cardProps.form), {}, {
|
|
247
|
+
style: _objectSpread({
|
|
244
248
|
display: filterFormProps !== null && filterFormProps !== void 0 && filterFormProps.hidden ? 'none' : undefined
|
|
245
|
-
},
|
|
246
|
-
styles: {
|
|
247
|
-
body: {
|
|
249
|
+
}, cardProps === null || cardProps === void 0 || (_cardProps$form = cardProps.form) === null || _cardProps$form === void 0 ? void 0 : _cardProps$form.style),
|
|
250
|
+
styles: _objectSpread(_objectSpread({}, cardProps === null || cardProps === void 0 || (_cardProps$form2 = cardProps.form) === null || _cardProps$form2 === void 0 ? void 0 : _cardProps$form2.styles), {}, {
|
|
251
|
+
body: _objectSpread({
|
|
248
252
|
padding: 10
|
|
249
|
-
}
|
|
250
|
-
},
|
|
253
|
+
}, cardProps === null || cardProps === void 0 || (_cardProps$form3 = cardProps.form) === null || _cardProps$form3 === void 0 || (_cardProps$form3 = _cardProps$form3.styles) === null || _cardProps$form3 === void 0 ? void 0 : _cardProps$form3.body)
|
|
254
|
+
}),
|
|
251
255
|
children: /*#__PURE__*/_jsx(FilterForm, _objectSpread(_objectSpread({}, filterFormProps), {}, {
|
|
252
256
|
loading: state.loading,
|
|
253
257
|
form: form,
|
|
@@ -271,22 +275,23 @@ var InlineRexProTable = function InlineRexProTable(_ref) {
|
|
|
271
275
|
}
|
|
272
276
|
}
|
|
273
277
|
}))
|
|
274
|
-
}), listTableProps ? /*#__PURE__*/_jsx(_Fragment, {}) : /*#__PURE__*/_jsx(ToolbarBox, {
|
|
278
|
+
})), listTableProps ? /*#__PURE__*/_jsx(_Fragment, {}) : /*#__PURE__*/_jsx(ToolbarBox, {
|
|
275
279
|
className: "pro-rex-toolbar-box",
|
|
276
280
|
style: {
|
|
277
281
|
marginBottom: 0
|
|
278
282
|
},
|
|
279
283
|
children: batchActionNodeFn()
|
|
280
|
-
}), /*#__PURE__*/_jsxs(Card, {
|
|
284
|
+
}), /*#__PURE__*/_jsxs(Card, _objectSpread(_objectSpread({
|
|
281
285
|
size: "small",
|
|
282
|
-
rootClassName: "pro-rex-table-card"
|
|
283
|
-
|
|
284
|
-
|
|
286
|
+
rootClassName: "pro-rex-table-card"
|
|
287
|
+
}, cardProps === null || cardProps === void 0 ? void 0 : cardProps.table), {}, {
|
|
288
|
+
styles: _objectSpread(_objectSpread({}, cardProps === null || cardProps === void 0 || (_cardProps$table = cardProps.table) === null || _cardProps$table === void 0 ? void 0 : _cardProps$table.styles), {}, {
|
|
289
|
+
body: _objectSpread({
|
|
285
290
|
display: 'flex',
|
|
286
291
|
flexDirection: 'column',
|
|
287
292
|
padding: 10
|
|
288
|
-
}
|
|
289
|
-
},
|
|
293
|
+
}, cardProps === null || cardProps === void 0 || (_cardProps$table2 = cardProps.table) === null || _cardProps$table2 === void 0 || (_cardProps$table2 = _cardProps$table2.styles) === null || _cardProps$table2 === void 0 ? void 0 : _cardProps$table2.body)
|
|
294
|
+
}),
|
|
290
295
|
children: [listTableProps ? /*#__PURE__*/_jsx(BaseListTable, _objectSpread(_objectSpread({
|
|
291
296
|
dataSource: state.dataSource
|
|
292
297
|
}, listTableProps), {}, {
|
|
@@ -328,6 +333,7 @@ var InlineRexProTable = function InlineRexProTable(_ref) {
|
|
|
328
333
|
action.getList(1);
|
|
329
334
|
}
|
|
330
335
|
})), (_state$dataSource = state.dataSource) !== null && _state$dataSource !== void 0 && _state$dataSource.length && !hidePagination ? /*#__PURE__*/_jsx(Pagination, {
|
|
336
|
+
pageSizeOptions: pageSizeOptions,
|
|
331
337
|
style: {
|
|
332
338
|
marginTop: 10
|
|
333
339
|
},
|
|
@@ -354,7 +360,7 @@ var InlineRexProTable = function InlineRexProTable(_ref) {
|
|
|
354
360
|
change();
|
|
355
361
|
}
|
|
356
362
|
}) : /*#__PURE__*/_jsx(_Fragment, {})]
|
|
357
|
-
})]
|
|
363
|
+
}))]
|
|
358
364
|
});
|
|
359
365
|
};
|
|
360
366
|
export var RexProTable = function RexProTable(props) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FilterForm, IFilterFormProps } from "../../filter-form";
|
|
2
2
|
import { BaseListTable, BaseTable, RequestFieldsContainer, TButtonFilterItem } from '@teamias/rex-design';
|
|
3
|
-
import { Button, DrawerProps, DropDownProps, FormInstance, GetProps, ModalProps } from 'antd';
|
|
3
|
+
import { Button, Card, DrawerProps, DropDownProps, FormInstance, GetProps, ModalProps } from 'antd';
|
|
4
4
|
import { SizeType } from 'antd/es/config-provider/SizeContext';
|
|
5
5
|
import { MutableRefObject, ReactNode } from 'react';
|
|
6
6
|
/** 组件props */
|
|
@@ -24,6 +24,16 @@ export interface IRexProTableProps<TF extends Record<string, unknown> = Record<s
|
|
|
24
24
|
* @default false
|
|
25
25
|
*/
|
|
26
26
|
autoInitRequest?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* 每页条数配置
|
|
29
|
+
* @default [10, 20, 50, 100]
|
|
30
|
+
*/
|
|
31
|
+
pageSizeOptions?: number[];
|
|
32
|
+
/** card props */
|
|
33
|
+
cardProps?: {
|
|
34
|
+
form?: GetProps<typeof Card>;
|
|
35
|
+
table?: GetProps<typeof Card>;
|
|
36
|
+
};
|
|
27
37
|
/** 隐藏分页 */
|
|
28
38
|
hidePagination?: boolean;
|
|
29
39
|
/** proTable 操作对象 */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teamias/rex-pro",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "A react library developed with dumi",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@ant-design/icons": "^6.1.0",
|
|
53
53
|
"@ant-design/pro-components": "^2.8.10",
|
|
54
|
-
"@teamias/rex-design": "^0.1.
|
|
54
|
+
"@teamias/rex-design": "^0.1.12",
|
|
55
55
|
"ahooks": "^3.9.6",
|
|
56
56
|
"antd": "^5.26.7",
|
|
57
57
|
"classnames": "^2.5.1",
|