@asdp/ferryui 0.1.22-dev.9165 → 0.1.22-dev.9176

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/index.mjs CHANGED
@@ -2324,7 +2324,14 @@ var DEFAULT_LABELS7 = {
2324
2324
  phoneDefaultPlaceholder: "Nomor telepon",
2325
2325
  requiredFieldError: "Field ini wajib diisi",
2326
2326
  invalidEmailError: "Email tidak valid",
2327
- emailOrPhoneRequiredError: "Email atau nomor HP wajib diisi"
2327
+ emailOrPhoneRequiredError: "Email atau nomor HP wajib diisi",
2328
+ invalidEmailFormatError: "Format email tidak valid",
2329
+ phoneMustStartWithPlusError: "Nomor HP harus dalam format internasional (contoh: +628123456789)",
2330
+ phoneMustBeOnlyDigitsError: "Nomor HP hanya boleh berisi angka setelah +",
2331
+ phoneMinDigitsError: "Nomor HP minimal 10 digit",
2332
+ invalidEmailOrPhoneError: "Masukkan email atau nomor HP yang valid",
2333
+ identityPhoneMustStartWithPlusError: "Nomor telepon harus diawali dengan +",
2334
+ identityPhoneMustBeOnlyDigitsError: "Nomor telepon hanya boleh berisi angka setelah +"
2328
2335
  },
2329
2336
  en: {
2330
2337
  emailOrPhonePlaceholder: "Email or Phone Number",
@@ -2339,7 +2346,14 @@ var DEFAULT_LABELS7 = {
2339
2346
  phoneDefaultPlaceholder: "Phone number",
2340
2347
  requiredFieldError: "This field is required",
2341
2348
  invalidEmailError: "Invalid email",
2342
- emailOrPhoneRequiredError: "Email or phone number is required"
2349
+ emailOrPhoneRequiredError: "Email or phone number is required",
2350
+ invalidEmailFormatError: "Invalid email format",
2351
+ phoneMustStartWithPlusError: "Phone number must be in international format (e.g., +628123456789)",
2352
+ phoneMustBeOnlyDigitsError: "Phone number must contain only numbers after +",
2353
+ phoneMinDigitsError: "Phone number must be at least 10 digits",
2354
+ invalidEmailOrPhoneError: "Please enter a valid email or phone number",
2355
+ identityPhoneMustStartWithPlusError: "Phone number must start with +",
2356
+ identityPhoneMustBeOnlyDigitsError: "Phone number must contain only numbers after +"
2343
2357
  }
2344
2358
  };
2345
2359
 
@@ -3653,21 +3667,21 @@ var InputDynamic = ({
3653
3667
  const detectedType = detectEmailOrPhoneStrict(stringValue);
3654
3668
  if (detectedType === "email") {
3655
3669
  if (!/^[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}$/i.test(stringValue)) {
3656
- return "Format email tidak valid";
3670
+ return mergedLabels.invalidEmailFormatError;
3657
3671
  }
3658
3672
  } else if (detectedType === "phone") {
3659
3673
  if (!stringValue.startsWith("+")) {
3660
- return "Nomor HP harus dalam format internasional (contoh: +628123456789)";
3674
+ return mergedLabels.phoneMustStartWithPlusError;
3661
3675
  }
3662
3676
  const phoneDigits = stringValue.substring(1);
3663
3677
  if (!/^\d+$/.test(phoneDigits)) {
3664
- return "Nomor HP hanya boleh berisi angka setelah +";
3678
+ return mergedLabels.phoneMustBeOnlyDigitsError;
3665
3679
  }
3666
3680
  if (phoneDigits.length < 10) {
3667
- return "Nomor HP minimal 10 digit";
3681
+ return mergedLabels.phoneMinDigitsError;
3668
3682
  }
3669
3683
  } else {
3670
- return "Masukkan email atau nomor HP yang valid";
3684
+ return mergedLabels.invalidEmailOrPhoneError;
3671
3685
  }
3672
3686
  return true;
3673
3687
  };
@@ -3675,22 +3689,22 @@ var InputDynamic = ({
3675
3689
  if (type === "identity") {
3676
3690
  rules.validate = (value) => {
3677
3691
  if (required && !value) {
3678
- return "Field ini wajib diisi";
3692
+ return mergedLabels.requiredFieldError;
3679
3693
  }
3680
3694
  const stringValue = typeof value === "string" ? value : value?.phoneNumber || "";
3681
3695
  if (!stringValue) return true;
3682
3696
  const detectedType = detectIdentityType(stringValue);
3683
3697
  if (detectedType === "email") {
3684
3698
  if (!/^[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}$/i.test(stringValue)) {
3685
- return "Format email tidak valid";
3699
+ return mergedLabels.invalidEmailFormatError;
3686
3700
  }
3687
3701
  } else if (detectedType === "phone") {
3688
3702
  if (!stringValue.startsWith("+")) {
3689
- return "Nomor telepon harus diawali dengan +";
3703
+ return mergedLabels.identityPhoneMustStartWithPlusError;
3690
3704
  }
3691
3705
  const phoneDigits = stringValue.substring(1);
3692
3706
  if (!/^\d+$/.test(phoneDigits)) {
3693
- return "Nomor telepon hanya boleh berisi angka setelah +";
3707
+ return mergedLabels.identityPhoneMustBeOnlyDigitsError;
3694
3708
  }
3695
3709
  }
3696
3710
  return true;
@@ -3699,7 +3713,7 @@ var InputDynamic = ({
3699
3713
  if (type === "phone") {
3700
3714
  rules.validate = (value) => {
3701
3715
  if (required && !value) {
3702
- return "Nomor telepon wajib diisi";
3716
+ return mergedLabels.requiredFieldError;
3703
3717
  }
3704
3718
  return true;
3705
3719
  };