@undp/carbon-library 1.0.135-ghg-inventory.12.17 → 1.0.135-ghg-inventory.12.19

Sign up to get free protection for your applications and to get access to all the features.
package/dist/cjs/index.js CHANGED
@@ -29483,14 +29483,23 @@ var GHGEmissionsComponent = function (props) {
29483
29483
  setOpenFinalizeFormModal(false);
29484
29484
  };
29485
29485
  var onOpenFinalizeFormModel = function () {
29486
- setActionInfo({
29487
- action: "".concat(t("ghgInventory:finalize")),
29488
- headerText: "".concat(t("ghgInventory:finalizeModelHeader")),
29489
- type: "primary",
29490
- icon: React.createElement(Icon.ClipboardCheck, null),
29486
+ form
29487
+ .validateFields()
29488
+ .then(function (values) {
29489
+ // Validation successful, set ActionInfo and open the form modal
29490
+ setActionInfo({
29491
+ action: "".concat(t("ghgInventory:finalize")),
29492
+ headerText: "".concat(t("ghgInventory:finalizeModelHeader")),
29493
+ type: "primary",
29494
+ icon: React.createElement(Icon.ClipboardCheck, null),
29495
+ });
29496
+ setErrorMsg('');
29497
+ setOpenFinalizeFormModal(true);
29498
+ })
29499
+ .catch(function (errorInfo) {
29500
+ // Validation failed
29501
+ console.log('Validation failed:', errorInfo);
29491
29502
  });
29492
- setErrorMsg('');
29493
- setOpenFinalizeFormModal(true);
29494
29503
  };
29495
29504
  var onSubmitForm = function (remarks, status) { return __awaiter(void 0, void 0, void 0, function () {
29496
29505
  var fields, payload, response, messageContent, error_1;
@@ -31023,14 +31032,23 @@ var GHGProjectionsComponent = function (props) {
31023
31032
  setOpenFinalizeFormModal(false);
31024
31033
  };
31025
31034
  var onOpenFinalizeFormModel = function () {
31026
- setActionInfo({
31027
- action: "".concat(t("ghgInventory:finalize")),
31028
- headerText: "".concat(t("ghgInventory:finalizeModelHeader")),
31029
- type: "primary",
31030
- icon: React.createElement(Icon.ClipboardCheck, null),
31035
+ form
31036
+ .validateFields()
31037
+ .then(function (values) {
31038
+ // Validation successful, set ActionInfo and open the form modal
31039
+ setActionInfo({
31040
+ action: "".concat(t("ghgInventory:finalize")),
31041
+ headerText: "".concat(t("ghgInventory:finalizeModelHeader")),
31042
+ type: "primary",
31043
+ icon: React.createElement(Icon.ClipboardCheck, null),
31044
+ });
31045
+ setErrorMsg('');
31046
+ setOpenFinalizeFormModal(true);
31047
+ })
31048
+ .catch(function (errorInfo) {
31049
+ // Validation failed
31050
+ console.log('Validation failed:', errorInfo);
31031
31051
  });
31032
- setErrorMsg('');
31033
- setOpenFinalizeFormModal(true);
31034
31052
  };
31035
31053
  var getProjectionData = function () { return __awaiter(void 0, void 0, void 0, function () {
31036
31054
  var response, error_1;
@@ -32087,7 +32105,7 @@ var totalEmissionOptionsSub = function (labels, chartColors) {
32087
32105
  color: '#263238',
32088
32106
  fontSize: '12px',
32089
32107
  fontFamily: 'Inter',
32090
- fontWeight: 400,
32108
+ fontWeight: 500,
32091
32109
  cssClass: 'apexcharts-yaxis-title',
32092
32110
  },
32093
32111
  },
@@ -32255,7 +32273,7 @@ var actualVsEstimateOptionsSub = function (labels, chartColors) {
32255
32273
  color: '#263238',
32256
32274
  fontSize: '12px',
32257
32275
  fontFamily: 'Inter',
32258
- fontWeight: 400,
32276
+ fontWeight: 500,
32259
32277
  cssClass: 'apexcharts-yaxis-title',
32260
32278
  },
32261
32279
  },
@@ -32377,7 +32395,7 @@ var emissionComparisonOptionsSub = function (labels, chartColors) {
32377
32395
  color: '#263238',
32378
32396
  fontSize: '12px',
32379
32397
  fontFamily: 'Inter',
32380
- fontWeight: 400,
32398
+ fontWeight: 500,
32381
32399
  cssClass: 'apexcharts-yaxis-title',
32382
32400
  },
32383
32401
  },