@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/cjs/index.js CHANGED
@@ -947,10 +947,10 @@ var AddNewCompanyComponent = function (props) {
947
947
  case 4:
948
948
  error_2 = _c.sent();
949
949
  antd.message.open({
950
- type: 'error',
951
- content: "".concat(t('errorInAddUser'), " ").concat(error_2.message),
950
+ type: "error",
951
+ content: "".concat(error_2.message),
952
952
  duration: 3,
953
- style: { textAlign: 'right', marginRight: 15, marginTop: 10 },
953
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
954
954
  });
955
955
  return [3 /*break*/, 6];
956
956
  case 5:
@@ -1133,13 +1133,18 @@ var AddNewCompanyComponent = function (props) {
1133
1133
  required: false,
1134
1134
  validator: function (rule, value) { return __awaiter(void 0, void 0, void 0, function () {
1135
1135
  return __generator(this, function (_a) {
1136
- if (value && !validator.isURL('https://' + value))
1137
- throw new Error("Website ".concat(t('isInvalid')));
1136
+ if (String(value).trim() !== "" ||
1137
+ String(value).trim() !== undefined ||
1138
+ value !== null ||
1139
+ value !== undefined) {
1140
+ if (value && !validator.isURL("https://" + value))
1141
+ throw new Error("Website ".concat(t("isInvalid")));
1142
+ }
1138
1143
  return [2 /*return*/];
1139
1144
  });
1140
1145
  }); },
1141
1146
  },
1142
- ] },
1147
+ ], 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(); } },
1143
1148
  React.createElement(antd.Input, { addonBefore: "https://", size: "large" })),
1144
1149
  React.createElement(antd.Form.Item, { name: "logo", label: "Organisation Logo (File Type : JPEG , PNG)", valuePropName: "fileList", getValueFromEvent: normFile, required: true, rules: [
1145
1150
  {