@idea-ionic/agenda 5.29.4 → 6.0.3

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 (303) hide show
  1. package/README.md +2 -2
  2. package/environment.d.ts +3 -0
  3. package/esm2020/environment.mjs +20 -0
  4. package/esm2020/idea-ionic-agenda.mjs +5 -0
  5. package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
  6. package/esm2020/src/agenda.component.mjs +249 -0
  7. package/esm2020/src/agenda.module.mjs +57 -0
  8. package/esm2020/src/calendar.component.mjs +125 -0
  9. package/esm2020/src/calendarCreation.component.mjs +142 -0
  10. package/esm2020/src/calendarItem.component.mjs +136 -0
  11. package/esm2020/src/calendars.service.mjs +255 -0
  12. package/esm2020/src/dateFormatter.provider.mjs +38 -0
  13. package/fesm2015/idea-ionic-agenda.mjs +974 -0
  14. package/fesm2015/idea-ionic-agenda.mjs.map +1 -0
  15. package/fesm2020/idea-ionic-agenda.mjs +967 -0
  16. package/fesm2020/idea-ionic-agenda.mjs.map +1 -0
  17. package/idea-ionic-agenda.d.ts +4 -0
  18. package/package.json +30 -18
  19. package/src/agenda.component.d.ts +127 -2
  20. package/src/agenda.module.d.ts +13 -0
  21. package/src/calendar.component.d.ts +41 -1
  22. package/src/calendarCreation.component.d.ts +41 -1
  23. package/src/calendarItem.component.d.ts +25 -0
  24. package/src/calendars.service.d.ts +50 -0
  25. package/src/dateFormatter.provider.d.ts +3 -0
  26. package/bundles/idea-ionic-agenda.umd.js +0 -1156
  27. package/bundles/idea-ionic-agenda.umd.js.map +0 -1
  28. package/bundles/idea-ionic-agenda.umd.min.js +0 -16
  29. package/bundles/idea-ionic-agenda.umd.min.js.map +0 -1
  30. package/esm2015/environment.js +0 -17
  31. package/esm2015/environment.ngsummary.json +0 -1
  32. package/esm2015/idea-ionic-agenda.js +0 -2
  33. package/esm2015/idea-ionic-agenda.ngsummary.json +0 -1
  34. package/esm2015/node_modules/@angular/animations/animations.ngsummary.json +0 -1
  35. package/esm2015/node_modules/@angular/common/common.ngfactory.js +0 -5
  36. package/esm2015/node_modules/@angular/common/common.ngsummary.json +0 -1
  37. package/esm2015/node_modules/@angular/common/http/http.ngsummary.json +0 -1
  38. package/esm2015/node_modules/@angular/core/core.ngfactory.js +0 -4
  39. package/esm2015/node_modules/@angular/core/core.ngsummary.json +0 -1
  40. package/esm2015/node_modules/@angular/forms/forms.ngfactory.js +0 -9
  41. package/esm2015/node_modules/@angular/forms/forms.ngsummary.json +0 -1
  42. package/esm2015/node_modules/@angular/router/router.ngfactory.js +0 -12
  43. package/esm2015/node_modules/@angular/router/router.ngsummary.json +0 -1
  44. package/esm2015/node_modules/@capacitor/core/dist/esm/core-plugin-definitions.ngsummary.json +0 -1
  45. package/esm2015/node_modules/@capacitor/core/dist/esm/definitions.ngsummary.json +0 -1
  46. package/esm2015/node_modules/@capacitor/core/dist/esm/global.ngsummary.json +0 -1
  47. package/esm2015/node_modules/@capacitor/core/dist/esm/index.ngsummary.json +0 -1
  48. package/esm2015/node_modules/@capacitor/core/dist/esm/web/accessibility.ngsummary.json +0 -1
  49. package/esm2015/node_modules/@capacitor/core/dist/esm/web/app.ngsummary.json +0 -1
  50. package/esm2015/node_modules/@capacitor/core/dist/esm/web/browser.ngsummary.json +0 -1
  51. package/esm2015/node_modules/@capacitor/core/dist/esm/web/camera.ngsummary.json +0 -1
  52. package/esm2015/node_modules/@capacitor/core/dist/esm/web/clipboard.ngsummary.json +0 -1
  53. package/esm2015/node_modules/@capacitor/core/dist/esm/web/device.ngsummary.json +0 -1
  54. package/esm2015/node_modules/@capacitor/core/dist/esm/web/filesystem.ngsummary.json +0 -1
  55. package/esm2015/node_modules/@capacitor/core/dist/esm/web/geolocation.ngsummary.json +0 -1
  56. package/esm2015/node_modules/@capacitor/core/dist/esm/web/index.ngsummary.json +0 -1
  57. package/esm2015/node_modules/@capacitor/core/dist/esm/web/local-notifications.ngsummary.json +0 -1
  58. package/esm2015/node_modules/@capacitor/core/dist/esm/web/modals.ngsummary.json +0 -1
  59. package/esm2015/node_modules/@capacitor/core/dist/esm/web/motion.ngsummary.json +0 -1
  60. package/esm2015/node_modules/@capacitor/core/dist/esm/web/network.ngsummary.json +0 -1
  61. package/esm2015/node_modules/@capacitor/core/dist/esm/web/permissions.ngsummary.json +0 -1
  62. package/esm2015/node_modules/@capacitor/core/dist/esm/web/share.ngsummary.json +0 -1
  63. package/esm2015/node_modules/@capacitor/core/dist/esm/web/splash-screen.ngsummary.json +0 -1
  64. package/esm2015/node_modules/@capacitor/core/dist/esm/web/storage.ngsummary.json +0 -1
  65. package/esm2015/node_modules/@capacitor/core/dist/esm/web/toast.ngsummary.json +0 -1
  66. package/esm2015/node_modules/@capacitor/core/dist/esm/web-plugins.ngsummary.json +0 -1
  67. package/esm2015/node_modules/@idea-ionic/common/idea-ionic-common.ngfactory.js +0 -1546
  68. package/esm2015/node_modules/@idea-ionic/common/idea-ionic-common.ngsummary.json +0 -1
  69. package/esm2015/node_modules/@ionic/angular/ionic-angular.ngfactory.js +0 -524
  70. package/esm2015/node_modules/@ionic/angular/ionic-angular.ngsummary.json +0 -1
  71. package/esm2015/node_modules/@ionic/angular/node_modules/tslib/tslib.ngsummary.json +0 -1
  72. package/esm2015/node_modules/@ionic/core/dist/types/components/action-sheet/action-sheet-interface.ngsummary.json +0 -1
  73. package/esm2015/node_modules/@ionic/core/dist/types/components/alert/alert-interface.ngsummary.json +0 -1
  74. package/esm2015/node_modules/@ionic/core/dist/types/components/checkbox/checkbox-interface.ngsummary.json +0 -1
  75. package/esm2015/node_modules/@ionic/core/dist/types/components/content/content-interface.ngsummary.json +0 -1
  76. package/esm2015/node_modules/@ionic/core/dist/types/components/datetime/datetime-interface.ngsummary.json +0 -1
  77. package/esm2015/node_modules/@ionic/core/dist/types/components/input/input-interface.ngsummary.json +0 -1
  78. package/esm2015/node_modules/@ionic/core/dist/types/components/loading/loading-interface.ngsummary.json +0 -1
  79. package/esm2015/node_modules/@ionic/core/dist/types/components/menu/menu-interface.ngsummary.json +0 -1
  80. package/esm2015/node_modules/@ionic/core/dist/types/components/modal/modal-interface.ngsummary.json +0 -1
  81. package/esm2015/node_modules/@ionic/core/dist/types/components/nav/constants.ngsummary.json +0 -1
  82. package/esm2015/node_modules/@ionic/core/dist/types/components/nav/nav-interface.ngsummary.json +0 -1
  83. package/esm2015/node_modules/@ionic/core/dist/types/components/nav/view-controller.ngsummary.json +0 -1
  84. package/esm2015/node_modules/@ionic/core/dist/types/components/picker/picker-interface.ngsummary.json +0 -1
  85. package/esm2015/node_modules/@ionic/core/dist/types/components/popover/popover-interface.ngsummary.json +0 -1
  86. package/esm2015/node_modules/@ionic/core/dist/types/components/radio-group/radio-group-interface.ngsummary.json +0 -1
  87. package/esm2015/node_modules/@ionic/core/dist/types/components/range/range-interface.ngsummary.json +0 -1
  88. package/esm2015/node_modules/@ionic/core/dist/types/components/refresher/refresher-interface.ngsummary.json +0 -1
  89. package/esm2015/node_modules/@ionic/core/dist/types/components/reorder-group/reorder-group-interface.ngsummary.json +0 -1
  90. package/esm2015/node_modules/@ionic/core/dist/types/components/route/route-interface.ngsummary.json +0 -1
  91. package/esm2015/node_modules/@ionic/core/dist/types/components/router/utils/interface.ngsummary.json +0 -1
  92. package/esm2015/node_modules/@ionic/core/dist/types/components/searchbar/searchbar-interface.ngsummary.json +0 -1
  93. package/esm2015/node_modules/@ionic/core/dist/types/components/segment/segment-interface.ngsummary.json +0 -1
  94. package/esm2015/node_modules/@ionic/core/dist/types/components/select/select-interface.ngsummary.json +0 -1
  95. package/esm2015/node_modules/@ionic/core/dist/types/components/select-popover/select-popover-interface.ngsummary.json +0 -1
  96. package/esm2015/node_modules/@ionic/core/dist/types/components/spinner/spinner-configs.ngsummary.json +0 -1
  97. package/esm2015/node_modules/@ionic/core/dist/types/components/spinner/spinner-interface.ngsummary.json +0 -1
  98. package/esm2015/node_modules/@ionic/core/dist/types/components/tab-bar/tab-bar-interface.ngsummary.json +0 -1
  99. package/esm2015/node_modules/@ionic/core/dist/types/components/textarea/textarea-interface.ngsummary.json +0 -1
  100. package/esm2015/node_modules/@ionic/core/dist/types/components/toast/toast-interface.ngsummary.json +0 -1
  101. package/esm2015/node_modules/@ionic/core/dist/types/components/toggle/toggle-interface.ngsummary.json +0 -1
  102. package/esm2015/node_modules/@ionic/core/dist/types/components/virtual-scroll/virtual-scroll-interface.ngsummary.json +0 -1
  103. package/esm2015/node_modules/@ionic/core/dist/types/components.ngsummary.json +0 -1
  104. package/esm2015/node_modules/@ionic/core/dist/types/global/config.ngsummary.json +0 -1
  105. package/esm2015/node_modules/@ionic/core/dist/types/index.ngsummary.json +0 -1
  106. package/esm2015/node_modules/@ionic/core/dist/types/interface.ngsummary.json +0 -1
  107. package/esm2015/node_modules/@ionic/core/dist/types/stencil-public-runtime.ngsummary.json +0 -1
  108. package/esm2015/node_modules/@ionic/core/dist/types/utils/animation/animation-interface.ngsummary.json +0 -1
  109. package/esm2015/node_modules/@ionic/core/dist/types/utils/animation/animation.ngsummary.json +0 -1
  110. package/esm2015/node_modules/@ionic/core/dist/types/utils/animation/cubic-bezier.ngsummary.json +0 -1
  111. package/esm2015/node_modules/@ionic/core/dist/types/utils/config.ngsummary.json +0 -1
  112. package/esm2015/node_modules/@ionic/core/dist/types/utils/gesture/gesture-controller.ngsummary.json +0 -1
  113. package/esm2015/node_modules/@ionic/core/dist/types/utils/gesture/index.ngsummary.json +0 -1
  114. package/esm2015/node_modules/@ionic/core/dist/types/utils/menu-controller/index.ngsummary.json +0 -1
  115. package/esm2015/node_modules/@ionic/core/dist/types/utils/overlays-interface.ngsummary.json +0 -1
  116. package/esm2015/node_modules/@ionic/core/dist/types/utils/overlays.ngsummary.json +0 -1
  117. package/esm2015/node_modules/@ionic/core/dist/types/utils/platform.ngsummary.json +0 -1
  118. package/esm2015/node_modules/@ionic/core/dist/types/utils/sanitization/index.ngsummary.json +0 -1
  119. package/esm2015/node_modules/@ionic/core/dist/types/utils/transition/index.ngsummary.json +0 -1
  120. package/esm2015/node_modules/@ionic/core/dist/types/utils/transition/ios.transition.ngsummary.json +0 -1
  121. package/esm2015/node_modules/@ionic/core/dist/types/utils/transition/md.transition.ngsummary.json +0 -1
  122. package/esm2015/node_modules/@ionic/storage/dist/esm/index.ngsummary.json +0 -1
  123. package/esm2015/node_modules/angular-calendar/angular-calendar.ngfactory.js +0 -397
  124. package/esm2015/node_modules/angular-calendar/angular-calendar.ngsummary.json +0 -1
  125. package/esm2015/node_modules/angular-calendar/date-adapters/date-fns/index.ngsummary.json +0 -1
  126. package/esm2015/node_modules/angular-calendar/node_modules/tslib/tslib.ngsummary.json +0 -1
  127. package/esm2015/node_modules/angular-draggable-droppable/angular-draggable-droppable.ngfactory.js +0 -5
  128. package/esm2015/node_modules/angular-draggable-droppable/angular-draggable-droppable.ngsummary.json +0 -1
  129. package/esm2015/node_modules/angular-draggable-droppable/node_modules/tslib/tslib.ngsummary.json +0 -1
  130. package/esm2015/node_modules/angular-resizable-element/angular-resizable-element.ngfactory.js +0 -5
  131. package/esm2015/node_modules/angular-resizable-element/angular-resizable-element.ngsummary.json +0 -1
  132. package/esm2015/node_modules/angular-resizable-element/node_modules/tslib/tslib.ngsummary.json +0 -1
  133. package/esm2015/node_modules/calendar-utils/calendar-utils.ngsummary.json +0 -1
  134. package/esm2015/node_modules/calendar-utils/date-adapters/date-adapter/index.ngsummary.json +0 -1
  135. package/esm2015/node_modules/date-fns/typings.ngsummary.json +0 -1
  136. package/esm2015/node_modules/idea-toolbox/dist/index.ngsummary.json +0 -1
  137. package/esm2015/node_modules/idea-toolbox/dist/src/APIRequestLog.model.ngsummary.json +0 -1
  138. package/esm2015/node_modules/idea-toolbox/dist/src/RCAttachedResource.model.ngsummary.json +0 -1
  139. package/esm2015/node_modules/idea-toolbox/dist/src/RCConfiguredFolder.model.ngsummary.json +0 -1
  140. package/esm2015/node_modules/idea-toolbox/dist/src/RCFolder.model.ngsummary.json +0 -1
  141. package/esm2015/node_modules/idea-toolbox/dist/src/RCResource.model.ngsummary.json +0 -1
  142. package/esm2015/node_modules/idea-toolbox/dist/src/address.model.ngsummary.json +0 -1
  143. package/esm2015/node_modules/idea-toolbox/dist/src/amazonTranslateLanguages.enum.ngsummary.json +0 -1
  144. package/esm2015/node_modules/idea-toolbox/dist/src/announcement.model.ngsummary.json +0 -1
  145. package/esm2015/node_modules/idea-toolbox/dist/src/appointment.model.ngsummary.json +0 -1
  146. package/esm2015/node_modules/idea-toolbox/dist/src/attachment.model.ngsummary.json +0 -1
  147. package/esm2015/node_modules/idea-toolbox/dist/src/booleanChoices.enum.ngsummary.json +0 -1
  148. package/esm2015/node_modules/idea-toolbox/dist/src/cacheable.model.ngsummary.json +0 -1
  149. package/esm2015/node_modules/idea-toolbox/dist/src/cacheableResource.model.ngsummary.json +0 -1
  150. package/esm2015/node_modules/idea-toolbox/dist/src/calendar.model.ngsummary.json +0 -1
  151. package/esm2015/node_modules/idea-toolbox/dist/src/check.model.ngsummary.json +0 -1
  152. package/esm2015/node_modules/idea-toolbox/dist/src/clientInfo.model.ngsummary.json +0 -1
  153. package/esm2015/node_modules/idea-toolbox/dist/src/cognitoUser.model.ngsummary.json +0 -1
  154. package/esm2015/node_modules/idea-toolbox/dist/src/contactRequest.model.ngsummary.json +0 -1
  155. package/esm2015/node_modules/idea-toolbox/dist/src/contacts.model.ngsummary.json +0 -1
  156. package/esm2015/node_modules/idea-toolbox/dist/src/countries.enum.ngsummary.json +0 -1
  157. package/esm2015/node_modules/idea-toolbox/dist/src/customBlockMeta.model.ngsummary.json +0 -1
  158. package/esm2015/node_modules/idea-toolbox/dist/src/customFieldMeta.model.ngsummary.json +0 -1
  159. package/esm2015/node_modules/idea-toolbox/dist/src/customFieldTypes.enum.ngsummary.json +0 -1
  160. package/esm2015/node_modules/idea-toolbox/dist/src/customSectionMeta.model.ngsummary.json +0 -1
  161. package/esm2015/node_modules/idea-toolbox/dist/src/delta.model.ngsummary.json +0 -1
  162. package/esm2015/node_modules/idea-toolbox/dist/src/emailChangeRequest.model.ngsummary.json +0 -1
  163. package/esm2015/node_modules/idea-toolbox/dist/src/emailData.model.ngsummary.json +0 -1
  164. package/esm2015/node_modules/idea-toolbox/dist/src/epoch.ngsummary.json +0 -1
  165. package/esm2015/node_modules/idea-toolbox/dist/src/errorReport.model.ngsummary.json +0 -1
  166. package/esm2015/node_modules/idea-toolbox/dist/src/errorWhitelisted.model.ngsummary.json +0 -1
  167. package/esm2015/node_modules/idea-toolbox/dist/src/excelRow.model.ngsummary.json +0 -1
  168. package/esm2015/node_modules/idea-toolbox/dist/src/invitation.model.ngsummary.json +0 -1
  169. package/esm2015/node_modules/idea-toolbox/dist/src/ionicons.enum.ngsummary.json +0 -1
  170. package/esm2015/node_modules/idea-toolbox/dist/src/label.model.ngsummary.json +0 -1
  171. package/esm2015/node_modules/idea-toolbox/dist/src/labelVariable.model.ngsummary.json +0 -1
  172. package/esm2015/node_modules/idea-toolbox/dist/src/languages.enum.ngsummary.json +0 -1
  173. package/esm2015/node_modules/idea-toolbox/dist/src/languages.model.ngsummary.json +0 -1
  174. package/esm2015/node_modules/idea-toolbox/dist/src/limitCounter.model.ngsummary.json +0 -1
  175. package/esm2015/node_modules/idea-toolbox/dist/src/markdown.ngsummary.json +0 -1
  176. package/esm2015/node_modules/idea-toolbox/dist/src/membership.model.ngsummary.json +0 -1
  177. package/esm2015/node_modules/idea-toolbox/dist/src/notification.model.ngsummary.json +0 -1
  178. package/esm2015/node_modules/idea-toolbox/dist/src/pdfTemplate.model.ngsummary.json +0 -1
  179. package/esm2015/node_modules/idea-toolbox/dist/src/projectPlan.model.ngsummary.json +0 -1
  180. package/esm2015/node_modules/idea-toolbox/dist/src/projectSubscription.model.ngsummary.json +0 -1
  181. package/esm2015/node_modules/idea-toolbox/dist/src/pushNotificationsDevice.model.ngsummary.json +0 -1
  182. package/esm2015/node_modules/idea-toolbox/dist/src/pushNotificationsPlatforms.enum.ngsummary.json +0 -1
  183. package/esm2015/node_modules/idea-toolbox/dist/src/resource.model.ngsummary.json +0 -1
  184. package/esm2015/node_modules/idea-toolbox/dist/src/sentiment.enum.ngsummary.json +0 -1
  185. package/esm2015/node_modules/idea-toolbox/dist/src/signature.model.ngsummary.json +0 -1
  186. package/esm2015/node_modules/idea-toolbox/dist/src/signedURL.model.ngsummary.json +0 -1
  187. package/esm2015/node_modules/idea-toolbox/dist/src/stringVariable.model.ngsummary.json +0 -1
  188. package/esm2015/node_modules/idea-toolbox/dist/src/suggestion.model.ngsummary.json +0 -1
  189. package/esm2015/node_modules/idea-toolbox/dist/src/team.model.ngsummary.json +0 -1
  190. package/esm2015/node_modules/idea-toolbox/dist/src/teamModules.model.ngsummary.json +0 -1
  191. package/esm2015/node_modules/idea-toolbox/dist/src/timeInterval.model.ngsummary.json +0 -1
  192. package/esm2015/node_modules/idea-toolbox/dist/src/user.model.ngsummary.json +0 -1
  193. package/esm2015/node_modules/idea-toolbox/dist/src/utils.ngsummary.json +0 -1
  194. package/esm2015/node_modules/ionicons/dist/types/components/icon/icon.ngsummary.json +0 -1
  195. package/esm2015/node_modules/ionicons/dist/types/components/icon/utils.ngsummary.json +0 -1
  196. package/esm2015/node_modules/ionicons/dist/types/components.ngsummary.json +0 -1
  197. package/esm2015/node_modules/ionicons/dist/types/index.ngsummary.json +0 -1
  198. package/esm2015/node_modules/ionicons/dist/types/stencil-public-runtime.ngsummary.json +0 -1
  199. package/esm2015/node_modules/positioning/dist/entry.ngsummary.json +0 -1
  200. package/esm2015/node_modules/positioning/dist/positioning.ngsummary.json +0 -1
  201. package/esm2015/node_modules/rxjs/index.ngsummary.json +0 -1
  202. package/esm2015/node_modules/rxjs/internal/AsyncSubject.ngsummary.json +0 -1
  203. package/esm2015/node_modules/rxjs/internal/BehaviorSubject.ngsummary.json +0 -1
  204. package/esm2015/node_modules/rxjs/internal/InnerSubscriber.ngsummary.json +0 -1
  205. package/esm2015/node_modules/rxjs/internal/Notification.ngsummary.json +0 -1
  206. package/esm2015/node_modules/rxjs/internal/Observable.ngsummary.json +0 -1
  207. package/esm2015/node_modules/rxjs/internal/Operator.ngsummary.json +0 -1
  208. package/esm2015/node_modules/rxjs/internal/OuterSubscriber.ngsummary.json +0 -1
  209. package/esm2015/node_modules/rxjs/internal/ReplaySubject.ngsummary.json +0 -1
  210. package/esm2015/node_modules/rxjs/internal/Scheduler.ngsummary.json +0 -1
  211. package/esm2015/node_modules/rxjs/internal/Subject.ngsummary.json +0 -1
  212. package/esm2015/node_modules/rxjs/internal/Subscriber.ngsummary.json +0 -1
  213. package/esm2015/node_modules/rxjs/internal/Subscription.ngsummary.json +0 -1
  214. package/esm2015/node_modules/rxjs/internal/config.ngsummary.json +0 -1
  215. package/esm2015/node_modules/rxjs/internal/observable/ConnectableObservable.ngsummary.json +0 -1
  216. package/esm2015/node_modules/rxjs/internal/observable/bindCallback.ngsummary.json +0 -1
  217. package/esm2015/node_modules/rxjs/internal/observable/bindNodeCallback.ngsummary.json +0 -1
  218. package/esm2015/node_modules/rxjs/internal/observable/combineLatest.ngsummary.json +0 -1
  219. package/esm2015/node_modules/rxjs/internal/observable/concat.ngsummary.json +0 -1
  220. package/esm2015/node_modules/rxjs/internal/observable/defer.ngsummary.json +0 -1
  221. package/esm2015/node_modules/rxjs/internal/observable/empty.ngsummary.json +0 -1
  222. package/esm2015/node_modules/rxjs/internal/observable/forkJoin.ngsummary.json +0 -1
  223. package/esm2015/node_modules/rxjs/internal/observable/from.ngsummary.json +0 -1
  224. package/esm2015/node_modules/rxjs/internal/observable/fromEvent.ngsummary.json +0 -1
  225. package/esm2015/node_modules/rxjs/internal/observable/fromEventPattern.ngsummary.json +0 -1
  226. package/esm2015/node_modules/rxjs/internal/observable/generate.ngsummary.json +0 -1
  227. package/esm2015/node_modules/rxjs/internal/observable/iif.ngsummary.json +0 -1
  228. package/esm2015/node_modules/rxjs/internal/observable/interval.ngsummary.json +0 -1
  229. package/esm2015/node_modules/rxjs/internal/observable/merge.ngsummary.json +0 -1
  230. package/esm2015/node_modules/rxjs/internal/observable/never.ngsummary.json +0 -1
  231. package/esm2015/node_modules/rxjs/internal/observable/of.ngsummary.json +0 -1
  232. package/esm2015/node_modules/rxjs/internal/observable/onErrorResumeNext.ngsummary.json +0 -1
  233. package/esm2015/node_modules/rxjs/internal/observable/pairs.ngsummary.json +0 -1
  234. package/esm2015/node_modules/rxjs/internal/observable/partition.ngsummary.json +0 -1
  235. package/esm2015/node_modules/rxjs/internal/observable/race.ngsummary.json +0 -1
  236. package/esm2015/node_modules/rxjs/internal/observable/range.ngsummary.json +0 -1
  237. package/esm2015/node_modules/rxjs/internal/observable/throwError.ngsummary.json +0 -1
  238. package/esm2015/node_modules/rxjs/internal/observable/timer.ngsummary.json +0 -1
  239. package/esm2015/node_modules/rxjs/internal/observable/using.ngsummary.json +0 -1
  240. package/esm2015/node_modules/rxjs/internal/observable/zip.ngsummary.json +0 -1
  241. package/esm2015/node_modules/rxjs/internal/operators/groupBy.ngsummary.json +0 -1
  242. package/esm2015/node_modules/rxjs/internal/scheduled/scheduled.ngsummary.json +0 -1
  243. package/esm2015/node_modules/rxjs/internal/scheduler/Action.ngsummary.json +0 -1
  244. package/esm2015/node_modules/rxjs/internal/scheduler/AnimationFrameScheduler.ngsummary.json +0 -1
  245. package/esm2015/node_modules/rxjs/internal/scheduler/AsapScheduler.ngsummary.json +0 -1
  246. package/esm2015/node_modules/rxjs/internal/scheduler/AsyncAction.ngsummary.json +0 -1
  247. package/esm2015/node_modules/rxjs/internal/scheduler/AsyncScheduler.ngsummary.json +0 -1
  248. package/esm2015/node_modules/rxjs/internal/scheduler/QueueScheduler.ngsummary.json +0 -1
  249. package/esm2015/node_modules/rxjs/internal/scheduler/VirtualTimeScheduler.ngsummary.json +0 -1
  250. package/esm2015/node_modules/rxjs/internal/scheduler/animationFrame.ngsummary.json +0 -1
  251. package/esm2015/node_modules/rxjs/internal/scheduler/asap.ngsummary.json +0 -1
  252. package/esm2015/node_modules/rxjs/internal/scheduler/async.ngsummary.json +0 -1
  253. package/esm2015/node_modules/rxjs/internal/scheduler/queue.ngsummary.json +0 -1
  254. package/esm2015/node_modules/rxjs/internal/symbol/observable.ngsummary.json +0 -1
  255. package/esm2015/node_modules/rxjs/internal/types.ngsummary.json +0 -1
  256. package/esm2015/node_modules/rxjs/internal/util/ArgumentOutOfRangeError.ngsummary.json +0 -1
  257. package/esm2015/node_modules/rxjs/internal/util/EmptyError.ngsummary.json +0 -1
  258. package/esm2015/node_modules/rxjs/internal/util/ObjectUnsubscribedError.ngsummary.json +0 -1
  259. package/esm2015/node_modules/rxjs/internal/util/TimeoutError.ngsummary.json +0 -1
  260. package/esm2015/node_modules/rxjs/internal/util/UnsubscriptionError.ngsummary.json +0 -1
  261. package/esm2015/node_modules/rxjs/internal/util/identity.ngsummary.json +0 -1
  262. package/esm2015/node_modules/rxjs/internal/util/isObservable.ngsummary.json +0 -1
  263. package/esm2015/node_modules/rxjs/internal/util/noop.ngsummary.json +0 -1
  264. package/esm2015/node_modules/rxjs/internal/util/pipe.ngsummary.json +0 -1
  265. package/esm2015/node_modules/signature_pad/dist/types/point.ngsummary.json +0 -1
  266. package/esm2015/node_modules/signature_pad/dist/types/signature_pad.ngsummary.json +0 -1
  267. package/esm2015/node_modules/tslib/tslib.ngsummary.json +0 -1
  268. package/esm2015/public-api.ngsummary.json +0 -1
  269. package/esm2015/src/agenda.component.js +0 -142
  270. package/esm2015/src/agenda.component.ngfactory.js +0 -120
  271. package/esm2015/src/agenda.component.ngsummary.json +0 -1
  272. package/esm2015/src/agenda.component.scss.shim.ngstyle.js +0 -3
  273. package/esm2015/src/agenda.module.js +0 -40
  274. package/esm2015/src/agenda.module.ngfactory.js +0 -20
  275. package/esm2015/src/agenda.module.ngsummary.json +0 -1
  276. package/esm2015/src/calendar.component.js +0 -111
  277. package/esm2015/src/calendar.component.ngfactory.js +0 -54
  278. package/esm2015/src/calendar.component.ngsummary.json +0 -1
  279. package/esm2015/src/calendar.component.scss.shim.ngstyle.js +0 -3
  280. package/esm2015/src/calendarCreation.component.js +0 -116
  281. package/esm2015/src/calendarCreation.component.ngfactory.js +0 -43
  282. package/esm2015/src/calendarCreation.component.ngsummary.json +0 -1
  283. package/esm2015/src/calendarCreation.component.scss.shim.ngstyle.js +0 -3
  284. package/esm2015/src/calendarItem.component.js +0 -119
  285. package/esm2015/src/calendarItem.component.ngfactory.js +0 -24
  286. package/esm2015/src/calendarItem.component.ngsummary.json +0 -1
  287. package/esm2015/src/calendarItem.component.scss.shim.ngstyle.js +0 -3
  288. package/esm2015/src/calendars.service.js +0 -209
  289. package/esm2015/src/calendars.service.ngsummary.json +0 -1
  290. package/esm2015/src/dateFormatter.provider.js +0 -32
  291. package/esm2015/src/dateFormatter.provider.ngsummary.json +0 -1
  292. package/fesm2015/idea-ionic-agenda.js +0 -736
  293. package/fesm2015/idea-ionic-agenda.js.map +0 -1
  294. package/idea-ionic-agenda.metadata.json +0 -1
  295. package/src/agenda.component.ngfactory.d.ts +0 -1
  296. package/src/agenda.component.scss.shim.ngstyle.d.ts +0 -1
  297. package/src/agenda.module.ngfactory.d.ts +0 -3
  298. package/src/calendar.component.ngfactory.d.ts +0 -1
  299. package/src/calendar.component.scss.shim.ngstyle.d.ts +0 -1
  300. package/src/calendarCreation.component.ngfactory.d.ts +0 -1
  301. package/src/calendarCreation.component.scss.shim.ngstyle.d.ts +0 -1
  302. package/src/calendarItem.component.ngfactory.d.ts +0 -1
  303. package/src/calendarItem.component.scss.shim.ngstyle.d.ts +0 -1
@@ -0,0 +1,967 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, EventEmitter, Component, ChangeDetectionStrategy, Input, Output, NgModule } from '@angular/core';
3
+ import * as i4 from '@angular/common';
4
+ import { formatDate, CommonModule } from '@angular/common';
5
+ import * as i5 from '@angular/forms';
6
+ import { FormsModule } from '@angular/forms';
7
+ import * as i2 from '@ionic/angular';
8
+ import { IonicModule } from '@ionic/angular';
9
+ import * as i3$1 from 'angular-calendar';
10
+ import { CalendarDateFormatter, CalendarView, CalendarModule, DateAdapter } from 'angular-calendar';
11
+ import { adapterFactory } from 'angular-calendar/date-adapters/date-fns';
12
+ import * as i3 from '@idea-ionic/common';
13
+ import { IDEASuggestionsComponent, IDEATranslationsModule, IDEAColorPickerModule, IDEACheckerModule } from '@idea-ionic/common';
14
+ import { Subject } from 'rxjs';
15
+ import { isFuture, isToday, isSameDay } from 'date-fns';
16
+ import ColorParse from 'color-parse';
17
+ import { ExternalCalendarSources, Calendar, Suggestion, Check, ExternalCalendarInfo } from 'idea-toolbox';
18
+ import { Plugins } from '@capacitor/core';
19
+ import { environment } from '@env';
20
+
21
+ class CustomDateFormatter extends CalendarDateFormatter {
22
+ // MONTH VIEW
23
+ monthViewColumnHeader({ date, locale }) {
24
+ return formatDate(date, 'EEE', locale);
25
+ }
26
+ monthViewTitle({ date, locale }) {
27
+ return formatDate(date, 'MMMM y', locale);
28
+ }
29
+ // WEEK VIEW
30
+ weekViewHour({ date, locale }) {
31
+ return locale === 'it' ? formatDate(date, 'HH:mm', locale) : formatDate(date, 'h aa', locale);
32
+ }
33
+ weekViewColumnHeader({ date, locale }) {
34
+ return formatDate(date, 'EEE', locale);
35
+ }
36
+ weekViewTitle({ date, locale }) {
37
+ return formatDate(date, 'MMMM yyyy', locale);
38
+ }
39
+ // DAY VIEW
40
+ dayViewHour({ date, locale }) {
41
+ return locale === 'it' ? formatDate(date, 'HH:mm', locale) : formatDate(date, 'h aa', locale);
42
+ }
43
+ dayViewTitle({ date, locale }) {
44
+ return locale === 'it'
45
+ ? formatDate(date, 'EEEE, dd MMM yyyy', locale)
46
+ : formatDate(date, 'EEEE, MMM dd, yyyy', locale);
47
+ }
48
+ }
49
+ CustomDateFormatter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: CustomDateFormatter, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
50
+ CustomDateFormatter.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: CustomDateFormatter });
51
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: CustomDateFormatter, decorators: [{
52
+ type: Injectable
53
+ }] });
54
+
55
+ /**
56
+ * A local fallback URL for the avatars.
57
+ */
58
+ const AVATAR_FALLBACK_URL = './assets/imgs/no-avatar.jpg';
59
+ class IDEAAgendaComponent {
60
+ constructor(platform, tc, t) {
61
+ this.platform = platform;
62
+ this.tc = tc;
63
+ this.t = t;
64
+ /**
65
+ * The events to display in the calendar.
66
+ */
67
+ this.events = [];
68
+ /**
69
+ * An array of day indexes (0 = sunday, 1 = monday, etc.) that will be hidden on the view.
70
+ */
71
+ this.excludeDays = [];
72
+ /**
73
+ * The day start hours in 24 hour time. Must be 0-23
74
+ */
75
+ this.dayStartHour = 0;
76
+ /**
77
+ * The day start hours in 24 hour time. Must be 0-23
78
+ */
79
+ this.dayEndHour = 23;
80
+ /**
81
+ * The number of segments in an hour. Must divide equally into 60.
82
+ */
83
+ this.hourSegments = 2;
84
+ /**
85
+ * Whether to open the current day's details right away in month view.
86
+ */
87
+ this.activeDayIsOpen = false;
88
+ /**
89
+ * The view mode for the agenda.
90
+ */
91
+ this.view = CalendarView.Week;
92
+ /**
93
+ * Whether to block any day/slot in the past.
94
+ */
95
+ this.onlyFuture = false;
96
+ /**
97
+ * Trigger when an event is selected.
98
+ */
99
+ this.selectEvent = new EventEmitter();
100
+ /**
101
+ * Trigger when a day is selected.
102
+ */
103
+ this.selectDay = new EventEmitter();
104
+ /**
105
+ * Trigger when a time slot is selected.
106
+ */
107
+ this.selectSlot = new EventEmitter();
108
+ /**
109
+ * Trigger when an event changed date (drag&drop or resize).
110
+ */
111
+ this.changeEvent = new EventEmitter();
112
+ /**
113
+ * Trigger when the view date of reference changed (because we moved inside the calendar).
114
+ */
115
+ this.changeDate = new EventEmitter();
116
+ /**
117
+ * Helper to use the enum in the UX.
118
+ */
119
+ this.CalendarView = CalendarView;
120
+ /**
121
+ * The currently selected date.
122
+ */
123
+ this.viewDate = new Date();
124
+ /**
125
+ * A controller to refresh the current view.
126
+ */
127
+ this.refresh = new Subject();
128
+ /**
129
+ * Helper to use the enum in the UI.
130
+ */
131
+ this.Attendance = EventAttendance;
132
+ }
133
+ ngOnInit() {
134
+ this.locale = this.t.getCurrentLang();
135
+ // in case of Italian locale the starting day for the week is monday (1), otherwise sunday (0)
136
+ this.weekStartsOn = this.locale === 'it' ? 1 : 0;
137
+ }
138
+ /**
139
+ * Run some checks before the month view is rendered (e.g. disable invalid days).
140
+ */
141
+ beforeMonthViewRender({ body }) {
142
+ body.forEach(day => {
143
+ if (!this.dateIsValid(day.date, true))
144
+ day.cssClass = 'cal-disabled';
145
+ });
146
+ }
147
+ /**
148
+ * Run some checks before the weel/day view is rendered (e.g. disable invalid days).
149
+ */
150
+ beforeWeekOrDayViewRender({ header }) {
151
+ header.forEach((day) => {
152
+ if (!this.dateIsValid(day.date, true))
153
+ day.cssClass = 'cal-disabled';
154
+ });
155
+ }
156
+ /**
157
+ * Check whether a date is valid based on the configured parameters.
158
+ */
159
+ dateIsValid(date, sameDayIsValid) {
160
+ if (!this.onlyFuture)
161
+ return true;
162
+ return isFuture(date) || (sameDayIsValid ? isToday(date) : false);
163
+ }
164
+ /**
165
+ * Change the current view for the agenda.
166
+ */
167
+ setView(view) {
168
+ this.view = view;
169
+ }
170
+ /**
171
+ * Emit the change of the view date and close the detail component of the month view, if needed.
172
+ */
173
+ viewDateChanged(newDate) {
174
+ if (this.view === CalendarView.Month)
175
+ this.activeDayIsOpen = false;
176
+ this.changeDate.emit(newDate);
177
+ }
178
+ /**
179
+ * A day was selected: manage the detailed view.
180
+ */
181
+ changeDay({ date, events }) {
182
+ // skip if the date isn't valid
183
+ if (!this.dateIsValid(date, true))
184
+ return;
185
+ // if the selected day changed, if the new day has events, open the details in month view (otherwise close them)
186
+ if ((isSameDay(this.viewDate, date) && this.activeDayIsOpen === true) || !events || events.length === 0)
187
+ this.activeDayIsOpen = false;
188
+ else
189
+ this.activeDayIsOpen = true;
190
+ // update the current date in the agenda
191
+ this.viewDate = date;
192
+ }
193
+ /**
194
+ * The time of an event was changed.
195
+ */
196
+ eventTimesChanged({ event, newStart, newEnd }) {
197
+ // update the event
198
+ event.start = newStart;
199
+ event.end = newEnd;
200
+ // re-map the array to trigger the UI refresh
201
+ this.events = this.events.slice();
202
+ // trigger the event to the parent component
203
+ this.changeEvent.emit(event);
204
+ }
205
+ /**
206
+ * Given a color, it returns an opaque version of it.
207
+ */
208
+ getAlternateColor(color, amount, opacity) {
209
+ const alt = ColorParse(color);
210
+ const r = Math.max(Math.min(255, Number(alt.values[0]) + amount), 0);
211
+ const g = Math.max(Math.min(255, Number(alt.values[1]) + amount), 0);
212
+ const b = Math.max(Math.min(255, Number(alt.values[2]) + amount), 0);
213
+ return `rgba(${r}, ${g}, ${b}, ${opacity || 1})`;
214
+ }
215
+ /**
216
+ * Get the content of the tooltip based on the event.
217
+ */
218
+ getTooltipContent(event) {
219
+ if (!event)
220
+ return '';
221
+ let str = event.title ? '<b>' + event.title + '</b>' : '';
222
+ if (event.description)
223
+ str = str.concat('<br>', event.description);
224
+ if (event.icons)
225
+ event.icons.forEach(x => (str = str.concat('<br>', '<i>', x.title, '</i>')));
226
+ if (event.avatars && event.avatars.length) {
227
+ str = str.concat('<br><br>~');
228
+ event.avatars.forEach(x => (str = str.concat('<br>', x.title)));
229
+ }
230
+ return str;
231
+ }
232
+ /**
233
+ * Get a shortened version of the description as preview.
234
+ */
235
+ getPreviewDescription(description) {
236
+ return description && description.length > 100 ? description.slice(0, 100).concat('...') : description;
237
+ }
238
+ /**
239
+ * Load a fallback url when the avatar is missing.
240
+ */
241
+ loadFallbackAvatar(targetImg) {
242
+ const fallback = this.fallbackAvatar || AVATAR_FALLBACK_URL;
243
+ if (targetImg && targetImg.src !== fallback)
244
+ targetImg.src = fallback;
245
+ }
246
+ }
247
+ IDEAAgendaComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: IDEAAgendaComponent, deps: [{ token: i2.Platform }, { token: i3.IDEATinCanService }, { token: i3.IDEATranslationsService }], target: i0.ɵɵFactoryTarget.Component });
248
+ IDEAAgendaComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: IDEAAgendaComponent, selector: "idea-agenda", inputs: { events: "events", excludeDays: "excludeDays", dayStartHour: "dayStartHour", dayEndHour: "dayEndHour", hourSegments: "hourSegments", activeDayIsOpen: "activeDayIsOpen", view: "view", onlyFuture: "onlyFuture", fallbackAvatar: "fallbackAvatar" }, outputs: { selectEvent: "selectEvent", selectDay: "selectDay", selectSlot: "selectSlot", changeEvent: "changeEvent", changeDate: "changeDate" }, ngImport: i0, template: "<div class=\"agenda\">\n <!-- TOOLBAR -->\n <ion-row class=\"ion-align-items-center\">\n <ion-col\n class=\"ion-align-self-center ion-text-right\"\n [size]=\"5\"\n [sizeSm]=\"3\"\n [pushSm]=\"5\"\n [sizeLg]=\"2\"\n [pushLg]=\"8\"\n >\n <ion-item lines=\"none\" class=\"calendarViewSelector\">\n <ion-select\n interface=\"popover\"\n [value]=\"view\"\n (ionChange)=\"$event?.detail ? setView($event.detail.value) : null\"\n >\n <ion-select-option [value]=\"CalendarView.Month\">{{ 'IDEA_AGENDA.MONTH' | translate }}</ion-select-option>\n <ion-select-option [value]=\"CalendarView.Week\">{{ 'IDEA_AGENDA.WEEK' | translate }}</ion-select-option>\n <ion-select-option [value]=\"CalendarView.Day\">{{ 'IDEA_AGENDA.DAY' | translate }}</ion-select-option>\n </ion-select>\n </ion-item>\n </ion-col>\n <ion-col\n class=\"ion-align-self-center ion-text-right\"\n [size]=\"7\"\n [sizeSm]=\"4\"\n [pushSm]=\"5\"\n [sizeLg]=\"2\"\n [pushLg]=\"8\"\n >\n <ion-button\n fill=\"clear\"\n color=\"dark\"\n size=\"small\"\n mwlCalendarPreviousView\n [view]=\"view\"\n [(viewDate)]=\"viewDate\"\n (viewDateChange)=\"viewDateChanged($event)\"\n >\n <ion-icon name=\"chevron-back-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n <ion-button\n fill=\"clear\"\n color=\"dark\"\n size=\"small\"\n mwlCalendarToday\n [(viewDate)]=\"viewDate\"\n (viewDateChange)=\"viewDateChanged($event)\"\n >\n <ion-icon name=\"today-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n <ion-button\n fill=\"clear\"\n color=\"dark\"\n size=\"small\"\n mwlCalendarNextView\n [view]=\"view\"\n [(viewDate)]=\"viewDate\"\n (viewDateChange)=\"viewDateChanged($event)\"\n >\n <ion-icon name=\"chevron-forward-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n </ion-col>\n <ion-col class=\"ion-align-self-center\" [size]=\"12\" [sizeSm]=\"5\" [pullSm]=\"7\" [sizeLg]=\"8\" [pullLg]=\"4\">\n <h2>{{ viewDate | calendarDate: view + 'ViewTitle':t.getCurrentLang() }}</h2>\n </ion-col>\n </ion-row>\n <!-- TEMPLATES (touch only what's necessary and leave everything else as it is) -->\n <ng-template #eventTitleTemplate let-event=\"event\" let-view=\"view\">\n <span\n class=\"cal-event-title\"\n [class.noWrap]=\"event.allDay\"\n [attr.aria-hidden]=\"{} | calendarA11y: 'hideEventTitle'\"\n >\n {{ event.title | calendarEventTitle: view:event }}\n <p *ngIf=\"!event.allDay\">{{ getPreviewDescription(event.description) }}</p>\n </span>\n </ng-template>\n <ng-template\n #eventTemplate\n let-weekEvent=\"weekEvent\"\n let-tooltipPlacement=\"tooltipPlacement\"\n let-eventClicked=\"eventClicked\"\n let-tooltipTemplate=\"tooltipTemplate\"\n let-tooltipAppendToBody=\"tooltipAppendToBody\"\n let-tooltipDisabled=\"tooltipDisabled\"\n let-tooltipDelay=\"tooltipDelay\"\n let-column=\"column\"\n let-daysInWeek=\"daysInWeek\"\n >\n <div\n class=\"cal-event\"\n [class.external]=\"weekEvent.event.external\"\n [class.needsAction]=\"Attendance.NEEDS_ACTION === weekEvent.event.attendance\"\n [class.declined]=\"Attendance.DECLINED === weekEvent.event.attendance\"\n [class.tentative]=\"Attendance.TENTATIVE === weekEvent.event.attendance\"\n [style.border-left-color]=\"weekEvent.event.color.primary\"\n [style.color]=\"getAlternateColor(weekEvent.event.color.primary, tc.get('darkMode') ? 80 : -40)\"\n [style.background-color]=\"getAlternateColor(weekEvent.event.color.primary, tc.get('darkMode') ? 60 : 80, 0.2)\"\n [mwlCalendarTooltip]=\"!tooltipDisabled && !platform.is('mobile') ? getTooltipContent(weekEvent.event) : ''\"\n [tooltipPlacement]=\"tooltipPlacement\"\n [tooltipEvent]=\"weekEvent.tempEvent || weekEvent.event\"\n [tooltipTemplate]=\"tooltipTemplate\"\n [tooltipAppendToBody]=\"tooltipAppendToBody\"\n [tooltipDelay]=\"tooltipDelay\"\n (mwlClick)=\"eventClicked.emit({ sourceEvent: $event })\"\n (mwlKeydownEnter)=\"eventClicked.emit({ sourceEvent: $event })\"\n tabindex=\"0\"\n role=\"application\"\n [attr.aria-label]=\"\n { event: weekEvent.tempEvent || weekEvent.event, locale: locale } | calendarA11y: 'eventDescription'\n \"\n >\n <mwl-calendar-event-actions [event]=\"weekEvent.tempEvent || weekEvent.event\"> </mwl-calendar-event-actions>\n &ngsp;\n <mwl-calendar-event-title\n [event]=\"weekEvent.tempEvent || weekEvent.event\"\n [customTemplate]=\"eventTitleTemplate\"\n [view]=\"daysInWeek === 1 ? 'day' : 'week'\"\n >\n </mwl-calendar-event-title>\n <div class=\"eventGadgets\" *ngIf=\"!weekEvent.event.allDay\">\n <ion-icon *ngFor=\"let icon of weekEvent.event.icons\" [name]=\"icon.name\" [title]=\"icon.title\"></ion-icon>\n <ion-avatar *ngFor=\"let avatar of weekEvent.event.avatars\" [title]=\"avatar.title\">\n <ion-img [src]=\"avatar.url\" (ionError)=\"loadFallbackAvatar($event?.target)\"></ion-img>\n </ion-avatar>\n </div>\n </div>\n </ng-template>\n <!-- VIEWS -->\n <div [ngSwitch]=\"view\">\n <mwl-calendar-month-view\n *ngSwitchCase=\"CalendarView.Month\"\n [viewDate]=\"viewDate\"\n [events]=\"events\"\n [refresh]=\"refresh\"\n [activeDayIsOpen]=\"activeDayIsOpen\"\n [locale]=\"locale\"\n [excludeDays]=\"excludeDays\"\n [weekStartsOn]=\"weekStartsOn\"\n [eventTitleTemplate]=\"eventTitleTemplate\"\n (eventClicked)=\"selectEvent.emit($event.event)\"\n (eventTimesChanged)=\"eventTimesChanged($event)\"\n (dayClicked)=\"changeDay($event.day)\"\n (beforeViewRender)=\"beforeMonthViewRender($event)\"\n >\n </mwl-calendar-month-view>\n <mwl-calendar-week-view\n *ngSwitchCase=\"CalendarView.Week\"\n [viewDate]=\"viewDate\"\n [events]=\"events\"\n [refresh]=\"refresh\"\n [locale]=\"locale\"\n [excludeDays]=\"excludeDays\"\n [weekStartsOn]=\"weekStartsOn\"\n [dayStartHour]=\"dayStartHour\"\n [dayEndHour]=\"dayEndHour\"\n [hourSegments]=\"hourSegments\"\n [eventTemplate]=\"eventTemplate\"\n (eventClicked)=\"selectEvent.emit($event.event)\"\n (eventTimesChanged)=\"eventTimesChanged($event)\"\n (dayHeaderClicked)=\"dateIsValid($event.day.date) ? selectDay.emit($event.day.date) : null\"\n (hourSegmentClicked)=\"dateIsValid($event.date) ? selectSlot.emit($event.date) : null\"\n (beforeViewRender)=\"beforeWeekOrDayViewRender($event)\"\n >\n </mwl-calendar-week-view>\n <mwl-calendar-day-view\n *ngSwitchCase=\"CalendarView.Day\"\n [viewDate]=\"viewDate\"\n [events]=\"events\"\n [refresh]=\"refresh\"\n [locale]=\"locale\"\n [dayStartHour]=\"dayStartHour\"\n [dayEndHour]=\"dayEndHour\"\n [hourSegments]=\"hourSegments\"\n [eventTemplate]=\"eventTemplate\"\n (eventClicked)=\"selectEvent.emit($event.event)\"\n (eventTimesChanged)=\"eventTimesChanged($event)\"\n (hourSegmentClicked)=\"dateIsValid($event.date) ? selectSlot.emit($event.date) : null\"\n (beforeViewRender)=\"beforeWeekOrDayViewRender($event)\"\n >\n </mwl-calendar-day-view>\n </div>\n</div>\n", styles: [".agenda{margin-top:15px}.agenda h2{margin:6px 10px;font-size:1.2em}.agenda .calendarViewSelector{--ion-item-background: transparent}.agenda .calendarViewSelector ion-select{max-width:100%;width:100%;padding-left:0;font-weight:500}.agenda .eventGadgets{margin-top:4px;margin-left:5px;text-align:right}.agenda .eventGadgets ion-avatar{display:block;float:left;margin:2px 1px;width:14px;height:14px}.agenda .eventGadgets ion-icon{padding-right:2px;opacity:.7;font-size:1.15em}@media only screen and (max-width: 575px){.agenda h2{margin:0 8px 12px;text-align:center}}\n"], components: [{ type: i2.IonRow, selector: "ion-row" }, { type: i2.IonCol, selector: "ion-col", inputs: ["offset", "offsetLg", "offsetMd", "offsetSm", "offsetXl", "offsetXs", "pull", "pullLg", "pullMd", "pullSm", "pullXl", "pullXs", "push", "pushLg", "pushMd", "pushSm", "pushXl", "pushXs", "size", "sizeLg", "sizeMd", "sizeSm", "sizeXl", "sizeXs"] }, { type: i2.IonItem, selector: "ion-item", inputs: ["button", "color", "counter", "detail", "detailIcon", "disabled", "download", "fill", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "shape", "target", "type"] }, { type: i2.IonSelect, selector: "ion-select", inputs: ["cancelText", "compareWith", "disabled", "interface", "interfaceOptions", "mode", "multiple", "name", "okText", "placeholder", "selectedText", "value"] }, { type: i2.IonSelectOption, selector: "ion-select-option", inputs: ["disabled", "value"] }, { type: i2.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { type: i2.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { type: i3$1.ɵCalendarEventActionsComponent, selector: "mwl-calendar-event-actions", inputs: ["event", "customTemplate"] }, { type: i3$1.ɵCalendarEventTitleComponent, selector: "mwl-calendar-event-title", inputs: ["event", "customTemplate", "view"] }, { type: i2.IonAvatar, selector: "ion-avatar" }, { type: i2.IonImg, selector: "ion-img", inputs: ["alt", "src"] }, { type: i3$1.CalendarMonthViewComponent, selector: "mwl-calendar-month-view", inputs: ["viewDate", "events", "excludeDays", "activeDayIsOpen", "activeDay", "refresh", "locale", "tooltipPlacement", "tooltipTemplate", "tooltipAppendToBody", "tooltipDelay", "weekStartsOn", "headerTemplate", "cellTemplate", "openDayEventsTemplate", "eventTitleTemplate", "eventActionsTemplate", "weekendDays"], outputs: ["beforeViewRender", "dayClicked", "eventClicked", "columnHeaderClicked", "eventTimesChanged"] }, { type: i3$1.CalendarWeekViewComponent, selector: "mwl-calendar-week-view", inputs: ["viewDate", "events", "excludeDays", "refresh", "locale", "tooltipPlacement", "tooltipTemplate", "tooltipAppendToBody", "tooltipDelay", "weekStartsOn", "headerTemplate", "eventTemplate", "eventTitleTemplate", "eventActionsTemplate", "precision", "weekendDays", "snapDraggedEvents", "hourSegments", "hourDuration", "hourSegmentHeight", "minimumEventHeight", "dayStartHour", "dayStartMinute", "dayEndHour", "dayEndMinute", "hourSegmentTemplate", "eventSnapSize", "allDayEventsLabelTemplate", "daysInWeek", "currentTimeMarkerTemplate", "validateEventTimesChanged"], outputs: ["dayHeaderClicked", "eventClicked", "eventTimesChanged", "beforeViewRender", "hourSegmentClicked"] }, { type: i3$1.CalendarDayViewComponent, selector: "mwl-calendar-day-view", inputs: ["viewDate", "events", "hourSegments", "hourSegmentHeight", "hourDuration", "minimumEventHeight", "dayStartHour", "dayStartMinute", "dayEndHour", "dayEndMinute", "refresh", "locale", "eventSnapSize", "tooltipPlacement", "tooltipTemplate", "tooltipAppendToBody", "tooltipDelay", "hourSegmentTemplate", "eventTemplate", "eventTitleTemplate", "eventActionsTemplate", "snapDraggedEvents", "allDayEventsLabelTemplate", "currentTimeMarkerTemplate", "validateEventTimesChanged"], outputs: ["eventClicked", "hourSegmentClicked", "eventTimesChanged", "beforeViewRender"] }], directives: [{ type: i2.SelectValueAccessor, selector: "ion-range, ion-select, ion-radio-group, ion-segment, ion-datetime" }, { type: i3$1.ɵCalendarPreviousViewDirective, selector: "[mwlCalendarPreviousView]", inputs: ["view", "viewDate", "excludeDays", "daysInWeek"], outputs: ["viewDateChange"] }, { type: i3$1.ɵCalendarTodayDirective, selector: "[mwlCalendarToday]", inputs: ["viewDate"], outputs: ["viewDateChange"] }, { type: i3$1.ɵCalendarNextViewDirective, selector: "[mwlCalendarNextView]", inputs: ["view", "viewDate", "excludeDays", "daysInWeek"], outputs: ["viewDateChange"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.ɵCalendarTooltipDirective, selector: "[mwlCalendarTooltip]", inputs: ["mwlCalendarTooltip", "tooltipPlacement", "tooltipTemplate", "tooltipEvent", "tooltipAppendToBody", "tooltipDelay"] }, { type: i3$1.ɵClickDirective, selector: "[mwlClick]", inputs: ["clickListenerDisabled"], outputs: ["mwlClick"] }, { type: i3$1.ɵKeydownEnterDirective, selector: "[mwlKeydownEnter]", outputs: ["mwlKeydownEnter"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], pipes: { "translate": i3.IDEATranslatePipe, "calendarDate": i3$1.ɵCalendarDatePipe, "calendarA11y": i3$1.ɵCalendarA11yPipe, "calendarEventTitle": i3$1.ɵCalendarEventTitlePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
249
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: IDEAAgendaComponent, decorators: [{
250
+ type: Component,
251
+ args: [{ selector: 'idea-agenda', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"agenda\">\n <!-- TOOLBAR -->\n <ion-row class=\"ion-align-items-center\">\n <ion-col\n class=\"ion-align-self-center ion-text-right\"\n [size]=\"5\"\n [sizeSm]=\"3\"\n [pushSm]=\"5\"\n [sizeLg]=\"2\"\n [pushLg]=\"8\"\n >\n <ion-item lines=\"none\" class=\"calendarViewSelector\">\n <ion-select\n interface=\"popover\"\n [value]=\"view\"\n (ionChange)=\"$event?.detail ? setView($event.detail.value) : null\"\n >\n <ion-select-option [value]=\"CalendarView.Month\">{{ 'IDEA_AGENDA.MONTH' | translate }}</ion-select-option>\n <ion-select-option [value]=\"CalendarView.Week\">{{ 'IDEA_AGENDA.WEEK' | translate }}</ion-select-option>\n <ion-select-option [value]=\"CalendarView.Day\">{{ 'IDEA_AGENDA.DAY' | translate }}</ion-select-option>\n </ion-select>\n </ion-item>\n </ion-col>\n <ion-col\n class=\"ion-align-self-center ion-text-right\"\n [size]=\"7\"\n [sizeSm]=\"4\"\n [pushSm]=\"5\"\n [sizeLg]=\"2\"\n [pushLg]=\"8\"\n >\n <ion-button\n fill=\"clear\"\n color=\"dark\"\n size=\"small\"\n mwlCalendarPreviousView\n [view]=\"view\"\n [(viewDate)]=\"viewDate\"\n (viewDateChange)=\"viewDateChanged($event)\"\n >\n <ion-icon name=\"chevron-back-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n <ion-button\n fill=\"clear\"\n color=\"dark\"\n size=\"small\"\n mwlCalendarToday\n [(viewDate)]=\"viewDate\"\n (viewDateChange)=\"viewDateChanged($event)\"\n >\n <ion-icon name=\"today-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n <ion-button\n fill=\"clear\"\n color=\"dark\"\n size=\"small\"\n mwlCalendarNextView\n [view]=\"view\"\n [(viewDate)]=\"viewDate\"\n (viewDateChange)=\"viewDateChanged($event)\"\n >\n <ion-icon name=\"chevron-forward-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n </ion-col>\n <ion-col class=\"ion-align-self-center\" [size]=\"12\" [sizeSm]=\"5\" [pullSm]=\"7\" [sizeLg]=\"8\" [pullLg]=\"4\">\n <h2>{{ viewDate | calendarDate: view + 'ViewTitle':t.getCurrentLang() }}</h2>\n </ion-col>\n </ion-row>\n <!-- TEMPLATES (touch only what's necessary and leave everything else as it is) -->\n <ng-template #eventTitleTemplate let-event=\"event\" let-view=\"view\">\n <span\n class=\"cal-event-title\"\n [class.noWrap]=\"event.allDay\"\n [attr.aria-hidden]=\"{} | calendarA11y: 'hideEventTitle'\"\n >\n {{ event.title | calendarEventTitle: view:event }}\n <p *ngIf=\"!event.allDay\">{{ getPreviewDescription(event.description) }}</p>\n </span>\n </ng-template>\n <ng-template\n #eventTemplate\n let-weekEvent=\"weekEvent\"\n let-tooltipPlacement=\"tooltipPlacement\"\n let-eventClicked=\"eventClicked\"\n let-tooltipTemplate=\"tooltipTemplate\"\n let-tooltipAppendToBody=\"tooltipAppendToBody\"\n let-tooltipDisabled=\"tooltipDisabled\"\n let-tooltipDelay=\"tooltipDelay\"\n let-column=\"column\"\n let-daysInWeek=\"daysInWeek\"\n >\n <div\n class=\"cal-event\"\n [class.external]=\"weekEvent.event.external\"\n [class.needsAction]=\"Attendance.NEEDS_ACTION === weekEvent.event.attendance\"\n [class.declined]=\"Attendance.DECLINED === weekEvent.event.attendance\"\n [class.tentative]=\"Attendance.TENTATIVE === weekEvent.event.attendance\"\n [style.border-left-color]=\"weekEvent.event.color.primary\"\n [style.color]=\"getAlternateColor(weekEvent.event.color.primary, tc.get('darkMode') ? 80 : -40)\"\n [style.background-color]=\"getAlternateColor(weekEvent.event.color.primary, tc.get('darkMode') ? 60 : 80, 0.2)\"\n [mwlCalendarTooltip]=\"!tooltipDisabled && !platform.is('mobile') ? getTooltipContent(weekEvent.event) : ''\"\n [tooltipPlacement]=\"tooltipPlacement\"\n [tooltipEvent]=\"weekEvent.tempEvent || weekEvent.event\"\n [tooltipTemplate]=\"tooltipTemplate\"\n [tooltipAppendToBody]=\"tooltipAppendToBody\"\n [tooltipDelay]=\"tooltipDelay\"\n (mwlClick)=\"eventClicked.emit({ sourceEvent: $event })\"\n (mwlKeydownEnter)=\"eventClicked.emit({ sourceEvent: $event })\"\n tabindex=\"0\"\n role=\"application\"\n [attr.aria-label]=\"\n { event: weekEvent.tempEvent || weekEvent.event, locale: locale } | calendarA11y: 'eventDescription'\n \"\n >\n <mwl-calendar-event-actions [event]=\"weekEvent.tempEvent || weekEvent.event\"> </mwl-calendar-event-actions>\n &ngsp;\n <mwl-calendar-event-title\n [event]=\"weekEvent.tempEvent || weekEvent.event\"\n [customTemplate]=\"eventTitleTemplate\"\n [view]=\"daysInWeek === 1 ? 'day' : 'week'\"\n >\n </mwl-calendar-event-title>\n <div class=\"eventGadgets\" *ngIf=\"!weekEvent.event.allDay\">\n <ion-icon *ngFor=\"let icon of weekEvent.event.icons\" [name]=\"icon.name\" [title]=\"icon.title\"></ion-icon>\n <ion-avatar *ngFor=\"let avatar of weekEvent.event.avatars\" [title]=\"avatar.title\">\n <ion-img [src]=\"avatar.url\" (ionError)=\"loadFallbackAvatar($event?.target)\"></ion-img>\n </ion-avatar>\n </div>\n </div>\n </ng-template>\n <!-- VIEWS -->\n <div [ngSwitch]=\"view\">\n <mwl-calendar-month-view\n *ngSwitchCase=\"CalendarView.Month\"\n [viewDate]=\"viewDate\"\n [events]=\"events\"\n [refresh]=\"refresh\"\n [activeDayIsOpen]=\"activeDayIsOpen\"\n [locale]=\"locale\"\n [excludeDays]=\"excludeDays\"\n [weekStartsOn]=\"weekStartsOn\"\n [eventTitleTemplate]=\"eventTitleTemplate\"\n (eventClicked)=\"selectEvent.emit($event.event)\"\n (eventTimesChanged)=\"eventTimesChanged($event)\"\n (dayClicked)=\"changeDay($event.day)\"\n (beforeViewRender)=\"beforeMonthViewRender($event)\"\n >\n </mwl-calendar-month-view>\n <mwl-calendar-week-view\n *ngSwitchCase=\"CalendarView.Week\"\n [viewDate]=\"viewDate\"\n [events]=\"events\"\n [refresh]=\"refresh\"\n [locale]=\"locale\"\n [excludeDays]=\"excludeDays\"\n [weekStartsOn]=\"weekStartsOn\"\n [dayStartHour]=\"dayStartHour\"\n [dayEndHour]=\"dayEndHour\"\n [hourSegments]=\"hourSegments\"\n [eventTemplate]=\"eventTemplate\"\n (eventClicked)=\"selectEvent.emit($event.event)\"\n (eventTimesChanged)=\"eventTimesChanged($event)\"\n (dayHeaderClicked)=\"dateIsValid($event.day.date) ? selectDay.emit($event.day.date) : null\"\n (hourSegmentClicked)=\"dateIsValid($event.date) ? selectSlot.emit($event.date) : null\"\n (beforeViewRender)=\"beforeWeekOrDayViewRender($event)\"\n >\n </mwl-calendar-week-view>\n <mwl-calendar-day-view\n *ngSwitchCase=\"CalendarView.Day\"\n [viewDate]=\"viewDate\"\n [events]=\"events\"\n [refresh]=\"refresh\"\n [locale]=\"locale\"\n [dayStartHour]=\"dayStartHour\"\n [dayEndHour]=\"dayEndHour\"\n [hourSegments]=\"hourSegments\"\n [eventTemplate]=\"eventTemplate\"\n (eventClicked)=\"selectEvent.emit($event.event)\"\n (eventTimesChanged)=\"eventTimesChanged($event)\"\n (hourSegmentClicked)=\"dateIsValid($event.date) ? selectSlot.emit($event.date) : null\"\n (beforeViewRender)=\"beforeWeekOrDayViewRender($event)\"\n >\n </mwl-calendar-day-view>\n </div>\n</div>\n", styles: [".agenda{margin-top:15px}.agenda h2{margin:6px 10px;font-size:1.2em}.agenda .calendarViewSelector{--ion-item-background: transparent}.agenda .calendarViewSelector ion-select{max-width:100%;width:100%;padding-left:0;font-weight:500}.agenda .eventGadgets{margin-top:4px;margin-left:5px;text-align:right}.agenda .eventGadgets ion-avatar{display:block;float:left;margin:2px 1px;width:14px;height:14px}.agenda .eventGadgets ion-icon{padding-right:2px;opacity:.7;font-size:1.15em}@media only screen and (max-width: 575px){.agenda h2{margin:0 8px 12px;text-align:center}}\n"] }]
252
+ }], ctorParameters: function () { return [{ type: i2.Platform }, { type: i3.IDEATinCanService }, { type: i3.IDEATranslationsService }]; }, propDecorators: { events: [{
253
+ type: Input
254
+ }], excludeDays: [{
255
+ type: Input
256
+ }], dayStartHour: [{
257
+ type: Input
258
+ }], dayEndHour: [{
259
+ type: Input
260
+ }], hourSegments: [{
261
+ type: Input
262
+ }], activeDayIsOpen: [{
263
+ type: Input
264
+ }], view: [{
265
+ type: Input
266
+ }], onlyFuture: [{
267
+ type: Input
268
+ }], fallbackAvatar: [{
269
+ type: Input
270
+ }], selectEvent: [{
271
+ type: Output
272
+ }], selectDay: [{
273
+ type: Output
274
+ }], selectSlot: [{
275
+ type: Output
276
+ }], changeEvent: [{
277
+ type: Output
278
+ }], changeDate: [{
279
+ type: Output
280
+ }] } });
281
+ /**
282
+ * Possible attendance statuses for the event.
283
+ */
284
+ var EventAttendance;
285
+ (function (EventAttendance) {
286
+ EventAttendance[EventAttendance["DECLINED"] = -1] = "DECLINED";
287
+ EventAttendance[EventAttendance["NEEDS_ACTION"] = 0] = "NEEDS_ACTION";
288
+ EventAttendance[EventAttendance["TENTATIVE"] = 1] = "TENTATIVE";
289
+ EventAttendance[EventAttendance["ACCEPTED"] = 2] = "ACCEPTED";
290
+ })(EventAttendance || (EventAttendance = {}));
291
+
292
+ const { Browser } = Plugins;
293
+ /**
294
+ * Note: to test locally, you need to temporarily change the redirect URI:
295
+ * - in the lambda `idea_calendars`, e.g. `SCARLETT_URL`;
296
+ * - in the client config file: `APP_URL`.
297
+ * In both cases, the value should be set to `http://localhost:8100` (or according to the local URL).
298
+ */
299
+ class IDEACalendarsService {
300
+ constructor(modalCtrl, alertCtrl, message, loading, API, t) {
301
+ this.modalCtrl = modalCtrl;
302
+ this.alertCtrl = alertCtrl;
303
+ this.message = message;
304
+ this.loading = loading;
305
+ this.API = API;
306
+ this.t = t;
307
+ }
308
+ /**
309
+ * Get the ion-icon of an external service from its name.
310
+ */
311
+ getServiceIcon(service) {
312
+ switch (service) {
313
+ case ExternalCalendarSources.GOOGLE:
314
+ return 'logo-google';
315
+ case ExternalCalendarSources.MICROSOFT:
316
+ return 'logo-windows';
317
+ default:
318
+ return 'help';
319
+ }
320
+ }
321
+ /**
322
+ * Get the base URL for API request (shared/private calendar).
323
+ */
324
+ getRequestURL(calendar) {
325
+ return (calendar.teamId ? `teams/${calendar.teamId}/` : '').concat('calendars');
326
+ }
327
+ /**
328
+ * Create a new calendar.
329
+ */
330
+ postCalendar(cal) {
331
+ return new Promise((resolve, reject) => {
332
+ this.API.postResource(this.getRequestURL(cal), { idea: true, body: cal })
333
+ .then((res) => resolve(new Calendar(res)))
334
+ .catch(err => reject(err));
335
+ });
336
+ }
337
+ /**
338
+ * Update an existing calendar.
339
+ */
340
+ putCalendar(cal) {
341
+ return new Promise((resolve, reject) => {
342
+ this.API.putResource(this.getRequestURL(cal), { idea: true, resourceId: cal.calendarId, body: cal })
343
+ .then((res) => resolve(new Calendar(res)))
344
+ .catch(err => reject(err));
345
+ });
346
+ }
347
+ /**
348
+ * Delete a calendar.
349
+ */
350
+ deleteCalendar(cal) {
351
+ return new Promise((resolve, reject) => {
352
+ this.API.deleteResource(this.getRequestURL(cal), { idea: true, resourceId: cal.calendarId })
353
+ .then(() => resolve())
354
+ .catch(err => reject(err));
355
+ });
356
+ }
357
+ /**
358
+ * Associate an external calendar with the given calendar.
359
+ */
360
+ setExternalCalendar(cal, externalId) {
361
+ return new Promise((resolve, reject) => {
362
+ this.API.patchResource(this.getRequestURL(cal), {
363
+ idea: true,
364
+ resourceId: cal.calendarId,
365
+ body: { action: 'SET_EXTERNAL_CALENDAR', externalId }
366
+ })
367
+ .then(res => resolve(new Calendar(res)))
368
+ .catch(err => reject(err));
369
+ });
370
+ }
371
+ /**
372
+ * Link the calendar with the chosen external service (auth flow).
373
+ */
374
+ linkExtService(cal) {
375
+ return new Promise((resolve, reject) => {
376
+ if (!cal.external)
377
+ return reject(new Error('NOT_EXTERNAL'));
378
+ let url;
379
+ switch (cal.external.service) {
380
+ case ExternalCalendarSources.GOOGLE:
381
+ url =
382
+ 'https://accounts.google.com/o/oauth2/v2/auth?' +
383
+ `client_id=${encodeURIComponent(environment.google.apiClientId)}` +
384
+ '&response_type=code' +
385
+ `&redirect_uri=${encodeURIComponent(environment.idea.app.url.concat('/echo/google-calendars-integration'))}` +
386
+ '&include_granted_scopes=true' +
387
+ '&access_type=offline&prompt=consent' +
388
+ `&scope=${encodeURIComponent(environment.google.apiScope)}` +
389
+ `&state=${encodeURIComponent(cal.calendarId)}`;
390
+ break;
391
+ case ExternalCalendarSources.MICROSOFT:
392
+ url =
393
+ 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize?' +
394
+ `client_id=${encodeURIComponent(environment.microsoft.apiClientId)}` +
395
+ '&response_type=code' +
396
+ `&redirect_uri=${encodeURIComponent(environment.idea.app.url.concat('/echo/microsoft-calendars-integration'))}` +
397
+ '&response_mode=query' +
398
+ `&scope=${encodeURIComponent(environment.microsoft.apiScope)}` +
399
+ `&state=${encodeURIComponent(cal.calendarId)}`;
400
+ break;
401
+ }
402
+ if (!url)
403
+ return reject(new Error('INVALID_SERVICE'));
404
+ // start the auth flow in the browser
405
+ Browser.open({ url }).then(() => {
406
+ // since we don't know when/if the auth flow will finish, we wait
407
+ this.alertCtrl
408
+ .create({
409
+ header: this.t._('IDEA_AGENDA.CALENDARS.LINKING_CALENDAR'),
410
+ message: this.t._('IDEA_AGENDA.CALENDARS.LINKING_CALENDAR_CONFIRM_ONCE_DONE'),
411
+ backdropDismiss: false,
412
+ buttons: [{ text: this.t._('COMMON.DONE'), handler: () => resolve() }]
413
+ })
414
+ .then(alert => alert.present());
415
+ });
416
+ });
417
+ }
418
+ /**
419
+ * Get the external calendars list of the external service.
420
+ */
421
+ getExternalCalendars(cal) {
422
+ return new Promise((resolve, reject) => {
423
+ if (!cal.external)
424
+ return reject(new Error('NOT_EXTERNAL'));
425
+ // get the access token to make requests; in case it fails, proceed to link the external service
426
+ this.API.patchResource(this.getRequestURL(cal), {
427
+ idea: true,
428
+ resourceId: cal.calendarId,
429
+ body: { action: 'GET_ACCESS_TOKEN' }
430
+ })
431
+ .then((result) => {
432
+ // prepare the headers (authorization) for the request to the external service
433
+ const headers = { Authorization: 'Bearer '.concat(result.token) };
434
+ // acquire and return the calendars
435
+ switch (cal.external.service) {
436
+ case ExternalCalendarSources.GOOGLE:
437
+ this.API.rawRequest()
438
+ .get('https://www.googleapis.com/calendar/v3/users/me/calendarList', { headers })
439
+ .toPromise()
440
+ .then((res) => resolve(res.items.map((c) => ({ name: c.summary, id: c.id }))))
441
+ .catch(err => reject(err));
442
+ break;
443
+ case ExternalCalendarSources.MICROSOFT:
444
+ this.API.rawRequest()
445
+ .get('https://graph.microsoft.com/v1.0/me/calendars', { headers })
446
+ .toPromise()
447
+ .then((res) => resolve(res.value.map((c) => ({ name: c.name, id: c.id }))))
448
+ .catch(err => reject(err));
449
+ break;
450
+ }
451
+ })
452
+ .catch(err => reject(err));
453
+ });
454
+ }
455
+ /**
456
+ * If the external service is linked, choose an external calendar and set it for the chosen calendar.
457
+ * @return the updated calendar.
458
+ */
459
+ chooseAndSetExternalCalendar(cal) {
460
+ return new Promise((resolve, reject) => {
461
+ this.openModalAndPickExternalCalendar(cal)
462
+ .then(extCalId => {
463
+ // the external calendar will be set later on
464
+ if (!extCalId)
465
+ return resolve(null);
466
+ // an external calendar was chosen: set it right away
467
+ this.setExternalCalendar(cal, extCalId)
468
+ .then(res => resolve(res))
469
+ .catch(err => reject(err));
470
+ })
471
+ .catch(err => reject(err));
472
+ });
473
+ }
474
+ /**
475
+ * Open the modal to pick a calendar from the external service.
476
+ * @return the id of the external calendar.
477
+ */
478
+ async openModalAndPickExternalCalendar(cal) {
479
+ await this.loading.show();
480
+ return new Promise((resolve, reject) => {
481
+ this.getExternalCalendars(cal)
482
+ .then((extCals) => {
483
+ if (!extCals.length)
484
+ return reject(new Error('NO_EXTERNAL_CALENDARS'));
485
+ // let the user to choose the external calendar to associate
486
+ this.modalCtrl
487
+ .create({
488
+ component: IDEASuggestionsComponent,
489
+ componentProps: {
490
+ data: extCals.map(c => new Suggestion({ value: c.id, name: c.name })),
491
+ searchPlaceholder: this.t._('IDEA_AGENDA.CALENDARS.CHOOSE_AN_EXTERNAL_CALENDAR_TO_LINK'),
492
+ sortData: true,
493
+ hideIdFromUI: true,
494
+ hideClearButton: true,
495
+ mustChoose: true
496
+ },
497
+ backdropDismiss: false
498
+ })
499
+ .then(modal => {
500
+ modal.onDidDismiss().then(res => resolve(res.data ? res.data.value : null));
501
+ modal.present();
502
+ });
503
+ })
504
+ .catch(err => reject(err))
505
+ .finally(() => this.loading.hide());
506
+ });
507
+ }
508
+ /**
509
+ * First sync of the extenal calendar.
510
+ */
511
+ syncCalendar(cal) {
512
+ return new Promise((resolve, reject) => this.syncCalendarHelper(cal, err => (err ? reject(err) : resolve())));
513
+ }
514
+ /**
515
+ * Helper to recursively sync an the extenal calendar.
516
+ */
517
+ syncCalendarHelper(cal, done) {
518
+ // this is a recursive operation: the API returns if the sync has to continue or it finished
519
+ this.API.patchResource(this.getRequestURL(cal), {
520
+ idea: true,
521
+ resourceId: cal.calendarId,
522
+ body: { action: 'SYNC_EXTERNAL_CALENDAR', firstSync: true }
523
+ })
524
+ .then((res) => {
525
+ if (res.moreData)
526
+ this.syncCalendarHelper(cal, done);
527
+ else
528
+ done();
529
+ })
530
+ .catch(err => done(err));
531
+ }
532
+ }
533
+ IDEACalendarsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: IDEACalendarsService, deps: [{ token: i2.ModalController }, { token: i2.AlertController }, { token: i3.IDEAMessageService }, { token: i3.IDEALoadingService }, { token: i3.IDEAAWSAPIService }, { token: i3.IDEATranslationsService }], target: i0.ɵɵFactoryTarget.Injectable });
534
+ IDEACalendarsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: IDEACalendarsService });
535
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: IDEACalendarsService, decorators: [{
536
+ type: Injectable
537
+ }], ctorParameters: function () { return [{ type: i2.ModalController }, { type: i2.AlertController }, { type: i3.IDEAMessageService }, { type: i3.IDEALoadingService }, { type: i3.IDEAAWSAPIService }, { type: i3.IDEATranslationsService }]; } });
538
+
539
+ class IDEACalendarComponent {
540
+ constructor(calendars, modalCtrl, alertCtrl, tc, loading, message, API, t) {
541
+ this.calendars = calendars;
542
+ this.modalCtrl = modalCtrl;
543
+ this.alertCtrl = alertCtrl;
544
+ this.tc = tc;
545
+ this.loading = loading;
546
+ this.message = message;
547
+ this.API = API;
548
+ this.t = t;
549
+ /**
550
+ * Errors while validating the entity.
551
+ */
552
+ this.errors = new Set();
553
+ /**
554
+ * The default color for a calendar.
555
+ */
556
+ this.DEFAULT_COLOR = '#555';
557
+ }
558
+ ngOnInit() {
559
+ this.membership = this.tc.get('membership');
560
+ // work on a copy
561
+ this._calendar = new Calendar(this.calendar);
562
+ // load the teammates to use for shared calendars permissions
563
+ this.API.getResource(`teams/${this.membership.teamId}/memberships`)
564
+ .then((memberships) => (this.membershipsChecks = memberships.map(m => new Check({
565
+ value: m.userId,
566
+ name: m.name,
567
+ checked: (this._calendar.usersCanManageAppointments || []).some(x => x === m.userId)
568
+ }))))
569
+ .catch(() => { });
570
+ }
571
+ /**
572
+ * Set the support array to display errors in the UI.
573
+ */
574
+ hasFieldAnError(field) {
575
+ return this.errors.has(field);
576
+ }
577
+ /**
578
+ * Save a calendar with the new info.
579
+ */
580
+ async save() {
581
+ // set the default color, in case none was selected
582
+ if (!this._calendar.color)
583
+ this._calendar.color = this.DEFAULT_COLOR;
584
+ // map the memberships able to manage appointments
585
+ if (this._calendar.isShared() && this.advancedPermissions)
586
+ this._calendar.usersCanManageAppointments = this.membershipsChecks
587
+ .filter(x => x.checked)
588
+ .map(x => String(x.value));
589
+ else
590
+ delete this._calendar.usersCanManageAppointments;
591
+ // checkings
592
+ this.errors = new Set(this._calendar.validate());
593
+ if (this.errors.size)
594
+ return this.message.error('COMMON.FORM_HAS_ERROR_TO_CHECK');
595
+ // send a put request
596
+ await this.loading.show();
597
+ this.calendars
598
+ .putCalendar(this._calendar)
599
+ .then((res) => {
600
+ this.calendar.load(res);
601
+ this.message.success('IDEA_AGENDA.CALENDARS.CALENDAR_SAVED');
602
+ this.modalCtrl.dismiss(this.calendar);
603
+ })
604
+ .catch(() => this.message.error('COMMON.OPERATION_FAILED'))
605
+ .finally(() => this.loading.hide());
606
+ }
607
+ /**
608
+ * Delete the calendar.
609
+ */
610
+ delete() {
611
+ this.alertCtrl
612
+ .create({
613
+ header: this.t._('COMMON.ARE_YOU_SURE'),
614
+ subHeader: this.t._('IDEA_AGENDA.CALENDARS.DELETE_CALENDAR'),
615
+ message: this.t._('IDEA_AGENDA.CALENDARS.DELETE_CALENDAR_HINT'),
616
+ buttons: [
617
+ { text: this.t._('COMMON.CANCEL'), role: 'cancel' },
618
+ {
619
+ text: this.t._('COMMON.DELETE'),
620
+ handler: async () => {
621
+ await this.loading.show();
622
+ this.calendars
623
+ .deleteCalendar(this._calendar)
624
+ .then(() => {
625
+ this.message.success('IDEA_AGENDA.CALENDARS.CALENDAR_DELETED');
626
+ this.modalCtrl.dismiss(true);
627
+ })
628
+ .catch(() => this.message.error('COMMON.OPERATION_FAILED'))
629
+ .finally(() => this.loading.hide());
630
+ }
631
+ }
632
+ ]
633
+ })
634
+ .then(alert => alert.present());
635
+ }
636
+ /**
637
+ * Close the component.
638
+ */
639
+ close() {
640
+ this.modalCtrl.dismiss();
641
+ }
642
+ }
643
+ IDEACalendarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: IDEACalendarComponent, deps: [{ token: IDEACalendarsService }, { token: i2.ModalController }, { token: i2.AlertController }, { token: i3.IDEATinCanService }, { token: i3.IDEALoadingService }, { token: i3.IDEAMessageService }, { token: i3.IDEAAWSAPIService }, { token: i3.IDEATranslationsService }], target: i0.ɵɵFactoryTarget.Component });
644
+ IDEACalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: IDEACalendarComponent, selector: "idea-calendar", inputs: { calendar: "calendar", advancedPermissions: "advancedPermissions", hideColor: "hideColor" }, ngImport: i0, template: "<ion-header>\n <ion-toolbar color=\"ideaToolbar\">\n <ion-buttons slot=\"start\">\n <ion-button [title]=\"t._('COMMON.CLOSE')\" (click)=\"close()\">\n <ion-icon name=\"close-circle\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n </ion-buttons>\n <ion-title>{{ 'IDEA_AGENDA.CALENDARS.EDIT_CALENDAR' | translate }}</ion-title>\n <ion-buttons slot=\"end\">\n <ion-button [title]=\"t._('COMMON.SAVE')\" (click)=\"save()\">\n <ion-icon name=\"checkmark-circle\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n </ion-buttons>\n </ion-toolbar>\n</ion-header>\n<ion-content>\n <div class=\"maxWidthContainer\" *ngIf=\"_calendar\">\n <ion-list class=\"aList\">\n <ion-item\n lines=\"inset\"\n [class.fieldHasError]=\"hasFieldAnError('name')\"\n [title]=\"t._('IDEA_AGENDA.CALENDARS.NAME_HINT')\"\n >\n <ion-label position=\"stacked\">{{ 'IDEA_AGENDA.CALENDARS.NAME' | translate }} </ion-label>\n <ion-input [placeholder]=\"t._('IDEA_AGENDA.CALENDARS.NAME_HINT')\" [(ngModel)]=\"_calendar.name\"></ion-input>\n </ion-item>\n <ion-item\n lines=\"inset\"\n [class.fieldHasError]=\"hasFieldAnError('description')\"\n [title]=\"t._('IDEA_AGENDA.CALENDARS.DESCRIPTION_HINT')\"\n >\n <ion-label position=\"stacked\">{{ 'IDEA_AGENDA.CALENDARS.DESCRIPTION' | translate }} </ion-label>\n <ion-input\n [placeholder]=\"t._('IDEA_AGENDA.CALENDARS.DESCRIPTION_HINT')\"\n [(ngModel)]=\"_calendar.description\"\n ></ion-input>\n </ion-item>\n <idea-color-picker\n *ngIf=\"!hideColor\"\n [lines]=\"'inset'\"\n [current]=\"_calendar.color\"\n [label]=\"t._('IDEA_AGENDA.CALENDARS.COLOR')\"\n [class.fieldHasError]=\"hasFieldAnError('color')\"\n (select)=\"$event ? (_calendar.color = $event) : null\"\n ></idea-color-picker>\n <idea-checker\n *ngIf=\"membershipsChecks && _calendar.isShared() && advancedPermissions\"\n [data]=\"membershipsChecks\"\n [label]=\"t._('IDEA_AGENDA.CALENDARS.USERS_ALLOWED_TO_MANAGE_APPOINTMENTS')\"\n [searchPlaceholder]=\"t._('IDEA_AGENDA.CALENDARS.WHO_CAN_MANAGE_APPOINTMENTS')\"\n [noneText]=\"t._('IDEA_AGENDA.CALENDARS.NOBODY')\"\n [allText]=\"t._('IDEA_AGENDA.CALENDARS.EVERYONE')\"\n [allowSelectDeselectAll]=\"true\"\n [lines]=\"'inset'\"\n ></idea-checker>\n </ion-list>\n <ion-list class=\"aList\" *ngIf=\"_calendar.external?.service\">\n <ion-list-header>\n <ion-label>\n <h2>{{ 'IDEA_AGENDA.CALENDARS.INFO_ON_CALENDAR' | translate }}</h2>\n </ion-label>\n </ion-list-header>\n <ion-item lines=\"inset\" *ngIf=\"calendar.userId\">\n <ion-label>\n {{ 'IDEA_AGENDA.CALENDARS.PRIVATE_CALENDAR' | translate }}\n <p>{{ 'IDEA_AGENDA.CALENDARS.PRIVATE_CALENDAR_HINT' | translate }}</p>\n </ion-label>\n <ion-icon slot=\"end\" name=\"person\"></ion-icon>\n </ion-item>\n <ion-item lines=\"inset\" *ngIf=\"calendar.teamId\">\n <ion-label>\n {{ 'IDEA_AGENDA.CALENDARS.TEAM_CALENDAR' | translate }}\n <p>{{ 'IDEA_AGENDA.CALENDARS.TEAM_CALENDAR_HINT' | translate }}</p>\n </ion-label>\n <ion-icon slot=\"end\" name=\"people\"></ion-icon>\n </ion-item>\n <ion-item lines=\"inset\">\n <ion-label>\n {{ 'IDEA_AGENDA.CALENDARS.LINKED_TO' | translate }}\n {{ 'IDEA_AGENDA.CALENDARS.SERVICES.' + _calendar.external.service | translate }}\n <p>{{ _calendar.external.name }} ({{ _calendar.external.email }})</p>\n </ion-label>\n <ion-icon slot=\"end\" [name]=\"calendars.getServiceIcon(_calendar.external.service)\"></ion-icon>\n </ion-item>\n <ion-item lines=\"inset\">\n <ion-label>\n {{ 'IDEA_AGENDA.CALENDARS.ACCESS_LEVELS.' + _calendar.external.userAccess | translate }}\n <p>{{ 'IDEA_AGENDA.CALENDARS.BASED_ON_EXTERNAL_SERVICE_SHARING_PERMISSION' | translate }}</p>\n </ion-label>\n <ion-icon slot=\"end\" name=\"shield\"></ion-icon>\n </ion-item>\n </ion-list>\n <ion-list class=\"aList\">\n <ion-list-header>\n <ion-label color=\"danger\">\n <h2>{{ 'IDEA_AGENDA.CALENDARS.DANGEROUS_ZONE' | translate }}</h2>\n </ion-label>\n </ion-list-header>\n <ion-item lines=\"inset\">\n <ion-label class=\"ion-text-wrap\">\n {{ 'IDEA_AGENDA.CALENDARS.DELETE_CALENDAR' | translate }}\n <p>{{ 'IDEA_AGENDA.CALENDARS.DELETE_CALENDAR_HINT' | translate }}</p>\n </ion-label>\n <ion-button color=\"danger\" [title]=\"t._('IDEA_AGENDA.CALENDARS.DELETE_CALENDAR_HINT')\" (click)=\"delete()\">\n {{ 'COMMON.DELETE' | translate }}\n </ion-button>\n </ion-item>\n </ion-list>\n </div>\n</ion-content>\n", styles: [".maxWidthContainer{max-width:500px;padding-top:20px}\n"], components: [{ type: i2.IonHeader, selector: "ion-header", inputs: ["collapse", "mode", "translucent"] }, { type: i2.IonToolbar, selector: "ion-toolbar", inputs: ["color", "mode"] }, { type: i2.IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { type: i2.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { type: i2.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { type: i2.IonTitle, selector: "ion-title", inputs: ["color", "size"] }, { type: i2.IonContent, selector: "ion-content", inputs: ["color", "forceOverscroll", "fullscreen", "scrollEvents", "scrollX", "scrollY"] }, { type: i2.IonList, selector: "ion-list", inputs: ["inset", "lines", "mode"] }, { type: i2.IonItem, selector: "ion-item", inputs: ["button", "color", "counter", "detail", "detailIcon", "disabled", "download", "fill", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "shape", "target", "type"] }, { type: i2.IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { type: i2.IonInput, selector: "ion-input", inputs: ["accept", "autocapitalize", "autocomplete", "autocorrect", "autofocus", "clearInput", "clearOnEdit", "color", "debounce", "disabled", "enterkeyhint", "inputmode", "max", "maxlength", "min", "minlength", "mode", "multiple", "name", "pattern", "placeholder", "readonly", "required", "size", "spellcheck", "step", "type", "value"] }, { type: i3.IDEAColorPickerComponent, selector: "idea-color-picker", inputs: ["colors", "current", "label", "placeholder", "icon", "iconColor", "disabled", "obligatory", "lines"], outputs: ["select", "iconSelect"] }, { type: i3.IDEACheckerComponent, selector: "idea-checker", inputs: ["data", "dataProvider", "label", "icon", "iconColor", "searchPlaceholder", "noPreviewText", "noElementsFoundText", "noneEqualsAll", "noneText", "allText", "lines", "disabled", "tappableWhenDisabled", "obligatory", "sortData", "numMaxElementsInPreview", "showAvatars", "fallbackAvatar", "limitSelectionToNum", "allowSelectDeselectAll"], outputs: ["change", "iconSelect"] }, { type: i2.IonListHeader, selector: "ion-list-header", inputs: ["color", "lines", "mode"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.TextValueAccessor, selector: "ion-input:not([type=number]),ion-textarea,ion-searchbar" }, { type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "translate": i3.IDEATranslatePipe } });
645
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: IDEACalendarComponent, decorators: [{
646
+ type: Component,
647
+ args: [{ selector: 'idea-calendar', template: "<ion-header>\n <ion-toolbar color=\"ideaToolbar\">\n <ion-buttons slot=\"start\">\n <ion-button [title]=\"t._('COMMON.CLOSE')\" (click)=\"close()\">\n <ion-icon name=\"close-circle\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n </ion-buttons>\n <ion-title>{{ 'IDEA_AGENDA.CALENDARS.EDIT_CALENDAR' | translate }}</ion-title>\n <ion-buttons slot=\"end\">\n <ion-button [title]=\"t._('COMMON.SAVE')\" (click)=\"save()\">\n <ion-icon name=\"checkmark-circle\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n </ion-buttons>\n </ion-toolbar>\n</ion-header>\n<ion-content>\n <div class=\"maxWidthContainer\" *ngIf=\"_calendar\">\n <ion-list class=\"aList\">\n <ion-item\n lines=\"inset\"\n [class.fieldHasError]=\"hasFieldAnError('name')\"\n [title]=\"t._('IDEA_AGENDA.CALENDARS.NAME_HINT')\"\n >\n <ion-label position=\"stacked\">{{ 'IDEA_AGENDA.CALENDARS.NAME' | translate }} </ion-label>\n <ion-input [placeholder]=\"t._('IDEA_AGENDA.CALENDARS.NAME_HINT')\" [(ngModel)]=\"_calendar.name\"></ion-input>\n </ion-item>\n <ion-item\n lines=\"inset\"\n [class.fieldHasError]=\"hasFieldAnError('description')\"\n [title]=\"t._('IDEA_AGENDA.CALENDARS.DESCRIPTION_HINT')\"\n >\n <ion-label position=\"stacked\">{{ 'IDEA_AGENDA.CALENDARS.DESCRIPTION' | translate }} </ion-label>\n <ion-input\n [placeholder]=\"t._('IDEA_AGENDA.CALENDARS.DESCRIPTION_HINT')\"\n [(ngModel)]=\"_calendar.description\"\n ></ion-input>\n </ion-item>\n <idea-color-picker\n *ngIf=\"!hideColor\"\n [lines]=\"'inset'\"\n [current]=\"_calendar.color\"\n [label]=\"t._('IDEA_AGENDA.CALENDARS.COLOR')\"\n [class.fieldHasError]=\"hasFieldAnError('color')\"\n (select)=\"$event ? (_calendar.color = $event) : null\"\n ></idea-color-picker>\n <idea-checker\n *ngIf=\"membershipsChecks && _calendar.isShared() && advancedPermissions\"\n [data]=\"membershipsChecks\"\n [label]=\"t._('IDEA_AGENDA.CALENDARS.USERS_ALLOWED_TO_MANAGE_APPOINTMENTS')\"\n [searchPlaceholder]=\"t._('IDEA_AGENDA.CALENDARS.WHO_CAN_MANAGE_APPOINTMENTS')\"\n [noneText]=\"t._('IDEA_AGENDA.CALENDARS.NOBODY')\"\n [allText]=\"t._('IDEA_AGENDA.CALENDARS.EVERYONE')\"\n [allowSelectDeselectAll]=\"true\"\n [lines]=\"'inset'\"\n ></idea-checker>\n </ion-list>\n <ion-list class=\"aList\" *ngIf=\"_calendar.external?.service\">\n <ion-list-header>\n <ion-label>\n <h2>{{ 'IDEA_AGENDA.CALENDARS.INFO_ON_CALENDAR' | translate }}</h2>\n </ion-label>\n </ion-list-header>\n <ion-item lines=\"inset\" *ngIf=\"calendar.userId\">\n <ion-label>\n {{ 'IDEA_AGENDA.CALENDARS.PRIVATE_CALENDAR' | translate }}\n <p>{{ 'IDEA_AGENDA.CALENDARS.PRIVATE_CALENDAR_HINT' | translate }}</p>\n </ion-label>\n <ion-icon slot=\"end\" name=\"person\"></ion-icon>\n </ion-item>\n <ion-item lines=\"inset\" *ngIf=\"calendar.teamId\">\n <ion-label>\n {{ 'IDEA_AGENDA.CALENDARS.TEAM_CALENDAR' | translate }}\n <p>{{ 'IDEA_AGENDA.CALENDARS.TEAM_CALENDAR_HINT' | translate }}</p>\n </ion-label>\n <ion-icon slot=\"end\" name=\"people\"></ion-icon>\n </ion-item>\n <ion-item lines=\"inset\">\n <ion-label>\n {{ 'IDEA_AGENDA.CALENDARS.LINKED_TO' | translate }}\n {{ 'IDEA_AGENDA.CALENDARS.SERVICES.' + _calendar.external.service | translate }}\n <p>{{ _calendar.external.name }} ({{ _calendar.external.email }})</p>\n </ion-label>\n <ion-icon slot=\"end\" [name]=\"calendars.getServiceIcon(_calendar.external.service)\"></ion-icon>\n </ion-item>\n <ion-item lines=\"inset\">\n <ion-label>\n {{ 'IDEA_AGENDA.CALENDARS.ACCESS_LEVELS.' + _calendar.external.userAccess | translate }}\n <p>{{ 'IDEA_AGENDA.CALENDARS.BASED_ON_EXTERNAL_SERVICE_SHARING_PERMISSION' | translate }}</p>\n </ion-label>\n <ion-icon slot=\"end\" name=\"shield\"></ion-icon>\n </ion-item>\n </ion-list>\n <ion-list class=\"aList\">\n <ion-list-header>\n <ion-label color=\"danger\">\n <h2>{{ 'IDEA_AGENDA.CALENDARS.DANGEROUS_ZONE' | translate }}</h2>\n </ion-label>\n </ion-list-header>\n <ion-item lines=\"inset\">\n <ion-label class=\"ion-text-wrap\">\n {{ 'IDEA_AGENDA.CALENDARS.DELETE_CALENDAR' | translate }}\n <p>{{ 'IDEA_AGENDA.CALENDARS.DELETE_CALENDAR_HINT' | translate }}</p>\n </ion-label>\n <ion-button color=\"danger\" [title]=\"t._('IDEA_AGENDA.CALENDARS.DELETE_CALENDAR_HINT')\" (click)=\"delete()\">\n {{ 'COMMON.DELETE' | translate }}\n </ion-button>\n </ion-item>\n </ion-list>\n </div>\n</ion-content>\n", styles: [".maxWidthContainer{max-width:500px;padding-top:20px}\n"] }]
648
+ }], ctorParameters: function () { return [{ type: IDEACalendarsService }, { type: i2.ModalController }, { type: i2.AlertController }, { type: i3.IDEATinCanService }, { type: i3.IDEALoadingService }, { type: i3.IDEAMessageService }, { type: i3.IDEAAWSAPIService }, { type: i3.IDEATranslationsService }]; }, propDecorators: { calendar: [{
649
+ type: Input
650
+ }], advancedPermissions: [{
651
+ type: Input
652
+ }], hideColor: [{
653
+ type: Input
654
+ }] } });
655
+
656
+ class IDEACalendarItemComponent {
657
+ constructor(calendars, alertCtrl, modalCtrl, message, loading, t) {
658
+ this.calendars = calendars;
659
+ this.alertCtrl = alertCtrl;
660
+ this.modalCtrl = modalCtrl;
661
+ this.message = message;
662
+ this.loading = loading;
663
+ this.t = t;
664
+ /**
665
+ * Report to parent components a change.
666
+ */
667
+ this.somethingChanged = new EventEmitter();
668
+ }
669
+ /**
670
+ * Open the modal to manage the calendar.
671
+ */
672
+ manageCalendar() {
673
+ if (this.disabled)
674
+ return;
675
+ this.modalCtrl
676
+ .create({
677
+ component: IDEACalendarComponent,
678
+ componentProps: {
679
+ calendar: this.calendar,
680
+ advancedPermissions: this.advancedPermissions,
681
+ hideColor: this.hideColor
682
+ }
683
+ })
684
+ .then(modal => {
685
+ modal.onDidDismiss().then(res => {
686
+ const cal = res.data;
687
+ // nothing changed
688
+ if (cal === undefined)
689
+ return;
690
+ // the calendar was deleted
691
+ else if (cal === null)
692
+ this.calendar = null;
693
+ // the calendar was updated
694
+ else
695
+ this.calendar.load(cal);
696
+ // report changes to parent components
697
+ this.somethingChanged.emit();
698
+ });
699
+ modal.present();
700
+ });
701
+ }
702
+ /**
703
+ * Continue the auth flow to link an external service and set an external calendar;
704
+ * otherwise, the calendar can be deleted.
705
+ */
706
+ linkExtCalendarOrDelete() {
707
+ if (this.disabled)
708
+ return;
709
+ // let the user pick an external calendar, in case the external service is linked
710
+ this.calendars
711
+ .chooseAndSetExternalCalendar(this.calendar)
712
+ .then(async (cal) => {
713
+ if (!cal)
714
+ return new Error('NO_EXTERNAL_CALENDAR_CHOSEN');
715
+ this.calendar.load(cal);
716
+ this.message.success('IDEA_AGENDA.CALENDARS.CALENDAR_LINKED');
717
+ // run a first sync for the linked external calendar
718
+ await this.loading.show(this.t._('IDEA_AGENDA.CALENDARS.FIRST_SYNC_MAY_TAKE_A_WHILE'));
719
+ this.calendars
720
+ .syncCalendar(this.calendar)
721
+ .then(() => this.message.success('IDEA_AGENDA.CALENDARS.FIRST_SYNC_COMPLETED'))
722
+ .catch(() => this.message.error('COMMON.OPERATION_FAILED'))
723
+ .finally(() => {
724
+ this.loading.hide();
725
+ // report changes to parent components
726
+ this.somethingChanged.emit();
727
+ });
728
+ })
729
+ .catch(() => {
730
+ // the external service isn't linked yet (we don't have a token): link or delete
731
+ this.alertCtrl
732
+ .create({
733
+ header: this.t._('IDEA_AGENDA.CALENDARS.CALENDAR_NOT_YET_LINKED'),
734
+ message: this.t._('IDEA_AGENDA.CALENDARS.DO_YOU_WANT_PROCEED_LINKING_OR_DELETE'),
735
+ buttons: [
736
+ {
737
+ text: this.t._('COMMON.DELETE'),
738
+ handler: async () => {
739
+ // request the calendar deletion
740
+ await this.loading.show();
741
+ this.calendars
742
+ .deleteCalendar(this.calendar)
743
+ .then(() => {
744
+ this.message.success('COMMON.OPERATION_COMPLETED');
745
+ // report changes to parent components
746
+ this.somethingChanged.emit();
747
+ })
748
+ .catch(() => this.message.error('COMMON.OPERATION_FAILED'))
749
+ .finally(() => this.loading.hide());
750
+ }
751
+ },
752
+ {
753
+ text: this.t._('IDEA_AGENDA.CALENDARS.LINK'),
754
+ handler: () =>
755
+ // try again to link the service
756
+ this.calendars
757
+ .linkExtService(this.calendar)
758
+ // if the service was successfully linked, go recursive to choose and set the external calendar
759
+ .then(() => this.linkExtCalendarOrDelete())
760
+ .catch(() => this.message.error('COMMON.OPERATION_FAILED'))
761
+ }
762
+ ]
763
+ })
764
+ .then(alert => alert.present());
765
+ });
766
+ }
767
+ }
768
+ IDEACalendarItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: IDEACalendarItemComponent, deps: [{ token: IDEACalendarsService }, { token: i2.AlertController }, { token: i2.ModalController }, { token: i3.IDEAMessageService }, { token: i3.IDEALoadingService }, { token: i3.IDEATranslationsService }], target: i0.ɵɵFactoryTarget.Component });
769
+ IDEACalendarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: IDEACalendarItemComponent, selector: "idea-calendar-item", inputs: { calendar: "calendar", disabled: "disabled", advancedPermissions: "advancedPermissions", hideColor: "hideColor" }, outputs: { somethingChanged: "somethingChanged" }, ngImport: i0, template: "<ion-item\n class=\"calendarItem\"\n *ngIf=\"calendar\"\n [button]=\"!disabled\"\n [title]=\"t._('IDEA_AGENDA.CALENDARS.EDIT_CALENDAR')\"\n (click)=\"calendar.external && !calendar.external.calendarId ? linkExtCalendarOrDelete() : manageCalendar()\"\n>\n <ion-avatar\n slot=\"start\"\n class=\"colorCircle\"\n *ngIf=\"!hideColor\"\n [style.background-color]=\"calendar.color\"\n ></ion-avatar>\n <ion-label>\n {{ calendar.name }}\n <p>\n <ion-text color=\"danger\" *ngIf=\"calendar.external && !calendar.external.calendarId\">\n {{ 'IDEA_AGENDA.CALENDARS.TAP_TO_CONFIGURE' | translate }}\n </ion-text>\n {{ calendar.description }}\n </p>\n </ion-label>\n <ion-icon\n slot=\"end\"\n color=\"danger\"\n name=\"flash-off\"\n *ngIf=\"calendar.external && !calendar.external.calendarId\"\n [title]=\"t._('IDEA_AGENDA.CALENDARS.CALENDAR_NOT_YET_LINKED_HINT')\"\n ></ion-icon>\n <ion-icon\n slot=\"end\"\n *ngIf=\"calendar.external?.service\"\n [name]=\"calendars.getServiceIcon(calendar.external.service)\"\n [title]=\"\n t._('IDEA_AGENDA.CALENDARS.LINKED_TO') + ' ' + t._('IDEA_AGENDA.CALENDARS.SERVICES.' + calendar.external.service)\n \"\n ></ion-icon>\n</ion-item>\n", styles: [".calendarItem ion-avatar.colorCircle{width:20px;height:20px;background-color:#555}\n"], components: [{ type: i2.IonItem, selector: "ion-item", inputs: ["button", "color", "counter", "detail", "detailIcon", "disabled", "download", "fill", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "shape", "target", "type"] }, { type: i2.IonAvatar, selector: "ion-avatar" }, { type: i2.IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { type: i2.IonText, selector: "ion-text", inputs: ["color", "mode"] }, { type: i2.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i3.IDEATranslatePipe } });
770
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: IDEACalendarItemComponent, decorators: [{
771
+ type: Component,
772
+ args: [{ selector: 'idea-calendar-item', template: "<ion-item\n class=\"calendarItem\"\n *ngIf=\"calendar\"\n [button]=\"!disabled\"\n [title]=\"t._('IDEA_AGENDA.CALENDARS.EDIT_CALENDAR')\"\n (click)=\"calendar.external && !calendar.external.calendarId ? linkExtCalendarOrDelete() : manageCalendar()\"\n>\n <ion-avatar\n slot=\"start\"\n class=\"colorCircle\"\n *ngIf=\"!hideColor\"\n [style.background-color]=\"calendar.color\"\n ></ion-avatar>\n <ion-label>\n {{ calendar.name }}\n <p>\n <ion-text color=\"danger\" *ngIf=\"calendar.external && !calendar.external.calendarId\">\n {{ 'IDEA_AGENDA.CALENDARS.TAP_TO_CONFIGURE' | translate }}\n </ion-text>\n {{ calendar.description }}\n </p>\n </ion-label>\n <ion-icon\n slot=\"end\"\n color=\"danger\"\n name=\"flash-off\"\n *ngIf=\"calendar.external && !calendar.external.calendarId\"\n [title]=\"t._('IDEA_AGENDA.CALENDARS.CALENDAR_NOT_YET_LINKED_HINT')\"\n ></ion-icon>\n <ion-icon\n slot=\"end\"\n *ngIf=\"calendar.external?.service\"\n [name]=\"calendars.getServiceIcon(calendar.external.service)\"\n [title]=\"\n t._('IDEA_AGENDA.CALENDARS.LINKED_TO') + ' ' + t._('IDEA_AGENDA.CALENDARS.SERVICES.' + calendar.external.service)\n \"\n ></ion-icon>\n</ion-item>\n", styles: [".calendarItem ion-avatar.colorCircle{width:20px;height:20px;background-color:#555}\n"] }]
773
+ }], ctorParameters: function () { return [{ type: IDEACalendarsService }, { type: i2.AlertController }, { type: i2.ModalController }, { type: i3.IDEAMessageService }, { type: i3.IDEALoadingService }, { type: i3.IDEATranslationsService }]; }, propDecorators: { calendar: [{
774
+ type: Input
775
+ }], disabled: [{
776
+ type: Input
777
+ }], advancedPermissions: [{
778
+ type: Input
779
+ }], hideColor: [{
780
+ type: Input
781
+ }], somethingChanged: [{
782
+ type: Output
783
+ }] } });
784
+
785
+ class IDEACalendarCreationComponent {
786
+ constructor(calendars, modalCtrl, tc, loading, message, API, t) {
787
+ this.calendars = calendars;
788
+ this.modalCtrl = modalCtrl;
789
+ this.tc = tc;
790
+ this.loading = loading;
791
+ this.message = message;
792
+ this.API = API;
793
+ this.t = t;
794
+ /**
795
+ * The default color for a new calendar.
796
+ */
797
+ this.DEFAULT_COLOR = '#555';
798
+ /**
799
+ * The possible external services for the new calendar.
800
+ */
801
+ this.SOURCES = Object.keys(ExternalCalendarSources);
802
+ }
803
+ ngOnInit() {
804
+ this.calendar = new Calendar();
805
+ this.membership = this.tc.get('membership');
806
+ if (this.fixScope === CalendarScopes.SHARED)
807
+ this.calendar.teamId = this.membership.teamId;
808
+ if (this.fixScope === CalendarScopes.PRIVATE)
809
+ this.calendar.userId = this.membership.userId;
810
+ }
811
+ /**
812
+ * If allowed by the component configuration, reset the scope of the calendar (private/shared).
813
+ */
814
+ resetScope() {
815
+ if (this.canChangeScope())
816
+ this.calendar.teamId = this.calendar.userId = null;
817
+ }
818
+ /**
819
+ * Whether we can change the scope of the calendar (private/shared).
820
+ */
821
+ canChangeScope() {
822
+ return !this.fixScope && this.scopeIsSet();
823
+ }
824
+ /**
825
+ * Whether the scope has been set already.
826
+ */
827
+ scopeIsSet() {
828
+ return Boolean(this.calendar.userId) || Boolean(this.calendar.teamId);
829
+ }
830
+ /**
831
+ * Add a new calendar based on the configuration set.
832
+ */
833
+ async saveNewCalendar(service) {
834
+ // be sure the scope of the calendar was chosen
835
+ if (!this.scopeIsSet())
836
+ return;
837
+ // be sure we are allowed to create the calendar
838
+ if (!service && this.onlyExternalCalendars)
839
+ return;
840
+ // flag the calendar so it has to be linked to an externals service (the procedure follows the creation)
841
+ if (service) {
842
+ this.calendar.external = new ExternalCalendarInfo({ service });
843
+ this.calendar.name = '-'; // it will be substituted with the external name
844
+ }
845
+ else {
846
+ // default values for local calendars
847
+ this.calendar.name = this.calendar.userId
848
+ ? this.t._('IDEA_AGENDA.CALENDARS.DEFAULT_PERSONAL_CALENDAR_NAME')
849
+ : this.t._('IDEA_AGENDA.CALENDARS.DEFAULT_TEAM_CALENDAR_NAME');
850
+ this.calendar.color = this.DEFAULT_COLOR;
851
+ }
852
+ // save (create) the new calendar
853
+ await this.loading.show();
854
+ this.calendars
855
+ .postCalendar(this.calendar)
856
+ .then(cal => {
857
+ this.calendar.load(cal);
858
+ this.message.success('IDEA_AGENDA.CALENDARS.CALENDAR_CREATED');
859
+ // if the calendar is local, no further action is needed
860
+ if (!cal.external)
861
+ return this.modalCtrl.dismiss(this.calendar);
862
+ // if the calendar should be linked to an external service, proceed
863
+ this.calendars
864
+ .linkExtService(this.calendar)
865
+ // if the link was successful, let the user pick an external calendar to set
866
+ .then(() => this.calendars.chooseAndSetExternalCalendar(this.calendar))
867
+ .then(async (res) => {
868
+ // if a calendar wasn't set, it can be done later on
869
+ if (!res)
870
+ return this.modalCtrl.dismiss(this.calendar);
871
+ // if an external calendar was set, update the calendar
872
+ this.calendar.load(res);
873
+ // run a first sync for the linked external calendar
874
+ await this.loading.show(this.t._('IDEA_AGENDA.CALENDARS.FIRST_SYNC_MAY_TAKE_A_WHILE'));
875
+ this.calendars
876
+ .syncCalendar(this.calendar)
877
+ .then(() => this.message.success('IDEA_AGENDA.CALENDARS.FIRST_SYNC_COMPLETED'))
878
+ .catch(() => this.message.error('COMMON.OPERATION_FAILED'))
879
+ .finally(() => {
880
+ this.loading.hide();
881
+ // the calendar is ready to go
882
+ this.modalCtrl.dismiss(this.calendar);
883
+ });
884
+ })
885
+ .catch(() => {
886
+ this.message.error('COMMON.OPERATION_FAILED');
887
+ // the operation can be retried later on; close the modal anyway
888
+ this.modalCtrl.dismiss(this.calendar);
889
+ });
890
+ })
891
+ .catch(() => this.message.error('COMMON.OPERATION_FAILED'))
892
+ .finally(() => this.loading.hide());
893
+ }
894
+ /**
895
+ * Close the component.
896
+ */
897
+ close() {
898
+ this.modalCtrl.dismiss();
899
+ }
900
+ }
901
+ IDEACalendarCreationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: IDEACalendarCreationComponent, deps: [{ token: IDEACalendarsService }, { token: i2.ModalController }, { token: i3.IDEATinCanService }, { token: i3.IDEALoadingService }, { token: i3.IDEAMessageService }, { token: i3.IDEAAWSAPIService }, { token: i3.IDEATranslationsService }], target: i0.ɵɵFactoryTarget.Component });
902
+ IDEACalendarCreationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: IDEACalendarCreationComponent, selector: "idea-calendar-creation", inputs: { fixScope: "fixScope", onlyExternalCalendars: "onlyExternalCalendars" }, ngImport: i0, template: "<ion-header>\n <ion-toolbar color=\"ideaToolbar\">\n <ion-buttons slot=\"start\">\n <ion-button *ngIf=\"!canChangeScope()\" [title]=\"t._('COMMON.CLOSE')\" (click)=\"close()\">\n <ion-icon name=\"close\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n <ion-button *ngIf=\"canChangeScope()\" (click)=\"resetScope()\">\n <ion-icon name=\"arrow-back\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n </ion-buttons>\n <ion-title>\n <span *ngIf=\"!scopeIsSet()\">{{ 'IDEA_AGENDA.CALENDARS.ADD_A_CALENDAR' | translate }}</span>\n <span *ngIf=\"calendar.userId\">{{ 'IDEA_AGENDA.CALENDARS.PERSONAL_CALENDAR' | translate }}</span>\n <span *ngIf=\"calendar.teamId\">\n {{ 'IDEA_AGENDA.CALENDARS.TEAM_CALENDAR' | translate: { team: tc.get('team').name } }}\n </span>\n </ion-title>\n </ion-toolbar>\n</ion-header>\n<ion-content>\n <!-- 1st STEP -->\n <ion-grid class=\"ion-padding choiceGrid\" *ngIf=\"!scopeIsSet()\">\n <ion-row>\n <ion-col class=\"ion-text-center\">\n <h1>{{ 'IDEA_AGENDA.CALENDARS.CREATE_PRIVATE_OR_TEAM' | translate }}</h1>\n </ion-col>\n </ion-row>\n <ion-row class=\"ion-align-items-center\">\n <ion-col class=\"ion-text-center\" [size]=\"12\" [sizeSm]=\"6\">\n <ion-card [button]=\"true\" (click)=\"calendar.userId = membership.userId\">\n <ion-card-header>\n <ion-card-title>\n <ion-icon name=\"person\"></ion-icon>\n </ion-card-title>\n </ion-card-header>\n <ion-card-content>\n <h1>{{ 'IDEA_AGENDA.CALENDARS.PERSONAL_CALENDAR' | translate }}</h1>\n <p>{{ 'IDEA_AGENDA.CALENDARS.PERSONAL_CALENDAR_HINT' | translate }}</p>\n </ion-card-content>\n </ion-card>\n </ion-col>\n <ion-col class=\"ion-text-center\" [size]=\"12\" [sizeSm]=\"6\">\n <ion-card [button]=\"true\" (click)=\"calendar.teamId = membership.teamId\">\n <ion-card-header>\n <ion-card-title>\n <ion-icon name=\"people\"></ion-icon>\n </ion-card-title>\n </ion-card-header>\n <ion-card-content>\n <h1>{{ 'IDEA_AGENDA.CALENDARS.TEAM_CALENDAR' | translate }}</h1>\n <p>{{ 'IDEA_AGENDA.CALENDARS.TEAM_CALENDAR_HINT' | translate }}</p>\n </ion-card-content>\n </ion-card>\n </ion-col>\n </ion-row>\n </ion-grid>\n <!-- 2nd STEP -->\n <ion-grid class=\"ion-padding choiceGrid\" *ngIf=\"scopeIsSet()\">\n <ion-row>\n <ion-col class=\"ion-text-center\">\n <h1>{{ 'IDEA_AGENDA.CALENDARS.WHICH_EXTERNAL_SERVICE_TO_LINK' | translate }}</h1>\n <p>{{ 'IDEA_AGENDA.CALENDARS.WHICH_EXTERNAL_SERVICE_TO_LINK_HINT' | translate }}</p>\n </ion-col>\n </ion-row>\n <ion-row class=\"ion-align-items-center\">\n <ion-col class=\"ion-text-center\" [size]=\"12\" *ngIf=\"!onlyExternalCalendars\">\n <ion-card class=\"step2\" [button]=\"true\" (click)=\"saveNewCalendar()\">\n <ion-card-header>\n <ion-card-title>\n <ion-icon name=\"remove\"></ion-icon>\n </ion-card-title>\n </ion-card-header>\n <ion-card-content>\n <h1>{{ 'IDEA_AGENDA.CALENDARS.DONT_LINK' | translate }}</h1>\n <p>{{ 'IDEA_AGENDA.CALENDARS.DONT_LINK_HINT' | translate }}</p>\n </ion-card-content>\n </ion-card>\n </ion-col>\n <ion-col class=\"ion-text-center\" *ngFor=\"let s of SOURCES\" [size]=\"12\">\n <ion-card class=\"step2\" [button]=\"true\" (click)=\"saveNewCalendar(s)\">\n <ion-card-header>\n <ion-card-title>\n <ion-icon [name]=\"calendars.getServiceIcon(s)\"></ion-icon>\n </ion-card-title>\n </ion-card-header>\n <ion-card-content>\n <h1>\n {{ 'IDEA_AGENDA.CALENDARS.LINK_TO' | translate }}\n {{ 'IDEA_AGENDA.CALENDARS.SERVICES.' + s | translate }}\n </h1>\n <p>{{ 'IDEA_AGENDA.CALENDARS.LINK_TO_HINT' | translate }}</p>\n </ion-card-content>\n </ion-card>\n </ion-col>\n </ion-row>\n </ion-grid>\n</ion-content>\n", styles: ["ion-content{--background: var(--ion-color-white-shade)}.choiceGrid ion-row ion-col>h1{margin:10px 0 0;font-size:1.1em}.choiceGrid ion-row ion-col>p{margin-top:0;margin-bottom:0;font-size:.9em}.choiceGrid ion-row:first-child ion-col{padding-bottom:25px}.choiceGrid ion-card{--ion-item-background: var(--ion-color-white);--color: var(--ion-color-dark-tint);height:240px;margin:0 auto;text-align:center}.choiceGrid ion-card ion-card-header{padding-bottom:10px}.choiceGrid ion-card ion-card-header ion-card-title{font-size:2.5em}.choiceGrid ion-card ion-card-content h1{font-size:1.4em;height:60px}.choiceGrid ion-card.step2{height:135px}.choiceGrid ion-card.step2 ion-card-header{padding-top:10px;padding-bottom:0}.choiceGrid ion-card.step2 ion-card-content h1{height:auto}\n"], components: [{ type: i2.IonHeader, selector: "ion-header", inputs: ["collapse", "mode", "translucent"] }, { type: i2.IonToolbar, selector: "ion-toolbar", inputs: ["color", "mode"] }, { type: i2.IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { type: i2.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { type: i2.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { type: i2.IonTitle, selector: "ion-title", inputs: ["color", "size"] }, { type: i2.IonContent, selector: "ion-content", inputs: ["color", "forceOverscroll", "fullscreen", "scrollEvents", "scrollX", "scrollY"] }, { type: i2.IonGrid, selector: "ion-grid", inputs: ["fixed"] }, { type: i2.IonRow, selector: "ion-row" }, { type: i2.IonCol, selector: "ion-col", inputs: ["offset", "offsetLg", "offsetMd", "offsetSm", "offsetXl", "offsetXs", "pull", "pullLg", "pullMd", "pullSm", "pullXl", "pullXs", "push", "pushLg", "pushMd", "pushSm", "pushXl", "pushXs", "size", "sizeLg", "sizeMd", "sizeSm", "sizeXl", "sizeXs"] }, { type: i2.IonCard, selector: "ion-card", inputs: ["button", "color", "disabled", "download", "href", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { type: i2.IonCardHeader, selector: "ion-card-header", inputs: ["color", "mode", "translucent"] }, { type: i2.IonCardTitle, selector: "ion-card-title", inputs: ["color", "mode"] }, { type: i2.IonCardContent, selector: "ion-card-content", inputs: ["mode"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "translate": i3.IDEATranslatePipe } });
903
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: IDEACalendarCreationComponent, decorators: [{
904
+ type: Component,
905
+ args: [{ selector: 'idea-calendar-creation', template: "<ion-header>\n <ion-toolbar color=\"ideaToolbar\">\n <ion-buttons slot=\"start\">\n <ion-button *ngIf=\"!canChangeScope()\" [title]=\"t._('COMMON.CLOSE')\" (click)=\"close()\">\n <ion-icon name=\"close\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n <ion-button *ngIf=\"canChangeScope()\" (click)=\"resetScope()\">\n <ion-icon name=\"arrow-back\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n </ion-buttons>\n <ion-title>\n <span *ngIf=\"!scopeIsSet()\">{{ 'IDEA_AGENDA.CALENDARS.ADD_A_CALENDAR' | translate }}</span>\n <span *ngIf=\"calendar.userId\">{{ 'IDEA_AGENDA.CALENDARS.PERSONAL_CALENDAR' | translate }}</span>\n <span *ngIf=\"calendar.teamId\">\n {{ 'IDEA_AGENDA.CALENDARS.TEAM_CALENDAR' | translate: { team: tc.get('team').name } }}\n </span>\n </ion-title>\n </ion-toolbar>\n</ion-header>\n<ion-content>\n <!-- 1st STEP -->\n <ion-grid class=\"ion-padding choiceGrid\" *ngIf=\"!scopeIsSet()\">\n <ion-row>\n <ion-col class=\"ion-text-center\">\n <h1>{{ 'IDEA_AGENDA.CALENDARS.CREATE_PRIVATE_OR_TEAM' | translate }}</h1>\n </ion-col>\n </ion-row>\n <ion-row class=\"ion-align-items-center\">\n <ion-col class=\"ion-text-center\" [size]=\"12\" [sizeSm]=\"6\">\n <ion-card [button]=\"true\" (click)=\"calendar.userId = membership.userId\">\n <ion-card-header>\n <ion-card-title>\n <ion-icon name=\"person\"></ion-icon>\n </ion-card-title>\n </ion-card-header>\n <ion-card-content>\n <h1>{{ 'IDEA_AGENDA.CALENDARS.PERSONAL_CALENDAR' | translate }}</h1>\n <p>{{ 'IDEA_AGENDA.CALENDARS.PERSONAL_CALENDAR_HINT' | translate }}</p>\n </ion-card-content>\n </ion-card>\n </ion-col>\n <ion-col class=\"ion-text-center\" [size]=\"12\" [sizeSm]=\"6\">\n <ion-card [button]=\"true\" (click)=\"calendar.teamId = membership.teamId\">\n <ion-card-header>\n <ion-card-title>\n <ion-icon name=\"people\"></ion-icon>\n </ion-card-title>\n </ion-card-header>\n <ion-card-content>\n <h1>{{ 'IDEA_AGENDA.CALENDARS.TEAM_CALENDAR' | translate }}</h1>\n <p>{{ 'IDEA_AGENDA.CALENDARS.TEAM_CALENDAR_HINT' | translate }}</p>\n </ion-card-content>\n </ion-card>\n </ion-col>\n </ion-row>\n </ion-grid>\n <!-- 2nd STEP -->\n <ion-grid class=\"ion-padding choiceGrid\" *ngIf=\"scopeIsSet()\">\n <ion-row>\n <ion-col class=\"ion-text-center\">\n <h1>{{ 'IDEA_AGENDA.CALENDARS.WHICH_EXTERNAL_SERVICE_TO_LINK' | translate }}</h1>\n <p>{{ 'IDEA_AGENDA.CALENDARS.WHICH_EXTERNAL_SERVICE_TO_LINK_HINT' | translate }}</p>\n </ion-col>\n </ion-row>\n <ion-row class=\"ion-align-items-center\">\n <ion-col class=\"ion-text-center\" [size]=\"12\" *ngIf=\"!onlyExternalCalendars\">\n <ion-card class=\"step2\" [button]=\"true\" (click)=\"saveNewCalendar()\">\n <ion-card-header>\n <ion-card-title>\n <ion-icon name=\"remove\"></ion-icon>\n </ion-card-title>\n </ion-card-header>\n <ion-card-content>\n <h1>{{ 'IDEA_AGENDA.CALENDARS.DONT_LINK' | translate }}</h1>\n <p>{{ 'IDEA_AGENDA.CALENDARS.DONT_LINK_HINT' | translate }}</p>\n </ion-card-content>\n </ion-card>\n </ion-col>\n <ion-col class=\"ion-text-center\" *ngFor=\"let s of SOURCES\" [size]=\"12\">\n <ion-card class=\"step2\" [button]=\"true\" (click)=\"saveNewCalendar(s)\">\n <ion-card-header>\n <ion-card-title>\n <ion-icon [name]=\"calendars.getServiceIcon(s)\"></ion-icon>\n </ion-card-title>\n </ion-card-header>\n <ion-card-content>\n <h1>\n {{ 'IDEA_AGENDA.CALENDARS.LINK_TO' | translate }}\n {{ 'IDEA_AGENDA.CALENDARS.SERVICES.' + s | translate }}\n </h1>\n <p>{{ 'IDEA_AGENDA.CALENDARS.LINK_TO_HINT' | translate }}</p>\n </ion-card-content>\n </ion-card>\n </ion-col>\n </ion-row>\n </ion-grid>\n</ion-content>\n", styles: ["ion-content{--background: var(--ion-color-white-shade)}.choiceGrid ion-row ion-col>h1{margin:10px 0 0;font-size:1.1em}.choiceGrid ion-row ion-col>p{margin-top:0;margin-bottom:0;font-size:.9em}.choiceGrid ion-row:first-child ion-col{padding-bottom:25px}.choiceGrid ion-card{--ion-item-background: var(--ion-color-white);--color: var(--ion-color-dark-tint);height:240px;margin:0 auto;text-align:center}.choiceGrid ion-card ion-card-header{padding-bottom:10px}.choiceGrid ion-card ion-card-header ion-card-title{font-size:2.5em}.choiceGrid ion-card ion-card-content h1{font-size:1.4em;height:60px}.choiceGrid ion-card.step2{height:135px}.choiceGrid ion-card.step2 ion-card-header{padding-top:10px;padding-bottom:0}.choiceGrid ion-card.step2 ion-card-content h1{height:auto}\n"] }]
906
+ }], ctorParameters: function () { return [{ type: IDEACalendarsService }, { type: i2.ModalController }, { type: i3.IDEATinCanService }, { type: i3.IDEALoadingService }, { type: i3.IDEAMessageService }, { type: i3.IDEAAWSAPIService }, { type: i3.IDEATranslationsService }]; }, propDecorators: { fixScope: [{
907
+ type: Input
908
+ }], onlyExternalCalendars: [{
909
+ type: Input
910
+ }] } });
911
+ /**
912
+ * The possible scopes of the calendar.
913
+ */
914
+ var CalendarScopes;
915
+ (function (CalendarScopes) {
916
+ CalendarScopes["SHARED"] = "shared";
917
+ CalendarScopes["PRIVATE"] = "private"; // userId
918
+ })(CalendarScopes || (CalendarScopes = {}));
919
+
920
+ class IDEAAgendaModule {
921
+ }
922
+ IDEAAgendaModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: IDEAAgendaModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
923
+ IDEAAgendaModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: IDEAAgendaModule, declarations: [IDEAAgendaComponent, IDEACalendarComponent, IDEACalendarItemComponent, IDEACalendarCreationComponent], imports: [CommonModule,
924
+ FormsModule,
925
+ IonicModule,
926
+ IDEATranslationsModule,
927
+ IDEAColorPickerModule,
928
+ IDEACheckerModule, i3$1.CalendarModule], exports: [IDEAAgendaComponent, IDEACalendarComponent, IDEACalendarItemComponent, IDEACalendarCreationComponent] });
929
+ IDEAAgendaModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: IDEAAgendaModule, providers: [{ provide: CalendarDateFormatter, useClass: CustomDateFormatter }, IDEACalendarsService], imports: [[
930
+ CommonModule,
931
+ FormsModule,
932
+ IonicModule,
933
+ IDEATranslationsModule,
934
+ IDEAColorPickerModule,
935
+ IDEACheckerModule,
936
+ CalendarModule.forRoot({ provide: DateAdapter, useFactory: adapterFactory })
937
+ ]] });
938
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: IDEAAgendaModule, decorators: [{
939
+ type: NgModule,
940
+ args: [{
941
+ imports: [
942
+ CommonModule,
943
+ FormsModule,
944
+ IonicModule,
945
+ IDEATranslationsModule,
946
+ IDEAColorPickerModule,
947
+ IDEACheckerModule,
948
+ CalendarModule.forRoot({ provide: DateAdapter, useFactory: adapterFactory })
949
+ ],
950
+ declarations: [IDEAAgendaComponent, IDEACalendarComponent, IDEACalendarItemComponent, IDEACalendarCreationComponent],
951
+ entryComponents: [
952
+ IDEAAgendaComponent,
953
+ IDEACalendarComponent,
954
+ IDEACalendarItemComponent,
955
+ IDEACalendarCreationComponent
956
+ ],
957
+ exports: [IDEAAgendaComponent, IDEACalendarComponent, IDEACalendarItemComponent, IDEACalendarCreationComponent],
958
+ providers: [{ provide: CalendarDateFormatter, useClass: CustomDateFormatter }, IDEACalendarsService]
959
+ }]
960
+ }] });
961
+
962
+ /**
963
+ * Generated bundle index. Do not edit.
964
+ */
965
+
966
+ export { CalendarScopes, CustomDateFormatter, EventAttendance, IDEAAgendaComponent, IDEAAgendaModule, IDEACalendarComponent, IDEACalendarCreationComponent, IDEACalendarItemComponent, IDEACalendarsService };
967
+ //# sourceMappingURL=idea-ionic-agenda.mjs.map