@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.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
  ]
@@ -717,6 +755,7 @@ function FormItem(props) {
717
755
  return null;
718
756
  }
719
757
  }
758
+ FormItem.useStatus = import_antd6.Form.Item.useStatus;
720
759
 
721
760
  // src/Form.tsx
722
761
  var import_jsx_runtime = require("react/jsx-runtime");
@@ -726,7 +765,7 @@ function Form(props) {
726
765
  const [computedProps, setComputedProps] = (0, import_react8.useState)();
727
766
  const config = useConfigContext();
728
767
  const [extendTypes, setExtendTypes] = (0, import_react8.useState)();
729
- const [form] = import_antd5.Form.useForm(props.form);
768
+ const [form] = import_antd7.Form.useForm(props.form);
730
769
  const [initialValues, setInitialValues] = (0, import_react8.useState)(props.initialValues);
731
770
  (0, import_react8.useEffect)(() => {
732
771
  var _a2, _b2;
@@ -805,7 +844,7 @@ function Form(props) {
805
844
  }, [computedProps]);
806
845
  if (!computedProps)
807
846
  return null;
808
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd5.Form, {
847
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd7.Form, {
809
848
  ...computedProps,
810
849
  onValuesChange,
811
850
  children: [
@@ -815,7 +854,7 @@ function Form(props) {
815
854
  extendTypes
816
855
  }, item.id)),
817
856
  computedProps.children,
818
- computedProps.submit !== false && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Button, {
857
+ computedProps.submit !== false && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd7.Button, {
819
858
  htmlType: "submit",
820
859
  type: "primary",
821
860
  loading,
@@ -825,11 +864,13 @@ function Form(props) {
825
864
  ]
826
865
  });
827
866
  }
828
- Form.useForm = import_antd5.Form.useForm;
867
+ Form.useForm = import_antd7.Form.useForm;
868
+ Form.useFormInstance = import_antd7.Form.useFormInstance;
869
+ Form.useWatch = import_antd7.Form.useWatch;
829
870
 
830
871
  // src/Link.tsx
831
872
  var import_react_router_dom = require("react-router-dom");
832
- var import_antd6 = require("antd");
873
+ var import_antd8 = require("antd");
833
874
  var import_jsx_runtime = require("react/jsx-runtime");
834
875
  function Link({
835
876
  href,
@@ -843,7 +884,7 @@ function Link({
843
884
  style = Object.assign({ cursor: "pointer" }, style);
844
885
  if (href.startsWith("http")) {
845
886
  if (button)
846
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Button, {
887
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Button, {
847
888
  ...button,
848
889
  target: target || (Link2 == null ? void 0 : Link2.target) || "_blank",
849
890
  style: {
@@ -867,7 +908,7 @@ function Link({
867
908
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_router_dom.Link, {
868
909
  to: href,
869
910
  target: target || (Link2 == null ? void 0 : Link2.target),
870
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Button, {
911
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Button, {
871
912
  ...button,
872
913
  style: {
873
914
  ...Link2.style,
@@ -888,7 +929,7 @@ function Link({
888
929
  }
889
930
 
890
931
  // src/Modal.tsx
891
- var import_antd7 = require("antd");
932
+ var import_antd9 = require("antd");
892
933
  var import_react9 = require("react");
893
934
  var import_jsx_runtime = require("react/jsx-runtime");
894
935
  function useModal(init) {
@@ -901,7 +942,7 @@ function useModal(init) {
901
942
  ...init
902
943
  });
903
944
  return {
904
- modal: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd7.Modal, {
945
+ modal: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Modal, {
905
946
  ...props
906
947
  }),
907
948
  modalProps: props,
@@ -915,47 +956,48 @@ function useModal(init) {
915
956
  }
916
957
 
917
958
  // src/Routers.tsx
918
- var import_antd8 = require("antd");
959
+ var import_antd10 = require("antd");
919
960
  var import_react10 = require("react");
920
961
  var import_react_router_dom2 = require("react-router-dom");
921
962
  var import_jsx_runtime = require("react/jsx-runtime");
922
963
  function PageNotFound() {
923
964
  const config = useConfigContext();
924
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Result, {
965
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Result, {
925
966
  status: "404",
926
967
  title: config.common.pageNotFound
927
968
  });
928
969
  }
929
970
  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
- ]
971
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Alert.ErrorBoundary, {
972
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_router_dom2.Routes, {
973
+ children: [
974
+ props.routes.map((r) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_router_dom2.Route, {
975
+ ...r,
976
+ element: r.element || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react10.Suspense, {
977
+ fallback: props.fallback || /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
978
+ style: { padding: "24px" },
979
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Skeleton, {
980
+ active: true
981
+ })
982
+ }),
983
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(r.page, {})
984
+ })
985
+ }, r.path)),
986
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_router_dom2.Route, {
987
+ path: "*",
988
+ element: props.notFound || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PageNotFound, {})
989
+ }, "*")
990
+ ]
991
+ })
949
992
  });
950
993
  }
951
994
 
952
995
  // src/Table.tsx
953
996
  var import_react11 = require("react");
954
- var import_antd9 = require("antd");
997
+ var import_antd11 = require("antd");
955
998
  var import_dayjs2 = __toESM(require("dayjs"));
956
999
  var import_icons3 = require("@ant-design/icons");
957
1000
  var import_lodash_es6 = require("lodash-es");
958
- var import_react12 = require("@faasjs/react");
959
1001
  var import_jsx_runtime = require("react/jsx-runtime");
960
1002
  function processValue(item, value) {
961
1003
  var _a;
@@ -1045,7 +1087,7 @@ function Table(props) {
1045
1087
  setSelectedKeys,
1046
1088
  confirm,
1047
1089
  clearFilters
1048
- }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Input.Search, {
1090
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Input.Search, {
1049
1091
  placeholder: `${common2.search} ${item.title}`,
1050
1092
  allowClear: true,
1051
1093
  onSearch: (v) => {
@@ -1075,7 +1117,7 @@ function Table(props) {
1075
1117
  setSelectedKeys,
1076
1118
  confirm,
1077
1119
  clearFilters
1078
- }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Input.Search, {
1120
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Input.Search, {
1079
1121
  placeholder: `${common2.search} ${item.title}`,
1080
1122
  allowClear: true,
1081
1123
  onSearch: (v) => {
@@ -1105,7 +1147,7 @@ function Table(props) {
1105
1147
  setSelectedKeys,
1106
1148
  confirm,
1107
1149
  clearFilters
1108
- }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Input.Search, {
1150
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Input.Search, {
1109
1151
  placeholder: `${common2.search} ${item.title}`,
1110
1152
  allowClear: true,
1111
1153
  onSearch: (v) => {
@@ -1135,7 +1177,7 @@ function Table(props) {
1135
1177
  setSelectedKeys,
1136
1178
  confirm,
1137
1179
  clearFilters
1138
- }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Input.Search, {
1180
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Input.Search, {
1139
1181
  placeholder: `${common2.search} ${item.title}`,
1140
1182
  allowClear: true,
1141
1183
  onSearch: (v) => {
@@ -1167,7 +1209,7 @@ function Table(props) {
1167
1209
  setSelectedKeys,
1168
1210
  selectedKeys,
1169
1211
  confirm
1170
- }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd9.Radio.Group, {
1212
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd11.Radio.Group, {
1171
1213
  style: { padding: 8 },
1172
1214
  buttonStyle: "solid",
1173
1215
  value: selectedKeys[0],
@@ -1176,10 +1218,10 @@ function Table(props) {
1176
1218
  confirm();
1177
1219
  },
1178
1220
  children: [
1179
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Radio.Button, {
1221
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Radio.Button, {
1180
1222
  children: common2.all
1181
1223
  }),
1182
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Radio.Button, {
1224
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Radio.Button, {
1183
1225
  value: "true",
1184
1226
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons3.CheckOutlined, {
1185
1227
  style: {
@@ -1188,7 +1230,7 @@ function Table(props) {
1188
1230
  }
1189
1231
  })
1190
1232
  }),
1191
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Radio.Button, {
1233
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Radio.Button, {
1192
1234
  value: "false",
1193
1235
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons3.CloseOutlined, {
1194
1236
  style: {
@@ -1197,7 +1239,7 @@ function Table(props) {
1197
1239
  }
1198
1240
  })
1199
1241
  }),
1200
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Radio.Button, {
1242
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Radio.Button, {
1201
1243
  value: "empty",
1202
1244
  children: common2.blank
1203
1245
  })
@@ -1288,14 +1330,14 @@ function Table(props) {
1288
1330
  if (!columns)
1289
1331
  return null;
1290
1332
  if (!props.faasData)
1291
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Table, {
1333
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Table, {
1292
1334
  ...props,
1293
1335
  rowKey: props.rowKey || "id",
1294
1336
  columns,
1295
1337
  dataSource: props.dataSource
1296
1338
  });
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, {
1339
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FaasDataWrapper, {
1340
+ fallback: props.faasData.fallback || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Skeleton, {
1299
1341
  active: true
1300
1342
  }),
1301
1343
  ...props.faasData,
@@ -1349,20 +1391,20 @@ function FaasDataTable({
1349
1391
  });
1350
1392
  }, [columns, data]);
1351
1393
  if (!data)
1352
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Table, {
1394
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Table, {
1353
1395
  ...props,
1354
1396
  rowKey: props.rowKey || "id",
1355
1397
  columns: currentColumns,
1356
1398
  dataSource: []
1357
1399
  });
1358
1400
  if (Array.isArray(data))
1359
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Table, {
1401
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Table, {
1360
1402
  ...props,
1361
1403
  rowKey: props.rowKey || "id",
1362
1404
  columns: currentColumns,
1363
1405
  dataSource: data
1364
1406
  });
1365
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Table, {
1407
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Table, {
1366
1408
  ...props,
1367
1409
  rowKey: props.rowKey || "id",
1368
1410
  columns: currentColumns,
@@ -1393,11 +1435,11 @@ function FaasDataTable({
1393
1435
  }
1394
1436
 
1395
1437
  // src/Title.tsx
1396
- var import_react13 = require("react");
1438
+ var import_react12 = require("react");
1397
1439
  var import_jsx_runtime = require("react/jsx-runtime");
1398
1440
  function Title(props) {
1399
1441
  const { Title: Title2 } = useConfigContext();
1400
- (0, import_react13.useEffect)(() => {
1442
+ (0, import_react12.useEffect)(() => {
1401
1443
  const title = Array.isArray(props.title) ? props.title : [props.title];
1402
1444
  document.title = title.concat(props.suffix || Title2.suffix).filter((t) => !!t).join(props.separator || Title2.separator);
1403
1445
  }, [props]);
@@ -1417,7 +1459,7 @@ function Title(props) {
1417
1459
  children: Array.isArray(props.title) ? props.title[0] : props.title
1418
1460
  });
1419
1461
  if (props.children)
1420
- return (0, import_react13.cloneElement)(props.children, { title: props.title });
1462
+ return (0, import_react12.cloneElement)(props.children, { title: props.title });
1421
1463
  return null;
1422
1464
  }
1423
1465
  // Annotate the CommonJS export names for ESM import in node:
@@ -1427,9 +1469,13 @@ function Title(props) {
1427
1469
  ConfigProvider,
1428
1470
  Description,
1429
1471
  Drawer,
1472
+ FaasDataInjection,
1473
+ FaasDataWrapper,
1474
+ FaasDataWrapperProps,
1430
1475
  Form,
1431
1476
  FormItem,
1432
1477
  Link,
1478
+ Loading,
1433
1479
  Modal,
1434
1480
  PageNotFound,
1435
1481
  Routes,