@timardex/cluemart-shared 1.4.37 → 1.4.39
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/{auth-HbXNMRIh.d.mts → auth-DUBji9Ck.d.mts} +1 -1
- package/dist/{auth-B_WKc68t.d.ts → auth-DlfrrfXs.d.ts} +1 -1
- package/dist/{chunk-JKQ4GVSJ.mjs → chunk-M35ZHJPQ.mjs} +31 -1
- package/dist/chunk-M35ZHJPQ.mjs.map +1 -0
- package/dist/{chunk-LGLQLG47.mjs → chunk-PZUKAO6K.mjs} +5 -1
- package/dist/chunk-PZUKAO6K.mjs.map +1 -0
- package/dist/formFields/index.cjs +32 -0
- package/dist/formFields/index.cjs.map +1 -1
- package/dist/formFields/index.d.mts +4 -2
- package/dist/formFields/index.d.ts +4 -2
- package/dist/formFields/index.mjs +5 -1
- package/dist/{global-DgA-5e-O.d.ts → global-B07TrIzO.d.ts} +8 -4
- package/dist/{global-V7YaFCJR.d.mts → global-DgdaY28O.d.mts} +8 -4
- package/dist/graphql/index.cjs +4 -0
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +3 -3
- package/dist/graphql/index.d.ts +3 -3
- package/dist/graphql/index.mjs +1 -1
- package/dist/hooks/index.cjs +57 -8
- 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 +55 -10
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.cjs +89 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +11 -5
- package/dist/index.d.ts +11 -5
- package/dist/index.mjs +87 -8
- package/dist/index.mjs.map +1 -1
- package/dist/{post-DklGTzDA.d.mts → post-75KGk2Nr.d.mts} +1 -1
- package/dist/{post-vmmaQ9XX.d.ts → post-Bt32gXMn.d.ts} +1 -1
- package/dist/{resourceActivities-BtWfy0kk.d.mts → resourceActivities-B2Yp2GKt.d.mts} +1 -1
- package/dist/{resourceActivities-fgwhRy0j.d.ts → resourceActivities-PNcgmHGK.d.ts} +1 -1
- package/dist/types/index.d.mts +5 -5
- package/dist/types/index.d.ts +5 -5
- package/dist/utils/index.d.mts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunk-JKQ4GVSJ.mjs.map +0 -1
- package/dist/chunk-LGLQLG47.mjs.map +0 -1
package/dist/hooks/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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 UnregisteredVendorFormData, B as BaseResourceTypeFormData } from '../global-
|
|
2
|
-
import { e as UserFormData, C as CreateUserFormData, f as PartnerFormData, g as TesterFormData, h as CreateTesterFormData, i as AdFormData, j as CreateAdFormData, k as CreatePartnerFormData, l as PostFormData, m as CreatePostFormData, n as AppSettingsFormData, o as CreateAppSettingsFormData } from '../post-
|
|
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, 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 UnregisteredVendorFormData, B as BaseResourceTypeFormData } from '../global-DgdaY28O.mjs';
|
|
2
|
+
import { e as UserFormData, C as CreateUserFormData, f as PartnerFormData, g as TesterFormData, h as CreateTesterFormData, i as AdFormData, j as CreateAdFormData, k as CreatePartnerFormData, l as PostFormData, m as CreatePostFormData, n as AppSettingsFormData, o as CreateAppSettingsFormData } from '../post-75KGk2Nr.mjs';
|
|
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-DUBji9Ck.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
|
-
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 UnregisteredVendorFormData, B as BaseResourceTypeFormData } from '../global-
|
|
2
|
-
import { e as UserFormData, C as CreateUserFormData, f as PartnerFormData, g as TesterFormData, h as CreateTesterFormData, i as AdFormData, j as CreateAdFormData, k as CreatePartnerFormData, l as PostFormData, m as CreatePostFormData, n as AppSettingsFormData, o as CreateAppSettingsFormData } from '../post-
|
|
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, 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 UnregisteredVendorFormData, B as BaseResourceTypeFormData } from '../global-B07TrIzO.js';
|
|
2
|
+
import { e as UserFormData, C as CreateUserFormData, f as PartnerFormData, g as TesterFormData, h as CreateTesterFormData, i as AdFormData, j as CreateAdFormData, k as CreatePartnerFormData, l as PostFormData, m as CreatePostFormData, n as AppSettingsFormData, o as CreateAppSettingsFormData } from '../post-Bt32gXMn.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-DlfrrfXs.js';
|
|
4
4
|
import 'react-hook-form';
|
|
5
5
|
import '../enums/index.js';
|
|
6
6
|
|
package/dist/hooks/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../chunk-
|
|
2
|
-
import "../chunk-
|
|
1
|
+
import "../chunk-M35ZHJPQ.mjs";
|
|
2
|
+
import "../chunk-PZUKAO6K.mjs";
|
|
3
3
|
import "../chunk-DWO35OY4.mjs";
|
|
4
4
|
import "../chunk-I7WE3EBR.mjs";
|
|
5
5
|
import {
|
|
@@ -412,7 +412,17 @@ var eventInfoSchema = yup2.object().shape({
|
|
|
412
412
|
return value < applicationDeadlineHours;
|
|
413
413
|
}
|
|
414
414
|
),
|
|
415
|
-
paymentInfo: yup2.array().of(paymentInfoSchema).min(1, "At least one payment method is required").required("Payment info is required")
|
|
415
|
+
paymentInfo: yup2.array().of(paymentInfoSchema).min(1, "At least one payment method is required").required("Payment info is required"),
|
|
416
|
+
refundPolicy: yup2.object({
|
|
417
|
+
cancelledByOrganiser: yup2.array().of(yup2.string().defined()).min(
|
|
418
|
+
1,
|
|
419
|
+
"At least one refund policy for cancellations by organiser is required"
|
|
420
|
+
).required("Refund policy for cancellations by organiser is required"),
|
|
421
|
+
cancelledByVendor: yup2.array().of(yup2.string().defined()).min(
|
|
422
|
+
1,
|
|
423
|
+
"At least one refund policy for cancellations by vendor is required"
|
|
424
|
+
).required("Refund policy for cancellations by vendor is required")
|
|
425
|
+
})
|
|
416
426
|
});
|
|
417
427
|
|
|
418
428
|
// src/yupSchema/vendor.ts
|
|
@@ -468,15 +478,27 @@ var vendorInfoSchema = yup3.object().shape({
|
|
|
468
478
|
).min(1, "Food flavors list must contain at least one item").required("Food flavors are required"),
|
|
469
479
|
packaging: yup3.array().of(yup3.string().defined()).min(1, "Packaging list must contain at least one item").required("Packaging is required"),
|
|
470
480
|
priceRange: yup3.object().shape({
|
|
471
|
-
max: yup3.
|
|
481
|
+
max: yup3.string().required("Max price is required").test(
|
|
482
|
+
"is-number",
|
|
483
|
+
"Max price must be a valid number",
|
|
484
|
+
(value) => value !== void 0 && value !== "" && !isNaN(Number(value))
|
|
485
|
+
).test(
|
|
472
486
|
"is-greater",
|
|
473
487
|
"Max price must be greater than or equal to Min price",
|
|
474
488
|
function(max) {
|
|
475
489
|
const { min } = this.parent;
|
|
476
|
-
|
|
490
|
+
if (!max || !min) return true;
|
|
491
|
+
const maxNum = Number(max);
|
|
492
|
+
const minNum = Number(min);
|
|
493
|
+
if (isNaN(maxNum) || isNaN(minNum)) return true;
|
|
494
|
+
return maxNum >= minNum;
|
|
477
495
|
}
|
|
478
496
|
),
|
|
479
|
-
min: yup3.
|
|
497
|
+
min: yup3.string().required("Min price is required").test(
|
|
498
|
+
"is-number",
|
|
499
|
+
"Min price must be a valid number",
|
|
500
|
+
(value) => value !== void 0 && value !== "" && !isNaN(Number(value))
|
|
501
|
+
)
|
|
480
502
|
}),
|
|
481
503
|
producedIn: yup3.array().of(yup3.string().defined()).min(1, "Produced in list must contain at least one item").required("Produced in is required")
|
|
482
504
|
}),
|
|
@@ -514,8 +536,24 @@ var vendorInfoSchema = yup3.object().shape({
|
|
|
514
536
|
}).optional(),
|
|
515
537
|
stallInfo: yup3.object().shape({
|
|
516
538
|
size: yup3.object().shape({
|
|
517
|
-
depth: yup3.
|
|
518
|
-
|
|
539
|
+
depth: yup3.string().required("Depth is required").test(
|
|
540
|
+
"is-number",
|
|
541
|
+
"Depth must be a valid number",
|
|
542
|
+
(value) => value !== void 0 && value !== "" && !isNaN(Number(value))
|
|
543
|
+
).test(
|
|
544
|
+
"is-positive",
|
|
545
|
+
"Depth must be greater than 0",
|
|
546
|
+
(value) => value !== void 0 && value !== "" && Number(value) > 0
|
|
547
|
+
),
|
|
548
|
+
width: yup3.string().required("Width is required").test(
|
|
549
|
+
"is-number",
|
|
550
|
+
"Width must be a valid number",
|
|
551
|
+
(value) => value !== void 0 && value !== "" && !isNaN(Number(value))
|
|
552
|
+
).test(
|
|
553
|
+
"is-positive",
|
|
554
|
+
"Width must be greater than 0",
|
|
555
|
+
(value) => value !== void 0 && value !== "" && Number(value) > 0
|
|
556
|
+
)
|
|
519
557
|
})
|
|
520
558
|
}),
|
|
521
559
|
vendorId: yup3.string().trim().required("Vendor ID is required")
|
|
@@ -814,6 +852,10 @@ var defaultEventInfoFormValues = {
|
|
|
814
852
|
// e.g., 2 hours before event opens
|
|
815
853
|
paymentDueHours: 12,
|
|
816
854
|
paymentInfo: [],
|
|
855
|
+
refundPolicy: {
|
|
856
|
+
cancelledByOrganiser: [],
|
|
857
|
+
cancelledByVendor: []
|
|
858
|
+
},
|
|
817
859
|
requirements: []
|
|
818
860
|
};
|
|
819
861
|
var defaultVendorFormValues = {
|
|
@@ -844,7 +886,7 @@ var defaultVendorInfoFormValues = {
|
|
|
844
886
|
product: {
|
|
845
887
|
foodFlavors: [],
|
|
846
888
|
packaging: [],
|
|
847
|
-
priceRange: { max:
|
|
889
|
+
priceRange: { max: "", min: "" },
|
|
848
890
|
producedIn: []
|
|
849
891
|
},
|
|
850
892
|
requirements: {
|
|
@@ -853,7 +895,7 @@ var defaultVendorInfoFormValues = {
|
|
|
853
895
|
table: { details: null, isRequired: false }
|
|
854
896
|
},
|
|
855
897
|
stallInfo: {
|
|
856
|
-
size: { depth:
|
|
898
|
+
size: { depth: "", width: "" }
|
|
857
899
|
},
|
|
858
900
|
vendorId: ""
|
|
859
901
|
};
|
|
@@ -1162,6 +1204,7 @@ function useEventInfoForm(data) {
|
|
|
1162
1204
|
packInTime: data.packInTime,
|
|
1163
1205
|
paymentDueHours: data.paymentDueHours,
|
|
1164
1206
|
paymentInfo: data.paymentInfo,
|
|
1207
|
+
refundPolicy: data.refundPolicy,
|
|
1165
1208
|
requirements: data.requirements
|
|
1166
1209
|
});
|
|
1167
1210
|
} else {
|
|
@@ -1176,6 +1219,7 @@ function useEventInfoForm(data) {
|
|
|
1176
1219
|
packInTime,
|
|
1177
1220
|
paymentDueHours,
|
|
1178
1221
|
paymentInfo,
|
|
1222
|
+
refundPolicy,
|
|
1179
1223
|
requirements
|
|
1180
1224
|
} = getValues();
|
|
1181
1225
|
return {
|
|
@@ -1188,6 +1232,7 @@ function useEventInfoForm(data) {
|
|
|
1188
1232
|
packInTime,
|
|
1189
1233
|
paymentDueHours,
|
|
1190
1234
|
paymentInfo,
|
|
1235
|
+
refundPolicy,
|
|
1191
1236
|
requirements
|
|
1192
1237
|
},
|
|
1193
1238
|
formState,
|