@timardex/cluemart-shared 3.0.0 → 3.0.1

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/index.cjs CHANGED
@@ -3164,6 +3164,9 @@ function eventStartDatesSet(dateTime) {
3164
3164
  );
3165
3165
  }
3166
3166
  function hasMatchingEventDate(vendorStartDates, eventStartDates) {
3167
+ if (eventStartDates.size === 0) {
3168
+ return true;
3169
+ }
3167
3170
  return vendorStartDates.some((startDate) => eventStartDates.has(startDate));
3168
3171
  }
3169
3172
  function matchesSelectedDate(vendorStartDates, selectedDate) {
@@ -3317,8 +3320,8 @@ function getVendorEventRelationDateOptions(events) {
3317
3320
  value: startDate
3318
3321
  }));
3319
3322
  }
3320
- function getVendorEventsEmptyMessage() {
3321
- return "No events found.";
3323
+ function getVendorEventsEmptyMessage(hasAnyEventsForVendor = false, selectedDate = null) {
3324
+ return hasAnyEventsForVendor && selectedDate ? "No events found for this date." : "No events found.";
3322
3325
  }
3323
3326
 
3324
3327
  // src/utils/affiliate.ts
@@ -3632,7 +3635,10 @@ function getVendorEventsData({
3632
3635
  })
3633
3636
  );
3634
3637
  return {
3635
- emptyMessage: getVendorEventsEmptyMessage(),
3638
+ emptyMessage: getVendorEventsEmptyMessage(
3639
+ (events?.length ?? 0) > 0,
3640
+ selectedDate
3641
+ ),
3636
3642
  eventDateOptions,
3637
3643
  eventsByDate: filterVendorEventsBySelectedDate(events, selectedDate),
3638
3644
  hasDatePills: eventDateOptions.length > 0