@undp/carbon-library 1.0.150-CARBON-343.2 → 1.0.150-CARBON-343.4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/index.js +7 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +7 -1
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
@@ -24519,6 +24519,10 @@ var NdcDetailsComponent = function (props) {
|
|
24519
24519
|
return ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.GOVERNMENT &&
|
24520
24520
|
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== Role.ViewOnly);
|
24521
24521
|
};
|
24522
|
+
var isAddSubNdcActionVisible = function () {
|
24523
|
+
return ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.MINISTRY &&
|
24524
|
+
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== Role.ViewOnly);
|
24525
|
+
};
|
24522
24526
|
var inRange = function (num, min, max) {
|
24523
24527
|
return num >= min && num <= max;
|
24524
24528
|
};
|
@@ -24702,7 +24706,7 @@ var NdcDetailsComponent = function (props) {
|
|
24702
24706
|
function getSubNdcActionContent(record) {
|
24703
24707
|
selectedNdcDetail.current = record;
|
24704
24708
|
return (React.createElement(Table, { components: components, rowClassName: function () { return "editable-row"; }, bordered: true, dataSource: getSubNdcDetails(record.key), columns: columns, showHeader: false, pagination: false, footer: function () {
|
24705
|
-
return (React.createElement(Row, { justify: "center" },
|
24709
|
+
return isAddSubNdcActionVisible() && (React.createElement(Row, { justify: "center" },
|
24706
24710
|
React.createElement(Button, { onClick: onAddNewSubNdcDetail, type: "default", style: {
|
24707
24711
|
marginBottom: 16,
|
24708
24712
|
width: "100%",
|
@@ -24807,6 +24811,8 @@ var NdcDetailsComponent = function (props) {
|
|
24807
24811
|
React.createElement("div", null,
|
24808
24812
|
React.createElement(Table, { key: tableKey, components: components, rowClassName: function () { return "editable-row"; }, bordered: true, dataSource: getNdcDetailsForPeriod(), columns: columns, expandable: {
|
24809
24813
|
expandedRowRender: function (record) { return getSubNdcActionContent(record); },
|
24814
|
+
indentSize: 0,
|
24815
|
+
defaultExpandedRowKeys: [selectedNdcDetail.current.key],
|
24810
24816
|
}, footer: function () {
|
24811
24817
|
return isAddNdcActionVisible() && (React.createElement(Row, { justify: "center" },
|
24812
24818
|
React.createElement(Button, { onClick: onAddNewNdcDetail, type: "default", style: {
|