@nylas/web-elements 0.0.0-test-20250320185733 → 0.0.0-test-20250321141510
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/cdn/nylas-scheduler-editor/nylas-scheduler-editor.es.js +7 -7
- package/dist/cdn/nylas-scheduling/nylas-scheduling.es.js +4792 -4796
- package/dist/cjs/calendar-agenda-fill-icon_36.cjs.entry.js +17 -13
- package/dist/cjs/calendar-agenda-fill-icon_36.cjs.entry.js.map +1 -1
- package/dist/cjs/index.es-4f95065f.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/nylas-booked-event-card_12.cjs.entry.js +3 -3
- package/dist/cjs/nylas-booked-event-card_12.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-provider.cjs.entry.js +2 -2
- package/dist/cjs/nylas-provider.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-scheduler-editor.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-scheduling.cjs.entry.js +1 -1
- package/dist/cjs/nylas-scheduling.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-web-elements.cjs.js +1 -1
- package/dist/cjs/scheduler-config-store-cf66a841.js.map +1 -1
- package/dist/cjs/{scheduler-store-df3a9a3a.js → scheduler-store-461fd2ff.js} +1 -11
- package/dist/cjs/{scheduler-store-df3a9a3a.js.map → scheduler-store-461fd2ff.js.map} +1 -1
- package/dist/collection/common/abstract-provider.js.map +1 -1
- package/dist/collection/components/nylas-provider/nylas-provider.js +7 -2
- package/dist/collection/components/nylas-provider/nylas-provider.js.map +1 -1
- package/dist/collection/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.js +8 -10
- package/dist/collection/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.js.map +1 -1
- package/dist/collection/components/scheduler/nylas-scheduling/nylas-scheduling.js +3 -3
- package/dist/collection/components/scheduler/nylas-scheduling/nylas-scheduling.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-booking-form-config/nylas-booking-form-config.js +20 -15
- package/dist/collection/components/scheduler-editor/nylas-booking-form-config/nylas-booking-form-config.js.map +1 -1
- package/dist/collection/connector/nylas-connector/index.js.map +1 -1
- package/dist/collection/connector/nylas-scheduler-config-connector/index.js.map +1 -1
- package/dist/collection/connector/nylas-scheduler-connector/errors/index.js.map +1 -1
- package/dist/collection/connector/shared/api/scheduler-config.js.map +1 -1
- package/dist/collection/connector/shared/api/scheduler.js.map +1 -1
- package/dist/collection/stores/scheduler-config-store.js.map +1 -1
- package/dist/collection/stores/scheduler-store.js.map +1 -1
- package/dist/collection/types/index.js +0 -10
- package/dist/collection/types/index.js.map +1 -1
- package/dist/components/index.es.js.map +1 -1
- package/dist/components/nylas-booked-event-card2.js +4 -4
- package/dist/components/nylas-booked-event-card2.js.map +1 -1
- package/dist/components/nylas-booking-form-config2.js +17 -13
- package/dist/components/nylas-booking-form-config2.js.map +1 -1
- package/dist/components/nylas-provider.js +1 -1
- package/dist/components/nylas-provider.js.map +1 -1
- package/dist/components/nylas-scheduler-editor.js.map +1 -1
- package/dist/components/nylas-scheduling.js.map +1 -1
- package/dist/components/scheduler-config-store.js.map +1 -1
- package/dist/components/scheduler-store.js +0 -10
- package/dist/components/scheduler-store.js.map +1 -1
- package/dist/esm/calendar-agenda-fill-icon_36.entry.js +17 -13
- package/dist/esm/calendar-agenda-fill-icon_36.entry.js.map +1 -1
- package/dist/esm/index.es-f8ebfa98.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/nylas-booked-event-card_12.entry.js +3 -3
- package/dist/esm/nylas-booked-event-card_12.entry.js.map +1 -1
- package/dist/esm/nylas-provider.entry.js +2 -2
- package/dist/esm/nylas-provider.entry.js.map +1 -1
- package/dist/esm/nylas-scheduler-editor.entry.js.map +1 -1
- package/dist/esm/nylas-scheduling.entry.js +1 -1
- package/dist/esm/nylas-scheduling.entry.js.map +1 -1
- package/dist/esm/nylas-web-elements.js +1 -1
- package/dist/esm/scheduler-config-store-d6729d8d.js.map +1 -1
- package/dist/esm/{scheduler-store-ef022be9.js → scheduler-store-755ced0b.js} +1 -11
- package/dist/esm/{scheduler-store-ef022be9.js.map → scheduler-store-755ced0b.js.map} +1 -1
- package/dist/nylas-web-elements/nylas-web-elements.esm.js +1 -1
- package/dist/nylas-web-elements/nylas-web-elements.esm.js.map +1 -1
- package/dist/nylas-web-elements/p-14894041.js.map +1 -1
- package/dist/nylas-web-elements/{p-a906d005.entry.js → p-4b48f29a.entry.js} +2 -2
- package/dist/nylas-web-elements/p-4b48f29a.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-68608216.entry.js.map +1 -1
- package/dist/nylas-web-elements/{p-1fb32e0e.entry.js → p-b9727e42.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-1fb32e0e.entry.js.map → p-b9727e42.entry.js.map} +1 -1
- package/dist/nylas-web-elements/p-c372bced.js.map +1 -1
- package/dist/nylas-web-elements/p-d36ad6ef.js +2 -0
- package/dist/nylas-web-elements/p-d36ad6ef.js.map +1 -0
- package/dist/nylas-web-elements/{p-13a6c977.entry.js → p-e4272174.entry.js} +2 -2
- package/dist/nylas-web-elements/p-e4272174.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-f12cd991.entry.js +8 -0
- package/dist/nylas-web-elements/p-f12cd991.entry.js.map +1 -0
- package/dist/types/common/abstract-provider.d.ts +1 -1
- package/dist/types/components/nylas-provider/nylas-provider.d.ts +1 -1
- package/dist/types/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.d.ts +1 -1
- package/dist/types/components/scheduler/nylas-scheduling/nylas-scheduling.d.ts +2 -1
- package/dist/types/components/scheduler-editor/nylas-booking-form-config/nylas-booking-form-config.d.ts +4 -12
- package/dist/types/components.d.ts +10 -10
- package/dist/types/connector/nylas-connector/index.d.ts +6 -6
- package/dist/types/connector/nylas-scheduler-config-connector/index.d.ts +2 -2
- package/dist/types/connector/nylas-scheduler-connector/errors/index.d.ts +2 -1
- package/dist/types/connector/shared/api/scheduler-config.d.ts +2 -2
- package/dist/types/stores/scheduler-config-store.d.ts +1 -1
- package/dist/types/stores/scheduler-store.d.ts +2 -2
- package/dist/types/types/index.d.ts +0 -9
- package/package.json +3 -3
- package/dist/nylas-web-elements/p-13a6c977.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-731a856b.js +0 -2
- package/dist/nylas-web-elements/p-731a856b.js.map +0 -1
- package/dist/nylas-web-elements/p-7b787c73.entry.js +0 -8
- package/dist/nylas-web-elements/p-7b787c73.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-a906d005.entry.js.map +0 -1
|
@@ -120,13 +120,13 @@ const NylasBookedEventCard = proxyCustomElement(class NylasBookedEventCard exten
|
|
|
120
120
|
render() {
|
|
121
121
|
const bookingType = this.configSettings?.booking_type;
|
|
122
122
|
const isManualConfirmation = bookingType && bookingType !== 'booking';
|
|
123
|
-
return (h(Host, { key: '
|
|
123
|
+
return (h(Host, { key: '746e23e82adf30da44ac6a160400705251a5cf98', part: "nbec" }, h("div", { key: 'aa3e79d294ff41b4a43775763f9e5f1922f955c7', class: "nylas-booked-event-card" }, h("div", { key: 'cbb343663633b5ba80875f42af0bb0d091ee1ac8', class: "booked-event-timezone" }, h("globe-icon", { key: '8c94142bd486144efaa251770c87f4ec15481b41' }), TIMEZONE_MAP[this.selectedTimezone]), h("div", { key: 'e06ef2c5b7a1977ff1953027d6109cb8a1acf493', class: "event-card-wrapper", part: "nbec__card" }, h("div", { key: '5a99626d44f6ef819af2606bf24208e1833e3a54', class: "calendar-icon" }, h("calendar-check-icon", { key: '06c5ec0241535ee0ea82c743653f93442bc9a5fa' })), h("div", { key: 'b38fa39209c64394902a0e7607248d0d0c73adf2', class: "booked-event-header" }, h("h2", { key: '1706d065e1f427efcccef18f382702e95da33080', slot: "card-title", part: "nbec__title" }, !!this.rescheduleBookingId && !this.isLoading
|
|
124
124
|
? `${instance.t('bookingRescheduled')}`
|
|
125
125
|
: isManualConfirmation && !this.isLoading
|
|
126
126
|
? `${instance.t('bookingSent')}`
|
|
127
|
-
: `${instance.t('bookingConfirmed')}`, "!"), h("div", { key: '
|
|
127
|
+
: `${instance.t('bookingConfirmed')}`, "!"), h("div", { key: 'c7bfce355ce08d858862bc7672f20e8a2bb3dce9', class: "card-description", part: "nbec__description" }, isManualConfirmation ? instance.t('bookingSentDescription') : h("span", null, instance.t('bookingConfirmedDescription')))), h("div", { key: '2074c51dfdfd0753fcd3d598b7633520bf70ab63', class: "booking-date-time" }, h("checkmark-circle-icon", { key: 'dbfe39fadeeb08186a5214cfb9ca5d3c8da55cb1' }), h("h3", { key: 'edb9ed53cb25e9e06ec7b27f8141fa6f422c1511' }, instance.t('bookingDateAndTimeHeader')), h("p", { key: '24d8d606ab3e217256152e249ee435d070df0c5b' }, this.selectedTimeslot?.start_time
|
|
128
128
|
? capitalizeFirstLetter(formatBookedEventDate(this.selectedTimeslot?.start_time, this.selectedTimezone, LANGUAGE_CODE_TO_LOCALE_MAP[this.selectedLanguage]))
|
|
129
|
-
: '-', ' ', h("br", { key: '
|
|
129
|
+
: '-', ' ', h("br", { key: '5949a97ff7e7b256e410f591b810332a72e0696c' }), this.startTime, " - ", this.endTime)), h("div", { key: '3450618726c762232151511fd28570834cf07cc4', class: "booking-participants" }), !isManualConfirmation && (h("div", { class: "button-container" }, h("div", { class: {
|
|
130
130
|
'footer': true,
|
|
131
131
|
'no-footer': (this.configSettings?.scheduler?.hide_cancellation_options && this.configSettings?.scheduler?.hide_rescheduling_options) ||
|
|
132
132
|
this.configSettings?.booking_type === 'organizer-confirmation',
|
|
@@ -141,7 +141,7 @@ const NylasBookedEventCard = proxyCustomElement(class NylasBookedEventCard exten
|
|
|
141
141
|
}, [1, "nylas-booked-event-card", {
|
|
142
142
|
"eventInfo": [16],
|
|
143
143
|
"rescheduleBookingId": [1, "reschedule-booking-id"],
|
|
144
|
-
"bookingInfo": [
|
|
144
|
+
"bookingInfo": [16],
|
|
145
145
|
"configSettings": [16],
|
|
146
146
|
"isL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,MAAM,CAAC;gBACtC,IAAI,YAAY,KAAK,CAAC,MAAM,IAAI,OAAO,IAAI,MAAM,CAAC,EAAE;oBAClD,YAAY,CAAC,MAAM,CAAC,CAAC;iBACtB;aACF;YACD,0BAA0B,EAAE,OAAO,KAA+C,EAAE,wBAAiD;gBACnI,KAAK,CAAC,yBAAyB,EAAE,4BAA4B,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;aAC9E;YACD,gCAAgC,EAAE,OAAO,KAAiE,EAAE,wBAAiD;gBAC3J,KAAK,CAAC,yBAAyB,EAAE,kCAAkC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;aACpF;SACF;QACD,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;kDAsFD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["i18next"],"sources":["src/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.scss?tag=nylas-booked-event-card&encapsulation=shadow","src/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.tsx"],"sourcesContent":["@import '../../../common/styles/variables.scss';\n\n:host {\n display: block;\n @include default-css-variables;\n}\n\n.nylas-booked-event-card {\n height: inherit;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n align-items: center;\n font-family: var(--nylas-font-family);\n}\n\n.event-card-wrapper {\n display: flex;\n align-items: center;\n flex-direction: column;\n background-color: var(--nylas-base-0);\n color: var(--nylas-base-900);\n border-radius: var(--nylas-border-radius-3x);\n position: relative;\n margin-top: 1rem;\n margin-bottom: 2rem;\n width: 424px;\n\n @media #{$mobile} {\n width: 100%;\n border-radius: 0px;\n }\n\n box-shadow:\n 0px 1px 4px rgba(0, 0, 0, 0.1),\n 0px 3px 6px rgba(0, 0, 0, 0.06);\n}\n\n.calendar-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 3rem;\n height: 3rem;\n border-radius: 50%;\n position: absolute;\n top: -1.25rem;\n left: 50%;\n transform: translateX(-50%);\n background-color: var(--nylas-base-0);\n border: 1px solid var(--nylas-base-200);\n color: var(--nylas-base-700);\n}\n\n.booked-event-header {\n margin: 1.5rem 0;\n overflow-wrap: anywhere;\n display: flex;\n align-items: center;\n flex-direction: column;\n font-size: 16px;\n font-weight: 400;\n border-bottom: 1px solid var(--nylas-base-200);\n width: inherit;\n padding: 0 0 1.5rem;\n\n h2 {\n color: var(--nylas-base-600);\n margin-top: 1.5rem;\n margin-bottom: 0.25rem;\n font-size: 1.125rem;\n font-weight: 600;\n }\n\n .card-description {\n text-align: center;\n }\n}\n\n.booking-date-time,\n.booking-participants {\n padding: 0 1rem;\n margin-top: 1.5rem;\n margin-left: 3rem;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n align-self: flex-start;\n position: relative;\n\n svg {\n color: var(--nylas-base-700);\n position: absolute;\n left: -10px;\n }\n\n .block {\n display: block;\n }\n\n h3 {\n color: var(--nylas-base-600);\n margin: 0;\n font-size: 16px;\n font-weight: 600;\n line-height: 1.25rem;\n text-align: justify;\n margin-bottom: 4px;\n }\n\n p {\n font-size: 16px;\n margin: 0;\n font-weight: 400;\n text-align: justify;\n color: var(--nylas-base-800);\n }\n}\n\n.booking-participants {\n margin-bottom: 1.5rem;\n}\n\n.booked-event-timezone {\n display: flex;\n color: var(--nylas-base-600);\n margin-bottom: 1.5rem;\n gap: 4px;\n margin: 2rem;\n align-items: center;\n align-self: flex-end;\n}\n\n.button-container {\n width: inherit;\n}\n\n.footer {\n padding: 0.5rem;\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 0.5rem;\n box-sizing: border-box;\n background-color: var(--nylas-base-25);\n border-top: 1px solid var(--nylas-base-200);\n width: 100%;\n border-radius: 0 0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x);\n\n &.no-template-cols {\n grid-template-columns: 1fr;\n }\n\n &.no-footer {\n display: none;\n }\n}\n\nsp-divider {\n background-color: var(--nylas-base-200);\n height: 1px;\n}\n\ncalendar-check-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n}\n","import { RegisterComponent } from '@/common/register-component';\nimport { Component, Element, EventEmitter, h, Host, Prop, State, Watch } from '@stencil/core';\nimport { NylasSchedulerBookingData, NylasSchedulerConnector } from '../../..';\nimport { ConfigSettings } from '@/stores/scheduler-store';\nimport { NylasScheduling } from '../nylas-scheduling/nylas-scheduling';\nimport { capitalizeFirstLetter, debug, formatBookedEventDate } from '@/utils/utils';\nimport { LANGUAGE_CODE_TO_LOCALE_MAP, TIMEZONE_MAP } from '@/common/constants';\nimport { NylasEvent } from '@/common/types';\nimport { Event } from '@stencil/core';\nimport { NylasSchedulerErrorResponse, ThemeConfig, Timeslot } from '@nylas/core';\nimport i18next from '@/utils/i18n';\n\n/**\n * The `nylas-booked-event-card` component is a UI component that displays the booked event card.\n *\n * @part nbec - The booked event card host.\n * @part nbec__card - The booked event card.\n * @part nbec__title - The title of the booked event card.\n * @part nbec__description - The description of the booked event card.\n * @part nbec__button-outline - The cancel & reschedule button CTA.\n * @part nbec__cancel-cta - The cancel button CTA.\n * @part nbec__reschedule-cta - The reschedule button CTA.\n */\n@Component({\n tag: 'nylas-booked-event-card',\n styleUrl: 'nylas-booked-event-card.scss',\n shadow: true,\n})\nexport class NylasBookedEventCard {\n /**\n * The host element.\n * Used to manage the host element of the provider.\n */\n @Element() private host!: HTMLNylasBookedEventCardElement;\n\n /**\n * @standalone\n * The booked event.\n */\n @Prop() readonly eventInfo!: NylasEvent;\n\n /**\n * @standalone\n * Booking flow type.\n */\n @Prop() readonly rescheduleBookingId?: string;\n\n /**\n * @standalone\n * The booking info used to book / reschedule the event.\n */\n @Prop() readonly bookingInfo?: NylasSchedulerBookingData;\n\n /**\n * @standalone\n * The config settings for the scheduler.\n */\n @Prop() readonly configSettings?: ConfigSettings;\n\n /**\n * @standalone\n * The loading state prop. Used to display loading state when fetching availability.\n */\n @Prop() readonly isLoading?: boolean;\n\n /**\n * @standalone\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: any;\n\n /**\n * The selected timezone.\n */\n @Prop() readonly selectedTimezone: string = Intl.DateTimeFormat().resolvedOptions().timeZone;\n\n /**\n * The selected timeslot.\n */\n @Prop() readonly selectedTimeslot!: Timeslot;\n\n /**\n * The selected language.\n */\n @Prop({ attribute: 'selected-language' }) readonly selectedLanguage: string = navigator.language;\n /**\n * The 12-hour time format.\n */\n @Prop() hour12?: boolean;\n\n @State() startTime: string = '';\n @State() endTime: string = '';\n\n /**\n * Cancel booking button clicked event.\n */\n @Event() readonly cancelBookingButtonClicked!: EventEmitter<{ bookingId: string }>;\n\n /**\n * Reschedule button clicked event.\n * */\n @Event() readonly rescheduleButtonClicked!: EventEmitter<{ bookingId: string; errorHandler?: (error: NylasSchedulerErrorResponse) => void }>;\n\n /**\n * This event is fired when an error occurs while rescheduling the booking.\n */\n @Event() readonly rescheduleBookedEventError!: EventEmitter<NylasSchedulerErrorResponse>;\n\n /**\n * This event is fired when an error occurs while cancelling the booking.\n */\n @Event() readonly cancelBookedEventValidationError!: EventEmitter<{\n error: {\n title: string;\n message: string;\n };\n }>;\n\n @Watch('themeConfig')\n themeConfigChanged(newThemeConfig: ThemeConfig) {\n this.applyThemeConfig(newThemeConfig);\n }\n\n connectedCallback() {}\n\n disconnectedCallback() {}\n\n async componentWillLoad() {\n debug(`[nylas-booked-event-card] Component will load`);\n }\n\n async componentDidLoad() {\n debug(`[nylas-booked-event-card] Component did load`);\n if (!this.eventInfo) {\n console.warn('[nylas-booked-event-card] \"eventInfo\" prop missing. Please provide the event info to display the event details in the booked event card component.');\n }\n if (!this.bookingInfo) {\n console.warn('[nylas-booked-event-card] \"bookingInfo\" prop missing. Please provide the booking info to display the guest details in the booked event card component.');\n }\n this.applyThemeConfig(this.themeConfig);\n const locale = LANGUAGE_CODE_TO_LOCALE_MAP[this.selectedLanguage || 'en'];\n\n const timeFormat = new Intl.DateTimeFormat(locale, {\n hour: '2-digit',\n minute: '2-digit',\n timeZone: this.selectedTimezone,\n hour12: this.hour12,\n });\n this.startTime = timeFormat.format(this.selectedTimeslot?.start_time as Date);\n this.endTime = timeFormat.format(this.selectedTimeslot?.end_time as Date);\n }\n\n applyThemeConfig(themeConfig?: ThemeConfig) {\n if (themeConfig) {\n for (const [key, value] of Object.entries(themeConfig)) {\n this.host.style.setProperty(`${key}`, value);\n }\n }\n }\n\n private handleCancelBookingButtonClicked = () => {\n const startTime = new Date(this.selectedTimeslot.start_time);\n const minCancellationNotice = this.configSettings?.scheduler?.min_cancellation_notice;\n if (!minCancellationNotice) {\n this.cancelBookingButtonClicked.emit({ bookingId: this.eventInfo.booking_id });\n return;\n }\n const dateTillCancellation = startTime.getTime() - minCancellationNotice * 60 * 1000;\n if (dateTillCancellation < new Date().getTime()) {\n this.cancelBookedEventValidationError.emit({\n error: {\n title: 'Cancellation Error',\n message: `You cannot cancel the booking within ${minCancellationNotice} minutes of the event.`,\n },\n });\n } else {\n this.cancelBookingButtonClicked.emit({ bookingId: this.eventInfo.booking_id });\n }\n };\n\n private handleRescheduleButtonClicked = () => {\n const errorHandler = (error: NylasSchedulerErrorResponse) => {\n this.rescheduleBookedEventError.emit(error);\n };\n this.rescheduleButtonClicked.emit({ bookingId: this.eventInfo.booking_id, errorHandler });\n };\n\n getPaticipantType = (type: string) => {\n switch (type) {\n case 'host':\n return 'Host';\n case 'you':\n return 'You';\n default:\n return '';\n }\n };\n\n @RegisterComponent<NylasBookedEventCard, NylasSchedulerConnector, Exclude<NylasScheduling['stores'], undefined>>({\n name: 'nylas-booked-event-card',\n stateToProps: new Map([\n ['scheduler.bookingInfo', 'bookingInfo'],\n ['scheduler.rescheduleBookingId', 'rescheduleBookingId'],\n ['scheduler.selectedTimezone', 'selectedTimezone'],\n ['scheduler.selectedTimeslot', 'selectedTimeslot'],\n ['scheduler.isLoading', 'isLoading'],\n ['scheduler.selectedLanguage', 'selectedLanguage'],\n ['scheduler.configSettings', 'configSettings'],\n ['scheduler.themeConfig', 'themeConfig'],\n ['scheduler.hour12', 'hour12'],\n ]),\n eventToProps: {\n cancelBookingButtonClicked: async (event: CustomEvent<{ bookingId: string }>, nylasSchedulerConnector: NylasSchedulerConnector) => {\n nylasSchedulerConnector.scheduler.setCancel(event.detail.bookingId);\n },\n rescheduleButtonClicked: async (\n event: CustomEvent<{ bookingId: string; errorHandler?: (error: NylasSchedulerErrorResponse) => void }>,\n nylasSchedulerConnector: NylasSchedulerConnector,\n ) => {\n const result = await nylasSchedulerConnector.scheduler.setReschedule(event.detail.bookingId);\n const { errorHandler } = event.detail;\n if (errorHandler && (!result || 'error' in result)) {\n errorHandler(result);\n }\n },\n rescheduleBookedEventError: async (event: CustomEvent<NylasSchedulerErrorResponse>, _nylasSchedulerConnector: NylasSchedulerConnector) => {\n debug('nylas-booked-event-card', 'rescheduleBookedEventError', event.detail);\n },\n cancelBookedEventValidationError: async (event: CustomEvent<{ error: { title: string; message: string } }>, _nylasSchedulerConnector: NylasSchedulerConnector) => {\n debug('nylas-booked-event-card', 'cancelBookedEventValidationError', event.detail);\n },\n },\n fireRegisterEvent: true,\n })\n render() {\n const bookingType = this.configSettings?.booking_type;\n const isManualConfirmation = bookingType && bookingType !== 'booking';\n\n return (\n <Host part=\"nbec\">\n <div class=\"nylas-booked-event-card\">\n <div class=\"booked-event-timezone\">\n <globe-icon></globe-icon>\n {TIMEZONE_MAP[this.selectedTimezone]}\n </div>\n <div class=\"event-card-wrapper\" part=\"nbec__card\">\n <div class=\"calendar-icon\">\n <calendar-check-icon />\n </div>\n <div class=\"booked-event-header\">\n <h2 slot=\"card-title\" part=\"nbec__title\">\n {!!this.rescheduleBookingId && !this.isLoading\n ? `${i18next.t('bookingRescheduled')}`\n : isManualConfirmation && !this.isLoading\n ? `${i18next.t('bookingSent')}`\n : `${i18next.t('bookingConfirmed')}`}\n !\n </h2>\n <div class=\"card-description\" part=\"nbec__description\">\n {isManualConfirmation ? i18next.t('bookingSentDescription') : <span>{i18next.t('bookingConfirmedDescription')}</span>}\n </div>\n </div>\n <div class=\"booking-date-time\">\n <checkmark-circle-icon></checkmark-circle-icon>\n <h3>{i18next.t('bookingDateAndTimeHeader')}</h3>\n <p>\n {this.selectedTimeslot?.start_time\n ? capitalizeFirstLetter(\n formatBookedEventDate(this.selectedTimeslot?.start_time as Date, this.selectedTimezone, LANGUAGE_CODE_TO_LOCALE_MAP[this.selectedLanguage]),\n )\n : '-'}{' '}\n <br />\n {this.startTime} - {this.endTime}\n </p>\n </div>\n <div class=\"booking-participants\">\n {/* <people-icon></people-icon>\n <h3>All participants</h3>\n {this.eventInfo?.participants && (\n <p>\n {this.eventInfo?.participants?.map((participant: NylasEvent['participants'][0]) => {\n return (\n <span class=\"block\">\n {participant.email} {this.getPaticipantType(participant.type) && `(${this.getPaticipantType(participant.type)})`}\n </span>\n );\n })}\n </p>\n )} */}\n </div>\n\n {!isManualConfirmation && (\n <div class=\"button-container\">\n <div\n class={{\n 'footer': true,\n 'no-footer':\n (this.configSettings?.scheduler?.hide_cancellation_options && this.configSettings?.scheduler?.hide_rescheduling_options) ||\n this.configSettings?.booking_type === 'organizer-confirmation',\n 'no-template-cols': !!this.configSettings?.scheduler?.hide_cancellation_options || !!this.configSettings?.scheduler?.hide_rescheduling_options,\n }}\n >\n {!this.configSettings?.scheduler?.hide_cancellation_options && (\n <button-component variant={'destructive'} onClick={this.handleCancelBookingButtonClicked} part=\"nbec__button-outline nbec__cancel-cta\">\n {`${i18next.t('cancelBookingButton')}`}\n </button-component>\n )}\n {!this.configSettings?.scheduler?.hide_rescheduling_options && (\n <button-component variant={'basic'} onClick={this.handleRescheduleButtonClicked} disabled={this.isLoading} part=\"nbec__button-outline nbec__reschedule-cta\">\n {`${i18next.t('rescheduleBookingButton')}`}\n </button-component>\n )}\n </div>\n </div>\n )}\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"nylas-booked-event-card2.js","mappings":";;;;;;;;;;AAAA,MAAM,uBAAuB,GAAG,msJAAmsJ,CAAC;AACpuJ,mCAAe,uBAAuB;;;;;;;;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C,yBAAyB,EAAE,4BAA4B,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;aAC9E;YACD,gCAAgC,EAAE,OAAO,KAAiE,EAAE,wBAAiD;gBAC3J,KAAK,CAAC,yBAAyB,EAAE,kCAAkC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;aACpF;SACF;QACD,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;kDAsFD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["i18next"],"sources":["src/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.scss?tag=nylas-booked-event-card&encapsulation=shadow","src/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.tsx"],"sourcesContent":["@import '../../../common/styles/variables.scss';\n\n:host {\n display: block;\n @include default-css-variables;\n}\n\n.nylas-booked-event-card {\n height: inherit;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n align-items: center;\n font-family: var(--nylas-font-family);\n}\n\n.event-card-wrapper {\n display: flex;\n align-items: center;\n flex-direction: column;\n background-color: var(--nylas-base-0);\n color: var(--nylas-base-900);\n border-radius: var(--nylas-border-radius-3x);\n position: relative;\n margin-top: 1rem;\n margin-bottom: 2rem;\n width: 424px;\n\n @media #{$mobile} {\n width: 100%;\n border-radius: 0px;\n }\n\n box-shadow:\n 0px 1px 4px rgba(0, 0, 0, 0.1),\n 0px 3px 6px rgba(0, 0, 0, 0.06);\n}\n\n.calendar-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 3rem;\n height: 3rem;\n border-radius: 50%;\n position: absolute;\n top: -1.25rem;\n left: 50%;\n transform: translateX(-50%);\n background-color: var(--nylas-base-0);\n border: 1px solid var(--nylas-base-200);\n color: var(--nylas-base-700);\n}\n\n.booked-event-header {\n margin: 1.5rem 0;\n overflow-wrap: anywhere;\n display: flex;\n align-items: center;\n flex-direction: column;\n font-size: 16px;\n font-weight: 400;\n border-bottom: 1px solid var(--nylas-base-200);\n width: inherit;\n padding: 0 0 1.5rem;\n\n h2 {\n color: var(--nylas-base-600);\n margin-top: 1.5rem;\n margin-bottom: 0.25rem;\n font-size: 1.125rem;\n font-weight: 600;\n }\n\n .card-description {\n text-align: center;\n }\n}\n\n.booking-date-time,\n.booking-participants {\n padding: 0 1rem;\n margin-top: 1.5rem;\n margin-left: 3rem;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n align-self: flex-start;\n position: relative;\n\n svg {\n color: var(--nylas-base-700);\n position: absolute;\n left: -10px;\n }\n\n .block {\n display: block;\n }\n\n h3 {\n color: var(--nylas-base-600);\n margin: 0;\n font-size: 16px;\n font-weight: 600;\n line-height: 1.25rem;\n text-align: justify;\n margin-bottom: 4px;\n }\n\n p {\n font-size: 16px;\n margin: 0;\n font-weight: 400;\n text-align: justify;\n color: var(--nylas-base-800);\n }\n}\n\n.booking-participants {\n margin-bottom: 1.5rem;\n}\n\n.booked-event-timezone {\n display: flex;\n color: var(--nylas-base-600);\n margin-bottom: 1.5rem;\n gap: 4px;\n margin: 2rem;\n align-items: center;\n align-self: flex-end;\n}\n\n.button-container {\n width: inherit;\n}\n\n.footer {\n padding: 0.5rem;\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 0.5rem;\n box-sizing: border-box;\n background-color: var(--nylas-base-25);\n border-top: 1px solid var(--nylas-base-200);\n width: 100%;\n border-radius: 0 0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x);\n\n &.no-template-cols {\n grid-template-columns: 1fr;\n }\n\n &.no-footer {\n display: none;\n }\n}\n\nsp-divider {\n background-color: var(--nylas-base-200);\n height: 1px;\n}\n\ncalendar-check-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n}\n","import { RegisterComponent } from '@/common/register-component';\nimport { Component, Element, EventEmitter, h, Host, Prop, State, Watch } from '@stencil/core';\nimport { NylasSchedulerConnector } from '../../..';\nimport type { NylasSchedulerBookingData } from '@/common/types';\nimport { ConfigSettings } from '@/stores/scheduler-store';\nimport { NylasScheduling } from '../nylas-scheduling/nylas-scheduling';\nimport { capitalizeFirstLetter, debug, formatBookedEventDate } from '@/utils/utils';\nimport { LANGUAGE_CODE_TO_LOCALE_MAP, TIMEZONE_MAP } from '@/common/constants';\nimport { NylasEvent } from '@/common/types';\nimport { Event } from '@stencil/core';\nimport { NylasSchedulerErrorResponse, ThemeConfig, Timeslot } from '@nylas/core';\nimport i18next from '@/utils/i18n';\n\n/**\n * The `nylas-booked-event-card` component is a UI component that displays the booked event card.\n *\n * @part nbec - The booked event card host.\n * @part nbec__card - The booked event card.\n * @part nbec__title - The title of the booked event card.\n * @part nbec__description - The description of the booked event card.\n * @part nbec__button-outline - The cancel & reschedule button CTA.\n * @part nbec__cancel-cta - The cancel button CTA.\n * @part nbec__reschedule-cta - The reschedule button CTA.\n */\n@Component({\n tag: 'nylas-booked-event-card',\n styleUrl: 'nylas-booked-event-card.scss',\n shadow: true,\n})\nexport class NylasBookedEventCard {\n /**\n * The host element.\n * Used to manage the host element of the provider.\n */\n @Element() private host!: HTMLNylasBookedEventCardElement;\n\n /**\n * @standalone\n * The booked event.\n */\n @Prop() readonly eventInfo!: NylasEvent;\n\n /**\n * @standalone\n * Booking flow type.\n */\n @Prop() readonly rescheduleBookingId?: string;\n\n /**\n * @standalone\n * The booking info used to book / reschedule the event.\n */\n @Prop() readonly bookingInfo?: NylasSchedulerBookingData;\n\n /**\n * @standalone\n * The config settings for the scheduler.\n */\n @Prop() readonly configSettings?: ConfigSettings;\n\n /**\n * @standalone\n * The loading state prop. Used to display loading state when fetching availability.\n */\n @Prop() readonly isLoading?: boolean;\n\n /**\n * @standalone\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: any;\n\n /**\n * The selected timezone.\n */\n @Prop() readonly selectedTimezone: string = Intl.DateTimeFormat().resolvedOptions().timeZone;\n\n /**\n * The selected timeslot.\n */\n @Prop() readonly selectedTimeslot!: Timeslot;\n\n /**\n * The selected language.\n */\n @Prop({ attribute: 'selected-language' }) readonly selectedLanguage: string = navigator.language;\n /**\n * The 12-hour time format.\n */\n @Prop() hour12?: boolean;\n\n @State() startTime: string = '';\n @State() endTime: string = '';\n\n /**\n * Cancel booking button clicked event.\n */\n @Event() readonly cancelBookingButtonClicked!: EventEmitter<{ bookingId: string }>;\n\n /**\n * Reschedule button clicked event.\n * */\n @Event() readonly rescheduleButtonClicked!: EventEmitter<{ bookingId: string; errorHandler?: (error: NylasSchedulerErrorResponse) => void }>;\n\n /**\n * This event is fired when an error occurs while rescheduling the booking.\n */\n @Event() readonly rescheduleBookedEventError!: EventEmitter<NylasSchedulerErrorResponse>;\n\n /**\n * This event is fired when an error occurs while cancelling the booking.\n */\n @Event() readonly cancelBookedEventValidationError!: EventEmitter<{\n error: {\n title: string;\n message: string;\n };\n }>;\n\n @Watch('themeConfig')\n themeConfigChanged(newThemeConfig: ThemeConfig) {\n this.applyThemeConfig(newThemeConfig);\n }\n\n connectedCallback() {}\n\n disconnectedCallback() {}\n\n async componentWillLoad() {\n debug(`[nylas-booked-event-card] Component will load`);\n }\n\n async componentDidLoad() {\n debug(`[nylas-booked-event-card] Component did load`);\n if (!this.eventInfo) {\n console.warn('[nylas-booked-event-card] \"eventInfo\" prop missing. Please provide the event info to display the event details in the booked event card component.');\n }\n if (!this.bookingInfo) {\n console.warn('[nylas-booked-event-card] \"bookingInfo\" prop missing. Please provide the booking info to display the guest details in the booked event card component.');\n }\n this.applyThemeConfig(this.themeConfig);\n const locale = LANGUAGE_CODE_TO_LOCALE_MAP[this.selectedLanguage || 'en'];\n\n const timeFormat = new Intl.DateTimeFormat(locale, {\n hour: '2-digit',\n minute: '2-digit',\n timeZone: this.selectedTimezone,\n hour12: this.hour12,\n });\n this.startTime = timeFormat.format(this.selectedTimeslot?.start_time as Date);\n this.endTime = timeFormat.format(this.selectedTimeslot?.end_time as Date);\n }\n\n applyThemeConfig(themeConfig?: ThemeConfig) {\n if (themeConfig) {\n for (const [key, value] of Object.entries(themeConfig)) {\n this.host.style.setProperty(`${key}`, value);\n }\n }\n }\n\n private handleCancelBookingButtonClicked = () => {\n const startTime = new Date(this.selectedTimeslot.start_time);\n const minCancellationNotice = this.configSettings?.scheduler?.min_cancellation_notice;\n if (!minCancellationNotice) {\n this.cancelBookingButtonClicked.emit({ bookingId: this.eventInfo.booking_id });\n return;\n }\n const dateTillCancellation = startTime.getTime() - minCancellationNotice * 60 * 1000;\n if (dateTillCancellation < new Date().getTime()) {\n this.cancelBookedEventValidationError.emit({\n error: {\n title: 'Cancellation Error',\n message: `You cannot cancel the booking within ${minCancellationNotice} minutes of the event.`,\n },\n });\n } else {\n this.cancelBookingButtonClicked.emit({ bookingId: this.eventInfo.booking_id });\n }\n };\n\n private handleRescheduleButtonClicked = () => {\n const errorHandler = (error: NylasSchedulerErrorResponse) => {\n this.rescheduleBookedEventError.emit(error);\n };\n this.rescheduleButtonClicked.emit({ bookingId: this.eventInfo.booking_id, errorHandler });\n };\n\n getPaticipantType = (type: string) => {\n switch (type) {\n case 'host':\n return 'Host';\n case 'you':\n return 'You';\n default:\n return '';\n }\n };\n\n @RegisterComponent<NylasBookedEventCard, NylasSchedulerConnector, Exclude<NylasScheduling['stores'], undefined>>({\n name: 'nylas-booked-event-card',\n stateToProps: new Map([\n ['scheduler.bookingInfo', 'bookingInfo'],\n ['scheduler.rescheduleBookingId', 'rescheduleBookingId'],\n ['scheduler.selectedTimezone', 'selectedTimezone'],\n ['scheduler.selectedTimeslot', 'selectedTimeslot'],\n ['scheduler.isLoading', 'isLoading'],\n ['scheduler.selectedLanguage', 'selectedLanguage'],\n ['scheduler.configSettings', 'configSettings'],\n ['scheduler.themeConfig', 'themeConfig'],\n ['scheduler.hour12', 'hour12'],\n ]),\n eventToProps: {\n cancelBookingButtonClicked: async (event: CustomEvent<{ bookingId: string }>, nylasSchedulerConnector: NylasSchedulerConnector) => {\n nylasSchedulerConnector.scheduler.setCancel(event.detail.bookingId);\n },\n rescheduleButtonClicked: async (\n event: CustomEvent<{ bookingId: string; errorHandler?: (error: NylasSchedulerErrorResponse) => void }>,\n nylasSchedulerConnector: NylasSchedulerConnector,\n ) => {\n const result = await nylasSchedulerConnector.scheduler.setReschedule(event.detail.bookingId);\n const { errorHandler } = event.detail;\n if (errorHandler && (!result || 'error' in result)) {\n errorHandler(result);\n }\n },\n rescheduleBookedEventError: async (event: CustomEvent<NylasSchedulerErrorResponse>, _nylasSchedulerConnector: NylasSchedulerConnector) => {\n debug('nylas-booked-event-card', 'rescheduleBookedEventError', event.detail);\n },\n cancelBookedEventValidationError: async (event: CustomEvent<{ error: { title: string; message: string } }>, _nylasSchedulerConnector: NylasSchedulerConnector) => {\n debug('nylas-booked-event-card', 'cancelBookedEventValidationError', event.detail);\n },\n },\n fireRegisterEvent: true,\n })\n render() {\n const bookingType = this.configSettings?.booking_type;\n const isManualConfirmation = bookingType && bookingType !== 'booking';\n\n return (\n <Host part=\"nbec\">\n <div class=\"nylas-booked-event-card\">\n <div class=\"booked-event-timezone\">\n <globe-icon></globe-icon>\n {TIMEZONE_MAP[this.selectedTimezone]}\n </div>\n <div class=\"event-card-wrapper\" part=\"nbec__card\">\n <div class=\"calendar-icon\">\n <calendar-check-icon />\n </div>\n <div class=\"booked-event-header\">\n <h2 slot=\"card-title\" part=\"nbec__title\">\n {!!this.rescheduleBookingId && !this.isLoading\n ? `${i18next.t('bookingRescheduled')}`\n : isManualConfirmation && !this.isLoading\n ? `${i18next.t('bookingSent')}`\n : `${i18next.t('bookingConfirmed')}`}\n !\n </h2>\n <div class=\"card-description\" part=\"nbec__description\">\n {isManualConfirmation ? i18next.t('bookingSentDescription') : <span>{i18next.t('bookingConfirmedDescription')}</span>}\n </div>\n </div>\n <div class=\"booking-date-time\">\n <checkmark-circle-icon></checkmark-circle-icon>\n <h3>{i18next.t('bookingDateAndTimeHeader')}</h3>\n <p>\n {this.selectedTimeslot?.start_time\n ? capitalizeFirstLetter(\n formatBookedEventDate(this.selectedTimeslot?.start_time as Date, this.selectedTimezone, LANGUAGE_CODE_TO_LOCALE_MAP[this.selectedLanguage]),\n )\n : '-'}{' '}\n <br />\n {this.startTime} - {this.endTime}\n </p>\n </div>\n <div class=\"booking-participants\">\n {/* <people-icon></people-icon>\n <h3>All participants</h3>\n {this.eventInfo?.participants && (\n <p>\n {this.eventInfo?.participants?.map((participant: NylasEvent['participants'][0]) => {\n return (\n <span class=\"block\">\n {participant.email} {this.getPaticipantType(participant.type) && `(${this.getPaticipantType(participant.type)})`}\n </span>\n );\n })}\n </p>\n )} */}\n </div>\n\n {!isManualConfirmation && (\n <div class=\"button-container\">\n <div\n class={{\n 'footer': true,\n 'no-footer':\n (this.configSettings?.scheduler?.hide_cancellation_options && this.configSettings?.scheduler?.hide_rescheduling_options) ||\n this.configSettings?.booking_type === 'organizer-confirmation',\n 'no-template-cols': !!this.configSettings?.scheduler?.hide_cancellation_options || !!this.configSettings?.scheduler?.hide_rescheduling_options,\n }}\n >\n {!this.configSettings?.scheduler?.hide_cancellation_options && (\n <button-component variant={'destructive'} onClick={this.handleCancelBookingButtonClicked} part=\"nbec__button-outline nbec__cancel-cta\">\n {`${i18next.t('cancelBookingButton')}`}\n </button-component>\n )}\n {!this.configSettings?.scheduler?.hide_rescheduling_options && (\n <button-component variant={'basic'} onClick={this.handleRescheduleButtonClicked} disabled={this.isLoading} part=\"nbec__button-outline nbec__reschedule-cta\">\n {`${i18next.t('rescheduleBookingButton')}`}\n </button-component>\n )}\n </div>\n </div>\n )}\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -2825,14 +2825,16 @@ const NylasBookingFormConfig = proxyCustomElement(class NylasBookingFormConfig e
|
|
|
2825
2825
|
return { ...field };
|
|
2826
2826
|
});
|
|
2827
2827
|
const addFieldsMap = sortedFields.reduce((acc, field) => {
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2828
|
+
if (field.key) {
|
|
2829
|
+
acc[field.key] = {
|
|
2830
|
+
type: field.type,
|
|
2831
|
+
required: field.required,
|
|
2832
|
+
order: field.order,
|
|
2833
|
+
options: field.options,
|
|
2834
|
+
label: field.label,
|
|
2835
|
+
default: field.default,
|
|
2836
|
+
};
|
|
2837
|
+
}
|
|
2836
2838
|
return acc;
|
|
2837
2839
|
}, {});
|
|
2838
2840
|
this.isInternalsAvailable && this.internals.setFormValue(JSON.stringify(addFieldsMap), this.name);
|
|
@@ -2869,7 +2871,9 @@ const NylasBookingFormConfig = proxyCustomElement(class NylasBookingFormConfig e
|
|
|
2869
2871
|
if (name === 'add-field') {
|
|
2870
2872
|
const field = FIELD_TYPES.find(f => f.type === value);
|
|
2871
2873
|
const maxOrder = Math.max(...this.formFields.map(f => f.order));
|
|
2872
|
-
const existingFieldKeys = this.formFields
|
|
2874
|
+
const existingFieldKeys = this.formFields
|
|
2875
|
+
.filter(f => f.type === field.type && f.key !== undefined)
|
|
2876
|
+
.map(f => f.key);
|
|
2873
2877
|
const next = this.findNextMissingNumber(existingFieldKeys);
|
|
2874
2878
|
const newField = { ...field, label: field.label, key: `${field.type}_${field.label.split(' ').join('-')}_${next}`, order: maxOrder + 1 };
|
|
2875
2879
|
this.formFields = [...this.formFields, newField];
|
|
@@ -3003,17 +3007,17 @@ const NylasBookingFormConfig = proxyCustomElement(class NylasBookingFormConfig e
|
|
|
3003
3007
|
this.formFieldsChangedHandler(this.formFields);
|
|
3004
3008
|
}
|
|
3005
3009
|
render() {
|
|
3006
|
-
return (h(Host, { key: '
|
|
3010
|
+
return (h(Host, { key: '979fb00eb59c917ae078bc7485f2e7a771a80253' }, h("div", { key: '3116eff470816482ad76da6fc0b1ecf815d6a0c0', class: "nylas-booking-form-config", part: "nbfc" }, h("div", { key: '6a9ffc262d6b9c69adb7abb4ca6b6cc3740e0faa', class: "header", part: "nbfc__header" }, h("div", { key: 'fc7a5a618a5e6b5cfc8f228eb70a246a42db6e6c', class: "header_text" }, h("h3", { key: 'c115277fa4a00de5bb0290c15618e763391f083c' }, instance.t('nylasBookingFormConfig.headerTitle')), h("p", { key: '5e2dde9a7cd55433bd5578e832993b9eeed0aacc' }, instance.t('nylasBookingFormConfig.headerSubTitle'))), h("div", { key: '0a4308a32e2c06d5010a8eb9865b1d17e9a78b07', class: "header_action" }, h("select-dropdown", { key: '2ed2353ec43bae53973ff9126dcda12315d7c051', name: "add-field", exportparts: "sd_dropdown: nbfc__add_field, sd_dropdown-button: nbfc__add_field-button, sd_dropdown-content: nbfc__add_field-dropdown-content", options: this.fieldTypes, withSearch: false, withChevron: false, dropdownButtonText: instance.t('nylasBookingFormConfig.dropdownButtonText') }, h("span", { key: '3e1bbe733b46cde957fea99873615eed2f5b9a00', slot: "select-icon" }, h("plus-icon", { key: '7d5b7b9d55ead7f14777cf9c1baab7d7b9509ee8', width: "15", height: "15" }))))), h("div", { key: 'fa3b2480584501e345c2b940d0b3f01d4aeb365a', class: "content" }, h("div", { key: 'e009e7c11d3362f3d7c3e798235c7fb8d97fd2bc', class: "additional_fields static_fields", part: "nbfc__static_fields" }, this.staticFields.map((field, i) => {
|
|
3007
3011
|
return (h("div", { class: `form-field draggable ${field.readonly && 'fixed'}`, part: "nbfc__form_field", key: i }, h("div", { class: "form-field_header", part: "nbfc__form_field-header" }, h("span", { class: "dragable" }, h("dragable-icon", { width: "24", height: "25" })), h("div", { class: "form-field_header_text" }, h("h4", null, instance.t(`nylasBookingFormConfig.fieldLabel.${field.fieldLabelKey}`)), h("p", null, field.typeLabel)), h("div", { class: "form-field_header_actions" }, h("span", { class: `is-required` }, field.required ? instance.t('required') : instance.t('optional')), h("span", { class: `chevron ${field.isOpen ? 'open' : 'closed'}`, onClick: () => {
|
|
3008
3012
|
this.fieldToggle(i);
|
|
3009
3013
|
} }, h("chevron-icon", { width: "24", height: "24" })))), h("div", { class: `form-field_content ${!field.isOpen && 'hidden'}`, part: "nbfc__form_field-content" }, h("div", { class: "inputs" }, h("input-component", { class: 'label-input', name: `${i}`, key: i, label: instance.t('nylasBookingFormConfig.label'), required: false, readOnly: field.readonly, defaultValue: field.label }, h("div", { class: "required-input", slot: "additional-input" }, h("input", { type: "checkbox", name: `required_${field.order}`, id: `required_${field.order}`, onClick: () => {
|
|
3010
3014
|
this.fieldRequired(i);
|
|
3011
3015
|
}, checked: field.required, disabled: field.readonly }), h("label", { htmlFor: `required_${field.order}`, "aria-label": "Required" }, instance.t('required'))))))));
|
|
3012
|
-
})), h("div", { key: '
|
|
3016
|
+
})), h("div", { key: '6e3e43cef3f490b42eed34b3ad87c82854dd07c8', id: "fields", class: "additional_fields", part: "nbfc__additional_fields" }, this.formFields?.map((field, i) => {
|
|
3013
3017
|
return (h("div", { class: `form-field draggable ${field?.readonly ? 'fixed' : ''}`, part: "nbfc__form_field", key: field.key }, h("div", { class: "form-field_header", part: "nbfc__form_field-header" }, h("span", { class: "dragable" }, h("dragable-icon", { width: "24", height: "25" })), h("div", { class: "form-field_header_text" }, h("h4", null, instance.t(`nylasBookingFormConfig.fieldLabel.${field.fieldLabelKey}`)), h("p", null, field.typeLabel)), h("div", { class: "form-field_header_actions" }, h("span", { class: `is-required` }, field.required ? instance.t('required') : instance.t('optional')), !field.readonly && (h("button", { onClick: () => {
|
|
3014
3018
|
const title = this.watchFields.title;
|
|
3015
3019
|
const description = this.watchFields.description;
|
|
3016
|
-
if (title && title.includes(field.key)) {
|
|
3020
|
+
if (title && field.key && title.includes(field.key)) {
|
|
3017
3021
|
field.error = instance.t('nylasBookingFormConfig.fieldInTitleError');
|
|
3018
3022
|
this.formFields = [...this.formFields];
|
|
3019
3023
|
this.formFieldsChangedHandler(this.formFields);
|
|
@@ -3024,7 +3028,7 @@ const NylasBookingFormConfig = proxyCustomElement(class NylasBookingFormConfig e
|
|
|
3024
3028
|
}, 3000);
|
|
3025
3029
|
return;
|
|
3026
3030
|
}
|
|
3027
|
-
if (description && description.includes(field.key)) {
|
|
3031
|
+
if (description && field.key && description.includes(field.key)) {
|
|
3028
3032
|
field.error = instance.t('nylasBookingFormConfig.fieldInDescriptionError');
|
|
3029
3033
|
this.formFields = [...this.formFields];
|
|
3030
3034
|
this.formFieldsChangedHandler(this.formFields);
|