@nylas/web-elements 1.1.0-canary.10 → 1.1.0-canary.11

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 (226) hide show
  1. package/dist/cjs/add-circle-icon_21.cjs.entry.js +73 -40
  2. package/dist/cjs/add-circle-icon_21.cjs.entry.js.map +1 -1
  3. package/dist/cjs/google-logo-icon_4.cjs.entry.js +5 -4
  4. package/dist/cjs/google-logo-icon_4.cjs.entry.js.map +1 -1
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/nylas-api-request-05f1e068.js.map +1 -1
  7. package/dist/cjs/nylas-api-request-de316f1a.js.map +1 -1
  8. package/dist/cjs/nylas-availability-picker.cjs.entry.js +14 -7
  9. package/dist/cjs/nylas-availability-picker.cjs.entry.js.map +1 -1
  10. package/dist/cjs/nylas-booked-event-card.cjs.entry.js +1 -1
  11. package/dist/cjs/nylas-booked-event-card_10.cjs.entry.js +9 -9
  12. package/dist/cjs/nylas-booking-calendar-picker.cjs.entry.js.map +1 -1
  13. package/dist/cjs/nylas-booking-form.cjs.entry.js +3 -3
  14. package/dist/cjs/nylas-buffer-time.cjs.entry.js +7 -6
  15. package/dist/cjs/nylas-buffer-time.cjs.entry.js.map +1 -1
  16. package/dist/cjs/nylas-calendar-picker.cjs.entry.js.map +1 -1
  17. package/dist/cjs/nylas-date-picker.cjs.entry.js +1 -1
  18. package/dist/cjs/nylas-editor-tabs.cjs.entry.js +5 -4
  19. package/dist/cjs/nylas-editor-tabs.cjs.entry.js.map +1 -1
  20. package/dist/cjs/nylas-event-description.cjs.entry.js +2 -2
  21. package/dist/cjs/nylas-event-description.cjs.entry.js.map +1 -1
  22. package/dist/cjs/nylas-event-duration.cjs.entry.js +1 -1
  23. package/dist/cjs/nylas-event-duration.cjs.entry.js.map +1 -1
  24. package/dist/cjs/nylas-event-info.cjs.entry.js +1 -1
  25. package/dist/cjs/nylas-event-info.cjs.entry.js.map +1 -1
  26. package/dist/cjs/nylas-event-limits.cjs.entry.js +1 -1
  27. package/dist/cjs/nylas-event-limits.cjs.entry.js.map +1 -1
  28. package/dist/cjs/nylas-event-title.cjs.entry.js +2 -2
  29. package/dist/cjs/nylas-if-state.cjs.entry.js +1 -1
  30. package/dist/cjs/nylas-limit-future-bookings.cjs.entry.js +1 -1
  31. package/dist/cjs/nylas-limit-future-bookings.cjs.entry.js.map +1 -1
  32. package/dist/cjs/nylas-locale-switch.cjs.entry.js +3 -3
  33. package/dist/cjs/nylas-location-component.cjs.entry.js +4 -4
  34. package/dist/cjs/nylas-location-component.cjs.entry.js.map +1 -1
  35. package/dist/cjs/nylas-min-cancellation-notice.cjs.entry.js +1 -1
  36. package/dist/cjs/nylas-min-cancellation-notice.cjs.entry.js.map +1 -1
  37. package/dist/cjs/nylas-scheduler-editor.cjs.entry.js +1 -1
  38. package/dist/cjs/nylas-scheduler-editor.cjs.entry.js.map +1 -1
  39. package/dist/cjs/nylas-selected-event-card.cjs.entry.js +1 -1
  40. package/dist/cjs/nylas-time-window-picker.cjs.entry.js +39 -14
  41. package/dist/cjs/nylas-time-window-picker.cjs.entry.js.map +1 -1
  42. package/dist/cjs/nylas-web-elements.cjs.js +1 -1
  43. package/dist/cjs/scheduler-config-store-918c20d5.js.map +1 -1
  44. package/dist/cjs/scheduler-config-store-a5b7c08b.js.map +1 -1
  45. package/dist/collection/collection-manifest.json +3 -3
  46. package/dist/collection/common/nylas-api-request.js.map +1 -1
  47. package/dist/collection/components/nylas-if-state/nylas-if-state.js +1 -1
  48. package/dist/collection/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.js +1 -1
  49. package/dist/collection/components/scheduler/nylas-booking-form/nylas-booking-form.js +3 -3
  50. package/dist/collection/components/scheduler/nylas-date-picker/nylas-date-picker.js +1 -1
  51. package/dist/collection/components/scheduler/nylas-locale-switch/nylas-locale-switch.js +3 -3
  52. package/dist/collection/components/scheduler/nylas-selected-event-card/nylas-selected-event-card.js +1 -1
  53. package/dist/collection/components/scheduler-editor/nylas-availability-picker/nylas-availability-picker.js +35 -14
  54. package/dist/collection/components/scheduler-editor/nylas-availability-picker/nylas-availability-picker.js.map +1 -1
  55. package/dist/collection/components/scheduler-editor/nylas-booking-calendar-picker/nylas-booking-calendar-picker.js +1 -1
  56. package/dist/collection/components/scheduler-editor/nylas-booking-calendar-picker/nylas-booking-calendar-picker.js.map +1 -1
  57. package/dist/collection/components/scheduler-editor/nylas-buffer-time/nylas-buffer-time.css +1 -1
  58. package/dist/collection/components/scheduler-editor/nylas-buffer-time/nylas-buffer-time.js +6 -5
  59. package/dist/collection/components/scheduler-editor/nylas-buffer-time/nylas-buffer-time.js.map +1 -1
  60. package/dist/collection/components/scheduler-editor/nylas-buffer-time/test/nylas-buffer-time.spec.js +2 -2
  61. package/dist/collection/components/scheduler-editor/nylas-buffer-time/test/nylas-buffer-time.spec.js.map +1 -1
  62. package/dist/collection/components/scheduler-editor/nylas-calendar-picker/nylas-calendar-picker.js +1 -1
  63. package/dist/collection/components/scheduler-editor/nylas-calendar-picker/nylas-calendar-picker.js.map +1 -1
  64. package/dist/collection/components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs.js +6 -5
  65. package/dist/collection/components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs.js.map +1 -1
  66. package/dist/collection/components/scheduler-editor/nylas-event-description/nylas-event-description.js +5 -5
  67. package/dist/collection/components/scheduler-editor/nylas-event-description/nylas-event-description.js.map +1 -1
  68. package/dist/collection/components/scheduler-editor/nylas-event-duration/nylas-event-duration.js +4 -4
  69. package/dist/collection/components/scheduler-editor/nylas-event-duration/nylas-event-duration.js.map +1 -1
  70. package/dist/collection/components/scheduler-editor/nylas-event-info/nylas-event-info.js +1 -1
  71. package/dist/collection/components/scheduler-editor/nylas-event-info/nylas-event-info.js.map +1 -1
  72. package/dist/collection/components/scheduler-editor/nylas-event-limits/nylas-event-limits.js +1 -1
  73. package/dist/collection/components/scheduler-editor/nylas-event-limits/nylas-event-limits.js.map +1 -1
  74. package/dist/collection/components/scheduler-editor/nylas-event-title/nylas-event-title.js +2 -2
  75. package/dist/collection/components/scheduler-editor/nylas-limit-future-bookings/nylas-limit-future-bookings.js +4 -4
  76. package/dist/collection/components/scheduler-editor/nylas-limit-future-bookings/nylas-limit-future-bookings.js.map +1 -1
  77. package/dist/collection/components/scheduler-editor/nylas-location-component/nylas-location-component.js +23 -23
  78. package/dist/collection/components/scheduler-editor/nylas-location-component/nylas-location-component.js.map +1 -1
  79. package/dist/collection/components/scheduler-editor/nylas-min-cancellation-notice/nylas-min-cancellation-notice.js +3 -3
  80. package/dist/collection/components/scheduler-editor/nylas-min-cancellation-notice/nylas-min-cancellation-notice.js.map +1 -1
  81. package/dist/collection/components/scheduler-editor/nylas-scheduler-editor/nylas-scheduler-editor.js +9 -9
  82. package/dist/collection/components/scheduler-editor/nylas-scheduler-editor/nylas-scheduler-editor.js.map +1 -1
  83. package/dist/collection/components/scheduler-editor/nylas-time-window-picker/nylas-time-window-picker.js +56 -57
  84. package/dist/collection/components/scheduler-editor/nylas-time-window-picker/nylas-time-window-picker.js.map +1 -1
  85. package/dist/collection/stores/scheduler-config-store.js.map +1 -1
  86. package/dist/collection/types/index.js +6 -0
  87. package/dist/collection/types/index.js.map +1 -0
  88. package/dist/components/nylas-api-request.js.map +1 -1
  89. package/dist/components/nylas-availability-picker2.js +15 -8
  90. package/dist/components/nylas-availability-picker2.js.map +1 -1
  91. package/dist/components/nylas-booked-event-card2.js +1 -1
  92. package/dist/components/nylas-booking-calendar-picker2.js.map +1 -1
  93. package/dist/components/nylas-booking-form2.js +3 -3
  94. package/dist/components/nylas-buffer-time2.js +7 -6
  95. package/dist/components/nylas-buffer-time2.js.map +1 -1
  96. package/dist/components/nylas-calendar-picker2.js.map +1 -1
  97. package/dist/components/nylas-date-picker2.js +1 -1
  98. package/dist/components/nylas-editor-tabs2.js +5 -4
  99. package/dist/components/nylas-editor-tabs2.js.map +1 -1
  100. package/dist/components/nylas-event-description2.js +2 -2
  101. package/dist/components/nylas-event-description2.js.map +1 -1
  102. package/dist/components/nylas-event-duration2.js +1 -1
  103. package/dist/components/nylas-event-duration2.js.map +1 -1
  104. package/dist/components/nylas-event-info2.js +1 -1
  105. package/dist/components/nylas-event-info2.js.map +1 -1
  106. package/dist/components/nylas-event-limits2.js +1 -1
  107. package/dist/components/nylas-event-limits2.js.map +1 -1
  108. package/dist/components/nylas-event-title2.js +2 -2
  109. package/dist/components/nylas-if-state.js +1 -1
  110. package/dist/components/nylas-limit-future-bookings2.js +1 -1
  111. package/dist/components/nylas-limit-future-bookings2.js.map +1 -1
  112. package/dist/components/nylas-locale-switch2.js +3 -3
  113. package/dist/components/nylas-location-component2.js +5 -5
  114. package/dist/components/nylas-location-component2.js.map +1 -1
  115. package/dist/components/nylas-min-cancellation-notice2.js +1 -1
  116. package/dist/components/nylas-min-cancellation-notice2.js.map +1 -1
  117. package/dist/components/nylas-scheduler-editor.js +1 -1
  118. package/dist/components/nylas-scheduler-editor.js.map +1 -1
  119. package/dist/components/nylas-selected-event-card2.js +1 -1
  120. package/dist/components/nylas-time-window-picker2.js +39 -16
  121. package/dist/components/nylas-time-window-picker2.js.map +1 -1
  122. package/dist/components/scheduler-config-store.js.map +1 -1
  123. package/dist/esm/add-circle-icon_21.entry.js +73 -40
  124. package/dist/esm/add-circle-icon_21.entry.js.map +1 -1
  125. package/dist/esm/google-logo-icon_4.entry.js +5 -4
  126. package/dist/esm/google-logo-icon_4.entry.js.map +1 -1
  127. package/dist/esm/loader.js +1 -1
  128. package/dist/esm/nylas-api-request-59738f8c.js.map +1 -1
  129. package/dist/esm/nylas-api-request-ff2869d7.js.map +1 -1
  130. package/dist/esm/nylas-availability-picker.entry.js +14 -7
  131. package/dist/esm/nylas-availability-picker.entry.js.map +1 -1
  132. package/dist/esm/nylas-booked-event-card.entry.js +1 -1
  133. package/dist/esm/nylas-booked-event-card_10.entry.js +9 -9
  134. package/dist/esm/nylas-booking-calendar-picker.entry.js.map +1 -1
  135. package/dist/esm/nylas-booking-form.entry.js +3 -3
  136. package/dist/esm/nylas-buffer-time.entry.js +7 -6
  137. package/dist/esm/nylas-buffer-time.entry.js.map +1 -1
  138. package/dist/esm/nylas-calendar-picker.entry.js.map +1 -1
  139. package/dist/esm/nylas-date-picker.entry.js +1 -1
  140. package/dist/esm/nylas-editor-tabs.entry.js +5 -4
  141. package/dist/esm/nylas-editor-tabs.entry.js.map +1 -1
  142. package/dist/esm/nylas-event-description.entry.js +2 -2
  143. package/dist/esm/nylas-event-description.entry.js.map +1 -1
  144. package/dist/esm/nylas-event-duration.entry.js +1 -1
  145. package/dist/esm/nylas-event-duration.entry.js.map +1 -1
  146. package/dist/esm/nylas-event-info.entry.js +1 -1
  147. package/dist/esm/nylas-event-info.entry.js.map +1 -1
  148. package/dist/esm/nylas-event-limits.entry.js +1 -1
  149. package/dist/esm/nylas-event-limits.entry.js.map +1 -1
  150. package/dist/esm/nylas-event-title.entry.js +2 -2
  151. package/dist/esm/nylas-if-state.entry.js +1 -1
  152. package/dist/esm/nylas-limit-future-bookings.entry.js +1 -1
  153. package/dist/esm/nylas-limit-future-bookings.entry.js.map +1 -1
  154. package/dist/esm/nylas-locale-switch.entry.js +3 -3
  155. package/dist/esm/nylas-location-component.entry.js +4 -4
  156. package/dist/esm/nylas-location-component.entry.js.map +1 -1
  157. package/dist/esm/nylas-min-cancellation-notice.entry.js +1 -1
  158. package/dist/esm/nylas-min-cancellation-notice.entry.js.map +1 -1
  159. package/dist/esm/nylas-scheduler-editor.entry.js +1 -1
  160. package/dist/esm/nylas-scheduler-editor.entry.js.map +1 -1
  161. package/dist/esm/nylas-selected-event-card.entry.js +1 -1
  162. package/dist/esm/nylas-time-window-picker.entry.js +39 -14
  163. package/dist/esm/nylas-time-window-picker.entry.js.map +1 -1
  164. package/dist/esm/nylas-web-elements.js +1 -1
  165. package/dist/esm/scheduler-config-store-8ccc8dc7.js.map +1 -1
  166. package/dist/esm/scheduler-config-store-ec3b6190.js.map +1 -1
  167. package/dist/nylas-web-elements/nylas-api-request-ff2869d7.js.map +1 -1
  168. package/dist/nylas-web-elements/nylas-availability-picker.entry.js +14 -7
  169. package/dist/nylas-web-elements/nylas-availability-picker.entry.js.map +1 -1
  170. package/dist/nylas-web-elements/nylas-booked-event-card.entry.js +1 -1
  171. package/dist/nylas-web-elements/nylas-booking-calendar-picker.entry.js.map +1 -1
  172. package/dist/nylas-web-elements/nylas-booking-form.entry.js +3 -3
  173. package/dist/nylas-web-elements/nylas-buffer-time.entry.js +7 -6
  174. package/dist/nylas-web-elements/nylas-buffer-time.entry.js.map +1 -1
  175. package/dist/nylas-web-elements/nylas-calendar-picker.entry.js.map +1 -1
  176. package/dist/nylas-web-elements/nylas-date-picker.entry.js +1 -1
  177. package/dist/nylas-web-elements/nylas-editor-tabs.entry.js +5 -4
  178. package/dist/nylas-web-elements/nylas-editor-tabs.entry.js.map +1 -1
  179. package/dist/nylas-web-elements/nylas-event-description.entry.js +2 -2
  180. package/dist/nylas-web-elements/nylas-event-description.entry.js.map +1 -1
  181. package/dist/nylas-web-elements/nylas-event-duration.entry.js +1 -1
  182. package/dist/nylas-web-elements/nylas-event-duration.entry.js.map +1 -1
  183. package/dist/nylas-web-elements/nylas-event-info.entry.js +1 -1
  184. package/dist/nylas-web-elements/nylas-event-info.entry.js.map +1 -1
  185. package/dist/nylas-web-elements/nylas-event-limits.entry.js +1 -1
  186. package/dist/nylas-web-elements/nylas-event-limits.entry.js.map +1 -1
  187. package/dist/nylas-web-elements/nylas-event-title.entry.js +2 -2
  188. package/dist/nylas-web-elements/nylas-if-state.entry.js +1 -1
  189. package/dist/nylas-web-elements/nylas-limit-future-bookings.entry.js +1 -1
  190. package/dist/nylas-web-elements/nylas-limit-future-bookings.entry.js.map +1 -1
  191. package/dist/nylas-web-elements/nylas-locale-switch.entry.js +3 -3
  192. package/dist/nylas-web-elements/nylas-location-component.entry.js +4 -4
  193. package/dist/nylas-web-elements/nylas-location-component.entry.js.map +1 -1
  194. package/dist/nylas-web-elements/nylas-min-cancellation-notice.entry.js +1 -1
  195. package/dist/nylas-web-elements/nylas-min-cancellation-notice.entry.js.map +1 -1
  196. package/dist/nylas-web-elements/nylas-scheduler-editor.entry.js +1 -1
  197. package/dist/nylas-web-elements/nylas-scheduler-editor.entry.js.map +1 -1
  198. package/dist/nylas-web-elements/nylas-selected-event-card.entry.js +1 -1
  199. package/dist/nylas-web-elements/nylas-time-window-picker.entry.js +39 -14
  200. package/dist/nylas-web-elements/nylas-time-window-picker.entry.js.map +1 -1
  201. package/dist/nylas-web-elements/nylas-web-elements.esm.js +1 -1
  202. package/dist/nylas-web-elements/p-0dabcb4d.js.map +1 -1
  203. package/dist/nylas-web-elements/{p-933c6d32.entry.js → p-181654f5.entry.js} +3 -3
  204. package/dist/nylas-web-elements/{p-933c6d32.entry.js.map → p-181654f5.entry.js.map} +1 -1
  205. package/dist/nylas-web-elements/{p-b1b3eb52.entry.js → p-1871c702.entry.js} +2 -2
  206. package/dist/nylas-web-elements/p-4f4e83d0.entry.js +2 -0
  207. package/dist/nylas-web-elements/p-4f4e83d0.entry.js.map +1 -0
  208. package/dist/nylas-web-elements/p-a219b2c7.entry.js +2 -0
  209. package/dist/nylas-web-elements/p-a219b2c7.entry.js.map +1 -0
  210. package/dist/nylas-web-elements/{p-a002b4cf.entry.js → p-e92690a2.entry.js} +2 -2
  211. package/dist/nylas-web-elements/p-ee91a2a0.js.map +1 -1
  212. package/dist/nylas-web-elements/scheduler-config-store-8ccc8dc7.js.map +1 -1
  213. package/dist/types/components/scheduler-editor/nylas-availability-picker/nylas-availability-picker.d.ts +10 -5
  214. package/dist/types/components/scheduler-editor/nylas-event-description/nylas-event-description.d.ts +2 -2
  215. package/dist/types/components/scheduler-editor/nylas-location-component/nylas-location-component.d.ts +2 -2
  216. package/dist/types/components/scheduler-editor/nylas-time-window-picker/nylas-time-window-picker.d.ts +8 -3
  217. package/dist/types/components.d.ts +125 -32
  218. package/dist/types/stores/scheduler-config-store.d.ts +5 -1
  219. package/dist/types/types/index.d.ts +73 -0
  220. package/package.json +4 -2
  221. package/dist/nylas-web-elements/p-74492776.entry.js +0 -2
  222. package/dist/nylas-web-elements/p-74492776.entry.js.map +0 -1
  223. package/dist/nylas-web-elements/p-76461af6.entry.js +0 -2
  224. package/dist/nylas-web-elements/p-76461af6.entry.js.map +0 -1
  225. /package/dist/nylas-web-elements/{p-b1b3eb52.entry.js.map → p-1871c702.entry.js.map} +0 -0
  226. /package/dist/nylas-web-elements/{p-a002b4cf.entry.js.map → p-e92690a2.entry.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"nylas-event-duration.js","sourceRoot":"","sources":["../../../../src/components/scheduler-editor/nylas-event-duration/nylas-event-duration.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AAkB9H,MAAM,OAAO,kBAAkB;;;oBAON,UAAU;;wBAGL,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,oBAAoB,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,oBAAoB,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC;+BACvH,IAAI,CAAC,oBAAoB,IAAI,CAAC;iCAC5B,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,oBAAoB,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;;IAU/G,yBAAyB,CAAC,QAAgB;QACxC,KAA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EACf,KAAK,EAAE,IAAI,CAAC,QAAQ,EACpB,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,UAAU,EAAE,EAC/B,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAClC,GAAG,EAAE,CAAC,GACN;oBACF,wEACE,IAAI,EAAE,gBAAgB,EACtB,OAAO,EAAE,eAAe,EACxB,WAAW,EAAC,qHAAqH,EACjI,qBAAqB,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,iBAAiB,CAAC,IAAI,eAAe,CAAC,CAAC,CAAC,EACzG,UAAU,EAAE,KAAK,GACjB,CACE,CACF,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAxCC;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;;;;gDAwCD","sourcesContent":["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 * @part ned - The event duration container\n * @part ned_input - The event duration input\n * @part ned__dropdown - The dropdown container\n * @part ned__dropdown-button - The dropdown button\n * @part ned__dropdown-content - The dropdown content\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 @Element() host!: HTMLElement;\n /**\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n\n @Prop() name: string = 'duration';\n @Prop() eventDurationMinutes?: number;\n\n @State() duration: number = this.eventDurationMinutes ? (this.eventDurationMinutes >= 60 ? this.eventDurationMinutes / 60 : this.eventDurationMinutes) : 5;\n @State() durationMinutes: number = this.eventDurationMinutes ?? 5;\n @State() durationIncrement: number = this.eventDurationMinutes ? (this.eventDurationMinutes >= 60 ? 60 : 1) : 1;\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 ?? 5;\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 @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 this.internals.setFormValue(this.durationMinutes.toString(), 'duration');\n }\n\n disconnectedCallback() {\n debug('nylas-event-duration', 'disconnectedCallback');\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 handleBlur() {\n if ((this.duration === null || this.duration === undefined) && this.durationIncrement === 1) {\n this.duration = 5;\n }\n if ((this.duration <= 0 || this.duration === null || this.duration === undefined) && this.durationIncrement === 60) {\n this.duration = 1;\n }\n if (this.duration < 5 && this.durationIncrement === 1) {\n this.duration = 5;\n }\n this.durationMinutes = this.duration * this.durationIncrement;\n this.internals.setFormValue(this.durationMinutes.toString(), 'duration');\n }\n\n @Listen('selectedOptionChanged')\n selectedOptionChangedHandler(event: CustomEvent<{ value: string; name: string }>) {\n debug('nylas-calendar-picker', 'selectedOptionChangedHandler', event.detail);\n const { value } = event.detail;\n this.durationIncrement = parseInt(value);\n if (this.durationIncrement === 1) {\n this.duration = 5;\n } else {\n this.duration = 1;\n }\n\n this.durationMinutes = this.duration * this.durationIncrement;\n this.internals.setFormValue(this.durationMinutes.toString(), 'duration');\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: 'minutes' },\n { value: 60, label: 'hours' },\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 <span class=\"label-icon\">\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">Set the duration of your event.</span>\n </tooltip-component>\n </span>\n </label>\n <div class=\"nylas-event-duration__wrapper\">\n <input\n type=\"number\"\n part=\"ned_input\"\n id=\"duration\"\n name=\"duration\"\n value={this.duration}\n onBlur={() => this.handleBlur()}\n onInput={e => this.handleChange(e)}\n min={5}\n />\n <select-dropdown\n name={'event-duration'}\n options={durationOptions}\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) ?? durationOptions[0]}\n withSearch={false}\n />\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"nylas-event-duration.js","sourceRoot":"","sources":["../../../../src/components/scheduler-editor/nylas-event-duration/nylas-event-duration.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AAkB9H,MAAM,OAAO,kBAAkB;;;oBAaN,UAAU;;wBASL,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,oBAAoB,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,oBAAoB,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC;+BAIvH,IAAI,CAAC,oBAAoB,IAAI,CAAC;iCAI5B,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,oBAAoB,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;;IAa/G,yBAAyB,CAAC,QAAgB;QACxC,KAAK,CAAC,sBAAsB,EAAE,2BAA2B,EAAE,QAAQ,CAAC,CAAC;QACrE,IAAI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AAC,IAAI,CAAC,UAAU,EAAE,EAC/B,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAClC,GAAG,EAAE,CAAC,GACN;oBACF,wEACE,IAAI,EAAE,gBAAgB,EACtB,OAAO,EAAE,eAAe,EACxB,WAAW,EAAC,qHAAqH,EACjI,qBAAqB,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,iBAAiB,CAAC,IAAI,eAAe,CAAC,CAAC,CAAC,EACzG,UAAU,EAAE,KAAK,GACjB,CACE,CACF,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAxCC;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;;;;gDAwCD","sourcesContent":["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 * @part ned - The event duration container\n * @part ned_input - The event duration input\n * @part ned__dropdown - The dropdown container\n * @part ned__dropdown-button - The dropdown button\n * @part ned__dropdown-content - The dropdown content\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 * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n\n /**\n * The name of the event duration. Default is 'duration'.\n */\n @Prop() name: string = 'duration';\n /**\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 5 minutes.\n */\n @State() duration: number = this.eventDurationMinutes ? (this.eventDurationMinutes >= 60 ? this.eventDurationMinutes / 60 : this.eventDurationMinutes) : 5;\n /**\n * The duration in minutes. This defaults to the event duration from the configuration or 5 minutes.\n */\n @State() durationMinutes: number = this.eventDurationMinutes ?? 5;\n /**\n * The duration increment. This defaults to minute(s).\n */\n @State() durationIncrement: number = this.eventDurationMinutes ? (this.eventDurationMinutes >= 60 ? 60 : 1) : 1;\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 ?? 5;\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 this.internals.setFormValue(this.durationMinutes.toString(), 'duration');\n }\n\n disconnectedCallback() {\n debug('nylas-event-duration', 'disconnectedCallback');\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 handleBlur() {\n if ((this.duration === null || this.duration === undefined) && this.durationIncrement === 1) {\n this.duration = 5;\n }\n if ((this.duration <= 0 || this.duration === null || this.duration === undefined) && this.durationIncrement === 60) {\n this.duration = 1;\n }\n if (this.duration < 5 && this.durationIncrement === 1) {\n this.duration = 5;\n }\n this.durationMinutes = this.duration * this.durationIncrement;\n this.internals.setFormValue(this.durationMinutes.toString(), 'duration');\n }\n\n @Listen('selectedOptionChanged')\n selectedOptionChangedHandler(event: CustomEvent<{ value: string; name: string }>) {\n debug('nylas-calendar-picker', 'selectedOptionChangedHandler', event.detail);\n const { value } = event.detail;\n this.durationIncrement = parseInt(value);\n if (this.durationIncrement === 1) {\n this.duration = 5;\n } else {\n this.duration = 1;\n }\n\n this.durationMinutes = this.duration * this.durationIncrement;\n this.internals.setFormValue(this.durationMinutes.toString(), 'duration');\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: 'minutes' },\n { value: 60, label: 'hours' },\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 <span class=\"label-icon\">\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">Set the duration of your event.</span>\n </tooltip-component>\n </span>\n </label>\n <div class=\"nylas-event-duration__wrapper\">\n <input\n type=\"number\"\n part=\"ned_input\"\n id=\"duration\"\n name=\"duration\"\n value={this.duration}\n onBlur={() => this.handleBlur()}\n onInput={e => this.handleChange(e)}\n min={5}\n />\n <select-dropdown\n name={'event-duration'}\n options={durationOptions}\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) ?? durationOptions[0]}\n withSearch={false}\n />\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
@@ -29,7 +29,7 @@ export class NylasEventInfo {
29
29
  debug('nylas-event-info', 'disconnectedCallback');
30
30
  }
31
31
  render() {
32
- return (h(Host, { key: '457f3d049f6a14d618ef40112be0edee12d65a2d' }, h("nylas-form-card", { key: 'b44f094aa09d25ca21a04181d1ae6e66d0a85610' }, h("h1", { key: '60ce63fea2cb8871a7680b903af74aca3b6a65ca', slot: "header-title", class: "nylas-event-info__title" }, "Event information"), h("h3", { key: '174984461cc3acfe3fca921f8578f9066405f209', slot: "header-subtitle", class: "nylas-event-info__subtitle" }, "Enter all event information."), h("div", { key: '7b256c5bf099d277450242fae4b8d7d866249ef8', slot: "content", class: "nylas-event-info__content" }, h("slot", { key: '429339b55f9f729202d37e1bf1ffc39f851545ba', name: "inputs" })))));
32
+ return (h(Host, { key: 'e606a689e2b20dcddcbdbf42c44933953cb0c9c7' }, h("nylas-form-card", { key: 'f3827f8c8756d131ea0eeca39d8dcae783b58629' }, h("h1", { key: '6deb1da623b3c6ede66653201476647d30b8f7e5', slot: "header-title", class: "nylas-event-info__title" }, "Event information"), h("h3", { key: 'f027a8e56e59fba0e8ec3e4bfcbfda6419c5a6dc', slot: "header-subtitle", class: "nylas-event-info__subtitle" }, "Enter all event information."), h("div", { key: '0124599b210dc4e9395cdc75dd964132e98736b9', slot: "content", class: "nylas-event-info__content" }, h("slot", { key: 'a227128a7e6f7f8b8c52bd0bd24ce672979fef30', name: "inputs" })))));
33
33
  }
34
34
  static get is() { return "nylas-event-info"; }
35
35
  static get encapsulation() { return "shadow"; }
@@ -1 +1 @@
1
- {"version":3,"file":"nylas-event-info.js","sourceRoot":"","sources":["../../../../src/components/scheduler-editor/nylas-event-info/nylas-event-info.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAYpE,MAAM,OAAO,cAAc;IAGzB,iBAAiB;QACf,KAAK,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,CAAC;IACjD,CAAC;IAED,iBAAiB;QACf,KAAK,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,CAAC;IACjD,CAAC;IAED,gBAAgB;QACd,KAAK,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;IAChD,CAAC;IAED,oBAAoB;QAClB,KAAK,CAAC,kBAAkB,EAAE,sBAAsB,CAAC,CAAC;IACpD,CAAC;IAOD,MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACH;gBACE,2DAAI,IAAI,EAAC,cAAc,EAAC,KAAK,EAAC,yBAAyB,wBAElD;gBACL,2DAAI,IAAI,EAAC,iBAAiB,EAAC,KAAK,EAAC,4BAA4B,mCAExD;gBACL,4DAAK,IAAI,EAAC,SAAS,EAAC,KAAK,EAAC,2BAA2B;oBACnD,6DAAM,IAAI,EAAC,QAAQ,GAAQ,CACvB,CACU,CACb,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;CACF;AAjBC;IALC,iBAAiB,CAAoG;QACpH,IAAI,EAAE,kBAAkB;QACxB,YAAY,EAAE,EAAE;QAChB,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;4CAiBD","sourcesContent":["import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug } from '@/utils/utils';\nimport { AttachInternals, Component, Host, h } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\n\n/**\n * The `nylas-event-info` component is a input form for the event information.\n */\n@Component({\n tag: 'nylas-event-info',\n styleUrl: 'nylas-event-info.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasEventInfo {\n @AttachInternals() internals!: ElementInternals;\n\n connectedCallback() {\n debug('nylas-event-info', 'connectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-event-info', 'componentWillLoad');\n }\n\n componentDidLoad() {\n debug('nylas-event-info', 'componentDidLoad');\n }\n\n disconnectedCallback() {\n debug('nylas-event-info', 'disconnectedCallback');\n }\n\n @RegisterComponent<NylasEventInfo, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-event-info',\n eventToProps: {},\n fireRegisterEvent: true,\n })\n render() {\n return (\n <Host>\n <nylas-form-card>\n <h1 slot=\"header-title\" class=\"nylas-event-info__title\">\n Event information\n </h1>\n <h3 slot=\"header-subtitle\" class=\"nylas-event-info__subtitle\">\n Enter all event information.\n </h3>\n <div slot=\"content\" class=\"nylas-event-info__content\">\n <slot name=\"inputs\"></slot>\n </div>\n </nylas-form-card>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"nylas-event-info.js","sourceRoot":"","sources":["../../../../src/components/scheduler-editor/nylas-event-info/nylas-event-info.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAYpE,MAAM,OAAO,cAAc;IAMzB,iBAAiB;QACf,KAAK,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,CAAC;IACjD,CAAC;IAED,iBAAiB;QACf,KAAK,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,CAAC;IACjD,CAAC;IAED,gBAAgB;QACd,KAAK,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;IAChD,CAAC;IAED,oBAAoB;QAClB,KAAK,CAAC,kBAAkB,EAAE,sBAAsB,CAAC,CAAC;IACpD,CAAC;IAOD,MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACH;gBACE,2DAAI,IAAI,EAAC,cAAc,EAAC,KAAK,EAAC,yBAAyB,wBAElD;gBACL,2DAAI,IAAI,EAAC,iBAAiB,EAAC,KAAK,EAAC,4BAA4B,mCAExD;gBACL,4DAAK,IAAI,EAAC,SAAS,EAAC,KAAK,EAAC,2BAA2B;oBACnD,6DAAM,IAAI,EAAC,QAAQ,GAAQ,CACvB,CACU,CACb,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;CACF;AAjBC;IALC,iBAAiB,CAAoG;QACpH,IAAI,EAAE,kBAAkB;QACxB,YAAY,EAAE,EAAE;QAChB,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;4CAiBD","sourcesContent":["import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug } from '@/utils/utils';\nimport { AttachInternals, Component, Host, h } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\n\n/**\n * The `nylas-event-info` component is a input form for the event information.\n */\n@Component({\n tag: 'nylas-event-info',\n styleUrl: 'nylas-event-info.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasEventInfo {\n /**\n * The element internals.\n */\n @AttachInternals() internals!: ElementInternals;\n\n connectedCallback() {\n debug('nylas-event-info', 'connectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-event-info', 'componentWillLoad');\n }\n\n componentDidLoad() {\n debug('nylas-event-info', 'componentDidLoad');\n }\n\n disconnectedCallback() {\n debug('nylas-event-info', 'disconnectedCallback');\n }\n\n @RegisterComponent<NylasEventInfo, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-event-info',\n eventToProps: {},\n fireRegisterEvent: true,\n })\n render() {\n return (\n <Host>\n <nylas-form-card>\n <h1 slot=\"header-title\" class=\"nylas-event-info__title\">\n Event information\n </h1>\n <h3 slot=\"header-subtitle\" class=\"nylas-event-info__subtitle\">\n Enter all event information.\n </h3>\n <div slot=\"content\" class=\"nylas-event-info__content\">\n <slot name=\"inputs\"></slot>\n </div>\n </nylas-form-card>\n </Host>\n );\n }\n}\n"]}
@@ -29,7 +29,7 @@ export class NylasEventLimits {
29
29
  debug('nylas-event-limits', 'disconnectedCallback');
30
30
  }
31
31
  render() {
32
- return (h(Host, { key: '5842b0e121d5e2939d95ae584eb70ef7cbae6b1f' }, h("nylas-form-card", { key: '57141d607074889e5daa1b00ff124cbb4fbfd33d' }, h("h1", { key: '4be5625d740dd7f04d50151ff1af48d175262ec9', slot: "header-title", class: "nylas-event-limits__title" }, "Set event limits"), h("h3", { key: '6eb7607dcaf1e7bc344a5fd06ff5555543927aa7', slot: "header-subtitle", class: "nylas-event-limits__subtitle" }, "Customize event limits for the event."), h("div", { key: 'b3ca5e1a7d63a3d4b79be46536f19a22ec54e95e', slot: "content", class: "nylas-event-limits__content" }, h("slot", { key: '452c3dce511c89c4e07fd54bf325264d686c83d6', name: "inputs" })))));
32
+ return (h(Host, { key: '56a1396f87f4d81f1a3912ec810e23a9dbed965b' }, h("nylas-form-card", { key: '2007e2fe058e39bb8c276d2995b4b8075d9ed82f' }, h("h1", { key: 'e57bc40b4b369d64cdb2b6c97009dea3f141716f', slot: "header-title", class: "nylas-event-limits__title" }, "Set event limits"), h("h3", { key: 'beb61ca97cfd3dca960e78e5f64abca4ace7777b', slot: "header-subtitle", class: "nylas-event-limits__subtitle" }, "Customize event limits for the event."), h("div", { key: '3912501d3e927fcbc6e8663f9149c66ce54fbd0e', slot: "content", class: "nylas-event-limits__content" }, h("slot", { key: 'a0902c2edc5ef540547452d5f1448ba26547af17', name: "inputs" })))));
33
33
  }
34
34
  static get is() { return "nylas-event-limits"; }
35
35
  static get encapsulation() { return "shadow"; }
@@ -1 +1 @@
1
- {"version":3,"file":"nylas-event-limits.js","sourceRoot":"","sources":["../../../../src/components/scheduler-editor/nylas-event-limits/nylas-event-limits.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAYpE,MAAM,OAAO,gBAAgB;IAG3B,iBAAiB;QACf,KAAK,CAAC,oBAAoB,EAAE,mBAAmB,CAAC,CAAC;IACnD,CAAC;IAED,iBAAiB;QACf,KAAK,CAAC,oBAAoB,EAAE,mBAAmB,CAAC,CAAC;IACnD,CAAC;IAED,gBAAgB;QACd,KAAK,CAAC,oBAAoB,EAAE,kBAAkB,CAAC,CAAC;IAClD,CAAC;IAED,oBAAoB;QAClB,KAAK,CAAC,oBAAoB,EAAE,sBAAsB,CAAC,CAAC;IACtD,CAAC;IAOD,MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACH;gBACE,2DAAI,IAAI,EAAC,cAAc,EAAC,KAAK,EAAC,2BAA2B,uBAEpD;gBACL,2DAAI,IAAI,EAAC,iBAAiB,EAAC,KAAK,EAAC,8BAA8B,4CAE1D;gBACL,4DAAK,IAAI,EAAC,SAAS,EAAC,KAAK,EAAC,6BAA6B;oBACrD,6DAAM,IAAI,EAAC,QAAQ,GAAQ,CACvB,CACU,CACb,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;CACF;AAjBC;IALC,iBAAiB,CAAsG;QACtH,IAAI,EAAE,oBAAoB;QAC1B,YAAY,EAAE,EAAE;QAChB,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;8CAiBD","sourcesContent":["import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug } from '@/utils/utils';\nimport { AttachInternals, Component, Host, h } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\n\n/**\n * The `nylas-event-limits` component is a input form for the event information.\n */\n@Component({\n tag: 'nylas-event-limits',\n styleUrl: 'nylas-event-limits.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasEventLimits {\n @AttachInternals() internals!: ElementInternals;\n\n connectedCallback() {\n debug('nylas-event-limits', 'connectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-event-limits', 'componentWillLoad');\n }\n\n componentDidLoad() {\n debug('nylas-event-limits', 'componentDidLoad');\n }\n\n disconnectedCallback() {\n debug('nylas-event-limits', 'disconnectedCallback');\n }\n\n @RegisterComponent<NylasEventLimits, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-event-limits',\n eventToProps: {},\n fireRegisterEvent: true,\n })\n render() {\n return (\n <Host>\n <nylas-form-card>\n <h1 slot=\"header-title\" class=\"nylas-event-limits__title\">\n Set event limits\n </h1>\n <h3 slot=\"header-subtitle\" class=\"nylas-event-limits__subtitle\">\n Customize event limits for the event.\n </h3>\n <div slot=\"content\" class=\"nylas-event-limits__content\">\n <slot name=\"inputs\"></slot>\n </div>\n </nylas-form-card>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"nylas-event-limits.js","sourceRoot":"","sources":["../../../../src/components/scheduler-editor/nylas-event-limits/nylas-event-limits.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAYpE,MAAM,OAAO,gBAAgB;IAM3B,iBAAiB;QACf,KAAK,CAAC,oBAAoB,EAAE,mBAAmB,CAAC,CAAC;IACnD,CAAC;IAED,iBAAiB;QACf,KAAK,CAAC,oBAAoB,EAAE,mBAAmB,CAAC,CAAC;IACnD,CAAC;IAED,gBAAgB;QACd,KAAK,CAAC,oBAAoB,EAAE,kBAAkB,CAAC,CAAC;IAClD,CAAC;IAED,oBAAoB;QAClB,KAAK,CAAC,oBAAoB,EAAE,sBAAsB,CAAC,CAAC;IACtD,CAAC;IAOD,MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACH;gBACE,2DAAI,IAAI,EAAC,cAAc,EAAC,KAAK,EAAC,2BAA2B,uBAEpD;gBACL,2DAAI,IAAI,EAAC,iBAAiB,EAAC,KAAK,EAAC,8BAA8B,4CAE1D;gBACL,4DAAK,IAAI,EAAC,SAAS,EAAC,KAAK,EAAC,6BAA6B;oBACrD,6DAAM,IAAI,EAAC,QAAQ,GAAQ,CACvB,CACU,CACb,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;CACF;AAjBC;IALC,iBAAiB,CAAsG;QACtH,IAAI,EAAE,oBAAoB;QAC1B,YAAY,EAAE,EAAE;QAChB,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;8CAiBD","sourcesContent":["import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug } from '@/utils/utils';\nimport { AttachInternals, Component, Host, h } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\n\n/**\n * The `nylas-event-limits` component is a input form for the event information.\n */\n@Component({\n tag: 'nylas-event-limits',\n styleUrl: 'nylas-event-limits.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasEventLimits {\n /**\n * The element internals.\n */\n @AttachInternals() internals!: ElementInternals;\n\n connectedCallback() {\n debug('nylas-event-limits', 'connectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-event-limits', 'componentWillLoad');\n }\n\n componentDidLoad() {\n debug('nylas-event-limits', 'componentDidLoad');\n }\n\n disconnectedCallback() {\n debug('nylas-event-limits', 'disconnectedCallback');\n }\n\n @RegisterComponent<NylasEventLimits, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-event-limits',\n eventToProps: {},\n fireRegisterEvent: true,\n })\n render() {\n return (\n <Host>\n <nylas-form-card>\n <h1 slot=\"header-title\" class=\"nylas-event-limits__title\">\n Set event limits\n </h1>\n <h3 slot=\"header-subtitle\" class=\"nylas-event-limits__subtitle\">\n Customize event limits for the event.\n </h3>\n <div slot=\"content\" class=\"nylas-event-limits__content\">\n <slot name=\"inputs\"></slot>\n </div>\n </nylas-form-card>\n </Host>\n );\n }\n}\n"]}
@@ -302,10 +302,10 @@ export class NylasEventTitle {
302
302
  return (h("div", { class: "token-label" }, h("span", { class: "token" }, token.token), h("span", { class: "description" }, token.description)));
303
303
  }
304
304
  render() {
305
- return (h(Host, { key: 'e0ddf6c13a5a0c0d2e0db9188365418fb7484dcf' }, h("div", { key: 'a3b8e594c8d9632709e777891f04df0aaaf7c5c3', class: "nylas-event-title", part: "net" }, h("label", { key: 'e5794d2cd8be0b1666bfa67c3ea657da5dc8d45d', htmlFor: "title" }, "Event title", h("span", { key: '1210caceb7bf824f01559460e1c5e572cb2dad92', class: "required" }, "*"), h("span", { key: '4280ec285221e6db76ca08723fe3888a1d2643e3', class: "label-icon" }, h("tooltip-component", { key: 'd6c05fb79cf39656af7589a2e9de9ef832d7a2f8' }, h("info-icon", { key: 'a4659d97d60d00dfcc2c993e70da5cfd05904f78', slot: "tooltip-icon" }), h("span", { key: '738bfa669eec42b417be02fbad0584af34044c83', slot: "tooltip-content" }, "Enter a title for your event.")))), h("div", { key: 'df102dc899f8de91154689d9cdaae28465380622', class: {
305
+ return (h(Host, { key: '28ef0be3f64aafdaabb6bed562f5c89b92f2510e' }, h("div", { key: '42cc820bd4ca2343ebe09108a7ce5fca37c02165', class: "nylas-event-title", part: "net" }, h("label", { key: '748c85b9ef6a656b43137864c49282abfa0b78b9', htmlFor: "title" }, "Event title", h("span", { key: '29e8a26acfc6795ee511457c1f052bcc831757c3', class: "required" }, "*"), h("span", { key: 'a555e59986cb55543c108d82c9e7120e8f78cd2a', class: "label-icon" }, h("tooltip-component", { key: '29e6f432f02f6cb10bee3a3c61374688a23c9a9a' }, h("info-icon", { key: 'af9821938dc7f3175d8fdfb3426631111242483b', slot: "tooltip-icon" }), h("span", { key: 'b1027c6b32fab643f94c4233f3c60e1462f69945', slot: "tooltip-content" }, "Enter a title for your event.")))), h("div", { key: '387e621aa40cef2857b00eae8da13be376296178', class: {
306
306
  title: true,
307
307
  error: this.validationError !== '',
308
- }, part: "net__title", ref: el => (this.titleRef = el), contentEditable: "true", onInput: e => this.handleChange(e), onKeyDown: event => this.handleInputKeyDown(event) }), this.showTokens && this.filteredTokens?.length > 0 && (h("div", { class: "token-options", part: "net__dropdown-content" }, h("ul", { tabindex: "-1", role: "listbox", "aria-label": this.name, "aria-activedescendant": this.ariaActivedescendant }, this.filteredTokens.map(option => (h("li", { tabindex: "0", key: option.label, id: option.label, class: { active: this.ariaActivedescendant === option.label }, onClick: e => this.selectOption(e, option), role: "option" }, this.getLabelHTML(option.labelHTML))))))), h("span", { key: 'ec769eea7e2e3ff6d64bef0f5099540c93ba80ab', class: "help-text" }, "Create a dynamic templated event title by typing $. Learn more"), this.validationError != '' && h("span", { class: "error-message" }, this.validationError))));
308
+ }, part: "net__title", ref: el => (this.titleRef = el), contentEditable: "true", onInput: e => this.handleChange(e), onKeyDown: event => this.handleInputKeyDown(event) }), this.showTokens && this.filteredTokens?.length > 0 && (h("div", { class: "token-options", part: "net__dropdown-content" }, h("ul", { tabindex: "-1", role: "listbox", "aria-label": this.name, "aria-activedescendant": this.ariaActivedescendant }, this.filteredTokens.map(option => (h("li", { tabindex: "0", key: option.label, id: option.label, class: { active: this.ariaActivedescendant === option.label }, onClick: e => this.selectOption(e, option), role: "option" }, this.getLabelHTML(option.labelHTML))))))), h("span", { key: 'c1a3f0602920e0799322aef007e738ec3fd2c478', class: "help-text" }, "Create a dynamic templated event title by typing $. Learn more"), this.validationError != '' && h("span", { class: "error-message" }, this.validationError))));
309
309
  }
310
310
  static get is() { return "nylas-event-title"; }
311
311
  static get encapsulation() { return "shadow"; }
@@ -90,7 +90,7 @@ export class NylasLimitFutureBookings {
90
90
  this.selectedPeriod = period;
91
91
  }
92
92
  render() {
93
- return (h(Host, { key: '1bb30d8045366579b327f32f954d64c3360efa11' }, h("div", { key: '2594946bd35a01a0ab64288c54fe886f4577d8b5', class: "nylas-limit-future-bookings", part: "nlfb" }, h("label", { key: 'cf955eb319e09617dd95037d66a387122238d17c' }, "Limit future bookings", h("span", { key: '4f5658353873122f083faec5504856902bdba106', class: "label-icon" }, h("tooltip-component", { key: 'ee20b3543178702592b83e70a5a85988d0c3cd29' }, h("info-icon", { key: 'dfe75e502418b3f00a29d3d0fb76338056089266', slot: "tooltip-icon" }), h("span", { key: 'c7226da2491e6c3beda2f9739afda6220c37c0e1', slot: "tooltip-content" }, "Set a limit on how far in the future bookings can be made.")))), h("time-period-selector", { key: '5ad178b3d7158738a2882cb5a6554727de34a23d', id: "limit-future-bookings", timePeriods: ['day', 'week', 'month'], exportparts: "tps__number-dropdown: nlfb__number-dropdown, tps__number-dropdown-button: nlfb__number-dropdown-button, tps__number-dropdown-content: nlfb__number-dropdown-content, tps__period-dropdown: nlfb__period-dropdown, tps__period-dropdown-button: nlfb__period-dropdown-button, tps__period-dropdown-content: nlfb__period-dropdown-content", defaultSelectedNumber: this.selectedNumber, defaultSelectedPeriod: this.selectedPeriod }))));
93
+ return (h(Host, { key: '633f17f3c8a36aaf1b48653a471fce7a67c2e6bc' }, h("div", { key: '5685213b7d7d44a54cecda52d553fc49f0b45cf6', class: "nylas-limit-future-bookings", part: "nlfb" }, h("label", { key: '9c3f51639f92585b04cb6c358783ddb240fcd217' }, "Limit future bookings", h("span", { key: 'f234e3ff93652121e54d1aa77cbd77c2e93252c5', class: "label-icon" }, h("tooltip-component", { key: '4a1a059e553f52b856b220c37a9721ed8d890171' }, h("info-icon", { key: 'f6daa7aae8aefe95871744a22d71a1bb743a797c', slot: "tooltip-icon" }), h("span", { key: 'ef99e06e91e3f76e640d8209d0f9ad1831c9fdeb', slot: "tooltip-content" }, "Set a limit on how far in the future bookings can be made.")))), h("time-period-selector", { key: '02215f1ea27a251917bf8ad3cb10f9d36bd870ba', id: "limit-future-bookings", timePeriods: ['day', 'week', 'month'], exportparts: "tps__number-dropdown: nlfb__number-dropdown, tps__number-dropdown-button: nlfb__number-dropdown-button, tps__number-dropdown-content: nlfb__number-dropdown-content, tps__period-dropdown: nlfb__period-dropdown, tps__period-dropdown-button: nlfb__period-dropdown-button, tps__period-dropdown-content: nlfb__period-dropdown-content", defaultSelectedNumber: this.selectedNumber, defaultSelectedPeriod: this.selectedPeriod }))));
94
94
  }
95
95
  static get is() { return "nylas-limit-future-bookings"; }
96
96
  static get encapsulation() { return "shadow"; }
@@ -140,7 +140,7 @@ export class NylasLimitFutureBookings {
140
140
  "optional": true,
141
141
  "docs": {
142
142
  "tags": [],
143
- "text": ""
143
+ "text": "The number of days into the future that invitees will see availability, as set in the configuration."
144
144
  },
145
145
  "attribute": "available-days-in-future",
146
146
  "reflect": false
@@ -157,7 +157,7 @@ export class NylasLimitFutureBookings {
157
157
  "optional": false,
158
158
  "docs": {
159
159
  "tags": [],
160
- "text": ""
160
+ "text": "The name of the limit future bookings input."
161
161
  },
162
162
  "attribute": "name",
163
163
  "reflect": false,
@@ -180,7 +180,7 @@ export class NylasLimitFutureBookings {
180
180
  "composed": true,
181
181
  "docs": {
182
182
  "tags": [],
183
- "text": ""
183
+ "text": "Event emitted when the future booking limit changes."
184
184
  },
185
185
  "complexType": {
186
186
  "original": "{\n value: string;\n name: string;\n }",
@@ -1 +1 @@
1
- {"version":3,"file":"nylas-limit-future-bookings.js","sourceRoot":"","sources":["../../../../src/components/scheduler-editor/nylas-limit-future-bookings/nylas-limit-future-bookings.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAgB,MAAM,EAAE,MAAM,eAAe,CAAC;AAoB9H,MAAM,OAAO,wBAAwB;;;;oBAOZ,uBAAuB;8BAEZ,CAAC;8BACD,KAAK;;IAUvC,yBAAyB,CAAC,QAAgB;QACxC,KAAK,CAAC,6BAA6B,EAAE,2BAA2B,EAAE,QAAQ,CAAC,CAAC;QAC5E,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC3C,CAAC;IAGD,mCAAmC,CAAC,MAAqB;QACvD,MAAM,YAAY,GAAG,MAAM,EAAE,SAAS,EAAE,wBAAwB,CAAC;QACjE,IAAI,YAAY,EAAE,CAAC;YACjB,IAAI,CAAC,6BAA6B,CAAC,YAAY,CAAC,CAAC;QACnD,CAAC;IACH,CAAC;IAGD,4BAA4B,CAAC,QAAgB;QAC3C,IAAI,CAAC,6BAA6B,CAAC,QAAQ,CAAC,CAAC;IAC/C,CAAC;IAOD,iBAAiB;QACf,KAAK,CAAC,6BAA6B,EAAE,mBAAmB,CAAC,CAAC;IAC5D,CAAC;IAED,iBAAiB;QACf,KAAK,CAAC,6BAA6B,EAAE,mBAAmB,CAAC,CAAC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A8G;QAC9H,IAAI,EAAE,6BAA6B;QACnC,YAAY,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,uCAAuC,EAAE,uBAAuB,CAAC,CAAC,CAAC;QAC3F,YAAY,EAAE,EAAE;QAChB,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;sDAwBD","sourcesContent":["import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug } from '@/utils/utils';\nimport { AttachInternals, Component, Host, State, h, Element, Prop, Watch, Event, EventEmitter, Listen } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { Configuration } from '@nylas/core';\n\n/**\n * The `nylas-limit-future-bookings` component is a form input for the description of an event.\n * @part nlfb - The limit future bookings container\n * @part nlfb__number-dropdown - The number dropdown container\n * @part nlfb__number-dropdown-button - The number dropdown button\n * @part nlfb__number-dropdown-content - The number dropdown content\n * @part nlfb__period-dropdown - The period dropdown container\n * @part nlfb__period-dropdown-button - The period dropdown button\n * @part nlfb__period-dropdown-content - The period dropdown content\n */\n@Component({\n tag: 'nylas-limit-future-bookings',\n styleUrl: 'nylas-limit-future-bookings.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasLimitFutureBookings {\n @Element() host!: HTMLElement;\n /**\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n @Prop() availableDaysInFuture?: number;\n @Prop() name: string = 'limit-future-bookings';\n\n @State() selectedNumber: number = 1;\n @State() selectedPeriod: string = 'day';\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-limit-future-bookings', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('selectedConfiguration')\n selectedConfigurationChangedHandler(newVal: Configuration) {\n const daysInFuture = newVal?.scheduler?.available_days_in_future;\n if (daysInFuture) {\n this.updateNumberAndPeriodFromDays(daysInFuture);\n }\n }\n\n @Watch('availableDaysInFuture')\n availableDaysInFutureChanged(newValue: number) {\n this.updateNumberAndPeriodFromDays(newValue);\n }\n\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n }>;\n\n connectedCallback() {\n debug('nylas-limit-future-bookings', 'connectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-limit-future-bookings', 'componentWillLoad');\n this.host.setAttribute('name', this.name);\n }\n\n componentDidLoad() {\n debug('nylas-limit-future-bookings', 'componentDidLoad');\n this.availableDaysInFutureChanged(this.availableDaysInFuture ?? 1);\n if (typeof this.internals.setFormValue !== 'function') {\n return;\n }\n this.internals.setFormValue(this.availableDaysInFuture?.toString() ?? '1', this.name);\n }\n\n disconnectedCallback() {\n debug('nylas-limit-future-bookings', 'disconnectedCallback');\n }\n\n @Listen('timePeriodChanged')\n timePeriodChangedHandler(\n event: CustomEvent<{\n number: number;\n period: string;\n }>,\n ) {\n const { number, period } = event.detail;\n let availableDaysInFuture;\n if (period === 'day') {\n availableDaysInFuture = number;\n } else if (period === 'week') {\n availableDaysInFuture = number * 7;\n } else {\n availableDaysInFuture = number * 30;\n }\n this.valueChanged.emit({ value: availableDaysInFuture, name: 'availableDaysInFuture' });\n if (typeof this.internals.setFormValue !== 'function') {\n return;\n }\n this.internals.setFormValue(availableDaysInFuture.toString(), this.name);\n }\n\n updateNumberAndPeriodFromDays(days: number): void {\n let number, period;\n if (days >= 30 && days % 30 === 0) {\n number = days / 30;\n period = 'month';\n } else if (days >= 7 && days % 7 === 0) {\n number = days / 7;\n period = 'week';\n } else {\n number = days;\n period = 'day';\n }\n this.selectedNumber = number;\n this.selectedPeriod = period;\n }\n\n @RegisterComponent<NylasLimitFutureBookings, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-limit-future-bookings',\n stateToProps: new Map([['schedulerConfig.selectedConfiguration', 'selectedConfiguration']]),\n eventToProps: {},\n fireRegisterEvent: true,\n })\n render() {\n return (\n <Host>\n <div class=\"nylas-limit-future-bookings\" part=\"nlfb\">\n <label>\n Limit future bookings\n <span class=\"label-icon\">\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">Set a limit on how far in the future bookings can be made.</span>\n </tooltip-component>\n </span>\n </label>\n <time-period-selector\n id=\"limit-future-bookings\"\n timePeriods={['day', 'week', 'month']}\n exportparts=\"tps__number-dropdown: nlfb__number-dropdown, tps__number-dropdown-button: nlfb__number-dropdown-button, tps__number-dropdown-content: nlfb__number-dropdown-content, tps__period-dropdown: nlfb__period-dropdown, tps__period-dropdown-button: nlfb__period-dropdown-button, tps__period-dropdown-content: nlfb__period-dropdown-content\"\n defaultSelectedNumber={this.selectedNumber}\n defaultSelectedPeriod={this.selectedPeriod}\n />\n </div>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"nylas-limit-future-bookings.js","sourceRoot":"","sources":["../../../../src/components/scheduler-editor/nylas-limit-future-bookings/nylas-limit-future-bookings.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAgB,MAAM,EAAE,MAAM,eAAe,CAAC;AAoB9H,MAAM,OAAO,wBAAwB;;;;oBAgBZ,uBAAuB;8BAKZ,CAAC;8BAID,KAAK;;IAavC,yBAAyB,CAAC,QAAgB;QACxC,KAAK,CAAC,6BAA6B,EAAE,2BAA2B,EAAE,QAAQ,CAAC,CAAC;QAC5E,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,M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I,EAAC,cAAc,GAAG;4BACjC,6DAAM,IAAI,EAAC,iBAAiB,iEAAkE,CAC5E,CACf,CACD;gBACR,6EACE,EAAE,EAAC,uBAAuB,EAC1B,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EACrC,WAAW,EAAC,0UAA0U,EACtV,qBAAqB,EAAE,IAAI,CAAC,cAAc,EAC1C,qBAAqB,EAAE,IAAI,CAAC,cAAc,GAC1C,CACE,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAxBC;IANC,iBAAiB,CAA8G;QAC9H,IAAI,EAAE,6BAA6B;QACnC,YAAY,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,uCAAuC,EAAE,uBAAuB,CAAC,CAAC,CAAC;QAC3F,YAAY,EAAE,EAAE;QAChB,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;sDAwBD","sourcesContent":["import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug } from '@/utils/utils';\nimport { AttachInternals, Component, Host, State, h, Element, Prop, Watch, Event, EventEmitter, Listen } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { Configuration } from '@nylas/core';\n\n/**\n * The `nylas-limit-future-bookings` component is a form input for the description of an event.\n * @part nlfb - The limit future bookings container\n * @part nlfb__number-dropdown - The number dropdown container\n * @part nlfb__number-dropdown-button - The number dropdown button\n * @part nlfb__number-dropdown-content - The number dropdown content\n * @part nlfb__period-dropdown - The period dropdown container\n * @part nlfb__period-dropdown-button - The period dropdown button\n * @part nlfb__period-dropdown-content - The period dropdown content\n */\n@Component({\n tag: 'nylas-limit-future-bookings',\n styleUrl: 'nylas-limit-future-bookings.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasLimitFutureBookings {\n /**\n * The host element <nylas-limit-future-bookings>\n */\n @Element() host!: HTMLElement;\n /**\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n /**\n * The number of days into the future that invitees will see availability, as set in the configuration.\n */\n @Prop() availableDaysInFuture?: number;\n /**\n * The name of the limit future bookings input.\n */\n @Prop() name: string = 'limit-future-bookings';\n\n /**\n * The selected number for the available days in the future.\n */\n @State() selectedNumber: number = 1;\n /**\n * The selected period for the available days in the future.\n */\n @State() selectedPeriod: string = 'day';\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-limit-future-bookings', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('selectedConfiguration')\n selectedConfigurationChangedHandler(newVal: Configuration) {\n const daysInFuture = newVal?.scheduler?.available_days_in_future;\n if (daysInFuture) {\n this.updateNumberAndPeriodFromDays(daysInFuture);\n }\n }\n\n @Watch('availableDaysInFuture')\n availableDaysInFutureChanged(newValue: number) {\n this.updateNumberAndPeriodFromDays(newValue);\n }\n\n /**\n * Event emitted when the future booking limit changes.\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n }>;\n\n connectedCallback() {\n debug('nylas-limit-future-bookings', 'connectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-limit-future-bookings', 'componentWillLoad');\n this.host.setAttribute('name', this.name);\n }\n\n componentDidLoad() {\n debug('nylas-limit-future-bookings', 'componentDidLoad');\n this.availableDaysInFutureChanged(this.availableDaysInFuture ?? 1);\n if (typeof this.internals.setFormValue !== 'function') {\n return;\n }\n this.internals.setFormValue(this.availableDaysInFuture?.toString() ?? '1', this.name);\n }\n\n disconnectedCallback() {\n debug('nylas-limit-future-bookings', 'disconnectedCallback');\n }\n\n @Listen('timePeriodChanged')\n timePeriodChangedHandler(\n event: CustomEvent<{\n number: number;\n period: string;\n }>,\n ) {\n const { number, period } = event.detail;\n let availableDaysInFuture;\n if (period === 'day') {\n availableDaysInFuture = number;\n } else if (period === 'week') {\n availableDaysInFuture = number * 7;\n } else {\n availableDaysInFuture = number * 30;\n }\n this.valueChanged.emit({ value: availableDaysInFuture, name: 'availableDaysInFuture' });\n if (typeof this.internals.setFormValue !== 'function') {\n return;\n }\n this.internals.setFormValue(availableDaysInFuture.toString(), this.name);\n }\n\n updateNumberAndPeriodFromDays(days: number): void {\n let number, period;\n if (days >= 30 && days % 30 === 0) {\n number = days / 30;\n period = 'month';\n } else if (days >= 7 && days % 7 === 0) {\n number = days / 7;\n period = 'week';\n } else {\n number = days;\n period = 'day';\n }\n this.selectedNumber = number;\n this.selectedPeriod = period;\n }\n\n @RegisterComponent<NylasLimitFutureBookings, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-limit-future-bookings',\n stateToProps: new Map([['schedulerConfig.selectedConfiguration', 'selectedConfiguration']]),\n eventToProps: {},\n fireRegisterEvent: true,\n })\n render() {\n return (\n <Host>\n <div class=\"nylas-limit-future-bookings\" part=\"nlfb\">\n <label>\n Limit future bookings\n <span class=\"label-icon\">\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">Set a limit on how far in the future bookings can be made.</span>\n </tooltip-component>\n </span>\n </label>\n <time-period-selector\n id=\"limit-future-bookings\"\n timePeriods={['day', 'week', 'month']}\n exportparts=\"tps__number-dropdown: nlfb__number-dropdown, tps__number-dropdown-button: nlfb__number-dropdown-button, tps__number-dropdown-content: nlfb__number-dropdown-content, tps__period-dropdown: nlfb__period-dropdown, tps__period-dropdown-button: nlfb__period-dropdown-button, tps__period-dropdown-content: nlfb__period-dropdown-content\"\n defaultSelectedNumber={this.selectedNumber}\n defaultSelectedPeriod={this.selectedPeriod}\n />\n </div>\n </Host>\n );\n }\n}\n"]}
@@ -17,11 +17,11 @@ import { debug } from "../../../utils/utils";
17
17
  import { Host, h } from "@stencil/core";
18
18
  export class NylasLocationComponent {
19
19
  constructor() {
20
+ this.name = 'location';
20
21
  this.selectedConfiguration = undefined;
21
22
  this.eventLocation = undefined;
22
23
  this.location = this.eventLocation ?? '';
23
24
  this.selectedLocationOption = this.eventLocation ? 'custom' : 'none';
24
- this.name = 'location';
25
25
  }
26
26
  elementNameChangedHandler(newValue) {
27
27
  debug('nylas-location-component', 'elementNameChangedHandler', newValue);
@@ -79,10 +79,10 @@ export class NylasLocationComponent {
79
79
  { value: 'custom', label: 'Custom location' },
80
80
  ];
81
81
  const icons = {
82
- none: h("location-off-icon", { key: '5344819790f0d245e78de8808b05005eaa610991' }),
83
- custom: h("location-icon", { key: '6d931006f7ea79e3290bde60cbdd3c1ca8e827f8' }),
82
+ none: h("location-off-icon", { key: '575c799ee8e373f1fa305166312f3192cbb1195e' }),
83
+ custom: h("location-icon", { key: '3e9a108a256313289846487fdb5a2c8f93bf06ea' }),
84
84
  };
85
- return (h(Host, { key: '2117e5636492cd1b3bc3b975fdc1398c030df9a4' }, h("div", { key: '093c3fdfaf0ad88955f8f785a5c589708d941e57', class: "nylas-event-location", part: "nel" }, h("label", { key: 'e2754216f675fc82cdc7813bacfe0e928e9ed50e', htmlFor: "location" }, "Location type", h("span", { key: 'e402fccc0065a4f6fd0cbd05af345b73b06c4464', class: "label-icon" }, h("tooltip-component", { key: 'c818dbca3cbbf29e34c56bbc9caea7fc3816d808' }, h("info-icon", { key: '5ea673e0d49efe7e0a4ac04c3ec64427a63b8843', slot: "tooltip-icon" }), h("span", { key: 'dac6ddf369aa6caf62a870ca349745f546ed3959', slot: "tooltip-content" }, "Choose how you\u2019ll meet with the participants at the scheduled time. Pick from available conferencing options or add a custom location.")))), h("div", { key: 'bf334b9e8e03b660f661d264c9ca52444ee859b6', class: "location-input" }, h("select-dropdown", { key: 'f216e1589bb3b72a9ed6b9cfbec5683795e1b08e', withSearch: false, name: "location", options: locationOptions, defaultSelectedOption: locationOptions.find(i => i.value == this.selectedLocationOption), exportparts: "sd__dropdown: nel__dropdown, sd__dropdown-button: nel__dropdown-button, sd__dropdown-content: nel__dropdown-content" }, h("span", { key: '6ca96d9f95ac189195c1490e6872b2478cd0d270', slot: "select-icon" }, icons[this.selectedLocationOption])), this.selectedLocationOption === 'custom' && (h("input", { type: "text", part: "nel__location", id: "location", name: "location", maxlength: "1024", value: this.location, onInput: e => this.handleChange(e) }))))));
85
+ return (h(Host, { key: '8038cd624df0d63608bb23d0b52ee73d62939ba6' }, h("div", { key: '3047dfeacda102f18f0413213a86676eb1c5f901', class: "nylas-event-location", part: "nel" }, h("label", { key: '8cbf08ad544cc6dbfa21f8eca510fe7700756cbb', htmlFor: "location" }, "Location type", h("span", { key: 'b806d2ab1087c5d82674d2ba1f697ab650dfff64', class: "label-icon" }, h("tooltip-component", { key: '3a67a7eb1eed2315d46d6e81fe62314bf92226d7' }, h("info-icon", { key: '4e787698acb0d0d272c13a226747c1252741cbe9', slot: "tooltip-icon" }), h("span", { key: '85eb8db37cef3482e59124b21c968dfe4ea38fec', slot: "tooltip-content" }, "Choose how you\u2019ll meet with the participants at the scheduled time. Pick from available conferencing options or add a custom location.")))), h("div", { key: '5970b85d96f9430504846d7ff66a259b639a17d7', class: "location-input" }, h("select-dropdown", { key: 'b848b8a01563c1640a0552c385ed268e15431453', withSearch: false, name: "location", options: locationOptions, defaultSelectedOption: locationOptions.find(i => i.value == this.selectedLocationOption), exportparts: "sd__dropdown: nel__dropdown, sd__dropdown-button: nel__dropdown-button, sd__dropdown-content: nel__dropdown-content" }, h("span", { key: 'c3bf4e65c37357b12892f333a3a2a22803400e46', slot: "select-icon" }, icons[this.selectedLocationOption])), this.selectedLocationOption === 'custom' && (h("input", { type: "text", part: "nel__location", id: "location", name: "location", maxlength: "1024", value: this.location, onInput: e => this.handleChange(e) }))))));
86
86
  }
87
87
  static get is() { return "nylas-location-component"; }
88
88
  static get encapsulation() { return "shadow"; }
@@ -99,6 +99,24 @@ export class NylasLocationComponent {
99
99
  }
100
100
  static get properties() {
101
101
  return {
102
+ "name": {
103
+ "type": "string",
104
+ "mutable": false,
105
+ "complexType": {
106
+ "original": "string",
107
+ "resolved": "string",
108
+ "references": {}
109
+ },
110
+ "required": false,
111
+ "optional": false,
112
+ "docs": {
113
+ "tags": [],
114
+ "text": "The name of the event location input."
115
+ },
116
+ "attribute": "name",
117
+ "reflect": false,
118
+ "defaultValue": "'location'"
119
+ },
102
120
  "selectedConfiguration": {
103
121
  "type": "unknown",
104
122
  "mutable": false,
@@ -132,28 +150,10 @@ export class NylasLocationComponent {
132
150
  "optional": true,
133
151
  "docs": {
134
152
  "tags": [],
135
- "text": ""
153
+ "text": "The event location stored in the configuration"
136
154
  },
137
155
  "attribute": "event-location",
138
156
  "reflect": false
139
- },
140
- "name": {
141
- "type": "string",
142
- "mutable": false,
143
- "complexType": {
144
- "original": "string",
145
- "resolved": "string",
146
- "references": {}
147
- },
148
- "required": false,
149
- "optional": false,
150
- "docs": {
151
- "tags": [],
152
- "text": ""
153
- },
154
- "attribute": "name",
155
- "reflect": false,
156
- "defaultValue": "'location'"
157
157
  }
158
158
  };
159
159
  }
@@ -1 +1 @@
1
- {"version":3,"file":"nylas-location-component.js","sourceRoot":"","sources":["../../../../src/components/scheduler-editor/nylas-location-component/nylas-location-component.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAgB,MAAM,EAAE,MAAM,eAAe,CAAC;AAkB9H,MAAM,OAAO,sBAAsB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0B;QAChC,YAAY,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,uCAAuC,EAAE,uBAAuB,CAAC,CAAC,CAAC;QAC3F,YAAY,EAAE,EAAE;QAChB,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;oDA0CD","sourcesContent":["import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug } from '@/utils/utils';\nimport { AttachInternals, Component, Host, State, h, Element, Prop, Watch, Event, EventEmitter, Listen } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { Configuration } from '@nylas/core';\n\n/**\n * The `nylas-location-component` component is a form input for the description of an event.\n * @part nel - The event location container\n * @part nel__location - The event location input\n * @part nel__dropdown - The dropdown container\n * @part nel__dropdown-button - The dropdown button\n * @part nel__dropdown-content - The dropdown content\n */\n@Component({\n tag: 'nylas-location-component',\n styleUrl: 'nylas-location-component.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasLocationComponent {\n /**\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n\n @Prop() eventLocation?: string;\n @State() location: string = this.eventLocation ?? '';\n @State() selectedLocationOption: string = this.eventLocation ? 'custom' : 'none';\n @AttachInternals() internals!: ElementInternals;\n @Element() host!: HTMLElement;\n @Prop() name: string = 'location';\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-location-component', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('selectedConfiguration')\n selectedConfigurationChangedHandler(newValue: Configuration, oldValue: Configuration) {\n debug('nylas-custom-booking-flow', 'selectedConfigurationChangedHandler', newValue, oldValue);\n const configLocation = newValue?.event_booking?.location;\n if (configLocation) {\n this.selectedLocationOption = configLocation ? 'custom' : 'none';\n this.location = configLocation;\n }\n }\n\n @Watch('eventLocation')\n eventLocationChangedHandler(newValue: string, oldValue: string) {\n debug('nylas-location-component', 'eventLocationChangedHandler', newValue);\n if (newValue === oldValue) {\n return;\n }\n this.selectedLocationOption = newValue ? 'custom' : 'none';\n }\n\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n }>;\n\n connectedCallback() {\n debug('nylas-location-component', 'connectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-location-component', 'componentWillLoad');\n this.host.setAttribute('name', this.name);\n }\n\n componentDidLoad() {\n debug('nylas-location-component', 'componentDidLoad');\n }\n\n disconnectedCallback() {\n debug('nylas-location-component', 'disconnectedCallback');\n }\n\n @Listen('selectedOptionChanged')\n selectedOptionChangedHandler(event: CustomEvent<{ value: string }>) {\n this.selectedLocationOption = event.detail.value;\n if (this.selectedLocationOption === 'none') {\n this.location = '';\n this.setFormValue('', 'location');\n this.valueChanged.emit({ value: '', name: this.name });\n }\n }\n\n setFormValue(value: string, name: string) {\n if (typeof this.internals.setFormValue === 'function') {\n this.internals.setFormValue(value, name);\n }\n }\n\n handleChange(event) {\n this.location = event.target.value;\n this.setFormValue(event.target.value, 'location');\n this.valueChanged.emit({ value: event.target.value, name: this.name });\n }\n\n @RegisterComponent<NylasLocationComponent, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-location-component',\n stateToProps: new Map([['schedulerConfig.selectedConfiguration', 'selectedConfiguration']]),\n eventToProps: {},\n fireRegisterEvent: true,\n })\n render() {\n const locationOptions = [\n { value: 'none', label: 'None' },\n { value: 'custom', label: 'Custom location' },\n ];\n const icons = {\n none: <location-off-icon />,\n custom: <location-icon />,\n };\n\n return (\n <Host>\n <div class=\"nylas-event-location\" part=\"nel\">\n <label htmlFor=\"location\">\n Location type\n <span class=\"label-icon\">\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">\n Choose how you’ll meet with the participants at the scheduled time. Pick from available conferencing options or add a custom location.\n </span>\n </tooltip-component>\n </span>\n </label>\n <div class=\"location-input\">\n <select-dropdown\n withSearch={false}\n name=\"location\"\n options={locationOptions}\n defaultSelectedOption={locationOptions.find(i => i.value == this.selectedLocationOption)}\n exportparts=\"sd__dropdown: nel__dropdown, sd__dropdown-button: nel__dropdown-button, sd__dropdown-content: nel__dropdown-content\"\n >\n <span slot=\"select-icon\">{icons[this.selectedLocationOption]}</span>\n </select-dropdown>\n {this.selectedLocationOption === 'custom' && (\n <input type=\"text\" part=\"nel__location\" id=\"location\" name=\"location\" maxlength=\"1024\" value={this.location} onInput={e => this.handleChange(e)} />\n )}\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"nylas-location-component.js","sourceRoot":"","sources":["../../../../src/components/scheduler-editor/nylas-location-component/nylas-location-component.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAgB,MAAM,EAAE,MAAM,eAAe,CAAC;AAkB9H,MAAM,OAAO,sBAAsB;;oBAQV,UAAU;;;wBAaL,IAAI,CAAC,aAAa,IAAI,EAAE;sCAIV,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM;;IAYhF,yBAAyB,CAAC,QAAgB;QACxC,KAAK,CAAC,0BAA0B,EAAE,2BAA2B,EAAE,QAAQ,CAAC,CAAC;QACzE,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC3C,CAAC;IAGD,mCAAmC,CAAC,QAAuB,EAAE,QAAuB;QAClF,KAAK,CAAC,2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AAK,EAAC,gBAAgB;oBACzB,wEACE,UAAU,EAAE,KAAK,EACjB,IAAI,EAAC,UAAU,EACf,OAAO,EAAE,eAAe,EACxB,qBAAqB,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,sBAAsB,CAAC,EACxF,WAAW,EAAC,qHAAqH;wBAEjI,6DAAM,IAAI,EAAC,aAAa,IAAE,KAAK,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAQ,CACpD;oBACjB,IAAI,CAAC,sBAAsB,KAAK,QAAQ,IAAI,CAC3C,aAAO,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,eAAe,EAAC,EAAE,EAAC,UAAU,EAAC,IAAI,EAAC,UAAU,EAAC,SAAS,EAAC,MAAM,EAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,GAAI,CACpJ,CACG,CACF,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AA1CC;IANC,iBAAiB,CAA4G;QAC5H,IAAI,EAAE,0BAA0B;QAChC,YAAY,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,uCAAuC,EAAE,uBAAuB,CAAC,CAAC,CAAC;QAC3F,YAAY,EAAE,EAAE;QAChB,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;oDA0CD","sourcesContent":["import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug } from '@/utils/utils';\nimport { AttachInternals, Component, Host, State, h, Element, Prop, Watch, Event, EventEmitter, Listen } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { Configuration } from '@nylas/core';\n\n/**\n * The `nylas-location-component` component is a form input for the description of an event.\n * @part nel - The event location container\n * @part nel__location - The event location input\n * @part nel__dropdown - The dropdown container\n * @part nel__dropdown-button - The dropdown button\n * @part nel__dropdown-content - The dropdown content\n */\n@Component({\n tag: 'nylas-location-component',\n styleUrl: 'nylas-location-component.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasLocationComponent {\n /*\n * The host element <nylas-location-component>\n */\n @Element() host!: HTMLElement;\n /**\n * The name of the event location input.\n */\n @Prop() name: string = 'location';\n /**\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n\n /**\n * The event location stored in the configuration\n */\n @Prop() eventLocation?: string;\n /**\n * The selected event location state. This defaults to the event location from the configuration or an empty string.\n */\n @State() location: string = this.eventLocation ?? '';\n /**\n * The selected location option. This defaults to 'none'.\n */\n @State() selectedLocationOption: string = this.eventLocation ? 'custom' : 'none';\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-location-component', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('selectedConfiguration')\n selectedConfigurationChangedHandler(newValue: Configuration, oldValue: Configuration) {\n debug('nylas-custom-booking-flow', 'selectedConfigurationChangedHandler', newValue, oldValue);\n const configLocation = newValue?.event_booking?.location;\n if (configLocation) {\n this.selectedLocationOption = configLocation ? 'custom' : 'none';\n this.location = configLocation;\n }\n }\n\n @Watch('eventLocation')\n eventLocationChangedHandler(newValue: string, oldValue: string) {\n debug('nylas-location-component', 'eventLocationChangedHandler', newValue);\n if (newValue === oldValue) {\n return;\n }\n this.selectedLocationOption = newValue ? 'custom' : 'none';\n }\n\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n }>;\n\n connectedCallback() {\n debug('nylas-location-component', 'connectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-location-component', 'componentWillLoad');\n this.host.setAttribute('name', this.name);\n }\n\n componentDidLoad() {\n debug('nylas-location-component', 'componentDidLoad');\n }\n\n disconnectedCallback() {\n debug('nylas-location-component', 'disconnectedCallback');\n }\n\n @Listen('selectedOptionChanged')\n selectedOptionChangedHandler(event: CustomEvent<{ value: string }>) {\n this.selectedLocationOption = event.detail.value;\n if (this.selectedLocationOption === 'none') {\n this.location = '';\n this.setFormValue('', 'location');\n this.valueChanged.emit({ value: '', name: this.name });\n }\n }\n\n setFormValue(value: string, name: string) {\n if (typeof this.internals.setFormValue === 'function') {\n this.internals.setFormValue(value, name);\n }\n }\n\n handleChange(event) {\n this.location = event.target.value;\n this.setFormValue(event.target.value, 'location');\n this.valueChanged.emit({ value: event.target.value, name: this.name });\n }\n\n @RegisterComponent<NylasLocationComponent, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-location-component',\n stateToProps: new Map([['schedulerConfig.selectedConfiguration', 'selectedConfiguration']]),\n eventToProps: {},\n fireRegisterEvent: true,\n })\n render() {\n const locationOptions = [\n { value: 'none', label: 'None' },\n { value: 'custom', label: 'Custom location' },\n ];\n const icons = {\n none: <location-off-icon />,\n custom: <location-icon />,\n };\n\n return (\n <Host>\n <div class=\"nylas-event-location\" part=\"nel\">\n <label htmlFor=\"location\">\n Location type\n <span class=\"label-icon\">\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">\n Choose how you’ll meet with the participants at the scheduled time. Pick from available conferencing options or add a custom location.\n </span>\n </tooltip-component>\n </span>\n </label>\n <div class=\"location-input\">\n <select-dropdown\n withSearch={false}\n name=\"location\"\n options={locationOptions}\n defaultSelectedOption={locationOptions.find(i => i.value == this.selectedLocationOption)}\n exportparts=\"sd__dropdown: nel__dropdown, sd__dropdown-button: nel__dropdown-button, sd__dropdown-content: nel__dropdown-content\"\n >\n <span slot=\"select-icon\">{icons[this.selectedLocationOption]}</span>\n </select-dropdown>\n {this.selectedLocationOption === 'custom' && (\n <input type=\"text\" part=\"nel__location\" id=\"location\" name=\"location\" maxlength=\"1024\" value={this.location} onInput={e => this.handleChange(e)} />\n )}\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
@@ -115,7 +115,7 @@ export class NylasMinCancellationNotice {
115
115
  this.selectedPeriod = period;
116
116
  }
117
117
  render() {
118
- return (h(Host, { key: 'd2eb0d080d1ce4645a642a4f5d55270ed170e882' }, h("div", { key: '2743c3c781ad47c9d0d53fdad2773f45d172e1f4', class: "nylas-min-cancellation-notice", part: "nmcn" }, h("label", { key: '457729b50558651645ecb10398586af1078cfd34' }, "Minimum cancellation notice", h("span", { key: '00b310035def5b8bbc183fa03d2bcb37d7c04b42', class: "label-icon" }, h("tooltip-component", { key: '27c7695f6302e2d043899656f15a70846c2858e2' }, h("info-icon", { key: '10f878cb410cc284e86890a0d6047c27bdc7f455', slot: "tooltip-icon" }), h("span", { key: 'e853afaa116b43371d01fcb3b801e622902e22cd', slot: "tooltip-content" }, "Set the minimum amount of time required to cancel an event.")))), h("time-period-selector", { key: '8bb3955f8cce7661e213fbf2c107f8326937b467', id: "min-cancellation-notice", exportparts: "tps__number-dropdown: nmcn__number-dropdown, tps__number-dropdown-button: nmcn__number-dropdown-button, tps__number-dropdown-content: nmcn__number-dropdown-content, tps__period-dropdown: nmcn__period-dropdown, tps__period-dropdown-button: nmcn__period-dropdown-button, tps__period-dropdown-content: nmcn__period-dropdown-content", timePeriods: ['minute', 'hour', 'day', 'week'], defaultSelectedNumber: this.selectedNumber, defaultSelectedPeriod: this.selectedPeriod }))));
118
+ return (h(Host, { key: '473f79ba357832c63d5af02f6123d5d8a4bbee61' }, h("div", { key: '657c38462f01c79f7e830e7758859398e776ccdb', class: "nylas-min-cancellation-notice", part: "nmcn" }, h("label", { key: '9a29a3b348cf93c9de3b7f28d05c319d64ed37c6' }, "Minimum cancellation notice", h("span", { key: 'a618468ede4da9c28ec941ab4b76551cff980d8a', class: "label-icon" }, h("tooltip-component", { key: 'a44b3a7327721e17884840a9124f7c27249f050c' }, h("info-icon", { key: '177c2db8b4f868e23f5e59a08a335a1bbf4e5316', slot: "tooltip-icon" }), h("span", { key: '843ca3f89854fb398717e8fab9c54b124ef93a46', slot: "tooltip-content" }, "Set the minimum amount of time required to cancel an event.")))), h("time-period-selector", { key: '74b22ae97313a1a096d1c5ef6c791507e98da099', id: "min-cancellation-notice", exportparts: "tps__number-dropdown: nmcn__number-dropdown, tps__number-dropdown-button: nmcn__number-dropdown-button, tps__number-dropdown-content: nmcn__number-dropdown-content, tps__period-dropdown: nmcn__period-dropdown, tps__period-dropdown-button: nmcn__period-dropdown-button, tps__period-dropdown-content: nmcn__period-dropdown-content", timePeriods: ['minute', 'hour', 'day', 'week'], defaultSelectedNumber: this.selectedNumber, defaultSelectedPeriod: this.selectedPeriod }))));
119
119
  }
120
120
  static get is() { return "nylas-min-cancellation-notice"; }
121
121
  static get encapsulation() { return "shadow"; }
@@ -165,7 +165,7 @@ export class NylasMinCancellationNotice {
165
165
  "optional": true,
166
166
  "docs": {
167
167
  "tags": [],
168
- "text": ""
168
+ "text": "The minimum cancellation notice stored in the configuration"
169
169
  },
170
170
  "attribute": "min-cancellation-notice",
171
171
  "reflect": false
@@ -182,7 +182,7 @@ export class NylasMinCancellationNotice {
182
182
  "optional": false,
183
183
  "docs": {
184
184
  "tags": [],
185
- "text": ""
185
+ "text": "The name of the min cancellation notice input."
186
186
  },
187
187
  "attribute": "name",
188
188
  "reflect": false,
@@ -1 +1 @@
1
- {"version":3,"file":"nylas-min-cancellation-notice.js","sourceRoot":"","sources":["../../../../src/components/scheduler-editor/nylas-min-cancellation-notice/nylas-min-cancellation-notice.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;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L,EAAC,IAAI;YACH,4DAAK,KAAK,EAAC,+BAA+B,EAAC,IAAI,EAAC,MAAM;gBACpD;;oBAEE,6DAAM,KAAK,EAAC,YAAY;wBACtB;4BACE,kEAAW,IAAI,EAAC,cAAc,GAAG;4BACjC,6DAAM,IAAI,EAAC,iBAAiB,kEAAmE,CAC7E,CACf,CACD;gBACR,6EACE,EAAE,EAAC,yBAAyB,EAC5B,WAAW,EAAC,0UAA0U,EACtV,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,EAC9C,qBAAqB,EAAE,IAAI,CAAC,cAAc,EAC1C,qBAAqB,EAAE,IAAI,CAAC,cAAc,GAC1C,CACE,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAxBC;IANC,iBAAiB,CAAgH;QAChI,IAAI,EAAE,+BAA+B;QACrC,YAAY,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,uCAAuC,EAAE,uBAAuB,CAAC,CAAC,CAAC;QAC3F,YAAY,EAAE,EAAE;QAChB,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;wDAwBD","sourcesContent":["import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug } from '@/utils/utils';\nimport { AttachInternals, Component, Host, State, h, Element, Prop, Watch, Event, EventEmitter, Listen } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { Configuration } from '@nylas/core';\n\n/**\n * The `nylas-min-cancellation-notice` component is a form input for the description of an event.\n * @part nmcn - The minimum cancellation notice container\n * @part nmcn__number-dropdown - The number dropdown container\n * @part nmcn__number-dropdown-button - The number dropdown button\n * @part nmcn__number-dropdown-content - The number dropdown content\n * @part nmcn__period-dropdown - The period dropdown container\n * @part nmcn__period-dropdown-button - The period dropdown button\n * @part nmcn__period-dropdown-content - The period dropdown content\n */\n@Component({\n tag: 'nylas-min-cancellation-notice',\n styleUrl: 'nylas-min-cancellation-notice.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasMinCancellationNotice {\n /**\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n @Prop() minCancellationNotice?: number;\n @AttachInternals() internals!: ElementInternals;\n @Element() host!: HTMLElement;\n @Prop() name: string = 'min-cancellation-notice';\n\n @State() selectedNumber: number = 1;\n @State() selectedPeriod: string = 'day';\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-min-cancellation-notice', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('selectedConfiguration')\n selectedConfigurationChangedHandler(newVal: Configuration) {\n const minCancellationNotice = newVal?.scheduler?.min_cancellation_notice;\n if (minCancellationNotice) {\n this.updateNumberAndPeriodFromMinutes(minCancellationNotice);\n }\n }\n\n @Watch('availableDaysInFuture')\n availableDaysInFutureChanged(newValue: number) {\n this.updateNumberAndPeriodFromMinutes(newValue);\n }\n\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n }>;\n\n connectedCallback() {\n debug('nylas-min-cancellation-notice', 'connectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-min-cancellation-notice', 'componentWillLoad');\n this.host.setAttribute('name', this.name);\n }\n\n componentDidLoad() {\n debug('nylas-min-cancellation-notice', 'componentDidLoad');\n this.availableDaysInFutureChanged(this.minCancellationNotice ?? 1);\n if (typeof this.internals.setFormValue !== 'function') {\n return;\n }\n this.internals.setFormValue(this.minCancellationNotice?.toString() ?? '1', this.name);\n }\n\n disconnectedCallback() {\n debug('nylas-min-cancellation-notice', 'disconnectedCallback');\n }\n\n @Listen('timePeriodChanged')\n timePeriodChangedHandler(\n event: CustomEvent<{\n number: number;\n period: string;\n }>,\n ) {\n const { number, period } = event.detail;\n let totalMinutes;\n const minutesInHour = 60;\n const minutesInDay = minutesInHour * 24;\n const minutesInWeek = minutesInDay * 7;\n const minutesInMonth = minutesInDay * 30; // Assuming 30 days in a month for simplification\n\n if (period === 'minute') {\n totalMinutes = number;\n } else if (period === 'hour') {\n totalMinutes = number * minutesInHour;\n } else if (period === 'day') {\n totalMinutes = number * minutesInDay;\n } else if (period === 'week') {\n totalMinutes = number * minutesInWeek;\n } else if (period === 'month') {\n totalMinutes = number * minutesInMonth;\n } else {\n totalMinutes = 0;\n }\n this.valueChanged.emit({ value: totalMinutes, name: 'minCancellationNotice' });\n if (typeof this.internals.setFormValue !== 'function') {\n return;\n }\n this.internals.setFormValue(totalMinutes.toString(), this.name);\n }\n\n private updateNumberAndPeriodFromMinutes(minutes: number): void {\n const minutesInHour = 60;\n const minutesInDay = minutesInHour * 24;\n const minutesInWeek = minutesInDay * 7;\n const minutesInMonth = minutesInDay * 30; // Assuming 30 days in a month for simplification\n let number, period;\n if (minutes >= minutesInMonth) {\n number = Math.floor(minutes / minutesInMonth);\n period = 'month';\n } else if (minutes >= minutesInWeek) {\n number = Math.floor(minutes / minutesInWeek);\n period = 'week';\n } else if (minutes >= minutesInDay) {\n number = Math.floor(minutes / minutesInDay);\n period = 'day';\n } else if (minutes >= minutesInHour) {\n number = Math.floor(minutes / minutesInHour);\n period = 'hour';\n } else {\n number = minutes;\n period = 'minute';\n }\n this.selectedNumber = number;\n this.selectedPeriod = period;\n }\n\n @RegisterComponent<NylasMinCancellationNotice, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-min-cancellation-notice',\n stateToProps: new Map([['schedulerConfig.selectedConfiguration', 'selectedConfiguration']]),\n eventToProps: {},\n fireRegisterEvent: true,\n })\n render() {\n return (\n <Host>\n <div class=\"nylas-min-cancellation-notice\" part=\"nmcn\">\n <label>\n Minimum cancellation notice\n <span class=\"label-icon\">\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">Set the minimum amount of time required to cancel an event.</span>\n </tooltip-component>\n </span>\n </label>\n <time-period-selector\n id=\"min-cancellation-notice\"\n exportparts=\"tps__number-dropdown: nmcn__number-dropdown, tps__number-dropdown-button: nmcn__number-dropdown-button, tps__number-dropdown-content: nmcn__number-dropdown-content, tps__period-dropdown: nmcn__period-dropdown, tps__period-dropdown-button: nmcn__period-dropdown-button, tps__period-dropdown-content: nmcn__period-dropdown-content\"\n timePeriods={['minute', 'hour', 'day', 'week']}\n defaultSelectedNumber={this.selectedNumber}\n defaultSelectedPeriod={this.selectedPeriod}\n />\n </div>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"nylas-min-cancellation-notice.js","sourceRoot":"","sources":["../../../../src/components/scheduler-editor/nylas-min-cancellation-notice/nylas-min-cancellation-notice.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAgB,MAAM,EAAE,MAAM,eAAe,CAAC;AAoB9H,MAAM,OAAO,0BAA0B;;;;oBAoBd,yBAAyB;8BAKd,CAAC;8BAID,KAAK;;IAQvC,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;IAC3C,CAAC;IAGD,mCAAmC,CAAC,MAAqB;QACvD,MAAM,qBAAqB,GAAG,MAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAxBC;IANC,iBAAiB,CAAgH;QAChI,IAAI,EAAE,+BAA+B;QACrC,YAAY,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,uCAAuC,EAAE,uBAAuB,CAAC,CAAC,CAAC;QAC3F,YAAY,EAAE,EAAE;QAChB,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;wDAwBD","sourcesContent":["import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug } from '@/utils/utils';\nimport { AttachInternals, Component, Host, State, h, Element, Prop, Watch, Event, EventEmitter, Listen } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { Configuration } from '@nylas/core';\n\n/**\n * The `nylas-min-cancellation-notice` component is a form input for the description of an event.\n * @part nmcn - The minimum cancellation notice container\n * @part nmcn__number-dropdown - The number dropdown container\n * @part nmcn__number-dropdown-button - The number dropdown button\n * @part nmcn__number-dropdown-content - The number dropdown content\n * @part nmcn__period-dropdown - The period dropdown container\n * @part nmcn__period-dropdown-button - The period dropdown button\n * @part nmcn__period-dropdown-content - The period dropdown content\n */\n@Component({\n tag: 'nylas-min-cancellation-notice',\n styleUrl: 'nylas-min-cancellation-notice.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasMinCancellationNotice {\n /**\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n /**\n * The minimum cancellation notice stored in the configuration\n */\n @Prop() minCancellationNotice?: number;\n /**\n * The element internals.\n */\n @AttachInternals() internals!: ElementInternals;\n /**\n * The host element <nylas-min-cancellation-notice>\n */\n @Element() host!: HTMLElement;\n /**\n * The name of the min cancellation notice input.\n */\n @Prop() name: string = 'min-cancellation-notice';\n\n /**\n * The selected number of minutes for the min cancellation notice.\n */\n @State() selectedNumber: number = 1;\n /**\n * The selected period for the min cancellation notice.\n */\n @State() selectedPeriod: string = 'day';\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-min-cancellation-notice', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('selectedConfiguration')\n selectedConfigurationChangedHandler(newVal: Configuration) {\n const minCancellationNotice = newVal?.scheduler?.min_cancellation_notice;\n if (minCancellationNotice) {\n this.updateNumberAndPeriodFromMinutes(minCancellationNotice);\n }\n }\n\n @Watch('availableDaysInFuture')\n availableDaysInFutureChanged(newValue: number) {\n this.updateNumberAndPeriodFromMinutes(newValue);\n }\n\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n }>;\n\n connectedCallback() {\n debug('nylas-min-cancellation-notice', 'connectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-min-cancellation-notice', 'componentWillLoad');\n this.host.setAttribute('name', this.name);\n }\n\n componentDidLoad() {\n debug('nylas-min-cancellation-notice', 'componentDidLoad');\n this.availableDaysInFutureChanged(this.minCancellationNotice ?? 1);\n if (typeof this.internals.setFormValue !== 'function') {\n return;\n }\n this.internals.setFormValue(this.minCancellationNotice?.toString() ?? '1', this.name);\n }\n\n disconnectedCallback() {\n debug('nylas-min-cancellation-notice', 'disconnectedCallback');\n }\n\n @Listen('timePeriodChanged')\n timePeriodChangedHandler(\n event: CustomEvent<{\n number: number;\n period: string;\n }>,\n ) {\n const { number, period } = event.detail;\n let totalMinutes;\n const minutesInHour = 60;\n const minutesInDay = minutesInHour * 24;\n const minutesInWeek = minutesInDay * 7;\n const minutesInMonth = minutesInDay * 30; // Assuming 30 days in a month for simplification\n\n if (period === 'minute') {\n totalMinutes = number;\n } else if (period === 'hour') {\n totalMinutes = number * minutesInHour;\n } else if (period === 'day') {\n totalMinutes = number * minutesInDay;\n } else if (period === 'week') {\n totalMinutes = number * minutesInWeek;\n } else if (period === 'month') {\n totalMinutes = number * minutesInMonth;\n } else {\n totalMinutes = 0;\n }\n this.valueChanged.emit({ value: totalMinutes, name: 'minCancellationNotice' });\n if (typeof this.internals.setFormValue !== 'function') {\n return;\n }\n this.internals.setFormValue(totalMinutes.toString(), this.name);\n }\n\n private updateNumberAndPeriodFromMinutes(minutes: number): void {\n const minutesInHour = 60;\n const minutesInDay = minutesInHour * 24;\n const minutesInWeek = minutesInDay * 7;\n const minutesInMonth = minutesInDay * 30; // Assuming 30 days in a month for simplification\n let number, period;\n if (minutes >= minutesInMonth) {\n number = Math.floor(minutes / minutesInMonth);\n period = 'month';\n } else if (minutes >= minutesInWeek) {\n number = Math.floor(minutes / minutesInWeek);\n period = 'week';\n } else if (minutes >= minutesInDay) {\n number = Math.floor(minutes / minutesInDay);\n period = 'day';\n } else if (minutes >= minutesInHour) {\n number = Math.floor(minutes / minutesInHour);\n period = 'hour';\n } else {\n number = minutes;\n period = 'minute';\n }\n this.selectedNumber = number;\n this.selectedPeriod = period;\n }\n\n @RegisterComponent<NylasMinCancellationNotice, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-min-cancellation-notice',\n stateToProps: new Map([['schedulerConfig.selectedConfiguration', 'selectedConfiguration']]),\n eventToProps: {},\n fireRegisterEvent: true,\n })\n render() {\n return (\n <Host>\n <div class=\"nylas-min-cancellation-notice\" part=\"nmcn\">\n <label>\n Minimum cancellation notice\n <span class=\"label-icon\">\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">Set the minimum amount of time required to cancel an event.</span>\n </tooltip-component>\n </span>\n </label>\n <time-period-selector\n id=\"min-cancellation-notice\"\n exportparts=\"tps__number-dropdown: nmcn__number-dropdown, tps__number-dropdown-button: nmcn__number-dropdown-button, tps__number-dropdown-content: nmcn__number-dropdown-content, tps__period-dropdown: nmcn__period-dropdown, tps__period-dropdown-button: nmcn__period-dropdown-button, tps__period-dropdown-content: nmcn__period-dropdown-content\"\n timePeriods={['minute', 'hour', 'day', 'week']}\n defaultSelectedNumber={this.selectedNumber}\n defaultSelectedPeriod={this.selectedPeriod}\n />\n </div>\n </Host>\n );\n }\n}\n"]}
@@ -124,7 +124,7 @@ export class NylasSchedulerEditor {
124
124
  await this.nylasSchedulerConfigConnector.schedulerConfig?.getCalendars();
125
125
  }
126
126
  render() {
127
- return (h(Host, { key: '5eacdea0c9cce3941dbcc80668d79bd78ab51e53' }, h("div", { key: 'f17745ecf7c21920a7d6b20bca0ec840d3b26925', class: "scheduler-editor-header", part: "nse__header" }, h("h1", { key: 'bd6ab00923b3f4d913e346aded89982bcc002b9f', class: "scheduler-editor-title", part: "nse__title" }, h("calendar-icon", { key: '8755a2e5fde1d94c87f7ae487ffc16981ec3a844', width: "18", height: "18" }), "Scheduler editor"), h("button", { key: '80e55094ce9da9ece1f6e62d2ca4892c0cc6ee7e', class: "scheduler-editor-close", onClick: e => this.handleSchedulerConfigCloseClicked(e), part: "nse__close-button" }, h("close-icon", { key: '8aa07ef7733444d32d38a7e5d9e6d3d61f226331', width: "18", height: "18" }))), this.stores?.schedulerConfig?.state.currentUser && this.stores.schedulerConfig.state.action === null && (h("div", { class: "list-configurations" }, h("nylas-list-configurations", null))), this.stores?.schedulerConfig?.state.currentUser && this.stores.schedulerConfig.state.action === 'create' && (h("nylas-editor-tabs", { mode: "composable" }, h("nylas-event-info", null, h("div", { slot: "inputs" }, h("nylas-event-title", null), h("nylas-event-duration", null), h("nylas-location-component", null))), h("nylas-booking-calendar-picker", null))), this.stores?.schedulerConfig?.state.currentUser && this.stores.schedulerConfig.state.action === 'edit' && (h("nylas-editor-tabs", { mode: this.mode }, this.mode === 'composable' && h("slot", null))), !this.stores?.schedulerConfig?.state.currentUser && (h("slot", { name: "login-required" }, h(LoginRequired, { authenticationUrl: this.authenticationUrl })))));
127
+ return (h(Host, { key: '9e7d484239633ec60552c6a400fbcda85f2d9ab2' }, h("div", { key: '6a360964ca93641b4f62750e95c75d81c8d62daa', class: "scheduler-editor-header", part: "nse__header" }, h("h1", { key: 'bdae7fcf66ce0a82d1596b6465d3317226ecc9de', class: "scheduler-editor-title", part: "nse__title" }, h("calendar-icon", { key: '2cc5546c75928257239a2fb4aadd0db480a5cd83', width: "18", height: "18" }), "Scheduler editor"), h("button", { key: '5429863bb4cb904ad6194db4a425320eab010dab', class: "scheduler-editor-close", onClick: e => this.handleSchedulerConfigCloseClicked(e), part: "nse__close-button" }, h("close-icon", { key: '8db91364286cb2be1c9f6b608f27f2def59664e6', width: "18", height: "18" }))), this.stores?.schedulerConfig?.state.currentUser && this.stores.schedulerConfig.state.action === null && (h("div", { class: "list-configurations" }, h("nylas-list-configurations", null))), this.stores?.schedulerConfig?.state.currentUser && this.stores.schedulerConfig.state.action === 'create' && (h("nylas-editor-tabs", { mode: "composable" }, h("nylas-event-info", null, h("div", { slot: "inputs" }, h("nylas-event-title", null), h("nylas-event-duration", null), h("nylas-location-component", null))), h("nylas-booking-calendar-picker", null))), this.stores?.schedulerConfig?.state.currentUser && this.stores.schedulerConfig.state.action === 'edit' && (h("nylas-editor-tabs", { mode: this.mode }, this.mode === 'composable' && h("slot", null))), !this.stores?.schedulerConfig?.state.currentUser && (h("slot", { name: "login-required" }, h(LoginRequired, { authenticationUrl: this.authenticationUrl })))));
128
128
  }
129
129
  static get is() { return "nylas-scheduler-editor"; }
130
130
  static get encapsulation() { return "shadow"; }
@@ -152,7 +152,7 @@ export class NylasSchedulerEditor {
152
152
  "optional": false,
153
153
  "docs": {
154
154
  "tags": [],
155
- "text": "The default require session auth flag to used to set the default value for the requireSessionAuth\nproperty when creating a configuration. If set to true, then a session token must be provided\nto the <nylas-scheduling/> component. If set to false, then a session token is not required\nand the configuration id can passed to the <nylas-scheduling/> component instead."
155
+ "text": "The default requires_session_auth flag to use to set the default value for the requireSessionAuth\nproperty when creating a configuration. If set to true, a session token must be provided\nto the <nylas-scheduling/> component. If set to false, then a session token is not required,\nand the configuration id can be passed to the <nylas-scheduling/> component instead."
156
156
  },
157
157
  "attribute": "default-requires-session-auth",
158
158
  "reflect": false,
@@ -243,7 +243,7 @@ export class NylasSchedulerEditor {
243
243
  "mutable": false,
244
244
  "complexType": {
245
245
  "original": "SchedulerEditorEventOverride",
246
- "resolved": "Partial<{ valueChanged: (event: CustomEvent<{ value: { openHours: OpenHours[]; timezone: string; }; name: string; } | { value: string[]; name: string; valueChangedHandler?: ((event: CustomEvent<{ value: string[]; name: string; }>) => void) | undefined; } | { value: string; name: string; valueChanged?: ((event: CustomEvent<{ value: string; name: string; }>) => void) | undefined; } | { value: string; name: string; } | { value: string; name: string; } | { value: string; name: string; }>, connector?: NylasSchedulerConnectorInterface | undefined) => Promise<void>; schedulerConfigChanged: (event: CustomEvent<SchedulerEventDetail>, connector?: NylasSchedulerConnectorInterface | undefined) => Promise<void>; cancelButtonClick: (event: CustomEvent<void>, connector?: NylasSchedulerConnectorInterface | undefined) => Promise<void>; formSubmitted: (event: CustomEvent<void>, connector?: NylasSchedulerConnectorInterface | undefined) => Promise<void>; previewButtonClicked: (event: CustomEvent<HTMLNylasEditorTabsElement>, connector?: NylasSchedulerConnectorInterface | undefined) => Promise<void>; initListConfigurations: (event: CustomEvent<HTMLNylasListConfigurationsElement>, connector?: NylasSchedulerConnectorInterface | undefined) => Promise<void>; createButtonClick: (event: CustomEvent<HTMLNylasListConfigurationsElement>, connector?: NylasSchedulerConnectorInterface | undefined) => Promise<void>; editButtonClick: (event: CustomEvent<{ host: HTMLNylasListConfigurationsElement; configuration: Configuration; }>, connector?: NylasSchedulerConnectorInterface | undefined) => Promise<void>; deleteButtonClick: (event: CustomEvent<{ host: HTMLNylasListConfigurationsElement; configuration: Configuration; }>, connector?: NylasSchedulerConnectorInterface | undefined) => Promise<void>; }> & EventOverride<NylasSchedulerConfigConnectorInterface>",
246
+ "resolved": "Partial<{ valueChanged: (event: CustomEvent<{ value: string[]; name: string; valueChangedHandler?: ((event: CustomEvent<{ value: string[]; name: string; }>) => void) | undefined; } | { value: string; name: string; valueChanged?: ((event: CustomEvent<{ value: string; name: string; }>) => void) | undefined; } | { value: string; name: string; } | { value: string; name: string; } | { value: string; name: string; } | { value: { openHours: OpenHours[]; timezone: string; }; name: string; }>, connector?: NylasSchedulerConnectorInterface | undefined) => Promise<void>; formSubmitted: (event: CustomEvent<void>, connector?: NylasSchedulerConnectorInterface | undefined) => Promise<void>; schedulerConfigChanged: (event: CustomEvent<SchedulerEventDetail>, connector?: NylasSchedulerConnectorInterface | undefined) => Promise<void>; cancelButtonClick: (event: CustomEvent<void>, connector?: NylasSchedulerConnectorInterface | undefined) => Promise<void>; previewButtonClicked: (event: CustomEvent<HTMLNylasEditorTabsElement>, connector?: NylasSchedulerConnectorInterface | undefined) => Promise<void>; initListConfigurations: (event: CustomEvent<HTMLNylasListConfigurationsElement>, connector?: NylasSchedulerConnectorInterface | undefined) => Promise<void>; createButtonClick: (event: CustomEvent<HTMLNylasListConfigurationsElement>, connector?: NylasSchedulerConnectorInterface | undefined) => Promise<void>; editButtonClick: (event: CustomEvent<{ host: HTMLNylasListConfigurationsElement; configuration: Configuration; }>, connector?: NylasSchedulerConnectorInterface | undefined) => Promise<void>; deleteButtonClick: (event: CustomEvent<{ host: HTMLNylasListConfigurationsElement; configuration: Configuration; }>, connector?: NylasSchedulerConnectorInterface | undefined) => Promise<void>; }> & EventOverride<NylasSchedulerConfigConnectorInterface>",
247
247
  "references": {
248
248
  "SchedulerEditorEventOverride": {
249
249
  "location": "import",
@@ -272,7 +272,7 @@ export class NylasSchedulerEditor {
272
272
  "optional": false,
273
273
  "docs": {
274
274
  "tags": [],
275
- "text": "The scheduler preview link to use when the user clicks on the preview button.\nYou can use a placeholder `{config.id}` to replace the configuration id anywhere in the link."
275
+ "text": "The scheduler preview link to use when the user clicks on the preview button.\nYou can use the placeholder `{config.id}` to replace the configuration id anywhere in the link."
276
276
  },
277
277
  "attribute": "scheduler-preview-link",
278
278
  "reflect": false,
@@ -283,7 +283,7 @@ export class NylasSchedulerEditor {
283
283
  "mutable": false,
284
284
  "complexType": {
285
285
  "original": "Partial<NylasSchedulerConfigStoreState>",
286
- "resolved": "undefined | { selectedConfiguration?: Partial<Configuration> | undefined; configurations?: Configuration[] | undefined; calendars?: Calendar[] | undefined; currentUser?: User | null | undefined; action?: \"create\" | \"edit\" | null | undefined; }",
286
+ "resolved": "undefined | { selectedConfiguration?: RecursivePartial<Configuration> | undefined; configurations?: Configuration[] | undefined; calendars?: Calendar[] | undefined; currentUser?: User | null | undefined; action?: \"create\" | \"edit\" | null | undefined; }",
287
287
  "references": {
288
288
  "Partial": {
289
289
  "location": "global",
@@ -300,7 +300,7 @@ export class NylasSchedulerEditor {
300
300
  "optional": true,
301
301
  "docs": {
302
302
  "tags": [],
303
- "text": "The default scheduler config store state.\nUsed to set the initial state of the scheduler config store."
303
+ "text": "The default scheduler config store state.\nUsed to set the initial state of the scheduler config store.\nThis state can be used to pass defaults to newly created configurations."
304
304
  }
305
305
  },
306
306
  "mode": {
@@ -315,7 +315,7 @@ export class NylasSchedulerEditor {
315
315
  "optional": false,
316
316
  "docs": {
317
317
  "tags": [],
318
- "text": "The is used to set the mode for the scheduler config.\nThe mode can be 'app' or 'composable'.\nThe default mode is 'app'."
318
+ "text": "This is used to set the mode for the scheduler config.\nThe mode can be 'app' or 'composable'.\nThe default mode is 'app'."
319
319
  },
320
320
  "attribute": "mode",
321
321
  "reflect": false,
@@ -357,7 +357,7 @@ export class NylasSchedulerEditor {
357
357
  "composed": true,
358
358
  "docs": {
359
359
  "tags": [],
360
- "text": "This event is fired when the the NyalsAuth isAuthenticated state changes\nto true."
360
+ "text": "This event is fired when the the NylasAuth isAuthenticated state changes\nto true."
361
361
  },
362
362
  "complexType": {
363
363
  "original": "HTMLNylasSchedulerEditorElement",
@@ -377,7 +377,7 @@ export class NylasSchedulerEditor {
377
377
  "composed": true,
378
378
  "docs": {
379
379
  "tags": [],
380
- "text": "This event is fired when the the NyalsAuth isAuthenticated state changes\nto true."
380
+ "text": "This event is fired when the the NylasAuth isAuthenticated state changes\nto true."
381
381
  },
382
382
  "complexType": {
383
383
  "original": "HTMLNylasSchedulerEditorElement",