@faasjs/ant-design 0.0.3-beta.24 → 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/dist/index.mjs CHANGED
@@ -128,8 +128,46 @@ import {
128
128
  useEffect as useEffect2,
129
129
  useState as useState2
130
130
  } from "react";
131
- import { FaasDataWrapper } from "@faasjs/react";
132
- import { Fragment, jsx as jsx3 } from "react/jsx-runtime";
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__ */ jsx3(Fragment, {
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__ */ jsx3(Fragment, {
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__ */ jsx3(Blank, {});
227
+ return /* @__PURE__ */ jsx5(Blank, {});
190
228
  switch (computedProps.item.type) {
191
229
  case "string[]":
192
- return /* @__PURE__ */ jsx3(Fragment, {
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__ */ jsx3(Fragment, {
236
+ return /* @__PURE__ */ jsx5(Fragment, {
199
237
  children: computedProps.value.join(", ")
200
238
  });
201
239
  case "boolean":
202
- return computedProps.value ? /* @__PURE__ */ jsx3(CheckOutlined, {
240
+ return computedProps.value ? /* @__PURE__ */ jsx5(CheckOutlined, {
203
241
  style: {
204
242
  marginTop: "4px",
205
243
  color: "#52c41a"
206
244
  }
207
- }) : /* @__PURE__ */ jsx3(CloseOutlined, {
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__ */ jsx3(Fragment, {
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__ */ jsx3(Fragment, {
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__ */ jsx3(Blank, {});
224
- return /* @__PURE__ */ jsx3(Description, {
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__ */ jsx3(Blank, {});
232
- return /* @__PURE__ */ jsx3(Space, {
269
+ return /* @__PURE__ */ jsx5(Blank, {});
270
+ return /* @__PURE__ */ jsx5(Space, {
233
271
  direction: "vertical",
234
- children: computedProps.value.map((value, index) => /* @__PURE__ */ jsx3(Description, {
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__ */ jsx3(Descriptions, {
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__ */ jsx3(Descriptions.Item, {
288
+ return !item.if || item.if(props.dataSource) ? /* @__PURE__ */ jsx5(Descriptions.Item, {
251
289
  label: item.title || upperFirst2(item.id),
252
- children: /* @__PURE__ */ jsx3(DescriptionItemContent, {
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__ */ jsx3(FaasDataWrapper, {
262
- fallback: props.faasData.fallback || /* @__PURE__ */ jsx3(Skeleton, {
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__ */ jsx3(Descriptions, {
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__ */ jsx3(Descriptions.Item, {
308
+ return !item.if || item.if(data) ? /* @__PURE__ */ jsx5(Descriptions.Item, {
271
309
  label: item.title || upperFirst2(item.id),
272
- children: /* @__PURE__ */ jsx3(DescriptionItemContent, {
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 jsx4 } from "react/jsx-runtime";
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__ */ jsx4(Drawer, {
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 jsx5, jsxs } from "react/jsx-runtime";
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__ */ jsx5(AntdForm.Item, {
460
+ return /* @__PURE__ */ jsx7(AntdForm.Item, {
423
461
  ...computedProps,
424
462
  noStyle: true,
425
463
  rules: [],
426
- children: /* @__PURE__ */ jsx5(Input, {
464
+ children: /* @__PURE__ */ jsx7(Input, {
427
465
  hidden: true
428
466
  })
429
467
  });
430
468
  if (extendTypes && extendTypes[computedProps.type])
431
- return /* @__PURE__ */ jsx5(AntdForm.Item, {
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__ */ jsx5(AntdForm.Item, {
474
+ return /* @__PURE__ */ jsx7(AntdForm.Item, {
437
475
  ...computedProps,
438
476
  children: computedProps.children
439
477
  });
440
478
  if (computedProps.render)
441
- return /* @__PURE__ */ jsx5(AntdForm.Item, {
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__ */ jsx5(AntdForm.Item, {
485
+ return /* @__PURE__ */ jsx7(AntdForm.Item, {
448
486
  ...computedProps,
449
- children: computedProps.options ? /* @__PURE__ */ jsx5(Select, {
487
+ children: computedProps.options ? /* @__PURE__ */ jsx7(Select, {
450
488
  ...computedProps.input
451
- }) : /* @__PURE__ */ jsx5(Input, {
489
+ }) : /* @__PURE__ */ jsx7(Input, {
452
490
  ...computedProps.input
453
491
  })
454
492
  });
455
493
  case "string[]":
456
494
  if (computedProps.options)
457
- return /* @__PURE__ */ jsx5(AntdForm.Item, {
495
+ return /* @__PURE__ */ jsx7(AntdForm.Item, {
458
496
  ...computedProps,
459
- children: /* @__PURE__ */ jsx5(Select, {
497
+ children: /* @__PURE__ */ jsx7(Select, {
460
498
  mode: "multiple",
461
499
  ...computedProps.input
462
500
  })
463
501
  });
464
- return /* @__PURE__ */ jsx5(AntdForm.List, {
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__ */ jsx5("div", {
509
+ computedProps.label && /* @__PURE__ */ jsx7("div", {
472
510
  className: "ant-form-item-label",
473
- children: /* @__PURE__ */ jsx5("label", {
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__ */ jsx5(AntdForm.Item, {
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__ */ jsx5(Col, {
523
+ /* @__PURE__ */ jsx7(Col, {
486
524
  span: 23,
487
- children: /* @__PURE__ */ jsx5(AntdForm.Item, {
525
+ children: /* @__PURE__ */ jsx7(AntdForm.Item, {
488
526
  ...field,
489
527
  noStyle: true,
490
- children: /* @__PURE__ */ jsx5(Input, {
528
+ children: /* @__PURE__ */ jsx7(Input, {
491
529
  ...computedProps.input
492
530
  })
493
531
  })
494
532
  }),
495
- /* @__PURE__ */ jsx5(Col, {
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__ */ jsx5(Button, {
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__ */ jsx5(MinusCircleOutlined, {}),
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__ */ jsx5(Button, {
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__ */ jsx5(PlusOutlined, {})
553
+ icon: /* @__PURE__ */ jsx7(PlusOutlined, {})
516
554
  }),
517
- /* @__PURE__ */ jsx5(AntdForm.ErrorList, {
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__ */ jsx5(AntdForm.Item, {
565
+ return /* @__PURE__ */ jsx7(AntdForm.Item, {
528
566
  ...computedProps,
529
- children: computedProps.options ? /* @__PURE__ */ jsx5(Select, {
567
+ children: computedProps.options ? /* @__PURE__ */ jsx7(Select, {
530
568
  ...computedProps.input
531
- }) : /* @__PURE__ */ jsx5(InputNumber, {
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__ */ jsx5(AntdForm.Item, {
576
+ return /* @__PURE__ */ jsx7(AntdForm.Item, {
539
577
  ...computedProps,
540
- children: /* @__PURE__ */ jsx5(Select, {
578
+ children: /* @__PURE__ */ jsx7(Select, {
541
579
  mode: "multiple",
542
580
  ...computedProps.input
543
581
  })
544
582
  });
545
- return /* @__PURE__ */ jsx5(AntdForm.List, {
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__ */ jsx5("div", {
590
+ computedProps.label && /* @__PURE__ */ jsx7("div", {
553
591
  className: "ant-form-item-label",
554
- children: /* @__PURE__ */ jsx5("label", {
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__ */ jsx5(AntdForm.Item, {
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__ */ jsx5(Col, {
604
+ /* @__PURE__ */ jsx7(Col, {
567
605
  span: 23,
568
- children: /* @__PURE__ */ jsx5(AntdForm.Item, {
606
+ children: /* @__PURE__ */ jsx7(AntdForm.Item, {
569
607
  ...field,
570
608
  noStyle: true,
571
- children: /* @__PURE__ */ jsx5(InputNumber, {
609
+ children: /* @__PURE__ */ jsx7(InputNumber, {
572
610
  style: { width: "100%" },
573
611
  ...computedProps.input
574
612
  })
575
613
  })
576
614
  }),
577
- /* @__PURE__ */ jsx5(Col, {
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__ */ jsx5(Button, {
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__ */ jsx5(MinusCircleOutlined, {}),
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__ */ jsx5(Button, {
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__ */ jsx5(PlusOutlined, {})
635
+ icon: /* @__PURE__ */ jsx7(PlusOutlined, {})
598
636
  }),
599
- /* @__PURE__ */ jsx5(AntdForm.ErrorList, {
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__ */ jsx5(AntdForm.Item, {
647
+ return /* @__PURE__ */ jsx7(AntdForm.Item, {
610
648
  ...computedProps,
611
- children: /* @__PURE__ */ jsx5(Switch, {
649
+ children: /* @__PURE__ */ jsx7(Switch, {
612
650
  ...computedProps.input
613
651
  })
614
652
  });
615
653
  case "date":
616
- return /* @__PURE__ */ jsx5(AntdForm.Item, {
654
+ return /* @__PURE__ */ jsx7(AntdForm.Item, {
617
655
  ...computedProps,
618
- children: /* @__PURE__ */ jsx5(DatePicker, {
656
+ children: /* @__PURE__ */ jsx7(DatePicker, {
619
657
  ...computedProps.input
620
658
  })
621
659
  });
622
660
  case "time":
623
- return /* @__PURE__ */ jsx5(AntdForm.Item, {
661
+ return /* @__PURE__ */ jsx7(AntdForm.Item, {
624
662
  ...computedProps,
625
- children: /* @__PURE__ */ jsx5(TimePicker, {
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__ */ jsx5("div", {
670
+ computedProps.label && /* @__PURE__ */ jsx7("div", {
633
671
  className: "ant-form-item-label",
634
- children: /* @__PURE__ */ jsx5("label", {
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__ */ jsx5(FormItem, {
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__ */ jsx5(AntdForm.List, {
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__ */ jsx5("div", {
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__ */ jsx5(Button, {
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__ */ jsx5(Row, {
707
+ /* @__PURE__ */ jsx7(Row, {
670
708
  gutter: 24,
671
- children: computedProps.object.map((o) => /* @__PURE__ */ jsx5(Col, {
709
+ children: computedProps.object.map((o) => /* @__PURE__ */ jsx7(Col, {
672
710
  span: o.col || 24,
673
- children: /* @__PURE__ */ jsx5(FormItem, {
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__ */ jsx5(PlusOutlined, {}),
725
+ icon: /* @__PURE__ */ jsx7(PlusOutlined, {}),
688
726
  children: [
689
727
  common2.add,
690
728
  " ",
691
729
  computedProps.label
692
730
  ]
693
731
  }),
694
- /* @__PURE__ */ jsx5(AntdForm.ErrorList, {
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 jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
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__ */ jsx6(FormItem, {
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__ */ jsx6(Button2, {
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 jsx7 } from "react/jsx-runtime";
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__ */ jsx7(Button3, {
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__ */ jsx7("a", {
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__ */ jsx7(RouterLink, {
891
+ return /* @__PURE__ */ jsx9(RouterLink, {
854
892
  to: href,
855
893
  target: target || (Link2 == null ? void 0 : Link2.target),
856
- children: /* @__PURE__ */ jsx7(Button3, {
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__ */ jsx7(RouterLink, {
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 jsx8 } from "react/jsx-runtime";
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__ */ jsx8(Modal, {
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 { Result, Skeleton as Skeleton2 } from "antd";
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 jsx9, jsxs as jsxs3 } from "react/jsx-runtime";
954
+ import { jsx as jsx11, jsxs as jsxs3 } from "react/jsx-runtime";
913
955
  function PageNotFound() {
914
956
  const config = useConfigContext();
915
- return /* @__PURE__ */ jsx9(Result, {
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__ */ jsxs3(OriginRoutes, {
922
- children: [
923
- props.routes.map((r) => /* @__PURE__ */ jsx9(Route, {
924
- ...r,
925
- element: r.element || /* @__PURE__ */ jsx9(Suspense, {
926
- fallback: props.fallback || /* @__PURE__ */ jsx9("div", {
927
- style: { padding: "24px" },
928
- children: /* @__PURE__ */ jsx9(Skeleton2, {
929
- active: true
930
- })
931
- }),
932
- children: /* @__PURE__ */ jsx9(r.page, {})
933
- })
934
- }, r.path)),
935
- /* @__PURE__ */ jsx9(Route, {
936
- path: "*",
937
- element: props.notFound || /* @__PURE__ */ jsx9(PageNotFound, {})
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__ */ jsx10(Blank, {});
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__ */ jsx10(Blank, {}),
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__ */ jsx10(Input2.Search, {
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__ */ jsx10(Input2.Search, {
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__ */ jsx10(Input2.Search, {
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__ */ jsx10(Input2.Search, {
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__ */ jsx10(Blank, {}) : value ? /* @__PURE__ */ jsx10(CheckOutlined2, {
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__ */ jsx10(CloseOutlined2, {
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__ */ jsx10(Radio.Button, {
1226
+ /* @__PURE__ */ jsx12(Radio.Button, {
1186
1227
  children: common2.all
1187
1228
  }),
1188
- /* @__PURE__ */ jsx10(Radio.Button, {
1229
+ /* @__PURE__ */ jsx12(Radio.Button, {
1189
1230
  value: "true",
1190
- children: /* @__PURE__ */ jsx10(CheckOutlined2, {
1231
+ children: /* @__PURE__ */ jsx12(CheckOutlined2, {
1191
1232
  style: {
1192
1233
  color: "#52c41a",
1193
1234
  verticalAlign: "middle"
1194
1235
  }
1195
1236
  })
1196
1237
  }),
1197
- /* @__PURE__ */ jsx10(Radio.Button, {
1238
+ /* @__PURE__ */ jsx12(Radio.Button, {
1198
1239
  value: "false",
1199
- children: /* @__PURE__ */ jsx10(CloseOutlined2, {
1240
+ children: /* @__PURE__ */ jsx12(CloseOutlined2, {
1200
1241
  style: {
1201
1242
  verticalAlign: "middle",
1202
1243
  color: "#ff4d4f"
1203
1244
  }
1204
1245
  })
1205
1246
  }),
1206
- /* @__PURE__ */ jsx10(Radio.Button, {
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__ */ jsx10(Description, {
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__ */ jsx10(Description, {
1293
+ item.render = (value) => value.map((v, i) => /* @__PURE__ */ jsx12(Description, {
1253
1294
  items: item.object,
1254
1295
  dataSource: v || [],
1255
1296
  column: 1
@@ -1283,7 +1324,7 @@ function Table(props) {
1283
1324
  const newColumns = [...prev];
1284
1325
  const index = newColumns.findIndex((item) => item.id === column.id);
1285
1326
  newColumns[index].filters = filters.concat({
1286
- text: /* @__PURE__ */ jsx10(Blank, {}),
1327
+ text: /* @__PURE__ */ jsx12(Blank, {}),
1287
1328
  value: null
1288
1329
  });
1289
1330
  return newColumns;
@@ -1294,18 +1335,18 @@ function Table(props) {
1294
1335
  if (!columns)
1295
1336
  return null;
1296
1337
  if (!props.faasData)
1297
- return /* @__PURE__ */ jsx10(AntdTable, {
1338
+ return /* @__PURE__ */ jsx12(AntdTable, {
1298
1339
  ...props,
1299
1340
  rowKey: props.rowKey || "id",
1300
1341
  columns,
1301
1342
  dataSource: props.dataSource
1302
1343
  });
1303
- return /* @__PURE__ */ jsx10(FaasDataWrapper2, {
1304
- fallback: props.faasData.fallback || /* @__PURE__ */ jsx10(Skeleton3, {
1344
+ return /* @__PURE__ */ jsx12(FaasDataWrapper, {
1345
+ fallback: props.faasData.fallback || /* @__PURE__ */ jsx12(Skeleton3, {
1305
1346
  active: true
1306
1347
  }),
1307
1348
  ...props.faasData,
1308
- children: /* @__PURE__ */ jsx10(FaasDataTable, {
1349
+ children: /* @__PURE__ */ jsx12(FaasDataTable, {
1309
1350
  props,
1310
1351
  columns
1311
1352
  })
@@ -1331,7 +1372,7 @@ function FaasDataTable({
1331
1372
  text: v.label,
1332
1373
  value: v.value
1333
1374
  })).concat({
1334
- text: /* @__PURE__ */ jsx10(Blank, {}),
1375
+ text: /* @__PURE__ */ jsx12(Blank, {}),
1335
1376
  value: null
1336
1377
  });
1337
1378
  column.render = (value) => processValue(column, value);
@@ -1346,7 +1387,7 @@ function FaasDataTable({
1346
1387
  }));
1347
1388
  if (filters.length)
1348
1389
  column.filters = filters.concat({
1349
- text: /* @__PURE__ */ jsx10(Blank, {}),
1390
+ text: /* @__PURE__ */ jsx12(Blank, {}),
1350
1391
  value: null
1351
1392
  });
1352
1393
  }
@@ -1355,20 +1396,20 @@ function FaasDataTable({
1355
1396
  });
1356
1397
  }, [columns, data]);
1357
1398
  if (!data)
1358
- return /* @__PURE__ */ jsx10(AntdTable, {
1399
+ return /* @__PURE__ */ jsx12(AntdTable, {
1359
1400
  ...props,
1360
1401
  rowKey: props.rowKey || "id",
1361
1402
  columns: currentColumns,
1362
1403
  dataSource: []
1363
1404
  });
1364
1405
  if (Array.isArray(data))
1365
- return /* @__PURE__ */ jsx10(AntdTable, {
1406
+ return /* @__PURE__ */ jsx12(AntdTable, {
1366
1407
  ...props,
1367
1408
  rowKey: props.rowKey || "id",
1368
1409
  columns: currentColumns,
1369
1410
  dataSource: data
1370
1411
  });
1371
- return /* @__PURE__ */ jsx10(AntdTable, {
1412
+ return /* @__PURE__ */ jsx12(AntdTable, {
1372
1413
  ...props,
1373
1414
  rowKey: props.rowKey || "id",
1374
1415
  columns: currentColumns,
@@ -1400,7 +1441,7 @@ function FaasDataTable({
1400
1441
 
1401
1442
  // src/Title.tsx
1402
1443
  import { useEffect as useEffect6, cloneElement as cloneElement3 } from "react";
1403
- import { Fragment as Fragment3, jsx as jsx11 } from "react/jsx-runtime";
1444
+ import { Fragment as Fragment3, jsx as jsx13 } from "react/jsx-runtime";
1404
1445
  function Title(props) {
1405
1446
  const { Title: Title2 } = useConfigContext();
1406
1447
  useEffect6(() => {
@@ -1409,17 +1450,17 @@ function Title(props) {
1409
1450
  }, [props]);
1410
1451
  if (props.h1) {
1411
1452
  if (typeof props.h1 === "boolean")
1412
- return /* @__PURE__ */ jsx11("h1", {
1453
+ return /* @__PURE__ */ jsx13("h1", {
1413
1454
  children: Array.isArray(props.title) ? props.title[0] : props.title
1414
1455
  });
1415
- return /* @__PURE__ */ jsx11("h1", {
1456
+ return /* @__PURE__ */ jsx13("h1", {
1416
1457
  className: props.h1.className,
1417
1458
  style: props.h1.style,
1418
1459
  children: Array.isArray(props.title) ? props.title[0] : props.title
1419
1460
  });
1420
1461
  }
1421
1462
  if (props.plain)
1422
- return /* @__PURE__ */ jsx11(Fragment3, {
1463
+ return /* @__PURE__ */ jsx13(Fragment3, {
1423
1464
  children: Array.isArray(props.title) ? props.title[0] : props.title
1424
1465
  });
1425
1466
  if (props.children)
@@ -1432,9 +1473,13 @@ export {
1432
1473
  ConfigProvider,
1433
1474
  Description,
1434
1475
  Drawer,
1476
+ FaasDataInjection,
1477
+ FaasDataWrapper,
1478
+ FaasDataWrapperProps,
1435
1479
  Form,
1436
1480
  FormItem,
1437
1481
  Link,
1482
+ Loading,
1438
1483
  Modal,
1439
1484
  PageNotFound,
1440
1485
  Routes,