@undp/carbon-library 2.1.13-CARBON-Sprint-60.2 → 2.1.13-PAN-1.0

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 CHANGED
@@ -14369,41 +14369,41 @@ var sectoralScopes = {
14369
14369
  ],
14370
14370
  };
14371
14371
  var ProgrammeCreationComponent = function (props) {
14372
- var _a, _b, _c;
14372
+ var _a, _b, _c, _d;
14373
14373
  var useLocation = props.useLocation, onNavigateToProgrammeView = props.onNavigateToProgrammeView, translator = props.translator;
14374
14374
  var t = translator.t;
14375
14375
  var state = useLocation().state;
14376
14376
  var formOne = antd.Form.useForm()[0];
14377
14377
  var formTwo = antd.Form.useForm()[0];
14378
14378
  antd.Form.useForm()[0];
14379
- var _d = useConnection(); _d.put; var get = _d.get, post = _d.post;
14379
+ var _e = useConnection(); _e.put; var get = _e.get, post = _e.post;
14380
14380
  var userInfoState = useUserContext().userInfoState;
14381
- var _e = React.useState(false), loading = _e[0], setLoading = _e[1];
14382
- var _f = React.useState(false), loadingList = _f[0], setLoadingList = _f[1];
14383
- var _g = React.useState(); _g[0]; var setNdcScopeChanged = _g[1];
14384
- var _h = React.useState(), ndcScopeValue = _h[0], setNdcScopeValue = _h[1];
14385
- var _j = React.useState(), stepOneData = _j[0], setStepOneData = _j[1];
14386
- var _k = React.useState(0), current = _k[0], setCurrent = _k[1];
14387
- var _l = React.useState(false), isUpdate = _l[0]; _l[1];
14388
- var _m = React.useState(), includedInNDC = _m[0], setIncludedInNDC = _m[1];
14389
- var _o = React.useState([]), countries = _o[0], setCountries = _o[1];
14390
- var _p = React.useState([]), organisationsList = _p[0], setOrganisationList = _p[1];
14391
- var _q = React.useState(), govData = _q[0], setGovData = _q[1];
14392
- var _r = React.useState(), initialOrganisationOwnershipValues = _r[0], setInitialOrganisationOwnershipValues = _r[1];
14393
- var _s = React.useState(""), userOrgTaxId = _s[0], setUserOrgTaxId = _s[1];
14394
- var _t = React.useState([]), regionsList = _t[0], setRegionsList = _t[1];
14395
- var _u = React.useState(); _u[0]; var setProgrammeDetailsObj = _u[1];
14396
- var _v = React.useState(), selectedOrgs = _v[0], setSelectedOrgs = _v[1];
14397
- var _w = React.useState(false), ownershipPercentageValidation = _w[0], setOwnershipPercentageValidation = _w[1];
14398
- var _x = React.useState(""), selectedSector = _x[0], setSelectedSector = _x[1];
14399
- var _y = React.useState([]); _y[0]; var setMinistrySectoralScope = _y[1];
14400
- var _z = React.useState([]), availableSecoralScope = _z[0], setAvailableSectoralScope = _z[1];
14401
- var _0 = React.useState([]), selectableSectoralScope = _0[0], setSelectableSectoralScope = _0[1];
14402
- var _1 = React.useState([]), availableSectar = _1[0], setAvailableSectar = _1[1];
14403
- var _2 = React.useState(true), article6trade = _2[0], setArticletrade = _2[1];
14404
- var _3 = React.useState([]), ministryList = _3[0], setMinistryList = _3[1];
14405
- var _4 = React.useState(); _4[0]; _4[1];
14406
- var _5 = React.useState(), implementOwner = _5[0], setimplementOwner = _5[1];
14381
+ var _f = React.useState(false), loading = _f[0], setLoading = _f[1];
14382
+ var _g = React.useState(false), loadingList = _g[0], setLoadingList = _g[1];
14383
+ var _h = React.useState(); _h[0]; var setNdcScopeChanged = _h[1];
14384
+ var _j = React.useState(), ndcScopeValue = _j[0], setNdcScopeValue = _j[1];
14385
+ var _k = React.useState(), stepOneData = _k[0], setStepOneData = _k[1];
14386
+ var _l = React.useState(0), current = _l[0], setCurrent = _l[1];
14387
+ var _m = React.useState(false), isUpdate = _m[0]; _m[1];
14388
+ var _o = React.useState(), includedInNDC = _o[0], setIncludedInNDC = _o[1];
14389
+ var _p = React.useState([]), countries = _p[0], setCountries = _p[1];
14390
+ var _q = React.useState([]), organisationsList = _q[0], setOrganisationList = _q[1];
14391
+ var _r = React.useState(), govData = _r[0], setGovData = _r[1];
14392
+ var _s = React.useState(), initialOrganisationOwnershipValues = _s[0], setInitialOrganisationOwnershipValues = _s[1];
14393
+ var _t = React.useState(""), userOrgTaxId = _t[0], setUserOrgTaxId = _t[1];
14394
+ var _u = React.useState([]); _u[0]; var setRegionsList = _u[1];
14395
+ var _v = React.useState(); _v[0]; var setProgrammeDetailsObj = _v[1];
14396
+ var _w = React.useState(), selectedOrgs = _w[0], setSelectedOrgs = _w[1];
14397
+ var _x = React.useState(false), ownershipPercentageValidation = _x[0], setOwnershipPercentageValidation = _x[1];
14398
+ var _y = React.useState(""), selectedSector = _y[0], setSelectedSector = _y[1];
14399
+ var _z = React.useState([]); _z[0]; var setMinistrySectoralScope = _z[1];
14400
+ var _0 = React.useState([]), availableSecoralScope = _0[0], setAvailableSectoralScope = _0[1];
14401
+ var _1 = React.useState([]), selectableSectoralScope = _1[0], setSelectableSectoralScope = _1[1];
14402
+ var _2 = React.useState([]), availableSectar = _2[0], setAvailableSectar = _2[1];
14403
+ var _3 = React.useState(true), article6trade = _3[0], setArticletrade = _3[1];
14404
+ var _4 = React.useState([]), ministryList = _4[0], setMinistryList = _4[1];
14405
+ var _5 = React.useState(); _5[0]; _5[1];
14406
+ var _6 = React.useState(), implementOwner = _6[0], setimplementOwner = _6[1];
14407
14407
  // const initialOrganisationOwnershipValues: any[] = [
14408
14408
  // {
14409
14409
  // organisation:
@@ -15005,13 +15005,6 @@ var ProgrammeCreationComponent = function (props) {
15005
15005
  formOne.resetFields(["article6Percentage"]);
15006
15006
  formOne.resetFields(["implementingOwner"]);
15007
15007
  };
15008
- var onChangeGeoLocation = function (values) {
15009
- if (values.includes("National")) {
15010
- var buyerCountryValues = regionsList;
15011
- var newBuyerValues = buyerCountryValues === null || buyerCountryValues === void 0 ? void 0 : buyerCountryValues.filter(function (item) { return item !== "National"; });
15012
- formOne.setFieldValue("geographicalLocation", __spreadArray([], newBuyerValues, true));
15013
- }
15014
- };
15015
15008
  var onChangeStepOne = function (changedValues, allValues) {
15016
15009
  var _a, _b, _c;
15017
15010
  var selectedCompanies;
@@ -15139,9 +15132,7 @@ var ProgrammeCreationComponent = function (props) {
15139
15132
  }); },
15140
15133
  },
15141
15134
  ] },
15142
- React.createElement(antd.DatePicker, { size: "large", disabledDate: function (currentDate) {
15143
- return currentDate < moment().startOf("day");
15144
- } })),
15135
+ React.createElement(antd.DatePicker, { size: "large" })),
15145
15136
  React.createElement(antd.Form.Item, { wrapperCol: { span: 13 }, label: t("addProgramme:ghgCovered"), name: "greenHouseGasses", rules: [
15146
15137
  {
15147
15138
  required: true,
@@ -15515,13 +15506,26 @@ var ProgrammeCreationComponent = function (props) {
15515
15506
  React.createElement(antd.Radio.Button, { className: "condition-radio", value: "true", onClick: function () { return onClickNDCScope("true"); } }, t("addProgramme:conditional"))),
15516
15507
  React.createElement("div", { className: "condition-radio-container" },
15517
15508
  React.createElement(antd.Radio.Button, { className: "condition-radio", value: "false", onClick: function () { return onClickNDCScope("false"); } }, t("addProgramme:unConditional"))))),
15518
- React.createElement(antd.Form.Item, { label: t("addProgramme:geographicalLocation"), name: "geographicalLocation", rules: [
15509
+ React.createElement(antd.Form.Item, { label: t("addProgramme:geographicalLocation"), name: "geographicalLocation", initialValue: (_d = state === null || state === void 0 ? void 0 : state.record) === null || _d === void 0 ? void 0 : _d.name, rules: [
15519
15510
  {
15520
15511
  required: true,
15521
- message: "".concat(t("addProgramme:geographicalLocation"), " ").concat(t("isRequired")),
15512
+ message: "",
15513
+ },
15514
+ {
15515
+ validator: function (rule, value) { return __awaiter(void 0, void 0, void 0, function () {
15516
+ return __generator(this, function (_a) {
15517
+ if (String(value).trim() === "" ||
15518
+ String(value).trim() === undefined ||
15519
+ value === null ||
15520
+ value === undefined) {
15521
+ throw new Error("".concat(t("addProgramme:geographicalLocation"), " ").concat(t("isRequired")));
15522
+ }
15523
+ return [2 /*return*/];
15524
+ });
15525
+ }); },
15522
15526
  },
15523
15527
  ] },
15524
- React.createElement(antd.Select, { mode: "multiple", size: "large", maxTagCount: 2, onChange: onChangeGeoLocation, loading: loadingList, className: "custom-select", allowClear: true }, regionsList.map(function (region) { return (React.createElement(antd.Select.Option, { value: region }, region)); })))))),
15528
+ React.createElement(antd.Input, { size: "large" }))))),
15525
15529
  React.createElement("div", { className: "steps-actions" },
15526
15530
  React.createElement(antd.Button, { type: "primary", htmlType: "submit", loading: loading, onClick: checkOrgPercentageValidation }, t("addProgramme:next"))))))),
15527
15531
  },