@timardex/cluemart-shared 2.2.26 → 2.2.28
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/{chunk-J62YICHJ.mjs → chunk-356ZQFAQ.mjs} +2 -2
- package/dist/{chunk-UM3UYMGK.mjs → chunk-RQPB4TAM.mjs} +100 -1
- package/dist/chunk-RQPB4TAM.mjs.map +1 -0
- package/dist/formFields/index.cjs +7 -0
- package/dist/formFields/index.cjs.map +1 -1
- package/dist/formFields/index.mjs +2 -2
- package/dist/hooks/index.cjs +7 -0
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.mjs +2 -2
- package/dist/index.cjs +101 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +61 -1
- package/dist/index.d.ts +61 -1
- package/dist/index.mjs +98 -0
- package/dist/index.mjs.map +1 -1
- package/dist/utils/index.cjs +101 -0
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.mts +61 -1
- package/dist/utils/index.d.ts +61 -1
- package/dist/utils/index.mjs +7 -1
- package/package.json +1 -1
- package/dist/chunk-UM3UYMGK.mjs.map +0 -1
- /package/dist/{chunk-J62YICHJ.mjs.map → chunk-356ZQFAQ.mjs.map} +0 -0
package/dist/hooks/index.mjs
CHANGED
|
@@ -2,12 +2,12 @@ import "../chunk-6O6TRUOV.mjs";
|
|
|
2
2
|
import "../chunk-VA5YN2K3.mjs";
|
|
3
3
|
import "../chunk-VPANTTZI.mjs";
|
|
4
4
|
import "../chunk-DWO35OY4.mjs";
|
|
5
|
-
import "../chunk-
|
|
5
|
+
import "../chunk-356ZQFAQ.mjs";
|
|
6
6
|
import {
|
|
7
7
|
SCHOOL_MIN_STUDENT_COUNT,
|
|
8
8
|
isValidIrdNumber,
|
|
9
9
|
normalizeUrl
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-RQPB4TAM.mjs";
|
|
11
11
|
import "../chunk-RE4NZPYY.mjs";
|
|
12
12
|
import {
|
|
13
13
|
dateFormat,
|
package/dist/index.cjs
CHANGED
|
@@ -130,6 +130,7 @@ __export(index_exports, {
|
|
|
130
130
|
OG_DESCRIPTION_LINE_BREAK: () => OG_DESCRIPTION_LINE_BREAK,
|
|
131
131
|
PERMISSIONS: () => PERMISSIONS,
|
|
132
132
|
POST_SHARE_RESOURCE_TYPES: () => POST_SHARE_RESOURCE_TYPES,
|
|
133
|
+
PRESERVED_RELATION_DATE_STATUSES: () => PRESERVED_RELATION_DATE_STATUSES,
|
|
133
134
|
PROMO_CODE_PREFIX: () => PROMO_CODE_PREFIX,
|
|
134
135
|
PUBLIC_SHARE_PATH_TYPES: () => PUBLIC_SHARE_PATH_TYPES,
|
|
135
136
|
PostTypeLabels: () => PostTypeLabels,
|
|
@@ -275,6 +276,7 @@ __export(index_exports, {
|
|
|
275
276
|
getEventScheduleStatusPresentation: () => getEventScheduleStatusPresentation,
|
|
276
277
|
getEventScheduleStatusTone: () => getEventScheduleStatusTone,
|
|
277
278
|
getEventStallholderEmptyMessage: () => getEventStallholderEmptyMessage,
|
|
279
|
+
getEventStallholdersData: () => getEventStallholdersData,
|
|
278
280
|
getFutureEventStatus: () => getFutureEventStatus,
|
|
279
281
|
getPermissionsForRoles: () => getPermissionsForRoles,
|
|
280
282
|
getRegisteredVendorCategoryNames: () => getRegisteredVendorCategoryNames,
|
|
@@ -286,6 +288,7 @@ __export(index_exports, {
|
|
|
286
288
|
getUsableAdminContexts: () => getUsableAdminContexts,
|
|
287
289
|
getVendorEventRelationDateOptions: () => getVendorEventRelationDateOptions,
|
|
288
290
|
getVendorEventRelationStartDates: () => getVendorEventRelationStartDates,
|
|
291
|
+
getVendorEventsData: () => getVendorEventsData,
|
|
289
292
|
getVendorEventsEmptyMessage: () => getVendorEventsEmptyMessage,
|
|
290
293
|
hasAllPermissions: () => hasAllPermissions,
|
|
291
294
|
hasAnyPermission: () => hasAnyPermission,
|
|
@@ -3472,6 +3475,101 @@ function billingCatalogDefinitionMatches(entry) {
|
|
|
3472
3475
|
return definition.billingPeriod === entry.billingPeriod && definition.licenceType === entry.licenceType;
|
|
3473
3476
|
}
|
|
3474
3477
|
|
|
3478
|
+
// src/utils/relations/eventStallholders.ts
|
|
3479
|
+
function getEventStallholdersData({
|
|
3480
|
+
eventDateTime,
|
|
3481
|
+
selectedCategory,
|
|
3482
|
+
selectedDate,
|
|
3483
|
+
unregisteredVendors = [],
|
|
3484
|
+
vendors
|
|
3485
|
+
}) {
|
|
3486
|
+
const eventStartDates = eventStartDatesSet(eventDateTime);
|
|
3487
|
+
const registeredForEvent = filterRegisteredVendorsByEventDatesOnly(
|
|
3488
|
+
vendors,
|
|
3489
|
+
eventStartDates
|
|
3490
|
+
);
|
|
3491
|
+
const unregisteredForEvent = filterUnregisteredVendorsByEventDatesOnly(
|
|
3492
|
+
unregisteredVendors,
|
|
3493
|
+
eventStartDates
|
|
3494
|
+
);
|
|
3495
|
+
const vendorList = filterRegisteredVendorsForEvent(
|
|
3496
|
+
vendors,
|
|
3497
|
+
eventStartDates,
|
|
3498
|
+
selectedDate,
|
|
3499
|
+
selectedCategory
|
|
3500
|
+
);
|
|
3501
|
+
const unregisteredVendorList = filterUnregisteredVendorsForEvent(
|
|
3502
|
+
unregisteredVendors,
|
|
3503
|
+
eventStartDates,
|
|
3504
|
+
selectedDate,
|
|
3505
|
+
selectedCategory
|
|
3506
|
+
);
|
|
3507
|
+
const registeredForSelectedDate = filterRegisteredVendorsForEvent(
|
|
3508
|
+
vendors,
|
|
3509
|
+
eventStartDates,
|
|
3510
|
+
selectedDate,
|
|
3511
|
+
null
|
|
3512
|
+
);
|
|
3513
|
+
const unregisteredForSelectedDate = filterUnregisteredVendorsForEvent(
|
|
3514
|
+
unregisteredVendors,
|
|
3515
|
+
eventStartDates,
|
|
3516
|
+
selectedDate,
|
|
3517
|
+
null
|
|
3518
|
+
);
|
|
3519
|
+
const stallholderCategories = getStallholderCategoryOptions(
|
|
3520
|
+
registeredForSelectedDate,
|
|
3521
|
+
unregisteredForSelectedDate
|
|
3522
|
+
);
|
|
3523
|
+
const futureEventStartDates = getEventDatesWithStallholders(
|
|
3524
|
+
eventDateTime,
|
|
3525
|
+
collectStallholderStartDates(registeredForEvent, unregisteredForEvent)
|
|
3526
|
+
).map((date) => ({
|
|
3527
|
+
label: formatDate(date.startDate, "date"),
|
|
3528
|
+
value: date.startDate
|
|
3529
|
+
}));
|
|
3530
|
+
const hasDatePills = futureEventStartDates.length > 0;
|
|
3531
|
+
const hasStallholders = vendorList.length > 0 || unregisteredVendorList.length > 0;
|
|
3532
|
+
const hasAnyStallholdersForEvent = registeredForEvent.length > 0 || unregisteredForEvent.length > 0;
|
|
3533
|
+
return {
|
|
3534
|
+
emptyMessage: getEventStallholderEmptyMessage(
|
|
3535
|
+
hasAnyStallholdersForEvent,
|
|
3536
|
+
selectedDate
|
|
3537
|
+
),
|
|
3538
|
+
futureEventStartDates,
|
|
3539
|
+
hasDatePills,
|
|
3540
|
+
hasStallholders,
|
|
3541
|
+
stallholderCategories,
|
|
3542
|
+
unregisteredVendorList,
|
|
3543
|
+
vendorList
|
|
3544
|
+
};
|
|
3545
|
+
}
|
|
3546
|
+
|
|
3547
|
+
// src/utils/relations/vendorEvents.ts
|
|
3548
|
+
function getVendorEventsData({
|
|
3549
|
+
events,
|
|
3550
|
+
selectedDate
|
|
3551
|
+
}) {
|
|
3552
|
+
const eventDateOptions = getVendorEventRelationDateOptions(events).map(
|
|
3553
|
+
(option) => ({
|
|
3554
|
+
...option,
|
|
3555
|
+
label: formatDate(option.value, "date")
|
|
3556
|
+
})
|
|
3557
|
+
);
|
|
3558
|
+
return {
|
|
3559
|
+
emptyMessage: getVendorEventsEmptyMessage(),
|
|
3560
|
+
eventDateOptions,
|
|
3561
|
+
eventsByDate: filterVendorEventsBySelectedDate(events, selectedDate),
|
|
3562
|
+
hasDatePills: eventDateOptions.length > 0
|
|
3563
|
+
};
|
|
3564
|
+
}
|
|
3565
|
+
|
|
3566
|
+
// src/utils/relations/preservedRelationDateStatuses.ts
|
|
3567
|
+
var PRESERVED_RELATION_DATE_STATUSES = /* @__PURE__ */ new Set([
|
|
3568
|
+
"Accepted" /* ACCEPTED */,
|
|
3569
|
+
"Completed" /* COMPLETED */,
|
|
3570
|
+
"Rejected" /* REJECTED */
|
|
3571
|
+
]);
|
|
3572
|
+
|
|
3475
3573
|
// src/utils/toUserFacingErrorMessage.ts
|
|
3476
3574
|
var DEFAULT_USER_FACING_ERROR = "Something went wrong. Please try again.";
|
|
3477
3575
|
var NETWORK_USER_FACING_ERROR = "Unable to connect. Please check your internet connection and try again.";
|
|
@@ -10289,6 +10387,7 @@ function canAccessAdminPath(roles, pathname) {
|
|
|
10289
10387
|
OG_DESCRIPTION_LINE_BREAK,
|
|
10290
10388
|
PERMISSIONS,
|
|
10291
10389
|
POST_SHARE_RESOURCE_TYPES,
|
|
10390
|
+
PRESERVED_RELATION_DATE_STATUSES,
|
|
10292
10391
|
PROMO_CODE_PREFIX,
|
|
10293
10392
|
PUBLIC_SHARE_PATH_TYPES,
|
|
10294
10393
|
PostTypeLabels,
|
|
@@ -10434,6 +10533,7 @@ function canAccessAdminPath(roles, pathname) {
|
|
|
10434
10533
|
getEventScheduleStatusPresentation,
|
|
10435
10534
|
getEventScheduleStatusTone,
|
|
10436
10535
|
getEventStallholderEmptyMessage,
|
|
10536
|
+
getEventStallholdersData,
|
|
10437
10537
|
getFutureEventStatus,
|
|
10438
10538
|
getPermissionsForRoles,
|
|
10439
10539
|
getRegisteredVendorCategoryNames,
|
|
@@ -10445,6 +10545,7 @@ function canAccessAdminPath(roles, pathname) {
|
|
|
10445
10545
|
getUsableAdminContexts,
|
|
10446
10546
|
getVendorEventRelationDateOptions,
|
|
10447
10547
|
getVendorEventRelationStartDates,
|
|
10548
|
+
getVendorEventsData,
|
|
10448
10549
|
getVendorEventsEmptyMessage,
|
|
10449
10550
|
hasAllPermissions,
|
|
10450
10551
|
hasAnyPermission,
|