@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.
@@ -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
- var _a = Config.getConfig(), theme = _a.theme, locale = _a.locale;
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 { ThemeConfig } from "antd";
2
- import { Locale } from "antd/es/locale";
3
- export interface DefinConfigOptions {
4
- locale?: Locale;
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 Config = /** @class */ (function () {
2
- function Config() {
3
- }
4
- Config.definConfig = function (_a) {
5
- var _b = _a === void 0 ? {} : _a, locale = _b.locale, theme = _b.theme;
6
- Config.locale = locale;
7
- Config.theme = theme;
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
- Config.getConfig = function () {
10
- return ({
11
- locale: Config.locale,
12
- theme: Config.theme,
13
- });
14
- };
15
- return Config;
16
- }());
17
- export default Config;
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 Config, type DefinConfigOptions, } from "./config";
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 Config, } from "./config";
6
+ export { default as CrudConfigProvider, } from "./config";
@@ -99,7 +99,7 @@ export interface GetSourceFunctionParams extends Record<string, any> {
99
99
  pageSize?: number;
100
100
  }
101
101
  /**获取数据的方法 */
102
- export type getSourceFunction = <RecordType = AnyObject>(params?: GetSourceFunctionParams) => Promise<Source<RecordType>>;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magicbe/antd-crud",
3
- "version": "0.0.17",
3
+ "version": "0.0.19",
4
4
  "description": "antd crud table",
5
5
  "author": "wang quan",
6
6
  "private": false,