@timardex/cluemart-shared 1.2.1 → 1.2.3
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-utcwpkKv.d.mts → ad-CjJ4eOXQ.d.mts} +1 -1
- package/dist/{ad-BTebYGa6.d.ts → ad-bZBXVzB4.d.ts} +1 -1
- package/dist/{auth-DO7TRji8.d.ts → auth-CUFK_NWr.d.ts} +1 -1
- package/dist/{auth-BH5KfDFw.d.mts → auth-DD3sE2bg.d.mts} +1 -1
- package/dist/formFields/index.cjs +35 -24
- package/dist/formFields/index.cjs.map +1 -1
- package/dist/formFields/index.d.mts +4 -3
- package/dist/formFields/index.d.ts +4 -3
- package/dist/formFields/index.mjs +34 -24
- package/dist/formFields/index.mjs.map +1 -1
- package/dist/{global-CntHxpmg.d.mts → global-CuI_od8W.d.mts} +19 -11
- package/dist/{global-K1ennCrw.d.ts → global-DB_pNCpw.d.ts} +19 -11
- package/dist/graphql/index.cjs +29 -13
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +2 -2
- package/dist/graphql/index.d.ts +2 -2
- package/dist/graphql/index.mjs +29 -13
- package/dist/graphql/index.mjs.map +1 -1
- package/dist/hooks/index.cjs +21 -18
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.mts +3 -3
- package/dist/hooks/index.d.ts +3 -3
- package/dist/hooks/index.mjs +21 -18
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.cjs +85 -55
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +21 -12
- package/dist/index.d.ts +21 -12
- package/dist/index.mjs +84 -55
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.d.mts +3 -3
- package/dist/types/index.d.ts +3 -3
- package/dist/utils/index.d.mts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -209,6 +209,7 @@ __export(index_exports, {
|
|
|
209
209
|
vendorFullAddress: () => vendorFullAddress,
|
|
210
210
|
vendorGazebo: () => vendorGazebo,
|
|
211
211
|
vendorLocationDescription: () => vendorLocationDescription,
|
|
212
|
+
vendorMenuFields: () => vendorMenuFields,
|
|
212
213
|
vendorMultiLocation: () => vendorMultiLocation,
|
|
213
214
|
vendorPackaging: () => vendorPackaging,
|
|
214
215
|
vendorPriceRange: () => vendorPriceRange,
|
|
@@ -473,11 +474,6 @@ var vendorBasicInfoFields = [
|
|
|
473
474
|
isTextArea: true,
|
|
474
475
|
name: "description",
|
|
475
476
|
placeholder: "Description"
|
|
476
|
-
},
|
|
477
|
-
{
|
|
478
|
-
helperText: "Enter Promo code if you have one.",
|
|
479
|
-
name: "promoCode",
|
|
480
|
-
placeholder: "Promo code"
|
|
481
477
|
}
|
|
482
478
|
];
|
|
483
479
|
var vendorMultiLocation = {
|
|
@@ -518,12 +514,45 @@ var vendorEndDateFields = [
|
|
|
518
514
|
placeholder: "End Time"
|
|
519
515
|
}
|
|
520
516
|
];
|
|
517
|
+
var vendorAvailability = [
|
|
518
|
+
{
|
|
519
|
+
name: "availability.school",
|
|
520
|
+
placeholder: "School events"
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
name: "availability.private",
|
|
524
|
+
placeholder: "Private events"
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
name: "availability.corporate",
|
|
528
|
+
placeholder: "Corporate events"
|
|
529
|
+
}
|
|
530
|
+
];
|
|
521
531
|
var vendorLocationDescription = {
|
|
522
532
|
helperText: "Description",
|
|
523
533
|
isTextArea: true,
|
|
524
534
|
name: "description",
|
|
525
535
|
placeholder: "Description"
|
|
526
536
|
};
|
|
537
|
+
var vendorMenuFields = [
|
|
538
|
+
{
|
|
539
|
+
helperText: "Item name",
|
|
540
|
+
name: "name",
|
|
541
|
+
placeholder: "Item name"
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
helperText: "Item Description",
|
|
545
|
+
isTextArea: true,
|
|
546
|
+
name: "description",
|
|
547
|
+
placeholder: "Item Description"
|
|
548
|
+
},
|
|
549
|
+
{
|
|
550
|
+
helperText: "Price",
|
|
551
|
+
keyboardType: "decimal-pad",
|
|
552
|
+
name: "price",
|
|
553
|
+
placeholder: "Price"
|
|
554
|
+
}
|
|
555
|
+
];
|
|
527
556
|
var availableCityTypes = [
|
|
528
557
|
"Auckland",
|
|
529
558
|
"Christchurch",
|
|
@@ -608,20 +637,6 @@ var vendorFoodFlavour = {
|
|
|
608
637
|
name: "product.foodFlavors",
|
|
609
638
|
placeholder: "Food flavours"
|
|
610
639
|
};
|
|
611
|
-
var vendorAvailability = [
|
|
612
|
-
{
|
|
613
|
-
name: "availability.school",
|
|
614
|
-
placeholder: "School events"
|
|
615
|
-
},
|
|
616
|
-
{
|
|
617
|
-
name: "availability.private",
|
|
618
|
-
placeholder: "Private events"
|
|
619
|
-
},
|
|
620
|
-
{
|
|
621
|
-
name: "availability.corporate",
|
|
622
|
-
placeholder: "Corporate events"
|
|
623
|
-
}
|
|
624
|
-
];
|
|
625
640
|
var vendorCompliance = [
|
|
626
641
|
{
|
|
627
642
|
name: "compliance.liabilityInsurance",
|
|
@@ -683,11 +698,6 @@ var eventBasicInfoFields = [
|
|
|
683
698
|
isTextArea: true,
|
|
684
699
|
name: "description",
|
|
685
700
|
placeholder: "Description"
|
|
686
|
-
},
|
|
687
|
-
{
|
|
688
|
-
helperText: "Enter Promo code if you have one.",
|
|
689
|
-
name: "promoCode",
|
|
690
|
-
placeholder: "Promo code"
|
|
691
701
|
}
|
|
692
702
|
];
|
|
693
703
|
var eventStartDateFields = [
|
|
@@ -2286,7 +2296,7 @@ var EVENT = import_client3.gql`
|
|
|
2286
2296
|
partners {
|
|
2287
2297
|
...PartnerFields
|
|
2288
2298
|
}
|
|
2289
|
-
|
|
2299
|
+
promoCodes
|
|
2290
2300
|
provider
|
|
2291
2301
|
posterUsage {
|
|
2292
2302
|
...PosterUsageFields
|
|
@@ -2379,11 +2389,23 @@ var VENDOR_DATETIME_FIELDS_FRAGMENT = import_client4.gql`
|
|
|
2379
2389
|
startTime
|
|
2380
2390
|
}
|
|
2381
2391
|
`;
|
|
2392
|
+
var VENDOR_MENU_FIELDS_FRAGMENT = import_client4.gql`
|
|
2393
|
+
fragment VendorMenuFields on VendorMenuType {
|
|
2394
|
+
name
|
|
2395
|
+
description
|
|
2396
|
+
price
|
|
2397
|
+
}
|
|
2398
|
+
`;
|
|
2382
2399
|
var VENDOR = import_client4.gql`
|
|
2383
2400
|
fragment VendorFields on VendorType {
|
|
2384
2401
|
_id
|
|
2385
2402
|
active
|
|
2386
2403
|
adIds
|
|
2404
|
+
availability {
|
|
2405
|
+
corporate
|
|
2406
|
+
private
|
|
2407
|
+
school
|
|
2408
|
+
}
|
|
2387
2409
|
vendorInfoId
|
|
2388
2410
|
categories {
|
|
2389
2411
|
...CategoryFields
|
|
@@ -2417,8 +2439,10 @@ var VENDOR = import_client4.gql`
|
|
|
2417
2439
|
partners {
|
|
2418
2440
|
...PartnerFields
|
|
2419
2441
|
}
|
|
2420
|
-
products
|
|
2421
|
-
|
|
2442
|
+
products {
|
|
2443
|
+
...VendorMenuFields
|
|
2444
|
+
}
|
|
2445
|
+
promoCodes
|
|
2422
2446
|
posterUsage {
|
|
2423
2447
|
...PosterUsageFields
|
|
2424
2448
|
}
|
|
@@ -2427,7 +2451,6 @@ var VENDOR = import_client4.gql`
|
|
|
2427
2451
|
socialMedia {
|
|
2428
2452
|
...SocialMediaFields
|
|
2429
2453
|
}
|
|
2430
|
-
specialities
|
|
2431
2454
|
updatedAt
|
|
2432
2455
|
vendorType
|
|
2433
2456
|
}
|
|
@@ -2439,6 +2462,7 @@ var VENDOR = import_client4.gql`
|
|
|
2439
2462
|
${SOCIAL_MEDIA_FIELDS_FRAGMENT}
|
|
2440
2463
|
${POSTER_USAGE_FIELDS_FRAGMENT}
|
|
2441
2464
|
${PARTNER_FIELDS_FRAGMENT}
|
|
2465
|
+
${VENDOR_MENU_FIELDS_FRAGMENT}
|
|
2442
2466
|
`;
|
|
2443
2467
|
var VENDOR_ATTRIBUTES_FRAGMENT = import_client4.gql`
|
|
2444
2468
|
fragment VendorAttributesFields on VendorAttributesType {
|
|
@@ -2449,11 +2473,6 @@ var VENDOR_ATTRIBUTES_FRAGMENT = import_client4.gql`
|
|
|
2449
2473
|
var VENDOR_INFO = import_client4.gql`
|
|
2450
2474
|
fragment VendorInfoFields on VendorInfoType {
|
|
2451
2475
|
_id
|
|
2452
|
-
availability {
|
|
2453
|
-
corporate
|
|
2454
|
-
private
|
|
2455
|
-
school
|
|
2456
|
-
}
|
|
2457
2476
|
compliance {
|
|
2458
2477
|
foodBeverageLicense
|
|
2459
2478
|
liabilityInsurance
|
|
@@ -3507,7 +3526,7 @@ var GET_RESOURCE_CONNECTIONS = import_client29.gql`
|
|
|
3507
3526
|
partners {
|
|
3508
3527
|
...PartnerFields
|
|
3509
3528
|
}
|
|
3510
|
-
|
|
3529
|
+
promoCodes
|
|
3511
3530
|
provider
|
|
3512
3531
|
posterUsage {
|
|
3513
3532
|
...PosterUsageFields
|
|
@@ -3528,6 +3547,11 @@ var GET_RESOURCE_CONNECTIONS = import_client29.gql`
|
|
|
3528
3547
|
_id
|
|
3529
3548
|
active
|
|
3530
3549
|
adIds
|
|
3550
|
+
availability {
|
|
3551
|
+
corporate
|
|
3552
|
+
private
|
|
3553
|
+
school
|
|
3554
|
+
}
|
|
3531
3555
|
vendorInfoId
|
|
3532
3556
|
categories {
|
|
3533
3557
|
...CategoryFields
|
|
@@ -3561,14 +3585,15 @@ var GET_RESOURCE_CONNECTIONS = import_client29.gql`
|
|
|
3561
3585
|
partners {
|
|
3562
3586
|
...PartnerFields
|
|
3563
3587
|
}
|
|
3564
|
-
products
|
|
3565
|
-
|
|
3588
|
+
products {
|
|
3589
|
+
...VendorMenuFields
|
|
3590
|
+
}
|
|
3591
|
+
promoCodes
|
|
3566
3592
|
posterUsage {
|
|
3567
3593
|
...PosterUsageFields
|
|
3568
3594
|
}
|
|
3569
3595
|
region
|
|
3570
3596
|
relationIds
|
|
3571
|
-
specialities
|
|
3572
3597
|
socialMedia {
|
|
3573
3598
|
...SocialMediaFields
|
|
3574
3599
|
}
|
|
@@ -3591,6 +3616,7 @@ var GET_RESOURCE_CONNECTIONS = import_client29.gql`
|
|
|
3591
3616
|
${SOCIAL_MEDIA_FIELDS_FRAGMENT}
|
|
3592
3617
|
${POSTER_USAGE_FIELDS_FRAGMENT}
|
|
3593
3618
|
${PARTNER_FIELDS_FRAGMENT}
|
|
3619
|
+
${VENDOR_MENU_FIELDS_FRAGMENT}
|
|
3594
3620
|
`;
|
|
3595
3621
|
|
|
3596
3622
|
// src/graphql/mutations/relation.ts
|
|
@@ -4863,9 +4889,16 @@ var eventInfoSchema = yup2.object().shape({
|
|
|
4863
4889
|
|
|
4864
4890
|
// src/yupSchema/vendor.ts
|
|
4865
4891
|
var yup3 = __toESM(require("yup"));
|
|
4892
|
+
var vendroMenuSchema = yup3.object().shape({
|
|
4893
|
+
description: yup3.string().trim().max(100).optional().nullable(),
|
|
4894
|
+
price: yup3.number().transform((value, originalValue) => originalValue === "" ? null : value).min(0).optional().nullable(),
|
|
4895
|
+
title: yup3.string().trim().max(50).optional().nullable()
|
|
4896
|
+
});
|
|
4866
4897
|
var vendorSchema = globalResourceSchema.shape({
|
|
4867
4898
|
categories: categorySchema.min(1, "Category list must contain at least one item").required("Categories are required"),
|
|
4868
4899
|
multiLocation: yup3.boolean().required("Multi location is required"),
|
|
4900
|
+
products: yup3.array().of(vendroMenuSchema).optional().nullable(),
|
|
4901
|
+
specialties: yup3.array().of(vendroMenuSchema).optional().nullable(),
|
|
4869
4902
|
vendorType: yup3.mixed().oneOf(Object.values(EnumVendorType)).required("Please select a Vendor type")
|
|
4870
4903
|
});
|
|
4871
4904
|
var vendorInfoSchema = yup3.object().shape({
|
|
@@ -5067,7 +5100,7 @@ var globalDefaultValues = {
|
|
|
5067
5100
|
logoUpload: null,
|
|
5068
5101
|
name: "",
|
|
5069
5102
|
partners: null,
|
|
5070
|
-
|
|
5103
|
+
promoCodes: [],
|
|
5071
5104
|
region: "",
|
|
5072
5105
|
socialMedia: []
|
|
5073
5106
|
};
|
|
@@ -5124,19 +5157,18 @@ var defaultEventInfoFormValues = {
|
|
|
5124
5157
|
};
|
|
5125
5158
|
var defaultVendorFormValues = {
|
|
5126
5159
|
...globalDefaultValues,
|
|
5160
|
+
availability: {
|
|
5161
|
+
corporate: false,
|
|
5162
|
+
private: false,
|
|
5163
|
+
school: false
|
|
5164
|
+
},
|
|
5127
5165
|
categories: [],
|
|
5128
5166
|
locations: null,
|
|
5129
5167
|
multiLocation: false,
|
|
5130
5168
|
products: null,
|
|
5131
|
-
specialities: null,
|
|
5132
5169
|
vendorType: "stallholder" /* STALLHOLDER */
|
|
5133
5170
|
};
|
|
5134
5171
|
var defaultVendorInfoFormValues = {
|
|
5135
|
-
availability: {
|
|
5136
|
-
corporate: false,
|
|
5137
|
-
private: false,
|
|
5138
|
-
school: false
|
|
5139
|
-
},
|
|
5140
5172
|
compliance: { foodBeverageLicense: false, liabilityInsurance: false },
|
|
5141
5173
|
contactDetails: {
|
|
5142
5174
|
email: null,
|
|
@@ -5175,7 +5207,7 @@ function mapBaseResourceTypeToFormData(data) {
|
|
|
5175
5207
|
name: data.name,
|
|
5176
5208
|
owner: data.owner,
|
|
5177
5209
|
partners: data.partners,
|
|
5178
|
-
|
|
5210
|
+
promoCodes: data.promoCodes,
|
|
5179
5211
|
region: data.region,
|
|
5180
5212
|
socialMedia: data.socialMedia
|
|
5181
5213
|
};
|
|
@@ -5199,11 +5231,11 @@ function useVendorForm(data) {
|
|
|
5199
5231
|
if (data) {
|
|
5200
5232
|
reset({
|
|
5201
5233
|
...mapBaseResourceTypeToFormData(data),
|
|
5234
|
+
availability: data.availability,
|
|
5202
5235
|
categories: data.categories,
|
|
5203
5236
|
locations: data.locations,
|
|
5204
5237
|
multiLocation: data.multiLocation,
|
|
5205
5238
|
products: data.products,
|
|
5206
|
-
specialities: data.specialities,
|
|
5207
5239
|
vendorType: data.vendorType
|
|
5208
5240
|
});
|
|
5209
5241
|
} else {
|
|
@@ -5213,6 +5245,7 @@ function useVendorForm(data) {
|
|
|
5213
5245
|
const {
|
|
5214
5246
|
_id,
|
|
5215
5247
|
active,
|
|
5248
|
+
availability,
|
|
5216
5249
|
categories,
|
|
5217
5250
|
cover,
|
|
5218
5251
|
coverUpload,
|
|
@@ -5227,10 +5260,9 @@ function useVendorForm(data) {
|
|
|
5227
5260
|
owner,
|
|
5228
5261
|
partners,
|
|
5229
5262
|
products,
|
|
5230
|
-
|
|
5263
|
+
promoCodes,
|
|
5231
5264
|
region,
|
|
5232
5265
|
socialMedia: socialMedia2,
|
|
5233
|
-
specialities,
|
|
5234
5266
|
vendorType
|
|
5235
5267
|
} = getValues();
|
|
5236
5268
|
return {
|
|
@@ -5238,6 +5270,7 @@ function useVendorForm(data) {
|
|
|
5238
5270
|
fields: {
|
|
5239
5271
|
_id,
|
|
5240
5272
|
active,
|
|
5273
|
+
availability,
|
|
5241
5274
|
categories,
|
|
5242
5275
|
cover,
|
|
5243
5276
|
coverUpload,
|
|
@@ -5252,10 +5285,9 @@ function useVendorForm(data) {
|
|
|
5252
5285
|
owner,
|
|
5253
5286
|
partners,
|
|
5254
5287
|
products,
|
|
5255
|
-
|
|
5288
|
+
promoCodes,
|
|
5256
5289
|
region,
|
|
5257
5290
|
socialMedia: socialMedia2,
|
|
5258
|
-
specialities,
|
|
5259
5291
|
vendorType
|
|
5260
5292
|
},
|
|
5261
5293
|
formState: { errors },
|
|
@@ -5287,7 +5319,6 @@ function useVendorInfoForm(data) {
|
|
|
5287
5319
|
if (data) {
|
|
5288
5320
|
reset({
|
|
5289
5321
|
_id: data._id,
|
|
5290
|
-
availability: data.availability,
|
|
5291
5322
|
compliance: data.compliance,
|
|
5292
5323
|
contactDetails: data.contactDetails,
|
|
5293
5324
|
documents: data.documents,
|
|
@@ -5303,7 +5334,6 @@ function useVendorInfoForm(data) {
|
|
|
5303
5334
|
}, [data]);
|
|
5304
5335
|
const {
|
|
5305
5336
|
_id,
|
|
5306
|
-
availability,
|
|
5307
5337
|
compliance,
|
|
5308
5338
|
contactDetails,
|
|
5309
5339
|
documents,
|
|
@@ -5317,7 +5347,6 @@ function useVendorInfoForm(data) {
|
|
|
5317
5347
|
control,
|
|
5318
5348
|
fields: {
|
|
5319
5349
|
_id,
|
|
5320
|
-
availability,
|
|
5321
5350
|
compliance,
|
|
5322
5351
|
contactDetails,
|
|
5323
5352
|
documents,
|
|
@@ -5385,7 +5414,7 @@ function useEventForm(data) {
|
|
|
5385
5414
|
nzbn,
|
|
5386
5415
|
owner,
|
|
5387
5416
|
partners,
|
|
5388
|
-
|
|
5417
|
+
promoCodes,
|
|
5389
5418
|
provider,
|
|
5390
5419
|
rainOrShine,
|
|
5391
5420
|
region,
|
|
@@ -5411,7 +5440,7 @@ function useEventForm(data) {
|
|
|
5411
5440
|
nzbn,
|
|
5412
5441
|
owner,
|
|
5413
5442
|
partners,
|
|
5414
|
-
|
|
5443
|
+
promoCodes,
|
|
5415
5444
|
provider,
|
|
5416
5445
|
rainOrShine,
|
|
5417
5446
|
region,
|
|
@@ -6231,6 +6260,7 @@ var fonts = {
|
|
|
6231
6260
|
vendorFullAddress,
|
|
6232
6261
|
vendorGazebo,
|
|
6233
6262
|
vendorLocationDescription,
|
|
6263
|
+
vendorMenuFields,
|
|
6234
6264
|
vendorMultiLocation,
|
|
6235
6265
|
vendorPackaging,
|
|
6236
6266
|
vendorPriceRange,
|