@apexcura/ui-components 0.0.16-Beta61 → 0.0.16-Beta62

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
@@ -784,9 +784,14 @@ var Sidebar = (props) => {
784
784
  console.log(item);
785
785
  setSelectedKey(item.key);
786
786
  if (props.onChange) {
787
- props.onChange(item);
787
+ props.onChange(item.key);
788
788
  }
789
789
  };
790
+ (0, import_react16.useEffect)(() => {
791
+ if (props.value) {
792
+ setSelectedKey(props.value);
793
+ }
794
+ }, [props.value]);
790
795
  function getItem(label, key, icon, children, item) {
791
796
  return {
792
797
  key,
package/dist/index.mjs CHANGED
@@ -702,7 +702,7 @@ var AddMoreTable = (props) => {
702
702
  };
703
703
 
704
704
  // src/Components/Sidebar.tsx
705
- import React15, { useState as useState5 } from "react";
705
+ import React15, { useEffect as useEffect2, useState as useState5 } from "react";
706
706
  import { Layout, Menu } from "antd";
707
707
  var { Sider } = Layout;
708
708
  var Sidebar = (props) => {
@@ -712,9 +712,14 @@ var Sidebar = (props) => {
712
712
  console.log(item);
713
713
  setSelectedKey(item.key);
714
714
  if (props.onChange) {
715
- props.onChange(item);
715
+ props.onChange(item.key);
716
716
  }
717
717
  };
718
+ useEffect2(() => {
719
+ if (props.value) {
720
+ setSelectedKey(props.value);
721
+ }
722
+ }, [props.value]);
718
723
  function getItem(label, key, icon, children, item) {
719
724
  return {
720
725
  key,
@@ -829,12 +834,12 @@ var Navbar = (props) => {
829
834
  };
830
835
 
831
836
  // src/Components/TableElement.tsx
832
- import React20, { useState as useState6, useEffect as useEffect2 } from "react";
837
+ import React20, { useState as useState6, useEffect as useEffect3 } from "react";
833
838
  import { Table as Table2 } from "antd";
834
839
  var TableElement = (props) => {
835
840
  const { thead, tbody } = props;
836
841
  const [dataSource, setDataSource] = useState6([]);
837
- useEffect2(() => {
842
+ useEffect3(() => {
838
843
  if (tbody) {
839
844
  setDataSource(
840
845
  tbody.map((row, index) => ({
@@ -1178,7 +1183,7 @@ var Upload2 = (props) => {
1178
1183
  };
1179
1184
 
1180
1185
  // src/Components/OtpElement.tsx
1181
- import React30, { useState as useState11, useRef as useRef2, useEffect as useEffect3 } from "react";
1186
+ import React30, { useState as useState11, useRef as useRef2, useEffect as useEffect4 } from "react";
1182
1187
  import { Input as Input3 } from "antd";
1183
1188
  var OtpElement = (props) => {
1184
1189
  const length = props.length;
@@ -1215,7 +1220,7 @@ var OtpElement = (props) => {
1215
1220
  });
1216
1221
  }
1217
1222
  };
1218
- useEffect3(() => {
1223
+ useEffect4(() => {
1219
1224
  inputRefs.current[0]?.focus();
1220
1225
  }, []);
1221
1226
  return /* @__PURE__ */ React30.createElement("div", { className: props.containerClassName }, Array.from({ length }).map((_, index) => /* @__PURE__ */ React30.createElement(
@@ -1467,7 +1472,7 @@ var HorizontalBarChart = (props) => {
1467
1472
  };
1468
1473
 
1469
1474
  // src/Components/LineChart.tsx
1470
- import React34, { useEffect as useEffect4, useRef as useRef3 } from "react";
1475
+ import React34, { useEffect as useEffect5, useRef as useRef3 } from "react";
1471
1476
  import Chart from "chart.js/auto";
1472
1477
  var LineChart = (props) => {
1473
1478
  const chartRef = useRef3(null);
@@ -1478,7 +1483,7 @@ var LineChart = (props) => {
1478
1483
  { label: "Conversion Rate", data: [50, 100, 150, 180, 50] }
1479
1484
  ];
1480
1485
  const labels = ["Instagram", "Whatsapp", "Messages", "Telegram", "Linkedin"];
1481
- useEffect4(() => {
1486
+ useEffect5(() => {
1482
1487
  if (chartRef.current) {
1483
1488
  if (chartInstance.current) {
1484
1489
  chartInstance.current.destroy();
@@ -1540,12 +1545,12 @@ var LineChart = (props) => {
1540
1545
  };
1541
1546
 
1542
1547
  // src/Components/DoubleBarChart.tsx
1543
- import React35, { useEffect as useEffect5, useRef as useRef4 } from "react";
1548
+ import React35, { useEffect as useEffect6, useRef as useRef4 } from "react";
1544
1549
  import Chart2 from "chart.js/auto";
1545
1550
  var DoubleBarChart = (props) => {
1546
1551
  const chartRef = useRef4(null);
1547
1552
  const chartInstance = useRef4(null);
1548
- useEffect5(() => {
1553
+ useEffect6(() => {
1549
1554
  if (chartRef.current) {
1550
1555
  if (chartInstance.current) {
1551
1556
  chartInstance.current.destroy();
@@ -1696,11 +1701,11 @@ var DivContainer = (props) => {
1696
1701
  };
1697
1702
 
1698
1703
  // src/Components/ColorPickerElement.tsx
1699
- import React38, { useEffect as useEffect6, useState as useState12 } from "react";
1704
+ import React38, { useEffect as useEffect7, useState as useState12 } from "react";
1700
1705
  import { ColorPicker } from "antd";
1701
1706
  var ColorPickerElement = (props) => {
1702
1707
  const [val, setVal] = useState12(props.value);
1703
- useEffect6(() => {
1708
+ useEffect7(() => {
1704
1709
  if (props.value) {
1705
1710
  setVal(props.value);
1706
1711
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.16-Beta61",
3
+ "version": "0.0.16-Beta62",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",