@ticketboothapp/booking 1.2.29 → 1.2.31
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/package.json
CHANGED
|
@@ -3071,12 +3071,12 @@ export function BookingFlow({
|
|
|
3071
3071
|
if (dates.length === 0) return;
|
|
3072
3072
|
if (hasAutoSelectedPartnerDateRef.current) return;
|
|
3073
3073
|
|
|
3074
|
-
// Match Calendar: a day is "sold out" only when every slot has 0 vacancies.
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3074
|
+
// Match Calendar: a day is "sold out" only when every slot has 0 vacancies.
|
|
3075
|
+
// Always auto-pick the first day with any inventory; only if the whole range is empty and user is admin, fall back to the first day.
|
|
3076
|
+
const firstWithInventory = dates.find((d) =>
|
|
3077
|
+
(availabilitiesByDate[d] ?? []).some((a) => (a.vacancies ?? 0) > 0),
|
|
3078
|
+
);
|
|
3079
|
+
const first = firstWithInventory ?? (isAdmin && dates[0] ? dates[0] : undefined);
|
|
3080
3080
|
if (!first) return;
|
|
3081
3081
|
|
|
3082
3082
|
hasAutoSelectedPartnerDateRef.current = true;
|
|
@@ -916,11 +916,10 @@ export function PrivateShuttleBookingFlow({
|
|
|
916
916
|
if (dates.length === 0) return;
|
|
917
917
|
if (hasAutoSelectedPartnerDateRef.current) return;
|
|
918
918
|
|
|
919
|
-
const
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
);
|
|
919
|
+
const firstWithInventory = dates.find((d) =>
|
|
920
|
+
(availabilitiesByDate[d] ?? []).some((a) => (a.vacancies ?? 0) > 0),
|
|
921
|
+
);
|
|
922
|
+
const first = firstWithInventory ?? (isAdmin && dates[0] ? dates[0] : undefined);
|
|
924
923
|
if (!first) return;
|
|
925
924
|
|
|
926
925
|
hasAutoSelectedPartnerDateRef.current = true;
|
package/src/index.ts
CHANGED
|
@@ -15,6 +15,7 @@ export {
|
|
|
15
15
|
export { BookingFlow } from './components/booking/BookingFlow';
|
|
16
16
|
export { PrivateShuttleBookingFlow } from './components/booking/PrivateShuttleBookingFlow';
|
|
17
17
|
export type { BookingFlowUiOptions } from './components/booking/booking-flow-ui';
|
|
18
|
+
export { PARTNER_EMBEDDED_BOOKING_FLOW_UI_BASE } from './components/booking/booking-flow-ui';
|
|
18
19
|
export { default as BookingDialog } from './components/booking/BookingDialog';
|
|
19
20
|
export { default as BookingProductGrid } from './components/booking/BookingProductGrid';
|
|
20
21
|
|