@idea-ionic/agenda 5.29.1 → 6.0.0

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