@apexcura/ui-components 0.0.14-Beta176 → 0.0.14-Beta178

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/.env.defaults CHANGED
@@ -1,2 +1,2 @@
1
- GOOGLE_CLIENT_ID=1234
2
- GOOGLE_AUTH_ORIGINS=1234
1
+ GOOGLE_CLIENT_ID=1234
2
+ GOOGLE_AUTH_ORIGINS=1234
package/dist/index.css CHANGED
@@ -460,9 +460,6 @@ video {
460
460
  :where(.css-dev-only-do-not-override-1r287do).ant-radio-button-wrapper:first-child {
461
461
  border-inline-start: 1px solid rgb(145 145 145);
462
462
  }
463
- :where(.css-dev-only-do-not-override-m4timi).ant-tabs-top > .ant-tabs-nav {
464
- margin: 0px;
465
- }
466
463
  .hover\:bg-\[\#F2F2F2\]:hover {
467
464
  --tw-bg-opacity: 1;
468
465
  background-color: rgb(242 242 242 / var(--tw-bg-opacity));
package/dist/index.d.mts CHANGED
@@ -69,8 +69,6 @@ type ElementType = {
69
69
  fillText2?: string;
70
70
  labels?: any[];
71
71
  data?: any[];
72
- pagination?: boolean;
73
- is_detail?: boolean;
74
72
  };
75
73
 
76
74
  declare const TextElement: (props: ElementType) => React$1.JSX.Element;
@@ -134,8 +132,10 @@ declare const HorizontalBarChart: (props: ElementType) => React$1.JSX.Element;
134
132
 
135
133
  declare const LineChart: (props: ElementType) => React$1.JSX.Element;
136
134
 
135
+ declare const HighchartsLineChart: (props: ElementType) => React$1.JSX.Element;
136
+
137
137
  declare const DoubleBarChart: (props: ElementType) => React$1.JSX.Element;
138
138
 
139
139
  declare const BarChart: (props: ElementType) => React$1.JSX.Element;
140
140
 
141
- export { AddMoreTable, BarChart, ButtonElement, CheckboxElement, CircleDonut, CkEditor, DatePickerElement, DateRangePickerElement, DoubleBarChart, DropDownGroup, FileUpload, HorizontalBarChart, Image, LineChart, MultipleSelectElement, Navbar, NumberElement, OtpElement, PasswordElement, RadioElement, SelectElement, SemiCircleDonut, Sidebar, SingleCheckbox, SingleSelectElement, SwitchElement, TableElement, TabsElement, TextElement, TextareaElement, Upload };
141
+ export { AddMoreTable, BarChart, ButtonElement, CheckboxElement, CircleDonut, CkEditor, DatePickerElement, DateRangePickerElement, DoubleBarChart, DropDownGroup, FileUpload, HighchartsLineChart, HorizontalBarChart, Image, LineChart, MultipleSelectElement, Navbar, NumberElement, OtpElement, PasswordElement, RadioElement, SelectElement, SemiCircleDonut, Sidebar, SingleCheckbox, SingleSelectElement, SwitchElement, TableElement, TabsElement, TextElement, TextareaElement, Upload };
package/dist/index.d.ts CHANGED
@@ -69,8 +69,6 @@ type ElementType = {
69
69
  fillText2?: string;
70
70
  labels?: any[];
71
71
  data?: any[];
72
- pagination?: boolean;
73
- is_detail?: boolean;
74
72
  };
75
73
 
76
74
  declare const TextElement: (props: ElementType) => React$1.JSX.Element;
@@ -134,8 +132,10 @@ declare const HorizontalBarChart: (props: ElementType) => React$1.JSX.Element;
134
132
 
135
133
  declare const LineChart: (props: ElementType) => React$1.JSX.Element;
136
134
 
135
+ declare const HighchartsLineChart: (props: ElementType) => React$1.JSX.Element;
136
+
137
137
  declare const DoubleBarChart: (props: ElementType) => React$1.JSX.Element;
138
138
 
139
139
  declare const BarChart: (props: ElementType) => React$1.JSX.Element;
140
140
 
141
- export { AddMoreTable, BarChart, ButtonElement, CheckboxElement, CircleDonut, CkEditor, DatePickerElement, DateRangePickerElement, DoubleBarChart, DropDownGroup, FileUpload, HorizontalBarChart, Image, LineChart, MultipleSelectElement, Navbar, NumberElement, OtpElement, PasswordElement, RadioElement, SelectElement, SemiCircleDonut, Sidebar, SingleCheckbox, SingleSelectElement, SwitchElement, TableElement, TabsElement, TextElement, TextareaElement, Upload };
141
+ export { AddMoreTable, BarChart, ButtonElement, CheckboxElement, CircleDonut, CkEditor, DatePickerElement, DateRangePickerElement, DoubleBarChart, DropDownGroup, FileUpload, HighchartsLineChart, HorizontalBarChart, Image, LineChart, MultipleSelectElement, Navbar, NumberElement, OtpElement, PasswordElement, RadioElement, SelectElement, SemiCircleDonut, Sidebar, SingleCheckbox, SingleSelectElement, SwitchElement, TableElement, TabsElement, TextElement, TextareaElement, Upload };
package/dist/index.js CHANGED
@@ -41,6 +41,7 @@ __export(src_exports, {
41
41
  DoubleBarChart: () => DoubleBarChart,
42
42
  DropDownGroup: () => DropDownGroup,
43
43
  FileUpload: () => FileUpload,
44
+ HighchartsLineChart: () => HighchartsLineChart,
44
45
  HorizontalBarChart: () => HorizontalBarChart,
45
46
  Image: () => Image,
46
47
  LineChart: () => LineChart,
@@ -385,9 +386,7 @@ var MultipleSelectElement = (props) => {
385
386
  var import_react11 = __toESM(require("react"));
386
387
  var ButtonElement = (props) => {
387
388
  const [svgContent, setSvgContent] = (0, import_react11.useState)(null);
388
- const [originalSvgContent, setOriginalSvgContent] = (0, import_react11.useState)(
389
- null
390
- );
389
+ const [originalSvgContent, setOriginalSvgContent] = (0, import_react11.useState)(null);
391
390
  const [hoverColor, setHoverColor] = (0, import_react11.useState)(null);
392
391
  (0, import_react11.useEffect)(() => {
393
392
  if (props.icon) {
@@ -452,14 +451,12 @@ var ButtonElement = (props) => {
452
451
  cursor: props.loading ? "no-drop" : "pointer"
453
452
  }
454
453
  },
455
- props.isLoading ? /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, /* @__PURE__ */ import_react11.default.createElement("svg", { className: "animate-spin h-5 w-5 mr-3", viewBox: "0 0 24 24" }), props.label) : /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, props.isSVGStylesOverride === false ? props.icon ? /* @__PURE__ */ import_react11.default.createElement(
456
- "img",
454
+ props.isLoading ? /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, /* @__PURE__ */ import_react11.default.createElement("svg", { className: "animate-spin h-5 w-5 mr-3", viewBox: "0 0 24 24" }), props.label) : /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, props.isSVGStylesOverride === false ? props.icon && /* @__PURE__ */ import_react11.default.createElement("img", { className: props.iconsClassName, src: props.icon, alt: props.label }) : svgContent && /* @__PURE__ */ import_react11.default.createElement(
455
+ "span",
457
456
  {
458
- className: props.iconsClassName,
459
- src: props.icon,
460
- alt: props.label
457
+ dangerouslySetInnerHTML: { __html: svgContent }
461
458
  }
462
- ) : /* @__PURE__ */ import_react11.default.createElement("img", { src: "", alt: "", className: props.iconsClassName }) : svgContent && /* @__PURE__ */ import_react11.default.createElement("span", { dangerouslySetInnerHTML: { __html: svgContent } }), props.label)
459
+ ), props.label)
463
460
  );
464
461
  };
465
462
 
@@ -723,22 +720,9 @@ var ModelElement = (props) => {
723
720
  margin: "-10px"
724
721
  }
725
722
  },
726
- columns.map((eachColumn) => {
727
- if (!["index", "View"].includes(eachColumn.key) && eachColumn?.["is_detail"] !== false) {
728
- return /* @__PURE__ */ import_react19.default.createElement("p", { style: { fontWeight: "500", padding: "10px" } }, /* @__PURE__ */ import_react19.default.createElement(
729
- "span",
730
- {
731
- style: {
732
- fontWeight: "200",
733
- color: "gray",
734
- paddingRight: "10px"
735
- }
736
- },
737
- eachColumn.title
738
- ), selectedRecord[eachColumn.key] !== "" ? selectedRecord[eachColumn.key] : "--");
739
- } else {
740
- return null;
741
- }
723
+ Object.entries(selectedRecord).map(([key, value]) => {
724
+ const record = columns.filter((eachColumn) => eachColumn.key === key);
725
+ return record.length > 0 ? /* @__PURE__ */ import_react19.default.createElement("p", { style: { fontWeight: "500", padding: "10px" }, key }, /* @__PURE__ */ import_react19.default.createElement("span", { style: { fontWeight: "200", color: "gray", paddingRight: "10px" } }, record[0].title), String(value)) : "";
742
726
  })
743
727
  )
744
728
  },
@@ -747,24 +731,12 @@ var ModelElement = (props) => {
747
731
  };
748
732
 
749
733
  // src/Components/TableElement.tsx
750
- var import_icons4 = require("@ant-design/icons");
751
734
  var TableElement = (props) => {
752
735
  const { thead, tbody } = props;
753
736
  const [selectedRecord, setSelectedRecord] = (0, import_react20.useState)({});
754
737
  const [model, setModel] = (0, import_react20.useState)(false);
755
- const [dataSource, setDataSource] = (0, import_react20.useState)([]);
756
- (0, import_react20.useEffect)(() => {
757
- if (tbody) {
758
- setDataSource(
759
- tbody.map((row, index) => ({
760
- ...row,
761
- key: index,
762
- index: index + 1
763
- }))
764
- );
765
- }
766
- }, [tbody]);
767
738
  const handleChange = (record) => {
739
+ console.log("record", record);
768
740
  if (props.onChange) {
769
741
  props.onChange(record);
770
742
  }
@@ -774,8 +746,8 @@ var TableElement = (props) => {
774
746
  columns = [
775
747
  {
776
748
  title: "#",
777
- dataIndex: "index",
778
- key: "index",
749
+ dataIndex: "#",
750
+ key: "#",
779
751
  fixed: "left"
780
752
  },
781
753
  ...thead.map((col, ind) => ({
@@ -786,9 +758,9 @@ var TableElement = (props) => {
786
758
  render: col.render,
787
759
  sorter: {
788
760
  compare: (a, b) => {
789
- if (typeof a[col.key] === "number" && typeof b[col.key] === "number") {
761
+ if (typeof a[col.key] === "number" && typeof a[col.key] === "number") {
790
762
  return a[col.key] - b[col.key];
791
- } else if (typeof a[col.key] === "string" && typeof b[col.key] === "string") {
763
+ } else if (typeof a[col.key] === "string" && typeof a[col.key] === "string") {
792
764
  return a[col.key].localeCompare(b[col.key]);
793
765
  }
794
766
  }
@@ -800,34 +772,26 @@ var TableElement = (props) => {
800
772
  title: "View",
801
773
  dataIndex: "View",
802
774
  key: "View",
803
- render: (_, record) => {
804
- return /* @__PURE__ */ import_react20.default.createElement(
805
- "a",
806
- {
807
- onClick: () => {
808
- if (props.view) {
809
- setSelectedRecord(record);
810
- handleChange(record);
811
- setModel(true);
812
- }
813
- }
814
- },
815
- /* @__PURE__ */ import_react20.default.createElement(import_icons4.EyeOutlined, null)
816
- );
817
- }
775
+ render: (_, record) => /* @__PURE__ */ import_react20.default.createElement(
776
+ "a",
777
+ {
778
+ onClick: () => {
779
+ setSelectedRecord(record);
780
+ handleChange(record);
781
+ setModel(true);
782
+ }
783
+ },
784
+ "View"
785
+ )
818
786
  });
819
787
  }
820
788
  }
821
- const onChangeTable = (pagination, filters, sorter, extra) => {
822
- if (extra && extra.currentDataSource) {
823
- setDataSource(
824
- extra.currentDataSource.map((row, index) => ({
825
- ...row,
826
- index: index + 1
827
- }))
828
- );
829
- }
830
- };
789
+ const dataSource = tbody && tbody.map((row, index) => ({
790
+ ...row,
791
+ key: index + 1,
792
+ [columns[0].key]: index + 1
793
+ }));
794
+ const count = dataSource ? dataSource.length : 0;
831
795
  const onChangePage = (page, pageSize) => {
832
796
  if (props.onChange) {
833
797
  props.onChange({ name: "pagination", page, pageSize });
@@ -835,11 +799,7 @@ var TableElement = (props) => {
835
799
  };
836
800
  const rowSelectionConfig = props.rowSelection ? {
837
801
  onChange: (selectedRowKeys, selectedRows) => {
838
- console.log(
839
- `selectedRowKeys: ${selectedRowKeys}`,
840
- "selectedRows: ",
841
- selectedRows
842
- );
802
+ console.log(`selectedRowKeys: ${selectedRowKeys}`, "selectedRows: ", selectedRows);
843
803
  if (props.onChange) {
844
804
  props.onChange(selectedRows);
845
805
  }
@@ -849,43 +809,19 @@ var TableElement = (props) => {
849
809
  import_antd14.Table,
850
810
  {
851
811
  className: props.className,
852
- ...props.pagination && {
853
- pagination: {
854
- showTotal: (total) => `Total: ${total} items`,
855
- total: props.count,
856
- showSizeChanger: props.count ? props.count > 10 : false,
857
- onChange: onChangePage
858
- }
859
- },
860
- onRow: (record) => {
861
- return {
862
- onClick: () => {
863
- if (props.view) {
864
- setSelectedRecord(record);
865
- handleChange(record);
866
- setModel(true);
867
- }
868
- },
869
- style: { cursor: "pointer" }
870
- };
812
+ pagination: {
813
+ showTotal: (total) => `Total: ${total} items`,
814
+ total: count,
815
+ showSizeChanger: count > 10,
816
+ onChange: onChangePage
871
817
  },
872
818
  rowSelection: rowSelectionConfig,
873
819
  dataSource,
874
820
  columns,
875
821
  size: props.size,
876
- bordered: true,
877
- onChange: onChangeTable
878
- }
879
- ), model && /* @__PURE__ */ import_react20.default.createElement(
880
- ModelElement,
881
- {
882
- selectedRecord,
883
- ...props,
884
- columns,
885
- model,
886
- onCancel: () => setModel(false)
822
+ bordered: true
887
823
  }
888
- ));
824
+ ), model && /* @__PURE__ */ import_react20.default.createElement(ModelElement, { selectedRecord, ...props, columns, model, onCancel: () => setModel(false) }));
889
825
  };
890
826
 
891
827
  // src/Components/DatePicker.tsx
@@ -1019,7 +955,7 @@ var DropDownGroup = (props) => {
1019
955
  // src/Components/FilesUpload.tsx
1020
956
  var import_react26 = __toESM(require("react"));
1021
957
  var import_antd19 = require("antd");
1022
- var import_icons5 = require("@ant-design/icons");
958
+ var import_icons4 = require("@ant-design/icons");
1023
959
  var FileUpload = (props) => {
1024
960
  const { Dragger } = import_antd19.Upload;
1025
961
  const [files, setFiles] = (0, import_react26.useState)([]);
@@ -1050,7 +986,7 @@ var FileUpload = (props) => {
1050
986
  showUploadList: true,
1051
987
  customRequest
1052
988
  },
1053
- /* @__PURE__ */ import_react26.default.createElement("p", null, /* @__PURE__ */ import_react26.default.createElement(import_icons5.InboxOutlined, null)),
989
+ /* @__PURE__ */ import_react26.default.createElement("p", null, /* @__PURE__ */ import_react26.default.createElement(import_icons4.InboxOutlined, null)),
1054
990
  /* @__PURE__ */ import_react26.default.createElement("p", null, "Click or drag file to upload")
1055
991
  ));
1056
992
  };
@@ -1447,13 +1383,21 @@ var LineChart = (props) => {
1447
1383
  return /* @__PURE__ */ import_react34.default.createElement("div", { className: props.className }, /* @__PURE__ */ import_react34.default.createElement("canvas", { ref: chartRef }));
1448
1384
  };
1449
1385
 
1450
- // src/Components/DoubleBarChart.tsx
1386
+ // src/Components/highchart.tsx
1451
1387
  var import_react35 = __toESM(require("react"));
1388
+ var import_highcharts = __toESM(require("highcharts"));
1389
+ var import_highcharts_react_official = __toESM(require("highcharts-react-official"));
1390
+ var HighchartsLineChart = (props) => {
1391
+ return /* @__PURE__ */ import_react35.default.createElement("div", { className: props.className }, /* @__PURE__ */ import_react35.default.createElement(import_highcharts_react_official.default, { highcharts: import_highcharts.default, options: props.graph_data }));
1392
+ };
1393
+
1394
+ // src/Components/DoubleBarChart.tsx
1395
+ var import_react36 = __toESM(require("react"));
1452
1396
  var import_auto2 = __toESM(require("chart.js/auto"));
1453
1397
  var DoubleBarChart = (props) => {
1454
- const chartRef = (0, import_react35.useRef)(null);
1455
- const chartInstance = (0, import_react35.useRef)(null);
1456
- (0, import_react35.useEffect)(() => {
1398
+ const chartRef = (0, import_react36.useRef)(null);
1399
+ const chartInstance = (0, import_react36.useRef)(null);
1400
+ (0, import_react36.useEffect)(() => {
1457
1401
  if (chartRef.current) {
1458
1402
  if (chartInstance.current) {
1459
1403
  chartInstance.current.destroy();
@@ -1522,11 +1466,11 @@ var DoubleBarChart = (props) => {
1522
1466
  }
1523
1467
  };
1524
1468
  }, []);
1525
- return /* @__PURE__ */ import_react35.default.createElement("div", { className: props.className }, /* @__PURE__ */ import_react35.default.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ import_react35.default.createElement("canvas", { ref: chartRef }));
1469
+ return /* @__PURE__ */ import_react36.default.createElement("div", { className: props.className }, /* @__PURE__ */ import_react36.default.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ import_react36.default.createElement("canvas", { ref: chartRef }));
1526
1470
  };
1527
1471
 
1528
1472
  // src/Components/BarChart.tsx
1529
- var import_react36 = __toESM(require("react"));
1473
+ var import_react37 = __toESM(require("react"));
1530
1474
  var import_react_chartjs_24 = require("react-chartjs-2");
1531
1475
  var import_chart4 = require("chart.js");
1532
1476
  import_chart4.Chart.register(import_chart4.BarElement, import_chart4.CategoryScale, import_chart4.LinearScale, import_chart4.Tooltip);
@@ -1588,7 +1532,7 @@ var BarChart = (props) => {
1588
1532
  }
1589
1533
  }
1590
1534
  };
1591
- return /* @__PURE__ */ import_react36.default.createElement("div", { className: props.className }, /* @__PURE__ */ import_react36.default.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ import_react36.default.createElement(import_react_chartjs_24.Bar, { data, options }));
1535
+ return /* @__PURE__ */ import_react37.default.createElement("div", { className: props.className }, /* @__PURE__ */ import_react37.default.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ import_react37.default.createElement(import_react_chartjs_24.Bar, { data, options }));
1592
1536
  };
1593
1537
  // Annotate the CommonJS export names for ESM import in node:
1594
1538
  0 && (module.exports = {
@@ -1603,6 +1547,7 @@ var BarChart = (props) => {
1603
1547
  DoubleBarChart,
1604
1548
  DropDownGroup,
1605
1549
  FileUpload,
1550
+ HighchartsLineChart,
1606
1551
  HorizontalBarChart,
1607
1552
  Image,
1608
1553
  LineChart,
package/dist/index.mjs CHANGED
@@ -319,9 +319,7 @@ var MultipleSelectElement = (props) => {
319
319
  import React11, { useEffect, useState as useState4 } from "react";
320
320
  var ButtonElement = (props) => {
321
321
  const [svgContent, setSvgContent] = useState4(null);
322
- const [originalSvgContent, setOriginalSvgContent] = useState4(
323
- null
324
- );
322
+ const [originalSvgContent, setOriginalSvgContent] = useState4(null);
325
323
  const [hoverColor, setHoverColor] = useState4(null);
326
324
  useEffect(() => {
327
325
  if (props.icon) {
@@ -386,14 +384,12 @@ var ButtonElement = (props) => {
386
384
  cursor: props.loading ? "no-drop" : "pointer"
387
385
  }
388
386
  },
389
- props.isLoading ? /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement("svg", { className: "animate-spin h-5 w-5 mr-3", viewBox: "0 0 24 24" }), props.label) : /* @__PURE__ */ React11.createElement(React11.Fragment, null, props.isSVGStylesOverride === false ? props.icon ? /* @__PURE__ */ React11.createElement(
390
- "img",
387
+ props.isLoading ? /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement("svg", { className: "animate-spin h-5 w-5 mr-3", viewBox: "0 0 24 24" }), props.label) : /* @__PURE__ */ React11.createElement(React11.Fragment, null, props.isSVGStylesOverride === false ? props.icon && /* @__PURE__ */ React11.createElement("img", { className: props.iconsClassName, src: props.icon, alt: props.label }) : svgContent && /* @__PURE__ */ React11.createElement(
388
+ "span",
391
389
  {
392
- className: props.iconsClassName,
393
- src: props.icon,
394
- alt: props.label
390
+ dangerouslySetInnerHTML: { __html: svgContent }
395
391
  }
396
- ) : /* @__PURE__ */ React11.createElement("img", { src: "", alt: "", className: props.iconsClassName }) : svgContent && /* @__PURE__ */ React11.createElement("span", { dangerouslySetInnerHTML: { __html: svgContent } }), props.label)
392
+ ), props.label)
397
393
  );
398
394
  };
399
395
 
@@ -612,7 +608,7 @@ var Navbar = (props) => {
612
608
  };
613
609
 
614
610
  // src/Components/TableElement.tsx
615
- import React20, { useState as useState6, useEffect as useEffect3 } from "react";
611
+ import React20, { useState as useState6 } from "react";
616
612
  import { Table as Table2 } from "antd";
617
613
 
618
614
  // src/Components/Model.tsx
@@ -657,22 +653,9 @@ var ModelElement = (props) => {
657
653
  margin: "-10px"
658
654
  }
659
655
  },
660
- columns.map((eachColumn) => {
661
- if (!["index", "View"].includes(eachColumn.key) && eachColumn?.["is_detail"] !== false) {
662
- return /* @__PURE__ */ React19.createElement("p", { style: { fontWeight: "500", padding: "10px" } }, /* @__PURE__ */ React19.createElement(
663
- "span",
664
- {
665
- style: {
666
- fontWeight: "200",
667
- color: "gray",
668
- paddingRight: "10px"
669
- }
670
- },
671
- eachColumn.title
672
- ), selectedRecord[eachColumn.key] !== "" ? selectedRecord[eachColumn.key] : "--");
673
- } else {
674
- return null;
675
- }
656
+ Object.entries(selectedRecord).map(([key, value]) => {
657
+ const record = columns.filter((eachColumn) => eachColumn.key === key);
658
+ return record.length > 0 ? /* @__PURE__ */ React19.createElement("p", { style: { fontWeight: "500", padding: "10px" }, key }, /* @__PURE__ */ React19.createElement("span", { style: { fontWeight: "200", color: "gray", paddingRight: "10px" } }, record[0].title), String(value)) : "";
676
659
  })
677
660
  )
678
661
  },
@@ -681,24 +664,12 @@ var ModelElement = (props) => {
681
664
  };
682
665
 
683
666
  // src/Components/TableElement.tsx
684
- import { EyeOutlined } from "@ant-design/icons";
685
667
  var TableElement = (props) => {
686
668
  const { thead, tbody } = props;
687
669
  const [selectedRecord, setSelectedRecord] = useState6({});
688
670
  const [model, setModel] = useState6(false);
689
- const [dataSource, setDataSource] = useState6([]);
690
- useEffect3(() => {
691
- if (tbody) {
692
- setDataSource(
693
- tbody.map((row, index) => ({
694
- ...row,
695
- key: index,
696
- index: index + 1
697
- }))
698
- );
699
- }
700
- }, [tbody]);
701
671
  const handleChange = (record) => {
672
+ console.log("record", record);
702
673
  if (props.onChange) {
703
674
  props.onChange(record);
704
675
  }
@@ -708,8 +679,8 @@ var TableElement = (props) => {
708
679
  columns = [
709
680
  {
710
681
  title: "#",
711
- dataIndex: "index",
712
- key: "index",
682
+ dataIndex: "#",
683
+ key: "#",
713
684
  fixed: "left"
714
685
  },
715
686
  ...thead.map((col, ind) => ({
@@ -720,9 +691,9 @@ var TableElement = (props) => {
720
691
  render: col.render,
721
692
  sorter: {
722
693
  compare: (a, b) => {
723
- if (typeof a[col.key] === "number" && typeof b[col.key] === "number") {
694
+ if (typeof a[col.key] === "number" && typeof a[col.key] === "number") {
724
695
  return a[col.key] - b[col.key];
725
- } else if (typeof a[col.key] === "string" && typeof b[col.key] === "string") {
696
+ } else if (typeof a[col.key] === "string" && typeof a[col.key] === "string") {
726
697
  return a[col.key].localeCompare(b[col.key]);
727
698
  }
728
699
  }
@@ -734,34 +705,26 @@ var TableElement = (props) => {
734
705
  title: "View",
735
706
  dataIndex: "View",
736
707
  key: "View",
737
- render: (_, record) => {
738
- return /* @__PURE__ */ React20.createElement(
739
- "a",
740
- {
741
- onClick: () => {
742
- if (props.view) {
743
- setSelectedRecord(record);
744
- handleChange(record);
745
- setModel(true);
746
- }
747
- }
748
- },
749
- /* @__PURE__ */ React20.createElement(EyeOutlined, null)
750
- );
751
- }
708
+ render: (_, record) => /* @__PURE__ */ React20.createElement(
709
+ "a",
710
+ {
711
+ onClick: () => {
712
+ setSelectedRecord(record);
713
+ handleChange(record);
714
+ setModel(true);
715
+ }
716
+ },
717
+ "View"
718
+ )
752
719
  });
753
720
  }
754
721
  }
755
- const onChangeTable = (pagination, filters, sorter, extra) => {
756
- if (extra && extra.currentDataSource) {
757
- setDataSource(
758
- extra.currentDataSource.map((row, index) => ({
759
- ...row,
760
- index: index + 1
761
- }))
762
- );
763
- }
764
- };
722
+ const dataSource = tbody && tbody.map((row, index) => ({
723
+ ...row,
724
+ key: index + 1,
725
+ [columns[0].key]: index + 1
726
+ }));
727
+ const count = dataSource ? dataSource.length : 0;
765
728
  const onChangePage = (page, pageSize) => {
766
729
  if (props.onChange) {
767
730
  props.onChange({ name: "pagination", page, pageSize });
@@ -769,11 +732,7 @@ var TableElement = (props) => {
769
732
  };
770
733
  const rowSelectionConfig = props.rowSelection ? {
771
734
  onChange: (selectedRowKeys, selectedRows) => {
772
- console.log(
773
- `selectedRowKeys: ${selectedRowKeys}`,
774
- "selectedRows: ",
775
- selectedRows
776
- );
735
+ console.log(`selectedRowKeys: ${selectedRowKeys}`, "selectedRows: ", selectedRows);
777
736
  if (props.onChange) {
778
737
  props.onChange(selectedRows);
779
738
  }
@@ -783,43 +742,19 @@ var TableElement = (props) => {
783
742
  Table2,
784
743
  {
785
744
  className: props.className,
786
- ...props.pagination && {
787
- pagination: {
788
- showTotal: (total) => `Total: ${total} items`,
789
- total: props.count,
790
- showSizeChanger: props.count ? props.count > 10 : false,
791
- onChange: onChangePage
792
- }
793
- },
794
- onRow: (record) => {
795
- return {
796
- onClick: () => {
797
- if (props.view) {
798
- setSelectedRecord(record);
799
- handleChange(record);
800
- setModel(true);
801
- }
802
- },
803
- style: { cursor: "pointer" }
804
- };
745
+ pagination: {
746
+ showTotal: (total) => `Total: ${total} items`,
747
+ total: count,
748
+ showSizeChanger: count > 10,
749
+ onChange: onChangePage
805
750
  },
806
751
  rowSelection: rowSelectionConfig,
807
752
  dataSource,
808
753
  columns,
809
754
  size: props.size,
810
- bordered: true,
811
- onChange: onChangeTable
812
- }
813
- ), model && /* @__PURE__ */ React20.createElement(
814
- ModelElement,
815
- {
816
- selectedRecord,
817
- ...props,
818
- columns,
819
- model,
820
- onCancel: () => setModel(false)
755
+ bordered: true
821
756
  }
822
- ));
757
+ ), model && /* @__PURE__ */ React20.createElement(ModelElement, { selectedRecord, ...props, columns, model, onCancel: () => setModel(false) }));
823
758
  };
824
759
 
825
760
  // src/Components/DatePicker.tsx
@@ -1038,7 +973,7 @@ var Upload2 = (props) => {
1038
973
  };
1039
974
 
1040
975
  // src/Components/OtpElement.tsx
1041
- import React30, { useState as useState11, useRef, useEffect as useEffect4 } from "react";
976
+ import React30, { useState as useState11, useRef, useEffect as useEffect3 } from "react";
1042
977
  import { Input as Input3 } from "antd";
1043
978
  var OtpElement = (props) => {
1044
979
  const length = props.length;
@@ -1075,7 +1010,7 @@ var OtpElement = (props) => {
1075
1010
  });
1076
1011
  }
1077
1012
  };
1078
- useEffect4(() => {
1013
+ useEffect3(() => {
1079
1014
  inputRefs.current[0]?.focus();
1080
1015
  }, []);
1081
1016
  return /* @__PURE__ */ React30.createElement("div", { className: props.containerClassName }, Array.from({ length }).map((_, index) => /* @__PURE__ */ React30.createElement(
@@ -1327,7 +1262,7 @@ var HorizontalBarChart = (props) => {
1327
1262
  };
1328
1263
 
1329
1264
  // src/Components/LineChart.tsx
1330
- import React34, { useEffect as useEffect5, useRef as useRef2 } from "react";
1265
+ import React34, { useEffect as useEffect4, useRef as useRef2 } from "react";
1331
1266
  import Chart from "chart.js/auto";
1332
1267
  var LineChart = (props) => {
1333
1268
  const chartRef = useRef2(null);
@@ -1338,7 +1273,7 @@ var LineChart = (props) => {
1338
1273
  { label: "Conversion Rate", data: [50, 100, 150, 180, 50] }
1339
1274
  ];
1340
1275
  const labels = ["Instagram", "Whatsapp", "Messages", "Telegram", "Linkedin"];
1341
- useEffect5(() => {
1276
+ useEffect4(() => {
1342
1277
  if (chartRef.current) {
1343
1278
  if (chartInstance.current) {
1344
1279
  chartInstance.current.destroy();
@@ -1399,13 +1334,21 @@ var LineChart = (props) => {
1399
1334
  return /* @__PURE__ */ React34.createElement("div", { className: props.className }, /* @__PURE__ */ React34.createElement("canvas", { ref: chartRef }));
1400
1335
  };
1401
1336
 
1337
+ // src/Components/highchart.tsx
1338
+ import React35 from "react";
1339
+ import Highcharts from "highcharts";
1340
+ import HighchartsReact from "highcharts-react-official";
1341
+ var HighchartsLineChart = (props) => {
1342
+ return /* @__PURE__ */ React35.createElement("div", { className: props.className }, /* @__PURE__ */ React35.createElement(HighchartsReact, { highcharts: Highcharts, options: props.graph_data }));
1343
+ };
1344
+
1402
1345
  // src/Components/DoubleBarChart.tsx
1403
- import React35, { useEffect as useEffect6, useRef as useRef3 } from "react";
1346
+ import React36, { useEffect as useEffect5, useRef as useRef3 } from "react";
1404
1347
  import Chart2 from "chart.js/auto";
1405
1348
  var DoubleBarChart = (props) => {
1406
1349
  const chartRef = useRef3(null);
1407
1350
  const chartInstance = useRef3(null);
1408
- useEffect6(() => {
1351
+ useEffect5(() => {
1409
1352
  if (chartRef.current) {
1410
1353
  if (chartInstance.current) {
1411
1354
  chartInstance.current.destroy();
@@ -1474,11 +1417,11 @@ var DoubleBarChart = (props) => {
1474
1417
  }
1475
1418
  };
1476
1419
  }, []);
1477
- return /* @__PURE__ */ React35.createElement("div", { className: props.className }, /* @__PURE__ */ React35.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ React35.createElement("canvas", { ref: chartRef }));
1420
+ return /* @__PURE__ */ React36.createElement("div", { className: props.className }, /* @__PURE__ */ React36.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ React36.createElement("canvas", { ref: chartRef }));
1478
1421
  };
1479
1422
 
1480
1423
  // src/Components/BarChart.tsx
1481
- import React36 from "react";
1424
+ import React37 from "react";
1482
1425
  import { Bar as Bar2 } from "react-chartjs-2";
1483
1426
  import {
1484
1427
  Chart as ChartJS4,
@@ -1546,7 +1489,7 @@ var BarChart = (props) => {
1546
1489
  }
1547
1490
  }
1548
1491
  };
1549
- return /* @__PURE__ */ React36.createElement("div", { className: props.className }, /* @__PURE__ */ React36.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ React36.createElement(Bar2, { data, options }));
1492
+ return /* @__PURE__ */ React37.createElement("div", { className: props.className }, /* @__PURE__ */ React37.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ React37.createElement(Bar2, { data, options }));
1550
1493
  };
1551
1494
  export {
1552
1495
  AddMoreTable,
@@ -1560,6 +1503,7 @@ export {
1560
1503
  DoubleBarChart,
1561
1504
  DropDownGroup,
1562
1505
  FileUpload,
1506
+ HighchartsLineChart,
1563
1507
  HorizontalBarChart,
1564
1508
  Image,
1565
1509
  LineChart,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.14-Beta176",
3
+ "version": "0.0.14-Beta178",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",
package/postcss.config.js CHANGED
@@ -1,6 +1,6 @@
1
- module.exports = {
2
- plugins: {
3
- tailwindcss: {},
4
- autoprefixer: {},
5
- },
6
- }
1
+ module.exports = {
2
+ plugins: {
3
+ tailwindcss: {},
4
+ autoprefixer: {},
5
+ },
6
+ }
@@ -1,10 +1,10 @@
1
- /** @type {import('tailwindcss').Config} */
2
- module.exports = {
3
-
4
- content: ['./src/**/*.{js,jsx,ts,tsx}'],
5
- theme: {
6
- extend: {},
7
- },
8
- plugins: [],
9
- }
10
-
1
+ /** @type {import('tailwindcss').Config} */
2
+ module.exports = {
3
+
4
+ content: ['./src/**/*.{js,jsx,ts,tsx}'],
5
+ theme: {
6
+ extend: {},
7
+ },
8
+ plugins: [],
9
+ }
10
+