@nylas/web-elements 0.0.0-canary-20251007200552 → 0.0.0-canary-20251008142712
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 +1571 -1480
- package/dist/cdn/nylas-scheduling/nylas-scheduling.es.js +100 -9
- package/dist/cjs/calendar-agenda-fill-icon_38.cjs.entry.js +1 -1
- package/dist/cjs/calendar-agenda-fill-icon_38.cjs.entry.js.map +1 -1
- package/dist/cjs/info-icon.tooltip-component.entry.cjs.js.map +1 -1
- package/dist/cjs/info-icon_2.cjs.entry.js +151 -6
- package/dist/cjs/info-icon_2.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/nylas-web-elements.cjs.js +1 -1
- package/dist/collection/components/design-system/tooltip-component/toolitp-component.js +181 -8
- package/dist/collection/components/design-system/tooltip-component/toolitp-component.js.map +1 -1
- package/dist/collection/components/design-system/tooltip-component/tooltip-component.css +64 -52
- package/dist/collection/components/scheduler-editor/nylas-specific-time-availability-picker/nylas-specific-time-availability-picker.css +4 -1
- package/dist/components/nylas-additional-participants.js +1 -1
- package/dist/components/nylas-availability-picker.js +1 -1
- package/dist/components/nylas-booking-calendar-picker.js +1 -1
- package/dist/components/nylas-booking-confirmation-redirect.js +1 -1
- package/dist/components/nylas-booking-confirmation-type.js +1 -1
- package/dist/components/nylas-booking-form.js +1 -1
- package/dist/components/nylas-buffer-time.js +1 -1
- package/dist/components/nylas-cancel-booking-form.js +1 -1
- package/dist/components/nylas-cancellation-policy.js +1 -1
- package/dist/components/nylas-confirmation-email.js +1 -1
- package/dist/components/nylas-connected-calendars.js +1 -1
- package/dist/components/nylas-custom-event-slug.js +1 -1
- package/dist/components/nylas-customize-booking-settings.js +1 -1
- package/dist/components/nylas-disable-emails.js +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-event-calendar.js +1 -1
- package/dist/components/nylas-event-capacity.js +1 -1
- package/dist/components/nylas-event-description.js +1 -1
- package/dist/components/nylas-event-location.js +1 -1
- package/dist/components/nylas-event-title.js +1 -1
- package/dist/components/nylas-feedback-form.js +1 -1
- package/dist/components/nylas-limit-future-bookings.js +1 -1
- package/dist/components/nylas-min-booking-notice.js +1 -1
- package/dist/components/nylas-min-cancellation-notice.js +1 -1
- package/dist/components/nylas-only-specific-time-availability.js +1 -1
- package/dist/components/nylas-page-name.js +1 -1
- package/dist/components/nylas-participant-booking-calendars.js +1 -1
- package/dist/components/nylas-participants-custom-availability.js +1 -1
- package/dist/components/nylas-reminder-emails.js +1 -1
- package/dist/components/nylas-scheduler-editor.js +33 -33
- package/dist/components/nylas-scheduling-method.js +1 -1
- package/dist/components/nylas-scheduling.js +5 -5
- package/dist/components/nylas-specific-time-availability-picker.js +1 -1
- package/dist/components/nylas-timeslot-interval.js +1 -1
- package/dist/components/{p-BqGEzlcQ.js → p-0q9sgr4i.js} +3 -3
- package/dist/components/{p-BqGEzlcQ.js.map → p-0q9sgr4i.js.map} +1 -1
- package/dist/components/{p-CwwJpDaO.js → p-B1psbbaJ.js} +3 -3
- package/dist/components/{p-CwwJpDaO.js.map → p-B1psbbaJ.js.map} +1 -1
- package/dist/components/{p-CbLs5Pk5.js → p-BFJmQasy.js} +4 -4
- package/dist/components/{p-CbLs5Pk5.js.map → p-BFJmQasy.js.map} +1 -1
- package/dist/components/{p-wzGjOUhU.js → p-BNmwL6-W.js} +4 -4
- package/dist/components/{p-wzGjOUhU.js.map → p-BNmwL6-W.js.map} +1 -1
- package/dist/components/{p-B-b3QZAX.js → p-Bfh24JOX.js} +3 -3
- package/dist/components/{p-B-b3QZAX.js.map → p-Bfh24JOX.js.map} +1 -1
- package/dist/components/{p-pjEuYJeR.js → p-Bk42j8OF.js} +3 -3
- package/dist/components/{p-pjEuYJeR.js.map → p-Bk42j8OF.js.map} +1 -1
- package/dist/components/{p-CXG_Ufsz.js → p-BpnsgdmY.js} +3 -3
- package/dist/components/{p-CXG_Ufsz.js.map → p-BpnsgdmY.js.map} +1 -1
- package/dist/components/{p-BbV-LHPC.js → p-BvCN7qQY.js} +3 -3
- package/dist/components/{p-BbV-LHPC.js.map → p-BvCN7qQY.js.map} +1 -1
- package/dist/components/{p-BT4xqZtB.js → p-BzvnGJrN.js} +4 -4
- package/dist/components/p-BzvnGJrN.js.map +1 -0
- package/dist/components/{p-BD1JIBI-.js → p-C20VhZn-.js} +3 -3
- package/dist/components/{p-BD1JIBI-.js.map → p-C20VhZn-.js.map} +1 -1
- package/dist/components/{p-2bXE-Vfv.js → p-C2lhNwAw.js} +3 -3
- package/dist/components/{p-2bXE-Vfv.js.map → p-C2lhNwAw.js.map} +1 -1
- package/dist/components/{p-C_lK5fHn.js → p-CD62_7I9.js} +23 -23
- package/dist/components/{p-C_lK5fHn.js.map → p-CD62_7I9.js.map} +1 -1
- package/dist/components/{p-B6C_M9Jr.js → p-CE9apE9h.js} +31 -31
- package/dist/components/{p-B6C_M9Jr.js.map → p-CE9apE9h.js.map} +1 -1
- package/dist/components/{p-DyYv3p94.js → p-CHxdUdXp.js} +3 -3
- package/dist/components/{p-DyYv3p94.js.map → p-CHxdUdXp.js.map} +1 -1
- package/dist/components/{p-Dj99qyJ3.js → p-CXsByTmW.js} +5 -5
- package/dist/components/{p-Dj99qyJ3.js.map → p-CXsByTmW.js.map} +1 -1
- package/dist/components/p-CelgQqJU.js +192 -0
- package/dist/components/p-CelgQqJU.js.map +1 -0
- package/dist/components/{p-COiHEYHM.js → p-CfSWSyFi.js} +4 -4
- package/dist/components/{p-COiHEYHM.js.map → p-CfSWSyFi.js.map} +1 -1
- package/dist/components/{p-BRLg6H-E.js → p-CfVpiH3G.js} +3 -3
- package/dist/components/{p-BRLg6H-E.js.map → p-CfVpiH3G.js.map} +1 -1
- package/dist/components/{p-Dzb4S0Ql.js → p-CnNHkU1E.js} +8 -8
- package/dist/components/{p-Dzb4S0Ql.js.map → p-CnNHkU1E.js.map} +1 -1
- package/dist/components/{p-Bt1Mbyo5.js → p-Coh5sPoS.js} +3 -3
- package/dist/components/{p-Bt1Mbyo5.js.map → p-Coh5sPoS.js.map} +1 -1
- package/dist/components/{p-DCescN3V.js → p-D3Qd1n_P.js} +3 -3
- package/dist/components/{p-DCescN3V.js.map → p-D3Qd1n_P.js.map} +1 -1
- package/dist/components/{p-BCPPCoYO.js → p-D4UyMIEq.js} +3 -3
- package/dist/components/{p-BCPPCoYO.js.map → p-D4UyMIEq.js.map} +1 -1
- package/dist/components/{p-nPHjU3jr.js → p-D5qrC2lA.js} +3 -3
- package/dist/components/{p-nPHjU3jr.js.map → p-D5qrC2lA.js.map} +1 -1
- package/dist/components/{p-Cffi7D48.js → p-DJajrAgg.js} +3 -3
- package/dist/components/{p-Cffi7D48.js.map → p-DJajrAgg.js.map} +1 -1
- package/dist/components/{p-B6clCy4A.js → p-DQZVOwPH.js} +3 -3
- package/dist/components/{p-B6clCy4A.js.map → p-DQZVOwPH.js.map} +1 -1
- package/dist/components/{p-B0o5xunX.js → p-DhtHRxq1.js} +3 -3
- package/dist/components/{p-B0o5xunX.js.map → p-DhtHRxq1.js.map} +1 -1
- package/dist/components/{p-CSWehFEc.js → p-DlQNeDle.js} +3 -3
- package/dist/components/{p-CSWehFEc.js.map → p-DlQNeDle.js.map} +1 -1
- package/dist/components/{p-CJcp_GoJ.js → p-DosSBspi.js} +3 -3
- package/dist/components/{p-CJcp_GoJ.js.map → p-DosSBspi.js.map} +1 -1
- package/dist/components/{p-jTVu8Py-.js → p-ENcpb5di.js} +4 -4
- package/dist/components/{p-jTVu8Py-.js.map → p-ENcpb5di.js.map} +1 -1
- package/dist/components/{p-BW7q0oI_.js → p-G063shWV.js} +3 -3
- package/dist/components/{p-BW7q0oI_.js.map → p-G063shWV.js.map} +1 -1
- package/dist/components/{p-6cQLqvfv.js → p-_Y7InDst.js} +3 -3
- package/dist/components/{p-6cQLqvfv.js.map → p-_Y7InDst.js.map} +1 -1
- package/dist/components/{p-BELvPT6B.js → p-gi3_0xjc.js} +3 -3
- package/dist/components/{p-BELvPT6B.js.map → p-gi3_0xjc.js.map} +1 -1
- package/dist/components/{p-BFr5rgUi.js → p-kop9MA9K.js} +3 -3
- package/dist/components/{p-BFr5rgUi.js.map → p-kop9MA9K.js.map} +1 -1
- package/dist/components/{p-CLUzc1bh.js → p-lfia5tlH.js} +3 -3
- package/dist/components/{p-CLUzc1bh.js.map → p-lfia5tlH.js.map} +1 -1
- package/dist/components/{p-Dqb4SZcE.js → p-vzH8CS8d.js} +4 -4
- package/dist/components/{p-Dqb4SZcE.js.map → p-vzH8CS8d.js.map} +1 -1
- package/dist/components/textarea-component.js +1 -1
- package/dist/components/tooltip-component.js +1 -1
- package/dist/esm/calendar-agenda-fill-icon_38.entry.js +1 -1
- package/dist/esm/calendar-agenda-fill-icon_38.entry.js.map +1 -1
- package/dist/esm/info-icon.tooltip-component.entry.js.map +1 -1
- package/dist/esm/info-icon_2.entry.js +151 -6
- package/dist/esm/info-icon_2.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/nylas-web-elements.js +1 -1
- package/dist/nylas-web-elements/info-icon.tooltip-component.entry.esm.js.map +1 -1
- package/dist/nylas-web-elements/nylas-web-elements.esm.js +1 -1
- package/dist/nylas-web-elements/p-2890bb11.entry.js +2 -0
- package/dist/nylas-web-elements/p-2890bb11.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-2fcae310.entry.js → p-545e93e8.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-2fcae310.entry.js.map → p-545e93e8.entry.js.map} +1 -1
- package/dist/types/components/design-system/tooltip-component/toolitp-component.d.ts +25 -3
- package/dist/types/components.d.ts +8 -4
- package/package.json +4 -3
- package/dist/components/p-BT4xqZtB.js.map +0 -1
- package/dist/components/p-C6fgjGAL.js +0 -43
- package/dist/components/p-C6fgjGAL.js.map +0 -1
- package/dist/nylas-web-elements/p-4eb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SAAA;AACD,QAAA,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;CA6DD,EAAA,0BAAA,CAAA,SAAA,EAAA,QAAA,EAAA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement","i18next"],"sources":["src/components/scheduler-editor/nylas-booking-calendar-picker/nylas-booking-calendar-picker.scss?tag=nylas-booking-calendar-picker&encapsulation=shadow","src/components/scheduler-editor/nylas-booking-calendar-picker/nylas-booking-calendar-picker.tsx"],"sourcesContent":["@use '../../../common/styles/variables' as *;\n\n:host {\n display: block;\n @include default-css-variables;\n width: inherit;\n}\n\n.nylas-booking-calendar-picker {\n width: inherit;\n display: flex;\n flex-direction: column;\n margin: 1rem;\n border-radius: var(--nylas-border-radius-2x);\n border: 1px solid var(--nylas-base-200);\n\n .header {\n padding: 1rem;\n border-bottom: 1px solid var(--nylas-base-200);\n\n h3 {\n margin: 0;\n font-size: 16px;\n font-weight: 600;\n line-height: 20px;\n color: var(--nylas-base-900);\n text-align: left;\n }\n\n p {\n margin: 0.25rem 0 0 0;\n font-size: 0.875rem;\n font-weight: 400;\n line-height: 20px;\n color: var(--nylas-base-600);\n text-align: left;\n display: flex;\n align-items: center;\n gap: 4px;\n }\n }\n\n .nylas-booking-calendar-picker__loading {\n padding-bottom: 1rem;\n display: flex;\n flex-direction: column;\n gap: 4px;\n\n .label {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n margin: 1rem 1rem 0;\n color: var(--nylas-base-800);\n }\n\n .loading-button {\n margin: 0 1rem;\n padding: 0;\n width: inherit;\n height: 48px;\n color: var(--nylas-base-900);\n font-size: 16px;\n cursor: not-allowed;\n display: flex;\n gap: 0.5rem;\n justify-content: space-between;\n align-items: center;\n background: transparent;\n border: 1px solid var(--nylas-base-200);\n border-radius: var(--nylas-border-radius-2x);\n\n span {\n padding: 0 1rem;\n }\n }\n }\n\n .nylas-booking-calendar-picker__dropdown {\n padding: 1rem;\n display: flex;\n flex-direction: column;\n gap: 4px;\n\n span.label {\n display: flex;\n align-items: center;\n gap: 4px;\n color: var(--nylas-base-800);\n\n tooltip-component {\n display: flex;\n }\n }\n\n select-dropdown::part(sd_dropdown) {\n width: 100%;\n }\n\n select-dropdown::part(sd_dropdown-content) {\n width: 100%;\n max-width: unset;\n }\n\n select-dropdown::part(sd_dropdown-button) {\n width: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n border: 1px solid var(--nylas-base-200);\n border-radius: var(--nylas-border-radius-2x);\n }\n\n select-dropdown::part(sd_dropdown-button-selected-label) {\n max-width: calc(100% - 2rem);\n font-family: var(--nylas-font-family);\n font-size: 16px;\n line-height: 24px;\n }\n }\n}\n","import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug } from '@/utils/utils';\nimport { Calendar, ThemeConfig } from '@nylas/core';\nimport { AttachInternals, Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { User } from '@/common/nylas-api-request';\nimport i18next from '@/utils/i18n';\nimport { LANGUAGE_CODE } from '@/common/constants';\n\n/**\n * The `nylas-booking-calendar-picker` component is a UI component that displays the booking calendar picker.\n * @part nbcp - The booking calendar picker container\n * @part nbcp__header - The header of the booking calendar picker\n * @part nbcp__input-label - The input label of the booking calendar picker\n * @part nbcp__dropdown - The dropdown container\n * @part nbcp__dropdown-button - The dropdown button\n * @part nbcp__dropdown-content - The dropdown content\n */\n@Component({\n tag: 'nylas-booking-calendar-picker',\n styleUrl: 'nylas-booking-calendar-picker.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasBookingCalendarPicker {\n @Element() host!: HTMLNylasCalendarPickerElement;\n /**\n * @standalone\n * The calendars to choose from.\n */\n @Prop() calendars?: Calendar[];\n /**\n * @standalone\n * The current logged in user.\n */\n @Prop() currentUser?: User;\n /**\n * @standalone\n * The list of user's calendars.\n */\n @Prop() currentUserCalendars?: Calendar[];\n /**\n * @standalone\n * The name of the calendar picker.\n */\n @Prop() name: string = 'booking-calendar';\n /**\n * @standalone\n * The default selected calendar.\n */\n @Prop() defaultBookingCalendar: string = '';\n /**\n * The prop to hide the header.\n */\n @Prop() hideHeader: boolean = false;\n /**\n * Prop for express flow when creating a config\n */\n @Prop() expressFlow: boolean = false;\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: LANGUAGE_CODE;\n /**\n * @standalone\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: ThemeConfig;\n\n /**\n * The element internals.\n */\n @AttachInternals() internals!: ElementInternals;\n\n /**\n * The selected calendars.\n */\n @State() selectedCalendar: string = '';\n\n /**\n * This event is fired when the selected booking calendar changes.\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n valueChanged?: (event: CustomEvent<{ value: string; name: string }>) => void;\n }>;\n\n // Lifecycle methods\n connectedCallback() {\n debug('nylas-booking-calendar-picker', 'connectedCallback');\n }\n\n disconnectedCallback() {\n debug('nylas-booking-calendar-picker', 'disconnectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-booking-calendar-picker', 'componentWillLoad');\n // See comment in the @Watch('name') decorator for more information.\n this.host.setAttribute('name', this.name);\n }\n\n componentDidLoad() {\n debug('nylas-booking-calendar-picker', 'componentDidLoad');\n const primaryCalendar = this.calendars?.find(calendar => calendar.is_primary)?.id;\n const firstCalendar = this.calendars?.[0]?.id;\n this.defaultBookingCalendar = this.defaultBookingCalendar || primaryCalendar || firstCalendar || '';\n this.isInternalsAvailable && this.internals.setFormValue(this.defaultBookingCalendar.toString(), this.name);\n this.selectedCalendar = this.defaultBookingCalendar;\n }\n\n componentWillUpdate() {\n debug('nylas-booking-calendar-picker', 'componentWillUpdate');\n }\n\n componentDidUpdate() {\n debug('nylas-booking-calendar-picker', 'componentDidUpdate');\n }\n\n componentWillRender() {\n debug('nylas-booking-calendar-picker', 'componentWillRender');\n }\n\n componentDidRender() {\n debug('nylas-booking-calendar-picker', 'componentDidRender');\n }\n\n get isInternalsAvailable() {\n return this.internals !== undefined && typeof this.internals.setFormValue === 'function';\n }\n\n /**\n * When a name prop is passed, stencil does not automatically set the name attribute on the host element.\n * Since this component is form-associated, the name attribute is required for form submission.\n * This is a workaround to ensure that the name attribute is set on the host element.\n */\n @Watch('name')\n elementNameChangedHandler(newValue: string) {\n debug('nylas-booking-calendar-picker', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('currentUserCalendars')\n currentUserCalendarsChangedHandler(newValue: Calendar[]) {\n debug('nylas-booking-calendar-picker', 'currentUserCalendarsChangedHandler', newValue);\n this.currentUserCalendars = newValue;\n }\n\n @Watch('selectedLanguage')\n selectedLanguageChangedHandler(newVal: LANGUAGE_CODE, oldVal: LANGUAGE_CODE) {\n if (newVal === oldVal) return;\n i18next.changeLanguage(newVal);\n }\n\n @Watch('themeConfig')\n themeConfigChangedHandler(newVal: ThemeConfig, oldVal: ThemeConfig) {\n if (newVal === oldVal) return;\n this.applyThemeConfig(newVal);\n }\n\n @Listen('nylasFormDropdownChanged')\n nylasFormDropdownChangedHandler(event: CustomEvent<{ value: string; name: string }>) {\n debug('nylas-booking-calendar-picker', 'nylasFormDropdownChangedHandler', event.detail);\n // Pass as handler so that if event.defaultPrevented by parent app, this will be skipped.\n this.isInternalsAvailable && this.internals.setValidity({});\n const valueChanged = (event: CustomEvent<{ value: string; name: string }>) => {\n const { value } = event.detail;\n this.selectedCalendar = value;\n this.isInternalsAvailable && this.internals.setFormValue(value.toString(), this.name);\n };\n this.valueChanged.emit({ value: event.detail.value, name: this.name, valueChanged });\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 @RegisterComponent<NylasBookingCalendarPicker, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-booking-calendar-picker',\n stateToProps: new Map([\n ['schedulerConfig.calendars', 'currentUserCalendars'],\n ['schedulerConfig.currentUser', 'currentUser'],\n ['schedulerConfig.selectedLanguage', 'selectedLanguage'],\n ['schedulerConfig.themeConfig', 'themeConfig'],\n ]),\n eventToProps: {\n valueChanged: async (\n event: CustomEvent<{ value: string; name: string; valueChanged?: (event: CustomEvent<{ value: string; name: string }>) => void }>,\n _nylasSchedulerConfigConnector: NylasSchedulerConfigConnector,\n ) => {\n const { valueChanged } = event.detail;\n // If a handler is passed, call it.\n if (valueChanged) {\n valueChanged(event);\n }\n },\n },\n fireRegisterEvent: true,\n })\n render() {\n const currentUserCalendarOptions =\n this.currentUserCalendars?.map(calendar => {\n return {\n value: calendar.id,\n label: calendar.name,\n };\n }) ?? [];\n\n const optionsFromCalendars =\n this.calendars?.map(calendar => {\n return {\n value: calendar.id,\n label: calendar.name,\n };\n }) ?? [];\n const calendarOptions = optionsFromCalendars?.length > 0 ? optionsFromCalendars : currentUserCalendarOptions || [];\n const defaultOption = calendarOptions.find(cal => cal.value == this.defaultBookingCalendar);\n return (\n <Host>\n <div class=\"nylas-booking-calendar-picker\" part=\"nbcp\">\n {!this.hideHeader && (\n <div class=\"header\" part=\"nbcp__header\">\n <h3>{i18next.t('nylasBookingCalendarPicker.headerTitle')}</h3>\n <p>\n {i18next.t('nylasBookingCalendarPicker.headerSubTitle')}\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">{i18next.t('nylasBookingCalendarPicker.tooltip.desc')}</span>\n </tooltip-component>\n </p>\n </div>\n )}\n {calendarOptions.length > 0 ? (\n <div class=\"nylas-booking-calendar-picker__dropdown\">\n <select-dropdown\n name=\"booking-calendar\"\n options={[{ value: '', label: i18next.t('nylasBookingCalendarPicker.selectOptionLabel') }, ...calendarOptions]}\n withSearch={false}\n required={this.expressFlow}\n emptyValue={i18next.t('nylasBookingCalendarPicker.selectOptionLabel')}\n errorMessage={i18next.t('nylasBookingCalendarPicker.selectCalendarErrorMessage')}\n exportparts=\"sd_dropdown: nbcp__dropdown, sd_dropdown-button: nbcp__dropdown-button, sd_dropdown-content: nbcp__dropdown-content\"\n defaultSelectedOption={defaultOption ? defaultOption : null}\n themeConfig={this.themeConfig}\n />\n </div>\n ) : (\n <div class=\"nylas-booking-calendar-picker__loading\">\n <span class=\"label\">\n {i18next.t('nylasBookingCalendarPicker.tooltip.desc')} <info-icon />\n </span>\n <div class=\"loading-button\">\n <span>{i18next.t('loading')}...</span>\n </div>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"p-CHxdUdXp.js","mappings":";;;;;;;;;AAAA,MAAM,6BAA6B,GAAG,srJAAsrJ;;;;;;;;;;;;;;;;MCyB/sJ,0BAA0B,GAAAA,kBAAA,CAAA,MAAA,0BAAA,SAAAC,CAAA,CAAA;AANvC,IAAA,WAAA,GAAA;;;;;;AA2BU,QAAA,IAAI,CAAA,IAAA,GAAW,kBAAkB;AAKjC,QAAA,IAAsB,CAAA,sBAAA,GAAW,EAAE;AAInC,QAAA,IAAU,CAAA,UAAA,GAAY,KAAK;AAI3B,QAAA,IAAW,CAAA,WAAA,GAAY,KAAK;AAmB3B,QAAA,IAAgB,CAAA,gBAAA,GAAW,EAAE;AA4LvC;IAhLC,iBAAiB,GAAA;AACf,QAAA,KAAK,CAAC,+BAA+B,EAAE,mBAAmB,CAAC;;IAG7D,oBAAoB,GAAA;AAClB,QAAA,KAAK,CAAC,+BAA+B,EAAE,sBAAsB,CAAC;;IAGhE,iBAAiB,GAAA;AACf,QAAA,KAAK,CAAC,+BAA+B,EAAE,mBAAmB,CAAC;QAE3D,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC;;IAG3C,gBAAgB,GAAA;AACd,QAAA,KAAK,CAAC,+BAA+B,EA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B,CAAC;YACrD,CAAC,6BAA6B,EAAE,aAAa,CAAC;YAC9C,CAAC,kCAAkC,EAAE,kBAAkB,CAAC;YACxD,CAAC,6BAA6B,EAAE,aAAa,CAAC;SAC/C,CAAC;AACF,QAAA,YAAY,EAAE;AACZ,YAAA,YAAY,EAAE,OACZ,KAAiI,EACjI,8BAA6D,KAC3D;AACF,gBAAA,MAAM,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC,MAAM;gBAErC,IAAI,YAAY,EAAE;oBAChB,YAAY,CAAC,KAAK,CAAC;;aAEtB;AACF,SAAA;AACD,QAAA,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;CA6DD,EAAA,0BAAA,CAAA,SAAA,EAAA,QAAA,EAAA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement","i18next"],"sources":["src/components/scheduler-editor/nylas-booking-calendar-picker/nylas-booking-calendar-picker.scss?tag=nylas-booking-calendar-picker&encapsulation=shadow","src/components/scheduler-editor/nylas-booking-calendar-picker/nylas-booking-calendar-picker.tsx"],"sourcesContent":["@use '../../../common/styles/variables' as *;\n\n:host {\n display: block;\n @include default-css-variables;\n width: inherit;\n}\n\n.nylas-booking-calendar-picker {\n width: inherit;\n display: flex;\n flex-direction: column;\n margin: 1rem;\n border-radius: var(--nylas-border-radius-2x);\n border: 1px solid var(--nylas-base-200);\n\n .header {\n padding: 1rem;\n border-bottom: 1px solid var(--nylas-base-200);\n\n h3 {\n margin: 0;\n font-size: 16px;\n font-weight: 600;\n line-height: 20px;\n color: var(--nylas-base-900);\n text-align: left;\n }\n\n p {\n margin: 0.25rem 0 0 0;\n font-size: 0.875rem;\n font-weight: 400;\n line-height: 20px;\n color: var(--nylas-base-600);\n text-align: left;\n display: flex;\n align-items: center;\n gap: 4px;\n }\n }\n\n .nylas-booking-calendar-picker__loading {\n padding-bottom: 1rem;\n display: flex;\n flex-direction: column;\n gap: 4px;\n\n .label {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n margin: 1rem 1rem 0;\n color: var(--nylas-base-800);\n }\n\n .loading-button {\n margin: 0 1rem;\n padding: 0;\n width: inherit;\n height: 48px;\n color: var(--nylas-base-900);\n font-size: 16px;\n cursor: not-allowed;\n display: flex;\n gap: 0.5rem;\n justify-content: space-between;\n align-items: center;\n background: transparent;\n border: 1px solid var(--nylas-base-200);\n border-radius: var(--nylas-border-radius-2x);\n\n span {\n padding: 0 1rem;\n }\n }\n }\n\n .nylas-booking-calendar-picker__dropdown {\n padding: 1rem;\n display: flex;\n flex-direction: column;\n gap: 4px;\n\n span.label {\n display: flex;\n align-items: center;\n gap: 4px;\n color: var(--nylas-base-800);\n\n tooltip-component {\n display: flex;\n }\n }\n\n select-dropdown::part(sd_dropdown) {\n width: 100%;\n }\n\n select-dropdown::part(sd_dropdown-content) {\n width: 100%;\n max-width: unset;\n }\n\n select-dropdown::part(sd_dropdown-button) {\n width: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n border: 1px solid var(--nylas-base-200);\n border-radius: var(--nylas-border-radius-2x);\n }\n\n select-dropdown::part(sd_dropdown-button-selected-label) {\n max-width: calc(100% - 2rem);\n font-family: var(--nylas-font-family);\n font-size: 16px;\n line-height: 24px;\n }\n }\n}\n","import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug } from '@/utils/utils';\nimport { Calendar, ThemeConfig } from '@nylas/core';\nimport { AttachInternals, Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { User } from '@/common/nylas-api-request';\nimport i18next from '@/utils/i18n';\nimport { LANGUAGE_CODE } from '@/common/constants';\n\n/**\n * The `nylas-booking-calendar-picker` component is a UI component that displays the booking calendar picker.\n * @part nbcp - The booking calendar picker container\n * @part nbcp__header - The header of the booking calendar picker\n * @part nbcp__input-label - The input label of the booking calendar picker\n * @part nbcp__dropdown - The dropdown container\n * @part nbcp__dropdown-button - The dropdown button\n * @part nbcp__dropdown-content - The dropdown content\n */\n@Component({\n tag: 'nylas-booking-calendar-picker',\n styleUrl: 'nylas-booking-calendar-picker.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasBookingCalendarPicker {\n @Element() host!: HTMLNylasCalendarPickerElement;\n /**\n * @standalone\n * The calendars to choose from.\n */\n @Prop() calendars?: Calendar[];\n /**\n * @standalone\n * The current logged in user.\n */\n @Prop() currentUser?: User;\n /**\n * @standalone\n * The list of user's calendars.\n */\n @Prop() currentUserCalendars?: Calendar[];\n /**\n * @standalone\n * The name of the calendar picker.\n */\n @Prop() name: string = 'booking-calendar';\n /**\n * @standalone\n * The default selected calendar.\n */\n @Prop() defaultBookingCalendar: string = '';\n /**\n * The prop to hide the header.\n */\n @Prop() hideHeader: boolean = false;\n /**\n * Prop for express flow when creating a config\n */\n @Prop() expressFlow: boolean = false;\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: LANGUAGE_CODE;\n /**\n * @standalone\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: ThemeConfig;\n\n /**\n * The element internals.\n */\n @AttachInternals() internals!: ElementInternals;\n\n /**\n * The selected calendars.\n */\n @State() selectedCalendar: string = '';\n\n /**\n * This event is fired when the selected booking calendar changes.\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n valueChanged?: (event: CustomEvent<{ value: string; name: string }>) => void;\n }>;\n\n // Lifecycle methods\n connectedCallback() {\n debug('nylas-booking-calendar-picker', 'connectedCallback');\n }\n\n disconnectedCallback() {\n debug('nylas-booking-calendar-picker', 'disconnectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-booking-calendar-picker', 'componentWillLoad');\n // See comment in the @Watch('name') decorator for more information.\n this.host.setAttribute('name', this.name);\n }\n\n componentDidLoad() {\n debug('nylas-booking-calendar-picker', 'componentDidLoad');\n const primaryCalendar = this.calendars?.find(calendar => calendar.is_primary)?.id;\n const firstCalendar = this.calendars?.[0]?.id;\n this.defaultBookingCalendar = this.defaultBookingCalendar || primaryCalendar || firstCalendar || '';\n this.isInternalsAvailable && this.internals.setFormValue(this.defaultBookingCalendar.toString(), this.name);\n this.selectedCalendar = this.defaultBookingCalendar;\n }\n\n componentWillUpdate() {\n debug('nylas-booking-calendar-picker', 'componentWillUpdate');\n }\n\n componentDidUpdate() {\n debug('nylas-booking-calendar-picker', 'componentDidUpdate');\n }\n\n componentWillRender() {\n debug('nylas-booking-calendar-picker', 'componentWillRender');\n }\n\n componentDidRender() {\n debug('nylas-booking-calendar-picker', 'componentDidRender');\n }\n\n get isInternalsAvailable() {\n return this.internals !== undefined && typeof this.internals.setFormValue === 'function';\n }\n\n /**\n * When a name prop is passed, stencil does not automatically set the name attribute on the host element.\n * Since this component is form-associated, the name attribute is required for form submission.\n * This is a workaround to ensure that the name attribute is set on the host element.\n */\n @Watch('name')\n elementNameChangedHandler(newValue: string) {\n debug('nylas-booking-calendar-picker', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('currentUserCalendars')\n currentUserCalendarsChangedHandler(newValue: Calendar[]) {\n debug('nylas-booking-calendar-picker', 'currentUserCalendarsChangedHandler', newValue);\n this.currentUserCalendars = newValue;\n }\n\n @Watch('selectedLanguage')\n selectedLanguageChangedHandler(newVal: LANGUAGE_CODE, oldVal: LANGUAGE_CODE) {\n if (newVal === oldVal) return;\n i18next.changeLanguage(newVal);\n }\n\n @Watch('themeConfig')\n themeConfigChangedHandler(newVal: ThemeConfig, oldVal: ThemeConfig) {\n if (newVal === oldVal) return;\n this.applyThemeConfig(newVal);\n }\n\n @Listen('nylasFormDropdownChanged')\n nylasFormDropdownChangedHandler(event: CustomEvent<{ value: string; name: string }>) {\n debug('nylas-booking-calendar-picker', 'nylasFormDropdownChangedHandler', event.detail);\n // Pass as handler so that if event.defaultPrevented by parent app, this will be skipped.\n this.isInternalsAvailable && this.internals.setValidity({});\n const valueChanged = (event: CustomEvent<{ value: string; name: string }>) => {\n const { value } = event.detail;\n this.selectedCalendar = value;\n this.isInternalsAvailable && this.internals.setFormValue(value.toString(), this.name);\n };\n this.valueChanged.emit({ value: event.detail.value, name: this.name, valueChanged });\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 @RegisterComponent<NylasBookingCalendarPicker, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-booking-calendar-picker',\n stateToProps: new Map([\n ['schedulerConfig.calendars', 'currentUserCalendars'],\n ['schedulerConfig.currentUser', 'currentUser'],\n ['schedulerConfig.selectedLanguage', 'selectedLanguage'],\n ['schedulerConfig.themeConfig', 'themeConfig'],\n ]),\n eventToProps: {\n valueChanged: async (\n event: CustomEvent<{ value: string; name: string; valueChanged?: (event: CustomEvent<{ value: string; name: string }>) => void }>,\n _nylasSchedulerConfigConnector: NylasSchedulerConfigConnector,\n ) => {\n const { valueChanged } = event.detail;\n // If a handler is passed, call it.\n if (valueChanged) {\n valueChanged(event);\n }\n },\n },\n fireRegisterEvent: true,\n })\n render() {\n const currentUserCalendarOptions =\n this.currentUserCalendars?.map(calendar => {\n return {\n value: calendar.id,\n label: calendar.name,\n };\n }) ?? [];\n\n const optionsFromCalendars =\n this.calendars?.map(calendar => {\n return {\n value: calendar.id,\n label: calendar.name,\n };\n }) ?? [];\n const calendarOptions = optionsFromCalendars?.length > 0 ? optionsFromCalendars : currentUserCalendarOptions || [];\n const defaultOption = calendarOptions.find(cal => cal.value == this.defaultBookingCalendar);\n return (\n <Host>\n <div class=\"nylas-booking-calendar-picker\" part=\"nbcp\">\n {!this.hideHeader && (\n <div class=\"header\" part=\"nbcp__header\">\n <h3>{i18next.t('nylasBookingCalendarPicker.headerTitle')}</h3>\n <p>\n {i18next.t('nylasBookingCalendarPicker.headerSubTitle')}\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">{i18next.t('nylasBookingCalendarPicker.tooltip.desc')}</span>\n </tooltip-component>\n </p>\n </div>\n )}\n {calendarOptions.length > 0 ? (\n <div class=\"nylas-booking-calendar-picker__dropdown\">\n <select-dropdown\n name=\"booking-calendar\"\n options={[{ value: '', label: i18next.t('nylasBookingCalendarPicker.selectOptionLabel') }, ...calendarOptions]}\n withSearch={false}\n required={this.expressFlow}\n emptyValue={i18next.t('nylasBookingCalendarPicker.selectOptionLabel')}\n errorMessage={i18next.t('nylasBookingCalendarPicker.selectCalendarErrorMessage')}\n exportparts=\"sd_dropdown: nbcp__dropdown, sd_dropdown-button: nbcp__dropdown-button, sd_dropdown-content: nbcp__dropdown-content\"\n defaultSelectedOption={defaultOption ? defaultOption : null}\n themeConfig={this.themeConfig}\n />\n </div>\n ) : (\n <div class=\"nylas-booking-calendar-picker__loading\">\n <span class=\"label\">\n {i18next.t('nylasBookingCalendarPicker.tooltip.desc')} <info-icon />\n </span>\n <div class=\"loading-button\">\n <span>{i18next.t('loading')}...</span>\n </div>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -10,14 +10,14 @@ import { d as defineCustomElement$c } from './p-_0P0Tp97.js';
|
|
|
10
10
|
import { d as defineCustomElement$b } from './p-CRehZg0N.js';
|
|
11
11
|
import { d as defineCustomElement$a } from './p-7S1M5IE9.js';
|
|
12
12
|
import { d as defineCustomElement$9 } from './p-S2TOEjUD.js';
|
|
13
|
-
import { d as defineCustomElement$8 } from './p-
|
|
13
|
+
import { d as defineCustomElement$8 } from './p-Bk42j8OF.js';
|
|
14
14
|
import { d as defineCustomElement$7 } from './p-CxKoqJ-5.js';
|
|
15
|
-
import { d as defineCustomElement$6 } from './p-
|
|
15
|
+
import { d as defineCustomElement$6 } from './p-BzvnGJrN.js';
|
|
16
16
|
import { d as defineCustomElement$5 } from './p-Cpjsa5iV.js';
|
|
17
17
|
import { d as defineCustomElement$4 } from './p-ClTk9Ttz.js';
|
|
18
18
|
import { d as defineCustomElement$3 } from './p-D7lRYhTx.js';
|
|
19
19
|
import { d as defineCustomElement$2 } from './p-3m3YER4_.js';
|
|
20
|
-
import { d as defineCustomElement$1 } from './p-
|
|
20
|
+
import { d as defineCustomElement$1 } from './p-CelgQqJU.js';
|
|
21
21
|
|
|
22
22
|
const nylasParticipantsCustomAvailabilityCss = ":host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:\"Inter\", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;width:inherit}.nylas-participants-custom-availability{width:inherit;display:flex;flex-direction:column;margin:1rem;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-200)}.nylas-participants-custom-availability .header{padding:1rem}.nylas-participants-custom-availability .header h3{margin:0;font-size:16px;font-weight:600;line-height:20px;color:var(--nylas-base-900);text-align:left}.nylas-participants-custom-availability .header p{margin:0.25rem 0 0 0;font-size:0.875rem;font-weight:400;line-height:20px;color:var(--nylas-base-600);text-align:left}.nylas-participants-custom-availability .content .participant-container{padding-top:8px;border-top:1px solid var(--nylas-base-200);color:var(--nylas-base-900);background-color:var(--nylas-base-25)}.nylas-participants-custom-availability .content .participant-container .participant-title{display:flex;justify-content:space-between;align-items:center;padding:4px 16px 12px}.nylas-participants-custom-availability .content .participant-container .participant-title p{margin:0}.nylas-participants-custom-availability .content .participant-container .participant-title .participant-toggle{display:flex;gap:24px;align-items:center}.nylas-participants-custom-availability .content .participant-container .participant-title .participant-toggle .chevron{display:flex;align-self:center;cursor:pointer}.nylas-participants-custom-availability .content .participant-container .participant-title .participant-toggle .chevron:hover,.nylas-participants-custom-availability .content .participant-container .participant-title .participant-toggle .chevron:active{color:var(--nylas-primary)}.nylas-participants-custom-availability .content .participant-container .participant-title .participant-toggle .chevron.open{transform:rotate(90deg)}.nylas-participants-custom-availability .content .participant-container .participant-title .participant-toggle .chevron.closed{transform:rotate(270deg)}.nylas-participants-custom-availability .content .participant-container .participant-title .participant-toggle .chevron.disabled{cursor:not-allowed;color:var(--nylas-base-300)}.nylas-participants-custom-availability .content .participant-container .participant-title .participant-toggle .chevron.disabled:hover{color:var(--nylas-base-300)}.nylas-participants-custom-availability .content .participant-container nylas-availability-picker::part(nap){margin:0;border:none}.nylas-participants-custom-availability .content .participant-container nylas-specific-time-availability-picker::part(nstap){margin:0;border:none}.nylas-participants-custom-availability .content .participant-container .participant-only-specific-time-container{padding:8px 16px;border-top:1px solid var(--nylas-base-200);background-color:var(--nylas-base-50)}.nylas-participants-custom-availability .content .participant-container .participant-only-specific-time-container .participant-only-specific-time-checkbox label{display:flex;align-items:center;gap:8px;font-size:14px;font-weight:400;color:var(--nylas-base-900);cursor:pointer}.nylas-participants-custom-availability .content .participant-container .participant-only-specific-time-container .participant-only-specific-time-checkbox label input[type=checkbox]{width:16px;height:16px;cursor:pointer;accent-color:var(--nylas-primary)}.nylas-participants-custom-availability .content .participant-container .participant-only-specific-time-container .participant-only-specific-time-checkbox label span{flex:1}.nylas-participants-custom-availability .content .participant-container .participant-only-specific-time-container .participant-only-specific-time-checkbox label tooltip-component{display:flex;align-items:center}.nylas-participants-custom-availability .content .participant-tabs{justify-content:space-between;display:grid;grid-template-columns:1fr 1fr;gap:16px;padding:8px 16px;border-top:1px solid var(--nylas-base-200)}.nylas-participants-custom-availability .content .participant-tabs.single-tab{grid-template-columns:1fr}.nylas-participants-custom-availability .content .participant-tab{cursor:pointer;padding:8px 16px;border-radius:var(--nylas-border-radius-2x);background-color:var(--nylas-base-100);text-align:center;font-size:14px;font-weight:500;line-height:20px;color:var(--nylas-base-600)}.nylas-participants-custom-availability .content .participant-tab.active{background-color:var(--nylas-primary);color:var(--nylas-base-100)}";
|
|
23
23
|
|
|
@@ -389,6 +389,6 @@ function defineCustomElement() {
|
|
|
389
389
|
}
|
|
390
390
|
|
|
391
391
|
export { NylasParticipantsCustomAvailability as N, defineCustomElement as d };
|
|
392
|
-
//# sourceMappingURL=p-
|
|
392
|
+
//# sourceMappingURL=p-CXsByTmW.js.map
|
|
393
393
|
|
|
394
|
-
//# sourceMappingURL=p-
|
|
394
|
+
//# sourceMappingURL=p-CXsByTmW.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-Dj99qyJ3.js","mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,sCAAsC,GAAG,o/MAAo/M;;;;;;;;;;;;;;;;MC6BthN,mCAAmC,GAAAA,kBAAA,CAAA,MAAA,mCAAA,SAAAC,CAAA,CAAA;AANhD,IAAA,WAAA,GAAA;;;;;;AAmBU,QAAA,IAAI,CAAA,IAAA,GAAW,iCAAiC;QAMhD,IAAY,CAAA,YAAA,GAAkB,IAAI,CAAC,qBAAqB,EAAE,YAAY,IAAI,EAAE;QA4B3E,IAAoB,CAAA,oBAAA,GAYzB,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC;AAoW5C;AAhWC,IAAA,yBAAyB,CAAC,QAAgB,EAAA;AACxC,QAAA,KAAK,CAAC,wCAAwC,EAAE,2BAA2B,EAAE,QAAQ,CAAC;QACtF,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC;;IAI1C,0BAA0B,CAAC,QAAuB,EAAE,QAAuB,EAAA;QACzE,KAAK,CAAC,wCAAwC,EAAE,4BAA4B,EAAE,QAAQ,EAAE,QAAQ,CAAC;QACjG,IAAI,CAAC,QAAQ,IAAI,CAAC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AChB,QAAA,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;CAqHD,EAAA,mCAAA,CAAA,SAAA,EAAA,QAAA,EAAA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement","i18next"],"sources":["src/components/scheduler-editor/nylas-participants-custom-availability/nylas-participants-custom-availability.scss?tag=nylas-participants-custom-availability&encapsulation=shadow","src/components/scheduler-editor/nylas-participants-custom-availability/nylas-participants-custom-availability.tsx"],"sourcesContent":["@use '../../../common/styles/variables' as *;\n\n:host {\n display: block;\n @include default-css-variables;\n width: inherit;\n}\n\n.nylas-participants-custom-availability {\n width: inherit;\n display: flex;\n flex-direction: column;\n margin: 1rem;\n border-radius: var(--nylas-border-radius-2x);\n border: 1px solid var(--nylas-base-200);\n .header {\n padding: 1rem;\n h3 {\n margin: 0;\n font-size: 16px;\n font-weight: 600;\n line-height: 20px;\n color: var(--nylas-base-900);\n text-align: left;\n }\n p {\n margin: 0.25rem 0 0 0;\n font-size: 0.875rem;\n font-weight: 400;\n line-height: 20px;\n color: var(--nylas-base-600);\n text-align: left;\n }\n }\n .content {\n .participant-container {\n padding-top: 8px;\n border-top: 1px solid var(--nylas-base-200);\n color: var(--nylas-base-900);\n background-color: var(--nylas-base-25);\n\n .participant-title {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 4px 16px 12px;\n p {\n margin: 0;\n }\n .participant-toggle {\n display: flex;\n gap: 24px;\n align-items: center;\n .chevron {\n display: flex;\n align-self: center;\n cursor: pointer;\n\n &:hover,\n &:active {\n color: var(--nylas-primary);\n }\n\n &.open {\n transform: rotate(90deg);\n }\n\n &.closed {\n transform: rotate(270deg);\n }\n\n &.disabled {\n cursor: not-allowed;\n color: var(--nylas-base-300);\n &:hover {\n color: var(--nylas-base-300);\n }\n }\n }\n }\n }\n nylas-availability-picker::part(nap) {\n margin: 0;\n border: none;\n }\n nylas-specific-time-availability-picker::part(nstap) {\n margin: 0;\n border: none;\n }\n .participant-only-specific-time-container {\n padding: 8px 16px;\n border-top: 1px solid var(--nylas-base-200);\n background-color: var(--nylas-base-50);\n\n .participant-only-specific-time-checkbox {\n label {\n display: flex;\n align-items: center;\n gap: 8px;\n font-size: 14px;\n font-weight: 400;\n color: var(--nylas-base-900);\n cursor: pointer;\n\n input[type='checkbox'] {\n width: 16px;\n height: 16px;\n cursor: pointer;\n accent-color: var(--nylas-primary);\n }\n\n span {\n flex: 1;\n }\n\n tooltip-component {\n display: flex;\n align-items: center;\n }\n }\n }\n }\n }\n .participant-tabs {\n justify-content: space-between;\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 16px;\n padding: 8px 16px;\n border-top: 1px solid var(--nylas-base-200);\n\n &.single-tab {\n grid-template-columns: 1fr;\n }\n }\n .participant-tab {\n cursor: pointer;\n padding: 8px 16px;\n border-radius: var(--nylas-border-radius-2x);\n background-color: var(--nylas-base-100);\n text-align: center;\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n color: var(--nylas-base-600);\n &.active {\n background-color: var(--nylas-primary);\n color: var(--nylas-base-100);\n }\n }\n }\n}\n","import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug } from '@/utils/utils';\nimport { AttachInternals, Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { Configuration, OpenHours, Participant, ParticipantAvailability, SpecificTimeAvailability, ThemeConfig } from '@nylas/core';\nimport { DEFAULT_OPEN_HOURS } from '@/common/constants';\nimport i18next from '@/utils/i18n';\nimport { LANGUAGE_CODE } from '@/common/constants';\n\n/**\n * The `nylas-participants-custom-availability` component is a form input for setting custom availability for participants.\n *\n * @part npca - The participants custom availability container\n * @part npca__header - The header of the participants custom availability\n * @part npca__content - The content of the participants custom availability\n * @part npca__participant-container - The participant container\n * @part npca__participant-title - The title of the participant\n * @part npca__participant-toggle--container - The toggle container for the participant\n * @part npca__toggle-label - The label of the toggle\n * @part npca_toggle-input - The input of the toggle\n * @part npca_toggle-slider - The slider of the toggle\n */\n@Component({\n tag: 'nylas-participants-custom-availability',\n styleUrl: 'nylas-participants-custom-availability.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasParticipantsCustomAvailability {\n @Element() host!: HTMLNylasParticipantsCustomAvailabilityElement;\n private participantFormRef!: HTMLFormElement;\n /**\n * @standalone\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n\n /**\n * @standalone\n * The name of the participants custom availability.\n */\n @Prop() name: string = 'participant-custom-availability';\n\n /**\n * @standalone\n * The participants selected in the add participants section.\n */\n @Prop() participants: Participant[] = this.selectedConfiguration?.participants || [];\n\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: LANGUAGE_CODE;\n\n /**\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: ThemeConfig;\n\n /**\n * This event is fired when the participants custom availability changes.\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n }>;\n\n /**\n * The element internals.\n */\n @AttachInternals() internals!: ElementInternals;\n\n /**\n * The state to store the custom availability setting for participants.\n */\n @State() selectedParticipants: {\n [key: string]: {\n setCustom: boolean;\n tab: 'availability' | 'specific-time-availability';\n isOpen: boolean;\n openHours: OpenHours[];\n specificTimesAvailability: SpecificTimeAvailability[];\n name: string;\n availability?: ParticipantAvailability;\n timezone?: string;\n onlySpecificTimeAvailability?: boolean;\n };\n } = this.setParticipants(this.participants);\n\n // Watchers\n @Watch('name')\n elementNameChangedHandler(newValue: string) {\n debug('nylas-participants-custom-availability', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('participants')\n participantsChangedHandler(newValue: Participant[], oldValue: Participant[]) {\n debug('nylas-participants-custom-availability', 'participantsChangedHandler', newValue, oldValue);\n if (!newValue || !oldValue || JSON.stringify(newValue) === JSON.stringify(oldValue)) {\n return;\n }\n this.selectedParticipants = this.setParticipants(newValue);\n }\n\n @Watch('selectedConfiguration')\n selectedConfigurationChangedHandler(newValue: Configuration, oldValue: Configuration) {\n debug('nylas-participants-custom-availability', 'selectedConfigurationChangedHandler', newValue, oldValue);\n if (!newValue || !oldValue || JSON.stringify(newValue) === JSON.stringify(oldValue)) {\n return;\n }\n if (newValue?.participants) {\n this.selectedParticipants = this.setParticipants(newValue?.participants);\n }\n }\n\n @Watch('selectedLanguage')\n selectedLanguageChangedHandler(newVal: LANGUAGE_CODE, oldVal: LANGUAGE_CODE) {\n if (newVal === oldVal) return;\n i18next.changeLanguage(newVal);\n }\n\n @Watch('themeConfig')\n themeConfigChangedHandler(newVal: ThemeConfig, oldVal: ThemeConfig) {\n if (newVal === oldVal) return;\n this.applyThemeConfig(newVal);\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 // Lifecycle Methods\n connectedCallback() {\n debug('nylas-participants-custom-availability', 'connectedCallback');\n }\n\n disconnectedCallback() {\n debug('nylas-participants-custom-availability', 'disconnectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-participants-custom-availability', 'componentWillLoad');\n }\n\n componentDidLoad() {\n debug('nylas-participants-custom-availability', 'componentDidLoad');\n if (this.selectedConfiguration) {\n this.selectedParticipants = this.setParticipants(this.selectedConfiguration?.participants);\n } else {\n this.selectedParticipants = this.setParticipants(this.participants);\n }\n }\n\n // Event Handlers\n @Listen('nylasFormSwitchToggled')\n nylasFormSwitchToggledHandler(event: CustomEvent<{ checked: boolean; name: string; label: boolean }>) {\n debug('nylas-participants-custom-availability', 'nylasFormSwitchToggledHandler', event.detail);\n\n // Check if this is a toggle for \"only specific time availability\"\n if (event.detail.name.startsWith('only-specific-time-')) {\n const participantEmail = event.detail.name.replace('only-specific-time-', '');\n if (this.selectedParticipants[participantEmail]) {\n this.selectedParticipants[participantEmail]['onlySpecificTimeAvailability'] = event.detail.checked;\n // When enabling only specific time, switch to specific time tab\n if (event.detail.checked) {\n this.selectedParticipants[participantEmail]['tab'] = 'specific-time-availability';\n }\n this.selectedParticipants = { ...this.selectedParticipants };\n this.updateFormValue();\n }\n return;\n }\n\n const existingParticipant = this.selectedConfiguration?.participants.find(participant => participant.email === event.detail.name);\n const existingOpenHours = existingParticipant?.availability?.open_hours || [];\n const openHours = existingOpenHours?.length > 0 ? existingOpenHours : this.selectedConfiguration?.availability?.availability_rules?.default_open_hours || [];\n const timeZone =\n existingOpenHours && existingOpenHours.length > 0\n ? existingParticipant?.timezone\n : this.selectedConfiguration?.availability?.availability_rules?.default_open_hours?.at(0)?.timezone ||\n this.selectedConfiguration?.event_booking?.timezone ||\n window.Intl.DateTimeFormat().resolvedOptions().timeZone;\n\n const existingSpecificTimeAvailability = existingParticipant?.specific_time_availability || [];\n const specificTimesAvailability = existingSpecificTimeAvailability?.length > 0 ? existingSpecificTimeAvailability : [];\n this.selectedParticipants[event.detail.name]['isOpen'] = event.detail.checked;\n this.selectedParticipants[event.detail.name]['tab'] = 'availability';\n this.selectedParticipants[event.detail.name]['setCustom'] = event.detail.checked;\n this.selectedParticipants[event.detail.name]['openHours'] = event.detail.checked ? (openHours?.length > 0 ? openHours : DEFAULT_OPEN_HOURS) : [];\n this.selectedParticipants[event.detail.name]['timezone'] = event.detail.checked ? timeZone : undefined;\n this.selectedParticipants[event.detail.name]['specificTimesAvailability'] = event.detail.checked ? specificTimesAvailability : [];\n this.selectedParticipants = { ...this.selectedParticipants };\n this.updateFormValue();\n }\n\n @Listen('valueChanged')\n handleValueChanged(event: CustomEvent) {\n debug('[nylas-editor-tabs]', 'handleValueChanged', event);\n const { name, value } = event.detail;\n if (!name.startsWith('participant-availability-') && !name.startsWith('participant-specific-time-availability-')) {\n return;\n }\n\n // Parse the JSON value once - can contain { openHours: OpenHours[], timezone: string } or SpecificTimeAvailability[]\n let jsonValue;\n try {\n jsonValue = JSON.parse(value);\n } catch (error) {\n console.error(`Failed to parse JSON for participant ${name}:`, error);\n return;\n }\n\n // Validate the form\n if (this.isInternalsAvailable) {\n if (!this.participantFormRef.checkValidity()) {\n this.internals.setValidity({ customError: true }, 'Please fix the overlapping time ranges.');\n return;\n } else {\n this.internals.setValidity({});\n }\n }\n\n if (name.startsWith('participant-availability-')) {\n // Expected name format: \"participant-availability-{participantId}-{uniqueKey}\"\n // We extract the unique key (4th segment) to identify the specific participant\n const nameParts = name.split('-');\n if (nameParts.length < 4) {\n console.warn(`Malformed participant name format: ${name}. Expected format: \"participant-availability-{participantId}-{uniqueKey}\"`);\n return;\n }\n\n const key = nameParts[3];\n if (!this.selectedParticipants[key]) return;\n const existingOpenHours = jsonValue.openHours || [];\n const openHours = existingOpenHours?.length > 0 ? existingOpenHours : this.selectedConfiguration?.availability?.availability_rules?.default_open_hours || [];\n this.selectedParticipants[key]['openHours'] = openHours;\n this.selectedParticipants[key]['tab'] = 'availability';\n } else if (name.startsWith('participant-specific-time-availability')) {\n // Expected name format: \"participant-specific-time-availability-{index}-{uniqueKey}\"\n // Extract the unique key (6th segment) to identify the specific participant\n const nameParts = name.split('-');\n if (nameParts.length < 6) {\n console.warn(`Malformed participant specific date name format: ${name}. Expected format: \"participant-specific-time-availability-{index}-{uniqueKey}\"`);\n return;\n }\n\n const key = nameParts[5];\n if (!this.selectedParticipants[key]) return;\n const existingSpecificTimeAvailability = jsonValue || [];\n this.selectedParticipants[key]['specificTimesAvailability'] = existingSpecificTimeAvailability;\n this.selectedParticipants[key]['tab'] = 'specific-time-availability';\n }\n\n this.selectedParticipants = { ...this.selectedParticipants };\n\n this.updateFormValue();\n }\n\n updateFormValue() {\n const participantOpenHours = {};\n const participantSpecificTimeAvailability = {};\n const participantOnlySpecificTimeAvailability = {};\n Object.keys(this.selectedParticipants).forEach(key => {\n participantOpenHours[key] = this.selectedParticipants[key].openHours;\n participantSpecificTimeAvailability[key] = this.selectedParticipants[key].specificTimesAvailability || [];\n participantOnlySpecificTimeAvailability[key] = this.selectedParticipants[key].onlySpecificTimeAvailability || false;\n });\n\n this.isInternalsAvailable && this.internals.setFormValue(JSON.stringify(participantOpenHours), this.name);\n this.valueChanged.emit({ value: JSON.stringify(participantOpenHours), name: this.name });\n\n this.isInternalsAvailable && this.internals.setFormValue(JSON.stringify(participantSpecificTimeAvailability), `${this.name}-specific-time`);\n this.valueChanged.emit({ value: JSON.stringify(participantSpecificTimeAvailability), name: `${this.name}-specific-time` });\n\n this.isInternalsAvailable && this.internals.setFormValue(JSON.stringify(participantOnlySpecificTimeAvailability), `${this.name}-only-specific-time`);\n this.valueChanged.emit({ value: JSON.stringify(participantOnlySpecificTimeAvailability), name: `${this.name}-only-specific-time` });\n }\n\n setParticipants(participants: Participant[]) {\n const selectedParticipants = {};\n participants?.forEach(participant => {\n const onlySpecificTime = participant.only_specific_time_availability || false;\n const hasOpenHours = Boolean(participant.availability?.open_hours && participant.availability.open_hours.length > 0);\n const hasSpecificTime = Boolean(participant.specific_time_availability && participant.specific_time_availability.length > 0);\n const hasCustomAvailability = hasOpenHours || hasSpecificTime;\n\n selectedParticipants[participant.email] = {\n isOpen: hasCustomAvailability, // Open the section if custom availability is configured\n setCustom: hasOpenHours,\n openHours: participant.availability?.open_hours || [],\n name: participant.name || participant.email,\n availability: participant.availability,\n timezone: participant.timezone,\n specificTimesAvailability: participant.specific_time_availability || [],\n onlySpecificTimeAvailability: onlySpecificTime,\n // Default to specific-time-availability tab if only specific time is enabled\n tab: onlySpecificTime ? 'specific-time-availability' : 'availability',\n };\n });\n return selectedParticipants;\n }\n\n /**\n * This method is essentially a workaround to check if the internals are available because\n * the unit tests in stencil do not support the internals.\n * @returns boolean\n */\n get isInternalsAvailable() {\n return this.internals !== undefined && typeof this.internals.setFormValue === 'function' && typeof this.internals.setValidity === 'function';\n }\n\n @RegisterComponent<NylasParticipantsCustomAvailability, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-participants-custom-availability',\n stateToProps: new Map([\n ['schedulerConfig.selectedConfiguration', 'selectedConfiguration'],\n ['schedulerConfig.selectedLanguage', 'selectedLanguage'],\n ['schedulerConfig.themeConfig', 'themeConfig'],\n ]),\n eventToProps: {},\n fireRegisterEvent: true,\n })\n render() {\n return (\n <Host>\n <div class=\"nylas-participants-custom-availability\" part=\"npca\">\n <div class=\"header\" part=\"npca__header\">\n <h3>{i18next.t('nylasParticipantCustomAvailability.headerTitle')}</h3>\n <p>{i18next.t('nylasParticipantCustomAvailability.headerSubTitle')}</p>\n </div>\n <div class=\"content\" part=\"npca__content\">\n <form ref={el => (this.participantFormRef = el as HTMLFormElement)}>\n {Object.keys(this.selectedParticipants).map((key, index) => {\n const participant = this.selectedParticipants[key];\n const participantOpenHours = participant.availability?.open_hours || [];\n if (!participant || !participant.name || !participant.availability) return;\n return (\n <div class=\"participant-container\" part=\"npca__participant-container\" key={`participant-conatiner-${index}`}>\n <div class=\"participant-title\" part=\"npca__participant-title\">\n <p>{i18next.t('nylasParticipantCustomAvailability.participantOpenHoursTitle', { participantName: participant.name })}</p>\n <div class=\"participant-toggle\" part=\"npca__participant-toggle--container\">\n <toggle-switch\n exportparts=\"ts_label: npca__toggle-label, ts_input: npca_toggle-input, ts_slider: npca_toggle-slider\"\n name={key}\n checked={!!participant?.openHours && participant?.openHours.length > 0}\n themeConfig={this.themeConfig}\n />\n <span\n class={`chevron ${participant.isOpen ? 'open' : 'closed'} ${participant.setCustom ? '' : 'disabled'}`}\n onClick={() => {\n if (!participant.setCustom) return;\n this.selectedParticipants[key].isOpen = !participant.isOpen;\n this.selectedParticipants[key].tab = 'availability';\n this.selectedParticipants = { ...this.selectedParticipants };\n }}\n >\n <chevron-icon width=\"24\" height=\"24\" />\n </span>\n </div>\n </div>\n {participant.isOpen && (\n <div class=\"participant-only-specific-time-container\">\n <div class=\"participant-only-specific-time-checkbox\">\n <label>\n <input\n type=\"checkbox\"\n checked={participant.onlySpecificTimeAvailability}\n onChange={(e: any) => {\n this.selectedParticipants[key]['onlySpecificTimeAvailability'] = e.target.checked;\n if (e.target.checked) {\n this.selectedParticipants[key]['tab'] = 'specific-time-availability';\n }\n this.selectedParticipants = { ...this.selectedParticipants };\n this.updateFormValue();\n }}\n />\n <span>{i18next.t('nylasParticipantCustomAvailability.onlySpecificTimeAvailability', { participantName: participant.name })}</span>\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" width=\"14\" height=\"14\" />\n <span slot=\"tooltip-content\">\n {i18next.t('nylasParticipantCustomAvailability.onlySpecificTimeAvailabilityTooltip', { participantName: participant.name })}\n </span>\n </tooltip-component>\n </label>\n </div>\n </div>\n )}\n {participant.isOpen && (\n <div class={`participant-tabs ${participant.onlySpecificTimeAvailability ? 'single-tab' : ''}`} part=\"npca__participant-tabs\">\n {!participant.onlySpecificTimeAvailability && (\n <div\n class={`participant-tab ${participant.tab === 'availability' ? 'active' : ''}`}\n part=\"npca__participant-tab\"\n onClick={() => {\n this.selectedParticipants[key].tab = 'availability';\n this.selectedParticipants = { ...this.selectedParticipants };\n }}\n >\n <span>{i18next.t('nylasParticipantCustomAvailability.participantAvailabilityTab')}</span>\n </div>\n )}\n <div\n class={`participant-tab ${participant.tab === 'specific-time-availability' ? 'active' : ''}`}\n part=\"npca__participant-tab\"\n onClick={() => {\n this.selectedParticipants[key].tab = 'specific-time-availability';\n this.selectedParticipants = { ...this.selectedParticipants };\n }}\n >\n <span>{i18next.t('nylasParticipantCustomAvailability.participantSpecificTimeAvailabilityTab')}</span>\n </div>\n </div>\n )}\n {participant.tab === 'availability' && participant.isOpen && !participant.onlySpecificTimeAvailability && (\n <nylas-availability-picker\n key={index}\n name={`participant-availability-${index}-${key}`}\n openHours={participantOpenHours}\n defaultTimezone={participant.timezone}\n hideHeader={true}\n />\n )}\n {participant.tab === 'specific-time-availability' && participant.isOpen && (\n <nylas-specific-time-availability-picker\n key={index}\n name={`participant-specific-time-availability-${index}-${key}`}\n specificTimesAvailability={participant.specificTimesAvailability}\n hideHeader={true}\n />\n )}\n </div>\n );\n })}\n </form>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"p-CXsByTmW.js","mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,sCAAsC,GAAG,o/MAAo/M;;;;;;;;;;;;;;;;MC6BthN,mCAAmC,GAAAA,kBAAA,CAAA,MAAA,mCAAA,SAAAC,CAAA,CAAA;AANhD,IAAA,WAAA,GAAA;;;;;;AAmBU,QAAA,IAAI,CAAA,IAAA,GAAW,iCAAiC;QAMhD,IAAY,CAAA,YAAA,GAAkB,IAAI,CAAC,qBAAqB,EAAE,YAAY,IAAI,EAAE;QA4B3E,IAAoB,CAAA,oBAAA,GAYzB,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC;AAoW5C;AAhWC,IAAA,yBAAyB,CAAC,QAAgB,EAAA;AACxC,QAAA,KAAK,CAAC,wCAAwC,EAAE,2BAA2B,EAAE,QAAQ,CAAC;QACtF,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC;;IAI1C,0BAA0B,CAAC,QAAuB,EAAE,QAAuB,EAAA;QACzE,KAAK,CAAC,wCAAwC,EAAE,4BAA4B,EAAE,QAAQ,EAAE,QAAQ,CAAC;QACjG,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE;YACnF;;QAEF,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC;;IAI5D,mCAAmC,CAAC,QAAuB,EAAE,QAAuB,EAAA;QAClF,KAAK,CAAC,wCAAwC,EAAE,qCAAqC,EAAE,QAAQ,E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ylas-participants-custom-availability/nylas-participants-custom-availability.scss?tag=nylas-participants-custom-availability&encapsulation=shadow","src/components/scheduler-editor/nylas-participants-custom-availability/nylas-participants-custom-availability.tsx"],"sourcesContent":["@use '../../../common/styles/variables' as *;\n\n:host {\n display: block;\n @include default-css-variables;\n width: inherit;\n}\n\n.nylas-participants-custom-availability {\n width: inherit;\n display: flex;\n flex-direction: column;\n margin: 1rem;\n border-radius: var(--nylas-border-radius-2x);\n border: 1px solid var(--nylas-base-200);\n .header {\n padding: 1rem;\n h3 {\n margin: 0;\n font-size: 16px;\n font-weight: 600;\n line-height: 20px;\n color: var(--nylas-base-900);\n text-align: left;\n }\n p {\n margin: 0.25rem 0 0 0;\n font-size: 0.875rem;\n font-weight: 400;\n line-height: 20px;\n color: var(--nylas-base-600);\n text-align: left;\n }\n }\n .content {\n .participant-container {\n padding-top: 8px;\n border-top: 1px solid var(--nylas-base-200);\n color: var(--nylas-base-900);\n background-color: var(--nylas-base-25);\n\n .participant-title {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 4px 16px 12px;\n p {\n margin: 0;\n }\n .participant-toggle {\n display: flex;\n gap: 24px;\n align-items: center;\n .chevron {\n display: flex;\n align-self: center;\n cursor: pointer;\n\n &:hover,\n &:active {\n color: var(--nylas-primary);\n }\n\n &.open {\n transform: rotate(90deg);\n }\n\n &.closed {\n transform: rotate(270deg);\n }\n\n &.disabled {\n cursor: not-allowed;\n color: var(--nylas-base-300);\n &:hover {\n color: var(--nylas-base-300);\n }\n }\n }\n }\n }\n nylas-availability-picker::part(nap) {\n margin: 0;\n border: none;\n }\n nylas-specific-time-availability-picker::part(nstap) {\n margin: 0;\n border: none;\n }\n .participant-only-specific-time-container {\n padding: 8px 16px;\n border-top: 1px solid var(--nylas-base-200);\n background-color: var(--nylas-base-50);\n\n .participant-only-specific-time-checkbox {\n label {\n display: flex;\n align-items: center;\n gap: 8px;\n font-size: 14px;\n font-weight: 400;\n color: var(--nylas-base-900);\n cursor: pointer;\n\n input[type='checkbox'] {\n width: 16px;\n height: 16px;\n cursor: pointer;\n accent-color: var(--nylas-primary);\n }\n\n span {\n flex: 1;\n }\n\n tooltip-component {\n display: flex;\n align-items: center;\n }\n }\n }\n }\n }\n .participant-tabs {\n justify-content: space-between;\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 16px;\n padding: 8px 16px;\n border-top: 1px solid var(--nylas-base-200);\n\n &.single-tab {\n grid-template-columns: 1fr;\n }\n }\n .participant-tab {\n cursor: pointer;\n padding: 8px 16px;\n border-radius: var(--nylas-border-radius-2x);\n background-color: var(--nylas-base-100);\n text-align: center;\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n color: var(--nylas-base-600);\n &.active {\n background-color: var(--nylas-primary);\n color: var(--nylas-base-100);\n }\n }\n }\n}\n","import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug } from '@/utils/utils';\nimport { AttachInternals, Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { Configuration, OpenHours, Participant, ParticipantAvailability, SpecificTimeAvailability, ThemeConfig } from '@nylas/core';\nimport { DEFAULT_OPEN_HOURS } from '@/common/constants';\nimport i18next from '@/utils/i18n';\nimport { LANGUAGE_CODE } from '@/common/constants';\n\n/**\n * The `nylas-participants-custom-availability` component is a form input for setting custom availability for participants.\n *\n * @part npca - The participants custom availability container\n * @part npca__header - The header of the participants custom availability\n * @part npca__content - The content of the participants custom availability\n * @part npca__participant-container - The participant container\n * @part npca__participant-title - The title of the participant\n * @part npca__participant-toggle--container - The toggle container for the participant\n * @part npca__toggle-label - The label of the toggle\n * @part npca_toggle-input - The input of the toggle\n * @part npca_toggle-slider - The slider of the toggle\n */\n@Component({\n tag: 'nylas-participants-custom-availability',\n styleUrl: 'nylas-participants-custom-availability.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasParticipantsCustomAvailability {\n @Element() host!: HTMLNylasParticipantsCustomAvailabilityElement;\n private participantFormRef!: HTMLFormElement;\n /**\n * @standalone\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n\n /**\n * @standalone\n * The name of the participants custom availability.\n */\n @Prop() name: string = 'participant-custom-availability';\n\n /**\n * @standalone\n * The participants selected in the add participants section.\n */\n @Prop() participants: Participant[] = this.selectedConfiguration?.participants || [];\n\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: LANGUAGE_CODE;\n\n /**\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: ThemeConfig;\n\n /**\n * This event is fired when the participants custom availability changes.\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n }>;\n\n /**\n * The element internals.\n */\n @AttachInternals() internals!: ElementInternals;\n\n /**\n * The state to store the custom availability setting for participants.\n */\n @State() selectedParticipants: {\n [key: string]: {\n setCustom: boolean;\n tab: 'availability' | 'specific-time-availability';\n isOpen: boolean;\n openHours: OpenHours[];\n specificTimesAvailability: SpecificTimeAvailability[];\n name: string;\n availability?: ParticipantAvailability;\n timezone?: string;\n onlySpecificTimeAvailability?: boolean;\n };\n } = this.setParticipants(this.participants);\n\n // Watchers\n @Watch('name')\n elementNameChangedHandler(newValue: string) {\n debug('nylas-participants-custom-availability', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('participants')\n participantsChangedHandler(newValue: Participant[], oldValue: Participant[]) {\n debug('nylas-participants-custom-availability', 'participantsChangedHandler', newValue, oldValue);\n if (!newValue || !oldValue || JSON.stringify(newValue) === JSON.stringify(oldValue)) {\n return;\n }\n this.selectedParticipants = this.setParticipants(newValue);\n }\n\n @Watch('selectedConfiguration')\n selectedConfigurationChangedHandler(newValue: Configuration, oldValue: Configuration) {\n debug('nylas-participants-custom-availability', 'selectedConfigurationChangedHandler', newValue, oldValue);\n if (!newValue || !oldValue || JSON.stringify(newValue) === JSON.stringify(oldValue)) {\n return;\n }\n if (newValue?.participants) {\n this.selectedParticipants = this.setParticipants(newValue?.participants);\n }\n }\n\n @Watch('selectedLanguage')\n selectedLanguageChangedHandler(newVal: LANGUAGE_CODE, oldVal: LANGUAGE_CODE) {\n if (newVal === oldVal) return;\n i18next.changeLanguage(newVal);\n }\n\n @Watch('themeConfig')\n themeConfigChangedHandler(newVal: ThemeConfig, oldVal: ThemeConfig) {\n if (newVal === oldVal) return;\n this.applyThemeConfig(newVal);\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 // Lifecycle Methods\n connectedCallback() {\n debug('nylas-participants-custom-availability', 'connectedCallback');\n }\n\n disconnectedCallback() {\n debug('nylas-participants-custom-availability', 'disconnectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-participants-custom-availability', 'componentWillLoad');\n }\n\n componentDidLoad() {\n debug('nylas-participants-custom-availability', 'componentDidLoad');\n if (this.selectedConfiguration) {\n this.selectedParticipants = this.setParticipants(this.selectedConfiguration?.participants);\n } else {\n this.selectedParticipants = this.setParticipants(this.participants);\n }\n }\n\n // Event Handlers\n @Listen('nylasFormSwitchToggled')\n nylasFormSwitchToggledHandler(event: CustomEvent<{ checked: boolean; name: string; label: boolean }>) {\n debug('nylas-participants-custom-availability', 'nylasFormSwitchToggledHandler', event.detail);\n\n // Check if this is a toggle for \"only specific time availability\"\n if (event.detail.name.startsWith('only-specific-time-')) {\n const participantEmail = event.detail.name.replace('only-specific-time-', '');\n if (this.selectedParticipants[participantEmail]) {\n this.selectedParticipants[participantEmail]['onlySpecificTimeAvailability'] = event.detail.checked;\n // When enabling only specific time, switch to specific time tab\n if (event.detail.checked) {\n this.selectedParticipants[participantEmail]['tab'] = 'specific-time-availability';\n }\n this.selectedParticipants = { ...this.selectedParticipants };\n this.updateFormValue();\n }\n return;\n }\n\n const existingParticipant = this.selectedConfiguration?.participants.find(participant => participant.email === event.detail.name);\n const existingOpenHours = existingParticipant?.availability?.open_hours || [];\n const openHours = existingOpenHours?.length > 0 ? existingOpenHours : this.selectedConfiguration?.availability?.availability_rules?.default_open_hours || [];\n const timeZone =\n existingOpenHours && existingOpenHours.length > 0\n ? existingParticipant?.timezone\n : this.selectedConfiguration?.availability?.availability_rules?.default_open_hours?.at(0)?.timezone ||\n this.selectedConfiguration?.event_booking?.timezone ||\n window.Intl.DateTimeFormat().resolvedOptions().timeZone;\n\n const existingSpecificTimeAvailability = existingParticipant?.specific_time_availability || [];\n const specificTimesAvailability = existingSpecificTimeAvailability?.length > 0 ? existingSpecificTimeAvailability : [];\n this.selectedParticipants[event.detail.name]['isOpen'] = event.detail.checked;\n this.selectedParticipants[event.detail.name]['tab'] = 'availability';\n this.selectedParticipants[event.detail.name]['setCustom'] = event.detail.checked;\n this.selectedParticipants[event.detail.name]['openHours'] = event.detail.checked ? (openHours?.length > 0 ? openHours : DEFAULT_OPEN_HOURS) : [];\n this.selectedParticipants[event.detail.name]['timezone'] = event.detail.checked ? timeZone : undefined;\n this.selectedParticipants[event.detail.name]['specificTimesAvailability'] = event.detail.checked ? specificTimesAvailability : [];\n this.selectedParticipants = { ...this.selectedParticipants };\n this.updateFormValue();\n }\n\n @Listen('valueChanged')\n handleValueChanged(event: CustomEvent) {\n debug('[nylas-editor-tabs]', 'handleValueChanged', event);\n const { name, value } = event.detail;\n if (!name.startsWith('participant-availability-') && !name.startsWith('participant-specific-time-availability-')) {\n return;\n }\n\n // Parse the JSON value once - can contain { openHours: OpenHours[], timezone: string } or SpecificTimeAvailability[]\n let jsonValue;\n try {\n jsonValue = JSON.parse(value);\n } catch (error) {\n console.error(`Failed to parse JSON for participant ${name}:`, error);\n return;\n }\n\n // Validate the form\n if (this.isInternalsAvailable) {\n if (!this.participantFormRef.checkValidity()) {\n this.internals.setValidity({ customError: true }, 'Please fix the overlapping time ranges.');\n return;\n } else {\n this.internals.setValidity({});\n }\n }\n\n if (name.startsWith('participant-availability-')) {\n // Expected name format: \"participant-availability-{participantId}-{uniqueKey}\"\n // We extract the unique key (4th segment) to identify the specific participant\n const nameParts = name.split('-');\n if (nameParts.length < 4) {\n console.warn(`Malformed participant name format: ${name}. Expected format: \"participant-availability-{participantId}-{uniqueKey}\"`);\n return;\n }\n\n const key = nameParts[3];\n if (!this.selectedParticipants[key]) return;\n const existingOpenHours = jsonValue.openHours || [];\n const openHours = existingOpenHours?.length > 0 ? existingOpenHours : this.selectedConfiguration?.availability?.availability_rules?.default_open_hours || [];\n this.selectedParticipants[key]['openHours'] = openHours;\n this.selectedParticipants[key]['tab'] = 'availability';\n } else if (name.startsWith('participant-specific-time-availability')) {\n // Expected name format: \"participant-specific-time-availability-{index}-{uniqueKey}\"\n // Extract the unique key (6th segment) to identify the specific participant\n const nameParts = name.split('-');\n if (nameParts.length < 6) {\n console.warn(`Malformed participant specific date name format: ${name}. Expected format: \"participant-specific-time-availability-{index}-{uniqueKey}\"`);\n return;\n }\n\n const key = nameParts[5];\n if (!this.selectedParticipants[key]) return;\n const existingSpecificTimeAvailability = jsonValue || [];\n this.selectedParticipants[key]['specificTimesAvailability'] = existingSpecificTimeAvailability;\n this.selectedParticipants[key]['tab'] = 'specific-time-availability';\n }\n\n this.selectedParticipants = { ...this.selectedParticipants };\n\n this.updateFormValue();\n }\n\n updateFormValue() {\n const participantOpenHours = {};\n const participantSpecificTimeAvailability = {};\n const participantOnlySpecificTimeAvailability = {};\n Object.keys(this.selectedParticipants).forEach(key => {\n participantOpenHours[key] = this.selectedParticipants[key].openHours;\n participantSpecificTimeAvailability[key] = this.selectedParticipants[key].specificTimesAvailability || [];\n participantOnlySpecificTimeAvailability[key] = this.selectedParticipants[key].onlySpecificTimeAvailability || false;\n });\n\n this.isInternalsAvailable && this.internals.setFormValue(JSON.stringify(participantOpenHours), this.name);\n this.valueChanged.emit({ value: JSON.stringify(participantOpenHours), name: this.name });\n\n this.isInternalsAvailable && this.internals.setFormValue(JSON.stringify(participantSpecificTimeAvailability), `${this.name}-specific-time`);\n this.valueChanged.emit({ value: JSON.stringify(participantSpecificTimeAvailability), name: `${this.name}-specific-time` });\n\n this.isInternalsAvailable && this.internals.setFormValue(JSON.stringify(participantOnlySpecificTimeAvailability), `${this.name}-only-specific-time`);\n this.valueChanged.emit({ value: JSON.stringify(participantOnlySpecificTimeAvailability), name: `${this.name}-only-specific-time` });\n }\n\n setParticipants(participants: Participant[]) {\n const selectedParticipants = {};\n participants?.forEach(participant => {\n const onlySpecificTime = participant.only_specific_time_availability || false;\n const hasOpenHours = Boolean(participant.availability?.open_hours && participant.availability.open_hours.length > 0);\n const hasSpecificTime = Boolean(participant.specific_time_availability && participant.specific_time_availability.length > 0);\n const hasCustomAvailability = hasOpenHours || hasSpecificTime;\n\n selectedParticipants[participant.email] = {\n isOpen: hasCustomAvailability, // Open the section if custom availability is configured\n setCustom: hasOpenHours,\n openHours: participant.availability?.open_hours || [],\n name: participant.name || participant.email,\n availability: participant.availability,\n timezone: participant.timezone,\n specificTimesAvailability: participant.specific_time_availability || [],\n onlySpecificTimeAvailability: onlySpecificTime,\n // Default to specific-time-availability tab if only specific time is enabled\n tab: onlySpecificTime ? 'specific-time-availability' : 'availability',\n };\n });\n return selectedParticipants;\n }\n\n /**\n * This method is essentially a workaround to check if the internals are available because\n * the unit tests in stencil do not support the internals.\n * @returns boolean\n */\n get isInternalsAvailable() {\n return this.internals !== undefined && typeof this.internals.setFormValue === 'function' && typeof this.internals.setValidity === 'function';\n }\n\n @RegisterComponent<NylasParticipantsCustomAvailability, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-participants-custom-availability',\n stateToProps: new Map([\n ['schedulerConfig.selectedConfiguration', 'selectedConfiguration'],\n ['schedulerConfig.selectedLanguage', 'selectedLanguage'],\n ['schedulerConfig.themeConfig', 'themeConfig'],\n ]),\n eventToProps: {},\n fireRegisterEvent: true,\n })\n render() {\n return (\n <Host>\n <div class=\"nylas-participants-custom-availability\" part=\"npca\">\n <div class=\"header\" part=\"npca__header\">\n <h3>{i18next.t('nylasParticipantCustomAvailability.headerTitle')}</h3>\n <p>{i18next.t('nylasParticipantCustomAvailability.headerSubTitle')}</p>\n </div>\n <div class=\"content\" part=\"npca__content\">\n <form ref={el => (this.participantFormRef = el as HTMLFormElement)}>\n {Object.keys(this.selectedParticipants).map((key, index) => {\n const participant = this.selectedParticipants[key];\n const participantOpenHours = participant.availability?.open_hours || [];\n if (!participant || !participant.name || !participant.availability) return;\n return (\n <div class=\"participant-container\" part=\"npca__participant-container\" key={`participant-conatiner-${index}`}>\n <div class=\"participant-title\" part=\"npca__participant-title\">\n <p>{i18next.t('nylasParticipantCustomAvailability.participantOpenHoursTitle', { participantName: participant.name })}</p>\n <div class=\"participant-toggle\" part=\"npca__participant-toggle--container\">\n <toggle-switch\n exportparts=\"ts_label: npca__toggle-label, ts_input: npca_toggle-input, ts_slider: npca_toggle-slider\"\n name={key}\n checked={!!participant?.openHours && participant?.openHours.length > 0}\n themeConfig={this.themeConfig}\n />\n <span\n class={`chevron ${participant.isOpen ? 'open' : 'closed'} ${participant.setCustom ? '' : 'disabled'}`}\n onClick={() => {\n if (!participant.setCustom) return;\n this.selectedParticipants[key].isOpen = !participant.isOpen;\n this.selectedParticipants[key].tab = 'availability';\n this.selectedParticipants = { ...this.selectedParticipants };\n }}\n >\n <chevron-icon width=\"24\" height=\"24\" />\n </span>\n </div>\n </div>\n {participant.isOpen && (\n <div class=\"participant-only-specific-time-container\">\n <div class=\"participant-only-specific-time-checkbox\">\n <label>\n <input\n type=\"checkbox\"\n checked={participant.onlySpecificTimeAvailability}\n onChange={(e: any) => {\n this.selectedParticipants[key]['onlySpecificTimeAvailability'] = e.target.checked;\n if (e.target.checked) {\n this.selectedParticipants[key]['tab'] = 'specific-time-availability';\n }\n this.selectedParticipants = { ...this.selectedParticipants };\n this.updateFormValue();\n }}\n />\n <span>{i18next.t('nylasParticipantCustomAvailability.onlySpecificTimeAvailability', { participantName: participant.name })}</span>\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" width=\"14\" height=\"14\" />\n <span slot=\"tooltip-content\">\n {i18next.t('nylasParticipantCustomAvailability.onlySpecificTimeAvailabilityTooltip', { participantName: participant.name })}\n </span>\n </tooltip-component>\n </label>\n </div>\n </div>\n )}\n {participant.isOpen && (\n <div class={`participant-tabs ${participant.onlySpecificTimeAvailability ? 'single-tab' : ''}`} part=\"npca__participant-tabs\">\n {!participant.onlySpecificTimeAvailability && (\n <div\n class={`participant-tab ${participant.tab === 'availability' ? 'active' : ''}`}\n part=\"npca__participant-tab\"\n onClick={() => {\n this.selectedParticipants[key].tab = 'availability';\n this.selectedParticipants = { ...this.selectedParticipants };\n }}\n >\n <span>{i18next.t('nylasParticipantCustomAvailability.participantAvailabilityTab')}</span>\n </div>\n )}\n <div\n class={`participant-tab ${participant.tab === 'specific-time-availability' ? 'active' : ''}`}\n part=\"npca__participant-tab\"\n onClick={() => {\n this.selectedParticipants[key].tab = 'specific-time-availability';\n this.selectedParticipants = { ...this.selectedParticipants };\n }}\n >\n <span>{i18next.t('nylasParticipantCustomAvailability.participantSpecificTimeAvailabilityTab')}</span>\n </div>\n </div>\n )}\n {participant.tab === 'availability' && participant.isOpen && !participant.onlySpecificTimeAvailability && (\n <nylas-availability-picker\n key={index}\n name={`participant-availability-${index}-${key}`}\n openHours={participantOpenHours}\n defaultTimezone={participant.timezone}\n hideHeader={true}\n />\n )}\n {participant.tab === 'specific-time-availability' && participant.isOpen && (\n <nylas-specific-time-availability-picker\n key={index}\n name={`participant-specific-time-availability-${index}-${key}`}\n specificTimesAvailability={participant.specificTimesAvailability}\n hideHeader={true}\n />\n )}\n </div>\n );\n })}\n </form>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { p as proxyCustomElement, H, h } from './p-Bht9ktsW.js';
|
|
2
|
+
|
|
3
|
+
const tooltipComponentCss = ".tooltip-container{position:relative;display:flex;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:\"Inter\", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.info-icon{cursor:pointer;display:inline-flex;align-items:center;justify-content:center;outline:none;transition:opacity 0.2s ease-in-out}.info-icon:hover{opacity:0.8}.info-icon:active{opacity:0.6}.info-icon:focus-visible{outline:2px solid var(--nylas-primary-500, #2563eb);outline-offset:2px;border-radius:2px}.info-icon[aria-pressed=true]{opacity:1;background-color:var(--nylas-primary-50, rgba(37, 99, 235, 0.1));border-radius:4px}.tooltip-content{display:none;background-color:var(--nylas-base-800);color:var(--nylas-base-0);text-align:left;border-radius:6px;padding:0.5rem 1rem;max-width:300px;width:max-content;z-index:9999;opacity:0;transition:opacity 0.2s ease-in-out;pointer-events:none;box-shadow:0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)}.tooltip-content.tooltip-visible{display:block;opacity:1;pointer-events:auto}.tooltip-content::after{content:\"\";position:absolute;border-width:6px;border-style:solid}.tooltip-content.top::after{bottom:-12px;left:50%;transform:translateX(-50%);border-color:var(--nylas-base-800) transparent transparent transparent}.tooltip-content.bottom::after{top:-12px;left:50%;transform:translateX(-50%);border-color:transparent transparent var(--nylas-base-800) transparent}.tooltip-content.left::after{right:-12px;top:50%;transform:translateY(-50%);border-color:transparent transparent transparent var(--nylas-base-800)}.tooltip-content.right::after{left:-12px;top:50%;transform:translateY(-50%);border-color:transparent var(--nylas-base-800) transparent transparent}@keyframes tooltip-fade-in{from{opacity:0;transform:scale(0.95)}to{opacity:1;transform:scale(1)}}.tooltip-visible{animation:tooltip-fade-in 0.15s ease-out}";
|
|
4
|
+
|
|
5
|
+
const TooltipComponent = proxyCustomElement(class TooltipComponent extends H {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.__registerHost();
|
|
9
|
+
this.__attachShadow();
|
|
10
|
+
this.position = 'bottom';
|
|
11
|
+
this.isVisible = false;
|
|
12
|
+
this.isPinned = false;
|
|
13
|
+
this.actualPosition = this.position;
|
|
14
|
+
this.tooltipStyle = { top: '0', left: '0' };
|
|
15
|
+
this.tooltipId = `tooltip-${Math.random().toString(36).substr(2, 9)}`;
|
|
16
|
+
this.handleClick = (event) => {
|
|
17
|
+
event.stopPropagation();
|
|
18
|
+
this.isPinned = !this.isPinned;
|
|
19
|
+
if (this.isPinned) {
|
|
20
|
+
this.showTooltip();
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
this.isVisible = false;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
this.handleMouseEnter = () => {
|
|
27
|
+
if (!this.isPinned) {
|
|
28
|
+
this.showTooltip();
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
this.handleMouseLeave = () => {
|
|
32
|
+
this.hideTooltip();
|
|
33
|
+
};
|
|
34
|
+
this.handleFocus = () => {
|
|
35
|
+
if (!this.isPinned) {
|
|
36
|
+
this.showTooltip();
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
this.handleBlur = () => {
|
|
40
|
+
this.hideTooltip();
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
handleKeyDown(event) {
|
|
44
|
+
if (event.key === 'Escape' && this.isVisible) {
|
|
45
|
+
this.isPinned = false;
|
|
46
|
+
this.isVisible = false;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
handleDocumentClick(event) {
|
|
50
|
+
if (!this.isPinned || !this.isVisible) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const clickedInside = this.el.contains(event.target);
|
|
54
|
+
if (!clickedInside) {
|
|
55
|
+
this.isPinned = false;
|
|
56
|
+
this.isVisible = false;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
calculatePosition() {
|
|
60
|
+
if (!this.tooltipContentEl) {
|
|
61
|
+
return { top: 0, left: 0, position: this.position };
|
|
62
|
+
}
|
|
63
|
+
const triggerEl = this.el.shadowRoot?.querySelector('.info-icon');
|
|
64
|
+
if (!triggerEl) {
|
|
65
|
+
return { top: 0, left: 0, position: this.position };
|
|
66
|
+
}
|
|
67
|
+
const triggerRect = triggerEl.getBoundingClientRect();
|
|
68
|
+
const tooltipRect = this.tooltipContentEl.getBoundingClientRect();
|
|
69
|
+
const viewportWidth = window.innerWidth;
|
|
70
|
+
const viewportHeight = window.innerHeight;
|
|
71
|
+
const spaceAbove = triggerRect.top;
|
|
72
|
+
const spaceBelow = viewportHeight - triggerRect.bottom;
|
|
73
|
+
const spaceLeft = triggerRect.left;
|
|
74
|
+
const spaceRight = viewportWidth - triggerRect.right;
|
|
75
|
+
let bestPosition = this.position;
|
|
76
|
+
const positions = ['top', 'bottom', 'left', 'right'];
|
|
77
|
+
const fitsInPreferred = this.checkPositionFits(this.position, triggerRect, tooltipRect, spaceAbove, spaceBelow, spaceLeft, spaceRight);
|
|
78
|
+
if (!fitsInPreferred) {
|
|
79
|
+
bestPosition = this.findBestAlternativePosition(positions, triggerRect, tooltipRect, spaceAbove, spaceBelow, spaceLeft, spaceRight);
|
|
80
|
+
}
|
|
81
|
+
const coordinates = this.getPositionCoordinates(bestPosition, triggerRect, tooltipRect, viewportWidth, viewportHeight);
|
|
82
|
+
return { ...coordinates, position: bestPosition };
|
|
83
|
+
}
|
|
84
|
+
checkPositionFits(position, _triggerRect, tooltipRect, spaceAbove, spaceBelow, spaceLeft, spaceRight) {
|
|
85
|
+
const margin = 20;
|
|
86
|
+
switch (position) {
|
|
87
|
+
case 'top':
|
|
88
|
+
return spaceAbove >= tooltipRect.height + margin;
|
|
89
|
+
case 'bottom':
|
|
90
|
+
return spaceBelow >= tooltipRect.height + margin;
|
|
91
|
+
case 'left':
|
|
92
|
+
return spaceLeft >= tooltipRect.width + margin;
|
|
93
|
+
case 'right':
|
|
94
|
+
return spaceRight >= tooltipRect.width + margin;
|
|
95
|
+
default:
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
findBestAlternativePosition(positions, _triggerRect, _tooltipRect, spaceAbove, spaceBelow, spaceLeft, spaceRight) {
|
|
100
|
+
const spaces = {
|
|
101
|
+
top: spaceAbove,
|
|
102
|
+
bottom: spaceBelow,
|
|
103
|
+
left: spaceLeft,
|
|
104
|
+
right: spaceRight,
|
|
105
|
+
};
|
|
106
|
+
const sortedPositions = positions.sort((a, b) => spaces[b] - spaces[a]);
|
|
107
|
+
return sortedPositions[0];
|
|
108
|
+
}
|
|
109
|
+
getPositionCoordinates(position, triggerRect, tooltipRect, viewportWidth, viewportHeight) {
|
|
110
|
+
let top = 0;
|
|
111
|
+
let left = 0;
|
|
112
|
+
const margin = 8;
|
|
113
|
+
switch (position) {
|
|
114
|
+
case 'top':
|
|
115
|
+
top = triggerRect.top - tooltipRect.height - margin;
|
|
116
|
+
left = triggerRect.left + triggerRect.width / 2 - tooltipRect.width / 2;
|
|
117
|
+
break;
|
|
118
|
+
case 'bottom':
|
|
119
|
+
top = triggerRect.bottom + margin;
|
|
120
|
+
left = triggerRect.left + triggerRect.width / 2 - tooltipRect.width / 2;
|
|
121
|
+
break;
|
|
122
|
+
case 'left':
|
|
123
|
+
top = triggerRect.top + triggerRect.height / 2 - tooltipRect.height / 2;
|
|
124
|
+
left = triggerRect.left - tooltipRect.width - margin;
|
|
125
|
+
break;
|
|
126
|
+
case 'right':
|
|
127
|
+
top = triggerRect.top + triggerRect.height / 2 - tooltipRect.height / 2;
|
|
128
|
+
left = triggerRect.right + margin;
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
const buffer = 10;
|
|
132
|
+
left = Math.max(margin, Math.min(left, viewportWidth - tooltipRect.width - margin - buffer));
|
|
133
|
+
top = Math.max(margin, Math.min(top, viewportHeight - tooltipRect.height - margin - buffer));
|
|
134
|
+
return { top, left };
|
|
135
|
+
}
|
|
136
|
+
showTooltip() {
|
|
137
|
+
this.isVisible = true;
|
|
138
|
+
requestAnimationFrame(() => {
|
|
139
|
+
const position = this.calculatePosition();
|
|
140
|
+
this.actualPosition = position.position;
|
|
141
|
+
this.tooltipStyle = {
|
|
142
|
+
top: `${position.top}px`,
|
|
143
|
+
left: `${position.left}px`,
|
|
144
|
+
};
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
hideTooltip() {
|
|
148
|
+
if (this.isPinned) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
this.isVisible = false;
|
|
152
|
+
}
|
|
153
|
+
render() {
|
|
154
|
+
return (h("div", { key: 'ac2b492ced810248b21b6d268c396d0d5c0c0b62', class: "tooltip-container", part: "tc__container" }, h("span", { key: '9cbab07a14f9c75912d3483f26e892608bb98f0a', class: "info-icon", tabindex: "0", role: "button", "aria-describedby": this.tooltipId, "aria-expanded": this.isVisible ? 'true' : 'false', "aria-pressed": this.isPinned ? 'true' : 'false', onClick: this.handleClick, onMouseEnter: this.handleMouseEnter, onMouseLeave: this.handleMouseLeave, onFocus: this.handleFocus, onBlur: this.handleBlur }, h("slot", { key: 'd8f086366cd648ebae4561967af6d7cd3eb4935a', name: "tooltip-icon" }, "i")), h("span", { key: 'dd7f80817726299fadb7a13ba18af9f866e4d185', ref: el => (this.tooltipContentEl = el), id: this.tooltipId, role: "tooltip", "aria-hidden": !this.isVisible ? 'true' : 'false', class: {
|
|
155
|
+
'tooltip-content': true,
|
|
156
|
+
'tooltip-visible': this.isVisible,
|
|
157
|
+
[this.actualPosition]: true,
|
|
158
|
+
}, style: this.isVisible
|
|
159
|
+
? {
|
|
160
|
+
position: 'fixed',
|
|
161
|
+
top: this.tooltipStyle.top,
|
|
162
|
+
left: this.tooltipStyle.left,
|
|
163
|
+
}
|
|
164
|
+
: {}, part: "tc__content" }, h("slot", { key: '0ad30c67749909cef048828bcbae5ed187a74dd1', name: "tooltip-content" }, "This is a help text."))));
|
|
165
|
+
}
|
|
166
|
+
get el() { return this; }
|
|
167
|
+
static get style() { return tooltipComponentCss; }
|
|
168
|
+
}, [257, "tooltip-component", {
|
|
169
|
+
"position": [1],
|
|
170
|
+
"isVisible": [32],
|
|
171
|
+
"isPinned": [32],
|
|
172
|
+
"actualPosition": [32],
|
|
173
|
+
"tooltipStyle": [32]
|
|
174
|
+
}, [[8, "keydown", "handleKeyDown"], [4, "click", "handleDocumentClick"]]]);
|
|
175
|
+
function defineCustomElement() {
|
|
176
|
+
if (typeof customElements === "undefined") {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
const components = ["tooltip-component"];
|
|
180
|
+
components.forEach(tagName => { switch (tagName) {
|
|
181
|
+
case "tooltip-component":
|
|
182
|
+
if (!customElements.get(tagName)) {
|
|
183
|
+
customElements.define(tagName, TooltipComponent);
|
|
184
|
+
}
|
|
185
|
+
break;
|
|
186
|
+
} });
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export { TooltipComponent as T, defineCustomElement as d };
|
|
190
|
+
//# sourceMappingURL=p-CelgQqJU.js.map
|
|
191
|
+
|
|
192
|
+
//# sourceMappingURL=p-CelgQqJU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"p-CelgQqJU.js","mappings":";;AAAA,MAAM,mBAAmB,GAAG,y2HAAy2H;;MCsBx3H,gBAAgB,GAAAA,kBAAA,CAAA,MAAA,gBAAA,SAAAC,CAAA,CAAA;AAL7B,IAAA,WAAA,GAAA;;;;AAYU,QAAA,IAAQ,CAAA,QAAA,GAAoB,QAAQ;AAKnC,QAAA,IAAS,CAAA,SAAA,GAAG,KAAK;AAKjB,QAAA,IAAQ,CAAA,Q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,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,iBAAiB,2BAA4B,CACnD,CACH;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/design-system/tooltip-component/tooltip-component.scss?tag=tooltip-component&encapsulation=shadow","src/components/design-system/tooltip-component/toolitp-component.tsx"],"sourcesContent":["@use '../../../common/styles/variables' as *;\n\n.tooltip-container {\n position: relative;\n display: flex;\n @include default-css-variables;\n}\n\n.info-icon {\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n outline: none;\n transition: opacity 0.2s ease-in-out;\n\n &:hover {\n opacity: 0.8;\n }\n\n &:active {\n opacity: 0.6;\n }\n\n &:focus-visible {\n outline: 2px solid var(--nylas-primary-500, #2563eb);\n outline-offset: 2px;\n border-radius: 2px;\n }\n\n &[aria-pressed='true'] {\n opacity: 1;\n background-color: var(--nylas-primary-50, rgba(37, 99, 235, 0.1));\n border-radius: 4px;\n }\n}\n\n.tooltip-content {\n display: none;\n background-color: var(--nylas-base-800);\n color: var(--nylas-base-0);\n text-align: left;\n border-radius: 6px;\n padding: 0.5rem 1rem;\n max-width: 300px;\n width: max-content;\n z-index: 9999;\n opacity: 0;\n transition: opacity 0.2s ease-in-out;\n pointer-events: none;\n box-shadow:\n 0 4px 6px -1px rgba(0, 0, 0, 0.1),\n 0 2px 4px -1px rgba(0, 0, 0, 0.06);\n\n &.tooltip-visible {\n display: block;\n opacity: 1;\n pointer-events: auto;\n }\n}\n\n/* Arrow styles */\n.tooltip-content::after {\n content: '';\n position: absolute;\n border-width: 6px;\n border-style: solid;\n}\n\n.tooltip-content {\n &.top::after {\n bottom: -12px;\n left: 50%;\n transform: translateX(-50%);\n border-color: var(--nylas-base-800) transparent transparent transparent;\n }\n\n &.bottom::after {\n top: -12px;\n left: 50%;\n transform: translateX(-50%);\n border-color: transparent transparent var(--nylas-base-800) transparent;\n }\n\n &.left::after {\n right: -12px;\n top: 50%;\n transform: translateY(-50%);\n border-color: transparent transparent transparent var(--nylas-base-800);\n }\n\n &.right::after {\n left: -12px;\n top: 50%;\n transform: translateY(-50%);\n border-color: transparent var(--nylas-base-800) transparent transparent;\n }\n}\n\n/* Animation for tooltip appearance */\n@keyframes tooltip-fade-in {\n from {\n opacity: 0;\n transform: scale(0.95);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n}\n\n.tooltip-visible {\n animation: tooltip-fade-in 0.15s ease-out;\n}\n","import { Component, Element, Prop, State, h, Listen } from '@stencil/core';\n\ntype TooltipPosition = 'top' | 'bottom' | 'left' | 'right';\n\ninterface PositionCoordinates {\n top: number;\n left: number;\n position: TooltipPosition;\n}\n\n/**\n * The `tooltip-component` component is a UI component that displays a tooltip.\n * It automatically adjusts its position to avoid being cut off by viewport or container boundaries.\n *\n * @part tc__container - The tooltip container.\n * @part tc__content - The tooltip content.\n */\n@Component({\n tag: 'tooltip-component',\n styleUrl: 'tooltip-component.scss',\n shadow: true,\n})\nexport class TooltipComponent {\n @Element() el!: HTMLElement;\n\n /**\n * The preferred position of the tooltip.\n * The tooltip will attempt to use this position but will automatically adjust if it would be cut off.\n */\n @Prop() position: TooltipPosition = 'bottom';\n\n /**\n * Controls the visibility of the tooltip.\n */\n @State() isVisible = false;\n\n /**\n * Tracks if the tooltip is pinned open via click.\n */\n @State() isPinned = false;\n\n /**\n * The actual position being used after boundary detection.\n */\n @State() actualPosition: TooltipPosition = this.position;\n\n /**\n * Calculated position coordinates for the tooltip.\n */\n @State() tooltipStyle: { top: string; left: string } = { top: '0', left: '0' };\n\n private tooltipContentEl?: HTMLElement;\n private tooltipId = `tooltip-${Math.random().toString(36).substr(2, 9)}`;\n\n /**\n * Listen for Escape key to close tooltip\n */\n @Listen('keydown', { target: 'window' })\n handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Escape' && this.isVisible) {\n this.isPinned = false;\n this.isVisible = false;\n }\n }\n\n /**\n * Listen for clicks outside to close pinned tooltip\n */\n @Listen('click', { target: 'document' })\n handleDocumentClick(event: MouseEvent) {\n if (!this.isPinned || !this.isVisible) {\n return;\n }\n\n // Check if click is outside the component\n const clickedInside = this.el.contains(event.target as Node);\n if (!clickedInside) {\n this.isPinned = false;\n this.isVisible = false;\n }\n }\n\n /**\n * Calculate the best position for the tooltip to avoid cutoff\n */\n private calculatePosition(): PositionCoordinates {\n if (!this.tooltipContentEl) {\n return { top: 0, left: 0, position: this.position };\n }\n\n const triggerEl = this.el.shadowRoot?.querySelector('.info-icon') as HTMLElement;\n if (!triggerEl) {\n return { top: 0, left: 0, position: this.position };\n }\n\n const triggerRect = triggerEl.getBoundingClientRect();\n const tooltipRect = this.tooltipContentEl.getBoundingClientRect();\n const viewportWidth = window.innerWidth;\n const viewportHeight = window.innerHeight;\n\n // Calculate available space in each direction\n const spaceAbove = triggerRect.top;\n const spaceBelow = viewportHeight - triggerRect.bottom;\n const spaceLeft = triggerRect.left;\n const spaceRight = viewportWidth - triggerRect.right;\n\n // Determine the best position based on available space\n let bestPosition = this.position;\n const positions: TooltipPosition[] = ['top', 'bottom', 'left', 'right'];\n\n // Check if preferred position fits\n const fitsInPreferred = this.checkPositionFits(this.position, triggerRect, tooltipRect, spaceAbove, spaceBelow, spaceLeft, spaceRight);\n\n if (!fitsInPreferred) {\n // Find alternative position with most space\n bestPosition = this.findBestAlternativePosition(positions, triggerRect, tooltipRect, spaceAbove, spaceBelow, spaceLeft, spaceRight);\n }\n\n // Calculate coordinates based on the chosen position\n const coordinates = this.getPositionCoordinates(bestPosition, triggerRect, tooltipRect, viewportWidth, viewportHeight);\n\n return { ...coordinates, position: bestPosition };\n }\n\n /**\n * Check if tooltip fits in a given position\n */\n private checkPositionFits(\n position: TooltipPosition,\n _triggerRect: DOMRect,\n tooltipRect: DOMRect,\n spaceAbove: number,\n spaceBelow: number,\n spaceLeft: number,\n spaceRight: number,\n ): boolean {\n const margin = 20; // 1.25rem margin + arrow\n\n switch (position) {\n case 'top':\n return spaceAbove >= tooltipRect.height + margin;\n case 'bottom':\n return spaceBelow >= tooltipRect.height + margin;\n case 'left':\n return spaceLeft >= tooltipRect.width + margin;\n case 'right':\n return spaceRight >= tooltipRect.width + margin;\n default:\n return false;\n }\n }\n\n /**\n * Find the best alternative position with the most available space\n */\n private findBestAlternativePosition(\n positions: TooltipPosition[],\n _triggerRect: DOMRect,\n _tooltipRect: DOMRect,\n spaceAbove: number,\n spaceBelow: number,\n spaceLeft: number,\n spaceRight: number,\n ): TooltipPosition {\n const spaces = {\n top: spaceAbove,\n bottom: spaceBelow,\n left: spaceLeft,\n right: spaceRight,\n };\n\n // Sort positions by available space\n const sortedPositions = positions.sort((a, b) => spaces[b] - spaces[a]);\n\n // Return the position with the most space\n return sortedPositions[0];\n }\n\n /**\n * Get position coordinates for the tooltip\n */\n private getPositionCoordinates(\n position: TooltipPosition,\n triggerRect: DOMRect,\n tooltipRect: DOMRect,\n viewportWidth: number,\n viewportHeight: number,\n ): { top: number; left: number } {\n let top = 0;\n let left = 0;\n const margin = 8; // Small margin for spacing\n\n switch (position) {\n case 'top':\n top = triggerRect.top - tooltipRect.height - margin;\n left = triggerRect.left + triggerRect.width / 2 - tooltipRect.width / 2;\n break;\n case 'bottom':\n top = triggerRect.bottom + margin;\n left = triggerRect.left + triggerRect.width / 2 - tooltipRect.width / 2;\n break;\n case 'left':\n top = triggerRect.top + triggerRect.height / 2 - tooltipRect.height / 2;\n left = triggerRect.left - tooltipRect.width - margin;\n break;\n case 'right':\n top = triggerRect.top + triggerRect.height / 2 - tooltipRect.height / 2;\n left = triggerRect.right + margin;\n break;\n }\n\n // Ensure tooltip stays within viewport bounds with extra buffer for accuracy\n const buffer = 10; // Extra buffer to account for rounding, padding, and box-sizing\n left = Math.max(margin, Math.min(left, viewportWidth - tooltipRect.width - margin - buffer));\n top = Math.max(margin, Math.min(top, viewportHeight - tooltipRect.height - margin - buffer));\n\n return { top, left };\n }\n\n /**\n * Show the tooltip with position calculation\n */\n private showTooltip() {\n this.isVisible = true;\n\n // Wait for next frame to ensure tooltip is rendered\n requestAnimationFrame(() => {\n const position = this.calculatePosition();\n this.actualPosition = position.position;\n this.tooltipStyle = {\n top: `${position.top}px`,\n left: `${position.left}px`,\n };\n });\n }\n\n /**\n * Hide the tooltip\n */\n private hideTooltip() {\n // Don't hide if tooltip is pinned\n if (this.isPinned) {\n return;\n }\n this.isVisible = false;\n }\n\n /**\n * Handle click to pin/unpin tooltip\n */\n private handleClick = (event: MouseEvent) => {\n event.stopPropagation();\n this.isPinned = !this.isPinned;\n\n if (this.isPinned) {\n this.showTooltip();\n } else {\n this.isVisible = false;\n }\n };\n\n /**\n * Handle mouse enter\n */\n private handleMouseEnter = () => {\n if (!this.isPinned) {\n this.showTooltip();\n }\n };\n\n /**\n * Handle mouse leave\n */\n private handleMouseLeave = () => {\n this.hideTooltip();\n };\n\n /**\n * Handle focus\n */\n private handleFocus = () => {\n if (!this.isPinned) {\n this.showTooltip();\n }\n };\n\n /**\n * Handle blur\n */\n private handleBlur = () => {\n this.hideTooltip();\n };\n\n render() {\n return (\n <div class=\"tooltip-container\" part=\"tc__container\">\n <span\n class=\"info-icon\"\n tabindex=\"0\"\n role=\"button\"\n aria-describedby={this.tooltipId}\n aria-expanded={this.isVisible ? 'true' : 'false'}\n aria-pressed={this.isPinned ? 'true' : 'false'}\n onClick={this.handleClick}\n onMouseEnter={this.handleMouseEnter}\n onMouseLeave={this.handleMouseLeave}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n >\n <slot name=\"tooltip-icon\">i</slot>\n </span>\n <span\n ref={el => (this.tooltipContentEl = el)}\n id={this.tooltipId}\n role=\"tooltip\"\n aria-hidden={!this.isVisible ? 'true' : 'false'}\n class={{\n 'tooltip-content': true,\n 'tooltip-visible': this.isVisible,\n [this.actualPosition]: true,\n }}\n style={\n this.isVisible\n ? {\n position: 'fixed',\n top: this.tooltipStyle.top,\n left: this.tooltipStyle.left,\n }\n : {}\n }\n part=\"tc__content\"\n >\n <slot name=\"tooltip-content\">This is a help text.</slot>\n </span>\n </div>\n );\n }\n}\n"],"version":3}
|