@nylas/web-elements 2.2.0 → 2.2.2
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/nylas-web-elements/{abstract-provider-D75Ucvku.js → abstract-provider-9AZudYSI.js} +2 -2
- package/dist/nylas-web-elements/{abstract-provider-D75Ucvku.js.map → abstract-provider-9AZudYSI.js.map} +1 -1
- package/dist/nylas-web-elements/add-circle-icon.entry.js +1 -1
- package/dist/nylas-web-elements/archive-icon.entry.js +1 -1
- package/dist/nylas-web-elements/arrow-icon.entry.js +1 -1
- package/dist/nylas-web-elements/bold-icon.entry.js +1 -1
- package/dist/nylas-web-elements/button-component.entry.js +1 -1
- package/dist/nylas-web-elements/calendar-agenda-fill-icon.entry.js +1 -1
- package/dist/nylas-web-elements/calendar-agenda-icon.entry.js +1 -1
- package/dist/nylas-web-elements/calendar-cancel-icon.entry.js +1 -1
- package/dist/nylas-web-elements/calendar-check-icon.entry.js +1 -1
- package/dist/nylas-web-elements/calendar-icon.entry.js +1 -1
- package/dist/nylas-web-elements/calendar-info-icon.entry.js +1 -1
- package/dist/nylas-web-elements/calendar-patterns-icon.entry.js +1 -1
- package/dist/nylas-web-elements/checkbox-component.entry.esm.js.map +1 -1
- package/dist/nylas-web-elements/checkbox-component.entry.js +1 -1
- package/dist/nylas-web-elements/checkbox-component.entry.js.map +1 -1
- package/dist/nylas-web-elements/checkbox-group.entry.js +1 -1
- package/dist/nylas-web-elements/checkmark-circle-icon.entry.js +1 -1
- package/dist/nylas-web-elements/checkmark-icon.entry.js +1 -1
- package/dist/nylas-web-elements/chevron-icon.entry.js +1 -1
- package/dist/nylas-web-elements/clock-icon.entry.js +1 -1
- package/dist/nylas-web-elements/close-icon.entry.js +1 -1
- package/dist/nylas-web-elements/copy-icon.entry.js +1 -1
- package/dist/nylas-web-elements/{customParseFormat-Bk5PI6Cs.js → customParseFormat-BJNMxHY2.js} +2 -2
- package/dist/nylas-web-elements/{customParseFormat-Bk5PI6Cs.js.map → customParseFormat-BJNMxHY2.js.map} +1 -1
- package/dist/nylas-web-elements/delete-icon.entry.js +1 -1
- package/dist/nylas-web-elements/document-refresh-icon.entry.js +1 -1
- package/dist/nylas-web-elements/dragable-icon.entry.js +1 -1
- package/dist/nylas-web-elements/edit-icon.entry.js +1 -1
- package/dist/nylas-web-elements/envelope-fill-icon.entry.js +1 -1
- package/dist/nylas-web-elements/envelope-icon.entry.js +1 -1
- package/dist/nylas-web-elements/eye-icon.entry.js +1 -1
- package/dist/nylas-web-elements/feedback-icon.entry.js +1 -1
- package/dist/nylas-web-elements/flow-icon.entry.js +1 -1
- package/dist/nylas-web-elements/folder-icon.entry.js +1 -1
- package/dist/nylas-web-elements/forward-icon.entry.js +1 -1
- package/dist/nylas-web-elements/globe-icon.entry.js +1 -1
- package/dist/nylas-web-elements/google-logo-icon.entry.js +1 -1
- package/dist/nylas-web-elements/google-meet-icon.entry.js +1 -1
- package/dist/nylas-web-elements/inbox-icon.entry.js +1 -1
- package/dist/nylas-web-elements/{index-BVtainOy.js → index-BPPwIJj2.js} +2 -2
- package/dist/nylas-web-elements/{index-BVtainOy.js.map → index-BPPwIJj2.js.map} +1 -1
- package/dist/nylas-web-elements/{index-B-KMpdMZ.js → index-Cbn5rIwb.js} +2 -2
- package/dist/nylas-web-elements/index-Cbn5rIwb.js.map +1 -0
- package/dist/nylas-web-elements/index.esm.js +1 -1
- package/dist/nylas-web-elements/info-icon.entry.js +1 -1
- package/dist/nylas-web-elements/input-color-picker.entry.js +1 -1
- package/dist/nylas-web-elements/input-component.entry.esm.js.map +1 -1
- package/dist/nylas-web-elements/input-component.entry.js +1 -1
- package/dist/nylas-web-elements/input-component.entry.js.map +1 -1
- package/dist/nylas-web-elements/input-dropdown.entry.esm.js.map +1 -1
- package/dist/nylas-web-elements/input-dropdown.entry.js +1 -1
- package/dist/nylas-web-elements/input-dropdown.entry.js.map +1 -1
- package/dist/nylas-web-elements/input-image-url.entry.js +1 -1
- package/dist/nylas-web-elements/italic-icon.entry.js +1 -1
- package/dist/nylas-web-elements/loading-icon.entry.js +1 -1
- package/dist/nylas-web-elements/location-icon.entry.js +1 -1
- package/dist/nylas-web-elements/location-off-icon.entry.js +1 -1
- package/dist/nylas-web-elements/microsoft-logo-icon.entry.js +1 -1
- package/dist/nylas-web-elements/microsoft-teams-icon.entry.js +1 -1
- package/dist/nylas-web-elements/multi-select-dropdown.entry.esm.js.map +1 -1
- package/dist/nylas-web-elements/multi-select-dropdown.entry.js +1 -1
- package/dist/nylas-web-elements/multi-select-dropdown.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-additional-participants.entry.js +1 -1
- package/dist/nylas-web-elements/{nylas-api-request-B1V2koVc.js → nylas-api-request-rYAjhY1J.js} +2 -2
- package/dist/nylas-web-elements/{nylas-api-request-B1V2koVc.js.map → nylas-api-request-rYAjhY1J.js.map} +1 -1
- package/dist/nylas-web-elements/nylas-availability-picker.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-booked-event-card.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-booking-calendar-picker.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-booking-confirmation-redirect.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-booking-confirmation-type.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-booking-form-config.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-booking-form.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-buffer-time.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-calendar-picker.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-cancel-booking-form.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-cancellation-policy.entry.esm.js.map +1 -1
- package/dist/nylas-web-elements/nylas-cancellation-policy.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-cancellation-policy.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-cancelled-event-card.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-confirmation-email.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-confirmed-event-card.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-connected-calendars.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-custom-booking-flow.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-custom-event-slug.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-customize-booking-settings.entry.esm.js.map +1 -1
- package/dist/nylas-web-elements/nylas-customize-booking-settings.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-customize-booking-settings.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-date-component.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-date-picker.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-date-picker.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-disable-emails.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-editor-tabs-group.entry.esm.js.map +1 -1
- package/dist/nylas-web-elements/nylas-editor-tabs-group.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-editor-tabs-group.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-editor-tabs.entry.esm.js.map +1 -1
- package/dist/nylas-web-elements/nylas-editor-tabs.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-editor-tabs.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-event-calendar.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-event-capacity.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-event-description.entry.esm.js.map +1 -1
- package/dist/nylas-web-elements/nylas-event-description.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-event-description.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-event-duration.entry.esm.js.map +1 -1
- package/dist/nylas-web-elements/nylas-event-duration.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-event-duration.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-event-info.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-event-limits.entry.esm.js.map +1 -1
- package/dist/nylas-web-elements/nylas-event-limits.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-event-limits.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-event-location.entry.esm.js.map +1 -1
- package/dist/nylas-web-elements/nylas-event-location.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-event-location.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-event-timeslot.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-event-title.entry.esm.js.map +1 -1
- package/dist/nylas-web-elements/nylas-event-title.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-event-title.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-feedback-form.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-form-card.entry.esm.js.map +1 -1
- package/dist/nylas-web-elements/nylas-form-card.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-form-card.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-limit-future-bookings.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-list-configurations.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-locale-switch.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-logo.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-min-booking-notice.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-min-cancellation-notice.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-notification.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-notification.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-organizer-confirmation-card.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-page-name.entry.esm.js.map +1 -1
- package/dist/nylas-web-elements/nylas-page-name.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-page-name.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-page-styling.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-participant-booking-calendars.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-participants-custom-availability.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-reminder-emails.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-reminder-time.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-scheduler-editor.entry.esm.js.map +1 -1
- package/dist/nylas-web-elements/nylas-scheduler-editor.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-scheduler-editor.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-scheduling-method.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-scheduling.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-select-event-type.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-selected-event-card.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-specific-time-availability-picker.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-time-window-picker.entry.esm.js.map +1 -1
- package/dist/nylas-web-elements/nylas-time-window-picker.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-time-window-picker.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-timeslot-interval.entry.esm.js.map +1 -1
- package/dist/nylas-web-elements/nylas-timeslot-interval.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-timeslot-interval.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-timeslot-picker.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-web-elements.esm.js +1 -1
- package/dist/nylas-web-elements/nylas-web-elements.esm.js.map +1 -1
- package/dist/nylas-web-elements/paintbrush-fill-icon.entry.js +1 -1
- package/dist/nylas-web-elements/paintbrush-icon.entry.js +1 -1
- package/dist/nylas-web-elements/people-icon.entry.js +1 -1
- package/dist/nylas-web-elements/person-clipboard-icon.entry.js +1 -1
- package/dist/nylas-web-elements/person-icon.entry.js +1 -1
- package/dist/nylas-web-elements/play-icon.entry.js +1 -1
- package/dist/nylas-web-elements/plus-icon.entry.js +1 -1
- package/dist/nylas-web-elements/radio-button-group.entry.esm.js.map +1 -1
- package/dist/nylas-web-elements/radio-button-group.entry.js +1 -1
- package/dist/nylas-web-elements/radio-button-group.entry.js.map +1 -1
- package/dist/nylas-web-elements/refresh-icon.entry.js +1 -1
- package/dist/nylas-web-elements/{register-component-BHk70oxk.js → register-component-Blj8K64f.js} +2 -2
- package/dist/nylas-web-elements/{register-component-BHk70oxk.js.map → register-component-Blj8K64f.js.map} +1 -1
- package/dist/nylas-web-elements/reply-all-icon.entry.js +1 -1
- package/dist/nylas-web-elements/reply-icon.entry.js +1 -1
- package/dist/nylas-web-elements/search-icon.entry.js +1 -1
- package/dist/nylas-web-elements/select-dropdown.entry.esm.js.map +1 -1
- package/dist/nylas-web-elements/select-dropdown.entry.js +1 -1
- package/dist/nylas-web-elements/select-dropdown.entry.js.map +1 -1
- package/dist/nylas-web-elements/sent-icon.entry.js +1 -1
- package/dist/nylas-web-elements/spam-icon.entry.js +1 -1
- package/dist/nylas-web-elements/star-icon.entry.js +1 -1
- package/dist/nylas-web-elements/stop-icon.entry.js +1 -1
- package/dist/nylas-web-elements/textarea-component.entry.esm.js.map +1 -1
- package/dist/nylas-web-elements/textarea-component.entry.js +1 -1
- package/dist/nylas-web-elements/textarea-component.entry.js.map +1 -1
- package/dist/nylas-web-elements/time-period-selector.entry.js +1 -1
- package/dist/nylas-web-elements/toggle-switch.entry.js +1 -1
- package/dist/nylas-web-elements/tooltip-component.entry.js +1 -1
- package/dist/nylas-web-elements/translate-icon.entry.js +1 -1
- package/dist/nylas-web-elements/trash-fill-icon.entry.js +1 -1
- package/dist/nylas-web-elements/trash-icon.entry.js +1 -1
- package/dist/nylas-web-elements/underline-icon.entry.js +1 -1
- package/dist/nylas-web-elements/{utils-Bj5Y75fX.js → utils-DhmCcrVs.js} +3 -3
- package/dist/nylas-web-elements/{utils-Bj5Y75fX.js.map → utils-DhmCcrVs.js.map} +1 -1
- package/dist/nylas-web-elements/warning-icon.entry.js +1 -1
- package/dist/nylas-web-elements/zoom-icon.entry.js +1 -1
- package/dist/types/components/design-system/input-component/input-component.d.ts +1 -0
- package/dist/types/components/design-system/multi-select-dropdown/multi-select-dropdown.d.ts +1 -0
- package/dist/types/components/design-system/textarea-component/textarea-component.d.ts +1 -0
- package/dist/types/components/scheduler-editor/nylas-customize-booking-settings/nylas-customize-booking-settings.d.ts +1 -1
- package/dist/types/components/scheduler-editor/nylas-time-window-picker/nylas-time-window-picker.d.ts +1 -0
- package/dist/types/components.d.ts +4 -4
- package/package.json +3 -3
- package/readme.md +1 -1
- package/dist/nylas-web-elements/index-B-KMpdMZ.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,a as t,h as n,d as i,e as s}from"./index-B-KMpdMZ.js";import{R as r}from"./register-component-BHk70oxk.js";import{d,u as a,t as o,b as c,J as l,i as m,A as p}from"./utils-Bj5Y75fX.js";import{T as u}from"./constants-DhnshuDN.js";import{c as v}from"./customParseFormat-Bk5PI6Cs.js";const h=':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}div.nylas-event-timeslot label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:16px;font-style:normal;font-weight:400;line-height:150%}div.nylas-event-timeslot div.date-time-input div.date-time-picker{display:flex;gap:32px}@media screen and (max-width: 768px){div.nylas-event-timeslot div.date-time-input div.date-time-picker{flex-direction:column;gap:16px}}div.nylas-event-timeslot div.date-time-input div.date-time-picker nylas-date-component{width:224px}@media screen and (max-width: 768px){div.nylas-event-timeslot div.date-time-input div.date-time-picker nylas-date-component{width:100%}}div.nylas-event-timeslot div.date-time-input div.date-time-picker nylas-date-component:not(.error)::part(ic__date){border-color:var(--nylas-base-200)}div.nylas-event-timeslot div.date-time-input div.date-time-picker nylas-date-component::part(ic__date){height:50px}div.nylas-event-timeslot div.date-time-input div.date-time-picker div.time-range{display:flex;gap:8px;align-items:flex-start}div.nylas-event-timeslot div.date-time-input div.date-time-picker div.time-range span{margin:12px 0 0 6px;display:inline-flex;align-items:flex-start}@media screen and (max-width: 768px){div.nylas-event-timeslot div.date-time-input div.date-time-picker div.time-range{display:grid;grid-template-columns:1fr 20px 1fr}div.nylas-event-timeslot div.date-time-input div.date-time-picker div.time-range nylas-time-window-picker::part(time-picker){width:-webkit-fill-available}div.nylas-event-timeslot div.date-time-input div.date-time-picker div.time-range nylas-time-window-picker::part(time-input){width:calc(100% - 8px)}}div.nylas-event-timeslot div.date-time-input div.date-time-picker select-dropdown{width:fit-content}div.nylas-event-timeslot div.date-time-input div.date-time-picker select-dropdown::part(sd_dropdown){position:relative}div.nylas-event-timeslot div.date-time-input div.date-time-picker select-dropdown::part(sd_dropdown-button){border:none;padding:14px;justify-content:flex-start}div.nylas-event-timeslot div.date-time-input div.date-time-picker select-dropdown::part(sd_dropdown-button):hover{border:none;outline:none;color:var(--nylas-primary)}@media screen and (max-width: 768px){div.nylas-event-timeslot div.date-time-input div.date-time-picker select-dropdown{width:-webkit-fill-available}div.nylas-event-timeslot div.date-time-input div.date-time-picker select-dropdown::part(sd_dropdown-button-selected-label){max-width:fit-content}div.nylas-event-timeslot div.date-time-input div.date-time-picker select-dropdown::part(sd_dropdown-content){right:unset;width:unset}}div.nylas-event-timeslot div.date-time-input div.recurrence-options{margin:8px 0}div.nylas-event-timeslot div.date-time-input div.recurrence-options select-dropdown::part(sd_dropdown){position:relative}div.nylas-event-timeslot div.date-time-input div.recurrence-options select-dropdown::part(sd_dropdown-button){width:fit-content;padding:14px;border-color:var(--nylas-base-200)}div.nylas-event-timeslot div.date-time-input div.recurrence-options select-dropdown::part(sd_dropdown-button):hover{color:var(--nylas-primary)}div.nylas-event-timeslot div.date-time-input div.recurrence-options select-dropdown::part(sd_dropdown-content){width:fit-content}div.nylas-event-timeslot div.date-time-input div.recurrence-options select-dropdown::part(sd_dropdown-button-selected-label){max-width:100%;width:fit-content;font-size:16px}@media screen and (max-width: 768px){div.nylas-event-timeslot div.date-time-input div.recurrence-options select-dropdown{width:-webkit-fill-available}div.nylas-event-timeslot div.date-time-input div.recurrence-options select-dropdown::part(sd_dropdown-button-selected-label){max-width:254px;width:fit-content}div.nylas-event-timeslot div.date-time-input div.recurrence-options select-dropdown::part(sd_dropdown-content){right:unset;width:unset}}@media screen and (max-width: 412px){div.nylas-event-timeslot div.date-time-input div.recurrence-options select-dropdown::part(sd_dropdown-button-selected-label){max-width:240px}}div.nylas-event-timeslot div.date-time-input div.recurrence-options div.custom-recurrence-time-period,div.nylas-event-timeslot div.date-time-input div.recurrence-options div.recurrence-type,div.nylas-event-timeslot div.date-time-input div.recurrence-options div.recurrence-end{display:grid;align-items:center;gap:16px;grid-template-columns:128px 1fr;margin-bottom:8px}div.nylas-event-timeslot div.date-time-input div.recurrence-options div.custom-recurrence-time-period select-dropdown::part(sd_dropdown-button),div.nylas-event-timeslot div.date-time-input div.recurrence-options div.recurrence-type select-dropdown::part(sd_dropdown-button),div.nylas-event-timeslot div.date-time-input div.recurrence-options div.recurrence-end select-dropdown::part(sd_dropdown-button){border-color:var(--nylas-base-200)}@media screen and (max-width: 768px){div.nylas-event-timeslot div.date-time-input div.recurrence-options div.custom-recurrence-time-period,div.nylas-event-timeslot div.date-time-input div.recurrence-options div.recurrence-type,div.nylas-event-timeslot div.date-time-input div.recurrence-options div.recurrence-end{grid-template-columns:1fr;gap:4px;margin:16px 0}}div.nylas-event-timeslot div.date-time-input div.recurrence-options div.custom-recurrence-time-period time-period-selector::part(id_dropdown-input),div.nylas-event-timeslot div.date-time-input div.recurrence-options div.recurrence-type time-period-selector::part(id_dropdown-input),div.nylas-event-timeslot div.date-time-input div.recurrence-options div.recurrence-end time-period-selector::part(id_dropdown-input){padding:16px}div.nylas-event-timeslot div.date-time-input div.recurrence-options div.custom-recurrence-time-period time-period-selector input-dropdown:hover,div.nylas-event-timeslot div.date-time-input div.recurrence-options div.recurrence-type time-period-selector input-dropdown:hover,div.nylas-event-timeslot div.date-time-input div.recurrence-options div.recurrence-end time-period-selector input-dropdown:hover{border:1px solid var(--nylas-primary);outline:1px solid transparent}div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.days{margin:16px 0;display:flex;gap:16px;align-items:center}div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.days div.buttons{display:flex;gap:8px;margin:8px 0}div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.days div.buttons button{border-radius:50%;border:none;height:24px;width:24px;color:var(--nylas-base-800);cursor:pointer;background:var(--nylas-base-100)}div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.days div.buttons button:hover{background-color:var(--nylas-base-500);color:var(--nylas-base-0)}div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.days div.buttons button.selected{background-color:var(--nylas-primary);color:var(--nylas-base-0)}div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.days div.buttons button:active{background-color:var(--nylas-base-600);color:var(--nylas-base-0)}div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.days,div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.custom-recurrence-ends,div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.month-recurrence{display:grid;align-items:center;gap:16px;grid-template-columns:128px 1fr}@media screen and (max-width: 768px){div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.days,div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.custom-recurrence-ends,div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.month-recurrence{grid-template-columns:1fr;gap:4px;margin:16px 0}}div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.custom-recurrence-ends #custom-recurrence-end-type::part(sd_dropdown-button){padding:16px}div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.custom-recurrence{display:flex;gap:16px;align-items:baseline}@media screen and (max-width: 768px){div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.custom-recurrence{flex-direction:column;align-items:flex-start;gap:0}}div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.custom-recurrence div.custom-recurrence-end-after{display:flex;gap:8px;align-items:center}@media screen and (max-width: 768px){div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.custom-recurrence div.custom-recurrence-end-after{flex-direction:column;align-items:flex-start}}div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.custom-recurrence div.custom-recurrence-end-after #recurrence-end-after::part(netimeslot__input-textfield),div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.custom-recurrence div.custom-recurrence-end-after #recurrence-end-after::part(ic__input){border-color:var(--nylas-base-200)}div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.custom-recurrence nylas-date-component::part(ic__date){padding:0 16px;height:52px;border:1px solid var(--nylas-base-200)}';var y=undefined&&undefined.__decorate||function(e,t,n,i){var s=arguments.length,r=s<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,n):i,d;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)if(d=e[a])r=(s<3?d(r):s>3?d(t,n,r):d(t,n))||r;return s>3&&r&&Object.defineProperty(t,n,r),r};var f=undefined&&undefined.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};d.extend(v);d.extend(a);d.extend(o);const b={day:"daily",week:"weekly",month:"monthly",year:"yearly"};const w=class{constructor(n){e(this,n);this.valueChanged=t(this,"valueChanged",7);this.timeWindowFormError=t(this,"timeWindowFormError",7);this.dateTimeInputError=t(this,"dateTimeInputError",7);if(n.$hostElement$["s-ei"]){this.internals=n.$hostElement$["s-ei"]}else{this.internals=n.$hostElement$.attachInternals();n.$hostElement$["s-ei"]=this.internals}this.name="event-timeslot";this.timeRangeError=false;this.recurrenceOptions=[];this.repeatEveryInterval=1;this.repeatEveryFrequency="week";this.repeatOnDays=[];this.repeatMonthlySameDate=true;this.repeatEndType="never";this.repeatEndAfter=1;this.monthRecurrenceOptions=[];this.hasDateTimeInputError=false}connectedCallback(){c("nylas-event-timeslot","connectedCallback")}disconnectedCallback(){c("nylas-event-timeslot","disconnectedCallback")}componentWillLoad(){c("nylas-event-timeslot","componentWillLoad");this.host.setAttribute("name",this.name)}componentDidLoad(){c("nylas-event-timeslot","componentDidLoad");if(this.initialValue){const{when:e,recurrence:t}=this.initialValue;if(e){this.selectedDate=d.unix(e.start_time).tz(e.start_timezone).format("YYYY-MM-DD");this.selectedStartTime=d.unix(e.start_time).tz(e.start_timezone).format("hh:mma");this.selectedEndTime=d.unix(e.end_time).tz(e.end_timezone).format("hh:mma");this.selectedTimezone=e.start_timezone}else{this.selectedDate=(new Date).toISOString().split("T")[0];const e=this.getSuggestedTime();this.selectedStartTime=e.startTime;this.selectedEndTime=e.endTime;this.selectedTimezone=Intl.DateTimeFormat().resolvedOptions().timeZone}if(t&&t.length>0){this.selectedRrule=t[0];const e=t[0]?.split(";")?.find((e=>e.includes("COUNT")));if(e){this.repeatEndAfter=parseInt(e.split("=")[1])}const n=t[0]?.split(";")?.find((e=>e.includes("BYDAY")));if(n){this.repeatOnDays=n.split("=")[1].split(",")}const i=t[0]?.split(";")?.find((e=>e.includes("UNTIL")));if(i){const e=d(i.split("=")[1],"YYYYMMDDTHHmmss").toDate();this.repeatEndOn=d(e).toISOString().split("T")[0];this.repeatEndType="on"}const s=this.getRecurrenceTypeFromRrule(t[0]);this.selectedRecurrenceType=s||"none"}else{this.selectedRecurrenceType="none";this.selectedRrule=l(this.selectedDate,this.selectedRecurrenceType,undefined,undefined,this.selectedTimezone)}}else{this.selectedDate=(new Date).toISOString().split("T")[0];const e=this.getSuggestedTime();this.selectedStartTime=e.startTime;this.selectedEndTime=e.endTime;this.selectedTimezone=Intl.DateTimeFormat().resolvedOptions().timeZone;this.selectedRecurrenceType="none";this.selectedRrule=l(this.selectedDate,this.selectedRecurrenceType,undefined,undefined,this.selectedTimezone)}this.recurrenceOptions=this.generateRecurrenceOptions(this.selectedDate,this.selectedTimezone);this.monthRecurrenceOptions=this.getMonthRecurrenceOptions(this.selectedDate,this.selectedTimezone);this.handleValueChanged(true)}elementNameChangedHandler(e){c("nylas-event-timeslot","elementNameChangedHandler",e);this.host.setAttribute("name",e)}selectedLanguageChangedHandler(e,t){if(e===t)return;m.changeLanguage(e)}themeConfigChangedHandler(e,t){if(e===t)return;this.applyThemeConfig(e)}applyThemeConfig(e){if(e){for(const[t,n]of Object.entries(e)){this.host.style.setProperty(`${t}`,n)}}}getOrdinalSuffix(e){const t=["th","st","nd","rd"];const n=e%100;return e+(t[(n-20)%10]||t[n]||t[0])}getRecurrenceTypeFromRrule(e){if(e.includes("INTERVAL"))return"custom";if(e.includes("FREQ=DAILY"))return"daily";if(e.includes("FREQ=WEEKLY"))return"weekly";if(e.includes("FREQ=MONTHLY"))return"monthly";if(e.includes("FREQ=YEARLY"))return"yearly";return undefined}generateRecurrenceOptions(e,t){const n=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];const i=d.tz(e,t);const s=n[i.day()];const r=i.date();const a=Math.ceil(r/7);return[{label:m.t("nylasEventTimeslot.recurrenceOptions.none"),value:"none"},{label:m.t("nylasEventTimeslot.recurrenceOptions.daily"),value:"daily"},{label:m.t("nylasEventTimeslot.recurrenceOptions.weekly",{dayOfWeek:s}),value:"weekly"},{label:m.t("nylasEventTimeslot.recurrenceOptions.monthly",{dayOfMonth:`${this.getOrdinalSuffix(a)} ${s}`}),value:"monthly"},{label:m.t("nylasEventTimeslot.recurrenceOptions.yearly",{dateOfMonth:`${i.format("MMMM D")}`}),value:"yearly"},{label:m.t("nylasEventTimeslot.recurrenceOptions.custom"),value:"custom"}]}getMonthRecurrenceOptions(e,t){const n=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];const i=d.tz(e,t);const s=n[i.day()];const r=i.date();const a=Math.ceil(r/7);return[{label:m.t("nylasEventTimeslot.recurrenceOptions.monthOnDay",{date:r}),value:"monthly-same-date"},{label:m.t("nylasEventTimeslot.recurrenceOptions.monthly",{dayOfMonth:`${this.getOrdinalSuffix(a)} ${s}`}),value:"monthly"}]}getSuggestedTime(){const e=d();const t=e.minute();const n=t<=30?30:60;const i=e.set("minute",n).set("second",0);const s=i.add(30,"minute");return{startTime:i.format("hh:mma"),endTime:s.format("hh:mma")}}getTimezoneLabelHTML(e){const t=p(e);return n("span",{class:"timezone-label",style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"-webkit-fill-available"}},u[e]," ",n("span",{class:"timezone-offset",style:{fontSize:"14px",fontWeight:"400",color:"var(--nylas-base-500)"}},t))}isStartTimeAfterEndTime(e,t){const n=d(e,"hh:mma");const i=d(t,"hh:mma");return n.isAfter(i)}isStartTimeEqualToEndTime(e,t){const n=d(e,"hh:mma");const i=d(t,"hh:mma");return n.isSame(i)}isStartTimeBeforeCurrentDate(e,t,n){const i=d.tz(`${e} ${t}`,"YYYY-MM-DD hh:mma",n);return i.isBefore(d())}validateDateTimeInput(e,t,n){const i=d.tz(`${e} ${t}`,"YYYY-MM-DD hh:mma",n);const s=i.isBefore(d());return{isValid:!s,errorMessage:s?m.t("nylasEventTimeslot.errors.startTimeBeforeCurrentDate"):""}}getStartAndEndTimes(){const e=d.tz(`${this.selectedDate} ${this.selectedStartTime}`,"YYYY-MM-DD hh:mma",this.selectedTimezone).toDate();const t=d.tz(`${this.selectedDate} ${this.selectedEndTime}`,"YYYY-MM-DD hh:mma",this.selectedTimezone).toDate();return{start_time:Math.round(e.getTime()/1e3),end_time:Math.round(t.getTime()/1e3)}}getCustomOptions(){if(this.selectedRecurrenceType!=="custom"){return undefined}const e=b[this.repeatEveryFrequency];return{frequency:e,interval:this.repeatEveryInterval,daysOfWeek:this.repeatEveryFrequency==="week"?this.repeatOnDays:undefined,monthlySameDate:this.repeatEveryFrequency==="month"?this.repeatMonthlySameDate:undefined,end:{type:this.repeatEndType,count:this.repeatEndType==="after"?this.repeatEndAfter:undefined,date:this.repeatEndType==="on"?this.repeatEndOn:undefined}}}handleValueChanged(e=false){const t=this.getCustomOptions();this.selectedRrule=l(this.selectedDate,this.selectedRecurrenceType,this.repeatEndOn,t,this.selectedTimezone);const{start_time:n,end_time:i}=this.getStartAndEndTimes();const s={when:{start_time:n,end_time:i,start_timezone:this.selectedTimezone,end_timezone:this.selectedTimezone},recurrence:this.selectedRrule?[this.selectedRrule]:[]};this.internals.setFormValue(JSON.stringify(s),this.name);if(!e){this.valueChanged.emit({value:JSON.stringify(s),name:this.name})}}setTime(e){const{key:t,value:n}=e.detail;if(t==="event-timeslot-start-time"){this.selectedStartTime=n}else if(t==="event-timeslot-end-time"){this.selectedEndTime=n}const i=this.isStartTimeAfterEndTime(this.selectedStartTime,this.selectedEndTime);const s=this.isStartTimeEqualToEndTime(this.selectedStartTime,this.selectedEndTime);const r=this.validateDateTimeInput(this.selectedDate,this.selectedStartTime,this.selectedTimezone);const d=!r.isValid;this.timeRangeError=i||s||d;let a="";if(i){a=m.t("nylasEventTimeslot.errors.invalidTimeRange")}else if(s){a=m.t("nylasEventTimeslot.errors.startTimeSameAsEndTime")}else if(d){a=r.errorMessage}else{a=""}this.timeWindowFormError.emit({key:this.name,message:a,uniqueIdentifier:"time-range"});if(a){return}this.handleValueChanged()}nylasFormDropdownChangedHandler(e){const{name:t,value:n}=e.detail;if(t==="timezone"){this.selectedTimezone=n;const e=d(this.selectedDate);const t=this.validateDateTimeInput(e.format("YYYY-MM-DD"),this.selectedStartTime,this.selectedTimezone);this.hasDateTimeInputError=!t.isValid;this.dateTimeInputError.emit({key:this.name,message:t.errorMessage});if(!t.isValid){return}}else if(t==="recurrence-type"){this.selectedRecurrenceType=n}else if(t==="month-recurrence-type"){this.repeatMonthlySameDate=n==="monthly-same-date"}else if(t==="custom-recurrence-end-type"){this.repeatEndType=n}this.handleValueChanged()}nylasFormInputChangedHandler(e){const{name:t,value:n}=e.detail;if(t==="date-time-input"){const e=d(n);const t=this.validateDateTimeInput(e.format("YYYY-MM-DD"),this.selectedStartTime,this.selectedTimezone);this.hasDateTimeInputError=!t.isValid;this.dateTimeInputError.emit({key:this.name,message:t.errorMessage});if(!t.isValid){return}this.selectedDate=e.format("YYYY-MM-DD");this.recurrenceOptions=this.generateRecurrenceOptions(this.selectedDate,this.selectedTimezone);this.monthRecurrenceOptions=this.getMonthRecurrenceOptions(this.selectedDate,this.selectedTimezone)}else if(t==="recurrence-end-date"||t==="custom-recurrence-end-date"){const i=e.detail?.error||"";this.timeWindowFormError.emit({key:this.name,message:i,uniqueIdentifier:t});this.repeatEndOn=n}else if(t==="recurrence-end-after"){const e=parseInt(n);if(e<1||isNaN(e)){this.timeWindowFormError.emit({key:this.name,message:m.t("fixFormErrors")});return}this.repeatEndAfter=e}this.handleValueChanged()}timePeriodChangedHandler(e){const{number:t,period:n}=e.detail;this.repeatEveryInterval=t;this.repeatEveryFrequency=n;if(n==="month"){this.monthRecurrenceOptions=this.getMonthRecurrenceOptions(this.selectedDate,this.selectedTimezone)}this.handleValueChanged()}render(){const e=this.currentUser?.provider==="icloud";const t=this.recurrenceOptions.find((e=>e.value===this.selectedRecurrenceType));const s=Object.keys(u).map((e=>({labelHTML:this.getTimezoneLabelHTML(e),label:u[e],value:e})));const r=s.find((e=>e.value===this.selectedTimezone));const a=[{label:m.t("nylasEventTimeslot.customRecurrence.endsOptions.never"),value:"never"},{label:m.t("nylasEventTimeslot.customRecurrence.endsOptions.on"),value:"on"},{label:m.t("nylasEventTimeslot.customRecurrence.endsOptions.after"),value:"after"}];const o=d(this.selectedDate).add(1,"year").toISOString().split("T")[0];const c=this.repeatEveryFrequency==="week"?4:this.repeatEveryFrequency==="month"?12:5;this.repeatEndOn=this.repeatEndOn||o;this.repeatEndAfter=this.repeatEndAfter||c;const l=d().tz(this.selectedTimezone);return n(i,{key:"25e1347b784f9d7407e9d658c9628b29eadf29a1"},n("div",{key:"a5e9ddbfb77543405327ebcf40e9d8d13c69bf69",class:"nylas-event-timeslot",part:"netimeslot"},n("label",{key:"65067ee85658ee88e6041d0a40e5dd8770f1ba1b",htmlFor:"date-time-input"},m.t("nylasEventTimeslot.dateTimeLabel")),n("div",{key:"4005a41b1c29c2953cd61229c6c460371edb80f3",class:"date-time-input",part:"netimeslot__date-time-input"},n("div",{key:"b1a5f085c7e9806ccaede81a2c04e7d7629202f6",class:"date-time-picker",part:"netimeslot__date-time-picker"},n("nylas-date-component",{key:"c22750cb44aa61a5a885744ad4336c700399c6e4",minDate:d().tz(this.selectedTimezone).toISOString().split("T")[0],name:"date-time-input",defaultValue:this.selectedDate,id:"date-time-input",class:{error:this.hasDateTimeInputError},required:true,hasError:this.hasDateTimeInputError,themeConfig:this.themeConfig}),n("div",{key:"cad29d96272177edaf6cf0403cbc5df3652d3dad",class:"time-range",part:"netimeslot__time-range"},n("nylas-time-window-picker",{id:"event-timeslot-start-time",hasError:this.timeRangeError,time:this.selectedStartTime,language:this.selectedLanguage,name:"event-timeslot-start-time",key:"event-timeslot-start-time",themeConfig:this.themeConfig,exportparts:"time-picker: nap__time-picker-container, time-input: nap__time-picker-input, times: nap__time-picker-times"}),n("span",{key:"fcb0020de2d5d65ea11ff2f14dc798c6693e8e20"},"–"),n("nylas-time-window-picker",{id:"event-timeslot-end-time",hasError:this.timeRangeError,time:this.selectedEndTime,language:this.selectedLanguage,name:"event-timeslot-end-time",key:"event-timeslot-end-time",minimumStartTime:this.selectedStartTime,themeConfig:this.themeConfig,exportparts:"time-picker: nap__time-picker-container, time-input: nap__time-picker-input, times: nap__time-picker-times"})),r?.label&&n("select-dropdown",{key:"4336bd7b5b216437d903ccb4703c79691eed2100",searchPlaceholder:m.t("search"),name:"timezone",exportparts:"sd_dropdown: nap__timezone-container, sd_dropdown-button: nap__timezone-button, sd_dropdown-content: nap__timezone-dropdown-content",options:s,withChevron:false,defaultSelectedOption:r,themeConfig:this.themeConfig},n("span",{key:"f3720e371a3da1fa4cae378ff807bd086de4dc3c",slot:"select-icon"},n("globe-icon",{key:"dd297a89a1dc71894e929fb27d8e68c10599526e",width:"20",height:"20"})))),!e&&n("div",{key:"d81aea27e43a3d5d60f1a26f68572caacee2798f",class:"recurrence-options",part:"netimeslot__recurrence-options"},t&&t?.label&&n("div",{key:"843e3bebab7fee82b56d04e03a88b89ac6969817",class:"recurrence-type",part:"netimeslot__recurrence-type"},n("label",{key:"f413bdd3300ee919c42091d7dd629614f653c79b",htmlFor:"recurrence-type"},m.t("nylasEventTimeslot.recurrenceLabel")),n("select-dropdown",{key:"eadf902a645a910587232169866d3113b69a4da8",withSearch:false,id:"recurrence-type",name:"recurrence-type",options:this.recurrenceOptions,themeConfig:this.themeConfig,defaultSelectedOption:t,exportparts:"sd_dropdown: netimeslot__dropdown, sd_dropdown-button: netimeslot__dropdown-button, sd_dropdown-content: netimeslot__dropdown-content"})),this.selectedRecurrenceType!=="custom"&&this.selectedRecurrenceType!=="none"&&n("div",{key:"83929da0354db332902df655fd13e6a9faabc836",class:"recurrence-end",part:"netimeslot__recurrence-end"},n("label",{key:"df9807c1c1f6021f959093690530d4e8c3bc97c8"},m.t("nylasEventTimeslot.endDate")),n("nylas-date-component",{key:"d9c66539af5a9989535b247563f9dd148d15e712",name:"recurrence-end-date",minDate:l.toISOString().split("T")[0],defaultValue:this.repeatEndOn||o,id:"recurrence-end-date",required:true,themeConfig:this.themeConfig})),this.selectedRecurrenceType==="custom"&&n("div",{key:"be20b947453865db6824b400412def5989c7aec1",class:"custom-recurrence-time-period",part:"netimeslot__custom-recurrence"},n("label",{key:"35c73a7be217e7cdce90dd325fbfb693750525a1",htmlFor:""},m.t("nylasEventTimeslot.customRecurrence.repeatEvery")),n("time-period-selector",{key:"f9b90e987644ccfafcadd6fe2d42adebc565551e",id:"custom-recurrence-time-period",exportparts:"tps__number-dropdown: netimeslot__number-dropdown, tps__number-dropdown-button: netimeslot__number-dropdown-button, tps__number-dropdown-content: netimeslot__number-dropdown-content, tps__period-dropdown: netimeslot__period-dropdown, tps__period-dropdown-button: netimeslot__period-dropdown-button, tps__period-dropdown-content: netimeslot__period-dropdown-content",timePeriods:[{value:"day",label:m.t("timePeriod",{context:"day"})},{value:"week",label:m.t("timePeriod",{context:"week"})},{value:"month",label:m.t("timePeriod",{context:"month"})},{value:"year",label:m.t("timePeriod",{context:"year"})}],themeConfig:this.themeConfig,defaultSelectedNumber:this.repeatEveryInterval,defaultSelectedPeriod:this.repeatEveryFrequency})),n("div",{key:"ab344382ddb1ea7b350286462b888eb9ddc58f08",class:"repeat-on"},this.selectedRecurrenceType==="custom"&&this.repeatEveryFrequency==="week"&&n("div",{key:"57d24db360fabcda9dd6e63e02e26b8a99c1ede4",class:"days"},n("label",{key:"630b743b968d897a605eb07cde472f9c895df580"},m.t("nylasEventTimeslot.customRecurrence.repeatOn")),n("div",{key:"ff67db7dd5834bfb2b498cd9316f8d2830854c58",class:"buttons"},[{label:"S",value:"SU",title:"Sunday"},{label:"M",value:"MO",title:"Monday"},{label:"T",value:"TU",title:"Tuesday"},{label:"W",value:"WE",title:"Wednesday"},{label:"T",value:"TH",title:"Thursday"},{label:"F",value:"FR",title:"Friday"},{label:"S",value:"SA",title:"Saturday"}].map((e=>n("button",{class:{selected:this.repeatOnDays.includes(e.value)},title:e.title,onClick:()=>{this.repeatOnDays=this.repeatOnDays.includes(e.value)?this.repeatOnDays.filter((t=>t!==e.value)):[...this.repeatOnDays,e.value];this.handleValueChanged()}},e.label))))),this.selectedRecurrenceType==="custom"&&this.repeatEveryFrequency==="month"&&n("div",{key:"ef5bf142d0d197d5519f5168199307ac1d1b9a15",class:"month-recurrence"},n("span",{key:"b4199f4e2a226d57f43f77cc13d1c23f8ed149c4"}),n("select-dropdown",{key:"d5505db8bcbfcff77d536b1145f0dcdd90a60249",withSearch:false,id:"month-recurrence-type",name:"month-recurrence-type",options:this.monthRecurrenceOptions,themeConfig:this.themeConfig,defaultSelectedOption:this.repeatMonthlySameDate?this.monthRecurrenceOptions[0]:this.monthRecurrenceOptions[1],exportparts:"sd_dropdown: netimeslot__dropdown, sd_dropdown-button: netimeslot__dropdown-button, sd_dropdown-content: netimeslot__dropdown-content"})),n("div",{key:"1012f6a1bc6d3a59b821daef13df2a4e07d449bb",class:"custom-recurrence"},this.selectedRecurrenceType==="custom"&&n("div",{key:"b45bbb50274b70db0054c79984814901cafebb25",class:"custom-recurrence-ends"},n("label",{key:"38c2c971d141ec286b2fffcfb91d317d6c1573ea",htmlFor:"recurrence-type"},m.t("nylasEventTimeslot.customRecurrence.ends")),n("select-dropdown",{key:"a205a4b8ccca5d2e1475deab6157ba285a523ee9",withSearch:false,id:"custom-recurrence-end-type",name:"custom-recurrence-end-type",options:a,themeConfig:this.themeConfig,defaultSelectedOption:a.find((e=>e.value===this.repeatEndType)),exportparts:"sd_dropdown: netimeslot__dropdown, sd_dropdown-button: netimeslot__dropdown-button, sd_dropdown-content: netimeslot__dropdown-content"})),this.selectedRecurrenceType==="custom"&&this.repeatEndType==="on"&&n("div",{key:"3c69aed3261bf11018f3d6e6cc14f5a2d368aca6"},n("nylas-date-component",{key:"eefd526dbe6f3718881e5a38e3c03feb5a0ad091",name:"custom-recurrence-end-date",minDate:l.toISOString().split("T")[0],defaultValue:this.repeatEndOn||o,id:"custom-recurrence-end-date",required:true,themeConfig:this.themeConfig})),this.selectedRecurrenceType==="custom"&&this.repeatEndType==="after"&&n("div",{key:"4a53b9331f7763dfe0710bb51410d6a51dc6aac1",class:"custom-recurrence-end-after"},n("input-component",{key:"62bfeefdbf9028d004e912352c223edd1d4eaa86",name:"recurrence-end-after",id:"recurrence-end-after",type:"number",minValue:1,themeConfig:this.themeConfig,defaultValue:c.toString(),exportparts:"ic_input: netimeslot__input-textfield"}),n("span",{key:"550ca54eb104aa706e07e11911b1040b4ee17c1e"},m.t("nylasEventTimeslot.customRecurrence.occurrences")))))))))}static get formAssociated(){return true}get host(){return s(this)}static get watchers(){return{name:["elementNameChangedHandler"],selectedLanguage:["selectedLanguageChangedHandler"],themeConfig:["themeConfigChangedHandler"]}}};y([r({name:"nylas-event-timeslot",stateToProps:new Map([["schedulerConfig.selectedLanguage","selectedLanguage"],["schedulerConfig.currentUser","currentUser"],["schedulerConfig.themeConfig","themeConfig"]]),eventToProps:{valueChanged:async(e,t)=>{c("nylas-event-timeslot","valueChanged",e.detail)}},fireRegisterEvent:true}),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",void 0)],w.prototype,"render",null);w.style=h;export{w as nylas_event_timeslot};
|
|
1
|
+
import{r as e,a as t,h as n,d as i,e as s}from"./index-Cbn5rIwb.js";import{R as r}from"./register-component-Blj8K64f.js";import{d,u as a,t as o,b as c,J as l,i as m,A as p}from"./utils-DhmCcrVs.js";import{T as u}from"./constants-DhnshuDN.js";import{c as v}from"./customParseFormat-BJNMxHY2.js";const h=':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}div.nylas-event-timeslot label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:16px;font-style:normal;font-weight:400;line-height:150%}div.nylas-event-timeslot div.date-time-input div.date-time-picker{display:flex;gap:32px}@media screen and (max-width: 768px){div.nylas-event-timeslot div.date-time-input div.date-time-picker{flex-direction:column;gap:16px}}div.nylas-event-timeslot div.date-time-input div.date-time-picker nylas-date-component{width:224px}@media screen and (max-width: 768px){div.nylas-event-timeslot div.date-time-input div.date-time-picker nylas-date-component{width:100%}}div.nylas-event-timeslot div.date-time-input div.date-time-picker nylas-date-component:not(.error)::part(ic__date){border-color:var(--nylas-base-200)}div.nylas-event-timeslot div.date-time-input div.date-time-picker nylas-date-component::part(ic__date){height:50px}div.nylas-event-timeslot div.date-time-input div.date-time-picker div.time-range{display:flex;gap:8px;align-items:flex-start}div.nylas-event-timeslot div.date-time-input div.date-time-picker div.time-range span{margin:12px 0 0 6px;display:inline-flex;align-items:flex-start}@media screen and (max-width: 768px){div.nylas-event-timeslot div.date-time-input div.date-time-picker div.time-range{display:grid;grid-template-columns:1fr 20px 1fr}div.nylas-event-timeslot div.date-time-input div.date-time-picker div.time-range nylas-time-window-picker::part(time-picker){width:-webkit-fill-available}div.nylas-event-timeslot div.date-time-input div.date-time-picker div.time-range nylas-time-window-picker::part(time-input){width:calc(100% - 8px)}}div.nylas-event-timeslot div.date-time-input div.date-time-picker select-dropdown{width:fit-content}div.nylas-event-timeslot div.date-time-input div.date-time-picker select-dropdown::part(sd_dropdown){position:relative}div.nylas-event-timeslot div.date-time-input div.date-time-picker select-dropdown::part(sd_dropdown-button){border:none;padding:14px;justify-content:flex-start}div.nylas-event-timeslot div.date-time-input div.date-time-picker select-dropdown::part(sd_dropdown-button):hover{border:none;outline:none;color:var(--nylas-primary)}@media screen and (max-width: 768px){div.nylas-event-timeslot div.date-time-input div.date-time-picker select-dropdown{width:-webkit-fill-available}div.nylas-event-timeslot div.date-time-input div.date-time-picker select-dropdown::part(sd_dropdown-button-selected-label){max-width:fit-content}div.nylas-event-timeslot div.date-time-input div.date-time-picker select-dropdown::part(sd_dropdown-content){right:unset;width:unset}}div.nylas-event-timeslot div.date-time-input div.recurrence-options{margin:8px 0}div.nylas-event-timeslot div.date-time-input div.recurrence-options select-dropdown::part(sd_dropdown){position:relative}div.nylas-event-timeslot div.date-time-input div.recurrence-options select-dropdown::part(sd_dropdown-button){width:fit-content;padding:14px;border-color:var(--nylas-base-200)}div.nylas-event-timeslot div.date-time-input div.recurrence-options select-dropdown::part(sd_dropdown-button):hover{color:var(--nylas-primary)}div.nylas-event-timeslot div.date-time-input div.recurrence-options select-dropdown::part(sd_dropdown-content){width:fit-content}div.nylas-event-timeslot div.date-time-input div.recurrence-options select-dropdown::part(sd_dropdown-button-selected-label){max-width:100%;width:fit-content;font-size:16px}@media screen and (max-width: 768px){div.nylas-event-timeslot div.date-time-input div.recurrence-options select-dropdown{width:-webkit-fill-available}div.nylas-event-timeslot div.date-time-input div.recurrence-options select-dropdown::part(sd_dropdown-button-selected-label){max-width:254px;width:fit-content}div.nylas-event-timeslot div.date-time-input div.recurrence-options select-dropdown::part(sd_dropdown-content){right:unset;width:unset}}@media screen and (max-width: 412px){div.nylas-event-timeslot div.date-time-input div.recurrence-options select-dropdown::part(sd_dropdown-button-selected-label){max-width:240px}}div.nylas-event-timeslot div.date-time-input div.recurrence-options div.custom-recurrence-time-period,div.nylas-event-timeslot div.date-time-input div.recurrence-options div.recurrence-type,div.nylas-event-timeslot div.date-time-input div.recurrence-options div.recurrence-end{display:grid;align-items:center;gap:16px;grid-template-columns:128px 1fr;margin-bottom:8px}div.nylas-event-timeslot div.date-time-input div.recurrence-options div.custom-recurrence-time-period select-dropdown::part(sd_dropdown-button),div.nylas-event-timeslot div.date-time-input div.recurrence-options div.recurrence-type select-dropdown::part(sd_dropdown-button),div.nylas-event-timeslot div.date-time-input div.recurrence-options div.recurrence-end select-dropdown::part(sd_dropdown-button){border-color:var(--nylas-base-200)}@media screen and (max-width: 768px){div.nylas-event-timeslot div.date-time-input div.recurrence-options div.custom-recurrence-time-period,div.nylas-event-timeslot div.date-time-input div.recurrence-options div.recurrence-type,div.nylas-event-timeslot div.date-time-input div.recurrence-options div.recurrence-end{grid-template-columns:1fr;gap:4px;margin:16px 0}}div.nylas-event-timeslot div.date-time-input div.recurrence-options div.custom-recurrence-time-period time-period-selector::part(id_dropdown-input),div.nylas-event-timeslot div.date-time-input div.recurrence-options div.recurrence-type time-period-selector::part(id_dropdown-input),div.nylas-event-timeslot div.date-time-input div.recurrence-options div.recurrence-end time-period-selector::part(id_dropdown-input){padding:16px}div.nylas-event-timeslot div.date-time-input div.recurrence-options div.custom-recurrence-time-period time-period-selector input-dropdown:hover,div.nylas-event-timeslot div.date-time-input div.recurrence-options div.recurrence-type time-period-selector input-dropdown:hover,div.nylas-event-timeslot div.date-time-input div.recurrence-options div.recurrence-end time-period-selector input-dropdown:hover{border:1px solid var(--nylas-primary);outline:1px solid transparent}div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.days{margin:16px 0;display:flex;gap:16px;align-items:center}div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.days div.buttons{display:flex;gap:8px;margin:8px 0}div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.days div.buttons button{border-radius:50%;border:none;height:24px;width:24px;color:var(--nylas-base-800);cursor:pointer;background:var(--nylas-base-100)}div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.days div.buttons button:hover{background-color:var(--nylas-base-500);color:var(--nylas-base-0)}div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.days div.buttons button.selected{background-color:var(--nylas-primary);color:var(--nylas-base-0)}div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.days div.buttons button:active{background-color:var(--nylas-base-600);color:var(--nylas-base-0)}div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.days,div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.custom-recurrence-ends,div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.month-recurrence{display:grid;align-items:center;gap:16px;grid-template-columns:128px 1fr}@media screen and (max-width: 768px){div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.days,div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.custom-recurrence-ends,div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.month-recurrence{grid-template-columns:1fr;gap:4px;margin:16px 0}}div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.custom-recurrence-ends #custom-recurrence-end-type::part(sd_dropdown-button){padding:16px}div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.custom-recurrence{display:flex;gap:16px;align-items:baseline}@media screen and (max-width: 768px){div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.custom-recurrence{flex-direction:column;align-items:flex-start;gap:0}}div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.custom-recurrence div.custom-recurrence-end-after{display:flex;gap:8px;align-items:center}@media screen and (max-width: 768px){div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.custom-recurrence div.custom-recurrence-end-after{flex-direction:column;align-items:flex-start}}div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.custom-recurrence div.custom-recurrence-end-after #recurrence-end-after::part(netimeslot__input-textfield),div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.custom-recurrence div.custom-recurrence-end-after #recurrence-end-after::part(ic__input){border-color:var(--nylas-base-200)}div.nylas-event-timeslot div.date-time-input div.recurrence-options div.repeat-on div.custom-recurrence nylas-date-component::part(ic__date){padding:0 16px;height:52px;border:1px solid var(--nylas-base-200)}';var y=undefined&&undefined.__decorate||function(e,t,n,i){var s=arguments.length,r=s<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,n):i,d;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)if(d=e[a])r=(s<3?d(r):s>3?d(t,n,r):d(t,n))||r;return s>3&&r&&Object.defineProperty(t,n,r),r};var f=undefined&&undefined.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};d.extend(v);d.extend(a);d.extend(o);const b={day:"daily",week:"weekly",month:"monthly",year:"yearly"};const w=class{constructor(n){e(this,n);this.valueChanged=t(this,"valueChanged",7);this.timeWindowFormError=t(this,"timeWindowFormError",7);this.dateTimeInputError=t(this,"dateTimeInputError",7);if(n.$hostElement$["s-ei"]){this.internals=n.$hostElement$["s-ei"]}else{this.internals=n.$hostElement$.attachInternals();n.$hostElement$["s-ei"]=this.internals}this.name="event-timeslot";this.timeRangeError=false;this.recurrenceOptions=[];this.repeatEveryInterval=1;this.repeatEveryFrequency="week";this.repeatOnDays=[];this.repeatMonthlySameDate=true;this.repeatEndType="never";this.repeatEndAfter=1;this.monthRecurrenceOptions=[];this.hasDateTimeInputError=false}connectedCallback(){c("nylas-event-timeslot","connectedCallback")}disconnectedCallback(){c("nylas-event-timeslot","disconnectedCallback")}componentWillLoad(){c("nylas-event-timeslot","componentWillLoad");this.host.setAttribute("name",this.name)}componentDidLoad(){c("nylas-event-timeslot","componentDidLoad");if(this.initialValue){const{when:e,recurrence:t}=this.initialValue;if(e){this.selectedDate=d.unix(e.start_time).tz(e.start_timezone).format("YYYY-MM-DD");this.selectedStartTime=d.unix(e.start_time).tz(e.start_timezone).format("hh:mma");this.selectedEndTime=d.unix(e.end_time).tz(e.end_timezone).format("hh:mma");this.selectedTimezone=e.start_timezone}else{this.selectedDate=(new Date).toISOString().split("T")[0];const e=this.getSuggestedTime();this.selectedStartTime=e.startTime;this.selectedEndTime=e.endTime;this.selectedTimezone=Intl.DateTimeFormat().resolvedOptions().timeZone}if(t&&t.length>0){this.selectedRrule=t[0];const e=t[0]?.split(";")?.find((e=>e.includes("COUNT")));if(e){this.repeatEndAfter=parseInt(e.split("=")[1])}const n=t[0]?.split(";")?.find((e=>e.includes("BYDAY")));if(n){this.repeatOnDays=n.split("=")[1].split(",")}const i=t[0]?.split(";")?.find((e=>e.includes("UNTIL")));if(i){const e=d(i.split("=")[1],"YYYYMMDDTHHmmss").toDate();this.repeatEndOn=d(e).toISOString().split("T")[0];this.repeatEndType="on"}const s=this.getRecurrenceTypeFromRrule(t[0]);this.selectedRecurrenceType=s||"none"}else{this.selectedRecurrenceType="none";this.selectedRrule=l(this.selectedDate,this.selectedRecurrenceType,undefined,undefined,this.selectedTimezone)}}else{this.selectedDate=(new Date).toISOString().split("T")[0];const e=this.getSuggestedTime();this.selectedStartTime=e.startTime;this.selectedEndTime=e.endTime;this.selectedTimezone=Intl.DateTimeFormat().resolvedOptions().timeZone;this.selectedRecurrenceType="none";this.selectedRrule=l(this.selectedDate,this.selectedRecurrenceType,undefined,undefined,this.selectedTimezone)}this.recurrenceOptions=this.generateRecurrenceOptions(this.selectedDate,this.selectedTimezone);this.monthRecurrenceOptions=this.getMonthRecurrenceOptions(this.selectedDate,this.selectedTimezone);this.handleValueChanged(true)}elementNameChangedHandler(e){c("nylas-event-timeslot","elementNameChangedHandler",e);this.host.setAttribute("name",e)}selectedLanguageChangedHandler(e,t){if(e===t)return;m.changeLanguage(e)}themeConfigChangedHandler(e,t){if(e===t)return;this.applyThemeConfig(e)}applyThemeConfig(e){if(e){for(const[t,n]of Object.entries(e)){this.host.style.setProperty(`${t}`,n)}}}getOrdinalSuffix(e){const t=["th","st","nd","rd"];const n=e%100;return e+(t[(n-20)%10]||t[n]||t[0])}getRecurrenceTypeFromRrule(e){if(e.includes("INTERVAL"))return"custom";if(e.includes("FREQ=DAILY"))return"daily";if(e.includes("FREQ=WEEKLY"))return"weekly";if(e.includes("FREQ=MONTHLY"))return"monthly";if(e.includes("FREQ=YEARLY"))return"yearly";return undefined}generateRecurrenceOptions(e,t){const n=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];const i=d.tz(e,t);const s=n[i.day()];const r=i.date();const a=Math.ceil(r/7);return[{label:m.t("nylasEventTimeslot.recurrenceOptions.none"),value:"none"},{label:m.t("nylasEventTimeslot.recurrenceOptions.daily"),value:"daily"},{label:m.t("nylasEventTimeslot.recurrenceOptions.weekly",{dayOfWeek:s}),value:"weekly"},{label:m.t("nylasEventTimeslot.recurrenceOptions.monthly",{dayOfMonth:`${this.getOrdinalSuffix(a)} ${s}`}),value:"monthly"},{label:m.t("nylasEventTimeslot.recurrenceOptions.yearly",{dateOfMonth:`${i.format("MMMM D")}`}),value:"yearly"},{label:m.t("nylasEventTimeslot.recurrenceOptions.custom"),value:"custom"}]}getMonthRecurrenceOptions(e,t){const n=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];const i=d.tz(e,t);const s=n[i.day()];const r=i.date();const a=Math.ceil(r/7);return[{label:m.t("nylasEventTimeslot.recurrenceOptions.monthOnDay",{date:r}),value:"monthly-same-date"},{label:m.t("nylasEventTimeslot.recurrenceOptions.monthly",{dayOfMonth:`${this.getOrdinalSuffix(a)} ${s}`}),value:"monthly"}]}getSuggestedTime(){const e=d();const t=e.minute();const n=t<=30?30:60;const i=e.set("minute",n).set("second",0);const s=i.add(30,"minute");return{startTime:i.format("hh:mma"),endTime:s.format("hh:mma")}}getTimezoneLabelHTML(e){const t=p(e);return n("span",{class:"timezone-label",style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"-webkit-fill-available"}},u[e]," ",n("span",{class:"timezone-offset",style:{fontSize:"14px",fontWeight:"400",color:"var(--nylas-base-500)"}},t))}isStartTimeAfterEndTime(e,t){const n=d(e,"hh:mma");const i=d(t,"hh:mma");return n.isAfter(i)}isStartTimeEqualToEndTime(e,t){const n=d(e,"hh:mma");const i=d(t,"hh:mma");return n.isSame(i)}isStartTimeBeforeCurrentDate(e,t,n){const i=d.tz(`${e} ${t}`,"YYYY-MM-DD hh:mma",n);return i.isBefore(d())}validateDateTimeInput(e,t,n){const i=d.tz(`${e} ${t}`,"YYYY-MM-DD hh:mma",n);const s=i.isBefore(d());return{isValid:!s,errorMessage:s?m.t("nylasEventTimeslot.errors.startTimeBeforeCurrentDate"):""}}getStartAndEndTimes(){const e=d.tz(`${this.selectedDate} ${this.selectedStartTime}`,"YYYY-MM-DD hh:mma",this.selectedTimezone).toDate();const t=d.tz(`${this.selectedDate} ${this.selectedEndTime}`,"YYYY-MM-DD hh:mma",this.selectedTimezone).toDate();return{start_time:Math.round(e.getTime()/1e3),end_time:Math.round(t.getTime()/1e3)}}getCustomOptions(){if(this.selectedRecurrenceType!=="custom"){return undefined}const e=b[this.repeatEveryFrequency];return{frequency:e,interval:this.repeatEveryInterval,daysOfWeek:this.repeatEveryFrequency==="week"?this.repeatOnDays:undefined,monthlySameDate:this.repeatEveryFrequency==="month"?this.repeatMonthlySameDate:undefined,end:{type:this.repeatEndType,count:this.repeatEndType==="after"?this.repeatEndAfter:undefined,date:this.repeatEndType==="on"?this.repeatEndOn:undefined}}}handleValueChanged(e=false){const t=this.getCustomOptions();this.selectedRrule=l(this.selectedDate,this.selectedRecurrenceType,this.repeatEndOn,t,this.selectedTimezone);const{start_time:n,end_time:i}=this.getStartAndEndTimes();const s={when:{start_time:n,end_time:i,start_timezone:this.selectedTimezone,end_timezone:this.selectedTimezone},recurrence:this.selectedRrule?[this.selectedRrule]:[]};this.internals.setFormValue(JSON.stringify(s),this.name);if(!e){this.valueChanged.emit({value:JSON.stringify(s),name:this.name})}}setTime(e){const{key:t,value:n}=e.detail;if(t==="event-timeslot-start-time"){this.selectedStartTime=n}else if(t==="event-timeslot-end-time"){this.selectedEndTime=n}const i=this.isStartTimeAfterEndTime(this.selectedStartTime,this.selectedEndTime);const s=this.isStartTimeEqualToEndTime(this.selectedStartTime,this.selectedEndTime);const r=this.validateDateTimeInput(this.selectedDate,this.selectedStartTime,this.selectedTimezone);const d=!r.isValid;this.timeRangeError=i||s||d;let a="";if(i){a=m.t("nylasEventTimeslot.errors.invalidTimeRange")}else if(s){a=m.t("nylasEventTimeslot.errors.startTimeSameAsEndTime")}else if(d){a=r.errorMessage}else{a=""}this.timeWindowFormError.emit({key:this.name,message:a,uniqueIdentifier:"time-range"});if(a){return}this.handleValueChanged()}nylasFormDropdownChangedHandler(e){const{name:t,value:n}=e.detail;if(t==="timezone"){this.selectedTimezone=n;const e=d(this.selectedDate);const t=this.validateDateTimeInput(e.format("YYYY-MM-DD"),this.selectedStartTime,this.selectedTimezone);this.hasDateTimeInputError=!t.isValid;this.dateTimeInputError.emit({key:this.name,message:t.errorMessage});if(!t.isValid){return}}else if(t==="recurrence-type"){this.selectedRecurrenceType=n}else if(t==="month-recurrence-type"){this.repeatMonthlySameDate=n==="monthly-same-date"}else if(t==="custom-recurrence-end-type"){this.repeatEndType=n}this.handleValueChanged()}nylasFormInputChangedHandler(e){const{name:t,value:n}=e.detail;if(t==="date-time-input"){const e=d(n);const t=this.validateDateTimeInput(e.format("YYYY-MM-DD"),this.selectedStartTime,this.selectedTimezone);this.hasDateTimeInputError=!t.isValid;this.dateTimeInputError.emit({key:this.name,message:t.errorMessage});if(!t.isValid){return}this.selectedDate=e.format("YYYY-MM-DD");this.recurrenceOptions=this.generateRecurrenceOptions(this.selectedDate,this.selectedTimezone);this.monthRecurrenceOptions=this.getMonthRecurrenceOptions(this.selectedDate,this.selectedTimezone)}else if(t==="recurrence-end-date"||t==="custom-recurrence-end-date"){const i=e.detail?.error||"";this.timeWindowFormError.emit({key:this.name,message:i,uniqueIdentifier:t});this.repeatEndOn=n}else if(t==="recurrence-end-after"){const e=parseInt(n);if(e<1||isNaN(e)){this.timeWindowFormError.emit({key:this.name,message:m.t("fixFormErrors")});return}this.repeatEndAfter=e}this.handleValueChanged()}timePeriodChangedHandler(e){const{number:t,period:n}=e.detail;this.repeatEveryInterval=t;this.repeatEveryFrequency=n;if(n==="month"){this.monthRecurrenceOptions=this.getMonthRecurrenceOptions(this.selectedDate,this.selectedTimezone)}this.handleValueChanged()}render(){const e=this.currentUser?.provider==="icloud";const t=this.recurrenceOptions.find((e=>e.value===this.selectedRecurrenceType));const s=Object.keys(u).map((e=>({labelHTML:this.getTimezoneLabelHTML(e),label:u[e],value:e})));const r=s.find((e=>e.value===this.selectedTimezone));const a=[{label:m.t("nylasEventTimeslot.customRecurrence.endsOptions.never"),value:"never"},{label:m.t("nylasEventTimeslot.customRecurrence.endsOptions.on"),value:"on"},{label:m.t("nylasEventTimeslot.customRecurrence.endsOptions.after"),value:"after"}];const o=d(this.selectedDate).add(1,"year").toISOString().split("T")[0];const c=this.repeatEveryFrequency==="week"?4:this.repeatEveryFrequency==="month"?12:5;this.repeatEndOn=this.repeatEndOn||o;this.repeatEndAfter=this.repeatEndAfter||c;const l=d().tz(this.selectedTimezone);return n(i,{key:"25e1347b784f9d7407e9d658c9628b29eadf29a1"},n("div",{key:"a5e9ddbfb77543405327ebcf40e9d8d13c69bf69",class:"nylas-event-timeslot",part:"netimeslot"},n("label",{key:"65067ee85658ee88e6041d0a40e5dd8770f1ba1b",htmlFor:"date-time-input"},m.t("nylasEventTimeslot.dateTimeLabel")),n("div",{key:"4005a41b1c29c2953cd61229c6c460371edb80f3",class:"date-time-input",part:"netimeslot__date-time-input"},n("div",{key:"b1a5f085c7e9806ccaede81a2c04e7d7629202f6",class:"date-time-picker",part:"netimeslot__date-time-picker"},n("nylas-date-component",{key:"c22750cb44aa61a5a885744ad4336c700399c6e4",minDate:d().tz(this.selectedTimezone).toISOString().split("T")[0],name:"date-time-input",defaultValue:this.selectedDate,id:"date-time-input",class:{error:this.hasDateTimeInputError},required:true,hasError:this.hasDateTimeInputError,themeConfig:this.themeConfig}),n("div",{key:"cad29d96272177edaf6cf0403cbc5df3652d3dad",class:"time-range",part:"netimeslot__time-range"},n("nylas-time-window-picker",{id:"event-timeslot-start-time",hasError:this.timeRangeError,time:this.selectedStartTime,language:this.selectedLanguage,name:"event-timeslot-start-time",key:"event-timeslot-start-time",themeConfig:this.themeConfig,exportparts:"time-picker: nap__time-picker-container, time-input: nap__time-picker-input, times: nap__time-picker-times"}),n("span",{key:"fcb0020de2d5d65ea11ff2f14dc798c6693e8e20"},"–"),n("nylas-time-window-picker",{id:"event-timeslot-end-time",hasError:this.timeRangeError,time:this.selectedEndTime,language:this.selectedLanguage,name:"event-timeslot-end-time",key:"event-timeslot-end-time",minimumStartTime:this.selectedStartTime,themeConfig:this.themeConfig,exportparts:"time-picker: nap__time-picker-container, time-input: nap__time-picker-input, times: nap__time-picker-times"})),r?.label&&n("select-dropdown",{key:"4336bd7b5b216437d903ccb4703c79691eed2100",searchPlaceholder:m.t("search"),name:"timezone",exportparts:"sd_dropdown: nap__timezone-container, sd_dropdown-button: nap__timezone-button, sd_dropdown-content: nap__timezone-dropdown-content",options:s,withChevron:false,defaultSelectedOption:r,themeConfig:this.themeConfig},n("span",{key:"f3720e371a3da1fa4cae378ff807bd086de4dc3c",slot:"select-icon"},n("globe-icon",{key:"dd297a89a1dc71894e929fb27d8e68c10599526e",width:"20",height:"20"})))),!e&&n("div",{key:"d81aea27e43a3d5d60f1a26f68572caacee2798f",class:"recurrence-options",part:"netimeslot__recurrence-options"},t&&t?.label&&n("div",{key:"843e3bebab7fee82b56d04e03a88b89ac6969817",class:"recurrence-type",part:"netimeslot__recurrence-type"},n("label",{key:"f413bdd3300ee919c42091d7dd629614f653c79b",htmlFor:"recurrence-type"},m.t("nylasEventTimeslot.recurrenceLabel")),n("select-dropdown",{key:"eadf902a645a910587232169866d3113b69a4da8",withSearch:false,id:"recurrence-type",name:"recurrence-type",options:this.recurrenceOptions,themeConfig:this.themeConfig,defaultSelectedOption:t,exportparts:"sd_dropdown: netimeslot__dropdown, sd_dropdown-button: netimeslot__dropdown-button, sd_dropdown-content: netimeslot__dropdown-content"})),this.selectedRecurrenceType!=="custom"&&this.selectedRecurrenceType!=="none"&&n("div",{key:"83929da0354db332902df655fd13e6a9faabc836",class:"recurrence-end",part:"netimeslot__recurrence-end"},n("label",{key:"df9807c1c1f6021f959093690530d4e8c3bc97c8"},m.t("nylasEventTimeslot.endDate")),n("nylas-date-component",{key:"d9c66539af5a9989535b247563f9dd148d15e712",name:"recurrence-end-date",minDate:l.toISOString().split("T")[0],defaultValue:this.repeatEndOn||o,id:"recurrence-end-date",required:true,themeConfig:this.themeConfig})),this.selectedRecurrenceType==="custom"&&n("div",{key:"be20b947453865db6824b400412def5989c7aec1",class:"custom-recurrence-time-period",part:"netimeslot__custom-recurrence"},n("label",{key:"35c73a7be217e7cdce90dd325fbfb693750525a1",htmlFor:""},m.t("nylasEventTimeslot.customRecurrence.repeatEvery")),n("time-period-selector",{key:"f9b90e987644ccfafcadd6fe2d42adebc565551e",id:"custom-recurrence-time-period",exportparts:"tps__number-dropdown: netimeslot__number-dropdown, tps__number-dropdown-button: netimeslot__number-dropdown-button, tps__number-dropdown-content: netimeslot__number-dropdown-content, tps__period-dropdown: netimeslot__period-dropdown, tps__period-dropdown-button: netimeslot__period-dropdown-button, tps__period-dropdown-content: netimeslot__period-dropdown-content",timePeriods:[{value:"day",label:m.t("timePeriod",{context:"day"})},{value:"week",label:m.t("timePeriod",{context:"week"})},{value:"month",label:m.t("timePeriod",{context:"month"})},{value:"year",label:m.t("timePeriod",{context:"year"})}],themeConfig:this.themeConfig,defaultSelectedNumber:this.repeatEveryInterval,defaultSelectedPeriod:this.repeatEveryFrequency})),n("div",{key:"ab344382ddb1ea7b350286462b888eb9ddc58f08",class:"repeat-on"},this.selectedRecurrenceType==="custom"&&this.repeatEveryFrequency==="week"&&n("div",{key:"57d24db360fabcda9dd6e63e02e26b8a99c1ede4",class:"days"},n("label",{key:"630b743b968d897a605eb07cde472f9c895df580"},m.t("nylasEventTimeslot.customRecurrence.repeatOn")),n("div",{key:"ff67db7dd5834bfb2b498cd9316f8d2830854c58",class:"buttons"},[{label:"S",value:"SU",title:"Sunday"},{label:"M",value:"MO",title:"Monday"},{label:"T",value:"TU",title:"Tuesday"},{label:"W",value:"WE",title:"Wednesday"},{label:"T",value:"TH",title:"Thursday"},{label:"F",value:"FR",title:"Friday"},{label:"S",value:"SA",title:"Saturday"}].map((e=>n("button",{class:{selected:this.repeatOnDays.includes(e.value)},title:e.title,onClick:()=>{this.repeatOnDays=this.repeatOnDays.includes(e.value)?this.repeatOnDays.filter((t=>t!==e.value)):[...this.repeatOnDays,e.value];this.handleValueChanged()}},e.label))))),this.selectedRecurrenceType==="custom"&&this.repeatEveryFrequency==="month"&&n("div",{key:"ef5bf142d0d197d5519f5168199307ac1d1b9a15",class:"month-recurrence"},n("span",{key:"b4199f4e2a226d57f43f77cc13d1c23f8ed149c4"}),n("select-dropdown",{key:"d5505db8bcbfcff77d536b1145f0dcdd90a60249",withSearch:false,id:"month-recurrence-type",name:"month-recurrence-type",options:this.monthRecurrenceOptions,themeConfig:this.themeConfig,defaultSelectedOption:this.repeatMonthlySameDate?this.monthRecurrenceOptions[0]:this.monthRecurrenceOptions[1],exportparts:"sd_dropdown: netimeslot__dropdown, sd_dropdown-button: netimeslot__dropdown-button, sd_dropdown-content: netimeslot__dropdown-content"})),n("div",{key:"1012f6a1bc6d3a59b821daef13df2a4e07d449bb",class:"custom-recurrence"},this.selectedRecurrenceType==="custom"&&n("div",{key:"b45bbb50274b70db0054c79984814901cafebb25",class:"custom-recurrence-ends"},n("label",{key:"38c2c971d141ec286b2fffcfb91d317d6c1573ea",htmlFor:"recurrence-type"},m.t("nylasEventTimeslot.customRecurrence.ends")),n("select-dropdown",{key:"a205a4b8ccca5d2e1475deab6157ba285a523ee9",withSearch:false,id:"custom-recurrence-end-type",name:"custom-recurrence-end-type",options:a,themeConfig:this.themeConfig,defaultSelectedOption:a.find((e=>e.value===this.repeatEndType)),exportparts:"sd_dropdown: netimeslot__dropdown, sd_dropdown-button: netimeslot__dropdown-button, sd_dropdown-content: netimeslot__dropdown-content"})),this.selectedRecurrenceType==="custom"&&this.repeatEndType==="on"&&n("div",{key:"3c69aed3261bf11018f3d6e6cc14f5a2d368aca6"},n("nylas-date-component",{key:"eefd526dbe6f3718881e5a38e3c03feb5a0ad091",name:"custom-recurrence-end-date",minDate:l.toISOString().split("T")[0],defaultValue:this.repeatEndOn||o,id:"custom-recurrence-end-date",required:true,themeConfig:this.themeConfig})),this.selectedRecurrenceType==="custom"&&this.repeatEndType==="after"&&n("div",{key:"4a53b9331f7763dfe0710bb51410d6a51dc6aac1",class:"custom-recurrence-end-after"},n("input-component",{key:"62bfeefdbf9028d004e912352c223edd1d4eaa86",name:"recurrence-end-after",id:"recurrence-end-after",type:"number",minValue:1,themeConfig:this.themeConfig,defaultValue:c.toString(),exportparts:"ic_input: netimeslot__input-textfield"}),n("span",{key:"550ca54eb104aa706e07e11911b1040b4ee17c1e"},m.t("nylasEventTimeslot.customRecurrence.occurrences")))))))))}static get formAssociated(){return true}get host(){return s(this)}static get watchers(){return{name:["elementNameChangedHandler"],selectedLanguage:["selectedLanguageChangedHandler"],themeConfig:["themeConfigChangedHandler"]}}};y([r({name:"nylas-event-timeslot",stateToProps:new Map([["schedulerConfig.selectedLanguage","selectedLanguage"],["schedulerConfig.currentUser","currentUser"],["schedulerConfig.themeConfig","themeConfig"]]),eventToProps:{valueChanged:async(e,t)=>{c("nylas-event-timeslot","valueChanged",e.detail)}},fireRegisterEvent:true}),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",void 0)],w.prototype,"render",null);w.style=h;export{w as nylas_event_timeslot};
|
|
2
2
|
//# sourceMappingURL=nylas-event-timeslot.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nylas-event-title.entry.esm.js","sources":["src/components/scheduler-editor/nylas-event-title/nylas-event-title.scss?tag=nylas-event-title&encapsulation=shadow","src/components/scheduler-editor/nylas-event-title/nylas-event-title.tsx"],"sourcesContent":["@use '../../../common/styles/variables' as *;\n\n:host {\n display: block;\n @include default-css-variables;\n}\n\n.nylas-event-title {\n display: flex;\n flex-direction: column;\n gap: 4px;\n position: relative;\n text-align: left;\n color: var(--nylas-base-900);\n\n div.title {\n padding: 12px 16px;\n border: 1px solid var(--nylas-base-200);\n border-radius: var(--nylas-border-radius-2x);\n overflow: auto;\n white-space: nowrap;\n scrollbar-width: thin;\n background-color: var(--nylas-base-0);\n\n &::-webkit-scrollbar {\n width: 6px;\n height: 6px;\n }\n\n &.error {\n border-color: var(--nylas-error);\n border-width: 2px;\n outline: none;\n }\n }\n\n input {\n padding: 12px 16px;\n border-width: 1;\n border-radius: 8px;\n border: 1px solid var(--nylas-base-200);\n }\n\n span.help-text {\n display: inline-block;\n gap: 4px;\n align-items: center;\n color: var(--nylas-base-500);\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 21px;\n position: relative;\n\n span.label-icon {\n display: inline-block;\n\n tooltip-component {\n &::part(tc__container) {\n position: unset;\n }\n\n &::part(tc__content) {\n position: absolute;\n top: 4px;\n left: 50%;\n transform: translateX(-50%);\n }\n }\n }\n }\n\n span.error-message {\n color: var(--nylas-error);\n }\n\n label {\n display: flex;\n align-items: center;\n color: var(--nylas-base-800);\n font-size: 16px;\n font-style: normal;\n font-weight: 400;\n line-height: 150%;\n\n /* 21px */\n span.required {\n color: var(--nylas-error, #cc4841);\n }\n\n span.label-icon {\n margin-left: 4px;\n\n tooltip-component {\n display: flex;\n }\n }\n }\n}\n\n.highlighted-tag {\n background-color: var(--nylas-base-200);\n border-radius: var(--nylas-border-radius);\n padding: 5px;\n margin-left: 4px;\n}\n\n.token-options {\n display: block;\n background-color: var(--nylas-base-0);\n width: 100%;\n max-height: 336px;\n overflow: auto;\n z-index: 1;\n border-radius: 4px;\n position: absolute;\n top: calc(48px + 24px + 8px); // 48px is the height of the input, 24px is the height of the label, 8px is the gap between the label and the input\n\n box-shadow: 0px 4px 6px -2px #0000000d;\n box-shadow: 0px 10px 15px -3px #0000001a;\n\n @media #{$mobile} {\n right: 0;\n width: 325px;\n max-width: unset;\n }\n\n ul {\n padding: 0;\n list-style-type: none;\n color: var(--nylas-base-900);\n max-height: 336px;\n margin: 0;\n\n li {\n padding: 16px, 12px, 16px, 12px;\n color: var(--nylas-base-900);\n padding: 12px 16px;\n text-decoration: none;\n display: block;\n font-family: inherit;\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n letter-spacing: 0px;\n text-align: left;\n cursor: pointer;\n\n .token-label {\n display: flex;\n flex-direction: column;\n font-weight: 400;\n\n .token {\n color: var(--nylas-abse-900);\n font-size: 16px;\n line-height: 24px;\n }\n\n .description {\n color: var(--nylas-base-600);\n font-size: 14px;\n line-height: 21px;\n }\n }\n\n &:hover,\n &:focus,\n &:active,\n &.active {\n background-color: var(--nylas-base-100);\n\n .token-label {\n .token {\n color: var(--nylas-primary);\n }\n }\n }\n }\n }\n\n .selected {\n background-color: var(--nylas-base-100);\n }\n}\n","import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug, getBrowser, isNonPrintableKey, sanitize } from '@/utils/utils';\nimport { AttachInternals, Component, Host, State, h, Element, Prop, Watch, Event, EventEmitter, Listen } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { EVENT_TITLE_TOKENS as eventTitleTokens } from '@/common/constants';\nimport { Configuration } from '@nylas/core';\nimport i18next from '@/utils/i18n';\nimport { LANGUAGE_CODE } from '@/common/constants';\nimport { ThemeConfig } from '@nylas/core';\n\ninterface CustomShadowRoot extends ShadowRoot {\n getSelection: () => Selection | null;\n}\n\ntype Token = {\n token: string;\n value: string;\n description: string;\n};\n\n/**\n * The `nylas-event-title` component is a form input for the title of an event.\n * @part net - The event title container\n * @part net__title - The event title input\n * @part net__dropdown-content - The token options container\n */\n@Component({\n tag: 'nylas-event-title',\n styleUrl: 'nylas-event-title.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasEventTitle {\n @Element() host!: HTMLElement;\n @AttachInternals() internals!: ElementInternals;\n\n // Properties\n /**\n * @standalone\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n /**\n * @standalone\n * The title of the event from the cofiguration.\n */\n @Prop() eventTitle?: string = this.selectedConfiguration?.event_booking?.title;\n /**\n * @standalone\n * The name attribute of this component.\n */\n @Prop() name: string = 'title';\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: LANGUAGE_CODE;\n\n /**\n * Whether to show the tokens dropdown.\n */\n @Prop() noTemplates: boolean = false;\n /**\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: ThemeConfig;\n\n // State variables\n /**\n * Whether to show the tokens dropdown.\n */\n @State() showTokens: boolean = false;\n /**\n * The available token options for the dropdown.\n */\n @State() availableTokens: { label: string; value: string; labelHTML: Token }[] = eventTitleTokens.map(token => ({\n label: token.token,\n value: token.value,\n labelHTML: token,\n }));\n /**\n * The filtered token options for the dropdown based on the current query.\n */\n @State() filteredTokens: { label: string; value: string; labelHTML: Token }[] = this.availableTokens;\n /**\n * The aria-activedescendant attribute value. This is used to indicate the\n * currently active descendant in the tokens dropdown.\n */\n @State() ariaActivedescendant: string = '';\n /**\n * Stores the reference to the current word being typed.\n * This is used to update the event title with the selected token tag when\n * an option is selected from the dropdown by clicking on it.\n */\n @State() currentWord: {\n $value: string;\n fullText: string;\n index: number;\n focusOffset: number;\n } = { $value: '', fullText: '', index: -1, focusOffset: -1 };\n\n @State() validationError: string = '';\n @State() configEventTitle: string = '';\n\n @State() additionalFieldTokens: Token[] = [];\n // Reference to the title div element\n private titleRef!: HTMLDivElement;\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-event-title]', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('ariaActivedescendant')\n ariaActivedescendantChangedHandler(newValue: string) {\n debug('[nylas-event-title]', 'ariaActivedescendantChangedHandler', newValue);\n if (newValue !== '') {\n const activeOption = this.host.shadowRoot?.getElementById(newValue);\n activeOption?.classList.add('active');\n } else {\n const options = this.host.shadowRoot?.querySelectorAll('.token-options li.active');\n options?.forEach(option => option.classList.remove('active'));\n }\n }\n\n @Watch('selectedConfiguration')\n configChangedHandler(newVal: Configuration) {\n const title = newVal?.event_booking?.title;\n const additionalFields = newVal?.scheduler?.additional_fields || {};\n const newKeys = Object.keys(additionalFields) || [];\n const newTokens = newKeys.map(key => {\n return {\n token: `$${key}`,\n value: `\\${${key}}`,\n description: additionalFields[key].label || '',\n };\n });\n this.additionalFieldTokens = [...newTokens];\n this.availableTokens = [...eventTitleTokens, ...newTokens].map(token => ({\n label: token.token,\n value: token.value,\n labelHTML: token,\n }));\n this.filteredTokens = [...this.availableTokens];\n if (title) {\n this.configEventTitle = title;\n this.updateEventTitleFromProp(title);\n }\n }\n\n @Watch('selectedLanguage')\n selectedLanguageChangedHandler(newVal: LANGUAGE_CODE, oldVal: LANGUAGE_CODE) {\n if (newVal === oldVal) return;\n i18next.changeLanguage(newVal);\n const titleTokens = {\n $invitee: 'invitee',\n $invitee_email: 'inviteeEmail',\n $duration: 'duration',\n };\n this.availableTokens = this.availableTokens.map(token => {\n if (titleTokens[token.label]) {\n token.labelHTML.description = i18next.t(`nylasEventTitle.eventTitleTokenDescription.${titleTokens[token.label]}`);\n }\n return token;\n });\n this.filteredTokens = [...this.availableTokens];\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 // Events\n /**\n * This event is fired when the value of the event title changes.\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n }>;\n\n // Lifecycle methods\n connectedCallback() {\n debug('[nylas-event-title]', 'connectedCallback');\n }\n\n componentWillLoad() {\n debug('[nylas-event-title]', 'componentWillLoad');\n this.host.setAttribute('name', this.name);\n }\n\n componentDidLoad() {\n debug('[nylas-event-title]', 'componentDidLoad');\n let title = this.eventTitle || this.configEventTitle;\n if (this.selectedConfiguration?.event_booking?.title) {\n title = this.selectedConfiguration?.event_booking?.title;\n }\n if (title) {\n this.updateEventTitleFromProp(title);\n this.updateEventTitle(title, true);\n }\n }\n\n disconnectedCallback() {\n debug('[nylas-event-title]', 'disconnectedCallback');\n }\n\n @Listen('formSubmitted', { target: 'window' })\n formSubmittedHandler(event: CustomEvent) {\n debug('[nylas-event-title]', 'formSubmittedHandler', event);\n if (!this.internals?.validity?.valid) {\n this.validationError = 'eventTitleRequired';\n } else {\n this.validationError = '';\n }\n }\n\n @Listen('valueChanged', { target: 'document' })\n valueChangedHandler(event: CustomEvent<{ value: string; name: string }>) {\n const { name, value } = event.detail;\n if (name === 'additional-fields') {\n const additionalFields = JSON.parse(value.toString());\n const newKeys = Object.keys(additionalFields) || [];\n const newTokens = newKeys.map(key => {\n return {\n token: `$${key}`,\n value: `\\${${key}}`,\n description: additionalFields[key].label || '',\n };\n });\n this.additionalFieldTokens = [...newTokens];\n this.availableTokens = [...eventTitleTokens, ...newTokens].map(token => ({\n label: token.token,\n value: token.value,\n labelHTML: token,\n }));\n this.filteredTokens = [...this.availableTokens];\n }\n }\n\n updateEventTitleFromProp(newValue: string) {\n debug('[nylas-event-title]', 'eventTitleChangedHandler', newValue);\n const title = newValue || this.configEventTitle;\n if (this.titleRef) {\n this.titleRef.innerHTML = this.highlightTokens(title);\n if (typeof this.internals.setValidity === 'function') {\n if (!title || title === '') {\n this.titleRef.focus();\n this.internals?.setValidity({ customError: true }, `Event title is required`, this.titleRef);\n } else {\n this.internals?.setValidity({ customError: false });\n this.isInternalsAvailable && this.internals?.setFormValue(title, this.name);\n }\n }\n }\n }\n\n highlightTokens(title: string) {\n let outputHtml = title;\n [...eventTitleTokens, ...this.additionalFieldTokens].forEach(tokenObj => {\n const token = tokenObj.value;\n // Create a regular expression that matches the token as a whole word\n const regex = new RegExp(`(\\\\${token})(?!\\\\w)`, 'g');\n // Replace the token with a span element\n outputHtml = outputHtml?.replace(regex, '<span class=\"highlighted-tag\">$1</span>') || '';\n });\n return outputHtml;\n }\n\n getCurrentSelectionForBrowser() {\n const getSelectionTextData = (nodeValue, offset, node, allSelected) => {\n // Remove zero-width space characters from the text, because they are not visible and cause issues with the selection\n const text = nodeValue.replace(/[\\u200B-\\u200D\\uFEFF]/g, '');\n const dollarIndex = text.lastIndexOf('$');\n const lastWord = text.substring(dollarIndex).split(' ')[0];\n return {\n focusOffset: offset,\n dollarIndex,\n lastWord,\n currentText: text,\n node,\n allSelected,\n };\n };\n\n // Check if the selection has selected all the text in the node, we need this to handle the case where the user selects all the text and then types or deletes\n const isAllSelected = (selection: Selection) => selection.anchorOffset === 0 && selection.focusOffset === selection.focusNode?.nodeValue?.length;\n\n const currentBrowser = getBrowser();\n switch (currentBrowser) {\n case 'Chrome': {\n const shadowRootSelection = (this.host.shadowRoot as CustomShadowRoot)?.getSelection();\n const focusNode = shadowRootSelection?.focusNode;\n const focusNodeValue = focusNode?.nodeValue || '';\n const allSelected = shadowRootSelection && isAllSelected(shadowRootSelection);\n return getSelectionTextData(focusNodeValue, shadowRootSelection?.focusOffset || -1, focusNode, allSelected);\n }\n case 'Firefox': {\n const selection = document.getSelection();\n const anchorNodeValue = selection?.anchorNode?.nodeValue || '';\n const allSelectedFirefox = selection && isAllSelected(selection);\n return getSelectionTextData(anchorNodeValue, selection?.focusOffset || -1, selection?.anchorNode, allSelectedFirefox);\n }\n case 'Safari': {\n const windowSelection = window.getSelection();\n const anchorNode = (windowSelection as any)?.getComposedRanges(this.host.shadowRoot as CustomShadowRoot)[0];\n const currentText = anchorNode?.startContainer?.nodeValue || '';\n const allSelectedSafari = windowSelection && isAllSelected(windowSelection);\n return getSelectionTextData(currentText, anchorNode?.endOffset || -1, anchorNode?.startContainer, allSelectedSafari);\n }\n default: {\n console.warn('Browser not supported');\n return null;\n }\n }\n }\n\n handleChange(event: Event) {\n let textContent = (event.target as HTMLDivElement).textContent || '';\n textContent = sanitize(textContent);\n\n // All browsers handle Selection within Shadow DOM differently, so get the current selection based on the browser\n const currentSelection = this.getCurrentSelectionForBrowser();\n if (!currentSelection) {\n this.updateEventTitle(textContent);\n this.resetDropdown();\n return;\n }\n const { focusOffset, dollarIndex, lastWord, currentText } = currentSelection;\n\n if (dollarIndex === -1 || focusOffset < dollarIndex) {\n this.updateEventTitle(textContent);\n this.resetDropdown();\n return;\n }\n if (lastWord.startsWith('$')) {\n this.showTokens = true;\n // Update the current word being typed, we need this reference to update the event title with the selected token\n // because the user can select an option from the dropdown by clicking on it, which will not trigger the input event.\n this.currentWord = {\n $value: lastWord,\n fullText: currentText,\n index: dollarIndex,\n focusOffset,\n };\n this.populateSuggestionsDropdown(lastWord);\n } else {\n this.resetDropdown();\n }\n this.updateEventTitle(textContent);\n }\n\n handleInputKeyDown(event) {\n const selection = this.getCurrentSelectionForBrowser();\n\n // If no text is remaining in the title, reset the title to an empty string\n if (selection?.allSelected && !isNonPrintableKey(event)) {\n this.titleRef.innerHTML = '';\n }\n\n if (event.key === 'Enter') {\n event.preventDefault();\n const activeOption = this.host.shadowRoot?.getElementById(this.ariaActivedescendant);\n if (activeOption) {\n activeOption.click();\n this.ariaActivedescendant = '';\n }\n } else if (event.key === 'ArrowDown') {\n event.preventDefault();\n const activeOption = this.host.shadowRoot?.getElementById(this.ariaActivedescendant);\n if (activeOption) {\n const nextOption = activeOption.nextElementSibling;\n if (nextOption) {\n this.ariaActivedescendant = nextOption.id;\n } else {\n this.ariaActivedescendant = this.filteredTokens[0].label;\n }\n } else {\n this.ariaActivedescendant = this.filteredTokens[0].label;\n }\n } else if (event.key === 'ArrowUp') {\n event.preventDefault();\n const activeOption = this.host.shadowRoot?.getElementById(this.ariaActivedescendant);\n if (activeOption) {\n const prevOption = activeOption.previousElementSibling;\n if (prevOption) {\n this.ariaActivedescendant = prevOption.id;\n } else {\n this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;\n }\n } else {\n this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;\n }\n } else if (event.key === 'Escape') {\n event.preventDefault();\n this.resetDropdown();\n } else if (event.key === 'Backspace' || event.key === 'Delete') {\n const parentNode = selection?.node?.parentNode;\n if (selection?.currentText.startsWith('${') && parentNode && parentNode.nodeName === 'SPAN') {\n event.preventDefault();\n parentNode.removeChild(selection.node);\n parentNode.remove();\n this.resetDropdown();\n this.updateEventTitle(this.titleRef?.textContent || '');\n }\n if (this.titleRef.textContent === '' || selection?.allSelected) {\n this.titleRef.innerHTML = '';\n this.updateEventTitle('');\n }\n }\n }\n\n selectOption(e: Event, option: { label: string; value: string; labelHTML: Token }) {\n e.preventDefault();\n const word = this.currentWord.fullText;\n const dollarWord = this.currentWord.$value;\n\n // Traverse the DOM to find the text node that contains the current word fullText\n let currentNode = this.titleRef.firstChild;\n let textNode: ChildNode | null = null;\n\n while (currentNode) {\n if (currentNode.nodeType === 3) {\n const currentNodeText = currentNode.textContent?.replace(/[\\u200B-\\u200D\\uFEFF]/g, '') || '';\n const wordText = word.replace(/[\\u200B-\\u200D\\uFEFF]/g, '');\n if (currentNodeText.includes(wordText)) {\n textNode = currentNode;\n break;\n }\n }\n currentNode = currentNode.nextSibling;\n }\n\n if (!textNode) {\n return;\n }\n // Split the text node into three parts: text before the token, the token, and text after the token\n const text = textNode.textContent || '';\n const index = text.indexOf(dollarWord);\n const textBefore = text.substring(0, index);\n const textAfter = text.substring(index + dollarWord.length);\n const newTextNode = document.createTextNode(textBefore);\n const newRange = document.createRange();\n\n // Create a new span element to replace the text node\n const tagSpan = document.createElement('span');\n tagSpan.classList.add('highlighted-tag');\n tagSpan.textContent = `${option.value}`;\n const newTextNodeAfter = document.createTextNode(textAfter);\n\n if (textAfter !== '') {\n // If there is text after the token, add it to the new span element\n textNode.replaceWith(newTextNode, tagSpan, newTextNodeAfter);\n newRange.setStart(newTextNodeAfter, 1);\n } else {\n // If there is no text after the token, add a zero-width space character (Without this, the cursor will not move outside the highlighted span element)\n const afterNode = document.createTextNode('\\u200B');\n textNode.replaceWith(newTextNode, tagSpan, afterNode);\n newRange.setStart(afterNode, 1);\n }\n\n // Hide the dropdown\n this.resetDropdown();\n this.titleRef.focus();\n\n // Set the focus to the new span element\n const sel = window.getSelection();\n newRange.collapse(true);\n sel?.removeAllRanges();\n sel?.addRange(newRange);\n\n // Update the event title with the selected token\n this.updateEventTitle(this.titleRef.textContent || '');\n }\n\n populateSuggestionsDropdown(query: string = '') {\n this.filteredTokens = this.availableTokens.filter(obj => {\n return obj.label.startsWith(query.toString()) || obj.value.startsWith(query.toString());\n });\n\n // Set the first option as the active descendant\n if (this.filteredTokens.length > 0) {\n this.ariaActivedescendant = this.filteredTokens[0].label;\n }\n }\n\n get isInternalsAvailable() {\n return typeof this.internals !== 'undefined' && typeof this.internals.setValidity === 'function' && typeof this.internals.setFormValue === 'function';\n }\n\n updateEventTitle(text: string, noValue: boolean = false) {\n const value = text.replace(/ +/g, ' ');\n if (value === '' || /^[\\s]*$/.test(value)) {\n this.validationError = 'eventTitleRequired';\n this.isInternalsAvailable && this.internals?.setValidity({ customError: true }, `Event title is required`, this.titleRef);\n } else {\n this.validationError = '';\n this.isInternalsAvailable && this.internals?.setValidity({ customError: false });\n }\n\n this.isInternalsAvailable && this.internals?.setFormValue(value, this.name);\n if (!noValue) {\n this.valueChanged.emit({ value: value, name: this.name });\n }\n }\n\n resetDropdown() {\n this.showTokens = false;\n this.ariaActivedescendant = '';\n }\n\n getLabelHTML(token: { token: string; description: string }) {\n return (\n <div class=\"token-label\">\n <span class=\"token\">{token.token}</span>\n <span class=\"description\">{token.description}</span>\n </div>\n );\n }\n\n @RegisterComponent<NylasEventTitle, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-event-title',\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-event-title\" part=\"net\">\n <label htmlFor=\"title\">\n {i18next.t('nylasEventTitle.headerTitle')}\n <span class=\"required\">*</span>\n </label>\n <div\n class={{\n title: true,\n error: this.validationError !== '',\n }}\n part=\"net__title\"\n ref={el => (this.titleRef = el as HTMLDivElement)}\n contentEditable=\"true\"\n onInput={e => this.handleChange(e)}\n onKeyDown={event => this.handleInputKeyDown(event)}\n ></div>\n {!this.noTemplates && this.showTokens && this.filteredTokens?.length > 0 && (\n <div class=\"token-options\" part=\"net__dropdown-content\">\n <ul tabindex=\"-1\" role=\"listbox\" aria-label={this.name} aria-activedescendant={this.ariaActivedescendant}>\n {this.filteredTokens.map(option => (\n <li\n tabindex=\"0\"\n key={option.label}\n id={option.label}\n class={{ active: this.ariaActivedescendant === option.label }}\n onClick={e => this.selectOption(e, option)}\n role=\"option\"\n >\n {this.getLabelHTML(option.labelHTML)}\n </li>\n ))}\n </ul>\n </div>\n )}\n {!this.noTemplates && (\n <span class=\"help-text\">\n {i18next.t('nylasEventTitle.helpText', { context: 'start', field: i18next.t('nylasEventTitle.title') })} <code>$</code>{' '}\n {i18next.t('nylasEventTitle.helpText', { context: 'end' })}\n <span class=\"label-icon\">\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">\n {i18next.t('nylasEventTitle.tooltip.desc')} <code>{'${invitee}'}</code>\n </span>\n </tooltip-component>\n </span>\n </span>\n )}\n {this.validationError != '' && <span class=\"error-message\">{i18next.t(`nylasEventTitle.${this.validationError}`)}</span>}\n </div>\n </Host>\n );\n }\n}\n"],"names":["eventTitleTokens","i18next"],"mappings":";;;;;AAAA,MAAM,kBAAkB,GAAG,2uKAA2uK;;;;;;;;;;;;;;;;MCiCzvK,eAAe,GAAA,MAAA;AAN5B,IAAA,WAAA,CAAA,OAAA,EAAA;;;;;;;;;;QAoBU,IAAU,CAAA,UAAA,GAAY,IAAI,CAAC,qBAAqB,EAAE,aAAa,EAAE,KAAK;AAKtE,QAAA,IAAI,CAAA,IAAA,GAAW,OAAO;AAStB,QAAA,IAAW,CAAA,WAAA,GAAY,KAAK;AAU3B,QAAA,IAAU,CAAA,UAAA,GAAY,KAAK;QAI3B,IAAe,CAAA,eAAA,GAAyDA,kBAAgB,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AC,8BAA8B,CAAC,OAAE,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EAAO,YAAY,CAAQ,CAClE,CACW,CACf,CACF,CACR,EACA,IAAI,CAAC,eAAe,IAAI,EAAE,IAAI,6DAAM,KAAK,EAAC,eAAe,EAAA,EAAEA,QAAO,CAAC,CAAC,CAAC,CAAmB,gBAAA,EAAA,IAAI,CAAC,eAAe,CAAA,CAAE,CAAC,CAAQ,CACpH,CACD;;;;;;;;;;;;AArDX,UAAA,CAAA;AAVC,IAAA,iBAAiB,CAAqG;AACrH,QAAA,IAAI,EAAE,mBAAmB;QACzB,YAAY,EAAE,IAAI,GAAG,CAAC;YACpB,CAAC,uCAAuC,EAAE,uBAAuB,CAAC;YAClE,CAAC,kCAAkC,EAAE,kBAAkB,CAAC;YACxD,CAAC,6BAA6B,EAAE,aAAa,CAAC;SAC/C,CAAC;AACF,QAAA,YAAY,EAAE,EAAE;AAChB,QAAA,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;CAwDD,EAAA,eAAA,CAAA,SAAA,EAAA,QAAA,EAAA,IAAA,CAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"nylas-event-title.entry.esm.js","sources":["src/components/scheduler-editor/nylas-event-title/nylas-event-title.scss?tag=nylas-event-title&encapsulation=shadow","src/components/scheduler-editor/nylas-event-title/nylas-event-title.tsx"],"sourcesContent":["@use '../../../common/styles/variables' as *;\n\n:host {\n display: block;\n @include default-css-variables;\n}\n\n.nylas-event-title {\n display: flex;\n flex-direction: column;\n gap: 4px;\n position: relative;\n text-align: left;\n color: var(--nylas-base-900);\n\n div.title {\n padding: 12px 16px;\n border: 1px solid var(--nylas-base-200);\n border-radius: var(--nylas-border-radius-2x);\n overflow: auto;\n white-space: nowrap;\n scrollbar-width: thin;\n background-color: var(--nylas-base-0);\n\n &::-webkit-scrollbar {\n width: 6px;\n height: 6px;\n }\n\n &.error {\n border-color: var(--nylas-error);\n border-width: 2px;\n outline: none;\n }\n }\n\n input {\n padding: 12px 16px;\n border-width: 1;\n border-radius: 8px;\n border: 1px solid var(--nylas-base-200);\n }\n\n span.help-text {\n display: inline-block;\n gap: 4px;\n align-items: center;\n color: var(--nylas-base-500);\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 21px;\n position: relative;\n\n span.label-icon {\n display: inline-block;\n\n tooltip-component {\n &::part(tc__container) {\n position: unset;\n }\n\n &::part(tc__content) {\n position: absolute;\n top: 4px;\n left: 50%;\n transform: translateX(-50%);\n }\n }\n }\n }\n\n span.error-message {\n color: var(--nylas-error);\n }\n\n label {\n display: flex;\n align-items: center;\n color: var(--nylas-base-800);\n font-size: 16px;\n font-style: normal;\n font-weight: 400;\n line-height: 150%;\n\n /* 21px */\n span.required {\n color: var(--nylas-error, #cc4841);\n }\n\n span.label-icon {\n margin-left: 4px;\n\n tooltip-component {\n display: flex;\n }\n }\n }\n}\n\n.highlighted-tag {\n background-color: var(--nylas-base-200);\n border-radius: var(--nylas-border-radius);\n padding: 5px;\n margin-left: 4px;\n}\n\n.token-options {\n display: block;\n background-color: var(--nylas-base-0);\n width: 100%;\n max-height: 336px;\n overflow: auto;\n z-index: 1;\n border-radius: 4px;\n position: absolute;\n top: calc(48px + 24px + 8px); // 48px is the height of the input, 24px is the height of the label, 8px is the gap between the label and the input\n\n box-shadow: 0px 4px 6px -2px #0000000d;\n box-shadow: 0px 10px 15px -3px #0000001a;\n\n @media #{$mobile} {\n right: 0;\n width: 325px;\n max-width: unset;\n }\n\n ul {\n padding: 0;\n list-style-type: none;\n color: var(--nylas-base-900);\n max-height: 336px;\n margin: 0;\n\n li {\n padding: 16px, 12px, 16px, 12px;\n color: var(--nylas-base-900);\n padding: 12px 16px;\n text-decoration: none;\n display: block;\n font-family: inherit;\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n letter-spacing: 0px;\n text-align: left;\n cursor: pointer;\n\n .token-label {\n display: flex;\n flex-direction: column;\n font-weight: 400;\n\n .token {\n color: var(--nylas-abse-900);\n font-size: 16px;\n line-height: 24px;\n }\n\n .description {\n color: var(--nylas-base-600);\n font-size: 14px;\n line-height: 21px;\n }\n }\n\n &:hover,\n &:focus,\n &:active,\n &.active {\n background-color: var(--nylas-base-100);\n\n .token-label {\n .token {\n color: var(--nylas-primary);\n }\n }\n }\n }\n }\n\n .selected {\n background-color: var(--nylas-base-100);\n }\n}\n","import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug, getBrowser, isNonPrintableKey, sanitize } from '@/utils/utils';\nimport { AttachInternals, Component, Host, State, h, Element, Prop, Watch, Event, EventEmitter, Listen } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { EVENT_TITLE_TOKENS as eventTitleTokens } from '@/common/constants';\nimport { Configuration } from '@nylas/core';\nimport i18next from '@/utils/i18n';\nimport { LANGUAGE_CODE } from '@/common/constants';\nimport { ThemeConfig } from '@nylas/core';\n\ninterface CustomShadowRoot extends ShadowRoot {\n getSelection: () => Selection | null;\n}\n\ntype Token = {\n token: string;\n value: string;\n description: string;\n};\n\n/**\n * The `nylas-event-title` component is a form input for the title of an event.\n * @part net - The event title container\n * @part net__title - The event title input\n * @part net__dropdown-content - The token options container\n */\n@Component({\n tag: 'nylas-event-title',\n styleUrl: 'nylas-event-title.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasEventTitle {\n @Element() host!: HTMLElement;\n @AttachInternals() internals!: ElementInternals;\n\n // Properties\n /**\n * @standalone\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n /**\n * @standalone\n * The title of the event from the cofiguration.\n */\n @Prop() eventTitle?: string = this.selectedConfiguration?.event_booking?.title;\n /**\n * @standalone\n * The name attribute of this component.\n */\n @Prop() name: string = 'title';\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: LANGUAGE_CODE;\n\n /**\n * Whether to show the tokens dropdown.\n */\n @Prop() noTemplates: boolean = false;\n /**\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: ThemeConfig;\n\n // State variables\n /**\n * Whether to show the tokens dropdown.\n */\n @State() showTokens: boolean = false;\n /**\n * The available token options for the dropdown.\n */\n @State() availableTokens: { label: string; value: string; labelHTML: Token }[] = eventTitleTokens.map(token => ({\n label: token.token,\n value: token.value,\n labelHTML: token,\n }));\n /**\n * The filtered token options for the dropdown based on the current query.\n */\n @State() filteredTokens: { label: string; value: string; labelHTML: Token }[] = this.availableTokens;\n /**\n * The aria-activedescendant attribute value. This is used to indicate the\n * currently active descendant in the tokens dropdown.\n */\n @State() ariaActivedescendant: string = '';\n /**\n * Stores the reference to the current word being typed.\n * This is used to update the event title with the selected token tag when\n * an option is selected from the dropdown by clicking on it.\n */\n @State() currentWord: {\n $value: string;\n fullText: string;\n index: number;\n focusOffset: number;\n } = { $value: '', fullText: '', index: -1, focusOffset: -1 };\n\n @State() validationError: string = '';\n @State() configEventTitle: string = '';\n\n @State() additionalFieldTokens: Token[] = [];\n // Reference to the title div element\n private titleRef!: HTMLDivElement;\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-event-title]', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('ariaActivedescendant')\n ariaActivedescendantChangedHandler(newValue: string) {\n debug('[nylas-event-title]', 'ariaActivedescendantChangedHandler', newValue);\n if (newValue !== '') {\n const activeOption = this.host.shadowRoot?.getElementById(newValue);\n activeOption?.classList.add('active');\n } else {\n const options = this.host.shadowRoot?.querySelectorAll('.token-options li.active');\n options?.forEach(option => option.classList.remove('active'));\n }\n }\n\n @Watch('selectedConfiguration')\n configChangedHandler(newVal: Configuration) {\n const title = newVal?.event_booking?.title;\n const additionalFields = newVal?.scheduler?.additional_fields || {};\n const newKeys = Object.keys(additionalFields) || [];\n const newTokens = newKeys.map(key => {\n return {\n token: `$${key}`,\n value: `\\${${key}}`,\n description: additionalFields[key].label || '',\n };\n });\n this.additionalFieldTokens = [...newTokens];\n this.availableTokens = [...eventTitleTokens, ...newTokens].map(token => ({\n label: token.token,\n value: token.value,\n labelHTML: token,\n }));\n this.filteredTokens = [...this.availableTokens];\n if (title) {\n this.configEventTitle = title;\n this.updateEventTitleFromProp(title);\n }\n }\n\n @Watch('selectedLanguage')\n selectedLanguageChangedHandler(newVal: LANGUAGE_CODE, oldVal: LANGUAGE_CODE) {\n if (newVal === oldVal) return;\n i18next.changeLanguage(newVal);\n const titleTokens = {\n $invitee: 'invitee',\n $invitee_email: 'inviteeEmail',\n $duration: 'duration',\n };\n this.availableTokens = this.availableTokens.map(token => {\n if (titleTokens[token.label]) {\n token.labelHTML.description = i18next.t(`nylasEventTitle.eventTitleTokenDescription.${titleTokens[token.label]}`);\n }\n return token;\n });\n this.filteredTokens = [...this.availableTokens];\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 // Events\n /**\n * This event is fired when the value of the event title changes.\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n }>;\n\n // Lifecycle methods\n connectedCallback() {\n debug('[nylas-event-title]', 'connectedCallback');\n }\n\n componentWillLoad() {\n debug('[nylas-event-title]', 'componentWillLoad');\n this.host.setAttribute('name', this.name);\n this.applyThemeConfig(this.themeConfig);\n }\n\n componentDidLoad() {\n debug('[nylas-event-title]', 'componentDidLoad');\n let title = this.eventTitle || this.configEventTitle;\n if (this.selectedConfiguration?.event_booking?.title) {\n title = this.selectedConfiguration?.event_booking?.title;\n }\n if (title) {\n this.updateEventTitleFromProp(title);\n this.updateEventTitle(title, true);\n }\n }\n\n disconnectedCallback() {\n debug('[nylas-event-title]', 'disconnectedCallback');\n }\n\n @Listen('formSubmitted', { target: 'window' })\n formSubmittedHandler(event: CustomEvent) {\n debug('[nylas-event-title]', 'formSubmittedHandler', event);\n if (!this.internals?.validity?.valid) {\n this.validationError = 'eventTitleRequired';\n } else {\n this.validationError = '';\n }\n }\n\n @Listen('valueChanged', { target: 'document' })\n valueChangedHandler(event: CustomEvent<{ value: string; name: string }>) {\n const { name, value } = event.detail;\n if (name === 'additional-fields') {\n const additionalFields = JSON.parse(value.toString());\n const newKeys = Object.keys(additionalFields) || [];\n const newTokens = newKeys.map(key => {\n return {\n token: `$${key}`,\n value: `\\${${key}}`,\n description: additionalFields[key].label || '',\n };\n });\n this.additionalFieldTokens = [...newTokens];\n this.availableTokens = [...eventTitleTokens, ...newTokens].map(token => ({\n label: token.token,\n value: token.value,\n labelHTML: token,\n }));\n this.filteredTokens = [...this.availableTokens];\n }\n }\n\n updateEventTitleFromProp(newValue: string) {\n debug('[nylas-event-title]', 'eventTitleChangedHandler', newValue);\n const title = newValue || this.configEventTitle;\n if (this.titleRef) {\n this.titleRef.innerHTML = this.highlightTokens(title);\n if (typeof this.internals.setValidity === 'function') {\n if (!title || title === '') {\n this.titleRef.focus();\n this.internals?.setValidity({ customError: true }, `Event title is required`, this.titleRef);\n } else {\n this.internals?.setValidity({ customError: false });\n this.isInternalsAvailable && this.internals?.setFormValue(title, this.name);\n }\n }\n }\n }\n\n highlightTokens(title: string) {\n let outputHtml = title;\n [...eventTitleTokens, ...this.additionalFieldTokens].forEach(tokenObj => {\n const token = tokenObj.value;\n // Create a regular expression that matches the token as a whole word\n const regex = new RegExp(`(\\\\${token})(?!\\\\w)`, 'g');\n // Replace the token with a span element\n outputHtml = outputHtml?.replace(regex, '<span class=\"highlighted-tag\">$1</span>') || '';\n });\n return outputHtml;\n }\n\n getCurrentSelectionForBrowser() {\n const getSelectionTextData = (nodeValue, offset, node, allSelected) => {\n // Remove zero-width space characters from the text, because they are not visible and cause issues with the selection\n const text = nodeValue.replace(/[\\u200B-\\u200D\\uFEFF]/g, '');\n const dollarIndex = text.lastIndexOf('$');\n const lastWord = text.substring(dollarIndex).split(' ')[0];\n return {\n focusOffset: offset,\n dollarIndex,\n lastWord,\n currentText: text,\n node,\n allSelected,\n };\n };\n\n // Check if the selection has selected all the text in the node, we need this to handle the case where the user selects all the text and then types or deletes\n const isAllSelected = (selection: Selection) => selection.anchorOffset === 0 && selection.focusOffset === selection.focusNode?.nodeValue?.length;\n\n const currentBrowser = getBrowser();\n switch (currentBrowser) {\n case 'Chrome': {\n const shadowRootSelection = (this.host.shadowRoot as CustomShadowRoot)?.getSelection();\n const focusNode = shadowRootSelection?.focusNode;\n const focusNodeValue = focusNode?.nodeValue || '';\n const allSelected = shadowRootSelection && isAllSelected(shadowRootSelection);\n return getSelectionTextData(focusNodeValue, shadowRootSelection?.focusOffset || -1, focusNode, allSelected);\n }\n case 'Firefox': {\n const selection = document.getSelection();\n const anchorNodeValue = selection?.anchorNode?.nodeValue || '';\n const allSelectedFirefox = selection && isAllSelected(selection);\n return getSelectionTextData(anchorNodeValue, selection?.focusOffset || -1, selection?.anchorNode, allSelectedFirefox);\n }\n case 'Safari': {\n const windowSelection = window.getSelection();\n const anchorNode = (windowSelection as any)?.getComposedRanges(this.host.shadowRoot as CustomShadowRoot)[0];\n const currentText = anchorNode?.startContainer?.nodeValue || '';\n const allSelectedSafari = windowSelection && isAllSelected(windowSelection);\n return getSelectionTextData(currentText, anchorNode?.endOffset || -1, anchorNode?.startContainer, allSelectedSafari);\n }\n default: {\n console.warn('Browser not supported');\n return null;\n }\n }\n }\n\n handleChange(event: Event) {\n let textContent = (event.target as HTMLDivElement).textContent || '';\n textContent = sanitize(textContent);\n\n // All browsers handle Selection within Shadow DOM differently, so get the current selection based on the browser\n const currentSelection = this.getCurrentSelectionForBrowser();\n if (!currentSelection) {\n this.updateEventTitle(textContent);\n this.resetDropdown();\n return;\n }\n const { focusOffset, dollarIndex, lastWord, currentText } = currentSelection;\n\n if (dollarIndex === -1 || focusOffset < dollarIndex) {\n this.updateEventTitle(textContent);\n this.resetDropdown();\n return;\n }\n if (lastWord.startsWith('$')) {\n this.showTokens = true;\n // Update the current word being typed, we need this reference to update the event title with the selected token\n // because the user can select an option from the dropdown by clicking on it, which will not trigger the input event.\n this.currentWord = {\n $value: lastWord,\n fullText: currentText,\n index: dollarIndex,\n focusOffset,\n };\n this.populateSuggestionsDropdown(lastWord);\n } else {\n this.resetDropdown();\n }\n this.updateEventTitle(textContent);\n }\n\n handleInputKeyDown(event) {\n const selection = this.getCurrentSelectionForBrowser();\n\n // If no text is remaining in the title, reset the title to an empty string\n if (selection?.allSelected && !isNonPrintableKey(event)) {\n this.titleRef.innerHTML = '';\n }\n\n if (event.key === 'Enter') {\n event.preventDefault();\n const activeOption = this.host.shadowRoot?.getElementById(this.ariaActivedescendant);\n if (activeOption) {\n activeOption.click();\n this.ariaActivedescendant = '';\n }\n } else if (event.key === 'ArrowDown') {\n event.preventDefault();\n const activeOption = this.host.shadowRoot?.getElementById(this.ariaActivedescendant);\n if (activeOption) {\n const nextOption = activeOption.nextElementSibling;\n if (nextOption) {\n this.ariaActivedescendant = nextOption.id;\n } else {\n this.ariaActivedescendant = this.filteredTokens[0].label;\n }\n } else {\n this.ariaActivedescendant = this.filteredTokens[0].label;\n }\n } else if (event.key === 'ArrowUp') {\n event.preventDefault();\n const activeOption = this.host.shadowRoot?.getElementById(this.ariaActivedescendant);\n if (activeOption) {\n const prevOption = activeOption.previousElementSibling;\n if (prevOption) {\n this.ariaActivedescendant = prevOption.id;\n } else {\n this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;\n }\n } else {\n this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;\n }\n } else if (event.key === 'Escape') {\n event.preventDefault();\n this.resetDropdown();\n } else if (event.key === 'Backspace' || event.key === 'Delete') {\n const parentNode = selection?.node?.parentNode;\n if (selection?.currentText.startsWith('${') && parentNode && parentNode.nodeName === 'SPAN') {\n event.preventDefault();\n parentNode.removeChild(selection.node);\n parentNode.remove();\n this.resetDropdown();\n this.updateEventTitle(this.titleRef?.textContent || '');\n }\n if (this.titleRef.textContent === '' || selection?.allSelected) {\n this.titleRef.innerHTML = '';\n this.updateEventTitle('');\n }\n }\n }\n\n selectOption(e: Event, option: { label: string; value: string; labelHTML: Token }) {\n e.preventDefault();\n const word = this.currentWord.fullText;\n const dollarWord = this.currentWord.$value;\n\n // Traverse the DOM to find the text node that contains the current word fullText\n let currentNode = this.titleRef.firstChild;\n let textNode: ChildNode | null = null;\n\n while (currentNode) {\n if (currentNode.nodeType === 3) {\n const currentNodeText = currentNode.textContent?.replace(/[\\u200B-\\u200D\\uFEFF]/g, '') || '';\n const wordText = word.replace(/[\\u200B-\\u200D\\uFEFF]/g, '');\n if (currentNodeText.includes(wordText)) {\n textNode = currentNode;\n break;\n }\n }\n currentNode = currentNode.nextSibling;\n }\n\n if (!textNode) {\n return;\n }\n // Split the text node into three parts: text before the token, the token, and text after the token\n const text = textNode.textContent || '';\n const index = text.indexOf(dollarWord);\n const textBefore = text.substring(0, index);\n const textAfter = text.substring(index + dollarWord.length);\n const newTextNode = document.createTextNode(textBefore);\n const newRange = document.createRange();\n\n // Create a new span element to replace the text node\n const tagSpan = document.createElement('span');\n tagSpan.classList.add('highlighted-tag');\n tagSpan.textContent = `${option.value}`;\n const newTextNodeAfter = document.createTextNode(textAfter);\n\n if (textAfter !== '') {\n // If there is text after the token, add it to the new span element\n textNode.replaceWith(newTextNode, tagSpan, newTextNodeAfter);\n newRange.setStart(newTextNodeAfter, 1);\n } else {\n // If there is no text after the token, add a zero-width space character (Without this, the cursor will not move outside the highlighted span element)\n const afterNode = document.createTextNode('\\u200B');\n textNode.replaceWith(newTextNode, tagSpan, afterNode);\n newRange.setStart(afterNode, 1);\n }\n\n // Hide the dropdown\n this.resetDropdown();\n this.titleRef.focus();\n\n // Set the focus to the new span element\n const sel = window.getSelection();\n newRange.collapse(true);\n sel?.removeAllRanges();\n sel?.addRange(newRange);\n\n // Update the event title with the selected token\n this.updateEventTitle(this.titleRef.textContent || '');\n }\n\n populateSuggestionsDropdown(query: string = '') {\n this.filteredTokens = this.availableTokens.filter(obj => {\n return obj.label.startsWith(query.toString()) || obj.value.startsWith(query.toString());\n });\n\n // Set the first option as the active descendant\n if (this.filteredTokens.length > 0) {\n this.ariaActivedescendant = this.filteredTokens[0].label;\n }\n }\n\n get isInternalsAvailable() {\n return typeof this.internals !== 'undefined' && typeof this.internals.setValidity === 'function' && typeof this.internals.setFormValue === 'function';\n }\n\n updateEventTitle(text: string, noValue: boolean = false) {\n const value = text.replace(/ +/g, ' ');\n if (value === '' || /^[\\s]*$/.test(value)) {\n this.validationError = 'eventTitleRequired';\n this.isInternalsAvailable && this.internals?.setValidity({ customError: true }, `Event title is required`, this.titleRef);\n } else {\n this.validationError = '';\n this.isInternalsAvailable && this.internals?.setValidity({ customError: false });\n }\n\n this.isInternalsAvailable && this.internals?.setFormValue(value, this.name);\n if (!noValue) {\n this.valueChanged.emit({ value: value, name: this.name });\n }\n }\n\n resetDropdown() {\n this.showTokens = false;\n this.ariaActivedescendant = '';\n }\n\n getLabelHTML(token: { token: string; description: string }) {\n return (\n <div class=\"token-label\">\n <span class=\"token\">{token.token}</span>\n <span class=\"description\">{token.description}</span>\n </div>\n );\n }\n\n @RegisterComponent<NylasEventTitle, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-event-title',\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-event-title\" part=\"net\">\n <label htmlFor=\"title\">\n {i18next.t('nylasEventTitle.headerTitle')}\n <span class=\"required\">*</span>\n </label>\n <div\n class={{\n title: true,\n error: this.validationError !== '',\n }}\n part=\"net__title\"\n ref={el => (this.titleRef = el as HTMLDivElement)}\n contentEditable=\"true\"\n onInput={e => this.handleChange(e)}\n onKeyDown={event => this.handleInputKeyDown(event)}\n ></div>\n {!this.noTemplates && this.showTokens && this.filteredTokens?.length > 0 && (\n <div class=\"token-options\" part=\"net__dropdown-content\">\n <ul tabindex=\"-1\" role=\"listbox\" aria-label={this.name} aria-activedescendant={this.ariaActivedescendant}>\n {this.filteredTokens.map(option => (\n <li\n tabindex=\"0\"\n key={option.label}\n id={option.label}\n class={{ active: this.ariaActivedescendant === option.label }}\n onClick={e => this.selectOption(e, option)}\n role=\"option\"\n >\n {this.getLabelHTML(option.labelHTML)}\n </li>\n ))}\n </ul>\n </div>\n )}\n {!this.noTemplates && (\n <span class=\"help-text\">\n {i18next.t('nylasEventTitle.helpText', { context: 'start', field: i18next.t('nylasEventTitle.title') })} <code>$</code>{' '}\n {i18next.t('nylasEventTitle.helpText', { context: 'end' })}\n <span class=\"label-icon\">\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">\n {i18next.t('nylasEventTitle.tooltip.desc')} <code>{'${invitee}'}</code>\n </span>\n </tooltip-component>\n </span>\n </span>\n )}\n {this.validationError != '' && <span class=\"error-message\">{i18next.t(`nylasEventTitle.${this.validationError}`)}</span>}\n </div>\n </Host>\n );\n }\n}\n"],"names":["eventTitleTokens","i18next"],"mappings":";;;;;AAAA,MAAM,kBAAkB,GAAG,2uKAA2uK;;;;;;;;;;;;;;;;MCiCzvK,eAAe,GAAA,MAAA;AAN5B,IAAA,WAAA,CAAA,OAAA,EAAA;;;;;;;;;;QAoBU,IAAU,CAAA,UAAA,GAAY,IAAI,CAAC,qBAAqB,EAAE,aAAa,EAAE,KAAK;AAKtE,QAAA,IAAI,CAAA,IAAA,GAAW,OAA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AA,WAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAC,cAAc,EAAG,CAAA,EACjC,CAAM,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAC,iBAAiB,EAAA,EACzBA,QAAO,CAAC,CAAC,CAAC,8BAA8B,CAAC,OAAE,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EAAO,YAAY,CAAQ,CAClE,CACW,CACf,CACF,CACR,EACA,IAAI,CAAC,eAAe,IAAI,EAAE,IAAI,6DAAM,KAAK,EAAC,eAAe,EAAA,EAAEA,QAAO,CAAC,CAAC,CAAC,CAAmB,gBAAA,EAAA,IAAI,CAAC,eAAe,CAAA,CAAE,CAAC,CAAQ,CACpH,CACD;;;;;;;;;;;;AArDX,UAAA,CAAA;AAVC,IAAA,iBAAiB,CAAqG;AACrH,QAAA,IAAI,EAAE,mBAAmB;QACzB,YAAY,EAAE,IAAI,GAAG,CAAC;YACpB,CAAC,uCAAuC,EAAE,uBAAuB,CAAC;YAClE,CAAC,kCAAkC,EAAE,kBAAkB,CAAC;YACxD,CAAC,6BAA6B,EAAE,aAAa,CAAC;SAC/C,CAAC;AACF,QAAA,YAAY,EAAE,EAAE;AAChB,QAAA,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;CAwDD,EAAA,eAAA,CAAA,SAAA,EAAA,QAAA,EAAA,IAAA,CAAA;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,a as t,h as n,d as s,e as l}from"./index-B-KMpdMZ.js";import{R as a}from"./register-component-BHk70oxk.js";import{b as o,i,L as r,n as c,M as d}from"./utils-Bj5Y75fX.js";import{E as f}from"./constants-DhnshuDN.js";const h=':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}.nylas-event-title{display:flex;flex-direction:column;gap:4px;position:relative;text-align:left;color:var(--nylas-base-900)}.nylas-event-title div.title{padding:12px 16px;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);overflow:auto;white-space:nowrap;scrollbar-width:thin;background-color:var(--nylas-base-0)}.nylas-event-title div.title::-webkit-scrollbar{width:6px;height:6px}.nylas-event-title div.title.error{border-color:var(--nylas-error);border-width:2px;outline:none}.nylas-event-title input{padding:12px 16px;border-width:1;border-radius:8px;border:1px solid var(--nylas-base-200)}.nylas-event-title span.help-text{display:inline-block;gap:4px;align-items:center;color:var(--nylas-base-500);font-size:14px;font-style:normal;font-weight:400;line-height:21px;position:relative}.nylas-event-title span.help-text span.label-icon{display:inline-block}.nylas-event-title span.help-text span.label-icon tooltip-component::part(tc__container){position:unset}.nylas-event-title span.help-text span.label-icon tooltip-component::part(tc__content){position:absolute;top:4px;left:50%;transform:translateX(-50%)}.nylas-event-title span.error-message{color:var(--nylas-error)}.nylas-event-title label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:16px;font-style:normal;font-weight:400;line-height:150%;}.nylas-event-title label span.required{color:var(--nylas-error, #cc4841)}.nylas-event-title label span.label-icon{margin-left:4px}.nylas-event-title label span.label-icon tooltip-component{display:flex}.highlighted-tag{background-color:var(--nylas-base-200);border-radius:var(--nylas-border-radius);padding:5px;margin-left:4px}.token-options{display:block;background-color:var(--nylas-base-0);width:100%;max-height:336px;overflow:auto;z-index:1;border-radius:4px;position:absolute;top:80px;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.0509803922);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1019607843)}@media screen and (max-width: 768px){.token-options{right:0;width:325px;max-width:unset}}.token-options ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px;margin:0}.token-options ul li{padding:16px, 12px, 16px, 12px;color:var(--nylas-base-900);padding:12px 16px;text-decoration:none;display:block;font-family:inherit;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;text-align:left;cursor:pointer}.token-options ul li .token-label{display:flex;flex-direction:column;font-weight:400}.token-options ul li .token-label .token{color:var(--nylas-abse-900);font-size:16px;line-height:24px}.token-options ul li .token-label .description{color:var(--nylas-base-600);font-size:14px;line-height:21px}.token-options ul li:hover,.token-options ul li:focus,.token-options ul li:active,.token-options ul li.active{background-color:var(--nylas-base-100)}.token-options ul li:hover .token-label .token,.token-options ul li:focus .token-label .token,.token-options ul li:active .token-label .token,.token-options ul li.active .token-label .token{color:var(--nylas-primary)}.token-options .selected{background-color:var(--nylas-base-100)}';var p=undefined&&undefined.__decorate||function(e,t,n,s){var l=arguments.length,a=l<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,n):s,o;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")a=Reflect.decorate(e,t,n,s);else for(var i=e.length-1;i>=0;i--)if(o=e[i])a=(l<3?o(a):l>3?o(t,n,a):o(t,n))||a;return l>3&&a&&Object.defineProperty(t,n,a),a};var y=undefined&&undefined.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};const b=class{constructor(n){e(this,n);this.valueChanged=t(this,"valueChanged",7);if(n.$hostElement$["s-ei"]){this.internals=n.$hostElement$["s-ei"]}else{this.internals=n.$hostElement$.attachInternals();n.$hostElement$["s-ei"]=this.internals}this.eventTitle=this.selectedConfiguration?.event_booking?.title;this.name="title";this.noTemplates=false;this.showTokens=false;this.availableTokens=f.map((e=>({label:e.token,value:e.value,labelHTML:e})));this.filteredTokens=this.availableTokens;this.ariaActivedescendant="";this.currentWord={$value:"",fullText:"",index:-1,focusOffset:-1};this.validationError="";this.configEventTitle="";this.additionalFieldTokens=[]}elementNameChangedHandler(e){o("[nylas-event-title]","elementNameChangedHandler",e);this.host.setAttribute("name",e)}ariaActivedescendantChangedHandler(e){o("[nylas-event-title]","ariaActivedescendantChangedHandler",e);if(e!==""){const t=this.host.shadowRoot?.getElementById(e);t?.classList.add("active")}else{const e=this.host.shadowRoot?.querySelectorAll(".token-options li.active");e?.forEach((e=>e.classList.remove("active")))}}configChangedHandler(e){const t=e?.event_booking?.title;const n=e?.scheduler?.additional_fields||{};const s=Object.keys(n)||[];const l=s.map((e=>({token:`$${e}`,value:`\${${e}}`,description:n[e].label||""})));this.additionalFieldTokens=[...l];this.availableTokens=[...f,...l].map((e=>({label:e.token,value:e.value,labelHTML:e})));this.filteredTokens=[...this.availableTokens];if(t){this.configEventTitle=t;this.updateEventTitleFromProp(t)}}selectedLanguageChangedHandler(e,t){if(e===t)return;i.changeLanguage(e);const n={$invitee:"invitee",$invitee_email:"inviteeEmail",$duration:"duration"};this.availableTokens=this.availableTokens.map((e=>{if(n[e.label]){e.labelHTML.description=i.t(`nylasEventTitle.eventTitleTokenDescription.${n[e.label]}`)}return e}));this.filteredTokens=[...this.availableTokens]}themeConfigChangedHandler(e,t){if(e===t)return;this.applyThemeConfig(e)}applyThemeConfig(e){if(e){for(const[t,n]of Object.entries(e)){this.host.style.setProperty(`${t}`,n)}}}connectedCallback(){o("[nylas-event-title]","connectedCallback")}componentWillLoad(){o("[nylas-event-title]","componentWillLoad");this.host.setAttribute("name",this.name)}componentDidLoad(){o("[nylas-event-title]","componentDidLoad");let e=this.eventTitle||this.configEventTitle;if(this.selectedConfiguration?.event_booking?.title){e=this.selectedConfiguration?.event_booking?.title}if(e){this.updateEventTitleFromProp(e);this.updateEventTitle(e,true)}}disconnectedCallback(){o("[nylas-event-title]","disconnectedCallback")}formSubmittedHandler(e){o("[nylas-event-title]","formSubmittedHandler",e);if(!this.internals?.validity?.valid){this.validationError="eventTitleRequired"}else{this.validationError=""}}valueChangedHandler(e){const{name:t,value:n}=e.detail;if(t==="additional-fields"){const e=JSON.parse(n.toString());const t=Object.keys(e)||[];const s=t.map((t=>({token:`$${t}`,value:`\${${t}}`,description:e[t].label||""})));this.additionalFieldTokens=[...s];this.availableTokens=[...f,...s].map((e=>({label:e.token,value:e.value,labelHTML:e})));this.filteredTokens=[...this.availableTokens]}}updateEventTitleFromProp(e){o("[nylas-event-title]","eventTitleChangedHandler",e);const t=e||this.configEventTitle;if(this.titleRef){this.titleRef.innerHTML=this.highlightTokens(t);if(typeof this.internals.setValidity==="function"){if(!t||t===""){this.titleRef.focus();this.internals?.setValidity({customError:true},`Event title is required`,this.titleRef)}else{this.internals?.setValidity({customError:false});this.isInternalsAvailable&&this.internals?.setFormValue(t,this.name)}}}}highlightTokens(e){let t=e;[...f,...this.additionalFieldTokens].forEach((e=>{const n=e.value;const s=new RegExp(`(\\${n})(?!\\w)`,"g");t=t?.replace(s,'<span class="highlighted-tag">$1</span>')||""}));return t}getCurrentSelectionForBrowser(){const e=(e,t,n,s)=>{const l=e.replace(/[\u200B-\u200D\uFEFF]/g,"");const a=l.lastIndexOf("$");const o=l.substring(a).split(" ")[0];return{focusOffset:t,dollarIndex:a,lastWord:o,currentText:l,node:n,allSelected:s}};const t=e=>e.anchorOffset===0&&e.focusOffset===e.focusNode?.nodeValue?.length;const n=r();switch(n){case"Chrome":{const n=this.host.shadowRoot?.getSelection();const s=n?.focusNode;const l=s?.nodeValue||"";const a=n&&t(n);return e(l,n?.focusOffset||-1,s,a)}case"Firefox":{const n=document.getSelection();const s=n?.anchorNode?.nodeValue||"";const l=n&&t(n);return e(s,n?.focusOffset||-1,n?.anchorNode,l)}case"Safari":{const n=window.getSelection();const s=n?.getComposedRanges(this.host.shadowRoot)[0];const l=s?.startContainer?.nodeValue||"";const a=n&&t(n);return e(l,s?.endOffset||-1,s?.startContainer,a)}default:{console.warn("Browser not supported");return null}}}handleChange(e){let t=e.target.textContent||"";t=c(t);const n=this.getCurrentSelectionForBrowser();if(!n){this.updateEventTitle(t);this.resetDropdown();return}const{focusOffset:s,dollarIndex:l,lastWord:a,currentText:o}=n;if(l===-1||s<l){this.updateEventTitle(t);this.resetDropdown();return}if(a.startsWith("$")){this.showTokens=true;this.currentWord={$value:a,fullText:o,index:l,focusOffset:s};this.populateSuggestionsDropdown(a)}else{this.resetDropdown()}this.updateEventTitle(t)}handleInputKeyDown(e){const t=this.getCurrentSelectionForBrowser();if(t?.allSelected&&!d(e)){this.titleRef.innerHTML=""}if(e.key==="Enter"){e.preventDefault();const t=this.host.shadowRoot?.getElementById(this.ariaActivedescendant);if(t){t.click();this.ariaActivedescendant=""}}else if(e.key==="ArrowDown"){e.preventDefault();const t=this.host.shadowRoot?.getElementById(this.ariaActivedescendant);if(t){const e=t.nextElementSibling;if(e){this.ariaActivedescendant=e.id}else{this.ariaActivedescendant=this.filteredTokens[0].label}}else{this.ariaActivedescendant=this.filteredTokens[0].label}}else if(e.key==="ArrowUp"){e.preventDefault();const t=this.host.shadowRoot?.getElementById(this.ariaActivedescendant);if(t){const e=t.previousElementSibling;if(e){this.ariaActivedescendant=e.id}else{this.ariaActivedescendant=this.filteredTokens[this.filteredTokens.length-1].label}}else{this.ariaActivedescendant=this.filteredTokens[this.filteredTokens.length-1].label}}else if(e.key==="Escape"){e.preventDefault();this.resetDropdown()}else if(e.key==="Backspace"||e.key==="Delete"){const n=t?.node?.parentNode;if(t?.currentText.startsWith("${")&&n&&n.nodeName==="SPAN"){e.preventDefault();n.removeChild(t.node);n.remove();this.resetDropdown();this.updateEventTitle(this.titleRef?.textContent||"")}if(this.titleRef.textContent===""||t?.allSelected){this.titleRef.innerHTML="";this.updateEventTitle("")}}}selectOption(e,t){e.preventDefault();const n=this.currentWord.fullText;const s=this.currentWord.$value;let l=this.titleRef.firstChild;let a=null;while(l){if(l.nodeType===3){const e=l.textContent?.replace(/[\u200B-\u200D\uFEFF]/g,"")||"";const t=n.replace(/[\u200B-\u200D\uFEFF]/g,"");if(e.includes(t)){a=l;break}}l=l.nextSibling}if(!a){return}const o=a.textContent||"";const i=o.indexOf(s);const r=o.substring(0,i);const c=o.substring(i+s.length);const d=document.createTextNode(r);const f=document.createRange();const h=document.createElement("span");h.classList.add("highlighted-tag");h.textContent=`${t.value}`;const p=document.createTextNode(c);if(c!==""){a.replaceWith(d,h,p);f.setStart(p,1)}else{const e=document.createTextNode("");a.replaceWith(d,h,e);f.setStart(e,1)}this.resetDropdown();this.titleRef.focus();const y=window.getSelection();f.collapse(true);y?.removeAllRanges();y?.addRange(f);this.updateEventTitle(this.titleRef.textContent||"")}populateSuggestionsDropdown(e=""){this.filteredTokens=this.availableTokens.filter((t=>t.label.startsWith(e.toString())||t.value.startsWith(e.toString())));if(this.filteredTokens.length>0){this.ariaActivedescendant=this.filteredTokens[0].label}}get isInternalsAvailable(){return typeof this.internals!=="undefined"&&typeof this.internals.setValidity==="function"&&typeof this.internals.setFormValue==="function"}updateEventTitle(e,t=false){const n=e.replace(/ +/g," ");if(n===""||/^[\s]*$/.test(n)){this.validationError="eventTitleRequired";this.isInternalsAvailable&&this.internals?.setValidity({customError:true},`Event title is required`,this.titleRef)}else{this.validationError="";this.isInternalsAvailable&&this.internals?.setValidity({customError:false})}this.isInternalsAvailable&&this.internals?.setFormValue(n,this.name);if(!t){this.valueChanged.emit({value:n,name:this.name})}}resetDropdown(){this.showTokens=false;this.ariaActivedescendant=""}getLabelHTML(e){return n("div",{class:"token-label"},n("span",{class:"token"},e.token),n("span",{class:"description"},e.description))}render(){return n(s,{key:"1ff5e27652ff3535717eb28b3dde267545575d73"},n("div",{key:"a764f07a722df7a90a5dc00c22a897e56dce61d1",class:"nylas-event-title",part:"net"},n("label",{key:"dc02c895b645caaeb0d322eb82c8ac8297bb92b9",htmlFor:"title"},i.t("nylasEventTitle.headerTitle"),n("span",{key:"e99c7b6d956204f2f06fe925023b6aad8e02bf68",class:"required"},"*")),n("div",{key:"1c67f937964872a774a1068f33a4f2ea598d250a",class:{title:true,error:this.validationError!==""},part:"net__title",ref:e=>this.titleRef=e,contentEditable:"true",onInput:e=>this.handleChange(e),onKeyDown:e=>this.handleInputKeyDown(e)}),!this.noTemplates&&this.showTokens&&this.filteredTokens?.length>0&&n("div",{key:"194327e179651aaea992f8f5af623c82441d997d",class:"token-options",part:"net__dropdown-content"},n("ul",{key:"e10a66360456ed4f1e31e174e2525d6c9628de18",tabindex:"-1",role:"listbox","aria-label":this.name,"aria-activedescendant":this.ariaActivedescendant},this.filteredTokens.map((e=>n("li",{tabindex:"0",key:e.label,id:e.label,class:{active:this.ariaActivedescendant===e.label},onClick:t=>this.selectOption(t,e),role:"option"},this.getLabelHTML(e.labelHTML)))))),!this.noTemplates&&n("span",{key:"73903f7e16749097c232ddddd0340b7b7f0e46cb",class:"help-text"},i.t("nylasEventTitle.helpText",{context:"start",field:i.t("nylasEventTitle.title")})," ",n("code",{key:"b2a038514f3350345749e8b7501efe92a930f6c2"},"$")," ",i.t("nylasEventTitle.helpText",{context:"end"}),n("span",{key:"a5e5353ce4141ddb90ccc27d8980eb957733050c",class:"label-icon"},n("tooltip-component",{key:"c22473e12b0a90172966220982783a679b6e1511"},n("info-icon",{key:"243aed37a94455511b99ad3c7c09466b137b10fa",slot:"tooltip-icon"}),n("span",{key:"45ac6c651bd5d1a10a24a59a25b3fa2c2eb407ea",slot:"tooltip-content"},i.t("nylasEventTitle.tooltip.desc")," ",n("code",{key:"6a4ff142819dc93f73b812cdc05358bcc2c157de"},"${invitee}"))))),this.validationError!=""&&n("span",{key:"f536b5a68aafe95eb492e9f564fb5189aa1f6a04",class:"error-message"},i.t(`nylasEventTitle.${this.validationError}`))))}static get formAssociated(){return true}get host(){return l(this)}static get watchers(){return{name:["elementNameChangedHandler"],ariaActivedescendant:["ariaActivedescendantChangedHandler"],selectedConfiguration:["configChangedHandler"],selectedLanguage:["selectedLanguageChangedHandler"],themeConfig:["themeConfigChangedHandler"]}}};p([a({name:"nylas-event-title",stateToProps:new Map([["schedulerConfig.selectedConfiguration","selectedConfiguration"],["schedulerConfig.selectedLanguage","selectedLanguage"],["schedulerConfig.themeConfig","themeConfig"]]),eventToProps:{},fireRegisterEvent:true}),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",void 0)],b.prototype,"render",null);b.style=h;export{b as nylas_event_title};
|
|
1
|
+
import{r as e,a as t,h as n,d as s,e as l}from"./index-Cbn5rIwb.js";import{R as a}from"./register-component-Blj8K64f.js";import{b as o,i,L as r,n as c,M as d}from"./utils-DhmCcrVs.js";import{E as f}from"./constants-DhnshuDN.js";const h=':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}.nylas-event-title{display:flex;flex-direction:column;gap:4px;position:relative;text-align:left;color:var(--nylas-base-900)}.nylas-event-title div.title{padding:12px 16px;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);overflow:auto;white-space:nowrap;scrollbar-width:thin;background-color:var(--nylas-base-0)}.nylas-event-title div.title::-webkit-scrollbar{width:6px;height:6px}.nylas-event-title div.title.error{border-color:var(--nylas-error);border-width:2px;outline:none}.nylas-event-title input{padding:12px 16px;border-width:1;border-radius:8px;border:1px solid var(--nylas-base-200)}.nylas-event-title span.help-text{display:inline-block;gap:4px;align-items:center;color:var(--nylas-base-500);font-size:14px;font-style:normal;font-weight:400;line-height:21px;position:relative}.nylas-event-title span.help-text span.label-icon{display:inline-block}.nylas-event-title span.help-text span.label-icon tooltip-component::part(tc__container){position:unset}.nylas-event-title span.help-text span.label-icon tooltip-component::part(tc__content){position:absolute;top:4px;left:50%;transform:translateX(-50%)}.nylas-event-title span.error-message{color:var(--nylas-error)}.nylas-event-title label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:16px;font-style:normal;font-weight:400;line-height:150%;}.nylas-event-title label span.required{color:var(--nylas-error, #cc4841)}.nylas-event-title label span.label-icon{margin-left:4px}.nylas-event-title label span.label-icon tooltip-component{display:flex}.highlighted-tag{background-color:var(--nylas-base-200);border-radius:var(--nylas-border-radius);padding:5px;margin-left:4px}.token-options{display:block;background-color:var(--nylas-base-0);width:100%;max-height:336px;overflow:auto;z-index:1;border-radius:4px;position:absolute;top:80px;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.0509803922);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1019607843)}@media screen and (max-width: 768px){.token-options{right:0;width:325px;max-width:unset}}.token-options ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px;margin:0}.token-options ul li{padding:16px, 12px, 16px, 12px;color:var(--nylas-base-900);padding:12px 16px;text-decoration:none;display:block;font-family:inherit;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;text-align:left;cursor:pointer}.token-options ul li .token-label{display:flex;flex-direction:column;font-weight:400}.token-options ul li .token-label .token{color:var(--nylas-abse-900);font-size:16px;line-height:24px}.token-options ul li .token-label .description{color:var(--nylas-base-600);font-size:14px;line-height:21px}.token-options ul li:hover,.token-options ul li:focus,.token-options ul li:active,.token-options ul li.active{background-color:var(--nylas-base-100)}.token-options ul li:hover .token-label .token,.token-options ul li:focus .token-label .token,.token-options ul li:active .token-label .token,.token-options ul li.active .token-label .token{color:var(--nylas-primary)}.token-options .selected{background-color:var(--nylas-base-100)}';var p=undefined&&undefined.__decorate||function(e,t,n,s){var l=arguments.length,a=l<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,n):s,o;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")a=Reflect.decorate(e,t,n,s);else for(var i=e.length-1;i>=0;i--)if(o=e[i])a=(l<3?o(a):l>3?o(t,n,a):o(t,n))||a;return l>3&&a&&Object.defineProperty(t,n,a),a};var y=undefined&&undefined.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};const b=class{constructor(n){e(this,n);this.valueChanged=t(this,"valueChanged",7);if(n.$hostElement$["s-ei"]){this.internals=n.$hostElement$["s-ei"]}else{this.internals=n.$hostElement$.attachInternals();n.$hostElement$["s-ei"]=this.internals}this.eventTitle=this.selectedConfiguration?.event_booking?.title;this.name="title";this.noTemplates=false;this.showTokens=false;this.availableTokens=f.map((e=>({label:e.token,value:e.value,labelHTML:e})));this.filteredTokens=this.availableTokens;this.ariaActivedescendant="";this.currentWord={$value:"",fullText:"",index:-1,focusOffset:-1};this.validationError="";this.configEventTitle="";this.additionalFieldTokens=[]}elementNameChangedHandler(e){o("[nylas-event-title]","elementNameChangedHandler",e);this.host.setAttribute("name",e)}ariaActivedescendantChangedHandler(e){o("[nylas-event-title]","ariaActivedescendantChangedHandler",e);if(e!==""){const t=this.host.shadowRoot?.getElementById(e);t?.classList.add("active")}else{const e=this.host.shadowRoot?.querySelectorAll(".token-options li.active");e?.forEach((e=>e.classList.remove("active")))}}configChangedHandler(e){const t=e?.event_booking?.title;const n=e?.scheduler?.additional_fields||{};const s=Object.keys(n)||[];const l=s.map((e=>({token:`$${e}`,value:`\${${e}}`,description:n[e].label||""})));this.additionalFieldTokens=[...l];this.availableTokens=[...f,...l].map((e=>({label:e.token,value:e.value,labelHTML:e})));this.filteredTokens=[...this.availableTokens];if(t){this.configEventTitle=t;this.updateEventTitleFromProp(t)}}selectedLanguageChangedHandler(e,t){if(e===t)return;i.changeLanguage(e);const n={$invitee:"invitee",$invitee_email:"inviteeEmail",$duration:"duration"};this.availableTokens=this.availableTokens.map((e=>{if(n[e.label]){e.labelHTML.description=i.t(`nylasEventTitle.eventTitleTokenDescription.${n[e.label]}`)}return e}));this.filteredTokens=[...this.availableTokens]}themeConfigChangedHandler(e,t){if(e===t)return;this.applyThemeConfig(e)}applyThemeConfig(e){if(e){for(const[t,n]of Object.entries(e)){this.host.style.setProperty(`${t}`,n)}}}connectedCallback(){o("[nylas-event-title]","connectedCallback")}componentWillLoad(){o("[nylas-event-title]","componentWillLoad");this.host.setAttribute("name",this.name);this.applyThemeConfig(this.themeConfig)}componentDidLoad(){o("[nylas-event-title]","componentDidLoad");let e=this.eventTitle||this.configEventTitle;if(this.selectedConfiguration?.event_booking?.title){e=this.selectedConfiguration?.event_booking?.title}if(e){this.updateEventTitleFromProp(e);this.updateEventTitle(e,true)}}disconnectedCallback(){o("[nylas-event-title]","disconnectedCallback")}formSubmittedHandler(e){o("[nylas-event-title]","formSubmittedHandler",e);if(!this.internals?.validity?.valid){this.validationError="eventTitleRequired"}else{this.validationError=""}}valueChangedHandler(e){const{name:t,value:n}=e.detail;if(t==="additional-fields"){const e=JSON.parse(n.toString());const t=Object.keys(e)||[];const s=t.map((t=>({token:`$${t}`,value:`\${${t}}`,description:e[t].label||""})));this.additionalFieldTokens=[...s];this.availableTokens=[...f,...s].map((e=>({label:e.token,value:e.value,labelHTML:e})));this.filteredTokens=[...this.availableTokens]}}updateEventTitleFromProp(e){o("[nylas-event-title]","eventTitleChangedHandler",e);const t=e||this.configEventTitle;if(this.titleRef){this.titleRef.innerHTML=this.highlightTokens(t);if(typeof this.internals.setValidity==="function"){if(!t||t===""){this.titleRef.focus();this.internals?.setValidity({customError:true},`Event title is required`,this.titleRef)}else{this.internals?.setValidity({customError:false});this.isInternalsAvailable&&this.internals?.setFormValue(t,this.name)}}}}highlightTokens(e){let t=e;[...f,...this.additionalFieldTokens].forEach((e=>{const n=e.value;const s=new RegExp(`(\\${n})(?!\\w)`,"g");t=t?.replace(s,'<span class="highlighted-tag">$1</span>')||""}));return t}getCurrentSelectionForBrowser(){const e=(e,t,n,s)=>{const l=e.replace(/[\u200B-\u200D\uFEFF]/g,"");const a=l.lastIndexOf("$");const o=l.substring(a).split(" ")[0];return{focusOffset:t,dollarIndex:a,lastWord:o,currentText:l,node:n,allSelected:s}};const t=e=>e.anchorOffset===0&&e.focusOffset===e.focusNode?.nodeValue?.length;const n=r();switch(n){case"Chrome":{const n=this.host.shadowRoot?.getSelection();const s=n?.focusNode;const l=s?.nodeValue||"";const a=n&&t(n);return e(l,n?.focusOffset||-1,s,a)}case"Firefox":{const n=document.getSelection();const s=n?.anchorNode?.nodeValue||"";const l=n&&t(n);return e(s,n?.focusOffset||-1,n?.anchorNode,l)}case"Safari":{const n=window.getSelection();const s=n?.getComposedRanges(this.host.shadowRoot)[0];const l=s?.startContainer?.nodeValue||"";const a=n&&t(n);return e(l,s?.endOffset||-1,s?.startContainer,a)}default:{console.warn("Browser not supported");return null}}}handleChange(e){let t=e.target.textContent||"";t=c(t);const n=this.getCurrentSelectionForBrowser();if(!n){this.updateEventTitle(t);this.resetDropdown();return}const{focusOffset:s,dollarIndex:l,lastWord:a,currentText:o}=n;if(l===-1||s<l){this.updateEventTitle(t);this.resetDropdown();return}if(a.startsWith("$")){this.showTokens=true;this.currentWord={$value:a,fullText:o,index:l,focusOffset:s};this.populateSuggestionsDropdown(a)}else{this.resetDropdown()}this.updateEventTitle(t)}handleInputKeyDown(e){const t=this.getCurrentSelectionForBrowser();if(t?.allSelected&&!d(e)){this.titleRef.innerHTML=""}if(e.key==="Enter"){e.preventDefault();const t=this.host.shadowRoot?.getElementById(this.ariaActivedescendant);if(t){t.click();this.ariaActivedescendant=""}}else if(e.key==="ArrowDown"){e.preventDefault();const t=this.host.shadowRoot?.getElementById(this.ariaActivedescendant);if(t){const e=t.nextElementSibling;if(e){this.ariaActivedescendant=e.id}else{this.ariaActivedescendant=this.filteredTokens[0].label}}else{this.ariaActivedescendant=this.filteredTokens[0].label}}else if(e.key==="ArrowUp"){e.preventDefault();const t=this.host.shadowRoot?.getElementById(this.ariaActivedescendant);if(t){const e=t.previousElementSibling;if(e){this.ariaActivedescendant=e.id}else{this.ariaActivedescendant=this.filteredTokens[this.filteredTokens.length-1].label}}else{this.ariaActivedescendant=this.filteredTokens[this.filteredTokens.length-1].label}}else if(e.key==="Escape"){e.preventDefault();this.resetDropdown()}else if(e.key==="Backspace"||e.key==="Delete"){const n=t?.node?.parentNode;if(t?.currentText.startsWith("${")&&n&&n.nodeName==="SPAN"){e.preventDefault();n.removeChild(t.node);n.remove();this.resetDropdown();this.updateEventTitle(this.titleRef?.textContent||"")}if(this.titleRef.textContent===""||t?.allSelected){this.titleRef.innerHTML="";this.updateEventTitle("")}}}selectOption(e,t){e.preventDefault();const n=this.currentWord.fullText;const s=this.currentWord.$value;let l=this.titleRef.firstChild;let a=null;while(l){if(l.nodeType===3){const e=l.textContent?.replace(/[\u200B-\u200D\uFEFF]/g,"")||"";const t=n.replace(/[\u200B-\u200D\uFEFF]/g,"");if(e.includes(t)){a=l;break}}l=l.nextSibling}if(!a){return}const o=a.textContent||"";const i=o.indexOf(s);const r=o.substring(0,i);const c=o.substring(i+s.length);const d=document.createTextNode(r);const f=document.createRange();const h=document.createElement("span");h.classList.add("highlighted-tag");h.textContent=`${t.value}`;const p=document.createTextNode(c);if(c!==""){a.replaceWith(d,h,p);f.setStart(p,1)}else{const e=document.createTextNode("");a.replaceWith(d,h,e);f.setStart(e,1)}this.resetDropdown();this.titleRef.focus();const y=window.getSelection();f.collapse(true);y?.removeAllRanges();y?.addRange(f);this.updateEventTitle(this.titleRef.textContent||"")}populateSuggestionsDropdown(e=""){this.filteredTokens=this.availableTokens.filter((t=>t.label.startsWith(e.toString())||t.value.startsWith(e.toString())));if(this.filteredTokens.length>0){this.ariaActivedescendant=this.filteredTokens[0].label}}get isInternalsAvailable(){return typeof this.internals!=="undefined"&&typeof this.internals.setValidity==="function"&&typeof this.internals.setFormValue==="function"}updateEventTitle(e,t=false){const n=e.replace(/ +/g," ");if(n===""||/^[\s]*$/.test(n)){this.validationError="eventTitleRequired";this.isInternalsAvailable&&this.internals?.setValidity({customError:true},`Event title is required`,this.titleRef)}else{this.validationError="";this.isInternalsAvailable&&this.internals?.setValidity({customError:false})}this.isInternalsAvailable&&this.internals?.setFormValue(n,this.name);if(!t){this.valueChanged.emit({value:n,name:this.name})}}resetDropdown(){this.showTokens=false;this.ariaActivedescendant=""}getLabelHTML(e){return n("div",{class:"token-label"},n("span",{class:"token"},e.token),n("span",{class:"description"},e.description))}render(){return n(s,{key:"1fa3955fef4d1579a70cdb753cb11d5e378b5146"},n("div",{key:"e86b28fb6c8b9bd161faabaa12123589d06f8b04",class:"nylas-event-title",part:"net"},n("label",{key:"9306c57cc5029234f1a870172c7c8ba865cb28d2",htmlFor:"title"},i.t("nylasEventTitle.headerTitle"),n("span",{key:"d4d6afc2f3ab2e753f0b590f76ef580b57116ce5",class:"required"},"*")),n("div",{key:"f8a0c7b4e089da09815a564225724829a0f5a34a",class:{title:true,error:this.validationError!==""},part:"net__title",ref:e=>this.titleRef=e,contentEditable:"true",onInput:e=>this.handleChange(e),onKeyDown:e=>this.handleInputKeyDown(e)}),!this.noTemplates&&this.showTokens&&this.filteredTokens?.length>0&&n("div",{key:"4a599ed2dc260b3af6007597e4224d346512c1b9",class:"token-options",part:"net__dropdown-content"},n("ul",{key:"88a76728daf8b5f29f51f308fc89896ec9491ca5",tabindex:"-1",role:"listbox","aria-label":this.name,"aria-activedescendant":this.ariaActivedescendant},this.filteredTokens.map((e=>n("li",{tabindex:"0",key:e.label,id:e.label,class:{active:this.ariaActivedescendant===e.label},onClick:t=>this.selectOption(t,e),role:"option"},this.getLabelHTML(e.labelHTML)))))),!this.noTemplates&&n("span",{key:"7287fa9df80c6fb27d66be3f4f8c6da25a7a6702",class:"help-text"},i.t("nylasEventTitle.helpText",{context:"start",field:i.t("nylasEventTitle.title")})," ",n("code",{key:"ad5b3cf4f460e336a0573335ac25054b4bd4a59b"},"$")," ",i.t("nylasEventTitle.helpText",{context:"end"}),n("span",{key:"14a4a6220382d6e18e6de5534a01980e27dd747d",class:"label-icon"},n("tooltip-component",{key:"bb56826332fc93b4aada8b517c5e4af7ec43a4ac"},n("info-icon",{key:"279f0e3b809bc39c2ccda98dc616f21338bafd74",slot:"tooltip-icon"}),n("span",{key:"0149e8427ca0ad971f14509786f2638389369fbe",slot:"tooltip-content"},i.t("nylasEventTitle.tooltip.desc")," ",n("code",{key:"7c5e9b3d350e46463bef4d9cdca53b7ea6b4b247"},"${invitee}"))))),this.validationError!=""&&n("span",{key:"58b4ea6e08ae930334210fc8f2c8f43eae7cba99",class:"error-message"},i.t(`nylasEventTitle.${this.validationError}`))))}static get formAssociated(){return true}get host(){return l(this)}static get watchers(){return{name:["elementNameChangedHandler"],ariaActivedescendant:["ariaActivedescendantChangedHandler"],selectedConfiguration:["configChangedHandler"],selectedLanguage:["selectedLanguageChangedHandler"],themeConfig:["themeConfigChangedHandler"]}}};p([a({name:"nylas-event-title",stateToProps:new Map([["schedulerConfig.selectedConfiguration","selectedConfiguration"],["schedulerConfig.selectedLanguage","selectedLanguage"],["schedulerConfig.themeConfig","themeConfig"]]),eventToProps:{},fireRegisterEvent:true}),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",void 0)],b.prototype,"render",null);b.style=h;export{b as nylas_event_title};
|
|
2
2
|
//# sourceMappingURL=nylas-event-title.entry.js.map
|