@nylas/web-elements 0.0.0-canary-20241015194719 → 0.0.0-canary-20241017202051

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.
Files changed (84) hide show
  1. package/dist/cdn/input-image-url/input-image-url.es.js +365 -365
  2. package/dist/cdn/nylas-additional-participants/nylas-additional-participants.es.js +46 -48
  3. package/dist/cdn/nylas-confirmation-email/nylas-confirmation-email.es.js +86 -82
  4. package/dist/cdn/nylas-custom-booking-flow/nylas-custom-booking-flow.es.js +1 -1
  5. package/dist/cdn/nylas-editor-tabs/nylas-editor-tabs.es.js +4710 -4700
  6. package/dist/cdn/nylas-event-duration/nylas-event-duration.es.js +228 -228
  7. package/dist/cdn/nylas-event-info/nylas-event-info.es.js +2 -2
  8. package/dist/cdn/nylas-event-limits/nylas-event-limits.es.js +2 -2
  9. package/dist/cdn/nylas-form-card/nylas-form-card.es.js +1 -1
  10. package/dist/cdn/nylas-reminder-emails/nylas-reminder-emails.es.js +2289 -2281
  11. package/dist/cdn/nylas-reminder-time/nylas-reminder-time.es.js +2253 -2245
  12. package/dist/cdn/nylas-scheduler-editor/nylas-scheduler-editor.es.js +53 -43
  13. package/dist/cdn/nylas-scheduling/nylas-scheduling.es.js +4 -3
  14. package/dist/cdn/nylas-timeslot-picker/nylas-timeslot-picker.es.js +4 -3
  15. package/dist/cjs/calendar-agenda-fill-icon_54.cjs.entry.js +60 -54
  16. package/dist/cjs/calendar-agenda-fill-icon_54.cjs.entry.js.map +1 -1
  17. package/dist/cjs/loader.cjs.js +1 -1
  18. package/dist/cjs/nylas-booked-event-card_12.cjs.entry.js +2 -2
  19. package/dist/cjs/nylas-booked-event-card_12.cjs.entry.js.map +1 -1
  20. package/dist/cjs/nylas-form-card.cjs.entry.js +1 -1
  21. package/dist/cjs/nylas-web-elements.cjs.js +1 -1
  22. package/dist/collection/collection-manifest.json +1 -1
  23. package/dist/collection/components/design-system/input-image-url/input-image-url.js +20 -2
  24. package/dist/collection/components/design-system/input-image-url/input-image-url.js.map +1 -1
  25. package/dist/collection/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.js +2 -2
  26. package/dist/collection/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.js.map +1 -1
  27. package/dist/collection/components/scheduler-editor/nylas-additional-participants/nylas-additional-participants.js +12 -16
  28. package/dist/collection/components/scheduler-editor/nylas-additional-participants/nylas-additional-participants.js.map +1 -1
  29. package/dist/collection/components/scheduler-editor/nylas-additional-participants/test/nylas-additional-participants.spec.js +106 -0
  30. package/dist/collection/components/scheduler-editor/nylas-additional-participants/test/nylas-additional-participants.spec.js.map +1 -0
  31. package/dist/collection/components/scheduler-editor/nylas-confirmation-email/nylas-confirmation-email.js +52 -28
  32. package/dist/collection/components/scheduler-editor/nylas-confirmation-email/nylas-confirmation-email.js.map +1 -1
  33. package/dist/collection/components/scheduler-editor/nylas-confirmation-email/test/nylas-confirmation-email.spec.js +33 -0
  34. package/dist/collection/components/scheduler-editor/nylas-confirmation-email/test/nylas-confirmation-email.spec.js.map +1 -0
  35. package/dist/collection/components/scheduler-editor/nylas-event-duration/nylas-event-duration.js +5 -3
  36. package/dist/collection/components/scheduler-editor/nylas-event-duration/nylas-event-duration.js.map +1 -1
  37. package/dist/collection/components/scheduler-editor/nylas-event-duration/test/nylas-event-duration.spec.js +55 -0
  38. package/dist/collection/components/scheduler-editor/nylas-event-duration/test/nylas-event-duration.spec.js.map +1 -0
  39. package/dist/collection/components/scheduler-editor/nylas-event-info/nylas-event-info.js +1 -1
  40. package/dist/collection/components/scheduler-editor/nylas-event-limits/nylas-event-limits.js +1 -1
  41. package/dist/collection/components/scheduler-editor/nylas-form-card/nylas-form-card.js +1 -1
  42. package/dist/collection/components/scheduler-editor/nylas-reminder-time/nylas-reminder-time.js +23 -30
  43. package/dist/collection/components/scheduler-editor/nylas-reminder-time/nylas-reminder-time.js.map +1 -1
  44. package/dist/collection/components/scheduler-editor/nylas-reminder-time/test/nylas-reminder-time.spec.js +37 -0
  45. package/dist/collection/components/scheduler-editor/nylas-reminder-time/test/nylas-reminder-time.spec.js.map +1 -0
  46. package/dist/components/input-image-url2.js +6 -2
  47. package/dist/components/input-image-url2.js.map +1 -1
  48. package/dist/components/nylas-additional-participants2.js +12 -16
  49. package/dist/components/nylas-additional-participants2.js.map +1 -1
  50. package/dist/components/nylas-confirmation-email2.js +14 -5
  51. package/dist/components/nylas-confirmation-email2.js.map +1 -1
  52. package/dist/components/nylas-event-duration2.js +5 -3
  53. package/dist/components/nylas-event-duration2.js.map +1 -1
  54. package/dist/components/nylas-event-info2.js +1 -1
  55. package/dist/components/nylas-event-limits2.js +1 -1
  56. package/dist/components/nylas-form-card2.js +1 -1
  57. package/dist/components/nylas-reminder-time2.js +23 -29
  58. package/dist/components/nylas-reminder-time2.js.map +1 -1
  59. package/dist/components/nylas-timeslot-picker2.js +2 -2
  60. package/dist/components/nylas-timeslot-picker2.js.map +1 -1
  61. package/dist/esm/calendar-agenda-fill-icon_54.entry.js +60 -54
  62. package/dist/esm/calendar-agenda-fill-icon_54.entry.js.map +1 -1
  63. package/dist/esm/loader.js +1 -1
  64. package/dist/esm/nylas-booked-event-card_12.entry.js +2 -2
  65. package/dist/esm/nylas-booked-event-card_12.entry.js.map +1 -1
  66. package/dist/esm/nylas-form-card.entry.js +1 -1
  67. package/dist/esm/nylas-web-elements.js +1 -1
  68. package/dist/nylas-web-elements/nylas-web-elements.esm.js +1 -1
  69. package/dist/nylas-web-elements/nylas-web-elements.esm.js.map +1 -1
  70. package/dist/nylas-web-elements/p-1ce8b1c3.entry.js +8 -0
  71. package/dist/nylas-web-elements/p-1ce8b1c3.entry.js.map +1 -0
  72. package/dist/nylas-web-elements/{p-698d229c.entry.js → p-7a1d51ab.entry.js} +2 -2
  73. package/dist/nylas-web-elements/{p-698d229c.entry.js.map → p-7a1d51ab.entry.js.map} +1 -1
  74. package/dist/nylas-web-elements/p-bbf86b8c.entry.js +2 -0
  75. package/dist/types/components/design-system/input-image-url/input-image-url.d.ts +4 -0
  76. package/dist/types/components/scheduler-editor/nylas-additional-participants/nylas-additional-participants.d.ts +1 -1
  77. package/dist/types/components/scheduler-editor/nylas-confirmation-email/nylas-confirmation-email.d.ts +5 -1
  78. package/dist/types/components/scheduler-editor/nylas-reminder-time/nylas-reminder-time.d.ts +1 -1
  79. package/dist/types/components.d.ts +18 -6
  80. package/package.json +3 -3
  81. package/dist/nylas-web-elements/p-b9a8d404.entry.js +0 -8
  82. package/dist/nylas-web-elements/p-b9a8d404.entry.js.map +0 -1
  83. package/dist/nylas-web-elements/p-f4334e3a.entry.js +0 -2
  84. /package/dist/nylas-web-elements/{p-f4334e3a.entry.js.map → p-bbf86b8c.entry.js.map} +0 -0
@@ -1 +1 @@
1
- {"file":"nylas-additional-participants2.js","mappings":";;;;;;;;;;;AAAA,MAAM,8BAA8B,GAAG,4gHAA4gH,CAAC;AACpjH,0CAAe,8BAA8B;;;;;;;;;;;;;;;;MC0ChC,2BAA2B;;;;;;;oBAMf,cAAc;;;;;4BAuBE,IAAI,CAAC,iBAAiB,IAAI,EAAE;iCACX,EAAE;6CACR,IAAI;kCACf,IAAI,CAAC,qBAAqB,EAAE,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,KAAK,YAAY;qBAChH,EAAE;;IAgB3B,yBAAyB,CAAC,QAAgB;QACxC,KAAK,CAAC,+BAA+B,EAAE,2BAA2B,EAAE,QAAQ,CAAC,CAAC;QAC9E,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;KAC1C;IAGD,mCAAmC,CAAC,QAAuB;QACzD,KAAK,CAAC,+BAA+B,EAAE,qCAAqC,EAAE,QAAQ,CAAC,CAAC;QACxF,IAAI,CAAC,kBAAkB,GAAG,QAAQ,EAAE,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,KAAK,YAAY,CAAC;QAC3G,IAAI,CAAC,YAAY,GAAG,QAAQ,EAAE,YAAY,IAAI,EAAE,C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AAO,EAAE,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,kBAAkB,IAAI,EAAE,EAAE,IAAI,CAAC,YAAY,CAAC,GAClF,CACH,EACA,CAAC,WAAW,CAAC,YAAY,KACxB,cAAQ,OAAO,EAAE,MAAM,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE,IAAI,EAAC,yBAAyB,IAClF,qBAAc,CACP,CACV,CACG,CACF,EACL,CAAC,WAAW,CAAC,QAAQ,KACpB,SAAG,KAAK,EAAC,sCAAsC,EAAC,IAAI,EAAC,YAAY,IAC9D,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAC5B,CACL,CACG,EACN;SACH,CAAC,EACF,0DAAG,KAAK,EAAC,sCAAsC,EAAC,IAAI,EAAC,YAAY,IAC9D,IAAI,CAAC,KAAK,CACT,CACA,EACN,+DAAQ,KAAK,EAAC,oCAAoC,EAAC,IAAI,EAAC,sBAAsB,EAAC,OAAO,EAAE,MAAM,IAAI,CAAC,cAAc,EAAE,IACjH,yEAAmB,OAAC,uEAAW,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,GAAG,SAAS,GAAG,GAAG,iBAAoB,CAC1F,CACL,CACU,CACb,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;AAhGD;IAVC,iBAAiB,CAAiH;QACjI,IAAI,EAAE,+BAA+B;QACrC,YAAY,EAAE,IAAI,GAAG,CAAC;YACpB,CAAC,wCAAwC,EAAE,oBAAoB,CAAC;YAChE,CAAC,uCAAuC,EAAE,uBAAuB,CAAC;YAClE,CAAC,6BAA6B,EAAE,aAAa,CAAC;SAC/C,CAAC;QACF,YAAY,EAAE,EAAE;QAChB,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;yDAiGD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/scheduler-editor/nylas-additional-participants/nylas-additional-participants.scss?tag=nylas-additional-participants&encapsulation=shadow","src/components/scheduler-editor/nylas-additional-participants/nylas-additional-participants.tsx"],"sourcesContent":["@import '../../../common/styles/variables.scss';\n\n:host {\n display: block;\n margin: 1rem;\n @include default-css-variables;\n}\n\n.nylas-additional-participants__title {\n color: var(--nylas-base-nylas-base-900-aaa, #101323);\n font-size: 16px;\n font-style: normal;\n font-weight: 600;\n line-height: 20px;\n /* 125% */\n margin: 0;\n text-align: left;\n}\n\n.nylas-additional-participants__subtitle {\n color: var(--nylas-base-600);\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 20px;\n /* 142.857% */\n margin: 0.25rem 0px 0px;\n text-align: left;\n}\n\n.nylas-additional-participants__content {\n padding: 1rem;\n display: flex;\n flex-direction: column;\n gap: 1rem;\n}\n\n.nylas-additional-participants__input_group {\n padding-top: 8px;\n display: flex;\n flex-direction: column;\n gap: 4px;\n\n label {\n display: flex;\n align-items: center;\n color: var(--nylas-base-800);\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 150%;\n }\n}\n\n.nylas-additional-participants__error {\n color: var(--nylas-error);\n font-size: 14px;\n font-family: var(--nylas-font-family);\n font-weight: 400;\n line-height: 16px;\n margin: 0;\n text-align: left;\n}\n\n.nylas-additional-participants__input_wrapper {\n display: flex;\n border-width: 1;\n border-radius: 8px;\n border: 1px solid var(--nylas-base-300);\n\n &.error {\n border-color: var(--nylas-error);\n }\n\n button {\n padding: 12px;\n border: none;\n border-left: 1px solid var(--nylas-base-300);\n background: none;\n cursor: pointer;\n\n &:hover,\n &:active {\n color: var(--nylas-primary);\n }\n }\n}\n\n.nylas-additional-participants__input_wrapper_organizer {\n border: none;\n}\n\n.nylas-additional-participants__input {\n flex: 1;\n display: flex;\n justify-content: space-between;\n\n input {\n border: none;\n outline: none;\n background: none;\n width: 100%;\n }\n\n input-dropdown {\n width: 100%;\n }\n\n input-dropdown::part(id_dropdown) {\n width: 100%;\n height: 100%;\n }\n\n input-dropdown::part(id_dropdown-input) {\n height: 100%;\n border-radius: var(--nylas-border-radius-2x);\n border: none;\n border-top-right-radius: initial;\n border-bottom-right-radius: initial;\n padding-left: 16px;\n }\n\n input-component::part(ic__input) {\n background: var(--nylas-base-50);\n }\n\n input-component::part(ic__label) {\n font-size: 14px;\n }\n\n input-component {\n div.required-input {\n display: flex;\n gap: 4px;\n\n label {\n display: flex;\n gap: 4px;\n align-items: center;\n\n tooltip-component#organizer_participant_tooltip::part(tc__content) {\n left: -84px;\n }\n }\n }\n }\n}\n\n.nylas-additional-participants__add {\n padding: 12px;\n display: flex;\n align-items: center;\n border: none;\n background: none;\n cursor: pointer;\n\n span {\n padding: 0 8px;\n font-size: 16px;\n font-style: normal;\n font-weight: 500;\n }\n\n &:hover,\n &:active {\n color: var(--nylas-primary);\n }\n}\n","import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug } from '@/utils/utils';\nimport { AttachInternals, Component, Host, Prop, State, Watch, h, Element, Listen, EventEmitter } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { Event } from '@stencil/core';\nimport { AdditionalParticipant, Configuration } from '@nylas/core';\nimport { User } from '@/common/nylas-api-request';\n\ntype Participant = {\n name?: string;\n email: string;\n is_valid?: boolean;\n is_organizer?: boolean;\n availability?: Availability;\n booking?: Booking;\n};\ntype Availability = {\n calendar_ids: string[];\n};\ntype Booking = {\n calendar_id: string;\n};\n\n/**\n * The `nylas-additional-participants` component is a form input for adding additional participants to an event.\n *\n * @part nap__title - The title of the component.\n * @part nap__subtitle - The subtitle of the component.\n * @part nap__content - The content of the component.\n * @part nap__input_group - The input group of the component.\n * @part nap__input_wrapper - The input wrapper of the component.\n * @part nap__input - The input of the component.\n * @part nap__remove-participant - The remove participant button of the component.\n * @part nap__add-participant - The add participant button of the component.\n *\n */\n@Component({\n tag: 'nylas-additional-participants',\n styleUrl: 'nylas-additional-participants.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasAdditionalParticipants {\n @Element() host!: HTMLNylasAdditionalParticipantsElement;\n /**\n * @standalone\n * The name of the component\n */\n @Prop() name: string = 'participants';\n /**\n * @standalone\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n /**\n * @standalone\n * The logged in user\n */\n @Prop() currentUser?: User;\n /**\n * @standalone\n * The additional participants options from the config\n */\n @Prop() participantOptions?: AdditionalParticipant[];\n /**\n * @standalone\n * The event participants\n */\n @Prop() eventParticipants?: Participant[];\n\n @AttachInternals() internals!: ElementInternals;\n @State() participants: Participant[] = this.eventParticipants ?? [];\n @State() participantErrors: { [key: string]: string } = {};\n @State() includeOrganizerAsParticipant: boolean = true;\n @State() isRoundRobinConfig: boolean = this.selectedConfiguration?.availability?.availability_rules?.availability_method !== 'collective';\n @State() error: string = '';\n\n /**\n * This event is fired when the selected participants change.\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\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-additional-participants', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('selectedConfiguration')\n selectedConfigurationChangedHandler(newValue: Configuration) {\n debug('nylas-additional-participants', 'selectedConfigurationChangedHandler', newValue);\n this.isRoundRobinConfig = newValue?.availability?.availability_rules?.availability_method !== 'collective';\n this.participants = newValue?.participants || [];\n this.updateOrganizerAsParticipant();\n }\n\n connectedCallback() {\n debug('nylas-additional-participants', 'connectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-additional-participants', 'componentWillLoad');\n this.host.setAttribute('name', this.name);\n }\n\n componentDidLoad() {\n debug('nylas-additional-participants', 'componentDidLoad');\n this.isRoundRobinConfig = this.selectedConfiguration?.availability?.availability_rules?.availability_method !== 'collective';\n this.includeOrganizerAsParticipant = this.isRoundRobinConfig && this.participants.find(p => p.email === this.currentUser?.email) ? true : false;\n\n if (this.selectedConfiguration) {\n this.selectedConfigurationChangedHandler(this.selectedConfiguration);\n } else {\n this.updateOrganizerAsParticipant();\n }\n }\n\n disconnectedCallback() {\n debug('nylas-additional-participants', 'disconnectedCallback');\n }\n\n @Listen('inputOptionChanged')\n onInputOptionChanged(event: CustomEvent<{ value: string; name: string }>) {\n debug('nylas-additional-participants', 'onInputOptionChanged');\n const EMAIL_REGEX = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}$/;\n const index = event.detail.name;\n const participant = this.participantOptions?.find(participant => participant.email === event.detail.value);\n\n if (!participant && this.isRoundRobinConfig) {\n this.internals.setValidity({ customError: true }, 'For round robin configuration, participant should be selected from the dropdown.');\n this.participantErrors[index] = 'For round robin page, participant should be selected from the dropdown.';\n this.participants[index].is_valid = false;\n this.participants = [...this.participants];\n return;\n } else if (!participant && !EMAIL_REGEX.test(event.detail.value)) {\n this.internals.setValidity({ customError: true }, 'Please enter a valid email address');\n this.participantErrors[index] = 'Please enter a valid email address';\n this.participants[index].is_valid = false;\n this.participants = [...this.participants];\n return;\n } else {\n this.participantErrors[index] = '';\n this.participants[index].is_valid = true;\n this.internals.setValidity({});\n }\n this.participants[index].email = event.detail.value;\n this.participants[index].availability = participant ? { calendar_ids: ['primary'] } : undefined;\n // If round-robin config, set booking calendar to primary for all participants\n this.participants[index].booking = participant && this.isRoundRobinConfig ? { calendar_id: 'primary' } : undefined;\n this.participants[index].name = participant?.name || event.detail.value;\n this.participants = [...this.participants];\n this.updateFormValue();\n }\n\n updateOrganizerAsParticipant() {\n const findCurrentUserInParticipants = this.participants.find(p => p.email === this.currentUser?.email);\n if (this.isRoundRobinConfig && !findCurrentUserInParticipants && this.currentUser?.email) {\n this.participants = [\n {\n name: this.currentUser?.name,\n email: this.currentUser?.email,\n is_organizer: true,\n availability: {\n calendar_ids: ['primary'],\n },\n booking: {\n calendar_id: 'primary',\n },\n },\n ...this.participants,\n ];\n }\n this.updateFormValue();\n }\n\n addParticipant() {\n debug('nylas-additional-participants', 'addParticipant');\n this.participants = [...this.participants, { name: '', email: '', is_organizer: false }];\n this.updateFormValue();\n }\n removeParticipant(index: number) {\n debug('nylas-additional-participants', 'removeParticipant');\n this.participants = this.participants.filter((_, i) => i !== index);\n this.updateFormValue();\n }\n validate(email, index) {\n debug('nylas-additional-participants', 'validate');\n const regex = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n const valid = regex.test(String(email).toLowerCase());\n this.participants[index].is_valid = valid;\n this.updateFormValue();\n }\n\n updateFormValue() {\n debug('nylas-additional-participants', 'updateFormValue');\n const participants = this.isRoundRobinConfig ? (this.includeOrganizerAsParticipant ? this.participants : this.participants.filter(p => !p.is_organizer)) : this.participants;\n if (participants.length === 0) {\n this.internals.setValidity({ customError: true }, 'Please add at least one participant');\n this.error = 'Please add at least one participant';\n } else {\n this.internals.setValidity({});\n this.error = '';\n this.internals.setFormValue(JSON.stringify(participants), this.name);\n this.valueChanged.emit({ value: JSON.stringify(participants), name: this.name });\n }\n }\n\n // Filter out the participants that are already added\n getArrayDifference(array1: AdditionalParticipant[], array2: Participant[]) {\n const filtered = array1.filter(participant1 => !array2.some(participant2 => participant1.email === participant2.email));\n return filtered.map(participant => {\n return { value: participant.email, label: participant.email };\n });\n }\n\n @RegisterComponent<NylasAdditionalParticipants, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-additional-participants',\n stateToProps: new Map([\n ['schedulerConfig.additionalParticipants', 'participantOptions'],\n ['schedulerConfig.selectedConfiguration', 'selectedConfiguration'],\n ['schedulerConfig.currentUser', 'currentUser'],\n ]),\n eventToProps: {},\n fireRegisterEvent: true,\n })\n render() {\n return (\n <Host part=\"nap\">\n <nylas-form-card>\n <h3 slot=\"header-title\" class=\"nylas-additional-participants__title\" part=\"nap__title\">\n Participants\n </h3>\n <p slot=\"header-subtitle\" class=\"nylas-additional-participants__subtitle\" part=\"nap__subtitle\">\n Add people in your team or organization to join the event.\n </p>\n <div slot=\"content\" class=\"nylas-additional-participants__content\">\n <div>\n {this.participants.map((participant, index) => {\n return (\n <div class={'nylas-additional-participants__input_group'} part=\"nap__input_group\">\n {!participant.is_organizer && <label>{`Participant ${index}`}</label>}\n <div\n part=\"nap__input_wrapper\"\n class={{\n 'nylas-additional-participants__input_wrapper': true,\n 'nylas-additional-participants__input_wrapper_organizer': participant?.is_organizer === true,\n 'nylas-additional-participants__input_wrapper_invalid': participant.is_valid === false,\n 'error': participant.is_valid === false,\n }}\n >\n <div class={{ 'nylas-additional-participants__input': true, 'organizer': participant?.is_organizer === true }} part=\"nap__input\">\n {participant.is_organizer ? (\n <input-component\n class={'label-input'}\n name={`${index}`}\n key={index}\n label=\"Organizer\"\n required={false}\n readOnly={participant.is_organizer}\n defaultValue={participant.email}\n >\n {this.isRoundRobinConfig && (\n <div class=\"required-input\" slot=\"additional-input\">\n <input\n type=\"checkbox\"\n name={`organizer_participant`}\n id={`organizer_participant`}\n onClick={() => {\n this.includeOrganizerAsParticipant = !this.includeOrganizerAsParticipant;\n this.updateFormValue();\n }}\n checked={this.includeOrganizerAsParticipant}\n />\n <label htmlFor={`organizer_participant`} aria-label=\"Include as participant\">\n Participant\n <tooltip-component id=\"organizer_participant_tooltip\">\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">\n <strong>Include Organizer:</strong> The organizer (you) will be included in the round-robin rotation. <br />\n <strong>Exclude Organizer:</strong> The organizer (you) will not be included in the round-robin rotation.\n </span>\n </tooltip-component>\n </label>\n </div>\n )}\n </input-component>\n ) : (\n <input-dropdown\n id={`${index}`}\n name={`${index}`}\n filterable={true}\n inputValue={participant.email}\n options={this.getArrayDifference(this.participantOptions || [], this.participants)}\n />\n )}\n {!participant.is_organizer && (\n <button onClick={() => this.removeParticipant(index)} part=\"nap__remove-participant\">\n <close-icon />\n </button>\n )}\n </div>\n </div>\n {!participant.is_valid && (\n <p class=\"nylas-additional-participants__error\" part=\"nap__error\">\n {this.participantErrors[index]}\n </p>\n )}\n </div>\n );\n })}\n <p class=\"nylas-additional-participants__error\" part=\"nap__error\">\n {this.error}\n </p>\n </div>\n <button class=\"nylas-additional-participants__add\" part=\"nap__add-participant\" onClick={() => this.addParticipant()}>\n <add-circle-icon /> <span>Add {this.participants.length > 1 ? 'another' : 'a'} participant</span>\n </button>\n </div>\n </nylas-form-card>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"nylas-additional-participants2.js","mappings":";;;;;;;;;;;AAAA,MAAM,8BAA8B,GAAG,4gHAA4gH,CAAC;AACpjH,0CAAe,8BAA8B;;;;;;;;;;;;;;;;MC0ChC,2BAA2B;;;;;;;oBAMf,cAAc;;;;;4BAuBE,IAAI,CAAC,iBAAiB,IAAI,EAAE;iCACX,EAAE;6CACR,IAAI;kCACf,IAAI,CAAC,qBAAqB,EAAE,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,KAAK,YAAY;qBAChH,EAAE;;IAgB3B,yBAAyB,CAAC,QAAgB;QACxC,KAAK,CAAC,+BAA+B,EAAE,2BAA2B,EAAE,QAAQ,CAAC,CAAC;QAC9E,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;KAC1C;IAGD,mCAAmC,CAAC,QAAuB;QACzD,KAAK,CAAC,+BAA+B,EAAE,qCAAqC,EAAE,QAAQ,CAAC,CAAC;QACxF,IAAI,CAAC,kBAAkB,GAAG,QAAQ,EAAE,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,KAAK,YAAY,CAAC;QAC3G,IAAI,CAAC,YAAY,GAAG,QAAQ,EAAE,YAAY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AAK,EAC7B,OAAO,EAAE,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,kBAAkB,IAAI,EAAE,EAAE,IAAI,CAAC,YAAY,CAAC,GAClF,CACH,EACA,CAAC,WAAW,CAAC,YAAY,KACxB,cAAQ,OAAO,EAAE,MAAM,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE,IAAI,EAAC,yBAAyB,IAClF,qBAAc,CACP,CACV,CACG,CACF,EACL,CAAC,WAAW,CAAC,QAAQ,KACpB,SAAG,KAAK,EAAC,sCAAsC,EAAC,IAAI,EAAC,YAAY,IAC9D,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAC5B,CACL,CACG,EACN;SACH,CAAC,EACF,0DAAG,KAAK,EAAC,sCAAsC,EAAC,IAAI,EAAC,YAAY,IAC9D,IAAI,CAAC,KAAK,CACT,CACA,EACN,+DAAQ,KAAK,EAAC,oCAAoC,EAAC,IAAI,EAAC,sBAAsB,EAAC,OAAO,EAAE,MAAM,IAAI,CAAC,cAAc,EAAE,IACjH,yEAAmB,OAAC,uEAAW,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,GAAG,SAAS,GAAG,GAAG,iBAAoB,CAC1F,CACL,CACU,CACb,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;AAhGD;IAVC,iBAAiB,CAAiH;QACjI,IAAI,EAAE,+BAA+B;QACrC,YAAY,EAAE,IAAI,GAAG,CAAC;YACpB,CAAC,wCAAwC,EAAE,oBAAoB,CAAC;YAChE,CAAC,uCAAuC,EAAE,uBAAuB,CAAC;YAClE,CAAC,6BAA6B,EAAE,aAAa,CAAC;SAC/C,CAAC;QACF,YAAY,EAAE,EAAE;QAChB,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;yDAiGD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/scheduler-editor/nylas-additional-participants/nylas-additional-participants.scss?tag=nylas-additional-participants&encapsulation=shadow","src/components/scheduler-editor/nylas-additional-participants/nylas-additional-participants.tsx"],"sourcesContent":["@import '../../../common/styles/variables.scss';\n\n:host {\n display: block;\n margin: 1rem;\n @include default-css-variables;\n}\n\n.nylas-additional-participants__title {\n color: var(--nylas-base-nylas-base-900-aaa, #101323);\n font-size: 16px;\n font-style: normal;\n font-weight: 600;\n line-height: 20px;\n /* 125% */\n margin: 0;\n text-align: left;\n}\n\n.nylas-additional-participants__subtitle {\n color: var(--nylas-base-600);\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 20px;\n /* 142.857% */\n margin: 0.25rem 0px 0px;\n text-align: left;\n}\n\n.nylas-additional-participants__content {\n padding: 1rem;\n display: flex;\n flex-direction: column;\n gap: 1rem;\n}\n\n.nylas-additional-participants__input_group {\n padding-top: 8px;\n display: flex;\n flex-direction: column;\n gap: 4px;\n\n label {\n display: flex;\n align-items: center;\n color: var(--nylas-base-800);\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 150%;\n }\n}\n\n.nylas-additional-participants__error {\n color: var(--nylas-error);\n font-size: 14px;\n font-family: var(--nylas-font-family);\n font-weight: 400;\n line-height: 16px;\n margin: 0;\n text-align: left;\n}\n\n.nylas-additional-participants__input_wrapper {\n display: flex;\n border-width: 1;\n border-radius: 8px;\n border: 1px solid var(--nylas-base-300);\n\n &.error {\n border-color: var(--nylas-error);\n }\n\n button {\n padding: 12px;\n border: none;\n border-left: 1px solid var(--nylas-base-300);\n background: none;\n cursor: pointer;\n\n &:hover,\n &:active {\n color: var(--nylas-primary);\n }\n }\n}\n\n.nylas-additional-participants__input_wrapper_organizer {\n border: none;\n}\n\n.nylas-additional-participants__input {\n flex: 1;\n display: flex;\n justify-content: space-between;\n\n input {\n border: none;\n outline: none;\n background: none;\n width: 100%;\n }\n\n input-dropdown {\n width: 100%;\n }\n\n input-dropdown::part(id_dropdown) {\n width: 100%;\n height: 100%;\n }\n\n input-dropdown::part(id_dropdown-input) {\n height: 100%;\n border-radius: var(--nylas-border-radius-2x);\n border: none;\n border-top-right-radius: initial;\n border-bottom-right-radius: initial;\n padding-left: 16px;\n }\n\n input-component::part(ic__input) {\n background: var(--nylas-base-50);\n }\n\n input-component::part(ic__label) {\n font-size: 14px;\n }\n\n input-component {\n div.required-input {\n display: flex;\n gap: 4px;\n\n label {\n display: flex;\n gap: 4px;\n align-items: center;\n\n tooltip-component#organizer_participant_tooltip::part(tc__content) {\n left: -84px;\n }\n }\n }\n }\n}\n\n.nylas-additional-participants__add {\n padding: 12px;\n display: flex;\n align-items: center;\n border: none;\n background: none;\n cursor: pointer;\n\n span {\n padding: 0 8px;\n font-size: 16px;\n font-style: normal;\n font-weight: 500;\n }\n\n &:hover,\n &:active {\n color: var(--nylas-primary);\n }\n}\n","import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug } from '@/utils/utils';\nimport { AttachInternals, Component, Host, Prop, State, Watch, h, Element, Listen, EventEmitter } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { Event } from '@stencil/core';\nimport { AdditionalParticipant, Configuration } from '@nylas/core';\nimport { User } from '@/common/nylas-api-request';\n\ntype Participant = {\n name?: string;\n email: string;\n is_valid?: boolean;\n is_organizer?: boolean;\n availability?: Availability;\n booking?: Booking;\n};\ntype Availability = {\n calendar_ids: string[];\n};\ntype Booking = {\n calendar_id: string;\n};\n\n/**\n * The `nylas-additional-participants` component is a form input for adding additional participants to an event.\n *\n * @part nap__title - The title of the component.\n * @part nap__subtitle - The subtitle of the component.\n * @part nap__content - The content of the component.\n * @part nap__input_group - The input group of the component.\n * @part nap__input_wrapper - The input wrapper of the component.\n * @part nap__input - The input of the component.\n * @part nap__remove-participant - The remove participant button of the component.\n * @part nap__add-participant - The add participant button of the component.\n *\n */\n@Component({\n tag: 'nylas-additional-participants',\n styleUrl: 'nylas-additional-participants.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasAdditionalParticipants {\n @Element() host!: HTMLNylasAdditionalParticipantsElement;\n /**\n * @standalone\n * The name of the component\n */\n @Prop() name: string = 'participants';\n /**\n * @standalone\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n /**\n * @standalone\n * The logged in user\n */\n @Prop() currentUser?: User;\n /**\n * @standalone\n * The additional participants options from the config\n */\n @Prop() participantOptions?: AdditionalParticipant[];\n /**\n * @standalone\n * The event participants\n */\n @Prop() eventParticipants?: Participant[];\n\n @AttachInternals() internals!: ElementInternals;\n @State() participants: Participant[] = this.eventParticipants ?? [];\n @State() participantErrors: { [key: string]: string } = {};\n @State() includeOrganizerAsParticipant: boolean = true;\n @State() isRoundRobinConfig: boolean = this.selectedConfiguration?.availability?.availability_rules?.availability_method !== 'collective';\n @State() error: string = '';\n\n /**\n * This event is fired when the selected participants change.\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\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-additional-participants', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('selectedConfiguration')\n selectedConfigurationChangedHandler(newValue: Configuration) {\n debug('nylas-additional-participants', 'selectedConfigurationChangedHandler', newValue);\n this.isRoundRobinConfig = newValue?.availability?.availability_rules?.availability_method !== 'collective';\n this.participants = newValue?.participants || [];\n this.updateOrganizerAsParticipant();\n }\n\n connectedCallback() {\n debug('nylas-additional-participants', 'connectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-additional-participants', 'componentWillLoad');\n this.host.setAttribute('name', this.name);\n }\n\n componentDidLoad() {\n debug('nylas-additional-participants', 'componentDidLoad');\n this.isRoundRobinConfig = this.selectedConfiguration?.availability?.availability_rules?.availability_method !== 'collective';\n this.includeOrganizerAsParticipant = this.isRoundRobinConfig && this.participants.find(p => p.email === this.currentUser?.email) ? true : false;\n\n if (this.selectedConfiguration) {\n this.selectedConfigurationChangedHandler(this.selectedConfiguration);\n } else {\n this.updateOrganizerAsParticipant();\n }\n }\n\n disconnectedCallback() {\n debug('nylas-additional-participants', 'disconnectedCallback');\n }\n\n /**\n * This method is essentially a workaround to check if the internals are available because\n * the unit tests in stencil do not support the internals.\n * @returns boolean\n */\n get isInternalsAvailable() {\n return this.internals !== undefined && typeof this.internals.setFormValue === 'function' && typeof this.internals.setValidity === 'function';\n }\n\n @Listen('inputOptionChanged')\n onInputOptionChanged(event: CustomEvent<{ value: string; name: string }>) {\n debug('nylas-additional-participants', 'onInputOptionChanged');\n const EMAIL_REGEX = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/;\n const index = event.detail.name;\n const participant = this.participantOptions?.find(participant => participant.email === event.detail.value);\n\n if (!participant && this.isRoundRobinConfig) {\n this.isInternalsAvailable && this.internals.setValidity({ customError: true }, 'For round robin configuration, participant should be selected from the dropdown.');\n this.participantErrors[index] = 'For round robin page, participant should be selected from the dropdown.';\n this.participants[index].is_valid = false;\n this.participants = [...this.participants];\n return;\n } else if (!participant && !EMAIL_REGEX.test(event.detail.value)) {\n this.isInternalsAvailable && this.internals.setValidity({ customError: true }, 'Please enter a valid email address');\n this.participantErrors[index] = 'Please enter a valid email address';\n this.participants[index].is_valid = false;\n this.participants = [...this.participants];\n return;\n } else {\n this.participantErrors[index] = '';\n this.participants[index].is_valid = true;\n this.isInternalsAvailable && this.internals.setValidity({});\n }\n this.participants[index].email = event.detail.value;\n this.participants[index].availability = participant ? { calendar_ids: ['primary'] } : undefined;\n // If round-robin config, set booking calendar to primary for all participants\n this.participants[index].booking = participant && this.isRoundRobinConfig ? { calendar_id: 'primary' } : undefined;\n this.participants[index].name = participant?.name || event.detail.value;\n this.participants = [...this.participants];\n this.updateFormValue();\n }\n\n updateOrganizerAsParticipant() {\n const findCurrentUserInParticipants = this.participants.find(p => p.email === this.currentUser?.email);\n if (this.isRoundRobinConfig && !findCurrentUserInParticipants && this.currentUser?.email) {\n this.participants = [\n {\n name: this.currentUser?.name,\n email: this.currentUser?.email,\n is_organizer: true,\n availability: {\n calendar_ids: ['primary'],\n },\n booking: {\n calendar_id: 'primary',\n },\n },\n ...this.participants,\n ];\n }\n this.updateFormValue();\n }\n\n addParticipant() {\n debug('nylas-additional-participants', 'addParticipant');\n this.participants = [...this.participants, { name: '', email: '', is_organizer: false }];\n this.updateFormValue();\n }\n removeParticipant(index: number) {\n debug('nylas-additional-participants', 'removeParticipant');\n this.participants = this.participants.filter((_, i) => i !== index);\n this.updateFormValue();\n }\n\n updateFormValue() {\n debug('nylas-additional-participants', 'updateFormValue');\n const participants = this.isRoundRobinConfig ? (this.includeOrganizerAsParticipant ? this.participants : this.participants.filter(p => !p.is_organizer)) : this.participants;\n if (participants.length === 0) {\n this.isInternalsAvailable && this.internals.setValidity({ customError: true }, 'Please add at least one participant');\n this.error = 'Please add at least one participant';\n } else {\n this.isInternalsAvailable && this.internals.setValidity({});\n this.error = '';\n this.isInternalsAvailable && this.internals.setFormValue(JSON.stringify(participants), this.name);\n this.valueChanged.emit({ value: JSON.stringify(participants), name: this.name });\n }\n }\n\n // Filter out the participants that are already added\n getArrayDifference(array1: AdditionalParticipant[], array2: Participant[]) {\n const filtered = array1.filter(participant1 => !array2.some(participant2 => participant1.email === participant2.email));\n return filtered.map(participant => {\n return { value: participant.email, label: participant.email };\n });\n }\n\n @RegisterComponent<NylasAdditionalParticipants, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-additional-participants',\n stateToProps: new Map([\n ['schedulerConfig.additionalParticipants', 'participantOptions'],\n ['schedulerConfig.selectedConfiguration', 'selectedConfiguration'],\n ['schedulerConfig.currentUser', 'currentUser'],\n ]),\n eventToProps: {},\n fireRegisterEvent: true,\n })\n render() {\n return (\n <Host part=\"nap\">\n <nylas-form-card>\n <h3 slot=\"header-title\" class=\"nylas-additional-participants__title\" part=\"nap__title\">\n Participants\n </h3>\n <p slot=\"header-subtitle\" class=\"nylas-additional-participants__subtitle\" part=\"nap__subtitle\">\n Add people in your team or organization to join the event.\n </p>\n <div slot=\"content\" class=\"nylas-additional-participants__content\">\n <div>\n {this.participants.map((participant, index) => {\n return (\n <div class={'nylas-additional-participants__input_group'} part=\"nap__input_group\">\n {!participant.is_organizer && <label>{`Participant ${index}`}</label>}\n <div\n part=\"nap__input_wrapper\"\n class={{\n 'nylas-additional-participants__input_wrapper': true,\n 'nylas-additional-participants__input_wrapper_organizer': participant?.is_organizer === true,\n 'nylas-additional-participants__input_wrapper_invalid': participant.is_valid === false,\n 'error': participant.is_valid === false,\n }}\n >\n <div class={{ 'nylas-additional-participants__input': true, 'organizer': participant?.is_organizer === true }} part=\"nap__input\">\n {participant.is_organizer ? (\n <input-component\n class={'label-input'}\n name={`${index}`}\n key={index}\n label=\"Organizer\"\n required={false}\n readOnly={participant.is_organizer}\n defaultValue={participant.email}\n >\n {this.isRoundRobinConfig && (\n <div class=\"required-input\" slot=\"additional-input\">\n <input\n type=\"checkbox\"\n name={`organizer_participant`}\n id={`organizer_participant`}\n onClick={() => {\n this.includeOrganizerAsParticipant = !this.includeOrganizerAsParticipant;\n this.updateFormValue();\n }}\n checked={this.includeOrganizerAsParticipant}\n />\n <label htmlFor={`organizer_participant`} aria-label=\"Include as participant\">\n Participant\n <tooltip-component id=\"organizer_participant_tooltip\">\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">\n <strong>Include Organizer:</strong> The organizer (you) will be included in the round-robin rotation. <br />\n <strong>Exclude Organizer:</strong> The organizer (you) will not be included in the round-robin rotation.\n </span>\n </tooltip-component>\n </label>\n </div>\n )}\n </input-component>\n ) : (\n <input-dropdown\n id={`${index}`}\n name={`${index}`}\n filterable={true}\n inputValue={participant.email}\n options={this.getArrayDifference(this.participantOptions || [], this.participants)}\n />\n )}\n {!participant.is_organizer && (\n <button onClick={() => this.removeParticipant(index)} part=\"nap__remove-participant\">\n <close-icon />\n </button>\n )}\n </div>\n </div>\n {!participant.is_valid && (\n <p class=\"nylas-additional-participants__error\" part=\"nap__error\">\n {this.participantErrors[index]}\n </p>\n )}\n </div>\n );\n })}\n <p class=\"nylas-additional-participants__error\" part=\"nap__error\">\n {this.error}\n </p>\n </div>\n <button class=\"nylas-additional-participants__add\" part=\"nap__add-participant\" onClick={() => this.addParticipant()}>\n <add-circle-icon /> <span>Add {this.participants.length > 1 ? 'another' : 'a'} participant</span>\n </button>\n </div>\n </nylas-form-card>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -39,9 +39,9 @@ const NylasConfirmationEmail = proxyCustomElement(class NylasConfirmationEmail e
39
39
  this.internals = this.attachInternals();
40
40
  this.selectedConfiguration = undefined;
41
41
  this.confirmationEmailTemplate = {};
42
- this.isOpen = false;
43
42
  this.participants = [];
44
43
  this.name = 'confirmation-email-template';
44
+ this.isOpen = false;
45
45
  this.confirmationEmail = undefined;
46
46
  this.isConfirmationEmailOpen = this.isOpen;
47
47
  this.participantsState = this.participants;
@@ -94,8 +94,17 @@ const NylasConfirmationEmail = proxyCustomElement(class NylasConfirmationEmail e
94
94
  const { value, name } = event.detail;
95
95
  if (name === 'confirmation-email-logo') {
96
96
  this.confirmationEmail = { ...this.confirmationEmail, logo: value };
97
- this.internals.setFormValue(JSON.stringify(this.confirmationEmail), this.name);
98
97
  this.valueChanged.emit({ value: JSON.stringify(this.confirmationEmail), name: this.name });
98
+ if (typeof this.internals.setValidity === 'function' && typeof this.internals.setFormValue === 'function') {
99
+ this.internals.setFormValue(JSON.stringify(this.confirmationEmail), this.name);
100
+ this.internals.setValidity({});
101
+ }
102
+ }
103
+ }
104
+ async nylasFormInputImageUrlInvalidHandler(event) {
105
+ const { value, name } = event.detail;
106
+ if (name === 'confirmation-email-logo' && typeof this.internals.setValidity === 'function') {
107
+ this.internals.setValidity({ customError: true }, value || 'Invalid image URL.');
99
108
  }
100
109
  }
101
110
  updateConfirmationFormValue() {
@@ -115,7 +124,7 @@ const NylasConfirmationEmail = proxyCustomElement(class NylasConfirmationEmail e
115
124
  render() {
116
125
  const organizer = this.participantsState.find(p => p.is_organizer);
117
126
  const organizerName = organizer?.name || organizer?.email;
118
- return (h(Host, { key: '0cd4c1886c65ead0e525ea96fe26a1316c61db7f' }, h("div", { key: '1901775f8a1364fe16485eeaf27d44862e74a642', class: "nylas-confirmation-email", part: "nce" }, h("div", { key: '241cf1a885d4d97d53c158e5691e350aa14b549f', class: "header", part: "nce__header" }, h("div", { key: 'e37c36a4d8f1f82669f3a397969202d3a2612b0e' }, h("h3", { key: 'ae34b848907720867cb014000e5b7367bcabedb3' }, this.confirmationEmail?.booking_confirmed?.title ?? `Booking confirmed with ${organizerName ? ` ${organizerName}` : ''}`), h("p", { key: '97d7c78a88b20be8c5b0a27485f917628f1c6edc' }, "Booking confirmation email")), this.isConfirmationEmailOpen ? (h("div", { class: "confirmation-email-toggle", part: "nce__confirmation-email-toggle--container" }, h("span", { class: `chevron ${this.isConfirmationEmailOpen ? 'open' : 'closed'} `, onClick: () => this.toggleConfirmationEmail() }, h("chevron-icon", { width: "24", height: "24" })))) : (h("button-component", { variant: 'basic', clickHandler: event => {
127
+ return (h(Host, { key: 'bc4803b94f914d083bd33cf4cecd0cac70b0658c' }, h("div", { key: '6445d38b903bffd19b4db004e850f6488ed4c27f', class: "nylas-confirmation-email", part: "nce" }, h("div", { key: '7ce1ccd72ef83717aec42fe0b533902e3a254796', class: "header", part: "nce__header" }, h("div", { key: 'cbceb816c30deebc4e053a7abd1da1c82c171ebe' }, h("h3", { key: '36f5b00d5a98d325341ff06b2bb3ba3cf951e94f' }, this.confirmationEmail?.booking_confirmed?.title ?? `Booking confirmed with ${organizerName ? ` ${organizerName}` : ''}`), h("p", { key: '6f72022d71e5f4e3c03d0f6d07d7f0f5bc0f9686' }, "Booking confirmation email")), this.isConfirmationEmailOpen ? (h("div", { class: "confirmation-email-toggle", part: "nce__confirmation-email-toggle--container" }, h("span", { class: `chevron ${this.isConfirmationEmailOpen ? 'open' : 'closed'} `, onClick: () => this.toggleConfirmationEmail() }, h("chevron-icon", { width: "24", height: "24" })))) : (h("button-component", { variant: 'basic', clickHandler: event => {
119
128
  event.preventDefault();
120
129
  this.toggleConfirmationEmail();
121
130
  } }, h("edit-icon", { width: "16", height: "16" }), "Edit"))), this.isConfirmationEmailOpen ? (h("div", { class: "nylas-confirmation-email__body", part: "nce__body" }, h("div", { class: "nylas-confirmation-email__section" }, h("div", { class: "nylas-confirmation-email__row" }, h("label", null, "Send confirmation email", h("span", { class: "label-icon" }, h("tooltip-component", null, h("info-icon", { slot: "tooltip-icon" }), h("span", { slot: "tooltip-content" }, "You and your guests will receive a confirmation email immediately upon booking.")))), h("span", { class: "selected-value" }, "Immediately upon booking")), h("div", { class: "nylas-confirmation-email__row" }, h("div", { class: "subsection" }, h("div", { class: "input-container" }, h("label", null, "Company logo URL", h("span", { class: "label-icon" }, h("tooltip-component", null, h("info-icon", { slot: "tooltip-icon" }), h("span", { slot: "tooltip-content" }, "This logo appears in the booking confirmation email. The URL must be publicly accessible. The image will be scaled down to a max size of 200px x 100px.")))), this.confirmationEmail && (h("input-image-url", { name: "confirmation-email-logo", exportparts: "iiu__logo-input-textfield: nce__input-image-url", imageUrl: this.confirmationEmail?.logo ?? '' }))))), h("div", { class: "nylas-confirmation-email__row full-width-col" }, h("div", { class: "subsection" }, h("h3", null, "Email message"), h("div", { class: "input-container" }, h("label", { htmlFor: "title" }, "Custom email title", h("span", { class: "label-icon" }, h("tooltip-component", null, h("info-icon", { slot: "tooltip-icon" }), h("span", { slot: "tooltip-content" }, "An email title is a headline within the body of the email. This doesn't change the subject line.")))), h("input-component", { name: "confirmation-email-title", maxLength: 60, placeholder: `Booking confirmed ${organizerName ? `with ${organizerName}` : ''}`, defaultValue: this.confirmationEmail?.booking_confirmed?.title ?? '' })), h("div", { class: "input-container" }, h("textarea-component", { label: "Additional info", name: "confirmation-email-body", id: "confirmation-email-body", placeholder: "Default body", tooltip: "Scheduler adds the content of the box to the email body.", maxLength: 500, defaultValue: this.confirmationEmail?.booking_confirmed?.body ?? '' }))))))) : (h("div", { class: "nylas-confirmation-email__summary", part: "nce__summary" }, h("p", null, h("span", { class: "summary-icon" }, h("person-clipboard-icon", null)), "All host & guests"), h("p", null, h("span", { class: "summary-icon" }, h("clock-icon", null)), "Immediately on booking"))))));
@@ -130,13 +139,13 @@ const NylasConfirmationEmail = proxyCustomElement(class NylasConfirmationEmail e
130
139
  }, [65, "nylas-confirmation-email", {
131
140
  "selectedConfiguration": [16],
132
141
  "confirmationEmailTemplate": [16],
133
- "isOpen": [4, "is-open"],
134
142
  "participants": [16],
135
143
  "name": [1],
144
+ "isOpen": [4, "is-open"],
136
145
  "confirmationEmail": [32],
137
146
  "isConfirmationEmailOpen": [32],
138
147
  "participantsState": [32]
139
- }, [[0, "nylasFormInputChanged", "nylasFormInputChangeHandler"], [0, "valueChanged", "valueChangedHandler"]], {
148
+ }, [[0, "nylasFormInputChanged", "nylasFormInputChangeHandler"], [0, "valueChanged", "valueChangedHandler"], [0, "nylasFormInputImageUrlInvalid", "nylasFormInputImageUrlInvalidHandler"]], {
140
149
  "name": ["elementNameChangedHandler"],
141
150
  "selectedConfiguration": ["selectedConfigurationChangedHandler"]
142
151
  }]);
@@ -1 +1 @@
1
- {"file":"nylas-confirmation-email2.js","mappings":";;;;;;;;;;;;;;;AAAA,MAAM,yBAAyB,GAAG,8vQAA8vQ,CAAC;AACjyQ,qCAAe,yBAAyB;;;;;;;;;;;;;;;;MCuB3B,sBAAsB;;;;;;;;yCAUkB,EAAmB;sBAI5C,KAAK;4BAIO,EAAE;oBAIjB,6BAA6B;;uCAcR,IAAI,CAAC,MAAM;iCAKX,IAAI,CAAC,YAAY;;IAY7D,iBAAiB;QACf,KAAK,CAAC,0BAA0B,EAAE,mBAAmB,CAAC,CAAC;KACxD;IAED,oBAAo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,CACF,KAEN,WAAK,KAAK,EAAC,mCAAmC,EAAC,IAAI,EAAC,cAAc,IAChE,aACE,YAAM,KAAK,EAAC,cAAc,IACxB,gCAA+C,CAC1C,sBAEL,EACJ,aACE,YAAM,KAAK,EAAC,cAAc,IACxB,qBAAyB,CACpB,2BAEL,CACA,CACP,CACG,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;AA3ID;IAjBC,iBAAiB,CAA4G;QAC5H,IAAI,EAAE,0BAA0B;QAChC,YAAY,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,uCAAuC,EAAE,uBAAuB,CAAC,CAAC,CAAC;QAC3F,YAAY,EAAE;YACZ,YAAY,EAAE,OACZ,KAAiI,EACjI,8BAA6D;gBAE7D,MAAM,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC;gBAEtC,IAAI,YAAY,EAAE;oBAChB,YAAY,CAAC,KAAK,CAAC,CAAC;iBACrB;aACF;SACF;QACD,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;oDA4ID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/scheduler-editor/nylas-confirmation-email/nylas-confirmation-email.scss?tag=nylas-confirmation-email&encapsulation=shadow","src/components/scheduler-editor/nylas-confirmation-email/nylas-confirmation-email.tsx"],"sourcesContent":["@import '../../../common/styles/variables.scss';\n\n:host {\n display: block;\n @include default-css-variables;\n width: inherit;\n}\n\n.nylas-confirmation-email {\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 text-align: left;\n\n .header {\n padding: 1rem;\n display: grid;\n grid-template-columns: 1fr auto;\n border-bottom: 1px solid var(--nylas-base-200);\n\n h3 {\n border-radius: var(--nylas-border-radius-2x);\n margin: 0;\n font-size: 1rem;\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 }\n\n .confirmation-email-toggle {\n display: flex;\n gap: 24px;\n align-items: center;\n\n .chevron {\n display: flex;\n align-self: center;\n cursor: pointer;\n\n &:hover,\n &:active {\n color: var(--nylas-primary);\n }\n\n &.open {\n transform: rotate(90deg);\n }\n\n &.closed {\n transform: rotate(270deg);\n }\n\n &.disabled {\n cursor: not-allowed;\n color: var(--nylas-base-300);\n\n &:hover {\n color: var(--nylas-base-300);\n }\n }\n }\n }\n }\n\n .nylas-confirmation-email__body {\n display: grid;\n grid-template-columns: 1fr auto;\n background-color: var(--nylas-base-25);\n border-radius: var(--nylas-border-radius-2x);\n\n @media #{$mobile} {\n grid-template-columns: 1fr;\n }\n\n .nylas-confirmation-email__section {\n padding: 1rem;\n display: flex;\n flex-direction: column;\n gap: 1rem;\n color: var(--nylas-base-800);\n\n @media #{$mobile} {\n border: none;\n }\n\n .nylas-confirmation-email__row {\n display: grid;\n grid-template-columns: 1fr auto;\n align-items: center;\n gap: 1rem;\n\n &.full-width-col {\n grid-template-columns: 1fr;\n border-top: 1px solid var(--nylas-base-200);\n padding-top: 1.25rem;\n margin: 0.25rem 0;\n }\n\n label {\n display: flex;\n align-items: center;\n\n span.required {\n color: var(--nylas-error, #cc4841);\n }\n\n span.label-icon {\n margin-left: 4px;\n\n tooltip-component {\n display: flex;\n }\n }\n }\n\n p {\n margin: 0.25rem 0 0 0;\n font-size: 1rem;\n font-weight: 500;\n line-height: 24px;\n color: var(--nylas-base-900);\n }\n\n .company-logo-container {\n display: flex;\n gap: 32px;\n width: 100%;\n\n .input-container {\n display: flex;\n flex-direction: column;\n flex: 1;\n }\n\n .company-logo {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 200px;\n height: 100px;\n border: var(--nylas-base-200) solid 1px;\n border-radius: var(--nylas-border-radius-2x);\n overflow: hidden;\n padding: 10px;\n }\n\n .company-logo img {\n max-height: 100%;\n max-width: 100%;\n object-fit: contain;\n object-position: center;\n }\n }\n\n span.selected-value {\n font-weight: 500;\n }\n }\n\n .subsection {\n display: flex;\n flex-direction: column;\n gap: 1rem;\n\n h3 {\n margin: 0;\n font-size: 1rem;\n font-weight: 600;\n line-height: 20px;\n color: var(--nylas-base-900);\n text-align: left;\n }\n\n .input-container {\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\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 }\n }\n }\n }\n\n .nylas-confirmation-email__preview {\n width: 208px;\n background: var(--nylas-base-25);\n border-bottom-right-radius: var(--nylas-border-radius-2x);\n\n @media #{$mobile} {\n width: inherit;\n border-bottom-left-radius: var(--nylas-border-radius-2x);\n }\n\n h4 {\n font-size: 14px;\n line-height: 24px;\n color: var(--nylas-base-600);\n font-family: var(--nylas-font-family);\n font-weight: 500;\n text-align: center;\n margin: 0.75rem 0;\n }\n\n .preview-container {\n padding: 0 2rem 1rem;\n\n .slot {\n background-color: transparent;\n border-top: 1px solid var(--nylas-base-300);\n\n &.active {\n background-color: var(--nylas-base-100);\n }\n\n &:last-of-type {\n border-bottom: 1px solid var(--nylas-base-300);\n }\n }\n\n .event-slot {\n background-color: var(--nylas-base-600);\n border-top: 1px solid var(--nylas-base-300);\n }\n }\n }\n\n span.error-message {\n color: var(--nylas-error);\n }\n\n span.help-text {\n margin: 0.25rem 0 0 0;\n font-size: 0.875rem;\n font-weight: 400;\n line-height: 20px;\n color: var(--nylas-base-600);\n text-align: left;\n }\n }\n\n .nylas-confirmation-email__summary {\n padding: 0.75rem 1rem;\n display: grid;\n grid-template-columns: auto 1fr;\n column-gap: 1rem;\n\n p {\n margin: 0;\n display: flex;\n align-items: center;\n column-gap: 4px;\n font-size: 0.875rem;\n font-weight: 400;\n line-height: 21px;\n color: var(--nylas-base-600);\n text-align: left;\n\n span.summary-icon {\n display: flex;\n justify-content: center;\n min-width: 20px;\n }\n }\n }\n}\n\nsp-divider {\n background-color: var(--nylas-base-200);\n height: 1px;\n margin: 0.25rem 0;\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, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { Configuration, EmailTemplate, Participant } from '@nylas/core';\n\n/**\n * The `nylas-confirmation-email` component is a UI component that allows users to set buffer time before and after an event.\n *\n * @part nce__tab-heading - The nylas-confirmation-email main tab heading\n * @part nce - The nylas-confirmation-email container\n * @part nce__header - The header of the event communication section\n * @part nce__body - The body of the event communication section\n * @part nce__confirmation-email-toggle--container - The confirmation email drawer toggle container\n * @part nce__input-image-url - The input image URL container\n * @part nce__summary - The confirmation card summary container\n */\n@Component({\n tag: 'nylas-confirmation-email',\n styleUrl: 'nylas-confirmation-email.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasConfirmationEmail {\n @Element() host!: HTMLNylasConfirmationEmailElement;\n /**\n * @internal\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n /**\n * The confirmation email template data to display\n */\n @Prop() confirmationEmailTemplate: EmailTemplate = {} as EmailTemplate;\n /**\n * Is the confirmation email card open\n */\n @Prop() isOpen: boolean = false;\n /**\n * List of participants\n */\n @Prop() participants: Participant[] = [];\n /**\n * The name of the component\n */\n @Prop() name: string = 'confirmation-email-template';\n /**\n * The element internals.\n */\n @AttachInternals() internals!: ElementInternals;\n\n /**\n * The confirmation email template state.\n */\n @State() confirmationEmail!: EmailTemplate;\n\n /**\n * The internal state to store the isOpen state.\n */\n @State() isConfirmationEmailOpen: boolean = this.isOpen;\n\n /**\n * The internal state to store the participants.\n */\n @State() participantsState: Participant[] = this.participants;\n\n /**\n * This event is fired when the email reminders change.\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n valueChanged?: (event: CustomEvent<{ value: string; name: string }>) => void;\n }>;\n\n // Lifecycle methods\n connectedCallback() {\n debug('nylas-confirmation-email', 'connectedCallback');\n }\n\n disconnectedCallback() {\n debug('nylas-confirmation-email', 'disconnectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-confirmation-email', '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-confirmation-email', 'componentDidLoad');\n if (this.selectedConfiguration) {\n this.selectedConfigurationChangedHandler(this.selectedConfiguration);\n } else {\n this.confirmationEmail = this.confirmationEmailTemplate;\n this.isConfirmationEmailOpen = this.isOpen;\n this.participantsState = this.participants;\n }\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-confirmation-email', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('selectedConfiguration')\n selectedConfigurationChangedHandler(newValue: Configuration) {\n debug('nylas-confirmation-email', 'selectedConfigurationChangedHandler', newValue);\n this.confirmationEmail = newValue?.scheduler?.email_template || this.confirmationEmailTemplate;\n this.isConfirmationEmailOpen = !newValue?.event_booking?.reminders?.length;\n this.participantsState = newValue?.participants || this.participants;\n }\n\n @Listen('nylasFormInputChanged')\n async nylasFormInputChangeHandler(event: CustomEvent<{ value: string; name: string; type?: string }>) {\n const { name, value } = event.detail;\n const type = event.detail?.type;\n if (name === 'confirmation-email-title') {\n this.confirmationEmail = { ...this.confirmationEmail, booking_confirmed: { ...(this.confirmationEmail?.booking_confirmed || {}), title: value } };\n this.internals.setFormValue(JSON.stringify(this.confirmationEmail), this.name);\n this.valueChanged.emit({ value: JSON.stringify(this.confirmationEmail), name: this.name });\n } else if (name === 'confirmation-email-body' && type === 'multi_line_text') {\n this.handleEmailBodyChange(event);\n }\n }\n\n @Listen('valueChanged')\n valueChangedHandler(event: CustomEvent<{ value: string; name: string }>) {\n debug('nylas-confirmation-email', 'valueChangedHandler', event.detail);\n const { value, name } = event.detail;\n\n if (name === 'confirmation-email-logo') {\n this.confirmationEmail = { ...this.confirmationEmail, logo: value };\n this.internals.setFormValue(JSON.stringify(this.confirmationEmail), this.name);\n this.valueChanged.emit({ value: JSON.stringify(this.confirmationEmail), name: this.name });\n }\n }\n\n updateConfirmationFormValue() {\n debug('nylas-confirmation-email', 'updateConfirmationFormValue');\n this.internals.setFormValue(JSON.stringify(this.confirmationEmail), this.name);\n this.valueChanged.emit({ value: JSON.stringify(this.confirmationEmail), name: this.name });\n }\n\n toggleConfirmationEmail() {\n this.isConfirmationEmailOpen = !this.isConfirmationEmailOpen;\n }\n\n handleEmailBodyChange(event) {\n const value = sanitize(event.detail.value);\n this.confirmationEmail = { ...this.confirmationEmail, booking_confirmed: { ...(this.confirmationEmail?.booking_confirmed || {}), body: value } };\n this.internals.setFormValue(JSON.stringify(this.confirmationEmail), this.name);\n this.valueChanged.emit({ value: JSON.stringify(this.confirmationEmail), name: this.name });\n }\n\n @RegisterComponent<NylasConfirmationEmail, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-confirmation-email',\n stateToProps: new Map([['schedulerConfig.selectedConfiguration', 'selectedConfiguration']]),\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 organizer = this.participantsState.find(p => p.is_organizer);\n const organizerName = organizer?.name || organizer?.email;\n\n return (\n <Host>\n <div class=\"nylas-confirmation-email\" part=\"nce\">\n <div class=\"header\" part=\"nce__header\">\n <div>\n <h3>{this.confirmationEmail?.booking_confirmed?.title ?? `Booking confirmed with ${organizerName ? ` ${organizerName}` : ''}`}</h3>\n <p>Booking confirmation email</p>\n </div>\n {this.isConfirmationEmailOpen ? (\n <div class=\"confirmation-email-toggle\" part=\"nce__confirmation-email-toggle--container\">\n <span class={`chevron ${this.isConfirmationEmailOpen ? 'open' : 'closed'} `} onClick={() => this.toggleConfirmationEmail()}>\n <chevron-icon width=\"24\" height=\"24\" />\n </span>\n </div>\n ) : (\n <button-component\n variant={'basic'}\n clickHandler={event => {\n event.preventDefault();\n this.toggleConfirmationEmail();\n }}\n >\n <edit-icon width=\"16\" height=\"16\"></edit-icon>\n Edit\n </button-component>\n )}\n </div>\n\n {this.isConfirmationEmailOpen ? (\n <div class=\"nylas-confirmation-email__body\" part=\"nce__body\">\n <div class=\"nylas-confirmation-email__section\">\n <div class=\"nylas-confirmation-email__row\">\n <label>\n Send confirmation email\n <span class=\"label-icon\">\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">You and your guests will receive a confirmation email immediately upon booking.</span>\n </tooltip-component>\n </span>\n </label>\n <span class=\"selected-value\">Immediately upon booking</span>\n </div>\n <div class=\"nylas-confirmation-email__row\">\n <div class=\"subsection\">\n <div class=\"input-container\">\n <label>\n Company logo URL\n <span class=\"label-icon\">\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">\n This logo appears in the booking confirmation email. The URL must be publicly accessible. The image will be scaled down to a max size of 200px x\n 100px.\n </span>\n </tooltip-component>\n </span>\n </label>\n\n {this.confirmationEmail && (\n <input-image-url\n name=\"confirmation-email-logo\"\n exportparts=\"iiu__logo-input-textfield: nce__input-image-url\"\n imageUrl={this.confirmationEmail?.logo ?? ''}\n />\n )}\n </div>\n </div>\n </div>\n <div class=\"nylas-confirmation-email__row full-width-col\">\n <div class=\"subsection\">\n <h3>Email message</h3>\n <div class=\"input-container\">\n <label htmlFor=\"title\">\n Custom email title\n <span class=\"label-icon\">\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">An email title is a headline within the body of the email. This doesn&apos;t change the subject line.</span>\n </tooltip-component>\n </span>\n </label>\n <input-component\n name=\"confirmation-email-title\"\n maxLength={60}\n placeholder={`Booking confirmed ${organizerName ? `with ${organizerName}` : ''}`}\n defaultValue={this.confirmationEmail?.booking_confirmed?.title ?? ''}\n ></input-component>\n </div>\n <div class=\"input-container\">\n {/* <label htmlFor=\"title\">Email body</label> */}\n <textarea-component\n label=\"Additional info\"\n name=\"confirmation-email-body\"\n id=\"confirmation-email-body\"\n placeholder=\"Default body\"\n tooltip=\"Scheduler adds the content of the box to the email body.\"\n maxLength={500}\n defaultValue={this.confirmationEmail?.booking_confirmed?.body ?? ''}\n ></textarea-component>\n\n {/* <textarea\n id=\"description\"\n part=\"nrt__textarea\"\n name=\"confirmation-email-body\"\n placeholder='Default body'\n value={this.confirmationEmail?.booking_confirmed?.body ?? ''}\n maxlength=\"500\"\n rows={2}\n onInput={e => this.handleEmailBodyChange(e)}\n ></textarea> */}\n </div>\n </div>\n </div>\n </div>\n </div>\n ) : (\n <div class=\"nylas-confirmation-email__summary\" part=\"nce__summary\">\n <p>\n <span class=\"summary-icon\">\n <person-clipboard-icon></person-clipboard-icon>\n </span>\n All host & guests\n </p>\n <p>\n <span class=\"summary-icon\">\n <clock-icon></clock-icon>\n </span>\n Immediately on booking\n </p>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"nylas-confirmation-email2.js","mappings":";;;;;;;;;;;;;;;AAAA,MAAM,yBAAyB,GAAG,8vQAA8vQ,CAAC;AACjyQ,qCAAe,yBAAyB;;;;;;;;;;;;;;;;MCuB3B,sBAAsB;;;;;;;;yCAWkB,E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Y,EAAE;oBAChB,YAAY,CAAC,KAAK,CAAC,CAAC;iBACrB;aACF;SACF;QACD,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;oDA4ID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/scheduler-editor/nylas-confirmation-email/nylas-confirmation-email.scss?tag=nylas-confirmation-email&encapsulation=shadow","src/components/scheduler-editor/nylas-confirmation-email/nylas-confirmation-email.tsx"],"sourcesContent":["@import '../../../common/styles/variables.scss';\n\n:host {\n display: block;\n @include default-css-variables;\n width: inherit;\n}\n\n.nylas-confirmation-email {\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 text-align: left;\n\n .header {\n padding: 1rem;\n display: grid;\n grid-template-columns: 1fr auto;\n border-bottom: 1px solid var(--nylas-base-200);\n\n h3 {\n border-radius: var(--nylas-border-radius-2x);\n margin: 0;\n font-size: 1rem;\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 }\n\n .confirmation-email-toggle {\n display: flex;\n gap: 24px;\n align-items: center;\n\n .chevron {\n display: flex;\n align-self: center;\n cursor: pointer;\n\n &:hover,\n &:active {\n color: var(--nylas-primary);\n }\n\n &.open {\n transform: rotate(90deg);\n }\n\n &.closed {\n transform: rotate(270deg);\n }\n\n &.disabled {\n cursor: not-allowed;\n color: var(--nylas-base-300);\n\n &:hover {\n color: var(--nylas-base-300);\n }\n }\n }\n }\n }\n\n .nylas-confirmation-email__body {\n display: grid;\n grid-template-columns: 1fr auto;\n background-color: var(--nylas-base-25);\n border-radius: var(--nylas-border-radius-2x);\n\n @media #{$mobile} {\n grid-template-columns: 1fr;\n }\n\n .nylas-confirmation-email__section {\n padding: 1rem;\n display: flex;\n flex-direction: column;\n gap: 1rem;\n color: var(--nylas-base-800);\n\n @media #{$mobile} {\n border: none;\n }\n\n .nylas-confirmation-email__row {\n display: grid;\n grid-template-columns: 1fr auto;\n align-items: center;\n gap: 1rem;\n\n &.full-width-col {\n grid-template-columns: 1fr;\n border-top: 1px solid var(--nylas-base-200);\n padding-top: 1.25rem;\n margin: 0.25rem 0;\n }\n\n label {\n display: flex;\n align-items: center;\n\n span.required {\n color: var(--nylas-error, #cc4841);\n }\n\n span.label-icon {\n margin-left: 4px;\n\n tooltip-component {\n display: flex;\n }\n }\n }\n\n p {\n margin: 0.25rem 0 0 0;\n font-size: 1rem;\n font-weight: 500;\n line-height: 24px;\n color: var(--nylas-base-900);\n }\n\n .company-logo-container {\n display: flex;\n gap: 32px;\n width: 100%;\n\n .input-container {\n display: flex;\n flex-direction: column;\n flex: 1;\n }\n\n .company-logo {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 200px;\n height: 100px;\n border: var(--nylas-base-200) solid 1px;\n border-radius: var(--nylas-border-radius-2x);\n overflow: hidden;\n padding: 10px;\n }\n\n .company-logo img {\n max-height: 100%;\n max-width: 100%;\n object-fit: contain;\n object-position: center;\n }\n }\n\n span.selected-value {\n font-weight: 500;\n }\n }\n\n .subsection {\n display: flex;\n flex-direction: column;\n gap: 1rem;\n\n h3 {\n margin: 0;\n font-size: 1rem;\n font-weight: 600;\n line-height: 20px;\n color: var(--nylas-base-900);\n text-align: left;\n }\n\n .input-container {\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\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 }\n }\n }\n }\n\n .nylas-confirmation-email__preview {\n width: 208px;\n background: var(--nylas-base-25);\n border-bottom-right-radius: var(--nylas-border-radius-2x);\n\n @media #{$mobile} {\n width: inherit;\n border-bottom-left-radius: var(--nylas-border-radius-2x);\n }\n\n h4 {\n font-size: 14px;\n line-height: 24px;\n color: var(--nylas-base-600);\n font-family: var(--nylas-font-family);\n font-weight: 500;\n text-align: center;\n margin: 0.75rem 0;\n }\n\n .preview-container {\n padding: 0 2rem 1rem;\n\n .slot {\n background-color: transparent;\n border-top: 1px solid var(--nylas-base-300);\n\n &.active {\n background-color: var(--nylas-base-100);\n }\n\n &:last-of-type {\n border-bottom: 1px solid var(--nylas-base-300);\n }\n }\n\n .event-slot {\n background-color: var(--nylas-base-600);\n border-top: 1px solid var(--nylas-base-300);\n }\n }\n }\n\n span.error-message {\n color: var(--nylas-error);\n }\n\n span.help-text {\n margin: 0.25rem 0 0 0;\n font-size: 0.875rem;\n font-weight: 400;\n line-height: 20px;\n color: var(--nylas-base-600);\n text-align: left;\n }\n }\n\n .nylas-confirmation-email__summary {\n padding: 0.75rem 1rem;\n display: grid;\n grid-template-columns: auto 1fr;\n column-gap: 1rem;\n\n p {\n margin: 0;\n display: flex;\n align-items: center;\n column-gap: 4px;\n font-size: 0.875rem;\n font-weight: 400;\n line-height: 21px;\n color: var(--nylas-base-600);\n text-align: left;\n\n span.summary-icon {\n display: flex;\n justify-content: center;\n min-width: 20px;\n }\n }\n }\n}\n\nsp-divider {\n background-color: var(--nylas-base-200);\n height: 1px;\n margin: 0.25rem 0;\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, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { Configuration, EmailTemplate, Participant } from '@nylas/core';\n\n/**\n * The `nylas-confirmation-email` component is a UI component that allows users to set buffer time before and after an event.\n *\n * @part nce__tab-heading - The nylas-confirmation-email main tab heading\n * @part nce - The nylas-confirmation-email container\n * @part nce__header - The header of the event communication section\n * @part nce__body - The body of the event communication section\n * @part nce__confirmation-email-toggle--container - The confirmation email drawer toggle container\n * @part nce__input-image-url - The input image URL container\n * @part nce__summary - The confirmation card summary container\n */\n@Component({\n tag: 'nylas-confirmation-email',\n styleUrl: 'nylas-confirmation-email.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasConfirmationEmail {\n @Element() host!: HTMLNylasConfirmationEmailElement;\n /**\n * @standalone\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n /**\n * @standalone\n * The confirmation email template data to display\n */\n @Prop() confirmationEmailTemplate: EmailTemplate = {} as EmailTemplate;\n /**\n * @standalone\n * List of participants\n */\n @Prop() participants: Participant[] = [];\n /**\n * @standalone\n * The name of the component\n */\n @Prop() name: string = 'confirmation-email-template';\n /**\n * Is the confirmation email card open\n */\n @Prop() isOpen: boolean = false;\n /**\n * The element internals.\n */\n @AttachInternals() internals!: ElementInternals;\n\n /**\n * The confirmation email template state.\n */\n @State() confirmationEmail!: EmailTemplate;\n\n /**\n * The internal state to store the isOpen state.\n */\n @State() isConfirmationEmailOpen: boolean = this.isOpen;\n\n /**\n * The internal state to store the participants.\n */\n @State() participantsState: Participant[] = this.participants;\n\n /**\n * This event is fired when the email reminders change.\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n valueChanged?: (event: CustomEvent<{ value: string; name: string }>) => void;\n }>;\n\n // Lifecycle methods\n connectedCallback() {\n debug('nylas-confirmation-email', 'connectedCallback');\n }\n\n disconnectedCallback() {\n debug('nylas-confirmation-email', 'disconnectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-confirmation-email', '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-confirmation-email', 'componentDidLoad');\n if (this.selectedConfiguration) {\n this.selectedConfigurationChangedHandler(this.selectedConfiguration);\n } else {\n this.confirmationEmail = this.confirmationEmailTemplate;\n this.isConfirmationEmailOpen = this.isOpen;\n this.participantsState = this.participants;\n }\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-confirmation-email', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('selectedConfiguration')\n selectedConfigurationChangedHandler(newValue: Configuration) {\n debug('nylas-confirmation-email', 'selectedConfigurationChangedHandler', newValue);\n this.confirmationEmail = newValue?.scheduler?.email_template || this.confirmationEmailTemplate;\n this.isConfirmationEmailOpen = !newValue?.event_booking?.reminders?.length;\n this.participantsState = newValue?.participants || this.participants;\n }\n\n @Listen('nylasFormInputChanged')\n async nylasFormInputChangeHandler(event: CustomEvent<{ value: string; name: string; type?: string }>) {\n const { name, value } = event.detail;\n const type = event.detail?.type;\n if (name === 'confirmation-email-title') {\n this.confirmationEmail = { ...this.confirmationEmail, booking_confirmed: { ...(this.confirmationEmail?.booking_confirmed || {}), title: value } };\n this.internals.setFormValue(JSON.stringify(this.confirmationEmail), this.name);\n this.valueChanged.emit({ value: JSON.stringify(this.confirmationEmail), name: this.name });\n } else if (name === 'confirmation-email-body' && type === 'multi_line_text') {\n this.handleEmailBodyChange(event);\n }\n }\n\n @Listen('valueChanged')\n valueChangedHandler(event: CustomEvent<{ value: string; name: string }>) {\n debug('nylas-confirmation-email', 'valueChangedHandler', event.detail);\n const { value, name } = event.detail;\n\n if (name === 'confirmation-email-logo') {\n this.confirmationEmail = { ...this.confirmationEmail, logo: value };\n this.valueChanged.emit({ value: JSON.stringify(this.confirmationEmail), name: this.name });\n if (typeof this.internals.setValidity === 'function' && typeof this.internals.setFormValue === 'function') {\n this.internals.setFormValue(JSON.stringify(this.confirmationEmail), this.name);\n this.internals.setValidity({});\n }\n }\n }\n\n @Listen('nylasFormInputImageUrlInvalid')\n async nylasFormInputImageUrlInvalidHandler(event: CustomEvent<{ value: string; name: string }>) {\n const { value, name } = event.detail;\n if (name === 'confirmation-email-logo' && typeof this.internals.setValidity === 'function') {\n this.internals.setValidity({ customError: true }, value || 'Invalid image URL.');\n }\n }\n\n updateConfirmationFormValue() {\n debug('nylas-confirmation-email', 'updateConfirmationFormValue');\n this.internals.setFormValue(JSON.stringify(this.confirmationEmail), this.name);\n this.valueChanged.emit({ value: JSON.stringify(this.confirmationEmail), name: this.name });\n }\n\n toggleConfirmationEmail() {\n this.isConfirmationEmailOpen = !this.isConfirmationEmailOpen;\n }\n\n handleEmailBodyChange(event) {\n const value = sanitize(event.detail.value);\n this.confirmationEmail = { ...this.confirmationEmail, booking_confirmed: { ...(this.confirmationEmail?.booking_confirmed || {}), body: value } };\n this.internals.setFormValue(JSON.stringify(this.confirmationEmail), this.name);\n this.valueChanged.emit({ value: JSON.stringify(this.confirmationEmail), name: this.name });\n }\n\n @RegisterComponent<NylasConfirmationEmail, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-confirmation-email',\n stateToProps: new Map([['schedulerConfig.selectedConfiguration', 'selectedConfiguration']]),\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 organizer = this.participantsState.find(p => p.is_organizer);\n const organizerName = organizer?.name || organizer?.email;\n\n return (\n <Host>\n <div class=\"nylas-confirmation-email\" part=\"nce\">\n <div class=\"header\" part=\"nce__header\">\n <div>\n <h3>{this.confirmationEmail?.booking_confirmed?.title ?? `Booking confirmed with ${organizerName ? ` ${organizerName}` : ''}`}</h3>\n <p>Booking confirmation email</p>\n </div>\n {this.isConfirmationEmailOpen ? (\n <div class=\"confirmation-email-toggle\" part=\"nce__confirmation-email-toggle--container\">\n <span class={`chevron ${this.isConfirmationEmailOpen ? 'open' : 'closed'} `} onClick={() => this.toggleConfirmationEmail()}>\n <chevron-icon width=\"24\" height=\"24\" />\n </span>\n </div>\n ) : (\n <button-component\n variant={'basic'}\n clickHandler={event => {\n event.preventDefault();\n this.toggleConfirmationEmail();\n }}\n >\n <edit-icon width=\"16\" height=\"16\"></edit-icon>\n Edit\n </button-component>\n )}\n </div>\n\n {this.isConfirmationEmailOpen ? (\n <div class=\"nylas-confirmation-email__body\" part=\"nce__body\">\n <div class=\"nylas-confirmation-email__section\">\n <div class=\"nylas-confirmation-email__row\">\n <label>\n Send confirmation email\n <span class=\"label-icon\">\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">You and your guests will receive a confirmation email immediately upon booking.</span>\n </tooltip-component>\n </span>\n </label>\n <span class=\"selected-value\">Immediately upon booking</span>\n </div>\n <div class=\"nylas-confirmation-email__row\">\n <div class=\"subsection\">\n <div class=\"input-container\">\n <label>\n Company logo URL\n <span class=\"label-icon\">\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">\n This logo appears in the booking confirmation email. The URL must be publicly accessible. The image will be scaled down to a max size of 200px x\n 100px.\n </span>\n </tooltip-component>\n </span>\n </label>\n\n {this.confirmationEmail && (\n <input-image-url\n name=\"confirmation-email-logo\"\n exportparts=\"iiu__logo-input-textfield: nce__input-image-url\"\n imageUrl={this.confirmationEmail?.logo ?? ''}\n />\n )}\n </div>\n </div>\n </div>\n <div class=\"nylas-confirmation-email__row full-width-col\">\n <div class=\"subsection\">\n <h3>Email message</h3>\n <div class=\"input-container\">\n <label htmlFor=\"title\">\n Custom email title\n <span class=\"label-icon\">\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">An email title is a headline within the body of the email. This doesn&apos;t change the subject line.</span>\n </tooltip-component>\n </span>\n </label>\n <input-component\n name=\"confirmation-email-title\"\n maxLength={60}\n placeholder={`Booking confirmed ${organizerName ? `with ${organizerName}` : ''}`}\n defaultValue={this.confirmationEmail?.booking_confirmed?.title ?? ''}\n ></input-component>\n </div>\n <div class=\"input-container\">\n {/* <label htmlFor=\"title\">Email body</label> */}\n <textarea-component\n label=\"Additional info\"\n name=\"confirmation-email-body\"\n id=\"confirmation-email-body\"\n placeholder=\"Default body\"\n tooltip=\"Scheduler adds the content of the box to the email body.\"\n maxLength={500}\n defaultValue={this.confirmationEmail?.booking_confirmed?.body ?? ''}\n ></textarea-component>\n\n {/* <textarea\n id=\"description\"\n part=\"nrt__textarea\"\n name=\"confirmation-email-body\"\n placeholder='Default body'\n value={this.confirmationEmail?.booking_confirmed?.body ?? ''}\n maxlength=\"500\"\n rows={2}\n onInput={e => this.handleEmailBodyChange(e)}\n ></textarea> */}\n </div>\n </div>\n </div>\n </div>\n </div>\n ) : (\n <div class=\"nylas-confirmation-email__summary\" part=\"nce__summary\">\n <p>\n <span class=\"summary-icon\">\n <person-clipboard-icon></person-clipboard-icon>\n </span>\n All host & guests\n </p>\n <p>\n <span class=\"summary-icon\">\n <clock-icon></clock-icon>\n </span>\n Immediately on booking\n </p>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -68,7 +68,6 @@ const NylasEventDuration = proxyCustomElement(class NylasEventDuration extends H
68
68
  componentWillLoad() {
69
69
  debug('nylas-event-duration', 'componentWillLoad');
70
70
  this.host.setAttribute('name', this.name);
71
- this.setDurationMintueOptions();
72
71
  }
73
72
  componentDidLoad() {
74
73
  debug('nylas-event-duration', 'componentDidLoad');
@@ -78,7 +77,10 @@ const NylasEventDuration = proxyCustomElement(class NylasEventDuration extends H
78
77
  this.duration = this.duration ? this.duration : this.eventDurationMinutes ? (this.eventDurationMinutes >= 60 ? this.eventDurationMinutes / 60 : this.eventDurationMinutes) : 30;
79
78
  this.durationMinutes = this.durationMinutes ? this.durationMinutes : this.duration ? this.duration : 30;
80
79
  this.durationIncrement = this.durationIncrement ? this.durationIncrement : this.duration >= 60 ? 60 : 1;
81
- this.internals.setFormValue(this.durationMinutes.toString(), 'duration');
80
+ this.setDurationMintueOptions();
81
+ if (typeof this.internals.setFormValue === 'function') {
82
+ this.internals.setFormValue(this.durationMinutes.toString(), 'duration');
83
+ }
82
84
  }
83
85
  disconnectedCallback() {
84
86
  debug('nylas-event-duration', 'disconnectedCallback');
@@ -128,7 +130,7 @@ const NylasEventDuration = proxyCustomElement(class NylasEventDuration extends H
128
130
  { value: 1, label: 'minute' },
129
131
  { value: 60, label: 'hour' },
130
132
  ];
131
- return (h(Host, { key: 'e63530398b7b2231436947da8c9e63c3c7bd696a' }, h("div", { key: '9ccca25a4322edaedafa53a2bd8ae2baf48b4f1e', class: "nylas-event-duration", part: "ned" }, h("label", { key: 'cd5562d2516c1f37eeb0b3e074493c671628ef4b', htmlFor: "duration" }, "Event duration", h("span", { key: 'ef36340fb220f380a9913ad5025e6600ce6e8f17', class: "required" }, "*")), h("div", { key: 'eddeda40d89ac770f20226605f3fedce00afe060', class: "nylas-event-duration__wrapper" }, h("input-dropdown", { key: 'b087fff0f15cfcaf5c89c0566941aa45c8e89d54', name: 'event-duration', options: this.durationMinutesOptions, inputValue: this.duration.toString(), exportparts: "id_dropdown: ned__input_dropdown, id_dropdown-input: ned__input_dropdown-input, id_dropdown-content: ned__input_dropdown-content", defaultInputOption: this.durationMinutesOptions.find(i => i.value == this.duration) }), this.durationIncrement && (h("select-dropdown", { name: 'event-duration', options: durationOptions, pluralizedLabel: this.duration > 1 ? 's' : '', exportparts: "sd_dropdown: ned__dropdown, sd_dropdown-button: ned__dropdown-button, sd_dropdown-content: ned__dropdown-content", defaultSelectedOption: durationOptions.find(i => i.value == this.durationIncrement), withSearch: false }))))));
133
+ return (h(Host, { key: 'f6b60528b9c3f2978ac12beae9bf049a9b90fec5' }, h("div", { key: 'f7c778d981fa1d33ceed820d500e6820a4f1223c', class: "nylas-event-duration", part: "ned" }, h("label", { key: 'f461dcfeda616f50820d6cdacb5dfded22ec7aff', htmlFor: "duration" }, "Event duration", h("span", { key: '086d2458ad14f00f718fb9106c45d63576c9f734', class: "required" }, "*")), h("div", { key: 'cf27800dec77fbe74c9428de92fa042a419ddb25', class: "nylas-event-duration__wrapper" }, h("input-dropdown", { key: '06ed64927a69ca96bb9f9cc5cfede6d55c310598', name: 'event-duration', options: this.durationMinutesOptions, inputValue: this.duration.toString(), exportparts: "id_dropdown: ned__input_dropdown, id_dropdown-input: ned__input_dropdown-input, id_dropdown-content: ned__input_dropdown-content", defaultInputOption: this.durationMinutesOptions.find(i => i.value == this.duration) }), this.durationIncrement && (h("select-dropdown", { name: 'event-duration', options: durationOptions, pluralizedLabel: this.duration > 1 ? 's' : '', exportparts: "sd_dropdown: ned__dropdown, sd_dropdown-button: ned__dropdown-button, sd_dropdown-content: ned__dropdown-content", defaultSelectedOption: durationOptions.find(i => i.value == this.durationIncrement), withSearch: false }))))));
132
134
  }
133
135
  static get formAssociated() { return true; }
134
136
  get host() { return this; }
@@ -1 +1 @@
1
- {"file":"nylas-event-duration2.js","mappings":";;;;;;;;AAAA,MAAM,qBAAqB,GAAG,42DAA42D,CAAC;AAC34D,iCAAe,qBAAqB;;;;;;;;;;;;;;;;MCuBvB,kBAAkB;;;;;;;;oBAeN,UAAU;;wBAUL,IAAI,CAAC,oBAAoB,IAAI,IAAI,CAAC,oBAAoB,IAAI,EAAE,GAAG,IAAI,CAAC,oBAAoB,GAAG,EAAE,GAAG,IAAI,CAAC,oBAAoB,IAAI,EAAE;;;sCAYzH;YAChC,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE;YAC1B,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE;YAC1B,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE;YAC1B,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,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,UAAU,EAAE,KAAK,GACjB,CACH,CACG,CACF,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;AAlCD;IANC,iBAAiB,CAAwG;QACxH,IAAI,EAAE,sBAAsB;QAC5B,YAAY,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,uCAAuC,EAAE,uBAAuB,CAAC,CAAC,CAAC;QAC3F,YAAY,EAAE,EAAE;QAChB,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;gDAmCD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/scheduler-editor/nylas-event-duration/nylas-event-duration.scss?tag=nylas-event-duration&encapsulation=shadow","src/components/scheduler-editor/nylas-event-duration/nylas-event-duration.tsx"],"sourcesContent":["@import '../../../common/styles/variables.scss';\n\n:host {\n display: block;\n @include default-css-variables;\n}\n\n.nylas-event-duration {\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%; /* 21px */\n span.required {\n color: var(--nylas-error, #cc4841);\n }\n span.label-icon {\n margin-left: 4px;\n tooltip-component {\n display: flex;\n }\n }\n }\n}\n.nylas-event-duration__wrapper {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n input {\n padding: 12px 16px;\n border-width: 1;\n border-radius: 8px;\n border: 1px solid var(--nylas-base-200);\n font-family: var(--nylas-font-family);\n font-size: 16px;\n line-height: 24px;\n width: 48px;\n }\n input-dropdown::part(id_dropdown-input) {\n border: 1px solid var(--nylas-base-200);\n border-radius: var(--nylas-border-radius-2x);\n padding: 14px 16px;\n width: 50px;\n }\n input-dropdown::part(id_dropdown-content) {\n width: 100%;\n min-width: unset;\n height: 200px;\n }\n\n select-dropdown {\n width: 120px;\n @media #{$mobile} {\n width: 100%;\n }\n }\n\n select-dropdown::part(sd_dropdown-button) {\n border: 1px solid var(--nylas-base-200);\n }\n}\n","import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug } from '@/utils/utils';\nimport { AttachInternals, Component, Host, Listen, State, h, Element, Prop, Watch, Event, EventEmitter } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { Configuration } from '@nylas/core';\n\n/**\n * The `nylas-event-duration` component is a form input for the duration of an event.\n *\n * @part ned - The event duration container\n * @part ned__dropdown - The dropdown container for the duration increment\n * @part ned__dropdown-button - The dropdown button for the duration increment\n * @part ned__dropdown-content - The dropdown content for the duration increment\n * @part ned__input_dropdown - The input dropdown container for the duration minutes\n * @part ned__input_dropdown-input - The input for the duration minutes\n * @part ned__input_dropdown-content - The dropdown content for the input duration minutes\n */\n@Component({\n tag: 'nylas-event-duration',\n styleUrl: 'nylas-event-duration.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasEventDuration {\n /**\n * The host element <nylas-event-duration>\n */\n @Element() host!: HTMLElement;\n /**\n * @standalone\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n\n /**\n * @standalone\n * The name of the event duration. Default is 'duration'.\n */\n @Prop() name: string = 'duration';\n /**\n * @standalone\n * The event duration in minutes as set in the configuration.\n */\n @Prop() eventDurationMinutes?: number;\n\n /**\n * The selected event duration state. This defaults to the event duration from the configuration or 30 minutes.\n */\n @State() duration: number = this.eventDurationMinutes ? (this.eventDurationMinutes >= 60 ? this.eventDurationMinutes / 60 : this.eventDurationMinutes) : 30;\n /**\n * The duration in minutes. This defaults to the event duration from the configuration or 30 minutes.\n */\n @State() durationMinutes!: number;\n /**\n * The duration increment. This defaults to minute(s).\n */\n @State() durationIncrement!: number;\n /**\n * The durationMinutesOptions for the dropdown.\n */\n @State() durationMinutesOptions = [\n { value: 15, label: '15' },\n { value: 30, label: '30' },\n { value: 45, label: '45' },\n { value: 60, label: '60' },\n ];\n\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-event-duration', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('selectedConfiguration')\n selectedConfigurationChangedHandler(newVal: Configuration) {\n const configDuration = newVal?.availability?.duration_minutes;\n if (configDuration) {\n this.duration = configDuration >= 60 ? configDuration / 60 : configDuration;\n this.durationMinutes = configDuration ? configDuration : 30;\n this.durationIncrement = configDuration >= 60 ? 60 : 1;\n }\n }\n\n @Watch('durationMinutes')\n durationMinutesChangedHandler(newValue: number, oldValue: number) {\n debug('nylas-event-duration', 'durationMinutesChangedHandler', newValue);\n if (newValue === oldValue) {\n return;\n }\n this.valueChanged.emit({ value: newValue.toString(), name: this.name });\n }\n\n /**\n * Event emitted when the event duration changes.\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n }>;\n\n connectedCallback() {\n debug('nylas-event-duration', 'connectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-event-duration', 'componentWillLoad');\n this.host.setAttribute('name', this.name);\n this.setDurationMintueOptions();\n }\n\n componentDidLoad() {\n debug('nylas-event-duration', 'componentDidLoad');\n if (this.selectedConfiguration) {\n this.selectedConfigurationChangedHandler(this.selectedConfiguration);\n }\n this.duration = this.duration ? this.duration : this.eventDurationMinutes ? (this.eventDurationMinutes >= 60 ? this.eventDurationMinutes / 60 : this.eventDurationMinutes) : 30;\n this.durationMinutes = this.durationMinutes ? this.durationMinutes : this.duration ? this.duration : 30;\n this.durationIncrement = this.durationIncrement ? this.durationIncrement : this.duration >= 60 ? 60 : 1;\n this.internals.setFormValue(this.durationMinutes.toString(), 'duration');\n }\n\n disconnectedCallback() {\n debug('nylas-event-duration', 'disconnectedCallback');\n }\n\n setDurationMintueOptions() {\n if (this.durationIncrement === 1) {\n this.durationMinutesOptions = [\n { value: 15, label: '15' },\n { value: 30, label: '30' },\n { value: 45, label: '45' },\n { value: 60, label: '60' },\n ];\n } else {\n this.durationMinutesOptions = Array.from({ length: 23 }, (_, i) => ({ value: i + 1, label: (i + 1).toString() }));\n }\n return this.durationMinutesOptions;\n }\n\n handleChange(event) {\n this.duration = event.target.value;\n this.durationMinutes = this.duration * this.durationIncrement;\n this.internals.setFormValue(this.durationMinutes.toString(), this.name);\n }\n\n @Listen('nylasFormDropdownChanged')\n nylasFormDropdownChangedHandler(event: CustomEvent<{ value: string; name: string }>) {\n debug('nylas-calendar-picker', 'nylasFormDropdownChangedHandler', event.detail);\n const { value } = event.detail;\n this.durationIncrement = parseInt(value);\n if (this.durationIncrement === 1) {\n this.duration = 60;\n } else {\n this.duration = 1;\n }\n this.setDurationMintueOptions();\n this.durationMinutes = this.duration * this.durationIncrement;\n this.internals.setFormValue(this.durationMinutes.toString(), 'duration');\n }\n\n @Listen('inputOptionChanged')\n inputOptionChangedHandler(event: CustomEvent<{ value: number; name: string }>) {\n debug('nylas-calendar-picker', 'inputOptionChangedHandler', event.detail);\n const { value } = event.detail;\n this.duration = value;\n this.durationMinutes = this.duration * this.durationIncrement;\n this.internals.setFormValue(this.durationMinutes.toString(), this.name);\n }\n\n @RegisterComponent<NylasEventDuration, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-event-duration',\n stateToProps: new Map([['schedulerConfig.selectedConfiguration', 'selectedConfiguration']]),\n eventToProps: {},\n fireRegisterEvent: true,\n })\n render() {\n const durationOptions = [\n { value: 1, label: 'minute' },\n { value: 60, label: 'hour' },\n ];\n\n return (\n <Host>\n <div class=\"nylas-event-duration\" part=\"ned\">\n <label htmlFor=\"duration\">\n Event duration<span class=\"required\">*</span>\n </label>\n <div class=\"nylas-event-duration__wrapper\">\n <input-dropdown\n name={'event-duration'}\n options={this.durationMinutesOptions}\n inputValue={this.duration.toString()}\n exportparts=\"id_dropdown: ned__input_dropdown, id_dropdown-input: ned__input_dropdown-input, id_dropdown-content: ned__input_dropdown-content\"\n defaultInputOption={this.durationMinutesOptions.find(i => i.value == this.duration)}\n />\n {this.durationIncrement && (\n <select-dropdown\n name={'event-duration'}\n options={durationOptions}\n pluralizedLabel={this.duration > 1 ? 's' : ''}\n exportparts=\"sd_dropdown: ned__dropdown, sd_dropdown-button: ned__dropdown-button, sd_dropdown-content: ned__dropdown-content\"\n defaultSelectedOption={durationOptions.find(i => i.value == this.durationIncrement)}\n withSearch={false}\n />\n )}\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"nylas-event-duration2.js","mappings":";;;;;;;;AAAA,MAAM,qBAAqB,GAAG,42DAA42D,CAAC;AAC34D,iCAAe,qBAAqB;;;;;;;;;;;;;;;;MCuBvB,kBAAkB;;;;;;;;oBAeN,UAAU;;wBAUL,IAAI,CAAC,oBAAoB,IAAI,IAAI,CAAC,oBAAoB,IAAI,EAAE,GAAG,IAAI,CAAC,oBAAoB,GAAG,EAAE,GAAG,IAAI,CAAC,oBAAoB,IAAI,EAAE;;;sCAYzH;YAChC,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE;YAC1B,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE;YAC1B,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE;YAC1B,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE;SAC3B;;IAaD,yBAAyB,CAAC,QAAgB;QACxC,KAAK,CAAC,sBAAsB,EAAE,2BAA2B,EAAE,QAAQ,CAAC,CAAC;QACrE,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;KAC1C;IAGD,mCAAmC,CAAC,MAAqB;QACvD,MAAM,cAAc,GAAG,MAAM,EAAE,YAAY,EAAE,gBAAgB,CAAC;QAC9D,IAAI,cAAc,E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F,YAAY,EAAE,EAAE;QAChB,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;gDAmCD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/scheduler-editor/nylas-event-duration/nylas-event-duration.scss?tag=nylas-event-duration&encapsulation=shadow","src/components/scheduler-editor/nylas-event-duration/nylas-event-duration.tsx"],"sourcesContent":["@import '../../../common/styles/variables.scss';\n\n:host {\n display: block;\n @include default-css-variables;\n}\n\n.nylas-event-duration {\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%; /* 21px */\n span.required {\n color: var(--nylas-error, #cc4841);\n }\n span.label-icon {\n margin-left: 4px;\n tooltip-component {\n display: flex;\n }\n }\n }\n}\n.nylas-event-duration__wrapper {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n input {\n padding: 12px 16px;\n border-width: 1;\n border-radius: 8px;\n border: 1px solid var(--nylas-base-200);\n font-family: var(--nylas-font-family);\n font-size: 16px;\n line-height: 24px;\n width: 48px;\n }\n input-dropdown::part(id_dropdown-input) {\n border: 1px solid var(--nylas-base-200);\n border-radius: var(--nylas-border-radius-2x);\n padding: 14px 16px;\n width: 50px;\n }\n input-dropdown::part(id_dropdown-content) {\n width: 100%;\n min-width: unset;\n height: 200px;\n }\n\n select-dropdown {\n width: 120px;\n @media #{$mobile} {\n width: 100%;\n }\n }\n\n select-dropdown::part(sd_dropdown-button) {\n border: 1px solid var(--nylas-base-200);\n }\n}\n","import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug } from '@/utils/utils';\nimport { AttachInternals, Component, Host, Listen, State, h, Element, Prop, Watch, Event, EventEmitter } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { Configuration } from '@nylas/core';\n\n/**\n * The `nylas-event-duration` component is a form input for the duration of an event.\n *\n * @part ned - The event duration container\n * @part ned__dropdown - The dropdown container for the duration increment\n * @part ned__dropdown-button - The dropdown button for the duration increment\n * @part ned__dropdown-content - The dropdown content for the duration increment\n * @part ned__input_dropdown - The input dropdown container for the duration minutes\n * @part ned__input_dropdown-input - The input for the duration minutes\n * @part ned__input_dropdown-content - The dropdown content for the input duration minutes\n */\n@Component({\n tag: 'nylas-event-duration',\n styleUrl: 'nylas-event-duration.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasEventDuration {\n /**\n * The host element <nylas-event-duration>\n */\n @Element() host!: HTMLElement;\n /**\n * @standalone\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n\n /**\n * @standalone\n * The name of the event duration. Default is 'duration'.\n */\n @Prop() name: string = 'duration';\n /**\n * @standalone\n * The event duration in minutes as set in the configuration.\n */\n @Prop() eventDurationMinutes?: number;\n\n /**\n * The selected event duration state. This defaults to the event duration from the configuration or 30 minutes.\n */\n @State() duration: number = this.eventDurationMinutes ? (this.eventDurationMinutes >= 60 ? this.eventDurationMinutes / 60 : this.eventDurationMinutes) : 30;\n /**\n * The duration in minutes. This defaults to the event duration from the configuration or 30 minutes.\n */\n @State() durationMinutes!: number;\n /**\n * The duration increment. This defaults to minute(s).\n */\n @State() durationIncrement!: number;\n /**\n * The durationMinutesOptions for the dropdown.\n */\n @State() durationMinutesOptions = [\n { value: 15, label: '15' },\n { value: 30, label: '30' },\n { value: 45, label: '45' },\n { value: 60, label: '60' },\n ];\n\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-event-duration', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('selectedConfiguration')\n selectedConfigurationChangedHandler(newVal: Configuration) {\n const configDuration = newVal?.availability?.duration_minutes;\n if (configDuration) {\n this.duration = configDuration >= 60 ? configDuration / 60 : configDuration;\n this.durationMinutes = configDuration ? configDuration : 30;\n this.durationIncrement = configDuration >= 60 ? 60 : 1;\n }\n }\n\n @Watch('durationMinutes')\n durationMinutesChangedHandler(newValue: number, oldValue: number) {\n debug('nylas-event-duration', 'durationMinutesChangedHandler', newValue);\n if (newValue === oldValue) {\n return;\n }\n this.valueChanged.emit({ value: newValue.toString(), name: this.name });\n }\n\n /**\n * Event emitted when the event duration changes.\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n }>;\n\n connectedCallback() {\n debug('nylas-event-duration', 'connectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-event-duration', 'componentWillLoad');\n this.host.setAttribute('name', this.name);\n }\n\n componentDidLoad() {\n debug('nylas-event-duration', 'componentDidLoad');\n if (this.selectedConfiguration) {\n this.selectedConfigurationChangedHandler(this.selectedConfiguration);\n }\n this.duration = this.duration ? this.duration : this.eventDurationMinutes ? (this.eventDurationMinutes >= 60 ? this.eventDurationMinutes / 60 : this.eventDurationMinutes) : 30;\n this.durationMinutes = this.durationMinutes ? this.durationMinutes : this.duration ? this.duration : 30;\n this.durationIncrement = this.durationIncrement ? this.durationIncrement : this.duration >= 60 ? 60 : 1;\n this.setDurationMintueOptions();\n if (typeof this.internals.setFormValue === 'function') {\n this.internals.setFormValue(this.durationMinutes.toString(), 'duration');\n }\n }\n\n disconnectedCallback() {\n debug('nylas-event-duration', 'disconnectedCallback');\n }\n\n setDurationMintueOptions() {\n if (this.durationIncrement === 1) {\n this.durationMinutesOptions = [\n { value: 15, label: '15' },\n { value: 30, label: '30' },\n { value: 45, label: '45' },\n { value: 60, label: '60' },\n ];\n } else {\n this.durationMinutesOptions = Array.from({ length: 23 }, (_, i) => ({ value: i + 1, label: (i + 1).toString() }));\n }\n return this.durationMinutesOptions;\n }\n\n handleChange(event) {\n this.duration = event.target.value;\n this.durationMinutes = this.duration * this.durationIncrement;\n this.internals.setFormValue(this.durationMinutes.toString(), this.name);\n }\n\n @Listen('nylasFormDropdownChanged')\n nylasFormDropdownChangedHandler(event: CustomEvent<{ value: string; name: string }>) {\n debug('nylas-calendar-picker', 'nylasFormDropdownChangedHandler', event.detail);\n const { value } = event.detail;\n this.durationIncrement = parseInt(value);\n if (this.durationIncrement === 1) {\n this.duration = 60;\n } else {\n this.duration = 1;\n }\n this.setDurationMintueOptions();\n this.durationMinutes = this.duration * this.durationIncrement;\n this.internals.setFormValue(this.durationMinutes.toString(), 'duration');\n }\n\n @Listen('inputOptionChanged')\n inputOptionChangedHandler(event: CustomEvent<{ value: number; name: string }>) {\n debug('nylas-calendar-picker', 'inputOptionChangedHandler', event.detail);\n const { value } = event.detail;\n this.duration = value;\n this.durationMinutes = this.duration * this.durationIncrement;\n this.internals.setFormValue(this.durationMinutes.toString(), this.name);\n }\n\n @RegisterComponent<NylasEventDuration, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-event-duration',\n stateToProps: new Map([['schedulerConfig.selectedConfiguration', 'selectedConfiguration']]),\n eventToProps: {},\n fireRegisterEvent: true,\n })\n render() {\n const durationOptions = [\n { value: 1, label: 'minute' },\n { value: 60, label: 'hour' },\n ];\n\n return (\n <Host>\n <div class=\"nylas-event-duration\" part=\"ned\">\n <label htmlFor=\"duration\">\n Event duration<span class=\"required\">*</span>\n </label>\n <div class=\"nylas-event-duration__wrapper\">\n <input-dropdown\n name={'event-duration'}\n options={this.durationMinutesOptions}\n inputValue={this.duration.toString()}\n exportparts=\"id_dropdown: ned__input_dropdown, id_dropdown-input: ned__input_dropdown-input, id_dropdown-content: ned__input_dropdown-content\"\n defaultInputOption={this.durationMinutesOptions.find(i => i.value == this.duration)}\n />\n {this.durationIncrement && (\n <select-dropdown\n name={'event-duration'}\n options={durationOptions}\n pluralizedLabel={this.duration > 1 ? 's' : ''}\n exportparts=\"sd_dropdown: ned__dropdown, sd_dropdown-button: ned__dropdown-button, sd_dropdown-content: ned__dropdown-content\"\n defaultSelectedOption={durationOptions.find(i => i.value == this.durationIncrement)}\n withSearch={false}\n />\n )}\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -41,7 +41,7 @@ const NylasEventInfo = proxyCustomElement(class NylasEventInfo extends HTMLEleme
41
41
  debug('nylas-event-info', 'disconnectedCallback');
42
42
  }
43
43
  render() {
44
- return (h(Host, { key: 'fb4a8dd875696bc6a4e951f2649a2ab650558489' }, h("nylas-form-card", { key: '193b25acb1374842946ff938755fe8fed7a6d4b9', exportparts: "nfc__header: nei__header" }, h("h1", { key: 'c405c5de0b2eafa15136d10f10de13a158595298', slot: "header-title", class: "nylas-event-info__title", part: "nei__title" }, "Event information"), h("div", { key: 'a49993db49876dfdebd6dbe412d759ce1d38028e', slot: "content", class: "nylas-event-info__content" }, h("slot", { key: 'dc4595988a0b6824f328896c1ea507b96e61e4a8', name: "inputs" })))));
44
+ return (h(Host, { key: 'be80a4e687ce223a8e52bbabc2e8acadcb194b11' }, h("nylas-form-card", { key: 'c96b77795ec2516889acf0f78c5eb723b26dd89c', exportparts: "nfc__header: nei__header" }, h("h1", { key: '890113187adcd6be1ab1d1beb489fe3a80124617', slot: "header-title", class: "nylas-event-info__title", part: "nei__title" }, "Event information"), h("div", { key: '44eaaae3833654530706dc93077b43a7597acc2c', slot: "content", class: "nylas-event-info__content" }, h("slot", { key: '7af737a67cb007c0ede7db5aa075828311d98da3', name: "inputs" })))));
45
45
  }
46
46
  static get formAssociated() { return true; }
47
47
  get el() { return this; }
@@ -41,7 +41,7 @@ const NylasEventLimits = proxyCustomElement(class NylasEventLimits extends HTMLE
41
41
  debug('nylas-event-limits', 'disconnectedCallback');
42
42
  }
43
43
  render() {
44
- return (h(Host, { key: '8715c9aeba26e6f4c151b0ab58333cc13d3500d3' }, h("nylas-form-card", { key: '2e2bf90762d35ac9fc4a995808b9aa3e4481d6c0', exportparts: "nfc__header: nel__header" }, h("h1", { key: 'b3689912282e3215d862ca06c75fae95b67e501f', slot: "header-title", class: "nylas-event-limits__title" }, "Event limits"), h("div", { key: 'bd5513f8c0cc573f14afeadfafe591b64b904920', slot: "content", class: "nylas-event-limits__content" }, h("slot", { key: '86ebfd856f0c93d3ad98d800d4ce9e1a8daf2516', name: "inputs" })))));
44
+ return (h(Host, { key: '6a28113e3b403869e77cc3a2c9c3a1bea217dc52' }, h("nylas-form-card", { key: 'cf9004d044222d796ae59df58737ad9719a20576', exportparts: "nfc__header: nel__header" }, h("h1", { key: 'ffeeb7a5741c9f07fb4f9bd84016b1707e2b55b7', slot: "header-title", class: "nylas-event-limits__title" }, "Event limits"), h("div", { key: '7b51592d95736f860ec805950275a18e9d914c32', slot: "content", class: "nylas-event-limits__content" }, h("slot", { key: '53e9098d736eedf5b22e1b8ae712ec22c8ca865e', name: "inputs" })))));
45
45
  }
46
46
  static get formAssociated() { return true; }
47
47
  get el() { return this; }
@@ -41,7 +41,7 @@ const NylasFormCard = proxyCustomElement(class NylasFormCard extends HTMLElement
41
41
  checkForMissingSlots(slots, this.host);
42
42
  }
43
43
  render() {
44
- return (h(Host, { key: 'e79321333887319f48356c64cb2e04539edf1d79' }, h("div", { key: '9a33c42c38012c5277ecc0d60523211671866378', class: "nylas-form-card", part: "nfc" }, h("div", { key: '905eed6cd8c79bda19fb3c5ab49802ae697a0ab9', class: "nylas-form-card__header", part: "nfc__header" }, h("slot", { key: 'db749b7eb575845c2b8d8e4a12ea0c3ffea4842a', name: "header-title" }), h("slot", { key: '5b9ac54446f1b1b49a9f0f2e2b45e3785acb9686', name: "header-subtitle" })), h("div", { key: '6893e68e48f990c6dfc3d3c3052dfba988b21807', class: "nylas-form-card__content" }, h("slot", { key: 'fac98a2a1a6b162bc3f4aed735b584c4d5e509a3', name: "content" })))));
44
+ return (h(Host, { key: '5ccd047d1a8bb515dea8aa7b9d7d39265afc31c9' }, h("div", { key: 'c40f52eaa4d099d92d65b0df662cd2de1b5f35c7', class: "nylas-form-card", part: "nfc" }, h("div", { key: '545dabd81dce9b4f6f5f1d129071e1136f62e609', class: "nylas-form-card__header", part: "nfc__header" }, h("slot", { key: '2be9b24f91316235be7132a6466cd16b9dfe813c', name: "header-title" }), h("slot", { key: '3414a084465efc50a3856291dff61d8ef3b3c617', name: "header-subtitle" })), h("div", { key: 'cc07650a55afd7fc5d2429ff3611168977775bc8', class: "nylas-form-card__content" }, h("slot", { key: 'd50dd8dfbfea1ad84876495e72dd03102e2bc0dc', name: "content" })))));
45
45
  }
46
46
  static get formAssociated() { return true; }
47
47
  get host() { return this; }