@nylas/web-elements 0.0.0-canary-20251023164535 → 0.0.0-canary-20251029185136
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/nylas-scheduler-editor/nylas-scheduler-editor.es.js +17 -16
- package/dist/cdn/nylas-scheduling/nylas-scheduling.es.js +10 -10
- package/dist/cjs/{abstract-provider-DOaCK0Ia.js → abstract-provider-CZo7QWPj.js} +3 -3
- package/dist/cjs/{abstract-provider-DOaCK0Ia.js.map → abstract-provider-CZo7QWPj.js.map} +1 -1
- package/dist/cjs/calendar-agenda-fill-icon_38.cjs.entry.js +9 -9
- package/dist/cjs/calendar-agenda-fill-icon_38.cjs.entry.js.map +1 -1
- package/dist/cjs/checkbox-group_4.cjs.entry.js +3 -3
- package/dist/cjs/checkmark-icon_15.cjs.entry.js +2 -2
- package/dist/cjs/{customParseFormat-B3qRJI76.js → customParseFormat-DdrySvrq.js} +3 -3
- package/dist/cjs/{customParseFormat-B3qRJI76.js.map → customParseFormat-DdrySvrq.js.map} +1 -1
- package/dist/cjs/globe-icon_3.cjs.entry.js +2 -2
- package/dist/cjs/google-logo-icon_6.cjs.entry.js +3 -3
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/input-component.cjs.entry.js +1 -1
- package/dist/cjs/input-dropdown_2.cjs.entry.js +1 -1
- package/dist/cjs/multi-select-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/{nylas-api-request-Dyvsd6KX.js → nylas-api-request-Cyt148Hk.js} +3 -3
- package/dist/cjs/{nylas-api-request-Dyvsd6KX.js.map → nylas-api-request-Cyt148Hk.js.map} +1 -1
- package/dist/cjs/nylas-booked-event-card_11.cjs.entry.js +2 -2
- package/dist/cjs/nylas-form-card.cjs.entry.js +2 -2
- package/dist/cjs/nylas-notification_2.cjs.entry.js +1 -1
- package/dist/cjs/nylas-scheduler-editor.cjs.entry.js +4 -4
- package/dist/cjs/nylas-scheduling.cjs.entry.js +3 -3
- package/dist/cjs/{register-component-CZKreEUk.js → register-component-BYFF0_7-.js} +3 -3
- package/dist/cjs/{register-component-CZKreEUk.js.map → register-component-BYFF0_7-.js.map} +1 -1
- package/dist/cjs/textarea-component.cjs.entry.js +1 -1
- package/dist/cjs/{utils-VYrzhIuQ.js → utils-DMP9yXCk.js} +11 -11
- package/dist/cjs/{utils-VYrzhIuQ.js.map → utils-DMP9yXCk.js.map} +1 -1
- package/dist/cjs/{version-sMNkED66.js → version-DTKfJ9pI.js} +3 -3
- package/dist/cjs/{version-sMNkED66.js.map → version-DTKfJ9pI.js.map} +1 -1
- package/dist/collection/components/scheduler-editor/nylas-specific-time-availability-picker/nylas-specific-time-availability-picker.css +9 -2
- package/dist/collection/components/scheduler-editor/nylas-specific-time-availability-picker/nylas-specific-time-availability-picker.js +6 -6
- package/dist/collection/components/scheduler-editor/nylas-specific-time-availability-picker/nylas-specific-time-availability-picker.js.map +1 -1
- package/dist/collection/version.js +1 -1
- package/dist/collection/version.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/input-component.js +1 -1
- package/dist/components/input-image-url.js +1 -1
- package/dist/components/multi-select-dropdown.js +1 -1
- package/dist/components/nylas-additional-participants.js +1 -1
- package/dist/components/nylas-availability-picker.js +1 -1
- package/dist/components/nylas-booked-event-card.js +1 -1
- package/dist/components/nylas-booking-calendar-picker.js +1 -1
- package/dist/components/nylas-booking-confirmation-redirect.js +1 -1
- package/dist/components/nylas-booking-confirmation-type.js +1 -1
- package/dist/components/nylas-booking-form-config.js +1 -1
- package/dist/components/nylas-booking-form.js +1 -1
- package/dist/components/nylas-buffer-time.js +1 -1
- package/dist/components/nylas-calendar-picker.js +1 -1
- package/dist/components/nylas-cancel-booking-form.js +1 -1
- package/dist/components/nylas-cancellation-policy.js +1 -1
- package/dist/components/nylas-cancelled-event-card.js +1 -1
- package/dist/components/nylas-confirmation-email.js +1 -1
- package/dist/components/nylas-confirmed-event-card.js +1 -1
- package/dist/components/nylas-connected-calendars.js +1 -1
- package/dist/components/nylas-custom-booking-flow.js +1 -1
- package/dist/components/nylas-custom-event-slug.js +1 -1
- package/dist/components/nylas-customize-booking-settings.js +1 -1
- package/dist/components/nylas-date-component.js +1 -1
- package/dist/components/nylas-date-picker.js +1 -1
- package/dist/components/nylas-disable-emails.js +1 -1
- package/dist/components/nylas-editor-tabs-group.js +1 -1
- package/dist/components/nylas-editor-tabs.js +1 -1
- package/dist/components/nylas-event-calendar.js +1 -1
- package/dist/components/nylas-event-capacity.js +1 -1
- package/dist/components/nylas-event-description.js +1 -1
- package/dist/components/nylas-event-duration.js +1 -1
- package/dist/components/nylas-event-info.js +1 -1
- package/dist/components/nylas-event-limits.js +1 -1
- package/dist/components/nylas-event-location.js +1 -1
- package/dist/components/nylas-event-timeslot.js +1 -1
- package/dist/components/nylas-event-title.js +1 -1
- package/dist/components/nylas-feedback-form.js +1 -1
- package/dist/components/nylas-form-card.js +1 -1
- package/dist/components/nylas-limit-future-bookings.js +1 -1
- package/dist/components/nylas-list-configurations.js +1 -1
- package/dist/components/nylas-locale-switch.js +1 -1
- package/dist/components/nylas-min-booking-notice.js +1 -1
- package/dist/components/nylas-min-cancellation-notice.js +1 -1
- package/dist/components/nylas-notification.js +1 -1
- package/dist/components/nylas-only-specific-time-availability.js +1 -1
- package/dist/components/nylas-organizer-confirmation-card.js +1 -1
- package/dist/components/nylas-page-name.js +1 -1
- package/dist/components/nylas-page-styling.js +1 -1
- package/dist/components/nylas-participant-booking-calendars.js +1 -1
- package/dist/components/nylas-participants-custom-availability.js +1 -1
- package/dist/components/nylas-reminder-emails.js +1 -1
- package/dist/components/nylas-reminder-time.js +1 -1
- package/dist/components/nylas-scheduler-editor.js +55 -55
- package/dist/components/nylas-scheduling-method.js +1 -1
- package/dist/components/nylas-scheduling.js +19 -19
- package/dist/components/nylas-select-event-type.js +1 -1
- package/dist/components/nylas-selected-event-card.js +1 -1
- package/dist/components/nylas-specific-time-availability-picker.js +1 -1
- package/dist/components/nylas-time-window-picker.js +1 -1
- package/dist/components/nylas-timeslot-interval.js +1 -1
- package/dist/components/nylas-timeslot-picker.js +1 -1
- package/dist/components/{p-H2PEDQev.js → p--DnD2uAW.js} +7 -7
- package/dist/components/{p-H2PEDQev.js.map → p--DnD2uAW.js.map} +1 -1
- package/dist/components/{p-BOEUsxij.js → p-B4K2F_cG.js} +4 -4
- package/dist/components/{p-BOEUsxij.js.map → p-B4K2F_cG.js.map} +1 -1
- package/dist/components/{p-CS8D-1if.js → p-B5pNjL0N.js} +4 -4
- package/dist/components/{p-CS8D-1if.js.map → p-B5pNjL0N.js.map} +1 -1
- package/dist/components/{p-Nzu_5ZmQ.js → p-BC9yeuRb.js} +3 -3
- package/dist/components/{p-Nzu_5ZmQ.js.map → p-BC9yeuRb.js.map} +1 -1
- package/dist/components/{p-BX-dFDFA.js → p-BMpBdxEp.js} +4 -4
- package/dist/components/{p-BX-dFDFA.js.map → p-BMpBdxEp.js.map} +1 -1
- package/dist/components/{p-DyOLurnZ.js → p-BYzuAGXU.js} +49 -49
- package/dist/components/{p-DyOLurnZ.js.map → p-BYzuAGXU.js.map} +1 -1
- package/dist/components/{p-D6E0vp2X.js → p-BfdTgv37.js} +4 -4
- package/dist/components/{p-D6E0vp2X.js.map → p-BfdTgv37.js.map} +1 -1
- package/dist/components/{p-C-9RzJZG.js → p-BkzMJ4pV.js} +11 -11
- package/dist/components/{p-C-9RzJZG.js.map → p-BkzMJ4pV.js.map} +1 -1
- package/dist/components/{p-BnKgaDIm.js → p-BnU07kVV.js} +5 -5
- package/dist/components/{p-BnKgaDIm.js.map → p-BnU07kVV.js.map} +1 -1
- package/dist/components/{p-CJXT074p.js → p-BnrCrrsE.js} +4 -4
- package/dist/components/{p-CJXT074p.js.map → p-BnrCrrsE.js.map} +1 -1
- package/dist/components/{p-B4LAfvS9.js → p-BoryVwdE.js} +3 -3
- package/dist/components/{p-B4LAfvS9.js.map → p-BoryVwdE.js.map} +1 -1
- package/dist/components/{p-B-q5dr4Z.js → p-BqTfI9iO.js} +5 -5
- package/dist/components/{p-B-q5dr4Z.js.map → p-BqTfI9iO.js.map} +1 -1
- package/dist/components/{p-PGZfpcsW.js → p-Bspl8yuu.js} +8 -8
- package/dist/components/{p-PGZfpcsW.js.map → p-Bspl8yuu.js.map} +1 -1
- package/dist/components/{p-nwpBi6uh.js → p-BvRLg-HQ.js} +3 -3
- package/dist/components/{p-nwpBi6uh.js.map → p-BvRLg-HQ.js.map} +1 -1
- package/dist/components/{p-Ck7Utpku.js → p-C5fHZLWQ.js} +5 -5
- package/dist/components/{p-Ck7Utpku.js.map → p-C5fHZLWQ.js.map} +1 -1
- package/dist/components/{p-rernVjNw.js → p-C7CSS14_.js} +6 -6
- package/dist/components/{p-rernVjNw.js.map → p-C7CSS14_.js.map} +1 -1
- package/dist/components/{p-USlPWd32.js → p-C8gVhB99.js} +5 -5
- package/dist/components/{p-USlPWd32.js.map → p-C8gVhB99.js.map} +1 -1
- package/dist/components/{p-DiCCKLqS.js → p-C9m4ME75.js} +40 -40
- package/dist/components/{p-DiCCKLqS.js.map → p-C9m4ME75.js.map} +1 -1
- package/dist/components/{p-BJIdbu1H.js → p-CHGzZc5-.js} +5 -5
- package/dist/components/{p-BJIdbu1H.js.map → p-CHGzZc5-.js.map} +1 -1
- package/dist/components/{p-C3quV8UM.js → p-CI0FKgAJ.js} +7 -7
- package/dist/components/{p-C3quV8UM.js.map → p-CI0FKgAJ.js.map} +1 -1
- package/dist/components/{p-OWT0xV_k.js → p-CNojy2PB.js} +4 -4
- package/dist/components/{p-OWT0xV_k.js.map → p-CNojy2PB.js.map} +1 -1
- package/dist/components/{p-CpcjVJMS.js → p-COOMTxtt.js} +4 -4
- package/dist/components/{p-CpcjVJMS.js.map → p-COOMTxtt.js.map} +1 -1
- package/dist/components/{p-CIZt1hbc.js → p-CS7dGt1R.js} +4 -4
- package/dist/components/{p-CIZt1hbc.js.map → p-CS7dGt1R.js.map} +1 -1
- package/dist/components/{p-CxgQ4DV9.js → p-CZw_P3Tp.js} +4 -4
- package/dist/components/{p-CxgQ4DV9.js.map → p-CZw_P3Tp.js.map} +1 -1
- package/dist/components/{p-CxjS5vcT.js → p-C_QAMVyX.js} +4 -4
- package/dist/components/{p-CxjS5vcT.js.map → p-C_QAMVyX.js.map} +1 -1
- package/dist/components/{p-zBmfn9Ee.js → p-CexYKlpc.js} +3 -3
- package/dist/components/{p-zBmfn9Ee.js.map → p-CexYKlpc.js.map} +1 -1
- package/dist/components/{p-wJWFqJZw.js → p-CsKdKz2W.js} +4 -4
- package/dist/components/{p-wJWFqJZw.js.map → p-CsKdKz2W.js.map} +1 -1
- package/dist/components/{p-CZLOU3Va.js → p-CwlnHdR3.js} +4 -4
- package/dist/components/{p-CZLOU3Va.js.map → p-CwlnHdR3.js.map} +1 -1
- package/dist/components/{p-BzNgohl1.js → p-Cx31rTZq.js} +4 -4
- package/dist/components/{p-BzNgohl1.js.map → p-Cx31rTZq.js.map} +1 -1
- package/dist/components/{p-BPbLHmnh.js → p-CzBqaxFU.js} +5 -5
- package/dist/components/{p-BPbLHmnh.js.map → p-CzBqaxFU.js.map} +1 -1
- package/dist/components/{p-C7_XycjO.js → p-D1EoqZsu.js} +4 -4
- package/dist/components/{p-C7_XycjO.js.map → p-D1EoqZsu.js.map} +1 -1
- package/dist/components/{p-C_9WoSFK.js → p-D3xYUjJI.js} +4 -4
- package/dist/components/{p-C_9WoSFK.js.map → p-D3xYUjJI.js.map} +1 -1
- package/dist/components/{p-BnsOCm71.js → p-D5KNDDuK.js} +4 -4
- package/dist/components/{p-BnsOCm71.js.map → p-D5KNDDuK.js.map} +1 -1
- package/dist/components/{p-CQQB-OD7.js → p-D6ovLzQI.js} +3 -3
- package/dist/components/{p-CQQB-OD7.js.map → p-D6ovLzQI.js.map} +1 -1
- package/dist/components/{p-BgVZNMXq.js → p-D6x7KnWY.js} +8 -8
- package/dist/components/{p-BgVZNMXq.js.map → p-D6x7KnWY.js.map} +1 -1
- package/dist/components/{p-C2wPhW78.js → p-D7s_zg_d.js} +4 -4
- package/dist/components/{p-C2wPhW78.js.map → p-D7s_zg_d.js.map} +1 -1
- package/dist/components/{p-4Eo0pKVg.js → p-D92kTAyK.js} +5 -5
- package/dist/components/{p-4Eo0pKVg.js.map → p-D92kTAyK.js.map} +1 -1
- package/dist/components/{p-C-bIz_hy.js → p-D9Dg1JWU.js} +3 -3
- package/dist/components/{p-C-bIz_hy.js.map → p-D9Dg1JWU.js.map} +1 -1
- package/dist/components/{p-DP1P7gC9.js → p-D9PED7bs.js} +5 -5
- package/dist/components/{p-DP1P7gC9.js.map → p-D9PED7bs.js.map} +1 -1
- package/dist/components/{p-Dy9AIDSW.js → p-DAmas3F9.js} +4 -4
- package/dist/components/{p-Dy9AIDSW.js.map → p-DAmas3F9.js.map} +1 -1
- package/dist/components/{p-DEF0WG29.js → p-DHlJz5qn.js} +5 -5
- package/dist/components/{p-DEF0WG29.js.map → p-DHlJz5qn.js.map} +1 -1
- package/dist/components/{p-o0D7OIed.js → p-DJv7tC9z.js} +3 -3
- package/dist/components/{p-o0D7OIed.js.map → p-DJv7tC9z.js.map} +1 -1
- package/dist/components/{p-s06UjtHJ.js → p-DKnp-SZi.js} +8 -8
- package/dist/components/{p-s06UjtHJ.js.map → p-DKnp-SZi.js.map} +1 -1
- package/dist/components/{p-DPHPGDki.js → p-DPeb4p0M.js} +5 -5
- package/dist/components/{p-DPHPGDki.js.map → p-DPeb4p0M.js.map} +1 -1
- package/dist/components/{p-C7Gn7-GK.js → p-DRd9V7vZ.js} +7 -7
- package/dist/components/{p-C7Gn7-GK.js.map → p-DRd9V7vZ.js.map} +1 -1
- package/dist/components/{p-D5WcQ7s2.js → p-DTlpOiw-.js} +6 -6
- package/dist/components/{p-D5WcQ7s2.js.map → p-DTlpOiw-.js.map} +1 -1
- package/dist/components/{p-auB3ZoWP.js → p-DWkUeMm6.js} +4 -4
- package/dist/components/{p-auB3ZoWP.js.map → p-DWkUeMm6.js.map} +1 -1
- package/dist/components/{p-DFnXfDS7.js → p-DbjQjOKi.js} +3 -3
- package/dist/components/{p-DFnXfDS7.js.map → p-DbjQjOKi.js.map} +1 -1
- package/dist/components/{p-BQaskvNx.js → p-DciJgP0N.js} +4 -4
- package/dist/components/{p-BQaskvNx.js.map → p-DciJgP0N.js.map} +1 -1
- package/dist/components/{p-CAlTvMv3.js → p-DkJ3N73P.js} +5 -5
- package/dist/components/{p-CAlTvMv3.js.map → p-DkJ3N73P.js.map} +1 -1
- package/dist/components/{p-D3EFT5f-.js → p-DmYbjMxT.js} +4 -4
- package/dist/components/{p-D3EFT5f-.js.map → p-DmYbjMxT.js.map} +1 -1
- package/dist/components/{p-Ckv0Bcus.js → p-Dp5o78QS.js} +5 -5
- package/dist/components/{p-Ckv0Bcus.js.map → p-Dp5o78QS.js.map} +1 -1
- package/dist/components/{p-BgfJE-cE.js → p-DqcCEDhq.js} +5 -5
- package/dist/components/{p-BgfJE-cE.js.map → p-DqcCEDhq.js.map} +1 -1
- package/dist/components/{p-ksfJsdwW.js → p-Dqk37NDi.js} +5 -5
- package/dist/components/{p-ksfJsdwW.js.map → p-Dqk37NDi.js.map} +1 -1
- package/dist/components/{p-ML5NaBlp.js → p-Du2grbuj.js} +5 -5
- package/dist/components/{p-ML5NaBlp.js.map → p-Du2grbuj.js.map} +1 -1
- package/dist/components/{p-Dows6o9d.js → p-DvSo9R8l.js} +5 -5
- package/dist/components/{p-Dows6o9d.js.map → p-DvSo9R8l.js.map} +1 -1
- package/dist/components/{p-DzIz09Sr.js → p-DwtTOYHU.js} +13 -13
- package/dist/components/p-DwtTOYHU.js.map +1 -0
- package/dist/components/{p-He5IjVyD.js → p-DzErtQSw.js} +5 -5
- package/dist/components/{p-He5IjVyD.js.map → p-DzErtQSw.js.map} +1 -1
- package/dist/components/{p-D4OZzddo.js → p-F1_K10Bc.js} +5 -5
- package/dist/components/{p-D4OZzddo.js.map → p-F1_K10Bc.js.map} +1 -1
- package/dist/components/{p-DLdTazaE.js → p-MYEzIAsT.js} +4 -4
- package/dist/components/{p-DLdTazaE.js.map → p-MYEzIAsT.js.map} +1 -1
- package/dist/components/{p-bbx04OZB.js → p-UTtjPYki.js} +3 -3
- package/dist/components/{p-bbx04OZB.js.map → p-UTtjPYki.js.map} +1 -1
- package/dist/components/{p-DZJR8iD8.js → p-ngAHxLZm.js} +5 -5
- package/dist/components/{p-DZJR8iD8.js.map → p-ngAHxLZm.js.map} +1 -1
- package/dist/components/{p-DIbhOKDN.js → p-qe7eWmdR.js} +3 -3
- package/dist/components/{p-DIbhOKDN.js.map → p-qe7eWmdR.js.map} +1 -1
- package/dist/components/{p-B_Zms6J8.js → p-s8TAnkny.js} +4 -4
- package/dist/components/{p-B_Zms6J8.js.map → p-s8TAnkny.js.map} +1 -1
- package/dist/components/{p-DHJAvIzJ.js → p-t4Pprf0f.js} +17 -17
- package/dist/components/{p-DHJAvIzJ.js.map → p-t4Pprf0f.js.map} +1 -1
- package/dist/components/{p-CoslO5Ge.js → p-tgoTIF6z.js} +3 -3
- package/dist/components/{p-CoslO5Ge.js.map → p-tgoTIF6z.js.map} +1 -1
- package/dist/components/textarea-component.js +1 -1
- package/dist/components/time-period-selector.js +1 -1
- package/dist/esm/{abstract-provider-CAByQ1yu.js → abstract-provider-X9hmEFLa.js} +3 -3
- package/dist/esm/{abstract-provider-CAByQ1yu.js.map → abstract-provider-X9hmEFLa.js.map} +1 -1
- package/dist/esm/calendar-agenda-fill-icon_38.entry.js +9 -9
- package/dist/esm/calendar-agenda-fill-icon_38.entry.js.map +1 -1
- package/dist/esm/checkbox-group_4.entry.js +3 -3
- package/dist/esm/checkmark-icon_15.entry.js +2 -2
- package/dist/esm/{customParseFormat-C5X9iZBs.js → customParseFormat-DrYeNeiE.js} +3 -3
- package/dist/esm/{customParseFormat-C5X9iZBs.js.map → customParseFormat-DrYeNeiE.js.map} +1 -1
- package/dist/esm/globe-icon_3.entry.js +2 -2
- package/dist/esm/google-logo-icon_6.entry.js +3 -3
- package/dist/esm/index.js +2 -2
- package/dist/esm/input-component.entry.js +1 -1
- package/dist/esm/input-dropdown_2.entry.js +1 -1
- package/dist/esm/multi-select-dropdown.entry.js +1 -1
- package/dist/esm/{nylas-api-request-DRpN-bAX.js → nylas-api-request-AONmCQNh.js} +3 -3
- package/dist/esm/{nylas-api-request-DRpN-bAX.js.map → nylas-api-request-AONmCQNh.js.map} +1 -1
- package/dist/esm/nylas-booked-event-card_11.entry.js +2 -2
- package/dist/esm/nylas-form-card.entry.js +2 -2
- package/dist/esm/nylas-notification_2.entry.js +1 -1
- package/dist/esm/nylas-scheduler-editor.entry.js +4 -4
- package/dist/esm/nylas-scheduling.entry.js +3 -3
- package/dist/esm/{register-component-BP-GJdVK.js → register-component-BjlxxlMe.js} +3 -3
- package/dist/esm/{register-component-BP-GJdVK.js.map → register-component-BjlxxlMe.js.map} +1 -1
- package/dist/esm/textarea-component.entry.js +1 -1
- package/dist/esm/{utils-A9dwq_ZM.js → utils-B8iY7eY3.js} +11 -11
- package/dist/esm/{utils-A9dwq_ZM.js.map → utils-B8iY7eY3.js.map} +1 -1
- package/dist/esm/{version-5omo-Q8r.js → version-BXeVyeUj.js} +3 -3
- package/dist/esm/{version-5omo-Q8r.js.map → version-BXeVyeUj.js.map} +1 -1
- package/dist/nylas-web-elements/index.esm.js +1 -1
- package/dist/nylas-web-elements/nylas-web-elements.esm.js +1 -1
- package/dist/nylas-web-elements/{p-d0cbbff8.entry.js → p-20f4278e.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-240cb142.entry.js → p-292681a3.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-02dfca12.entry.js → p-2cf643e5.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-9efaf701.entry.js → p-2e5ddc68.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-3f8cca39.entry.js → p-2f787108.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-3a892dc9.entry.js → p-46da48ea.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-080d42d9.entry.js → p-581f203b.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-f344d9c4.entry.js → p-756bf83b.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-6e38f35b.entry.js → p-7b6e347e.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-5427bc14.entry.js → p-88fee757.entry.js} +3 -3
- package/dist/nylas-web-elements/{p-5427bc14.entry.js.map → p-88fee757.entry.js.map} +1 -1
- package/dist/nylas-web-elements/{p-CbRMUrkC.js → p-B1edKX4a.js} +2 -2
- package/dist/nylas-web-elements/{p-CbRMUrkC.js.map → p-B1edKX4a.js.map} +1 -1
- package/dist/nylas-web-elements/{p-A9dwq_ZM.js → p-B8iY7eY3.js} +2 -2
- package/dist/nylas-web-elements/{p-A9dwq_ZM.js.map → p-B8iY7eY3.js.map} +1 -1
- package/dist/nylas-web-elements/{p-5omo-Q8r.js → p-BXeVyeUj.js} +2 -2
- package/dist/nylas-web-elements/{p-5omo-Q8r.js.map → p-BXeVyeUj.js.map} +1 -1
- package/dist/nylas-web-elements/{p-uCXCisBZ.js → p-BaQNtGdo.js} +2 -2
- package/dist/nylas-web-elements/{p-uCXCisBZ.js.map → p-BaQNtGdo.js.map} +1 -1
- package/dist/nylas-web-elements/{p-BUNkAxEd.js → p-DEznk-5Q.js} +2 -2
- package/dist/nylas-web-elements/{p-BUNkAxEd.js.map → p-DEznk-5Q.js.map} +1 -1
- package/dist/nylas-web-elements/{p-CnLqB-Lc.js → p-ZCLNGrd_.js} +2 -2
- package/dist/nylas-web-elements/{p-CnLqB-Lc.js.map → p-ZCLNGrd_.js.map} +1 -1
- package/dist/nylas-web-elements/{p-eed68bcb.entry.js → p-c157e947.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-e13ed4e9.entry.js → p-c8025a87.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-80b69e76.entry.js → p-cd365b9c.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-0e011ed4.entry.js → p-d246e20e.entry.js} +2 -2
- package/dist/types/version.d.ts +1 -1
- package/package.json +2 -2
- package/dist/components/p-DzIz09Sr.js.map +0 -1
- /package/dist/nylas-web-elements/{p-d0cbbff8.entry.js.map → p-20f4278e.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-240cb142.entry.js.map → p-292681a3.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-02dfca12.entry.js.map → p-2cf643e5.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-9efaf701.entry.js.map → p-2e5ddc68.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-3f8cca39.entry.js.map → p-2f787108.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-3a892dc9.entry.js.map → p-46da48ea.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-080d42d9.entry.js.map → p-581f203b.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-f344d9c4.entry.js.map → p-756bf83b.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-6e38f35b.entry.js.map → p-7b6e347e.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-eed68bcb.entry.js.map → p-c157e947.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-e13ed4e9.entry.js.map → p-c8025a87.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-80b69e76.entry.js.map → p-cd365b9c.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-0e011ed4.entry.js.map → p-d246e20e.entry.js.map} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, e as createEvent, h, i as Host } from './p-Bht9ktsW.js';
|
|
2
|
-
import { R as RegisterComponent } from './p-
|
|
3
|
-
import { a as debug, b as instance, p as isValidUrl } from './p-
|
|
2
|
+
import { R as RegisterComponent } from './p-BC9yeuRb.js';
|
|
3
|
+
import { a as debug, b as instance, p as isValidUrl } from './p-BkzMJ4pV.js';
|
|
4
4
|
import { d as defineCustomElement$6 } from './p-yguTPRl_.js';
|
|
5
5
|
import { d as defineCustomElement$5 } from './p-u4gxSL05.js';
|
|
6
|
-
import { d as defineCustomElement$4 } from './p-
|
|
6
|
+
import { d as defineCustomElement$4 } from './p-DJv7tC9z.js';
|
|
7
7
|
import { d as defineCustomElement$3 } from './p-Dyl-GVi0.js';
|
|
8
8
|
import { d as defineCustomElement$2 } from './p-emUyDjNl.js';
|
|
9
9
|
import { d as defineCustomElement$1 } from './p-Di3WT0Ws.js';
|
|
@@ -253,6 +253,6 @@ function defineCustomElement() {
|
|
|
253
253
|
}
|
|
254
254
|
|
|
255
255
|
export { NylasBookingConfirmationRedirect as N, defineCustomElement as d };
|
|
256
|
-
//# sourceMappingURL=p-
|
|
256
|
+
//# sourceMappingURL=p-D9PED7bs.js.map
|
|
257
257
|
|
|
258
|
-
//# sourceMappingURL=p-
|
|
258
|
+
//# sourceMappingURL=p-D9PED7bs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-DP1P7gC9.js","mappings":";;;;;;;;;;AAAA,MAAM,mCAAmC,GAAG,uoHAAuoH;;;;;;;;;;;;;;;;MCyBtqH,gCAAgC,GAAAA,kBAAA,CAAA,MAAA,gCAAA,SAAAC,CAAA,CAAA;AAN7C,IAAA,WAAA,GAAA;;;;;;AAiBU,QAAA,IAAI,CAAA,IAAA,GAAW,uBAAuB;AAKtC,QAAA,IAAW,CAAA,WAAA,GAAW,EAAE;AAKxB,QAAA,IAAuB,CAAA,uBAAA,GAAW,EAAE;AAmBnC,QAAA,IAAkB,CAAA,kBAAA,GAAW,EAAE;AAM/B,QAAA,IAAe,CAAA,eAAA,GAAY,KAAK;AAEhC,QAAA,IAAa,CAAA,aAAA,GAAW,EAAE;AAC1B,QAAA,IAAY,CAAA,YAAA,GAAW,EAAE;AAqOnC;AApNC,IAAA,yBAAyB,CAAC,QAAgB,EAAA;AACxC,QAAA,KAAK,CAAC,qCAAqC,EAAE,2BAA2B,EAAE,QAAQ,CAAC;QACnF,IAAI,CAAC,IAAI,CAAC,YAAY,CAA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I,CAAC,WAAW,EAC7B,CAAA,EACD,IAAI,CAAC,uBAAuB,IAAI,6DAAM,KAAK,EAAC,eAAe,EAAE,EAAA,IAAI,CAAC,uBAAuB,CAAQ,CAC9F,CACP,CACG,CACP,CACG,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAtDX,UAAA,CAAA;AArBC,IAAA,iBAAiB,CAAsH;AACtI,QAAA,IAAI,EAAE,qCAAqC;QAC3C,YAAY,EAAE,IAAI,GAAG,CAAC;YACpB,CAAC,uCAAuC,EAAE,uBAAuB,CAAC;YAClE,CAAC,kCAAkC,EAAE,kBAAkB,CAAC;YACxD,CAAC,6BAA6B,EAAE,aAAa,CAAC;SAC/C,CAAC;AACF,QAAA,YAAY,EAAE;AACZ,YAAA,YAAY,EAAE,OACZ,KAAiI,EACjI,8BAA6D,KAC3D;AACF,gBAAA,MAAM,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC,MAAM;gBAErC,IAAI,YAAY,EAAE;oBAChB,YAAY,CAAC,KAAK,CAAC;;aAEtB;AACF,SAAA;AACD,QAAA,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;CAyDD,EAAA,gCAAA,CAAA,SAAA,EAAA,QAAA,EAAA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement","i18next"],"sources":["src/components/scheduler-editor/nylas-booking-confirmation-redirect/nylas-booking-confirmation-redirect.scss?tag=nylas-booking-confirmation-redirect&encapsulation=shadow","src/components/scheduler-editor/nylas-booking-confirmation-redirect/nylas-booking-confirmation-redirect.tsx"],"sourcesContent":["@use '../../../common/styles/variables' as *;\n\n:host {\n display: block;\n @include default-css-variables;\n width: inherit;\n}\n\n.nylas-booking-confirmation-redirect {\n width: inherit;\n display: flex;\n flex-direction: column;\n\n .nylas-booking-confirmation-redirect__dropdown {\n span.label {\n display: flex;\n align-items: center;\n gap: 4px;\n margin-bottom: 4px;\n color: var(--nylas-base-800);\n\n tooltip-component {\n display: flex;\n }\n }\n\n select-dropdown::part(sd_dropdown) {\n width: 100%;\n }\n\n select-dropdown::part(sd_dropdown-button) {\n width: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n border: 1px solid var(--nylas-base-200);\n border-radius: var(--nylas-border-radius-2x);\n padding: 1rem;\n }\n\n select-dropdown::part(sd_dropdown-content) {\n width: 100%;\n max-width: unset;\n }\n\n select-dropdown::part(sd_dropdown-button-selected-label) {\n max-width: calc(100% - 2rem);\n font-family: var(--nylas-font-family);\n font-size: 16px;\n line-height: 24px;\n }\n\n input-component::part(ic__input_wrapper) {\n margin-top: 1rem;\n }\n\n span.error-message {\n color: var(--nylas-error);\n }\n }\n}\n","import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug } from '@/utils/utils';\nimport { AttachInternals, Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { isValidUrl } from '@/utils/utils';\nimport { Configuration, ThemeConfig } from '@nylas/core';\nimport i18next from '@/utils/i18n';\nimport { LANGUAGE_CODE } from '@/common/constants';\n\n/**\n * The `nylas-booking-confirmation-redirect` component is a UI component that allows the user to choose a custom redirect URL after a booking is confirmed.\n * @part nbcr - The booking redirect container\n * @part nbcr__header - The header of the booking redirect\n * @part nbcr__dropdown - The dropdown container\n * @part nbcr__dropdown-button - The dropdown button\n * @part nbcr__dropdown-content - The dropdown content\n * @part nbcr__input-textfield - The input field content\n */\n@Component({\n tag: 'nylas-booking-confirmation-redirect',\n styleUrl: 'nylas-booking-confirmation-redirect.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasBookingConfirmationRedirect {\n @Element() host!: HTMLNylasBookingConfirmationRedirectElement;\n /**\n * @standalone\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n /**\n * @standalone\n * The name of the confirmation redirect link.\n */\n @Prop() name: string = 'confirmation-redirect';\n /**\n * @standalone\n * The custom redirect URL.\n */\n @Prop() redirectUrl: string = '';\n /**\n * @standalone\n * The custom redirect URL error message\n */\n @Prop() redirectUrlErrorMessage: string = '';\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: LANGUAGE_CODE;\n /**\n * @standalone\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: ThemeConfig;\n\n /**\n * The element internals.\n */\n @AttachInternals() internals!: ElementInternals;\n\n /**\n * The current redirect URL.\n */\n @State() currentRedirectUrl: string = '';\n /**\n * The state for whether a custom URL can be added.\n */\n @State() acceptUrl!: boolean;\n\n @State() componentLoaded: boolean = false;\n\n @State() requiredError: string = '';\n @State() patternError: string = '';\n\n /**\n * This event is fired when the current redirect URL changes and is valid.\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n valueChanged?: (event: CustomEvent<{ value: string; name: string }>) => void;\n }>;\n\n /**\n * When a name prop is passed, stencil does not automatically set the name attribute on the host element.\n * Since this component is form-associated, the name attribute is required for form submission.\n * This is a workaround to ensure that the name attribute is set on the host element.\n */\n @Watch('name')\n elementNameChangedHandler(newValue: string) {\n debug('nylas-booking-confirmation-redirect', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('selectedConfiguration')\n selectedConfigurationChangedHandler(newValue: Configuration) {\n debug('nylas-booking-confirmation-redirect', 'selectedConfigurationChangedHandler', newValue);\n if (newValue?.scheduler?.confirmation_redirect_url) {\n this.currentRedirectUrl = newValue?.scheduler?.confirmation_redirect_url;\n this.acceptUrl = newValue?.scheduler?.confirmation_redirect_url !== '';\n }\n }\n\n @Watch('selectedLanguage')\n selectedLanguageChangedHandler(newVal: LANGUAGE_CODE, oldVal: LANGUAGE_CODE) {\n if (newVal === oldVal) return;\n i18next.changeLanguage(newVal);\n this.requiredError = i18next.t('fieldRequired', { field: i18next.t('redirectUrl') });\n this.patternError = i18next.t('invalidInputFormat', { field: i18next.t('redirectUrl') });\n }\n\n @Watch('themeConfig')\n themeConfigChangedHandler(newVal: ThemeConfig, oldVal: ThemeConfig) {\n if (newVal === oldVal) return;\n this.applyThemeConfig(newVal);\n }\n\n // Lifecycle methods\n connectedCallback() {\n debug('nylas-booking-confirmation-redirect', 'connectedCallback');\n }\n\n disconnectedCallback() {\n debug('nylas-booking-confirmation-redirect', 'disconnectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-booking-confirmation-redirect', 'componentWillLoad');\n // See comment in the @Watch('name') decorator for more information.\n this.host.setAttribute('name', this.name);\n }\n\n componentDidLoad() {\n debug('nylas-booking-confirmation-redirect', 'componentDidLoad');\n if (this.selectedConfiguration) {\n this.selectedConfigurationChangedHandler(this.selectedConfiguration);\n } else {\n this.currentRedirectUrl = this.redirectUrl;\n this.acceptUrl = this.redirectUrl !== '';\n }\n this.componentLoaded = true;\n if (typeof this.internals.setFormValue === 'function') {\n this.internals.setFormValue(this.currentRedirectUrl.toString(), this.name);\n }\n }\n\n componentWillUpdate() {\n debug('nylas-booking-confirmation-redirect', 'componentWillUpdate');\n }\n\n componentDidUpdate() {\n debug('nylas-booking-confirmation-redirect', 'componentDidUpdate');\n }\n\n componentWillRender() {\n debug('nylas-booking-confirmation-redirect', 'componentWillRender');\n }\n\n componentDidRender() {\n debug('nylas-booking-confirmation-redirect', 'componentDidRender');\n }\n\n @Listen('nylasFormDropdownChanged')\n nylasFormDropdownChangedHandler(event: CustomEvent<{ value: string; name: string }>) {\n debug('nylas-booking-confirmation-redirect', 'nylasFormDropdownChangedHandler', event.detail);\n\n const { name, value } = event.detail;\n\n if (name === 'confirmation-redirect-dropdown') {\n if (value === 'custom') {\n this.acceptUrl = true;\n } else {\n this.acceptUrl = false;\n\n // Submit empty string to clear redirect URL\n this.internals.setFormValue('', this.name);\n this.valueChanged.emit({ name: this.name, value: '' });\n }\n }\n }\n\n @Listen('nylasFormInputBlurred')\n nylasFormInputBlurHandler(event: CustomEvent<{ value: string; name: string }>) {\n const { name, value } = event.detail;\n this.currentRedirectUrl = value;\n\n if (this.acceptUrl && name === 'confirmation-redirect') {\n this.redirectUrlErrorMessage = '';\n\n if (!isValidUrl(this.currentRedirectUrl)) {\n this.internals.setValidity({ customError: true }, i18next.t('nylasBookingConfirmationRedirect.customRedirectUrlErrorMessage'));\n this.redirectUrlErrorMessage = i18next.t('nylasBookingConfirmationRedirect.customRedirectUrlErrorMessage');\n return;\n }\n this.internals.setValidity({});\n\n // Pass as handler so that if event.defaultPrevented by parent app, this will be skipped.\n const valueChanged = (event: CustomEvent<{ value: string; name: string }>) => {\n const { value } = event.detail;\n this.internals.setFormValue(value.toString(), this.name);\n };\n this.valueChanged.emit({ ...event.detail, valueChanged });\n }\n }\n\n @Listen('formSubmitted', { target: 'document' })\n formSubmittedHandler(_event: CustomEvent) {\n if (this.acceptUrl && !isValidUrl(this.currentRedirectUrl)) {\n this.internals.setValidity({ customError: true }, i18next.t('nylasBookingConfirmationRedirect.customRedirectUrlErrorMessage'));\n this.redirectUrlErrorMessage = i18next.t('nylasBookingConfirmationRedirect.customRedirectUrlErrorMessage');\n } else {\n this.internals.setValidity({});\n }\n }\n\n applyThemeConfig(themeConfig?: ThemeConfig) {\n if (themeConfig) {\n for (const [key, value] of Object.entries(themeConfig)) {\n this.host.style.setProperty(`${key}`, value);\n }\n }\n }\n\n @RegisterComponent<NylasBookingConfirmationRedirect, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-booking-confirmation-redirect',\n stateToProps: new Map([\n ['schedulerConfig.selectedConfiguration', 'selectedConfiguration'],\n ['schedulerConfig.selectedLanguage', 'selectedLanguage'],\n ['schedulerConfig.themeConfig', 'themeConfig'],\n ]),\n eventToProps: {\n valueChanged: async (\n event: CustomEvent<{ value: string; name: string; valueChanged?: (event: CustomEvent<{ value: string; name: string }>) => void }>,\n _nylasSchedulerConfigConnector: NylasSchedulerConfigConnector,\n ) => {\n const { valueChanged } = event.detail;\n // If a handler is passed, call it.\n if (valueChanged) {\n valueChanged(event);\n }\n },\n },\n fireRegisterEvent: true,\n })\n render() {\n const redirectOptions = [\n {\n label: i18next.t('nylasBookingConfirmationRedirect.redirectOption', { context: 'default' }),\n value: 'default',\n },\n {\n label: i18next.t('nylasBookingConfirmationRedirect.redirectOption', { context: 'custom' }),\n value: 'custom',\n },\n ];\n\n return (\n <Host>\n <div class=\"nylas-booking-confirmation-redirect\" part=\"nbcr\">\n {redirectOptions.length > 0 && (\n <div class=\"nylas-booking-confirmation-redirect__dropdown\">\n <span class=\"label\">\n {i18next.t('nylasBookingConfirmationRedirect.dropdownLabel')}\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">{i18next.t('nylasBookingConfirmationRedirect.tooltip.desc')}</span>\n </tooltip-component>\n </span>\n {this.componentLoaded && (\n <select-dropdown\n name=\"confirmation-redirect-dropdown\"\n options={redirectOptions}\n withSearch={false}\n defaultSelectedOption={redirectOptions.find(option => option.value === (this.acceptUrl ? 'custom' : 'default'))}\n exportparts=\"sd_dropdown: nbcr__dropdown, sd_dropdown-button: nbcr__dropdown-button, sd_dropdown-content: nbcr__dropdown-content\"\n themeConfig={this.themeConfig}\n />\n )}\n {this.acceptUrl && (\n <div>\n <input-component\n name=\"confirmation-redirect\"\n id=\"confirmation-redirect\"\n type=\"text\"\n placeholder={i18next.t('nylasBookingConfirmationRedirect.customRedirectUrlPlaceholder')}\n required={false}\n part=\"ic__input_wrapper: nbcr__input-textfield\"\n requiredError={this.requiredError}\n patternError={this.patternError}\n defaultValue={this.currentRedirectUrl}\n themeConfig={this.themeConfig}\n />\n {this.redirectUrlErrorMessage && <span class=\"error-message\">{this.redirectUrlErrorMessage}</span>}\n </div>\n )}\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"p-D9PED7bs.js","mappings":";;;;;;;;;;AAAA,MAAM,mCAAmC,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K,CAAC;;aAEtB;AACF,SAAA;AACD,QAAA,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;CAyDD,EAAA,gCAAA,CAAA,SAAA,EAAA,QAAA,EAAA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement","i18next"],"sources":["src/components/scheduler-editor/nylas-booking-confirmation-redirect/nylas-booking-confirmation-redirect.scss?tag=nylas-booking-confirmation-redirect&encapsulation=shadow","src/components/scheduler-editor/nylas-booking-confirmation-redirect/nylas-booking-confirmation-redirect.tsx"],"sourcesContent":["@use '../../../common/styles/variables' as *;\n\n:host {\n display: block;\n @include default-css-variables;\n width: inherit;\n}\n\n.nylas-booking-confirmation-redirect {\n width: inherit;\n display: flex;\n flex-direction: column;\n\n .nylas-booking-confirmation-redirect__dropdown {\n span.label {\n display: flex;\n align-items: center;\n gap: 4px;\n margin-bottom: 4px;\n color: var(--nylas-base-800);\n\n tooltip-component {\n display: flex;\n }\n }\n\n select-dropdown::part(sd_dropdown) {\n width: 100%;\n }\n\n select-dropdown::part(sd_dropdown-button) {\n width: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n border: 1px solid var(--nylas-base-200);\n border-radius: var(--nylas-border-radius-2x);\n padding: 1rem;\n }\n\n select-dropdown::part(sd_dropdown-content) {\n width: 100%;\n max-width: unset;\n }\n\n select-dropdown::part(sd_dropdown-button-selected-label) {\n max-width: calc(100% - 2rem);\n font-family: var(--nylas-font-family);\n font-size: 16px;\n line-height: 24px;\n }\n\n input-component::part(ic__input_wrapper) {\n margin-top: 1rem;\n }\n\n span.error-message {\n color: var(--nylas-error);\n }\n }\n}\n","import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug } from '@/utils/utils';\nimport { AttachInternals, Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { isValidUrl } from '@/utils/utils';\nimport { Configuration, ThemeConfig } from '@nylas/core';\nimport i18next from '@/utils/i18n';\nimport { LANGUAGE_CODE } from '@/common/constants';\n\n/**\n * The `nylas-booking-confirmation-redirect` component is a UI component that allows the user to choose a custom redirect URL after a booking is confirmed.\n * @part nbcr - The booking redirect container\n * @part nbcr__header - The header of the booking redirect\n * @part nbcr__dropdown - The dropdown container\n * @part nbcr__dropdown-button - The dropdown button\n * @part nbcr__dropdown-content - The dropdown content\n * @part nbcr__input-textfield - The input field content\n */\n@Component({\n tag: 'nylas-booking-confirmation-redirect',\n styleUrl: 'nylas-booking-confirmation-redirect.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasBookingConfirmationRedirect {\n @Element() host!: HTMLNylasBookingConfirmationRedirectElement;\n /**\n * @standalone\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n /**\n * @standalone\n * The name of the confirmation redirect link.\n */\n @Prop() name: string = 'confirmation-redirect';\n /**\n * @standalone\n * The custom redirect URL.\n */\n @Prop() redirectUrl: string = '';\n /**\n * @standalone\n * The custom redirect URL error message\n */\n @Prop() redirectUrlErrorMessage: string = '';\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: LANGUAGE_CODE;\n /**\n * @standalone\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: ThemeConfig;\n\n /**\n * The element internals.\n */\n @AttachInternals() internals!: ElementInternals;\n\n /**\n * The current redirect URL.\n */\n @State() currentRedirectUrl: string = '';\n /**\n * The state for whether a custom URL can be added.\n */\n @State() acceptUrl!: boolean;\n\n @State() componentLoaded: boolean = false;\n\n @State() requiredError: string = '';\n @State() patternError: string = '';\n\n /**\n * This event is fired when the current redirect URL changes and is valid.\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n valueChanged?: (event: CustomEvent<{ value: string; name: string }>) => void;\n }>;\n\n /**\n * When a name prop is passed, stencil does not automatically set the name attribute on the host element.\n * Since this component is form-associated, the name attribute is required for form submission.\n * This is a workaround to ensure that the name attribute is set on the host element.\n */\n @Watch('name')\n elementNameChangedHandler(newValue: string) {\n debug('nylas-booking-confirmation-redirect', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('selectedConfiguration')\n selectedConfigurationChangedHandler(newValue: Configuration) {\n debug('nylas-booking-confirmation-redirect', 'selectedConfigurationChangedHandler', newValue);\n if (newValue?.scheduler?.confirmation_redirect_url) {\n this.currentRedirectUrl = newValue?.scheduler?.confirmation_redirect_url;\n this.acceptUrl = newValue?.scheduler?.confirmation_redirect_url !== '';\n }\n }\n\n @Watch('selectedLanguage')\n selectedLanguageChangedHandler(newVal: LANGUAGE_CODE, oldVal: LANGUAGE_CODE) {\n if (newVal === oldVal) return;\n i18next.changeLanguage(newVal);\n this.requiredError = i18next.t('fieldRequired', { field: i18next.t('redirectUrl') });\n this.patternError = i18next.t('invalidInputFormat', { field: i18next.t('redirectUrl') });\n }\n\n @Watch('themeConfig')\n themeConfigChangedHandler(newVal: ThemeConfig, oldVal: ThemeConfig) {\n if (newVal === oldVal) return;\n this.applyThemeConfig(newVal);\n }\n\n // Lifecycle methods\n connectedCallback() {\n debug('nylas-booking-confirmation-redirect', 'connectedCallback');\n }\n\n disconnectedCallback() {\n debug('nylas-booking-confirmation-redirect', 'disconnectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-booking-confirmation-redirect', 'componentWillLoad');\n // See comment in the @Watch('name') decorator for more information.\n this.host.setAttribute('name', this.name);\n }\n\n componentDidLoad() {\n debug('nylas-booking-confirmation-redirect', 'componentDidLoad');\n if (this.selectedConfiguration) {\n this.selectedConfigurationChangedHandler(this.selectedConfiguration);\n } else {\n this.currentRedirectUrl = this.redirectUrl;\n this.acceptUrl = this.redirectUrl !== '';\n }\n this.componentLoaded = true;\n if (typeof this.internals.setFormValue === 'function') {\n this.internals.setFormValue(this.currentRedirectUrl.toString(), this.name);\n }\n }\n\n componentWillUpdate() {\n debug('nylas-booking-confirmation-redirect', 'componentWillUpdate');\n }\n\n componentDidUpdate() {\n debug('nylas-booking-confirmation-redirect', 'componentDidUpdate');\n }\n\n componentWillRender() {\n debug('nylas-booking-confirmation-redirect', 'componentWillRender');\n }\n\n componentDidRender() {\n debug('nylas-booking-confirmation-redirect', 'componentDidRender');\n }\n\n @Listen('nylasFormDropdownChanged')\n nylasFormDropdownChangedHandler(event: CustomEvent<{ value: string; name: string }>) {\n debug('nylas-booking-confirmation-redirect', 'nylasFormDropdownChangedHandler', event.detail);\n\n const { name, value } = event.detail;\n\n if (name === 'confirmation-redirect-dropdown') {\n if (value === 'custom') {\n this.acceptUrl = true;\n } else {\n this.acceptUrl = false;\n\n // Submit empty string to clear redirect URL\n this.internals.setFormValue('', this.name);\n this.valueChanged.emit({ name: this.name, value: '' });\n }\n }\n }\n\n @Listen('nylasFormInputBlurred')\n nylasFormInputBlurHandler(event: CustomEvent<{ value: string; name: string }>) {\n const { name, value } = event.detail;\n this.currentRedirectUrl = value;\n\n if (this.acceptUrl && name === 'confirmation-redirect') {\n this.redirectUrlErrorMessage = '';\n\n if (!isValidUrl(this.currentRedirectUrl)) {\n this.internals.setValidity({ customError: true }, i18next.t('nylasBookingConfirmationRedirect.customRedirectUrlErrorMessage'));\n this.redirectUrlErrorMessage = i18next.t('nylasBookingConfirmationRedirect.customRedirectUrlErrorMessage');\n return;\n }\n this.internals.setValidity({});\n\n // Pass as handler so that if event.defaultPrevented by parent app, this will be skipped.\n const valueChanged = (event: CustomEvent<{ value: string; name: string }>) => {\n const { value } = event.detail;\n this.internals.setFormValue(value.toString(), this.name);\n };\n this.valueChanged.emit({ ...event.detail, valueChanged });\n }\n }\n\n @Listen('formSubmitted', { target: 'document' })\n formSubmittedHandler(_event: CustomEvent) {\n if (this.acceptUrl && !isValidUrl(this.currentRedirectUrl)) {\n this.internals.setValidity({ customError: true }, i18next.t('nylasBookingConfirmationRedirect.customRedirectUrlErrorMessage'));\n this.redirectUrlErrorMessage = i18next.t('nylasBookingConfirmationRedirect.customRedirectUrlErrorMessage');\n } else {\n this.internals.setValidity({});\n }\n }\n\n applyThemeConfig(themeConfig?: ThemeConfig) {\n if (themeConfig) {\n for (const [key, value] of Object.entries(themeConfig)) {\n this.host.style.setProperty(`${key}`, value);\n }\n }\n }\n\n @RegisterComponent<NylasBookingConfirmationRedirect, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-booking-confirmation-redirect',\n stateToProps: new Map([\n ['schedulerConfig.selectedConfiguration', 'selectedConfiguration'],\n ['schedulerConfig.selectedLanguage', 'selectedLanguage'],\n ['schedulerConfig.themeConfig', 'themeConfig'],\n ]),\n eventToProps: {\n valueChanged: async (\n event: CustomEvent<{ value: string; name: string; valueChanged?: (event: CustomEvent<{ value: string; name: string }>) => void }>,\n _nylasSchedulerConfigConnector: NylasSchedulerConfigConnector,\n ) => {\n const { valueChanged } = event.detail;\n // If a handler is passed, call it.\n if (valueChanged) {\n valueChanged(event);\n }\n },\n },\n fireRegisterEvent: true,\n })\n render() {\n const redirectOptions = [\n {\n label: i18next.t('nylasBookingConfirmationRedirect.redirectOption', { context: 'default' }),\n value: 'default',\n },\n {\n label: i18next.t('nylasBookingConfirmationRedirect.redirectOption', { context: 'custom' }),\n value: 'custom',\n },\n ];\n\n return (\n <Host>\n <div class=\"nylas-booking-confirmation-redirect\" part=\"nbcr\">\n {redirectOptions.length > 0 && (\n <div class=\"nylas-booking-confirmation-redirect__dropdown\">\n <span class=\"label\">\n {i18next.t('nylasBookingConfirmationRedirect.dropdownLabel')}\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">{i18next.t('nylasBookingConfirmationRedirect.tooltip.desc')}</span>\n </tooltip-component>\n </span>\n {this.componentLoaded && (\n <select-dropdown\n name=\"confirmation-redirect-dropdown\"\n options={redirectOptions}\n withSearch={false}\n defaultSelectedOption={redirectOptions.find(option => option.value === (this.acceptUrl ? 'custom' : 'default'))}\n exportparts=\"sd_dropdown: nbcr__dropdown, sd_dropdown-button: nbcr__dropdown-button, sd_dropdown-content: nbcr__dropdown-content\"\n themeConfig={this.themeConfig}\n />\n )}\n {this.acceptUrl && (\n <div>\n <input-component\n name=\"confirmation-redirect\"\n id=\"confirmation-redirect\"\n type=\"text\"\n placeholder={i18next.t('nylasBookingConfirmationRedirect.customRedirectUrlPlaceholder')}\n required={false}\n part=\"ic__input_wrapper: nbcr__input-textfield\"\n requiredError={this.requiredError}\n patternError={this.patternError}\n defaultValue={this.currentRedirectUrl}\n themeConfig={this.themeConfig}\n />\n {this.redirectUrlErrorMessage && <span class=\"error-message\">{this.redirectUrlErrorMessage}</span>}\n </div>\n )}\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, e as createEvent, h, i as Host } from './p-Bht9ktsW.js';
|
|
2
|
-
import { R as RegisterComponent } from './p-
|
|
3
|
-
import { a as debug, b as instance, s as sanitize } from './p-
|
|
2
|
+
import { R as RegisterComponent } from './p-BC9yeuRb.js';
|
|
3
|
+
import { a as debug, b as instance, s as sanitize } from './p-BkzMJ4pV.js';
|
|
4
4
|
import { d as defineCustomElement$2 } from './p-u4gxSL05.js';
|
|
5
5
|
import { d as defineCustomElement$1 } from './p-Di3WT0Ws.js';
|
|
6
6
|
|
|
@@ -144,6 +144,6 @@ function defineCustomElement() {
|
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
export { NylasCancellationPolicy as N, defineCustomElement as d };
|
|
147
|
-
//# sourceMappingURL=p-
|
|
147
|
+
//# sourceMappingURL=p-DAmas3F9.js.map
|
|
148
148
|
|
|
149
|
-
//# sourceMappingURL=p-
|
|
149
|
+
//# sourceMappingURL=p-DAmas3F9.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-
|
|
1
|
+
{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AA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,YAAY,EAAA,EACtB,CAAA,CAAA,mBAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EACE,CAAW,CAAA,WAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAC,cAAc,EAAG,CAAA,EACjC,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,iBAAiB,EAAA,EAAEA,QAAO,CAAC,CAAC,CAAC,sCAAsC,CAAC,CAAQ,CACrE,CACf,CACD,EACR,CAAA,CAAA,UAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAU,EAAE,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAC,oBAAoB,EAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,EAAC,KAAK,EAAC,OAAO,EAAE,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,GAAa,CACpJ,CACD;;;;;;;;;;;;;;;;;;;;;;;;AAfX,UAAA,CAAA;AAVC,IAAA,iBAAiB,CAA6G;AAC7H,QAAA,IAAI,EAAE,2BAA2B;QACjC,YAAY,EAAE,IAAI,GAAG,CAAC;YACpB,CAAC,uCAAuC,EAAE,uBAAuB,CAAC;YAClE,CAAC,kCAAkC,EAAE,kBAAkB,CAAC;YACxD,CAAC,6BAA6B,EAAE,aAAa,CAAC;SAC/C,CAAC;AACF,QAAA,YAAY,EAAE,EAAE;AAChB,QAAA,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;CAkBD,EAAA,uBAAA,CAAA,SAAA,EAAA,QAAA,EAAA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement","i18next"],"sources":["src/components/scheduler-editor/nylas-cancellation-policy/nylas-cancellation-policy.scss?tag=nylas-cancellation-policy&encapsulation=shadow","src/components/scheduler-editor/nylas-cancellation-policy/nylas-cancellation-policy.tsx"],"sourcesContent":["@use '../../../common/styles/variables' as *;\n\n:host {\n @include default-css-variables;\n}\n\n.nylas-cancellation-policy {\n display: flex;\n flex-direction: column;\n gap: 4px;\n\n label {\n display: flex;\n align-items: center;\n color: var(--nylas-base-800);\n font-size: 16px;\n font-style: normal;\n font-weight: 400;\n line-height: 150%;\n\n /* 21px */\n span.label-icon {\n margin-left: 4px;\n\n tooltip-component {\n display: flex;\n }\n }\n }\n\n textarea {\n padding: 12px 16px;\n border-width: 1;\n resize: vertical;\n border-radius: 8px;\n font-family: var(--nylas-font-family);\n font-size: 16px;\n line-height: 24px;\n border: 1px solid var(--nylas-base-200);\n background-color: var(--nylas-base-0);\n color: var(--nylas-base-900);\n\n &::-webkit-resizer {\n display: none;\n }\n }\n}\n","import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug, sanitize } from '@/utils/utils';\nimport { AttachInternals, Component, Host, State, h, Element, Prop, Watch, Event, EventEmitter } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { Configuration, ThemeConfig } from '@nylas/core';\nimport i18next from '@/utils/i18n';\nimport { LANGUAGE_CODE } from '@/common/constants';\n\n/**\n * The `nylas-cancellation-policy` component is a form input for the cancellation policy message of an event.\n * @part ncpolicy - The cancellation policy container\n * @part ncpolicy__textarea - The cancellation policy textarea\n */\n@Component({\n tag: 'nylas-cancellation-policy',\n styleUrl: 'nylas-cancellation-policy.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasCancellationPolicy {\n /**\n * The host element <nylas-cancellation-policy>\n */\n @Element() host!: HTMLElement;\n /**\n * @standalone\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n\n /**\n * @standalone\n * The cancellation policy stored in the configuration\n */\n @Prop() cancellationPolicy?: string;\n\n /**\n * @standalone\n * The name of the cancellation policy input.\n */\n @Prop() name: string = 'cancellation-policy';\n\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: LANGUAGE_CODE;\n\n /**\n * @standalone\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: ThemeConfig;\n\n /**\n * The selected cancellation policy state. This defaults to the cancellation policy from the configuration or an empty string.\n */\n @State() message!: string;\n /**\n * The element internals.\n */\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-cancellation-policy', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('selectedConfiguration')\n selectedConfigurationChangedHandler(newValue: Configuration) {\n debug('nylas-custom-booking-flow', 'selectedConfigurationChangedHandler', newValue);\n this.message = newValue?.scheduler?.cancellation_policy || this.cancellationPolicy || '';\n }\n\n @Watch('selectedLanguage')\n selectedLanguageChangedHandler(newVal: LANGUAGE_CODE, oldVal: LANGUAGE_CODE) {\n if (newVal === oldVal) return;\n i18next.changeLanguage(newVal);\n }\n\n @Watch('themeConfig')\n themeConfigChangedHandler(newVal: ThemeConfig, oldVal: ThemeConfig) {\n if (newVal === oldVal) return;\n this.applyThemeConfig(newVal);\n }\n\n /**\n * Event emitted when the cancellation policy message changes.\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n }>;\n\n connectedCallback() {\n debug('nylas-cancellation-policy', 'connectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-cancellation-policy', 'componentWillLoad');\n this.host.setAttribute('name', this.name);\n }\n\n componentDidLoad() {\n debug('nylas-cancellation-policy', 'componentDidLoad');\n if (this.selectedConfiguration) {\n this.selectedConfigurationChangedHandler(this.selectedConfiguration);\n } else {\n this.message = this.cancellationPolicy || '';\n }\n }\n\n disconnectedCallback() {\n debug('nylas-cancellation-policy', 'disconnectedCallback');\n }\n\n handleChange(event) {\n const value = sanitize(event.target.value);\n this.message = value;\n this.internals.setFormValue(value, this.name);\n this.valueChanged.emit({ value: value, name: this.name });\n }\n\n applyThemeConfig(themeConfig?: ThemeConfig) {\n if (themeConfig) {\n for (const [key, value] of Object.entries(themeConfig)) {\n this.host.style.setProperty(`${key}`, value);\n }\n }\n }\n\n @RegisterComponent<NylasCancellationPolicy, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-cancellation-policy',\n stateToProps: new Map([\n ['schedulerConfig.selectedConfiguration', 'selectedConfiguration'],\n ['schedulerConfig.selectedLanguage', 'selectedLanguage'],\n ['schedulerConfig.themeConfig', 'themeConfig'],\n ]),\n eventToProps: {},\n fireRegisterEvent: true,\n })\n render() {\n return (\n <Host>\n <div class=\"nylas-cancellation-policy\" part=\"ncpolicy\">\n <label htmlFor={this.name}>\n {i18next.t('nylasCancellationPolicy.cancellationPolicyLabel')}\n <span class=\"label-icon\">\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">{i18next.t('nylasCancellationPolicy.tooltip.desc')}</span>\n </tooltip-component>\n </span>\n </label>\n <textarea id={this.name} part=\"ncpolicy__textarea\" name={this.name} value={this.message} maxlength=\"250\" onInput={e => this.handleChange(e)}></textarea>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, e as createEvent, h, i as Host } from './p-Bht9ktsW.js';
|
|
2
|
-
import { R as RegisterComponent } from './p-
|
|
3
|
-
import { a as debug, b as instance, t as timeToMinutes, f as convertTo12HourFormat, m as minutesToTime, g as convertTo24HourFormat } from './p-
|
|
2
|
+
import { R as RegisterComponent } from './p-BC9yeuRb.js';
|
|
3
|
+
import { a as debug, b as instance, t as timeToMinutes, f as convertTo12HourFormat, m as minutesToTime, g as convertTo24HourFormat } from './p-BkzMJ4pV.js';
|
|
4
4
|
import { D as DEFAULT_OPEN_HOURS, T as TIMEZONE_MAP } from './p-DUCeQ1R4.js';
|
|
5
5
|
import { d as defineCustomElement$9 } from './p-p1aiCEqo.js';
|
|
6
6
|
import { d as defineCustomElement$8 } from './p-yguTPRl_.js';
|
|
7
7
|
import { d as defineCustomElement$7 } from './p-BjvAaf0A.js';
|
|
8
8
|
import { d as defineCustomElement$6 } from './p-T0NGagTT.js';
|
|
9
9
|
import { d as defineCustomElement$5 } from './p-u4gxSL05.js';
|
|
10
|
-
import { d as defineCustomElement$4 } from './p-
|
|
10
|
+
import { d as defineCustomElement$4 } from './p-qe7eWmdR.js';
|
|
11
11
|
import { d as defineCustomElement$3 } from './p-Dyl-GVi0.js';
|
|
12
12
|
import { d as defineCustomElement$2 } from './p-emUyDjNl.js';
|
|
13
13
|
import { d as defineCustomElement$1 } from './p-Di3WT0Ws.js';
|
|
@@ -536,6 +536,6 @@ function defineCustomElement() {
|
|
|
536
536
|
}
|
|
537
537
|
|
|
538
538
|
export { NylasAvailabilityPicker as N, defineCustomElement as d };
|
|
539
|
-
//# sourceMappingURL=p-
|
|
539
|
+
//# sourceMappingURL=p-DHlJz5qn.js.map
|
|
540
540
|
|
|
541
|
-
//# sourceMappingURL=p-
|
|
541
|
+
//# sourceMappingURL=p-DHlJz5qn.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-DEF0WG29.js","mappings":";;;;;;;;;;;;;;AAAA,MAAM,0BAA0B,GAAG,wwMAAwwM;;;;;;;;;;;;;;;;MCgD9xM,uBAAuB,GAAAA,kBAAA,CAAA,MAAA,uBAAA,SAAAC,CAAA,CAAA;AANpC,IAAA,WAAA,GAAA;;;;;;AAeU,QAAA,IAAI,CAAA,IAAA,GAAW,cAAc;AAe7B,QAAA,IAAe,CAAA,eAAA,GAAW,IAAI,CAAC,cAAc,EAAE,CAAC,eAAe,EAAE,CAAC,QAAQ;AAK1E,QAAA,IAAU,CAAA,UAAA,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CAAC,UAAU,CAAC,CAAA,EAAG,GAAG,CAAG,CAAA,CAAA,CAAC,IAAI,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAE;kBAC9H,EAAE,CACF,CACP,CACG,EACN,CACG,CAAA,KAAA,EAAA,IAAA,EAAA,UAAU,CAAC,MAAM,GAAG,CAAC,IACpB,CAAA,CAAA,QAAA,EAAA,EAAQ,OAAO,EAAE,MAAM,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,IAAI,EAAC,qBAAqB,EAAA,EACvE,CAAmB,CAAA,iBAAA,EAAA,IAAA,CAAA,CACZ,IACP,IAAI,CACJ,CACF;AAEV,SAAC,CAAC,CACE,CACF,CACF,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAvIX,UAAA,CAAA;AATC,IAAA,iBAAiB,CAA6G;AAC7H,QAAA,IAAI,EAAE,2BAA2B;QACjC,YAAY,EAAE,IAAI,GAAG,CAAC;YACpB,CAAC,uCAAuC,EAAE,uBAAuB,CAAC;YAClE,CAAC,kCAAkC,EAAE,kBAAkB,CAAC;YACxD,CAAC,6BAA6B,EAAE,aAAa,CAAC;SAC/C,CAAC;AACF,QAAA,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;CA0ID,EAAA,uBAAA,CAAA,SAAA,EAAA,QAAA,EAAA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement","i18next"],"sources":["src/components/scheduler-editor/nylas-availability-picker/nylas-availability-picker.scss?tag=nylas-availability-picker&encapsulation=shadow","src/components/scheduler-editor/nylas-availability-picker/nylas-availability-picker.tsx"],"sourcesContent":["@use '../../../common/styles/variables' as *;\n\n:host {\n display: block;\n @include default-css-variables;\n width: inherit;\n}\n\n.nylas-availability-picker {\n width: inherit;\n display: flex;\n flex-direction: column;\n margin: 1rem;\n border-radius: var(--nylas-border-radius-2x);\n border: 1px solid var(--nylas-base-200);\n\n .header {\n padding: 1rem;\n border-bottom: 1px solid var(--nylas-base-200);\n\n h3 {\n margin: 0;\n font-size: 16px;\n font-weight: 600;\n line-height: 20px;\n color: var(--nylas-base-900);\n text-align: left;\n }\n\n p {\n margin: 0.25rem 0 0 0;\n font-size: 0.875rem;\n font-weight: 400;\n line-height: 20px;\n color: var(--nylas-base-600);\n text-align: left;\n display: flex;\n align-items: center;\n gap: 4px;\n }\n }\n\n .content {\n padding: 1rem;\n border-radius: var(--nylas-border-radius-2x);\n color: var(--nylas-base-900);\n font-size: 16px;\n font-family: var(--nylas-font-family);\n background: var(--nylas-base-25);\n\n @media #{$small-mobile} {\n font-size: 15px;\n }\n\n .select-timezone {\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-bottom: 1px solid var(--nylas-base-200);\n padding-bottom: 1rem;\n gap: 1rem;\n\n h4 {\n display: flex;\n gap: 0.5rem;\n align-items: center;\n margin: 0;\n font-size: 16px;\n font-weight: 500;\n line-height: 20px;\n\n @media #{$small-mobile} {\n font-size: 15px;\n }\n }\n }\n\n .availability {\n display: flex;\n flex-direction: column;\n gap: 1rem;\n padding: 0 0.5rem;\n margin: 1rem 0;\n\n @media #{$small-mobile} {\n gap: 0.5rem;\n padding: 0;\n }\n\n .availability-day {\n display: grid;\n grid-template-columns: minmax(auto, 65px) 1fr minmax(auto, 40px);\n\n gap: 1rem;\n align-items: baseline;\n\n @media #{$mobile} {\n grid-template-columns: 78px 1fr auto;\n }\n\n @media #{$small-mobile} {\n display: inline-grid;\n gap: 8px;\n grid-template-columns: 60px 1fr auto;\n }\n\n .day {\n display: flex;\n gap: 0.5rem;\n align-items: center;\n\n @media #{$small-mobile} {\n gap: 0.25rem;\n }\n\n input[type='checkbox'] {\n transform: scale(1.3);\n }\n }\n\n .time-ranges {\n span.unavailable {\n height: 48px;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .time-range {\n display: flex;\n gap: 1.5rem;\n justify-content: space-between;\n align-items: baseline;\n\n @media #{$small-mobile} {\n justify-content: unset;\n gap: 0.5rem;\n }\n\n .pickers {\n display: flex;\n gap: 1rem;\n\n @media #{$small-mobile} {\n gap: 0.5rem;\n }\n\n span {\n margin-top: 0.75rem;\n }\n }\n\n &:not(:last-of-type) {\n margin-bottom: 1rem;\n }\n }\n\n .error-message {\n width: 100%;\n padding: 4px 8px;\n background: var(--nylas-error-50);\n color: var(--nylas-error);\n font-size: 12px;\n border-radius: 4px;\n border: 1px solid var(--nylas-error-200);\n margin-top: 8px;\n }\n }\n\n button {\n border: none;\n background: transparent;\n height: 40px;\n cursor: pointer;\n color: var(--nylas-base-800);\n\n &:hover,\n &:active {\n color: var(--nylas-primary);\n }\n }\n }\n }\n }\n}\n\nselect-dropdown {\n width: auto;\n}\n\nselect-dropdown::part(sd_dropdown-button) {\n justify-content: initial;\n}\n","import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { convertTo12HourFormat, convertTo24HourFormat, debug, minutesToTime, timeToMinutes } from '@/utils/utils';\nimport { AttachInternals, Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { DEFAULT_OPEN_HOURS, TIMEZONE_MAP } from '@/common/constants';\nimport { Configuration, ThemeConfig } from '@nylas/core';\nimport i18next from '@/utils/i18n';\nimport { LANGUAGE_CODE } from '@/common/constants';\n\nexport type OpenHours = {\n days: number[];\n start: string;\n end: string;\n timezone: string;\n};\n\nexport type Schedule = {\n SUN: { start: string; end: string }[];\n MON: { start: string; end: string }[];\n TUE: { start: string; end: string }[];\n WED: { start: string; end: string }[];\n THU: { start: string; end: string }[];\n FRI: { start: string; end: string }[];\n SAT: { start: string; end: string }[];\n};\n\n/**\n * The `nylas-availability-picker` component is a form input for selecting availability (open hours).\n * @part nap__header - The header of the availability picker\n * @part nap__select-timezone - The timezone selection container\n * @part nap__select-timezone-button - The timezone selection button\n * @part nap__select-timezone-dropdown-content - The timezone selection dropdown content\n * @part nap__availability - The availability container\n * @part nap__day - The day container\n * @part nap__time-ranges - The time ranges container\n * @part nap__time-range - The time range container\n * @part nap__add-time-range - The add time range button\n * @part nap__time-picker-container - The time picker container\n * @part nap__time-picker-input - The time picker input\n * @part nap__time-picker-times - The time picker times\n */\n@Component({\n tag: 'nylas-availability-picker',\n styleUrl: 'nylas-availability-picker.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasAvailabilityPicker {\n /**\n * The element <nylas-availability-picker> itself.\n */\n @Element() host!: HTMLNylasAvailabilityPickerElement;\n /**\n * @standalone\n * The name of the availability picker.\n */\n @Prop() name: string = 'availability';\n /**\n * @standalone\n * The selected configuration.\n */\n @Prop() selectedConfiguration?: Configuration;\n /**\n * @standalone\n * The open hours to display.\n */\n @Prop() openHours?: OpenHours[];\n /**\n * @standalone\n * The default timezone or preset timezone.\n */\n @Prop() defaultTimezone: string = Intl.DateTimeFormat().resolvedOptions().timeZone;\n /**\n * @standalone\n * Hide the header of the availability picker.\n */\n @Prop() hideHeader: boolean = false;\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: LANGUAGE_CODE;\n /**\n * @standalone\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: ThemeConfig;\n\n /**\n * This event is fired when the selected availability / open hours change.\n * The value is a stringified JSON object with the open hours and timezone.\n ```\n {\n openHours: OpenHours[],\n timezone: string\n }\n ```\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n }>;\n\n /**\n * The element internals.\n */\n @AttachInternals() internals!: ElementInternals;\n @State() schedule = {\n SUN: [],\n MON: [{ start: '09:00am', end: '05:00pm' }],\n TUE: [{ start: '09:00am', end: '05:00pm' }],\n WED: [{ start: '09:00am', end: '05:00pm' }],\n THU: [{ start: '09:00am', end: '05:00pm' }],\n FRI: [{ start: '09:00am', end: '05:00pm' }],\n SAT: [],\n };\n /**\n * The selected timezone state.\n */\n @State() timezone: string = '';\n\n /**\n * The overlapping time ranges state. This is used to display an error message when there are overlapping time ranges.\n */\n @State() overlapDays: { [key: string]: number[] } = {};\n\n /**\n * State for tracking time window validation errors (e.g., start time after end time)\n */\n @State() timeWindowErrors: { [key: string]: string } = {};\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-availability-picker', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('openHours')\n openHoursChanged(newValue: OpenHours[]) {\n // Only process if we have a non-empty array and timezone is already set\n // This prevents processing during initialization and handles null/undefined consistently\n if (newValue && newValue.length > 0 && this.timezone) {\n this.openHoursToSchedule(newValue);\n }\n }\n\n @Watch('selectedConfiguration')\n configChangedHandler(newConfig: Configuration) {\n const defaultOpenHours = newConfig?.availability?.availability_rules?.default_open_hours ?? DEFAULT_OPEN_HOURS;\n // If the name is `availability`, we are setting the default open hours. If the name is `participant-****`, we are setting the participant's custom availability.\n // Set the timezone accordingly.\n const defaultOpenHoursTimezone = newConfig?.event_booking?.timezone || this.defaultTimezone;\n this.timezone = this.name === 'availability' ? defaultOpenHoursTimezone : this.defaultTimezone;\n\n // Process openHours if available, otherwise fall back to defaultOpenHours\n // The openHours watcher will handle openHours changes separately to avoid redundant calls\n if (this.openHours && this.openHours.length > 0) {\n this.openHoursToSchedule(this.openHours);\n } else if (defaultOpenHours) {\n this.openHoursToSchedule(defaultOpenHours);\n }\n }\n\n /**\n * Normalize time format to ensure consistent parsing across languages\n */\n private normalizeTimeFormat(timeStr: string): string {\n // Normalize Spanish AM/PM formats (a.m./p.m.) to English am/pm\n return timeStr.replace(/a\\.?m\\.?/gi, 'am').replace(/p\\.?m\\.?/gi, 'pm');\n }\n\n scheduleChanged(newValue: Schedule, valueChanged: boolean = true) {\n const overlapDays: { [key: string]: number[] } = {};\n Object.keys(newValue).forEach(key => {\n const dayTimeRanges = newValue[key];\n if (dayTimeRanges.length > 0) {\n // Normalize time formats before checking overlaps\n const normalizedTimeRanges = dayTimeRanges.map(range => ({\n start: this.normalizeTimeFormat(range.start),\n end: this.normalizeTimeFormat(range.end),\n }));\n const overlaps = this.getOverlaps(normalizedTimeRanges);\n if (overlaps.length > 0) {\n overlapDays[key] = overlaps;\n }\n }\n });\n this.overlapDays = overlapDays;\n\n // Clean up timeWindowErrors for non-existent time ranges\n this.cleanupTimeWindowErrors(newValue);\n\n this.updateFormValidity();\n\n if (valueChanged) {\n this.valueChanged.emit({\n value: JSON.stringify({\n openHours: this.scheduleToOpenHours(newValue),\n timezone: this.timezone,\n }),\n name: this.name,\n });\n }\n }\n\n /**\n * Clean up timeWindowErrors for time ranges that no longer exist in the schedule\n */\n private cleanupTimeWindowErrors(schedule: Schedule) {\n const newTimeWindowErrors = { ...this.timeWindowErrors };\n let hasChanges = false;\n\n // Get all valid time range keys from current schedule\n const validKeys = new Set<string>();\n Object.keys(schedule).forEach(day => {\n const timeRanges = schedule[day];\n timeRanges.forEach((_, index) => {\n validKeys.add(`${day}:${index}_start`);\n validKeys.add(`${day}:${index}_end`);\n });\n });\n\n // Remove errors for keys that no longer exist\n Object.keys(newTimeWindowErrors).forEach(errorKey => {\n if (!validKeys.has(errorKey)) {\n delete newTimeWindowErrors[errorKey];\n hasChanges = true;\n }\n });\n\n if (hasChanges) {\n this.timeWindowErrors = newTimeWindowErrors;\n }\n }\n\n /**\n * Updates form validity based on both overlap errors and time window errors\n */\n updateFormValidity() {\n const hasOverlapErrors = Object.keys(this.overlapDays).length > 0;\n const hasTimeWindowErrors = Object.keys(this.timeWindowErrors).filter(key => this.timeWindowErrors[key]).length > 0;\n\n if (hasOverlapErrors) {\n const element = this.host.shadowRoot?.getElementById(Object.keys(this.overlapDays)[0]) as HTMLInputElement;\n if (element) {\n debug('nylas-availability-picker', 'The time ranges are overlapping. Overlap: ', this.overlapDays);\n this.isInternalsAvailable && this.internals.setValidity({ customError: true }, 'Overlapping time ranges found', element);\n }\n } else if (hasTimeWindowErrors) {\n const firstErrorKey = Object.keys(this.timeWindowErrors).find(key => this.timeWindowErrors[key]);\n const element = this.host.shadowRoot?.getElementById(firstErrorKey!) as HTMLInputElement;\n const errorMessage = this.timeWindowErrors[firstErrorKey!];\n if (element) {\n this.isInternalsAvailable && this.internals.setValidity({ customError: true }, errorMessage, element);\n }\n } else {\n this.isInternalsAvailable && this.internals.setValidity({ customError: false });\n this.isInternalsAvailable &&\n this.internals.setFormValue(\n JSON.stringify({\n openHours: this.scheduleToOpenHours(this.schedule),\n timezone: this.timezone,\n }),\n this.name,\n );\n }\n }\n\n @Watch('selectedLanguage')\n selectedLanguageChangedHandler(newVal: LANGUAGE_CODE, oldVal: LANGUAGE_CODE) {\n if (newVal === oldVal) return;\n i18next.changeLanguage(newVal);\n }\n\n @Listen('nylasFormDropdownChanged')\n nylasFormDropdownChangedHandler(\n event: CustomEvent<{\n value: string;\n name: string;\n }>,\n ) {\n const { name, value } = event.detail;\n if (name === 'timezone') {\n this.timezone = value;\n const updateValue = {\n openHours: this.scheduleToOpenHours(this.schedule),\n timezone: this.timezone,\n };\n this.isInternalsAvailable && this.internals.setFormValue(JSON.stringify(updateValue), this.name);\n this.valueChanged.emit({\n value: JSON.stringify(updateValue),\n name: this.name,\n });\n }\n }\n\n @Watch('themeConfig')\n themeConfigChangedHandler(newVal: ThemeConfig, oldVal: ThemeConfig) {\n if (newVal === oldVal) return;\n this.applyThemeConfig(newVal);\n }\n\n connectedCallback() {\n debug('nylas-availability-picker', 'connectedCallback');\n }\n\n disconnectedCallback() {\n debug('nylas-availability-picker', 'disconnectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-availability-picker', 'componentWillLoad');\n this.host.setAttribute('name', this.name);\n }\n\n componentDidLoad() {\n debug('nylas-availability-picker', 'componentDidLoad');\n\n if (this.selectedConfiguration) {\n this.configChangedHandler(this.selectedConfiguration);\n } else {\n this.timezone = this.defaultTimezone;\n if (this.openHours && this.openHours.length > 0) {\n this.openHoursToSchedule(this.openHours);\n }\n }\n\n const updateValue = {\n openHours: this.scheduleToOpenHours(this.schedule),\n timezone: this.timezone,\n };\n this.isInternalsAvailable && this.internals.setFormValue(JSON.stringify(updateValue), this.name);\n\n // Set initial form validity\n this.updateFormValidity();\n }\n\n get isInternalsAvailable() {\n return typeof this.internals.setFormValue === 'function';\n }\n\n getOverlaps(timeRanges) {\n // Convert times to minutes and add to the array\n const timeRangesInMinutes = timeRanges.map((range, index) => ({\n start: timeToMinutes(range.start),\n end: timeToMinutes(range.end),\n originalIndex: index,\n }));\n\n // Sort by start time\n timeRangesInMinutes.sort((a, b) => a.start - b.start);\n const overlaps: number[] = [];\n // Check for overlap\n for (let i = 1; i < timeRangesInMinutes.length; i++) {\n if (timeRangesInMinutes[i].start < timeRangesInMinutes[i - 1].end) {\n // Add both overlapping time range indices if they are not already included\n if (!overlaps.includes(timeRangesInMinutes[i].originalIndex)) {\n overlaps.push(timeRangesInMinutes[i].originalIndex);\n }\n if (!overlaps.includes(timeRangesInMinutes[i - 1].originalIndex)) {\n overlaps.push(timeRangesInMinutes[i - 1].originalIndex);\n }\n }\n }\n return overlaps.sort((a, b) => a - b); // Return sorted list of indices\n }\n\n addTimeRange(day) {\n const currentTimeRanges = this.schedule[day];\n\n // Default working hours are from 00:00 to 23:45 for calculation purposes\n const dayStart = 0; // Start of the day in minutes (00:00)\n const dayEnd = 1425; // End of the day in minutes (23:45)\n\n if (currentTimeRanges.length === 0) {\n // If there are no existing time ranges, add one at the start of the day\n this.schedule[day] = [{ start: '09:00am', end: '05:00pm' }]; // Example range\n } else {\n // Convert all time ranges to minutes for comparison\n const timeRangesInMinutes = currentTimeRanges\n .map(range => ({\n start: timeToMinutes(range.start),\n end: timeToMinutes(range.end),\n }))\n .sort((a, b) => a.start - b.start); // Sort by start time\n\n // Attempt to add a new time range at the end of the day\n const lastRangeEnd = timeRangesInMinutes[timeRangesInMinutes.length - 1].end;\n if (lastRangeEnd + 60 <= dayEnd) {\n // There's room at the end of the day\n this.schedule[day].push({\n start: convertTo12HourFormat(minutesToTime(lastRangeEnd)),\n end: convertTo12HourFormat(minutesToTime(lastRangeEnd + 60)),\n });\n } else {\n // No room at the end, look for gaps at the beginning of the day\n let gapFound = false;\n if (timeRangesInMinutes[0].start > dayStart + 60) {\n // There's room for at least a 1-hour meeting at the beginning of the day\n this.schedule[day].push({\n start: convertTo12HourFormat(minutesToTime(dayStart)),\n end: convertTo12HourFormat(minutesToTime(dayStart + 60)),\n });\n gapFound = true;\n }\n\n if (!gapFound) {\n // Search for gaps between scheduled time ranges\n for (let i = 0; i < timeRangesInMinutes.length - 1; i++) {\n const currentEnd = timeRangesInMinutes[i].end;\n const nextStart = timeRangesInMinutes[i + 1].start;\n\n if (nextStart - currentEnd >= 60) {\n // Found a gap\n this.schedule[day].push({\n start: convertTo12HourFormat(minutesToTime(currentEnd)),\n end: convertTo12HourFormat(minutesToTime(currentEnd + 60)),\n });\n break; // Exit the loop after adding a time range\n }\n }\n }\n }\n }\n\n // Sort the updated schedule to maintain order\n this.schedule[day].sort((a, b) => timeToMinutes(a.start) - timeToMinutes(b.start));\n\n this.schedule = { ...this.schedule };\n this.scheduleChanged(this.schedule);\n }\n\n removeTimeRange(day, index) {\n // Clear any time window errors for the removed time range\n const startKey = `${day}:${index}_start`;\n const endKey = `${day}:${index}_end`;\n\n const newTimeWindowErrors = { ...this.timeWindowErrors };\n delete newTimeWindowErrors[startKey];\n delete newTimeWindowErrors[endKey];\n this.timeWindowErrors = newTimeWindowErrors;\n\n this.schedule[day].splice(index, 1);\n this.schedule = { ...this.schedule };\n this.scheduleChanged(this.schedule);\n }\n\n @Listen('timeChange')\n setTime(event: CustomEvent<{ key: string; value: string }>) {\n const { key, value } = event.detail;\n const [dayIndex, timeType] = key.split('_');\n const [day, index] = dayIndex.split(':');\n\n if (timeType === 'start') {\n this.schedule[day][index].start = value;\n } else if (timeType === 'end') {\n this.schedule[day][index].end = value;\n }\n\n // Clear any existing time window error for this specific key\n if (this.timeWindowErrors[key]) {\n const newErrors = { ...this.timeWindowErrors };\n delete newErrors[key];\n this.timeWindowErrors = newErrors;\n }\n\n this.schedule = { ...this.schedule };\n this.scheduleChanged(this.schedule);\n }\n\n @Listen('timeWindowFormError')\n setFormError(event: CustomEvent<{ key: string; message: string }>) {\n const { key, message } = event.detail;\n\n if (message) {\n // Set the error for this specific time input\n this.timeWindowErrors = {\n ...this.timeWindowErrors,\n [key]: message,\n };\n } else {\n // Clear the error for this specific time input\n const newErrors = { ...this.timeWindowErrors };\n delete newErrors[key];\n this.timeWindowErrors = newErrors;\n }\n\n // Update overall form validity\n this.updateFormValidity();\n }\n\n openHoursToSchedule(openHours: OpenHours[]) {\n const newSchedule = {\n SUN: [],\n MON: [],\n TUE: [],\n WED: [],\n THU: [],\n FRI: [],\n SAT: [],\n };\n openHours.forEach(openHour => {\n if (!openHour.days) return;\n openHour.days.forEach(day => {\n const dayKey = this.getDayKey(day);\n const start12hr = this.normalizeTimeFormat(convertTo12HourFormat(openHour.start));\n const end12hr = this.normalizeTimeFormat(convertTo12HourFormat(openHour.end));\n const timeRange = { start: start12hr, end: end12hr };\n\n // Check if the time range already exists for the day\n let timeRangeExists = false;\n if (newSchedule[dayKey]) {\n // Search for an existing time range that matches the current one\n timeRangeExists = newSchedule[dayKey].some(range => range.start === timeRange.start && range.end === timeRange.end);\n }\n\n if (!timeRangeExists) {\n if (newSchedule[dayKey]) {\n newSchedule[dayKey].push(timeRange);\n } else {\n newSchedule[dayKey] = [timeRange];\n }\n }\n });\n });\n\n this.schedule = newSchedule;\n this.scheduleChanged(this.schedule, false);\n }\n\n getDayKey(dayIndex: number): string {\n const days = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'];\n return days[dayIndex];\n }\n\n scheduleToOpenHours(schedule: Schedule): OpenHours[] {\n const dayKeys = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'];\n const openHoursMap: Map<string, { days: number[]; start: string; end: string }> = new Map();\n\n dayKeys.forEach((dayKey, index) => {\n if (schedule[dayKey]) {\n // Check if schedule for the day exists\n schedule[dayKey].forEach(timeRange => {\n const start24hr = convertTo24HourFormat(timeRange.start);\n const end24hr = convertTo24HourFormat(timeRange.end);\n const key = `${start24hr}-${end24hr}`;\n\n if (!openHoursMap.has(key)) {\n openHoursMap.set(key, { days: [index], start: start24hr, end: end24hr });\n } else {\n const entry = openHoursMap.get(key);\n if (entry) {\n entry.days.push(index);\n openHoursMap.set(key, entry);\n }\n }\n });\n }\n });\n\n const selectedOpenHours: OpenHours[] = [];\n openHoursMap.forEach((value, _key) => {\n selectedOpenHours.push({\n days: value.days,\n start: value.start,\n end: value.end,\n timezone: this.timezone,\n });\n });\n\n return selectedOpenHours;\n }\n\n applyThemeConfig(themeConfig?: ThemeConfig) {\n if (themeConfig) {\n for (const [key, value] of Object.entries(themeConfig)) {\n this.host.style.setProperty(`${key}`, value);\n }\n }\n }\n\n @RegisterComponent<NylasAvailabilityPicker, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-availability-picker',\n stateToProps: new Map([\n ['schedulerConfig.selectedConfiguration', 'selectedConfiguration'],\n ['schedulerConfig.selectedLanguage', 'selectedLanguage'],\n ['schedulerConfig.themeConfig', 'themeConfig'],\n ]),\n fireRegisterEvent: true,\n })\n render() {\n const timezoneOptions = Object.keys(TIMEZONE_MAP).map(key => ({\n label: TIMEZONE_MAP[key],\n value: key,\n }));\n const selectedTimezoneOption = timezoneOptions.find(i => i.value === this.timezone);\n\n return (\n <Host>\n <div class=\"nylas-availability-picker\" part=\"nap\">\n {!this.hideHeader && (\n <div class=\"header\" part=\"nap__header\">\n <h3>{i18next.t('nylasAvailabilityPicker.headerTitle')}</h3>\n <p>\n {i18next.t('nylasAvailabilityPicker.headerSubTitle')}\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">{i18next.t('nylasAvailabilityPicker.tooltip.desc')}</span>\n </tooltip-component>\n </p>\n </div>\n )}\n <div class=\"content\">\n <div class=\"select-timezone\" part=\"nap__select-timezone\">\n <h4 class=\"sub-header\">{i18next.t('nylasAvailabilityPicker.selectTimezone')}</h4>\n {selectedTimezoneOption?.label && (\n <select-dropdown\n name=\"timezone\"\n searchPlaceholder={i18next.t('search')}\n exportparts=\"sd_dropdown: nap__timezone-container, sd_dropdown-button: nap__timezone-button, sd_dropdown-content: nap__timezone-dropdown-content\"\n options={timezoneOptions}\n defaultSelectedOption={selectedTimezoneOption}\n themeConfig={this.themeConfig}\n >\n <span slot=\"select-icon\">\n <globe-icon width=\"20\" height=\"20\" />\n </span>\n </select-dropdown>\n )}\n </div>\n <div class=\"availability\" part=\"nap__availability\">\n {Object.keys(this.schedule).map(key => {\n const day = key;\n const timeRanges = this.schedule[key] as { start: string; end: string }[];\n return (\n <div class=\"availability-day\">\n <div class=\"day\" part=\"nap__day\">\n <input\n type=\"checkbox\"\n name={day}\n id={day}\n checked={timeRanges.length > 0}\n onClick={() => {\n if (timeRanges.length > 0) {\n // Clear any time window errors for this day when toggling off\n const newTimeWindowErrors = { ...this.timeWindowErrors };\n Object.keys(newTimeWindowErrors).forEach(errorKey => {\n if (errorKey.startsWith(`${day}:`)) {\n delete newTimeWindowErrors[errorKey];\n }\n });\n this.timeWindowErrors = newTimeWindowErrors;\n\n this.schedule[day] = [];\n } else {\n this.schedule[day] = [{ start: '09:00am', end: '05:00pm' }];\n }\n this.schedule = { ...this.schedule };\n this.scheduleChanged(this.schedule);\n }}\n />\n <label htmlFor={day} aria-label=\"Select day\">\n {i18next.t(`nylasAvailabilityPicker.days.${day}`)}\n </label>\n </div>\n <div class=\"time-ranges\" part=\"nap__time-ranges\">\n {timeRanges.length ? null : <span class=\"unavailable\">{i18next.t('nylasAvailabilityPicker.unavailable')}</span>}\n {timeRanges.length > 0 &&\n timeRanges.map((timeRange, timeRangeIndex) => {\n const startKey = `${key}:${timeRangeIndex}_start`;\n const endKey = `${key}:${timeRangeIndex}_end`;\n return (\n <div class=\"time-range\" part=\"nap__time-range\">\n <div class=\"pickers\">\n <nylas-time-window-picker\n id={startKey}\n hasError={this.overlapDays[day]?.includes(timeRangeIndex) || !!this.timeWindowErrors[startKey]}\n time={timeRange.start}\n name={startKey}\n key={startKey}\n language={this.selectedLanguage}\n themeConfig={this.themeConfig}\n exportparts=\"time-picker: nap__time-picker-container, time-input: nap__time-picker-input, times: nap__time-picker-times\"\n />\n <span> - </span>\n <nylas-time-window-picker\n id={endKey}\n hasError={this.overlapDays[day]?.includes(timeRangeIndex) || !!this.timeWindowErrors[endKey]}\n time={timeRange.end}\n name={endKey}\n key={endKey}\n minimumStartTime={timeRange.start}\n language={this.selectedLanguage}\n themeConfig={this.themeConfig}\n exportparts=\"time-picker: nap__time-picker-container, time-input: nap__time-picker-input, times: nap__time-picker-times\"\n />\n </div>\n <button onClick={() => this.removeTimeRange(day, timeRangeIndex)}>\n <close-icon />\n </button>\n </div>\n );\n })}\n {(this.overlapDays[day] || Object.keys(this.timeWindowErrors).find(key => key.startsWith(`${day}:`) && this.timeWindowErrors[key])) && (\n <div class=\"error-message\" part=\"nap__error-message\">\n {this.overlapDays[day] ? i18next.t('nylasAvailabilityPicker.errors.overlappingTimeRanges') : ''}\n {!this.overlapDays[day] && Object.keys(this.timeWindowErrors).find(key => key.startsWith(`${day}:`) && this.timeWindowErrors[key])\n ? this.timeWindowErrors[Object.keys(this.timeWindowErrors).find(key => key.startsWith(`${day}:`) && this.timeWindowErrors[key])!]\n : ''}\n </div>\n )}\n </div>\n <div>\n {timeRanges.length > 0 ? (\n <button onClick={() => this.addTimeRange(day)} part=\"nap__add-time-range\">\n <add-circle-icon />\n </button>\n ) : null}\n </div>\n </div>\n );\n })}\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"p-D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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement","i18next"],"sources":["src/components/scheduler-editor/nylas-availability-picker/nylas-availability-picker.scss?tag=nylas-availability-picker&encapsulation=shadow","src/components/scheduler-editor/nylas-availability-picker/nylas-availability-picker.tsx"],"sourcesContent":["@use '../../../common/styles/variables' as *;\n\n:host {\n display: block;\n @include default-css-variables;\n width: inherit;\n}\n\n.nylas-availability-picker {\n width: inherit;\n display: flex;\n flex-direction: column;\n margin: 1rem;\n border-radius: var(--nylas-border-radius-2x);\n border: 1px solid var(--nylas-base-200);\n\n .header {\n padding: 1rem;\n border-bottom: 1px solid var(--nylas-base-200);\n\n h3 {\n margin: 0;\n font-size: 16px;\n font-weight: 600;\n line-height: 20px;\n color: var(--nylas-base-900);\n text-align: left;\n }\n\n p {\n margin: 0.25rem 0 0 0;\n font-size: 0.875rem;\n font-weight: 400;\n line-height: 20px;\n color: var(--nylas-base-600);\n text-align: left;\n display: flex;\n align-items: center;\n gap: 4px;\n }\n }\n\n .content {\n padding: 1rem;\n border-radius: var(--nylas-border-radius-2x);\n color: var(--nylas-base-900);\n font-size: 16px;\n font-family: var(--nylas-font-family);\n background: var(--nylas-base-25);\n\n @media #{$small-mobile} {\n font-size: 15px;\n }\n\n .select-timezone {\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-bottom: 1px solid var(--nylas-base-200);\n padding-bottom: 1rem;\n gap: 1rem;\n\n h4 {\n display: flex;\n gap: 0.5rem;\n align-items: center;\n margin: 0;\n font-size: 16px;\n font-weight: 500;\n line-height: 20px;\n\n @media #{$small-mobile} {\n font-size: 15px;\n }\n }\n }\n\n .availability {\n display: flex;\n flex-direction: column;\n gap: 1rem;\n padding: 0 0.5rem;\n margin: 1rem 0;\n\n @media #{$small-mobile} {\n gap: 0.5rem;\n padding: 0;\n }\n\n .availability-day {\n display: grid;\n grid-template-columns: minmax(auto, 65px) 1fr minmax(auto, 40px);\n\n gap: 1rem;\n align-items: baseline;\n\n @media #{$mobile} {\n grid-template-columns: 78px 1fr auto;\n }\n\n @media #{$small-mobile} {\n display: inline-grid;\n gap: 8px;\n grid-template-columns: 60px 1fr auto;\n }\n\n .day {\n display: flex;\n gap: 0.5rem;\n align-items: center;\n\n @media #{$small-mobile} {\n gap: 0.25rem;\n }\n\n input[type='checkbox'] {\n transform: scale(1.3);\n }\n }\n\n .time-ranges {\n span.unavailable {\n height: 48px;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .time-range {\n display: flex;\n gap: 1.5rem;\n justify-content: space-between;\n align-items: baseline;\n\n @media #{$small-mobile} {\n justify-content: unset;\n gap: 0.5rem;\n }\n\n .pickers {\n display: flex;\n gap: 1rem;\n\n @media #{$small-mobile} {\n gap: 0.5rem;\n }\n\n span {\n margin-top: 0.75rem;\n }\n }\n\n &:not(:last-of-type) {\n margin-bottom: 1rem;\n }\n }\n\n .error-message {\n width: 100%;\n padding: 4px 8px;\n background: var(--nylas-error-50);\n color: var(--nylas-error);\n font-size: 12px;\n border-radius: 4px;\n border: 1px solid var(--nylas-error-200);\n margin-top: 8px;\n }\n }\n\n button {\n border: none;\n background: transparent;\n height: 40px;\n cursor: pointer;\n color: var(--nylas-base-800);\n\n &:hover,\n &:active {\n color: var(--nylas-primary);\n }\n }\n }\n }\n }\n}\n\nselect-dropdown {\n width: auto;\n}\n\nselect-dropdown::part(sd_dropdown-button) {\n justify-content: initial;\n}\n","import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { convertTo12HourFormat, convertTo24HourFormat, debug, minutesToTime, timeToMinutes } from '@/utils/utils';\nimport { AttachInternals, Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { DEFAULT_OPEN_HOURS, TIMEZONE_MAP } from '@/common/constants';\nimport { Configuration, ThemeConfig } from '@nylas/core';\nimport i18next from '@/utils/i18n';\nimport { LANGUAGE_CODE } from '@/common/constants';\n\nexport type OpenHours = {\n days: number[];\n start: string;\n end: string;\n timezone: string;\n};\n\nexport type Schedule = {\n SUN: { start: string; end: string }[];\n MON: { start: string; end: string }[];\n TUE: { start: string; end: string }[];\n WED: { start: string; end: string }[];\n THU: { start: string; end: string }[];\n FRI: { start: string; end: string }[];\n SAT: { start: string; end: string }[];\n};\n\n/**\n * The `nylas-availability-picker` component is a form input for selecting availability (open hours).\n * @part nap__header - The header of the availability picker\n * @part nap__select-timezone - The timezone selection container\n * @part nap__select-timezone-button - The timezone selection button\n * @part nap__select-timezone-dropdown-content - The timezone selection dropdown content\n * @part nap__availability - The availability container\n * @part nap__day - The day container\n * @part nap__time-ranges - The time ranges container\n * @part nap__time-range - The time range container\n * @part nap__add-time-range - The add time range button\n * @part nap__time-picker-container - The time picker container\n * @part nap__time-picker-input - The time picker input\n * @part nap__time-picker-times - The time picker times\n */\n@Component({\n tag: 'nylas-availability-picker',\n styleUrl: 'nylas-availability-picker.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasAvailabilityPicker {\n /**\n * The element <nylas-availability-picker> itself.\n */\n @Element() host!: HTMLNylasAvailabilityPickerElement;\n /**\n * @standalone\n * The name of the availability picker.\n */\n @Prop() name: string = 'availability';\n /**\n * @standalone\n * The selected configuration.\n */\n @Prop() selectedConfiguration?: Configuration;\n /**\n * @standalone\n * The open hours to display.\n */\n @Prop() openHours?: OpenHours[];\n /**\n * @standalone\n * The default timezone or preset timezone.\n */\n @Prop() defaultTimezone: string = Intl.DateTimeFormat().resolvedOptions().timeZone;\n /**\n * @standalone\n * Hide the header of the availability picker.\n */\n @Prop() hideHeader: boolean = false;\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: LANGUAGE_CODE;\n /**\n * @standalone\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: ThemeConfig;\n\n /**\n * This event is fired when the selected availability / open hours change.\n * The value is a stringified JSON object with the open hours and timezone.\n ```\n {\n openHours: OpenHours[],\n timezone: string\n }\n ```\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n }>;\n\n /**\n * The element internals.\n */\n @AttachInternals() internals!: ElementInternals;\n @State() schedule = {\n SUN: [],\n MON: [{ start: '09:00am', end: '05:00pm' }],\n TUE: [{ start: '09:00am', end: '05:00pm' }],\n WED: [{ start: '09:00am', end: '05:00pm' }],\n THU: [{ start: '09:00am', end: '05:00pm' }],\n FRI: [{ start: '09:00am', end: '05:00pm' }],\n SAT: [],\n };\n /**\n * The selected timezone state.\n */\n @State() timezone: string = '';\n\n /**\n * The overlapping time ranges state. This is used to display an error message when there are overlapping time ranges.\n */\n @State() overlapDays: { [key: string]: number[] } = {};\n\n /**\n * State for tracking time window validation errors (e.g., start time after end time)\n */\n @State() timeWindowErrors: { [key: string]: string } = {};\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-availability-picker', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('openHours')\n openHoursChanged(newValue: OpenHours[]) {\n // Only process if we have a non-empty array and timezone is already set\n // This prevents processing during initialization and handles null/undefined consistently\n if (newValue && newValue.length > 0 && this.timezone) {\n this.openHoursToSchedule(newValue);\n }\n }\n\n @Watch('selectedConfiguration')\n configChangedHandler(newConfig: Configuration) {\n const defaultOpenHours = newConfig?.availability?.availability_rules?.default_open_hours ?? DEFAULT_OPEN_HOURS;\n // If the name is `availability`, we are setting the default open hours. If the name is `participant-****`, we are setting the participant's custom availability.\n // Set the timezone accordingly.\n const defaultOpenHoursTimezone = newConfig?.event_booking?.timezone || this.defaultTimezone;\n this.timezone = this.name === 'availability' ? defaultOpenHoursTimezone : this.defaultTimezone;\n\n // Process openHours if available, otherwise fall back to defaultOpenHours\n // The openHours watcher will handle openHours changes separately to avoid redundant calls\n if (this.openHours && this.openHours.length > 0) {\n this.openHoursToSchedule(this.openHours);\n } else if (defaultOpenHours) {\n this.openHoursToSchedule(defaultOpenHours);\n }\n }\n\n /**\n * Normalize time format to ensure consistent parsing across languages\n */\n private normalizeTimeFormat(timeStr: string): string {\n // Normalize Spanish AM/PM formats (a.m./p.m.) to English am/pm\n return timeStr.replace(/a\\.?m\\.?/gi, 'am').replace(/p\\.?m\\.?/gi, 'pm');\n }\n\n scheduleChanged(newValue: Schedule, valueChanged: boolean = true) {\n const overlapDays: { [key: string]: number[] } = {};\n Object.keys(newValue).forEach(key => {\n const dayTimeRanges = newValue[key];\n if (dayTimeRanges.length > 0) {\n // Normalize time formats before checking overlaps\n const normalizedTimeRanges = dayTimeRanges.map(range => ({\n start: this.normalizeTimeFormat(range.start),\n end: this.normalizeTimeFormat(range.end),\n }));\n const overlaps = this.getOverlaps(normalizedTimeRanges);\n if (overlaps.length > 0) {\n overlapDays[key] = overlaps;\n }\n }\n });\n this.overlapDays = overlapDays;\n\n // Clean up timeWindowErrors for non-existent time ranges\n this.cleanupTimeWindowErrors(newValue);\n\n this.updateFormValidity();\n\n if (valueChanged) {\n this.valueChanged.emit({\n value: JSON.stringify({\n openHours: this.scheduleToOpenHours(newValue),\n timezone: this.timezone,\n }),\n name: this.name,\n });\n }\n }\n\n /**\n * Clean up timeWindowErrors for time ranges that no longer exist in the schedule\n */\n private cleanupTimeWindowErrors(schedule: Schedule) {\n const newTimeWindowErrors = { ...this.timeWindowErrors };\n let hasChanges = false;\n\n // Get all valid time range keys from current schedule\n const validKeys = new Set<string>();\n Object.keys(schedule).forEach(day => {\n const timeRanges = schedule[day];\n timeRanges.forEach((_, index) => {\n validKeys.add(`${day}:${index}_start`);\n validKeys.add(`${day}:${index}_end`);\n });\n });\n\n // Remove errors for keys that no longer exist\n Object.keys(newTimeWindowErrors).forEach(errorKey => {\n if (!validKeys.has(errorKey)) {\n delete newTimeWindowErrors[errorKey];\n hasChanges = true;\n }\n });\n\n if (hasChanges) {\n this.timeWindowErrors = newTimeWindowErrors;\n }\n }\n\n /**\n * Updates form validity based on both overlap errors and time window errors\n */\n updateFormValidity() {\n const hasOverlapErrors = Object.keys(this.overlapDays).length > 0;\n const hasTimeWindowErrors = Object.keys(this.timeWindowErrors).filter(key => this.timeWindowErrors[key]).length > 0;\n\n if (hasOverlapErrors) {\n const element = this.host.shadowRoot?.getElementById(Object.keys(this.overlapDays)[0]) as HTMLInputElement;\n if (element) {\n debug('nylas-availability-picker', 'The time ranges are overlapping. Overlap: ', this.overlapDays);\n this.isInternalsAvailable && this.internals.setValidity({ customError: true }, 'Overlapping time ranges found', element);\n }\n } else if (hasTimeWindowErrors) {\n const firstErrorKey = Object.keys(this.timeWindowErrors).find(key => this.timeWindowErrors[key]);\n const element = this.host.shadowRoot?.getElementById(firstErrorKey!) as HTMLInputElement;\n const errorMessage = this.timeWindowErrors[firstErrorKey!];\n if (element) {\n this.isInternalsAvailable && this.internals.setValidity({ customError: true }, errorMessage, element);\n }\n } else {\n this.isInternalsAvailable && this.internals.setValidity({ customError: false });\n this.isInternalsAvailable &&\n this.internals.setFormValue(\n JSON.stringify({\n openHours: this.scheduleToOpenHours(this.schedule),\n timezone: this.timezone,\n }),\n this.name,\n );\n }\n }\n\n @Watch('selectedLanguage')\n selectedLanguageChangedHandler(newVal: LANGUAGE_CODE, oldVal: LANGUAGE_CODE) {\n if (newVal === oldVal) return;\n i18next.changeLanguage(newVal);\n }\n\n @Listen('nylasFormDropdownChanged')\n nylasFormDropdownChangedHandler(\n event: CustomEvent<{\n value: string;\n name: string;\n }>,\n ) {\n const { name, value } = event.detail;\n if (name === 'timezone') {\n this.timezone = value;\n const updateValue = {\n openHours: this.scheduleToOpenHours(this.schedule),\n timezone: this.timezone,\n };\n this.isInternalsAvailable && this.internals.setFormValue(JSON.stringify(updateValue), this.name);\n this.valueChanged.emit({\n value: JSON.stringify(updateValue),\n name: this.name,\n });\n }\n }\n\n @Watch('themeConfig')\n themeConfigChangedHandler(newVal: ThemeConfig, oldVal: ThemeConfig) {\n if (newVal === oldVal) return;\n this.applyThemeConfig(newVal);\n }\n\n connectedCallback() {\n debug('nylas-availability-picker', 'connectedCallback');\n }\n\n disconnectedCallback() {\n debug('nylas-availability-picker', 'disconnectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-availability-picker', 'componentWillLoad');\n this.host.setAttribute('name', this.name);\n }\n\n componentDidLoad() {\n debug('nylas-availability-picker', 'componentDidLoad');\n\n if (this.selectedConfiguration) {\n this.configChangedHandler(this.selectedConfiguration);\n } else {\n this.timezone = this.defaultTimezone;\n if (this.openHours && this.openHours.length > 0) {\n this.openHoursToSchedule(this.openHours);\n }\n }\n\n const updateValue = {\n openHours: this.scheduleToOpenHours(this.schedule),\n timezone: this.timezone,\n };\n this.isInternalsAvailable && this.internals.setFormValue(JSON.stringify(updateValue), this.name);\n\n // Set initial form validity\n this.updateFormValidity();\n }\n\n get isInternalsAvailable() {\n return typeof this.internals.setFormValue === 'function';\n }\n\n getOverlaps(timeRanges) {\n // Convert times to minutes and add to the array\n const timeRangesInMinutes = timeRanges.map((range, index) => ({\n start: timeToMinutes(range.start),\n end: timeToMinutes(range.end),\n originalIndex: index,\n }));\n\n // Sort by start time\n timeRangesInMinutes.sort((a, b) => a.start - b.start);\n const overlaps: number[] = [];\n // Check for overlap\n for (let i = 1; i < timeRangesInMinutes.length; i++) {\n if (timeRangesInMinutes[i].start < timeRangesInMinutes[i - 1].end) {\n // Add both overlapping time range indices if they are not already included\n if (!overlaps.includes(timeRangesInMinutes[i].originalIndex)) {\n overlaps.push(timeRangesInMinutes[i].originalIndex);\n }\n if (!overlaps.includes(timeRangesInMinutes[i - 1].originalIndex)) {\n overlaps.push(timeRangesInMinutes[i - 1].originalIndex);\n }\n }\n }\n return overlaps.sort((a, b) => a - b); // Return sorted list of indices\n }\n\n addTimeRange(day) {\n const currentTimeRanges = this.schedule[day];\n\n // Default working hours are from 00:00 to 23:45 for calculation purposes\n const dayStart = 0; // Start of the day in minutes (00:00)\n const dayEnd = 1425; // End of the day in minutes (23:45)\n\n if (currentTimeRanges.length === 0) {\n // If there are no existing time ranges, add one at the start of the day\n this.schedule[day] = [{ start: '09:00am', end: '05:00pm' }]; // Example range\n } else {\n // Convert all time ranges to minutes for comparison\n const timeRangesInMinutes = currentTimeRanges\n .map(range => ({\n start: timeToMinutes(range.start),\n end: timeToMinutes(range.end),\n }))\n .sort((a, b) => a.start - b.start); // Sort by start time\n\n // Attempt to add a new time range at the end of the day\n const lastRangeEnd = timeRangesInMinutes[timeRangesInMinutes.length - 1].end;\n if (lastRangeEnd + 60 <= dayEnd) {\n // There's room at the end of the day\n this.schedule[day].push({\n start: convertTo12HourFormat(minutesToTime(lastRangeEnd)),\n end: convertTo12HourFormat(minutesToTime(lastRangeEnd + 60)),\n });\n } else {\n // No room at the end, look for gaps at the beginning of the day\n let gapFound = false;\n if (timeRangesInMinutes[0].start > dayStart + 60) {\n // There's room for at least a 1-hour meeting at the beginning of the day\n this.schedule[day].push({\n start: convertTo12HourFormat(minutesToTime(dayStart)),\n end: convertTo12HourFormat(minutesToTime(dayStart + 60)),\n });\n gapFound = true;\n }\n\n if (!gapFound) {\n // Search for gaps between scheduled time ranges\n for (let i = 0; i < timeRangesInMinutes.length - 1; i++) {\n const currentEnd = timeRangesInMinutes[i].end;\n const nextStart = timeRangesInMinutes[i + 1].start;\n\n if (nextStart - currentEnd >= 60) {\n // Found a gap\n this.schedule[day].push({\n start: convertTo12HourFormat(minutesToTime(currentEnd)),\n end: convertTo12HourFormat(minutesToTime(currentEnd + 60)),\n });\n break; // Exit the loop after adding a time range\n }\n }\n }\n }\n }\n\n // Sort the updated schedule to maintain order\n this.schedule[day].sort((a, b) => timeToMinutes(a.start) - timeToMinutes(b.start));\n\n this.schedule = { ...this.schedule };\n this.scheduleChanged(this.schedule);\n }\n\n removeTimeRange(day, index) {\n // Clear any time window errors for the removed time range\n const startKey = `${day}:${index}_start`;\n const endKey = `${day}:${index}_end`;\n\n const newTimeWindowErrors = { ...this.timeWindowErrors };\n delete newTimeWindowErrors[startKey];\n delete newTimeWindowErrors[endKey];\n this.timeWindowErrors = newTimeWindowErrors;\n\n this.schedule[day].splice(index, 1);\n this.schedule = { ...this.schedule };\n this.scheduleChanged(this.schedule);\n }\n\n @Listen('timeChange')\n setTime(event: CustomEvent<{ key: string; value: string }>) {\n const { key, value } = event.detail;\n const [dayIndex, timeType] = key.split('_');\n const [day, index] = dayIndex.split(':');\n\n if (timeType === 'start') {\n this.schedule[day][index].start = value;\n } else if (timeType === 'end') {\n this.schedule[day][index].end = value;\n }\n\n // Clear any existing time window error for this specific key\n if (this.timeWindowErrors[key]) {\n const newErrors = { ...this.timeWindowErrors };\n delete newErrors[key];\n this.timeWindowErrors = newErrors;\n }\n\n this.schedule = { ...this.schedule };\n this.scheduleChanged(this.schedule);\n }\n\n @Listen('timeWindowFormError')\n setFormError(event: CustomEvent<{ key: string; message: string }>) {\n const { key, message } = event.detail;\n\n if (message) {\n // Set the error for this specific time input\n this.timeWindowErrors = {\n ...this.timeWindowErrors,\n [key]: message,\n };\n } else {\n // Clear the error for this specific time input\n const newErrors = { ...this.timeWindowErrors };\n delete newErrors[key];\n this.timeWindowErrors = newErrors;\n }\n\n // Update overall form validity\n this.updateFormValidity();\n }\n\n openHoursToSchedule(openHours: OpenHours[]) {\n const newSchedule = {\n SUN: [],\n MON: [],\n TUE: [],\n WED: [],\n THU: [],\n FRI: [],\n SAT: [],\n };\n openHours.forEach(openHour => {\n if (!openHour.days) return;\n openHour.days.forEach(day => {\n const dayKey = this.getDayKey(day);\n const start12hr = this.normalizeTimeFormat(convertTo12HourFormat(openHour.start));\n const end12hr = this.normalizeTimeFormat(convertTo12HourFormat(openHour.end));\n const timeRange = { start: start12hr, end: end12hr };\n\n // Check if the time range already exists for the day\n let timeRangeExists = false;\n if (newSchedule[dayKey]) {\n // Search for an existing time range that matches the current one\n timeRangeExists = newSchedule[dayKey].some(range => range.start === timeRange.start && range.end === timeRange.end);\n }\n\n if (!timeRangeExists) {\n if (newSchedule[dayKey]) {\n newSchedule[dayKey].push(timeRange);\n } else {\n newSchedule[dayKey] = [timeRange];\n }\n }\n });\n });\n\n this.schedule = newSchedule;\n this.scheduleChanged(this.schedule, false);\n }\n\n getDayKey(dayIndex: number): string {\n const days = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'];\n return days[dayIndex];\n }\n\n scheduleToOpenHours(schedule: Schedule): OpenHours[] {\n const dayKeys = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'];\n const openHoursMap: Map<string, { days: number[]; start: string; end: string }> = new Map();\n\n dayKeys.forEach((dayKey, index) => {\n if (schedule[dayKey]) {\n // Check if schedule for the day exists\n schedule[dayKey].forEach(timeRange => {\n const start24hr = convertTo24HourFormat(timeRange.start);\n const end24hr = convertTo24HourFormat(timeRange.end);\n const key = `${start24hr}-${end24hr}`;\n\n if (!openHoursMap.has(key)) {\n openHoursMap.set(key, { days: [index], start: start24hr, end: end24hr });\n } else {\n const entry = openHoursMap.get(key);\n if (entry) {\n entry.days.push(index);\n openHoursMap.set(key, entry);\n }\n }\n });\n }\n });\n\n const selectedOpenHours: OpenHours[] = [];\n openHoursMap.forEach((value, _key) => {\n selectedOpenHours.push({\n days: value.days,\n start: value.start,\n end: value.end,\n timezone: this.timezone,\n });\n });\n\n return selectedOpenHours;\n }\n\n applyThemeConfig(themeConfig?: ThemeConfig) {\n if (themeConfig) {\n for (const [key, value] of Object.entries(themeConfig)) {\n this.host.style.setProperty(`${key}`, value);\n }\n }\n }\n\n @RegisterComponent<NylasAvailabilityPicker, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-availability-picker',\n stateToProps: new Map([\n ['schedulerConfig.selectedConfiguration', 'selectedConfiguration'],\n ['schedulerConfig.selectedLanguage', 'selectedLanguage'],\n ['schedulerConfig.themeConfig', 'themeConfig'],\n ]),\n fireRegisterEvent: true,\n })\n render() {\n const timezoneOptions = Object.keys(TIMEZONE_MAP).map(key => ({\n label: TIMEZONE_MAP[key],\n value: key,\n }));\n const selectedTimezoneOption = timezoneOptions.find(i => i.value === this.timezone);\n\n return (\n <Host>\n <div class=\"nylas-availability-picker\" part=\"nap\">\n {!this.hideHeader && (\n <div class=\"header\" part=\"nap__header\">\n <h3>{i18next.t('nylasAvailabilityPicker.headerTitle')}</h3>\n <p>\n {i18next.t('nylasAvailabilityPicker.headerSubTitle')}\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">{i18next.t('nylasAvailabilityPicker.tooltip.desc')}</span>\n </tooltip-component>\n </p>\n </div>\n )}\n <div class=\"content\">\n <div class=\"select-timezone\" part=\"nap__select-timezone\">\n <h4 class=\"sub-header\">{i18next.t('nylasAvailabilityPicker.selectTimezone')}</h4>\n {selectedTimezoneOption?.label && (\n <select-dropdown\n name=\"timezone\"\n searchPlaceholder={i18next.t('search')}\n exportparts=\"sd_dropdown: nap__timezone-container, sd_dropdown-button: nap__timezone-button, sd_dropdown-content: nap__timezone-dropdown-content\"\n options={timezoneOptions}\n defaultSelectedOption={selectedTimezoneOption}\n themeConfig={this.themeConfig}\n >\n <span slot=\"select-icon\">\n <globe-icon width=\"20\" height=\"20\" />\n </span>\n </select-dropdown>\n )}\n </div>\n <div class=\"availability\" part=\"nap__availability\">\n {Object.keys(this.schedule).map(key => {\n const day = key;\n const timeRanges = this.schedule[key] as { start: string; end: string }[];\n return (\n <div class=\"availability-day\">\n <div class=\"day\" part=\"nap__day\">\n <input\n type=\"checkbox\"\n name={day}\n id={day}\n checked={timeRanges.length > 0}\n onClick={() => {\n if (timeRanges.length > 0) {\n // Clear any time window errors for this day when toggling off\n const newTimeWindowErrors = { ...this.timeWindowErrors };\n Object.keys(newTimeWindowErrors).forEach(errorKey => {\n if (errorKey.startsWith(`${day}:`)) {\n delete newTimeWindowErrors[errorKey];\n }\n });\n this.timeWindowErrors = newTimeWindowErrors;\n\n this.schedule[day] = [];\n } else {\n this.schedule[day] = [{ start: '09:00am', end: '05:00pm' }];\n }\n this.schedule = { ...this.schedule };\n this.scheduleChanged(this.schedule);\n }}\n />\n <label htmlFor={day} aria-label=\"Select day\">\n {i18next.t(`nylasAvailabilityPicker.days.${day}`)}\n </label>\n </div>\n <div class=\"time-ranges\" part=\"nap__time-ranges\">\n {timeRanges.length ? null : <span class=\"unavailable\">{i18next.t('nylasAvailabilityPicker.unavailable')}</span>}\n {timeRanges.length > 0 &&\n timeRanges.map((timeRange, timeRangeIndex) => {\n const startKey = `${key}:${timeRangeIndex}_start`;\n const endKey = `${key}:${timeRangeIndex}_end`;\n return (\n <div class=\"time-range\" part=\"nap__time-range\">\n <div class=\"pickers\">\n <nylas-time-window-picker\n id={startKey}\n hasError={this.overlapDays[day]?.includes(timeRangeIndex) || !!this.timeWindowErrors[startKey]}\n time={timeRange.start}\n name={startKey}\n key={startKey}\n language={this.selectedLanguage}\n themeConfig={this.themeConfig}\n exportparts=\"time-picker: nap__time-picker-container, time-input: nap__time-picker-input, times: nap__time-picker-times\"\n />\n <span> - </span>\n <nylas-time-window-picker\n id={endKey}\n hasError={this.overlapDays[day]?.includes(timeRangeIndex) || !!this.timeWindowErrors[endKey]}\n time={timeRange.end}\n name={endKey}\n key={endKey}\n minimumStartTime={timeRange.start}\n language={this.selectedLanguage}\n themeConfig={this.themeConfig}\n exportparts=\"time-picker: nap__time-picker-container, time-input: nap__time-picker-input, times: nap__time-picker-times\"\n />\n </div>\n <button onClick={() => this.removeTimeRange(day, timeRangeIndex)}>\n <close-icon />\n </button>\n </div>\n );\n })}\n {(this.overlapDays[day] || Object.keys(this.timeWindowErrors).find(key => key.startsWith(`${day}:`) && this.timeWindowErrors[key])) && (\n <div class=\"error-message\" part=\"nap__error-message\">\n {this.overlapDays[day] ? i18next.t('nylasAvailabilityPicker.errors.overlappingTimeRanges') : ''}\n {!this.overlapDays[day] && Object.keys(this.timeWindowErrors).find(key => key.startsWith(`${day}:`) && this.timeWindowErrors[key])\n ? this.timeWindowErrors[Object.keys(this.timeWindowErrors).find(key => key.startsWith(`${day}:`) && this.timeWindowErrors[key])!]\n : ''}\n </div>\n )}\n </div>\n <div>\n {timeRanges.length > 0 ? (\n <button onClick={() => this.addTimeRange(day)} part=\"nap__add-time-range\">\n <add-circle-icon />\n </button>\n ) : null}\n </div>\n </div>\n );\n })}\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, e as createEvent, h } from './p-Bht9ktsW.js';
|
|
2
|
-
import { s as sanitize } from './p-
|
|
2
|
+
import { s as sanitize } from './p-BkzMJ4pV.js';
|
|
3
3
|
|
|
4
4
|
const inputComponentCss = ":host{display:block;height:auto;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:\"Inter\", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;width:100%}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%;flex-direction:column;gap:4px;font-family:var(--nylas-font-family);font-size:16px;color:var(--nylas-base-800)}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}label p{margin:0}label .error{color:var(--nylas-error)}.input_wrapper{display:flex;align-items:center;gap:1rem}input[type=text],input[type=number],input[type=email],input[type=phone_number]{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%;width:-moz-available;width:-webkit-fill-available}input[type=text]:focus,input[type=number]:focus,input[type=email]:focus,input[type=phone_number]:focus{outline-color:var(--nylas-primary)}input[type=text].error,input[type=number].error,input[type=email].error,input[type=phone_number].error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}input[type=text].error::placeholder,input[type=number].error::placeholder,input[type=email].error::placeholder,input[type=phone_number].error::placeholder{font-weight:400}input[type=text]::placeholder,input[type=number]::placeholder,input[type=email]::placeholder,input[type=phone_number]::placeholder{color:var(--nylas-base-300)}input:read-only{background-color:var(--nylas-base-100);cursor:not-allowed}";
|
|
5
5
|
|
|
@@ -180,6 +180,6 @@ function defineCustomElement() {
|
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
export { InputComponent as I, defineCustomElement as d };
|
|
183
|
-
//# sourceMappingURL=p-
|
|
183
|
+
//# sourceMappingURL=p-DJv7tC9z.js.map
|
|
184
184
|
|
|
185
|
-
//# sourceMappingURL=p-
|
|
185
|
+
//# sourceMappingURL=p-DJv7tC9z.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-o0D7OIed.js","mappings":";;;AAAA,MAAM,iBAAiB,GAAG,6zHAA6zH;;ACIv1H,MAAM,cAAc,GAAG;AACrB,IAAA,KAAK,EAAE,sIAAsI;AAC7I,IAAA,YAAY,EAAE,eAAe;CAC9B;AAED,MAAM,kBAAkB,GAAG;AACzB,IAAA,KAAK,EAAE,kBAAkB;AACzB,IAAA,YAAY,EAAE,YAAY;CAC3B;MAYY,cAAc,GAAAA,kBAAA,CAAA,MAAA,cAAA,SAAAC,CAAA,CAAA;AAL3B,IAAA,WAAA,GAAA;;;;;;;AAaU,QAAA,IAAI,CAAA,IAAA,GAAW,OAAO;AAQtB,QAAA,IAAK,CAAA,KAAA,G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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/design-system/input-component/input-component.scss?tag=input-component&encapsulation=shadow","src/components/design-system/input-component/input-component.tsx"],"sourcesContent":["@use '../../../common/styles/variables' as *;\n@use '../../../common/mixins/inputs' as *;\n\n:host {\n display: block;\n height: auto;\n @include default-css-variables;\n width: 100%;\n}\n\nlabel {\n @include input-label;\n flex-direction: column;\n gap: 4px;\n font-family: var(--nylas-font-family);\n font-size: 16px;\n color: var(--nylas-base-800);\n\n p {\n margin: 0;\n }\n\n .error {\n color: var(--nylas-error);\n }\n}\n\n.input_wrapper {\n display: flex;\n align-items: center;\n gap: 1rem;\n}\n\ninput[type='text'],\ninput[type='number'],\ninput[type='email'],\ninput[type='phone_number'] {\n @include textfield;\n width: -moz-available;\n width: -webkit-fill-available;\n}\n\ninput:read-only {\n background-color: var(--nylas-base-100);\n cursor: not-allowed;\n}","import { Component, h, Prop, State, Event, EventEmitter, Listen, Watch, Element } from '@stencil/core';\nimport { sanitize } from '@/utils/utils';\nimport { ThemeConfig } from '@nylas/core';\n\nconst DefaultPattern = {\n email: /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,\n phone_number: /^\\+?\\d{1,15}$/,\n};\n\nconst DefaultPlaceholder = {\n email: 'name@example.com',\n phone_number: '1234567890',\n};\n\n/**\n * The `input-component` component is a UI component that allows users to input text, email, or phone number values.\n * This component is used in the scheduling form to input text, email and phone number type inputs.\n */\n\n@Component({\n tag: 'input-component',\n styleUrl: 'input-component.scss',\n shadow: true,\n})\nexport class InputComponent {\n /**\n * The host element\n */\n @Element() el!: HTMLElement;\n /**\n * The name of the input. This is used to identify the input when submitting a form.\n */\n @Prop() name: string = 'input';\n /**\n * The default value of the input. This is the value that is displayed when the input is rendered.\n */\n @Prop() defaultValue?: string;\n /**\n * The label of the input. This is displayed above the input.\n */\n @Prop() label: string = '';\n /**\n * The type of the input. This is used to determine the input's behavior.\n * Supported types are 'text', 'email', and 'phone_number'.\n */\n @Prop() type: 'text' | 'email' | 'phone_number' | 'number' = 'text';\n /**\n * The placeholder of the input. This is displayed when the input is empty.\n */\n @Prop() placeholder: string = DefaultPlaceholder[this.type];\n /**\n * Whether the input is required. If true, the input must have a value when submitting a form.\n * Default is false. If the input is required and the value is empty, an error message is displayed.\n */\n @Prop() required: boolean = false;\n /**\n * Whether the input is read-only. If true, the input cannot be edited.\n * Default is false.\n */\n @Prop() readOnly: boolean = false;\n /**\n * Whether the input should be focused when rendered.\n * Default is false. If true, the input is focused when rendered.\n * Use this to set the focus on the first input in a form.\n */\n @Prop() autoFocus: boolean = false;\n /**\n * The pattern to validate the input value. If the value does not match the pattern, an error message is displayed.\n * Default is null. If the pattern is not set, the pattern is determined by the input type for 'email' and 'phone_number'.\n */\n @Prop() pattern?: RegExp;\n /**\n * The maximum length of the input value. If the value is longer than the maximum length, an error message is displayed.\n * Default is 255.\n */\n @Prop() maxLength: number = 255;\n /**\n * The error message to display when the value does not match the pattern.\n * Default is 'Invalid <field> format.' where <field> is the input label.\n */\n @Prop() patternError: string = '';\n\n /**\n * This error message is displayed when the input value is empty and the input is required.\n */\n @Prop() requiredError: string = '';\n @Prop() maxValue?: number; // Optional max value for 'number'\n @Prop() minValue?: number; // Optional min value for 'number'\n\n /**\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: ThemeConfig;\n\n /**\n * The input value state.\n */\n @State() value!: string;\n /**\n * The error message state.\n */\n @State() error: string = '';\n\n /**\n * This event is fired when the input value is changed.\n * The scheduling form listens for this event to validate the input value and submit the form.\n * If using outside of the scheduling form, listen for this event to validate the input value\n * and handle the input value change.\n */\n @Event() nylasFormInputChanged!: EventEmitter<{\n value: string;\n name: string;\n label: string;\n type: string;\n error: string;\n }>;\n\n @Event() nylasFormInputFocused!: EventEmitter<{\n value: string;\n name: string;\n }>;\n\n @Event() nylasFormInputBlurred!: EventEmitter<{\n value: string;\n name: string;\n }>;\n\n // Lifecycle methods\n @Watch('defaultValue')\n handleDefaultValueChange(newValue: string) {\n this.value = sanitize(newValue);\n if (this.value) {\n this.validatePattern(this.value);\n }\n }\n\n @Watch('themeConfig')\n themeConfigChangedHandler(newVal: ThemeConfig, oldVal: ThemeConfig) {\n if (newVal === oldVal) return;\n this.applyThemeConfig(newVal);\n }\n\n applyThemeConfig(themeConfig?: ThemeConfig) {\n if (themeConfig) {\n for (const [key, value] of Object.entries(themeConfig)) {\n this.el.style.setProperty(`${key}`, value);\n }\n }\n }\n\n componentWillLoad() {\n this.applyThemeConfig(this.themeConfig);\n }\n\n componentDidLoad() {\n this.value = sanitize(this.defaultValue || '');\n if (this.type !== 'text' && !this.pattern) {\n this.pattern = DefaultPattern[this.type];\n }\n\n if (this.value) {\n this.validatePattern(this.value);\n }\n this.applyThemeConfig(this.themeConfig);\n }\n\n // Event listeners\n /**\n * Listen for the bookingFormSubmitted event to validate the input value when the form is submitted.\n */\n @Listen('bookingFormSubmitted', { target: 'document' })\n handleBookingFormSubmitted(event: CustomEvent) {\n this.validatePattern(this.value);\n if (this.error) {\n event.preventDefault();\n }\n }\n\n @Listen('formSubmitted', { target: 'document' })\n async handleFormSubmitted(event: CustomEvent) {\n if (this.el?.getAttribute('data-page-styling')) {\n this.validatePattern(this.value);\n if (this.error) {\n event.preventDefault();\n }\n }\n }\n\n // Methods\n handleInput(e: Event) {\n this.error = '';\n const inputValue = (e.target as HTMLInputElement).value;\n\n // For 'number', ensure the value is valid\n if (this.type === 'number') {\n const numericValue = parseFloat(inputValue);\n if ((this.maxValue !== undefined && numericValue > this.maxValue) || (this.minValue !== undefined && numericValue < this.minValue)) {\n if (this.minValue === undefined) {\n this.error = `Value must be less than ${this.maxValue}`;\n } else if (this.maxValue === undefined) {\n this.error = `Value must be greater than ${this.minValue}`;\n } else {\n this.error = `Value must be between ${this.minValue} and ${this.maxValue}`;\n }\n } else if (isNaN(numericValue)) {\n this.error = this.patternError || 'Invalid format.';\n }\n }\n\n this.value = sanitize(inputValue);\n this.nylasFormInputChanged.emit({\n value: this.value,\n name: this.name,\n label: this.label,\n error: this.error,\n type: this.type,\n });\n }\n\n handleBlur() {\n this.nylasFormInputBlurred.emit({\n value: this.value,\n name: this.name,\n });\n }\n\n handleFocus() {\n this.nylasFormInputFocused.emit({\n value: this.value,\n name: this.name,\n });\n }\n\n validatePattern(value: string) {\n // Reset error\n this.error = '';\n\n if (this.required && !value) {\n this.error = this.requiredError || 'This field is required.';\n return;\n }\n\n if (this.type === 'number' && value) {\n const numericValue = parseFloat(value);\n if ((this.maxValue !== undefined && numericValue > this.maxValue) || (this.minValue !== undefined && numericValue < this.minValue)) {\n this.error = `Value must be between ${this.minValue} and ${this.maxValue}`;\n return;\n }\n }\n\n if (this.pattern && value && !this.pattern.test(value)) {\n this.error = this.patternError || 'Invalid format.';\n }\n }\n\n render() {\n return (\n <label part={this.error ? 'ic__label ic__label--error' : 'ic__label'} class={{ error: !!this.error }}>\n {this.label && (\n <p>\n <span class=\"label\">{this.label}</span>\n {this.required && <span class=\"required\">*</span>}\n </p>\n )}\n <div part=\"ic__input_wrapper\" class=\"input_wrapper\">\n <input\n type={this.type}\n name={this.name}\n part={this.error ? 'ic__input ic__input--error' : 'ic__input'}\n title={this.readOnly ? 'read-only field' : undefined}\n readOnly={this.readOnly}\n autoFocus={this.autoFocus}\n value={this.value}\n maxLength={this.maxLength}\n max={this.type === 'number' ? this.maxValue : undefined}\n min={this.type === 'number' ? this.minValue : undefined}\n placeholder={this.placeholder}\n class={{ error: !!this.error }}\n onInput={e => this.handleInput(e)}\n onFocus={() => this.handleFocus()}\n onBlur={() => this.handleBlur()}\n />\n <slot name=\"additional-input\"></slot>\n </div>\n {this.error && (\n <span class=\"error help-text\" part=\"ic__error_message\">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AAI,CAAC,WAAW,EAC7B,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,EAC9B,OAAO,EAAE,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EACjC,OAAO,EAAE,MAAM,IAAI,CAAC,WAAW,EAAE,EACjC,MAAM,EAAE,MAAM,IAAI,CAAC,UAAU,EAAE,EAC/B,CAAA,EACF,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,kBAAkB,EAAA,CAAQ,CACjC,EACL,IAAI,CAAC,KAAK,KACT,6DAAM,KAAK,EAAC,iBAAiB,EAAC,IAAI,EAAC,mBAAmB,EAAA,EACnD,IAAI,CAAC,KAAK,CACN,CACR,CACK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/design-system/input-component/input-component.scss?tag=input-component&encapsulation=shadow","src/components/design-system/input-component/input-component.tsx"],"sourcesContent":["@use '../../../common/styles/variables' as *;\n@use '../../../common/mixins/inputs' as *;\n\n:host {\n display: block;\n height: auto;\n @include default-css-variables;\n width: 100%;\n}\n\nlabel {\n @include input-label;\n flex-direction: column;\n gap: 4px;\n font-family: var(--nylas-font-family);\n font-size: 16px;\n color: var(--nylas-base-800);\n\n p {\n margin: 0;\n }\n\n .error {\n color: var(--nylas-error);\n }\n}\n\n.input_wrapper {\n display: flex;\n align-items: center;\n gap: 1rem;\n}\n\ninput[type='text'],\ninput[type='number'],\ninput[type='email'],\ninput[type='phone_number'] {\n @include textfield;\n width: -moz-available;\n width: -webkit-fill-available;\n}\n\ninput:read-only {\n background-color: var(--nylas-base-100);\n cursor: not-allowed;\n}","import { Component, h, Prop, State, Event, EventEmitter, Listen, Watch, Element } from '@stencil/core';\nimport { sanitize } from '@/utils/utils';\nimport { ThemeConfig } from '@nylas/core';\n\nconst DefaultPattern = {\n email: /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,\n phone_number: /^\\+?\\d{1,15}$/,\n};\n\nconst DefaultPlaceholder = {\n email: 'name@example.com',\n phone_number: '1234567890',\n};\n\n/**\n * The `input-component` component is a UI component that allows users to input text, email, or phone number values.\n * This component is used in the scheduling form to input text, email and phone number type inputs.\n */\n\n@Component({\n tag: 'input-component',\n styleUrl: 'input-component.scss',\n shadow: true,\n})\nexport class InputComponent {\n /**\n * The host element\n */\n @Element() el!: HTMLElement;\n /**\n * The name of the input. This is used to identify the input when submitting a form.\n */\n @Prop() name: string = 'input';\n /**\n * The default value of the input. This is the value that is displayed when the input is rendered.\n */\n @Prop() defaultValue?: string;\n /**\n * The label of the input. This is displayed above the input.\n */\n @Prop() label: string = '';\n /**\n * The type of the input. This is used to determine the input's behavior.\n * Supported types are 'text', 'email', and 'phone_number'.\n */\n @Prop() type: 'text' | 'email' | 'phone_number' | 'number' = 'text';\n /**\n * The placeholder of the input. This is displayed when the input is empty.\n */\n @Prop() placeholder: string = DefaultPlaceholder[this.type];\n /**\n * Whether the input is required. If true, the input must have a value when submitting a form.\n * Default is false. If the input is required and the value is empty, an error message is displayed.\n */\n @Prop() required: boolean = false;\n /**\n * Whether the input is read-only. If true, the input cannot be edited.\n * Default is false.\n */\n @Prop() readOnly: boolean = false;\n /**\n * Whether the input should be focused when rendered.\n * Default is false. If true, the input is focused when rendered.\n * Use this to set the focus on the first input in a form.\n */\n @Prop() autoFocus: boolean = false;\n /**\n * The pattern to validate the input value. If the value does not match the pattern, an error message is displayed.\n * Default is null. If the pattern is not set, the pattern is determined by the input type for 'email' and 'phone_number'.\n */\n @Prop() pattern?: RegExp;\n /**\n * The maximum length of the input value. If the value is longer than the maximum length, an error message is displayed.\n * Default is 255.\n */\n @Prop() maxLength: number = 255;\n /**\n * The error message to display when the value does not match the pattern.\n * Default is 'Invalid <field> format.' where <field> is the input label.\n */\n @Prop() patternError: string = '';\n\n /**\n * This error message is displayed when the input value is empty and the input is required.\n */\n @Prop() requiredError: string = '';\n @Prop() maxValue?: number; // Optional max value for 'number'\n @Prop() minValue?: number; // Optional min value for 'number'\n\n /**\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: ThemeConfig;\n\n /**\n * The input value state.\n */\n @State() value!: string;\n /**\n * The error message state.\n */\n @State() error: string = '';\n\n /**\n * This event is fired when the input value is changed.\n * The scheduling form listens for this event to validate the input value and submit the form.\n * If using outside of the scheduling form, listen for this event to validate the input value\n * and handle the input value change.\n */\n @Event() nylasFormInputChanged!: EventEmitter<{\n value: string;\n name: string;\n label: string;\n type: string;\n error: string;\n }>;\n\n @Event() nylasFormInputFocused!: EventEmitter<{\n value: string;\n name: string;\n }>;\n\n @Event() nylasFormInputBlurred!: EventEmitter<{\n value: string;\n name: string;\n }>;\n\n // Lifecycle methods\n @Watch('defaultValue')\n handleDefaultValueChange(newValue: string) {\n this.value = sanitize(newValue);\n if (this.value) {\n this.validatePattern(this.value);\n }\n }\n\n @Watch('themeConfig')\n themeConfigChangedHandler(newVal: ThemeConfig, oldVal: ThemeConfig) {\n if (newVal === oldVal) return;\n this.applyThemeConfig(newVal);\n }\n\n applyThemeConfig(themeConfig?: ThemeConfig) {\n if (themeConfig) {\n for (const [key, value] of Object.entries(themeConfig)) {\n this.el.style.setProperty(`${key}`, value);\n }\n }\n }\n\n componentWillLoad() {\n this.applyThemeConfig(this.themeConfig);\n }\n\n componentDidLoad() {\n this.value = sanitize(this.defaultValue || '');\n if (this.type !== 'text' && !this.pattern) {\n this.pattern = DefaultPattern[this.type];\n }\n\n if (this.value) {\n this.validatePattern(this.value);\n }\n this.applyThemeConfig(this.themeConfig);\n }\n\n // Event listeners\n /**\n * Listen for the bookingFormSubmitted event to validate the input value when the form is submitted.\n */\n @Listen('bookingFormSubmitted', { target: 'document' })\n handleBookingFormSubmitted(event: CustomEvent) {\n this.validatePattern(this.value);\n if (this.error) {\n event.preventDefault();\n }\n }\n\n @Listen('formSubmitted', { target: 'document' })\n async handleFormSubmitted(event: CustomEvent) {\n if (this.el?.getAttribute('data-page-styling')) {\n this.validatePattern(this.value);\n if (this.error) {\n event.preventDefault();\n }\n }\n }\n\n // Methods\n handleInput(e: Event) {\n this.error = '';\n const inputValue = (e.target as HTMLInputElement).value;\n\n // For 'number', ensure the value is valid\n if (this.type === 'number') {\n const numericValue = parseFloat(inputValue);\n if ((this.maxValue !== undefined && numericValue > this.maxValue) || (this.minValue !== undefined && numericValue < this.minValue)) {\n if (this.minValue === undefined) {\n this.error = `Value must be less than ${this.maxValue}`;\n } else if (this.maxValue === undefined) {\n this.error = `Value must be greater than ${this.minValue}`;\n } else {\n this.error = `Value must be between ${this.minValue} and ${this.maxValue}`;\n }\n } else if (isNaN(numericValue)) {\n this.error = this.patternError || 'Invalid format.';\n }\n }\n\n this.value = sanitize(inputValue);\n this.nylasFormInputChanged.emit({\n value: this.value,\n name: this.name,\n label: this.label,\n error: this.error,\n type: this.type,\n });\n }\n\n handleBlur() {\n this.nylasFormInputBlurred.emit({\n value: this.value,\n name: this.name,\n });\n }\n\n handleFocus() {\n this.nylasFormInputFocused.emit({\n value: this.value,\n name: this.name,\n });\n }\n\n validatePattern(value: string) {\n // Reset error\n this.error = '';\n\n if (this.required && !value) {\n this.error = this.requiredError || 'This field is required.';\n return;\n }\n\n if (this.type === 'number' && value) {\n const numericValue = parseFloat(value);\n if ((this.maxValue !== undefined && numericValue > this.maxValue) || (this.minValue !== undefined && numericValue < this.minValue)) {\n this.error = `Value must be between ${this.minValue} and ${this.maxValue}`;\n return;\n }\n }\n\n if (this.pattern && value && !this.pattern.test(value)) {\n this.error = this.patternError || 'Invalid format.';\n }\n }\n\n render() {\n return (\n <label part={this.error ? 'ic__label ic__label--error' : 'ic__label'} class={{ error: !!this.error }}>\n {this.label && (\n <p>\n <span class=\"label\">{this.label}</span>\n {this.required && <span class=\"required\">*</span>}\n </p>\n )}\n <div part=\"ic__input_wrapper\" class=\"input_wrapper\">\n <input\n type={this.type}\n name={this.name}\n part={this.error ? 'ic__input ic__input--error' : 'ic__input'}\n title={this.readOnly ? 'read-only field' : undefined}\n readOnly={this.readOnly}\n autoFocus={this.autoFocus}\n value={this.value}\n maxLength={this.maxLength}\n max={this.type === 'number' ? this.maxValue : undefined}\n min={this.type === 'number' ? this.minValue : undefined}\n placeholder={this.placeholder}\n class={{ error: !!this.error }}\n onInput={e => this.handleInput(e)}\n onFocus={() => this.handleFocus()}\n onBlur={() => this.handleBlur()}\n />\n <slot name=\"additional-input\"></slot>\n </div>\n {this.error && (\n <span class=\"error help-text\" part=\"ic__error_message\">\n {this.error}\n </span>\n )}\n </label>\n );\n }\n}\n"],"version":3}
|