@timardex/cluemart-shared 1.2.50 → 1.2.51
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-Dcmq74_b.d.ts → ad-C98yzFdy.d.mts} +17 -4
- package/dist/{ad-BO5cMy3b.d.mts → ad-CPL59gj7.d.ts} +17 -4
- package/dist/{chunk-VYFOKMRP.mjs → chunk-IRQ365TO.mjs} +2 -2
- package/dist/{chunk-XXZPSRMS.mjs → chunk-N625BZKR.mjs} +3 -2
- package/dist/chunk-N625BZKR.mjs.map +1 -0
- package/dist/{chunk-S6RE75SK.mjs → chunk-V3BTJQHJ.mjs} +9 -2
- package/dist/chunk-V3BTJQHJ.mjs.map +1 -0
- package/dist/enums/index.cjs +9 -1
- package/dist/enums/index.cjs.map +1 -1
- package/dist/enums/index.d.mts +9 -4
- package/dist/enums/index.d.ts +9 -4
- package/dist/enums/index.mjs +3 -1
- package/dist/formFields/index.cjs +94 -82
- package/dist/formFields/index.cjs.map +1 -1
- package/dist/formFields/index.d.mts +3 -2
- package/dist/formFields/index.d.ts +3 -2
- package/dist/formFields/index.mjs +24 -10
- package/dist/formFields/index.mjs.map +1 -1
- package/dist/graphql/index.cjs +379 -175
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +43 -2
- package/dist/graphql/index.d.ts +43 -2
- package/dist/graphql/index.mjs +278 -81
- package/dist/graphql/index.mjs.map +1 -1
- package/dist/hooks/index.cjs +128 -21
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.mts +11 -2
- package/dist/hooks/index.d.ts +11 -2
- package/dist/hooks/index.mjs +121 -22
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.cjs +682 -355
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +75 -6
- package/dist/index.d.ts +75 -6
- package/dist/index.mjs +539 -222
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.cjs +2 -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/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-S6RE75SK.mjs.map +0 -1
- package/dist/chunk-XXZPSRMS.mjs.map +0 -1
- /package/dist/{chunk-VYFOKMRP.mjs.map → chunk-IRQ365TO.mjs.map} +0 -0
package/dist/hooks/index.mjs
CHANGED
|
@@ -3,24 +3,25 @@ import {
|
|
|
3
3
|
EnumAdStatus,
|
|
4
4
|
EnumAdStyle,
|
|
5
5
|
EnumAdType
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-N625BZKR.mjs";
|
|
7
7
|
import {
|
|
8
8
|
dateFormat,
|
|
9
9
|
normalizeUrl,
|
|
10
10
|
timeFormat
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-IRQ365TO.mjs";
|
|
12
12
|
import {
|
|
13
13
|
EnumEventDateStatus,
|
|
14
14
|
EnumEventType,
|
|
15
15
|
EnumFoodFlavor,
|
|
16
16
|
EnumOSPlatform,
|
|
17
|
+
EnumPartnerType,
|
|
17
18
|
EnumPaymentMethod,
|
|
18
19
|
EnumResourceType,
|
|
19
20
|
EnumSocialMedia,
|
|
20
21
|
EnumUserLicence,
|
|
21
22
|
EnumUserRole,
|
|
22
23
|
EnumVendorType
|
|
23
|
-
} from "../chunk-
|
|
24
|
+
} from "../chunk-V3BTJQHJ.mjs";
|
|
24
25
|
|
|
25
26
|
// src/hooks/useLocationSearch.ts
|
|
26
27
|
var handleApiError = (error, message) => {
|
|
@@ -106,6 +107,8 @@ import dayjs from "dayjs";
|
|
|
106
107
|
import customParseFormat from "dayjs/plugin/customParseFormat.js";
|
|
107
108
|
import isSameOrAfter from "dayjs/plugin/isSameOrAfter.js";
|
|
108
109
|
import * as yup from "yup";
|
|
110
|
+
var nzBankAccountRegex = /^\d{2}-\d{4}-\d{7}-\d{2}$/;
|
|
111
|
+
var nzbnRegex = /^94\d{11}$/;
|
|
109
112
|
var normalizedUrlTransform = () => yup.string().trim().transform(
|
|
110
113
|
(value) => typeof value === "string" ? value.toLowerCase() : value
|
|
111
114
|
).transform(
|
|
@@ -299,8 +302,6 @@ var categorySchema = yup.array().of(
|
|
|
299
302
|
|
|
300
303
|
// src/yupSchema/event.ts
|
|
301
304
|
import * as yup2 from "yup";
|
|
302
|
-
var nzBankAccountRegex = /^\d{2}-\d{4}-\d{7}-\d{2}$/;
|
|
303
|
-
var nzbnRegex = /^94\d{11}$/;
|
|
304
305
|
var eventSchema = globalResourceSchema.shape({
|
|
305
306
|
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(
|
|
306
307
|
"unique-start-date-time",
|
|
@@ -535,7 +536,27 @@ var adSchema = yup7.object().shape({
|
|
|
535
536
|
targetRegion: yup7.string().nullable().notRequired()
|
|
536
537
|
});
|
|
537
538
|
|
|
539
|
+
// src/yupSchema/partner.ts
|
|
540
|
+
import * as yup8 from "yup";
|
|
541
|
+
var partnerSchema = globalResourceSchema.shape({
|
|
542
|
+
location: locationSchema,
|
|
543
|
+
nzbn: yup8.string().required("NZBN is required").matches(nzbnRegex, "NZBN must be 13 digits and start with 94"),
|
|
544
|
+
partnerType: yup8.mixed().oneOf(Object.values(EnumPartnerType)).required("Please select a Partner type")
|
|
545
|
+
});
|
|
546
|
+
|
|
538
547
|
// src/hooks/utils.ts
|
|
548
|
+
var defaultLocation = {
|
|
549
|
+
city: "",
|
|
550
|
+
coordinates: [0, 0],
|
|
551
|
+
// [longitude, latitude]
|
|
552
|
+
country: "",
|
|
553
|
+
fullAddress: "",
|
|
554
|
+
latitude: 0,
|
|
555
|
+
longitude: 0,
|
|
556
|
+
region: "",
|
|
557
|
+
type: "Point"
|
|
558
|
+
// Default type for GeoJSON
|
|
559
|
+
};
|
|
539
560
|
var globalDefaultValues = {
|
|
540
561
|
active: false,
|
|
541
562
|
associates: null,
|
|
@@ -562,22 +583,17 @@ var globalDefaultValues = {
|
|
|
562
583
|
region: "",
|
|
563
584
|
socialMedia: []
|
|
564
585
|
};
|
|
586
|
+
var defaultPartnerFormValues = {
|
|
587
|
+
...globalDefaultValues,
|
|
588
|
+
location: defaultLocation,
|
|
589
|
+
nzbn: "",
|
|
590
|
+
partnerType: "Charity_Partner" /* CHARITY_PARTNER */
|
|
591
|
+
};
|
|
565
592
|
var defaultEventFormValues = {
|
|
566
593
|
...globalDefaultValues,
|
|
567
594
|
dateTime: [],
|
|
568
595
|
eventType: "Market" /* MARKET */,
|
|
569
|
-
location:
|
|
570
|
-
city: "",
|
|
571
|
-
coordinates: [0, 0],
|
|
572
|
-
// [longitude, latitude]
|
|
573
|
-
country: "",
|
|
574
|
-
fullAddress: "",
|
|
575
|
-
latitude: 0,
|
|
576
|
-
longitude: 0,
|
|
577
|
-
region: "",
|
|
578
|
-
type: "Point"
|
|
579
|
-
// Default type for GeoJSON
|
|
580
|
-
},
|
|
596
|
+
location: defaultLocation,
|
|
581
597
|
nzbn: "",
|
|
582
598
|
provider: null,
|
|
583
599
|
rainOrShine: false,
|
|
@@ -1302,12 +1318,12 @@ import React7 from "react";
|
|
|
1302
1318
|
import { useForm as useForm12 } from "react-hook-form";
|
|
1303
1319
|
|
|
1304
1320
|
// src/yupSchema/contactUs.ts
|
|
1305
|
-
import * as
|
|
1306
|
-
var contactUsSchema =
|
|
1321
|
+
import * as yup9 from "yup";
|
|
1322
|
+
var contactUsSchema = yup9.object().shape({
|
|
1307
1323
|
email: emailRequiredSchema,
|
|
1308
|
-
firstName:
|
|
1309
|
-
lastName:
|
|
1310
|
-
message:
|
|
1324
|
+
firstName: yup9.string().label("First Name").required("First name is required"),
|
|
1325
|
+
lastName: yup9.string().label("Last Name").required("Last name is required"),
|
|
1326
|
+
message: yup9.string().label("Message").required("Message is required")
|
|
1311
1327
|
});
|
|
1312
1328
|
|
|
1313
1329
|
// src/hooks/useContactUsForm.ts
|
|
@@ -1471,9 +1487,91 @@ function useAdForm(data) {
|
|
|
1471
1487
|
watch
|
|
1472
1488
|
};
|
|
1473
1489
|
}
|
|
1490
|
+
|
|
1491
|
+
// src/hooks/partner/usePartnerForm.ts
|
|
1492
|
+
import { yupResolver as yupResolver14 } from "@hookform/resolvers/yup";
|
|
1493
|
+
import * as React9 from "react";
|
|
1494
|
+
import { useForm as useForm14 } from "react-hook-form";
|
|
1495
|
+
function usePartnerForm(data) {
|
|
1496
|
+
const {
|
|
1497
|
+
control,
|
|
1498
|
+
formState: { errors },
|
|
1499
|
+
getValues,
|
|
1500
|
+
handleSubmit,
|
|
1501
|
+
reset,
|
|
1502
|
+
setValue,
|
|
1503
|
+
watch
|
|
1504
|
+
} = useForm14({
|
|
1505
|
+
defaultValues: defaultPartnerFormValues,
|
|
1506
|
+
resolver: yupResolver14(partnerSchema)
|
|
1507
|
+
});
|
|
1508
|
+
React9.useEffect(() => {
|
|
1509
|
+
if (data) {
|
|
1510
|
+
reset({
|
|
1511
|
+
...mapBaseResourceTypeToFormData(data),
|
|
1512
|
+
location: data.location,
|
|
1513
|
+
nzbn: data.nzbn,
|
|
1514
|
+
partnerType: data.partnerType
|
|
1515
|
+
});
|
|
1516
|
+
} else {
|
|
1517
|
+
reset(defaultPartnerFormValues);
|
|
1518
|
+
}
|
|
1519
|
+
}, [data]);
|
|
1520
|
+
const {
|
|
1521
|
+
_id,
|
|
1522
|
+
active,
|
|
1523
|
+
associates,
|
|
1524
|
+
cover,
|
|
1525
|
+
coverUpload,
|
|
1526
|
+
description,
|
|
1527
|
+
images,
|
|
1528
|
+
imagesUpload,
|
|
1529
|
+
location,
|
|
1530
|
+
logo,
|
|
1531
|
+
logoUpload,
|
|
1532
|
+
name,
|
|
1533
|
+
nzbn,
|
|
1534
|
+
owner,
|
|
1535
|
+
partnerType,
|
|
1536
|
+
promoCodes,
|
|
1537
|
+
region,
|
|
1538
|
+
socialMedia,
|
|
1539
|
+
termsAgreement
|
|
1540
|
+
} = getValues();
|
|
1541
|
+
return {
|
|
1542
|
+
control,
|
|
1543
|
+
fields: {
|
|
1544
|
+
_id,
|
|
1545
|
+
active,
|
|
1546
|
+
associates,
|
|
1547
|
+
cover,
|
|
1548
|
+
coverUpload,
|
|
1549
|
+
description,
|
|
1550
|
+
images,
|
|
1551
|
+
imagesUpload,
|
|
1552
|
+
location,
|
|
1553
|
+
logo,
|
|
1554
|
+
logoUpload,
|
|
1555
|
+
name,
|
|
1556
|
+
nzbn,
|
|
1557
|
+
owner,
|
|
1558
|
+
partnerType,
|
|
1559
|
+
promoCodes,
|
|
1560
|
+
region,
|
|
1561
|
+
socialMedia,
|
|
1562
|
+
termsAgreement
|
|
1563
|
+
},
|
|
1564
|
+
formState: { errors },
|
|
1565
|
+
handleSubmit,
|
|
1566
|
+
reset,
|
|
1567
|
+
setValue,
|
|
1568
|
+
watch
|
|
1569
|
+
};
|
|
1570
|
+
}
|
|
1474
1571
|
export {
|
|
1475
1572
|
defaultEventFormValues,
|
|
1476
1573
|
defaultEventInfoFormValues,
|
|
1574
|
+
defaultPartnerFormValues,
|
|
1477
1575
|
defaultVendorFormValues,
|
|
1478
1576
|
defaultVendorInfoFormValues,
|
|
1479
1577
|
globalDefaultValues,
|
|
@@ -1484,6 +1582,7 @@ export {
|
|
|
1484
1582
|
useEventInfoForm,
|
|
1485
1583
|
useLocationSearch,
|
|
1486
1584
|
useLoginForm,
|
|
1585
|
+
usePartnerForm,
|
|
1487
1586
|
useRegisterForm,
|
|
1488
1587
|
useRequestPasswordResetForm,
|
|
1489
1588
|
useResetPasswordForm,
|