@undp/carbon-library 1.0.150-CARBON-343.4 → 1.0.150-CARBON-343.5

Sign up to get free protection for your applications and to get access to all the features.
package/dist/esm/index.js CHANGED
@@ -24508,7 +24508,7 @@ var NdcDetailsComponent = function (props) {
24508
24508
  var selectedPeriod = useRef({});
24509
24509
  var addedNdcDetailId = useRef(0);
24510
24510
  var selectedNdcDetail = useRef({});
24511
- var _e = useState(0), tableKey = _e[0], setTableKey = _e[1];
24511
+ var _e = useState(0), tableKey = _e[0]; _e[1];
24512
24512
  var userInfoState = useUserContext().userInfoState;
24513
24513
  var isAddRangeVisible = function () {
24514
24514
  return (((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.MINISTRY ||
@@ -24519,10 +24519,6 @@ var NdcDetailsComponent = function (props) {
24519
24519
  return ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.GOVERNMENT &&
24520
24520
  (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== Role.ViewOnly);
24521
24521
  };
24522
- var isAddSubNdcActionVisible = function () {
24523
- return ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.MINISTRY &&
24524
- (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== Role.ViewOnly);
24525
- };
24526
24522
  var inRange = function (num, min, max) {
24527
24523
  return num >= min && num <= max;
24528
24524
  };
@@ -24561,6 +24557,7 @@ var NdcDetailsComponent = function (props) {
24561
24557
  key: "nationalPlanObj",
24562
24558
  align: "left",
24563
24559
  editable: true,
24560
+ width: 800,
24564
24561
  },
24565
24562
  {
24566
24563
  title: t("ndc:ndcColumnsKpi"),
@@ -24568,6 +24565,7 @@ var NdcDetailsComponent = function (props) {
24568
24565
  key: "kpi",
24569
24566
  align: "left",
24570
24567
  editable: true,
24568
+ width: 100,
24571
24569
  },
24572
24570
  {
24573
24571
  title: "Ministry",
@@ -24602,29 +24600,6 @@ var NdcDetailsComponent = function (props) {
24602
24600
  };
24603
24601
  setNdcDetailsData(__spreadArray(__spreadArray([], ndcDetailsData, true), [newData], false));
24604
24602
  }
24605
- function onAddNewSubNdcDetail() {
24606
- var range = selectedTab.split("-");
24607
- var ndcDetail = ndcDetailsData.find(function (item) { return item.key === selectedNdcDetail.current.key; });
24608
- var ndcDetailItemIndex = ndcDetailsData.findIndex(function (item) { return item.key === selectedNdcDetail.current.key; });
24609
- if (ndcDetail) {
24610
- addedNdcDetailId.current = addedNdcDetailId.current + 1;
24611
- var newData = {
24612
- key: addedNdcDetailId.current,
24613
- startDate: new Date("".concat(Number(range[0]), "-01-24 23:12:00")),
24614
- endDate: new Date("".concat(Number(range[0]), "-12-24 23:12:00")),
24615
- nationalPlanObj: t("ndc:enterNewPlanTxt"),
24616
- kpi: 0,
24617
- ministry: "Please add the Ministry name",
24618
- };
24619
- if (!ndcDetail.subNdcDetails) {
24620
- ndcDetail.subNdcDetails = [];
24621
- }
24622
- ndcDetail.subNdcDetails.push(newData);
24623
- }
24624
- ndcDetailsData[ndcDetailItemIndex] = ndcDetail;
24625
- setNdcDetailsData(ndcDetailsData);
24626
- setTableKey(function (key) { return key + 1; });
24627
- }
24628
24603
  var components = {
24629
24604
  body: {
24630
24605
  row: EditableRow,
@@ -24705,13 +24680,7 @@ var NdcDetailsComponent = function (props) {
24705
24680
  }
24706
24681
  function getSubNdcActionContent(record) {
24707
24682
  selectedNdcDetail.current = record;
24708
- return (React.createElement(Table, { components: components, rowClassName: function () { return "editable-row"; }, bordered: true, dataSource: getSubNdcDetails(record.key), columns: columns, showHeader: false, pagination: false, footer: function () {
24709
- return isAddSubNdcActionVisible() && (React.createElement(Row, { justify: "center" },
24710
- React.createElement(Button, { onClick: onAddNewSubNdcDetail, type: "default", style: {
24711
- marginBottom: 16,
24712
- width: "100%",
24713
- } }, t("ndc:addSubNdcAction"))));
24714
- } }));
24683
+ return (React.createElement(Table, { components: components, rowClassName: function () { return "editable-row"; }, bordered: true, dataSource: getSubNdcDetails(record.key), columns: columns, showHeader: false, pagination: false }));
24715
24684
  }
24716
24685
  var onTabChange = function (key) {
24717
24686
  setSelectedTab(key);
@@ -24724,7 +24693,7 @@ var NdcDetailsComponent = function (props) {
24724
24693
  endDate: new Date("2020-03-25"),
24725
24694
  nationalPlanObj: "Enhance value addition in key growth opportunities",
24726
24695
  kpi: 25,
24727
- ministry: "Ministry of Agriculture, Water and Forestry (MAWF)",
24696
+ ministry: "Ministry of Environment",
24728
24697
  subNdcDetails: [
24729
24698
  {
24730
24699
  key: 6,
@@ -24734,6 +24703,14 @@ var NdcDetailsComponent = function (props) {
24734
24703
  kpi: 25,
24735
24704
  ministry: "Ministry of Agriculture, Water and Forestry (MAWF)",
24736
24705
  },
24706
+ {
24707
+ key: 7,
24708
+ startDate: new Date("2019-03-25"),
24709
+ endDate: new Date("2020-03-25"),
24710
+ nationalPlanObj: "",
24711
+ kpi: "",
24712
+ ministry: "",
24713
+ },
24737
24714
  ],
24738
24715
  },
24739
24716
  {
@@ -24742,7 +24719,35 @@ var NdcDetailsComponent = function (props) {
24742
24719
  endDate: new Date("2019-08-25"),
24743
24720
  nationalPlanObj: "Strengthen the private sector to create 10,000 jobs",
24744
24721
  kpi: 10500,
24745
- ministry: "Ministry of Tourism (MoT)",
24722
+ ministry: "Ministry of Environment",
24723
+ subNdcDetails: [
24724
+ {
24725
+ key: 8,
24726
+ startDate: new Date("2019-03-25"),
24727
+ endDate: new Date("2020-03-25"),
24728
+ nationalPlanObj: "",
24729
+ kpi: "",
24730
+ ministry: "",
24731
+ },
24732
+ ],
24733
+ },
24734
+ {
24735
+ key: 12,
24736
+ startDate: new Date("2019-03-25"),
24737
+ endDate: new Date("2019-08-25"),
24738
+ nationalPlanObj: "Other",
24739
+ kpi: 10500,
24740
+ ministry: "Ministry of Environment",
24741
+ subNdcDetails: [
24742
+ {
24743
+ key: 8,
24744
+ startDate: new Date("2019-03-25"),
24745
+ endDate: new Date("2020-03-25"),
24746
+ nationalPlanObj: "",
24747
+ kpi: "",
24748
+ ministry: "",
24749
+ },
24750
+ ],
24746
24751
  },
24747
24752
  {
24748
24753
  key: 3,
@@ -24750,7 +24755,17 @@ var NdcDetailsComponent = function (props) {
24750
24755
  endDate: new Date("2022-03-25"),
24751
24756
  nationalPlanObj: "Consolidate and increase the stock and quality of productive infrastructure by 50%",
24752
24757
  kpi: 48,
24753
- ministry: "Ministry of Education, Arts and Culture (MoE)",
24758
+ ministry: "Ministry of Environment",
24759
+ subNdcDetails: [
24760
+ {
24761
+ key: 9,
24762
+ startDate: new Date("2019-03-25"),
24763
+ endDate: new Date("2020-03-25"),
24764
+ nationalPlanObj: "",
24765
+ kpi: "",
24766
+ ministry: "",
24767
+ },
24768
+ ],
24754
24769
  },
24755
24770
  {
24756
24771
  key: 4,
@@ -24758,7 +24773,17 @@ var NdcDetailsComponent = function (props) {
24758
24773
  endDate: new Date("2022-05-25"),
24759
24774
  nationalPlanObj: "Enhance the productivity and social wellbeing of the population",
24760
24775
  kpi: 20,
24761
- ministry: "Ministry of Environment, Forestry and Tourism (MEFT)",
24776
+ ministry: "Ministry of Environment",
24777
+ subNdcDetails: [
24778
+ {
24779
+ key: 10,
24780
+ startDate: new Date("2019-03-25"),
24781
+ endDate: new Date("2020-03-25"),
24782
+ nationalPlanObj: "",
24783
+ kpi: "",
24784
+ ministry: "",
24785
+ },
24786
+ ],
24762
24787
  },
24763
24788
  {
24764
24789
  key: 5,
@@ -24766,7 +24791,35 @@ var NdcDetailsComponent = function (props) {
24766
24791
  endDate: new Date("2023-03-25"),
24767
24792
  nationalPlanObj: "Strengthen the role of the state in guiding and facilitating development",
24768
24793
  kpi: 10,
24769
- ministry: "Ministry of Tourism (MoT)",
24794
+ ministry: "Ministry of Environment",
24795
+ subNdcDetails: [
24796
+ {
24797
+ key: 11,
24798
+ startDate: new Date("2019-03-25"),
24799
+ endDate: new Date("2020-03-25"),
24800
+ nationalPlanObj: "",
24801
+ kpi: "",
24802
+ ministry: "",
24803
+ },
24804
+ ],
24805
+ },
24806
+ {
24807
+ key: 13,
24808
+ startDate: new Date("2022-03-25"),
24809
+ endDate: new Date("2023-03-25"),
24810
+ nationalPlanObj: "Other",
24811
+ kpi: 10,
24812
+ ministry: "Ministry of Environment",
24813
+ subNdcDetails: [
24814
+ {
24815
+ key: 11,
24816
+ startDate: new Date("2019-03-25"),
24817
+ endDate: new Date("2020-03-25"),
24818
+ nationalPlanObj: "",
24819
+ kpi: "",
24820
+ ministry: "",
24821
+ },
24822
+ ],
24770
24823
  },
24771
24824
  ];
24772
24825
  var initialPeriods = [