@timardex/cluemart-shared 1.2.89 → 1.2.90

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
@@ -94,11 +94,11 @@ var EnumPartnerType = /* @__PURE__ */ ((EnumPartnerType2) => {
94
94
  EnumPartnerType2["SUPPORTING_PARTNER"] = "Supporting_Partner";
95
95
  return EnumPartnerType2;
96
96
  })(EnumPartnerType || {});
97
- var EnumOSPlatform = /* @__PURE__ */ ((EnumOSPlatform3) => {
98
- EnumOSPlatform3["ANDROID"] = "android";
99
- EnumOSPlatform3["IOS"] = "ios";
100
- EnumOSPlatform3["WEB"] = "web";
101
- return EnumOSPlatform3;
97
+ var EnumOSPlatform = /* @__PURE__ */ ((EnumOSPlatform2) => {
98
+ EnumOSPlatform2["ANDROID"] = "android";
99
+ EnumOSPlatform2["IOS"] = "ios";
100
+ EnumOSPlatform2["WEB"] = "web";
101
+ return EnumOSPlatform2;
102
102
  })(EnumOSPlatform || {});
103
103
  var EnumRelationResource = /* @__PURE__ */ ((EnumRelationResource2) => {
104
104
  EnumRelationResource2["EVENT_INVITE_VENDOR"] = "event_invite_vendor";
@@ -5530,7 +5530,7 @@ var testerSchema = yup6.object().shape({
5530
5530
  event: yup6.object().when("resourceType", {
5531
5531
  is: (resourceType) => resourceType === "event" /* EVENT */,
5532
5532
  otherwise: (schema) => schema.nullable().optional(),
5533
- then: () => testerEventSchema
5533
+ then: (schema) => schema.required("Event information is required").shape(testerEventSchema.fields)
5534
5534
  }),
5535
5535
  firstName: yup6.string().required("First name is required"),
5536
5536
  lastName: yup6.string().required("Last name is required"),
@@ -5550,7 +5550,7 @@ var testerSchema = yup6.object().shape({
5550
5550
  vendor: yup6.object().when("resourceType", {
5551
5551
  is: (resourceType) => resourceType === "vendor" /* VENDOR */,
5552
5552
  otherwise: (schema) => schema.nullable().optional(),
5553
- then: () => testerVendorSchema
5553
+ then: (schema) => schema.required("Vendor information is required").shape(testerVendorSchema.fields)
5554
5554
  })
5555
5555
  });
5556
5556
 
@@ -6347,7 +6347,7 @@ import { useForm as useForm11 } from "react-hook-form";
6347
6347
  var defaultValues7 = {
6348
6348
  businessName: "",
6349
6349
  email: "",
6350
- event: null,
6350
+ event: {},
6351
6351
  firstName: "",
6352
6352
  lastName: "",
6353
6353
  mobilePhone: "",
@@ -6355,7 +6355,7 @@ var defaultValues7 = {
6355
6355
  privacyConsent: false,
6356
6356
  region: "",
6357
6357
  resourceType: "",
6358
- vendor: null
6358
+ vendor: {}
6359
6359
  };
6360
6360
  function useTesterForm(data) {
6361
6361
  const {
@@ -6365,13 +6365,10 @@ function useTesterForm(data) {
6365
6365
  handleSubmit,
6366
6366
  reset,
6367
6367
  setValue,
6368
- trigger,
6369
6368
  watch
6370
6369
  } = useForm11({
6371
6370
  defaultValues: defaultValues7,
6372
- mode: "onChange",
6373
- resolver: yupResolver11(testerSchema),
6374
- reValidateMode: "onChange"
6371
+ resolver: yupResolver11(testerSchema)
6375
6372
  });
6376
6373
  React6.useEffect(() => {
6377
6374
  if (data) {
@@ -6391,80 +6388,34 @@ function useTesterForm(data) {
6391
6388
  } else {
6392
6389
  reset(defaultValues7);
6393
6390
  }
6394
- }, [data, reset]);
6395
- const resourceType = watch("resourceType");
6396
- const vendor = watch("vendor");
6397
- const event = watch("event");
6398
- React6.useEffect(() => {
6399
- if (resourceType === "vendor" /* VENDOR */ && vendor === null) {
6400
- const emptyVendor = {
6401
- categories: [],
6402
- marketsAttended: [],
6403
- productsOrServices: "",
6404
- questionary: {
6405
- applyToAtLeastOneMarket: false,
6406
- completeFeedbackQuestionnaire: false,
6407
- tryVisitorFeatures: false,
6408
- uploadStallProfileFirstWeek: false
6409
- }
6410
- };
6411
- setValue("vendor", emptyVendor, { shouldValidate: true });
6412
- } else if (resourceType === "event" /* EVENT */ && vendor !== null) {
6413
- setValue("vendor", null, { shouldValidate: true });
6414
- }
6415
- }, [resourceType, vendor, setValue]);
6416
- React6.useEffect(() => {
6417
- if (resourceType === "event" /* EVENT */ && event === null) {
6418
- const emptyEvent = {
6419
- allowMarketingAppearance: false,
6420
- completeFinalQuestionnaire: false,
6421
- dailyCoordinationNeeds: "",
6422
- interestedInCharityInitiative: false,
6423
- inviteAtLeastFiveStallholders: false,
6424
- manageApplicationsAndCommunication: false,
6425
- markets: [],
6426
- organizerExpectations: "",
6427
- registerMarketsFirstWeek: false
6428
- };
6429
- setValue("event", emptyEvent, { shouldValidate: true });
6430
- } else if (resourceType === "vendor" /* VENDOR */ && event !== null) {
6431
- setValue("event", null, { shouldValidate: true });
6432
- }
6433
- }, [resourceType, event, setValue]);
6434
- React6.useEffect(() => {
6435
- if (resourceType === "vendor" /* VENDOR */ && vendor !== null) {
6436
- trigger("vendor");
6437
- }
6438
- }, [resourceType, vendor, trigger]);
6439
- React6.useEffect(() => {
6440
- if (resourceType === "event" /* EVENT */ && event !== null) {
6441
- trigger("event");
6442
- }
6443
- }, [resourceType, event, trigger]);
6391
+ }, [data]);
6444
6392
  const {
6445
6393
  businessName,
6446
6394
  email,
6395
+ event,
6447
6396
  firstName,
6448
6397
  lastName,
6449
6398
  mobilePhone,
6450
6399
  osType,
6451
6400
  privacyConsent,
6452
- region
6401
+ region,
6402
+ resourceType,
6403
+ vendor
6453
6404
  } = getValues();
6454
6405
  return {
6455
6406
  control,
6456
6407
  fields: {
6457
6408
  businessName,
6458
6409
  email,
6459
- event: event || null,
6410
+ event,
6460
6411
  firstName,
6461
6412
  lastName,
6462
6413
  mobilePhone,
6463
6414
  osType,
6464
6415
  privacyConsent,
6465
6416
  region,
6466
- resourceType: resourceType || "",
6467
- vendor: vendor || null
6417
+ resourceType,
6418
+ vendor
6468
6419
  },
6469
6420
  formState: { errors },
6470
6421
  handleSubmit,