@timardex/cluemart-shared 1.2.89 → 1.2.91
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-ClzcYPuT.d.mts → ad-B89WhTMq.d.mts} +4 -4
- package/dist/{ad-CIaDLRVX.d.ts → ad-Dc3Cdtpm.d.ts} +4 -4
- package/dist/{chunk-66MS2SVX.mjs → chunk-VK2BLRBY.mjs} +1 -1
- package/dist/chunk-VK2BLRBY.mjs.map +1 -0
- package/dist/graphql/index.d.mts +1 -1
- package/dist/graphql/index.d.ts +1 -1
- package/dist/hooks/index.cjs +32 -81
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.mjs +28 -77
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.cjs +32 -81
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.mjs +32 -81
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-66MS2SVX.mjs.map +0 -1
package/dist/hooks/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { L as LocationType, h as VendorFormData, i as CreateVendorFormData, j as VendorInfoFormData, k as CreateVendorInfoFormData, l as EventFormData, m as CreateEventFormData, n as EventInfoFormData, o as CreateEventInfoFormData, p as UserFormData, q as CreateUserFormData, B as BaseResourceTypeFormData } from '../global-CLsysATK.mjs';
|
|
2
2
|
import { C as CreateLoginFormData, a as CreateRegisterFormData, b as CreateRequestPasswordResetFormData, c as CreateValidateVerificationTokenFormData, d as CreateResetPasswordFormData, e as ContactUsFormData, f as CreateContactUsFormData } from '../auth-zy1P_DKw.mjs';
|
|
3
|
-
import { a as PartnerFormData, b as TesterFormData, C as CreateTesterFormData, c as AdFormData, d as CreateAdFormData, e as CreatePartnerFormData } from '../ad-
|
|
3
|
+
import { a as PartnerFormData, b as TesterFormData, C as CreateTesterFormData, c as AdFormData, d as CreateAdFormData, e as CreatePartnerFormData } from '../ad-B89WhTMq.mjs';
|
|
4
4
|
import 'react-hook-form';
|
|
5
5
|
import '../enums/index.mjs';
|
|
6
6
|
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { L as LocationType, h as VendorFormData, i as CreateVendorFormData, j as VendorInfoFormData, k as CreateVendorInfoFormData, l as EventFormData, m as CreateEventFormData, n as EventInfoFormData, o as CreateEventInfoFormData, p as UserFormData, q as CreateUserFormData, B as BaseResourceTypeFormData } from '../global-BYQMdxtO.js';
|
|
2
2
|
import { C as CreateLoginFormData, a as CreateRegisterFormData, b as CreateRequestPasswordResetFormData, c as CreateValidateVerificationTokenFormData, d as CreateResetPasswordFormData, e as ContactUsFormData, f as CreateContactUsFormData } from '../auth-D0FKzjLe.js';
|
|
3
|
-
import { a as PartnerFormData, b as TesterFormData, C as CreateTesterFormData, c as AdFormData, d as CreateAdFormData, e as CreatePartnerFormData } from '../ad-
|
|
3
|
+
import { a as PartnerFormData, b as TesterFormData, C as CreateTesterFormData, c as AdFormData, d as CreateAdFormData, e as CreatePartnerFormData } from '../ad-Dc3Cdtpm.js';
|
|
4
4
|
import 'react-hook-form';
|
|
5
5
|
import '../enums/index.js';
|
|
6
6
|
|
package/dist/hooks/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
OrganizedMarketCount,
|
|
7
7
|
OrganizerMarketFrequency,
|
|
8
8
|
VendorSellingFrequency
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-VK2BLRBY.mjs";
|
|
10
10
|
import {
|
|
11
11
|
dateFormat,
|
|
12
12
|
normalizeUrl,
|
|
@@ -483,7 +483,7 @@ var validateVerificationTokenSchema = yup5.object().shape({
|
|
|
483
483
|
// src/yupSchema/tester.ts
|
|
484
484
|
import * as yup6 from "yup";
|
|
485
485
|
var testerVendorSchema = yup6.object().shape({
|
|
486
|
-
categories: categorySchema,
|
|
486
|
+
categories: categorySchema.min(1, "Category list must contain at least one item").required("Categories are required"),
|
|
487
487
|
marketsAttended: yup6.array().of(
|
|
488
488
|
yup6.object().shape({
|
|
489
489
|
city: yup6.string().trim().required("City is required"),
|
|
@@ -493,29 +493,29 @@ var testerVendorSchema = yup6.object().shape({
|
|
|
493
493
|
productsOrServices: yup6.string().trim().required("Products or services description is required"),
|
|
494
494
|
questionary: yup6.object().shape({
|
|
495
495
|
appearInVideoIntroduction: yup6.boolean().optional(),
|
|
496
|
-
applyToAtLeastOneMarket: yup6.boolean().required("
|
|
497
|
-
completeFeedbackQuestionnaire: yup6.boolean().required("
|
|
496
|
+
applyToAtLeastOneMarket: yup6.boolean().required("Required field"),
|
|
497
|
+
completeFeedbackQuestionnaire: yup6.boolean().required("Required field"),
|
|
498
498
|
excitementAboutApp: yup6.string().trim().optional(),
|
|
499
499
|
sendPhotoForSocialMedia: yup6.boolean().optional(),
|
|
500
500
|
socialMediaFeatureReason: yup6.string().trim().optional(),
|
|
501
501
|
testingPeriodConcerns: yup6.string().trim().optional(),
|
|
502
|
-
tryVisitorFeatures: yup6.boolean().required("
|
|
503
|
-
uploadStallProfileFirstWeek: yup6.boolean().required("
|
|
502
|
+
tryVisitorFeatures: yup6.boolean().required("Required field"),
|
|
503
|
+
uploadStallProfileFirstWeek: yup6.boolean().required("Required field"),
|
|
504
504
|
usefulnessExpectations: yup6.string().trim().optional()
|
|
505
505
|
}),
|
|
506
506
|
sellingFrequency: yup6.mixed().oneOf(
|
|
507
507
|
Object.values(VendorSellingFrequency),
|
|
508
508
|
"Please select a valid selling frequency"
|
|
509
|
-
).required("
|
|
509
|
+
).required("Required field"),
|
|
510
510
|
yearlySellingApprox: yup6.number().label("Yearly Selling Approx").min(0, "Yearly selling approximate must be at least 0").integer("Yearly selling approximate must be a whole number").required("Yearly selling approximate is required").test("no-leading-zeros", "", noLeadingZeros("Yearly selling approximate"))
|
|
511
511
|
});
|
|
512
512
|
var testerEventSchema = yup6.object().shape({
|
|
513
|
-
allowMarketingAppearance: yup6.boolean().
|
|
514
|
-
completeFinalQuestionnaire: yup6.boolean().required("
|
|
515
|
-
dailyCoordinationNeeds: yup6.string().trim().
|
|
516
|
-
interestedInCharityInitiative: yup6.boolean().
|
|
517
|
-
inviteAtLeastFiveStallholders: yup6.boolean().required("
|
|
518
|
-
manageApplicationsAndCommunication: yup6.boolean().required("
|
|
513
|
+
allowMarketingAppearance: yup6.boolean().optional(),
|
|
514
|
+
completeFinalQuestionnaire: yup6.boolean().required("Required field"),
|
|
515
|
+
dailyCoordinationNeeds: yup6.string().trim().optional(),
|
|
516
|
+
interestedInCharityInitiative: yup6.boolean().optional(),
|
|
517
|
+
inviteAtLeastFiveStallholders: yup6.boolean().required("Required field"),
|
|
518
|
+
manageApplicationsAndCommunication: yup6.boolean().required("Required field"),
|
|
519
519
|
markets: yup6.array().of(
|
|
520
520
|
yup6.object().shape({
|
|
521
521
|
averageStallCount: yup6.number().label("Average Stall Count").min(1, "Average stall count must be at least 1").integer("Average stall count must be a whole number").required("Average stall count is required").test("no-leading-zeros", "", noLeadingZeros("Average stall count")),
|
|
@@ -531,8 +531,8 @@ var testerEventSchema = yup6.object().shape({
|
|
|
531
531
|
Object.values(OrganizedMarketCount),
|
|
532
532
|
"Please select a valid market count"
|
|
533
533
|
).required("Organized market count is required"),
|
|
534
|
-
organizerExpectations: yup6.string().trim().
|
|
535
|
-
registerMarketsFirstWeek: yup6.boolean().required("
|
|
534
|
+
organizerExpectations: yup6.string().trim().optional(),
|
|
535
|
+
registerMarketsFirstWeek: yup6.boolean().required("Required field")
|
|
536
536
|
});
|
|
537
537
|
var testerSchema = yup6.object().shape({
|
|
538
538
|
businessName: yup6.string().required("Business name is required"),
|
|
@@ -540,7 +540,7 @@ var testerSchema = yup6.object().shape({
|
|
|
540
540
|
event: yup6.object().when("resourceType", {
|
|
541
541
|
is: (resourceType) => resourceType === "event" /* EVENT */,
|
|
542
542
|
otherwise: (schema) => schema.nullable().optional(),
|
|
543
|
-
then: () => testerEventSchema
|
|
543
|
+
then: (schema) => schema.required("Event information is required").shape(testerEventSchema.fields)
|
|
544
544
|
}),
|
|
545
545
|
firstName: yup6.string().required("First name is required"),
|
|
546
546
|
lastName: yup6.string().required("Last name is required"),
|
|
@@ -560,7 +560,7 @@ var testerSchema = yup6.object().shape({
|
|
|
560
560
|
vendor: yup6.object().when("resourceType", {
|
|
561
561
|
is: (resourceType) => resourceType === "vendor" /* VENDOR */,
|
|
562
562
|
otherwise: (schema) => schema.nullable().optional(),
|
|
563
|
-
then: () => testerVendorSchema
|
|
563
|
+
then: (schema) => schema.required("Vendor information is required").shape(testerVendorSchema.fields)
|
|
564
564
|
})
|
|
565
565
|
});
|
|
566
566
|
|
|
@@ -1330,7 +1330,7 @@ import { useForm as useForm11 } from "react-hook-form";
|
|
|
1330
1330
|
var defaultValues7 = {
|
|
1331
1331
|
businessName: "",
|
|
1332
1332
|
email: "",
|
|
1333
|
-
event:
|
|
1333
|
+
event: {},
|
|
1334
1334
|
firstName: "",
|
|
1335
1335
|
lastName: "",
|
|
1336
1336
|
mobilePhone: "",
|
|
@@ -1338,7 +1338,7 @@ var defaultValues7 = {
|
|
|
1338
1338
|
privacyConsent: false,
|
|
1339
1339
|
region: "",
|
|
1340
1340
|
resourceType: "",
|
|
1341
|
-
vendor:
|
|
1341
|
+
vendor: {}
|
|
1342
1342
|
};
|
|
1343
1343
|
function useTesterForm(data) {
|
|
1344
1344
|
const {
|
|
@@ -1348,13 +1348,10 @@ function useTesterForm(data) {
|
|
|
1348
1348
|
handleSubmit,
|
|
1349
1349
|
reset,
|
|
1350
1350
|
setValue,
|
|
1351
|
-
trigger,
|
|
1352
1351
|
watch
|
|
1353
1352
|
} = useForm11({
|
|
1354
1353
|
defaultValues: defaultValues7,
|
|
1355
|
-
|
|
1356
|
-
resolver: yupResolver11(testerSchema),
|
|
1357
|
-
reValidateMode: "onChange"
|
|
1354
|
+
resolver: yupResolver11(testerSchema)
|
|
1358
1355
|
});
|
|
1359
1356
|
React6.useEffect(() => {
|
|
1360
1357
|
if (data) {
|
|
@@ -1374,80 +1371,34 @@ function useTesterForm(data) {
|
|
|
1374
1371
|
} else {
|
|
1375
1372
|
reset(defaultValues7);
|
|
1376
1373
|
}
|
|
1377
|
-
}, [data
|
|
1378
|
-
const resourceType = watch("resourceType");
|
|
1379
|
-
const vendor = watch("vendor");
|
|
1380
|
-
const event = watch("event");
|
|
1381
|
-
React6.useEffect(() => {
|
|
1382
|
-
if (resourceType === "vendor" /* VENDOR */ && vendor === null) {
|
|
1383
|
-
const emptyVendor = {
|
|
1384
|
-
categories: [],
|
|
1385
|
-
marketsAttended: [],
|
|
1386
|
-
productsOrServices: "",
|
|
1387
|
-
questionary: {
|
|
1388
|
-
applyToAtLeastOneMarket: false,
|
|
1389
|
-
completeFeedbackQuestionnaire: false,
|
|
1390
|
-
tryVisitorFeatures: false,
|
|
1391
|
-
uploadStallProfileFirstWeek: false
|
|
1392
|
-
}
|
|
1393
|
-
};
|
|
1394
|
-
setValue("vendor", emptyVendor, { shouldValidate: true });
|
|
1395
|
-
} else if (resourceType === "event" /* EVENT */ && vendor !== null) {
|
|
1396
|
-
setValue("vendor", null, { shouldValidate: true });
|
|
1397
|
-
}
|
|
1398
|
-
}, [resourceType, vendor, setValue]);
|
|
1399
|
-
React6.useEffect(() => {
|
|
1400
|
-
if (resourceType === "event" /* EVENT */ && event === null) {
|
|
1401
|
-
const emptyEvent = {
|
|
1402
|
-
allowMarketingAppearance: false,
|
|
1403
|
-
completeFinalQuestionnaire: false,
|
|
1404
|
-
dailyCoordinationNeeds: "",
|
|
1405
|
-
interestedInCharityInitiative: false,
|
|
1406
|
-
inviteAtLeastFiveStallholders: false,
|
|
1407
|
-
manageApplicationsAndCommunication: false,
|
|
1408
|
-
markets: [],
|
|
1409
|
-
organizerExpectations: "",
|
|
1410
|
-
registerMarketsFirstWeek: false
|
|
1411
|
-
};
|
|
1412
|
-
setValue("event", emptyEvent, { shouldValidate: true });
|
|
1413
|
-
} else if (resourceType === "vendor" /* VENDOR */ && event !== null) {
|
|
1414
|
-
setValue("event", null, { shouldValidate: true });
|
|
1415
|
-
}
|
|
1416
|
-
}, [resourceType, event, setValue]);
|
|
1417
|
-
React6.useEffect(() => {
|
|
1418
|
-
if (resourceType === "vendor" /* VENDOR */ && vendor !== null) {
|
|
1419
|
-
trigger("vendor");
|
|
1420
|
-
}
|
|
1421
|
-
}, [resourceType, vendor, trigger]);
|
|
1422
|
-
React6.useEffect(() => {
|
|
1423
|
-
if (resourceType === "event" /* EVENT */ && event !== null) {
|
|
1424
|
-
trigger("event");
|
|
1425
|
-
}
|
|
1426
|
-
}, [resourceType, event, trigger]);
|
|
1374
|
+
}, [data]);
|
|
1427
1375
|
const {
|
|
1428
1376
|
businessName,
|
|
1429
1377
|
email,
|
|
1378
|
+
event,
|
|
1430
1379
|
firstName,
|
|
1431
1380
|
lastName,
|
|
1432
1381
|
mobilePhone,
|
|
1433
1382
|
osType,
|
|
1434
1383
|
privacyConsent,
|
|
1435
|
-
region
|
|
1384
|
+
region,
|
|
1385
|
+
resourceType,
|
|
1386
|
+
vendor
|
|
1436
1387
|
} = getValues();
|
|
1437
1388
|
return {
|
|
1438
1389
|
control,
|
|
1439
1390
|
fields: {
|
|
1440
1391
|
businessName,
|
|
1441
1392
|
email,
|
|
1442
|
-
event
|
|
1393
|
+
event,
|
|
1443
1394
|
firstName,
|
|
1444
1395
|
lastName,
|
|
1445
1396
|
mobilePhone,
|
|
1446
1397
|
osType,
|
|
1447
1398
|
privacyConsent,
|
|
1448
1399
|
region,
|
|
1449
|
-
resourceType
|
|
1450
|
-
vendor
|
|
1400
|
+
resourceType,
|
|
1401
|
+
vendor
|
|
1451
1402
|
},
|
|
1452
1403
|
formState: { errors },
|
|
1453
1404
|
handleSubmit,
|