@undp/carbon-library 1.0.37 → 1.0.38

Sign up to get free protection for your applications and to get access to all the features.
package/dist/esm/index.js CHANGED
@@ -927,10 +927,10 @@ var AddNewCompanyComponent = function (props) {
927
927
  case 4:
928
928
  error_2 = _c.sent();
929
929
  message.open({
930
- type: 'error',
931
- content: "".concat(t('errorInAddUser'), " ").concat(error_2.message),
930
+ type: "error",
931
+ content: "".concat(error_2.message),
932
932
  duration: 3,
933
- style: { textAlign: 'right', marginRight: 15, marginTop: 10 },
933
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
934
934
  });
935
935
  return [3 /*break*/, 6];
936
936
  case 5:
@@ -1113,13 +1113,18 @@ var AddNewCompanyComponent = function (props) {
1113
1113
  required: false,
1114
1114
  validator: function (rule, value) { return __awaiter(void 0, void 0, void 0, function () {
1115
1115
  return __generator(this, function (_a) {
1116
- if (value && !validator.isURL('https://' + value))
1117
- throw new Error("Website ".concat(t('isInvalid')));
1116
+ if (String(value).trim() !== "" ||
1117
+ String(value).trim() !== undefined ||
1118
+ value !== null ||
1119
+ value !== undefined) {
1120
+ if (value && !validator.isURL("https://" + value))
1121
+ throw new Error("Website ".concat(t("isInvalid")));
1122
+ }
1118
1123
  return [2 /*return*/];
1119
1124
  });
1120
1125
  }); },
1121
1126
  },
1122
- ] },
1127
+ ], getValueFromEvent: function (event) { var _a; return (_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.value.trim(); } },
1123
1128
  React.createElement(Input, { addonBefore: "https://", size: "large" })),
1124
1129
  React.createElement(Form.Item, { name: "logo", label: "Organisation Logo (File Type : JPEG , PNG)", valuePropName: "fileList", getValueFromEvent: normFile, required: true, rules: [
1125
1130
  {