@faasjs/ant-design 0.0.3-beta.75 → 0.0.3-beta.77

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
@@ -468,17 +468,15 @@ function Description(props) {
468
468
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Descriptions, {
469
469
  ...props,
470
470
  title: (0, import_lodash_es4.isFunction)(props.renderTitle) ? props.renderTitle(props.dataSource) : props.title,
471
- children: props.items.map((item) => {
472
- return !item.if || item.if(props.dataSource) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Descriptions.Item, {
473
- label: item.title || (0, import_lodash_es4.upperFirst)(item.id),
474
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DescriptionItemContent, {
475
- item,
476
- value: props.dataSource[item.id],
477
- values: props.dataSource,
478
- extendTypes: props.extendTypes
479
- })
480
- }, item.id) : null;
481
- }).filter(Boolean)
471
+ children: props.items.map((item) => item && (!item.if || item.if(props.dataSource)) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Descriptions.Item, {
472
+ label: item.title || (0, import_lodash_es4.upperFirst)(item.id),
473
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DescriptionItemContent, {
474
+ item,
475
+ value: props.dataSource[item.id],
476
+ values: props.dataSource,
477
+ extendTypes: props.extendTypes
478
+ })
479
+ }, item.id) : null).filter(Boolean)
482
480
  });
483
481
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FaasDataWrapper, {
484
482
  render: ({ data }) => {
@@ -1723,29 +1721,24 @@ function FaasDataTable({
1723
1721
 
1724
1722
  // src/Tabs.tsx
1725
1723
  var import_antd13 = require("antd");
1726
- var import_react14 = require("react");
1727
1724
  var import_jsx_runtime = require("react/jsx-runtime");
1728
1725
  function Tabs(props) {
1729
- const [items, setItems] = (0, import_react14.useState)([]);
1730
- (0, import_react14.useEffect)(() => {
1731
- setItems(props.items.filter(Boolean).map((item) => ({
1732
- ...item,
1733
- key: item.id,
1734
- label: item.title || item.id
1735
- })));
1736
- }, [props.items.filter(Boolean).map((i) => i.id).join("")]);
1737
1726
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd13.Tabs, {
1738
1727
  ...props,
1739
- items
1728
+ items: props.items.filter(Boolean).map((i) => ({
1729
+ ...i,
1730
+ key: i.key || i.id,
1731
+ label: i.label || i.title || i.id
1732
+ }))
1740
1733
  });
1741
1734
  }
1742
1735
 
1743
1736
  // src/Title.tsx
1744
- var import_react15 = require("react");
1737
+ var import_react14 = require("react");
1745
1738
  var import_jsx_runtime = require("react/jsx-runtime");
1746
1739
  function Title(props) {
1747
1740
  const { Title: Title2 } = useConfigContext();
1748
- (0, import_react15.useEffect)(() => {
1741
+ (0, import_react14.useEffect)(() => {
1749
1742
  const title = Array.isArray(props.title) ? props.title : [props.title];
1750
1743
  document.title = title.concat(props.suffix || Title2.suffix).filter((t) => !!t).join(props.separator || Title2.separator);
1751
1744
  }, [props]);
@@ -1765,7 +1758,7 @@ function Title(props) {
1765
1758
  children: Array.isArray(props.title) ? props.title[0] : props.title
1766
1759
  });
1767
1760
  if (props.children)
1768
- return (0, import_react15.cloneElement)(props.children, { title: props.title });
1761
+ return (0, import_react14.cloneElement)(props.children, { title: props.title });
1769
1762
  return null;
1770
1763
  }
1771
1764
  // Annotate the CommonJS export names for ESM import in node:
package/dist/index.mjs CHANGED
@@ -433,17 +433,15 @@ function Description(props) {
433
433
  return /* @__PURE__ */ jsx8(Descriptions, {
434
434
  ...props,
435
435
  title: isFunction(props.renderTitle) ? props.renderTitle(props.dataSource) : props.title,
436
- children: props.items.map((item) => {
437
- return !item.if || item.if(props.dataSource) ? /* @__PURE__ */ jsx8(Descriptions.Item, {
438
- label: item.title || upperFirst2(item.id),
439
- children: /* @__PURE__ */ jsx8(DescriptionItemContent, {
440
- item,
441
- value: props.dataSource[item.id],
442
- values: props.dataSource,
443
- extendTypes: props.extendTypes
444
- })
445
- }, item.id) : null;
446
- }).filter(Boolean)
436
+ children: props.items.map((item) => item && (!item.if || item.if(props.dataSource)) ? /* @__PURE__ */ jsx8(Descriptions.Item, {
437
+ label: item.title || upperFirst2(item.id),
438
+ children: /* @__PURE__ */ jsx8(DescriptionItemContent, {
439
+ item,
440
+ value: props.dataSource[item.id],
441
+ values: props.dataSource,
442
+ extendTypes: props.extendTypes
443
+ })
444
+ }, item.id) : null).filter(Boolean)
447
445
  });
448
446
  return /* @__PURE__ */ jsx8(FaasDataWrapper, {
449
447
  render: ({ data }) => {
@@ -1730,29 +1728,24 @@ function FaasDataTable({
1730
1728
 
1731
1729
  // src/Tabs.tsx
1732
1730
  import { Tabs as Origin2 } from "antd";
1733
- import { useEffect as useEffect7, useState as useState8 } from "react";
1734
1731
  import { jsx as jsx15 } from "react/jsx-runtime";
1735
1732
  function Tabs(props) {
1736
- const [items, setItems] = useState8([]);
1737
- useEffect7(() => {
1738
- setItems(props.items.filter(Boolean).map((item) => ({
1739
- ...item,
1740
- key: item.id,
1741
- label: item.title || item.id
1742
- })));
1743
- }, [props.items.filter(Boolean).map((i) => i.id).join("")]);
1744
1733
  return /* @__PURE__ */ jsx15(Origin2, {
1745
1734
  ...props,
1746
- items
1735
+ items: props.items.filter(Boolean).map((i) => ({
1736
+ ...i,
1737
+ key: i.key || i.id,
1738
+ label: i.label || i.title || i.id
1739
+ }))
1747
1740
  });
1748
1741
  }
1749
1742
 
1750
1743
  // src/Title.tsx
1751
- import { useEffect as useEffect8, cloneElement as cloneElement4 } from "react";
1744
+ import { useEffect as useEffect7, cloneElement as cloneElement4 } from "react";
1752
1745
  import { Fragment as Fragment6, jsx as jsx16 } from "react/jsx-runtime";
1753
1746
  function Title(props) {
1754
1747
  const { Title: Title2 } = useConfigContext();
1755
- useEffect8(() => {
1748
+ useEffect7(() => {
1756
1749
  const title = Array.isArray(props.title) ? props.title : [props.title];
1757
1750
  document.title = title.concat(props.suffix || Title2.suffix).filter((t) => !!t).join(props.separator || Title2.separator);
1758
1751
  }, [props]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/ant-design",
3
- "version": "0.0.3-beta.75",
3
+ "version": "0.0.3-beta.77",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",