@faasjs/ant-design 0.0.3-beta.15 → 0.0.3-beta.17

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,11 @@ __export(src_exports, {
30
30
  ConfigContext: () => ConfigContext,
31
31
  ConfigProvider: () => ConfigProvider,
32
32
  Description: () => Description,
33
- Drawer: () => import_antd4.Drawer,
33
+ Drawer: () => import_antd3.Drawer,
34
34
  Form: () => Form,
35
35
  FormItem: () => FormItem,
36
36
  Link: () => Link,
37
- Modal: () => import_antd8.Modal,
37
+ Modal: () => import_antd7.Modal,
38
38
  PageNotFound: () => PageNotFound,
39
39
  Routes: () => Routes,
40
40
  Table: () => Table,
@@ -51,12 +51,11 @@ module.exports = __toCommonJS(src_exports);
51
51
  var import_react = __toESM(require("react"));
52
52
 
53
53
  // src/Blank.tsx
54
- var import_antd2 = require("antd");
54
+ var import_antd = require("antd");
55
55
  var import_lodash_es2 = require("lodash-es");
56
56
 
57
57
  // src/Config.tsx
58
58
  var import_react2 = require("react");
59
- var import_antd = require("antd");
60
59
  var import_lodash_es = require("lodash-es");
61
60
  var import_jsx_runtime = require("react/jsx-runtime");
62
61
  var isZH = /^zh/i.test(navigator.language);
@@ -116,10 +115,7 @@ function ConfigProvider({
116
115
  }, []);
117
116
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ConfigContext.Provider, {
118
117
  value: values,
119
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.ConfigProvider, {
120
- ...config.antd,
121
- children
122
- })
118
+ children
123
119
  });
124
120
  }
125
121
  function useConfigContext() {
@@ -130,7 +126,7 @@ function useConfigContext() {
130
126
  var import_jsx_runtime = require("react/jsx-runtime");
131
127
  function Blank(options) {
132
128
  const { Blank: Blank2 } = useConfigContext();
133
- return !options || (0, import_lodash_es2.isNil)(options.value) || Array.isArray(options.value) && !options.value.length || options.value === "" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd2.Typography.Text, {
129
+ return !options || (0, import_lodash_es2.isNil)(options.value) || Array.isArray(options.value) && !options.value.length || options.value === "" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Typography.Text, {
134
130
  disabled: true,
135
131
  children: (options == null ? void 0 : options.text) || Blank2.text
136
132
  }) : options.value;
@@ -165,7 +161,7 @@ function transferValue(type, value) {
165
161
 
166
162
  // src/Description.tsx
167
163
  var import_icons = require("@ant-design/icons");
168
- var import_antd3 = require("antd");
164
+ var import_antd2 = require("antd");
169
165
  var import_lodash_es4 = require("lodash-es");
170
166
  var import_react3 = require("react");
171
167
  var import_react4 = require("@faasjs/react");
@@ -217,7 +213,10 @@ function DescriptionItemContent(props) {
217
213
  else
218
214
  throw Error(computedProps.item.type + " requires children or render");
219
215
  if (computedProps.item.children)
220
- return (0, import_react3.cloneElement)(computedProps.item.children, { value: computedProps.value });
216
+ return (0, import_react3.cloneElement)(computedProps.item.children, {
217
+ value: computedProps.value,
218
+ values: computedProps.values
219
+ });
221
220
  if (computedProps.item.render)
222
221
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
223
222
  children: computedProps.item.render(computedProps.value, computedProps.values)
@@ -266,7 +265,7 @@ function DescriptionItemContent(props) {
266
265
  case "object[]":
267
266
  if (!((_a = computedProps.value) == null ? void 0 : _a.length))
268
267
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Blank, {});
269
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd3.Space, {
268
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd2.Space, {
270
269
  direction: "vertical",
271
270
  children: computedProps.value.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Description, {
272
271
  items: computedProps.item.object,
@@ -280,11 +279,11 @@ function DescriptionItemContent(props) {
280
279
  }
281
280
  function Description(props) {
282
281
  if (!props.faasData)
283
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd3.Descriptions, {
282
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd2.Descriptions, {
284
283
  ...props,
285
284
  title: (0, import_lodash_es4.isFunction)(props.renderTitle) ? props.renderTitle(props.dataSource) : props.title,
286
285
  children: props.items.map((item) => {
287
- return !item.if || item.if(props.dataSource) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd3.Descriptions.Item, {
286
+ return !item.if || item.if(props.dataSource) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd2.Descriptions.Item, {
288
287
  label: item.title || (0, import_lodash_es4.upperFirst)(item.id),
289
288
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DescriptionItemContent, {
290
289
  item,
@@ -296,15 +295,15 @@ function Description(props) {
296
295
  }).filter(Boolean)
297
296
  });
298
297
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react4.FaasDataWrapper, {
299
- fallback: props.faasData.fallback || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd3.Skeleton, {
298
+ fallback: props.faasData.fallback || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd2.Skeleton, {
300
299
  active: true
301
300
  }),
302
301
  render: ({ data }) => {
303
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd3.Descriptions, {
302
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd2.Descriptions, {
304
303
  ...props,
305
304
  title: (0, import_lodash_es4.isFunction)(props.renderTitle) ? props.renderTitle(data) : props.title,
306
305
  children: props.items.map((item) => {
307
- return !item.if || item.if(data) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd3.Descriptions.Item, {
306
+ return !item.if || item.if(data) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd2.Descriptions.Item, {
308
307
  label: item.title || (0, import_lodash_es4.upperFirst)(item.id),
309
308
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DescriptionItemContent, {
310
309
  item,
@@ -321,7 +320,7 @@ function Description(props) {
321
320
  }
322
321
 
323
322
  // src/Drawer.tsx
324
- var import_antd4 = require("antd");
323
+ var import_antd3 = require("antd");
325
324
  var import_react5 = require("react");
326
325
  var import_jsx_runtime = require("react/jsx-runtime");
327
326
  function useDrawer(init) {
@@ -334,7 +333,7 @@ function useDrawer(init) {
334
333
  ...init
335
334
  });
336
335
  return {
337
- drawer: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Drawer, {
336
+ drawer: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd3.Drawer, {
338
337
  ...props
339
338
  }),
340
339
  drawerProps: props,
@@ -349,11 +348,11 @@ function useDrawer(init) {
349
348
 
350
349
  // src/Form.tsx
351
350
  var import_react7 = require("@faasjs/react");
352
- var import_antd6 = require("antd");
351
+ var import_antd5 = require("antd");
353
352
  var import_react8 = require("react");
354
353
 
355
354
  // src/FormItem.tsx
356
- var import_antd5 = require("antd");
355
+ var import_antd4 = require("antd");
357
356
  var import_icons2 = require("@ant-design/icons");
358
357
  var import_react6 = require("react");
359
358
  var import_lodash_es5 = require("lodash-es");
@@ -434,49 +433,49 @@ function FormItem(props) {
434
433
  if (!computedProps)
435
434
  return null;
436
435
  if (hidden)
437
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.Item, {
436
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
438
437
  ...computedProps,
439
438
  noStyle: true,
440
439
  rules: [],
441
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Input, {
440
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Input, {
442
441
  hidden: true
443
442
  })
444
443
  });
445
444
  if (extendTypes && extendTypes[computedProps.type])
446
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.Item, {
445
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
447
446
  ...computedProps,
448
447
  children: extendTypes[computedProps.type].children
449
448
  });
450
449
  if (computedProps.children)
451
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.Item, {
450
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
452
451
  ...computedProps,
453
452
  children: computedProps.children
454
453
  });
455
454
  if (computedProps.render)
456
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.Item, {
455
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
457
456
  ...computedProps,
458
457
  children: computedProps.render()
459
458
  });
460
459
  switch (computedProps.type) {
461
460
  case "string":
462
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.Item, {
461
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
463
462
  ...computedProps,
464
- children: computedProps.options ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Select, {
463
+ children: computedProps.options ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Select, {
465
464
  ...computedProps.input
466
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Input, {
465
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Input, {
467
466
  ...computedProps.input
468
467
  })
469
468
  });
470
469
  case "string[]":
471
470
  if (computedProps.options)
472
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.Item, {
471
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
473
472
  ...computedProps,
474
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Select, {
473
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Select, {
475
474
  mode: "multiple",
476
475
  ...computedProps.input
477
476
  })
478
477
  });
479
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.List, {
478
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.List, {
480
479
  name: computedProps.name,
481
480
  rules: computedProps.rules,
482
481
  children: (fields, { add, remove }, { errors }) => {
@@ -492,24 +491,24 @@ function FormItem(props) {
492
491
  }),
493
492
  fields.map((field) => {
494
493
  var _a3;
495
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.Item, {
496
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd5.Row, {
494
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
495
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd4.Row, {
497
496
  gutter: 24,
498
497
  style: { flexFlow: "row nowrap" },
499
498
  children: [
500
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Col, {
499
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Col, {
501
500
  span: 23,
502
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.Item, {
501
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
503
502
  ...field,
504
503
  noStyle: true,
505
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Input, {
504
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Input, {
506
505
  ...computedProps.input
507
506
  })
508
507
  })
509
508
  }),
510
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Col, {
509
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Col, {
511
510
  span: 1,
512
- 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_antd5.Button, {
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, {
513
512
  danger: true,
514
513
  type: "link",
515
514
  style: { float: "right" },
@@ -521,15 +520,15 @@ function FormItem(props) {
521
520
  })
522
521
  }, field.key);
523
522
  }),
524
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd5.Form.Item, {
523
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd4.Form.Item, {
525
524
  children: [
526
- !((_a2 = computedProps.input) == null ? void 0 : _a2.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Button, {
525
+ !((_a2 = computedProps.input) == null ? void 0 : _a2.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Button, {
527
526
  type: "dashed",
528
527
  block: true,
529
528
  onClick: () => add(),
530
529
  icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons2.PlusOutlined, {})
531
530
  }),
532
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.ErrorList, {
531
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.ErrorList, {
533
532
  errors
534
533
  })
535
534
  ]
@@ -539,25 +538,25 @@ function FormItem(props) {
539
538
  }
540
539
  });
541
540
  case "number":
542
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.Item, {
541
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
543
542
  ...computedProps,
544
- children: computedProps.options ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Select, {
543
+ children: computedProps.options ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Select, {
545
544
  ...computedProps.input
546
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.InputNumber, {
545
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.InputNumber, {
547
546
  style: { width: "100%" },
548
547
  ...computedProps.input
549
548
  })
550
549
  });
551
550
  case "number[]":
552
551
  if (computedProps.options)
553
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.Item, {
552
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
554
553
  ...computedProps,
555
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Select, {
554
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Select, {
556
555
  mode: "multiple",
557
556
  ...computedProps.input
558
557
  })
559
558
  });
560
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.List, {
559
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.List, {
561
560
  name: computedProps.name,
562
561
  rules: computedProps.rules,
563
562
  children: (fields, { add, remove }, { errors }) => {
@@ -573,25 +572,25 @@ function FormItem(props) {
573
572
  }),
574
573
  fields.map((field) => {
575
574
  var _a3;
576
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.Item, {
577
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd5.Row, {
575
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
576
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd4.Row, {
578
577
  gutter: 24,
579
578
  style: { flexFlow: "row nowrap" },
580
579
  children: [
581
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Col, {
580
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Col, {
582
581
  span: 23,
583
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.Item, {
582
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
584
583
  ...field,
585
584
  noStyle: true,
586
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.InputNumber, {
585
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.InputNumber, {
587
586
  style: { width: "100%" },
588
587
  ...computedProps.input
589
588
  })
590
589
  })
591
590
  }),
592
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Col, {
591
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Col, {
593
592
  span: 1,
594
- 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_antd5.Button, {
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, {
595
594
  danger: true,
596
595
  type: "link",
597
596
  style: { float: "right" },
@@ -603,15 +602,15 @@ function FormItem(props) {
603
602
  })
604
603
  }, field.key);
605
604
  }),
606
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd5.Form.Item, {
605
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd4.Form.Item, {
607
606
  children: [
608
- !((_b = computedProps.input) == null ? void 0 : _b.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Button, {
607
+ !((_b = computedProps.input) == null ? void 0 : _b.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Button, {
609
608
  type: "dashed",
610
609
  block: true,
611
610
  onClick: () => add(),
612
611
  icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons2.PlusOutlined, {})
613
612
  }),
614
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.ErrorList, {
613
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.ErrorList, {
615
614
  errors
616
615
  })
617
616
  ]
@@ -621,23 +620,23 @@ function FormItem(props) {
621
620
  }
622
621
  });
623
622
  case "boolean":
624
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.Item, {
623
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
625
624
  ...computedProps,
626
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Switch, {
625
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Switch, {
627
626
  ...computedProps.input
628
627
  })
629
628
  });
630
629
  case "date":
631
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.Item, {
630
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
632
631
  ...computedProps,
633
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.DatePicker, {
632
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.DatePicker, {
634
633
  ...computedProps.input
635
634
  })
636
635
  });
637
636
  case "time":
638
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.Item, {
637
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
639
638
  ...computedProps,
640
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.TimePicker, {
639
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.TimePicker, {
641
640
  ...computedProps.input
642
641
  })
643
642
  });
@@ -657,12 +656,12 @@ function FormItem(props) {
657
656
  ]
658
657
  });
659
658
  case "object[]":
660
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.List, {
659
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.List, {
661
660
  name: computedProps.name,
662
661
  rules: computedProps.rules,
663
662
  children: (fields, { add, remove }, { errors }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
664
663
  children: [
665
- fields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd5.Form.Item, {
664
+ fields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd4.Form.Item, {
666
665
  style: { marginBottom: 0 },
667
666
  children: [
668
667
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
@@ -672,7 +671,7 @@ function FormItem(props) {
672
671
  computedProps.label,
673
672
  " ",
674
673
  field.name + 1,
675
- !computedProps.disabled && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Button, {
674
+ !computedProps.disabled && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Button, {
676
675
  danger: true,
677
676
  type: "link",
678
677
  onClick: () => remove(field.name),
@@ -681,9 +680,9 @@ function FormItem(props) {
681
680
  ]
682
681
  })
683
682
  }),
684
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Row, {
683
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Row, {
685
684
  gutter: 24,
686
- children: computedProps.object.map((o) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Col, {
685
+ children: computedProps.object.map((o) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Col, {
687
686
  span: o.col || 24,
688
687
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormItem, {
689
688
  ...o,
@@ -693,9 +692,9 @@ function FormItem(props) {
693
692
  })
694
693
  ]
695
694
  }, field.key)),
696
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd5.Form.Item, {
695
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd4.Form.Item, {
697
696
  children: [
698
- !computedProps.disabled && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd5.Button, {
697
+ !computedProps.disabled && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd4.Button, {
699
698
  type: "dashed",
700
699
  block: true,
701
700
  onClick: () => add(),
@@ -706,7 +705,7 @@ function FormItem(props) {
706
705
  computedProps.label
707
706
  ]
708
707
  }),
709
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.ErrorList, {
708
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.ErrorList, {
710
709
  errors
711
710
  })
712
711
  ]
@@ -727,7 +726,7 @@ function Form(props) {
727
726
  const [computedProps, setComputedProps] = (0, import_react8.useState)();
728
727
  const config = useConfigContext();
729
728
  const [extendTypes, setExtendTypes] = (0, import_react8.useState)();
730
- const [form] = import_antd6.Form.useForm(props.form);
729
+ const [form] = import_antd5.Form.useForm(props.form);
731
730
  const [initialValues, setInitialValues] = (0, import_react8.useState)(props.initialValues);
732
731
  (0, import_react8.useEffect)(() => {
733
732
  var _a2, _b2;
@@ -806,7 +805,7 @@ function Form(props) {
806
805
  }, [computedProps]);
807
806
  if (!computedProps)
808
807
  return null;
809
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd6.Form, {
808
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd5.Form, {
810
809
  ...computedProps,
811
810
  onValuesChange,
812
811
  children: [
@@ -816,7 +815,7 @@ function Form(props) {
816
815
  extendTypes
817
816
  }, item.id)),
818
817
  computedProps.children,
819
- computedProps.submit !== false && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Button, {
818
+ computedProps.submit !== false && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Button, {
820
819
  htmlType: "submit",
821
820
  type: "primary",
822
821
  loading,
@@ -826,11 +825,11 @@ function Form(props) {
826
825
  ]
827
826
  });
828
827
  }
829
- Form.useForm = import_antd6.Form.useForm;
828
+ Form.useForm = import_antd5.Form.useForm;
830
829
 
831
830
  // src/Link.tsx
832
831
  var import_react_router_dom = require("react-router-dom");
833
- var import_antd7 = require("antd");
832
+ var import_antd6 = require("antd");
834
833
  var import_jsx_runtime = require("react/jsx-runtime");
835
834
  function Link({
836
835
  href,
@@ -844,7 +843,7 @@ function Link({
844
843
  style = Object.assign({ cursor: "pointer" }, style);
845
844
  if (href.startsWith("http")) {
846
845
  if (button)
847
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd7.Button, {
846
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Button, {
848
847
  ...button,
849
848
  target: target || (Link2 == null ? void 0 : Link2.target) || "_blank",
850
849
  style: {
@@ -852,7 +851,7 @@ function Link({
852
851
  ...style || {}
853
852
  },
854
853
  href,
855
- children: text || children
854
+ children: text != null ? text : children
856
855
  });
857
856
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", {
858
857
  href,
@@ -861,20 +860,20 @@ function Link({
861
860
  ...Link2.style,
862
861
  ...style || {}
863
862
  },
864
- children: text || children
863
+ children: text != null ? text : children
865
864
  });
866
865
  }
867
866
  if (button)
868
867
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_router_dom.Link, {
869
868
  to: href,
870
869
  target: target || (Link2 == null ? void 0 : Link2.target),
871
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd7.Button, {
870
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Button, {
872
871
  ...button,
873
872
  style: {
874
873
  ...Link2.style,
875
874
  ...style || {}
876
875
  },
877
- children: text || children
876
+ children: text != null ? text : children
878
877
  })
879
878
  });
880
879
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_router_dom.Link, {
@@ -884,12 +883,12 @@ function Link({
884
883
  ...Link2.style,
885
884
  ...style || {}
886
885
  },
887
- children: text || children
886
+ children: text != null ? text : children
888
887
  });
889
888
  }
890
889
 
891
890
  // src/Modal.tsx
892
- var import_antd8 = require("antd");
891
+ var import_antd7 = require("antd");
893
892
  var import_react9 = require("react");
894
893
  var import_jsx_runtime = require("react/jsx-runtime");
895
894
  function useModal(init) {
@@ -902,7 +901,7 @@ function useModal(init) {
902
901
  ...init
903
902
  });
904
903
  return {
905
- modal: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Modal, {
904
+ modal: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd7.Modal, {
906
905
  ...props
907
906
  }),
908
907
  modalProps: props,
@@ -916,13 +915,13 @@ function useModal(init) {
916
915
  }
917
916
 
918
917
  // src/Routers.tsx
919
- var import_antd9 = require("antd");
918
+ var import_antd8 = require("antd");
920
919
  var import_react10 = require("react");
921
920
  var import_react_router_dom2 = require("react-router-dom");
922
921
  var import_jsx_runtime = require("react/jsx-runtime");
923
922
  function PageNotFound() {
924
923
  const config = useConfigContext();
925
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Result, {
924
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Result, {
926
925
  status: "404",
927
926
  title: config.common.pageNotFound
928
927
  });
@@ -935,7 +934,7 @@ function Routes(props) {
935
934
  element: r.element || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react10.Suspense, {
936
935
  fallback: props.fallback || /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
937
936
  style: { padding: "24px" },
938
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Skeleton, {
937
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Skeleton, {
939
938
  active: true
940
939
  })
941
940
  }),
@@ -952,7 +951,7 @@ function Routes(props) {
952
951
 
953
952
  // src/Table.tsx
954
953
  var import_react11 = require("react");
955
- var import_antd10 = require("antd");
954
+ var import_antd9 = require("antd");
956
955
  var import_dayjs2 = __toESM(require("dayjs"));
957
956
  var import_icons3 = require("@ant-design/icons");
958
957
  var import_lodash_es6 = require("lodash-es");
@@ -984,7 +983,7 @@ function processValue(item, value) {
984
983
  }
985
984
  function Table(props) {
986
985
  const [columns, setColumns] = (0, import_react11.useState)();
987
- const { common: common2, antd } = useConfigContext();
986
+ const { common: common2 } = useConfigContext();
988
987
  (0, import_react11.useEffect)(() => {
989
988
  var _a;
990
989
  for (const item of props.items) {
@@ -1004,7 +1003,13 @@ function Table(props) {
1004
1003
  }));
1005
1004
  }
1006
1005
  if (item.children)
1007
- delete item.children;
1006
+ item.render = (value, values) => (0, import_react11.cloneElement)(
1007
+ item.children,
1008
+ {
1009
+ value,
1010
+ values
1011
+ }
1012
+ );
1008
1013
  if (props.extendTypes && props.extendTypes[item.type]) {
1009
1014
  if (props.extendTypes[item.type].children)
1010
1015
  item.render = (value, values) => (0, import_react11.cloneElement)(
@@ -1037,7 +1042,7 @@ function Table(props) {
1037
1042
  setSelectedKeys,
1038
1043
  confirm,
1039
1044
  clearFilters
1040
- }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Input.Search, {
1045
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Input.Search, {
1041
1046
  placeholder: `${common2.search} ${item.title}`,
1042
1047
  allowClear: true,
1043
1048
  onSearch: (v) => {
@@ -1067,7 +1072,7 @@ function Table(props) {
1067
1072
  setSelectedKeys,
1068
1073
  confirm,
1069
1074
  clearFilters
1070
- }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Input.Search, {
1075
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Input.Search, {
1071
1076
  placeholder: `${common2.search} ${item.title}`,
1072
1077
  allowClear: true,
1073
1078
  onSearch: (v) => {
@@ -1097,7 +1102,7 @@ function Table(props) {
1097
1102
  setSelectedKeys,
1098
1103
  confirm,
1099
1104
  clearFilters
1100
- }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Input.Search, {
1105
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Input.Search, {
1101
1106
  placeholder: `${common2.search} ${item.title}`,
1102
1107
  allowClear: true,
1103
1108
  onSearch: (v) => {
@@ -1127,7 +1132,7 @@ function Table(props) {
1127
1132
  setSelectedKeys,
1128
1133
  confirm,
1129
1134
  clearFilters
1130
- }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Input.Search, {
1135
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Input.Search, {
1131
1136
  placeholder: `${common2.search} ${item.title}`,
1132
1137
  allowClear: true,
1133
1138
  onSearch: (v) => {
@@ -1159,7 +1164,7 @@ function Table(props) {
1159
1164
  setSelectedKeys,
1160
1165
  selectedKeys,
1161
1166
  confirm
1162
- }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd10.Radio.Group, {
1167
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd9.Radio.Group, {
1163
1168
  style: { padding: 8 },
1164
1169
  buttonStyle: "solid",
1165
1170
  value: selectedKeys[0],
@@ -1168,10 +1173,10 @@ function Table(props) {
1168
1173
  confirm();
1169
1174
  },
1170
1175
  children: [
1171
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Radio.Button, {
1176
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Radio.Button, {
1172
1177
  children: common2.all
1173
1178
  }),
1174
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Radio.Button, {
1179
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Radio.Button, {
1175
1180
  value: "true",
1176
1181
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons3.CheckOutlined, {
1177
1182
  style: {
@@ -1180,7 +1185,7 @@ function Table(props) {
1180
1185
  }
1181
1186
  })
1182
1187
  }),
1183
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Radio.Button, {
1188
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Radio.Button, {
1184
1189
  value: "false",
1185
1190
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons3.CloseOutlined, {
1186
1191
  style: {
@@ -1189,7 +1194,7 @@ function Table(props) {
1189
1194
  }
1190
1195
  })
1191
1196
  }),
1192
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Radio.Button, {
1197
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Radio.Button, {
1193
1198
  value: "empty",
1194
1199
  children: common2.blank
1195
1200
  })
@@ -1278,17 +1283,14 @@ function Table(props) {
1278
1283
  if (!columns)
1279
1284
  return null;
1280
1285
  if (!props.faasData)
1281
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.ConfigProvider, {
1282
- ...antd,
1283
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Table, {
1284
- ...props,
1285
- rowKey: props.rowKey || "id",
1286
- columns,
1287
- dataSource: props.dataSource
1288
- })
1286
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Table, {
1287
+ ...props,
1288
+ rowKey: props.rowKey || "id",
1289
+ columns,
1290
+ dataSource: props.dataSource
1289
1291
  });
1290
1292
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react12.FaasDataWrapper, {
1291
- fallback: props.faasData.fallback || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Skeleton, {
1293
+ fallback: props.faasData.fallback || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Skeleton, {
1292
1294
  active: true
1293
1295
  }),
1294
1296
  render: ({
@@ -1297,55 +1299,46 @@ function Table(props) {
1297
1299
  reload
1298
1300
  }) => {
1299
1301
  if (!data)
1300
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.ConfigProvider, {
1301
- ...antd,
1302
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Table, {
1303
- ...props,
1304
- rowKey: props.rowKey || "id",
1305
- columns,
1306
- dataSource: []
1307
- })
1302
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Table, {
1303
+ ...props,
1304
+ rowKey: props.rowKey || "id",
1305
+ columns,
1306
+ dataSource: []
1308
1307
  });
1309
1308
  if (Array.isArray(data))
1310
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.ConfigProvider, {
1311
- ...antd,
1312
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Table, {
1313
- ...props,
1314
- rowKey: props.rowKey || "id",
1315
- columns,
1316
- dataSource: data
1317
- })
1318
- });
1319
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.ConfigProvider, {
1320
- ...antd,
1321
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Table, {
1309
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Table, {
1322
1310
  ...props,
1323
1311
  rowKey: props.rowKey || "id",
1324
1312
  columns,
1325
- dataSource: data.rows,
1326
- pagination: {
1327
- ...props.pagination,
1328
- ...data.pagination
1329
- },
1330
- onChange: (pagination, filters, sorter, extra) => {
1331
- if (props.onChange) {
1332
- const processed = props.onChange(pagination, filters, sorter, extra);
1333
- reload({
1334
- ...params,
1335
- pagination: processed.pagination,
1336
- filters: processed.filters,
1337
- sorter: processed.sorter
1338
- });
1339
- return;
1340
- }
1313
+ dataSource: data
1314
+ });
1315
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Table, {
1316
+ ...props,
1317
+ rowKey: props.rowKey || "id",
1318
+ columns,
1319
+ dataSource: data.rows,
1320
+ pagination: {
1321
+ ...props.pagination,
1322
+ ...data.pagination
1323
+ },
1324
+ onChange: (pagination, filters, sorter, extra) => {
1325
+ if (props.onChange) {
1326
+ const processed = props.onChange(pagination, filters, sorter, extra);
1341
1327
  reload({
1342
1328
  ...params,
1343
- pagination,
1344
- filters,
1345
- sorter
1329
+ pagination: processed.pagination,
1330
+ filters: processed.filters,
1331
+ sorter: processed.sorter
1346
1332
  });
1333
+ return;
1347
1334
  }
1348
- })
1335
+ reload({
1336
+ ...params,
1337
+ pagination,
1338
+ filters,
1339
+ sorter
1340
+ });
1341
+ }
1349
1342
  });
1350
1343
  },
1351
1344
  ...props.faasData