@undp/carbon-library 1.0.135-CARBON-343.14 → 1.0.135-CARBON-343.15

Sign up to get free protection for your applications and to get access to all the features.
package/dist/cjs/index.js CHANGED
@@ -23636,6 +23636,7 @@ var NdcDetailsComponent = function (props) {
23636
23636
  var _c = React.useState([]), periodItems = _c[0], setPeriodItems = _c[1];
23637
23637
  var _d = React.useState("add_new"), selectedTab = _d[0], setSelectedTab = _d[1];
23638
23638
  var selectedPeriod = React.useRef({});
23639
+ var addedNdcDetailId = React.useRef(0);
23639
23640
  var userInfoState = useUserContext().userInfoState;
23640
23641
  var isAddRangeVisible = function () {
23641
23642
  return (((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.MINISTRY ||
@@ -23698,7 +23699,9 @@ var NdcDetailsComponent = function (props) {
23698
23699
  });
23699
23700
  function onAddNewNdcDetail() {
23700
23701
  var range = selectedTab.split("-");
23702
+ addedNdcDetailId.current = addedNdcDetailId.current + 1;
23701
23703
  var newData = {
23704
+ key: addedNdcDetailId.current,
23702
23705
  startDate: new Date("".concat(Number(range[0]), "-01-24 23:12:00")),
23703
23706
  endDate: new Date("".concat(Number(range[0]), "-12-24 23:12:00")),
23704
23707
  nationalPlanObj: t("ndc:enterNewPlanTxt"),
@@ -23790,30 +23793,35 @@ var NdcDetailsComponent = function (props) {
23790
23793
  React.useEffect(function () {
23791
23794
  var defaultNdcDetails = [
23792
23795
  {
23796
+ key: 1,
23793
23797
  startDate: new Date("2019-03-25"),
23794
23798
  endDate: new Date("2020-03-25"),
23795
23799
  nationalPlanObj: "Enhance value addition in key growth opportunities",
23796
23800
  kpi: 25,
23797
23801
  },
23798
23802
  {
23803
+ key: 2,
23799
23804
  startDate: new Date("2019-03-25"),
23800
23805
  endDate: new Date("2019-08-25"),
23801
23806
  nationalPlanObj: "Strengthen the private sector to create 10,000 jobs",
23802
23807
  kpi: 10500,
23803
23808
  },
23804
23809
  {
23810
+ key: 3,
23805
23811
  startDate: new Date("2021-03-25"),
23806
23812
  endDate: new Date("2022-03-25"),
23807
23813
  nationalPlanObj: "Consolidate and increase the stock and quality of productive infrastructure by 50%",
23808
23814
  kpi: 48,
23809
23815
  },
23810
23816
  {
23817
+ key: 4,
23811
23818
  startDate: new Date("2022-03-25"),
23812
23819
  endDate: new Date("2022-05-25"),
23813
23820
  nationalPlanObj: "Enhance the productivity and social wellbeing of the population",
23814
23821
  kpi: 20,
23815
23822
  },
23816
23823
  {
23824
+ key: 5,
23817
23825
  startDate: new Date("2022-03-25"),
23818
23826
  endDate: new Date("2023-03-25"),
23819
23827
  nationalPlanObj: "Strengthen the role of the state in guiding and facilitating development",
@@ -23845,6 +23853,7 @@ var NdcDetailsComponent = function (props) {
23845
23853
  children: addNewPeriodContent(),
23846
23854
  });
23847
23855
  }
23856
+ addedNdcDetailId.current = 5;
23848
23857
  setPeriodItems(initialPeriods);
23849
23858
  periodItemsRef.current = initialPeriods;
23850
23859
  setNdcDetailsData(defaultNdcDetails);