@faasjs/ant-design 0.0.2-beta.416 → 0.0.2-beta.417
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 +1 -0
- package/dist/index.js +80 -134
- package/dist/index.mjs +101 -155
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -151,6 +151,7 @@ declare type DescriptionProps<T = any, ExtendItemProps = any> = {
|
|
|
151
151
|
};
|
|
152
152
|
dataSource?: T;
|
|
153
153
|
faasData?: FaasDataWrapperProps<T>;
|
|
154
|
+
footer?: (values: T) => JSX.Element;
|
|
154
155
|
} & DescriptionsProps;
|
|
155
156
|
declare function Description<T = any>(props: DescriptionProps<T>): JSX.Element;
|
|
156
157
|
|
package/dist/index.js
CHANGED
|
@@ -220,7 +220,7 @@ function DescriptionItemContent(props) {
|
|
|
220
220
|
children: computedProps.item.render(computedProps.value, computedProps.values)
|
|
221
221
|
});
|
|
222
222
|
if (typeof computedProps.value === "undefined" || computedProps.value === null)
|
|
223
|
-
return
|
|
223
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Blank, {});
|
|
224
224
|
switch (computedProps.item.type) {
|
|
225
225
|
case "string[]":
|
|
226
226
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, {
|
|
@@ -258,33 +258,39 @@ function DescriptionItemContent(props) {
|
|
|
258
258
|
}
|
|
259
259
|
function Description(props) {
|
|
260
260
|
if (!props.faasData)
|
|
261
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.
|
|
261
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_antd3.Descriptions, {
|
|
262
262
|
...props,
|
|
263
|
-
children:
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
263
|
+
children: [
|
|
264
|
+
props.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_antd3.Descriptions.Item, {
|
|
265
|
+
label: item.title || (0, import_lodash4.upperFirst)(item.id),
|
|
266
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(DescriptionItemContent, {
|
|
267
|
+
item,
|
|
268
|
+
value: props.dataSource[item.id],
|
|
269
|
+
values: props.dataSource,
|
|
270
|
+
extendTypes: props.extendTypes
|
|
271
|
+
})
|
|
272
|
+
}, item.id)),
|
|
273
|
+
props.footer && props.footer(props.dataSource)
|
|
274
|
+
]
|
|
272
275
|
});
|
|
273
276
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react4.FaasDataWrapper, {
|
|
274
277
|
fallback: props.faasData.fallback || /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_antd3.Skeleton, {
|
|
275
278
|
active: true
|
|
276
279
|
}),
|
|
277
|
-
render: ({ data }) => /* @__PURE__ */ (0, import_jsx_runtime3.
|
|
280
|
+
render: ({ data }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_antd3.Descriptions, {
|
|
278
281
|
...props,
|
|
279
|
-
children:
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
282
|
+
children: [
|
|
283
|
+
props.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_antd3.Descriptions.Item, {
|
|
284
|
+
label: item.title || (0, import_lodash4.upperFirst)(item.id),
|
|
285
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(DescriptionItemContent, {
|
|
286
|
+
item,
|
|
287
|
+
value: data[item.id],
|
|
288
|
+
values: data,
|
|
289
|
+
extendTypes: props.extendTypes
|
|
290
|
+
})
|
|
291
|
+
}, item.id)),
|
|
292
|
+
props.footer && props.footer(data)
|
|
293
|
+
]
|
|
288
294
|
}),
|
|
289
295
|
...props.faasData
|
|
290
296
|
});
|
|
@@ -904,7 +910,7 @@ var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
|
904
910
|
function processValue(item, value) {
|
|
905
911
|
var _a;
|
|
906
912
|
if (typeof value === "undefined" && value === null)
|
|
907
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
913
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Blank, {});
|
|
908
914
|
if (item.options) {
|
|
909
915
|
if (item.type.endsWith("[]"))
|
|
910
916
|
return value.map((v) => {
|
|
@@ -976,34 +982,19 @@ function Table(props) {
|
|
|
976
982
|
selectedKeys,
|
|
977
983
|
confirm,
|
|
978
984
|
clearFilters
|
|
979
|
-
}) => /* @__PURE__ */ (0, import_jsx_runtime11.
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
type: "button",
|
|
993
|
-
onClick: () => confirm(),
|
|
994
|
-
style: {
|
|
995
|
-
width: 90,
|
|
996
|
-
marginRight: 8
|
|
997
|
-
},
|
|
998
|
-
children: common2.search
|
|
999
|
-
}),
|
|
1000
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", {
|
|
1001
|
-
type: "button",
|
|
1002
|
-
onClick: () => clearFilters(),
|
|
1003
|
-
style: { width: 90 },
|
|
1004
|
-
children: common2.reset
|
|
1005
|
-
})
|
|
1006
|
-
]
|
|
985
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_antd10.Input.Search, {
|
|
986
|
+
placeholder: `${common2.search} ${item.title}`,
|
|
987
|
+
value: selectedKeys[0],
|
|
988
|
+
allowClear: true,
|
|
989
|
+
onSearch: (v) => {
|
|
990
|
+
if (v) {
|
|
991
|
+
setSelectedKeys([v]);
|
|
992
|
+
} else {
|
|
993
|
+
setSelectedKeys([]);
|
|
994
|
+
clearFilters();
|
|
995
|
+
}
|
|
996
|
+
confirm();
|
|
997
|
+
}
|
|
1007
998
|
});
|
|
1008
999
|
break;
|
|
1009
1000
|
case "string[]":
|
|
@@ -1017,34 +1008,19 @@ function Table(props) {
|
|
|
1017
1008
|
selectedKeys,
|
|
1018
1009
|
confirm,
|
|
1019
1010
|
clearFilters
|
|
1020
|
-
}) => /* @__PURE__ */ (0, import_jsx_runtime11.
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
type: "button",
|
|
1034
|
-
onClick: () => confirm(),
|
|
1035
|
-
style: {
|
|
1036
|
-
width: 90,
|
|
1037
|
-
marginRight: 8
|
|
1038
|
-
},
|
|
1039
|
-
children: common2.search
|
|
1040
|
-
}),
|
|
1041
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", {
|
|
1042
|
-
type: "button",
|
|
1043
|
-
onClick: () => clearFilters(),
|
|
1044
|
-
style: { width: 90 },
|
|
1045
|
-
children: common2.reset
|
|
1046
|
-
})
|
|
1047
|
-
]
|
|
1011
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_antd10.Input.Search, {
|
|
1012
|
+
placeholder: `${common2.search} ${item.title}`,
|
|
1013
|
+
value: selectedKeys[0],
|
|
1014
|
+
allowClear: true,
|
|
1015
|
+
onSearch: (v) => {
|
|
1016
|
+
if (v) {
|
|
1017
|
+
setSelectedKeys([v]);
|
|
1018
|
+
} else {
|
|
1019
|
+
setSelectedKeys([]);
|
|
1020
|
+
clearFilters();
|
|
1021
|
+
}
|
|
1022
|
+
confirm();
|
|
1023
|
+
}
|
|
1048
1024
|
});
|
|
1049
1025
|
break;
|
|
1050
1026
|
case "number":
|
|
@@ -1060,34 +1036,19 @@ function Table(props) {
|
|
|
1060
1036
|
selectedKeys,
|
|
1061
1037
|
confirm,
|
|
1062
1038
|
clearFilters
|
|
1063
|
-
}) => /* @__PURE__ */ (0, import_jsx_runtime11.
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
type: "button",
|
|
1077
|
-
onClick: () => confirm(),
|
|
1078
|
-
style: {
|
|
1079
|
-
width: 90,
|
|
1080
|
-
marginRight: 8
|
|
1081
|
-
},
|
|
1082
|
-
children: common2.search
|
|
1083
|
-
}),
|
|
1084
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", {
|
|
1085
|
-
type: "button",
|
|
1086
|
-
onClick: () => clearFilters(),
|
|
1087
|
-
style: { width: 90 },
|
|
1088
|
-
children: common2.reset
|
|
1089
|
-
})
|
|
1090
|
-
]
|
|
1039
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_antd10.Input.Search, {
|
|
1040
|
+
placeholder: `${common2.search} ${item.title}`,
|
|
1041
|
+
value: selectedKeys[0],
|
|
1042
|
+
allowClear: true,
|
|
1043
|
+
onSearch: (v) => {
|
|
1044
|
+
if (v) {
|
|
1045
|
+
setSelectedKeys([v]);
|
|
1046
|
+
} else {
|
|
1047
|
+
setSelectedKeys([]);
|
|
1048
|
+
clearFilters();
|
|
1049
|
+
}
|
|
1050
|
+
confirm();
|
|
1051
|
+
}
|
|
1091
1052
|
});
|
|
1092
1053
|
break;
|
|
1093
1054
|
case "number[]":
|
|
@@ -1101,34 +1062,19 @@ function Table(props) {
|
|
|
1101
1062
|
selectedKeys,
|
|
1102
1063
|
confirm,
|
|
1103
1064
|
clearFilters
|
|
1104
|
-
}) => /* @__PURE__ */ (0, import_jsx_runtime11.
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
type: "button",
|
|
1118
|
-
onClick: () => confirm(),
|
|
1119
|
-
style: {
|
|
1120
|
-
width: 90,
|
|
1121
|
-
marginRight: 8
|
|
1122
|
-
},
|
|
1123
|
-
children: common2.search
|
|
1124
|
-
}),
|
|
1125
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", {
|
|
1126
|
-
type: "button",
|
|
1127
|
-
onClick: () => clearFilters(),
|
|
1128
|
-
style: { width: 90 },
|
|
1129
|
-
children: common2.reset
|
|
1130
|
-
})
|
|
1131
|
-
]
|
|
1065
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_antd10.Input.Search, {
|
|
1066
|
+
placeholder: `${common2.search} ${item.title}`,
|
|
1067
|
+
value: selectedKeys[0],
|
|
1068
|
+
allowClear: true,
|
|
1069
|
+
onSearch: (v) => {
|
|
1070
|
+
if (v) {
|
|
1071
|
+
setSelectedKeys([v]);
|
|
1072
|
+
} else {
|
|
1073
|
+
setSelectedKeys([]);
|
|
1074
|
+
clearFilters();
|
|
1075
|
+
}
|
|
1076
|
+
confirm();
|
|
1077
|
+
}
|
|
1132
1078
|
});
|
|
1133
1079
|
break;
|
|
1134
1080
|
case "boolean":
|
package/dist/index.mjs
CHANGED
|
@@ -129,7 +129,7 @@ import {
|
|
|
129
129
|
} from "react";
|
|
130
130
|
import dayjs from "dayjs";
|
|
131
131
|
import { FaasDataWrapper } from "@faasjs/react";
|
|
132
|
-
import { Fragment, jsx as jsx3 } from "react/jsx-runtime";
|
|
132
|
+
import { Fragment, jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
133
133
|
function DescriptionItemContent(props) {
|
|
134
134
|
const [computedProps, setComputedProps] = useState2();
|
|
135
135
|
useEffect2(() => {
|
|
@@ -181,7 +181,7 @@ function DescriptionItemContent(props) {
|
|
|
181
181
|
children: computedProps.item.render(computedProps.value, computedProps.values)
|
|
182
182
|
});
|
|
183
183
|
if (typeof computedProps.value === "undefined" || computedProps.value === null)
|
|
184
|
-
return
|
|
184
|
+
return /* @__PURE__ */ jsx3(Blank, {});
|
|
185
185
|
switch (computedProps.item.type) {
|
|
186
186
|
case "string[]":
|
|
187
187
|
return /* @__PURE__ */ jsx3(Fragment, {
|
|
@@ -219,33 +219,39 @@ function DescriptionItemContent(props) {
|
|
|
219
219
|
}
|
|
220
220
|
function Description(props) {
|
|
221
221
|
if (!props.faasData)
|
|
222
|
-
return /* @__PURE__ */
|
|
222
|
+
return /* @__PURE__ */ jsxs(Descriptions, {
|
|
223
223
|
...props,
|
|
224
|
-
children:
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
224
|
+
children: [
|
|
225
|
+
props.items.map((item) => /* @__PURE__ */ jsx3(Descriptions.Item, {
|
|
226
|
+
label: item.title || upperFirst2(item.id),
|
|
227
|
+
children: /* @__PURE__ */ jsx3(DescriptionItemContent, {
|
|
228
|
+
item,
|
|
229
|
+
value: props.dataSource[item.id],
|
|
230
|
+
values: props.dataSource,
|
|
231
|
+
extendTypes: props.extendTypes
|
|
232
|
+
})
|
|
233
|
+
}, item.id)),
|
|
234
|
+
props.footer && props.footer(props.dataSource)
|
|
235
|
+
]
|
|
233
236
|
});
|
|
234
237
|
return /* @__PURE__ */ jsx3(FaasDataWrapper, {
|
|
235
238
|
fallback: props.faasData.fallback || /* @__PURE__ */ jsx3(Skeleton, {
|
|
236
239
|
active: true
|
|
237
240
|
}),
|
|
238
|
-
render: ({ data }) => /* @__PURE__ */
|
|
241
|
+
render: ({ data }) => /* @__PURE__ */ jsxs(Descriptions, {
|
|
239
242
|
...props,
|
|
240
|
-
children:
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
243
|
+
children: [
|
|
244
|
+
props.items.map((item) => /* @__PURE__ */ jsx3(Descriptions.Item, {
|
|
245
|
+
label: item.title || upperFirst2(item.id),
|
|
246
|
+
children: /* @__PURE__ */ jsx3(DescriptionItemContent, {
|
|
247
|
+
item,
|
|
248
|
+
value: data[item.id],
|
|
249
|
+
values: data,
|
|
250
|
+
extendTypes: props.extendTypes
|
|
251
|
+
})
|
|
252
|
+
}, item.id)),
|
|
253
|
+
props.footer && props.footer(data)
|
|
254
|
+
]
|
|
249
255
|
}),
|
|
250
256
|
...props.faasData
|
|
251
257
|
});
|
|
@@ -319,7 +325,7 @@ TimePicker.displayName = "TimePicker";
|
|
|
319
325
|
|
|
320
326
|
// src/FormItem.tsx
|
|
321
327
|
import dayjs2, { isDayjs } from "dayjs";
|
|
322
|
-
import { Fragment as Fragment2, jsx as jsx6, jsxs } from "react/jsx-runtime";
|
|
328
|
+
import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
323
329
|
function processProps(propsCopy, config) {
|
|
324
330
|
if (!propsCopy.title)
|
|
325
331
|
propsCopy.title = upperFirst3(propsCopy.id);
|
|
@@ -440,7 +446,7 @@ function FormItem(props) {
|
|
|
440
446
|
rules: computedProps.rules,
|
|
441
447
|
children: (fields, { add, remove }, { errors }) => {
|
|
442
448
|
var _a2;
|
|
443
|
-
return /* @__PURE__ */
|
|
449
|
+
return /* @__PURE__ */ jsxs2(Fragment2, {
|
|
444
450
|
children: [
|
|
445
451
|
computedProps.label && /* @__PURE__ */ jsx6("div", {
|
|
446
452
|
className: "ant-form-item-label",
|
|
@@ -452,7 +458,7 @@ function FormItem(props) {
|
|
|
452
458
|
fields.map((field) => {
|
|
453
459
|
var _a3;
|
|
454
460
|
return /* @__PURE__ */ jsx6(AntdForm.Item, {
|
|
455
|
-
children: /* @__PURE__ */
|
|
461
|
+
children: /* @__PURE__ */ jsxs2(Row, {
|
|
456
462
|
gutter: 24,
|
|
457
463
|
style: { flexFlow: "row nowrap" },
|
|
458
464
|
children: [
|
|
@@ -480,7 +486,7 @@ function FormItem(props) {
|
|
|
480
486
|
})
|
|
481
487
|
}, field.key);
|
|
482
488
|
}),
|
|
483
|
-
/* @__PURE__ */
|
|
489
|
+
/* @__PURE__ */ jsxs2(AntdForm.Item, {
|
|
484
490
|
children: [
|
|
485
491
|
!((_a2 = computedProps.input) == null ? void 0 : _a2.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ jsx6(Button, {
|
|
486
492
|
type: "dashed",
|
|
@@ -521,7 +527,7 @@ function FormItem(props) {
|
|
|
521
527
|
rules: computedProps.rules,
|
|
522
528
|
children: (fields, { add, remove }, { errors }) => {
|
|
523
529
|
var _a2, _b;
|
|
524
|
-
return /* @__PURE__ */
|
|
530
|
+
return /* @__PURE__ */ jsxs2(Fragment2, {
|
|
525
531
|
children: [
|
|
526
532
|
computedProps.label && /* @__PURE__ */ jsx6("div", {
|
|
527
533
|
className: "ant-form-item-label",
|
|
@@ -533,7 +539,7 @@ function FormItem(props) {
|
|
|
533
539
|
fields.map((field) => {
|
|
534
540
|
var _a3;
|
|
535
541
|
return /* @__PURE__ */ jsx6(AntdForm.Item, {
|
|
536
|
-
children: /* @__PURE__ */
|
|
542
|
+
children: /* @__PURE__ */ jsxs2(Row, {
|
|
537
543
|
gutter: 24,
|
|
538
544
|
style: { flexFlow: "row nowrap" },
|
|
539
545
|
children: [
|
|
@@ -562,7 +568,7 @@ function FormItem(props) {
|
|
|
562
568
|
})
|
|
563
569
|
}, field.key);
|
|
564
570
|
}),
|
|
565
|
-
/* @__PURE__ */
|
|
571
|
+
/* @__PURE__ */ jsxs2(AntdForm.Item, {
|
|
566
572
|
children: [
|
|
567
573
|
!((_b = computedProps.input) == null ? void 0 : _b.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ jsx6(Button, {
|
|
568
574
|
type: "dashed",
|
|
@@ -601,7 +607,7 @@ function FormItem(props) {
|
|
|
601
607
|
})
|
|
602
608
|
});
|
|
603
609
|
case "object":
|
|
604
|
-
return /* @__PURE__ */
|
|
610
|
+
return /* @__PURE__ */ jsxs2(Fragment2, {
|
|
605
611
|
children: [
|
|
606
612
|
computedProps.label && /* @__PURE__ */ jsx6("div", {
|
|
607
613
|
className: "ant-form-item-label",
|
|
@@ -619,14 +625,14 @@ function FormItem(props) {
|
|
|
619
625
|
return /* @__PURE__ */ jsx6(AntdForm.List, {
|
|
620
626
|
name: computedProps.name,
|
|
621
627
|
rules: computedProps.rules,
|
|
622
|
-
children: (fields, { add, remove }, { errors }) => /* @__PURE__ */
|
|
628
|
+
children: (fields, { add, remove }, { errors }) => /* @__PURE__ */ jsxs2(Fragment2, {
|
|
623
629
|
children: [
|
|
624
|
-
fields.map((field) => /* @__PURE__ */
|
|
630
|
+
fields.map((field) => /* @__PURE__ */ jsxs2(AntdForm.Item, {
|
|
625
631
|
style: { marginBottom: 0 },
|
|
626
632
|
children: [
|
|
627
633
|
/* @__PURE__ */ jsx6("div", {
|
|
628
634
|
className: "ant-form-item-label",
|
|
629
|
-
children: /* @__PURE__ */
|
|
635
|
+
children: /* @__PURE__ */ jsxs2("label", {
|
|
630
636
|
children: [
|
|
631
637
|
computedProps.label,
|
|
632
638
|
" ",
|
|
@@ -652,9 +658,9 @@ function FormItem(props) {
|
|
|
652
658
|
})
|
|
653
659
|
]
|
|
654
660
|
}, field.key)),
|
|
655
|
-
/* @__PURE__ */
|
|
661
|
+
/* @__PURE__ */ jsxs2(AntdForm.Item, {
|
|
656
662
|
children: [
|
|
657
|
-
!computedProps.disabled && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */
|
|
663
|
+
!computedProps.disabled && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ jsxs2(Button, {
|
|
658
664
|
type: "dashed",
|
|
659
665
|
block: true,
|
|
660
666
|
onClick: () => add(),
|
|
@@ -679,7 +685,7 @@ function FormItem(props) {
|
|
|
679
685
|
}
|
|
680
686
|
|
|
681
687
|
// src/Form.tsx
|
|
682
|
-
import { jsx as jsx7, jsxs as
|
|
688
|
+
import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
683
689
|
function Form(props) {
|
|
684
690
|
var _a, _b;
|
|
685
691
|
const [loading, setLoading] = useState5(false);
|
|
@@ -723,7 +729,7 @@ function Form(props) {
|
|
|
723
729
|
}, []);
|
|
724
730
|
if (!computedProps)
|
|
725
731
|
return null;
|
|
726
|
-
return /* @__PURE__ */
|
|
732
|
+
return /* @__PURE__ */ jsxs3(AntdForm2, {
|
|
727
733
|
...computedProps,
|
|
728
734
|
children: [
|
|
729
735
|
computedProps.beforeItems,
|
|
@@ -843,7 +849,7 @@ import {
|
|
|
843
849
|
Routes as OriginRoutes,
|
|
844
850
|
Route
|
|
845
851
|
} from "react-router-dom";
|
|
846
|
-
import { jsx as jsx10, jsxs as
|
|
852
|
+
import { jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
847
853
|
function PageNotFound() {
|
|
848
854
|
const config = useConfigContext();
|
|
849
855
|
return /* @__PURE__ */ jsx10(Result, {
|
|
@@ -852,7 +858,7 @@ function PageNotFound() {
|
|
|
852
858
|
});
|
|
853
859
|
}
|
|
854
860
|
function Routes(props) {
|
|
855
|
-
return /* @__PURE__ */
|
|
861
|
+
return /* @__PURE__ */ jsxs4(OriginRoutes, {
|
|
856
862
|
children: [
|
|
857
863
|
props.routes.map((r) => /* @__PURE__ */ jsx10(Route, {
|
|
858
864
|
...r,
|
|
@@ -884,7 +890,7 @@ import {
|
|
|
884
890
|
Table as AntdTable,
|
|
885
891
|
Radio,
|
|
886
892
|
Skeleton as Skeleton3,
|
|
887
|
-
|
|
893
|
+
Input as Input2
|
|
888
894
|
} from "antd";
|
|
889
895
|
import dayjs3 from "dayjs";
|
|
890
896
|
import { CheckOutlined as CheckOutlined2, CloseOutlined as CloseOutlined2 } from "@ant-design/icons";
|
|
@@ -894,11 +900,11 @@ import {
|
|
|
894
900
|
upperFirst as upperFirst4
|
|
895
901
|
} from "lodash";
|
|
896
902
|
import { FaasDataWrapper as FaasDataWrapper2 } from "@faasjs/react";
|
|
897
|
-
import { jsx as jsx11, jsxs as
|
|
903
|
+
import { jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
898
904
|
function processValue(item, value) {
|
|
899
905
|
var _a;
|
|
900
906
|
if (typeof value === "undefined" && value === null)
|
|
901
|
-
return /* @__PURE__ */ jsx11(
|
|
907
|
+
return /* @__PURE__ */ jsx11(Blank, {});
|
|
902
908
|
if (item.options) {
|
|
903
909
|
if (item.type.endsWith("[]"))
|
|
904
910
|
return value.map((v) => {
|
|
@@ -970,34 +976,19 @@ function Table(props) {
|
|
|
970
976
|
selectedKeys,
|
|
971
977
|
confirm,
|
|
972
978
|
clearFilters
|
|
973
|
-
}) => /* @__PURE__ */
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
type: "button",
|
|
987
|
-
onClick: () => confirm(),
|
|
988
|
-
style: {
|
|
989
|
-
width: 90,
|
|
990
|
-
marginRight: 8
|
|
991
|
-
},
|
|
992
|
-
children: common2.search
|
|
993
|
-
}),
|
|
994
|
-
/* @__PURE__ */ jsx11("button", {
|
|
995
|
-
type: "button",
|
|
996
|
-
onClick: () => clearFilters(),
|
|
997
|
-
style: { width: 90 },
|
|
998
|
-
children: common2.reset
|
|
999
|
-
})
|
|
1000
|
-
]
|
|
979
|
+
}) => /* @__PURE__ */ jsx11(Input2.Search, {
|
|
980
|
+
placeholder: `${common2.search} ${item.title}`,
|
|
981
|
+
value: selectedKeys[0],
|
|
982
|
+
allowClear: true,
|
|
983
|
+
onSearch: (v) => {
|
|
984
|
+
if (v) {
|
|
985
|
+
setSelectedKeys([v]);
|
|
986
|
+
} else {
|
|
987
|
+
setSelectedKeys([]);
|
|
988
|
+
clearFilters();
|
|
989
|
+
}
|
|
990
|
+
confirm();
|
|
991
|
+
}
|
|
1001
992
|
});
|
|
1002
993
|
break;
|
|
1003
994
|
case "string[]":
|
|
@@ -1011,34 +1002,19 @@ function Table(props) {
|
|
|
1011
1002
|
selectedKeys,
|
|
1012
1003
|
confirm,
|
|
1013
1004
|
clearFilters
|
|
1014
|
-
}) => /* @__PURE__ */
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
type: "button",
|
|
1028
|
-
onClick: () => confirm(),
|
|
1029
|
-
style: {
|
|
1030
|
-
width: 90,
|
|
1031
|
-
marginRight: 8
|
|
1032
|
-
},
|
|
1033
|
-
children: common2.search
|
|
1034
|
-
}),
|
|
1035
|
-
/* @__PURE__ */ jsx11("button", {
|
|
1036
|
-
type: "button",
|
|
1037
|
-
onClick: () => clearFilters(),
|
|
1038
|
-
style: { width: 90 },
|
|
1039
|
-
children: common2.reset
|
|
1040
|
-
})
|
|
1041
|
-
]
|
|
1005
|
+
}) => /* @__PURE__ */ jsx11(Input2.Search, {
|
|
1006
|
+
placeholder: `${common2.search} ${item.title}`,
|
|
1007
|
+
value: selectedKeys[0],
|
|
1008
|
+
allowClear: true,
|
|
1009
|
+
onSearch: (v) => {
|
|
1010
|
+
if (v) {
|
|
1011
|
+
setSelectedKeys([v]);
|
|
1012
|
+
} else {
|
|
1013
|
+
setSelectedKeys([]);
|
|
1014
|
+
clearFilters();
|
|
1015
|
+
}
|
|
1016
|
+
confirm();
|
|
1017
|
+
}
|
|
1042
1018
|
});
|
|
1043
1019
|
break;
|
|
1044
1020
|
case "number":
|
|
@@ -1054,34 +1030,19 @@ function Table(props) {
|
|
|
1054
1030
|
selectedKeys,
|
|
1055
1031
|
confirm,
|
|
1056
1032
|
clearFilters
|
|
1057
|
-
}) => /* @__PURE__ */
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
type: "button",
|
|
1071
|
-
onClick: () => confirm(),
|
|
1072
|
-
style: {
|
|
1073
|
-
width: 90,
|
|
1074
|
-
marginRight: 8
|
|
1075
|
-
},
|
|
1076
|
-
children: common2.search
|
|
1077
|
-
}),
|
|
1078
|
-
/* @__PURE__ */ jsx11("button", {
|
|
1079
|
-
type: "button",
|
|
1080
|
-
onClick: () => clearFilters(),
|
|
1081
|
-
style: { width: 90 },
|
|
1082
|
-
children: common2.reset
|
|
1083
|
-
})
|
|
1084
|
-
]
|
|
1033
|
+
}) => /* @__PURE__ */ jsx11(Input2.Search, {
|
|
1034
|
+
placeholder: `${common2.search} ${item.title}`,
|
|
1035
|
+
value: selectedKeys[0],
|
|
1036
|
+
allowClear: true,
|
|
1037
|
+
onSearch: (v) => {
|
|
1038
|
+
if (v) {
|
|
1039
|
+
setSelectedKeys([v]);
|
|
1040
|
+
} else {
|
|
1041
|
+
setSelectedKeys([]);
|
|
1042
|
+
clearFilters();
|
|
1043
|
+
}
|
|
1044
|
+
confirm();
|
|
1045
|
+
}
|
|
1085
1046
|
});
|
|
1086
1047
|
break;
|
|
1087
1048
|
case "number[]":
|
|
@@ -1095,34 +1056,19 @@ function Table(props) {
|
|
|
1095
1056
|
selectedKeys,
|
|
1096
1057
|
confirm,
|
|
1097
1058
|
clearFilters
|
|
1098
|
-
}) => /* @__PURE__ */
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
type: "button",
|
|
1112
|
-
onClick: () => confirm(),
|
|
1113
|
-
style: {
|
|
1114
|
-
width: 90,
|
|
1115
|
-
marginRight: 8
|
|
1116
|
-
},
|
|
1117
|
-
children: common2.search
|
|
1118
|
-
}),
|
|
1119
|
-
/* @__PURE__ */ jsx11("button", {
|
|
1120
|
-
type: "button",
|
|
1121
|
-
onClick: () => clearFilters(),
|
|
1122
|
-
style: { width: 90 },
|
|
1123
|
-
children: common2.reset
|
|
1124
|
-
})
|
|
1125
|
-
]
|
|
1059
|
+
}) => /* @__PURE__ */ jsx11(Input2.Search, {
|
|
1060
|
+
placeholder: `${common2.search} ${item.title}`,
|
|
1061
|
+
value: selectedKeys[0],
|
|
1062
|
+
allowClear: true,
|
|
1063
|
+
onSearch: (v) => {
|
|
1064
|
+
if (v) {
|
|
1065
|
+
setSelectedKeys([v]);
|
|
1066
|
+
} else {
|
|
1067
|
+
setSelectedKeys([]);
|
|
1068
|
+
clearFilters();
|
|
1069
|
+
}
|
|
1070
|
+
confirm();
|
|
1071
|
+
}
|
|
1126
1072
|
});
|
|
1127
1073
|
break;
|
|
1128
1074
|
case "boolean":
|
|
@@ -1143,7 +1089,7 @@ function Table(props) {
|
|
|
1143
1089
|
setSelectedKeys,
|
|
1144
1090
|
selectedKeys,
|
|
1145
1091
|
confirm
|
|
1146
|
-
}) => /* @__PURE__ */
|
|
1092
|
+
}) => /* @__PURE__ */ jsxs5(Radio.Group, {
|
|
1147
1093
|
style: { padding: 8 },
|
|
1148
1094
|
buttonStyle: "solid",
|
|
1149
1095
|
value: selectedKeys[0],
|
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.417",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"lodash": "*",
|
|
29
29
|
"react": "*",
|
|
30
30
|
"react-dom": "*",
|
|
31
|
-
"@faasjs/react": "^0.0.2-beta.
|
|
31
|
+
"@faasjs/react": "^0.0.2-beta.417",
|
|
32
32
|
"react-router-dom": "*",
|
|
33
33
|
"dayjs": "*"
|
|
34
34
|
},
|