@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.cjs
CHANGED
|
@@ -32,6 +32,7 @@ var hooks_exports = {};
|
|
|
32
32
|
__export(hooks_exports, {
|
|
33
33
|
defaultEventFormValues: () => defaultEventFormValues,
|
|
34
34
|
defaultEventInfoFormValues: () => defaultEventInfoFormValues,
|
|
35
|
+
defaultPartnerFormValues: () => defaultPartnerFormValues,
|
|
35
36
|
defaultVendorFormValues: () => defaultVendorFormValues,
|
|
36
37
|
defaultVendorInfoFormValues: () => defaultVendorInfoFormValues,
|
|
37
38
|
globalDefaultValues: () => globalDefaultValues,
|
|
@@ -42,6 +43,7 @@ __export(hooks_exports, {
|
|
|
42
43
|
useEventInfoForm: () => useEventInfoForm,
|
|
43
44
|
useLocationSearch: () => useLocationSearch,
|
|
44
45
|
useLoginForm: () => useLoginForm,
|
|
46
|
+
usePartnerForm: () => usePartnerForm,
|
|
45
47
|
useRegisterForm: () => useRegisterForm,
|
|
46
48
|
useRequestPasswordResetForm: () => useRequestPasswordResetForm,
|
|
47
49
|
useResetPasswordForm: () => useResetPasswordForm,
|
|
@@ -169,6 +171,7 @@ var EnumFoodFlavor = /* @__PURE__ */ ((EnumFoodFlavor3) => {
|
|
|
169
171
|
var EnumResourceType = /* @__PURE__ */ ((EnumResourceType2) => {
|
|
170
172
|
EnumResourceType2["EVENT"] = "event";
|
|
171
173
|
EnumResourceType2["VENDOR"] = "vendor";
|
|
174
|
+
EnumResourceType2["PARTNER"] = "partner";
|
|
172
175
|
return EnumResourceType2;
|
|
173
176
|
})(EnumResourceType || {});
|
|
174
177
|
var EnumEventType = /* @__PURE__ */ ((EnumEventType2) => {
|
|
@@ -181,9 +184,14 @@ var EnumEventType = /* @__PURE__ */ ((EnumEventType2) => {
|
|
|
181
184
|
var EnumVendorType = /* @__PURE__ */ ((EnumVendorType2) => {
|
|
182
185
|
EnumVendorType2["STALLHOLDER"] = "Stallholder";
|
|
183
186
|
EnumVendorType2["SHOP"] = "Shop";
|
|
184
|
-
EnumVendorType2["CHARITY"] = "Charity";
|
|
185
187
|
return EnumVendorType2;
|
|
186
188
|
})(EnumVendorType || {});
|
|
189
|
+
var EnumPartnerType = /* @__PURE__ */ ((EnumPartnerType2) => {
|
|
190
|
+
EnumPartnerType2["CHARITY_PARTNER"] = "Charity_Partner";
|
|
191
|
+
EnumPartnerType2["MEDIA_PARTNER"] = "Media_Partner";
|
|
192
|
+
EnumPartnerType2["SUPPORTING_PARTNER"] = "Supporting_Partner";
|
|
193
|
+
return EnumPartnerType2;
|
|
194
|
+
})(EnumPartnerType || {});
|
|
187
195
|
var EnumOSPlatform = /* @__PURE__ */ ((EnumOSPlatform2) => {
|
|
188
196
|
EnumOSPlatform2["ANDROID"] = "android";
|
|
189
197
|
EnumOSPlatform2["IOS"] = "ios";
|
|
@@ -282,6 +290,8 @@ function normalizeUrl(url) {
|
|
|
282
290
|
}
|
|
283
291
|
|
|
284
292
|
// src/yupSchema/global.ts
|
|
293
|
+
var nzBankAccountRegex = /^\d{2}-\d{4}-\d{7}-\d{2}$/;
|
|
294
|
+
var nzbnRegex = /^94\d{11}$/;
|
|
285
295
|
var normalizedUrlTransform = () => yup.string().trim().transform(
|
|
286
296
|
(value) => typeof value === "string" ? value.toLowerCase() : value
|
|
287
297
|
).transform(
|
|
@@ -475,8 +485,6 @@ var categorySchema = yup.array().of(
|
|
|
475
485
|
|
|
476
486
|
// src/yupSchema/event.ts
|
|
477
487
|
var yup2 = __toESM(require("yup"));
|
|
478
|
-
var nzBankAccountRegex = /^\d{2}-\d{4}-\d{7}-\d{2}$/;
|
|
479
|
-
var nzbnRegex = /^94\d{11}$/;
|
|
480
488
|
var eventSchema = globalResourceSchema.shape({
|
|
481
489
|
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(
|
|
482
490
|
"unique-start-date-time",
|
|
@@ -668,8 +676,9 @@ var yup7 = __toESM(require("yup"));
|
|
|
668
676
|
|
|
669
677
|
// src/types/ad.ts
|
|
670
678
|
var EnumAdShowOn = /* @__PURE__ */ ((EnumAdShowOn2) => {
|
|
671
|
-
EnumAdShowOn2["FRONT_PAGE"] = "Front_page";
|
|
672
679
|
EnumAdShowOn2["EVENTS_PAGE"] = "Events_page";
|
|
680
|
+
EnumAdShowOn2["FRONT_PAGE"] = "Front_page";
|
|
681
|
+
EnumAdShowOn2["PARTNERS_PAGE"] = "Partners_page";
|
|
673
682
|
EnumAdShowOn2["VENDORS_PAGE"] = "Vendors_page";
|
|
674
683
|
return EnumAdShowOn2;
|
|
675
684
|
})(EnumAdShowOn || {});
|
|
@@ -737,7 +746,27 @@ var adSchema = yup7.object().shape({
|
|
|
737
746
|
targetRegion: yup7.string().nullable().notRequired()
|
|
738
747
|
});
|
|
739
748
|
|
|
749
|
+
// src/yupSchema/partner.ts
|
|
750
|
+
var yup8 = __toESM(require("yup"));
|
|
751
|
+
var partnerSchema = globalResourceSchema.shape({
|
|
752
|
+
location: locationSchema,
|
|
753
|
+
nzbn: yup8.string().required("NZBN is required").matches(nzbnRegex, "NZBN must be 13 digits and start with 94"),
|
|
754
|
+
partnerType: yup8.mixed().oneOf(Object.values(EnumPartnerType)).required("Please select a Partner type")
|
|
755
|
+
});
|
|
756
|
+
|
|
740
757
|
// src/hooks/utils.ts
|
|
758
|
+
var defaultLocation = {
|
|
759
|
+
city: "",
|
|
760
|
+
coordinates: [0, 0],
|
|
761
|
+
// [longitude, latitude]
|
|
762
|
+
country: "",
|
|
763
|
+
fullAddress: "",
|
|
764
|
+
latitude: 0,
|
|
765
|
+
longitude: 0,
|
|
766
|
+
region: "",
|
|
767
|
+
type: "Point"
|
|
768
|
+
// Default type for GeoJSON
|
|
769
|
+
};
|
|
741
770
|
var globalDefaultValues = {
|
|
742
771
|
active: false,
|
|
743
772
|
associates: null,
|
|
@@ -764,22 +793,17 @@ var globalDefaultValues = {
|
|
|
764
793
|
region: "",
|
|
765
794
|
socialMedia: []
|
|
766
795
|
};
|
|
796
|
+
var defaultPartnerFormValues = {
|
|
797
|
+
...globalDefaultValues,
|
|
798
|
+
location: defaultLocation,
|
|
799
|
+
nzbn: "",
|
|
800
|
+
partnerType: "Charity_Partner" /* CHARITY_PARTNER */
|
|
801
|
+
};
|
|
767
802
|
var defaultEventFormValues = {
|
|
768
803
|
...globalDefaultValues,
|
|
769
804
|
dateTime: [],
|
|
770
805
|
eventType: "Market" /* MARKET */,
|
|
771
|
-
location:
|
|
772
|
-
city: "",
|
|
773
|
-
coordinates: [0, 0],
|
|
774
|
-
// [longitude, latitude]
|
|
775
|
-
country: "",
|
|
776
|
-
fullAddress: "",
|
|
777
|
-
latitude: 0,
|
|
778
|
-
longitude: 0,
|
|
779
|
-
region: "",
|
|
780
|
-
type: "Point"
|
|
781
|
-
// Default type for GeoJSON
|
|
782
|
-
},
|
|
806
|
+
location: defaultLocation,
|
|
783
807
|
nzbn: "",
|
|
784
808
|
provider: null,
|
|
785
809
|
rainOrShine: false,
|
|
@@ -1504,12 +1528,12 @@ var import_react2 = __toESM(require("react"));
|
|
|
1504
1528
|
var import_react_hook_form12 = require("react-hook-form");
|
|
1505
1529
|
|
|
1506
1530
|
// src/yupSchema/contactUs.ts
|
|
1507
|
-
var
|
|
1508
|
-
var contactUsSchema =
|
|
1531
|
+
var yup9 = __toESM(require("yup"));
|
|
1532
|
+
var contactUsSchema = yup9.object().shape({
|
|
1509
1533
|
email: emailRequiredSchema,
|
|
1510
|
-
firstName:
|
|
1511
|
-
lastName:
|
|
1512
|
-
message:
|
|
1534
|
+
firstName: yup9.string().label("First Name").required("First name is required"),
|
|
1535
|
+
lastName: yup9.string().label("Last Name").required("Last name is required"),
|
|
1536
|
+
message: yup9.string().label("Message").required("Message is required")
|
|
1513
1537
|
});
|
|
1514
1538
|
|
|
1515
1539
|
// src/hooks/useContactUsForm.ts
|
|
@@ -1673,10 +1697,92 @@ function useAdForm(data) {
|
|
|
1673
1697
|
watch
|
|
1674
1698
|
};
|
|
1675
1699
|
}
|
|
1700
|
+
|
|
1701
|
+
// src/hooks/partner/usePartnerForm.ts
|
|
1702
|
+
var import_yup14 = require("@hookform/resolvers/yup");
|
|
1703
|
+
var React9 = __toESM(require("react"));
|
|
1704
|
+
var import_react_hook_form14 = require("react-hook-form");
|
|
1705
|
+
function usePartnerForm(data) {
|
|
1706
|
+
const {
|
|
1707
|
+
control,
|
|
1708
|
+
formState: { errors },
|
|
1709
|
+
getValues,
|
|
1710
|
+
handleSubmit,
|
|
1711
|
+
reset,
|
|
1712
|
+
setValue,
|
|
1713
|
+
watch
|
|
1714
|
+
} = (0, import_react_hook_form14.useForm)({
|
|
1715
|
+
defaultValues: defaultPartnerFormValues,
|
|
1716
|
+
resolver: (0, import_yup14.yupResolver)(partnerSchema)
|
|
1717
|
+
});
|
|
1718
|
+
React9.useEffect(() => {
|
|
1719
|
+
if (data) {
|
|
1720
|
+
reset({
|
|
1721
|
+
...mapBaseResourceTypeToFormData(data),
|
|
1722
|
+
location: data.location,
|
|
1723
|
+
nzbn: data.nzbn,
|
|
1724
|
+
partnerType: data.partnerType
|
|
1725
|
+
});
|
|
1726
|
+
} else {
|
|
1727
|
+
reset(defaultPartnerFormValues);
|
|
1728
|
+
}
|
|
1729
|
+
}, [data]);
|
|
1730
|
+
const {
|
|
1731
|
+
_id,
|
|
1732
|
+
active,
|
|
1733
|
+
associates,
|
|
1734
|
+
cover,
|
|
1735
|
+
coverUpload,
|
|
1736
|
+
description,
|
|
1737
|
+
images,
|
|
1738
|
+
imagesUpload,
|
|
1739
|
+
location,
|
|
1740
|
+
logo,
|
|
1741
|
+
logoUpload,
|
|
1742
|
+
name,
|
|
1743
|
+
nzbn,
|
|
1744
|
+
owner,
|
|
1745
|
+
partnerType,
|
|
1746
|
+
promoCodes,
|
|
1747
|
+
region,
|
|
1748
|
+
socialMedia,
|
|
1749
|
+
termsAgreement
|
|
1750
|
+
} = getValues();
|
|
1751
|
+
return {
|
|
1752
|
+
control,
|
|
1753
|
+
fields: {
|
|
1754
|
+
_id,
|
|
1755
|
+
active,
|
|
1756
|
+
associates,
|
|
1757
|
+
cover,
|
|
1758
|
+
coverUpload,
|
|
1759
|
+
description,
|
|
1760
|
+
images,
|
|
1761
|
+
imagesUpload,
|
|
1762
|
+
location,
|
|
1763
|
+
logo,
|
|
1764
|
+
logoUpload,
|
|
1765
|
+
name,
|
|
1766
|
+
nzbn,
|
|
1767
|
+
owner,
|
|
1768
|
+
partnerType,
|
|
1769
|
+
promoCodes,
|
|
1770
|
+
region,
|
|
1771
|
+
socialMedia,
|
|
1772
|
+
termsAgreement
|
|
1773
|
+
},
|
|
1774
|
+
formState: { errors },
|
|
1775
|
+
handleSubmit,
|
|
1776
|
+
reset,
|
|
1777
|
+
setValue,
|
|
1778
|
+
watch
|
|
1779
|
+
};
|
|
1780
|
+
}
|
|
1676
1781
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1677
1782
|
0 && (module.exports = {
|
|
1678
1783
|
defaultEventFormValues,
|
|
1679
1784
|
defaultEventInfoFormValues,
|
|
1785
|
+
defaultPartnerFormValues,
|
|
1680
1786
|
defaultVendorFormValues,
|
|
1681
1787
|
defaultVendorInfoFormValues,
|
|
1682
1788
|
globalDefaultValues,
|
|
@@ -1687,6 +1793,7 @@ function useAdForm(data) {
|
|
|
1687
1793
|
useEventInfoForm,
|
|
1688
1794
|
useLocationSearch,
|
|
1689
1795
|
useLoginForm,
|
|
1796
|
+
usePartnerForm,
|
|
1690
1797
|
useRegisterForm,
|
|
1691
1798
|
useRequestPasswordResetForm,
|
|
1692
1799
|
useResetPasswordForm,
|