@magicbe/antd-crud 0.0.17 → 0.0.19
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.
- package/dist/components/index.js +1 -4
- package/dist/config.d.ts +4 -16
- package/dist/config.js +28 -16
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/interface.d.ts +2 -2
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -15,15 +15,12 @@ import Filter from "./Filter";
|
|
|
15
15
|
import Action from "./Action";
|
|
16
16
|
import Table from "./Table";
|
|
17
17
|
import { TableContextProvider, useTableContext } from "./Context";
|
|
18
|
-
import { ConfigProvider } from "antd";
|
|
19
|
-
import Config from "../config";
|
|
20
18
|
var Content = function () {
|
|
21
19
|
var _a = useTableContext(), filter_ref = _a.filter_ref, action_ref = _a.action_ref, table_ref = _a.table_ref, content_ref = _a.content_ref;
|
|
22
20
|
return (_jsxs("div", __assign({ ref: content_ref }, { children: [_jsx(Filter, { ref: filter_ref }), _jsx(Action, { ref: action_ref }), _jsx(Table, { ref: table_ref })] })));
|
|
23
21
|
};
|
|
24
22
|
var ContentPrev = function (props, ref) {
|
|
25
23
|
useImperativeHandle(ref, function () { return ({}); });
|
|
26
|
-
|
|
27
|
-
return (_jsx(ConfigProvider, __assign({}, { theme: theme, locale: locale }, { children: _jsx(TableContextProvider, __assign({}, props, { children: _jsx(Content, {}) })) })));
|
|
24
|
+
return (_jsx(TableContextProvider, __assign({}, props, { children: _jsx(Content, {}) })));
|
|
28
25
|
};
|
|
29
26
|
export default React.forwardRef(ContentPrev);
|
package/dist/config.d.ts
CHANGED
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
theme?: ThemeConfig;
|
|
6
|
-
}
|
|
7
|
-
declare class Config {
|
|
8
|
-
private static locale?;
|
|
9
|
-
private static theme?;
|
|
10
|
-
static definConfig({ locale, theme }?: DefinConfigOptions): void;
|
|
11
|
-
static getConfig(): {
|
|
12
|
-
locale: Locale;
|
|
13
|
-
theme: ThemeConfig;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
export default Config;
|
|
1
|
+
import { ConfigProviderProps } from "antd";
|
|
2
|
+
import React, { PropsWithChildren } from "react";
|
|
3
|
+
declare const CrudConfigProvider: React.FC<PropsWithChildren & ConfigProviderProps>;
|
|
4
|
+
export default CrudConfigProvider;
|
package/dist/config.js
CHANGED
|
@@ -1,17 +1,29 @@
|
|
|
1
|
-
var
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
8
9
|
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import { ConfigProvider } from "antd";
|
|
25
|
+
var CrudConfigProvider = function (_a) {
|
|
26
|
+
var children = _a.children, props = __rest(_a, ["children"]);
|
|
27
|
+
return (_jsx(ConfigProvider, __assign({}, props, { children: children })));
|
|
28
|
+
};
|
|
29
|
+
export default CrudConfigProvider;
|
package/dist/index.d.ts
CHANGED
|
@@ -4,4 +4,4 @@ export { TableContextProvider, useTableContext, } from "./components/Context";
|
|
|
4
4
|
export { default as Filter, type FilterProps, type FilterRef, } from "./components/Filter";
|
|
5
5
|
export { default as Action, AppendAction as MastAppend, DeleteAction as MastDelete, EditAction as MastEdit, type ActionProps, type ActionRef, } from "./components/Action";
|
|
6
6
|
export { default as Table, AppendAction as RowAppend, DeleteAction as RowDelete, EditAction as RowEdit, type TableProps, type TableRef, } from "./components/Table";
|
|
7
|
-
export { default as
|
|
7
|
+
export { default as CrudConfigProvider, } from "./config";
|
package/dist/index.js
CHANGED
|
@@ -3,4 +3,4 @@ export { TableContextProvider, useTableContext, } from "./components/Context";
|
|
|
3
3
|
export { default as Filter, } from "./components/Filter";
|
|
4
4
|
export { default as Action, AppendAction as MastAppend, DeleteAction as MastDelete, EditAction as MastEdit, } from "./components/Action";
|
|
5
5
|
export { default as Table, AppendAction as RowAppend, DeleteAction as RowDelete, EditAction as RowEdit, } from "./components/Table";
|
|
6
|
-
export { default as
|
|
6
|
+
export { default as CrudConfigProvider, } from "./config";
|
package/dist/interface.d.ts
CHANGED
|
@@ -99,7 +99,7 @@ export interface GetSourceFunctionParams extends Record<string, any> {
|
|
|
99
99
|
pageSize?: number;
|
|
100
100
|
}
|
|
101
101
|
/**获取数据的方法 */
|
|
102
|
-
export type getSourceFunction
|
|
102
|
+
export type getSourceFunction<RecordType = AnyObject> = (params?: GetSourceFunctionParams) => Promise<Source<RecordType>>;
|
|
103
103
|
export interface Selection<RecordType = AnyObject> {
|
|
104
104
|
keys?: React.Key[];
|
|
105
105
|
rows?: RecordType[];
|
|
@@ -157,7 +157,7 @@ export type Action = boolean | React.FC | React.FC[] | CustomAction;
|
|
|
157
157
|
/**主体参数 */
|
|
158
158
|
export interface ContentProps<RecordType = AnyObject> extends Omit<TableProps<RecordType>, "columns" | "pagination" | "dataSource" | "loading" | "rowSelection"> {
|
|
159
159
|
columns?: ColumnType<RecordType>[];
|
|
160
|
-
getSources?: getSourceFunction
|
|
160
|
+
getSources?: getSourceFunction<RecordType>;
|
|
161
161
|
add?: add;
|
|
162
162
|
del?: del;
|
|
163
163
|
edit?: edit;
|