@faasjs/ant-design 0.0.3-beta.71 → 0.0.3-beta.72
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.js +714 -669
- package/dist/index.mjs +686 -640
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
|
|
21
1
|
// src/App.tsx
|
|
22
2
|
import {
|
|
23
3
|
ConfigProvider,
|
|
@@ -37,17 +17,24 @@ import { Modal } from "antd";
|
|
|
37
17
|
import { useState } from "react";
|
|
38
18
|
import { jsx } from "react/jsx-runtime";
|
|
39
19
|
function useModal(init) {
|
|
40
|
-
const [props, setProps] = useState(
|
|
20
|
+
const [props, setProps] = useState({
|
|
41
21
|
open: false,
|
|
42
|
-
onCancel: () => setProps((prev) =>
|
|
22
|
+
onCancel: () => setProps((prev) => ({
|
|
23
|
+
...prev,
|
|
43
24
|
open: false
|
|
44
|
-
}))
|
|
45
|
-
|
|
25
|
+
})),
|
|
26
|
+
...init
|
|
27
|
+
});
|
|
46
28
|
return {
|
|
47
|
-
modal: /* @__PURE__ */ jsx(Modal,
|
|
29
|
+
modal: /* @__PURE__ */ jsx(Modal, {
|
|
30
|
+
...props
|
|
31
|
+
}),
|
|
48
32
|
modalProps: props,
|
|
49
33
|
setModalProps(changes) {
|
|
50
|
-
setProps((prev) =>
|
|
34
|
+
setProps((prev) => ({
|
|
35
|
+
...prev,
|
|
36
|
+
...changes
|
|
37
|
+
}));
|
|
51
38
|
}
|
|
52
39
|
};
|
|
53
40
|
}
|
|
@@ -57,17 +44,24 @@ import { Drawer } from "antd";
|
|
|
57
44
|
import { useState as useState2 } from "react";
|
|
58
45
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
59
46
|
function useDrawer(init) {
|
|
60
|
-
const [props, setProps] = useState2(
|
|
47
|
+
const [props, setProps] = useState2({
|
|
61
48
|
open: false,
|
|
62
|
-
onClose: () => setProps((prev) =>
|
|
49
|
+
onClose: () => setProps((prev) => ({
|
|
50
|
+
...prev,
|
|
63
51
|
open: false
|
|
64
|
-
}))
|
|
65
|
-
|
|
52
|
+
})),
|
|
53
|
+
...init
|
|
54
|
+
});
|
|
66
55
|
return {
|
|
67
|
-
drawer: /* @__PURE__ */ jsx2(Drawer,
|
|
56
|
+
drawer: /* @__PURE__ */ jsx2(Drawer, {
|
|
57
|
+
...props
|
|
58
|
+
}),
|
|
68
59
|
drawerProps: props,
|
|
69
60
|
setDrawerProps(changes) {
|
|
70
|
-
setProps((prev) =>
|
|
61
|
+
setProps((prev) => ({
|
|
62
|
+
...prev,
|
|
63
|
+
...changes
|
|
64
|
+
}));
|
|
71
65
|
}
|
|
72
66
|
};
|
|
73
67
|
}
|
|
@@ -89,7 +83,9 @@ function RoutesApp(props) {
|
|
|
89
83
|
setDrawerProps({ open: false });
|
|
90
84
|
setModalProps({ open: false });
|
|
91
85
|
}, [location]);
|
|
92
|
-
return /* @__PURE__ */ jsx3(Fragment, {
|
|
86
|
+
return /* @__PURE__ */ jsx3(Fragment, {
|
|
87
|
+
children: props.children
|
|
88
|
+
});
|
|
93
89
|
}
|
|
94
90
|
function App(props) {
|
|
95
91
|
const [messageApi, messageContextHolder] = message.useMessage();
|
|
@@ -110,21 +106,30 @@ function App(props) {
|
|
|
110
106
|
setDrawerProps
|
|
111
107
|
]
|
|
112
108
|
);
|
|
113
|
-
return /* @__PURE__ */ jsx3(
|
|
114
|
-
|
|
115
|
-
__spreadProps(__spreadValues({}, Object.assign(props.styleProviderProps || {}, {
|
|
109
|
+
return /* @__PURE__ */ jsx3(StyleProvider, {
|
|
110
|
+
...Object.assign(props.styleProviderProps || {}, {
|
|
116
111
|
hashPriority: "high",
|
|
117
112
|
transformers: [legacyLogicalPropertiesTransformer]
|
|
118
|
-
})
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
113
|
+
}),
|
|
114
|
+
children: /* @__PURE__ */ jsx3(ConfigProvider, {
|
|
115
|
+
...props.configProviderProps,
|
|
116
|
+
children: /* @__PURE__ */ jsx3(AppContext.Provider, {
|
|
117
|
+
value: memoizedContextValue,
|
|
118
|
+
children: /* @__PURE__ */ jsxs(BrowserRouter, {
|
|
119
|
+
...props.browserRouterProps,
|
|
120
|
+
children: [
|
|
121
|
+
messageContextHolder,
|
|
122
|
+
notificationContextHolder,
|
|
123
|
+
modal,
|
|
124
|
+
drawer,
|
|
125
|
+
/* @__PURE__ */ jsx3(RoutesApp, {
|
|
126
|
+
children: props.children
|
|
127
|
+
})
|
|
128
|
+
]
|
|
129
|
+
})
|
|
130
|
+
})
|
|
126
131
|
})
|
|
127
|
-
);
|
|
132
|
+
});
|
|
128
133
|
}
|
|
129
134
|
function useApp() {
|
|
130
135
|
return useContext(AppContext);
|
|
@@ -199,7 +204,10 @@ function ConfigProvider2({
|
|
|
199
204
|
} else
|
|
200
205
|
setValues(defaultsDeep(config, values));
|
|
201
206
|
}, []);
|
|
202
|
-
return /* @__PURE__ */ jsx4(ConfigContext.Provider, {
|
|
207
|
+
return /* @__PURE__ */ jsx4(ConfigContext.Provider, {
|
|
208
|
+
value: values,
|
|
209
|
+
children
|
|
210
|
+
});
|
|
203
211
|
}
|
|
204
212
|
function useConfigContext() {
|
|
205
213
|
return useContext2(ConfigContext);
|
|
@@ -209,7 +217,10 @@ function useConfigContext() {
|
|
|
209
217
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
210
218
|
function Blank(options) {
|
|
211
219
|
const { Blank: Blank2 } = useConfigContext();
|
|
212
|
-
return !options || isNil(options.value) || Array.isArray(options.value) && !options.value.length || options.value === "" ? /* @__PURE__ */ jsx5(Typography.Text, {
|
|
220
|
+
return !options || isNil(options.value) || Array.isArray(options.value) && !options.value.length || options.value === "" ? /* @__PURE__ */ jsx5(Typography.Text, {
|
|
221
|
+
disabled: true,
|
|
222
|
+
children: (options == null ? void 0 : options.text) || Blank2.text
|
|
223
|
+
}) : options.value;
|
|
213
224
|
}
|
|
214
225
|
|
|
215
226
|
// src/data.ts
|
|
@@ -260,22 +271,32 @@ import { Spin } from "antd";
|
|
|
260
271
|
import { Fragment as Fragment2, jsx as jsx6 } from "react/jsx-runtime";
|
|
261
272
|
function Loading(props) {
|
|
262
273
|
if (props.loading === false)
|
|
263
|
-
return /* @__PURE__ */ jsx6(Fragment2, {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
274
|
+
return /* @__PURE__ */ jsx6(Fragment2, {
|
|
275
|
+
children: props.children
|
|
276
|
+
});
|
|
277
|
+
return /* @__PURE__ */ jsx6("div", {
|
|
278
|
+
style: {
|
|
279
|
+
...props.style || {},
|
|
280
|
+
...!props.size || props.size === "large" ? {
|
|
281
|
+
margin: "20vh auto",
|
|
282
|
+
textAlign: "center"
|
|
283
|
+
} : {}
|
|
284
|
+
},
|
|
285
|
+
children: /* @__PURE__ */ jsx6(Spin, {
|
|
286
|
+
size: props.size || "large"
|
|
287
|
+
})
|
|
288
|
+
});
|
|
268
289
|
}
|
|
269
290
|
|
|
270
291
|
// src/FaasDataWrapper.tsx
|
|
271
292
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
272
293
|
function FaasDataWrapper(props) {
|
|
273
|
-
return /* @__PURE__ */ jsx7(
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
);
|
|
294
|
+
return /* @__PURE__ */ jsx7(Origin, {
|
|
295
|
+
fallback: props.loading || /* @__PURE__ */ jsx7(Loading, {
|
|
296
|
+
...props.loadingProps
|
|
297
|
+
}),
|
|
298
|
+
...props
|
|
299
|
+
});
|
|
279
300
|
}
|
|
280
301
|
|
|
281
302
|
// src/Description.tsx
|
|
@@ -285,7 +306,7 @@ function DescriptionItemContent(props) {
|
|
|
285
306
|
const [computedProps, setComputedProps] = useState4();
|
|
286
307
|
useEffect3(() => {
|
|
287
308
|
var _a2, _b;
|
|
288
|
-
const propsCopy =
|
|
309
|
+
const propsCopy = { ...props };
|
|
289
310
|
if (!propsCopy.item.title)
|
|
290
311
|
propsCopy.item.title = upperFirst2(propsCopy.item.id);
|
|
291
312
|
if (!propsCopy.item.type)
|
|
@@ -322,7 +343,9 @@ function DescriptionItemContent(props) {
|
|
|
322
343
|
}
|
|
323
344
|
);
|
|
324
345
|
else if (computedProps.extendTypes[computedProps.item.type].render)
|
|
325
|
-
return /* @__PURE__ */ jsx8(Fragment3, {
|
|
346
|
+
return /* @__PURE__ */ jsx8(Fragment3, {
|
|
347
|
+
children: computedProps.extendTypes[computedProps.item.type].render(computedProps.value, computedProps.values, 0, "description")
|
|
348
|
+
});
|
|
326
349
|
else
|
|
327
350
|
throw Error(computedProps.item.type + " requires children or render");
|
|
328
351
|
if (computedProps.item.descriptionChildren === null)
|
|
@@ -342,114 +365,106 @@ function DescriptionItemContent(props) {
|
|
|
342
365
|
values: computedProps.values
|
|
343
366
|
});
|
|
344
367
|
if (computedProps.item.descriptionRender)
|
|
345
|
-
return /* @__PURE__ */ jsx8(Fragment3, {
|
|
368
|
+
return /* @__PURE__ */ jsx8(Fragment3, {
|
|
369
|
+
children: computedProps.item.descriptionRender(computedProps.value, computedProps.values, 0, "description")
|
|
370
|
+
});
|
|
346
371
|
if (computedProps.item.render)
|
|
347
|
-
return /* @__PURE__ */ jsx8(Fragment3, {
|
|
372
|
+
return /* @__PURE__ */ jsx8(Fragment3, {
|
|
373
|
+
children: computedProps.item.render(computedProps.value, computedProps.values, 0, "description")
|
|
374
|
+
});
|
|
348
375
|
if (computedProps.value === null || Array.isArray(computedProps.value) && !computedProps.value.length)
|
|
349
376
|
return /* @__PURE__ */ jsx8(Blank, {});
|
|
350
377
|
switch (computedProps.item.type) {
|
|
351
378
|
case "string[]":
|
|
352
|
-
return /* @__PURE__ */ jsx8(Fragment3, {
|
|
379
|
+
return /* @__PURE__ */ jsx8(Fragment3, {
|
|
380
|
+
children: computedProps.value.join(", ")
|
|
381
|
+
});
|
|
353
382
|
case "number":
|
|
354
383
|
return computedProps.value || null;
|
|
355
384
|
case "number[]":
|
|
356
|
-
return /* @__PURE__ */ jsx8(Fragment3, {
|
|
385
|
+
return /* @__PURE__ */ jsx8(Fragment3, {
|
|
386
|
+
children: computedProps.value.join(", ")
|
|
387
|
+
});
|
|
357
388
|
case "boolean":
|
|
358
|
-
return computedProps.value ? /* @__PURE__ */ jsx8(CheckOutlined, {
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
389
|
+
return computedProps.value ? /* @__PURE__ */ jsx8(CheckOutlined, {
|
|
390
|
+
style: {
|
|
391
|
+
marginTop: "4px",
|
|
392
|
+
color: "#52c41a"
|
|
393
|
+
}
|
|
394
|
+
}) : /* @__PURE__ */ jsx8(CloseOutlined, {
|
|
395
|
+
style: {
|
|
396
|
+
marginTop: "4px",
|
|
397
|
+
color: "#ff4d4f"
|
|
398
|
+
}
|
|
399
|
+
});
|
|
365
400
|
case "time":
|
|
366
|
-
return /* @__PURE__ */ jsx8(Fragment3, {
|
|
401
|
+
return /* @__PURE__ */ jsx8(Fragment3, {
|
|
402
|
+
children: computedProps.value.format("YYYY-MM-DD HH:mm:ss")
|
|
403
|
+
});
|
|
367
404
|
case "date":
|
|
368
|
-
return /* @__PURE__ */ jsx8(Fragment3, {
|
|
405
|
+
return /* @__PURE__ */ jsx8(Fragment3, {
|
|
406
|
+
children: computedProps.value.format("YYYY-MM-DD")
|
|
407
|
+
});
|
|
369
408
|
case "object":
|
|
370
409
|
if (!computedProps.value)
|
|
371
410
|
return /* @__PURE__ */ jsx8(Blank, {});
|
|
372
|
-
return /* @__PURE__ */ jsx8(
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
column: 1
|
|
378
|
-
}
|
|
379
|
-
);
|
|
411
|
+
return /* @__PURE__ */ jsx8(Description, {
|
|
412
|
+
items: computedProps.item.object,
|
|
413
|
+
dataSource: computedProps.value,
|
|
414
|
+
column: 1
|
|
415
|
+
});
|
|
380
416
|
case "object[]":
|
|
381
417
|
if (!((_a = computedProps.value) == null ? void 0 : _a.length))
|
|
382
418
|
return /* @__PURE__ */ jsx8(Blank, {});
|
|
383
|
-
return /* @__PURE__ */ jsx8(Space, {
|
|
384
|
-
|
|
385
|
-
{
|
|
419
|
+
return /* @__PURE__ */ jsx8(Space, {
|
|
420
|
+
direction: "vertical",
|
|
421
|
+
children: computedProps.value.map((value, index) => /* @__PURE__ */ jsx8(Description, {
|
|
386
422
|
items: computedProps.item.object,
|
|
387
423
|
dataSource: value,
|
|
388
424
|
column: 1
|
|
389
|
-
},
|
|
390
|
-
|
|
391
|
-
)) });
|
|
425
|
+
}, index))
|
|
426
|
+
});
|
|
392
427
|
default:
|
|
393
428
|
return computedProps.value || null;
|
|
394
429
|
}
|
|
395
430
|
}
|
|
396
431
|
function Description(props) {
|
|
397
432
|
if (props.dataSource)
|
|
398
|
-
return /* @__PURE__ */ jsx8(
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
433
|
+
return /* @__PURE__ */ jsx8(Descriptions, {
|
|
434
|
+
...props,
|
|
435
|
+
title: isFunction(props.renderTitle) ? props.renderTitle(props.dataSource) : props.title,
|
|
436
|
+
children: props.items.map((item) => {
|
|
437
|
+
return !item.if || item.if(props.dataSource) ? /* @__PURE__ */ jsx8(Descriptions.Item, {
|
|
438
|
+
label: item.title || upperFirst2(item.id),
|
|
439
|
+
children: /* @__PURE__ */ jsx8(DescriptionItemContent, {
|
|
440
|
+
item,
|
|
441
|
+
value: props.dataSource[item.id],
|
|
442
|
+
values: props.dataSource,
|
|
443
|
+
extendTypes: props.extendTypes
|
|
444
|
+
})
|
|
445
|
+
}, item.id) : null;
|
|
446
|
+
}).filter(Boolean)
|
|
447
|
+
});
|
|
448
|
+
return /* @__PURE__ */ jsx8(FaasDataWrapper, {
|
|
449
|
+
render: ({ data }) => {
|
|
450
|
+
return /* @__PURE__ */ jsx8(Descriptions, {
|
|
451
|
+
...props,
|
|
452
|
+
title: isFunction(props.renderTitle) ? props.renderTitle(data) : props.title,
|
|
402
453
|
children: props.items.map((item) => {
|
|
403
|
-
return !item.if || item.if(
|
|
404
|
-
|
|
405
|
-
{
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
values: props.dataSource,
|
|
413
|
-
extendTypes: props.extendTypes
|
|
414
|
-
}
|
|
415
|
-
)
|
|
416
|
-
},
|
|
417
|
-
item.id
|
|
418
|
-
) : null;
|
|
454
|
+
return !item.if || item.if(data) ? /* @__PURE__ */ jsx8(Descriptions.Item, {
|
|
455
|
+
label: item.title || upperFirst2(item.id),
|
|
456
|
+
children: /* @__PURE__ */ jsx8(DescriptionItemContent, {
|
|
457
|
+
item,
|
|
458
|
+
value: data[item.id],
|
|
459
|
+
values: data,
|
|
460
|
+
extendTypes: props.extendTypes
|
|
461
|
+
})
|
|
462
|
+
}, item.id) : null;
|
|
419
463
|
}).filter(Boolean)
|
|
420
|
-
})
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
__spreadValues({
|
|
425
|
-
render: ({ data }) => {
|
|
426
|
-
return /* @__PURE__ */ jsx8(
|
|
427
|
-
Descriptions,
|
|
428
|
-
__spreadProps(__spreadValues({}, props), {
|
|
429
|
-
title: isFunction(props.renderTitle) ? props.renderTitle(data) : props.title,
|
|
430
|
-
children: props.items.map((item) => {
|
|
431
|
-
return !item.if || item.if(data) ? /* @__PURE__ */ jsx8(
|
|
432
|
-
Descriptions.Item,
|
|
433
|
-
{
|
|
434
|
-
label: item.title || upperFirst2(item.id),
|
|
435
|
-
children: /* @__PURE__ */ jsx8(
|
|
436
|
-
DescriptionItemContent,
|
|
437
|
-
{
|
|
438
|
-
item,
|
|
439
|
-
value: data[item.id],
|
|
440
|
-
values: data,
|
|
441
|
-
extendTypes: props.extendTypes
|
|
442
|
-
}
|
|
443
|
-
)
|
|
444
|
-
},
|
|
445
|
-
item.id
|
|
446
|
-
) : null;
|
|
447
|
-
}).filter(Boolean)
|
|
448
|
-
})
|
|
449
|
-
);
|
|
450
|
-
}
|
|
451
|
-
}, props.faasData)
|
|
452
|
-
);
|
|
464
|
+
});
|
|
465
|
+
},
|
|
466
|
+
...props.faasData
|
|
467
|
+
});
|
|
453
468
|
}
|
|
454
469
|
|
|
455
470
|
// src/ErrorBoundary.tsx
|
|
@@ -483,17 +498,17 @@ var ErrorBoundary = class extends Component {
|
|
|
483
498
|
if (error) {
|
|
484
499
|
if (this.props.onError)
|
|
485
500
|
return this.props.onError(error, info);
|
|
486
|
-
return /* @__PURE__ */ jsx9(
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
description: /* @__PURE__ */ jsx9("pre", { style: {
|
|
501
|
+
return /* @__PURE__ */ jsx9(Alert, {
|
|
502
|
+
type: "error",
|
|
503
|
+
message: errorMessage,
|
|
504
|
+
description: /* @__PURE__ */ jsx9("pre", {
|
|
505
|
+
style: {
|
|
492
506
|
fontSize: "0.9em",
|
|
493
507
|
overflowX: "auto"
|
|
494
|
-
},
|
|
495
|
-
|
|
496
|
-
|
|
508
|
+
},
|
|
509
|
+
children: errorDescription
|
|
510
|
+
})
|
|
511
|
+
});
|
|
497
512
|
}
|
|
498
513
|
return children;
|
|
499
514
|
}
|
|
@@ -586,7 +601,7 @@ function FormItem(props) {
|
|
|
586
601
|
const { common: common2 } = useConfigContext();
|
|
587
602
|
const [hidden, setHidden] = useState5(props.hidden || false);
|
|
588
603
|
useEffect4(() => {
|
|
589
|
-
const propsCopy =
|
|
604
|
+
const propsCopy = { ...props };
|
|
590
605
|
if (propsCopy.extendTypes) {
|
|
591
606
|
setExtendTypes(propsCopy.extendTypes);
|
|
592
607
|
delete propsCopy.extendTypes;
|
|
@@ -609,231 +624,290 @@ function FormItem(props) {
|
|
|
609
624
|
if (!computedProps)
|
|
610
625
|
return null;
|
|
611
626
|
if (hidden)
|
|
612
|
-
return /* @__PURE__ */ jsx10(
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
627
|
+
return /* @__PURE__ */ jsx10(AntdForm.Item, {
|
|
628
|
+
...computedProps,
|
|
629
|
+
noStyle: true,
|
|
630
|
+
rules: [],
|
|
631
|
+
children: /* @__PURE__ */ jsx10(Input, {
|
|
632
|
+
hidden: true
|
|
618
633
|
})
|
|
619
|
-
);
|
|
634
|
+
});
|
|
620
635
|
if (extendTypes && extendTypes[computedProps.type])
|
|
621
|
-
return /* @__PURE__ */ jsx10(AntdForm.Item,
|
|
636
|
+
return /* @__PURE__ */ jsx10(AntdForm.Item, {
|
|
637
|
+
...computedProps,
|
|
638
|
+
children: extendTypes[computedProps.type].children
|
|
639
|
+
});
|
|
622
640
|
if (computedProps.formChildren === null)
|
|
623
641
|
return null;
|
|
624
642
|
if (computedProps.formChildren)
|
|
625
|
-
return /* @__PURE__ */ jsx10(AntdForm.Item,
|
|
643
|
+
return /* @__PURE__ */ jsx10(AntdForm.Item, {
|
|
644
|
+
...computedProps,
|
|
645
|
+
children: cloneElement2(computedProps.formChildren, { scene: "form" })
|
|
646
|
+
});
|
|
626
647
|
if (computedProps.children === null)
|
|
627
648
|
return null;
|
|
628
649
|
if (computedProps.children)
|
|
629
|
-
return /* @__PURE__ */ jsx10(AntdForm.Item,
|
|
650
|
+
return /* @__PURE__ */ jsx10(AntdForm.Item, {
|
|
651
|
+
...computedProps,
|
|
652
|
+
children: cloneElement2(computedProps.children, { scene: "form" })
|
|
653
|
+
});
|
|
630
654
|
if (computedProps.formRender)
|
|
631
|
-
return /* @__PURE__ */ jsx10(AntdForm.Item,
|
|
655
|
+
return /* @__PURE__ */ jsx10(AntdForm.Item, {
|
|
656
|
+
...computedProps,
|
|
657
|
+
children: computedProps.formRender(null, null, 0, "form")
|
|
658
|
+
});
|
|
632
659
|
if (computedProps.render)
|
|
633
|
-
return /* @__PURE__ */ jsx10(AntdForm.Item,
|
|
660
|
+
return /* @__PURE__ */ jsx10(AntdForm.Item, {
|
|
661
|
+
...computedProps,
|
|
662
|
+
children: computedProps.render(null, null, 0, "form")
|
|
663
|
+
});
|
|
634
664
|
switch (computedProps.type) {
|
|
635
665
|
case "string":
|
|
636
|
-
return /* @__PURE__ */ jsx10(AntdForm.Item,
|
|
666
|
+
return /* @__PURE__ */ jsx10(AntdForm.Item, {
|
|
667
|
+
...computedProps,
|
|
668
|
+
children: computedProps.options ? /* @__PURE__ */ jsx10(Select, {
|
|
669
|
+
...computedProps.input
|
|
670
|
+
}) : /* @__PURE__ */ jsx10(Input, {
|
|
671
|
+
...computedProps.input
|
|
672
|
+
})
|
|
673
|
+
});
|
|
637
674
|
case "string[]":
|
|
638
675
|
if (computedProps.options)
|
|
639
|
-
return /* @__PURE__ */ jsx10(AntdForm.Item,
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
mode: "multiple"
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
computedProps.label && /* @__PURE__ */ jsx10("div", {
|
|
676
|
+
return /* @__PURE__ */ jsx10(AntdForm.Item, {
|
|
677
|
+
...computedProps,
|
|
678
|
+
children: /* @__PURE__ */ jsx10(Select, {
|
|
679
|
+
mode: "multiple",
|
|
680
|
+
...computedProps.input
|
|
681
|
+
})
|
|
682
|
+
});
|
|
683
|
+
return /* @__PURE__ */ jsx10(AntdForm.List, {
|
|
684
|
+
name: computedProps.name,
|
|
685
|
+
rules: computedProps.rules,
|
|
686
|
+
children: (fields, { add, remove }, { errors }) => {
|
|
687
|
+
var _a2;
|
|
688
|
+
return /* @__PURE__ */ jsxs2(Fragment4, {
|
|
689
|
+
children: [
|
|
690
|
+
computedProps.label && /* @__PURE__ */ jsx10("div", {
|
|
691
|
+
className: "ant-form-item-label",
|
|
692
|
+
children: /* @__PURE__ */ jsx10("label", {
|
|
693
|
+
className: computedProps.rules.find((r) => r.required) && "ant-form-item-required",
|
|
694
|
+
children: computedProps.label
|
|
695
|
+
})
|
|
696
|
+
}),
|
|
654
697
|
fields.map((field) => {
|
|
655
698
|
var _a3;
|
|
656
|
-
return /* @__PURE__ */ jsx10(AntdForm.Item, {
|
|
657
|
-
Row,
|
|
658
|
-
{
|
|
699
|
+
return /* @__PURE__ */ jsx10(AntdForm.Item, {
|
|
700
|
+
children: /* @__PURE__ */ jsxs2(Row, {
|
|
659
701
|
gutter: 24,
|
|
660
702
|
style: { flexFlow: "row nowrap" },
|
|
661
703
|
children: [
|
|
662
|
-
/* @__PURE__ */ jsx10(Col, {
|
|
663
|
-
|
|
664
|
-
|
|
704
|
+
/* @__PURE__ */ jsx10(Col, {
|
|
705
|
+
span: 23,
|
|
706
|
+
children: /* @__PURE__ */ jsx10(AntdForm.Item, {
|
|
707
|
+
...field,
|
|
665
708
|
noStyle: true,
|
|
666
|
-
children: /* @__PURE__ */ jsx10(Input,
|
|
709
|
+
children: /* @__PURE__ */ jsx10(Input, {
|
|
710
|
+
...computedProps.input
|
|
711
|
+
})
|
|
667
712
|
})
|
|
668
|
-
|
|
669
|
-
/* @__PURE__ */ jsx10(Col, {
|
|
670
|
-
|
|
671
|
-
{
|
|
713
|
+
}),
|
|
714
|
+
/* @__PURE__ */ jsx10(Col, {
|
|
715
|
+
span: 1,
|
|
716
|
+
children: !((_a3 = computedProps.input) == null ? void 0 : _a3.disabled) && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ jsx10(Button, {
|
|
672
717
|
danger: true,
|
|
673
718
|
type: "link",
|
|
674
719
|
style: { float: "right" },
|
|
675
720
|
icon: /* @__PURE__ */ jsx10(MinusCircleOutlined, {}),
|
|
676
721
|
onClick: () => remove(field.name)
|
|
677
|
-
}
|
|
678
|
-
|
|
722
|
+
})
|
|
723
|
+
})
|
|
679
724
|
]
|
|
680
|
-
}
|
|
681
|
-
|
|
725
|
+
})
|
|
726
|
+
}, field.key);
|
|
682
727
|
}),
|
|
683
|
-
/* @__PURE__ */ jsxs2(AntdForm.Item, {
|
|
684
|
-
|
|
685
|
-
Button,
|
|
686
|
-
{
|
|
728
|
+
/* @__PURE__ */ jsxs2(AntdForm.Item, {
|
|
729
|
+
children: [
|
|
730
|
+
!((_a2 = computedProps.input) == null ? void 0 : _a2.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ jsx10(Button, {
|
|
687
731
|
type: "dashed",
|
|
688
732
|
block: true,
|
|
689
733
|
onClick: () => add(),
|
|
690
734
|
icon: /* @__PURE__ */ jsx10(PlusOutlined, {})
|
|
691
|
-
}
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
735
|
+
}),
|
|
736
|
+
computedProps.extra && /* @__PURE__ */ jsx10("div", {
|
|
737
|
+
className: "ant-form-item-extra",
|
|
738
|
+
children: computedProps.extra
|
|
739
|
+
}),
|
|
740
|
+
/* @__PURE__ */ jsx10(AntdForm.ErrorList, {
|
|
741
|
+
errors
|
|
742
|
+
})
|
|
743
|
+
]
|
|
744
|
+
})
|
|
745
|
+
]
|
|
746
|
+
});
|
|
698
747
|
}
|
|
699
|
-
);
|
|
748
|
+
});
|
|
700
749
|
case "number":
|
|
701
|
-
return /* @__PURE__ */ jsx10(AntdForm.Item,
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
},
|
|
706
|
-
|
|
750
|
+
return /* @__PURE__ */ jsx10(AntdForm.Item, {
|
|
751
|
+
...computedProps,
|
|
752
|
+
children: computedProps.options ? /* @__PURE__ */ jsx10(Select, {
|
|
753
|
+
...computedProps.input
|
|
754
|
+
}) : /* @__PURE__ */ jsx10(InputNumber, {
|
|
755
|
+
style: { width: "100%" },
|
|
756
|
+
...computedProps.input
|
|
757
|
+
})
|
|
758
|
+
});
|
|
707
759
|
case "number[]":
|
|
708
760
|
if (computedProps.options)
|
|
709
|
-
return /* @__PURE__ */ jsx10(AntdForm.Item,
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
mode: "multiple"
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
computedProps.label && /* @__PURE__ */ jsx10("div", {
|
|
761
|
+
return /* @__PURE__ */ jsx10(AntdForm.Item, {
|
|
762
|
+
...computedProps,
|
|
763
|
+
children: /* @__PURE__ */ jsx10(Select, {
|
|
764
|
+
mode: "multiple",
|
|
765
|
+
...computedProps.input
|
|
766
|
+
})
|
|
767
|
+
});
|
|
768
|
+
return /* @__PURE__ */ jsx10(AntdForm.List, {
|
|
769
|
+
name: computedProps.name,
|
|
770
|
+
rules: computedProps.rules,
|
|
771
|
+
children: (fields, { add, remove }, { errors }) => {
|
|
772
|
+
var _a2, _b;
|
|
773
|
+
return /* @__PURE__ */ jsxs2(Fragment4, {
|
|
774
|
+
children: [
|
|
775
|
+
computedProps.label && /* @__PURE__ */ jsx10("div", {
|
|
776
|
+
className: "ant-form-item-label",
|
|
777
|
+
children: /* @__PURE__ */ jsx10("label", {
|
|
778
|
+
className: ((_a2 = computedProps.rules) == null ? void 0 : _a2.find((r) => r.required)) && "ant-form-item-required",
|
|
779
|
+
children: computedProps.label
|
|
780
|
+
})
|
|
781
|
+
}),
|
|
724
782
|
fields.map((field) => {
|
|
725
783
|
var _a3;
|
|
726
|
-
return /* @__PURE__ */ jsx10(AntdForm.Item, {
|
|
727
|
-
Row,
|
|
728
|
-
{
|
|
784
|
+
return /* @__PURE__ */ jsx10(AntdForm.Item, {
|
|
785
|
+
children: /* @__PURE__ */ jsxs2(Row, {
|
|
729
786
|
gutter: 24,
|
|
730
787
|
style: { flexFlow: "row nowrap" },
|
|
731
788
|
children: [
|
|
732
|
-
/* @__PURE__ */ jsx10(Col, {
|
|
733
|
-
|
|
734
|
-
|
|
789
|
+
/* @__PURE__ */ jsx10(Col, {
|
|
790
|
+
span: 23,
|
|
791
|
+
children: /* @__PURE__ */ jsx10(AntdForm.Item, {
|
|
792
|
+
...field,
|
|
735
793
|
noStyle: true,
|
|
736
|
-
children: /* @__PURE__ */ jsx10(
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
}, computedProps.input)
|
|
741
|
-
)
|
|
794
|
+
children: /* @__PURE__ */ jsx10(InputNumber, {
|
|
795
|
+
style: { width: "100%" },
|
|
796
|
+
...computedProps.input
|
|
797
|
+
})
|
|
742
798
|
})
|
|
743
|
-
|
|
744
|
-
/* @__PURE__ */ jsx10(Col, {
|
|
745
|
-
|
|
746
|
-
{
|
|
799
|
+
}),
|
|
800
|
+
/* @__PURE__ */ jsx10(Col, {
|
|
801
|
+
span: 1,
|
|
802
|
+
children: !((_a3 = computedProps.input) == null ? void 0 : _a3.disabled) && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ jsx10(Button, {
|
|
747
803
|
danger: true,
|
|
748
804
|
type: "link",
|
|
749
805
|
style: { float: "right" },
|
|
750
806
|
icon: /* @__PURE__ */ jsx10(MinusCircleOutlined, {}),
|
|
751
807
|
onClick: () => remove(field.name)
|
|
752
|
-
}
|
|
753
|
-
|
|
808
|
+
})
|
|
809
|
+
})
|
|
754
810
|
]
|
|
755
|
-
}
|
|
756
|
-
|
|
811
|
+
})
|
|
812
|
+
}, field.key);
|
|
757
813
|
}),
|
|
758
|
-
/* @__PURE__ */ jsxs2(AntdForm.Item, {
|
|
759
|
-
|
|
760
|
-
Button,
|
|
761
|
-
{
|
|
814
|
+
/* @__PURE__ */ jsxs2(AntdForm.Item, {
|
|
815
|
+
children: [
|
|
816
|
+
!((_b = computedProps.input) == null ? void 0 : _b.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ jsx10(Button, {
|
|
762
817
|
type: "dashed",
|
|
763
818
|
block: true,
|
|
764
819
|
onClick: () => add(),
|
|
765
820
|
icon: /* @__PURE__ */ jsx10(PlusOutlined, {})
|
|
766
|
-
}
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
821
|
+
}),
|
|
822
|
+
computedProps.extra && /* @__PURE__ */ jsx10("div", {
|
|
823
|
+
className: "ant-form-item-extra",
|
|
824
|
+
children: computedProps.extra
|
|
825
|
+
}),
|
|
826
|
+
/* @__PURE__ */ jsx10(AntdForm.ErrorList, {
|
|
827
|
+
errors
|
|
828
|
+
})
|
|
829
|
+
]
|
|
830
|
+
})
|
|
831
|
+
]
|
|
832
|
+
});
|
|
773
833
|
}
|
|
774
|
-
);
|
|
834
|
+
});
|
|
775
835
|
case "boolean":
|
|
776
|
-
return /* @__PURE__ */ jsx10(AntdForm.Item,
|
|
836
|
+
return /* @__PURE__ */ jsx10(AntdForm.Item, {
|
|
837
|
+
...computedProps,
|
|
838
|
+
children: /* @__PURE__ */ jsx10(Switch, {
|
|
839
|
+
...computedProps.input
|
|
840
|
+
})
|
|
841
|
+
});
|
|
777
842
|
case "date":
|
|
778
|
-
return /* @__PURE__ */ jsx10(AntdForm.Item,
|
|
843
|
+
return /* @__PURE__ */ jsx10(AntdForm.Item, {
|
|
844
|
+
...computedProps,
|
|
845
|
+
children: /* @__PURE__ */ jsx10(DatePicker, {
|
|
846
|
+
...computedProps.input
|
|
847
|
+
})
|
|
848
|
+
});
|
|
779
849
|
case "time":
|
|
780
|
-
return /* @__PURE__ */ jsx10(AntdForm.Item,
|
|
850
|
+
return /* @__PURE__ */ jsx10(AntdForm.Item, {
|
|
851
|
+
...computedProps,
|
|
852
|
+
children: /* @__PURE__ */ jsx10(TimePicker, {
|
|
853
|
+
...computedProps.input
|
|
854
|
+
})
|
|
855
|
+
});
|
|
781
856
|
case "object":
|
|
782
|
-
return /* @__PURE__ */ jsxs2(Fragment4, {
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
857
|
+
return /* @__PURE__ */ jsxs2(Fragment4, {
|
|
858
|
+
children: [
|
|
859
|
+
computedProps.label && /* @__PURE__ */ jsx10("div", {
|
|
860
|
+
className: "ant-form-item-label",
|
|
861
|
+
children: /* @__PURE__ */ jsx10("label", {
|
|
862
|
+
className: ((_a = computedProps.rules) == null ? void 0 : _a.find((r) => r.required)) && "ant-form-item-required",
|
|
863
|
+
children: computedProps.label
|
|
864
|
+
})
|
|
865
|
+
}),
|
|
866
|
+
computedProps.object.map((o) => /* @__PURE__ */ jsx10(FormItem, {
|
|
867
|
+
...o
|
|
868
|
+
}, o.id))
|
|
869
|
+
]
|
|
870
|
+
});
|
|
790
871
|
case "object[]":
|
|
791
|
-
return /* @__PURE__ */ jsx10(
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
Button,
|
|
808
|
-
{
|
|
872
|
+
return /* @__PURE__ */ jsx10(AntdForm.List, {
|
|
873
|
+
name: computedProps.name,
|
|
874
|
+
rules: computedProps.rules,
|
|
875
|
+
children: (fields, { add, remove }, { errors }) => /* @__PURE__ */ jsxs2(Fragment4, {
|
|
876
|
+
children: [
|
|
877
|
+
fields.map((field) => /* @__PURE__ */ jsxs2(AntdForm.Item, {
|
|
878
|
+
style: { marginBottom: 0 },
|
|
879
|
+
children: [
|
|
880
|
+
/* @__PURE__ */ jsx10("div", {
|
|
881
|
+
className: "ant-form-item-label",
|
|
882
|
+
children: /* @__PURE__ */ jsxs2("label", {
|
|
883
|
+
children: [
|
|
884
|
+
computedProps.label,
|
|
885
|
+
" ",
|
|
886
|
+
field.name + 1,
|
|
887
|
+
!computedProps.disabled && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ jsx10(Button, {
|
|
809
888
|
danger: true,
|
|
810
889
|
type: "link",
|
|
811
890
|
onClick: () => remove(field.name),
|
|
812
891
|
children: common2.delete
|
|
813
|
-
}
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
)),
|
|
833
|
-
/* @__PURE__ */ jsxs2(AntdForm.Item, { children: [
|
|
834
|
-
!computedProps.disabled && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ jsxs2(
|
|
835
|
-
Button,
|
|
836
|
-
{
|
|
892
|
+
})
|
|
893
|
+
]
|
|
894
|
+
})
|
|
895
|
+
}),
|
|
896
|
+
/* @__PURE__ */ jsx10(Row, {
|
|
897
|
+
gutter: 24,
|
|
898
|
+
children: computedProps.object.map((o) => /* @__PURE__ */ jsx10(Col, {
|
|
899
|
+
span: o.col || 24,
|
|
900
|
+
children: /* @__PURE__ */ jsx10(FormItem, {
|
|
901
|
+
...o,
|
|
902
|
+
name: [field.name, o.id]
|
|
903
|
+
})
|
|
904
|
+
}, o.id))
|
|
905
|
+
})
|
|
906
|
+
]
|
|
907
|
+
}, field.key)),
|
|
908
|
+
/* @__PURE__ */ jsxs2(AntdForm.Item, {
|
|
909
|
+
children: [
|
|
910
|
+
!computedProps.disabled && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ jsxs2(Button, {
|
|
837
911
|
type: "dashed",
|
|
838
912
|
block: true,
|
|
839
913
|
onClick: () => add(),
|
|
@@ -843,14 +917,19 @@ function FormItem(props) {
|
|
|
843
917
|
" ",
|
|
844
918
|
computedProps.label
|
|
845
919
|
]
|
|
846
|
-
}
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
920
|
+
}),
|
|
921
|
+
computedProps.extra && /* @__PURE__ */ jsx10("div", {
|
|
922
|
+
className: "ant-form-item-extra",
|
|
923
|
+
children: computedProps.extra
|
|
924
|
+
}),
|
|
925
|
+
/* @__PURE__ */ jsx10(AntdForm.ErrorList, {
|
|
926
|
+
errors
|
|
927
|
+
})
|
|
928
|
+
]
|
|
929
|
+
})
|
|
930
|
+
]
|
|
931
|
+
})
|
|
932
|
+
});
|
|
854
933
|
default:
|
|
855
934
|
return null;
|
|
856
935
|
}
|
|
@@ -869,9 +948,10 @@ function Form(props) {
|
|
|
869
948
|
const [initialValues, setInitialValues] = useState6(props.initialValues);
|
|
870
949
|
useEffect5(() => {
|
|
871
950
|
var _a2, _b2, _c;
|
|
872
|
-
const propsCopy =
|
|
951
|
+
const propsCopy = {
|
|
952
|
+
...props,
|
|
873
953
|
form
|
|
874
|
-
}
|
|
954
|
+
};
|
|
875
955
|
if (propsCopy.initialValues && ((_a2 = propsCopy.items) == null ? void 0 : _a2.length)) {
|
|
876
956
|
for (const key in propsCopy.initialValues) {
|
|
877
957
|
propsCopy.initialValues[key] = transferValue(
|
|
@@ -895,7 +975,10 @@ function Form(props) {
|
|
|
895
975
|
setLoading(true);
|
|
896
976
|
try {
|
|
897
977
|
if (propsCopy.submit && ((_a3 = propsCopy.submit.to) == null ? void 0 : _a3.action)) {
|
|
898
|
-
await props.onFinish(values, async (values2) => faas(propsCopy.submit.to.action, propsCopy.submit.to.params ?
|
|
978
|
+
await props.onFinish(values, async (values2) => faas(propsCopy.submit.to.action, propsCopy.submit.to.params ? {
|
|
979
|
+
...values2,
|
|
980
|
+
...propsCopy.submit.to.params
|
|
981
|
+
} : values2));
|
|
899
982
|
} else
|
|
900
983
|
await props.onFinish(values);
|
|
901
984
|
} catch (error) {
|
|
@@ -906,7 +989,10 @@ function Form(props) {
|
|
|
906
989
|
} else if (propsCopy.submit && ((_c = propsCopy.submit.to) == null ? void 0 : _c.action)) {
|
|
907
990
|
propsCopy.onFinish = async (values) => {
|
|
908
991
|
setLoading(true);
|
|
909
|
-
return faas(propsCopy.submit.to.action, propsCopy.submit.to.params ?
|
|
992
|
+
return faas(propsCopy.submit.to.action, propsCopy.submit.to.params ? {
|
|
993
|
+
...values,
|
|
994
|
+
...propsCopy.submit.to.params
|
|
995
|
+
} : values).then((result) => {
|
|
910
996
|
if (propsCopy.submit.to.then)
|
|
911
997
|
propsCopy.submit.to.then(result);
|
|
912
998
|
return result;
|
|
@@ -949,33 +1035,25 @@ function Form(props) {
|
|
|
949
1035
|
}, [computedProps]);
|
|
950
1036
|
if (!computedProps)
|
|
951
1037
|
return null;
|
|
952
|
-
return /* @__PURE__ */ jsxs3(
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
computedProps.submit
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
loading,
|
|
972
|
-
children: ((_b = computedProps.submit) == null ? void 0 : _b.text) || config.Form.submit.text
|
|
973
|
-
}
|
|
974
|
-
),
|
|
975
|
-
computedProps.footer
|
|
976
|
-
]
|
|
977
|
-
})
|
|
978
|
-
);
|
|
1038
|
+
return /* @__PURE__ */ jsxs3(AntdForm2, {
|
|
1039
|
+
...computedProps,
|
|
1040
|
+
onValuesChange,
|
|
1041
|
+
children: [
|
|
1042
|
+
computedProps.beforeItems,
|
|
1043
|
+
(_a = computedProps.items) == null ? void 0 : _a.map((item) => isValidElement(item) ? item : /* @__PURE__ */ jsx11(FormItem, {
|
|
1044
|
+
...item,
|
|
1045
|
+
extendTypes
|
|
1046
|
+
}, item.id)),
|
|
1047
|
+
computedProps.children,
|
|
1048
|
+
computedProps.submit !== false && /* @__PURE__ */ jsx11(Button2, {
|
|
1049
|
+
htmlType: "submit",
|
|
1050
|
+
type: "primary",
|
|
1051
|
+
loading,
|
|
1052
|
+
children: ((_b = computedProps.submit) == null ? void 0 : _b.text) || config.Form.submit.text
|
|
1053
|
+
}),
|
|
1054
|
+
computedProps.footer
|
|
1055
|
+
]
|
|
1056
|
+
});
|
|
979
1057
|
}
|
|
980
1058
|
Form.useForm = AntdForm2.useForm;
|
|
981
1059
|
Form.useFormInstance = AntdForm2.useFormInstance;
|
|
@@ -992,9 +1070,11 @@ import { jsx as jsx12 } from "react/jsx-runtime";
|
|
|
992
1070
|
function Link(props) {
|
|
993
1071
|
var _a, _b, _c, _d;
|
|
994
1072
|
const { Link: Link2 } = useConfigContext();
|
|
995
|
-
let style =
|
|
996
|
-
|
|
997
|
-
|
|
1073
|
+
let style = {
|
|
1074
|
+
...Link2.style || {},
|
|
1075
|
+
cursor: "pointer",
|
|
1076
|
+
...props.style
|
|
1077
|
+
};
|
|
998
1078
|
if (props.block)
|
|
999
1079
|
style = Object.assign({
|
|
1000
1080
|
display: "block",
|
|
@@ -1002,49 +1082,36 @@ function Link(props) {
|
|
|
1002
1082
|
}, style);
|
|
1003
1083
|
if (props.href.startsWith("http")) {
|
|
1004
1084
|
if (props.button)
|
|
1005
|
-
return /* @__PURE__ */ jsx12(
|
|
1006
|
-
|
|
1007
|
-
__spreadProps(__spreadValues({}, props.button), {
|
|
1008
|
-
target: props.target || (Link2 == null ? void 0 : Link2.target) || "_blank",
|
|
1009
|
-
style,
|
|
1010
|
-
href: props.href,
|
|
1011
|
-
children: (_a = props.text) != null ? _a : props.children
|
|
1012
|
-
})
|
|
1013
|
-
);
|
|
1014
|
-
return /* @__PURE__ */ jsx12(
|
|
1015
|
-
"a",
|
|
1016
|
-
{
|
|
1017
|
-
href: props.href,
|
|
1085
|
+
return /* @__PURE__ */ jsx12(Button3, {
|
|
1086
|
+
...props.button,
|
|
1018
1087
|
target: props.target || (Link2 == null ? void 0 : Link2.target) || "_blank",
|
|
1019
1088
|
style,
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1089
|
+
href: props.href,
|
|
1090
|
+
children: (_a = props.text) != null ? _a : props.children
|
|
1091
|
+
});
|
|
1092
|
+
return /* @__PURE__ */ jsx12("a", {
|
|
1093
|
+
href: props.href,
|
|
1094
|
+
target: props.target || (Link2 == null ? void 0 : Link2.target) || "_blank",
|
|
1095
|
+
style,
|
|
1096
|
+
children: (_b = props.text) != null ? _b : props.children
|
|
1097
|
+
});
|
|
1023
1098
|
}
|
|
1024
1099
|
if (props.button)
|
|
1025
|
-
return /* @__PURE__ */ jsx12(
|
|
1026
|
-
RouterLink,
|
|
1027
|
-
{
|
|
1028
|
-
to: props.href,
|
|
1029
|
-
target: props.target || (Link2 == null ? void 0 : Link2.target),
|
|
1030
|
-
children: /* @__PURE__ */ jsx12(
|
|
1031
|
-
Button3,
|
|
1032
|
-
__spreadProps(__spreadValues({}, props.button), {
|
|
1033
|
-
style,
|
|
1034
|
-
children: (_c = props.text) != null ? _c : props.children
|
|
1035
|
-
})
|
|
1036
|
-
)
|
|
1037
|
-
}
|
|
1038
|
-
);
|
|
1039
|
-
return /* @__PURE__ */ jsx12(
|
|
1040
|
-
RouterLink,
|
|
1041
|
-
{
|
|
1100
|
+
return /* @__PURE__ */ jsx12(RouterLink, {
|
|
1042
1101
|
to: props.href,
|
|
1043
1102
|
target: props.target || (Link2 == null ? void 0 : Link2.target),
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1103
|
+
children: /* @__PURE__ */ jsx12(Button3, {
|
|
1104
|
+
...props.button,
|
|
1105
|
+
style,
|
|
1106
|
+
children: (_c = props.text) != null ? _c : props.children
|
|
1107
|
+
})
|
|
1108
|
+
});
|
|
1109
|
+
return /* @__PURE__ */ jsx12(RouterLink, {
|
|
1110
|
+
to: props.href,
|
|
1111
|
+
target: props.target || (Link2 == null ? void 0 : Link2.target),
|
|
1112
|
+
style,
|
|
1113
|
+
children: (_d = props.text) != null ? _d : props.children
|
|
1114
|
+
});
|
|
1048
1115
|
}
|
|
1049
1116
|
|
|
1050
1117
|
// src/Routers.tsx
|
|
@@ -1060,32 +1127,32 @@ import { lazy } from "react";
|
|
|
1060
1127
|
import { jsx as jsx13, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1061
1128
|
function PageNotFound() {
|
|
1062
1129
|
const config = useConfigContext();
|
|
1063
|
-
return /* @__PURE__ */ jsx13(
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
title: config.common.pageNotFound
|
|
1068
|
-
}
|
|
1069
|
-
);
|
|
1130
|
+
return /* @__PURE__ */ jsx13(Result, {
|
|
1131
|
+
status: "404",
|
|
1132
|
+
title: config.common.pageNotFound
|
|
1133
|
+
});
|
|
1070
1134
|
}
|
|
1071
1135
|
function Routes(props) {
|
|
1072
|
-
return /* @__PURE__ */ jsxs4(OriginRoutes, {
|
|
1073
|
-
|
|
1074
|
-
Route,
|
|
1075
|
-
|
|
1076
|
-
element: r.element || /* @__PURE__ */ jsx13(Suspense, {
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1136
|
+
return /* @__PURE__ */ jsxs4(OriginRoutes, {
|
|
1137
|
+
children: [
|
|
1138
|
+
props.routes.map((r) => /* @__PURE__ */ jsx13(Route, {
|
|
1139
|
+
...r,
|
|
1140
|
+
element: r.element || /* @__PURE__ */ jsx13(Suspense, {
|
|
1141
|
+
fallback: props.fallback || /* @__PURE__ */ jsx13("div", {
|
|
1142
|
+
style: { padding: "24px" },
|
|
1143
|
+
children: /* @__PURE__ */ jsx13(Skeleton, {
|
|
1144
|
+
active: true
|
|
1145
|
+
})
|
|
1146
|
+
}),
|
|
1147
|
+
children: /* @__PURE__ */ jsx13(r.page, {})
|
|
1148
|
+
})
|
|
1149
|
+
}, r.path)),
|
|
1150
|
+
/* @__PURE__ */ jsx13(Route, {
|
|
1083
1151
|
path: "*",
|
|
1084
1152
|
element: props.notFound || /* @__PURE__ */ jsx13(PageNotFound, {})
|
|
1085
|
-
},
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
] });
|
|
1153
|
+
}, "*")
|
|
1154
|
+
]
|
|
1155
|
+
});
|
|
1089
1156
|
}
|
|
1090
1157
|
|
|
1091
1158
|
// src/Table.tsx
|
|
@@ -1151,38 +1218,32 @@ function Table(props) {
|
|
|
1151
1218
|
setSelectedKeys,
|
|
1152
1219
|
selectedKeys,
|
|
1153
1220
|
confirm
|
|
1154
|
-
}) => /* @__PURE__ */ jsx14(
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1221
|
+
}) => /* @__PURE__ */ jsx14("div", {
|
|
1222
|
+
style: {
|
|
1223
|
+
padding: 8,
|
|
1224
|
+
width: "200px"
|
|
1225
|
+
},
|
|
1226
|
+
onKeyDown: (e) => e.stopPropagation(),
|
|
1227
|
+
children: /* @__PURE__ */ jsx14(Select2, {
|
|
1228
|
+
options: item.options,
|
|
1229
|
+
allowClear: true,
|
|
1230
|
+
showSearch: true,
|
|
1231
|
+
style: { width: "100%" },
|
|
1232
|
+
placeholder: `${common2.search} ${item.title}`,
|
|
1233
|
+
value: selectedKeys,
|
|
1234
|
+
onChange: (v) => {
|
|
1235
|
+
setSelectedKeys((v == null ? void 0 : v.length) ? v : []);
|
|
1236
|
+
confirm();
|
|
1160
1237
|
},
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
value: selectedKeys,
|
|
1171
|
-
onChange: (v) => {
|
|
1172
|
-
setSelectedKeys((v == null ? void 0 : v.length) ? v : []);
|
|
1173
|
-
confirm();
|
|
1174
|
-
},
|
|
1175
|
-
mode: "multiple",
|
|
1176
|
-
filterOption: (input, option) => {
|
|
1177
|
-
if (!input || !option || !option.label)
|
|
1178
|
-
return true;
|
|
1179
|
-
input = input.trim();
|
|
1180
|
-
return option.value === input || option.label.toString().toLowerCase().includes(input.toLowerCase());
|
|
1181
|
-
}
|
|
1182
|
-
}
|
|
1183
|
-
)
|
|
1184
|
-
}
|
|
1185
|
-
);
|
|
1238
|
+
mode: "multiple",
|
|
1239
|
+
filterOption: (input, option) => {
|
|
1240
|
+
if (!input || !option || !option.label)
|
|
1241
|
+
return true;
|
|
1242
|
+
input = input.trim();
|
|
1243
|
+
return option.value === input || option.label.toString().toLowerCase().includes(input.toLowerCase());
|
|
1244
|
+
}
|
|
1245
|
+
})
|
|
1246
|
+
});
|
|
1186
1247
|
return item;
|
|
1187
1248
|
};
|
|
1188
1249
|
useEffect6(() => {
|
|
@@ -1264,22 +1325,19 @@ function Table(props) {
|
|
|
1264
1325
|
setSelectedKeys,
|
|
1265
1326
|
confirm,
|
|
1266
1327
|
clearFilters
|
|
1267
|
-
}) => /* @__PURE__ */ jsx14(
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
setSelectedKeys([]);
|
|
1277
|
-
clearFilters();
|
|
1278
|
-
}
|
|
1279
|
-
confirm();
|
|
1328
|
+
}) => /* @__PURE__ */ jsx14(Input2.Search, {
|
|
1329
|
+
placeholder: `${common2.search} ${item.title}`,
|
|
1330
|
+
allowClear: true,
|
|
1331
|
+
onSearch: (v) => {
|
|
1332
|
+
if (v) {
|
|
1333
|
+
setSelectedKeys([v]);
|
|
1334
|
+
} else {
|
|
1335
|
+
setSelectedKeys([]);
|
|
1336
|
+
clearFilters();
|
|
1280
1337
|
}
|
|
1338
|
+
confirm();
|
|
1281
1339
|
}
|
|
1282
|
-
);
|
|
1340
|
+
});
|
|
1283
1341
|
break;
|
|
1284
1342
|
case "string[]":
|
|
1285
1343
|
if (!item.render)
|
|
@@ -1299,22 +1357,19 @@ function Table(props) {
|
|
|
1299
1357
|
setSelectedKeys,
|
|
1300
1358
|
confirm,
|
|
1301
1359
|
clearFilters
|
|
1302
|
-
}) => /* @__PURE__ */ jsx14(
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
setSelectedKeys([]);
|
|
1312
|
-
clearFilters();
|
|
1313
|
-
}
|
|
1314
|
-
confirm();
|
|
1360
|
+
}) => /* @__PURE__ */ jsx14(Input2.Search, {
|
|
1361
|
+
placeholder: `${common2.search} ${item.title}`,
|
|
1362
|
+
allowClear: true,
|
|
1363
|
+
onSearch: (v) => {
|
|
1364
|
+
if (v) {
|
|
1365
|
+
setSelectedKeys([v]);
|
|
1366
|
+
} else {
|
|
1367
|
+
setSelectedKeys([]);
|
|
1368
|
+
clearFilters();
|
|
1315
1369
|
}
|
|
1370
|
+
confirm();
|
|
1316
1371
|
}
|
|
1317
|
-
);
|
|
1372
|
+
});
|
|
1318
1373
|
break;
|
|
1319
1374
|
case "number":
|
|
1320
1375
|
if (!item.render)
|
|
@@ -1336,22 +1391,19 @@ function Table(props) {
|
|
|
1336
1391
|
setSelectedKeys,
|
|
1337
1392
|
confirm,
|
|
1338
1393
|
clearFilters
|
|
1339
|
-
}) => /* @__PURE__ */ jsx14(
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
setSelectedKeys([]);
|
|
1349
|
-
clearFilters();
|
|
1350
|
-
}
|
|
1351
|
-
confirm();
|
|
1394
|
+
}) => /* @__PURE__ */ jsx14(Input2.Search, {
|
|
1395
|
+
placeholder: `${common2.search} ${item.title}`,
|
|
1396
|
+
allowClear: true,
|
|
1397
|
+
onSearch: (v) => {
|
|
1398
|
+
if (v) {
|
|
1399
|
+
setSelectedKeys([Number(v)]);
|
|
1400
|
+
} else {
|
|
1401
|
+
setSelectedKeys([]);
|
|
1402
|
+
clearFilters();
|
|
1352
1403
|
}
|
|
1404
|
+
confirm();
|
|
1353
1405
|
}
|
|
1354
|
-
);
|
|
1406
|
+
});
|
|
1355
1407
|
break;
|
|
1356
1408
|
case "number[]":
|
|
1357
1409
|
if (!item.render)
|
|
@@ -1371,66 +1423,79 @@ function Table(props) {
|
|
|
1371
1423
|
setSelectedKeys,
|
|
1372
1424
|
confirm,
|
|
1373
1425
|
clearFilters
|
|
1374
|
-
}) => /* @__PURE__ */ jsx14(
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
setSelectedKeys([]);
|
|
1384
|
-
clearFilters();
|
|
1385
|
-
}
|
|
1386
|
-
confirm();
|
|
1426
|
+
}) => /* @__PURE__ */ jsx14(Input2.Search, {
|
|
1427
|
+
placeholder: `${common2.search} ${item.title}`,
|
|
1428
|
+
allowClear: true,
|
|
1429
|
+
onSearch: (v) => {
|
|
1430
|
+
if (v) {
|
|
1431
|
+
setSelectedKeys([Number(v)]);
|
|
1432
|
+
} else {
|
|
1433
|
+
setSelectedKeys([]);
|
|
1434
|
+
clearFilters();
|
|
1387
1435
|
}
|
|
1436
|
+
confirm();
|
|
1388
1437
|
}
|
|
1389
|
-
);
|
|
1438
|
+
});
|
|
1390
1439
|
break;
|
|
1391
1440
|
case "boolean":
|
|
1392
1441
|
if (!item.render)
|
|
1393
|
-
item.render = (value) => isNil2(value) ? /* @__PURE__ */ jsx14(Blank, {}) : value ? /* @__PURE__ */ jsx14(CheckOutlined2, {
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1442
|
+
item.render = (value) => isNil2(value) ? /* @__PURE__ */ jsx14(Blank, {}) : value ? /* @__PURE__ */ jsx14(CheckOutlined2, {
|
|
1443
|
+
style: {
|
|
1444
|
+
marginTop: "4px",
|
|
1445
|
+
color: "#52c41a"
|
|
1446
|
+
}
|
|
1447
|
+
}) : /* @__PURE__ */ jsx14(CloseOutlined2, {
|
|
1448
|
+
style: {
|
|
1449
|
+
marginTop: "4px",
|
|
1450
|
+
color: "#ff4d4f"
|
|
1451
|
+
}
|
|
1452
|
+
});
|
|
1400
1453
|
if (item.filterDropdown !== false)
|
|
1401
1454
|
item.filterDropdown = ({
|
|
1402
1455
|
setSelectedKeys,
|
|
1403
1456
|
selectedKeys,
|
|
1404
1457
|
confirm
|
|
1405
|
-
}) => /* @__PURE__ */ jsxs5(
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
}
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1458
|
+
}) => /* @__PURE__ */ jsxs5(Radio.Group, {
|
|
1459
|
+
style: { padding: 8 },
|
|
1460
|
+
buttonStyle: "solid",
|
|
1461
|
+
value: JSON.stringify(selectedKeys[0]),
|
|
1462
|
+
onChange: (e) => {
|
|
1463
|
+
const Values = {
|
|
1464
|
+
true: true,
|
|
1465
|
+
false: false,
|
|
1466
|
+
null: null
|
|
1467
|
+
};
|
|
1468
|
+
setSelectedKeys(e.target.value ? [Values[e.target.value]] : []);
|
|
1469
|
+
confirm();
|
|
1470
|
+
},
|
|
1471
|
+
children: [
|
|
1472
|
+
/* @__PURE__ */ jsx14(Radio.Button, {
|
|
1473
|
+
children: common2.all
|
|
1474
|
+
}),
|
|
1475
|
+
/* @__PURE__ */ jsx14(Radio.Button, {
|
|
1476
|
+
value: "true",
|
|
1477
|
+
children: /* @__PURE__ */ jsx14(CheckOutlined2, {
|
|
1478
|
+
style: {
|
|
1479
|
+
color: "#52c41a",
|
|
1480
|
+
verticalAlign: "middle"
|
|
1481
|
+
}
|
|
1482
|
+
})
|
|
1483
|
+
}),
|
|
1484
|
+
/* @__PURE__ */ jsx14(Radio.Button, {
|
|
1485
|
+
value: "false",
|
|
1486
|
+
children: /* @__PURE__ */ jsx14(CloseOutlined2, {
|
|
1487
|
+
style: {
|
|
1488
|
+
verticalAlign: "middle",
|
|
1489
|
+
color: "#ff4d4f"
|
|
1490
|
+
}
|
|
1491
|
+
})
|
|
1492
|
+
}),
|
|
1493
|
+
/* @__PURE__ */ jsx14(Radio.Button, {
|
|
1494
|
+
value: "null",
|
|
1495
|
+
children: common2.blank
|
|
1496
|
+
})
|
|
1497
|
+
]
|
|
1498
|
+
});
|
|
1434
1499
|
if (!item.onFilter)
|
|
1435
1500
|
item.onFilter = (value, row) => {
|
|
1436
1501
|
switch (value) {
|
|
@@ -1458,15 +1523,12 @@ function Table(props) {
|
|
|
1458
1523
|
item.filterDropdown = ({
|
|
1459
1524
|
setSelectedKeys,
|
|
1460
1525
|
confirm
|
|
1461
|
-
}) => /* @__PURE__ */ jsx14(
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
setSelectedKeys(dates && dates[0] && dates[1] ? [[dates[0].startOf("day").toISOString(), dates[1].endOf("day").toISOString()]] : []);
|
|
1466
|
-
confirm();
|
|
1467
|
-
}
|
|
1526
|
+
}) => /* @__PURE__ */ jsx14(DatePicker2.RangePicker, {
|
|
1527
|
+
onChange: (dates) => {
|
|
1528
|
+
setSelectedKeys(dates && dates[0] && dates[1] ? [[dates[0].startOf("day").toISOString(), dates[1].endOf("day").toISOString()]] : []);
|
|
1529
|
+
confirm();
|
|
1468
1530
|
}
|
|
1469
|
-
);
|
|
1531
|
+
});
|
|
1470
1532
|
if (!item.onFilter)
|
|
1471
1533
|
item.onFilter = (value, row) => {
|
|
1472
1534
|
if (isNil2(value[0]))
|
|
@@ -1491,15 +1553,12 @@ function Table(props) {
|
|
|
1491
1553
|
item.filterDropdown = ({
|
|
1492
1554
|
setSelectedKeys,
|
|
1493
1555
|
confirm
|
|
1494
|
-
}) => /* @__PURE__ */ jsx14(
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
setSelectedKeys(dates && dates[0] && dates[1] ? [[dates[0].startOf("day").toISOString(), dates[1].endOf("day").toISOString()]] : []);
|
|
1499
|
-
confirm();
|
|
1500
|
-
}
|
|
1556
|
+
}) => /* @__PURE__ */ jsx14(DatePicker2.RangePicker, {
|
|
1557
|
+
onChange: (dates) => {
|
|
1558
|
+
setSelectedKeys(dates && dates[0] && dates[1] ? [[dates[0].startOf("day").toISOString(), dates[1].endOf("day").toISOString()]] : []);
|
|
1559
|
+
confirm();
|
|
1501
1560
|
}
|
|
1502
|
-
);
|
|
1561
|
+
});
|
|
1503
1562
|
if (!item.onFilter)
|
|
1504
1563
|
item.onFilter = (value, row) => {
|
|
1505
1564
|
if (isNil2(value[0]))
|
|
@@ -1511,26 +1570,21 @@ function Table(props) {
|
|
|
1511
1570
|
break;
|
|
1512
1571
|
case "object":
|
|
1513
1572
|
if (!item.render)
|
|
1514
|
-
item.render = (value) => /* @__PURE__ */ jsx14(
|
|
1515
|
-
|
|
1516
|
-
{
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
column: 1
|
|
1520
|
-
}
|
|
1521
|
-
);
|
|
1573
|
+
item.render = (value) => /* @__PURE__ */ jsx14(Description, {
|
|
1574
|
+
items: item.object,
|
|
1575
|
+
dataSource: value || {},
|
|
1576
|
+
column: 1
|
|
1577
|
+
});
|
|
1522
1578
|
break;
|
|
1523
1579
|
case "object[]":
|
|
1524
1580
|
if (!item.render)
|
|
1525
|
-
item.render = (value) => /* @__PURE__ */ jsx14(Fragment5, {
|
|
1526
|
-
Description,
|
|
1527
|
-
{
|
|
1581
|
+
item.render = (value) => /* @__PURE__ */ jsx14(Fragment5, {
|
|
1582
|
+
children: value.map((v, i) => /* @__PURE__ */ jsx14(Description, {
|
|
1528
1583
|
items: item.object,
|
|
1529
1584
|
dataSource: v || [],
|
|
1530
1585
|
column: 1
|
|
1531
|
-
},
|
|
1532
|
-
|
|
1533
|
-
)) });
|
|
1586
|
+
}, i))
|
|
1587
|
+
});
|
|
1534
1588
|
break;
|
|
1535
1589
|
default:
|
|
1536
1590
|
if (!item.render)
|
|
@@ -1569,26 +1623,19 @@ function Table(props) {
|
|
|
1569
1623
|
if (!columns)
|
|
1570
1624
|
return null;
|
|
1571
1625
|
if (props.dataSource)
|
|
1572
|
-
return /* @__PURE__ */ jsx14(
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
children: /* @__PURE__ */ jsx14(
|
|
1584
|
-
FaasDataTable,
|
|
1585
|
-
{
|
|
1586
|
-
props,
|
|
1587
|
-
columns
|
|
1588
|
-
}
|
|
1589
|
-
)
|
|
1626
|
+
return /* @__PURE__ */ jsx14(AntdTable, {
|
|
1627
|
+
...props,
|
|
1628
|
+
rowKey: props.rowKey || "id",
|
|
1629
|
+
columns,
|
|
1630
|
+
dataSource: props.dataSource
|
|
1631
|
+
});
|
|
1632
|
+
return /* @__PURE__ */ jsx14(FaasDataWrapper, {
|
|
1633
|
+
...props.faasData,
|
|
1634
|
+
children: /* @__PURE__ */ jsx14(FaasDataTable, {
|
|
1635
|
+
props,
|
|
1636
|
+
columns
|
|
1590
1637
|
})
|
|
1591
|
-
);
|
|
1638
|
+
});
|
|
1592
1639
|
}
|
|
1593
1640
|
function FaasDataTable({
|
|
1594
1641
|
props,
|
|
@@ -1634,51 +1681,50 @@ function FaasDataTable({
|
|
|
1634
1681
|
});
|
|
1635
1682
|
}, [columns, data]);
|
|
1636
1683
|
if (!data)
|
|
1637
|
-
return /* @__PURE__ */ jsx14(
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
})
|
|
1645
|
-
);
|
|
1684
|
+
return /* @__PURE__ */ jsx14(AntdTable, {
|
|
1685
|
+
...props,
|
|
1686
|
+
loading: props.loading,
|
|
1687
|
+
rowKey: props.rowKey || "id",
|
|
1688
|
+
columns: currentColumns,
|
|
1689
|
+
dataSource: []
|
|
1690
|
+
});
|
|
1646
1691
|
if (Array.isArray(data))
|
|
1647
|
-
return /* @__PURE__ */ jsx14(
|
|
1648
|
-
|
|
1649
|
-
__spreadProps(__spreadValues({}, props), {
|
|
1650
|
-
loading: props.loading,
|
|
1651
|
-
rowKey: props.rowKey || "id",
|
|
1652
|
-
columns: currentColumns,
|
|
1653
|
-
dataSource: data
|
|
1654
|
-
})
|
|
1655
|
-
);
|
|
1656
|
-
return /* @__PURE__ */ jsx14(
|
|
1657
|
-
AntdTable,
|
|
1658
|
-
__spreadProps(__spreadValues({}, props), {
|
|
1692
|
+
return /* @__PURE__ */ jsx14(AntdTable, {
|
|
1693
|
+
...props,
|
|
1659
1694
|
loading: props.loading,
|
|
1660
1695
|
rowKey: props.rowKey || "id",
|
|
1661
1696
|
columns: currentColumns,
|
|
1662
|
-
dataSource: data
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1697
|
+
dataSource: data
|
|
1698
|
+
});
|
|
1699
|
+
return /* @__PURE__ */ jsx14(AntdTable, {
|
|
1700
|
+
...props,
|
|
1701
|
+
loading: props.loading,
|
|
1702
|
+
rowKey: props.rowKey || "id",
|
|
1703
|
+
columns: currentColumns,
|
|
1704
|
+
dataSource: data.rows,
|
|
1705
|
+
pagination: {
|
|
1706
|
+
...props.pagination,
|
|
1707
|
+
...data.pagination
|
|
1708
|
+
},
|
|
1709
|
+
onChange: (pagination, filters, sorter, extra) => {
|
|
1710
|
+
if (props.onChange) {
|
|
1711
|
+
const processed = props.onChange(pagination, filters, sorter, extra);
|
|
1712
|
+
reload({
|
|
1713
|
+
...params,
|
|
1714
|
+
pagination: processed.pagination,
|
|
1715
|
+
filters: processed.filters,
|
|
1716
|
+
sorter: processed.sorter
|
|
1717
|
+
});
|
|
1718
|
+
return;
|
|
1679
1719
|
}
|
|
1680
|
-
|
|
1681
|
-
|
|
1720
|
+
reload({
|
|
1721
|
+
...params,
|
|
1722
|
+
pagination,
|
|
1723
|
+
filters,
|
|
1724
|
+
sorter
|
|
1725
|
+
});
|
|
1726
|
+
}
|
|
1727
|
+
});
|
|
1682
1728
|
}
|
|
1683
1729
|
|
|
1684
1730
|
// src/Tabs.tsx
|
|
@@ -1688,17 +1734,16 @@ import { jsx as jsx15 } from "react/jsx-runtime";
|
|
|
1688
1734
|
function Tabs(props) {
|
|
1689
1735
|
const [items, setItems] = useState8([]);
|
|
1690
1736
|
useEffect7(() => {
|
|
1691
|
-
setItems(props.items.filter(Boolean).map((item) =>
|
|
1737
|
+
setItems(props.items.filter(Boolean).map((item) => ({
|
|
1738
|
+
...item,
|
|
1692
1739
|
key: item.id,
|
|
1693
1740
|
label: item.title || item.id
|
|
1694
1741
|
})));
|
|
1695
1742
|
}, [props.items.filter(Boolean).map((i) => i.id).join("")]);
|
|
1696
|
-
return /* @__PURE__ */ jsx15(
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
})
|
|
1701
|
-
);
|
|
1743
|
+
return /* @__PURE__ */ jsx15(Origin2, {
|
|
1744
|
+
...props,
|
|
1745
|
+
items
|
|
1746
|
+
});
|
|
1702
1747
|
}
|
|
1703
1748
|
|
|
1704
1749
|
// src/Title.tsx
|
|
@@ -1712,18 +1757,19 @@ function Title(props) {
|
|
|
1712
1757
|
}, [props]);
|
|
1713
1758
|
if (props.h1) {
|
|
1714
1759
|
if (typeof props.h1 === "boolean")
|
|
1715
|
-
return /* @__PURE__ */ jsx16("h1", {
|
|
1716
|
-
return /* @__PURE__ */ jsx16(
|
|
1717
|
-
"h1",
|
|
1718
|
-
{
|
|
1719
|
-
className: props.h1.className,
|
|
1720
|
-
style: props.h1.style,
|
|
1760
|
+
return /* @__PURE__ */ jsx16("h1", {
|
|
1721
1761
|
children: Array.isArray(props.title) ? props.title[0] : props.title
|
|
1722
|
-
}
|
|
1723
|
-
|
|
1762
|
+
});
|
|
1763
|
+
return /* @__PURE__ */ jsx16("h1", {
|
|
1764
|
+
className: props.h1.className,
|
|
1765
|
+
style: props.h1.style,
|
|
1766
|
+
children: Array.isArray(props.title) ? props.title[0] : props.title
|
|
1767
|
+
});
|
|
1724
1768
|
}
|
|
1725
1769
|
if (props.plain)
|
|
1726
|
-
return /* @__PURE__ */ jsx16(Fragment6, {
|
|
1770
|
+
return /* @__PURE__ */ jsx16(Fragment6, {
|
|
1771
|
+
children: Array.isArray(props.title) ? props.title[0] : props.title
|
|
1772
|
+
});
|
|
1727
1773
|
if (props.children)
|
|
1728
1774
|
return cloneElement4(props.children, { title: props.title });
|
|
1729
1775
|
return null;
|