@undp/carbon-library 1.0.135-ghg-inventory.12.20 → 1.0.135-ghg-inventory.12.21

Sign up to get free protection for your applications and to get access to all the features.
package/dist/cjs/index.js CHANGED
@@ -30256,15 +30256,12 @@ var GHGEmissionsComponent = function (props) {
30256
30256
  if (value && value < 0) {
30257
30257
  throw new Error();
30258
30258
  }
30259
- if (value && !Number.isInteger(value)) {
30260
- throw new Error();
30261
- }
30262
30259
  return [2 /*return*/];
30263
30260
  });
30264
30261
  }); },
30265
30262
  },
30266
30263
  ] },
30267
- React.createElement(antd.InputNumber, { onChange: function (event) { return calculateSumCo2(event, panelHeading); } }))),
30264
+ React.createElement(antd.InputNumber, { onChange: function (event) { return calculateSumCo2(event, panelHeading); }, disabled: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly }))),
30268
30265
  React.createElement(antd.Col, { xl: 6 },
30269
30266
  React.createElement(antd.Form.Item, { name: panelHeading + '_' + item + '_ch4', rules: [
30270
30267
  {
@@ -30273,15 +30270,12 @@ var GHGEmissionsComponent = function (props) {
30273
30270
  if (value && value < 0) {
30274
30271
  throw new Error();
30275
30272
  }
30276
- if (value && !Number.isInteger(value)) {
30277
- throw new Error();
30278
- }
30279
30273
  return [2 /*return*/];
30280
30274
  });
30281
30275
  }); },
30282
30276
  },
30283
30277
  ] },
30284
- React.createElement(antd.InputNumber, { onChange: function (event) { return calculateSumCh4(event, panelHeading); } }))),
30278
+ React.createElement(antd.InputNumber, { onChange: function (event) { return calculateSumCh4(event, panelHeading); }, disabled: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly }))),
30285
30279
  React.createElement(antd.Col, { xl: 6 },
30286
30280
  React.createElement(antd.Form.Item, { name: panelHeading + '_' + item + '_n2o', rules: [
30287
30281
  {
@@ -30290,15 +30284,12 @@ var GHGEmissionsComponent = function (props) {
30290
30284
  if (value && value < 0) {
30291
30285
  throw new Error();
30292
30286
  }
30293
- if (value && !Number.isInteger(value)) {
30294
- throw new Error();
30295
- }
30296
30287
  return [2 /*return*/];
30297
30288
  });
30298
30289
  }); },
30299
30290
  },
30300
30291
  ] },
30301
- React.createElement(antd.InputNumber, { onChange: function (event) { return calculateSumN2o(event, panelHeading); } }))),
30292
+ React.createElement(antd.InputNumber, { onChange: function (event) { return calculateSumN2o(event, panelHeading); }, disabled: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly }))),
30302
30293
  React.createElement(antd.Col, { xl: 6 },
30303
30294
  React.createElement(antd.Form.Item, { name: panelHeading + '_' + item + '_co2eq', rules: [
30304
30295
  {
@@ -30307,15 +30298,12 @@ var GHGEmissionsComponent = function (props) {
30307
30298
  if (value && value < 0) {
30308
30299
  throw new Error();
30309
30300
  }
30310
- if (value && !Number.isInteger(value)) {
30311
- throw new Error();
30312
- }
30313
30301
  return [2 /*return*/];
30314
30302
  });
30315
30303
  }); },
30316
30304
  },
30317
30305
  ] },
30318
- React.createElement(antd.InputNumber, { onChange: function (event) { return calculateSumCo2Eq(event, panelHeading); } }))))))); };
30306
+ React.createElement(antd.InputNumber, { onChange: function (event) { return calculateSumCo2Eq(event, panelHeading); }, disabled: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly }))))))); };
30319
30307
  var renderPanelContentView = function (co2, ch4, n2o, co2eq, item, index) {
30320
30308
  return (React.createElement(antd.Row, { gutter: 16, key: index, className: "panel-content-row" },
30321
30309
  React.createElement(antd.Col, { xl: 12, md: 12, className: "panel-content-title" },
@@ -30496,9 +30484,9 @@ var GHGEmissionsComponent = function (props) {
30496
30484
  // Prevent upload
30497
30485
  return false;
30498
30486
  } },
30499
- React.createElement(antd.Button, { icon: React.createElement(icons.UploadOutlined, null) }, t("ghgInventory:upload"))))),
30487
+ React.createElement(antd.Button, { icon: React.createElement(icons.UploadOutlined, null), disabled: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly }, t("ghgInventory:upload"))))),
30500
30488
  React.createElement(antd.Col, { xl: 16, md: 16, className: "add-new-upload-file-name-input" },
30501
- React.createElement(antd.Input, { value: uploadedFileName, readOnly: true, suffix: uploadedFileName && (React.createElement(antd.Button, { onClick: clearUploadDoc, icon: React.createElement(icons.DeleteOutlined, null), style: { marginRight: '-10px', padding: '0px 6px' } })) }))))),
30489
+ React.createElement(antd.Input, { value: uploadedFileName, disabled: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly, readOnly: true, suffix: uploadedFileName && (React.createElement(antd.Button, { onClick: clearUploadDoc, icon: React.createElement(icons.DeleteOutlined, null), style: { marginRight: '-10px', padding: '0px 6px' } })) }))))),
30502
30490
  React.createElement(antd.Row, { gutter: 16 },
30503
30491
  React.createElement(antd.Col, { span: 9, offset: 12 },
30504
30492
  React.createElement(antd.Row, { gutter: 16, className: "table-heading-row" },
@@ -30560,15 +30548,12 @@ var GHGEmissionsComponent = function (props) {
30560
30548
  if (value && value < 0) {
30561
30549
  throw new Error();
30562
30550
  }
30563
- if (value && !Number.isInteger(value)) {
30564
- throw new Error();
30565
- }
30566
30551
  return [2 /*return*/];
30567
30552
  });
30568
30553
  }); },
30569
30554
  },
30570
30555
  ] },
30571
- React.createElement(antd.InputNumber, null))),
30556
+ React.createElement(antd.InputNumber, { disabled: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly }))),
30572
30557
  React.createElement(antd.Col, { xl: 6 },
30573
30558
  React.createElement(antd.Form.Item, { name: "totalCo2WithoutLand_ch4", rules: [
30574
30559
  {
@@ -30577,15 +30562,12 @@ var GHGEmissionsComponent = function (props) {
30577
30562
  if (value && value < 0) {
30578
30563
  throw new Error();
30579
30564
  }
30580
- if (value && !Number.isInteger(value)) {
30581
- throw new Error();
30582
- }
30583
30565
  return [2 /*return*/];
30584
30566
  });
30585
30567
  }); },
30586
30568
  },
30587
30569
  ] },
30588
- React.createElement(antd.InputNumber, null))),
30570
+ React.createElement(antd.InputNumber, { disabled: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly }))),
30589
30571
  React.createElement(antd.Col, { xl: 6 },
30590
30572
  React.createElement(antd.Form.Item, { name: "totalCo2WithoutLand_n2o", rules: [
30591
30573
  {
@@ -30594,15 +30576,12 @@ var GHGEmissionsComponent = function (props) {
30594
30576
  if (value && value < 0) {
30595
30577
  throw new Error();
30596
30578
  }
30597
- if (value && !Number.isInteger(value)) {
30598
- throw new Error();
30599
- }
30600
30579
  return [2 /*return*/];
30601
30580
  });
30602
30581
  }); },
30603
30582
  },
30604
30583
  ] },
30605
- React.createElement(antd.InputNumber, null))),
30584
+ React.createElement(antd.InputNumber, { disabled: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly }))),
30606
30585
  React.createElement(antd.Col, { xl: 6 },
30607
30586
  React.createElement(antd.Form.Item, { name: "totalCo2WithoutLand_co2eq", rules: [
30608
30587
  {
@@ -30611,15 +30590,12 @@ var GHGEmissionsComponent = function (props) {
30611
30590
  if (value && value < 0) {
30612
30591
  throw new Error();
30613
30592
  }
30614
- if (value && !Number.isInteger(value)) {
30615
- throw new Error();
30616
- }
30617
30593
  return [2 /*return*/];
30618
30594
  });
30619
30595
  }); },
30620
30596
  },
30621
30597
  ] },
30622
- React.createElement(antd.InputNumber, null)))))),
30598
+ React.createElement(antd.InputNumber, { disabled: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly })))))),
30623
30599
  React.createElement(antd.Row, { gutter: 16, key: 'totalCo2WithLand', className: "total-co2-with-land-row" },
30624
30600
  React.createElement(antd.Col, { xl: 12, md: 12, className: "total-co2-with-land-title" },
30625
30601
  React.createElement("span", null, t("ghgInventory:totalCo2WithLand"))),
@@ -30633,15 +30609,12 @@ var GHGEmissionsComponent = function (props) {
30633
30609
  if (value && value < 0) {
30634
30610
  throw new Error();
30635
30611
  }
30636
- if (value && !Number.isInteger(value)) {
30637
- throw new Error();
30638
- }
30639
30612
  return [2 /*return*/];
30640
30613
  });
30641
30614
  }); },
30642
30615
  },
30643
30616
  ] },
30644
- React.createElement(antd.InputNumber, null))),
30617
+ React.createElement(antd.InputNumber, { disabled: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly }))),
30645
30618
  React.createElement(antd.Col, { xl: 6 },
30646
30619
  React.createElement(antd.Form.Item, { name: "totalCo2WithLand_ch4", rules: [
30647
30620
  {
@@ -30650,15 +30623,12 @@ var GHGEmissionsComponent = function (props) {
30650
30623
  if (value && value < 0) {
30651
30624
  throw new Error();
30652
30625
  }
30653
- if (value && !Number.isInteger(value)) {
30654
- throw new Error();
30655
- }
30656
30626
  return [2 /*return*/];
30657
30627
  });
30658
30628
  }); },
30659
30629
  },
30660
30630
  ] },
30661
- React.createElement(antd.InputNumber, null))),
30631
+ React.createElement(antd.InputNumber, { disabled: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly }))),
30662
30632
  React.createElement(antd.Col, { xl: 6 },
30663
30633
  React.createElement(antd.Form.Item, { name: "totalCo2WithLand_n2o", rules: [
30664
30634
  {
@@ -30667,15 +30637,12 @@ var GHGEmissionsComponent = function (props) {
30667
30637
  if (value && value < 0) {
30668
30638
  throw new Error();
30669
30639
  }
30670
- if (value && !Number.isInteger(value)) {
30671
- throw new Error();
30672
- }
30673
30640
  return [2 /*return*/];
30674
30641
  });
30675
30642
  }); },
30676
30643
  },
30677
30644
  ] },
30678
- React.createElement(antd.InputNumber, null))),
30645
+ React.createElement(antd.InputNumber, { disabled: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly }))),
30679
30646
  React.createElement(antd.Col, { xl: 6 },
30680
30647
  React.createElement(antd.Form.Item, { name: "totalCo2WithLand_co2eq", rules: [
30681
30648
  {
@@ -30684,15 +30651,12 @@ var GHGEmissionsComponent = function (props) {
30684
30651
  if (value && value < 0) {
30685
30652
  throw new Error();
30686
30653
  }
30687
- if (value && !Number.isInteger(value)) {
30688
- throw new Error();
30689
- }
30690
30654
  return [2 /*return*/];
30691
30655
  });
30692
30656
  }); },
30693
30657
  },
30694
30658
  ] },
30695
- React.createElement(antd.InputNumber, null)))))),
30659
+ React.createElement(antd.InputNumber, { disabled: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly })))))),
30696
30660
  (((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.GOVERNMENT || (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.MINISTRY)
30697
30661
  && ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== exports.Role.ViewOnly)) &&
30698
30662
  (React.createElement("div", { className: "steps-actions" },
@@ -31960,15 +31924,12 @@ var GHGProjectionsComponent = function (props) {
31960
31924
  if (value && value < 0) {
31961
31925
  throw new Error();
31962
31926
  }
31963
- if (value && !Number.isInteger(value)) {
31964
- throw new Error();
31965
- }
31966
31927
  return [2 /*return*/];
31967
31928
  });
31968
31929
  }); },
31969
31930
  },
31970
31931
  ] },
31971
- React.createElement(antd.InputNumber, { onChange: function (event) { return calculateSumBau(event, panelHeading); } }))),
31932
+ React.createElement(antd.InputNumber, { onChange: function (event) { return calculateSumBau(event, panelHeading); }, disabled: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly }))),
31972
31933
  React.createElement(antd.Col, { xl: 7 },
31973
31934
  React.createElement(antd.Form.Item, { name: panelHeading + '_' + item + '_conditionalNdc', rules: [
31974
31935
  {
@@ -31977,15 +31938,12 @@ var GHGProjectionsComponent = function (props) {
31977
31938
  if (value && value < 0) {
31978
31939
  throw new Error();
31979
31940
  }
31980
- if (value && !Number.isInteger(value)) {
31981
- throw new Error();
31982
- }
31983
31941
  return [2 /*return*/];
31984
31942
  });
31985
31943
  }); },
31986
31944
  },
31987
31945
  ] },
31988
- React.createElement(antd.InputNumber, { onChange: function (event) { return calculateSumConditionalNdc(event, panelHeading); } }))),
31946
+ React.createElement(antd.InputNumber, { onChange: function (event) { return calculateSumConditionalNdc(event, panelHeading); }, disabled: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly }))),
31989
31947
  React.createElement(antd.Col, { xl: 7 },
31990
31948
  React.createElement(antd.Form.Item, { name: panelHeading + '_' + item + '_unconditionalNdc', rules: [
31991
31949
  {
@@ -31994,15 +31952,12 @@ var GHGProjectionsComponent = function (props) {
31994
31952
  if (value && value < 0) {
31995
31953
  throw new Error();
31996
31954
  }
31997
- if (value && !Number.isInteger(value)) {
31998
- throw new Error();
31999
- }
32000
31955
  return [2 /*return*/];
32001
31956
  });
32002
31957
  }); },
32003
31958
  },
32004
31959
  ] },
32005
- React.createElement(antd.InputNumber, { onChange: function (event) { return calculateSumUnconditionalNdc(event, panelHeading); } }))))))); };
31960
+ React.createElement(antd.InputNumber, { onChange: function (event) { return calculateSumUnconditionalNdc(event, panelHeading); }, disabled: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly }))))))); };
32006
31961
  var renderPanelContentView = function (bau, conditionalNdc, unconditionalNdc, item, index) {
32007
31962
  return (React.createElement(antd.Row, { gutter: 16, key: index, className: "panel-content-row" },
32008
31963
  React.createElement(antd.Col, { xl: 12, md: 12, className: "panel-content-title" },
@@ -32178,9 +32133,9 @@ var GHGProjectionsComponent = function (props) {
32178
32133
  // Prevent upload
32179
32134
  return false;
32180
32135
  } },
32181
- React.createElement(antd.Button, { icon: React.createElement(icons.UploadOutlined, null) }, t("ghgInventory:upload"))))),
32136
+ React.createElement(antd.Button, { icon: React.createElement(icons.UploadOutlined, null), disabled: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly }, t("ghgInventory:upload"))))),
32182
32137
  React.createElement(antd.Col, { xl: 16, md: 16, className: "add-new-upload-file-name-input" },
32183
- React.createElement(antd.Input, { value: uploadedFileName, readOnly: true, suffix: uploadedFileName && (React.createElement(antd.Button, { onClick: clearUploadDoc, icon: React.createElement(icons.DeleteOutlined, null), style: { marginRight: '-10px', padding: '0px 6px' } })) }))))),
32138
+ React.createElement(antd.Input, { value: uploadedFileName, disabled: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly, readOnly: true, suffix: uploadedFileName && (React.createElement(antd.Button, { onClick: clearUploadDoc, icon: React.createElement(icons.DeleteOutlined, null), style: { marginRight: '-10px', padding: '0px 6px' } })) }))))),
32184
32139
  React.createElement(antd.Row, { gutter: 16 },
32185
32140
  React.createElement(antd.Col, { span: 9, offset: 12 },
32186
32141
  React.createElement(antd.Row, { gutter: 16, className: "table-heading-row" },
@@ -32231,15 +32186,12 @@ var GHGProjectionsComponent = function (props) {
32231
32186
  if (value && value < 0) {
32232
32187
  throw new Error();
32233
32188
  }
32234
- if (value && !Number.isInteger(value)) {
32235
- throw new Error();
32236
- }
32237
32189
  return [2 /*return*/];
32238
32190
  });
32239
32191
  }); },
32240
32192
  },
32241
32193
  ] },
32242
- React.createElement(antd.InputNumber, null))),
32194
+ React.createElement(antd.InputNumber, { disabled: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly }))),
32243
32195
  React.createElement(antd.Col, { xl: 7 },
32244
32196
  React.createElement(antd.Form.Item, { name: "totalCo2WithoutLand_conditionalNdc", rules: [
32245
32197
  {
@@ -32248,15 +32200,12 @@ var GHGProjectionsComponent = function (props) {
32248
32200
  if (value && value < 0) {
32249
32201
  throw new Error();
32250
32202
  }
32251
- if (value && !Number.isInteger(value)) {
32252
- throw new Error();
32253
- }
32254
32203
  return [2 /*return*/];
32255
32204
  });
32256
32205
  }); },
32257
32206
  },
32258
32207
  ] },
32259
- React.createElement(antd.InputNumber, null))),
32208
+ React.createElement(antd.InputNumber, { disabled: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly }))),
32260
32209
  React.createElement(antd.Col, { xl: 7 },
32261
32210
  React.createElement(antd.Form.Item, { name: "totalCo2WithoutLand_unconditionalNdc", rules: [
32262
32211
  {
@@ -32265,15 +32214,12 @@ var GHGProjectionsComponent = function (props) {
32265
32214
  if (value && value < 0) {
32266
32215
  throw new Error();
32267
32216
  }
32268
- if (value && !Number.isInteger(value)) {
32269
- throw new Error();
32270
- }
32271
32217
  return [2 /*return*/];
32272
32218
  });
32273
32219
  }); },
32274
32220
  },
32275
32221
  ] },
32276
- React.createElement(antd.InputNumber, null)))))),
32222
+ React.createElement(antd.InputNumber, { disabled: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly })))))),
32277
32223
  React.createElement(antd.Row, { gutter: 16, key: 'totalCo2WithLand', className: "total-co2-with-land-row" },
32278
32224
  React.createElement(antd.Col, { xl: 12, md: 12, className: "total-co2-with-land-title" },
32279
32225
  React.createElement("span", null, t("ghgInventory:totalCo2WithLand"))),
@@ -32287,15 +32233,12 @@ var GHGProjectionsComponent = function (props) {
32287
32233
  if (value && value < 0) {
32288
32234
  throw new Error();
32289
32235
  }
32290
- if (value && !Number.isInteger(value)) {
32291
- throw new Error();
32292
- }
32293
32236
  return [2 /*return*/];
32294
32237
  });
32295
32238
  }); },
32296
32239
  },
32297
32240
  ] },
32298
- React.createElement(antd.InputNumber, null))),
32241
+ React.createElement(antd.InputNumber, { disabled: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly }))),
32299
32242
  React.createElement(antd.Col, { xl: 7 },
32300
32243
  React.createElement(antd.Form.Item, { name: "totalCo2WithLand_conditionalNdc", rules: [
32301
32244
  {
@@ -32304,15 +32247,12 @@ var GHGProjectionsComponent = function (props) {
32304
32247
  if (value && value < 0) {
32305
32248
  throw new Error();
32306
32249
  }
32307
- if (value && !Number.isInteger(value)) {
32308
- throw new Error();
32309
- }
32310
32250
  return [2 /*return*/];
32311
32251
  });
32312
32252
  }); },
32313
32253
  },
32314
32254
  ] },
32315
- React.createElement(antd.InputNumber, null))),
32255
+ React.createElement(antd.InputNumber, { disabled: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly }))),
32316
32256
  React.createElement(antd.Col, { xl: 7 },
32317
32257
  React.createElement(antd.Form.Item, { name: "totalCo2WithLand_unconditionalNdc", rules: [
32318
32258
  {
@@ -32321,15 +32261,12 @@ var GHGProjectionsComponent = function (props) {
32321
32261
  if (value && value < 0) {
32322
32262
  throw new Error();
32323
32263
  }
32324
- if (value && !Number.isInteger(value)) {
32325
- throw new Error();
32326
- }
32327
32264
  return [2 /*return*/];
32328
32265
  });
32329
32266
  }); },
32330
32267
  },
32331
32268
  ] },
32332
- React.createElement(antd.InputNumber, null)))))),
32269
+ React.createElement(antd.InputNumber, { disabled: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly })))))),
32333
32270
  (((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.GOVERNMENT || (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.MINISTRY)
32334
32271
  && ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== exports.Role.ViewOnly)) &&
32335
32272
  (React.createElement("div", { className: "steps-actions" },