@faasjs/ant-design 0.0.2-beta.450 → 0.0.2-beta.452

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
@@ -273,7 +273,8 @@ function DescriptionItemContent(props) {
273
273
  case "object":
274
274
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Description, {
275
275
  items: computedProps.item.object,
276
- dataSource: computedProps.value
276
+ dataSource: computedProps.value,
277
+ column: 1
277
278
  });
278
279
  case "object[]":
279
280
  if (!((_a = computedProps.value) == null ? void 0 : _a.length))
@@ -282,7 +283,8 @@ function DescriptionItemContent(props) {
282
283
  direction: "vertical",
283
284
  children: computedProps.value.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Description, {
284
285
  items: computedProps.item.object,
285
- dataSource: value
286
+ dataSource: value,
287
+ column: 1
286
288
  }, index))
287
289
  });
288
290
  default:
@@ -383,7 +385,6 @@ var TimePicker = (0, import_react6.forwardRef)((props, ref) => {
383
385
  TimePicker.displayName = "TimePicker";
384
386
 
385
387
  // src/FormItem.tsx
386
- var import_dayjs4 = __toESM(require("dayjs"));
387
388
  var import_jsx_runtime6 = require("react/jsx-runtime");
388
389
  function processProps(propsCopy, config) {
389
390
  if (!propsCopy.title)
@@ -431,26 +432,6 @@ function processProps(propsCopy, config) {
431
432
  }
432
433
  return propsCopy;
433
434
  }
434
- function DateItem(options) {
435
- const [value, setValue] = (0, import_react7.useState)();
436
- (0, import_react7.useEffect)(() => {
437
- setValue(options.value && !(0, import_dayjs4.isDayjs)(options.value) ? (0, import_dayjs4.default)(options.value) : null);
438
- }, [options.value]);
439
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DatePicker, {
440
- ...options,
441
- value
442
- });
443
- }
444
- function TimeItem(options) {
445
- const [value, setValue] = (0, import_react7.useState)();
446
- (0, import_react7.useEffect)(() => {
447
- setValue(options.value && !(0, import_dayjs4.isDayjs)(options.value) ? (0, import_dayjs4.default)(options.value) : null);
448
- }, [options.value]);
449
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TimePicker, {
450
- ...options,
451
- value
452
- });
453
- }
454
435
  function FormItem(props) {
455
436
  var _a;
456
437
  const [computedProps, setComputedProps] = (0, import_react7.useState)();
@@ -654,14 +635,14 @@ function FormItem(props) {
654
635
  case "date":
655
636
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_antd5.Form.Item, {
656
637
  ...computedProps,
657
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DateItem, {
638
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DatePicker, {
658
639
  ...computedProps.input
659
640
  })
660
641
  });
661
642
  case "time":
662
643
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_antd5.Form.Item, {
663
644
  ...computedProps,
664
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TimeItem, {
645
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TimePicker, {
665
646
  ...computedProps.input
666
647
  })
667
648
  });
@@ -708,7 +689,7 @@ function FormItem(props) {
708
689
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_antd5.Row, {
709
690
  gutter: 24,
710
691
  children: computedProps.object.map((o) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_antd5.Col, {
711
- span: o.col || 6,
692
+ span: o.col || 24,
712
693
  children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FormItem, {
713
694
  ...o,
714
695
  name: [field.name, o.id]
@@ -983,7 +964,7 @@ function Routes(props) {
983
964
  // src/Table.tsx
984
965
  var import_react12 = require("react");
985
966
  var import_antd10 = require("antd");
986
- var import_dayjs5 = __toESM(require("dayjs"));
967
+ var import_dayjs4 = __toESM(require("dayjs"));
987
968
  var import_icons3 = require("@ant-design/icons");
988
969
  var import_lodash6 = require("lodash");
989
970
  var import_react13 = require("@faasjs/react");
@@ -1229,17 +1210,17 @@ function Table(props) {
1229
1210
  if (!item.render)
1230
1211
  item.render = (value) => processValue(item, value);
1231
1212
  if (!item.onFilter)
1232
- item.onFilter = (value, row) => (0, import_dayjs5.default)(row[item.id]).isSame((0, import_dayjs5.default)(value));
1213
+ item.onFilter = (value, row) => (0, import_dayjs4.default)(row[item.id]).isSame((0, import_dayjs4.default)(value));
1233
1214
  if (!item.sorter)
1234
- item.sorter = (a, b) => (0, import_dayjs5.default)(a[item.id]).isBefore(b[item.id]) ? -1 : 1;
1215
+ item.sorter = (a, b) => (0, import_dayjs4.default)(a[item.id]).isBefore(b[item.id]) ? -1 : 1;
1235
1216
  break;
1236
1217
  case "time":
1237
1218
  if (!item.render)
1238
1219
  item.render = (value) => processValue(item, value);
1239
1220
  if (!item.onFilter)
1240
- item.onFilter = (value, row) => (0, import_dayjs5.default)(row[item.id]).isSame((0, import_dayjs5.default)(value));
1221
+ item.onFilter = (value, row) => (0, import_dayjs4.default)(row[item.id]).isSame((0, import_dayjs4.default)(value));
1241
1222
  if (!item.sorter)
1242
- item.sorter = (a, b) => (0, import_dayjs5.default)(a[item.id]).isBefore(b[item.id]) ? -1 : 1;
1223
+ item.sorter = (a, b) => (0, import_dayjs4.default)(a[item.id]).isBefore(b[item.id]) ? -1 : 1;
1243
1224
  break;
1244
1225
  case "object":
1245
1226
  if (!item.render)
package/dist/index.mjs CHANGED
@@ -234,7 +234,8 @@ function DescriptionItemContent(props) {
234
234
  case "object":
235
235
  return /* @__PURE__ */ jsx3(Description, {
236
236
  items: computedProps.item.object,
237
- dataSource: computedProps.value
237
+ dataSource: computedProps.value,
238
+ column: 1
238
239
  });
239
240
  case "object[]":
240
241
  if (!((_a = computedProps.value) == null ? void 0 : _a.length))
@@ -243,7 +244,8 @@ function DescriptionItemContent(props) {
243
244
  direction: "vertical",
244
245
  children: computedProps.value.map((value, index) => /* @__PURE__ */ jsx3(Description, {
245
246
  items: computedProps.item.object,
246
- dataSource: value
247
+ dataSource: value,
248
+ column: 1
247
249
  }, index))
248
250
  });
249
251
  default:
@@ -363,7 +365,6 @@ var TimePicker = forwardRef((props, ref) => {
363
365
  TimePicker.displayName = "TimePicker";
364
366
 
365
367
  // src/FormItem.tsx
366
- import dayjs2, { isDayjs } from "dayjs";
367
368
  import { Fragment as Fragment2, jsx as jsx6, jsxs } from "react/jsx-runtime";
368
369
  function processProps(propsCopy, config) {
369
370
  if (!propsCopy.title)
@@ -411,26 +412,6 @@ function processProps(propsCopy, config) {
411
412
  }
412
413
  return propsCopy;
413
414
  }
414
- function DateItem(options) {
415
- const [value, setValue] = useState4();
416
- useEffect3(() => {
417
- setValue(options.value && !isDayjs(options.value) ? dayjs2(options.value) : null);
418
- }, [options.value]);
419
- return /* @__PURE__ */ jsx6(DatePicker, {
420
- ...options,
421
- value
422
- });
423
- }
424
- function TimeItem(options) {
425
- const [value, setValue] = useState4();
426
- useEffect3(() => {
427
- setValue(options.value && !isDayjs(options.value) ? dayjs2(options.value) : null);
428
- }, [options.value]);
429
- return /* @__PURE__ */ jsx6(TimePicker, {
430
- ...options,
431
- value
432
- });
433
- }
434
415
  function FormItem(props) {
435
416
  var _a;
436
417
  const [computedProps, setComputedProps] = useState4();
@@ -634,14 +615,14 @@ function FormItem(props) {
634
615
  case "date":
635
616
  return /* @__PURE__ */ jsx6(AntdForm.Item, {
636
617
  ...computedProps,
637
- children: /* @__PURE__ */ jsx6(DateItem, {
618
+ children: /* @__PURE__ */ jsx6(DatePicker, {
638
619
  ...computedProps.input
639
620
  })
640
621
  });
641
622
  case "time":
642
623
  return /* @__PURE__ */ jsx6(AntdForm.Item, {
643
624
  ...computedProps,
644
- children: /* @__PURE__ */ jsx6(TimeItem, {
625
+ children: /* @__PURE__ */ jsx6(TimePicker, {
645
626
  ...computedProps.input
646
627
  })
647
628
  });
@@ -688,7 +669,7 @@ function FormItem(props) {
688
669
  /* @__PURE__ */ jsx6(Row, {
689
670
  gutter: 24,
690
671
  children: computedProps.object.map((o) => /* @__PURE__ */ jsx6(Col, {
691
- span: o.col || 6,
672
+ span: o.col || 24,
692
673
  children: /* @__PURE__ */ jsx6(FormItem, {
693
674
  ...o,
694
675
  name: [field.name, o.id]
@@ -977,7 +958,7 @@ import {
977
958
  Skeleton as Skeleton3,
978
959
  Input as Input2
979
960
  } from "antd";
980
- import dayjs3 from "dayjs";
961
+ import dayjs2 from "dayjs";
981
962
  import { CheckOutlined as CheckOutlined2, CloseOutlined as CloseOutlined2 } from "@ant-design/icons";
982
963
  import {
983
964
  isNil as isNil2,
@@ -1227,17 +1208,17 @@ function Table(props) {
1227
1208
  if (!item.render)
1228
1209
  item.render = (value) => processValue(item, value);
1229
1210
  if (!item.onFilter)
1230
- item.onFilter = (value, row) => dayjs3(row[item.id]).isSame(dayjs3(value));
1211
+ item.onFilter = (value, row) => dayjs2(row[item.id]).isSame(dayjs2(value));
1231
1212
  if (!item.sorter)
1232
- item.sorter = (a, b) => dayjs3(a[item.id]).isBefore(b[item.id]) ? -1 : 1;
1213
+ item.sorter = (a, b) => dayjs2(a[item.id]).isBefore(b[item.id]) ? -1 : 1;
1233
1214
  break;
1234
1215
  case "time":
1235
1216
  if (!item.render)
1236
1217
  item.render = (value) => processValue(item, value);
1237
1218
  if (!item.onFilter)
1238
- item.onFilter = (value, row) => dayjs3(row[item.id]).isSame(dayjs3(value));
1219
+ item.onFilter = (value, row) => dayjs2(row[item.id]).isSame(dayjs2(value));
1239
1220
  if (!item.sorter)
1240
- item.sorter = (a, b) => dayjs3(a[item.id]).isBefore(b[item.id]) ? -1 : 1;
1221
+ item.sorter = (a, b) => dayjs2(a[item.id]).isBefore(b[item.id]) ? -1 : 1;
1241
1222
  break;
1242
1223
  case "object":
1243
1224
  if (!item.render)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/ant-design",
3
- "version": "0.0.2-beta.450",
3
+ "version": "0.0.2-beta.452",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -28,7 +28,7 @@
28
28
  "lodash": "*",
29
29
  "react": "*",
30
30
  "react-dom": "*",
31
- "@faasjs/react": "^0.0.2-beta.450",
31
+ "@faasjs/react": "^0.0.2-beta.452",
32
32
  "react-router-dom": "*",
33
33
  "dayjs": "*"
34
34
  },