@undp/carbon-library 2.1.13-PAN-1.12 → 2.1.13-PAN-1.14

Sign up to get free protection for your applications and to get access to all the features.
package/dist/esm/index.js CHANGED
@@ -202,7 +202,7 @@ var CreditTransferStage;
202
202
  CreditTransferStage["NotRecognised"] = "NotRecognised";
203
203
  })(CreditTransferStage || (CreditTransferStage = {}));
204
204
 
205
- var SectoralScope$1;
205
+ var SectoralScope;
206
206
  (function (SectoralScope) {
207
207
  SectoralScope["Energy Industries (Renewable \u2013 / Non-Renewable Sources)"] = "1";
208
208
  SectoralScope["Energy Distribution"] = "2";
@@ -219,7 +219,7 @@ var SectoralScope$1;
219
219
  SectoralScope["Waste Handling and Disposal"] = "13";
220
220
  SectoralScope["Afforestation and Reforestation"] = "14";
221
221
  SectoralScope["Agriculture"] = "15";
222
- })(SectoralScope$1 || (SectoralScope$1 = {}));
222
+ })(SectoralScope || (SectoralScope = {}));
223
223
 
224
224
  var CarbonSystemType;
225
225
  (function (CarbonSystemType) {
@@ -319,7 +319,7 @@ var getGeneralFields = function (programme, system) {
319
319
  currentStatus: programme.currentStage,
320
320
  applicationType: "Project Developer",
321
321
  sector: programme.sector,
322
- sectoralScope: Object.keys(SectoralScope$1)[Object.values(SectoralScope$1).indexOf(programme.sectoralScope)],
322
+ sectoralScope: Object.keys(SectoralScope)[Object.values(SectoralScope).indexOf(programme.sectoralScope)],
323
323
  startDate: DateTime.fromSeconds(Number(programme.startTime)),
324
324
  endDate: DateTime.fromSeconds(Number(programme.endTime)),
325
325
  buyerCountry: programme.programmeProperties.buyerCountryEligibility,
@@ -7812,7 +7812,7 @@ var AddNewCompanyComponent = function (props) {
7812
7812
  message: "".concat(t("addCompany:sectoralScope"), " ").concat(t("isRequired")),
7813
7813
  },
7814
7814
  ], initialValue: (_m = state === null || state === void 0 ? void 0 : state.record) === null || _m === void 0 ? void 0 : _m.sectoralScope },
7815
- React.createElement(Select, { mode: "multiple", size: "large", maxTagCount: 2, allowClear: true }, Object.entries(SectoralScope$1).map(function (_a) {
7815
+ React.createElement(Select, { mode: "multiple", size: "large", maxTagCount: 2, allowClear: true }, Object.entries(SectoralScope).map(function (_a) {
7816
7816
  var key = _a[0], value = _a[1];
7817
7817
  return (React.createElement(Select.Option, { key: value, value: value }, key));
7818
7818
  })))),
@@ -8062,8 +8062,8 @@ var CompanyDetailsComponent = function (props) {
8062
8062
  var t = props.t, companyDetails = props.companyDetails; props.userDetails; var isLoading = props.isLoading, regionField = props.regionField, systemType = props.systemType;
8063
8063
  var getEnumKeysFromValues = function (values) {
8064
8064
  var enumKeys = [];
8065
- for (var key in SectoralScope$1) {
8066
- if (values.includes(SectoralScope$1[key])) {
8065
+ for (var key in SectoralScope) {
8066
+ if (values.includes(SectoralScope[key])) {
8067
8067
  enumKeys.push(key);
8068
8068
  }
8069
8069
  }
@@ -14827,7 +14827,7 @@ var ProgrammeCreationComponent = function (props) {
14827
14827
  selectedSector !== String(Sector.Education) &&
14828
14828
  selectedSector !== String(Sector.Hospitality)
14829
14829
  ? sectoralScopes[selectedSector]
14830
- : Object.entries(SectoralScope$1).map(function (_a) {
14830
+ : Object.entries(SectoralScope).map(function (_a) {
14831
14831
  var key = _a[0]; _a[1];
14832
14832
  return key;
14833
14833
  });
@@ -15115,7 +15115,7 @@ var ProgrammeCreationComponent = function (props) {
15115
15115
  sectSScope_1 = [];
15116
15116
  sectors_1 = [];
15117
15117
  (_j = (_h = (_g = response === null || response === void 0 ? void 0 : response.data[0]) === null || _g === void 0 ? void 0 : _g.company) === null || _h === void 0 ? void 0 : _h.sectoralScope) === null || _j === void 0 ? void 0 : _j.map(function (sScope) {
15118
- Object.entries(SectoralScope$1).map(function (_a) {
15118
+ Object.entries(SectoralScope).map(function (_a) {
15119
15119
  var key = _a[0], value = _a[1];
15120
15120
  if (sScope === String(value)) {
15121
15121
  sectSScope_1.push({ key: key, value: value });
@@ -15868,9 +15868,9 @@ var ProgrammeCreationComponent = function (props) {
15868
15868
  CompanyRole.MINISTRY
15869
15869
  ? selectableSectoralScope === null || selectableSectoralScope === void 0 ? void 0 : selectableSectoralScope.map(function (item) { return (React.createElement(Select.Option, { key: item.value, value: item.value }, item.key)); })
15870
15870
  : selectedSectoralScopes === null || selectedSectoralScopes === void 0 ? void 0 : selectedSectoralScopes.map(function (val) {
15871
- if (val in SectoralScope$1) {
15871
+ if (val in SectoralScope) {
15872
15872
  var key = val;
15873
- return (React.createElement(Select.Option, { key: SectoralScope$1[key], value: SectoralScope$1[key] }, val));
15873
+ return (React.createElement(Select.Option, { key: SectoralScope[key], value: SectoralScope[key] }, val));
15874
15874
  }
15875
15875
  return null;
15876
15876
  }))),
@@ -20392,21 +20392,22 @@ var enablementTypesAndValues = [
20392
20392
  ];
20393
20393
 
20394
20394
  var NdcActionDetails = function (props) {
20395
+ var _a, _b, _c;
20395
20396
  var isBackBtnVisible = props.isBackBtnVisible, onFormSubmit = props.onFormSubmit, ndcActionDetails = props.ndcActionDetails, translator = props.translator, programmeDetails = props.programmeDetails, onClickedBackBtn = props.onClickedBackBtn;
20396
20397
  translator.setDefaultNamespace("ndcAction");
20397
20398
  var t = translator.t;
20398
- var _a = useState(), ndcActionType = _a[0], setNdcActionType = _a[1];
20399
- var _b = useState(), methodology = _b[0], setMethodology = _b[1];
20400
- var _c = useState(), mitigationType = _c[0], setmitigationType = _c[1];
20401
- var _d = useState(""), mitigationSubType = _d[0], setMitigationSubType = _d[1];
20402
- var _e = useState(""), sector = _e[0], setSector = _e[1];
20403
- var _f = useState(""); _f[0]; var setSubSector = _f[1];
20404
- var _g = useState(ndcActionTypeList), ndcActionTypeListFiltered = _g[0]; _g[1];
20405
- var _h = useState([]), checkedOptionsGhgReduced = _h[0], setCheckedOptionsGhgReduced = _h[1];
20406
- var _j = useState([]), checkedOptionsGhgAvoided = _j[0], setCheckedOptionsGhgAvoided = _j[1];
20407
- var _k = useState(), inputNumberValueGhgAvoidedGas = _k[0], setInputNumberValueGhgAvoidedGas = _k[1];
20408
- var _l = useState(), inputNumberValueGhgReducedGas = _l[0], setInputNumberValueGhgReducedGas = _l[1];
20409
- var _m = useState(), includedInNAP = _m[0], setIncludedInNAP = _m[1];
20399
+ var _d = useState(), ndcActionType = _d[0], setNdcActionType = _d[1];
20400
+ var _e = useState(), methodology = _e[0], setMethodology = _e[1];
20401
+ var _f = useState(), mitigationType = _f[0], setmitigationType = _f[1];
20402
+ var _g = useState(""), mitigationSubType = _g[0], setMitigationSubType = _g[1];
20403
+ var _h = useState(""), sector = _h[0], setSector = _h[1];
20404
+ var _j = useState(""), subSector = _j[0], setSubSector = _j[1];
20405
+ var _k = useState(ndcActionTypeList), ndcActionTypeListFiltered = _k[0]; _k[1];
20406
+ var _l = useState([]), checkedOptionsGhgReduced = _l[0], setCheckedOptionsGhgReduced = _l[1];
20407
+ var _m = useState([]), checkedOptionsGhgAvoided = _m[0], setCheckedOptionsGhgAvoided = _m[1];
20408
+ var _o = useState(), inputNumberValueGhgAvoidedGas = _o[0], setInputNumberValueGhgAvoidedGas = _o[1];
20409
+ var _p = useState(), inputNumberValueGhgReducedGas = _p[0], setInputNumberValueGhgReducedGas = _p[1];
20410
+ var _q = useState(), includedInNAP = _q[0], setIncludedInNAP = _q[1];
20410
20411
  var form = Form.useForm()[0];
20411
20412
  var maximumImageSize = process.env.REACT_APP_MAXIMUM_FILE_SIZE
20412
20413
  ? parseInt(process.env.REACT_APP_MAXIMUM_FILE_SIZE)
@@ -20422,7 +20423,7 @@ var NdcActionDetails = function (props) {
20422
20423
  if (programmeDetails) {
20423
20424
  setSector(programmeDetails === null || programmeDetails === void 0 ? void 0 : programmeDetails.sector);
20424
20425
  var key = getKeyFromValue(programmeDetails === null || programmeDetails === void 0 ? void 0 : programmeDetails.sectoralScope);
20425
- setSubSector(programmeDetails === null || programmeDetails === void 0 ? void 0 : programmeDetails.sectoralScope);
20426
+ setSubSector(key);
20426
20427
  console.log(programmeDetails, "Programme Details");
20427
20428
  console.log("Ndc Actions ------- > ", ndcActionDetails);
20428
20429
  if (!ndcActionDetails) {
@@ -20431,8 +20432,8 @@ var NdcActionDetails = function (props) {
20431
20432
  : "", key);
20432
20433
  console.log("Other detail 115 ------------- > ", programmeDetails);
20433
20434
  form.setFieldsValue({
20434
- mitigationType: sectorMitigationTypesListMapped[sector]
20435
- ? (_f = (_e = (_d = sectorMitigationTypesListMapped[sector]) === null || _d === void 0 ? void 0 : _d.find(function (item) { return item.label === sector; })) === null || _e === void 0 ? void 0 : _e.label) !== null && _f !== void 0 ? _f : ""
20435
+ mitigationType: sectorMitigationTypesListMapped[programmeDetails === null || programmeDetails === void 0 ? void 0 : programmeDetails.sector]
20436
+ ? (_f = (_e = (_d = sectorMitigationTypesListMapped[programmeDetails === null || programmeDetails === void 0 ? void 0 : programmeDetails.sector]) === null || _d === void 0 ? void 0 : _d.find(function (item) { return item.label === (programmeDetails === null || programmeDetails === void 0 ? void 0 : programmeDetails.sector); })) === null || _e === void 0 ? void 0 : _e.label) !== null && _f !== void 0 ? _f : ""
20436
20437
  : "",
20437
20438
  mitigationSubType: key,
20438
20439
  });
@@ -20832,15 +20833,9 @@ var NdcActionDetails = function (props) {
20832
20833
  ndcActionType === NdcActionTypes.CrossCutting) && (React.createElement(React.Fragment, null,
20833
20834
  React.createElement(Row, { justify: "start", align: "middle" },
20834
20835
  React.createElement(Col, null,
20835
- React.createElement(Form.Item, { label: t("ndcAction:mitigationType"),
20836
- // initialValue={
20837
- // sectorMitigationTypesListMapped[sector]
20838
- // ? sectorMitigationTypesListMapped[sector]?.find(
20839
- // (item: any) => item.label === sector
20840
- // )?.label ?? ""
20841
- // : ""
20842
- // }
20843
- name: "mitigationType", rules: [
20836
+ React.createElement(Form.Item, { label: t("ndcAction:mitigationType"), initialValue: sectorMitigationTypesListMapped[programmeDetails === null || programmeDetails === void 0 ? void 0 : programmeDetails.sector]
20837
+ ? (_c = (_b = (_a = sectorMitigationTypesListMapped[programmeDetails === null || programmeDetails === void 0 ? void 0 : programmeDetails.sector]) === null || _a === void 0 ? void 0 : _a.find(function (item) { return item.label === (programmeDetails === null || programmeDetails === void 0 ? void 0 : programmeDetails.sector); })) === null || _b === void 0 ? void 0 : _b.label) !== null && _c !== void 0 ? _c : ""
20838
+ : "", name: "mitigationType", rules: [
20844
20839
  {
20845
20840
  required: true,
20846
20841
  message: "".concat(t("ndcAction:mitigationType"), " ").concat(t("ndcAction:isRequired")),
@@ -20858,15 +20853,7 @@ var NdcActionDetails = function (props) {
20858
20853
  ndcActionType === NdcActionTypes.CrossCutting) &&
20859
20854
  mitigationType &&
20860
20855
  mitigationSubTypesListMapped[mitigationType] && (React.createElement(Col, { style: { marginLeft: "38px" } },
20861
- React.createElement(Form.Item, { label: t("ndcAction:mitigationSubType"), name: "mitigationSubType",
20862
- // initialValue={
20863
- // mitigationSubTypesListMapped[subSector]
20864
- // ? mitigationSubTypesListMapped[subSector]?.find(
20865
- // (item: any) => item.label === subSector
20866
- // )?.label
20867
- // : ""
20868
- // }
20869
- rules: [
20856
+ React.createElement(Form.Item, { label: t("ndcAction:mitigationSubType"), name: "mitigationSubType", initialValue: subSector, rules: [
20870
20857
  {
20871
20858
  required: true,
20872
20859
  message: "".concat(t("ndcAction:mitigationSubType"), " ").concat(t("ndcAction:isRequired")),
@@ -36879,5 +36866,5 @@ var GHGDashboardComponent = function (props) {
36879
36866
  React.createElement(Row, { gutter: [40, 40], className: "statics-card-row" }, row.map(function (item, j) { return getWidgetJSX(item); })))); }))));
36880
36867
  };
36881
36868
 
36882
- export { Action, AddNdcActionComponent, AddNewCompanyComponent, AddNewUserComponent, AdminBGColor, AdminColor, BaseEntity, CarbonSystemType, CertBGColor, CertColor, CoBenifitsComponent, Company, CompanyManagementColumns, CompanyManagementComponent, CompanyProfileComponent, CompanyRole, CompanyState, ConfigurationSettingsType, ConnectionContextProvider, CreditTransferComponent, CreditTransferStage, DevBGColor, DevColor, DocType, DocumentStatus, ESGType, Emission, EmissionGas, EmissionSector, EmissionSubSectors, EnergyGenerationUnits, FormElementType, GHGDashboardComponent, GHGEmissionsComponent, GHGProjectionsComponent, GhgStatCardTypes, GovBGColor, GovColor, GovDepartment, ImgWithFallback, InfoView, Instrument, InvestmentBGColor, InvestmentBody, InvestmentColor, InvestmentCreationComponent, InvestmentCreationType, InvestmentLevel, InvestmentManagementComponent, InvestmentOwnershipType, InvestmentStatus, InvestmentStream, InvestmentType, LandAreaUnits, LegendItem, Loading, ManagerBGColor, ManagerColor, MapComponent, MapTypes, MapboxComponent, MinBGColor, MinColor, Ministry, MitigationSubTypes, MitigationTypes, MrvDashboardComponent, MrvStatsCardsTypes, NdcActionBody, NdcActionManagementComponent, NdcActionStatus, NdcActionTypes, NdcActionViewComponent, NdcDetailsComponent, OrganisationStatus, ProfileIcon, ProgrammeCertify, ProgrammeCreationComponent, ProgrammeDocuments, ProgrammeEntity, ProgrammeIssueForm, ProgrammeManagementColumns, ProgrammeManagementComponent, ProgrammeRetireForm, ProgrammeRevokeForm, ProgrammeStageLegend, ProgrammeStageMRV, ProgrammeStageR, ProgrammeStageUnified, ProgrammeTransfer, ProgrammeTransferForm, Projection, ProjectionTypes$1 as ProjectionTypes, RadioButtonStatus, RadioButtonStatus2, RegistryDashboardComponent, RejectDocumentationConfirmationModel, RetireType, Role, RoleIcon, RootBGColor, RootColor, SdgGoals$1 as SdgGoals, Sector, SectoralScope$1 as SectoralScope, SettingsContext, SettingsContextProvider, StasticCard, StatsCardsTypes, SubTypeOfMitigation, SupportCreationComponent, SupportManagementComponent, SystemNames, TimelineBody, Titles, TooltipColor, TransferActionModel, TxType, TypeOfMitigation, UnitField, User, UserContext, UserInformationContextProvider, UserManagementColumns, UserManagementComponent, UserProfileComponent, UserRoleIcon, ViewBGColor, ViewColor, WidgetType, addCommSep, addCommSepRound$1 as addCommSepRound, addNdcDesc, addRoundNumber, addSpaces, consumerGroupList, creditUnit, dateFormat, dateTimeFormat, energyGenerationUnitList, getBase64, getCompanyBgColor, getCreditStageVal, getFinancialFields, getGeneralFields, getInvestmentStatusEnumVal, getNdcActionStatusEnumVal$1 as getNdcActionStatusEnumVal, getNdcStatusTagType, getRetirementTypeString, getStageEnumVal, getStageTagType, getStageTagTypeMRV, getStageTransferEnumVal, getStatusTagType, getTransferStageTagType, getValidNdcActions, isBase64, landAreaUnitList, methodologyOptions, mitigationSubTypeList, mitigationSubTypesListMapped, mitigationTypeList, ndcActionTypeList, sectorMitigationTypesListMapped, sumArray, titleList, useConnection, useSettingsContext, useUserContext };
36869
+ export { Action, AddNdcActionComponent, AddNewCompanyComponent, AddNewUserComponent, AdminBGColor, AdminColor, BaseEntity, CarbonSystemType, CertBGColor, CertColor, CoBenifitsComponent, Company, CompanyManagementColumns, CompanyManagementComponent, CompanyProfileComponent, CompanyRole, CompanyState, ConfigurationSettingsType, ConnectionContextProvider, CreditTransferComponent, CreditTransferStage, DevBGColor, DevColor, DocType, DocumentStatus, ESGType, Emission, EmissionGas, EmissionSector, EmissionSubSectors, EnergyGenerationUnits, FormElementType, GHGDashboardComponent, GHGEmissionsComponent, GHGProjectionsComponent, GhgStatCardTypes, GovBGColor, GovColor, GovDepartment, ImgWithFallback, InfoView, Instrument, InvestmentBGColor, InvestmentBody, InvestmentColor, InvestmentCreationComponent, InvestmentCreationType, InvestmentLevel, InvestmentManagementComponent, InvestmentOwnershipType, InvestmentStatus, InvestmentStream, InvestmentType, LandAreaUnits, LegendItem, Loading, ManagerBGColor, ManagerColor, MapComponent, MapTypes, MapboxComponent, MinBGColor, MinColor, Ministry, MitigationSubTypes, MitigationTypes, MrvDashboardComponent, MrvStatsCardsTypes, NdcActionBody, NdcActionManagementComponent, NdcActionStatus, NdcActionTypes, NdcActionViewComponent, NdcDetailsComponent, OrganisationStatus, ProfileIcon, ProgrammeCertify, ProgrammeCreationComponent, ProgrammeDocuments, ProgrammeEntity, ProgrammeIssueForm, ProgrammeManagementColumns, ProgrammeManagementComponent, ProgrammeRetireForm, ProgrammeRevokeForm, ProgrammeStageLegend, ProgrammeStageMRV, ProgrammeStageR, ProgrammeStageUnified, ProgrammeTransfer, ProgrammeTransferForm, Projection, ProjectionTypes$1 as ProjectionTypes, RadioButtonStatus, RadioButtonStatus2, RegistryDashboardComponent, RejectDocumentationConfirmationModel, RetireType, Role, RoleIcon, RootBGColor, RootColor, SdgGoals$1 as SdgGoals, Sector, SectoralScope, SettingsContext, SettingsContextProvider, StasticCard, StatsCardsTypes, SubTypeOfMitigation, SupportCreationComponent, SupportManagementComponent, SystemNames, TimelineBody, Titles, TooltipColor, TransferActionModel, TxType, TypeOfMitigation, UnitField, User, UserContext, UserInformationContextProvider, UserManagementColumns, UserManagementComponent, UserProfileComponent, UserRoleIcon, ViewBGColor, ViewColor, WidgetType, addCommSep, addCommSepRound$1 as addCommSepRound, addNdcDesc, addRoundNumber, addSpaces, consumerGroupList, creditUnit, dateFormat, dateTimeFormat, energyGenerationUnitList, getBase64, getCompanyBgColor, getCreditStageVal, getFinancialFields, getGeneralFields, getInvestmentStatusEnumVal, getNdcActionStatusEnumVal$1 as getNdcActionStatusEnumVal, getNdcStatusTagType, getRetirementTypeString, getStageEnumVal, getStageTagType, getStageTagTypeMRV, getStageTransferEnumVal, getStatusTagType, getTransferStageTagType, getValidNdcActions, isBase64, landAreaUnitList, methodologyOptions, mitigationSubTypeList, mitigationSubTypesListMapped, mitigationTypeList, ndcActionTypeList, sectorMitigationTypesListMapped, sumArray, titleList, useConnection, useSettingsContext, useUserContext };
36883
36870
  //# sourceMappingURL=index.js.map