@undp/carbon-library 2.1.13-PAN-1.8 → 2.1.13-PAN-1.9

Sign up to get free protection for your applications and to get access to all the features.
package/dist/esm/index.js CHANGED
@@ -20392,22 +20392,22 @@ var enablementTypesAndValues = [
20392
20392
  ];
20393
20393
 
20394
20394
  var NdcActionDetails = function (props) {
20395
- var _a, _b, _c, _d;
20395
+ var _a, _b, _c, _d, _e;
20396
20396
  var isBackBtnVisible = props.isBackBtnVisible, onFormSubmit = props.onFormSubmit, ndcActionDetails = props.ndcActionDetails, translator = props.translator, programmeDetails = props.programmeDetails, onClickedBackBtn = props.onClickedBackBtn;
20397
20397
  translator.setDefaultNamespace("ndcAction");
20398
20398
  var t = translator.t;
20399
- var _e = useState(), ndcActionType = _e[0], setNdcActionType = _e[1];
20400
- var _f = useState(), methodology = _f[0], setMethodology = _f[1];
20401
- var _g = useState(), mitigationType = _g[0], setmitigationType = _g[1];
20402
- var _h = useState(""), mitigationSubType = _h[0], setMitigationSubType = _h[1];
20403
- var _j = useState(""), sector = _j[0], setSector = _j[1];
20404
- var _k = useState(""), subSector = _k[0], setSubSector = _k[1];
20405
- var _l = useState(ndcActionTypeList), ndcActionTypeListFiltered = _l[0]; _l[1];
20406
- var _m = useState([]), checkedOptionsGhgReduced = _m[0], setCheckedOptionsGhgReduced = _m[1];
20407
- var _o = useState([]), checkedOptionsGhgAvoided = _o[0], setCheckedOptionsGhgAvoided = _o[1];
20408
- var _p = useState(), inputNumberValueGhgAvoidedGas = _p[0], setInputNumberValueGhgAvoidedGas = _p[1];
20409
- var _q = useState(), inputNumberValueGhgReducedGas = _q[0], setInputNumberValueGhgReducedGas = _q[1];
20410
- var _r = useState(), includedInNAP = _r[0], setIncludedInNAP = _r[1];
20399
+ var _f = useState(), ndcActionType = _f[0], setNdcActionType = _f[1];
20400
+ var _g = useState(), methodology = _g[0], setMethodology = _g[1];
20401
+ var _h = useState(), mitigationType = _h[0], setmitigationType = _h[1];
20402
+ var _j = useState(""), mitigationSubType = _j[0], setMitigationSubType = _j[1];
20403
+ var _k = useState(""), sector = _k[0], setSector = _k[1];
20404
+ var _l = useState(""), subSector = _l[0], setSubSector = _l[1];
20405
+ var _m = useState(ndcActionTypeList), ndcActionTypeListFiltered = _m[0]; _m[1];
20406
+ var _o = useState([]), checkedOptionsGhgReduced = _o[0], setCheckedOptionsGhgReduced = _o[1];
20407
+ var _p = useState([]), checkedOptionsGhgAvoided = _p[0], setCheckedOptionsGhgAvoided = _p[1];
20408
+ var _q = useState(), inputNumberValueGhgAvoidedGas = _q[0], setInputNumberValueGhgAvoidedGas = _q[1];
20409
+ var _r = useState(), inputNumberValueGhgReducedGas = _r[0], setInputNumberValueGhgReducedGas = _r[1];
20410
+ var _s = useState(), includedInNAP = _s[0], setIncludedInNAP = _s[1];
20411
20411
  var form = Form.useForm()[0];
20412
20412
  var maximumImageSize = process.env.REACT_APP_MAXIMUM_FILE_SIZE
20413
20413
  ? parseInt(process.env.REACT_APP_MAXIMUM_FILE_SIZE)
@@ -20813,7 +20813,9 @@ var NdcActionDetails = function (props) {
20813
20813
  ndcActionType === NdcActionTypes.CrossCutting) && (React.createElement(React.Fragment, null,
20814
20814
  React.createElement(Row, { justify: "start", align: "middle" },
20815
20815
  React.createElement(Col, null,
20816
- React.createElement(Form.Item, { label: t("ndcAction:mitigationType"), name: "mitigationType", rules: [
20816
+ React.createElement(Form.Item, { label: t("ndcAction:mitigationType"), initialValue: sectorMitigationTypesListMapped[sector]
20817
+ ? (_c = (_b = (_a = sectorMitigationTypesListMapped[sector]) === null || _a === void 0 ? void 0 : _a.find(function (item) { return item.label === sector; })) === null || _b === void 0 ? void 0 : _b.label) !== null && _c !== void 0 ? _c : ""
20818
+ : "", name: "mitigationType", rules: [
20817
20819
  {
20818
20820
  required: true,
20819
20821
  message: "".concat(t("ndcAction:mitigationType"), " ").concat(t("ndcAction:isRequired")),
@@ -20826,22 +20828,14 @@ var NdcActionDetails = function (props) {
20826
20828
  (programmeDetails === null || programmeDetails === void 0 ? void 0 : programmeDetails.sector) === Sector.Education ||
20827
20829
  (programmeDetails === null || programmeDetails === void 0 ? void 0 : programmeDetails.sector) === Sector.Hospitality
20828
20830
  ? mitigationTypeList
20829
- : sectorMitigationTypesListMapped[sector],
20830
- // defaultValue={
20831
- // sectorMitigationTypesListMapped[sector]
20832
- // ? sectorMitigationTypesListMapped[sector]?.find(
20833
- // (item: any) => item.label === sector
20834
- // )?.label ?? ""
20835
- // : ""
20836
- // }
20837
- value: sectorMitigationTypesListMapped[sector]
20838
- ? (_b = (_a = sectorMitigationTypesListMapped[sector]) === null || _a === void 0 ? void 0 : _a.find(function (item) { return item.label === sector; })) !== null && _b !== void 0 ? _b : { value: "", label: "" }
20839
- : { value: "", label: "" } }))),
20831
+ : sectorMitigationTypesListMapped[sector] }))),
20840
20832
  (ndcActionType === NdcActionTypes.Mitigation ||
20841
20833
  ndcActionType === NdcActionTypes.CrossCutting) &&
20842
20834
  mitigationType &&
20843
20835
  mitigationSubTypesListMapped[mitigationType] && (React.createElement(Col, { style: { marginLeft: "38px" } },
20844
- React.createElement(Form.Item, { label: t("ndcAction:mitigationSubType"), name: "mitigationSubType", rules: [
20836
+ React.createElement(Form.Item, { label: t("ndcAction:mitigationSubType"), name: "mitigationSubType", initialValue: mitigationSubTypesListMapped[subSector]
20837
+ ? (_e = (_d = mitigationSubTypesListMapped[subSector]) === null || _d === void 0 ? void 0 : _d.find(function (item) { return item.label === subSector; })) === null || _e === void 0 ? void 0 : _e.label
20838
+ : "", rules: [
20845
20839
  {
20846
20840
  required: true,
20847
20841
  message: "".concat(t("ndcAction:mitigationSubType"), " ").concat(t("ndcAction:isRequired")),
@@ -20850,13 +20844,7 @@ var NdcActionDetails = function (props) {
20850
20844
  React.createElement(Select, { size: "large", onChange: handleMitigationSubTypeChange, style: {
20851
20845
  width: "249px",
20852
20846
  borderRadius: "4px",
20853
- }, options: mitigationSubTypesListMapped[mitigationType], value: mitigationSubType ||
20854
- ((_d = (mitigationSubTypesListMapped[subSector]
20855
- ? (_c = mitigationSubTypesListMapped[subSector]) === null || _c === void 0 ? void 0 : _c.find(function (item) { return item.label === subSector; })
20856
- : { value: "", label: "" })) !== null && _d !== void 0 ? _d : {
20857
- value: "",
20858
- label: "",
20859
- }) }))))),
20847
+ }, options: mitigationSubTypesListMapped[mitigationType] }))))),
20860
20848
  React.createElement(Row, { justify: "start", align: "middle" },
20861
20849
  React.createElement(Col, { span: 20 },
20862
20850
  React.createElement(Form.Item, { label: t("ndcAction:methodology"), name: "methodology", rules: [