@asdp/ferryui 0.1.22-dev.9569 → 0.1.22-dev.9577

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.js CHANGED
@@ -3638,7 +3638,7 @@ var DEFAULT_LABELS7 = {
3638
3638
  hidePasswordAriaLabel: "Sembunyikan kata sandi",
3639
3639
  datePickerPlaceholder: "Pilih tanggal",
3640
3640
  phoneDefaultPlaceholder: "Nomor telepon",
3641
- requiredFieldError: "Field ini wajib diisi",
3641
+ requiredFieldError: "wajib diisi",
3642
3642
  invalidEmailError: "Email tidak valid",
3643
3643
  emailOrPhoneRequiredError: "Email atau nomor HP wajib diisi",
3644
3644
  invalidEmailFormatError: "Format email tidak valid",
@@ -3661,7 +3661,7 @@ var DEFAULT_LABELS7 = {
3661
3661
  hidePasswordAriaLabel: "Hide password",
3662
3662
  datePickerPlaceholder: "Select date",
3663
3663
  phoneDefaultPlaceholder: "Phone number",
3664
- requiredFieldError: "This field is required",
3664
+ requiredFieldError: "is required",
3665
3665
  invalidEmailError: "Invalid email",
3666
3666
  emailOrPhoneRequiredError: "Email or phone number is required",
3667
3667
  invalidEmailFormatError: "Invalid email format",
@@ -5239,8 +5239,9 @@ var InputDynamic = ({
5239
5239
  };
5240
5240
  const getValidationRules = () => {
5241
5241
  const rules = {};
5242
+ const requiredMessage = typeof validationRules?.required === "string" ? validationRules.required : `${label || (language === "id" ? "Field ini" : "This field")} ${mergedLabels.requiredFieldError}`;
5242
5243
  if (required) {
5243
- rules.required = validationRules?.required || mergedLabels.requiredFieldError;
5244
+ rules.required = requiredMessage;
5244
5245
  }
5245
5246
  if (validationRules?.minLength) {
5246
5247
  rules.minLength = validationRules.minLength;
@@ -5269,7 +5270,7 @@ var InputDynamic = ({
5269
5270
  if (type === "emailOrPhone") {
5270
5271
  rules.validate = (value) => {
5271
5272
  if (required && !value) {
5272
- return mergedLabels.emailOrPhoneRequiredError;
5273
+ return label ? requiredMessage : mergedLabels.emailOrPhoneRequiredError;
5273
5274
  }
5274
5275
  const stringValue = typeof value === "string" ? value : "";
5275
5276
  if (!stringValue) return true;
@@ -5292,7 +5293,7 @@ var InputDynamic = ({
5292
5293
  if (type === "identity") {
5293
5294
  rules.validate = (value) => {
5294
5295
  if (required && !value) {
5295
- return mergedLabels.requiredFieldError;
5296
+ return requiredMessage;
5296
5297
  }
5297
5298
  const stringValue = typeof value === "string" ? value : value?.phoneNumber || "";
5298
5299
  if (!stringValue) return true;
@@ -5313,7 +5314,7 @@ var InputDynamic = ({
5313
5314
  if (type === "phone") {
5314
5315
  rules.validate = (value) => {
5315
5316
  if (required && !value) {
5316
- return mergedLabels.requiredFieldError;
5317
+ return requiredMessage;
5317
5318
  }
5318
5319
  if (value) {
5319
5320
  const stringValue = typeof value === "string" ? value : String(value);
@@ -10978,9 +10979,15 @@ var ModalPassengerForm = ({
10978
10979
  const [capturedImage, setCapturedImage] = React.useState(null);
10979
10980
  const [stream, setStream] = React.useState(null);
10980
10981
  const videoRef = React.useRef(null);
10981
- const { control, handleSubmit, reset, watch, setValue } = reactHookForm.useForm({
10982
+ const { control, handleSubmit, reset, watch, setValue, trigger } = reactHookForm.useForm({
10983
+ mode: "all",
10982
10984
  defaultValues
10983
10985
  });
10986
+ React.useEffect(() => {
10987
+ if (open) {
10988
+ trigger();
10989
+ }
10990
+ }, [open, trigger]);
10984
10991
  const watchIdentityTypeId = watch("identityTypeId");
10985
10992
  const watchPassportCountryId = watch("countryId");
10986
10993
  const watchBirthdate = watch("birthdate");
@@ -11980,6 +11987,7 @@ var CardVehicleDetail = ({
11980
11987
  disabled,
11981
11988
  name: vehicleNumberName,
11982
11989
  placeholder: mergedLabels.vehicleNumberPlaceholder,
11990
+ required: true,
11983
11991
  type: "text"
11984
11992
  }
11985
11993
  )
@@ -12288,14 +12296,14 @@ var CardVehicleOwnerForm = ({
12288
12296
  reactComponents.Radio,
12289
12297
  {
12290
12298
  value: MANIFEST_ENTITY.COMPANY,
12291
- label: MANIFEST_ENTITY.COMPANY
12299
+ label: mergedLabels.entityTypeCompany
12292
12300
  }
12293
12301
  ),
12294
12302
  /* @__PURE__ */ jsxRuntime.jsx(
12295
12303
  reactComponents.Radio,
12296
12304
  {
12297
12305
  value: MANIFEST_ENTITY.INDIVIDUAL,
12298
- label: MANIFEST_ENTITY.INDIVIDUAL
12306
+ label: mergedLabels.entityTypeIndividual
12299
12307
  }
12300
12308
  )
12301
12309
  ]