@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.js CHANGED
@@ -30,11 +30,15 @@ __export(src_exports, {
30
30
  ConfigContext: () => ConfigContext,
31
31
  ConfigProvider: () => ConfigProvider,
32
32
  Description: () => Description,
33
- Drawer: () => import_antd3.Drawer,
33
+ Drawer: () => import_antd5.Drawer,
34
+ FaasDataInjection: () => import_react3.FaasDataInjection,
35
+ FaasDataWrapper: () => FaasDataWrapper,
36
+ FaasDataWrapperProps: () => import_react3.FaasDataWrapperProps,
34
37
  Form: () => Form,
35
38
  FormItem: () => FormItem,
36
39
  Link: () => Link,
37
- Modal: () => import_antd7.Modal,
40
+ Loading: () => Loading,
41
+ Modal: () => import_antd9.Modal,
38
42
  PageNotFound: () => PageNotFound,
39
43
  Routes: () => Routes,
40
44
  Table: () => Table,
@@ -161,15 +165,49 @@ function transferValue(type, value) {
161
165
 
162
166
  // src/Description.tsx
163
167
  var import_icons = require("@ant-design/icons");
164
- var import_antd2 = require("antd");
168
+ var import_antd4 = require("antd");
165
169
  var import_lodash_es4 = require("lodash-es");
166
- var import_react3 = require("react");
167
- var import_react4 = require("@faasjs/react");
170
+ var import_react4 = require("react");
171
+
172
+ // src/FaasDataWrapper.tsx
173
+ var import_react3 = require("@faasjs/react");
174
+
175
+ // src/Loading.tsx
176
+ var import_antd2 = require("antd");
177
+ var import_jsx_runtime = require("react/jsx-runtime");
178
+ function Loading(props) {
179
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
180
+ style: {
181
+ ...props.style || {},
182
+ ...!props.size || props.size === "large" ? {
183
+ margin: "20vh auto",
184
+ textAlign: "center"
185
+ } : {}
186
+ },
187
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd2.Spin, {
188
+ size: props.size || "large"
189
+ })
190
+ });
191
+ }
192
+
193
+ // src/FaasDataWrapper.tsx
194
+ var import_antd3 = require("antd");
195
+ var import_jsx_runtime = require("react/jsx-runtime");
196
+ function FaasDataWrapper(props) {
197
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd3.Alert.ErrorBoundary, {
198
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react3.FaasDataWrapper, {
199
+ fallback: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Loading, {}),
200
+ ...props
201
+ })
202
+ });
203
+ }
204
+
205
+ // src/Description.tsx
168
206
  var import_jsx_runtime = require("react/jsx-runtime");
169
207
  function DescriptionItemContent(props) {
170
208
  var _a;
171
- const [computedProps, setComputedProps] = (0, import_react3.useState)();
172
- (0, import_react3.useEffect)(() => {
209
+ const [computedProps, setComputedProps] = (0, import_react4.useState)();
210
+ (0, import_react4.useEffect)(() => {
173
211
  var _a2, _b;
174
212
  const propsCopy = { ...props };
175
213
  if (!propsCopy.item.title)
@@ -199,7 +237,7 @@ function DescriptionItemContent(props) {
199
237
  return null;
200
238
  if (computedProps.extendTypes && computedProps.extendTypes[computedProps.item.type])
201
239
  if (computedProps.extendTypes[computedProps.item.type].children)
202
- return (0, import_react3.cloneElement)(
240
+ return (0, import_react4.cloneElement)(
203
241
  computedProps.extendTypes[computedProps.item.type].children,
204
242
  {
205
243
  value: computedProps.value,
@@ -213,7 +251,7 @@ function DescriptionItemContent(props) {
213
251
  else
214
252
  throw Error(computedProps.item.type + " requires children or render");
215
253
  if (computedProps.item.children)
216
- return (0, import_react3.cloneElement)(computedProps.item.children, {
254
+ return (0, import_react4.cloneElement)(computedProps.item.children, {
217
255
  value: computedProps.value,
218
256
  values: computedProps.values
219
257
  });
@@ -265,7 +303,7 @@ function DescriptionItemContent(props) {
265
303
  case "object[]":
266
304
  if (!((_a = computedProps.value) == null ? void 0 : _a.length))
267
305
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Blank, {});
268
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd2.Space, {
306
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Space, {
269
307
  direction: "vertical",
270
308
  children: computedProps.value.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Description, {
271
309
  items: computedProps.item.object,
@@ -279,11 +317,11 @@ function DescriptionItemContent(props) {
279
317
  }
280
318
  function Description(props) {
281
319
  if (!props.faasData)
282
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd2.Descriptions, {
320
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Descriptions, {
283
321
  ...props,
284
322
  title: (0, import_lodash_es4.isFunction)(props.renderTitle) ? props.renderTitle(props.dataSource) : props.title,
285
323
  children: props.items.map((item) => {
286
- return !item.if || item.if(props.dataSource) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd2.Descriptions.Item, {
324
+ return !item.if || item.if(props.dataSource) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Descriptions.Item, {
287
325
  label: item.title || (0, import_lodash_es4.upperFirst)(item.id),
288
326
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DescriptionItemContent, {
289
327
  item,
@@ -294,16 +332,16 @@ function Description(props) {
294
332
  }, item.id) : null;
295
333
  }).filter(Boolean)
296
334
  });
297
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react4.FaasDataWrapper, {
298
- fallback: props.faasData.fallback || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd2.Skeleton, {
335
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FaasDataWrapper, {
336
+ fallback: props.faasData.fallback || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Skeleton, {
299
337
  active: true
300
338
  }),
301
339
  render: ({ data }) => {
302
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd2.Descriptions, {
340
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Descriptions, {
303
341
  ...props,
304
342
  title: (0, import_lodash_es4.isFunction)(props.renderTitle) ? props.renderTitle(data) : props.title,
305
343
  children: props.items.map((item) => {
306
- return !item.if || item.if(data) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd2.Descriptions.Item, {
344
+ return !item.if || item.if(data) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Descriptions.Item, {
307
345
  label: item.title || (0, import_lodash_es4.upperFirst)(item.id),
308
346
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DescriptionItemContent, {
309
347
  item,
@@ -320,7 +358,7 @@ function Description(props) {
320
358
  }
321
359
 
322
360
  // src/Drawer.tsx
323
- var import_antd3 = require("antd");
361
+ var import_antd5 = require("antd");
324
362
  var import_react5 = require("react");
325
363
  var import_jsx_runtime = require("react/jsx-runtime");
326
364
  function useDrawer(init) {
@@ -333,7 +371,7 @@ function useDrawer(init) {
333
371
  ...init
334
372
  });
335
373
  return {
336
- drawer: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd3.Drawer, {
374
+ drawer: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Drawer, {
337
375
  ...props
338
376
  }),
339
377
  drawerProps: props,
@@ -348,11 +386,11 @@ function useDrawer(init) {
348
386
 
349
387
  // src/Form.tsx
350
388
  var import_react7 = require("@faasjs/react");
351
- var import_antd5 = require("antd");
389
+ var import_antd7 = require("antd");
352
390
  var import_react8 = require("react");
353
391
 
354
392
  // src/FormItem.tsx
355
- var import_antd4 = require("antd");
393
+ var import_antd6 = require("antd");
356
394
  var import_icons2 = require("@ant-design/icons");
357
395
  var import_react6 = require("react");
358
396
  var import_lodash_es5 = require("lodash-es");
@@ -433,49 +471,49 @@ function FormItem(props) {
433
471
  if (!computedProps)
434
472
  return null;
435
473
  if (hidden)
436
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
474
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.Item, {
437
475
  ...computedProps,
438
476
  noStyle: true,
439
477
  rules: [],
440
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Input, {
478
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Input, {
441
479
  hidden: true
442
480
  })
443
481
  });
444
482
  if (extendTypes && extendTypes[computedProps.type])
445
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
483
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.Item, {
446
484
  ...computedProps,
447
485
  children: extendTypes[computedProps.type].children
448
486
  });
449
487
  if (computedProps.children)
450
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
488
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.Item, {
451
489
  ...computedProps,
452
490
  children: computedProps.children
453
491
  });
454
492
  if (computedProps.render)
455
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
493
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.Item, {
456
494
  ...computedProps,
457
495
  children: computedProps.render()
458
496
  });
459
497
  switch (computedProps.type) {
460
498
  case "string":
461
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
499
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.Item, {
462
500
  ...computedProps,
463
- children: computedProps.options ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Select, {
501
+ children: computedProps.options ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Select, {
464
502
  ...computedProps.input
465
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Input, {
503
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Input, {
466
504
  ...computedProps.input
467
505
  })
468
506
  });
469
507
  case "string[]":
470
508
  if (computedProps.options)
471
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
509
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.Item, {
472
510
  ...computedProps,
473
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Select, {
511
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Select, {
474
512
  mode: "multiple",
475
513
  ...computedProps.input
476
514
  })
477
515
  });
478
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.List, {
516
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.List, {
479
517
  name: computedProps.name,
480
518
  rules: computedProps.rules,
481
519
  children: (fields, { add, remove }, { errors }) => {
@@ -491,24 +529,24 @@ function FormItem(props) {
491
529
  }),
492
530
  fields.map((field) => {
493
531
  var _a3;
494
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
495
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd4.Row, {
532
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.Item, {
533
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd6.Row, {
496
534
  gutter: 24,
497
535
  style: { flexFlow: "row nowrap" },
498
536
  children: [
499
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Col, {
537
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Col, {
500
538
  span: 23,
501
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
539
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.Item, {
502
540
  ...field,
503
541
  noStyle: true,
504
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Input, {
542
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Input, {
505
543
  ...computedProps.input
506
544
  })
507
545
  })
508
546
  }),
509
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Col, {
547
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Col, {
510
548
  span: 1,
511
- children: !((_a3 = computedProps.input) == null ? void 0 : _a3.disabled) && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Button, {
549
+ children: !((_a3 = computedProps.input) == null ? void 0 : _a3.disabled) && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Button, {
512
550
  danger: true,
513
551
  type: "link",
514
552
  style: { float: "right" },
@@ -520,15 +558,15 @@ function FormItem(props) {
520
558
  })
521
559
  }, field.key);
522
560
  }),
523
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd4.Form.Item, {
561
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd6.Form.Item, {
524
562
  children: [
525
- !((_a2 = computedProps.input) == null ? void 0 : _a2.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Button, {
563
+ !((_a2 = computedProps.input) == null ? void 0 : _a2.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Button, {
526
564
  type: "dashed",
527
565
  block: true,
528
566
  onClick: () => add(),
529
567
  icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons2.PlusOutlined, {})
530
568
  }),
531
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.ErrorList, {
569
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.ErrorList, {
532
570
  errors
533
571
  })
534
572
  ]
@@ -538,25 +576,25 @@ function FormItem(props) {
538
576
  }
539
577
  });
540
578
  case "number":
541
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
579
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.Item, {
542
580
  ...computedProps,
543
- children: computedProps.options ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Select, {
581
+ children: computedProps.options ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Select, {
544
582
  ...computedProps.input
545
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.InputNumber, {
583
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.InputNumber, {
546
584
  style: { width: "100%" },
547
585
  ...computedProps.input
548
586
  })
549
587
  });
550
588
  case "number[]":
551
589
  if (computedProps.options)
552
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
590
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.Item, {
553
591
  ...computedProps,
554
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Select, {
592
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Select, {
555
593
  mode: "multiple",
556
594
  ...computedProps.input
557
595
  })
558
596
  });
559
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.List, {
597
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.List, {
560
598
  name: computedProps.name,
561
599
  rules: computedProps.rules,
562
600
  children: (fields, { add, remove }, { errors }) => {
@@ -572,25 +610,25 @@ function FormItem(props) {
572
610
  }),
573
611
  fields.map((field) => {
574
612
  var _a3;
575
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
576
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd4.Row, {
613
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.Item, {
614
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd6.Row, {
577
615
  gutter: 24,
578
616
  style: { flexFlow: "row nowrap" },
579
617
  children: [
580
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Col, {
618
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Col, {
581
619
  span: 23,
582
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
620
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.Item, {
583
621
  ...field,
584
622
  noStyle: true,
585
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.InputNumber, {
623
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.InputNumber, {
586
624
  style: { width: "100%" },
587
625
  ...computedProps.input
588
626
  })
589
627
  })
590
628
  }),
591
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Col, {
629
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Col, {
592
630
  span: 1,
593
- children: !((_a3 = computedProps.input) == null ? void 0 : _a3.disabled) && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Button, {
631
+ children: !((_a3 = computedProps.input) == null ? void 0 : _a3.disabled) && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Button, {
594
632
  danger: true,
595
633
  type: "link",
596
634
  style: { float: "right" },
@@ -602,15 +640,15 @@ function FormItem(props) {
602
640
  })
603
641
  }, field.key);
604
642
  }),
605
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd4.Form.Item, {
643
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd6.Form.Item, {
606
644
  children: [
607
- !((_b = computedProps.input) == null ? void 0 : _b.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Button, {
645
+ !((_b = computedProps.input) == null ? void 0 : _b.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Button, {
608
646
  type: "dashed",
609
647
  block: true,
610
648
  onClick: () => add(),
611
649
  icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons2.PlusOutlined, {})
612
650
  }),
613
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.ErrorList, {
651
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.ErrorList, {
614
652
  errors
615
653
  })
616
654
  ]
@@ -620,23 +658,23 @@ function FormItem(props) {
620
658
  }
621
659
  });
622
660
  case "boolean":
623
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
661
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.Item, {
624
662
  ...computedProps,
625
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Switch, {
663
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Switch, {
626
664
  ...computedProps.input
627
665
  })
628
666
  });
629
667
  case "date":
630
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
668
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.Item, {
631
669
  ...computedProps,
632
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.DatePicker, {
670
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.DatePicker, {
633
671
  ...computedProps.input
634
672
  })
635
673
  });
636
674
  case "time":
637
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
675
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.Item, {
638
676
  ...computedProps,
639
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.TimePicker, {
677
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.TimePicker, {
640
678
  ...computedProps.input
641
679
  })
642
680
  });
@@ -656,12 +694,12 @@ function FormItem(props) {
656
694
  ]
657
695
  });
658
696
  case "object[]":
659
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.List, {
697
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.List, {
660
698
  name: computedProps.name,
661
699
  rules: computedProps.rules,
662
700
  children: (fields, { add, remove }, { errors }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
663
701
  children: [
664
- fields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd4.Form.Item, {
702
+ fields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd6.Form.Item, {
665
703
  style: { marginBottom: 0 },
666
704
  children: [
667
705
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
@@ -671,7 +709,7 @@ function FormItem(props) {
671
709
  computedProps.label,
672
710
  " ",
673
711
  field.name + 1,
674
- !computedProps.disabled && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Button, {
712
+ !computedProps.disabled && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Button, {
675
713
  danger: true,
676
714
  type: "link",
677
715
  onClick: () => remove(field.name),
@@ -680,9 +718,9 @@ function FormItem(props) {
680
718
  ]
681
719
  })
682
720
  }),
683
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Row, {
721
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Row, {
684
722
  gutter: 24,
685
- children: computedProps.object.map((o) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Col, {
723
+ children: computedProps.object.map((o) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Col, {
686
724
  span: o.col || 24,
687
725
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormItem, {
688
726
  ...o,
@@ -692,9 +730,9 @@ function FormItem(props) {
692
730
  })
693
731
  ]
694
732
  }, field.key)),
695
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd4.Form.Item, {
733
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd6.Form.Item, {
696
734
  children: [
697
- !computedProps.disabled && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd4.Button, {
735
+ !computedProps.disabled && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd6.Button, {
698
736
  type: "dashed",
699
737
  block: true,
700
738
  onClick: () => add(),
@@ -705,7 +743,7 @@ function FormItem(props) {
705
743
  computedProps.label
706
744
  ]
707
745
  }),
708
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.ErrorList, {
746
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.ErrorList, {
709
747
  errors
710
748
  })
711
749
  ]
@@ -726,7 +764,7 @@ function Form(props) {
726
764
  const [computedProps, setComputedProps] = (0, import_react8.useState)();
727
765
  const config = useConfigContext();
728
766
  const [extendTypes, setExtendTypes] = (0, import_react8.useState)();
729
- const [form] = import_antd5.Form.useForm(props.form);
767
+ const [form] = import_antd7.Form.useForm(props.form);
730
768
  const [initialValues, setInitialValues] = (0, import_react8.useState)(props.initialValues);
731
769
  (0, import_react8.useEffect)(() => {
732
770
  var _a2, _b2;
@@ -805,7 +843,7 @@ function Form(props) {
805
843
  }, [computedProps]);
806
844
  if (!computedProps)
807
845
  return null;
808
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd5.Form, {
846
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd7.Form, {
809
847
  ...computedProps,
810
848
  onValuesChange,
811
849
  children: [
@@ -815,7 +853,7 @@ function Form(props) {
815
853
  extendTypes
816
854
  }, item.id)),
817
855
  computedProps.children,
818
- computedProps.submit !== false && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Button, {
856
+ computedProps.submit !== false && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd7.Button, {
819
857
  htmlType: "submit",
820
858
  type: "primary",
821
859
  loading,
@@ -825,11 +863,11 @@ function Form(props) {
825
863
  ]
826
864
  });
827
865
  }
828
- Form.useForm = import_antd5.Form.useForm;
866
+ Form.useForm = import_antd7.Form.useForm;
829
867
 
830
868
  // src/Link.tsx
831
869
  var import_react_router_dom = require("react-router-dom");
832
- var import_antd6 = require("antd");
870
+ var import_antd8 = require("antd");
833
871
  var import_jsx_runtime = require("react/jsx-runtime");
834
872
  function Link({
835
873
  href,
@@ -843,7 +881,7 @@ function Link({
843
881
  style = Object.assign({ cursor: "pointer" }, style);
844
882
  if (href.startsWith("http")) {
845
883
  if (button)
846
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Button, {
884
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Button, {
847
885
  ...button,
848
886
  target: target || (Link2 == null ? void 0 : Link2.target) || "_blank",
849
887
  style: {
@@ -867,7 +905,7 @@ function Link({
867
905
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_router_dom.Link, {
868
906
  to: href,
869
907
  target: target || (Link2 == null ? void 0 : Link2.target),
870
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Button, {
908
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Button, {
871
909
  ...button,
872
910
  style: {
873
911
  ...Link2.style,
@@ -888,7 +926,7 @@ function Link({
888
926
  }
889
927
 
890
928
  // src/Modal.tsx
891
- var import_antd7 = require("antd");
929
+ var import_antd9 = require("antd");
892
930
  var import_react9 = require("react");
893
931
  var import_jsx_runtime = require("react/jsx-runtime");
894
932
  function useModal(init) {
@@ -901,7 +939,7 @@ function useModal(init) {
901
939
  ...init
902
940
  });
903
941
  return {
904
- modal: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd7.Modal, {
942
+ modal: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Modal, {
905
943
  ...props
906
944
  }),
907
945
  modalProps: props,
@@ -915,47 +953,48 @@ function useModal(init) {
915
953
  }
916
954
 
917
955
  // src/Routers.tsx
918
- var import_antd8 = require("antd");
956
+ var import_antd10 = require("antd");
919
957
  var import_react10 = require("react");
920
958
  var import_react_router_dom2 = require("react-router-dom");
921
959
  var import_jsx_runtime = require("react/jsx-runtime");
922
960
  function PageNotFound() {
923
961
  const config = useConfigContext();
924
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Result, {
962
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Result, {
925
963
  status: "404",
926
964
  title: config.common.pageNotFound
927
965
  });
928
966
  }
929
967
  function Routes(props) {
930
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_router_dom2.Routes, {
931
- children: [
932
- props.routes.map((r) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_router_dom2.Route, {
933
- ...r,
934
- element: r.element || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react10.Suspense, {
935
- fallback: props.fallback || /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
936
- style: { padding: "24px" },
937
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Skeleton, {
938
- active: true
939
- })
940
- }),
941
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(r.page, {})
942
- })
943
- }, r.path)),
944
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_router_dom2.Route, {
945
- path: "*",
946
- element: props.notFound || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PageNotFound, {})
947
- }, "*")
948
- ]
968
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Alert.ErrorBoundary, {
969
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_router_dom2.Routes, {
970
+ children: [
971
+ props.routes.map((r) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_router_dom2.Route, {
972
+ ...r,
973
+ element: r.element || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react10.Suspense, {
974
+ fallback: props.fallback || /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
975
+ style: { padding: "24px" },
976
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Skeleton, {
977
+ active: true
978
+ })
979
+ }),
980
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(r.page, {})
981
+ })
982
+ }, r.path)),
983
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_router_dom2.Route, {
984
+ path: "*",
985
+ element: props.notFound || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PageNotFound, {})
986
+ }, "*")
987
+ ]
988
+ })
949
989
  });
950
990
  }
951
991
 
952
992
  // src/Table.tsx
953
993
  var import_react11 = require("react");
954
- var import_antd9 = require("antd");
994
+ var import_antd11 = require("antd");
955
995
  var import_dayjs2 = __toESM(require("dayjs"));
956
996
  var import_icons3 = require("@ant-design/icons");
957
997
  var import_lodash_es6 = require("lodash-es");
958
- var import_react12 = require("@faasjs/react");
959
998
  var import_jsx_runtime = require("react/jsx-runtime");
960
999
  function processValue(item, value) {
961
1000
  var _a;
@@ -1045,7 +1084,7 @@ function Table(props) {
1045
1084
  setSelectedKeys,
1046
1085
  confirm,
1047
1086
  clearFilters
1048
- }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Input.Search, {
1087
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Input.Search, {
1049
1088
  placeholder: `${common2.search} ${item.title}`,
1050
1089
  allowClear: true,
1051
1090
  onSearch: (v) => {
@@ -1075,7 +1114,7 @@ function Table(props) {
1075
1114
  setSelectedKeys,
1076
1115
  confirm,
1077
1116
  clearFilters
1078
- }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Input.Search, {
1117
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Input.Search, {
1079
1118
  placeholder: `${common2.search} ${item.title}`,
1080
1119
  allowClear: true,
1081
1120
  onSearch: (v) => {
@@ -1105,7 +1144,7 @@ function Table(props) {
1105
1144
  setSelectedKeys,
1106
1145
  confirm,
1107
1146
  clearFilters
1108
- }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Input.Search, {
1147
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Input.Search, {
1109
1148
  placeholder: `${common2.search} ${item.title}`,
1110
1149
  allowClear: true,
1111
1150
  onSearch: (v) => {
@@ -1135,7 +1174,7 @@ function Table(props) {
1135
1174
  setSelectedKeys,
1136
1175
  confirm,
1137
1176
  clearFilters
1138
- }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Input.Search, {
1177
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Input.Search, {
1139
1178
  placeholder: `${common2.search} ${item.title}`,
1140
1179
  allowClear: true,
1141
1180
  onSearch: (v) => {
@@ -1167,7 +1206,7 @@ function Table(props) {
1167
1206
  setSelectedKeys,
1168
1207
  selectedKeys,
1169
1208
  confirm
1170
- }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd9.Radio.Group, {
1209
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd11.Radio.Group, {
1171
1210
  style: { padding: 8 },
1172
1211
  buttonStyle: "solid",
1173
1212
  value: selectedKeys[0],
@@ -1176,10 +1215,10 @@ function Table(props) {
1176
1215
  confirm();
1177
1216
  },
1178
1217
  children: [
1179
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Radio.Button, {
1218
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Radio.Button, {
1180
1219
  children: common2.all
1181
1220
  }),
1182
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Radio.Button, {
1221
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Radio.Button, {
1183
1222
  value: "true",
1184
1223
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons3.CheckOutlined, {
1185
1224
  style: {
@@ -1188,7 +1227,7 @@ function Table(props) {
1188
1227
  }
1189
1228
  })
1190
1229
  }),
1191
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Radio.Button, {
1230
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Radio.Button, {
1192
1231
  value: "false",
1193
1232
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons3.CloseOutlined, {
1194
1233
  style: {
@@ -1197,7 +1236,7 @@ function Table(props) {
1197
1236
  }
1198
1237
  })
1199
1238
  }),
1200
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Radio.Button, {
1239
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Radio.Button, {
1201
1240
  value: "empty",
1202
1241
  children: common2.blank
1203
1242
  })
@@ -1288,14 +1327,14 @@ function Table(props) {
1288
1327
  if (!columns)
1289
1328
  return null;
1290
1329
  if (!props.faasData)
1291
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Table, {
1330
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Table, {
1292
1331
  ...props,
1293
1332
  rowKey: props.rowKey || "id",
1294
1333
  columns,
1295
1334
  dataSource: props.dataSource
1296
1335
  });
1297
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react12.FaasDataWrapper, {
1298
- fallback: props.faasData.fallback || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Skeleton, {
1336
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FaasDataWrapper, {
1337
+ fallback: props.faasData.fallback || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Skeleton, {
1299
1338
  active: true
1300
1339
  }),
1301
1340
  ...props.faasData,
@@ -1349,20 +1388,20 @@ function FaasDataTable({
1349
1388
  });
1350
1389
  }, [columns, data]);
1351
1390
  if (!data)
1352
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Table, {
1391
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Table, {
1353
1392
  ...props,
1354
1393
  rowKey: props.rowKey || "id",
1355
1394
  columns: currentColumns,
1356
1395
  dataSource: []
1357
1396
  });
1358
1397
  if (Array.isArray(data))
1359
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Table, {
1398
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Table, {
1360
1399
  ...props,
1361
1400
  rowKey: props.rowKey || "id",
1362
1401
  columns: currentColumns,
1363
1402
  dataSource: data
1364
1403
  });
1365
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Table, {
1404
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Table, {
1366
1405
  ...props,
1367
1406
  rowKey: props.rowKey || "id",
1368
1407
  columns: currentColumns,
@@ -1393,11 +1432,11 @@ function FaasDataTable({
1393
1432
  }
1394
1433
 
1395
1434
  // src/Title.tsx
1396
- var import_react13 = require("react");
1435
+ var import_react12 = require("react");
1397
1436
  var import_jsx_runtime = require("react/jsx-runtime");
1398
1437
  function Title(props) {
1399
1438
  const { Title: Title2 } = useConfigContext();
1400
- (0, import_react13.useEffect)(() => {
1439
+ (0, import_react12.useEffect)(() => {
1401
1440
  const title = Array.isArray(props.title) ? props.title : [props.title];
1402
1441
  document.title = title.concat(props.suffix || Title2.suffix).filter((t) => !!t).join(props.separator || Title2.separator);
1403
1442
  }, [props]);
@@ -1417,7 +1456,7 @@ function Title(props) {
1417
1456
  children: Array.isArray(props.title) ? props.title[0] : props.title
1418
1457
  });
1419
1458
  if (props.children)
1420
- return (0, import_react13.cloneElement)(props.children, { title: props.title });
1459
+ return (0, import_react12.cloneElement)(props.children, { title: props.title });
1421
1460
  return null;
1422
1461
  }
1423
1462
  // Annotate the CommonJS export names for ESM import in node:
@@ -1427,9 +1466,13 @@ function Title(props) {
1427
1466
  ConfigProvider,
1428
1467
  Description,
1429
1468
  Drawer,
1469
+ FaasDataInjection,
1470
+ FaasDataWrapper,
1471
+ FaasDataWrapperProps,
1430
1472
  Form,
1431
1473
  FormItem,
1432
1474
  Link,
1475
+ Loading,
1433
1476
  Modal,
1434
1477
  PageNotFound,
1435
1478
  Routes,