@faasjs/ant-design 0.0.3-beta.24 → 0.0.3-beta.26

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
  ]
@@ -703,9 +741,10 @@ function FormItem(props) {
703
741
  return null;
704
742
  }
705
743
  }
744
+ FormItem.useStatus = AntdForm.Item.useStatus;
706
745
 
707
746
  // src/Form.tsx
708
- import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
747
+ import { jsx as jsx8, jsxs as jsxs2 } from "react/jsx-runtime";
709
748
  function Form(props) {
710
749
  var _a, _b;
711
750
  const [loading, setLoading] = useState5(false);
@@ -796,12 +835,12 @@ function Form(props) {
796
835
  onValuesChange,
797
836
  children: [
798
837
  computedProps.beforeItems,
799
- (_a = computedProps.items) == null ? void 0 : _a.map((item) => isValidElement(item) ? item : /* @__PURE__ */ jsx6(FormItem, {
838
+ (_a = computedProps.items) == null ? void 0 : _a.map((item) => isValidElement(item) ? item : /* @__PURE__ */ jsx8(FormItem, {
800
839
  ...item,
801
840
  extendTypes
802
841
  }, item.id)),
803
842
  computedProps.children,
804
- computedProps.submit !== false && /* @__PURE__ */ jsx6(Button2, {
843
+ computedProps.submit !== false && /* @__PURE__ */ jsx8(Button2, {
805
844
  htmlType: "submit",
806
845
  type: "primary",
807
846
  loading,
@@ -812,11 +851,13 @@ function Form(props) {
812
851
  });
813
852
  }
814
853
  Form.useForm = AntdForm2.useForm;
854
+ Form.useFormInstance = AntdForm2.useFormInstance;
855
+ Form.useWatch = AntdForm2.useWatch;
815
856
 
816
857
  // src/Link.tsx
817
858
  import { Link as RouterLink } from "react-router-dom";
818
859
  import { Button as Button3 } from "antd";
819
- import { jsx as jsx7 } from "react/jsx-runtime";
860
+ import { jsx as jsx9 } from "react/jsx-runtime";
820
861
  function Link({
821
862
  href,
822
863
  target,
@@ -829,7 +870,7 @@ function Link({
829
870
  style = Object.assign({ cursor: "pointer" }, style);
830
871
  if (href.startsWith("http")) {
831
872
  if (button)
832
- return /* @__PURE__ */ jsx7(Button3, {
873
+ return /* @__PURE__ */ jsx9(Button3, {
833
874
  ...button,
834
875
  target: target || (Link2 == null ? void 0 : Link2.target) || "_blank",
835
876
  style: {
@@ -839,7 +880,7 @@ function Link({
839
880
  href,
840
881
  children: text != null ? text : children
841
882
  });
842
- return /* @__PURE__ */ jsx7("a", {
883
+ return /* @__PURE__ */ jsx9("a", {
843
884
  href,
844
885
  target: target || (Link2 == null ? void 0 : Link2.target) || "_blank",
845
886
  style: {
@@ -850,10 +891,10 @@ function Link({
850
891
  });
851
892
  }
852
893
  if (button)
853
- return /* @__PURE__ */ jsx7(RouterLink, {
894
+ return /* @__PURE__ */ jsx9(RouterLink, {
854
895
  to: href,
855
896
  target: target || (Link2 == null ? void 0 : Link2.target),
856
- children: /* @__PURE__ */ jsx7(Button3, {
897
+ children: /* @__PURE__ */ jsx9(Button3, {
857
898
  ...button,
858
899
  style: {
859
900
  ...Link2.style,
@@ -862,7 +903,7 @@ function Link({
862
903
  children: text != null ? text : children
863
904
  })
864
905
  });
865
- return /* @__PURE__ */ jsx7(RouterLink, {
906
+ return /* @__PURE__ */ jsx9(RouterLink, {
866
907
  to: href,
867
908
  target: target || (Link2 == null ? void 0 : Link2.target),
868
909
  style: {
@@ -876,7 +917,7 @@ function Link({
876
917
  // src/Modal.tsx
877
918
  import { Modal } from "antd";
878
919
  import { useState as useState6 } from "react";
879
- import { jsx as jsx8 } from "react/jsx-runtime";
920
+ import { jsx as jsx10 } from "react/jsx-runtime";
880
921
  function useModal(init) {
881
922
  const [props, setProps] = useState6({
882
923
  open: false,
@@ -887,7 +928,7 @@ function useModal(init) {
887
928
  ...init
888
929
  });
889
930
  return {
890
- modal: /* @__PURE__ */ jsx8(Modal, {
931
+ modal: /* @__PURE__ */ jsx10(Modal, {
891
932
  ...props
892
933
  }),
893
934
  modalProps: props,
@@ -901,7 +942,11 @@ function useModal(init) {
901
942
  }
902
943
 
903
944
  // src/Routers.tsx
904
- import { Result, Skeleton as Skeleton2 } from "antd";
945
+ import {
946
+ Result,
947
+ Skeleton as Skeleton2,
948
+ Alert as Alert2
949
+ } from "antd";
905
950
  import {
906
951
  Suspense
907
952
  } from "react";
@@ -909,34 +954,36 @@ import {
909
954
  Routes as OriginRoutes,
910
955
  Route
911
956
  } from "react-router-dom";
912
- import { jsx as jsx9, jsxs as jsxs3 } from "react/jsx-runtime";
957
+ import { jsx as jsx11, jsxs as jsxs3 } from "react/jsx-runtime";
913
958
  function PageNotFound() {
914
959
  const config = useConfigContext();
915
- return /* @__PURE__ */ jsx9(Result, {
960
+ return /* @__PURE__ */ jsx11(Result, {
916
961
  status: "404",
917
962
  title: config.common.pageNotFound
918
963
  });
919
964
  }
920
965
  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
- ]
966
+ return /* @__PURE__ */ jsx11(Alert2.ErrorBoundary, {
967
+ children: /* @__PURE__ */ jsxs3(OriginRoutes, {
968
+ children: [
969
+ props.routes.map((r) => /* @__PURE__ */ jsx11(Route, {
970
+ ...r,
971
+ element: r.element || /* @__PURE__ */ jsx11(Suspense, {
972
+ fallback: props.fallback || /* @__PURE__ */ jsx11("div", {
973
+ style: { padding: "24px" },
974
+ children: /* @__PURE__ */ jsx11(Skeleton2, {
975
+ active: true
976
+ })
977
+ }),
978
+ children: /* @__PURE__ */ jsx11(r.page, {})
979
+ })
980
+ }, r.path)),
981
+ /* @__PURE__ */ jsx11(Route, {
982
+ path: "*",
983
+ element: props.notFound || /* @__PURE__ */ jsx11(PageNotFound, {})
984
+ }, "*")
985
+ ]
986
+ })
940
987
  });
941
988
  }
942
989
 
@@ -959,15 +1006,12 @@ import {
959
1006
  uniqBy,
960
1007
  upperFirst as upperFirst4
961
1008
  } 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";
1009
+ import { jsx as jsx12, jsxs as jsxs4 } from "react/jsx-runtime";
966
1010
  function processValue(item, value) {
967
1011
  var _a;
968
1012
  const transferred = transferValue(item.type, value);
969
1013
  if (transferred === null || Array.isArray(transferred) && transferred.length === 0)
970
- return /* @__PURE__ */ jsx10(Blank, {});
1014
+ return /* @__PURE__ */ jsx12(Blank, {});
971
1015
  if (item.options) {
972
1016
  if (item.type.endsWith("[]"))
973
1017
  return transferred.map((v) => {
@@ -1007,7 +1051,7 @@ function Table(props) {
1007
1051
  text: o.label,
1008
1052
  value: o.value
1009
1053
  })).concat({
1010
- text: /* @__PURE__ */ jsx10(Blank, {}),
1054
+ text: /* @__PURE__ */ jsx12(Blank, {}),
1011
1055
  value: null
1012
1056
  });
1013
1057
  }
@@ -1051,7 +1095,7 @@ function Table(props) {
1051
1095
  setSelectedKeys,
1052
1096
  confirm,
1053
1097
  clearFilters
1054
- }) => /* @__PURE__ */ jsx10(Input2.Search, {
1098
+ }) => /* @__PURE__ */ jsx12(Input2.Search, {
1055
1099
  placeholder: `${common2.search} ${item.title}`,
1056
1100
  allowClear: true,
1057
1101
  onSearch: (v) => {
@@ -1081,7 +1125,7 @@ function Table(props) {
1081
1125
  setSelectedKeys,
1082
1126
  confirm,
1083
1127
  clearFilters
1084
- }) => /* @__PURE__ */ jsx10(Input2.Search, {
1128
+ }) => /* @__PURE__ */ jsx12(Input2.Search, {
1085
1129
  placeholder: `${common2.search} ${item.title}`,
1086
1130
  allowClear: true,
1087
1131
  onSearch: (v) => {
@@ -1111,7 +1155,7 @@ function Table(props) {
1111
1155
  setSelectedKeys,
1112
1156
  confirm,
1113
1157
  clearFilters
1114
- }) => /* @__PURE__ */ jsx10(Input2.Search, {
1158
+ }) => /* @__PURE__ */ jsx12(Input2.Search, {
1115
1159
  placeholder: `${common2.search} ${item.title}`,
1116
1160
  allowClear: true,
1117
1161
  onSearch: (v) => {
@@ -1141,7 +1185,7 @@ function Table(props) {
1141
1185
  setSelectedKeys,
1142
1186
  confirm,
1143
1187
  clearFilters
1144
- }) => /* @__PURE__ */ jsx10(Input2.Search, {
1188
+ }) => /* @__PURE__ */ jsx12(Input2.Search, {
1145
1189
  placeholder: `${common2.search} ${item.title}`,
1146
1190
  allowClear: true,
1147
1191
  onSearch: (v) => {
@@ -1157,12 +1201,12 @@ function Table(props) {
1157
1201
  break;
1158
1202
  case "boolean":
1159
1203
  if (!item.render)
1160
- item.render = (value) => typeof value === "undefined" ? /* @__PURE__ */ jsx10(Blank, {}) : value ? /* @__PURE__ */ jsx10(CheckOutlined2, {
1204
+ item.render = (value) => typeof value === "undefined" ? /* @__PURE__ */ jsx12(Blank, {}) : value ? /* @__PURE__ */ jsx12(CheckOutlined2, {
1161
1205
  style: {
1162
1206
  marginTop: "4px",
1163
1207
  color: "#52c41a"
1164
1208
  }
1165
- }) : /* @__PURE__ */ jsx10(CloseOutlined2, {
1209
+ }) : /* @__PURE__ */ jsx12(CloseOutlined2, {
1166
1210
  style: {
1167
1211
  marginTop: "4px",
1168
1212
  color: "#ff4d4f"
@@ -1182,28 +1226,28 @@ function Table(props) {
1182
1226
  confirm();
1183
1227
  },
1184
1228
  children: [
1185
- /* @__PURE__ */ jsx10(Radio.Button, {
1229
+ /* @__PURE__ */ jsx12(Radio.Button, {
1186
1230
  children: common2.all
1187
1231
  }),
1188
- /* @__PURE__ */ jsx10(Radio.Button, {
1232
+ /* @__PURE__ */ jsx12(Radio.Button, {
1189
1233
  value: "true",
1190
- children: /* @__PURE__ */ jsx10(CheckOutlined2, {
1234
+ children: /* @__PURE__ */ jsx12(CheckOutlined2, {
1191
1235
  style: {
1192
1236
  color: "#52c41a",
1193
1237
  verticalAlign: "middle"
1194
1238
  }
1195
1239
  })
1196
1240
  }),
1197
- /* @__PURE__ */ jsx10(Radio.Button, {
1241
+ /* @__PURE__ */ jsx12(Radio.Button, {
1198
1242
  value: "false",
1199
- children: /* @__PURE__ */ jsx10(CloseOutlined2, {
1243
+ children: /* @__PURE__ */ jsx12(CloseOutlined2, {
1200
1244
  style: {
1201
1245
  verticalAlign: "middle",
1202
1246
  color: "#ff4d4f"
1203
1247
  }
1204
1248
  })
1205
1249
  }),
1206
- /* @__PURE__ */ jsx10(Radio.Button, {
1250
+ /* @__PURE__ */ jsx12(Radio.Button, {
1207
1251
  value: "empty",
1208
1252
  children: common2.blank
1209
1253
  })
@@ -1241,7 +1285,7 @@ function Table(props) {
1241
1285
  break;
1242
1286
  case "object":
1243
1287
  if (!item.render)
1244
- item.render = (value) => /* @__PURE__ */ jsx10(Description, {
1288
+ item.render = (value) => /* @__PURE__ */ jsx12(Description, {
1245
1289
  items: item.object,
1246
1290
  dataSource: value || {},
1247
1291
  column: 1
@@ -1249,7 +1293,7 @@ function Table(props) {
1249
1293
  break;
1250
1294
  case "object[]":
1251
1295
  if (!item.render)
1252
- item.render = (value) => value.map((v, i) => /* @__PURE__ */ jsx10(Description, {
1296
+ item.render = (value) => value.map((v, i) => /* @__PURE__ */ jsx12(Description, {
1253
1297
  items: item.object,
1254
1298
  dataSource: v || [],
1255
1299
  column: 1
@@ -1283,7 +1327,7 @@ function Table(props) {
1283
1327
  const newColumns = [...prev];
1284
1328
  const index = newColumns.findIndex((item) => item.id === column.id);
1285
1329
  newColumns[index].filters = filters.concat({
1286
- text: /* @__PURE__ */ jsx10(Blank, {}),
1330
+ text: /* @__PURE__ */ jsx12(Blank, {}),
1287
1331
  value: null
1288
1332
  });
1289
1333
  return newColumns;
@@ -1294,18 +1338,18 @@ function Table(props) {
1294
1338
  if (!columns)
1295
1339
  return null;
1296
1340
  if (!props.faasData)
1297
- return /* @__PURE__ */ jsx10(AntdTable, {
1341
+ return /* @__PURE__ */ jsx12(AntdTable, {
1298
1342
  ...props,
1299
1343
  rowKey: props.rowKey || "id",
1300
1344
  columns,
1301
1345
  dataSource: props.dataSource
1302
1346
  });
1303
- return /* @__PURE__ */ jsx10(FaasDataWrapper2, {
1304
- fallback: props.faasData.fallback || /* @__PURE__ */ jsx10(Skeleton3, {
1347
+ return /* @__PURE__ */ jsx12(FaasDataWrapper, {
1348
+ fallback: props.faasData.fallback || /* @__PURE__ */ jsx12(Skeleton3, {
1305
1349
  active: true
1306
1350
  }),
1307
1351
  ...props.faasData,
1308
- children: /* @__PURE__ */ jsx10(FaasDataTable, {
1352
+ children: /* @__PURE__ */ jsx12(FaasDataTable, {
1309
1353
  props,
1310
1354
  columns
1311
1355
  })
@@ -1331,7 +1375,7 @@ function FaasDataTable({
1331
1375
  text: v.label,
1332
1376
  value: v.value
1333
1377
  })).concat({
1334
- text: /* @__PURE__ */ jsx10(Blank, {}),
1378
+ text: /* @__PURE__ */ jsx12(Blank, {}),
1335
1379
  value: null
1336
1380
  });
1337
1381
  column.render = (value) => processValue(column, value);
@@ -1346,7 +1390,7 @@ function FaasDataTable({
1346
1390
  }));
1347
1391
  if (filters.length)
1348
1392
  column.filters = filters.concat({
1349
- text: /* @__PURE__ */ jsx10(Blank, {}),
1393
+ text: /* @__PURE__ */ jsx12(Blank, {}),
1350
1394
  value: null
1351
1395
  });
1352
1396
  }
@@ -1355,20 +1399,20 @@ function FaasDataTable({
1355
1399
  });
1356
1400
  }, [columns, data]);
1357
1401
  if (!data)
1358
- return /* @__PURE__ */ jsx10(AntdTable, {
1402
+ return /* @__PURE__ */ jsx12(AntdTable, {
1359
1403
  ...props,
1360
1404
  rowKey: props.rowKey || "id",
1361
1405
  columns: currentColumns,
1362
1406
  dataSource: []
1363
1407
  });
1364
1408
  if (Array.isArray(data))
1365
- return /* @__PURE__ */ jsx10(AntdTable, {
1409
+ return /* @__PURE__ */ jsx12(AntdTable, {
1366
1410
  ...props,
1367
1411
  rowKey: props.rowKey || "id",
1368
1412
  columns: currentColumns,
1369
1413
  dataSource: data
1370
1414
  });
1371
- return /* @__PURE__ */ jsx10(AntdTable, {
1415
+ return /* @__PURE__ */ jsx12(AntdTable, {
1372
1416
  ...props,
1373
1417
  rowKey: props.rowKey || "id",
1374
1418
  columns: currentColumns,
@@ -1400,7 +1444,7 @@ function FaasDataTable({
1400
1444
 
1401
1445
  // src/Title.tsx
1402
1446
  import { useEffect as useEffect6, cloneElement as cloneElement3 } from "react";
1403
- import { Fragment as Fragment3, jsx as jsx11 } from "react/jsx-runtime";
1447
+ import { Fragment as Fragment3, jsx as jsx13 } from "react/jsx-runtime";
1404
1448
  function Title(props) {
1405
1449
  const { Title: Title2 } = useConfigContext();
1406
1450
  useEffect6(() => {
@@ -1409,17 +1453,17 @@ function Title(props) {
1409
1453
  }, [props]);
1410
1454
  if (props.h1) {
1411
1455
  if (typeof props.h1 === "boolean")
1412
- return /* @__PURE__ */ jsx11("h1", {
1456
+ return /* @__PURE__ */ jsx13("h1", {
1413
1457
  children: Array.isArray(props.title) ? props.title[0] : props.title
1414
1458
  });
1415
- return /* @__PURE__ */ jsx11("h1", {
1459
+ return /* @__PURE__ */ jsx13("h1", {
1416
1460
  className: props.h1.className,
1417
1461
  style: props.h1.style,
1418
1462
  children: Array.isArray(props.title) ? props.title[0] : props.title
1419
1463
  });
1420
1464
  }
1421
1465
  if (props.plain)
1422
- return /* @__PURE__ */ jsx11(Fragment3, {
1466
+ return /* @__PURE__ */ jsx13(Fragment3, {
1423
1467
  children: Array.isArray(props.title) ? props.title[0] : props.title
1424
1468
  });
1425
1469
  if (props.children)
@@ -1432,9 +1476,13 @@ export {
1432
1476
  ConfigProvider,
1433
1477
  Description,
1434
1478
  Drawer,
1479
+ FaasDataInjection,
1480
+ FaasDataWrapper,
1481
+ FaasDataWrapperProps,
1435
1482
  Form,
1436
1483
  FormItem,
1437
1484
  Link,
1485
+ Loading,
1438
1486
  Modal,
1439
1487
  PageNotFound,
1440
1488
  Routes,