@undp/carbon-library 1.0.133-NAM-17.2 → 1.0.133-NAM-17.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/index.js +67 -12
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/Definitions/Enums/typeOfMitigation.enum.d.ts +10 -1
- package/dist/esm/index.js +68 -13
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/Definitions/Enums/typeOfMitigation.enum.d.ts +10 -1
- package/dist/index.d.ts +11 -2
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
@@ -1162,6 +1162,8 @@ var mitigationTypeList = [
|
|
1162
1162
|
{ value: exports.MitigationTypes.N20.valueOf(), label: "N2O" },
|
1163
1163
|
{ value: exports.MitigationTypes.TRANSPORT.valueOf(), label: "Transport" },
|
1164
1164
|
{ value: exports.MitigationTypes.WIND.valueOf(), label: "Wind" },
|
1165
|
+
{ value: exports.MitigationTypes.CO2_USAGE.valueOf(), label: "CO2 usage" },
|
1166
|
+
{ value: exports.MitigationTypes.TIDAL.valueOf(), label: "Tidal" },
|
1165
1167
|
];
|
1166
1168
|
var sectorMitigationTypesListMapped = {
|
1167
1169
|
Energy: [
|
@@ -1223,6 +1225,8 @@ var sectorMitigationTypesListMapped = {
|
|
1223
1225
|
Other: [
|
1224
1226
|
{ value: exports.MitigationTypes.MARINE.valueOf(), label: "Marine" },
|
1225
1227
|
{ value: exports.MitigationTypes.N20.valueOf(), label: "N2O" },
|
1228
|
+
{ value: exports.MitigationTypes.CO2_USAGE.valueOf(), label: "CO2 usage" },
|
1229
|
+
{ value: exports.MitigationTypes.TIDAL.valueOf(), label: "Tidal" },
|
1226
1230
|
],
|
1227
1231
|
};
|
1228
1232
|
var mitigationSubTypeList = [
|
@@ -1249,7 +1253,7 @@ var mitigationSubTypeList = [
|
|
1249
1253
|
{ label: "Biodiesel", value: exports.MitigationSubTypes.BIODIESEL.valueOf() },
|
1250
1254
|
{ label: "Biodiesel from waste oil", value: exports.MitigationSubTypes.BIODIESEL_FROM_WASTE_OIL.valueOf() },
|
1251
1255
|
{ label: "Ethanol", value: exports.MitigationSubTypes.ETHANOL.valueOf() },
|
1252
|
-
{ label: "
|
1256
|
+
{ label: "Clinker replacement", value: exports.MitigationSubTypes.CLINKER_REPLACEMENT.valueOf() },
|
1253
1257
|
{ label: "Coal Mine Methane", value: exports.MitigationSubTypes.COAL_MINE_METHANE.valueOf() },
|
1254
1258
|
{ label: "Coal Bed Methane", value: exports.MitigationSubTypes.COAL_BED_METHANE.valueOf() },
|
1255
1259
|
{ label: "CMM & Ventilation Air Methane", value: exports.MitigationSubTypes.CMM_VENTILATION_AIR_METHANE.valueOf() },
|
@@ -1379,8 +1383,8 @@ var mitigationSubTypeList = [
|
|
1379
1383
|
{ label: "Cars: Green hydrogen", value: exports.MitigationSubTypes.CARS_GREEN_HYDROGEN.valueOf() },
|
1380
1384
|
{ label: "Cars: efficient operation", value: exports.MitigationSubTypes.CARS_EFFICIENT_OPERATION.valueOf() },
|
1381
1385
|
{ label: "Scrapping old vehicles", value: exports.MitigationSubTypes.SCRAPPING_OLD_VEHICLES.valueOf() },
|
1382
|
-
{ label: "Biodiesel for transport", value: exports.MitigationSubTypes.
|
1383
|
-
{ label: "Cable cars", value: exports.MitigationSubTypes.
|
1386
|
+
{ label: "Biodiesel for transport", value: exports.MitigationSubTypes.BIODIESEL_FOR_TRANSPORT.valueOf() },
|
1387
|
+
{ label: "Cable cars", value: exports.MitigationSubTypes.CABLE_CARS.valueOf() },
|
1384
1388
|
{ label: "Wind", value: exports.MitigationSubTypes.WIND.valueOf() },
|
1385
1389
|
{ label: "Offshore wind", value: exports.MitigationSubTypes.OFFSHORE_WIND.valueOf() },
|
1386
1390
|
{ label: "CO2 recycling", value: exports.MitigationSubTypes.CO2_RECYCLING.valueOf() },
|
@@ -1416,7 +1420,7 @@ var mitigationSubTypesListMapped = {
|
|
1416
1420
|
{ label: "Ethanol", value: exports.MitigationSubTypes.ETHANOL.valueOf() },
|
1417
1421
|
],
|
1418
1422
|
Cement: [
|
1419
|
-
{ label: "
|
1423
|
+
{ label: "Clinker replacement", value: exports.MitigationSubTypes.CLINKER_REPLACEMENT.valueOf() },
|
1420
1424
|
],
|
1421
1425
|
"Coal/Mine": [
|
1422
1426
|
{ label: "Coal Mine Methane", value: exports.MitigationSubTypes.COAL_MINE_METHANE.valueOf() },
|
@@ -1573,7 +1577,7 @@ var mitigationSubTypesListMapped = {
|
|
1573
1577
|
{ label: "Bus Rapid Transit: Green hydrogen", value: exports.MitigationSubTypes.BUS_RAPID_TRANSIT_GREEN_HYDROGEN.valueOf() },
|
1574
1578
|
{ label: "Motorbikes", value: exports.MitigationSubTypes.MOTORBIKES.valueOf() },
|
1575
1579
|
{ label: "Mode shift: Road to rail", value: exports.MitigationSubTypes.MODE_SHIFT_ROAD_TO_RAIL.valueOf() },
|
1576
|
-
{ label: "More efficient train system", value: exports.MitigationSubTypes.
|
1580
|
+
{ label: "More efficient train system", value: exports.MitigationSubTypes.MORE_EFFICIENT_TRAIN_SYSTEM.valueOf() },
|
1577
1581
|
{ label: "More efficient vehicles", value: exports.MitigationSubTypes.MORE_EFFICIENT_VEHICLES.valueOf() },
|
1578
1582
|
{ label: "Rail: regenerative braking", value: exports.MitigationSubTypes.RAIL_REGENERATIVE_BRAKING.valueOf() },
|
1579
1583
|
{ label: "Rail: Green hydrogen", value: exports.MitigationSubTypes.RAIL_GREEN_HYDROGEN.valueOf() },
|
@@ -1582,8 +1586,8 @@ var mitigationSubTypesListMapped = {
|
|
1582
1586
|
{ label: "Cars: Green hydrogen", value: exports.MitigationSubTypes.CARS_GREEN_HYDROGEN.valueOf() },
|
1583
1587
|
{ label: "Cars: efficient operation", value: exports.MitigationSubTypes.CARS_EFFICIENT_OPERATION.valueOf() },
|
1584
1588
|
{ label: "Scrapping old vehicles", value: exports.MitigationSubTypes.SCRAPPING_OLD_VEHICLES.valueOf() },
|
1585
|
-
{ label: "Biodiesel for transport", value: exports.MitigationSubTypes.
|
1586
|
-
{ label: "Cable cars", value: exports.MitigationSubTypes.
|
1589
|
+
{ label: "Biodiesel for transport", value: exports.MitigationSubTypes.BIODIESEL_FOR_TRANSPORT.valueOf() },
|
1590
|
+
{ label: "Cable cars", value: exports.MitigationSubTypes.CABLE_CARS.valueOf() },
|
1587
1591
|
],
|
1588
1592
|
Wind: [
|
1589
1593
|
{ label: "Wind", value: exports.MitigationSubTypes.WIND.valueOf() },
|
@@ -2082,7 +2086,18 @@ exports.TypeOfMitigation = void 0;
|
|
2082
2086
|
(function (TypeOfMitigation) {
|
2083
2087
|
TypeOfMitigation["AGRICULTURE"] = "Agriculture";
|
2084
2088
|
TypeOfMitigation["SOLAR"] = "Solar";
|
2089
|
+
TypeOfMitigation["EE_HOUSEHOLDS"] = "EEHouseholds";
|
2085
2090
|
})(exports.TypeOfMitigation || (exports.TypeOfMitigation = {}));
|
2091
|
+
// sub types of mitigation
|
2092
|
+
exports.SubTypeOfMitigation = void 0;
|
2093
|
+
(function (SubTypeOfMitigation) {
|
2094
|
+
SubTypeOfMitigation["SOIL_ENRICHMENT_BIOCHAR"] = "SoilEnrichmentBiochar";
|
2095
|
+
SubTypeOfMitigation["RICE_CROPS"] = "RiceCrops";
|
2096
|
+
SubTypeOfMitigation["SOLAR_PHOTOVOLTAICS_PV"] = "SolarPhotovoltaicsPV";
|
2097
|
+
SubTypeOfMitigation["SOLAR_WATER_PUMPING_OFF_GRID"] = "SolarWaterPumpingOffGrid";
|
2098
|
+
SubTypeOfMitigation["SOLAR_WATER_PUMPING_ON_GRID"] = "SolarWaterPumpingOnGrid";
|
2099
|
+
SubTypeOfMitigation["STOVES_HOUSES_IN_NAMIBIA"] = "StovesHousesInNamibia";
|
2100
|
+
})(exports.SubTypeOfMitigation || (exports.SubTypeOfMitigation = {}));
|
2086
2101
|
|
2087
2102
|
exports.TxType = void 0;
|
2088
2103
|
(function (TxType) {
|
@@ -17137,12 +17152,20 @@ var NdcActionDetails = function (props) {
|
|
17137
17152
|
value === undefined) {
|
17138
17153
|
throw new Error("".concat(t("ndcAction:energyGeneration"), " ").concat(t("ndcAction:isRequired")));
|
17139
17154
|
}
|
17155
|
+
if (value < 0) {
|
17156
|
+
throw new Error("".concat(t("ndcAction:allowOnlyNumericValueAndDecimal")));
|
17157
|
+
}
|
17140
17158
|
return [2 /*return*/];
|
17141
17159
|
});
|
17142
17160
|
}); },
|
17143
17161
|
},
|
17144
17162
|
], name: "energyGeneration" },
|
17145
|
-
React.createElement(antd.InputNumber, { style: { width: 442, paddingRight: 12 }, onChange:
|
17163
|
+
React.createElement(antd.InputNumber, { style: { width: 442, paddingRight: 12 }, onChange: function (value) {
|
17164
|
+
var numericValue = Number(value); // Convert value to a number
|
17165
|
+
if (!isNaN(numericValue) && numericValue >= 0) {
|
17166
|
+
calculateMethodologyEstimatedCredits();
|
17167
|
+
}
|
17168
|
+
} }))),
|
17146
17169
|
React.createElement(antd.Col, { style: { marginLeft: "38px" } },
|
17147
17170
|
React.createElement(antd.Form.Item, { label: t("ndcAction:energyGenerationUnit"), name: "energyGenerationUnit", rules: [
|
17148
17171
|
{
|
@@ -17177,12 +17200,20 @@ var NdcActionDetails = function (props) {
|
|
17177
17200
|
value === undefined) {
|
17178
17201
|
throw new Error("".concat(t("ndcAction:eligibleLandArea"), " ").concat(t("ndcAction:isRequired")));
|
17179
17202
|
}
|
17203
|
+
if (value < 0) {
|
17204
|
+
throw new Error("".concat(t("ndcAction:allowOnlyNumericValueAndDecimal")));
|
17205
|
+
}
|
17180
17206
|
return [2 /*return*/];
|
17181
17207
|
});
|
17182
17208
|
}); },
|
17183
17209
|
},
|
17184
17210
|
] },
|
17185
|
-
React.createElement(antd.InputNumber, { style: { width: 442, paddingRight: 12 }, onChange:
|
17211
|
+
React.createElement(antd.InputNumber, { style: { width: 442, paddingRight: 12 }, onChange: function (value) {
|
17212
|
+
var numericValue = Number(value); // Convert value to a number
|
17213
|
+
if (!isNaN(numericValue) && numericValue >= 0) {
|
17214
|
+
calculateMethodologyEstimatedCredits();
|
17215
|
+
}
|
17216
|
+
} }))),
|
17186
17217
|
React.createElement(antd.Col, { style: { marginLeft: "38px" } },
|
17187
17218
|
React.createElement(antd.Form.Item, { label: t("ndcAction:landAreaUnit"), name: "landAreaUnit", rules: [
|
17188
17219
|
{
|
@@ -17210,12 +17241,20 @@ var NdcActionDetails = function (props) {
|
|
17210
17241
|
value === undefined) {
|
17211
17242
|
throw new Error("".concat(t("ndcAction:tonnesOnDryBasis"), " ").concat(t("ndcAction:isRequired")));
|
17212
17243
|
}
|
17244
|
+
if (value < 1) {
|
17245
|
+
throw new Error("".concat(t("ndcAction:allowOnlyNumericValueAndDecimal")));
|
17246
|
+
}
|
17213
17247
|
return [2 /*return*/];
|
17214
17248
|
});
|
17215
17249
|
}); },
|
17216
17250
|
},
|
17217
17251
|
] },
|
17218
|
-
React.createElement(antd.InputNumber, { style: { width: 442, paddingRight: 12 }, onChange:
|
17252
|
+
React.createElement(antd.InputNumber, { style: { width: 442, paddingRight: 12 }, onChange: function (value) {
|
17253
|
+
var numericValue = Number(value); // Convert value to a number
|
17254
|
+
if (!isNaN(numericValue) && numericValue >= 0) {
|
17255
|
+
calculateMethodologyEstimatedCredits();
|
17256
|
+
}
|
17257
|
+
} }))))),
|
17219
17258
|
(ndcActionType === exports.NdcActionTypes.Mitigation ||
|
17220
17259
|
ndcActionType === exports.NdcActionTypes.CrossCutting) &&
|
17221
17260
|
mitigationType === exports.MitigationTypes.EE_HOUSEHOLDS &&
|
@@ -17236,12 +17275,20 @@ var NdcActionDetails = function (props) {
|
|
17236
17275
|
value === undefined) {
|
17237
17276
|
throw new Error("".concat(t("ndcAction:numberOfDays"), " ").concat(t("ndcAction:isRequired")));
|
17238
17277
|
}
|
17278
|
+
if (value < 0) {
|
17279
|
+
throw new Error("".concat(t("ndcAction:allowOnlyNumericValue")));
|
17280
|
+
}
|
17239
17281
|
return [2 /*return*/];
|
17240
17282
|
});
|
17241
17283
|
}); },
|
17242
17284
|
},
|
17243
17285
|
], name: "numberOfDays" },
|
17244
|
-
React.createElement(antd.InputNumber, { style: { width: 442, paddingRight: 12 }, onChange:
|
17286
|
+
React.createElement(antd.InputNumber, { style: { width: 442, paddingRight: 12 }, onChange: function (value) {
|
17287
|
+
var numericValue = Number(value); // Convert value to a number
|
17288
|
+
if (!isNaN(numericValue) && numericValue >= 0) {
|
17289
|
+
calculateMethodologyEstimatedCredits();
|
17290
|
+
}
|
17291
|
+
} }))),
|
17245
17292
|
React.createElement(antd.Col, { style: { marginLeft: "38px" } },
|
17246
17293
|
React.createElement(antd.Form.Item, { label: t("ndcAction:numberOfPeople"), rules: [
|
17247
17294
|
{
|
@@ -17257,12 +17304,20 @@ var NdcActionDetails = function (props) {
|
|
17257
17304
|
value === undefined) {
|
17258
17305
|
throw new Error("".concat(t("ndcAction:numberOfPeople"), " ").concat(t("ndcAction:isRequired")));
|
17259
17306
|
}
|
17307
|
+
if (value < 0) {
|
17308
|
+
throw new Error("".concat(t("ndcAction:allowOnlyNumericValue")));
|
17309
|
+
}
|
17260
17310
|
return [2 /*return*/];
|
17261
17311
|
});
|
17262
17312
|
}); },
|
17263
17313
|
},
|
17264
17314
|
], name: "numberOfPeople" },
|
17265
|
-
React.createElement(antd.InputNumber, { style: { width: 442, paddingRight: 12 }, onChange:
|
17315
|
+
React.createElement(antd.InputNumber, { style: { width: 442, paddingRight: 12 }, onChange: function (value) {
|
17316
|
+
var numericValue = Number(value); // Convert value to a number
|
17317
|
+
if (!isNaN(numericValue) && numericValue >= 0) {
|
17318
|
+
calculateMethodologyEstimatedCredits();
|
17319
|
+
}
|
17320
|
+
} })))))),
|
17266
17321
|
(ndcActionType === exports.NdcActionTypes.Mitigation ||
|
17267
17322
|
ndcActionType === exports.NdcActionTypes.CrossCutting) && (React.createElement(antd.Row, { justify: "start", align: "middle" },
|
17268
17323
|
React.createElement(antd.Col, null,
|