@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/cjs/index.js CHANGED
@@ -24528,7 +24528,7 @@ var NdcDetailsComponent = function (props) {
24528
24528
  var selectedPeriod = React.useRef({});
24529
24529
  var addedNdcDetailId = React.useRef(0);
24530
24530
  var selectedNdcDetail = React.useRef({});
24531
- var _e = React.useState(0), tableKey = _e[0], setTableKey = _e[1];
24531
+ var _e = React.useState(0), tableKey = _e[0]; _e[1];
24532
24532
  var userInfoState = useUserContext().userInfoState;
24533
24533
  var isAddRangeVisible = function () {
24534
24534
  return (((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.MINISTRY ||
@@ -24539,10 +24539,6 @@ var NdcDetailsComponent = function (props) {
24539
24539
  return ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.GOVERNMENT &&
24540
24540
  (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== exports.Role.ViewOnly);
24541
24541
  };
24542
- var isAddSubNdcActionVisible = function () {
24543
- return ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.MINISTRY &&
24544
- (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== exports.Role.ViewOnly);
24545
- };
24546
24542
  var inRange = function (num, min, max) {
24547
24543
  return num >= min && num <= max;
24548
24544
  };
@@ -24581,6 +24577,7 @@ var NdcDetailsComponent = function (props) {
24581
24577
  key: "nationalPlanObj",
24582
24578
  align: "left",
24583
24579
  editable: true,
24580
+ width: 800,
24584
24581
  },
24585
24582
  {
24586
24583
  title: t("ndc:ndcColumnsKpi"),
@@ -24588,6 +24585,7 @@ var NdcDetailsComponent = function (props) {
24588
24585
  key: "kpi",
24589
24586
  align: "left",
24590
24587
  editable: true,
24588
+ width: 100,
24591
24589
  },
24592
24590
  {
24593
24591
  title: "Ministry",
@@ -24622,29 +24620,6 @@ var NdcDetailsComponent = function (props) {
24622
24620
  };
24623
24621
  setNdcDetailsData(__spreadArray(__spreadArray([], ndcDetailsData, true), [newData], false));
24624
24622
  }
24625
- function onAddNewSubNdcDetail() {
24626
- var range = selectedTab.split("-");
24627
- var ndcDetail = ndcDetailsData.find(function (item) { return item.key === selectedNdcDetail.current.key; });
24628
- var ndcDetailItemIndex = ndcDetailsData.findIndex(function (item) { return item.key === selectedNdcDetail.current.key; });
24629
- if (ndcDetail) {
24630
- addedNdcDetailId.current = addedNdcDetailId.current + 1;
24631
- var newData = {
24632
- key: addedNdcDetailId.current,
24633
- startDate: new Date("".concat(Number(range[0]), "-01-24 23:12:00")),
24634
- endDate: new Date("".concat(Number(range[0]), "-12-24 23:12:00")),
24635
- nationalPlanObj: t("ndc:enterNewPlanTxt"),
24636
- kpi: 0,
24637
- ministry: "Please add the Ministry name",
24638
- };
24639
- if (!ndcDetail.subNdcDetails) {
24640
- ndcDetail.subNdcDetails = [];
24641
- }
24642
- ndcDetail.subNdcDetails.push(newData);
24643
- }
24644
- ndcDetailsData[ndcDetailItemIndex] = ndcDetail;
24645
- setNdcDetailsData(ndcDetailsData);
24646
- setTableKey(function (key) { return key + 1; });
24647
- }
24648
24623
  var components = {
24649
24624
  body: {
24650
24625
  row: EditableRow,
@@ -24725,13 +24700,7 @@ var NdcDetailsComponent = function (props) {
24725
24700
  }
24726
24701
  function getSubNdcActionContent(record) {
24727
24702
  selectedNdcDetail.current = record;
24728
- return (React.createElement(antd.Table, { components: components, rowClassName: function () { return "editable-row"; }, bordered: true, dataSource: getSubNdcDetails(record.key), columns: columns, showHeader: false, pagination: false, footer: function () {
24729
- return isAddSubNdcActionVisible() && (React.createElement(antd.Row, { justify: "center" },
24730
- React.createElement(antd.Button, { onClick: onAddNewSubNdcDetail, type: "default", style: {
24731
- marginBottom: 16,
24732
- width: "100%",
24733
- } }, t("ndc:addSubNdcAction"))));
24734
- } }));
24703
+ return (React.createElement(antd.Table, { components: components, rowClassName: function () { return "editable-row"; }, bordered: true, dataSource: getSubNdcDetails(record.key), columns: columns, showHeader: false, pagination: false }));
24735
24704
  }
24736
24705
  var onTabChange = function (key) {
24737
24706
  setSelectedTab(key);
@@ -24744,7 +24713,7 @@ var NdcDetailsComponent = function (props) {
24744
24713
  endDate: new Date("2020-03-25"),
24745
24714
  nationalPlanObj: "Enhance value addition in key growth opportunities",
24746
24715
  kpi: 25,
24747
- ministry: "Ministry of Agriculture, Water and Forestry (MAWF)",
24716
+ ministry: "Ministry of Environment",
24748
24717
  subNdcDetails: [
24749
24718
  {
24750
24719
  key: 6,
@@ -24754,6 +24723,14 @@ var NdcDetailsComponent = function (props) {
24754
24723
  kpi: 25,
24755
24724
  ministry: "Ministry of Agriculture, Water and Forestry (MAWF)",
24756
24725
  },
24726
+ {
24727
+ key: 7,
24728
+ startDate: new Date("2019-03-25"),
24729
+ endDate: new Date("2020-03-25"),
24730
+ nationalPlanObj: "",
24731
+ kpi: "",
24732
+ ministry: "",
24733
+ },
24757
24734
  ],
24758
24735
  },
24759
24736
  {
@@ -24762,7 +24739,35 @@ var NdcDetailsComponent = function (props) {
24762
24739
  endDate: new Date("2019-08-25"),
24763
24740
  nationalPlanObj: "Strengthen the private sector to create 10,000 jobs",
24764
24741
  kpi: 10500,
24765
- ministry: "Ministry of Tourism (MoT)",
24742
+ ministry: "Ministry of Environment",
24743
+ subNdcDetails: [
24744
+ {
24745
+ key: 8,
24746
+ startDate: new Date("2019-03-25"),
24747
+ endDate: new Date("2020-03-25"),
24748
+ nationalPlanObj: "",
24749
+ kpi: "",
24750
+ ministry: "",
24751
+ },
24752
+ ],
24753
+ },
24754
+ {
24755
+ key: 12,
24756
+ startDate: new Date("2019-03-25"),
24757
+ endDate: new Date("2019-08-25"),
24758
+ nationalPlanObj: "Other",
24759
+ kpi: 10500,
24760
+ ministry: "Ministry of Environment",
24761
+ subNdcDetails: [
24762
+ {
24763
+ key: 8,
24764
+ startDate: new Date("2019-03-25"),
24765
+ endDate: new Date("2020-03-25"),
24766
+ nationalPlanObj: "",
24767
+ kpi: "",
24768
+ ministry: "",
24769
+ },
24770
+ ],
24766
24771
  },
24767
24772
  {
24768
24773
  key: 3,
@@ -24770,7 +24775,17 @@ var NdcDetailsComponent = function (props) {
24770
24775
  endDate: new Date("2022-03-25"),
24771
24776
  nationalPlanObj: "Consolidate and increase the stock and quality of productive infrastructure by 50%",
24772
24777
  kpi: 48,
24773
- ministry: "Ministry of Education, Arts and Culture (MoE)",
24778
+ ministry: "Ministry of Environment",
24779
+ subNdcDetails: [
24780
+ {
24781
+ key: 9,
24782
+ startDate: new Date("2019-03-25"),
24783
+ endDate: new Date("2020-03-25"),
24784
+ nationalPlanObj: "",
24785
+ kpi: "",
24786
+ ministry: "",
24787
+ },
24788
+ ],
24774
24789
  },
24775
24790
  {
24776
24791
  key: 4,
@@ -24778,7 +24793,17 @@ var NdcDetailsComponent = function (props) {
24778
24793
  endDate: new Date("2022-05-25"),
24779
24794
  nationalPlanObj: "Enhance the productivity and social wellbeing of the population",
24780
24795
  kpi: 20,
24781
- ministry: "Ministry of Environment, Forestry and Tourism (MEFT)",
24796
+ ministry: "Ministry of Environment",
24797
+ subNdcDetails: [
24798
+ {
24799
+ key: 10,
24800
+ startDate: new Date("2019-03-25"),
24801
+ endDate: new Date("2020-03-25"),
24802
+ nationalPlanObj: "",
24803
+ kpi: "",
24804
+ ministry: "",
24805
+ },
24806
+ ],
24782
24807
  },
24783
24808
  {
24784
24809
  key: 5,
@@ -24786,7 +24811,35 @@ var NdcDetailsComponent = function (props) {
24786
24811
  endDate: new Date("2023-03-25"),
24787
24812
  nationalPlanObj: "Strengthen the role of the state in guiding and facilitating development",
24788
24813
  kpi: 10,
24789
- ministry: "Ministry of Tourism (MoT)",
24814
+ ministry: "Ministry of Environment",
24815
+ subNdcDetails: [
24816
+ {
24817
+ key: 11,
24818
+ startDate: new Date("2019-03-25"),
24819
+ endDate: new Date("2020-03-25"),
24820
+ nationalPlanObj: "",
24821
+ kpi: "",
24822
+ ministry: "",
24823
+ },
24824
+ ],
24825
+ },
24826
+ {
24827
+ key: 13,
24828
+ startDate: new Date("2022-03-25"),
24829
+ endDate: new Date("2023-03-25"),
24830
+ nationalPlanObj: "Other",
24831
+ kpi: 10,
24832
+ ministry: "Ministry of Environment",
24833
+ subNdcDetails: [
24834
+ {
24835
+ key: 11,
24836
+ startDate: new Date("2019-03-25"),
24837
+ endDate: new Date("2020-03-25"),
24838
+ nationalPlanObj: "",
24839
+ kpi: "",
24840
+ ministry: "",
24841
+ },
24842
+ ],
24790
24843
  },
24791
24844
  ];
24792
24845
  var initialPeriods = [