@timardex/cluemart-shared 1.1.78 → 1.1.79
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/{ad-ByaFgKCJ.d.ts → ad-Ce7cLdiv.d.ts} +4 -4
- package/dist/{ad-BoyPTKzO.d.mts → ad-DwRLMLYf.d.mts} +4 -4
- package/dist/{auth-CatvNkT_.d.ts → auth-D0DRigoH.d.ts} +1 -1
- package/dist/{auth-CsMldwsP.d.mts → auth-waRIlEXb.d.mts} +1 -1
- package/dist/{chunk-ERBPRUAF.mjs → chunk-MVZHKSTO.mjs} +12 -12
- package/dist/chunk-MVZHKSTO.mjs.map +1 -0
- package/dist/{chunk-JFIG6CV2.mjs → chunk-YOGSPGDV.mjs} +2 -2
- package/dist/chunk-YOGSPGDV.mjs.map +1 -0
- package/dist/{chunk-JZMSWUO5.mjs → chunk-Z4MFANBF.mjs} +2 -2
- package/dist/enums/index.cjs +11 -11
- package/dist/enums/index.cjs.map +1 -1
- package/dist/enums/index.d.mts +11 -11
- package/dist/enums/index.d.ts +11 -11
- package/dist/enums/index.mjs +1 -1
- package/dist/formFields/index.cjs +26 -26
- package/dist/formFields/index.cjs.map +1 -1
- package/dist/formFields/index.d.mts +7 -7
- package/dist/formFields/index.d.ts +7 -7
- package/dist/formFields/index.mjs +23 -23
- package/dist/formFields/index.mjs.map +1 -1
- package/dist/{global-BsANkXhj.d.ts → global-SUox6kvO.d.ts} +14 -14
- package/dist/{global-Dt-vAIF9.d.mts → global-yFmN7ypZ.d.mts} +14 -14
- package/dist/graphql/index.cjs +249 -248
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +33 -33
- package/dist/graphql/index.d.ts +33 -33
- package/dist/graphql/index.mjs +236 -235
- package/dist/graphql/index.mjs.map +1 -1
- package/dist/hooks/index.cjs +36 -36
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.mts +15 -15
- package/dist/hooks/index.d.ts +15 -15
- package/dist/hooks/index.mjs +33 -33
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.cjs +321 -320
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +74 -74
- package/dist/index.d.ts +74 -74
- package/dist/index.mjs +298 -297
- package/dist/index.mjs.map +1 -1
- package/dist/{resourceViews-C2CYUMC0.d.ts → resourceViews-CcElRvU6.d.ts} +2 -2
- package/dist/{resourceViews-ja9Qif1X.d.mts → resourceViews-Xr7sq5z4.d.mts} +2 -2
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.mts +4 -4
- package/dist/types/index.d.ts +4 -4
- package/dist/types/index.mjs +1 -1
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.mts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-ERBPRUAF.mjs.map +0 -1
- package/dist/chunk-JFIG6CV2.mjs.map +0 -1
- /package/dist/{chunk-JZMSWUO5.mjs.map → chunk-Z4MFANBF.mjs.map} +0 -0
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { L as LocationType, g as StallholderFormData, h as CreateStallholderFormData, i as StallholderInfoFormData, j as CreateStallholderInfoFormData, k as
|
|
2
|
-
import { a as UserFormData, C as CreateUserFormData, b as TestersFormData, c as CreateTestersFormData, d as AdFormData, e as CreateAdFormData } from '../ad-
|
|
3
|
-
import { C as CreateLoginFormData, a as CreateRegisterFormData, b as CreateRequestPasswordResetFormData, c as CreateValidateVerificationTokenFormData, d as CreateResetPasswordFormData, e as ContactUsFormData, f as CreateContactUsFormData } from '../auth-
|
|
1
|
+
import { L as LocationType, g as StallholderFormData, h as CreateStallholderFormData, i as StallholderInfoFormData, j as CreateStallholderInfoFormData, k as EventFormData, l as CreateEventFormData, m as EventInfoFormData, n as CreateEventInfoFormData, B as BaseResourceTypeFormData } from '../global-SUox6kvO.js';
|
|
2
|
+
import { a as UserFormData, C as CreateUserFormData, b as TestersFormData, c as CreateTestersFormData, d as AdFormData, e as CreateAdFormData } from '../ad-Ce7cLdiv.js';
|
|
3
|
+
import { C as CreateLoginFormData, a as CreateRegisterFormData, b as CreateRequestPasswordResetFormData, c as CreateValidateVerificationTokenFormData, d as CreateResetPasswordFormData, e as ContactUsFormData, f as CreateContactUsFormData } from '../auth-D0DRigoH.js';
|
|
4
4
|
import 'react-hook-form';
|
|
5
5
|
import '../enums/index.js';
|
|
6
6
|
|
|
@@ -36,20 +36,20 @@ declare function useStallholderForm(data?: StallholderFormData): CreateStallhold
|
|
|
36
36
|
declare function useStallholderInfoForm(data?: StallholderInfoFormData): CreateStallholderInfoFormData;
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
|
-
* Custom hook to manage the
|
|
39
|
+
* Custom hook to manage the event form state and validation.
|
|
40
40
|
*
|
|
41
|
-
* @param {
|
|
42
|
-
* @returns {
|
|
41
|
+
* @param {EventFormData} data - The initial form data.
|
|
42
|
+
* @returns {CreateEventFormData} - The form methods and state.
|
|
43
43
|
*/
|
|
44
|
-
declare function
|
|
44
|
+
declare function useEventForm(data?: EventFormData): CreateEventFormData;
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
|
-
* Custom hook to manage the
|
|
47
|
+
* Custom hook to manage the event form state and validation.
|
|
48
48
|
*
|
|
49
|
-
* @param {
|
|
50
|
-
* @returns {
|
|
49
|
+
* @param {EventInfoFormData} data - The initial form data.
|
|
50
|
+
* @returns {CreateEventInfoFormData} - The form methods and state.
|
|
51
51
|
*/
|
|
52
|
-
declare function
|
|
52
|
+
declare function useEventInfoForm(data?: EventInfoFormData): CreateEventInfoFormData;
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
55
|
* Custom hook to manage the user form state and validation.
|
|
@@ -80,11 +80,11 @@ declare function useValidateVerificationTokenForm(): CreateValidateVerificationT
|
|
|
80
80
|
declare function useResetPasswordForm(): CreateResetPasswordFormData;
|
|
81
81
|
|
|
82
82
|
declare const globalDefaultValues: BaseResourceTypeFormData;
|
|
83
|
-
declare const
|
|
84
|
-
declare const
|
|
83
|
+
declare const defaultEventFormValues: EventFormData;
|
|
84
|
+
declare const defaultEventInfoFormValues: EventInfoFormData;
|
|
85
85
|
declare const defaultStallholderFormValues: StallholderFormData;
|
|
86
86
|
declare const defaultStallholderInfoFormValues: StallholderInfoFormData;
|
|
87
|
-
declare function mapBaseResourceTypeToFormData(data:
|
|
87
|
+
declare function mapBaseResourceTypeToFormData(data: EventFormData | StallholderFormData): BaseResourceTypeFormData;
|
|
88
88
|
|
|
89
89
|
declare function useTestersForm(data?: TestersFormData): CreateTestersFormData;
|
|
90
90
|
|
|
@@ -92,4 +92,4 @@ declare function useContactUsForm(data?: ContactUsFormData): CreateContactUsForm
|
|
|
92
92
|
|
|
93
93
|
declare function useAdForm(data?: AdFormData): CreateAdFormData;
|
|
94
94
|
|
|
95
|
-
export { type PlacePrediction,
|
|
95
|
+
export { type PlacePrediction, defaultEventFormValues, defaultEventInfoFormValues, defaultStallholderFormValues, defaultStallholderInfoFormValues, globalDefaultValues, mapBaseResourceTypeToFormData, useAdForm, useContactUsForm, useEventForm, useEventInfoForm, useLocationSearch, useLoginForm, useRegisterForm, useRequestPasswordResetForm, useResetPasswordForm, useStallholderForm, useStallholderInfoForm, useTestersForm, useUserForm, useValidateVerificationTokenForm };
|
package/dist/hooks/index.mjs
CHANGED
|
@@ -3,19 +3,19 @@ import {
|
|
|
3
3
|
EnumAdStatus,
|
|
4
4
|
EnumAdStyle,
|
|
5
5
|
EnumAdType
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-YOGSPGDV.mjs";
|
|
7
7
|
import {
|
|
8
8
|
dateFormat,
|
|
9
9
|
normalizeUrl,
|
|
10
10
|
timeFormat
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-Z4MFANBF.mjs";
|
|
12
12
|
import {
|
|
13
13
|
EnumOSPlatform,
|
|
14
14
|
EnumPaymentMethod,
|
|
15
15
|
EnumResourceType,
|
|
16
16
|
EnumSocialMedia,
|
|
17
17
|
EnumUserRole
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-MVZHKSTO.mjs";
|
|
19
19
|
|
|
20
20
|
// src/hooks/useLocationSearch.ts
|
|
21
21
|
var handleApiError = (error, message) => {
|
|
@@ -281,11 +281,11 @@ var contactDetailsSchema = yup.object({
|
|
|
281
281
|
)
|
|
282
282
|
}).nullable().optional().label("Contact Details");
|
|
283
283
|
|
|
284
|
-
// src/yupSchema/
|
|
284
|
+
// src/yupSchema/event.ts
|
|
285
285
|
import * as yup2 from "yup";
|
|
286
286
|
var nzBankAccountRegex = /^\d{2}-\d{4}-\d{7}-\d{2}$/;
|
|
287
|
-
var
|
|
288
|
-
dateTime: yup2.array().of(dateTimeSchema).min(1, "At least one
|
|
287
|
+
var eventSchema = globalResourceSchema.shape({
|
|
288
|
+
dateTime: yup2.array().of(dateTimeSchema).min(1, "At least one Event date required").max(50, "You can only add up to 50 Event dates").required("DateTime is required").test(
|
|
289
289
|
"unique-start-date-time",
|
|
290
290
|
"Start Date and Time must be unique",
|
|
291
291
|
function(value) {
|
|
@@ -303,7 +303,7 @@ var marketSchema = globalResourceSchema.shape({
|
|
|
303
303
|
}
|
|
304
304
|
),
|
|
305
305
|
location: locationSchema,
|
|
306
|
-
rainOrShine: yup2.boolean().label("Rain or Shine").required("Please specify if the
|
|
306
|
+
rainOrShine: yup2.boolean().label("Rain or Shine").required("Please specify if the event is rain or shine"),
|
|
307
307
|
tags: yup2.array().of(yup2.string().defined()).min(1, "Tags are required").required("Tags are required")
|
|
308
308
|
});
|
|
309
309
|
var paymentInfoSchema = yup2.object({
|
|
@@ -327,11 +327,11 @@ var paymentInfoSchema = yup2.object({
|
|
|
327
327
|
otherwise: (schema) => schema.notRequired()
|
|
328
328
|
})
|
|
329
329
|
});
|
|
330
|
-
var
|
|
330
|
+
var eventInfoSchema = yup2.object().shape({
|
|
331
331
|
contactDetails: contactDetailsSchema,
|
|
332
332
|
applicationDeadlineHours: yup2.number().label("Application Deadline Hours").nullable().transform((value, originalValue) => originalValue === "" ? null : value).typeError("Application deadline hours must be a number").min(1, "Application deadline hours must be at least 1").required("Application deadline hours is required").test("no-leading-zeros", "", noLeadingZeros("Application deadline hours")),
|
|
333
333
|
dateTime: yup2.array().of(dateTimeWithPriceSchema).required("DateTime is required"),
|
|
334
|
-
|
|
334
|
+
eventId: yup2.string().trim().required("Event ID is required"),
|
|
335
335
|
packInTime: yup2.number().label("Pack In Time").typeError("Pack in time must be a number").min(1, "Pack in time must be at least 1").required("Pack in time is required").test("no-leading-zeros", "", noLeadingZeros("Pack in time")),
|
|
336
336
|
paymentDueHours: yup2.number().label("Payment Due Hours").typeError("Payment due hours must be a number").min(1, "Payment due hours must be at least 1").required("Payment due hours is required").test("no-leading-zeros", "", noLeadingZeros("Payment due hours")),
|
|
337
337
|
paymentInfo: yup2.array().of(paymentInfoSchema).min(1, "At least one payment info is required").required("Payment info is required")
|
|
@@ -441,7 +441,7 @@ var testersSchema = yup6.object().shape({
|
|
|
441
441
|
osType: yup6.mixed().oneOf(Object.values(EnumOSPlatform), "Please select Android or iOS device").required("OS Type is required"),
|
|
442
442
|
resourceType: yup6.mixed().oneOf(
|
|
443
443
|
Object.values(EnumResourceType),
|
|
444
|
-
"Please select
|
|
444
|
+
"Please select Event or Stallholder"
|
|
445
445
|
).required("Resource Type is required")
|
|
446
446
|
});
|
|
447
447
|
|
|
@@ -477,7 +477,7 @@ var adSchema = yup7.object().shape({
|
|
|
477
477
|
resourceRegion: yup7.string().required("Resource region is required"),
|
|
478
478
|
resourceType: yup7.mixed().oneOf(
|
|
479
479
|
Object.values(EnumResourceType),
|
|
480
|
-
"Please select
|
|
480
|
+
"Please select Event or Stallholder"
|
|
481
481
|
).required("Resource Type is required"),
|
|
482
482
|
showOn: yup7.mixed().oneOf(
|
|
483
483
|
Object.values(EnumAdShowOn),
|
|
@@ -517,7 +517,7 @@ var globalDefaultValues = {
|
|
|
517
517
|
region: "",
|
|
518
518
|
socialMedia: []
|
|
519
519
|
};
|
|
520
|
-
var
|
|
520
|
+
var defaultEventFormValues = {
|
|
521
521
|
...globalDefaultValues,
|
|
522
522
|
dateTime: [
|
|
523
523
|
{
|
|
@@ -543,7 +543,7 @@ var defaultMarketFormValues = {
|
|
|
543
543
|
rainOrShine: false,
|
|
544
544
|
tags: []
|
|
545
545
|
};
|
|
546
|
-
var
|
|
546
|
+
var defaultEventInfoFormValues = {
|
|
547
547
|
applicationDeadlineHours: 48,
|
|
548
548
|
contactDetails: {
|
|
549
549
|
email: null,
|
|
@@ -559,9 +559,9 @@ var defaultMarketInfoFormValues = {
|
|
|
559
559
|
startTime: ""
|
|
560
560
|
}
|
|
561
561
|
],
|
|
562
|
-
|
|
562
|
+
eventId: "",
|
|
563
563
|
packInTime: 2,
|
|
564
|
-
// e.g., 2 hours before
|
|
564
|
+
// e.g., 2 hours before event opens
|
|
565
565
|
paymentDueHours: 24,
|
|
566
566
|
paymentInfo: [],
|
|
567
567
|
requirements: []
|
|
@@ -762,11 +762,11 @@ function useStallholderInfoForm(data) {
|
|
|
762
762
|
};
|
|
763
763
|
}
|
|
764
764
|
|
|
765
|
-
// src/hooks/
|
|
765
|
+
// src/hooks/event/useEventForm.ts
|
|
766
766
|
import { yupResolver as yupResolver3 } from "@hookform/resolvers/yup";
|
|
767
767
|
import * as React3 from "react";
|
|
768
768
|
import { useForm as useForm3 } from "react-hook-form";
|
|
769
|
-
function
|
|
769
|
+
function useEventForm(data) {
|
|
770
770
|
const {
|
|
771
771
|
control,
|
|
772
772
|
formState: { errors },
|
|
@@ -776,8 +776,8 @@ function useMarketForm(data) {
|
|
|
776
776
|
setValue,
|
|
777
777
|
watch
|
|
778
778
|
} = useForm3({
|
|
779
|
-
defaultValues:
|
|
780
|
-
resolver: yupResolver3(
|
|
779
|
+
defaultValues: defaultEventFormValues,
|
|
780
|
+
resolver: yupResolver3(eventSchema)
|
|
781
781
|
});
|
|
782
782
|
React3.useEffect(() => {
|
|
783
783
|
if (data) {
|
|
@@ -790,7 +790,7 @@ function useMarketForm(data) {
|
|
|
790
790
|
tags: data.tags
|
|
791
791
|
});
|
|
792
792
|
} else {
|
|
793
|
-
reset(
|
|
793
|
+
reset(defaultEventFormValues);
|
|
794
794
|
}
|
|
795
795
|
}, [data]);
|
|
796
796
|
const {
|
|
@@ -843,11 +843,11 @@ function useMarketForm(data) {
|
|
|
843
843
|
};
|
|
844
844
|
}
|
|
845
845
|
|
|
846
|
-
// src/hooks/
|
|
846
|
+
// src/hooks/event/useEventInfoForm.ts
|
|
847
847
|
import { yupResolver as yupResolver4 } from "@hookform/resolvers/yup";
|
|
848
848
|
import * as React4 from "react";
|
|
849
849
|
import { useForm as useForm4 } from "react-hook-form";
|
|
850
|
-
function
|
|
850
|
+
function useEventInfoForm(data) {
|
|
851
851
|
const {
|
|
852
852
|
control,
|
|
853
853
|
formState: { errors },
|
|
@@ -857,8 +857,8 @@ function useMarketInfoForm(data) {
|
|
|
857
857
|
setValue,
|
|
858
858
|
watch
|
|
859
859
|
} = useForm4({
|
|
860
|
-
defaultValues:
|
|
861
|
-
resolver: yupResolver4(
|
|
860
|
+
defaultValues: defaultEventInfoFormValues,
|
|
861
|
+
resolver: yupResolver4(eventInfoSchema)
|
|
862
862
|
});
|
|
863
863
|
React4.useEffect(() => {
|
|
864
864
|
if (data) {
|
|
@@ -867,14 +867,14 @@ function useMarketInfoForm(data) {
|
|
|
867
867
|
applicationDeadlineHours: data.applicationDeadlineHours,
|
|
868
868
|
contactDetails: data.contactDetails,
|
|
869
869
|
dateTime: data.dateTime,
|
|
870
|
-
|
|
870
|
+
eventId: data.eventId,
|
|
871
871
|
packInTime: data.packInTime,
|
|
872
872
|
paymentDueHours: data.paymentDueHours,
|
|
873
873
|
paymentInfo: data.paymentInfo,
|
|
874
874
|
requirements: data.requirements
|
|
875
875
|
});
|
|
876
876
|
} else {
|
|
877
|
-
reset(
|
|
877
|
+
reset(defaultEventInfoFormValues);
|
|
878
878
|
}
|
|
879
879
|
}, [data]);
|
|
880
880
|
const {
|
|
@@ -882,7 +882,7 @@ function useMarketInfoForm(data) {
|
|
|
882
882
|
applicationDeadlineHours,
|
|
883
883
|
contactDetails,
|
|
884
884
|
dateTime,
|
|
885
|
-
|
|
885
|
+
eventId,
|
|
886
886
|
packInTime,
|
|
887
887
|
paymentDueHours,
|
|
888
888
|
paymentInfo,
|
|
@@ -895,7 +895,7 @@ function useMarketInfoForm(data) {
|
|
|
895
895
|
applicationDeadlineHours,
|
|
896
896
|
contactDetails,
|
|
897
897
|
dateTime,
|
|
898
|
-
|
|
898
|
+
eventId,
|
|
899
899
|
packInTime,
|
|
900
900
|
paymentDueHours,
|
|
901
901
|
paymentInfo,
|
|
@@ -1325,7 +1325,7 @@ var defaultValues9 = {
|
|
|
1325
1325
|
resourceName: "",
|
|
1326
1326
|
resourceRegion: "",
|
|
1327
1327
|
resourceType: "",
|
|
1328
|
-
// default to
|
|
1328
|
+
// default to event
|
|
1329
1329
|
showOn: "Front_page" /* FRONT_PAGE */,
|
|
1330
1330
|
// default to front page
|
|
1331
1331
|
socialMedia: [],
|
|
@@ -1419,18 +1419,18 @@ function useAdForm(data) {
|
|
|
1419
1419
|
};
|
|
1420
1420
|
}
|
|
1421
1421
|
export {
|
|
1422
|
-
|
|
1423
|
-
|
|
1422
|
+
defaultEventFormValues,
|
|
1423
|
+
defaultEventInfoFormValues,
|
|
1424
1424
|
defaultStallholderFormValues,
|
|
1425
1425
|
defaultStallholderInfoFormValues,
|
|
1426
1426
|
globalDefaultValues,
|
|
1427
1427
|
mapBaseResourceTypeToFormData,
|
|
1428
1428
|
useAdForm,
|
|
1429
1429
|
useContactUsForm,
|
|
1430
|
+
useEventForm,
|
|
1431
|
+
useEventInfoForm,
|
|
1430
1432
|
useLocationSearch,
|
|
1431
1433
|
useLoginForm,
|
|
1432
|
-
useMarketForm,
|
|
1433
|
-
useMarketInfoForm,
|
|
1434
1434
|
useRegisterForm,
|
|
1435
1435
|
useRequestPasswordResetForm,
|
|
1436
1436
|
useResetPasswordForm,
|