@undp/carbon-library 2.1.11 → 2.1.12-CARBON-Sprint-58.1

Sign up to get free protection for your applications and to get access to all the features.
package/dist/cjs/index.js CHANGED
@@ -6,10 +6,10 @@ var React = require('react');
6
6
  var luxon = require('luxon');
7
7
  var buffer = require('buffer');
8
8
  var axios = require('axios');
9
+ var Icon = require('react-bootstrap-icons');
9
10
  var PhoneInput = require('react-phone-number-input');
10
11
  var validator = require('validator');
11
12
  var classTransformer = require('class-transformer');
12
- var Icon = require('react-bootstrap-icons');
13
13
  require('react-phone-number-input/style.css');
14
14
  var mapboxgl = require('mapbox-gl');
15
15
  require('mapbox-gl/dist/mapbox-gl.css');
@@ -450,6 +450,7 @@ exports.CompanyManagementColumns = void 0;
450
450
  CompanyManagementColumns["programmeCount"] = "programmeCount";
451
451
  CompanyManagementColumns["creditBalance"] = "creditBalance";
452
452
  CompanyManagementColumns["companyState"] = "status";
453
+ CompanyManagementColumns["action"] = "action";
453
454
  })(exports.CompanyManagementColumns || (exports.CompanyManagementColumns = {}));
454
455
 
455
456
  var css_248z$y = ".profile-icon {\n border-radius: 100%;\n margin-right: 15px;\n font-size: 15px;\n width: 40px;\n height: 40px;\n display: flex;\n justify-content: center;\n align-items: center; }\n .profile-icon img {\n width: 26px; }\n";
@@ -873,6 +874,19 @@ var CompanyManagementComponent = function (props) {
873
874
  var handleFilterVisibleChange = function () {
874
875
  setFilterVisible(true);
875
876
  };
877
+ var actionMenu = function (record) {
878
+ return (React.createElement(antd.List, { className: "action-menu", size: "small", dataSource: [
879
+ {
880
+ text: t("company:view"),
881
+ icon: React.createElement(Icon__namespace.InfoCircle, null),
882
+ click: function () {
883
+ onNavigateToCompanyProfile(record);
884
+ },
885
+ },
886
+ ], renderItem: function (item) { return (React.createElement(antd.List.Item, { onClick: item.click },
887
+ React.createElement(antd.Typography.Text, { className: "action-icon color-primary" }, item.icon),
888
+ React.createElement("span", null, item.text))); } }));
889
+ };
876
890
  var columns = [
877
891
  {
878
892
  title: "",
@@ -953,6 +967,17 @@ var CompanyManagementComponent = function (props) {
953
967
  return getCompanyStateComponent(item);
954
968
  },
955
969
  },
970
+ {
971
+ title: t(""),
972
+ width: 6,
973
+ align: "right",
974
+ key: exports.CompanyManagementColumns.action,
975
+ render: function (_, record) {
976
+ var menu = actionMenu(record);
977
+ return menu && (React.createElement(antd.Popover, { placement: "bottomRight", content: menu, trigger: "click" },
978
+ React.createElement(icons.EllipsisOutlined, { rotate: 90, style: { fontWeight: 600, fontSize: "1rem", cursor: "pointer" } })));
979
+ },
980
+ },
956
981
  ].filter(function (column) { return visibleColumns.includes(column.key); });
957
982
  var filterOr = function () {
958
983
  if (searchByTermOrganisation !== null &&
@@ -1252,6 +1277,7 @@ exports.ProgrammeManagementColumns = void 0;
1252
1277
  ProgrammeManagementColumns["creditTransferred"] = "creditTransferred";
1253
1278
  ProgrammeManagementColumns["certifierId"] = "certifierId";
1254
1279
  ProgrammeManagementColumns["serialNo"] = "serialNo";
1280
+ ProgrammeManagementColumns["action"] = "action";
1255
1281
  ProgrammeManagementColumns["emissionReductionExpected"] = "emissionReductionExpected";
1256
1282
  ProgrammeManagementColumns["emissionReductionAchieved"] = "emissionReductionAchieved";
1257
1283
  ProgrammeManagementColumns["emissionReductionAchievedandCreditIssued"] = "emissionReductionAchievedandCreditIssued";
@@ -8137,6 +8163,19 @@ var ProgrammeManagementComponent = function (props) {
8137
8163
  setCheckAll(e.target.checked);
8138
8164
  onStatusQuery(nw);
8139
8165
  };
8166
+ var actionMenu = function (record) {
8167
+ return (React.createElement(antd.List, { className: "action-menu", size: "small", dataSource: [
8168
+ {
8169
+ text: t("programme:view"),
8170
+ icon: React.createElement(Icon__namespace.InfoCircle, null),
8171
+ click: function () {
8172
+ onNavigateToProgrammeView(record);
8173
+ },
8174
+ },
8175
+ ], renderItem: function (item) { return (React.createElement(antd.List.Item, { onClick: item.click },
8176
+ React.createElement(antd.Typography.Text, { className: "action-icon color-primary" }, item.icon),
8177
+ React.createElement("span", null, item.text))); } }));
8178
+ };
8140
8179
  var columns = [
8141
8180
  {
8142
8181
  title: t("programme:title"),
@@ -8284,6 +8323,17 @@ var ProgrammeManagementComponent = function (props) {
8284
8323
  key: exports.ProgrammeManagementColumns.serialNo,
8285
8324
  align: "left",
8286
8325
  },
8326
+ {
8327
+ title: t(""),
8328
+ width: 6,
8329
+ align: "right",
8330
+ key: exports.ProgrammeManagementColumns.action,
8331
+ render: function (_, record) {
8332
+ var menu = actionMenu(record);
8333
+ return menu && (React.createElement(antd.Popover, { placement: "bottomRight", content: menu, trigger: "click" },
8334
+ React.createElement(icons.EllipsisOutlined, { rotate: 90, style: { fontWeight: 600, fontSize: "1rem", cursor: "pointer" } })));
8335
+ },
8336
+ },
8287
8337
  ].filter(function (column) { return visibleColumns.includes(column.key); });
8288
8338
  var getAllProgramme = function () { return __awaiter(void 0, void 0, void 0, function () {
8289
8339
  var filter, filterOr, sort, response, error_1;
@@ -19519,6 +19569,19 @@ var NdcActionManagementComponent = function (props) {
19519
19569
  }
19520
19570
  }
19521
19571
  };
19572
+ var actionMenu = function (record) {
19573
+ return (React.createElement(antd.List, { className: "action-menu", size: "small", dataSource: [
19574
+ {
19575
+ text: t("ndcAction:view"),
19576
+ icon: React.createElement(Icon__namespace.InfoCircle, null),
19577
+ click: function () {
19578
+ onNavigateToNdcManagementView(record);
19579
+ },
19580
+ },
19581
+ ], renderItem: function (item) { return (React.createElement(antd.List.Item, { onClick: item.click },
19582
+ React.createElement(antd.Typography.Text, { className: "action-icon color-primary" }, item.icon),
19583
+ React.createElement("span", null, item.text))); } }));
19584
+ };
19522
19585
  var columns = [
19523
19586
  {
19524
19587
  title: t("ndcAction:ndcColumnsActionId"),
@@ -19603,6 +19666,17 @@ var NdcActionManagementComponent = function (props) {
19603
19666
  React.createElement(antd.Tag, { className: "clickable", color: getNdcStatusTagType(Obj.status) }, addSpaces(Obj.status))));
19604
19667
  },
19605
19668
  },
19669
+ {
19670
+ title: t(""),
19671
+ width: 6,
19672
+ align: "right",
19673
+ key: "action",
19674
+ render: function (_, record) {
19675
+ var menu = actionMenu(record);
19676
+ return menu && (React.createElement(antd.Popover, { placement: "bottomRight", content: menu, trigger: "click" },
19677
+ React.createElement(icons.EllipsisOutlined, { rotate: 90, style: { fontWeight: 600, fontSize: "1rem", cursor: "pointer" } })));
19678
+ },
19679
+ },
19606
19680
  ];
19607
19681
  var getNdcActionData = function () { return __awaiter(void 0, void 0, void 0, function () {
19608
19682
  var filter, interFilterOr, sort, filterBy, response, error_1;