@undp/carbon-library 1.0.299-CARBON-440.0 → 1.0.299-CARBON-Sprint-56.2

Sign up to get free protection for your applications and to get access to all the features.
package/dist/cjs/index.js CHANGED
@@ -6892,6 +6892,27 @@ var AddNewCompanyComponent = function (props) {
6892
6892
  {
6893
6893
  required: false,
6894
6894
  },
6895
+ {
6896
+ validator: function (rule, value) { return __awaiter(void 0, void 0, void 0, function () {
6897
+ var phoneNo;
6898
+ return __generator(this, function (_a) {
6899
+ phoneNo = PhoneInput.formatPhoneNumber(String(value));
6900
+ if (String(value).trim() !== "") {
6901
+ if ((String(value).trim() !== "" &&
6902
+ String(value).trim() !== undefined &&
6903
+ value !== null &&
6904
+ value !== undefined) &&
6905
+ (phoneNo !== null &&
6906
+ phoneNo !== "" &&
6907
+ phoneNo !== undefined) &&
6908
+ !PhoneInput.isPossiblePhoneNumber(String(value))) {
6909
+ throw new Error("".concat(t("addCompany:phoneNo"), " ").concat(t("isInvalid")));
6910
+ }
6911
+ }
6912
+ return [2 /*return*/];
6913
+ });
6914
+ }); },
6915
+ },
6895
6916
  ] },
6896
6917
  React.createElement(PhoneInput, { placeholder: t("addCompany:phoneNo"), international: true, value: PhoneInput.formatPhoneNumberIntl(contactNoInput), defaultCountry: "LK", countryCallingCodeEditable: false, onChange: function (v) { } })))),
6897
6918
  React.createElement(antd.Col, { xl: 12, md: 24 },
@@ -15100,6 +15121,27 @@ var AddNewUserComponent = function (props) {
15100
15121
  {
15101
15122
  required: false,
15102
15123
  },
15124
+ {
15125
+ validator: function (rule, value) { return __awaiter(void 0, void 0, void 0, function () {
15126
+ var phoneNo;
15127
+ return __generator(this, function (_a) {
15128
+ phoneNo = PhoneInput.formatPhoneNumber(String(value));
15129
+ if (String(value).trim() !== "") {
15130
+ if ((String(value).trim() !== "" &&
15131
+ String(value).trim() !== undefined &&
15132
+ value !== null &&
15133
+ value !== undefined) &&
15134
+ (phoneNo !== null &&
15135
+ phoneNo !== "" &&
15136
+ phoneNo !== undefined) &&
15137
+ !PhoneInput.isPossiblePhoneNumber(String(value))) {
15138
+ throw new Error("".concat(t("addUser:phoneNo"), " ").concat(t("isInvalid")));
15139
+ }
15140
+ }
15141
+ return [2 /*return*/];
15142
+ });
15143
+ }); },
15144
+ },
15103
15145
  ] },
15104
15146
  React.createElement(PhoneInput, { placeholder: t("addUser:phoneNo"), international: true,
15105
15147
  // value={contactNoInput}