@undp/carbon-library 1.0.285-CARBON-412.3 → 1.0.285-CARBON-411.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +73 -299
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/Definitions/Enums/instrument.enum.d.ts +0 -3
- package/dist/esm/index.js +73 -299
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/Definitions/Enums/instrument.enum.d.ts +0 -3
- package/dist/index.d.ts +0 -3
- package/dist/locales/i18n/programme/en.json +1 -9
- package/package.json +1 -1
- package/dist/cjs/types/Definitions/Enums/payback.enum.d.ts +0 -8
- package/dist/esm/types/Definitions/Enums/payback.enum.d.ts +0 -8
package/dist/esm/index.js
CHANGED
@@ -2022,9 +2022,6 @@ var Instrument;
|
|
2022
2022
|
Instrument["EQUITY"] = "Equity";
|
2023
2023
|
Instrument["GUARANTEE"] = "Guarantee";
|
2024
2024
|
Instrument["INKIND"] = "In-Kind";
|
2025
|
-
Instrument["CONLOAN"] = "ConcessionalLoan";
|
2026
|
-
Instrument["NONCONLOAN"] = "Non-ConcessionalLoan";
|
2027
|
-
Instrument["INSURANCE"] = "Insurance";
|
2028
2025
|
Instrument["OTHER"] = "Other";
|
2029
2026
|
})(Instrument || (Instrument = {}));
|
2030
2027
|
|
@@ -5843,7 +5840,7 @@ var AddNewCompanyComponent = function (props) {
|
|
5843
5840
|
});
|
5844
5841
|
}); };
|
5845
5842
|
var getRegionList = function () { return __awaiter(void 0, void 0, void 0, function () {
|
5846
|
-
var response, regionNames, error_1;
|
5843
|
+
var response, regionNames, uniqueRegionNames, error_1;
|
5847
5844
|
return __generator(this, function (_a) {
|
5848
5845
|
switch (_a.label) {
|
5849
5846
|
case 0:
|
@@ -5866,7 +5863,8 @@ var AddNewCompanyComponent = function (props) {
|
|
5866
5863
|
response = _a.sent();
|
5867
5864
|
if (response.data) {
|
5868
5865
|
regionNames = response.data.map(function (item) { return item.regionName; });
|
5869
|
-
|
5866
|
+
uniqueRegionNames = Array.from(new Set(regionNames));
|
5867
|
+
setRegionsList(__spreadArray([t("national")], uniqueRegionNames, true));
|
5870
5868
|
}
|
5871
5869
|
return [3 /*break*/, 5];
|
5872
5870
|
case 3:
|
@@ -13300,7 +13298,7 @@ var ProgrammeCreationComponent = function (props) {
|
|
13300
13298
|
});
|
13301
13299
|
}); };
|
13302
13300
|
var getRegionList = function () { return __awaiter(void 0, void 0, void 0, function () {
|
13303
|
-
var response, regionNames, error_2;
|
13301
|
+
var response, regionNames, uniqueRegionNames, error_2;
|
13304
13302
|
return __generator(this, function (_a) {
|
13305
13303
|
switch (_a.label) {
|
13306
13304
|
case 0:
|
@@ -13323,7 +13321,8 @@ var ProgrammeCreationComponent = function (props) {
|
|
13323
13321
|
response = _a.sent();
|
13324
13322
|
if (response.data) {
|
13325
13323
|
regionNames = response.data.map(function (item) { return item.regionName; });
|
13326
|
-
|
13324
|
+
uniqueRegionNames = Array.from(new Set(regionNames));
|
13325
|
+
setRegionsList(__spreadArray(["National"], uniqueRegionNames, true));
|
13327
13326
|
}
|
13328
13327
|
return [3 /*break*/, 5];
|
13329
13328
|
case 3:
|
@@ -15399,25 +15398,13 @@ var UserManagementComponent = function (props) {
|
|
15399
15398
|
React.createElement(UserActionConfirmationModel, { t: t, actionInfo: actionInfo, onActionConfirmed: handleOk, onActionCanceled: handleCancel, openModal: openDeleteConfirmationModal, errorMsg: errorMsg, loading: loading })));
|
15400
15399
|
};
|
15401
15400
|
|
15402
|
-
var css_248z$m = ".steps-actions {\n display: flex;\n flex-direction: row-reverse;\n margin-right: 1rem;\n justify-content: flex-start; }\n\n.investment-title-bar {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n padding: 0px 0px 30px 0px; }\n .investment-title-bar .title {\n display: flex;\n flex-direction: column;\n justify-content: space-between; }\n .investment-title-bar .actions {\n display: flex;\n align-items: center;\n justify-content: flex-end; }\n .investment-title-bar .flex-display {\n margin-left: 15px; }\n\n.ownership-container {\n padding: 15px 0px; }\n .ownership-container .label {\n color: rgba(58, 53, 65, 0.5); }\n\n.separator {\n padding: 5px;\n color: #d8d8d8; }\n\n.role-group .ant-col-13 {\n max-width: 320px; }\n\n.role-group .condition-radio-container {\n width: 48%;\n text-align: center; }\n .role-group .condition-radio-container .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled) {\n color: #ffffff !important;\n border-color: #9155fd !important;\n box-shadow: none;\n max-width: 200px; }\n\n.role-group .ant-radio-button-wrapper::before {\n background-color: transparent; }\n\n.role-group .anticon {\n margin-right: 0.5rem; }\n\n.role-group .ant-radio-button-wrapper {\n border: 1px solid #d9d9d9;\n color: rgba(140, 140, 140, 0.7) !important;\n width: 100% !important; }\n\n.role-group .condition-radio {\n width: 100%;\n text-transform: uppercase; }\n .role-group .condition-radio .ant-radio-button-checked {\n background: #9155fd;\n color: #ffffff; }\n\n.role-group .role-icons {\n margin-right: 5px; }\n\n.investment-management .role-icon {\n padding: 0.5rem 0.6rem; }\n\n.investment-management .ant-tag {\n border: none; }\n\n.investment-management .ant-checkbox-checked .ant-checkbox-input[value='Rejected'] + .ant-checkbox-inner {\n background-color: rgba(237, 77, 71, 0.6);\n border: none; }\n\n.investment-management .ant-checkbox-checked .ant-checkbox-input[value='Cancelled'] + .ant-checkbox-inner {\n background-color: rgba(58, 53, 65, 0.4);\n border: none; }\n\n.investment-management .ant-checkbox-checked .ant-checkbox-input[value='Accepted'] + .ant-checkbox-inner {\n background-color: #16b1ff;\n border: none; }\n\n.investment-management .ant-checkbox-checked .ant-checkbox-input[value='Pending'] + .ant-checkbox-inner {\n background-color: rgba(118, 195, 39, 0.6);\n border: none; }\n\n.investment-management .ant-checkbox-checked .ant-checkbox-input[value='Recognised'] + .ant-checkbox-inner {\n background-color: #976ed7;\n border: none; }\n\n.investment-management .ant-checkbox-checked .ant-checkbox-input[value='NotRecognised'] + .ant-checkbox-inner {\n background-color: #ffa070;\n border: none; }\n
|
15401
|
+
var css_248z$m = ".steps-actions {\n display: flex;\n flex-direction: row-reverse;\n margin-right: 1rem;\n justify-content: flex-start; }\n\n.investment-title-bar {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n padding: 0px 0px 30px 0px; }\n .investment-title-bar .title {\n display: flex;\n flex-direction: column;\n justify-content: space-between; }\n .investment-title-bar .actions {\n display: flex;\n align-items: center;\n justify-content: flex-end; }\n .investment-title-bar .flex-display {\n margin-left: 15px; }\n\n.ownership-container {\n padding: 15px 0px; }\n .ownership-container .label {\n color: rgba(58, 53, 65, 0.5); }\n\n.separator {\n padding: 5px;\n color: #d8d8d8; }\n\n.role-group .ant-col-13 {\n max-width: 320px; }\n\n.role-group .condition-radio-container {\n width: 48%;\n text-align: center; }\n .role-group .condition-radio-container .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled) {\n color: #ffffff !important;\n border-color: #9155fd !important;\n box-shadow: none;\n max-width: 200px; }\n\n.role-group .ant-radio-button-wrapper::before {\n background-color: transparent; }\n\n.role-group .anticon {\n margin-right: 0.5rem; }\n\n.role-group .ant-radio-button-wrapper {\n border: 1px solid #d9d9d9;\n color: rgba(140, 140, 140, 0.7) !important;\n width: 100% !important; }\n\n.role-group .condition-radio {\n width: 100%;\n text-transform: uppercase; }\n .role-group .condition-radio .ant-radio-button-checked {\n background: #9155fd;\n color: #ffffff; }\n\n.role-group .role-icons {\n margin-right: 5px; }\n\n.investment-management .role-icon {\n padding: 0.5rem 0.6rem; }\n\n.investment-management .ant-tag {\n border: none; }\n\n.investment-management .ant-checkbox-checked .ant-checkbox-input[value='Rejected'] + .ant-checkbox-inner {\n background-color: rgba(237, 77, 71, 0.6);\n border: none; }\n\n.investment-management .ant-checkbox-checked .ant-checkbox-input[value='Cancelled'] + .ant-checkbox-inner {\n background-color: rgba(58, 53, 65, 0.4);\n border: none; }\n\n.investment-management .ant-checkbox-checked .ant-checkbox-input[value='Accepted'] + .ant-checkbox-inner {\n background-color: #16b1ff;\n border: none; }\n\n.investment-management .ant-checkbox-checked .ant-checkbox-input[value='Pending'] + .ant-checkbox-inner {\n background-color: rgba(118, 195, 39, 0.6);\n border: none; }\n\n.investment-management .ant-checkbox-checked .ant-checkbox-input[value='Recognised'] + .ant-checkbox-inner {\n background-color: #976ed7;\n border: none; }\n\n.investment-management .ant-checkbox-checked .ant-checkbox-input[value='NotRecognised'] + .ant-checkbox-inner {\n background-color: #ffa070;\n border: none; }\n";
|
15403
15402
|
styleInject(css_248z$m);
|
15404
15403
|
|
15405
15404
|
var Loading = function () {
|
15406
15405
|
return React.createElement(Spin, { className: "loading-center", size: "large" });
|
15407
15406
|
};
|
15408
15407
|
|
15409
|
-
var GuaranteePayback;
|
15410
|
-
(function (GuaranteePayback) {
|
15411
|
-
GuaranteePayback["UPFORNT"] = "Upfront";
|
15412
|
-
GuaranteePayback["ANNUAL"] = "Annual";
|
15413
|
-
})(GuaranteePayback || (GuaranteePayback = {}));
|
15414
|
-
var InsurancePayback;
|
15415
|
-
(function (InsurancePayback) {
|
15416
|
-
InsurancePayback["LUMPSUM"] = "LumpSum";
|
15417
|
-
InsurancePayback["ANNUAL"] = "Annual";
|
15418
|
-
})(InsurancePayback || (InsurancePayback = {}));
|
15419
|
-
|
15420
|
-
var RangePicker$3 = DatePicker.RangePicker;
|
15421
15408
|
var InvestmentCreationComponent = function (props) {
|
15422
15409
|
var t = props.t, useConnection = props.useConnection, userInfoState = props.userInfoState, useLocation = props.useLocation, onNavigateToProgrammeManagementView = props.onNavigateToProgrammeManagementView, onNavigateToProgrammeView = props.onNavigateToProgrammeView;
|
15423
15410
|
var state = useLocation().state;
|
@@ -15438,9 +15425,8 @@ var InvestmentCreationComponent = function (props) {
|
|
15438
15425
|
label: addSpaces(Object.values(Instrument)[index]),
|
15439
15426
|
value: Object.values(Instrument)[index],
|
15440
15427
|
}); });
|
15441
|
-
var onInstrumentChange = function (
|
15442
|
-
|
15443
|
-
setInstrument([e.target.value]);
|
15428
|
+
var onInstrumentChange = function (value) {
|
15429
|
+
setInstrument(value);
|
15444
15430
|
};
|
15445
15431
|
var onPercentageChange = function (value) {
|
15446
15432
|
setCurrentPercTotal(formTwo.getFieldValue("percentage").reduce(function (a, b) { return a + b; }, 0));
|
@@ -15563,7 +15549,7 @@ var InvestmentCreationComponent = function (props) {
|
|
15563
15549
|
if (!data) {
|
15564
15550
|
return React.createElement(Loading, null);
|
15565
15551
|
}
|
15566
|
-
console.log(
|
15552
|
+
console.log('data', data);
|
15567
15553
|
var companyName = {};
|
15568
15554
|
if (data && Object.keys(data)[0] !== "ownership") {
|
15569
15555
|
for (var _i = 0, _l = data === null || data === void 0 ? void 0 : data.company; _i < _l.length; _i++) {
|
@@ -15598,16 +15584,6 @@ var InvestmentCreationComponent = function (props) {
|
|
15598
15584
|
if (payload.paymentPerMetric) {
|
15599
15585
|
payload.paymentPerMetric = parseFloat(payload.paymentPerMetric);
|
15600
15586
|
}
|
15601
|
-
if (payload.period) {
|
15602
|
-
payload.period[0] = moment(payload.period[0]).startOf("day").unix();
|
15603
|
-
payload.period[1] = moment(payload.period[1]).endOf("day").unix();
|
15604
|
-
}
|
15605
|
-
if (payload.startOfPayback) {
|
15606
|
-
payload.startOfPayback = moment(payload.startOfPayback)
|
15607
|
-
.startOf("day")
|
15608
|
-
.unix();
|
15609
|
-
}
|
15610
|
-
payload.instrument = [payload.instrument];
|
15611
15587
|
payload.fromCompanyIds = data.companyId.map(function (e) { return Number(e); });
|
15612
15588
|
payload.percentage = val.percentage;
|
15613
15589
|
payload.toCompanyId = Number(payload.toCompanyId);
|
@@ -15653,7 +15629,7 @@ var InvestmentCreationComponent = function (props) {
|
|
15653
15629
|
}
|
15654
15630
|
};
|
15655
15631
|
var onChangeTypeCreation = function (e) {
|
15656
|
-
console.log(
|
15632
|
+
console.log('radio checked', e.target.value);
|
15657
15633
|
setTypeCreation(e.target.value);
|
15658
15634
|
};
|
15659
15635
|
return (React.createElement("div", { className: "add-programme-main-container" },
|
@@ -15719,30 +15695,8 @@ var InvestmentCreationComponent = function (props) {
|
|
15719
15695
|
React.createElement(Input, { size: "large" }))))),
|
15720
15696
|
React.createElement(Row, { className: "row", gutter: [16, 16] },
|
15721
15697
|
React.createElement(Col, { xl: 24, md: 24 },
|
15722
|
-
React.createElement(Form.Item, { label: t("programme:instrument"), name: "instrument",
|
15723
|
-
|
15724
|
-
required: true, className: "investment-radio-button", rules: [
|
15725
|
-
{
|
15726
|
-
required: true,
|
15727
|
-
message: "",
|
15728
|
-
},
|
15729
|
-
{
|
15730
|
-
validator: function (rule, value) { return __awaiter(void 0, void 0, void 0, function () {
|
15731
|
-
return __generator(this, function (_a) {
|
15732
|
-
if (String(value).trim() === "" ||
|
15733
|
-
String(value).trim() === undefined ||
|
15734
|
-
value === null ||
|
15735
|
-
value === undefined) {
|
15736
|
-
throw new Error("".concat(t("programme:instrument"), " ").concat(t("isRequired")));
|
15737
|
-
}
|
15738
|
-
return [2 /*return*/];
|
15739
|
-
});
|
15740
|
-
}); },
|
15741
|
-
},
|
15742
|
-
] },
|
15743
|
-
React.createElement(Radio.Group, { onChange: onInstrumentChange, value: instrument[0] }, instrumentOptions.map(function (e) {
|
15744
|
-
return (React.createElement(Radio, { value: e.value }, e.label));
|
15745
|
-
}))))),
|
15698
|
+
React.createElement(Form.Item, { label: t("programme:instrument"), name: "instrument", wrapperCol: { span: 24 }, className: "" },
|
15699
|
+
React.createElement(Checkbox.Group, { options: instrumentOptions, defaultValue: instrumentOptions.map(function (e) { return e.value; }), onChange: onInstrumentChange })))),
|
15746
15700
|
instrument &&
|
15747
15701
|
instrument.indexOf(Instrument.LOAN) >= 0 && (React.createElement(Row, { className: "row", gutter: [16, 16] },
|
15748
15702
|
React.createElement(Col, { xl: 8, md: 12 },
|
@@ -15773,160 +15727,6 @@ var InvestmentCreationComponent = function (props) {
|
|
15773
15727
|
},
|
15774
15728
|
] },
|
15775
15729
|
React.createElement(Input, { size: "large" })))))),
|
15776
|
-
instrument &&
|
15777
|
-
(instrument.indexOf(Instrument.CONLOAN) >= 0 ||
|
15778
|
-
instrument.indexOf(Instrument.NONCONLOAN) >= 0) && (React.createElement("div", { className: "details-part-two" },
|
15779
|
-
React.createElement(Row, { className: "row", gutter: [16, 16] },
|
15780
|
-
React.createElement(Col, { xl: 8, md: 12 },
|
15781
|
-
React.createElement(Form.Item, { label: t("programme:interestRate"), name: "interestRate", rules: [
|
15782
|
-
{
|
15783
|
-
required: true,
|
15784
|
-
message: "",
|
15785
|
-
},
|
15786
|
-
{
|
15787
|
-
validator: function (rule, value) { return __awaiter(void 0, void 0, void 0, function () {
|
15788
|
-
return __generator(this, function (_a) {
|
15789
|
-
if (String(value).trim() === "" ||
|
15790
|
-
String(value).trim() ===
|
15791
|
-
undefined ||
|
15792
|
-
value === null ||
|
15793
|
-
value === undefined) {
|
15794
|
-
throw new Error("".concat(t("programme:interestRate"), " ").concat(t("isRequired")));
|
15795
|
-
}
|
15796
|
-
else if (!isNaN(value)) {
|
15797
|
-
return [2 /*return*/, Promise.resolve()];
|
15798
|
-
}
|
15799
|
-
else {
|
15800
|
-
throw new Error("".concat(t("programme:interestRate"), " ").concat(t("isInvalid")));
|
15801
|
-
}
|
15802
|
-
});
|
15803
|
-
}); },
|
15804
|
-
},
|
15805
|
-
] },
|
15806
|
-
React.createElement(Input, { size: "large" })))),
|
15807
|
-
React.createElement(Row, { className: "row", gutter: [16, 16] },
|
15808
|
-
React.createElement(Col, { xl: 8, md: 12 },
|
15809
|
-
React.createElement(Form.Item, { label: t("programme:loanPeriod"), name: "period", required: true, rules: [
|
15810
|
-
{
|
15811
|
-
required: true,
|
15812
|
-
message: "",
|
15813
|
-
},
|
15814
|
-
{
|
15815
|
-
validator: function (rule, value) { return __awaiter(void 0, void 0, void 0, function () {
|
15816
|
-
return __generator(this, function (_a) {
|
15817
|
-
if (String(value).trim() === "" ||
|
15818
|
-
String(value).trim() ===
|
15819
|
-
undefined ||
|
15820
|
-
value === null ||
|
15821
|
-
value === undefined) {
|
15822
|
-
throw new Error("".concat(t("programme:loanPeriod"), " ").concat(t("isRequired")));
|
15823
|
-
}
|
15824
|
-
return [2 /*return*/];
|
15825
|
-
});
|
15826
|
-
}); },
|
15827
|
-
},
|
15828
|
-
] },
|
15829
|
-
React.createElement(RangePicker$3, { showTime: true, allowClear: true, format: "DD:MM:YYYY", size: "large" }))),
|
15830
|
-
React.createElement(Col, { xl: 8, md: 12 },
|
15831
|
-
React.createElement(Form.Item, { label: t("programme:startOfPayback"), name: "startOfPayback", rules: [
|
15832
|
-
{
|
15833
|
-
required: true,
|
15834
|
-
message: "",
|
15835
|
-
},
|
15836
|
-
{
|
15837
|
-
validator: function (rule, value) { return __awaiter(void 0, void 0, void 0, function () {
|
15838
|
-
return __generator(this, function (_a) {
|
15839
|
-
if (String(value).trim() === "" ||
|
15840
|
-
String(value).trim() ===
|
15841
|
-
undefined ||
|
15842
|
-
value === null ||
|
15843
|
-
value === undefined) {
|
15844
|
-
throw new Error("".concat(t("programme:startOfPayback"), " ").concat(t("isRequired")));
|
15845
|
-
}
|
15846
|
-
return [2 /*return*/];
|
15847
|
-
});
|
15848
|
-
}); },
|
15849
|
-
},
|
15850
|
-
] },
|
15851
|
-
React.createElement(DatePicker, { size: "large", disabledDate: function (currentDate) {
|
15852
|
-
return currentDate < moment().startOf("day");
|
15853
|
-
} })))))),
|
15854
|
-
instrument &&
|
15855
|
-
instrument.indexOf(Instrument.GUARANTEE) >= 0 && (React.createElement("div", { className: "details-part-two" },
|
15856
|
-
React.createElement(Row, { className: "row", gutter: [16, 16] },
|
15857
|
-
React.createElement(Col, { xl: 8, md: 12 },
|
15858
|
-
React.createElement(Form.Item, { label: t("programme:interestRate"), name: "interestRate", rules: [
|
15859
|
-
{
|
15860
|
-
required: true,
|
15861
|
-
message: "",
|
15862
|
-
},
|
15863
|
-
{
|
15864
|
-
validator: function (rule, value) { return __awaiter(void 0, void 0, void 0, function () {
|
15865
|
-
return __generator(this, function (_a) {
|
15866
|
-
if (String(value).trim() === "" ||
|
15867
|
-
String(value).trim() ===
|
15868
|
-
undefined ||
|
15869
|
-
value === null ||
|
15870
|
-
value === undefined) {
|
15871
|
-
throw new Error("".concat(t("programme:interestRate"), " ").concat(t("isRequired")));
|
15872
|
-
}
|
15873
|
-
else if (!isNaN(value)) {
|
15874
|
-
return [2 /*return*/, Promise.resolve()];
|
15875
|
-
}
|
15876
|
-
else {
|
15877
|
-
throw new Error("".concat(t("programme:interestRate"), " ").concat(t("isInvalid")));
|
15878
|
-
}
|
15879
|
-
});
|
15880
|
-
}); },
|
15881
|
-
},
|
15882
|
-
] },
|
15883
|
-
React.createElement(Input, { size: "large" })))),
|
15884
|
-
React.createElement(Row, { className: "row", gutter: [16, 16] },
|
15885
|
-
React.createElement(Col, { xl: 8, md: 12 },
|
15886
|
-
React.createElement(Form.Item, { label: t("programme:period"), name: "period", required: true, rules: [
|
15887
|
-
{
|
15888
|
-
required: true,
|
15889
|
-
message: "",
|
15890
|
-
},
|
15891
|
-
{
|
15892
|
-
validator: function (rule, value) { return __awaiter(void 0, void 0, void 0, function () {
|
15893
|
-
return __generator(this, function (_a) {
|
15894
|
-
if (String(value).trim() === "" ||
|
15895
|
-
String(value).trim() ===
|
15896
|
-
undefined ||
|
15897
|
-
value === null ||
|
15898
|
-
value === undefined) {
|
15899
|
-
throw new Error("".concat(t("programme:period"), " ").concat(t("isRequired")));
|
15900
|
-
}
|
15901
|
-
return [2 /*return*/];
|
15902
|
-
});
|
15903
|
-
}); },
|
15904
|
-
},
|
15905
|
-
] },
|
15906
|
-
React.createElement(RangePicker$3, { showTime: true, allowClear: true, format: "DD:MM:YYYY", size: "large" }))),
|
15907
|
-
React.createElement(Col, { xl: 8, md: 12 },
|
15908
|
-
React.createElement(Form.Item, { label: t("programme:payback"), wrapperCol: { span: 13 }, className: "role-group", name: "guaranteePayback", rules: [
|
15909
|
-
{
|
15910
|
-
required: true,
|
15911
|
-
message: "",
|
15912
|
-
},
|
15913
|
-
{
|
15914
|
-
validator: function (rule, value) { return __awaiter(void 0, void 0, void 0, function () {
|
15915
|
-
return __generator(this, function (_a) {
|
15916
|
-
if (String(value).trim() === "" ||
|
15917
|
-
String(value).trim() ===
|
15918
|
-
undefined ||
|
15919
|
-
value === null ||
|
15920
|
-
value === undefined) {
|
15921
|
-
throw new Error("".concat(t("programme:payback"), " ").concat(t("isRequired")));
|
15922
|
-
}
|
15923
|
-
return [2 /*return*/];
|
15924
|
-
});
|
15925
|
-
}); },
|
15926
|
-
},
|
15927
|
-
] },
|
15928
|
-
React.createElement(Radio.Group, { size: "large" }, Object.values(GuaranteePayback).map(function (k, index) { return (React.createElement("div", { className: "condition-radio-container" },
|
15929
|
-
React.createElement(Radio.Button, { className: "condition-radio", value: k }, t("programme:" + k)))); }))))))),
|
15930
15730
|
instrument &&
|
15931
15731
|
instrument.indexOf(Instrument.RESULT_BASED) >= 0 && (React.createElement(Row, { className: "row", gutter: [16, 16] },
|
15932
15732
|
React.createElement(Col, { xl: 12, md: 24 },
|
@@ -15991,32 +15791,6 @@ var InvestmentCreationComponent = function (props) {
|
|
15991
15791
|
},
|
15992
15792
|
] },
|
15993
15793
|
React.createElement(Input, { size: "large" })))))),
|
15994
|
-
instrument &&
|
15995
|
-
instrument.indexOf(Instrument.INSURANCE) >= 0 && (React.createElement(Row, { className: "row", gutter: [16, 16] },
|
15996
|
-
React.createElement(Col, { xl: 8, md: 12 },
|
15997
|
-
React.createElement("div", { className: "details-part-two" },
|
15998
|
-
React.createElement(Form.Item, { label: t("programme:payback"), wrapperCol: { span: 13 }, className: "role-group", name: "insurancePayback", rules: [
|
15999
|
-
{
|
16000
|
-
required: true,
|
16001
|
-
message: "",
|
16002
|
-
},
|
16003
|
-
{
|
16004
|
-
validator: function (rule, value) { return __awaiter(void 0, void 0, void 0, function () {
|
16005
|
-
return __generator(this, function (_a) {
|
16006
|
-
if (String(value).trim() === "" ||
|
16007
|
-
String(value).trim() ===
|
16008
|
-
undefined ||
|
16009
|
-
value === null ||
|
16010
|
-
value === undefined) {
|
16011
|
-
throw new Error("".concat(t("programme:payback"), " ").concat(t("isRequired")));
|
16012
|
-
}
|
16013
|
-
return [2 /*return*/];
|
16014
|
-
});
|
16015
|
-
}); },
|
16016
|
-
},
|
16017
|
-
] },
|
16018
|
-
React.createElement(Radio.Group, { size: "large" }, Object.values(InsurancePayback).map(function (k, index) { return (React.createElement("div", { className: "condition-radio-container" },
|
16019
|
-
React.createElement(Radio.Button, { className: "condition-radio", value: k }, t("programme:" + k)))); }))))))),
|
16020
15794
|
instrument &&
|
16021
15795
|
instrument.indexOf(Instrument.OTHER) >= 0 && (React.createElement(Row, { className: "row", gutter: [16, 16] },
|
16022
15796
|
React.createElement(Col, { xl: 12, md: 24 },
|
@@ -16042,7 +15816,7 @@ var InvestmentCreationComponent = function (props) {
|
|
16042
15816
|
},
|
16043
15817
|
] },
|
16044
15818
|
React.createElement(Input, { size: "large" })))))),
|
16045
|
-
React.createElement(Row, { className: "row", gutter: [
|
15819
|
+
React.createElement(Row, { className: "row", gutter: [4, 4] },
|
16046
15820
|
React.createElement(Col, { xl: 8, md: 12 },
|
16047
15821
|
React.createElement(Form.Item, { label: t("programme:type"), wrapperCol: { span: 13 }, className: "role-group", name: "type", rules: [
|
16048
15822
|
{
|
@@ -16086,73 +15860,73 @@ var InvestmentCreationComponent = function (props) {
|
|
16086
15860
|
React.createElement("div", { className: "step-count" }, "02"),
|
16087
15861
|
React.createElement("div", { className: "title" }, t("programme:ownership")))),
|
16088
15862
|
description: current === 1 && (React.createElement("div", null,
|
16089
|
-
React.createElement("div", { className: "programme-sought-form-container ownership-container" }, Object.keys(data).length > 0 &&
|
16090
|
-
React.createElement(
|
16091
|
-
|
16092
|
-
|
16093
|
-
React.createElement(
|
16094
|
-
React.createElement(
|
16095
|
-
|
16096
|
-
|
16097
|
-
|
16098
|
-
React.createElement(
|
16099
|
-
|
16100
|
-
|
16101
|
-
|
16102
|
-
|
16103
|
-
|
16104
|
-
|
16105
|
-
|
16106
|
-
|
16107
|
-
|
16108
|
-
|
16109
|
-
|
16110
|
-
|
16111
|
-
|
16112
|
-
|
16113
|
-
index,
|
16114
|
-
]) &&
|
16115
|
-
parseFloat(getFieldValue([
|
15863
|
+
React.createElement("div", { className: "programme-sought-form-container ownership-container" }, Object.keys(data).length > 0 &&
|
15864
|
+
React.createElement("div", { className: "programme-sought-form" },
|
15865
|
+
React.createElement(Form, { labelCol: { span: 20 }, wrapperCol: { span: 24 }, form: formTwo, name: "investment-sought", className: "investment-sought-form", layout: "vertical", requiredMark: true, onChange: onPercentageChange, onFinish: submitInvestment }, data === null || data === void 0 ? void 0 :
|
15866
|
+
data.companyId.map(function (companyId, index) {
|
15867
|
+
return (React.createElement(Row, { className: "row", gutter: [16, 16] },
|
15868
|
+
React.createElement(Col, { xl: 8, md: 15 },
|
15869
|
+
React.createElement("div", { className: "label" },
|
15870
|
+
companyName[companyId].name,
|
15871
|
+
React.createElement("span", { className: "required-mark" }, "*"))),
|
15872
|
+
React.createElement(Col, { xl: 8, md: 9 },
|
15873
|
+
React.createElement(Form.Item, { className: "inline", name: ["percentage", index], initialValue: 0, rules: [
|
15874
|
+
{
|
15875
|
+
pattern: new RegExp(/^[+]?([.]\d+|\d+[.]?\d*)$/g),
|
15876
|
+
message: "Percentage Should be a positive number",
|
15877
|
+
},
|
15878
|
+
{
|
15879
|
+
required: true,
|
15880
|
+
message: "Required field",
|
15881
|
+
},
|
15882
|
+
function (_a) {
|
15883
|
+
var getFieldValue = _a.getFieldValue;
|
15884
|
+
return ({
|
15885
|
+
validator: function (rule, v) {
|
15886
|
+
if (getFieldValue([
|
16116
15887
|
"percentage",
|
16117
15888
|
index,
|
16118
|
-
])
|
16119
|
-
|
16120
|
-
|
16121
|
-
|
16122
|
-
|
16123
|
-
|
16124
|
-
|
16125
|
-
|
16126
|
-
|
16127
|
-
|
16128
|
-
|
16129
|
-
|
16130
|
-
|
15889
|
+
]) &&
|
15890
|
+
parseFloat(getFieldValue([
|
15891
|
+
"percentage",
|
15892
|
+
index,
|
15893
|
+
])) > data.proponentPercentage[index]) {
|
15894
|
+
// eslint-disable-next-line prefer-promise-reject-errors
|
15895
|
+
return Promise.reject("Amount > Available");
|
15896
|
+
}
|
15897
|
+
return Promise.resolve();
|
15898
|
+
},
|
15899
|
+
});
|
15900
|
+
},
|
15901
|
+
] },
|
15902
|
+
React.createElement(InputNumber, { placeholder: "", controls: false, disabled: govData.companyId == companyId,
|
15903
|
+
// disabled={userInfoState?.companyId === Number(companyId)}
|
15904
|
+
onKeyPress: function (event) {
|
15905
|
+
if (!/[0-9\.]/.test(event.key)) {
|
15906
|
+
event.preventDefault();
|
15907
|
+
}
|
15908
|
+
} })),
|
15909
|
+
React.createElement("div", { className: "inline separator" }, "/"),
|
15910
|
+
React.createElement(Form.Item, { className: "inline" },
|
15911
|
+
React.createElement(InputNumber, { placeholder: String(data === null || data === void 0 ? void 0 : data.proponentPercentage[index]), disabled: true })))));
|
15912
|
+
}),
|
15913
|
+
React.createElement(Row, { className: "row", gutter: [16, 16] },
|
15914
|
+
React.createElement(Col, { xl: 8, md: 15 },
|
15915
|
+
React.createElement("div", { className: "label" }, t("programme:total"))),
|
15916
|
+
React.createElement(Col, { xl: 8, md: 9 },
|
15917
|
+
React.createElement(Form.Item, { className: "inline", name: ["total"] },
|
15918
|
+
React.createElement(InputNumber, { placeholder: currentPercTotal + "", controls: false, disabled: true, onKeyPress: function (event) {
|
16131
15919
|
if (!/[0-9\.]/.test(event.key)) {
|
16132
15920
|
event.preventDefault();
|
16133
15921
|
}
|
16134
15922
|
} })),
|
16135
15923
|
React.createElement("div", { className: "inline separator" }, "/"),
|
16136
15924
|
React.createElement(Form.Item, { className: "inline" },
|
16137
|
-
React.createElement(InputNumber, {
|
16138
|
-
|
16139
|
-
|
16140
|
-
|
16141
|
-
|
16142
|
-
React.createElement(Col, { xl: 8, md: 9 },
|
16143
|
-
React.createElement(Form.Item, { className: "inline", name: ["total"] },
|
16144
|
-
React.createElement(InputNumber, { placeholder: currentPercTotal + "", controls: false, disabled: true, onKeyPress: function (event) {
|
16145
|
-
if (!/[0-9\.]/.test(event.key)) {
|
16146
|
-
event.preventDefault();
|
16147
|
-
}
|
16148
|
-
} })),
|
16149
|
-
React.createElement("div", { className: "inline separator" }, "/"),
|
16150
|
-
React.createElement(Form.Item, { className: "inline" },
|
16151
|
-
React.createElement(InputNumber, { disabled: true, placeholder: "100" })))),
|
16152
|
-
React.createElement(Form.Item, null,
|
16153
|
-
React.createElement("div", { className: "steps-actions" },
|
16154
|
-
React.createElement(Button, { type: "primary", htmlType: "submit", loading: loading, onSubmit: submitInvestment }, t("programme:submit")),
|
16155
|
-
React.createElement(Button, { className: "back-btn", onClick: function () { return prevOne(); }, loading: loading }, t("programme:back")))))))))),
|
15925
|
+
React.createElement(InputNumber, { disabled: true, placeholder: "100" })))),
|
15926
|
+
React.createElement(Form.Item, null,
|
15927
|
+
React.createElement("div", { className: "steps-actions" },
|
15928
|
+
React.createElement(Button, { type: "primary", htmlType: "submit", loading: loading, onSubmit: submitInvestment }, t("programme:submit")),
|
15929
|
+
React.createElement(Button, { className: "back-btn", onClick: function () { return prevOne(); }, loading: loading }, t("programme:back"))))))))),
|
16156
15930
|
},
|
16157
15931
|
] })))));
|
16158
15932
|
};
|