@nylas/web-elements 2.3.0 → 2.3.1-canary-20260108155205
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 +1 -1
- package/dist/cdn/nylas-scheduling/nylas-scheduling.es.js +4941 -4925
- package/dist/cjs/google-logo-icon_6.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/nylas-booked-event-card_11.cjs.entry.js +8 -0
- package/dist/cjs/nylas-booked-event-card_11.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-scheduler-editor.cjs.entry.js +1 -1
- package/dist/cjs/nylas-scheduling.cjs.entry.js +16 -3
- package/dist/cjs/nylas-scheduling.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-scheduling.entry.cjs.js.map +1 -1
- package/dist/cjs/nylas-web-elements.cjs.js +1 -1
- package/dist/cjs/{version-DOUE1CF3.js → version-BIKhGgjH.js} +3 -3
- package/dist/cjs/{version-DOUE1CF3.js.map → version-BIKhGgjH.js.map} +1 -1
- package/dist/collection/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.js +10 -0
- package/dist/collection/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.js.map +1 -1
- package/dist/collection/connector/shared/api/scheduler.js +18 -2
- package/dist/collection/connector/shared/api/scheduler.js.map +1 -1
- package/dist/collection/version.js +1 -1
- package/dist/collection/version.js.map +1 -1
- package/dist/components/nylas-editor-tabs-group.js +1 -1
- package/dist/components/nylas-editor-tabs.js +1 -1
- package/dist/components/nylas-scheduler-editor.js +3 -3
- package/dist/components/nylas-scheduling.js +18 -5
- package/dist/components/nylas-scheduling.js.map +1 -1
- package/dist/components/nylas-timeslot-picker.js +1 -1
- package/dist/components/{p-Yb-Jmnhb.js → p-CUriRAxu.js} +3 -3
- package/dist/components/{p-Yb-Jmnhb.js.map → p-CUriRAxu.js.map} +1 -1
- package/dist/components/{p-ne-_OsQh.js → p-D_fU0kvl.js} +11 -2
- package/dist/components/p-D_fU0kvl.js.map +1 -0
- package/dist/components/{p-OF14LJnh.js → p-DkfG_oE2.js} +3 -3
- package/dist/components/{p-OF14LJnh.js.map → p-DkfG_oE2.js.map} +1 -1
- package/dist/components/{p-rnP3lTjZ.js → p-DzM_DEIH.js} +3 -3
- package/dist/components/{p-rnP3lTjZ.js.map → p-DzM_DEIH.js.map} +1 -1
- package/dist/esm/google-logo-icon_6.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/nylas-booked-event-card_11.entry.js +8 -0
- package/dist/esm/nylas-booked-event-card_11.entry.js.map +1 -1
- package/dist/esm/nylas-scheduler-editor.entry.js +1 -1
- package/dist/esm/nylas-scheduling.entry.js +17 -4
- package/dist/esm/nylas-scheduling.entry.js.map +1 -1
- package/dist/esm/nylas-web-elements.js +1 -1
- package/dist/esm/{version-Vj35JRt4.js → version-CXFvcHg5.js} +3 -3
- package/dist/esm/{version-Vj35JRt4.js.map → version-CXFvcHg5.js.map} +1 -1
- package/dist/nylas-web-elements/nylas-scheduling.entry.esm.js.map +1 -1
- package/dist/nylas-web-elements/nylas-web-elements.esm.js +1 -1
- package/dist/nylas-web-elements/{p-2f3336a6.entry.js → p-15e67701.entry.js} +2 -2
- package/dist/nylas-web-elements/p-3a989daf.entry.js +2 -0
- package/dist/nylas-web-elements/p-3a989daf.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-5ae85f94.entry.js → p-544c4297.entry.js} +2 -2
- package/dist/nylas-web-elements/p-544c4297.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-5eb93f5b.entry.js → p-60fb00a8.entry.js} +2 -2
- package/dist/nylas-web-elements/p-CXFvcHg5.js +2 -0
- package/dist/nylas-web-elements/{p-Vj35JRt4.js.map → p-CXFvcHg5.js.map} +1 -1
- package/dist/types/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.d.ts +1 -0
- package/dist/types/connector/shared/api/scheduler.d.ts +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
- package/dist/components/p-ne-_OsQh.js.map +0 -1
- package/dist/nylas-web-elements/p-5ae85f94.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-Vj35JRt4.js +0 -2
- package/dist/nylas-web-elements/p-f32db1ab.entry.js +0 -2
- package/dist/nylas-web-elements/p-f32db1ab.entry.js.map +0 -1
- /package/dist/nylas-web-elements/{p-2f3336a6.entry.js.map → p-15e67701.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-5eb93f5b.entry.js.map → p-60fb00a8.entry.js.map} +0 -0
|
@@ -68,6 +68,13 @@ const NylasTimeslotPicker = proxyCustomElement(class NylasTimeslotPicker extends
|
|
|
68
68
|
this.times = availableTimes || [];
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
+
selectedTimezoneChanged(newTimezone) {
|
|
72
|
+
debug(`[nylas-timeslot-picker] Selected timezone changed`, { newTimezone, selectedDate: this.selectedDate });
|
|
73
|
+
if (this.selectedDate && this.availability) {
|
|
74
|
+
const availableTimes = this.availability?.filter(timeslot => isSameDayTimezone(timeslot.start_time, this.selectedDate, newTimezone)).map(timeslot => timeslot);
|
|
75
|
+
this.times = availableTimes || [];
|
|
76
|
+
}
|
|
77
|
+
}
|
|
71
78
|
themeConfigChanged(newThemeConfig) {
|
|
72
79
|
this.applyThemeConfig(newThemeConfig);
|
|
73
80
|
}
|
|
@@ -162,6 +169,7 @@ const NylasTimeslotPicker = proxyCustomElement(class NylasTimeslotPicker extends
|
|
|
162
169
|
"selectedLanguage": ["selectedLanguageChanged"],
|
|
163
170
|
"selectedDate": ["selectedDateChanged"],
|
|
164
171
|
"availability": ["availabilityChanged"],
|
|
172
|
+
"selectedTimezone": ["selectedTimezoneChanged"],
|
|
165
173
|
"themeConfig": ["themeConfigChanged"]
|
|
166
174
|
}; }
|
|
167
175
|
static get style() { return nylasTimeslotPickerCss; }
|
|
@@ -182,6 +190,7 @@ const NylasTimeslotPicker = proxyCustomElement(class NylasTimeslotPicker extends
|
|
|
182
190
|
"selectedLanguage": ["selectedLanguageChanged"],
|
|
183
191
|
"selectedDate": ["selectedDateChanged"],
|
|
184
192
|
"availability": ["availabilityChanged"],
|
|
193
|
+
"selectedTimezone": ["selectedTimezoneChanged"],
|
|
185
194
|
"themeConfig": ["themeConfigChanged"]
|
|
186
195
|
}]);
|
|
187
196
|
__decorate([
|
|
@@ -256,6 +265,6 @@ function defineCustomElement() {
|
|
|
256
265
|
}
|
|
257
266
|
|
|
258
267
|
export { NylasTimeslotPicker as N, defineCustomElement as d };
|
|
259
|
-
//# sourceMappingURL=p-
|
|
268
|
+
//# sourceMappingURL=p-D_fU0kvl.js.map
|
|
260
269
|
|
|
261
|
-
//# sourceMappingURL=p-
|
|
270
|
+
//# sourceMappingURL=p-D_fU0kvl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"p-D_fU0kvl.js","mappings":";;;;;;;AAAA,MAAM,sBAAsB,GAAG,y5HAAy5H;;;;;;;;;;;;;;;;MC0B36H,mBAAmB,GAAAA,kBAAA,CAAA,MAAA,mBAAA,SAAAC,CAAA,CAAA;AALhC,IAAA,WAAA,GAAA;;;;;;;AAiCqD,QAAA,IAAgB,CAAA,gBAAA,GAAW,IAAI,CAAC,cAAc,EAAE,CAAC,eAAe,EAAE,CAAC,QAAQ;AAI/E,QAAA,IAAA,CAAA,YAAY,GAAU,IAAI,IAAI,EAAE;AAqBtE,QAAA,IAAK,CAAA,KAAA,GAA2B,EAAE;QAsGnC,IAAA,CAAA,uBAAuB,GAAG,OAAO,KAAY,EAAE,QAA8B,KAAI;YACvF,KAAK,CAAC,cAAc,EAAE;AACtB,YAAA,KAAK,CAAC,CAAA,wCAAA,CAA0C,EAAE,QAAQ,CAAC;YAC3D,IAAI,QAAQ,EAAE;AACZ,gBAAA,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAA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;;","names":["__stencil_proxyCustomElement","HTMLElement","i18next"],"sources":["src/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.scss?tag=nylas-timeslot-picker&encapsulation=shadow","src/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.tsx"],"sourcesContent":["@use '../../../common/styles/variables' as *;\n\n:host {\n display: block;\n height: calc(100% - 48px); //48px is the height of the header\n @include default-css-variables;\n}\n\n.time-picker-wrapper {\n display: flex;\n flex-direction: column;\n height: 100%;\n}\n\n.timeslots {\n position: relative;\n display: flex;\n flex-direction: column;\n gap: 0.75rem;\n align-items: center;\n overflow-y: scroll;\n padding: 0.5rem 1.5rem 1.5rem;\n flex: 1;\n}\n\n.time {\n /* Frame 12 */\n box-sizing: border-box;\n\n /* Auto layout */\n\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n padding: 4px 12px;\n gap: 0.5rem;\n font-size: 16px;\n font-weight: 500;\n font-family: inherit;\n\n width: 100%;\n height: 48px;\n\n color: var(--nylas-base-800);\n background: var(--nylas-base-0);\n border: none;\n outline: 1.5px solid var(--nylas-base-200);\n border-radius: var(--nylas-border-radius-2x);\n\n flex: none;\n order: 4;\n align-self: stretch;\n flex-grow: 0;\n\n cursor: pointer;\n\n &:hover,\n &:focus {\n color: var(--nylas-primary);\n outline-color: var(--nylas-primary);\n }\n\n &.selected {\n font-weight: 600;\n color: var(--nylas-primary);\n outline: 2px solid var(--nylas-primary);\n border-color: transparent;\n box-shadow: 0 0 0 2px var(--nylas-primary);\n }\n\n .time-label {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 4px;\n\n span.spots {\n font-size: 14px;\n font-family: var(--nylas-font-family);\n font-weight: 400;\n color: var(--nylas-base-600);\n }\n }\n}\n\n.empty {\n text-align: center;\n padding: 0 1.5rem;\n color: var(--nylas-base-600);\n font-size: min(max(12px, 2vw), 14px);\n height: 450px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n@keyframes pulsate {\n 0% {\n background-color: var(--nylas-base-50);\n }\n\n 50% {\n background-color: var(--nylas-base-100);\n }\n\n 100% {\n background-color: var(--nylas-base-50);\n }\n}\n\n.loading {\n padding: 0 1.5rem;\n\n .timeslot-skeleton {\n width: 100%;\n height: 4rem;\n background-color: var(--nylas-base-50);\n margin-bottom: 0.5rem;\n border-radius: var(--nylas-border-radius-2x);\n animation: pulsate 1.5s infinite ease-in-out;\n }\n}\n\n.footer {\n width: 100%;\n padding: 14px;\n box-sizing: border-box;\n border-top: 1px solid var(--nylas-base-200);\n}","import { RegisterComponent } from '@/common/register-component';\nimport { debug, isSameDayTimezone } from '@/utils/utils';\nimport { Component, Element, Event, EventEmitter, Host, Method, Prop, State, Watch, h } from '@stencil/core';\nimport { NylasSchedulerConnector } from '../../..';\nimport { NylasScheduling } from '../nylas-scheduling/nylas-scheduling';\nimport { AvailabilityTimeslot } from '@/stores/scheduler-store';\nimport type { ThemeConfig, Timeslot } from '@nylas/core';\nimport i18next from '@/utils/i18n';\nimport { LANGUAGE_CODE, LANGUAGE_CODE_TO_LOCALE_MAP } from '@/common/constants';\n\n/**\n * The `nylas-timeslot-picker` component is a UI component that allows users to select a timeslot from a list of available timeslots.\n *\n * @slot timeslot-picker-cta-label - The label for the timeslot picker CTA. Default is \"Next\".\n * @part ntp - The timeslot picker component.\n * @part ntp__timeslot - The timeslot button.\n * @part ntp__timeslot--selected - The selected timeslot button.\n * @part ntp__button-primary - The timeslot picker CTA.\n * @part ntp__time-picker-wrapper - The timeslot picker wrapper.\n * @part ntp__timeslots - The timeslot picker timeslots.\n */\n@Component({\n tag: 'nylas-timeslot-picker',\n styleUrl: 'nylas-timeslot-picker.scss',\n shadow: true,\n})\nexport class NylasTimeslotPicker {\n /**\n * The host element.\n * Used to manage the host element of the provider.\n */\n @Element() private host!: HTMLNylasTimeslotPickerElement;\n /**\n * @standalone\n * The available timeslots.\n */\n @Prop({ attribute: 'availability' }) readonly availability?: AvailabilityTimeslot[];\n /**\n * @standalone\n * The loading state prop. Used to display loading state when fetching availability.\n */\n @Prop({ attribute: 'loading-state' }) readonly isLoading?: boolean;\n /**\n * @standalone\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: any;\n /**\n * The selected timeslot.\n */\n @Prop({ attribute: 'selected-timeslot' }) readonly selectedTimeslot?: Timeslot;\n /**\n * The selected timezone.\n */\n @Prop({ attribute: 'selected-timezone' }) readonly selectedTimezone: string = Intl.DateTimeFormat().resolvedOptions().timeZone;\n /**\n * The selected date.\n */\n @Prop({ attribute: 'selected-date' }) readonly selectedDate?: Date = new Date();\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: string;\n /**\n * The 12-hour time format.\n */\n @Prop() hour12?: boolean;\n\n /**\n * This event is fired when a timeslot is selected.\n */\n @Event() readonly timeslotSelected!: EventEmitter<Timeslot>;\n /**\n * This event is fired when a timeslot is confirmed. By default, this will proceed to the booking form page.\n */\n @Event() readonly timeslotConfirmed!: EventEmitter<{ timeslot: Timeslot; host: HTMLNylasTimeslotPickerElement }>;\n\n @Event() readonly validateTimeslotError!: EventEmitter<{ error: string; type: 'error' | 'info' }>;\n\n @State() times: AvailabilityTimeslot[] = [];\n @State() hoveredTimeslotIndex?: number;\n @State() selectedTimeslotIndex?: string;\n\n @Watch('selectedLanguage')\n selectedLanguageChanged(newLanguage: LANGUAGE_CODE) {\n i18next.changeLanguage(newLanguage);\n }\n\n @Watch('selectedDate')\n selectedDateChanged(newVal: Date | null | undefined) {\n debug(`[nylas-timeslot-picker] Selected date changed`, { newVal });\n\n if (newVal) {\n this.selectedTimeslotIndex = '';\n if (typeof newVal !== 'undefined') {\n const availableTimes = this.availability?.filter(timeslot => isSameDayTimezone(timeslot.start_time, newVal, this.selectedTimezone)).map(timeslot => timeslot);\n this.times = availableTimes || [];\n }\n }\n }\n\n @Watch('availability')\n availabilityChanged(newVal: AvailabilityTimeslot[] | undefined) {\n debug(`[nylas-timeslot-picker] Available times changed`, { newVal, selectedDate: this.selectedDate });\n if (typeof newVal !== 'undefined') {\n const availableTimes = newVal\n ?.filter(timeslot => this.selectedDate && isSameDayTimezone(timeslot.start_time, this.selectedDate, this.selectedTimezone))\n .map(timeslot => timeslot);\n this.times = availableTimes || [];\n }\n }\n\n @Watch('selectedTimezone')\n selectedTimezoneChanged(newTimezone: string) {\n debug(`[nylas-timeslot-picker] Selected timezone changed`, { newTimezone, selectedDate: this.selectedDate });\n // Recalculate times when timezone changes because a timeslot that was on\n // \"January 7th in UTC\" might be on \"January 8th in Tokyo timezone\"\n if (this.selectedDate && this.availability) {\n const availableTimes = this.availability?.filter(timeslot => isSameDayTimezone(timeslot.start_time, this.selectedDate!, newTimezone)).map(timeslot => timeslot);\n this.times = availableTimes || [];\n }\n }\n\n @Watch('themeConfig')\n themeConfigChanged(newThemeConfig: ThemeConfig) {\n this.applyThemeConfig(newThemeConfig);\n }\n\n connectedCallback() {\n // Use queueMicrotask to defer theme application until after React has set props.\n // This fixes the timing issue where connectedCallback fires before React sets themeConfig.\n queueMicrotask(() => {\n if (this.themeConfig) {\n this.applyThemeConfig(this.themeConfig);\n this.host.setAttribute('data-themed', '');\n }\n });\n }\n\n disconnectedCallback() {}\n\n async componentWillLoad() {\n debug(`[nylas-timeslot-picker] Component will load`, { selectedDate: this.selectedDate, availability: this.availability, times: this.times });\n }\n\n async componentDidLoad() {\n debug(`[nylas-timeslot-picker] Component did load`);\n const availableTimes = this.availability\n ?.filter(timeslot => this.selectedDate && isSameDayTimezone(timeslot.start_time, this.selectedDate, this.selectedTimezone))\n .map(timeslot => timeslot);\n this.times = availableTimes || [];\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 getTimeslotId(timeslot: Timeslot, index: number) {\n const date = new Date(timeslot.start_time);\n const eventId = timeslot.event_id;\n return `${date.toLocaleDateString()}-${index}${eventId ? `-${eventId}` : ''}`;\n }\n\n private onClickSelectTime(timeslot: Timeslot, index: number) {\n debug(`[nylas-timeslot-picker] Time selected`, timeslot, index);\n this.selectedTimeslotIndex = this.getTimeslotId(timeslot, index);\n this.timeslotSelected.emit({\n start_time: timeslot.start_time,\n end_time: timeslot.end_time,\n emails: timeslot.emails,\n capacity: timeslot?.capacity,\n event_id: timeslot?.event_id,\n master_id: timeslot?.master_id,\n calendar_id: timeslot?.calendar_id,\n });\n }\n\n private handleConfirmedTimeslot = async (event: Event, timeslot: Timeslot | undefined) => {\n event.preventDefault();\n debug(`[nylas-timeslot-picker] Confirm timeslot`, timeslot);\n if (timeslot) {\n this.timeslotConfirmed.emit({ timeslot, host: this.host });\n }\n };\n\n @Method()\n async emitValidateTimeslotError(error: string, type: 'error' | 'info') {\n this.validateTimeslotError.emit({ error, type });\n }\n\n private handleMouseEnter = (index: number) => {\n this.hoveredTimeslotIndex = index;\n };\n\n private handleMouseLeave = () => {\n this.hoveredTimeslotIndex = -1;\n };\n\n private getTimeSlotLabel(timeslot: Timeslot) {\n const locale = LANGUAGE_CODE_TO_LOCALE_MAP[this.selectedLanguage || 'en'];\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 return `${timeFormat.format(timeslot.start_time)} - ${timeFormat.format(timeslot.end_time)}`;\n }\n\n @RegisterComponent<NylasTimeslotPicker, NylasSchedulerConnector, Exclude<NylasScheduling['stores'], undefined>>({\n name: 'nylas-timeslot-picker',\n stateToProps: new Map([\n ['scheduler.selectedDate', 'selectedDate'],\n ['scheduler.availability', 'availability'],\n ['scheduler.selectedTimeslot', 'selectedTimeslot'],\n ['scheduler.selectedTimezone', 'selectedTimezone'],\n ['scheduler.selectedLanguage', 'selectedLanguage'],\n ['scheduler.isLoading', 'isLoading'],\n ['scheduler.themeConfig', 'themeConfig'],\n ['scheduler.hour12', 'hour12'],\n ]),\n eventToProps: {\n timeslotSelected: async (event: CustomEvent<Timeslot>, nylasSchedulerConnector: NylasSchedulerConnector) => {\n debug('nylas-timeslot-picker', 'timeslotSelected', event.detail);\n nylasSchedulerConnector.scheduler.selectTime(event.detail);\n },\n timeslotConfirmed: async (event: CustomEvent<{ timeslot: Timeslot; host: HTMLNylasTimeslotPickerElement }>, nylasSchedulerConnector: NylasSchedulerConnector) => {\n debug('nylas-timeslot-picker', 'timeslotConfirmed', event.detail);\n const { timeslot, host } = event.detail;\n if (timeslot && timeslot?.event_id && timeslot?.capacity) {\n const result = await nylasSchedulerConnector.scheduler.validateGroupEventTimeslot(timeslot);\n if (result && 'error' in result) {\n const errorMessage = result.error?.message || 'An error occurred while validating the timeslot';\n if (errorMessage === 'Event is full') {\n host.emitValidateTimeslotError(errorMessage, 'info');\n } else {\n host.emitValidateTimeslotError(errorMessage, 'error');\n }\n }\n } else {\n nylasSchedulerConnector.scheduler.toggleAdditionalData(true);\n }\n },\n validateTimeslotError: async (event: CustomEvent<{ error: string }>, _nylasSchedulerConnector: NylasSchedulerConnector) => {\n debug('nylas-timeslot-picker', 'validateTimeslotError', event.detail);\n },\n },\n fireRegisterEvent: true,\n })\n render() {\n const locale = LANGUAGE_CODE_TO_LOCALE_MAP[this.selectedLanguage || 'en'];\n if (this.isLoading) {\n return (\n <Host>\n <div class={'loading'}>\n {new Array(6).fill(0).map((_, i) => (\n <div class={'timeslot-skeleton'} style={{ animationDelay: `${i * 20}ms` }} />\n ))}\n </div>\n </Host>\n );\n }\n\n if (this.availability && this.availability.length === 0) {\n return (\n <Host>\n <div class={'empty'}>\n <span>No dates available</span>\n </div>\n </Host>\n );\n }\n\n const filteredTimes = this.times.filter(timeslot => {\n const groupEvent = timeslot?.event_id || timeslot?.master_id;\n const showCapacity = typeof timeslot?.capacity === 'number' && timeslot?.capacity > 0;\n return !(groupEvent && !showCapacity);\n });\n\n if ((!this.times || this.times.length === 0 || filteredTimes.length === 0) && !!this.selectedDate) {\n return (\n <Host>\n <div class={'empty'}>\n <span>No time slots available for selected date</span>\n </div>\n </Host>\n );\n }\n\n if (!this.selectedDate) return <Host></Host>;\n\n return (\n <Host part=\"ntp\">\n <div class={'time-picker-wrapper'} part=\"ntp__time-picker-wrapper\">\n <div class={'timeslots'} part=\"ntp__timeslots\">\n {filteredTimes.map((timeslot, index) => {\n const showCapacity = typeof timeslot?.capacity === 'number' && timeslot?.capacity > 0;\n const isSelected = this.selectedTimeslotIndex == this.getTimeslotId(timeslot, index);\n return (\n <button\n part={`ntp__timeslot ${this.selectedTimeslot?.start_time?.getTime() === timeslot.start_time.getTime() ? 'ntp__timeslot--selected' : ''}`}\n class={{\n time: true,\n selected: typeof this.selectedTimeslot !== 'undefined' && isSelected,\n }}\n onClick={() => this.onClickSelectTime(timeslot, index)}\n onMouseEnter={() => this.handleMouseEnter(index)}\n onMouseLeave={() => this.handleMouseLeave()}\n >\n <div class=\"time-label\" part=\"ntp__time-label\">\n {this.hoveredTimeslotIndex == index || isSelected\n ? this.getTimeSlotLabel(timeslot)\n : timeslot.start_time.toLocaleTimeString(locale, { hour: '2-digit', minute: '2-digit', timeZone: this.selectedTimezone, hour12: this.hour12 })}\n <span class=\"spots\">{showCapacity ? i18next.t('spotsLeft', { count: timeslot?.capacity }) : null}</span>\n </div>\n </button>\n );\n })}\n </div>\n {this.selectedTimeslot && (\n <div class={'footer'}>\n <button-component variant={'primary'} onClick={(event: Event) => this.handleConfirmedTimeslot(event, this.selectedTimeslot)} part=\"ntp__button-primary\">\n <slot name=\"timeslot-picker-cta-label\">{i18next.t('nextButton')}</slot>\n </button-component>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -3,7 +3,7 @@ import { R as RegisterComponent } from './p-_xBp5cfI.js';
|
|
|
3
3
|
import { a as debug, b as instance, E as mergeDeep, F as parsePreviewLink } from './p-dEI4mtiM.js';
|
|
4
4
|
import { E as ErrorCategory, u } from './p-C1VNIgoH.js';
|
|
5
5
|
import { D as DEFAULT_OPEN_HOURS, e as editorTabComponentNames, C as CONFIGURATION_EVENT_TYPE } from './p-DUCeQ1R4.js';
|
|
6
|
-
import { i as isInitialized, a as init, c as captureMessage, b as captureFeedback, v as version, f as feedbackSyncIntegration } from './p-
|
|
6
|
+
import { i as isInitialized, a as init, c as captureMessage, b as captureFeedback, v as version, f as feedbackSyncIntegration } from './p-CUriRAxu.js';
|
|
7
7
|
import { d as defineCustomElement$1o } from './p-Ha2t2y12.js';
|
|
8
8
|
import { d as defineCustomElement$1n } from './p-Dvm3cFRX.js';
|
|
9
9
|
import { d as defineCustomElement$1m } from './p-CSGxrebs.js';
|
|
@@ -1423,6 +1423,6 @@ function defineCustomElement() {
|
|
|
1423
1423
|
}
|
|
1424
1424
|
|
|
1425
1425
|
export { NylasEditorTabs as N, defineCustomElement as d };
|
|
1426
|
-
//# sourceMappingURL=p-
|
|
1426
|
+
//# sourceMappingURL=p-DkfG_oE2.js.map
|
|
1427
1427
|
|
|
1428
|
-
//# sourceMappingURL=p-
|
|
1428
|
+
//# sourceMappingURL=p-DkfG_oE2.js.map
|