@faasjs/ant-design 0.0.3-beta.23 → 0.0.3-beta.25
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/README.md +111 -2
- package/dist/index.d.ts +23 -1
- package/dist/index.js +184 -137
- package/dist/index.mjs +215 -166
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -128,8 +128,46 @@ import {
|
|
|
128
128
|
useEffect as useEffect2,
|
|
129
129
|
useState as useState2
|
|
130
130
|
} from "react";
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
|
|
132
|
+
// src/FaasDataWrapper.tsx
|
|
133
|
+
import {
|
|
134
|
+
FaasDataWrapper as Origin,
|
|
135
|
+
FaasDataWrapperProps,
|
|
136
|
+
FaasDataInjection
|
|
137
|
+
} from "@faasjs/react";
|
|
138
|
+
|
|
139
|
+
// src/Loading.tsx
|
|
140
|
+
import { Spin } from "antd";
|
|
141
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
142
|
+
function Loading(props) {
|
|
143
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
144
|
+
style: {
|
|
145
|
+
...props.style || {},
|
|
146
|
+
...!props.size || props.size === "large" ? {
|
|
147
|
+
margin: "20vh auto",
|
|
148
|
+
textAlign: "center"
|
|
149
|
+
} : {}
|
|
150
|
+
},
|
|
151
|
+
children: /* @__PURE__ */ jsx3(Spin, {
|
|
152
|
+
size: props.size || "large"
|
|
153
|
+
})
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// src/FaasDataWrapper.tsx
|
|
158
|
+
import { Alert } from "antd";
|
|
159
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
160
|
+
function FaasDataWrapper(props) {
|
|
161
|
+
return /* @__PURE__ */ jsx4(Alert.ErrorBoundary, {
|
|
162
|
+
children: /* @__PURE__ */ jsx4(Origin, {
|
|
163
|
+
fallback: /* @__PURE__ */ jsx4(Loading, {}),
|
|
164
|
+
...props
|
|
165
|
+
})
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// src/Description.tsx
|
|
170
|
+
import { Fragment, jsx as jsx5 } from "react/jsx-runtime";
|
|
133
171
|
function DescriptionItemContent(props) {
|
|
134
172
|
var _a;
|
|
135
173
|
const [computedProps, setComputedProps] = useState2();
|
|
@@ -171,7 +209,7 @@ function DescriptionItemContent(props) {
|
|
|
171
209
|
}
|
|
172
210
|
);
|
|
173
211
|
else if (computedProps.extendTypes[computedProps.item.type].render)
|
|
174
|
-
return /* @__PURE__ */
|
|
212
|
+
return /* @__PURE__ */ jsx5(Fragment, {
|
|
175
213
|
children: computedProps.extendTypes[computedProps.item.type].render(computedProps.value, computedProps.values)
|
|
176
214
|
});
|
|
177
215
|
else
|
|
@@ -182,56 +220,56 @@ function DescriptionItemContent(props) {
|
|
|
182
220
|
values: computedProps.values
|
|
183
221
|
});
|
|
184
222
|
if (computedProps.item.render)
|
|
185
|
-
return /* @__PURE__ */
|
|
223
|
+
return /* @__PURE__ */ jsx5(Fragment, {
|
|
186
224
|
children: computedProps.item.render(computedProps.value, computedProps.values)
|
|
187
225
|
});
|
|
188
226
|
if (computedProps.value === null || Array.isArray(computedProps.value) && !computedProps.value.length)
|
|
189
|
-
return /* @__PURE__ */
|
|
227
|
+
return /* @__PURE__ */ jsx5(Blank, {});
|
|
190
228
|
switch (computedProps.item.type) {
|
|
191
229
|
case "string[]":
|
|
192
|
-
return /* @__PURE__ */
|
|
230
|
+
return /* @__PURE__ */ jsx5(Fragment, {
|
|
193
231
|
children: computedProps.value.join(", ")
|
|
194
232
|
});
|
|
195
233
|
case "number":
|
|
196
234
|
return computedProps.value || null;
|
|
197
235
|
case "number[]":
|
|
198
|
-
return /* @__PURE__ */
|
|
236
|
+
return /* @__PURE__ */ jsx5(Fragment, {
|
|
199
237
|
children: computedProps.value.join(", ")
|
|
200
238
|
});
|
|
201
239
|
case "boolean":
|
|
202
|
-
return computedProps.value ? /* @__PURE__ */
|
|
240
|
+
return computedProps.value ? /* @__PURE__ */ jsx5(CheckOutlined, {
|
|
203
241
|
style: {
|
|
204
242
|
marginTop: "4px",
|
|
205
243
|
color: "#52c41a"
|
|
206
244
|
}
|
|
207
|
-
}) : /* @__PURE__ */
|
|
245
|
+
}) : /* @__PURE__ */ jsx5(CloseOutlined, {
|
|
208
246
|
style: {
|
|
209
247
|
marginTop: "4px",
|
|
210
248
|
color: "#ff4d4f"
|
|
211
249
|
}
|
|
212
250
|
});
|
|
213
251
|
case "time":
|
|
214
|
-
return /* @__PURE__ */
|
|
252
|
+
return /* @__PURE__ */ jsx5(Fragment, {
|
|
215
253
|
children: computedProps.value.format("YYYY-MM-DD HH:mm:ss")
|
|
216
254
|
});
|
|
217
255
|
case "date":
|
|
218
|
-
return /* @__PURE__ */
|
|
256
|
+
return /* @__PURE__ */ jsx5(Fragment, {
|
|
219
257
|
children: computedProps.value.format("YYYY-MM-DD")
|
|
220
258
|
});
|
|
221
259
|
case "object":
|
|
222
260
|
if (!computedProps.value)
|
|
223
|
-
return /* @__PURE__ */
|
|
224
|
-
return /* @__PURE__ */
|
|
261
|
+
return /* @__PURE__ */ jsx5(Blank, {});
|
|
262
|
+
return /* @__PURE__ */ jsx5(Description, {
|
|
225
263
|
items: computedProps.item.object,
|
|
226
264
|
dataSource: computedProps.value,
|
|
227
265
|
column: 1
|
|
228
266
|
});
|
|
229
267
|
case "object[]":
|
|
230
268
|
if (!((_a = computedProps.value) == null ? void 0 : _a.length))
|
|
231
|
-
return /* @__PURE__ */
|
|
232
|
-
return /* @__PURE__ */
|
|
269
|
+
return /* @__PURE__ */ jsx5(Blank, {});
|
|
270
|
+
return /* @__PURE__ */ jsx5(Space, {
|
|
233
271
|
direction: "vertical",
|
|
234
|
-
children: computedProps.value.map((value, index) => /* @__PURE__ */
|
|
272
|
+
children: computedProps.value.map((value, index) => /* @__PURE__ */ jsx5(Description, {
|
|
235
273
|
items: computedProps.item.object,
|
|
236
274
|
dataSource: value,
|
|
237
275
|
column: 1
|
|
@@ -243,13 +281,13 @@ function DescriptionItemContent(props) {
|
|
|
243
281
|
}
|
|
244
282
|
function Description(props) {
|
|
245
283
|
if (!props.faasData)
|
|
246
|
-
return /* @__PURE__ */
|
|
284
|
+
return /* @__PURE__ */ jsx5(Descriptions, {
|
|
247
285
|
...props,
|
|
248
286
|
title: isFunction(props.renderTitle) ? props.renderTitle(props.dataSource) : props.title,
|
|
249
287
|
children: props.items.map((item) => {
|
|
250
|
-
return !item.if || item.if(props.dataSource) ? /* @__PURE__ */
|
|
288
|
+
return !item.if || item.if(props.dataSource) ? /* @__PURE__ */ jsx5(Descriptions.Item, {
|
|
251
289
|
label: item.title || upperFirst2(item.id),
|
|
252
|
-
children: /* @__PURE__ */
|
|
290
|
+
children: /* @__PURE__ */ jsx5(DescriptionItemContent, {
|
|
253
291
|
item,
|
|
254
292
|
value: props.dataSource[item.id],
|
|
255
293
|
values: props.dataSource,
|
|
@@ -258,18 +296,18 @@ function Description(props) {
|
|
|
258
296
|
}, item.id) : null;
|
|
259
297
|
}).filter(Boolean)
|
|
260
298
|
});
|
|
261
|
-
return /* @__PURE__ */
|
|
262
|
-
fallback: props.faasData.fallback || /* @__PURE__ */
|
|
299
|
+
return /* @__PURE__ */ jsx5(FaasDataWrapper, {
|
|
300
|
+
fallback: props.faasData.fallback || /* @__PURE__ */ jsx5(Skeleton, {
|
|
263
301
|
active: true
|
|
264
302
|
}),
|
|
265
303
|
render: ({ data }) => {
|
|
266
|
-
return /* @__PURE__ */
|
|
304
|
+
return /* @__PURE__ */ jsx5(Descriptions, {
|
|
267
305
|
...props,
|
|
268
306
|
title: isFunction(props.renderTitle) ? props.renderTitle(data) : props.title,
|
|
269
307
|
children: props.items.map((item) => {
|
|
270
|
-
return !item.if || item.if(data) ? /* @__PURE__ */
|
|
308
|
+
return !item.if || item.if(data) ? /* @__PURE__ */ jsx5(Descriptions.Item, {
|
|
271
309
|
label: item.title || upperFirst2(item.id),
|
|
272
|
-
children: /* @__PURE__ */
|
|
310
|
+
children: /* @__PURE__ */ jsx5(DescriptionItemContent, {
|
|
273
311
|
item,
|
|
274
312
|
value: data[item.id],
|
|
275
313
|
values: data,
|
|
@@ -286,7 +324,7 @@ function Description(props) {
|
|
|
286
324
|
// src/Drawer.tsx
|
|
287
325
|
import { Drawer } from "antd";
|
|
288
326
|
import { useState as useState3 } from "react";
|
|
289
|
-
import { jsx as
|
|
327
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
290
328
|
function useDrawer(init) {
|
|
291
329
|
const [props, setProps] = useState3({
|
|
292
330
|
open: false,
|
|
@@ -297,7 +335,7 @@ function useDrawer(init) {
|
|
|
297
335
|
...init
|
|
298
336
|
});
|
|
299
337
|
return {
|
|
300
|
-
drawer: /* @__PURE__ */
|
|
338
|
+
drawer: /* @__PURE__ */ jsx6(Drawer, {
|
|
301
339
|
...props
|
|
302
340
|
}),
|
|
303
341
|
drawerProps: props,
|
|
@@ -342,7 +380,7 @@ import {
|
|
|
342
380
|
useState as useState4
|
|
343
381
|
} from "react";
|
|
344
382
|
import { upperFirst as upperFirst3 } from "lodash-es";
|
|
345
|
-
import { Fragment as Fragment2, jsx as
|
|
383
|
+
import { Fragment as Fragment2, jsx as jsx7, jsxs } from "react/jsx-runtime";
|
|
346
384
|
function processProps(propsCopy, config) {
|
|
347
385
|
if (!propsCopy.title)
|
|
348
386
|
propsCopy.title = upperFirst3(propsCopy.id);
|
|
@@ -419,86 +457,86 @@ function FormItem(props) {
|
|
|
419
457
|
if (!computedProps)
|
|
420
458
|
return null;
|
|
421
459
|
if (hidden)
|
|
422
|
-
return /* @__PURE__ */
|
|
460
|
+
return /* @__PURE__ */ jsx7(AntdForm.Item, {
|
|
423
461
|
...computedProps,
|
|
424
462
|
noStyle: true,
|
|
425
463
|
rules: [],
|
|
426
|
-
children: /* @__PURE__ */
|
|
464
|
+
children: /* @__PURE__ */ jsx7(Input, {
|
|
427
465
|
hidden: true
|
|
428
466
|
})
|
|
429
467
|
});
|
|
430
468
|
if (extendTypes && extendTypes[computedProps.type])
|
|
431
|
-
return /* @__PURE__ */
|
|
469
|
+
return /* @__PURE__ */ jsx7(AntdForm.Item, {
|
|
432
470
|
...computedProps,
|
|
433
471
|
children: extendTypes[computedProps.type].children
|
|
434
472
|
});
|
|
435
473
|
if (computedProps.children)
|
|
436
|
-
return /* @__PURE__ */
|
|
474
|
+
return /* @__PURE__ */ jsx7(AntdForm.Item, {
|
|
437
475
|
...computedProps,
|
|
438
476
|
children: computedProps.children
|
|
439
477
|
});
|
|
440
478
|
if (computedProps.render)
|
|
441
|
-
return /* @__PURE__ */
|
|
479
|
+
return /* @__PURE__ */ jsx7(AntdForm.Item, {
|
|
442
480
|
...computedProps,
|
|
443
481
|
children: computedProps.render()
|
|
444
482
|
});
|
|
445
483
|
switch (computedProps.type) {
|
|
446
484
|
case "string":
|
|
447
|
-
return /* @__PURE__ */
|
|
485
|
+
return /* @__PURE__ */ jsx7(AntdForm.Item, {
|
|
448
486
|
...computedProps,
|
|
449
|
-
children: computedProps.options ? /* @__PURE__ */
|
|
487
|
+
children: computedProps.options ? /* @__PURE__ */ jsx7(Select, {
|
|
450
488
|
...computedProps.input
|
|
451
|
-
}) : /* @__PURE__ */
|
|
489
|
+
}) : /* @__PURE__ */ jsx7(Input, {
|
|
452
490
|
...computedProps.input
|
|
453
491
|
})
|
|
454
492
|
});
|
|
455
493
|
case "string[]":
|
|
456
494
|
if (computedProps.options)
|
|
457
|
-
return /* @__PURE__ */
|
|
495
|
+
return /* @__PURE__ */ jsx7(AntdForm.Item, {
|
|
458
496
|
...computedProps,
|
|
459
|
-
children: /* @__PURE__ */
|
|
497
|
+
children: /* @__PURE__ */ jsx7(Select, {
|
|
460
498
|
mode: "multiple",
|
|
461
499
|
...computedProps.input
|
|
462
500
|
})
|
|
463
501
|
});
|
|
464
|
-
return /* @__PURE__ */
|
|
502
|
+
return /* @__PURE__ */ jsx7(AntdForm.List, {
|
|
465
503
|
name: computedProps.name,
|
|
466
504
|
rules: computedProps.rules,
|
|
467
505
|
children: (fields, { add, remove }, { errors }) => {
|
|
468
506
|
var _a2;
|
|
469
507
|
return /* @__PURE__ */ jsxs(Fragment2, {
|
|
470
508
|
children: [
|
|
471
|
-
computedProps.label && /* @__PURE__ */
|
|
509
|
+
computedProps.label && /* @__PURE__ */ jsx7("div", {
|
|
472
510
|
className: "ant-form-item-label",
|
|
473
|
-
children: /* @__PURE__ */
|
|
511
|
+
children: /* @__PURE__ */ jsx7("label", {
|
|
474
512
|
className: computedProps.rules.find((r) => r.required) && "ant-form-item-required",
|
|
475
513
|
children: computedProps.label
|
|
476
514
|
})
|
|
477
515
|
}),
|
|
478
516
|
fields.map((field) => {
|
|
479
517
|
var _a3;
|
|
480
|
-
return /* @__PURE__ */
|
|
518
|
+
return /* @__PURE__ */ jsx7(AntdForm.Item, {
|
|
481
519
|
children: /* @__PURE__ */ jsxs(Row, {
|
|
482
520
|
gutter: 24,
|
|
483
521
|
style: { flexFlow: "row nowrap" },
|
|
484
522
|
children: [
|
|
485
|
-
/* @__PURE__ */
|
|
523
|
+
/* @__PURE__ */ jsx7(Col, {
|
|
486
524
|
span: 23,
|
|
487
|
-
children: /* @__PURE__ */
|
|
525
|
+
children: /* @__PURE__ */ jsx7(AntdForm.Item, {
|
|
488
526
|
...field,
|
|
489
527
|
noStyle: true,
|
|
490
|
-
children: /* @__PURE__ */
|
|
528
|
+
children: /* @__PURE__ */ jsx7(Input, {
|
|
491
529
|
...computedProps.input
|
|
492
530
|
})
|
|
493
531
|
})
|
|
494
532
|
}),
|
|
495
|
-
/* @__PURE__ */
|
|
533
|
+
/* @__PURE__ */ jsx7(Col, {
|
|
496
534
|
span: 1,
|
|
497
|
-
children: !((_a3 = computedProps.input) == null ? void 0 : _a3.disabled) && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */
|
|
535
|
+
children: !((_a3 = computedProps.input) == null ? void 0 : _a3.disabled) && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ jsx7(Button, {
|
|
498
536
|
danger: true,
|
|
499
537
|
type: "link",
|
|
500
538
|
style: { float: "right" },
|
|
501
|
-
icon: /* @__PURE__ */
|
|
539
|
+
icon: /* @__PURE__ */ jsx7(MinusCircleOutlined, {}),
|
|
502
540
|
onClick: () => remove(field.name)
|
|
503
541
|
})
|
|
504
542
|
})
|
|
@@ -508,13 +546,13 @@ function FormItem(props) {
|
|
|
508
546
|
}),
|
|
509
547
|
/* @__PURE__ */ jsxs(AntdForm.Item, {
|
|
510
548
|
children: [
|
|
511
|
-
!((_a2 = computedProps.input) == null ? void 0 : _a2.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */
|
|
549
|
+
!((_a2 = computedProps.input) == null ? void 0 : _a2.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ jsx7(Button, {
|
|
512
550
|
type: "dashed",
|
|
513
551
|
block: true,
|
|
514
552
|
onClick: () => add(),
|
|
515
|
-
icon: /* @__PURE__ */
|
|
553
|
+
icon: /* @__PURE__ */ jsx7(PlusOutlined, {})
|
|
516
554
|
}),
|
|
517
|
-
/* @__PURE__ */
|
|
555
|
+
/* @__PURE__ */ jsx7(AntdForm.ErrorList, {
|
|
518
556
|
errors
|
|
519
557
|
})
|
|
520
558
|
]
|
|
@@ -524,63 +562,63 @@ function FormItem(props) {
|
|
|
524
562
|
}
|
|
525
563
|
});
|
|
526
564
|
case "number":
|
|
527
|
-
return /* @__PURE__ */
|
|
565
|
+
return /* @__PURE__ */ jsx7(AntdForm.Item, {
|
|
528
566
|
...computedProps,
|
|
529
|
-
children: computedProps.options ? /* @__PURE__ */
|
|
567
|
+
children: computedProps.options ? /* @__PURE__ */ jsx7(Select, {
|
|
530
568
|
...computedProps.input
|
|
531
|
-
}) : /* @__PURE__ */
|
|
569
|
+
}) : /* @__PURE__ */ jsx7(InputNumber, {
|
|
532
570
|
style: { width: "100%" },
|
|
533
571
|
...computedProps.input
|
|
534
572
|
})
|
|
535
573
|
});
|
|
536
574
|
case "number[]":
|
|
537
575
|
if (computedProps.options)
|
|
538
|
-
return /* @__PURE__ */
|
|
576
|
+
return /* @__PURE__ */ jsx7(AntdForm.Item, {
|
|
539
577
|
...computedProps,
|
|
540
|
-
children: /* @__PURE__ */
|
|
578
|
+
children: /* @__PURE__ */ jsx7(Select, {
|
|
541
579
|
mode: "multiple",
|
|
542
580
|
...computedProps.input
|
|
543
581
|
})
|
|
544
582
|
});
|
|
545
|
-
return /* @__PURE__ */
|
|
583
|
+
return /* @__PURE__ */ jsx7(AntdForm.List, {
|
|
546
584
|
name: computedProps.name,
|
|
547
585
|
rules: computedProps.rules,
|
|
548
586
|
children: (fields, { add, remove }, { errors }) => {
|
|
549
587
|
var _a2, _b;
|
|
550
588
|
return /* @__PURE__ */ jsxs(Fragment2, {
|
|
551
589
|
children: [
|
|
552
|
-
computedProps.label && /* @__PURE__ */
|
|
590
|
+
computedProps.label && /* @__PURE__ */ jsx7("div", {
|
|
553
591
|
className: "ant-form-item-label",
|
|
554
|
-
children: /* @__PURE__ */
|
|
592
|
+
children: /* @__PURE__ */ jsx7("label", {
|
|
555
593
|
className: ((_a2 = computedProps.rules) == null ? void 0 : _a2.find((r) => r.required)) && "ant-form-item-required",
|
|
556
594
|
children: computedProps.label
|
|
557
595
|
})
|
|
558
596
|
}),
|
|
559
597
|
fields.map((field) => {
|
|
560
598
|
var _a3;
|
|
561
|
-
return /* @__PURE__ */
|
|
599
|
+
return /* @__PURE__ */ jsx7(AntdForm.Item, {
|
|
562
600
|
children: /* @__PURE__ */ jsxs(Row, {
|
|
563
601
|
gutter: 24,
|
|
564
602
|
style: { flexFlow: "row nowrap" },
|
|
565
603
|
children: [
|
|
566
|
-
/* @__PURE__ */
|
|
604
|
+
/* @__PURE__ */ jsx7(Col, {
|
|
567
605
|
span: 23,
|
|
568
|
-
children: /* @__PURE__ */
|
|
606
|
+
children: /* @__PURE__ */ jsx7(AntdForm.Item, {
|
|
569
607
|
...field,
|
|
570
608
|
noStyle: true,
|
|
571
|
-
children: /* @__PURE__ */
|
|
609
|
+
children: /* @__PURE__ */ jsx7(InputNumber, {
|
|
572
610
|
style: { width: "100%" },
|
|
573
611
|
...computedProps.input
|
|
574
612
|
})
|
|
575
613
|
})
|
|
576
614
|
}),
|
|
577
|
-
/* @__PURE__ */
|
|
615
|
+
/* @__PURE__ */ jsx7(Col, {
|
|
578
616
|
span: 1,
|
|
579
|
-
children: !((_a3 = computedProps.input) == null ? void 0 : _a3.disabled) && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */
|
|
617
|
+
children: !((_a3 = computedProps.input) == null ? void 0 : _a3.disabled) && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ jsx7(Button, {
|
|
580
618
|
danger: true,
|
|
581
619
|
type: "link",
|
|
582
620
|
style: { float: "right" },
|
|
583
|
-
icon: /* @__PURE__ */
|
|
621
|
+
icon: /* @__PURE__ */ jsx7(MinusCircleOutlined, {}),
|
|
584
622
|
onClick: () => remove(field.name)
|
|
585
623
|
})
|
|
586
624
|
})
|
|
@@ -590,13 +628,13 @@ function FormItem(props) {
|
|
|
590
628
|
}),
|
|
591
629
|
/* @__PURE__ */ jsxs(AntdForm.Item, {
|
|
592
630
|
children: [
|
|
593
|
-
!((_b = computedProps.input) == null ? void 0 : _b.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */
|
|
631
|
+
!((_b = computedProps.input) == null ? void 0 : _b.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ jsx7(Button, {
|
|
594
632
|
type: "dashed",
|
|
595
633
|
block: true,
|
|
596
634
|
onClick: () => add(),
|
|
597
|
-
icon: /* @__PURE__ */
|
|
635
|
+
icon: /* @__PURE__ */ jsx7(PlusOutlined, {})
|
|
598
636
|
}),
|
|
599
|
-
/* @__PURE__ */
|
|
637
|
+
/* @__PURE__ */ jsx7(AntdForm.ErrorList, {
|
|
600
638
|
errors
|
|
601
639
|
})
|
|
602
640
|
]
|
|
@@ -606,43 +644,43 @@ function FormItem(props) {
|
|
|
606
644
|
}
|
|
607
645
|
});
|
|
608
646
|
case "boolean":
|
|
609
|
-
return /* @__PURE__ */
|
|
647
|
+
return /* @__PURE__ */ jsx7(AntdForm.Item, {
|
|
610
648
|
...computedProps,
|
|
611
|
-
children: /* @__PURE__ */
|
|
649
|
+
children: /* @__PURE__ */ jsx7(Switch, {
|
|
612
650
|
...computedProps.input
|
|
613
651
|
})
|
|
614
652
|
});
|
|
615
653
|
case "date":
|
|
616
|
-
return /* @__PURE__ */
|
|
654
|
+
return /* @__PURE__ */ jsx7(AntdForm.Item, {
|
|
617
655
|
...computedProps,
|
|
618
|
-
children: /* @__PURE__ */
|
|
656
|
+
children: /* @__PURE__ */ jsx7(DatePicker, {
|
|
619
657
|
...computedProps.input
|
|
620
658
|
})
|
|
621
659
|
});
|
|
622
660
|
case "time":
|
|
623
|
-
return /* @__PURE__ */
|
|
661
|
+
return /* @__PURE__ */ jsx7(AntdForm.Item, {
|
|
624
662
|
...computedProps,
|
|
625
|
-
children: /* @__PURE__ */
|
|
663
|
+
children: /* @__PURE__ */ jsx7(TimePicker, {
|
|
626
664
|
...computedProps.input
|
|
627
665
|
})
|
|
628
666
|
});
|
|
629
667
|
case "object":
|
|
630
668
|
return /* @__PURE__ */ jsxs(Fragment2, {
|
|
631
669
|
children: [
|
|
632
|
-
computedProps.label && /* @__PURE__ */
|
|
670
|
+
computedProps.label && /* @__PURE__ */ jsx7("div", {
|
|
633
671
|
className: "ant-form-item-label",
|
|
634
|
-
children: /* @__PURE__ */
|
|
672
|
+
children: /* @__PURE__ */ jsx7("label", {
|
|
635
673
|
className: ((_a = computedProps.rules) == null ? void 0 : _a.find((r) => r.required)) && "ant-form-item-required",
|
|
636
674
|
children: computedProps.label
|
|
637
675
|
})
|
|
638
676
|
}),
|
|
639
|
-
computedProps.object.map((o) => /* @__PURE__ */
|
|
677
|
+
computedProps.object.map((o) => /* @__PURE__ */ jsx7(FormItem, {
|
|
640
678
|
...o
|
|
641
679
|
}, o.id))
|
|
642
680
|
]
|
|
643
681
|
});
|
|
644
682
|
case "object[]":
|
|
645
|
-
return /* @__PURE__ */
|
|
683
|
+
return /* @__PURE__ */ jsx7(AntdForm.List, {
|
|
646
684
|
name: computedProps.name,
|
|
647
685
|
rules: computedProps.rules,
|
|
648
686
|
children: (fields, { add, remove }, { errors }) => /* @__PURE__ */ jsxs(Fragment2, {
|
|
@@ -650,14 +688,14 @@ function FormItem(props) {
|
|
|
650
688
|
fields.map((field) => /* @__PURE__ */ jsxs(AntdForm.Item, {
|
|
651
689
|
style: { marginBottom: 0 },
|
|
652
690
|
children: [
|
|
653
|
-
/* @__PURE__ */
|
|
691
|
+
/* @__PURE__ */ jsx7("div", {
|
|
654
692
|
className: "ant-form-item-label",
|
|
655
693
|
children: /* @__PURE__ */ jsxs("label", {
|
|
656
694
|
children: [
|
|
657
695
|
computedProps.label,
|
|
658
696
|
" ",
|
|
659
697
|
field.name + 1,
|
|
660
|
-
!computedProps.disabled && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */
|
|
698
|
+
!computedProps.disabled && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ jsx7(Button, {
|
|
661
699
|
danger: true,
|
|
662
700
|
type: "link",
|
|
663
701
|
onClick: () => remove(field.name),
|
|
@@ -666,11 +704,11 @@ function FormItem(props) {
|
|
|
666
704
|
]
|
|
667
705
|
})
|
|
668
706
|
}),
|
|
669
|
-
/* @__PURE__ */
|
|
707
|
+
/* @__PURE__ */ jsx7(Row, {
|
|
670
708
|
gutter: 24,
|
|
671
|
-
children: computedProps.object.map((o) => /* @__PURE__ */
|
|
709
|
+
children: computedProps.object.map((o) => /* @__PURE__ */ jsx7(Col, {
|
|
672
710
|
span: o.col || 24,
|
|
673
|
-
children: /* @__PURE__ */
|
|
711
|
+
children: /* @__PURE__ */ jsx7(FormItem, {
|
|
674
712
|
...o,
|
|
675
713
|
name: [field.name, o.id]
|
|
676
714
|
})
|
|
@@ -684,14 +722,14 @@ function FormItem(props) {
|
|
|
684
722
|
type: "dashed",
|
|
685
723
|
block: true,
|
|
686
724
|
onClick: () => add(),
|
|
687
|
-
icon: /* @__PURE__ */
|
|
725
|
+
icon: /* @__PURE__ */ jsx7(PlusOutlined, {}),
|
|
688
726
|
children: [
|
|
689
727
|
common2.add,
|
|
690
728
|
" ",
|
|
691
729
|
computedProps.label
|
|
692
730
|
]
|
|
693
731
|
}),
|
|
694
|
-
/* @__PURE__ */
|
|
732
|
+
/* @__PURE__ */ jsx7(AntdForm.ErrorList, {
|
|
695
733
|
errors
|
|
696
734
|
})
|
|
697
735
|
]
|
|
@@ -705,7 +743,7 @@ function FormItem(props) {
|
|
|
705
743
|
}
|
|
706
744
|
|
|
707
745
|
// src/Form.tsx
|
|
708
|
-
import { jsx as
|
|
746
|
+
import { jsx as jsx8, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
709
747
|
function Form(props) {
|
|
710
748
|
var _a, _b;
|
|
711
749
|
const [loading, setLoading] = useState5(false);
|
|
@@ -796,12 +834,12 @@ function Form(props) {
|
|
|
796
834
|
onValuesChange,
|
|
797
835
|
children: [
|
|
798
836
|
computedProps.beforeItems,
|
|
799
|
-
(_a = computedProps.items) == null ? void 0 : _a.map((item) => isValidElement(item) ? item : /* @__PURE__ */
|
|
837
|
+
(_a = computedProps.items) == null ? void 0 : _a.map((item) => isValidElement(item) ? item : /* @__PURE__ */ jsx8(FormItem, {
|
|
800
838
|
...item,
|
|
801
839
|
extendTypes
|
|
802
840
|
}, item.id)),
|
|
803
841
|
computedProps.children,
|
|
804
|
-
computedProps.submit !== false && /* @__PURE__ */
|
|
842
|
+
computedProps.submit !== false && /* @__PURE__ */ jsx8(Button2, {
|
|
805
843
|
htmlType: "submit",
|
|
806
844
|
type: "primary",
|
|
807
845
|
loading,
|
|
@@ -816,7 +854,7 @@ Form.useForm = AntdForm2.useForm;
|
|
|
816
854
|
// src/Link.tsx
|
|
817
855
|
import { Link as RouterLink } from "react-router-dom";
|
|
818
856
|
import { Button as Button3 } from "antd";
|
|
819
|
-
import { jsx as
|
|
857
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
820
858
|
function Link({
|
|
821
859
|
href,
|
|
822
860
|
target,
|
|
@@ -829,7 +867,7 @@ function Link({
|
|
|
829
867
|
style = Object.assign({ cursor: "pointer" }, style);
|
|
830
868
|
if (href.startsWith("http")) {
|
|
831
869
|
if (button)
|
|
832
|
-
return /* @__PURE__ */
|
|
870
|
+
return /* @__PURE__ */ jsx9(Button3, {
|
|
833
871
|
...button,
|
|
834
872
|
target: target || (Link2 == null ? void 0 : Link2.target) || "_blank",
|
|
835
873
|
style: {
|
|
@@ -839,7 +877,7 @@ function Link({
|
|
|
839
877
|
href,
|
|
840
878
|
children: text != null ? text : children
|
|
841
879
|
});
|
|
842
|
-
return /* @__PURE__ */
|
|
880
|
+
return /* @__PURE__ */ jsx9("a", {
|
|
843
881
|
href,
|
|
844
882
|
target: target || (Link2 == null ? void 0 : Link2.target) || "_blank",
|
|
845
883
|
style: {
|
|
@@ -850,10 +888,10 @@ function Link({
|
|
|
850
888
|
});
|
|
851
889
|
}
|
|
852
890
|
if (button)
|
|
853
|
-
return /* @__PURE__ */
|
|
891
|
+
return /* @__PURE__ */ jsx9(RouterLink, {
|
|
854
892
|
to: href,
|
|
855
893
|
target: target || (Link2 == null ? void 0 : Link2.target),
|
|
856
|
-
children: /* @__PURE__ */
|
|
894
|
+
children: /* @__PURE__ */ jsx9(Button3, {
|
|
857
895
|
...button,
|
|
858
896
|
style: {
|
|
859
897
|
...Link2.style,
|
|
@@ -862,7 +900,7 @@ function Link({
|
|
|
862
900
|
children: text != null ? text : children
|
|
863
901
|
})
|
|
864
902
|
});
|
|
865
|
-
return /* @__PURE__ */
|
|
903
|
+
return /* @__PURE__ */ jsx9(RouterLink, {
|
|
866
904
|
to: href,
|
|
867
905
|
target: target || (Link2 == null ? void 0 : Link2.target),
|
|
868
906
|
style: {
|
|
@@ -876,7 +914,7 @@ function Link({
|
|
|
876
914
|
// src/Modal.tsx
|
|
877
915
|
import { Modal } from "antd";
|
|
878
916
|
import { useState as useState6 } from "react";
|
|
879
|
-
import { jsx as
|
|
917
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
880
918
|
function useModal(init) {
|
|
881
919
|
const [props, setProps] = useState6({
|
|
882
920
|
open: false,
|
|
@@ -887,7 +925,7 @@ function useModal(init) {
|
|
|
887
925
|
...init
|
|
888
926
|
});
|
|
889
927
|
return {
|
|
890
|
-
modal: /* @__PURE__ */
|
|
928
|
+
modal: /* @__PURE__ */ jsx10(Modal, {
|
|
891
929
|
...props
|
|
892
930
|
}),
|
|
893
931
|
modalProps: props,
|
|
@@ -901,7 +939,11 @@ function useModal(init) {
|
|
|
901
939
|
}
|
|
902
940
|
|
|
903
941
|
// src/Routers.tsx
|
|
904
|
-
import {
|
|
942
|
+
import {
|
|
943
|
+
Result,
|
|
944
|
+
Skeleton as Skeleton2,
|
|
945
|
+
Alert as Alert2
|
|
946
|
+
} from "antd";
|
|
905
947
|
import {
|
|
906
948
|
Suspense
|
|
907
949
|
} from "react";
|
|
@@ -909,34 +951,36 @@ import {
|
|
|
909
951
|
Routes as OriginRoutes,
|
|
910
952
|
Route
|
|
911
953
|
} from "react-router-dom";
|
|
912
|
-
import { jsx as
|
|
954
|
+
import { jsx as jsx11, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
913
955
|
function PageNotFound() {
|
|
914
956
|
const config = useConfigContext();
|
|
915
|
-
return /* @__PURE__ */
|
|
957
|
+
return /* @__PURE__ */ jsx11(Result, {
|
|
916
958
|
status: "404",
|
|
917
959
|
title: config.common.pageNotFound
|
|
918
960
|
});
|
|
919
961
|
}
|
|
920
962
|
function Routes(props) {
|
|
921
|
-
return /* @__PURE__ */
|
|
922
|
-
children:
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
963
|
+
return /* @__PURE__ */ jsx11(Alert2.ErrorBoundary, {
|
|
964
|
+
children: /* @__PURE__ */ jsxs3(OriginRoutes, {
|
|
965
|
+
children: [
|
|
966
|
+
props.routes.map((r) => /* @__PURE__ */ jsx11(Route, {
|
|
967
|
+
...r,
|
|
968
|
+
element: r.element || /* @__PURE__ */ jsx11(Suspense, {
|
|
969
|
+
fallback: props.fallback || /* @__PURE__ */ jsx11("div", {
|
|
970
|
+
style: { padding: "24px" },
|
|
971
|
+
children: /* @__PURE__ */ jsx11(Skeleton2, {
|
|
972
|
+
active: true
|
|
973
|
+
})
|
|
974
|
+
}),
|
|
975
|
+
children: /* @__PURE__ */ jsx11(r.page, {})
|
|
976
|
+
})
|
|
977
|
+
}, r.path)),
|
|
978
|
+
/* @__PURE__ */ jsx11(Route, {
|
|
979
|
+
path: "*",
|
|
980
|
+
element: props.notFound || /* @__PURE__ */ jsx11(PageNotFound, {})
|
|
981
|
+
}, "*")
|
|
982
|
+
]
|
|
983
|
+
})
|
|
940
984
|
});
|
|
941
985
|
}
|
|
942
986
|
|
|
@@ -959,15 +1003,12 @@ import {
|
|
|
959
1003
|
uniqBy,
|
|
960
1004
|
upperFirst as upperFirst4
|
|
961
1005
|
} from "lodash-es";
|
|
962
|
-
import {
|
|
963
|
-
FaasDataWrapper as FaasDataWrapper2
|
|
964
|
-
} from "@faasjs/react";
|
|
965
|
-
import { jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1006
|
+
import { jsx as jsx12, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
966
1007
|
function processValue(item, value) {
|
|
967
1008
|
var _a;
|
|
968
1009
|
const transferred = transferValue(item.type, value);
|
|
969
1010
|
if (transferred === null || Array.isArray(transferred) && transferred.length === 0)
|
|
970
|
-
return /* @__PURE__ */
|
|
1011
|
+
return /* @__PURE__ */ jsx12(Blank, {});
|
|
971
1012
|
if (item.options) {
|
|
972
1013
|
if (item.type.endsWith("[]"))
|
|
973
1014
|
return transferred.map((v) => {
|
|
@@ -1007,7 +1048,7 @@ function Table(props) {
|
|
|
1007
1048
|
text: o.label,
|
|
1008
1049
|
value: o.value
|
|
1009
1050
|
})).concat({
|
|
1010
|
-
text: /* @__PURE__ */
|
|
1051
|
+
text: /* @__PURE__ */ jsx12(Blank, {}),
|
|
1011
1052
|
value: null
|
|
1012
1053
|
});
|
|
1013
1054
|
}
|
|
@@ -1051,7 +1092,7 @@ function Table(props) {
|
|
|
1051
1092
|
setSelectedKeys,
|
|
1052
1093
|
confirm,
|
|
1053
1094
|
clearFilters
|
|
1054
|
-
}) => /* @__PURE__ */
|
|
1095
|
+
}) => /* @__PURE__ */ jsx12(Input2.Search, {
|
|
1055
1096
|
placeholder: `${common2.search} ${item.title}`,
|
|
1056
1097
|
allowClear: true,
|
|
1057
1098
|
onSearch: (v) => {
|
|
@@ -1081,7 +1122,7 @@ function Table(props) {
|
|
|
1081
1122
|
setSelectedKeys,
|
|
1082
1123
|
confirm,
|
|
1083
1124
|
clearFilters
|
|
1084
|
-
}) => /* @__PURE__ */
|
|
1125
|
+
}) => /* @__PURE__ */ jsx12(Input2.Search, {
|
|
1085
1126
|
placeholder: `${common2.search} ${item.title}`,
|
|
1086
1127
|
allowClear: true,
|
|
1087
1128
|
onSearch: (v) => {
|
|
@@ -1111,7 +1152,7 @@ function Table(props) {
|
|
|
1111
1152
|
setSelectedKeys,
|
|
1112
1153
|
confirm,
|
|
1113
1154
|
clearFilters
|
|
1114
|
-
}) => /* @__PURE__ */
|
|
1155
|
+
}) => /* @__PURE__ */ jsx12(Input2.Search, {
|
|
1115
1156
|
placeholder: `${common2.search} ${item.title}`,
|
|
1116
1157
|
allowClear: true,
|
|
1117
1158
|
onSearch: (v) => {
|
|
@@ -1141,7 +1182,7 @@ function Table(props) {
|
|
|
1141
1182
|
setSelectedKeys,
|
|
1142
1183
|
confirm,
|
|
1143
1184
|
clearFilters
|
|
1144
|
-
}) => /* @__PURE__ */
|
|
1185
|
+
}) => /* @__PURE__ */ jsx12(Input2.Search, {
|
|
1145
1186
|
placeholder: `${common2.search} ${item.title}`,
|
|
1146
1187
|
allowClear: true,
|
|
1147
1188
|
onSearch: (v) => {
|
|
@@ -1157,12 +1198,12 @@ function Table(props) {
|
|
|
1157
1198
|
break;
|
|
1158
1199
|
case "boolean":
|
|
1159
1200
|
if (!item.render)
|
|
1160
|
-
item.render = (value) => typeof value === "undefined" ? /* @__PURE__ */
|
|
1201
|
+
item.render = (value) => typeof value === "undefined" ? /* @__PURE__ */ jsx12(Blank, {}) : value ? /* @__PURE__ */ jsx12(CheckOutlined2, {
|
|
1161
1202
|
style: {
|
|
1162
1203
|
marginTop: "4px",
|
|
1163
1204
|
color: "#52c41a"
|
|
1164
1205
|
}
|
|
1165
|
-
}) : /* @__PURE__ */
|
|
1206
|
+
}) : /* @__PURE__ */ jsx12(CloseOutlined2, {
|
|
1166
1207
|
style: {
|
|
1167
1208
|
marginTop: "4px",
|
|
1168
1209
|
color: "#ff4d4f"
|
|
@@ -1182,28 +1223,28 @@ function Table(props) {
|
|
|
1182
1223
|
confirm();
|
|
1183
1224
|
},
|
|
1184
1225
|
children: [
|
|
1185
|
-
/* @__PURE__ */
|
|
1226
|
+
/* @__PURE__ */ jsx12(Radio.Button, {
|
|
1186
1227
|
children: common2.all
|
|
1187
1228
|
}),
|
|
1188
|
-
/* @__PURE__ */
|
|
1229
|
+
/* @__PURE__ */ jsx12(Radio.Button, {
|
|
1189
1230
|
value: "true",
|
|
1190
|
-
children: /* @__PURE__ */
|
|
1231
|
+
children: /* @__PURE__ */ jsx12(CheckOutlined2, {
|
|
1191
1232
|
style: {
|
|
1192
1233
|
color: "#52c41a",
|
|
1193
1234
|
verticalAlign: "middle"
|
|
1194
1235
|
}
|
|
1195
1236
|
})
|
|
1196
1237
|
}),
|
|
1197
|
-
/* @__PURE__ */
|
|
1238
|
+
/* @__PURE__ */ jsx12(Radio.Button, {
|
|
1198
1239
|
value: "false",
|
|
1199
|
-
children: /* @__PURE__ */
|
|
1240
|
+
children: /* @__PURE__ */ jsx12(CloseOutlined2, {
|
|
1200
1241
|
style: {
|
|
1201
1242
|
verticalAlign: "middle",
|
|
1202
1243
|
color: "#ff4d4f"
|
|
1203
1244
|
}
|
|
1204
1245
|
})
|
|
1205
1246
|
}),
|
|
1206
|
-
/* @__PURE__ */
|
|
1247
|
+
/* @__PURE__ */ jsx12(Radio.Button, {
|
|
1207
1248
|
value: "empty",
|
|
1208
1249
|
children: common2.blank
|
|
1209
1250
|
})
|
|
@@ -1241,7 +1282,7 @@ function Table(props) {
|
|
|
1241
1282
|
break;
|
|
1242
1283
|
case "object":
|
|
1243
1284
|
if (!item.render)
|
|
1244
|
-
item.render = (value) => /* @__PURE__ */
|
|
1285
|
+
item.render = (value) => /* @__PURE__ */ jsx12(Description, {
|
|
1245
1286
|
items: item.object,
|
|
1246
1287
|
dataSource: value || {},
|
|
1247
1288
|
column: 1
|
|
@@ -1249,7 +1290,7 @@ function Table(props) {
|
|
|
1249
1290
|
break;
|
|
1250
1291
|
case "object[]":
|
|
1251
1292
|
if (!item.render)
|
|
1252
|
-
item.render = (value) => value.map((v, i) => /* @__PURE__ */
|
|
1293
|
+
item.render = (value) => value.map((v, i) => /* @__PURE__ */ jsx12(Description, {
|
|
1253
1294
|
items: item.object,
|
|
1254
1295
|
dataSource: v || [],
|
|
1255
1296
|
column: 1
|
|
@@ -1274,36 +1315,38 @@ function Table(props) {
|
|
|
1274
1315
|
return;
|
|
1275
1316
|
for (const column of columns) {
|
|
1276
1317
|
if (column.optionsType === "auto" && !column.options && !column.filters) {
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1318
|
+
const filters = uniqBy(props.dataSource, column.id).map((v) => ({
|
|
1319
|
+
text: v[column.id],
|
|
1320
|
+
value: v[column.id]
|
|
1321
|
+
}));
|
|
1322
|
+
if (filters.length)
|
|
1323
|
+
setColumns((prev) => {
|
|
1324
|
+
const newColumns = [...prev];
|
|
1325
|
+
const index = newColumns.findIndex((item) => item.id === column.id);
|
|
1326
|
+
newColumns[index].filters = filters.concat({
|
|
1327
|
+
text: /* @__PURE__ */ jsx12(Blank, {}),
|
|
1328
|
+
value: null
|
|
1329
|
+
});
|
|
1330
|
+
return newColumns;
|
|
1286
1331
|
});
|
|
1287
|
-
return newColumns;
|
|
1288
|
-
});
|
|
1289
1332
|
}
|
|
1290
1333
|
}
|
|
1291
1334
|
}, [props.dataSource, columns]);
|
|
1292
1335
|
if (!columns)
|
|
1293
1336
|
return null;
|
|
1294
1337
|
if (!props.faasData)
|
|
1295
|
-
return /* @__PURE__ */
|
|
1338
|
+
return /* @__PURE__ */ jsx12(AntdTable, {
|
|
1296
1339
|
...props,
|
|
1297
1340
|
rowKey: props.rowKey || "id",
|
|
1298
1341
|
columns,
|
|
1299
1342
|
dataSource: props.dataSource
|
|
1300
1343
|
});
|
|
1301
|
-
return /* @__PURE__ */
|
|
1302
|
-
fallback: props.faasData.fallback || /* @__PURE__ */
|
|
1344
|
+
return /* @__PURE__ */ jsx12(FaasDataWrapper, {
|
|
1345
|
+
fallback: props.faasData.fallback || /* @__PURE__ */ jsx12(Skeleton3, {
|
|
1303
1346
|
active: true
|
|
1304
1347
|
}),
|
|
1305
1348
|
...props.faasData,
|
|
1306
|
-
children: /* @__PURE__ */
|
|
1349
|
+
children: /* @__PURE__ */ jsx12(FaasDataTable, {
|
|
1307
1350
|
props,
|
|
1308
1351
|
columns
|
|
1309
1352
|
})
|
|
@@ -1329,7 +1372,7 @@ function FaasDataTable({
|
|
|
1329
1372
|
text: v.label,
|
|
1330
1373
|
value: v.value
|
|
1331
1374
|
})).concat({
|
|
1332
|
-
text: /* @__PURE__ */
|
|
1375
|
+
text: /* @__PURE__ */ jsx12(Blank, {}),
|
|
1333
1376
|
value: null
|
|
1334
1377
|
});
|
|
1335
1378
|
column.render = (value) => processValue(column, value);
|
|
@@ -1338,33 +1381,35 @@ function FaasDataTable({
|
|
|
1338
1381
|
continue;
|
|
1339
1382
|
}
|
|
1340
1383
|
if (column.optionsType === "auto" && !column.options && !column.filters) {
|
|
1341
|
-
|
|
1384
|
+
const filters = uniqBy(props.dataSource, column.id).map((v) => ({
|
|
1342
1385
|
text: v[column.id],
|
|
1343
1386
|
value: v[column.id]
|
|
1344
|
-
}))
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1387
|
+
}));
|
|
1388
|
+
if (filters.length)
|
|
1389
|
+
column.filters = filters.concat({
|
|
1390
|
+
text: /* @__PURE__ */ jsx12(Blank, {}),
|
|
1391
|
+
value: null
|
|
1392
|
+
});
|
|
1348
1393
|
}
|
|
1349
1394
|
}
|
|
1350
1395
|
return newColumns;
|
|
1351
1396
|
});
|
|
1352
1397
|
}, [columns, data]);
|
|
1353
1398
|
if (!data)
|
|
1354
|
-
return /* @__PURE__ */
|
|
1399
|
+
return /* @__PURE__ */ jsx12(AntdTable, {
|
|
1355
1400
|
...props,
|
|
1356
1401
|
rowKey: props.rowKey || "id",
|
|
1357
1402
|
columns: currentColumns,
|
|
1358
1403
|
dataSource: []
|
|
1359
1404
|
});
|
|
1360
1405
|
if (Array.isArray(data))
|
|
1361
|
-
return /* @__PURE__ */
|
|
1406
|
+
return /* @__PURE__ */ jsx12(AntdTable, {
|
|
1362
1407
|
...props,
|
|
1363
1408
|
rowKey: props.rowKey || "id",
|
|
1364
1409
|
columns: currentColumns,
|
|
1365
1410
|
dataSource: data
|
|
1366
1411
|
});
|
|
1367
|
-
return /* @__PURE__ */
|
|
1412
|
+
return /* @__PURE__ */ jsx12(AntdTable, {
|
|
1368
1413
|
...props,
|
|
1369
1414
|
rowKey: props.rowKey || "id",
|
|
1370
1415
|
columns: currentColumns,
|
|
@@ -1396,7 +1441,7 @@ function FaasDataTable({
|
|
|
1396
1441
|
|
|
1397
1442
|
// src/Title.tsx
|
|
1398
1443
|
import { useEffect as useEffect6, cloneElement as cloneElement3 } from "react";
|
|
1399
|
-
import { Fragment as Fragment3, jsx as
|
|
1444
|
+
import { Fragment as Fragment3, jsx as jsx13 } from "react/jsx-runtime";
|
|
1400
1445
|
function Title(props) {
|
|
1401
1446
|
const { Title: Title2 } = useConfigContext();
|
|
1402
1447
|
useEffect6(() => {
|
|
@@ -1405,17 +1450,17 @@ function Title(props) {
|
|
|
1405
1450
|
}, [props]);
|
|
1406
1451
|
if (props.h1) {
|
|
1407
1452
|
if (typeof props.h1 === "boolean")
|
|
1408
|
-
return /* @__PURE__ */
|
|
1453
|
+
return /* @__PURE__ */ jsx13("h1", {
|
|
1409
1454
|
children: Array.isArray(props.title) ? props.title[0] : props.title
|
|
1410
1455
|
});
|
|
1411
|
-
return /* @__PURE__ */
|
|
1456
|
+
return /* @__PURE__ */ jsx13("h1", {
|
|
1412
1457
|
className: props.h1.className,
|
|
1413
1458
|
style: props.h1.style,
|
|
1414
1459
|
children: Array.isArray(props.title) ? props.title[0] : props.title
|
|
1415
1460
|
});
|
|
1416
1461
|
}
|
|
1417
1462
|
if (props.plain)
|
|
1418
|
-
return /* @__PURE__ */
|
|
1463
|
+
return /* @__PURE__ */ jsx13(Fragment3, {
|
|
1419
1464
|
children: Array.isArray(props.title) ? props.title[0] : props.title
|
|
1420
1465
|
});
|
|
1421
1466
|
if (props.children)
|
|
@@ -1428,9 +1473,13 @@ export {
|
|
|
1428
1473
|
ConfigProvider,
|
|
1429
1474
|
Description,
|
|
1430
1475
|
Drawer,
|
|
1476
|
+
FaasDataInjection,
|
|
1477
|
+
FaasDataWrapper,
|
|
1478
|
+
FaasDataWrapperProps,
|
|
1431
1479
|
Form,
|
|
1432
1480
|
FormItem,
|
|
1433
1481
|
Link,
|
|
1482
|
+
Loading,
|
|
1434
1483
|
Modal,
|
|
1435
1484
|
PageNotFound,
|
|
1436
1485
|
Routes,
|