nylas-cancel-booking-form

Overview

The nylas-cancel-booking-form component is a UI component that allows users to cancel a booking (DELETE request). This component is also used to reject a booking (PUT request) by the organizer, if the prop rejectBookingId is provided.

Version1.1.4
Install (React)npm install @nylas/react
Import (React)import { NylasCancelBookingForm } from '@nylas/react';
Import (CDN)<script type="module"> import { defineCustomElement } from "https://cdn.jsdelivr.net/npm/@nylas/web-elements@latest/dist/cdn/nylas-cancel-booking-form/nylas-cancel-booking-form.es.js"; defineCustomElement(); </script>

Example


Properties

PropertyAttributeDescriptionTypeDefault
cancelBookingIdThe booking ID to cancel.string | undefinedundefined
rejectBookingIdThe booking ID to reject.string | undefinedundefined
selectedTimeslot _(required)_The selected timeslot.{ start_time: Date; end_time: Date; emails?: string[] | undefined; }undefined

Standalone Props

ⓘ NOTE: The following props are automatically configured when used within nylas-scheduling. Set these props manually only if you’re using the component independently.
PropertyAttributeDescriptionTypeDefault
configSettingsThe config settings.undefined | { configuration_id: string; scheduler: { available_days_in_future: number; min_cancellation_notice: number; min_booking_notice: number; rescheduling_url?: string | undefined; cancellation_url?: string | undefined; cancellation_policy?: string | undefined; hide_additional_guests?: boolean | undefined; hide_cancellation_options?: boolean | undefined; hide_rescheduling_options?: boolean | undefined; additional_fields?: Record<string, AdditionalFields> | undefined; confirmation_redirect_url?: string | undefined; organizer_confirmation_url?: string | undefined; }; organizer: { name: string; email: string; }; slug: string; appearance: Appearance; booking_type: string; name: string; }undefined
eventInfoThe event info.undefined | { booking_id: string; organizer: { email: string; name: string; is_organizer?: boolean | undefined; }; title: string; description: string; status: string; }undefined
isLoadingThe loading state.boolean | undefinedundefined

Events

EventDescriptionType
cancelBookedEventErrorThis event is fired when an error occurs while cancelling the booking.CustomEvent<NylasSchedulerErrorResponse>
cancelBookingFormErrorThis event is fired when an error occurs in the booking form.CustomEvent<{ id?: string | undefined; type?: NotificationType | undefined; title?: string | undefined; code?: number | undefined; category?: string | undefined; description?: string | undefined; ttl?: number | "none" | undefined; }>
cancelBookingFormSubmittedThis event is fired when the cancel booking form is submitted.CustomEvent<{ bookingId: string; action: "cancel" | "reject"; reason: string; errorHandler?: ((error: NylasSchedulerErrorResponse) => void) | undefined; }>
goBackButtonClickedThis event is fired when the Go back button is clicked on the cancel booking form.CustomEvent<void>
triggerValidationThis event is only for triggering the validation on the text area for cancellation reason. This is for internal purposes only.CustomEvent<{}>

Shadow Parts

PartDescription
"ncbf"The cancel booking form container.
"ncbf__button-cta"The cancel booking form CTA button.
"ncbf__button-outline"The cancel booking form outline button.
"ncbf__card"The cancel booking form card.
"ncbf__description"The description of the cancel booking form.
"ncbf__icon"The calendar icon.
"ncbf__reason-textarea"The reason textarea.
"ncbf__title"The title of the cancel booking form.

Built with StencilJS