@faasjs/ant-design 0.0.2-beta.350 → 0.0.2-beta.351
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/index.d.ts +18 -12
- package/dist/index.js +5 -9
- package/dist/index.mjs +5 -9
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DescriptionsProps, DrawerProps as DrawerProps$1, FormItemProps as FormItemProps$1, InputProps, InputNumberProps, SwitchProps, SelectProps, FormProps as FormProps$1, TableColumnProps, TableProps as TableProps$1 } from 'antd';
|
|
2
2
|
export { Drawer } from 'antd';
|
|
3
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
3
4
|
import * as antd_lib_form_Form from 'antd/lib/form/Form';
|
|
4
5
|
import { RuleObject } from 'rc-field-form/lib/interface';
|
|
5
6
|
|
|
@@ -37,6 +38,20 @@ declare function transferOptions(options: BaseOption[]): {
|
|
|
37
38
|
value?: string | number;
|
|
38
39
|
}[];
|
|
39
40
|
|
|
41
|
+
declare type FaasDataWrapperProps<T = any> = {
|
|
42
|
+
dataSource?: T;
|
|
43
|
+
faasData?: {
|
|
44
|
+
action: string;
|
|
45
|
+
params?: Record<string, any>;
|
|
46
|
+
data?: T;
|
|
47
|
+
setData?: Dispatch<SetStateAction<T>>;
|
|
48
|
+
};
|
|
49
|
+
render: (args: {
|
|
50
|
+
data: T;
|
|
51
|
+
}) => JSX.Element;
|
|
52
|
+
fallback?: JSX.Element;
|
|
53
|
+
};
|
|
54
|
+
|
|
40
55
|
declare type ExtendDescriptionTypeProps = {
|
|
41
56
|
children?: JSX.Element | null;
|
|
42
57
|
render?: (value: any, values: any) => JSX.Element | string | number | boolean | null;
|
|
@@ -48,16 +63,11 @@ declare type DescriptionItemProps<T = any> = {
|
|
|
48
63
|
} & FaasItemProps;
|
|
49
64
|
declare type DescriptionProps<T = any, ExtendItemProps = any> = {
|
|
50
65
|
items: (DescriptionItemProps | ExtendItemProps)[];
|
|
51
|
-
dataSource?: T;
|
|
52
|
-
faasData?: {
|
|
53
|
-
action: string;
|
|
54
|
-
params?: Record<string, any>;
|
|
55
|
-
};
|
|
56
66
|
extendTypes?: {
|
|
57
67
|
[key: string]: ExtendDescriptionTypeProps;
|
|
58
68
|
};
|
|
59
|
-
} & DescriptionsProps;
|
|
60
|
-
declare function Description(props: DescriptionProps): JSX.Element;
|
|
69
|
+
} & FaasDataWrapperProps<T> & DescriptionsProps;
|
|
70
|
+
declare function Description<T = any>(props: DescriptionProps<T>): JSX.Element;
|
|
61
71
|
|
|
62
72
|
declare type DrawerProps = DrawerProps$1 & {
|
|
63
73
|
children?: JSX.Element | JSX.Element[];
|
|
@@ -141,11 +151,7 @@ declare type TableProps<T = any, ExtendTypes = any> = {
|
|
|
141
151
|
extendTypes?: {
|
|
142
152
|
[key: string]: ExtendTableTypeProps;
|
|
143
153
|
};
|
|
144
|
-
|
|
145
|
-
action: string;
|
|
146
|
-
params?: Record<string, any>;
|
|
147
|
-
};
|
|
148
|
-
} & TableProps$1<T>;
|
|
154
|
+
} & FaasDataWrapperProps<T> & TableProps$1<T>;
|
|
149
155
|
declare function Table<T = any, ExtendTypes = any>(props: TableProps<T, ExtendTypes>): JSX.Element;
|
|
150
156
|
|
|
151
157
|
export { BaseItemProps, BaseOption, Blank, Description, DescriptionItemProps, DescriptionProps, DrawerProps, ExtendDescriptionItemProps, ExtendDescriptionTypeProps, ExtendFormItemProps, ExtendFormTypeProps, ExtendTableItemProps, ExtendTableTypeProps, FaasItemProps, FaasItemType, FaasItemTypeValue, Form, FormItem, FormItemProps, FormProps, Table, TableItemProps, TableProps, transferOptions, useDrawer };
|
package/dist/index.js
CHANGED
|
@@ -87,7 +87,7 @@ var import_antd2 = require("antd");
|
|
|
87
87
|
var import_lodash3 = require("lodash");
|
|
88
88
|
var import_react4 = require("react");
|
|
89
89
|
|
|
90
|
-
// src/
|
|
90
|
+
// src/FaasDataWrapper.tsx
|
|
91
91
|
var import_react2 = require("react");
|
|
92
92
|
var import_react3 = require("@faasjs/react");
|
|
93
93
|
function FaasDataWrapper({
|
|
@@ -180,9 +180,7 @@ function DescriptionItemContent(props) {
|
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
function Description(props) {
|
|
183
|
-
return /* @__PURE__ */ import_react.default.createElement(FaasDataWrapper, {
|
|
184
|
-
dataSource: props.dataSource,
|
|
185
|
-
faasData: props.faasData,
|
|
183
|
+
return /* @__PURE__ */ import_react.default.createElement(FaasDataWrapper, __spreadProps(__spreadValues({}, props), {
|
|
186
184
|
render: ({ data }) => /* @__PURE__ */ import_react.default.createElement(import_antd2.Descriptions, __spreadValues({}, props), props.items.map((item) => /* @__PURE__ */ import_react.default.createElement(import_antd2.Descriptions.Item, {
|
|
187
185
|
key: item.id,
|
|
188
186
|
label: item.title || (0, import_lodash3.upperFirst)(item.id)
|
|
@@ -192,7 +190,7 @@ function Description(props) {
|
|
|
192
190
|
values: data,
|
|
193
191
|
extendTypes: props.extendTypes
|
|
194
192
|
}))))
|
|
195
|
-
});
|
|
193
|
+
}));
|
|
196
194
|
}
|
|
197
195
|
|
|
198
196
|
// src/Drawer.tsx
|
|
@@ -535,15 +533,13 @@ function Table(props) {
|
|
|
535
533
|
}, [props.items]);
|
|
536
534
|
if (!columns)
|
|
537
535
|
return null;
|
|
538
|
-
return /* @__PURE__ */ import_react.default.createElement(FaasDataWrapper, {
|
|
539
|
-
dataSource: props.dataSource,
|
|
540
|
-
faasData: props.faasData,
|
|
536
|
+
return /* @__PURE__ */ import_react.default.createElement(FaasDataWrapper, __spreadValues({
|
|
541
537
|
render: ({ data }) => /* @__PURE__ */ import_react.default.createElement(import_antd6.Table, __spreadProps(__spreadValues({}, props), {
|
|
542
538
|
rowKey: props.rowKey || "id",
|
|
543
539
|
columns,
|
|
544
540
|
dataSource: data
|
|
545
541
|
}))
|
|
546
|
-
});
|
|
542
|
+
}, props));
|
|
547
543
|
}
|
|
548
544
|
module.exports = __toCommonJS(src_exports);
|
|
549
545
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/index.mjs
CHANGED
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
useState as useState2
|
|
54
54
|
} from "react";
|
|
55
55
|
|
|
56
|
-
// src/
|
|
56
|
+
// src/FaasDataWrapper.tsx
|
|
57
57
|
import {
|
|
58
58
|
useEffect,
|
|
59
59
|
useState
|
|
@@ -149,9 +149,7 @@ function DescriptionItemContent(props) {
|
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
function Description(props) {
|
|
152
|
-
return /* @__PURE__ */ React.createElement(FaasDataWrapper, {
|
|
153
|
-
dataSource: props.dataSource,
|
|
154
|
-
faasData: props.faasData,
|
|
152
|
+
return /* @__PURE__ */ React.createElement(FaasDataWrapper, __spreadProps(__spreadValues({}, props), {
|
|
155
153
|
render: ({ data }) => /* @__PURE__ */ React.createElement(Descriptions, __spreadValues({}, props), props.items.map((item) => /* @__PURE__ */ React.createElement(Descriptions.Item, {
|
|
156
154
|
key: item.id,
|
|
157
155
|
label: item.title || upperFirst2(item.id)
|
|
@@ -161,7 +159,7 @@ function Description(props) {
|
|
|
161
159
|
values: data,
|
|
162
160
|
extendTypes: props.extendTypes
|
|
163
161
|
}))))
|
|
164
|
-
});
|
|
162
|
+
}));
|
|
165
163
|
}
|
|
166
164
|
|
|
167
165
|
// src/Drawer.tsx
|
|
@@ -523,15 +521,13 @@ function Table(props) {
|
|
|
523
521
|
}, [props.items]);
|
|
524
522
|
if (!columns)
|
|
525
523
|
return null;
|
|
526
|
-
return /* @__PURE__ */ React.createElement(FaasDataWrapper, {
|
|
527
|
-
dataSource: props.dataSource,
|
|
528
|
-
faasData: props.faasData,
|
|
524
|
+
return /* @__PURE__ */ React.createElement(FaasDataWrapper, __spreadValues({
|
|
529
525
|
render: ({ data }) => /* @__PURE__ */ React.createElement(AntdTable, __spreadProps(__spreadValues({}, props), {
|
|
530
526
|
rowKey: props.rowKey || "id",
|
|
531
527
|
columns,
|
|
532
528
|
dataSource: data
|
|
533
529
|
}))
|
|
534
|
-
});
|
|
530
|
+
}, props));
|
|
535
531
|
}
|
|
536
532
|
export {
|
|
537
533
|
Blank,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faasjs/ant-design",
|
|
3
|
-
"version": "0.0.2-beta.
|
|
3
|
+
"version": "0.0.2-beta.351",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"lodash": "*",
|
|
28
28
|
"react": "*",
|
|
29
29
|
"react-dom": "*",
|
|
30
|
-
"@faasjs/react": "^0.0.2-beta.
|
|
30
|
+
"@faasjs/react": "^0.0.2-beta.351"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/lodash": "*",
|