@apexcura/ui-components 0.0.11-Beta157 → 0.0.11-Beta158

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
@@ -613,21 +613,35 @@ var import_react19 = __toESM(require("react"));
613
613
  var import_antd14 = require("antd");
614
614
  var TableElement = (props) => {
615
615
  const { thead, tbody } = props;
616
- const columns = [{
617
- title: "#",
618
- dataIndex: "#",
619
- key: "#"
620
- }];
621
- thead && thead.map((col) => ({
622
- title: col.label,
623
- dataIndex: col.name,
624
- key: col.key
625
- }));
616
+ let columns = [];
617
+ if (thead) {
618
+ columns = [
619
+ {
620
+ title: "#",
621
+ dataIndex: "#",
622
+ key: "#"
623
+ },
624
+ ...thead.map((col) => ({
625
+ title: col.label,
626
+ dataIndex: col.name,
627
+ key: col.key
628
+ }))
629
+ ];
630
+ }
626
631
  const dataSource = tbody && tbody.map((row, index) => ({
627
632
  ...row,
628
633
  [thead && thead[0].key]: index + 1
629
634
  }));
630
- return /* @__PURE__ */ import_react19.default.createElement(import_antd14.Table, { dataSource, columns, bordered: true, pagination: false, size: props.size && props.size });
635
+ return /* @__PURE__ */ import_react19.default.createElement(
636
+ import_antd14.Table,
637
+ {
638
+ dataSource,
639
+ columns,
640
+ bordered: true,
641
+ pagination: false,
642
+ size: props.size && props.size
643
+ }
644
+ );
631
645
  };
632
646
 
633
647
  // src/Components/DatePicker.tsx
package/dist/index.mjs CHANGED
@@ -562,21 +562,35 @@ import React18 from "react";
562
562
  import { Table as Table2 } from "antd";
563
563
  var TableElement = (props) => {
564
564
  const { thead, tbody } = props;
565
- const columns = [{
566
- title: "#",
567
- dataIndex: "#",
568
- key: "#"
569
- }];
570
- thead && thead.map((col) => ({
571
- title: col.label,
572
- dataIndex: col.name,
573
- key: col.key
574
- }));
565
+ let columns = [];
566
+ if (thead) {
567
+ columns = [
568
+ {
569
+ title: "#",
570
+ dataIndex: "#",
571
+ key: "#"
572
+ },
573
+ ...thead.map((col) => ({
574
+ title: col.label,
575
+ dataIndex: col.name,
576
+ key: col.key
577
+ }))
578
+ ];
579
+ }
575
580
  const dataSource = tbody && tbody.map((row, index) => ({
576
581
  ...row,
577
582
  [thead && thead[0].key]: index + 1
578
583
  }));
579
- return /* @__PURE__ */ React18.createElement(Table2, { dataSource, columns, bordered: true, pagination: false, size: props.size && props.size });
584
+ return /* @__PURE__ */ React18.createElement(
585
+ Table2,
586
+ {
587
+ dataSource,
588
+ columns,
589
+ bordered: true,
590
+ pagination: false,
591
+ size: props.size && props.size
592
+ }
593
+ );
580
594
  };
581
595
 
582
596
  // src/Components/DatePicker.tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.11-Beta157",
3
+ "version": "0.0.11-Beta158",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",