@asdp/ferryui 0.1.22-dev.9167 → 0.1.22-dev.9182

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.d.mts CHANGED
@@ -880,6 +880,13 @@ interface InputDynamicLabels {
880
880
  requiredFieldError: string;
881
881
  invalidEmailError: string;
882
882
  emailOrPhoneRequiredError: string;
883
+ invalidEmailFormatError: string;
884
+ phoneMustStartWithPlusError: string;
885
+ phoneMustBeOnlyDigitsError: string;
886
+ phoneMinDigitsError: string;
887
+ invalidEmailOrPhoneError: string;
888
+ identityPhoneMustStartWithPlusError: string;
889
+ identityPhoneMustBeOnlyDigitsError: string;
883
890
  }
884
891
 
885
892
  declare const InputDynamic: React$1.FC<InputDynamicProps>;
package/dist/index.d.ts CHANGED
@@ -880,6 +880,13 @@ interface InputDynamicLabels {
880
880
  requiredFieldError: string;
881
881
  invalidEmailError: string;
882
882
  emailOrPhoneRequiredError: string;
883
+ invalidEmailFormatError: string;
884
+ phoneMustStartWithPlusError: string;
885
+ phoneMustBeOnlyDigitsError: string;
886
+ phoneMinDigitsError: string;
887
+ invalidEmailOrPhoneError: string;
888
+ identityPhoneMustStartWithPlusError: string;
889
+ identityPhoneMustBeOnlyDigitsError: string;
883
890
  }
884
891
 
885
892
  declare const InputDynamic: React$1.FC<InputDynamicProps>;
package/dist/index.js CHANGED
@@ -2333,7 +2333,14 @@ var DEFAULT_LABELS7 = {
2333
2333
  phoneDefaultPlaceholder: "Nomor telepon",
2334
2334
  requiredFieldError: "Field ini wajib diisi",
2335
2335
  invalidEmailError: "Email tidak valid",
2336
- emailOrPhoneRequiredError: "Email atau nomor HP wajib diisi"
2336
+ emailOrPhoneRequiredError: "Email atau nomor HP wajib diisi",
2337
+ invalidEmailFormatError: "Format email tidak valid",
2338
+ phoneMustStartWithPlusError: "Nomor HP harus dalam format internasional (contoh: +628123456789)",
2339
+ phoneMustBeOnlyDigitsError: "Nomor HP hanya boleh berisi angka setelah +",
2340
+ phoneMinDigitsError: "Nomor HP minimal 10 digit",
2341
+ invalidEmailOrPhoneError: "Masukkan email atau nomor HP yang valid",
2342
+ identityPhoneMustStartWithPlusError: "Nomor telepon harus diawali dengan +",
2343
+ identityPhoneMustBeOnlyDigitsError: "Nomor telepon hanya boleh berisi angka setelah +"
2337
2344
  },
2338
2345
  en: {
2339
2346
  emailOrPhonePlaceholder: "Email or Phone Number",
@@ -2348,7 +2355,14 @@ var DEFAULT_LABELS7 = {
2348
2355
  phoneDefaultPlaceholder: "Phone number",
2349
2356
  requiredFieldError: "This field is required",
2350
2357
  invalidEmailError: "Invalid email",
2351
- emailOrPhoneRequiredError: "Email or phone number is required"
2358
+ emailOrPhoneRequiredError: "Email or phone number is required",
2359
+ invalidEmailFormatError: "Invalid email format",
2360
+ phoneMustStartWithPlusError: "Phone number must be in international format (e.g., +628123456789)",
2361
+ phoneMustBeOnlyDigitsError: "Phone number must contain only numbers after +",
2362
+ phoneMinDigitsError: "Phone number must be at least 10 digits",
2363
+ invalidEmailOrPhoneError: "Please enter a valid email or phone number",
2364
+ identityPhoneMustStartWithPlusError: "Phone number must start with +",
2365
+ identityPhoneMustBeOnlyDigitsError: "Phone number must contain only numbers after +"
2352
2366
  }
2353
2367
  };
2354
2368
 
@@ -3260,7 +3274,7 @@ var InputDynamic = ({
3260
3274
  autoCapitalize: "off",
3261
3275
  spellCheck: "false"
3262
3276
  },
3263
- value: COUNTRIES.find((country) => country.value === field.value) || null,
3277
+ value: (options && options.length > 0 ? options : COUNTRIES).find((country) => country.value === field.value) || null,
3264
3278
  onChange: (selectedOption) => {
3265
3279
  field.onChange(selectedOption ? selectedOption.value : "");
3266
3280
  if (onChange) {
@@ -3662,21 +3676,21 @@ var InputDynamic = ({
3662
3676
  const detectedType = detectEmailOrPhoneStrict(stringValue);
3663
3677
  if (detectedType === "email") {
3664
3678
  if (!/^[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}$/i.test(stringValue)) {
3665
- return "Format email tidak valid";
3679
+ return mergedLabels.invalidEmailFormatError;
3666
3680
  }
3667
3681
  } else if (detectedType === "phone") {
3668
3682
  if (!stringValue.startsWith("+")) {
3669
- return "Nomor HP harus dalam format internasional (contoh: +628123456789)";
3683
+ return mergedLabels.phoneMustStartWithPlusError;
3670
3684
  }
3671
3685
  const phoneDigits = stringValue.substring(1);
3672
3686
  if (!/^\d+$/.test(phoneDigits)) {
3673
- return "Nomor HP hanya boleh berisi angka setelah +";
3687
+ return mergedLabels.phoneMustBeOnlyDigitsError;
3674
3688
  }
3675
3689
  if (phoneDigits.length < 10) {
3676
- return "Nomor HP minimal 10 digit";
3690
+ return mergedLabels.phoneMinDigitsError;
3677
3691
  }
3678
3692
  } else {
3679
- return "Masukkan email atau nomor HP yang valid";
3693
+ return mergedLabels.invalidEmailOrPhoneError;
3680
3694
  }
3681
3695
  return true;
3682
3696
  };
@@ -3684,22 +3698,22 @@ var InputDynamic = ({
3684
3698
  if (type === "identity") {
3685
3699
  rules.validate = (value) => {
3686
3700
  if (required && !value) {
3687
- return "Field ini wajib diisi";
3701
+ return mergedLabels.requiredFieldError;
3688
3702
  }
3689
3703
  const stringValue = typeof value === "string" ? value : value?.phoneNumber || "";
3690
3704
  if (!stringValue) return true;
3691
3705
  const detectedType = detectIdentityType(stringValue);
3692
3706
  if (detectedType === "email") {
3693
3707
  if (!/^[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}$/i.test(stringValue)) {
3694
- return "Format email tidak valid";
3708
+ return mergedLabels.invalidEmailFormatError;
3695
3709
  }
3696
3710
  } else if (detectedType === "phone") {
3697
3711
  if (!stringValue.startsWith("+")) {
3698
- return "Nomor telepon harus diawali dengan +";
3712
+ return mergedLabels.identityPhoneMustStartWithPlusError;
3699
3713
  }
3700
3714
  const phoneDigits = stringValue.substring(1);
3701
3715
  if (!/^\d+$/.test(phoneDigits)) {
3702
- return "Nomor telepon hanya boleh berisi angka setelah +";
3716
+ return mergedLabels.identityPhoneMustBeOnlyDigitsError;
3703
3717
  }
3704
3718
  }
3705
3719
  return true;
@@ -3708,7 +3722,7 @@ var InputDynamic = ({
3708
3722
  if (type === "phone") {
3709
3723
  rules.validate = (value) => {
3710
3724
  if (required && !value) {
3711
- return "Nomor telepon wajib diisi";
3725
+ return mergedLabels.requiredFieldError;
3712
3726
  }
3713
3727
  return true;
3714
3728
  };
@@ -12064,7 +12078,7 @@ var PriceDetailsTerms = ({
12064
12078
  const linkColor = reactComponents.tokens.colorBrandBackground;
12065
12079
  const bookingTerms = labels.bookingTerms;
12066
12080
  const agreementTerms = [
12067
- /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Link, { href: "/terms-and-conditions", style: { color: linkColor }, children: labels.agreementLinkFerizy }) }),
12081
+ /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Link, { href: "/term-condition", style: { color: linkColor }, children: labels.agreementLinkFerizy }) }),
12068
12082
  /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
12069
12083
  labels.agreementCovidInfo,
12070
12084
  /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Link, { href: "/surat-edaran-satgas-covid-19", style: { color: linkColor }, children: labels.agreementCovidLink })