@wix/bookings 1.0.1782 → 1.0.1783
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/build/cjs/context-booking-checkout.d.ts +32 -0
- package/build/cjs/context-booking-checkout.js +2002 -1762
- package/build/cjs/context-booking-checkout.js.map +1 -1
- package/build/cjs/context-my-booking.d.ts +2832 -0
- package/build/cjs/context-my-booking.js +592 -0
- package/build/cjs/context-my-booking.js.map +1 -0
- package/build/cjs/context-my-bookings.d.ts +2862 -0
- package/build/cjs/context-my-bookings.js +12885 -0
- package/build/cjs/context-my-bookings.js.map +1 -0
- package/build/cjs/context-service.d.ts +18 -24
- package/build/cjs/context-service.js +403 -396
- package/build/cjs/context-service.js.map +1 -1
- package/build/cjs/context-time-slots.d.ts +24 -7
- package/build/cjs/context-time-slots.js +82 -81
- package/build/cjs/context-time-slots.js.map +1 -1
- package/build/es/context-booking-checkout.d.mts +32 -0
- package/build/es/context-booking-checkout.mjs +2002 -1762
- package/build/es/context-booking-checkout.mjs.map +1 -1
- package/build/es/context-my-booking.d.mts +2832 -0
- package/build/es/context-my-booking.mjs +562 -0
- package/build/es/context-my-booking.mjs.map +1 -0
- package/build/es/context-my-bookings.d.mts +2862 -0
- package/build/es/context-my-bookings.mjs +12844 -0
- package/build/es/context-my-bookings.mjs.map +1 -0
- package/build/es/context-service.d.mts +18 -24
- package/build/es/context-service.mjs +403 -396
- package/build/es/context-service.mjs.map +1 -1
- package/build/es/context-time-slots.d.mts +24 -7
- package/build/es/context-time-slots.mjs +82 -81
- package/build/es/context-time-slots.mjs.map +1 -1
- package/build/internal/cjs/context-booking-checkout.d.ts +32 -0
- package/build/internal/cjs/context-my-booking.d.ts +2832 -0
- package/build/internal/cjs/context-my-bookings.d.ts +2862 -0
- package/build/internal/cjs/context-service.d.ts +18 -24
- package/build/internal/cjs/context-time-slots.d.ts +24 -7
- package/build/internal/es/context-booking-checkout.d.mts +32 -0
- package/build/internal/es/context-my-booking.d.mts +2832 -0
- package/build/internal/es/context-my-bookings.d.mts +2862 -0
- package/build/internal/es/context-service.d.mts +18 -24
- package/build/internal/es/context-time-slots.d.mts +24 -7
- package/context/my-booking/package.json +3 -0
- package/context/my-bookings/package.json +3 -0
- package/context-runtime/context-booking-checkout/runtime.d.ts +32 -0
- package/context-runtime/context-booking-checkout/runtime.js +3 -3
- package/context-runtime/context-my-booking/runtime.d.ts +2832 -0
- package/context-runtime/context-my-booking/runtime.js +2 -0
- package/context-runtime/context-my-bookings/runtime.d.ts +2862 -0
- package/context-runtime/context-my-bookings/runtime.js +11 -0
- package/context-runtime/context-service/runtime.d.ts +18 -24
- package/context-runtime/context-service/runtime.js +3 -3
- package/context-runtime/context-time-slots/runtime.d.ts +24 -7
- package/context-runtime/context-time-slots/runtime.js +2 -2
- package/package.json +20 -4
|
@@ -3531,6 +3531,38 @@ interface BookingCheckoutState {
|
|
|
3531
3531
|
* ```
|
|
3532
3532
|
*/
|
|
3533
3533
|
setParticipants: (count: number) => void;
|
|
3534
|
+
/**
|
|
3535
|
+
* Sets whether the visitor has a promo code to enter at checkout, in `selection.wantsPromoCode`,
|
|
3536
|
+
* and writes it to the page's URL, replacing the current history entry.
|
|
3537
|
+
*
|
|
3538
|
+
* When it's `true` and a priced service is paid in person, `createBooking()` sends the visitor to
|
|
3539
|
+
* the checkout page to enter the code. It doesn't change what's booked, so it keeps
|
|
3540
|
+
* `selectedPaymentOptions`, `createError`, and `addToCartError`.
|
|
3541
|
+
*
|
|
3542
|
+
* The function does nothing when `selection` is `null`.
|
|
3543
|
+
*
|
|
3544
|
+
* @param wanted Whether the visitor has a promo code to enter at checkout.
|
|
3545
|
+
* @example Let the visitor say they have a promo code
|
|
3546
|
+
* ```tsx
|
|
3547
|
+
* import { useBookingCheckoutContext } from '@wix/bookings/context/booking-checkout';
|
|
3548
|
+
*
|
|
3549
|
+
* function PromoCodeCheckbox() {
|
|
3550
|
+
* const { selection, setWantsPromoCode } = useBookingCheckoutContext();
|
|
3551
|
+
*
|
|
3552
|
+
* return (
|
|
3553
|
+
* <label>
|
|
3554
|
+
* <input
|
|
3555
|
+
* type="checkbox"
|
|
3556
|
+
* checked={selection?.wantsPromoCode === true}
|
|
3557
|
+
* onChange={(event) => setWantsPromoCode(event.target.checked)}
|
|
3558
|
+
* />
|
|
3559
|
+
* I have a promo code
|
|
3560
|
+
* </label>
|
|
3561
|
+
* );
|
|
3562
|
+
* }
|
|
3563
|
+
* ```
|
|
3564
|
+
*/
|
|
3565
|
+
setWantsPromoCode: (wanted: boolean) => void;
|
|
3534
3566
|
}
|
|
3535
3567
|
//#endregion
|
|
3536
3568
|
//#region src/extensions/contexts/booking-checkout-context/booking-checkout-context.d.ts
|