@nylas/web-elements 1.1.0-canary.15 → 1.1.0-canary.16
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/cjs/add-circle-icon_2.cjs.entry.js +10 -17
- package/dist/cjs/add-circle-icon_2.cjs.entry.js.map +1 -1
- package/dist/cjs/{calendar-info-icon_25.cjs.entry.js → calendar-info-icon_27.cjs.entry.js} +161 -27
- package/dist/cjs/calendar-info-icon_27.cjs.entry.js.map +1 -0
- package/dist/cjs/google-logo-icon_4.cjs.entry.js +12 -7
- package/dist/cjs/google-logo-icon_4.cjs.entry.js.map +1 -1
- package/dist/cjs/index-7af03e3f.js +8 -16
- package/dist/cjs/index-c14ea8f5.js +12 -12
- package/dist/cjs/input-dropdown.cjs.entry.js +9 -2
- package/dist/cjs/input-dropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/input-dropdown_2.cjs.entry.js +9 -2
- package/dist/cjs/input-dropdown_2.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/nylas-additional-participants.cjs.entry.js +34 -14
- package/dist/cjs/nylas-additional-participants.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-booked-event-card_10.cjs.entry.js +2 -2
- package/dist/cjs/nylas-booked-event-card_10.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-booking-form.cjs.entry.js +2 -2
- package/dist/cjs/nylas-booking-form.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-cancellation-policy.cjs.entry.js +1 -1
- package/dist/cjs/nylas-custom-booking-flow.cjs.entry.js +1 -1
- package/dist/cjs/nylas-customize-booking-settings.cjs.entry.js +4 -4
- package/dist/cjs/nylas-customize-booking-settings.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-editor-tabs.cjs.entry.js +12 -7
- package/dist/cjs/nylas-editor-tabs.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-event-info.cjs.entry.js +1 -1
- package/dist/cjs/nylas-event-limits.cjs.entry.js +1 -1
- package/dist/cjs/nylas-event-location.cjs.entry.js +3 -3
- package/dist/cjs/nylas-form-card.cjs.entry.js +1 -1
- package/dist/cjs/nylas-limit-future-bookings.cjs.entry.js +1 -1
- package/dist/cjs/nylas-min-booking-notice.cjs.entry.js +1 -1
- package/dist/cjs/nylas-min-cancellation-notice.cjs.entry.js +1 -1
- package/dist/cjs/nylas-provider.cjs.entry.js +1 -1
- package/dist/cjs/nylas-scheduler-editor.cjs.entry.js +4 -2
- package/dist/cjs/nylas-scheduler-editor.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-scheduling.cjs.entry.js +1 -1
- package/dist/cjs/nylas-scheduling.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-time-window-picker.cjs.entry.js +1 -1
- package/dist/cjs/nylas-timeslot-interval.cjs.entry.js +2 -2
- package/dist/cjs/nylas-web-elements.cjs.js +1 -1
- package/dist/cjs/{scheduler-config-store-a5b7c08b.js → scheduler-config-store-0266631b.js} +2 -1
- package/dist/cjs/scheduler-config-store-0266631b.js.map +1 -0
- package/dist/cjs/{scheduler-config-store-918c20d5.js → scheduler-config-store-9f19c7a9.js} +2 -1
- package/dist/cjs/scheduler-config-store-9f19c7a9.js.map +1 -0
- package/dist/cjs/scheduler-store-0f7328f1.js.map +1 -1
- package/dist/cjs/scheduler-store-743ed238.js.map +1 -1
- package/dist/collection/components/design-system/input-dropdown/input-dropdown.js +10 -1
- package/dist/collection/components/design-system/input-dropdown/input-dropdown.js.map +1 -1
- package/dist/collection/components/scheduler/nylas-booking-form/nylas-booking-form.js +2 -2
- package/dist/collection/components/scheduler/nylas-booking-form/nylas-booking-form.js.map +1 -1
- package/dist/collection/components/scheduler/nylas-cancel-booking-form/nylas-cancel-booking-form.js +1 -1
- package/dist/collection/components/scheduler/nylas-cancelled-event-card/nylas-cancelled-event-card.js +1 -1
- package/dist/collection/components/scheduler/nylas-date-picker/nylas-date-picker.js +1 -1
- package/dist/collection/components/scheduler/nylas-scheduling/nylas-scheduling.css +1 -0
- package/dist/collection/components/scheduler-editor/nylas-additional-participants/nylas-additional-participants.css +20 -1
- package/dist/collection/components/scheduler-editor/nylas-additional-participants/nylas-additional-participants.js +62 -13
- package/dist/collection/components/scheduler-editor/nylas-additional-participants/nylas-additional-participants.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-cancellation-policy/nylas-cancellation-policy.js +1 -1
- package/dist/collection/components/scheduler-editor/nylas-custom-booking-flow/nylas-custom-booking-flow.js +1 -1
- package/dist/collection/components/scheduler-editor/nylas-customize-booking-settings/nylas-customize-booking-settings.js +5 -5
- package/dist/collection/components/scheduler-editor/nylas-customize-booking-settings/nylas-customize-booking-settings.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs.js +9 -7
- package/dist/collection/components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-editor-tabs/tab-contents.js +2 -0
- package/dist/collection/components/scheduler-editor/nylas-editor-tabs/tab-contents.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-event-info/nylas-event-info.js +1 -1
- package/dist/collection/components/scheduler-editor/nylas-event-limits/nylas-event-limits.js +1 -1
- package/dist/collection/components/scheduler-editor/nylas-event-location/nylas-event-location.js +3 -3
- package/dist/collection/components/scheduler-editor/nylas-form-card/nylas-form-card.js +1 -1
- package/dist/collection/components/scheduler-editor/nylas-limit-future-bookings/nylas-limit-future-bookings.js +1 -1
- package/dist/collection/components/scheduler-editor/nylas-min-booking-notice/nylas-min-booking-notice.js +1 -1
- package/dist/collection/components/scheduler-editor/nylas-min-cancellation-notice/nylas-min-cancellation-notice.js +1 -1
- package/dist/collection/components/scheduler-editor/nylas-scheduler-editor/nylas-scheduler-editor.js +25 -2
- package/dist/collection/components/scheduler-editor/nylas-scheduler-editor/nylas-scheduler-editor.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-time-window-picker/nylas-time-window-picker.js +1 -1
- package/dist/collection/components/scheduler-editor/nylas-timeslot-interval/nylas-timeslot-interval.js +2 -2
- package/dist/collection/stores/scheduler-config-store.js +1 -0
- package/dist/collection/stores/scheduler-config-store.js.map +1 -1
- package/dist/collection/stores/scheduler-store.js.map +1 -1
- package/dist/components/input-dropdown2.js +11 -3
- package/dist/components/input-dropdown2.js.map +1 -1
- package/dist/components/nylas-additional-participants.js +1 -127
- package/dist/components/nylas-additional-participants.js.map +1 -1
- package/dist/components/nylas-additional-participants2.js +164 -0
- package/dist/components/nylas-additional-participants2.js.map +1 -0
- package/dist/components/nylas-booking-form2.js +2 -2
- package/dist/components/nylas-booking-form2.js.map +1 -1
- package/dist/components/nylas-cancellation-policy2.js +1 -1
- package/dist/components/nylas-custom-booking-flow.js +1 -1
- package/dist/components/nylas-customize-booking-settings2.js +4 -4
- package/dist/components/nylas-customize-booking-settings2.js.map +1 -1
- package/dist/components/nylas-editor-tabs2.js +90 -73
- package/dist/components/nylas-editor-tabs2.js.map +1 -1
- package/dist/components/nylas-event-info2.js +1 -1
- package/dist/components/nylas-event-limits2.js +1 -1
- package/dist/components/nylas-event-location2.js +3 -3
- package/dist/components/nylas-form-card2.js +1 -1
- package/dist/components/nylas-limit-future-bookings2.js +1 -1
- package/dist/components/nylas-min-booking-notice2.js +1 -1
- package/dist/components/nylas-min-cancellation-notice2.js +1 -1
- package/dist/components/nylas-scheduler-editor.js +92 -77
- package/dist/components/nylas-scheduler-editor.js.map +1 -1
- package/dist/components/nylas-scheduling.js +1 -1
- package/dist/components/nylas-scheduling.js.map +1 -1
- package/dist/components/nylas-time-window-picker2.js +1 -1
- package/dist/components/nylas-timeslot-interval2.js +2 -2
- package/dist/components/people-icon.js +1 -32
- package/dist/components/people-icon.js.map +1 -1
- package/dist/components/people.js +36 -0
- package/dist/components/people.js.map +1 -0
- package/dist/components/scheduler-config-store.js +1 -0
- package/dist/components/scheduler-config-store.js.map +1 -1
- package/dist/components/scheduler-store.js.map +1 -1
- package/dist/esm/add-circle-icon.entry.js +1 -1
- package/dist/esm/add-circle-icon_2.entry.js +10 -17
- package/dist/esm/add-circle-icon_2.entry.js.map +1 -1
- package/dist/esm/archive-icon.entry.js +1 -1
- package/dist/esm/arrow-icon.entry.js +1 -1
- package/dist/esm/bold-icon.entry.js +1 -1
- package/dist/esm/button-component.entry.js +1 -1
- package/dist/esm/calendar-cancel-icon.entry.js +1 -1
- package/dist/esm/calendar-check-icon.entry.js +1 -1
- package/dist/esm/calendar-icon.entry.js +1 -1
- package/dist/esm/calendar-info-icon.entry.js +1 -1
- package/dist/esm/{calendar-info-icon_25.entry.js → calendar-info-icon_27.entry.js} +160 -28
- package/dist/esm/calendar-info-icon_27.entry.js.map +1 -0
- package/dist/esm/calendar-patterns-icon.entry.js +1 -1
- package/dist/esm/checkbox-component.entry.js +1 -1
- package/dist/esm/checkmark-circle-icon.entry.js +1 -1
- package/dist/esm/chevron-icon.entry.js +1 -1
- package/dist/esm/clock-icon.entry.js +1 -1
- package/dist/esm/close-icon.entry.js +1 -1
- package/dist/esm/document-refresh-icon.entry.js +1 -1
- package/dist/esm/flow-icon.entry.js +1 -1
- package/dist/esm/folder-icon.entry.js +1 -1
- package/dist/esm/forward-icon.entry.js +1 -1
- package/dist/esm/globe-icon.entry.js +1 -1
- package/dist/esm/google-logo-icon.entry.js +1 -1
- package/dist/esm/google-logo-icon_4.entry.js +12 -7
- package/dist/esm/google-logo-icon_4.entry.js.map +1 -1
- package/dist/esm/inbox-icon.entry.js +1 -1
- package/dist/esm/{index-11d12497.js → index-2c7e4f4b.js} +2 -2
- package/dist/esm/{index-11d12497.js.map → index-2c7e4f4b.js.map} +1 -1
- package/dist/esm/{index-8362ce5c.js → index-582cfc93.js} +14 -14
- package/dist/esm/{index-8362ce5c.js.map → index-582cfc93.js.map} +1 -1
- package/dist/esm/index-7cb0dd3d.js +8 -16
- package/dist/esm/index.js +2 -2
- package/dist/esm/info-icon.entry.js +1 -1
- package/dist/esm/input-component.entry.js +1 -1
- package/dist/esm/input-dropdown.entry.js +10 -3
- package/dist/esm/input-dropdown.entry.js.map +1 -1
- package/dist/esm/input-dropdown_2.entry.js +9 -2
- package/dist/esm/input-dropdown_2.entry.js.map +1 -1
- package/dist/esm/italic-icon.entry.js +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/loading-icon.entry.js +1 -1
- package/dist/esm/location-icon.entry.js +1 -1
- package/dist/esm/location-off-icon.entry.js +1 -1
- package/dist/esm/{mailbox-store-11fa8387.js → mailbox-store-c9b2a4fd.js} +2 -2
- package/dist/esm/{mailbox-store-11fa8387.js.map → mailbox-store-c9b2a4fd.js.map} +1 -1
- package/dist/esm/microsoft-logo-icon.entry.js +1 -1
- package/dist/esm/multi-select-dropdown.entry.js +1 -1
- package/dist/esm/nylas-additional-participants.entry.js +36 -16
- package/dist/esm/nylas-additional-participants.entry.js.map +1 -1
- package/dist/esm/nylas-availability-picker.entry.js +2 -2
- package/dist/esm/nylas-booked-event-card.entry.js +2 -2
- package/dist/esm/nylas-booked-event-card_10.entry.js +2 -2
- package/dist/esm/nylas-booked-event-card_10.entry.js.map +1 -1
- package/dist/esm/nylas-booking-calendar-picker.entry.js +2 -2
- package/dist/esm/nylas-booking-form.entry.js +4 -4
- package/dist/esm/nylas-booking-form.entry.js.map +1 -1
- package/dist/esm/nylas-buffer-time.entry.js +2 -2
- package/dist/esm/nylas-calendar-picker.entry.js +2 -2
- package/dist/esm/nylas-cancel-booking-form.entry.js +2 -2
- package/dist/esm/nylas-cancellation-policy.entry.js +3 -3
- package/dist/esm/nylas-cancelled-event-card.entry.js +2 -2
- package/dist/esm/nylas-composer.entry.js +1 -1
- package/dist/esm/nylas-custom-booking-flow.entry.js +3 -3
- package/dist/esm/nylas-customize-booking-settings.entry.js +6 -6
- package/dist/esm/nylas-customize-booking-settings.entry.js.map +1 -1
- package/dist/esm/nylas-date-picker.entry.js +2 -2
- package/dist/esm/nylas-editor-tabs.entry.js +14 -9
- package/dist/esm/nylas-editor-tabs.entry.js.map +1 -1
- package/dist/esm/nylas-event-description.entry.js +2 -2
- package/dist/esm/nylas-event-duration.entry.js +2 -2
- package/dist/esm/nylas-event-info.entry.js +3 -3
- package/dist/esm/nylas-event-limits.entry.js +3 -3
- package/dist/esm/nylas-event-location.entry.js +5 -5
- package/dist/esm/nylas-event-title.entry.js +2 -2
- package/dist/esm/nylas-form-card.entry.js +3 -3
- package/dist/esm/nylas-if-state.entry.js +2 -2
- package/dist/esm/nylas-limit-future-bookings.entry.js +3 -3
- package/dist/esm/nylas-list-configurations.entry.js +2 -2
- package/dist/esm/nylas-list-folders.entry.js +2 -2
- package/dist/esm/nylas-list-threads.entry.js +2 -2
- package/dist/esm/nylas-locale-switch.entry.js +2 -2
- package/dist/esm/nylas-login.entry.js +2 -2
- package/dist/esm/nylas-logo.entry.js +1 -1
- package/dist/esm/nylas-mailbox-pagination.entry.js +2 -2
- package/dist/esm/nylas-mailbox-toolbar-button.entry.js +2 -2
- package/dist/esm/nylas-mailbox.entry.js +3 -3
- package/dist/esm/nylas-min-booking-notice.entry.js +3 -3
- package/dist/esm/nylas-min-cancellation-notice.entry.js +3 -3
- package/dist/esm/nylas-notification.entry.js +1 -1
- package/dist/esm/nylas-provider.entry.js +5 -5
- package/dist/esm/nylas-scheduler-editor.entry.js +6 -4
- package/dist/esm/nylas-scheduler-editor.entry.js.map +1 -1
- package/dist/esm/nylas-scheduling.entry.js +4 -4
- package/dist/esm/nylas-scheduling.entry.js.map +1 -1
- package/dist/esm/nylas-selected-event-card.entry.js +2 -2
- package/dist/esm/nylas-summarize-message-button.entry.js +2 -2
- package/dist/esm/nylas-threads-refresh.entry.js +2 -2
- package/dist/esm/nylas-threads-search.entry.js +2 -2
- package/dist/esm/nylas-time-window-picker.entry.js +2 -2
- package/dist/esm/nylas-timeslot-interval.entry.js +4 -4
- package/dist/esm/nylas-timeslot-picker.entry.js +2 -2
- package/dist/esm/nylas-view-email.entry.js +1 -1
- package/dist/esm/nylas-view-thread.entry.js +2 -2
- package/dist/esm/nylas-web-elements.js +3 -3
- package/dist/esm/people-icon.entry.js +1 -1
- package/dist/esm/person-icon.entry.js +1 -1
- package/dist/esm/play-icon.entry.js +1 -1
- package/dist/esm/radio-button-group.entry.js +1 -1
- package/dist/esm/refresh-icon.entry.js +1 -1
- package/dist/esm/{register-component-8e4e394f.js → register-component-6ae95538.js} +2 -2
- package/dist/esm/{register-component-8e4e394f.js.map → register-component-6ae95538.js.map} +1 -1
- package/dist/esm/reply-all-icon.entry.js +1 -1
- package/dist/esm/reply-icon.entry.js +1 -1
- package/dist/esm/{scheduler-config-store-ec3b6190.js → scheduler-config-store-4a50a03d.js} +2 -1
- package/dist/esm/scheduler-config-store-4a50a03d.js.map +1 -0
- package/dist/{nylas-web-elements/scheduler-config-store-8ccc8dc7.js → esm/scheduler-config-store-f20845ad.js} +3 -2
- package/dist/esm/scheduler-config-store-f20845ad.js.map +1 -0
- package/dist/{nylas-web-elements/scheduler-store-c3af2560.js → esm/scheduler-store-17f7f1c8.js} +2 -2
- package/dist/esm/{scheduler-store-c3af2560.js.map → scheduler-store-17f7f1c8.js.map} +1 -1
- package/dist/esm/scheduler-store-f02ce045.js.map +1 -1
- package/dist/esm/search-icon.entry.js +1 -1
- package/dist/esm/select-dropdown.entry.js +1 -1
- package/dist/esm/sent-icon.entry.js +1 -1
- package/dist/esm/spam-icon.entry.js +1 -1
- package/dist/esm/star-icon.entry.js +1 -1
- package/dist/esm/stop-icon.entry.js +1 -1
- package/dist/esm/textarea-component.entry.js +1 -1
- package/dist/esm/time-period-selector.entry.js +1 -1
- package/dist/esm/toggle-switch.entry.js +1 -1
- package/dist/esm/tooltip-component.entry.js +1 -1
- package/dist/esm/translate-icon.entry.js +1 -1
- package/dist/esm/trash-icon.entry.js +1 -1
- package/dist/esm/underline-icon.entry.js +1 -1
- package/dist/esm/warning-icon.entry.js +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-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.js +1 -1
- package/dist/nylas-web-elements/checkmark-circle-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/document-refresh-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/inbox-icon.entry.js +1 -1
- package/dist/nylas-web-elements/{index-11d12497.js → index-2c7e4f4b.js} +2 -2
- package/dist/nylas-web-elements/{index-11d12497.js.map → index-2c7e4f4b.js.map} +1 -1
- package/dist/nylas-web-elements/{index-8362ce5c.js → index-582cfc93.js} +2 -2
- package/dist/nylas-web-elements/{index-8362ce5c.js.map → index-582cfc93.js.map} +1 -1
- package/dist/nylas-web-elements/index.esm.js +2 -2
- package/dist/nylas-web-elements/info-icon.entry.js +1 -1
- package/dist/nylas-web-elements/input-component.entry.js +1 -1
- package/dist/nylas-web-elements/input-dropdown.entry.js +10 -3
- package/dist/nylas-web-elements/input-dropdown.entry.js.map +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/{mailbox-store-11fa8387.js → mailbox-store-c9b2a4fd.js} +2 -2
- package/dist/nylas-web-elements/{mailbox-store-11fa8387.js.map → mailbox-store-c9b2a4fd.js.map} +1 -1
- package/dist/nylas-web-elements/microsoft-logo-icon.entry.js +1 -1
- package/dist/nylas-web-elements/multi-select-dropdown.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-additional-participants.entry.js +36 -16
- package/dist/nylas-web-elements/nylas-additional-participants.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-availability-picker.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-booked-event-card.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-booking-calendar-picker.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-booking-form.entry.js +4 -4
- package/dist/nylas-web-elements/nylas-booking-form.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-buffer-time.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-calendar-picker.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-cancel-booking-form.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-cancellation-policy.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-cancelled-event-card.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-composer.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-custom-booking-flow.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-customize-booking-settings.entry.js +6 -6
- package/dist/nylas-web-elements/nylas-customize-booking-settings.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-date-picker.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-editor-tabs.entry.js +14 -9
- package/dist/nylas-web-elements/nylas-editor-tabs.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-event-description.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-event-duration.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-event-info.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-event-limits.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-event-location.entry.js +5 -5
- package/dist/nylas-web-elements/nylas-event-title.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-form-card.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-if-state.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-limit-future-bookings.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-list-configurations.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-list-folders.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-list-threads.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-locale-switch.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-login.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-logo.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-mailbox-pagination.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-mailbox-toolbar-button.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-mailbox.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-min-booking-notice.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-min-cancellation-notice.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-notification.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-provider.entry.js +5 -5
- package/dist/nylas-web-elements/nylas-scheduler-editor.entry.js +6 -4
- package/dist/nylas-web-elements/nylas-scheduler-editor.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-scheduling.entry.js +4 -4
- package/dist/nylas-web-elements/nylas-scheduling.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-selected-event-card.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-summarize-message-button.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-threads-refresh.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-threads-search.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-time-window-picker.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-timeslot-interval.entry.js +4 -4
- package/dist/nylas-web-elements/nylas-timeslot-picker.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-view-email.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-view-thread.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-web-elements.esm.js +3 -3
- package/dist/nylas-web-elements/p-05833164.entry.js +2 -0
- package/dist/nylas-web-elements/p-05833164.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-a804616a.entry.js → p-09fec39c.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-df2b34ee.entry.js → p-13b003b5.entry.js} +2 -2
- package/dist/nylas-web-elements/p-29938263.js +2 -0
- package/dist/nylas-web-elements/p-29938263.js.map +1 -0
- package/dist/nylas-web-elements/{p-afd34a25.entry.js → p-2f656fb3.entry.js} +3 -3
- package/dist/nylas-web-elements/p-2f656fb3.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-427548f5.entry.js +2 -0
- package/dist/nylas-web-elements/p-427548f5.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-470536e0.entry.js +2 -0
- package/dist/nylas-web-elements/p-470536e0.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-4f548e66.entry.js +2 -0
- package/dist/nylas-web-elements/p-4f548e66.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-823c8aa2.js.map +1 -1
- package/dist/nylas-web-elements/p-96418bc6.entry.js +2 -0
- package/dist/nylas-web-elements/p-96418bc6.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-9acfea5f.entry.js +2 -0
- package/dist/nylas-web-elements/p-9acfea5f.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-84529d9b.entry.js → p-b27e34a9.entry.js} +2 -2
- package/dist/nylas-web-elements/p-efd5b80a.entry.js +2 -0
- package/dist/nylas-web-elements/p-efd5b80a.entry.js.map +1 -0
- package/dist/nylas-web-elements/people-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/radio-button-group.entry.js +1 -1
- package/dist/nylas-web-elements/refresh-icon.entry.js +1 -1
- package/dist/nylas-web-elements/{register-component-8e4e394f.js → register-component-6ae95538.js} +2 -2
- package/dist/nylas-web-elements/{register-component-8e4e394f.js.map → register-component-6ae95538.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/{esm/scheduler-config-store-8ccc8dc7.js → nylas-web-elements/scheduler-config-store-f20845ad.js} +3 -2
- package/dist/nylas-web-elements/scheduler-config-store-f20845ad.js.map +1 -0
- package/dist/{esm/scheduler-store-c3af2560.js → nylas-web-elements/scheduler-store-17f7f1c8.js} +2 -2
- package/dist/nylas-web-elements/{scheduler-store-c3af2560.js.map → scheduler-store-17f7f1c8.js.map} +1 -1
- package/dist/nylas-web-elements/search-icon.entry.js +1 -1
- package/dist/nylas-web-elements/select-dropdown.entry.js +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.js +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-icon.entry.js +1 -1
- package/dist/nylas-web-elements/underline-icon.entry.js +1 -1
- package/dist/nylas-web-elements/warning-icon.entry.js +1 -1
- package/dist/types/components/design-system/input-dropdown/input-dropdown.d.ts +1 -0
- package/dist/types/components/scheduler-editor/nylas-additional-participants/nylas-additional-participants.d.ts +11 -1
- package/dist/types/components/scheduler-editor/nylas-scheduler-editor/nylas-scheduler-editor.d.ts +2 -0
- package/dist/types/components.d.ts +12 -2
- package/dist/types/stores/scheduler-config-store.d.ts +2 -1
- package/dist/types/stores/scheduler-store.d.ts +1 -1
- package/package.json +2 -2
- package/dist/cjs/calendar-info-icon_25.cjs.entry.js.map +0 -1
- package/dist/cjs/scheduler-config-store-918c20d5.js.map +0 -1
- package/dist/cjs/scheduler-config-store-a5b7c08b.js.map +0 -1
- package/dist/esm/calendar-info-icon_25.entry.js.map +0 -1
- package/dist/esm/scheduler-config-store-8ccc8dc7.js.map +0 -1
- package/dist/esm/scheduler-config-store-ec3b6190.js.map +0 -1
- package/dist/nylas-web-elements/p-155942d0.entry.js +0 -2
- package/dist/nylas-web-elements/p-155942d0.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-237d2b4e.entry.js +0 -2
- package/dist/nylas-web-elements/p-237d2b4e.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-2e813dd0.entry.js +0 -2
- package/dist/nylas-web-elements/p-2e813dd0.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-35b66ab6.entry.js +0 -2
- package/dist/nylas-web-elements/p-35b66ab6.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-6239608c.entry.js +0 -2
- package/dist/nylas-web-elements/p-6239608c.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-86895fc4.entry.js +0 -2
- package/dist/nylas-web-elements/p-86895fc4.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-afd34a25.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-b406bf70.entry.js +0 -2
- package/dist/nylas-web-elements/p-b406bf70.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-ee91a2a0.js +0 -2
- package/dist/nylas-web-elements/p-ee91a2a0.js.map +0 -1
- package/dist/nylas-web-elements/p-f1bd124d.entry.js +0 -2
- package/dist/nylas-web-elements/p-f1bd124d.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-fac4d89e.entry.js +0 -2
- package/dist/nylas-web-elements/p-fac4d89e.entry.js.map +0 -1
- package/dist/nylas-web-elements/scheduler-config-store-8ccc8dc7.js.map +0 -1
- /package/dist/nylas-web-elements/{p-a804616a.entry.js.map → p-09fec39c.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-df2b34ee.entry.js.map → p-13b003b5.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-84529d9b.entry.js.map → p-b27e34a9.entry.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nylas-scheduler-editor.js","sourceRoot":"","sources":["../../../../src/components/scheduler-editor/nylas-scheduler-editor/nylas-scheduler-editor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAAY,2BAA2B,EAA8B,MAAM,4BAA4B,CAAC;AAE/G,OAAO,EAAE,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;AAC7F,OAAO,EAAE,+BAA+B,EAAiE,MAAM,iCAAiC,CAAC;AACjJ,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAU,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACrH,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAY5C,MAAM,OAAO,oBAAoB;;QAoRvB,sCAAiC,GAAG,CAAC,MAAa,EAAE,EAAE;YAC5D,MAAM,KAAK,GAAG,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC/D,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC;gBAC5B,YAAY,CAAC,UAAU,CA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { NylasBaseProvider } from '@/common/abstract-provider';\nimport type { SchedulerEditorEventOverride } from '@/common/component-types';\nimport { AuthArgs, NylasIdentityRequestWrapper, User, type NylasApiRequest } from '@/common/nylas-api-request';\nimport { RegisteredComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { CreateNylasSchedulerConfigStore, NylasSchedulerConfigStoreState, NylasSchedulerConfigStoreType } from '@/stores/scheduler-config-store';\nimport { debug } from '@/utils/utils';\nimport { Config, NylasSessions } from '@nylas/identity';\nimport { Component, Element, Event, EventEmitter, Host, Listen, Method, Prop, State, Watch, h } from '@stencil/core';\nimport { LoginRequired } from './LoginRequired';\nimport { ExpressFlow } from './ExpressFlow';\n\n/**\n * The `nylas-scheduler-editor` component is a form that allows users to configure the settings for the Nylas Scheduler.\n *\n * @slot login-required - This slot is used to display a message when the user is not logged in.\n */\n@Component({\n tag: 'nylas-scheduler-editor',\n styleUrl: 'nylas-scheduler-editor.scss',\n shadow: true,\n})\nexport class NylasSchedulerEditor {\n /**\n * Stores to be used by the provider.\n */\n private stores?: {\n schedulerConfig: NylasSchedulerConfigStoreType;\n };\n\n /**\n * This is a base provide that defines the common methods and properties\n * that all providers should have.\n *\n * Because stencil does not support abstract classes, we have to use a\n * property to store the base provider instance.\n */\n private baseProvider?: NylasBaseProvider<Exclude<typeof this.stores, undefined>>;\n\n /**\n * The Nylas Scheduler Config Connector instance.\n * The brains of the provider. It manages data fetching and state synchronization.\n */\n private nylasSchedulerConfigConnector?: NylasSchedulerConfigConnector;\n\n /**\n * The host element.\n * Used to manage the host element of the provider.\n */\n @Element() private host!: HTMLNylasSchedulerEditorElement;\n\n /***\n * The configuration id to use for the scheduler editor.\n * If provided, then the scheduler editor will try and fetch the configuration\n * with the provided id. If found, it will automatically load the editor\n * with the configuration settings for editing.\n */\n @Prop({ mutable: true }) configurationId?: string;\n\n /**\n * The Nylas Api Request instance.\n * Used to make requests to the Nylas API.\n */\n @Prop({ mutable: true }) nylasApiRequest?: NylasApiRequest;\n\n /**\n * The Nylas Sessions configuration.\n * Used to configure the Nylas Sessions instance.\n */\n @Prop() nylasSessionsConfig?: Config;\n\n /**\n * The default authentication arguments to use when authenticating a user.\n */\n @Prop() defaultAuthArgs?: AuthArgs[];\n\n /**\n * This provides a way to override the default event handlers.\n */\n @Prop() eventOverrides: SchedulerEditorEventOverride = {};\n\n /**\n * The scheduler preview link to use when the user clicks on the preview button.\n * You can use the placeholder `{config.id}` to replace the configuration id anywhere in the link.\n */\n @Prop({ attribute: 'scheduler-preview-link' }) schedulerPreviewLink: string = '';\n\n /**\n * The default scheduler config store state.\n * Used to set the initial state of the scheduler config store.\n * This state can be used to pass defaults to newly created configurations.\n */\n @Prop({ attribute: 'default-scheduler-config-store-state' }) readonly defaultSchedulerConfigState?: Partial<NylasSchedulerConfigStoreState>;\n\n /**\n * This is used to set the mode for the scheduler config.\n * The mode can be 'app' or 'composable'.\n * The default mode is 'app'.\n */\n @Prop({ attribute: 'mode' }) readonly mode: 'app' | 'composable' = 'app';\n\n /**\n * This event is fired when the provider is initialized.\n * By default, this event handles determining if the user is logged in or not.\n * In addition, it fetches the provided configuration if a valid configuration id is provided.\n */\n @Event({ cancelable: true }) readonly init!: EventEmitter<HTMLNylasSchedulerEditorElement>;\n\n /**\n * This event is fired when the the NylasAuth isAuthenticated state changes\n * to true.\n */\n @Event({ cancelable: true }) readonly loggedIn!: EventEmitter<HTMLNylasSchedulerEditorElement>;\n\n /**\n * This event is fired when the the NylasAuth isAuthenticated state changes\n * to false.\n */\n @Event({ cancelable: true }) readonly loggedOut!: EventEmitter<HTMLNylasSchedulerEditorElement>;\n\n /**\n * This event is fired when the close button on scheduler config is clicked.\n */\n @Event({ cancelable: true }) readonly schedulerConfigCloseClicked!: EventEmitter<HTMLNylasSchedulerEditorElement>;\n\n /**\n * Automatically register components that have the `@RegisterComponent` decorator.\n * If this is set to false, you will need to manually register components using the\n * `registerComponent` method.\n * @default true\n */\n @State() automaticComponentRegistration: boolean = true;\n\n connectedCallback() {\n debug(`[nylas-scheduler-editor] connectedCallback`);\n }\n\n async componentWillLoad() {\n debug(`[nylas-scheduler-editor] componentWillLoad`);\n this.stores = {\n schedulerConfig: CreateNylasSchedulerConfigStore({\n ...this.defaultSchedulerConfigState,\n }),\n };\n\n if (!this.nylasApiRequest && this.nylasSessionsConfig) {\n const nylasSession = new NylasSessions(this.nylasSessionsConfig);\n\n // We must check if the user is logged in before continuing\n // otherwise, a PCKE code will not be generated and the user\n // will not be able to log in.\n await nylasSession.isLoggedIn();\n\n // Watch for login events so that we can automatically update the state\n nylasSession.onLoginSuccess(async () => {\n const currentUser = await this.nylasSchedulerConfigConnector?.schedulerConfig?.currentUser();\n if (currentUser) {\n this.loggedIn.emit(this.host);\n this.loggedInHandler(currentUser);\n }\n });\n\n // Watch for logout events so that we can automatically update the state\n nylasSession.onLoginFail(async () => {\n this.stores?.schedulerConfig?.set('currentUser', null);\n this.loggedOut.emit(this.host);\n });\n\n this.nylasApiRequest = new NylasIdentityRequestWrapper(nylasSession);\n }\n\n if (this.nylasApiRequest && this.defaultAuthArgs) {\n this.nylasApiRequest.setDefaultAuthArgs(this.defaultAuthArgs);\n }\n\n this.baseProvider = new NylasBaseProvider(this.host, this.stores, this.automaticComponentRegistration, this.eventOverrides);\n\n const nylasSchedulerConfigStore = this.baseProvider.getStore('schedulerConfig');\n this.nylasSchedulerConfigConnector = new NylasSchedulerConfigConnector({\n nylasApiRequest: this.nylasApiRequest,\n nylasSchedulerConfigStore: nylasSchedulerConfigStore,\n });\n\n const initEvent = this.init.emit(this.host);\n if (!initEvent.defaultPrevented) {\n const currentUser = await this.nylasSchedulerConfigConnector?.schedulerConfig?.currentUser();\n if (currentUser) {\n this.loggedIn.emit(this.host);\n await this.loggedInHandler(currentUser);\n } else {\n this.stores?.schedulerConfig?.set('currentUser', null);\n this.loggedOut.emit(this.host);\n }\n }\n\n // Watch for store changes\n this.stores?.schedulerConfig?.onChange('selectedConfiguration', async config => {\n if (config && config.id) {\n this.configurationId = config.id;\n }\n });\n\n this.baseProvider?.componentWillLoad(this.nylasSchedulerConfigConnector);\n }\n\n async componentDidLoad() {\n debug(`[nylas-scheduler-editor] componentDidLoad`);\n this.baseProvider?.componentDidLoad();\n }\n\n componentDisconnected() {\n this.baseProvider?.componentDisconnected();\n }\n\n /**\n * Watch for changes to the configuration id and automatically fetch the configuration\n * when the configuration id changes. If the configuration id is cleared, then the\n * configuration is cleared as well.\n * @param newConfigurationId The new configuration id\n */\n @Watch('configurationId')\n async configurationIdChanged(newConfigurationId: string) {\n if (newConfigurationId) {\n await this.nylasSchedulerConfigConnector?.schedulerConfig?.getConfigurationById(newConfigurationId);\n this.stores?.schedulerConfig?.set('action', 'edit');\n } else {\n // Clear the configuration\n this.stores?.schedulerConfig?.set('selectedConfiguration', {});\n this.stores?.schedulerConfig?.set('action', null);\n }\n }\n\n /**\n * This method is used to get the NylasSchedulerConfigStore instance.\n * You can use this instance to update or get the state of the store.\n * @returns Promise<NylasSchedulerConfigStoreType | undefined>\n */\n @Method()\n async store(): Promise<NylasSchedulerConfigStoreType | undefined> {\n return this.stores?.schedulerConfig;\n }\n\n /**\n * This method is used to get the NylasSchedulerConfigConnector instance.\n * You can use this instance to make requests to the Nylas API.\n * @returns Promise<NylasSchedulerConfigConnector | undefined>\n */\n @Method()\n async schedulerConnector(): Promise<NylasSchedulerConfigConnector | undefined> {\n return this.nylasSchedulerConfigConnector;\n }\n\n /**\n * This is a custom event handler that is used to register a component with the provider.\n * It is used by components that have the `@RegisterComponent` decorator.\n * @param event A custom event that contains the component to register\n * @returns Promise<void>\n */\n @Listen('registerComponent')\n async registerComponentHandler(event: CustomEvent<RegisteredComponent<any, any>>): Promise<void> {\n this.baseProvider?.registerComponent(event.detail);\n }\n\n /**\n * This is a custom event handler that is used to unregister a component with the provider.\n * It is used by components that have the `@RegisterComponent` decorator.\n * @param event A custom event that contains the component to unregister\n * @returns Promise<void>\n */\n @Listen('unregisterComponent')\n async unregisterComponentHandler(event: CustomEvent<RegisteredComponent<any, any>>): Promise<void> {\n this.baseProvider?.unregisterComponent(event.detail);\n }\n\n /**\n * Upon login, set the current user and fetch the configuration and calendars.\n * @param currentUser The current user that is logged in\n */\n private async loggedInHandler(currentUser: User) {\n this.stores?.schedulerConfig?.set('currentUser', currentUser);\n\n if (!this.nylasSchedulerConfigConnector) {\n return;\n }\n\n if (this.configurationId) {\n const data = await this.nylasSchedulerConfigConnector.schedulerConfig?.getConfigurationById(this.configurationId);\n if (data && data[0]?.id) {\n this.stores?.schedulerConfig?.set('action', 'edit');\n }\n }\n\n await this.nylasSchedulerConfigConnector.schedulerConfig?.getCalendars();\n }\n\n /**\n * This is a custom event handler that is used to update the state of the provider.\n */\n private handleSchedulerConfigCloseClicked = (_event: Event) => {\n const event = this.schedulerConfigCloseClicked.emit(this.host);\n if (!event.defaultPrevented) {\n localStorage.removeItem('grant');\n localStorage.removeItem('user');\n window.location.reload();\n }\n };\n\n /**\n * This method is used to get the authentication URL for a provider.\n * @param provider The provider to get the authentication URL for (e.g. google, microsoft, etc.)\n * @returns Promise<string> The authentication URL to redirect the user for the provider\n */\n private authenticationUrl = async (provider?: string) => {\n if (!this.nylasApiRequest) {\n console.error(`[nylas-scheduler-editor] Nylas API Request is not initialized.`);\n return '';\n }\n const url = await this.nylasApiRequest.authenticationUrl({ provider });\n\n return url || '';\n };\n\n render() {\n return (\n <Host>\n <div class=\"scheduler-editor-header\" part=\"nse__header\">\n <h1 class=\"scheduler-editor-title\" part=\"nse__title\">\n <calendar-icon width=\"18\" height=\"18\" />\n Scheduler editor\n </h1>\n <button class=\"scheduler-editor-close\" title=\"logout\" onClick={e => this.handleSchedulerConfigCloseClicked(e)} part=\"nse__close-button\">\n <close-icon width=\"18\" height=\"18\" />\n </button>\n </div>\n {this.stores?.schedulerConfig?.state.currentUser && this.stores.schedulerConfig.state.action === null && (\n <div class=\"list-configurations\">\n <nylas-list-configurations></nylas-list-configurations>\n </div>\n )}\n {this.stores?.schedulerConfig?.state.currentUser && this.stores.schedulerConfig.state.action === 'create' && (\n // If the mode is 'app', then render the editor tabs in a composable mode with children for creating a new configuration (Express flow).\n <nylas-editor-tabs mode=\"composable\">\n <ExpressFlow />\n </nylas-editor-tabs>\n )}\n {this.stores?.schedulerConfig?.state.currentUser && this.stores.schedulerConfig.state.action === 'edit' && (\n <nylas-editor-tabs mode={this.mode}>{this.mode === 'composable' && <slot />}</nylas-editor-tabs>\n )}\n {!this.stores?.schedulerConfig?.state.currentUser && (\n <slot name=\"login-required\">\n <LoginRequired authenticationUrl={this.authenticationUrl} />\n </slot>\n )}\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"nylas-scheduler-editor.js","sourceRoot":"","sources":["../../../../src/components/scheduler-editor/nylas-scheduler-editor/nylas-scheduler-editor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAAY,2BAA2B,EAA8B,MAAM,4BAA4B,CAAC;AAE/G,OAAO,EAAE,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;AAC7F,OAAO,EAAE,+BAA+B,EAAiE,MAAM,iCAAiC,CAAC;AACjJ,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAU,aAAa,EAAE,MAAM,iBAAiB,CAAC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G,yBAAmB,IAAI,EAAC,YAAY;gBAClC,EAAC,WAAW,OAAG,CACG,CACrB;YACA,IAAI,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,CAAC,WAAW,IAAI,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,MAAM,KAAK,MAAM,IAAI,CACzG,yBAAmB,IAAI,EAAE,IAAI,CAAC,IAAI,IAAG,IAAI,CAAC,IAAI,KAAK,YAAY,IAAI,eAAQ,CAAqB,CACjG;YACA,CAAC,IAAI,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,CAAC,WAAW,IAAI,CACnD,YAAM,IAAI,EAAC,gBAAgB;gBACzB,EAAC,aAAa,IAAC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,GAAI,CACvD,CACR,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { NylasBaseProvider } from '@/common/abstract-provider';\nimport type { SchedulerEditorEventOverride } from '@/common/component-types';\nimport { AuthArgs, NylasIdentityRequestWrapper, User, type NylasApiRequest } from '@/common/nylas-api-request';\nimport { RegisteredComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { CreateNylasSchedulerConfigStore, NylasSchedulerConfigStoreState, NylasSchedulerConfigStoreType } from '@/stores/scheduler-config-store';\nimport { debug } from '@/utils/utils';\nimport { Config, NylasSessions } from '@nylas/identity';\nimport { Component, Element, Event, EventEmitter, Host, Listen, Method, Prop, State, Watch, h } from '@stencil/core';\nimport { LoginRequired } from './LoginRequired';\nimport { ExpressFlow } from './ExpressFlow';\nimport { Participant } from '@nylas/core';\n\n/**\n * The `nylas-scheduler-editor` component is a form that allows users to configure the settings for the Nylas Scheduler.\n *\n * @slot login-required - This slot is used to display a message when the user is not logged in.\n */\n@Component({\n tag: 'nylas-scheduler-editor',\n styleUrl: 'nylas-scheduler-editor.scss',\n shadow: true,\n})\nexport class NylasSchedulerEditor {\n /**\n * Stores to be used by the provider.\n */\n private stores?: {\n schedulerConfig: NylasSchedulerConfigStoreType;\n };\n\n /**\n * This is a base provide that defines the common methods and properties\n * that all providers should have.\n *\n * Because stencil does not support abstract classes, we have to use a\n * property to store the base provider instance.\n */\n private baseProvider?: NylasBaseProvider<Exclude<typeof this.stores, undefined>>;\n\n /**\n * The Nylas Scheduler Config Connector instance.\n * The brains of the provider. It manages data fetching and state synchronization.\n */\n private nylasSchedulerConfigConnector?: NylasSchedulerConfigConnector;\n\n /**\n * The host element.\n * Used to manage the host element of the provider.\n */\n @Element() private host!: HTMLNylasSchedulerEditorElement;\n\n /***\n * The configuration id to use for the scheduler editor.\n * If provided, then the scheduler editor will try and fetch the configuration\n * with the provided id. If found, it will automatically load the editor\n * with the configuration settings for editing.\n */\n @Prop({ mutable: true }) configurationId?: string;\n\n /**\n * The Nylas Api Request instance.\n * Used to make requests to the Nylas API.\n */\n @Prop({ mutable: true }) nylasApiRequest?: NylasApiRequest;\n\n /**\n * The Nylas Sessions configuration.\n * Used to configure the Nylas Sessions instance.\n */\n @Prop() nylasSessionsConfig?: Config;\n\n /**\n * The default authentication arguments to use when authenticating a user.\n */\n @Prop() defaultAuthArgs?: AuthArgs[];\n\n /**\n * This provides a way to override the default event handlers.\n */\n @Prop() eventOverrides: SchedulerEditorEventOverride = {};\n\n /**\n * The scheduler preview link to use when the user clicks on the preview button.\n * You can use the placeholder `{config.id}` to replace the configuration id anywhere in the link.\n */\n @Prop({ attribute: 'scheduler-preview-link' }) schedulerPreviewLink: string = '';\n\n /**\n * The default scheduler config store state.\n * Used to set the initial state of the scheduler config store.\n * This state can be used to pass defaults to newly created configurations.\n */\n @Prop({ attribute: 'default-scheduler-config-store-state' }) readonly defaultSchedulerConfigState?: Partial<NylasSchedulerConfigStoreState>;\n\n /**\n * This is used to set the mode for the scheduler config.\n * The mode can be 'app' or 'composable'.\n * The default mode is 'app'.\n */\n @Prop({ attribute: 'mode' }) readonly mode: 'app' | 'composable' = 'app';\n\n /**\n * This prop is used to populate the additional participants and\n * their availability in the scheduler editor.\n */\n @Prop({ attribute: 'additional-participants' }) additionalParticipants?: Participant[];\n\n /**\n * This event is fired when the provider is initialized.\n * By default, this event handles determining if the user is logged in or not.\n * In addition, it fetches the provided configuration if a valid configuration id is provided.\n */\n @Event({ cancelable: true }) readonly init!: EventEmitter<HTMLNylasSchedulerEditorElement>;\n\n /**\n * This event is fired when the the NylasAuth isAuthenticated state changes\n * to true.\n */\n @Event({ cancelable: true }) readonly loggedIn!: EventEmitter<HTMLNylasSchedulerEditorElement>;\n\n /**\n * This event is fired when the the NylasAuth isAuthenticated state changes\n * to false.\n */\n @Event({ cancelable: true }) readonly loggedOut!: EventEmitter<HTMLNylasSchedulerEditorElement>;\n\n /**\n * This event is fired when the close button on scheduler config is clicked.\n */\n @Event({ cancelable: true }) readonly schedulerConfigCloseClicked!: EventEmitter<HTMLNylasSchedulerEditorElement>;\n\n /**\n * Automatically register components that have the `@RegisterComponent` decorator.\n * If this is set to false, you will need to manually register components using the\n * `registerComponent` method.\n * @default true\n */\n @State() automaticComponentRegistration: boolean = true;\n\n connectedCallback() {\n debug(`[nylas-scheduler-editor] connectedCallback`);\n }\n\n async componentWillLoad() {\n debug(`[nylas-scheduler-editor] componentWillLoad`);\n this.stores = {\n schedulerConfig: CreateNylasSchedulerConfigStore({\n ...this.defaultSchedulerConfigState,\n additionalParticipants: this.additionalParticipants,\n }),\n };\n\n if (!this.nylasApiRequest && this.nylasSessionsConfig) {\n const nylasSession = new NylasSessions(this.nylasSessionsConfig);\n\n // We must check if the user is logged in before continuing\n // otherwise, a PCKE code will not be generated and the user\n // will not be able to log in.\n await nylasSession.isLoggedIn();\n\n // Watch for login events so that we can automatically update the state\n nylasSession.onLoginSuccess(async () => {\n const currentUser = await this.nylasSchedulerConfigConnector?.schedulerConfig?.currentUser();\n if (currentUser) {\n this.loggedIn.emit(this.host);\n this.loggedInHandler(currentUser);\n }\n });\n\n // Watch for logout events so that we can automatically update the state\n nylasSession.onLoginFail(async () => {\n this.stores?.schedulerConfig?.set('currentUser', null);\n this.loggedOut.emit(this.host);\n });\n\n this.nylasApiRequest = new NylasIdentityRequestWrapper(nylasSession);\n }\n\n if (this.nylasApiRequest && this.defaultAuthArgs) {\n this.nylasApiRequest.setDefaultAuthArgs(this.defaultAuthArgs);\n }\n\n this.baseProvider = new NylasBaseProvider(this.host, this.stores, this.automaticComponentRegistration, this.eventOverrides);\n\n const nylasSchedulerConfigStore = this.baseProvider.getStore('schedulerConfig');\n this.nylasSchedulerConfigConnector = new NylasSchedulerConfigConnector({\n nylasApiRequest: this.nylasApiRequest,\n nylasSchedulerConfigStore: nylasSchedulerConfigStore,\n });\n\n const initEvent = this.init.emit(this.host);\n if (!initEvent.defaultPrevented) {\n const currentUser = await this.nylasSchedulerConfigConnector?.schedulerConfig?.currentUser();\n if (currentUser) {\n this.loggedIn.emit(this.host);\n await this.loggedInHandler(currentUser);\n } else {\n this.stores?.schedulerConfig?.set('currentUser', null);\n this.loggedOut.emit(this.host);\n }\n }\n\n // Watch for store changes\n this.stores?.schedulerConfig?.onChange('selectedConfiguration', async config => {\n if (config && config.id) {\n this.configurationId = config.id;\n }\n });\n\n this.baseProvider?.componentWillLoad(this.nylasSchedulerConfigConnector);\n }\n\n async componentDidLoad() {\n debug(`[nylas-scheduler-editor] componentDidLoad`);\n this.baseProvider?.componentDidLoad();\n }\n\n componentDisconnected() {\n this.baseProvider?.componentDisconnected();\n }\n\n /**\n * Watch for changes to the configuration id and automatically fetch the configuration\n * when the configuration id changes. If the configuration id is cleared, then the\n * configuration is cleared as well.\n * @param newConfigurationId The new configuration id\n */\n @Watch('configurationId')\n async configurationIdChanged(newConfigurationId: string) {\n if (newConfigurationId) {\n await this.nylasSchedulerConfigConnector?.schedulerConfig?.getConfigurationById(newConfigurationId);\n this.stores?.schedulerConfig?.set('action', 'edit');\n } else {\n // Clear the configuration\n this.stores?.schedulerConfig?.set('selectedConfiguration', {});\n this.stores?.schedulerConfig?.set('action', null);\n }\n }\n\n /**\n * This method is used to get the NylasSchedulerConfigStore instance.\n * You can use this instance to update or get the state of the store.\n * @returns Promise<NylasSchedulerConfigStoreType | undefined>\n */\n @Method()\n async store(): Promise<NylasSchedulerConfigStoreType | undefined> {\n return this.stores?.schedulerConfig;\n }\n\n /**\n * This method is used to get the NylasSchedulerConfigConnector instance.\n * You can use this instance to make requests to the Nylas API.\n * @returns Promise<NylasSchedulerConfigConnector | undefined>\n */\n @Method()\n async schedulerConnector(): Promise<NylasSchedulerConfigConnector | undefined> {\n return this.nylasSchedulerConfigConnector;\n }\n\n /**\n * This is a custom event handler that is used to register a component with the provider.\n * It is used by components that have the `@RegisterComponent` decorator.\n * @param event A custom event that contains the component to register\n * @returns Promise<void>\n */\n @Listen('registerComponent')\n async registerComponentHandler(event: CustomEvent<RegisteredComponent<any, any>>): Promise<void> {\n this.baseProvider?.registerComponent(event.detail);\n }\n\n /**\n * This is a custom event handler that is used to unregister a component with the provider.\n * It is used by components that have the `@RegisterComponent` decorator.\n * @param event A custom event that contains the component to unregister\n * @returns Promise<void>\n */\n @Listen('unregisterComponent')\n async unregisterComponentHandler(event: CustomEvent<RegisteredComponent<any, any>>): Promise<void> {\n this.baseProvider?.unregisterComponent(event.detail);\n }\n\n /**\n * Upon login, set the current user and fetch the configuration and calendars.\n * @param currentUser The current user that is logged in\n */\n private async loggedInHandler(currentUser: User) {\n this.stores?.schedulerConfig?.set('currentUser', currentUser);\n\n if (!this.nylasSchedulerConfigConnector) {\n return;\n }\n\n if (this.configurationId) {\n const data = await this.nylasSchedulerConfigConnector.schedulerConfig?.getConfigurationById(this.configurationId);\n if (data && data[0]?.id) {\n this.stores?.schedulerConfig?.set('action', 'edit');\n }\n }\n\n await this.nylasSchedulerConfigConnector.schedulerConfig?.getCalendars();\n }\n\n /**\n * This is a custom event handler that is used to update the state of the provider.\n */\n private handleSchedulerConfigCloseClicked = (_event: Event) => {\n const event = this.schedulerConfigCloseClicked.emit(this.host);\n if (!event.defaultPrevented) {\n localStorage.removeItem('grant');\n localStorage.removeItem('user');\n window.location.reload();\n }\n };\n\n /**\n * This method is used to get the authentication URL for a provider.\n * @param provider The provider to get the authentication URL for (e.g. google, microsoft, etc.)\n * @returns Promise<string> The authentication URL to redirect the user for the provider\n */\n private authenticationUrl = async (provider?: string) => {\n if (!this.nylasApiRequest) {\n console.error(`[nylas-scheduler-editor] Nylas API Request is not initialized.`);\n return '';\n }\n const url = await this.nylasApiRequest.authenticationUrl({ provider });\n\n return url || '';\n };\n\n render() {\n return (\n <Host>\n <div class=\"scheduler-editor-header\" part=\"nse__header\">\n <h1 class=\"scheduler-editor-title\" part=\"nse__title\">\n <calendar-icon width=\"18\" height=\"18\" />\n Scheduler editor\n </h1>\n <button class=\"scheduler-editor-close\" title=\"logout\" onClick={e => this.handleSchedulerConfigCloseClicked(e)} part=\"nse__close-button\">\n <close-icon width=\"18\" height=\"18\" />\n </button>\n </div>\n {this.stores?.schedulerConfig?.state.currentUser && this.stores.schedulerConfig.state.action === null && (\n <div class=\"list-configurations\">\n <nylas-list-configurations></nylas-list-configurations>\n </div>\n )}\n {this.stores?.schedulerConfig?.state.currentUser && this.stores.schedulerConfig.state.action === 'create' && (\n // If the mode is 'app', then render the editor tabs in a composable mode with children for creating a new configuration (Express flow).\n <nylas-editor-tabs mode=\"composable\">\n <ExpressFlow />\n </nylas-editor-tabs>\n )}\n {this.stores?.schedulerConfig?.state.currentUser && this.stores.schedulerConfig.state.action === 'edit' && (\n <nylas-editor-tabs mode={this.mode}>{this.mode === 'composable' && <slot />}</nylas-editor-tabs>\n )}\n {!this.stores?.schedulerConfig?.state.currentUser && (\n <slot name=\"login-required\">\n <LoginRequired authenticationUrl={this.authenticationUrl} />\n </slot>\n )}\n </Host>\n );\n }\n}\n"]}
|
|
@@ -254,7 +254,7 @@ export class TimeInput {
|
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
256
|
render() {
|
|
257
|
-
return (h(Host, { key: '
|
|
257
|
+
return (h(Host, { key: '3dcb132dc120ec0a5d6a87f7570ab80cb2e7ea4d' }, h("div", { key: '2c7cedc0ada83478cfbf494aec47a7ea74ef75a2', class: "time-picker", part: "time-picker" }, h("input", { key: '2aa4c3f63baf9a757bbc4bc328a4533f072371e8', type: "text", name: this.name, id: this.name, part: "time-input", class: {
|
|
258
258
|
'time-input': true,
|
|
259
259
|
'error': !!this.err || this.hasError,
|
|
260
260
|
}, ref: el => (this.timeInput = el), value: this.time, onClick: () => {
|
|
@@ -115,9 +115,9 @@ export class NylasTimeslotInterval {
|
|
|
115
115
|
{ value: '45', label: '45 mins' },
|
|
116
116
|
{ value: '60', label: '60 mins' },
|
|
117
117
|
];
|
|
118
|
-
return (h(Host, { key: '
|
|
118
|
+
return (h(Host, { key: '9c18133d3cbd15e000d01a96e263a6733dcc8e99' }, h("div", { key: '7bd06065aafe18728f36459b77d7fc4806822f10', class: "nylas-timeslot-interval", part: "nti" }, h("div", { key: '15746bf796ff8c9e4fd53ddd90f63916050ee04b', class: "header", part: "nti__header" }, h("h3", { key: 'aa810ca197364fd7733cbf130b873c3d818faeb1' }, "Time-slot interval preferences"), h("p", { key: '82bc4717c917713f17e6bee8623a949e2bfef8e0' }, "Choose your interval preference for time-slots.")), h("div", { key: 'ee4fa651eda5c579122dde7ee2982a4d72463d57', class: "nylas-timeslot-interval__dropdown" }, h("span", { key: '81ebbbb0387a3bce67475cc8f4dc87ccca6c0bde', class: "label", part: "nti__input-label" }, "Select interval preference", h("tooltip-component", { key: '461710561b0433a0b11cfe94ee3992caf5e3219d' }, h("info-icon", { key: '76afb5257805385077723d9023f10186dbb7beff', slot: "tooltip-icon" }), h("span", { key: 'e1b549b0b9da7c25a98bb65f5f190ad0c491efa5', slot: "tooltip-content" }, "Set the interval preference for the time-slots."))), h("select-dropdown", { key: '9aca7454f181f124346314b775c21e1cb9d73268', name: "booking-calendar", options: intervalPreferenceOptions, withSearch: false, exportparts: "sd_dropdown: nti__dropdown, sd_dropdown-button: nti__dropdown-button, sd_dropdown-content: nti__dropdown-content", defaultSelectedOption: this.defaultIntervalMinutes == this.eventDurationMinutes
|
|
119
119
|
? intervalPreferenceOptions[0]
|
|
120
|
-
: intervalPreferenceOptions.find(op => op.value == this.defaultIntervalMinutes.toString()) ?? intervalPreferenceOptions[0] }), h("span", { key: '
|
|
120
|
+
: intervalPreferenceOptions.find(op => op.value == this.defaultIntervalMinutes.toString()) ?? intervalPreferenceOptions[0] }), h("span", { key: 'c035b67e0d48587909166fc254263e0c3132a802', class: "label", part: "nti__input-label" }, "Select the type of time-slot rounding", h("tooltip-component", { key: '7319296977085837167db8032c6e64da5c7a2de2' }, h("info-icon", { key: 'f5a4f712492db6dc31dbc951b1dc510db18b3de8', slot: "tooltip-icon" }), h("span", { key: '1e2ea5c7453132f26dec5b179bf91d2908b64060', slot: "tooltip-content" }, "Select if you want to round the time slots to the nearest interval."))), h("radio-button-group", { key: '871c8f566df35a7bc1db98eda4610d2f4b76ad85', name: "interval-preference", defaultSelectedValue: this.defaultRoundTo && this.defaultRoundTo === this.defaultIntervalMinutes ? 'rounding' : 'no-rounding', options: [
|
|
121
121
|
{ value: 'no-rounding', label: 'Default', description: 'Time-slots will be rounded to the nearest quarter-hour.' },
|
|
122
122
|
{
|
|
123
123
|
value: 'rounding',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduler-config-store.js","sourceRoot":"","sources":["../../src/stores/scheduler-config-store.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,WAAW,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"scheduler-config-store.js","sourceRoot":"","sources":["../../src/stores/scheduler-config-store.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAiD5D,MAAM,UAAU,+BAA+B,CAAC,eAAwD,EAAE;IACxG,MAAM,2BAA2B,GAAmC;QAClE,qBAAqB,EAAE,EAAE;QACzB,cAAc,EAAE,EAAE;QAClB,SAAS,EAAE,EAAE;QACb,WAAW,EAAE,IAAI;QACjB,MAAM,EAAE,IAAI;QACZ,sBAAsB,EAAE,EAAE;QAC1B,GAAG,YAAY;KAChB,CAAC;IACF,MAAM,KAAK,GAAG,WAAW,CAAiC,2BAA2B,CAAC,CAAC;IAMvF,SAAS,0BAA0B;QACjC,KAAK,CAAC,GAAG,CAAC,uBAAuB,EAAE,EAAE,GAAG,YAAY,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC;IACnF,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,QAAQ,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACtC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,0BAA0B,EAAE,CAAC;QAC/B,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,GAAG,KAAK;QACR,0BAA0B;KAC3B,CAAC;AACJ,CAAC","sourcesContent":["import { Calendar, Configuration, Participant } from '@nylas/core';\nimport { ObservableMap, createStore } from '@stencil/store';\nimport { User } from '@/common/nylas-api-request';\n\ntype RecursivePartial<T> = {\n [P in keyof T]?: T[P] extends (infer U)[] ? RecursivePartial<U>[] : T[P] extends object | undefined ? RecursivePartial<T[P]> : T[P];\n};\n\nexport interface NylasSchedulerConfigStoreState {\n /**\n * The selected configuration.\n * This is the configuration that is currently selected, use it to populate default values for new configurations.\n */\n selectedConfiguration: RecursivePartial<Configuration>;\n /**\n * The list of configurations.\n * This is the list of configurations that the user has created.\n */\n configurations: Configuration[];\n /**\n * The list of calendars.\n * This is the list of calendars that the user has access to.\n */\n calendars: Calendar[];\n /**\n * The current user.\n * This is the user that is currently logged in.\n */\n currentUser: User | null;\n /**\n * The current action.\n * This is the current action that the user is performing.\n */\n action: 'create' | 'edit' | null;\n /**\n * The additional participants.\n */\n additionalParticipants: Participant[];\n}\n\nexport type NylasSchedulerConfigStoreType = ReturnType<typeof CreateNylasSchedulerConfigStore>;\n\nexport type CreateNylasSchedulerConfigStoreReturnType = ObservableMap<NylasSchedulerConfigStoreState> & {\n /**\n * Reset the selected configuration to the default state.\n * This is used to reset the selected configuration to the default state instead of setting it to an empty object.\n */\n resetSelectedConfiguration: () => void;\n};\n\nexport function CreateNylasSchedulerConfigStore(defaultState: Partial<NylasSchedulerConfigStoreState> = {}): CreateNylasSchedulerConfigStoreReturnType {\n const defaultSchedulerConfigState: NylasSchedulerConfigStoreState = {\n selectedConfiguration: {},\n configurations: [],\n calendars: [],\n currentUser: null,\n action: null,\n additionalParticipants: [],\n ...defaultState,\n };\n const store = createStore<NylasSchedulerConfigStoreState>(defaultSchedulerConfigState);\n\n /**\n * Reset the selected configuration to the default state.\n * This is used to reset the selected configuration to the default state instead of setting it to an empty object.\n */\n function resetSelectedConfiguration() {\n store.set('selectedConfiguration', { ...defaultState['selectedConfiguration'] });\n }\n\n store.onChange('action', async action => {\n if (!action) {\n resetSelectedConfiguration();\n }\n });\n\n return {\n ...store,\n resetSelectedConfiguration,\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduler-store.js","sourceRoot":"","sources":["../../src/stores/scheduler-store.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAqD7C,MAAM,UAAU,yBAA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K,CAAC,GAAG,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;IAOH,KAAK,CAAC,KAAK,GAAG,GAAG,EAAE;QACjB,KAAK,MAAM,GAAG,IAAI,sBAAsB,EAAE,CAAC;YACzC,MAAM,KAAK,GAAG,sBAAsB,CAAC,GAA0C,CAAC,CAAC;YACjF,KAAK,CAAC,GAAG,CAAC,GAAU,EAAE,KAAK,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { DataState, NylasEvent } from '@/common/types';\nimport { debug } from '@/utils/utils';\nimport { NylasSchedulerBookingData, Timeslot } from '@nylas/core';\nimport { createStore } from '@stencil/store';\n\nexport type AvailabilityTimeslot = {\n emails: string[];\n start_time: Date;\n end_time: Date;\n};\n\nexport type LoadingState = {\n api: 'availability' | 'createBooking' | 'cancelBooking' | 'rescheduleBooking';\n};\n\nexport type ConfigSettings = {\n scheduler: {\n available_days_in_future: number;\n min_cancellation_notice: number;\n min_booking_notice: number;\n rescheduling_url?: string;\n cancellation_url?: string;\n cancellation_policy?: string;\n
|
|
1
|
+
{"version":3,"file":"scheduler-store.js","sourceRoot":"","sources":["../../src/stores/scheduler-store.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAqD7C,MAAM,UAAU,yBAAyB,CAAC,eAAkD,EAAE;IAC5F,MAAM,sBAAsB,GAA6B;QACvD,YAAY,EAAE,IAAI;QAClB,gBAAgB,EAAE,SAAS,CAAC,QAAQ;QACpC,gBAAgB,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,eAAe,EAAE,CAAC,QAAQ;QAClE,gBAAgB,EAAE,IAAI;QACtB,eAAe,EAAE,KAAK;QACtB,eAAe,EAAE,IAAI;QACrB,YAAY,EAAE,EAAE;QAChB,aAAa,E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,CAAC,CAAC;IAEF,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { DataState, NylasEvent } from '@/common/types';\nimport { debug } from '@/utils/utils';\nimport { NylasSchedulerBookingData, Timeslot } from '@nylas/core';\nimport { createStore } from '@stencil/store';\n\nexport type AvailabilityTimeslot = {\n emails: string[];\n start_time: Date;\n end_time: Date;\n};\n\nexport type LoadingState = {\n api: 'availability' | 'createBooking' | 'cancelBooking' | 'rescheduleBooking';\n};\n\nexport type ConfigSettings = {\n scheduler: {\n available_days_in_future: number;\n min_cancellation_notice: number;\n min_booking_notice: number;\n rescheduling_url?: string;\n cancellation_url?: string;\n cancellation_policy?: string;\n hide_additional_guests?: boolean;\n hide_cancellation_options?: boolean;\n hide_rescheduling_options?: boolean;\n };\n organizer: {\n name: string;\n email: string;\n };\n};\n\nexport interface NylasSchedulerStoreState {\n selectedDate: Date | null;\n selectedLanguage: string;\n selectedTimezone: string;\n selectedTimeslot: Timeslot | null;\n showBookingForm: boolean;\n selectableDates: Date[] | null;\n eventDuration: number;\n availability: AvailabilityTimeslot[];\n state: DataState;\n eventInfo: NylasEvent | null;\n cancelledEventInfo: Partial<NylasEvent> | null;\n reschedulingEventInfo?: NylasEvent;\n bookingInfo?: NylasSchedulerBookingData;\n rescheduleBookingId?: string;\n cancelBookingId?: string;\n isLoading: boolean;\n nylasBranding?: boolean;\n configSettings?: ConfigSettings;\n}\n\nexport type NylasSchedulerStoreType = ReturnType<typeof CreateNylasSchedulerStore>;\n\nexport function CreateNylasSchedulerStore(defaultState: Partial<NylasSchedulerStoreState> = {}) {\n const defaultNylasStoreState: NylasSchedulerStoreState = {\n selectedDate: null,\n selectedLanguage: navigator.language,\n selectedTimezone: Intl.DateTimeFormat().resolvedOptions().timeZone,\n selectedTimeslot: null,\n showBookingForm: false,\n selectableDates: null,\n availability: [],\n eventDuration: 0,\n state: 'ready',\n eventInfo: null,\n cancelledEventInfo: null,\n isLoading: false,\n nylasBranding: true,\n ...defaultState,\n };\n debug(`[defaultNylasStoreState]: `, defaultNylasStoreState);\n const store = createStore<NylasSchedulerStoreState>(defaultNylasStoreState);\n\n store.onChange('availability', availability => {\n debug(`[availability]: `, availability);\n const selectableDates = availability.map(timeslot => timeslot.start_time);\n debug(`[selectableDates]: `, selectableDates);\n store.set('selectableDates', selectableDates);\n const timeslot = availability[0];\n if (!timeslot) return;\n const durationMinutes = Math.floor((timeslot.end_time.getTime() - timeslot.start_time.getTime()) / 60000);\n debug(`[durationMinutes]: `, durationMinutes);\n store.set('eventDuration', durationMinutes);\n });\n\n /**\n * Reset the Nylas store to its default state.\n * There is something wrong with the stencil/store reset method,\n * so we have to do it via this hack.\n */\n store.reset = () => {\n for (const key in defaultNylasStoreState) {\n const value = defaultNylasStoreState[key as keyof typeof defaultNylasStoreState];\n store.set(key as any, value);\n }\n };\n\n return store;\n}\n"]}
|
|
@@ -31,6 +31,12 @@ const InputDropdown = proxyCustomElement(class InputDropdown extends HTMLElement
|
|
|
31
31
|
}
|
|
32
32
|
this.selectedOption = newValue;
|
|
33
33
|
}
|
|
34
|
+
inputValueChangedHandler(newValue, oldValue) {
|
|
35
|
+
if (newValue === oldValue) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
this.inputValue = newValue;
|
|
39
|
+
}
|
|
34
40
|
componentWillLoad() {
|
|
35
41
|
this.filteredOptions = this.options;
|
|
36
42
|
if (!this.selectedOption && !!this.defaultInputOption) {
|
|
@@ -176,7 +182,7 @@ const InputDropdown = proxyCustomElement(class InputDropdown extends HTMLElement
|
|
|
176
182
|
}
|
|
177
183
|
}
|
|
178
184
|
render() {
|
|
179
|
-
return (h("div", { key: '
|
|
185
|
+
return (h("div", { key: '24c46ff43e7ff2701790b5e7cd69833a4c0fa02f', class: "dropdown", part: "id_dropdown" }, h("input", { key: '86724f295c643d3edda0de987b17f85389a0a716', type: "text", name: this.name, id: this.name, part: "id_dropdown-input", class: { dropbtn: true, open: this.isOpen }, value: this.inputValue, onClick: (e) => {
|
|
180
186
|
this.toggleDropdown();
|
|
181
187
|
this.shouldAutoScroll = true;
|
|
182
188
|
this.handleClick(e);
|
|
@@ -187,7 +193,8 @@ const InputDropdown = proxyCustomElement(class InputDropdown extends HTMLElement
|
|
|
187
193
|
get el() { return this; }
|
|
188
194
|
static get watchers() { return {
|
|
189
195
|
"options": ["optionsChangedHandler"],
|
|
190
|
-
"defaultInputOption": ["defaultSelectedOptionChangedHandler"]
|
|
196
|
+
"defaultInputOption": ["defaultSelectedOptionChangedHandler"],
|
|
197
|
+
"inputValue": ["inputValueChangedHandler"]
|
|
191
198
|
}; }
|
|
192
199
|
static get style() { return inputDropdownCss; }
|
|
193
200
|
}, [1, "input-dropdown", {
|
|
@@ -203,7 +210,8 @@ const InputDropdown = proxyCustomElement(class InputDropdown extends HTMLElement
|
|
|
203
210
|
"shouldAutoScroll": [32]
|
|
204
211
|
}, [[6, "click", "handleOutsideClick"]], {
|
|
205
212
|
"options": ["optionsChangedHandler"],
|
|
206
|
-
"defaultInputOption": ["defaultSelectedOptionChangedHandler"]
|
|
213
|
+
"defaultInputOption": ["defaultSelectedOptionChangedHandler"],
|
|
214
|
+
"inputValue": ["inputValueChangedHandler"]
|
|
207
215
|
}]);
|
|
208
216
|
function defineCustomElement() {
|
|
209
217
|
if (typeof customElements === "undefined") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"input-dropdown2.js","mappings":";;AAAA,MAAM,gBAAgB,GAAG,myFAAmyF;;MCmB/yF,aAAa;;;;;;;uBAcY,EAAE;;;+BAYJ,EAAE;8BAMa,IAAI,CAAC,kBAAkB,IAAI,IAAI;sBAIrD,KAAK;+BAKa,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC;oCAMtB,EAAE;gCAKL,KAAK;;IAY1C,qBAAqB,CAAC,QAA0B,EAAE,QAA0B;QAC1E,IAAI,QAAQ,KAAK,QAAQ,EAAE;YACzB,OAAO;SACR;QACD,IAAI,CAAC,eAAe,GAAG,QAAQ,CAAC;KACjC;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,OAAO,EAAE,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EACxC,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE;gBACL,OAAO,EAAE,IAAI,CAAC,oBAAoB,KAAK,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE;aAC/D,IAEA,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,KAAK,CAChD,CACN,CAAC,CACC,CACD,IACJ,IAAI,CACJ,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/design-system/input-dropdown/input-dropdown.scss?tag=input-dropdown&encapsulation=shadow","src/components/design-system/input-dropdown/input-dropdown.tsx"],"sourcesContent":["@import '../../../common/styles/variables.scss';\n\n:host {\n display: block;\n position: relative;\n @media #{$mobile} {\n position: unset;\n }\n @include default-css-variables;\n}\n\n.dropdown {\n display: inline-block;\n}\n\n.dropbtn {\n color: var(--nylas-base-800);\n padding: 10px;\n font-size: 1rem;\n font-family: var(--nylas-font-family);\n cursor: pointer;\n display: flex;\n gap: 0.5rem;\n background: transparent;\n border: none;\n border-radius: var(--nylas-border-radius-2x);\n width: 50px;\n padding: 14px 16px;\n border-radius: var(--nylas-border-radius-2x);\n &.focus {\n background: transparent;\n }\n &:hover,\n &:active {\n outline: 1px solid var(--nylas-primary);\n }\n &:active {\n outline: 2px solid var(--nylas-primary);\n }\n span {\n &.chevron {\n display: flex;\n align-self: center;\n }\n &.open {\n transform: rotate(90deg);\n }\n &.closed {\n transform: rotate(270deg);\n }\n &.selected-option {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n max-width: 144px;\n font-size: 14px;\n line-height: 20px;\n @media #{$mobile} {\n max-width: 124px;\n font-size: 16px;\n }\n }\n }\n}\n\n.dropdown-content {\n display: block;\n margin-top: 0.5rem;\n background-color: var(--nylas-base-0);\n max-width: 306px;\n width: max-content;\n max-height: 336px;\n overflow: auto;\n z-index: 1;\n border-radius: 4px;\n position: absolute;\n @media #{$mobile} {\n right: 0;\n width: 325px;\n max-width: unset;\n }\n box-shadow: 0px 4px 6px -2px rgba(0, 0, 0, 0.05);\n box-shadow: 0px 10px 15px -3px rgba(0, 0, 0, 0.1);\n}\n\n.search-box {\n border-bottom: 1px solid var(--nylas-base-200);\n padding: 10px;\n position: sticky;\n top: 0;\n background: var(--nylas-base-0);\n .icon {\n position: absolute;\n top: 1.25rem;\n left: 1.25rem;\n color: var(--nylas-base-300);\n }\n}\n\n.dropdown-content ul {\n padding: 0;\n list-style-type: none;\n color: var(--nylas-base-900);\n max-height: 336px;\n li {\n padding: 16px, 12px, 16px, 12px;\n color: black;\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 &:hover,\n &:focus {\n background-color: var(--nylas-base-100);\n }\n }\n}\n\n.dropdown-content .selected {\n background-color: #e7e7e7;\n}\n\ninput[type='text'] {\n width: -webkit-fill-available;\n padding: inherit;\n border: 1px solid #ccc;\n border-radius: 4px;\n position: sticky;\n background: no-repeat scroll 7px 7px;\n padding-left: 30px;\n background-size: 16px 16px;\n}\n","import { Component, Element, Event, EventEmitter, h, Listen, Prop, State, Watch } from '@stencil/core';\n\ninterface DropdownOption {\n labelHTML?: HTMLElement;\n label: string;\n value: string;\n}\n\n/**\n * The `input-dropdown` component is a dropdown that allows users to input an option and/or select from a list of options.\n * @part id_dropdown - The dropdown container\n * @part id_dropdown-input - The dropdown button\n * @part id_dropdown-content - The dropdown content\n */\n@Component({\n tag: 'input-dropdown',\n styleUrl: 'input-dropdown.scss',\n shadow: true,\n})\nexport class InputDropdown {\n @Element() el!: HTMLElement;\n\n private inputRef?: HTMLInputElement;\n private optionsRef!: HTMLElement;\n\n // Props\n /**\n * The name of the dropdown\n */\n @Prop() name!: string;\n /**\n * The options to display in the dropdown\n */\n @Prop() options: DropdownOption[] = [];\n /**\n * The default selected option\n */\n @Prop() defaultInputOption?: DropdownOption;\n /**\n * Should show search input\n */\n @Prop() inputValue!: string;\n /**\n * Show pluralized label for the selected option. This is s tring that is appended to the selected option label as a suffix.\n */\n @Prop() pluralizedLabel: string = '';\n\n // States\n /**\n * The selected option\n */\n @State() selectedOption: DropdownOption | null = this.defaultInputOption || null;\n /**\n * The open state of the dropdown\n */\n @State() isOpen: boolean = false;\n\n /**\n * The filtered options based on the search value\n */\n @State() filteredOptions: DropdownOption[] = [...this.options];\n /**\n * The aria-activedescendant attribute for the listbox element to indicate the currently active\n * option in the list box to screen readers. The value of aria-activedescendant is the ID of\n * the active option.\n */\n @State() ariaActivedescendant: string = '';\n\n /**\n * This is used to scroll to the input value.\n */\n @State() shouldAutoScroll: boolean = false;\n\n // Events\n /**\n * This event is fired when the selected option is changed\n */\n @Event({ bubbles: true, composed: true }) inputOptionChanged!: EventEmitter<{\n value: DropdownOption['value'];\n name: string;\n }>;\n\n @Watch('options')\n optionsChangedHandler(newValue: DropdownOption[], oldValue: DropdownOption[]) {\n if (newValue === oldValue) {\n return;\n }\n this.filteredOptions = newValue;\n }\n\n @Watch('defaultInputOption')\n defaultSelectedOptionChangedHandler(newValue: DropdownOption, oldValue: DropdownOption) {\n if (newValue.label === oldValue.label) {\n return;\n }\n this.selectedOption = newValue;\n }\n\n // Lifecycle methods\n componentWillLoad() {\n this.filteredOptions = this.options;\n // Set the selected option to the first option if no option is selected\n if (!this.selectedOption && !!this.defaultInputOption) {\n this.selectedOption = this.defaultInputOption;\n }\n if (!this.selectedOption && this.options.length > 0) {\n this.selectedOption = this.options[0];\n }\n }\n\n // Methods\n toggleDropdown(): void {\n this.isOpen = !this.isOpen;\n }\n\n selectOption(option: DropdownOption): void {\n this.selectedOption = option;\n this.toggleDropdown();\n this.inputOptionChanged.emit({\n value: option.value,\n name: this.name,\n });\n }\n\n handleOnInput(event: Event): void {\n const value = (event.target as HTMLInputElement).value;\n const optionIndex = this.options.findIndex(option => option.label.toLowerCase().includes(value.toLowerCase()));\n if (optionIndex > -1) {\n this.scrollToViewWithinParent(optionIndex);\n }\n this.inputOptionChanged.emit({\n value,\n name: this.name,\n });\n }\n\n scrollToViewWithinParent(optionIndex: number) {\n const option = this.options[optionIndex];\n const childElement = this.el.shadowRoot?.getElementById(option.value.toString()) as HTMLLIElement;\n const parentElement = this.optionsRef;\n\n this.ariaActivedescendant = option.value.toString();\n\n // Scroll child into view within parent\n const childRect = childElement.getBoundingClientRect();\n const parentRect = parentElement.getBoundingClientRect();\n\n if (childRect.top < parentRect.top) {\n // Child is above the visible area of the parent\n parentElement.scrollTop -= parentRect.top - childRect.top;\n } else if (childRect.bottom > parentRect.bottom) {\n // Child is below the visible area of the parent\n parentElement.scrollTop += childRect.bottom - parentRect.bottom;\n }\n }\n\n handleSelectButtonKeyDown(event: KeyboardEvent): void {\n switch (event.key) {\n case 'ArrowDown':\n case 'Enter':\n event.preventDefault();\n if (!this.isOpen) {\n this.toggleDropdown();\n }\n this.inputRef?.focus();\n break;\n case 'Escape':\n this.isOpen = false;\n break;\n }\n }\n\n handleClick(event: Event): void {\n if (this.isOpen) {\n const value = (event.target as HTMLInputElement).value;\n const optionIndex = this.options.findIndex(option => option.label.toLowerCase().includes(value.toLowerCase()));\n if (optionIndex > -1) {\n setTimeout(() => {\n this.scrollToViewWithinParent(optionIndex);\n }, 10);\n }\n }\n }\n\n handleListboxKeydown(e) {\n const items = this.filteredOptions;\n const currentIndex = items.findIndex(item => item.value === this.ariaActivedescendant);\n if (e.key === 'ArrowDown' || (e.key === 'Tab' && !e.shiftKey)) {\n e.preventDefault();\n if (currentIndex === items.length - 1) {\n this.ariaActivedescendant = '';\n this.inputRef?.focus();\n return;\n }\n const nextIndex = currentIndex + 1 < items.length ? currentIndex + 1 : 0;\n this.ariaActivedescendant = items[nextIndex].value;\n this.focusOption(nextIndex);\n } else if (e.key === 'ArrowUp' || (e.key === 'Tab' && e.shiftKey)) {\n e.preventDefault();\n if (currentIndex === 0) {\n this.ariaActivedescendant = '';\n this.inputRef?.focus();\n return;\n }\n const prevIndex = currentIndex - 1 >= 0 ? currentIndex - 1 : items.length - 1;\n this.ariaActivedescendant = items[prevIndex].value;\n this.focusOption(prevIndex);\n } else if (e.key === 'Enter') {\n e.preventDefault();\n if (this.ariaActivedescendant) {\n this.selectOption(items[currentIndex]);\n }\n } else if (e.key === 'Escape') {\n this.isOpen = false;\n }\n }\n\n focusOption(index) {\n const option = this.filteredOptions[index];\n if (!option) return; // Guard clause in case index is out of bounds\n\n const elementId = option.value;\n const element = this.el.shadowRoot?.getElementById(elementId) as HTMLLIElement;\n\n if (element) {\n element.focus(); // Set focus on the element\n element.scrollIntoView({ behavior: 'smooth', block: 'nearest' });\n }\n }\n\n handleComboboxKeyDown(event: KeyboardEvent): void {\n if (event.key === 'ArrowDown' || (event.key == 'Tab' && !event.shiftKey)) {\n event.preventDefault();\n if (!this.isOpen) {\n this.isOpen = true;\n this.shouldAutoScroll = true;\n return;\n }\n this.ariaActivedescendant = this.filteredOptions[0].value;\n this.focusOption(0);\n } else if (event.key === 'ArrowUp' || (event.key === 'Tab' && event.shiftKey)) {\n event.preventDefault();\n this.ariaActivedescendant = this.filteredOptions[this.filteredOptions.length - 1].value;\n this.focusOption(this.filteredOptions.length - 1);\n } else if (event.key === 'Escape') {\n this.isOpen = false;\n }\n }\n\n // Event listeners\n @Listen('click', { target: 'document', capture: true })\n handleOutsideClick(event: MouseEvent) {\n // Get the path of the event\n const path = event.composedPath();\n\n // Check if the path includes the host element\n const isClickInside = path.includes(this.el);\n\n if (!isClickInside && this.isOpen) {\n this.isOpen = false;\n }\n }\n\n render() {\n return (\n <div class=\"dropdown\" part=\"id_dropdown\">\n <input\n type=\"text\"\n name={this.name}\n id={this.name}\n part=\"id_dropdown-input\"\n class={{ dropbtn: true, open: this.isOpen }}\n value={this.inputValue}\n onClick={(e: Event) => {\n this.toggleDropdown();\n this.shouldAutoScroll = true;\n this.handleClick(e);\n }}\n aria-haspopup=\"listbox\"\n aria-label={this.name}\n aria-expanded={this.isOpen ? 'true' : 'false'}\n onKeyDown={e => this.handleComboboxKeyDown(e)}\n onInput={event => this.handleOnInput(event)}\n />\n {this.isOpen ? (\n <div class=\"dropdown-content\" part=\"id_dropdown-content\" ref={el => (this.optionsRef = el as HTMLElement)}>\n <ul tabindex=\"-1\" role=\"listbox\" aria-label={this.name} aria-activedescendant={this.ariaActivedescendant} onKeyDown={e => this.handleListboxKeydown(e)}>\n {this.filteredOptions.map(option => (\n <li\n tabindex=\"0\"\n key={option.value}\n id={option.value}\n onClick={() => this.selectOption(option)}\n role=\"option\"\n class={{\n focused: this.ariaActivedescendant === option.value.toString(),\n }}\n >\n {option.labelHTML ? option.labelHTML : option.label}\n </li>\n ))}\n </ul>\n </div>\n ) : null}\n </div>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"input-dropdown2.js","mappings":";;AAAA,MAAM,gBAAgB,GAAG,myFAAmyF;;MCmB/yF,aAAa;;;;;;;uBAcY,EAAE;;;+BAYJ,EAAE;8BAMa,IAAI,CAAC,kBAAkB,IAAI,IAAI;sBAIrD,KAAK;+BAKa,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC;oCAMtB,EAAE;gCAKL,KAAK;;IAY1C,qBAAqB,CAAC,QAA0B,EAAE,QAA0B;QAC1E,IAAI,QAAQ,KAAK,QAAQ,EAAE;YACzB,OAAO;SACR;QACD,IAAI,CAAC,eAAe,GAAG,QAAQ,CAAC;KACjC;IAGD,mCAAmC,CAAC,QAAwB,EAAE,QAAwB;QACpF,IAAI,QAAQ,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,EAAE;YACrC,OAAO;SACR;QACD,IAAI,CAAC,cAAc,GAAG,QAAQ,CAAC;KAChC;IAGD,wBAAwB,CAAC,QAAgB,EAAE,QAAgB;QACzD,IAAI,QAAQ,KAAK,QAAQ,EAAE;YACzB,OAAO;SACR;QACD,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC;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AAC,QAAQ,EAAE;aAC/D,IAEA,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,KAAK,CAChD,CACN,CAAC,CACC,CACD,IACJ,IAAI,CACJ,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/design-system/input-dropdown/input-dropdown.scss?tag=input-dropdown&encapsulation=shadow","src/components/design-system/input-dropdown/input-dropdown.tsx"],"sourcesContent":["@import '../../../common/styles/variables.scss';\n\n:host {\n display: block;\n position: relative;\n @media #{$mobile} {\n position: unset;\n }\n @include default-css-variables;\n}\n\n.dropdown {\n display: inline-block;\n}\n\n.dropbtn {\n color: var(--nylas-base-800);\n padding: 10px;\n font-size: 1rem;\n font-family: var(--nylas-font-family);\n cursor: pointer;\n display: flex;\n gap: 0.5rem;\n background: transparent;\n border: none;\n border-radius: var(--nylas-border-radius-2x);\n width: 50px;\n padding: 14px 16px;\n border-radius: var(--nylas-border-radius-2x);\n &.focus {\n background: transparent;\n }\n &:hover,\n &:active {\n outline: 1px solid var(--nylas-primary);\n }\n &:active {\n outline: 2px solid var(--nylas-primary);\n }\n span {\n &.chevron {\n display: flex;\n align-self: center;\n }\n &.open {\n transform: rotate(90deg);\n }\n &.closed {\n transform: rotate(270deg);\n }\n &.selected-option {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n max-width: 144px;\n font-size: 14px;\n line-height: 20px;\n @media #{$mobile} {\n max-width: 124px;\n font-size: 16px;\n }\n }\n }\n}\n\n.dropdown-content {\n display: block;\n margin-top: 0.5rem;\n background-color: var(--nylas-base-0);\n max-width: 306px;\n width: max-content;\n max-height: 336px;\n overflow: auto;\n z-index: 1;\n border-radius: 4px;\n position: absolute;\n @media #{$mobile} {\n right: 0;\n width: 325px;\n max-width: unset;\n }\n box-shadow: 0px 4px 6px -2px rgba(0, 0, 0, 0.05);\n box-shadow: 0px 10px 15px -3px rgba(0, 0, 0, 0.1);\n}\n\n.search-box {\n border-bottom: 1px solid var(--nylas-base-200);\n padding: 10px;\n position: sticky;\n top: 0;\n background: var(--nylas-base-0);\n .icon {\n position: absolute;\n top: 1.25rem;\n left: 1.25rem;\n color: var(--nylas-base-300);\n }\n}\n\n.dropdown-content ul {\n padding: 0;\n list-style-type: none;\n color: var(--nylas-base-900);\n max-height: 336px;\n li {\n padding: 16px, 12px, 16px, 12px;\n color: black;\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 &:hover,\n &:focus {\n background-color: var(--nylas-base-100);\n }\n }\n}\n\n.dropdown-content .selected {\n background-color: #e7e7e7;\n}\n\ninput[type='text'] {\n width: -webkit-fill-available;\n padding: inherit;\n border: 1px solid #ccc;\n border-radius: 4px;\n position: sticky;\n background: no-repeat scroll 7px 7px;\n padding-left: 30px;\n background-size: 16px 16px;\n}\n","import { Component, Element, Event, EventEmitter, h, Listen, Prop, State, Watch } from '@stencil/core';\n\ninterface DropdownOption {\n labelHTML?: HTMLElement;\n label: string;\n value: string;\n}\n\n/**\n * The `input-dropdown` component is a dropdown that allows users to input an option and/or select from a list of options.\n * @part id_dropdown - The dropdown container\n * @part id_dropdown-input - The dropdown button\n * @part id_dropdown-content - The dropdown content\n */\n@Component({\n tag: 'input-dropdown',\n styleUrl: 'input-dropdown.scss',\n shadow: true,\n})\nexport class InputDropdown {\n @Element() el!: HTMLElement;\n\n private inputRef?: HTMLInputElement;\n private optionsRef!: HTMLElement;\n\n // Props\n /**\n * The name of the dropdown\n */\n @Prop() name!: string;\n /**\n * The options to display in the dropdown\n */\n @Prop() options: DropdownOption[] = [];\n /**\n * The default selected option\n */\n @Prop() defaultInputOption?: DropdownOption;\n /**\n * Should show search input\n */\n @Prop() inputValue!: string;\n /**\n * Show pluralized label for the selected option. This is s tring that is appended to the selected option label as a suffix.\n */\n @Prop() pluralizedLabel: string = '';\n\n // States\n /**\n * The selected option\n */\n @State() selectedOption: DropdownOption | null = this.defaultInputOption || null;\n /**\n * The open state of the dropdown\n */\n @State() isOpen: boolean = false;\n\n /**\n * The filtered options based on the search value\n */\n @State() filteredOptions: DropdownOption[] = [...this.options];\n /**\n * The aria-activedescendant attribute for the listbox element to indicate the currently active\n * option in the list box to screen readers. The value of aria-activedescendant is the ID of\n * the active option.\n */\n @State() ariaActivedescendant: string = '';\n\n /**\n * This is used to scroll to the input value.\n */\n @State() shouldAutoScroll: boolean = false;\n\n // Events\n /**\n * This event is fired when the selected option is changed\n */\n @Event({ bubbles: true, composed: true }) inputOptionChanged!: EventEmitter<{\n value: DropdownOption['value'];\n name: string;\n }>;\n\n @Watch('options')\n optionsChangedHandler(newValue: DropdownOption[], oldValue: DropdownOption[]) {\n if (newValue === oldValue) {\n return;\n }\n this.filteredOptions = newValue;\n }\n\n @Watch('defaultInputOption')\n defaultSelectedOptionChangedHandler(newValue: DropdownOption, oldValue: DropdownOption) {\n if (newValue.label === oldValue.label) {\n return;\n }\n this.selectedOption = newValue;\n }\n\n @Watch('inputValue')\n inputValueChangedHandler(newValue: string, oldValue: string) {\n if (newValue === oldValue) {\n return;\n }\n this.inputValue = newValue;\n }\n\n // Lifecycle methods\n componentWillLoad() {\n this.filteredOptions = this.options;\n // Set the selected option to the first option if no option is selected\n if (!this.selectedOption && !!this.defaultInputOption) {\n this.selectedOption = this.defaultInputOption;\n }\n if (!this.selectedOption && this.options.length > 0) {\n this.selectedOption = this.options[0];\n }\n }\n\n // Methods\n toggleDropdown(): void {\n this.isOpen = !this.isOpen;\n }\n\n selectOption(option: DropdownOption): void {\n this.selectedOption = option;\n this.toggleDropdown();\n this.inputOptionChanged.emit({\n value: option.value,\n name: this.name,\n });\n }\n\n handleOnInput(event: Event): void {\n const value = (event.target as HTMLInputElement).value;\n const optionIndex = this.options.findIndex(option => option.label.toLowerCase().includes(value.toLowerCase()));\n if (optionIndex > -1) {\n this.scrollToViewWithinParent(optionIndex);\n }\n this.inputOptionChanged.emit({\n value,\n name: this.name,\n });\n }\n\n scrollToViewWithinParent(optionIndex: number) {\n const option = this.options[optionIndex];\n const childElement = this.el.shadowRoot?.getElementById(option.value.toString()) as HTMLLIElement;\n const parentElement = this.optionsRef;\n\n this.ariaActivedescendant = option.value.toString();\n\n // Scroll child into view within parent\n const childRect = childElement.getBoundingClientRect();\n const parentRect = parentElement.getBoundingClientRect();\n\n if (childRect.top < parentRect.top) {\n // Child is above the visible area of the parent\n parentElement.scrollTop -= parentRect.top - childRect.top;\n } else if (childRect.bottom > parentRect.bottom) {\n // Child is below the visible area of the parent\n parentElement.scrollTop += childRect.bottom - parentRect.bottom;\n }\n }\n\n handleSelectButtonKeyDown(event: KeyboardEvent): void {\n switch (event.key) {\n case 'ArrowDown':\n case 'Enter':\n event.preventDefault();\n if (!this.isOpen) {\n this.toggleDropdown();\n }\n this.inputRef?.focus();\n break;\n case 'Escape':\n this.isOpen = false;\n break;\n }\n }\n\n handleClick(event: Event): void {\n if (this.isOpen) {\n const value = (event.target as HTMLInputElement).value;\n const optionIndex = this.options.findIndex(option => option.label.toLowerCase().includes(value.toLowerCase()));\n if (optionIndex > -1) {\n setTimeout(() => {\n this.scrollToViewWithinParent(optionIndex);\n }, 10);\n }\n }\n }\n\n handleListboxKeydown(e) {\n const items = this.filteredOptions;\n const currentIndex = items.findIndex(item => item.value === this.ariaActivedescendant);\n if (e.key === 'ArrowDown' || (e.key === 'Tab' && !e.shiftKey)) {\n e.preventDefault();\n if (currentIndex === items.length - 1) {\n this.ariaActivedescendant = '';\n this.inputRef?.focus();\n return;\n }\n const nextIndex = currentIndex + 1 < items.length ? currentIndex + 1 : 0;\n this.ariaActivedescendant = items[nextIndex].value;\n this.focusOption(nextIndex);\n } else if (e.key === 'ArrowUp' || (e.key === 'Tab' && e.shiftKey)) {\n e.preventDefault();\n if (currentIndex === 0) {\n this.ariaActivedescendant = '';\n this.inputRef?.focus();\n return;\n }\n const prevIndex = currentIndex - 1 >= 0 ? currentIndex - 1 : items.length - 1;\n this.ariaActivedescendant = items[prevIndex].value;\n this.focusOption(prevIndex);\n } else if (e.key === 'Enter') {\n e.preventDefault();\n if (this.ariaActivedescendant) {\n this.selectOption(items[currentIndex]);\n }\n } else if (e.key === 'Escape') {\n this.isOpen = false;\n }\n }\n\n focusOption(index) {\n const option = this.filteredOptions[index];\n if (!option) return; // Guard clause in case index is out of bounds\n\n const elementId = option.value;\n const element = this.el.shadowRoot?.getElementById(elementId) as HTMLLIElement;\n\n if (element) {\n element.focus(); // Set focus on the element\n element.scrollIntoView({ behavior: 'smooth', block: 'nearest' });\n }\n }\n\n handleComboboxKeyDown(event: KeyboardEvent): void {\n if (event.key === 'ArrowDown' || (event.key == 'Tab' && !event.shiftKey)) {\n event.preventDefault();\n if (!this.isOpen) {\n this.isOpen = true;\n this.shouldAutoScroll = true;\n return;\n }\n this.ariaActivedescendant = this.filteredOptions[0].value;\n this.focusOption(0);\n } else if (event.key === 'ArrowUp' || (event.key === 'Tab' && event.shiftKey)) {\n event.preventDefault();\n this.ariaActivedescendant = this.filteredOptions[this.filteredOptions.length - 1].value;\n this.focusOption(this.filteredOptions.length - 1);\n } else if (event.key === 'Escape') {\n this.isOpen = false;\n }\n }\n\n // Event listeners\n @Listen('click', { target: 'document', capture: true })\n handleOutsideClick(event: MouseEvent) {\n // Get the path of the event\n const path = event.composedPath();\n\n // Check if the path includes the host element\n const isClickInside = path.includes(this.el);\n\n if (!isClickInside && this.isOpen) {\n this.isOpen = false;\n }\n }\n\n render() {\n return (\n <div class=\"dropdown\" part=\"id_dropdown\">\n <input\n type=\"text\"\n name={this.name}\n id={this.name}\n part=\"id_dropdown-input\"\n class={{ dropbtn: true, open: this.isOpen }}\n value={this.inputValue}\n onClick={(e: Event) => {\n this.toggleDropdown();\n this.shouldAutoScroll = true;\n this.handleClick(e);\n }}\n aria-haspopup=\"listbox\"\n aria-label={this.name}\n aria-expanded={this.isOpen ? 'true' : 'false'}\n onKeyDown={e => this.handleComboboxKeyDown(e)}\n onInput={event => this.handleOnInput(event)}\n />\n {this.isOpen ? (\n <div class=\"dropdown-content\" part=\"id_dropdown-content\" ref={el => (this.optionsRef = el as HTMLElement)}>\n <ul tabindex=\"-1\" role=\"listbox\" aria-label={this.name} aria-activedescendant={this.ariaActivedescendant} onKeyDown={e => this.handleListboxKeydown(e)}>\n {this.filteredOptions.map(option => (\n <li\n tabindex=\"0\"\n key={option.value}\n id={option.value}\n onClick={() => this.selectOption(option)}\n role=\"option\"\n class={{\n focused: this.ariaActivedescendant === option.value.toString(),\n }}\n >\n {option.labelHTML ? option.labelHTML : option.label}\n </li>\n ))}\n </ul>\n </div>\n ) : null}\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,130 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { R as RegisterComponent } from './register-component.js';
|
|
3
|
-
import { a as debug } from './utils.js';
|
|
4
|
-
import { d as defineCustomElement$3 } from './close.js';
|
|
5
|
-
import { d as defineCustomElement$2 } from './nylas-form-card2.js';
|
|
6
|
-
|
|
7
|
-
const nylasAdditionalParticipantsCss = ":host{display:block;margin:1rem;--nylas-primary:#2563eb;--nylas-error:#cc4841;--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-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:\"Inter\", sans-serif}.nylas-additional-participants__title{color:var(--nylas-base-nylas-base-900-aaa, #101323);font-size:16px;font-style:normal;font-weight:600;line-height:20px;margin:0;text-align:left}.nylas-additional-participants__subtitle{color:var(--nylas-base-600);font-size:14px;font-style:normal;font-weight:400;line-height:20px;margin:0.25rem 0px 0px;text-align:left}.nylas-additional-participants__content{padding:1rem;display:flex;flex-direction:column;gap:1rem}.nylas-additional-participants__input_group{padding-top:8px;display:flex;flex-direction:column;gap:4px}.nylas-additional-participants__input_group label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:14px;font-style:normal;font-weight:400;line-height:150%}.nylas-additional-participants__input_wrapper{display:flex;border-width:1;border-radius:8px;border:1px solid var(--nylas-base-300)}.nylas-additional-participants__input_wrapper button{padding:12px;border:none;background:none;cursor:pointer}.nylas-additional-participants__input_wrapper button:hover,.nylas-additional-participants__input_wrapper button:active{color:var(--nylas-primary)}.nylas-additional-participants__input_wrapper_organizer{background:var(--nylas-base-50)}.nylas-additional-participants__input{flex:1;padding:12px 16px;border-right:1px solid var(--nylas-base-300)}.nylas-additional-participants__input input{border:none;outline:none;background:none;width:100%}.nylas-additional-participants__add{padding:12px;display:flex;align-items:center;border:none;background:none;cursor:pointer}.nylas-additional-participants__add span{padding:0 8px;font-size:16px;font-style:normal;font-weight:500}.nylas-additional-participants__add:hover,.nylas-additional-participants__add:active{color:var(--nylas-primary)}";
|
|
8
|
-
|
|
9
|
-
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
10
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
11
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
12
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
13
|
-
else
|
|
14
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
15
|
-
if (d = decorators[i])
|
|
16
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
17
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
18
|
-
};
|
|
19
|
-
var __metadata = (undefined && undefined.__metadata) || function (k, v) {
|
|
20
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
21
|
-
return Reflect.metadata(k, v);
|
|
22
|
-
};
|
|
23
|
-
const NylasAdditionalParticipants$1 = proxyCustomElement(class NylasAdditionalParticipants extends HTMLElement {
|
|
24
|
-
constructor() {
|
|
25
|
-
super();
|
|
26
|
-
this.__registerHost();
|
|
27
|
-
this.__attachShadow();
|
|
28
|
-
this.internals = this.attachInternals();
|
|
29
|
-
this.name = 'participants';
|
|
30
|
-
this.eventParticipants = undefined;
|
|
31
|
-
this.participants = this.eventParticipants ?? [];
|
|
32
|
-
this.participantsValid = true;
|
|
33
|
-
}
|
|
34
|
-
elementNameChangedHandler(newValue) {
|
|
35
|
-
debug('nylas-additional-participants', 'elementNameChangedHandler', newValue);
|
|
36
|
-
this.host.setAttribute('name', newValue);
|
|
37
|
-
}
|
|
38
|
-
connectedCallback() {
|
|
39
|
-
debug('nylas-additional-participants', 'connectedCallback');
|
|
40
|
-
}
|
|
41
|
-
componentWillLoad() {
|
|
42
|
-
debug('nylas-additional-participants', 'componentWillLoad');
|
|
43
|
-
this.host.setAttribute('name', this.name);
|
|
44
|
-
}
|
|
45
|
-
componentDidLoad() {
|
|
46
|
-
debug('nylas-additional-participants', 'componentDidLoad');
|
|
47
|
-
this.internals.setFormValue(JSON.stringify(this.participants), 'participants');
|
|
48
|
-
}
|
|
49
|
-
disconnectedCallback() {
|
|
50
|
-
debug('nylas-additional-participants', 'disconnectedCallback');
|
|
51
|
-
}
|
|
52
|
-
onParticipantChange(event, index) {
|
|
53
|
-
debug('nylas-additional-participants', 'onParticipantChange');
|
|
54
|
-
this.participants[index].email = event.target.value;
|
|
55
|
-
this.internals.setFormValue(JSON.stringify(this.participants), 'participants');
|
|
56
|
-
}
|
|
57
|
-
addParticipant() {
|
|
58
|
-
debug('nylas-additional-participants', 'addParticipant');
|
|
59
|
-
this.participants = [...this.participants, { email: '', is_organizer: false, availability: { calendar_ids: ['primary'] } }];
|
|
60
|
-
this.internals.setFormValue(JSON.stringify(this.participants), 'participants');
|
|
61
|
-
}
|
|
62
|
-
removeParticipant(email) {
|
|
63
|
-
debug('nylas-additional-participants', 'addParticipant');
|
|
64
|
-
this.participants = this.participants.filter(p => p.email !== email);
|
|
65
|
-
this.internals.setFormValue(JSON.stringify(this.participants), 'participants');
|
|
66
|
-
}
|
|
67
|
-
validate(email, index) {
|
|
68
|
-
debug('nylas-additional-participants', 'validate');
|
|
69
|
-
const regex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
70
|
-
const valid = regex.test(String(email).toLowerCase());
|
|
71
|
-
this.participants[index].is_valid = valid;
|
|
72
|
-
this.internals.setFormValue(JSON.stringify(this.participants), 'participants');
|
|
73
|
-
}
|
|
74
|
-
render() {
|
|
75
|
-
return (h(Host, { key: '91518d593ecd43e88105d3137746e9d95653e0e7' }, h("nylas-form-card", { key: 'd05f897f3d5109ce3b31d2aad8ca09af05793b58' }, h("h3", { key: 'fcc5ae151fb84bf60abf58e44eb8e043cd4cefac', slot: "header-title", class: "nylas-additional-participants__title", part: "nap__title" }, "Additional participants"), h("p", { key: '7e8e8354258dc9884cef56c1e4bdbe0d1fc724c5', slot: "header-subtitle", class: "nylas-additional-participants__subtitle", part: "nap__subtitle" }, "Add anyone else who would be joining for this event."), h("div", { key: '3376539a53c39a2e43fd4a817a83511eb852cd87', slot: "content", class: "nylas-additional-participants__content" }, h("div", { key: 'b782dad233ad8ca25030d9ea45092eea93c2f0dd' }, this.participants.map((participant, index) => {
|
|
76
|
-
return (h("div", { class: 'nylas-additional-participants__input_group', part: "nap__input_group" }, h("label", null, participant.is_organizer ? 'Organizer' : `Participant ${index}`), h("div", { part: "nap__input_wrapper", class: `nylas-additional-participants__input_wrapper ${participant.is_organizer && 'nylas-additional-participants__input_wrapper_organizer'} ${participant.is_valid === false && 'nylas-additional-participants__input_wrapper_invalid'}` }, h("div", { class: "nylas-additional-participants__input", part: "nap__input" }, h("input", { type: "text", value: participant.email, onInput: e => {
|
|
77
|
-
this.onParticipantChange(e, index);
|
|
78
|
-
}, readOnly: participant.is_organizer, onBlur: () => this.validate(participant.email, index) })), !participant.is_organizer && (h("button", { onClick: () => this.removeParticipant(participant.email), part: "nap__remove-participant" }, h("close-icon", null))))));
|
|
79
|
-
}))))));
|
|
80
|
-
}
|
|
81
|
-
static get formAssociated() { return true; }
|
|
82
|
-
get host() { return this; }
|
|
83
|
-
static get watchers() { return {
|
|
84
|
-
"name": ["elementNameChangedHandler"]
|
|
85
|
-
}; }
|
|
86
|
-
static get style() { return nylasAdditionalParticipantsCss; }
|
|
87
|
-
}, [65, "nylas-additional-participants", {
|
|
88
|
-
"name": [1],
|
|
89
|
-
"eventParticipants": [16],
|
|
90
|
-
"participants": [32],
|
|
91
|
-
"participantsValid": [32]
|
|
92
|
-
}, undefined, {
|
|
93
|
-
"name": ["elementNameChangedHandler"]
|
|
94
|
-
}]);
|
|
95
|
-
__decorate([
|
|
96
|
-
RegisterComponent({
|
|
97
|
-
name: 'nylas-additional-participants',
|
|
98
|
-
eventToProps: {},
|
|
99
|
-
fireRegisterEvent: true,
|
|
100
|
-
}),
|
|
101
|
-
__metadata("design:type", Function),
|
|
102
|
-
__metadata("design:paramtypes", []),
|
|
103
|
-
__metadata("design:returntype", void 0)
|
|
104
|
-
], NylasAdditionalParticipants$1.prototype, "render", null);
|
|
105
|
-
function defineCustomElement$1() {
|
|
106
|
-
if (typeof customElements === "undefined") {
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
const components = ["nylas-additional-participants", "close-icon", "nylas-form-card"];
|
|
110
|
-
components.forEach(tagName => { switch (tagName) {
|
|
111
|
-
case "nylas-additional-participants":
|
|
112
|
-
if (!customElements.get(tagName)) {
|
|
113
|
-
customElements.define(tagName, NylasAdditionalParticipants$1);
|
|
114
|
-
}
|
|
115
|
-
break;
|
|
116
|
-
case "close-icon":
|
|
117
|
-
if (!customElements.get(tagName)) {
|
|
118
|
-
defineCustomElement$3();
|
|
119
|
-
}
|
|
120
|
-
break;
|
|
121
|
-
case "nylas-form-card":
|
|
122
|
-
if (!customElements.get(tagName)) {
|
|
123
|
-
defineCustomElement$2();
|
|
124
|
-
}
|
|
125
|
-
break;
|
|
126
|
-
} });
|
|
127
|
-
}
|
|
1
|
+
import { N as NylasAdditionalParticipants$1, d as defineCustomElement$1 } from './nylas-additional-participants2.js';
|
|
128
2
|
|
|
129
3
|
const NylasAdditionalParticipants = NylasAdditionalParticipants$1;
|
|
130
4
|
const defineCustomElement = defineCustomElement$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"nylas-additional-participants.js","mappings":";;;;;;AAAA,MAAM,8BAA8B,GAAG,k1EAAk1E;;;;;;;;;;;;;;;;MCwC52EA,6BAA2B;;;;;;oBAEf,cAAc;;4BAeE,IAAI,CAAC,iBAAiB,IAAI,EAAE;iCAC7B,IAAI;;IAN1C,yBAAyB,CAAC,QAAgB;QACxC,KAAK,CAAC,+BAA+B,EAAE,2BAA2B,EAAE,QAAQ,CAAC,CAAC;QAC9E,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;KAC1C;IAID,iBAAiB;QACf,KAAK,CAAC,+BAA+B,EAAE,mBAAmB,CAAC,CAAC;KAC7D;IAED,iBAAiB;QACf,KAAK,CAAC,+BAA+B,EAAE,mBAAmB,CAAC,CAAC;QAC5D,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;KAC3C;IAED,gBAAgB;QACd,KAAK,CAAC,+BAA+B,EAAE,kBAAkB,CAAC,CAAC;QAC3D,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAA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AClC,MAAM,EAAE,MAAM,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,GACrD,CACE,EACL,CAAC,WAAW,CAAC,YAAY,KACxB,cAAQ,OAAO,EAAE,MAAM,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,IAAI,EAAC,yBAAyB,IAC9F,qBAAc,CACP,CACV,CACG,CACF,EACN;SACH,CAAC,CACE,CAIF,CACU,CACb,EACP;KACH;;;;;;;;;;;;;;;AAhDD;IALC,iBAAiB,CAAiH;QACjI,IAAI,EAAE,+BAA+B;QACrC,YAAY,EAAE,EAAE;QAChB,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;2DAiDD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["NylasAdditionalParticipants"],"sources":["src/components/scheduler-editor/nylas-additional-participants/nylas-additional-participants.scss?tag=nylas-additional-participants&encapsulation=shadow","src/components/scheduler-editor/nylas-additional-participants/nylas-additional-participants.tsx"],"sourcesContent":["@import '../../../common/styles/variables.scss';\n\n:host {\n display: block;\n margin: 1rem;\n @include default-css-variables;\n}\n\n.nylas-additional-participants__title {\n color: var(--nylas-base-nylas-base-900-aaa, #101323);\n font-size: 16px;\n font-style: normal;\n font-weight: 600;\n line-height: 20px; /* 125% */\n margin: 0;\n text-align: left;\n}\n.nylas-additional-participants__subtitle {\n color: var(--nylas-base-600);\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 20px; /* 142.857% */\n margin: 0.25rem 0px 0px;\n text-align: left;\n}\n.nylas-additional-participants__content {\n padding: 1rem;\n display: flex;\n flex-direction: column;\n gap: 1rem;\n}\n\n.nylas-additional-participants__input_group {\n padding-top: 8px;\n display: flex;\n flex-direction: column;\n gap: 4px;\n label {\n display: flex;\n align-items: center;\n color: var(--nylas-base-800);\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 150%;\n }\n}\n.nylas-additional-participants__input_wrapper {\n display: flex;\n border-width: 1;\n border-radius: 8px;\n border: 1px solid var(--nylas-base-300);\n button {\n padding: 12px;\n border: none;\n background: none;\n cursor: pointer;\n &:hover,\n &:active {\n color: var(--nylas-primary);\n }\n }\n}\n.nylas-additional-participants__input_wrapper_organizer {\n background: var(--nylas-base-50);\n}\n\n.nylas-additional-participants__input {\n flex: 1;\n padding: 12px 16px;\n border-right: 1px solid var(--nylas-base-300);\n input {\n border: none;\n outline: none;\n background: none;\n width: 100%;\n }\n}\n\n.nylas-additional-participants__add {\n padding: 12px;\n display: flex;\n align-items: center;\n border: none;\n background: none;\n cursor: pointer;\n span {\n padding: 0 8px;\n font-size: 16px;\n font-style: normal;\n font-weight: 500;\n }\n &:hover,\n &:active {\n color: var(--nylas-primary);\n }\n}\n","import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug } from '@/utils/utils';\nimport { AttachInternals, Component, Host, Prop, State, Watch, h, Element } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\n\ntype Participant = {\n name?: string;\n email: string;\n is_valid?: boolean;\n is_organizer: boolean;\n availability?: Availability;\n booking?: Booking;\n};\ntype Availability = {\n calendar_ids: string[];\n};\ntype Booking = {\n calendar_id: string;\n};\n\n/**\n * The `nylas-additional-participants` component is a form input for adding additional participants to an event.\n *\n * @part nap__title - The title of the component.\n * @part nap__subtitle - The subtitle of the component.\n * @part nap__content - The content of the component.\n * @part nap__input_group - The input group of the component.\n * @part nap__input_wrapper - The input wrapper of the component.\n * @part nap__input - The input of the component.\n * @part nap__remove-participant - The remove participant button of the component.\n * @part nap__add-participant - The add participant button of the component.\n *\n */\n@Component({\n tag: 'nylas-additional-participants',\n styleUrl: 'nylas-additional-participants.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasAdditionalParticipants {\n @Element() host!: HTMLNylasAdditionalParticipantsElement;\n @Prop() name: string = 'participants';\n @Prop() eventParticipants?: Participant[];\n @AttachInternals() internals!: ElementInternals;\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-additional-participants', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @State() participants: Participant[] = this.eventParticipants ?? [];\n @State() participantsValid: boolean = true;\n connectedCallback() {\n debug('nylas-additional-participants', 'connectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-additional-participants', 'componentWillLoad');\n this.host.setAttribute('name', this.name);\n }\n\n componentDidLoad() {\n debug('nylas-additional-participants', 'componentDidLoad');\n this.internals.setFormValue(JSON.stringify(this.participants), 'participants');\n }\n\n disconnectedCallback() {\n debug('nylas-additional-participants', 'disconnectedCallback');\n }\n onParticipantChange(event, index) {\n debug('nylas-additional-participants', 'onParticipantChange');\n this.participants[index].email = event.target.value;\n this.internals.setFormValue(JSON.stringify(this.participants), 'participants');\n }\n addParticipant() {\n debug('nylas-additional-participants', 'addParticipant');\n this.participants = [...this.participants, { email: '', is_organizer: false, availability: { calendar_ids: ['primary'] } }];\n this.internals.setFormValue(JSON.stringify(this.participants), 'participants');\n }\n removeParticipant(email: string) {\n debug('nylas-additional-participants', 'addParticipant');\n this.participants = this.participants.filter(p => p.email !== email);\n this.internals.setFormValue(JSON.stringify(this.participants), 'participants');\n }\n validate(email, index) {\n debug('nylas-additional-participants', 'validate');\n const regex = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n const valid = regex.test(String(email).toLowerCase());\n this.participants[index].is_valid = valid;\n this.internals.setFormValue(JSON.stringify(this.participants), 'participants');\n }\n\n @RegisterComponent<NylasAdditionalParticipants, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-additional-participants',\n eventToProps: {},\n fireRegisterEvent: true,\n })\n render() {\n return (\n <Host>\n <nylas-form-card>\n <h3 slot=\"header-title\" class=\"nylas-additional-participants__title\" part=\"nap__title\">\n Additional participants\n </h3>\n <p slot=\"header-subtitle\" class=\"nylas-additional-participants__subtitle\" part=\"nap__subtitle\">\n Add anyone else who would be joining for this event.\n </p>\n <div slot=\"content\" class=\"nylas-additional-participants__content\">\n <div>\n {this.participants.map((participant, index) => {\n return (\n <div class={'nylas-additional-participants__input_group'} part=\"nap__input_group\">\n <label>{participant.is_organizer ? 'Organizer' : `Participant ${index}`}</label>\n <div\n part=\"nap__input_wrapper\"\n class={`nylas-additional-participants__input_wrapper ${participant.is_organizer && 'nylas-additional-participants__input_wrapper_organizer'} ${participant.is_valid === false && 'nylas-additional-participants__input_wrapper_invalid'}`}\n >\n <div class=\"nylas-additional-participants__input\" part=\"nap__input\">\n <input\n type=\"text\"\n value={participant.email}\n onInput={e => {\n this.onParticipantChange(e, index);\n }}\n readOnly={participant.is_organizer}\n onBlur={() => this.validate(participant.email, index)}\n />\n </div>\n {!participant.is_organizer && (\n <button onClick={() => this.removeParticipant(participant.email)} part=\"nap__remove-participant\">\n <close-icon />\n </button>\n )}\n </div>\n </div>\n );\n })}\n </div>\n {/* <button class=\"nylas-additional-participants__add\" part=\"nap__add-participant\" onClick={() => this.addParticipant()}>\n <add-circle-icon /> <span>Add a participant</span>\n </button> */}\n </div>\n </nylas-form-card>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"nylas-additional-participants.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|