@timardex/cluemart-shared 1.0.9 → 1.0.11

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.cjs CHANGED
@@ -216,22 +216,22 @@ var EnumResourceTypeIcon = /* @__PURE__ */ ((EnumResourceTypeIcon2) => {
216
216
  EnumResourceTypeIcon2["STALLHOLDER"] = "store";
217
217
  return EnumResourceTypeIcon2;
218
218
  })(EnumResourceTypeIcon || {});
219
- var EnumRegions = /* @__PURE__ */ ((EnumRegions2) => {
220
- EnumRegions2["Auckland"] = "Auckland";
221
- EnumRegions2["BayOfPlenty"] = "Bay of Plenty";
222
- EnumRegions2["Canterbury"] = "Canterbury";
223
- EnumRegions2["Gisborne"] = "Gisborne";
224
- EnumRegions2["HawkesBay"] = "Hawke's Bay";
225
- EnumRegions2["ManawatuWanganui"] = "Manawatu-Wanganui";
226
- EnumRegions2["Marlborough"] = "Marlborough";
227
- EnumRegions2["Nelson"] = "Nelson";
228
- EnumRegions2["Northland"] = "Northland";
229
- EnumRegions2["Otago"] = "Otago";
230
- EnumRegions2["Southland"] = "Southland";
231
- EnumRegions2["Taranaki"] = "Taranaki";
232
- EnumRegions2["Waikato"] = "Waikato";
233
- EnumRegions2["Wellington"] = "Wellington";
234
- return EnumRegions2;
219
+ var EnumRegions = /* @__PURE__ */ ((EnumRegions3) => {
220
+ EnumRegions3["Auckland"] = "Auckland";
221
+ EnumRegions3["BayOfPlenty"] = "Bay of Plenty";
222
+ EnumRegions3["Canterbury"] = "Canterbury";
223
+ EnumRegions3["Gisborne"] = "Gisborne";
224
+ EnumRegions3["HawkesBay"] = "Hawke's Bay";
225
+ EnumRegions3["ManawatuWanganui"] = "Manawatu-Wanganui";
226
+ EnumRegions3["Marlborough"] = "Marlborough";
227
+ EnumRegions3["Nelson"] = "Nelson";
228
+ EnumRegions3["Northland"] = "Northland";
229
+ EnumRegions3["Otago"] = "Otago";
230
+ EnumRegions3["Southland"] = "Southland";
231
+ EnumRegions3["Taranaki"] = "Taranaki";
232
+ EnumRegions3["Waikato"] = "Waikato";
233
+ EnumRegions3["Wellington"] = "Wellington";
234
+ return EnumRegions3;
235
235
  })(EnumRegions || {});
236
236
  var ImageTypeEnum = /* @__PURE__ */ ((ImageTypeEnum2) => {
237
237
  ImageTypeEnum2["AVATAR"] = "avatar";
@@ -351,6 +351,8 @@ function sortDatesByProximity(dates) {
351
351
  return diffA - diffB;
352
352
  });
353
353
  }
354
+ var availableRegionTypes = Object.values(EnumRegions);
355
+ var availableRegionOptions = mapArrayToOptions(availableRegionTypes);
354
356
 
355
357
  // src/hooks/useLocationSearch.ts
356
358
  var handleApiError = (error, message) => {
@@ -607,6 +609,7 @@ var userSchema = yup4.object().shape({
607
609
  firstName: yup4.string().required("First name is required"),
608
610
  lastName: yup4.string().required("Last name is required"),
609
611
  password: passwordSchema,
612
+ preferredRegion: yup4.string().required("Preferred region is required"),
610
613
  // eslint-disable-next-line sort-keys
611
614
  confirmPassword: yup4.string().oneOf([yup4.ref("password")], "Passwords must match").required("Confirm Password is required"),
612
615
  role: yup4.mixed().oneOf(Object.values(EnumUserRole)).required("Role is required")
@@ -623,6 +626,7 @@ var registerSchema = yup5.object().shape({
623
626
  firstName: yup5.string().required("First Name is required"),
624
627
  lastName: yup5.string().required("Last Name is required"),
625
628
  password: passwordSchema,
629
+ preferredRegion: yup5.string().required("Preferred Region is required"),
626
630
  role: yup5.mixed().oneOf(Object.values(EnumUserRole)).required("Role is required")
627
631
  });
628
632
  var requestPasswordResetSchema = yup5.object().shape({
@@ -980,6 +984,7 @@ var defaultValues = {
980
984
  firstName: "",
981
985
  lastName: "",
982
986
  password: "",
987
+ preferredRegion: "",
983
988
  role: "customer" /* CUSTOMER */
984
989
  };
985
990
  function useUserForm(data) {
@@ -1007,6 +1012,7 @@ function useUserForm(data) {
1007
1012
  firstName: data.firstName,
1008
1013
  lastName: data.lastName,
1009
1014
  password: data.password,
1015
+ preferredRegion: data.preferredRegion,
1010
1016
  role: data.role
1011
1017
  });
1012
1018
  } else {
@@ -1023,6 +1029,7 @@ function useUserForm(data) {
1023
1029
  firstName,
1024
1030
  lastName,
1025
1031
  password,
1032
+ preferredRegion,
1026
1033
  role
1027
1034
  } = getValues();
1028
1035
  return {
@@ -1037,6 +1044,7 @@ function useUserForm(data) {
1037
1044
  firstName,
1038
1045
  lastName,
1039
1046
  password,
1047
+ preferredRegion,
1040
1048
  role
1041
1049
  },
1042
1050
  formState: { errors },
@@ -1090,6 +1098,7 @@ var defaultValues3 = {
1090
1098
  firstName: "",
1091
1099
  lastName: "",
1092
1100
  password: "",
1101
+ preferredRegion: "",
1093
1102
  role: "customer" /* CUSTOMER */
1094
1103
  };
1095
1104
  function useRegisterForm() {
@@ -1105,7 +1114,7 @@ function useRegisterForm() {
1105
1114
  defaultValues: defaultValues3,
1106
1115
  resolver: (0, import_yup6.yupResolver)(registerSchema)
1107
1116
  });
1108
- const { email, firstName, lastName, password, role } = getValues();
1117
+ const { email, firstName, lastName, password, preferredRegion, role } = getValues();
1109
1118
  return {
1110
1119
  control,
1111
1120
  fields: {
@@ -1113,6 +1122,7 @@ function useRegisterForm() {
1113
1122
  firstName,
1114
1123
  lastName,
1115
1124
  password,
1125
+ preferredRegion,
1116
1126
  role
1117
1127
  },
1118
1128
  formState: { errors },
@@ -1277,6 +1287,7 @@ var USER_FIELDS_FRAGMENT = import_client.gql`
1277
1287
  lastName
1278
1288
  licences
1279
1289
  markets
1290
+ preferredRegion
1280
1291
  role
1281
1292
  stallholder
1282
1293
  updatedAt
@@ -2759,9 +2770,7 @@ var availableCityTypes = [
2759
2770
  "Hamilton",
2760
2771
  "Wellington"
2761
2772
  ];
2762
- var availableRegionTypes = Object.values(EnumRegions);
2763
2773
  var availableCityOptions = mapArrayToOptions(availableCityTypes);
2764
- var availableRegionOptions = mapArrayToOptions(availableRegionTypes);
2765
2774
 
2766
2775
  // src/formFields/stallholder/stallholderApplyForm.ts
2767
2776
  var stallholderElectricity = {
package/dist/index.d.mts CHANGED
@@ -87,6 +87,7 @@ type RegisterFormData = {
87
87
  firstName: string;
88
88
  lastName: string;
89
89
  password: string;
90
+ preferredRegion: string;
90
91
  role: EnumUserRole;
91
92
  };
92
93
  interface CreateRegisterFormData {
@@ -359,6 +360,7 @@ type UserFormData = {
359
360
  firstName: string;
360
361
  lastName: string;
361
362
  password: string;
363
+ preferredRegion: string;
362
364
  role: EnumUserRole;
363
365
  };
364
366
  interface CreateUserFormData {
@@ -387,6 +389,7 @@ interface UserType {
387
389
  licences: EnumUserLicence[] | null;
388
390
  markets: string[] | null;
389
391
  password: string;
392
+ preferredRegion: string;
390
393
  role: EnumUserRole;
391
394
  stallholder: string | null;
392
395
  updatedAt: string;
@@ -565,6 +568,8 @@ declare function sortDatesByProximity(dates: {
565
568
  startDate: string;
566
569
  startTime: string;
567
570
  }[];
571
+ declare const availableRegionTypes: EnumRegions[];
572
+ declare const availableRegionOptions: OptionItem[];
568
573
 
569
574
  interface PlacePrediction {
570
575
  place_id: string;
@@ -851,6 +856,7 @@ declare const userSchema: yup.ObjectSchema<{
851
856
  firstName: string;
852
857
  lastName: string;
853
858
  password: string;
859
+ preferredRegion: string;
854
860
  confirmPassword: string;
855
861
  role: NonNullable<EnumUserRole | undefined>;
856
862
  }, yup.AnyObject, {
@@ -859,6 +865,7 @@ declare const userSchema: yup.ObjectSchema<{
859
865
  firstName: undefined;
860
866
  lastName: undefined;
861
867
  password: undefined;
868
+ preferredRegion: undefined;
862
869
  confirmPassword: undefined;
863
870
  role: undefined;
864
871
  }, "">;
@@ -875,12 +882,14 @@ declare const registerSchema: yup.ObjectSchema<{
875
882
  firstName: string;
876
883
  lastName: string;
877
884
  password: string;
885
+ preferredRegion: string;
878
886
  role: NonNullable<EnumUserRole | undefined>;
879
887
  }, yup.AnyObject, {
880
888
  email: undefined;
881
889
  firstName: undefined;
882
890
  lastName: undefined;
883
891
  password: undefined;
892
+ preferredRegion: undefined;
884
893
  role: undefined;
885
894
  }, "">;
886
895
  declare const requestPasswordResetSchema: yup.ObjectSchema<{
@@ -1197,9 +1206,7 @@ declare const stallholderFullAddress: FormField;
1197
1206
  declare const stallholderStartDateFields: FormDateField[];
1198
1207
  declare const stallholderEndDateFields: FormDateField[];
1199
1208
  declare const stallholderLocationDescription: FormField;
1200
- declare const availableRegionTypes: EnumRegions[];
1201
1209
  declare const availableCityOptions: OptionItem[];
1202
- declare const availableRegionOptions: OptionItem[];
1203
1210
 
1204
1211
  declare const stallholderElectricity: {
1205
1212
  details: FormField;
package/dist/index.d.ts CHANGED
@@ -87,6 +87,7 @@ type RegisterFormData = {
87
87
  firstName: string;
88
88
  lastName: string;
89
89
  password: string;
90
+ preferredRegion: string;
90
91
  role: EnumUserRole;
91
92
  };
92
93
  interface CreateRegisterFormData {
@@ -359,6 +360,7 @@ type UserFormData = {
359
360
  firstName: string;
360
361
  lastName: string;
361
362
  password: string;
363
+ preferredRegion: string;
362
364
  role: EnumUserRole;
363
365
  };
364
366
  interface CreateUserFormData {
@@ -387,6 +389,7 @@ interface UserType {
387
389
  licences: EnumUserLicence[] | null;
388
390
  markets: string[] | null;
389
391
  password: string;
392
+ preferredRegion: string;
390
393
  role: EnumUserRole;
391
394
  stallholder: string | null;
392
395
  updatedAt: string;
@@ -565,6 +568,8 @@ declare function sortDatesByProximity(dates: {
565
568
  startDate: string;
566
569
  startTime: string;
567
570
  }[];
571
+ declare const availableRegionTypes: EnumRegions[];
572
+ declare const availableRegionOptions: OptionItem[];
568
573
 
569
574
  interface PlacePrediction {
570
575
  place_id: string;
@@ -851,6 +856,7 @@ declare const userSchema: yup.ObjectSchema<{
851
856
  firstName: string;
852
857
  lastName: string;
853
858
  password: string;
859
+ preferredRegion: string;
854
860
  confirmPassword: string;
855
861
  role: NonNullable<EnumUserRole | undefined>;
856
862
  }, yup.AnyObject, {
@@ -859,6 +865,7 @@ declare const userSchema: yup.ObjectSchema<{
859
865
  firstName: undefined;
860
866
  lastName: undefined;
861
867
  password: undefined;
868
+ preferredRegion: undefined;
862
869
  confirmPassword: undefined;
863
870
  role: undefined;
864
871
  }, "">;
@@ -875,12 +882,14 @@ declare const registerSchema: yup.ObjectSchema<{
875
882
  firstName: string;
876
883
  lastName: string;
877
884
  password: string;
885
+ preferredRegion: string;
878
886
  role: NonNullable<EnumUserRole | undefined>;
879
887
  }, yup.AnyObject, {
880
888
  email: undefined;
881
889
  firstName: undefined;
882
890
  lastName: undefined;
883
891
  password: undefined;
892
+ preferredRegion: undefined;
884
893
  role: undefined;
885
894
  }, "">;
886
895
  declare const requestPasswordResetSchema: yup.ObjectSchema<{
@@ -1197,9 +1206,7 @@ declare const stallholderFullAddress: FormField;
1197
1206
  declare const stallholderStartDateFields: FormDateField[];
1198
1207
  declare const stallholderEndDateFields: FormDateField[];
1199
1208
  declare const stallholderLocationDescription: FormField;
1200
- declare const availableRegionTypes: EnumRegions[];
1201
1209
  declare const availableCityOptions: OptionItem[];
1202
- declare const availableRegionOptions: OptionItem[];
1203
1210
 
1204
1211
  declare const stallholderElectricity: {
1205
1212
  details: FormField;