@idea-ionic/agenda 5.29.4 → 6.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (303) hide show
  1. package/README.md +2 -2
  2. package/environment.d.ts +3 -0
  3. package/esm2020/environment.mjs +20 -0
  4. package/esm2020/idea-ionic-agenda.mjs +5 -0
  5. package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
  6. package/esm2020/src/agenda.component.mjs +249 -0
  7. package/esm2020/src/agenda.module.mjs +57 -0
  8. package/esm2020/src/calendar.component.mjs +125 -0
  9. package/esm2020/src/calendarCreation.component.mjs +142 -0
  10. package/esm2020/src/calendarItem.component.mjs +136 -0
  11. package/esm2020/src/calendars.service.mjs +255 -0
  12. package/esm2020/src/dateFormatter.provider.mjs +38 -0
  13. package/fesm2015/idea-ionic-agenda.mjs +974 -0
  14. package/fesm2015/idea-ionic-agenda.mjs.map +1 -0
  15. package/fesm2020/idea-ionic-agenda.mjs +967 -0
  16. package/fesm2020/idea-ionic-agenda.mjs.map +1 -0
  17. package/idea-ionic-agenda.d.ts +4 -0
  18. package/package.json +30 -18
  19. package/src/agenda.component.d.ts +127 -2
  20. package/src/agenda.module.d.ts +13 -0
  21. package/src/calendar.component.d.ts +41 -1
  22. package/src/calendarCreation.component.d.ts +41 -1
  23. package/src/calendarItem.component.d.ts +25 -0
  24. package/src/calendars.service.d.ts +50 -0
  25. package/src/dateFormatter.provider.d.ts +3 -0
  26. package/bundles/idea-ionic-agenda.umd.js +0 -1156
  27. package/bundles/idea-ionic-agenda.umd.js.map +0 -1
  28. package/bundles/idea-ionic-agenda.umd.min.js +0 -16
  29. package/bundles/idea-ionic-agenda.umd.min.js.map +0 -1
  30. package/esm2015/environment.js +0 -17
  31. package/esm2015/environment.ngsummary.json +0 -1
  32. package/esm2015/idea-ionic-agenda.js +0 -2
  33. package/esm2015/idea-ionic-agenda.ngsummary.json +0 -1
  34. package/esm2015/node_modules/@angular/animations/animations.ngsummary.json +0 -1
  35. package/esm2015/node_modules/@angular/common/common.ngfactory.js +0 -5
  36. package/esm2015/node_modules/@angular/common/common.ngsummary.json +0 -1
  37. package/esm2015/node_modules/@angular/common/http/http.ngsummary.json +0 -1
  38. package/esm2015/node_modules/@angular/core/core.ngfactory.js +0 -4
  39. package/esm2015/node_modules/@angular/core/core.ngsummary.json +0 -1
  40. package/esm2015/node_modules/@angular/forms/forms.ngfactory.js +0 -9
  41. package/esm2015/node_modules/@angular/forms/forms.ngsummary.json +0 -1
  42. package/esm2015/node_modules/@angular/router/router.ngfactory.js +0 -12
  43. package/esm2015/node_modules/@angular/router/router.ngsummary.json +0 -1
  44. package/esm2015/node_modules/@capacitor/core/dist/esm/core-plugin-definitions.ngsummary.json +0 -1
  45. package/esm2015/node_modules/@capacitor/core/dist/esm/definitions.ngsummary.json +0 -1
  46. package/esm2015/node_modules/@capacitor/core/dist/esm/global.ngsummary.json +0 -1
  47. package/esm2015/node_modules/@capacitor/core/dist/esm/index.ngsummary.json +0 -1
  48. package/esm2015/node_modules/@capacitor/core/dist/esm/web/accessibility.ngsummary.json +0 -1
  49. package/esm2015/node_modules/@capacitor/core/dist/esm/web/app.ngsummary.json +0 -1
  50. package/esm2015/node_modules/@capacitor/core/dist/esm/web/browser.ngsummary.json +0 -1
  51. package/esm2015/node_modules/@capacitor/core/dist/esm/web/camera.ngsummary.json +0 -1
  52. package/esm2015/node_modules/@capacitor/core/dist/esm/web/clipboard.ngsummary.json +0 -1
  53. package/esm2015/node_modules/@capacitor/core/dist/esm/web/device.ngsummary.json +0 -1
  54. package/esm2015/node_modules/@capacitor/core/dist/esm/web/filesystem.ngsummary.json +0 -1
  55. package/esm2015/node_modules/@capacitor/core/dist/esm/web/geolocation.ngsummary.json +0 -1
  56. package/esm2015/node_modules/@capacitor/core/dist/esm/web/index.ngsummary.json +0 -1
  57. package/esm2015/node_modules/@capacitor/core/dist/esm/web/local-notifications.ngsummary.json +0 -1
  58. package/esm2015/node_modules/@capacitor/core/dist/esm/web/modals.ngsummary.json +0 -1
  59. package/esm2015/node_modules/@capacitor/core/dist/esm/web/motion.ngsummary.json +0 -1
  60. package/esm2015/node_modules/@capacitor/core/dist/esm/web/network.ngsummary.json +0 -1
  61. package/esm2015/node_modules/@capacitor/core/dist/esm/web/permissions.ngsummary.json +0 -1
  62. package/esm2015/node_modules/@capacitor/core/dist/esm/web/share.ngsummary.json +0 -1
  63. package/esm2015/node_modules/@capacitor/core/dist/esm/web/splash-screen.ngsummary.json +0 -1
  64. package/esm2015/node_modules/@capacitor/core/dist/esm/web/storage.ngsummary.json +0 -1
  65. package/esm2015/node_modules/@capacitor/core/dist/esm/web/toast.ngsummary.json +0 -1
  66. package/esm2015/node_modules/@capacitor/core/dist/esm/web-plugins.ngsummary.json +0 -1
  67. package/esm2015/node_modules/@idea-ionic/common/idea-ionic-common.ngfactory.js +0 -1546
  68. package/esm2015/node_modules/@idea-ionic/common/idea-ionic-common.ngsummary.json +0 -1
  69. package/esm2015/node_modules/@ionic/angular/ionic-angular.ngfactory.js +0 -524
  70. package/esm2015/node_modules/@ionic/angular/ionic-angular.ngsummary.json +0 -1
  71. package/esm2015/node_modules/@ionic/angular/node_modules/tslib/tslib.ngsummary.json +0 -1
  72. package/esm2015/node_modules/@ionic/core/dist/types/components/action-sheet/action-sheet-interface.ngsummary.json +0 -1
  73. package/esm2015/node_modules/@ionic/core/dist/types/components/alert/alert-interface.ngsummary.json +0 -1
  74. package/esm2015/node_modules/@ionic/core/dist/types/components/checkbox/checkbox-interface.ngsummary.json +0 -1
  75. package/esm2015/node_modules/@ionic/core/dist/types/components/content/content-interface.ngsummary.json +0 -1
  76. package/esm2015/node_modules/@ionic/core/dist/types/components/datetime/datetime-interface.ngsummary.json +0 -1
  77. package/esm2015/node_modules/@ionic/core/dist/types/components/input/input-interface.ngsummary.json +0 -1
  78. package/esm2015/node_modules/@ionic/core/dist/types/components/loading/loading-interface.ngsummary.json +0 -1
  79. package/esm2015/node_modules/@ionic/core/dist/types/components/menu/menu-interface.ngsummary.json +0 -1
  80. package/esm2015/node_modules/@ionic/core/dist/types/components/modal/modal-interface.ngsummary.json +0 -1
  81. package/esm2015/node_modules/@ionic/core/dist/types/components/nav/constants.ngsummary.json +0 -1
  82. package/esm2015/node_modules/@ionic/core/dist/types/components/nav/nav-interface.ngsummary.json +0 -1
  83. package/esm2015/node_modules/@ionic/core/dist/types/components/nav/view-controller.ngsummary.json +0 -1
  84. package/esm2015/node_modules/@ionic/core/dist/types/components/picker/picker-interface.ngsummary.json +0 -1
  85. package/esm2015/node_modules/@ionic/core/dist/types/components/popover/popover-interface.ngsummary.json +0 -1
  86. package/esm2015/node_modules/@ionic/core/dist/types/components/radio-group/radio-group-interface.ngsummary.json +0 -1
  87. package/esm2015/node_modules/@ionic/core/dist/types/components/range/range-interface.ngsummary.json +0 -1
  88. package/esm2015/node_modules/@ionic/core/dist/types/components/refresher/refresher-interface.ngsummary.json +0 -1
  89. package/esm2015/node_modules/@ionic/core/dist/types/components/reorder-group/reorder-group-interface.ngsummary.json +0 -1
  90. package/esm2015/node_modules/@ionic/core/dist/types/components/route/route-interface.ngsummary.json +0 -1
  91. package/esm2015/node_modules/@ionic/core/dist/types/components/router/utils/interface.ngsummary.json +0 -1
  92. package/esm2015/node_modules/@ionic/core/dist/types/components/searchbar/searchbar-interface.ngsummary.json +0 -1
  93. package/esm2015/node_modules/@ionic/core/dist/types/components/segment/segment-interface.ngsummary.json +0 -1
  94. package/esm2015/node_modules/@ionic/core/dist/types/components/select/select-interface.ngsummary.json +0 -1
  95. package/esm2015/node_modules/@ionic/core/dist/types/components/select-popover/select-popover-interface.ngsummary.json +0 -1
  96. package/esm2015/node_modules/@ionic/core/dist/types/components/spinner/spinner-configs.ngsummary.json +0 -1
  97. package/esm2015/node_modules/@ionic/core/dist/types/components/spinner/spinner-interface.ngsummary.json +0 -1
  98. package/esm2015/node_modules/@ionic/core/dist/types/components/tab-bar/tab-bar-interface.ngsummary.json +0 -1
  99. package/esm2015/node_modules/@ionic/core/dist/types/components/textarea/textarea-interface.ngsummary.json +0 -1
  100. package/esm2015/node_modules/@ionic/core/dist/types/components/toast/toast-interface.ngsummary.json +0 -1
  101. package/esm2015/node_modules/@ionic/core/dist/types/components/toggle/toggle-interface.ngsummary.json +0 -1
  102. package/esm2015/node_modules/@ionic/core/dist/types/components/virtual-scroll/virtual-scroll-interface.ngsummary.json +0 -1
  103. package/esm2015/node_modules/@ionic/core/dist/types/components.ngsummary.json +0 -1
  104. package/esm2015/node_modules/@ionic/core/dist/types/global/config.ngsummary.json +0 -1
  105. package/esm2015/node_modules/@ionic/core/dist/types/index.ngsummary.json +0 -1
  106. package/esm2015/node_modules/@ionic/core/dist/types/interface.ngsummary.json +0 -1
  107. package/esm2015/node_modules/@ionic/core/dist/types/stencil-public-runtime.ngsummary.json +0 -1
  108. package/esm2015/node_modules/@ionic/core/dist/types/utils/animation/animation-interface.ngsummary.json +0 -1
  109. package/esm2015/node_modules/@ionic/core/dist/types/utils/animation/animation.ngsummary.json +0 -1
  110. package/esm2015/node_modules/@ionic/core/dist/types/utils/animation/cubic-bezier.ngsummary.json +0 -1
  111. package/esm2015/node_modules/@ionic/core/dist/types/utils/config.ngsummary.json +0 -1
  112. package/esm2015/node_modules/@ionic/core/dist/types/utils/gesture/gesture-controller.ngsummary.json +0 -1
  113. package/esm2015/node_modules/@ionic/core/dist/types/utils/gesture/index.ngsummary.json +0 -1
  114. package/esm2015/node_modules/@ionic/core/dist/types/utils/menu-controller/index.ngsummary.json +0 -1
  115. package/esm2015/node_modules/@ionic/core/dist/types/utils/overlays-interface.ngsummary.json +0 -1
  116. package/esm2015/node_modules/@ionic/core/dist/types/utils/overlays.ngsummary.json +0 -1
  117. package/esm2015/node_modules/@ionic/core/dist/types/utils/platform.ngsummary.json +0 -1
  118. package/esm2015/node_modules/@ionic/core/dist/types/utils/sanitization/index.ngsummary.json +0 -1
  119. package/esm2015/node_modules/@ionic/core/dist/types/utils/transition/index.ngsummary.json +0 -1
  120. package/esm2015/node_modules/@ionic/core/dist/types/utils/transition/ios.transition.ngsummary.json +0 -1
  121. package/esm2015/node_modules/@ionic/core/dist/types/utils/transition/md.transition.ngsummary.json +0 -1
  122. package/esm2015/node_modules/@ionic/storage/dist/esm/index.ngsummary.json +0 -1
  123. package/esm2015/node_modules/angular-calendar/angular-calendar.ngfactory.js +0 -397
  124. package/esm2015/node_modules/angular-calendar/angular-calendar.ngsummary.json +0 -1
  125. package/esm2015/node_modules/angular-calendar/date-adapters/date-fns/index.ngsummary.json +0 -1
  126. package/esm2015/node_modules/angular-calendar/node_modules/tslib/tslib.ngsummary.json +0 -1
  127. package/esm2015/node_modules/angular-draggable-droppable/angular-draggable-droppable.ngfactory.js +0 -5
  128. package/esm2015/node_modules/angular-draggable-droppable/angular-draggable-droppable.ngsummary.json +0 -1
  129. package/esm2015/node_modules/angular-draggable-droppable/node_modules/tslib/tslib.ngsummary.json +0 -1
  130. package/esm2015/node_modules/angular-resizable-element/angular-resizable-element.ngfactory.js +0 -5
  131. package/esm2015/node_modules/angular-resizable-element/angular-resizable-element.ngsummary.json +0 -1
  132. package/esm2015/node_modules/angular-resizable-element/node_modules/tslib/tslib.ngsummary.json +0 -1
  133. package/esm2015/node_modules/calendar-utils/calendar-utils.ngsummary.json +0 -1
  134. package/esm2015/node_modules/calendar-utils/date-adapters/date-adapter/index.ngsummary.json +0 -1
  135. package/esm2015/node_modules/date-fns/typings.ngsummary.json +0 -1
  136. package/esm2015/node_modules/idea-toolbox/dist/index.ngsummary.json +0 -1
  137. package/esm2015/node_modules/idea-toolbox/dist/src/APIRequestLog.model.ngsummary.json +0 -1
  138. package/esm2015/node_modules/idea-toolbox/dist/src/RCAttachedResource.model.ngsummary.json +0 -1
  139. package/esm2015/node_modules/idea-toolbox/dist/src/RCConfiguredFolder.model.ngsummary.json +0 -1
  140. package/esm2015/node_modules/idea-toolbox/dist/src/RCFolder.model.ngsummary.json +0 -1
  141. package/esm2015/node_modules/idea-toolbox/dist/src/RCResource.model.ngsummary.json +0 -1
  142. package/esm2015/node_modules/idea-toolbox/dist/src/address.model.ngsummary.json +0 -1
  143. package/esm2015/node_modules/idea-toolbox/dist/src/amazonTranslateLanguages.enum.ngsummary.json +0 -1
  144. package/esm2015/node_modules/idea-toolbox/dist/src/announcement.model.ngsummary.json +0 -1
  145. package/esm2015/node_modules/idea-toolbox/dist/src/appointment.model.ngsummary.json +0 -1
  146. package/esm2015/node_modules/idea-toolbox/dist/src/attachment.model.ngsummary.json +0 -1
  147. package/esm2015/node_modules/idea-toolbox/dist/src/booleanChoices.enum.ngsummary.json +0 -1
  148. package/esm2015/node_modules/idea-toolbox/dist/src/cacheable.model.ngsummary.json +0 -1
  149. package/esm2015/node_modules/idea-toolbox/dist/src/cacheableResource.model.ngsummary.json +0 -1
  150. package/esm2015/node_modules/idea-toolbox/dist/src/calendar.model.ngsummary.json +0 -1
  151. package/esm2015/node_modules/idea-toolbox/dist/src/check.model.ngsummary.json +0 -1
  152. package/esm2015/node_modules/idea-toolbox/dist/src/clientInfo.model.ngsummary.json +0 -1
  153. package/esm2015/node_modules/idea-toolbox/dist/src/cognitoUser.model.ngsummary.json +0 -1
  154. package/esm2015/node_modules/idea-toolbox/dist/src/contactRequest.model.ngsummary.json +0 -1
  155. package/esm2015/node_modules/idea-toolbox/dist/src/contacts.model.ngsummary.json +0 -1
  156. package/esm2015/node_modules/idea-toolbox/dist/src/countries.enum.ngsummary.json +0 -1
  157. package/esm2015/node_modules/idea-toolbox/dist/src/customBlockMeta.model.ngsummary.json +0 -1
  158. package/esm2015/node_modules/idea-toolbox/dist/src/customFieldMeta.model.ngsummary.json +0 -1
  159. package/esm2015/node_modules/idea-toolbox/dist/src/customFieldTypes.enum.ngsummary.json +0 -1
  160. package/esm2015/node_modules/idea-toolbox/dist/src/customSectionMeta.model.ngsummary.json +0 -1
  161. package/esm2015/node_modules/idea-toolbox/dist/src/delta.model.ngsummary.json +0 -1
  162. package/esm2015/node_modules/idea-toolbox/dist/src/emailChangeRequest.model.ngsummary.json +0 -1
  163. package/esm2015/node_modules/idea-toolbox/dist/src/emailData.model.ngsummary.json +0 -1
  164. package/esm2015/node_modules/idea-toolbox/dist/src/epoch.ngsummary.json +0 -1
  165. package/esm2015/node_modules/idea-toolbox/dist/src/errorReport.model.ngsummary.json +0 -1
  166. package/esm2015/node_modules/idea-toolbox/dist/src/errorWhitelisted.model.ngsummary.json +0 -1
  167. package/esm2015/node_modules/idea-toolbox/dist/src/excelRow.model.ngsummary.json +0 -1
  168. package/esm2015/node_modules/idea-toolbox/dist/src/invitation.model.ngsummary.json +0 -1
  169. package/esm2015/node_modules/idea-toolbox/dist/src/ionicons.enum.ngsummary.json +0 -1
  170. package/esm2015/node_modules/idea-toolbox/dist/src/label.model.ngsummary.json +0 -1
  171. package/esm2015/node_modules/idea-toolbox/dist/src/labelVariable.model.ngsummary.json +0 -1
  172. package/esm2015/node_modules/idea-toolbox/dist/src/languages.enum.ngsummary.json +0 -1
  173. package/esm2015/node_modules/idea-toolbox/dist/src/languages.model.ngsummary.json +0 -1
  174. package/esm2015/node_modules/idea-toolbox/dist/src/limitCounter.model.ngsummary.json +0 -1
  175. package/esm2015/node_modules/idea-toolbox/dist/src/markdown.ngsummary.json +0 -1
  176. package/esm2015/node_modules/idea-toolbox/dist/src/membership.model.ngsummary.json +0 -1
  177. package/esm2015/node_modules/idea-toolbox/dist/src/notification.model.ngsummary.json +0 -1
  178. package/esm2015/node_modules/idea-toolbox/dist/src/pdfTemplate.model.ngsummary.json +0 -1
  179. package/esm2015/node_modules/idea-toolbox/dist/src/projectPlan.model.ngsummary.json +0 -1
  180. package/esm2015/node_modules/idea-toolbox/dist/src/projectSubscription.model.ngsummary.json +0 -1
  181. package/esm2015/node_modules/idea-toolbox/dist/src/pushNotificationsDevice.model.ngsummary.json +0 -1
  182. package/esm2015/node_modules/idea-toolbox/dist/src/pushNotificationsPlatforms.enum.ngsummary.json +0 -1
  183. package/esm2015/node_modules/idea-toolbox/dist/src/resource.model.ngsummary.json +0 -1
  184. package/esm2015/node_modules/idea-toolbox/dist/src/sentiment.enum.ngsummary.json +0 -1
  185. package/esm2015/node_modules/idea-toolbox/dist/src/signature.model.ngsummary.json +0 -1
  186. package/esm2015/node_modules/idea-toolbox/dist/src/signedURL.model.ngsummary.json +0 -1
  187. package/esm2015/node_modules/idea-toolbox/dist/src/stringVariable.model.ngsummary.json +0 -1
  188. package/esm2015/node_modules/idea-toolbox/dist/src/suggestion.model.ngsummary.json +0 -1
  189. package/esm2015/node_modules/idea-toolbox/dist/src/team.model.ngsummary.json +0 -1
  190. package/esm2015/node_modules/idea-toolbox/dist/src/teamModules.model.ngsummary.json +0 -1
  191. package/esm2015/node_modules/idea-toolbox/dist/src/timeInterval.model.ngsummary.json +0 -1
  192. package/esm2015/node_modules/idea-toolbox/dist/src/user.model.ngsummary.json +0 -1
  193. package/esm2015/node_modules/idea-toolbox/dist/src/utils.ngsummary.json +0 -1
  194. package/esm2015/node_modules/ionicons/dist/types/components/icon/icon.ngsummary.json +0 -1
  195. package/esm2015/node_modules/ionicons/dist/types/components/icon/utils.ngsummary.json +0 -1
  196. package/esm2015/node_modules/ionicons/dist/types/components.ngsummary.json +0 -1
  197. package/esm2015/node_modules/ionicons/dist/types/index.ngsummary.json +0 -1
  198. package/esm2015/node_modules/ionicons/dist/types/stencil-public-runtime.ngsummary.json +0 -1
  199. package/esm2015/node_modules/positioning/dist/entry.ngsummary.json +0 -1
  200. package/esm2015/node_modules/positioning/dist/positioning.ngsummary.json +0 -1
  201. package/esm2015/node_modules/rxjs/index.ngsummary.json +0 -1
  202. package/esm2015/node_modules/rxjs/internal/AsyncSubject.ngsummary.json +0 -1
  203. package/esm2015/node_modules/rxjs/internal/BehaviorSubject.ngsummary.json +0 -1
  204. package/esm2015/node_modules/rxjs/internal/InnerSubscriber.ngsummary.json +0 -1
  205. package/esm2015/node_modules/rxjs/internal/Notification.ngsummary.json +0 -1
  206. package/esm2015/node_modules/rxjs/internal/Observable.ngsummary.json +0 -1
  207. package/esm2015/node_modules/rxjs/internal/Operator.ngsummary.json +0 -1
  208. package/esm2015/node_modules/rxjs/internal/OuterSubscriber.ngsummary.json +0 -1
  209. package/esm2015/node_modules/rxjs/internal/ReplaySubject.ngsummary.json +0 -1
  210. package/esm2015/node_modules/rxjs/internal/Scheduler.ngsummary.json +0 -1
  211. package/esm2015/node_modules/rxjs/internal/Subject.ngsummary.json +0 -1
  212. package/esm2015/node_modules/rxjs/internal/Subscriber.ngsummary.json +0 -1
  213. package/esm2015/node_modules/rxjs/internal/Subscription.ngsummary.json +0 -1
  214. package/esm2015/node_modules/rxjs/internal/config.ngsummary.json +0 -1
  215. package/esm2015/node_modules/rxjs/internal/observable/ConnectableObservable.ngsummary.json +0 -1
  216. package/esm2015/node_modules/rxjs/internal/observable/bindCallback.ngsummary.json +0 -1
  217. package/esm2015/node_modules/rxjs/internal/observable/bindNodeCallback.ngsummary.json +0 -1
  218. package/esm2015/node_modules/rxjs/internal/observable/combineLatest.ngsummary.json +0 -1
  219. package/esm2015/node_modules/rxjs/internal/observable/concat.ngsummary.json +0 -1
  220. package/esm2015/node_modules/rxjs/internal/observable/defer.ngsummary.json +0 -1
  221. package/esm2015/node_modules/rxjs/internal/observable/empty.ngsummary.json +0 -1
  222. package/esm2015/node_modules/rxjs/internal/observable/forkJoin.ngsummary.json +0 -1
  223. package/esm2015/node_modules/rxjs/internal/observable/from.ngsummary.json +0 -1
  224. package/esm2015/node_modules/rxjs/internal/observable/fromEvent.ngsummary.json +0 -1
  225. package/esm2015/node_modules/rxjs/internal/observable/fromEventPattern.ngsummary.json +0 -1
  226. package/esm2015/node_modules/rxjs/internal/observable/generate.ngsummary.json +0 -1
  227. package/esm2015/node_modules/rxjs/internal/observable/iif.ngsummary.json +0 -1
  228. package/esm2015/node_modules/rxjs/internal/observable/interval.ngsummary.json +0 -1
  229. package/esm2015/node_modules/rxjs/internal/observable/merge.ngsummary.json +0 -1
  230. package/esm2015/node_modules/rxjs/internal/observable/never.ngsummary.json +0 -1
  231. package/esm2015/node_modules/rxjs/internal/observable/of.ngsummary.json +0 -1
  232. package/esm2015/node_modules/rxjs/internal/observable/onErrorResumeNext.ngsummary.json +0 -1
  233. package/esm2015/node_modules/rxjs/internal/observable/pairs.ngsummary.json +0 -1
  234. package/esm2015/node_modules/rxjs/internal/observable/partition.ngsummary.json +0 -1
  235. package/esm2015/node_modules/rxjs/internal/observable/race.ngsummary.json +0 -1
  236. package/esm2015/node_modules/rxjs/internal/observable/range.ngsummary.json +0 -1
  237. package/esm2015/node_modules/rxjs/internal/observable/throwError.ngsummary.json +0 -1
  238. package/esm2015/node_modules/rxjs/internal/observable/timer.ngsummary.json +0 -1
  239. package/esm2015/node_modules/rxjs/internal/observable/using.ngsummary.json +0 -1
  240. package/esm2015/node_modules/rxjs/internal/observable/zip.ngsummary.json +0 -1
  241. package/esm2015/node_modules/rxjs/internal/operators/groupBy.ngsummary.json +0 -1
  242. package/esm2015/node_modules/rxjs/internal/scheduled/scheduled.ngsummary.json +0 -1
  243. package/esm2015/node_modules/rxjs/internal/scheduler/Action.ngsummary.json +0 -1
  244. package/esm2015/node_modules/rxjs/internal/scheduler/AnimationFrameScheduler.ngsummary.json +0 -1
  245. package/esm2015/node_modules/rxjs/internal/scheduler/AsapScheduler.ngsummary.json +0 -1
  246. package/esm2015/node_modules/rxjs/internal/scheduler/AsyncAction.ngsummary.json +0 -1
  247. package/esm2015/node_modules/rxjs/internal/scheduler/AsyncScheduler.ngsummary.json +0 -1
  248. package/esm2015/node_modules/rxjs/internal/scheduler/QueueScheduler.ngsummary.json +0 -1
  249. package/esm2015/node_modules/rxjs/internal/scheduler/VirtualTimeScheduler.ngsummary.json +0 -1
  250. package/esm2015/node_modules/rxjs/internal/scheduler/animationFrame.ngsummary.json +0 -1
  251. package/esm2015/node_modules/rxjs/internal/scheduler/asap.ngsummary.json +0 -1
  252. package/esm2015/node_modules/rxjs/internal/scheduler/async.ngsummary.json +0 -1
  253. package/esm2015/node_modules/rxjs/internal/scheduler/queue.ngsummary.json +0 -1
  254. package/esm2015/node_modules/rxjs/internal/symbol/observable.ngsummary.json +0 -1
  255. package/esm2015/node_modules/rxjs/internal/types.ngsummary.json +0 -1
  256. package/esm2015/node_modules/rxjs/internal/util/ArgumentOutOfRangeError.ngsummary.json +0 -1
  257. package/esm2015/node_modules/rxjs/internal/util/EmptyError.ngsummary.json +0 -1
  258. package/esm2015/node_modules/rxjs/internal/util/ObjectUnsubscribedError.ngsummary.json +0 -1
  259. package/esm2015/node_modules/rxjs/internal/util/TimeoutError.ngsummary.json +0 -1
  260. package/esm2015/node_modules/rxjs/internal/util/UnsubscriptionError.ngsummary.json +0 -1
  261. package/esm2015/node_modules/rxjs/internal/util/identity.ngsummary.json +0 -1
  262. package/esm2015/node_modules/rxjs/internal/util/isObservable.ngsummary.json +0 -1
  263. package/esm2015/node_modules/rxjs/internal/util/noop.ngsummary.json +0 -1
  264. package/esm2015/node_modules/rxjs/internal/util/pipe.ngsummary.json +0 -1
  265. package/esm2015/node_modules/signature_pad/dist/types/point.ngsummary.json +0 -1
  266. package/esm2015/node_modules/signature_pad/dist/types/signature_pad.ngsummary.json +0 -1
  267. package/esm2015/node_modules/tslib/tslib.ngsummary.json +0 -1
  268. package/esm2015/public-api.ngsummary.json +0 -1
  269. package/esm2015/src/agenda.component.js +0 -142
  270. package/esm2015/src/agenda.component.ngfactory.js +0 -120
  271. package/esm2015/src/agenda.component.ngsummary.json +0 -1
  272. package/esm2015/src/agenda.component.scss.shim.ngstyle.js +0 -3
  273. package/esm2015/src/agenda.module.js +0 -40
  274. package/esm2015/src/agenda.module.ngfactory.js +0 -20
  275. package/esm2015/src/agenda.module.ngsummary.json +0 -1
  276. package/esm2015/src/calendar.component.js +0 -111
  277. package/esm2015/src/calendar.component.ngfactory.js +0 -54
  278. package/esm2015/src/calendar.component.ngsummary.json +0 -1
  279. package/esm2015/src/calendar.component.scss.shim.ngstyle.js +0 -3
  280. package/esm2015/src/calendarCreation.component.js +0 -116
  281. package/esm2015/src/calendarCreation.component.ngfactory.js +0 -43
  282. package/esm2015/src/calendarCreation.component.ngsummary.json +0 -1
  283. package/esm2015/src/calendarCreation.component.scss.shim.ngstyle.js +0 -3
  284. package/esm2015/src/calendarItem.component.js +0 -119
  285. package/esm2015/src/calendarItem.component.ngfactory.js +0 -24
  286. package/esm2015/src/calendarItem.component.ngsummary.json +0 -1
  287. package/esm2015/src/calendarItem.component.scss.shim.ngstyle.js +0 -3
  288. package/esm2015/src/calendars.service.js +0 -209
  289. package/esm2015/src/calendars.service.ngsummary.json +0 -1
  290. package/esm2015/src/dateFormatter.provider.js +0 -32
  291. package/esm2015/src/dateFormatter.provider.ngsummary.json +0 -1
  292. package/fesm2015/idea-ionic-agenda.js +0 -736
  293. package/fesm2015/idea-ionic-agenda.js.map +0 -1
  294. package/idea-ionic-agenda.metadata.json +0 -1
  295. package/src/agenda.component.ngfactory.d.ts +0 -1
  296. package/src/agenda.component.scss.shim.ngstyle.d.ts +0 -1
  297. package/src/agenda.module.ngfactory.d.ts +0 -3
  298. package/src/calendar.component.ngfactory.d.ts +0 -1
  299. package/src/calendar.component.scss.shim.ngstyle.d.ts +0 -1
  300. package/src/calendarCreation.component.ngfactory.d.ts +0 -1
  301. package/src/calendarCreation.component.scss.shim.ngstyle.d.ts +0 -1
  302. package/src/calendarItem.component.ngfactory.d.ts +0 -1
  303. package/src/calendarItem.component.scss.shim.ngstyle.d.ts +0 -1
@@ -1,736 +0,0 @@
1
- import { Injectable, EventEmitter, Component, ChangeDetectionStrategy, Input, Output, NgModule } from '@angular/core';
2
- import { formatDate, CommonModule } from '@angular/common';
3
- import { FormsModule } from '@angular/forms';
4
- import { Platform, ModalController, AlertController, IonicModule } from '@ionic/angular';
5
- import { CalendarDateFormatter, CalendarView, CalendarModule, DateAdapter } from 'angular-calendar';
6
- import { adapterFactory } from 'angular-calendar/date-adapters/date-fns';
7
- import { IDEATinCanService, IDEATranslationsService, IDEASuggestionsComponent, IDEAMessageService, IDEALoadingService, IDEAAWSAPIService, IDEATranslationsModule, IDEAColorPickerModule, IDEACheckerModule } from '@idea-ionic/common';
8
- import { Subject } from 'rxjs';
9
- import { isFuture, isToday, isSameDay } from 'date-fns';
10
- import ColorParse from 'color-parse';
11
- import { __awaiter } from 'tslib';
12
- import { ExternalCalendarSources, Calendar, Suggestion, Check, ExternalCalendarInfo } from 'idea-toolbox';
13
- import { Plugins } from '@capacitor/core';
14
- import { environment } from '@env';
15
-
16
- class CustomDateFormatter extends CalendarDateFormatter {
17
- monthViewColumnHeader({ date, locale }) {
18
- return formatDate(date, 'EEE', locale);
19
- }
20
- monthViewTitle({ date, locale }) {
21
- return formatDate(date, 'MMMM y', locale);
22
- }
23
- weekViewHour({ date, locale }) {
24
- return locale === 'it' ? formatDate(date, 'HH:mm', locale) : formatDate(date, 'h aa', locale);
25
- }
26
- weekViewColumnHeader({ date, locale }) {
27
- return formatDate(date, 'EEE', locale);
28
- }
29
- weekViewTitle({ date, locale }) {
30
- return formatDate(date, 'MMMM yyyy', locale);
31
- }
32
- dayViewHour({ date, locale }) {
33
- return locale === 'it' ? formatDate(date, 'HH:mm', locale) : formatDate(date, 'h aa', locale);
34
- }
35
- dayViewTitle({ date, locale }) {
36
- return locale === 'it'
37
- ? formatDate(date, 'EEEE, dd MMM yyyy', locale)
38
- : formatDate(date, 'EEEE, MMM dd, yyyy', locale);
39
- }
40
- }
41
- CustomDateFormatter.decorators = [
42
- { type: Injectable }
43
- ];
44
-
45
- const AVATAR_FALLBACK_URL = './assets/imgs/no-avatar.jpg';
46
- class IDEAAgendaComponent {
47
- constructor(platform, tc, t) {
48
- this.platform = platform;
49
- this.tc = tc;
50
- this.t = t;
51
- this.events = [];
52
- this.excludeDays = [];
53
- this.dayStartHour = 0;
54
- this.dayEndHour = 23;
55
- this.hourSegments = 2;
56
- this.activeDayIsOpen = false;
57
- this.view = CalendarView.Week;
58
- this.onlyFuture = false;
59
- this.selectEvent = new EventEmitter();
60
- this.selectDay = new EventEmitter();
61
- this.selectSlot = new EventEmitter();
62
- this.changeEvent = new EventEmitter();
63
- this.changeDate = new EventEmitter();
64
- this.CalendarView = CalendarView;
65
- this.viewDate = new Date();
66
- this.refresh = new Subject();
67
- this.Attendance = EventAttendance;
68
- }
69
- ngOnInit() {
70
- this.locale = this.t.getCurrentLang();
71
- this.weekStartsOn = this.locale === 'it' ? 1 : 0;
72
- }
73
- beforeMonthViewRender({ body }) {
74
- body.forEach(day => {
75
- if (!this.dateIsValid(day.date, true))
76
- day.cssClass = 'cal-disabled';
77
- });
78
- }
79
- beforeWeekOrDayViewRender({ header }) {
80
- header.forEach((day) => {
81
- if (!this.dateIsValid(day.date, true))
82
- day.cssClass = 'cal-disabled';
83
- });
84
- }
85
- dateIsValid(date, sameDayIsValid) {
86
- if (!this.onlyFuture)
87
- return true;
88
- return isFuture(date) || (sameDayIsValid ? isToday(date) : false);
89
- }
90
- setView(view) {
91
- this.view = view;
92
- }
93
- viewDateChanged(newDate) {
94
- if (this.view === CalendarView.Month)
95
- this.activeDayIsOpen = false;
96
- this.changeDate.emit(newDate);
97
- }
98
- changeDay({ date, events }) {
99
- if (!this.dateIsValid(date, true))
100
- return;
101
- if ((isSameDay(this.viewDate, date) && this.activeDayIsOpen === true) || !events || events.length === 0)
102
- this.activeDayIsOpen = false;
103
- else
104
- this.activeDayIsOpen = true;
105
- this.viewDate = date;
106
- }
107
- eventTimesChanged({ event, newStart, newEnd }) {
108
- event.start = newStart;
109
- event.end = newEnd;
110
- this.events = this.events.slice();
111
- this.changeEvent.emit(event);
112
- }
113
- getAlternateColor(color, amount, opacity) {
114
- const alt = ColorParse(color);
115
- const r = Math.max(Math.min(255, Number(alt.values[0]) + amount), 0);
116
- const g = Math.max(Math.min(255, Number(alt.values[1]) + amount), 0);
117
- const b = Math.max(Math.min(255, Number(alt.values[2]) + amount), 0);
118
- return `rgba(${r}, ${g}, ${b}, ${opacity || 1})`;
119
- }
120
- getTooltipContent(event) {
121
- if (!event)
122
- return '';
123
- let str = event.title ? '<b>' + event.title + '</b>' : '';
124
- if (event.description)
125
- str = str.concat('<br>', event.description);
126
- if (event.icons)
127
- event.icons.forEach(x => (str = str.concat('<br>', '<i>', x.title, '</i>')));
128
- if (event.avatars && event.avatars.length) {
129
- str = str.concat('<br><br>~');
130
- event.avatars.forEach(x => (str = str.concat('<br>', x.title)));
131
- }
132
- return str;
133
- }
134
- getPreviewDescription(description) {
135
- return description && description.length > 100 ? description.slice(0, 100).concat('...') : description;
136
- }
137
- loadFallbackAvatar(targetImg) {
138
- const fallback = this.fallbackAvatar || AVATAR_FALLBACK_URL;
139
- if (targetImg && targetImg.src !== fallback)
140
- targetImg.src = fallback;
141
- }
142
- }
143
- IDEAAgendaComponent.decorators = [
144
- { type: Component, args: [{
145
- selector: 'idea-agenda',
146
- changeDetection: ChangeDetectionStrategy.OnPush,
147
- 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",
148
- 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}}"]
149
- },] }
150
- ];
151
- IDEAAgendaComponent.ctorParameters = () => [
152
- { type: Platform },
153
- { type: IDEATinCanService },
154
- { type: IDEATranslationsService }
155
- ];
156
- IDEAAgendaComponent.propDecorators = {
157
- events: [{ type: Input }],
158
- excludeDays: [{ type: Input }],
159
- dayStartHour: [{ type: Input }],
160
- dayEndHour: [{ type: Input }],
161
- hourSegments: [{ type: Input }],
162
- activeDayIsOpen: [{ type: Input }],
163
- view: [{ type: Input }],
164
- onlyFuture: [{ type: Input }],
165
- fallbackAvatar: [{ type: Input }],
166
- selectEvent: [{ type: Output }],
167
- selectDay: [{ type: Output }],
168
- selectSlot: [{ type: Output }],
169
- changeEvent: [{ type: Output }],
170
- changeDate: [{ type: Output }]
171
- };
172
- var EventAttendance;
173
- (function (EventAttendance) {
174
- EventAttendance[EventAttendance["DECLINED"] = -1] = "DECLINED";
175
- EventAttendance[EventAttendance["NEEDS_ACTION"] = 0] = "NEEDS_ACTION";
176
- EventAttendance[EventAttendance["TENTATIVE"] = 1] = "TENTATIVE";
177
- EventAttendance[EventAttendance["ACCEPTED"] = 2] = "ACCEPTED";
178
- })(EventAttendance || (EventAttendance = {}));
179
-
180
- const { Browser } = Plugins;
181
- class IDEACalendarsService {
182
- constructor(modalCtrl, alertCtrl, message, loading, API, t) {
183
- this.modalCtrl = modalCtrl;
184
- this.alertCtrl = alertCtrl;
185
- this.message = message;
186
- this.loading = loading;
187
- this.API = API;
188
- this.t = t;
189
- }
190
- getServiceIcon(service) {
191
- switch (service) {
192
- case ExternalCalendarSources.GOOGLE:
193
- return 'logo-google';
194
- case ExternalCalendarSources.MICROSOFT:
195
- return 'logo-windows';
196
- default:
197
- return 'help';
198
- }
199
- }
200
- getRequestURL(calendar) {
201
- return (calendar.teamId ? `teams/${calendar.teamId}/` : '').concat('calendars');
202
- }
203
- postCalendar(cal) {
204
- return new Promise((resolve, reject) => {
205
- this.API.postResource(this.getRequestURL(cal), { idea: true, body: cal })
206
- .then((res) => resolve(new Calendar(res)))
207
- .catch(err => reject(err));
208
- });
209
- }
210
- putCalendar(cal) {
211
- return new Promise((resolve, reject) => {
212
- this.API.putResource(this.getRequestURL(cal), { idea: true, resourceId: cal.calendarId, body: cal })
213
- .then((res) => resolve(new Calendar(res)))
214
- .catch(err => reject(err));
215
- });
216
- }
217
- deleteCalendar(cal) {
218
- return new Promise((resolve, reject) => {
219
- this.API.deleteResource(this.getRequestURL(cal), { idea: true, resourceId: cal.calendarId })
220
- .then(() => resolve())
221
- .catch(err => reject(err));
222
- });
223
- }
224
- setExternalCalendar(cal, externalId) {
225
- return new Promise((resolve, reject) => {
226
- this.API.patchResource(this.getRequestURL(cal), {
227
- idea: true,
228
- resourceId: cal.calendarId,
229
- body: { action: 'SET_EXTERNAL_CALENDAR', externalId }
230
- })
231
- .then(res => resolve(new Calendar(res)))
232
- .catch(err => reject(err));
233
- });
234
- }
235
- linkExtService(cal) {
236
- return new Promise((resolve, reject) => {
237
- if (!cal.external)
238
- return reject(new Error('NOT_EXTERNAL'));
239
- let url;
240
- switch (cal.external.service) {
241
- case ExternalCalendarSources.GOOGLE:
242
- url =
243
- 'https://accounts.google.com/o/oauth2/v2/auth?' +
244
- `client_id=${encodeURIComponent(environment.google.apiClientId)}` +
245
- '&response_type=code' +
246
- `&redirect_uri=${encodeURIComponent(environment.idea.app.url.concat('/echo/google-calendars-integration'))}` +
247
- '&include_granted_scopes=true' +
248
- '&access_type=offline&prompt=consent' +
249
- `&scope=${encodeURIComponent(environment.google.apiScope)}` +
250
- `&state=${encodeURIComponent(cal.calendarId)}`;
251
- break;
252
- case ExternalCalendarSources.MICROSOFT:
253
- url =
254
- 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize?' +
255
- `client_id=${encodeURIComponent(environment.microsoft.apiClientId)}` +
256
- '&response_type=code' +
257
- `&redirect_uri=${encodeURIComponent(environment.idea.app.url.concat('/echo/microsoft-calendars-integration'))}` +
258
- '&response_mode=query' +
259
- `&scope=${encodeURIComponent(environment.microsoft.apiScope)}` +
260
- `&state=${encodeURIComponent(cal.calendarId)}`;
261
- break;
262
- }
263
- if (!url)
264
- return reject(new Error('INVALID_SERVICE'));
265
- Browser.open({ url }).then(() => {
266
- this.alertCtrl
267
- .create({
268
- header: this.t._('IDEA_AGENDA.CALENDARS.LINKING_CALENDAR'),
269
- message: this.t._('IDEA_AGENDA.CALENDARS.LINKING_CALENDAR_CONFIRM_ONCE_DONE'),
270
- backdropDismiss: false,
271
- buttons: [{ text: this.t._('COMMON.DONE'), handler: () => resolve() }]
272
- })
273
- .then(alert => alert.present());
274
- });
275
- });
276
- }
277
- getExternalCalendars(cal) {
278
- return new Promise((resolve, reject) => {
279
- if (!cal.external)
280
- return reject(new Error('NOT_EXTERNAL'));
281
- this.API.patchResource(this.getRequestURL(cal), {
282
- idea: true,
283
- resourceId: cal.calendarId,
284
- body: { action: 'GET_ACCESS_TOKEN' }
285
- })
286
- .then((result) => {
287
- const headers = { Authorization: 'Bearer '.concat(result.token) };
288
- switch (cal.external.service) {
289
- case ExternalCalendarSources.GOOGLE:
290
- this.API.rawRequest()
291
- .get('https://www.googleapis.com/calendar/v3/users/me/calendarList', { headers })
292
- .toPromise()
293
- .then((res) => resolve(res.items.map((c) => ({ name: c.summary, id: c.id }))))
294
- .catch(err => reject(err));
295
- break;
296
- case ExternalCalendarSources.MICROSOFT:
297
- this.API.rawRequest()
298
- .get('https://graph.microsoft.com/v1.0/me/calendars', { headers })
299
- .toPromise()
300
- .then((res) => resolve(res.value.map((c) => ({ name: c.name, id: c.id }))))
301
- .catch(err => reject(err));
302
- break;
303
- }
304
- })
305
- .catch(err => reject(err));
306
- });
307
- }
308
- chooseAndSetExternalCalendar(cal) {
309
- return new Promise((resolve, reject) => {
310
- this.openModalAndPickExternalCalendar(cal)
311
- .then(extCalId => {
312
- if (!extCalId)
313
- return resolve(null);
314
- this.setExternalCalendar(cal, extCalId)
315
- .then(res => resolve(res))
316
- .catch(err => reject(err));
317
- })
318
- .catch(err => reject(err));
319
- });
320
- }
321
- openModalAndPickExternalCalendar(cal) {
322
- return __awaiter(this, void 0, void 0, function* () {
323
- yield this.loading.show();
324
- return new Promise((resolve, reject) => {
325
- this.getExternalCalendars(cal)
326
- .then((extCals) => {
327
- if (!extCals.length)
328
- return reject(new Error('NO_EXTERNAL_CALENDARS'));
329
- this.modalCtrl
330
- .create({
331
- component: IDEASuggestionsComponent,
332
- componentProps: {
333
- data: extCals.map(c => new Suggestion({ value: c.id, name: c.name })),
334
- searchPlaceholder: this.t._('IDEA_AGENDA.CALENDARS.CHOOSE_AN_EXTERNAL_CALENDAR_TO_LINK'),
335
- sortData: true,
336
- hideIdFromUI: true,
337
- hideClearButton: true,
338
- mustChoose: true
339
- },
340
- backdropDismiss: false
341
- })
342
- .then(modal => {
343
- modal.onDidDismiss().then(res => resolve(res.data ? res.data.value : null));
344
- modal.present();
345
- });
346
- })
347
- .catch(err => reject(err))
348
- .finally(() => this.loading.hide());
349
- });
350
- });
351
- }
352
- syncCalendar(cal) {
353
- return new Promise((resolve, reject) => this.syncCalendarHelper(cal, err => (err ? reject(err) : resolve())));
354
- }
355
- syncCalendarHelper(cal, done) {
356
- this.API.patchResource(this.getRequestURL(cal), {
357
- idea: true,
358
- resourceId: cal.calendarId,
359
- body: { action: 'SYNC_EXTERNAL_CALENDAR', firstSync: true }
360
- })
361
- .then((res) => {
362
- if (res.moreData)
363
- this.syncCalendarHelper(cal, done);
364
- else
365
- done();
366
- })
367
- .catch(err => done(err));
368
- }
369
- }
370
- IDEACalendarsService.decorators = [
371
- { type: Injectable }
372
- ];
373
- IDEACalendarsService.ctorParameters = () => [
374
- { type: ModalController },
375
- { type: AlertController },
376
- { type: IDEAMessageService },
377
- { type: IDEALoadingService },
378
- { type: IDEAAWSAPIService },
379
- { type: IDEATranslationsService }
380
- ];
381
-
382
- class IDEACalendarComponent {
383
- constructor(calendars, modalCtrl, alertCtrl, tc, loading, message, API, t) {
384
- this.calendars = calendars;
385
- this.modalCtrl = modalCtrl;
386
- this.alertCtrl = alertCtrl;
387
- this.tc = tc;
388
- this.loading = loading;
389
- this.message = message;
390
- this.API = API;
391
- this.t = t;
392
- this.errors = new Set();
393
- this.DEFAULT_COLOR = '#555';
394
- }
395
- ngOnInit() {
396
- this.membership = this.tc.get('membership');
397
- this._calendar = new Calendar(this.calendar);
398
- this.API.getResource(`teams/${this.membership.teamId}/memberships`)
399
- .then((memberships) => (this.membershipsChecks = memberships.map(m => new Check({
400
- value: m.userId,
401
- name: m.name,
402
- checked: (this._calendar.usersCanManageAppointments || []).some(x => x === m.userId)
403
- }))))
404
- .catch(() => { });
405
- }
406
- hasFieldAnError(field) {
407
- return this.errors.has(field);
408
- }
409
- save() {
410
- return __awaiter(this, void 0, void 0, function* () {
411
- if (!this._calendar.color)
412
- this._calendar.color = this.DEFAULT_COLOR;
413
- if (this._calendar.isShared() && this.advancedPermissions)
414
- this._calendar.usersCanManageAppointments = this.membershipsChecks
415
- .filter(x => x.checked)
416
- .map(x => String(x.value));
417
- else
418
- delete this._calendar.usersCanManageAppointments;
419
- this.errors = new Set(this._calendar.validate());
420
- if (this.errors.size)
421
- return this.message.error('COMMON.FORM_HAS_ERROR_TO_CHECK');
422
- yield this.loading.show();
423
- this.calendars
424
- .putCalendar(this._calendar)
425
- .then((res) => {
426
- this.calendar.load(res);
427
- this.message.success('IDEA_AGENDA.CALENDARS.CALENDAR_SAVED');
428
- this.modalCtrl.dismiss(this.calendar);
429
- })
430
- .catch(() => this.message.error('COMMON.OPERATION_FAILED'))
431
- .finally(() => this.loading.hide());
432
- });
433
- }
434
- delete() {
435
- this.alertCtrl
436
- .create({
437
- header: this.t._('COMMON.ARE_YOU_SURE'),
438
- subHeader: this.t._('IDEA_AGENDA.CALENDARS.DELETE_CALENDAR'),
439
- message: this.t._('IDEA_AGENDA.CALENDARS.DELETE_CALENDAR_HINT'),
440
- buttons: [
441
- { text: this.t._('COMMON.CANCEL'), role: 'cancel' },
442
- {
443
- text: this.t._('COMMON.DELETE'),
444
- handler: () => __awaiter(this, void 0, void 0, function* () {
445
- yield this.loading.show();
446
- this.calendars
447
- .deleteCalendar(this._calendar)
448
- .then(() => {
449
- this.message.success('IDEA_AGENDA.CALENDARS.CALENDAR_DELETED');
450
- this.modalCtrl.dismiss(true);
451
- })
452
- .catch(() => this.message.error('COMMON.OPERATION_FAILED'))
453
- .finally(() => this.loading.hide());
454
- })
455
- }
456
- ]
457
- })
458
- .then(alert => alert.present());
459
- }
460
- close() {
461
- this.modalCtrl.dismiss();
462
- }
463
- }
464
- IDEACalendarComponent.decorators = [
465
- { type: Component, args: [{
466
- selector: 'idea-calendar',
467
- 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",
468
- styles: [".maxWidthContainer{max-width:500px;padding-top:20px}"]
469
- },] }
470
- ];
471
- IDEACalendarComponent.ctorParameters = () => [
472
- { type: IDEACalendarsService },
473
- { type: ModalController },
474
- { type: AlertController },
475
- { type: IDEATinCanService },
476
- { type: IDEALoadingService },
477
- { type: IDEAMessageService },
478
- { type: IDEAAWSAPIService },
479
- { type: IDEATranslationsService }
480
- ];
481
- IDEACalendarComponent.propDecorators = {
482
- calendar: [{ type: Input }],
483
- advancedPermissions: [{ type: Input }],
484
- hideColor: [{ type: Input }]
485
- };
486
-
487
- class IDEACalendarItemComponent {
488
- constructor(calendars, alertCtrl, modalCtrl, message, loading, t) {
489
- this.calendars = calendars;
490
- this.alertCtrl = alertCtrl;
491
- this.modalCtrl = modalCtrl;
492
- this.message = message;
493
- this.loading = loading;
494
- this.t = t;
495
- this.somethingChanged = new EventEmitter();
496
- }
497
- manageCalendar() {
498
- if (this.disabled)
499
- return;
500
- this.modalCtrl
501
- .create({
502
- component: IDEACalendarComponent,
503
- componentProps: {
504
- calendar: this.calendar,
505
- advancedPermissions: this.advancedPermissions,
506
- hideColor: this.hideColor
507
- }
508
- })
509
- .then(modal => {
510
- modal.onDidDismiss().then(res => {
511
- const cal = res.data;
512
- if (cal === undefined)
513
- return;
514
- else if (cal === null)
515
- this.calendar = null;
516
- else
517
- this.calendar.load(cal);
518
- this.somethingChanged.emit();
519
- });
520
- modal.present();
521
- });
522
- }
523
- linkExtCalendarOrDelete() {
524
- if (this.disabled)
525
- return;
526
- this.calendars
527
- .chooseAndSetExternalCalendar(this.calendar)
528
- .then((cal) => __awaiter(this, void 0, void 0, function* () {
529
- if (!cal)
530
- return new Error('NO_EXTERNAL_CALENDAR_CHOSEN');
531
- this.calendar.load(cal);
532
- this.message.success('IDEA_AGENDA.CALENDARS.CALENDAR_LINKED');
533
- yield this.loading.show(this.t._('IDEA_AGENDA.CALENDARS.FIRST_SYNC_MAY_TAKE_A_WHILE'));
534
- this.calendars
535
- .syncCalendar(this.calendar)
536
- .then(() => this.message.success('IDEA_AGENDA.CALENDARS.FIRST_SYNC_COMPLETED'))
537
- .catch(() => this.message.error('COMMON.OPERATION_FAILED'))
538
- .finally(() => {
539
- this.loading.hide();
540
- this.somethingChanged.emit();
541
- });
542
- }))
543
- .catch(() => {
544
- this.alertCtrl
545
- .create({
546
- header: this.t._('IDEA_AGENDA.CALENDARS.CALENDAR_NOT_YET_LINKED'),
547
- message: this.t._('IDEA_AGENDA.CALENDARS.DO_YOU_WANT_PROCEED_LINKING_OR_DELETE'),
548
- buttons: [
549
- {
550
- text: this.t._('COMMON.DELETE'),
551
- handler: () => __awaiter(this, void 0, void 0, function* () {
552
- yield this.loading.show();
553
- this.calendars
554
- .deleteCalendar(this.calendar)
555
- .then(() => {
556
- this.message.success('COMMON.OPERATION_COMPLETED');
557
- this.somethingChanged.emit();
558
- })
559
- .catch(() => this.message.error('COMMON.OPERATION_FAILED'))
560
- .finally(() => this.loading.hide());
561
- })
562
- },
563
- {
564
- text: this.t._('IDEA_AGENDA.CALENDARS.LINK'),
565
- handler: () => this.calendars
566
- .linkExtService(this.calendar)
567
- .then(() => this.linkExtCalendarOrDelete())
568
- .catch(() => this.message.error('COMMON.OPERATION_FAILED'))
569
- }
570
- ]
571
- })
572
- .then(alert => alert.present());
573
- });
574
- }
575
- }
576
- IDEACalendarItemComponent.decorators = [
577
- { type: Component, args: [{
578
- selector: 'idea-calendar-item',
579
- 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",
580
- styles: [".calendarItem ion-avatar.colorCircle{width:20px;height:20px;background-color:#555}"]
581
- },] }
582
- ];
583
- IDEACalendarItemComponent.ctorParameters = () => [
584
- { type: IDEACalendarsService },
585
- { type: AlertController },
586
- { type: ModalController },
587
- { type: IDEAMessageService },
588
- { type: IDEALoadingService },
589
- { type: IDEATranslationsService }
590
- ];
591
- IDEACalendarItemComponent.propDecorators = {
592
- calendar: [{ type: Input }],
593
- disabled: [{ type: Input }],
594
- advancedPermissions: [{ type: Input }],
595
- hideColor: [{ type: Input }],
596
- somethingChanged: [{ type: Output }]
597
- };
598
-
599
- class IDEACalendarCreationComponent {
600
- constructor(calendars, modalCtrl, tc, loading, message, API, t) {
601
- this.calendars = calendars;
602
- this.modalCtrl = modalCtrl;
603
- this.tc = tc;
604
- this.loading = loading;
605
- this.message = message;
606
- this.API = API;
607
- this.t = t;
608
- this.DEFAULT_COLOR = '#555';
609
- this.SOURCES = Object.keys(ExternalCalendarSources);
610
- }
611
- ngOnInit() {
612
- this.calendar = new Calendar();
613
- this.membership = this.tc.get('membership');
614
- if (this.fixScope === CalendarScopes.SHARED)
615
- this.calendar.teamId = this.membership.teamId;
616
- if (this.fixScope === CalendarScopes.PRIVATE)
617
- this.calendar.userId = this.membership.userId;
618
- }
619
- resetScope() {
620
- if (this.canChangeScope())
621
- this.calendar.teamId = this.calendar.userId = null;
622
- }
623
- canChangeScope() {
624
- return !this.fixScope && this.scopeIsSet();
625
- }
626
- scopeIsSet() {
627
- return Boolean(this.calendar.userId) || Boolean(this.calendar.teamId);
628
- }
629
- saveNewCalendar(service) {
630
- return __awaiter(this, void 0, void 0, function* () {
631
- if (!this.scopeIsSet())
632
- return;
633
- if (!service && this.onlyExternalCalendars)
634
- return;
635
- if (service) {
636
- this.calendar.external = new ExternalCalendarInfo({ service });
637
- this.calendar.name = '-';
638
- }
639
- else {
640
- this.calendar.name = this.calendar.userId
641
- ? this.t._('IDEA_AGENDA.CALENDARS.DEFAULT_PERSONAL_CALENDAR_NAME')
642
- : this.t._('IDEA_AGENDA.CALENDARS.DEFAULT_TEAM_CALENDAR_NAME');
643
- this.calendar.color = this.DEFAULT_COLOR;
644
- }
645
- yield this.loading.show();
646
- this.calendars
647
- .postCalendar(this.calendar)
648
- .then(cal => {
649
- this.calendar.load(cal);
650
- this.message.success('IDEA_AGENDA.CALENDARS.CALENDAR_CREATED');
651
- if (!cal.external)
652
- return this.modalCtrl.dismiss(this.calendar);
653
- this.calendars
654
- .linkExtService(this.calendar)
655
- .then(() => this.calendars.chooseAndSetExternalCalendar(this.calendar))
656
- .then((res) => __awaiter(this, void 0, void 0, function* () {
657
- if (!res)
658
- return this.modalCtrl.dismiss(this.calendar);
659
- this.calendar.load(res);
660
- yield this.loading.show(this.t._('IDEA_AGENDA.CALENDARS.FIRST_SYNC_MAY_TAKE_A_WHILE'));
661
- this.calendars
662
- .syncCalendar(this.calendar)
663
- .then(() => this.message.success('IDEA_AGENDA.CALENDARS.FIRST_SYNC_COMPLETED'))
664
- .catch(() => this.message.error('COMMON.OPERATION_FAILED'))
665
- .finally(() => {
666
- this.loading.hide();
667
- this.modalCtrl.dismiss(this.calendar);
668
- });
669
- }))
670
- .catch(() => {
671
- this.message.error('COMMON.OPERATION_FAILED');
672
- this.modalCtrl.dismiss(this.calendar);
673
- });
674
- })
675
- .catch(() => this.message.error('COMMON.OPERATION_FAILED'))
676
- .finally(() => this.loading.hide());
677
- });
678
- }
679
- close() {
680
- this.modalCtrl.dismiss();
681
- }
682
- }
683
- IDEACalendarCreationComponent.decorators = [
684
- { type: Component, args: [{
685
- selector: 'idea-calendar-creation',
686
- 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",
687
- 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}"]
688
- },] }
689
- ];
690
- IDEACalendarCreationComponent.ctorParameters = () => [
691
- { type: IDEACalendarsService },
692
- { type: ModalController },
693
- { type: IDEATinCanService },
694
- { type: IDEALoadingService },
695
- { type: IDEAMessageService },
696
- { type: IDEAAWSAPIService },
697
- { type: IDEATranslationsService }
698
- ];
699
- IDEACalendarCreationComponent.propDecorators = {
700
- fixScope: [{ type: Input }],
701
- onlyExternalCalendars: [{ type: Input }]
702
- };
703
- var CalendarScopes;
704
- (function (CalendarScopes) {
705
- CalendarScopes["SHARED"] = "shared";
706
- CalendarScopes["PRIVATE"] = "private";
707
- })(CalendarScopes || (CalendarScopes = {}));
708
-
709
- const ɵ0 = adapterFactory;
710
- class IDEAAgendaModule {
711
- }
712
- IDEAAgendaModule.decorators = [
713
- { type: NgModule, args: [{
714
- imports: [
715
- CommonModule,
716
- FormsModule,
717
- IonicModule,
718
- IDEATranslationsModule,
719
- IDEAColorPickerModule,
720
- IDEACheckerModule,
721
- CalendarModule.forRoot({ provide: DateAdapter, useFactory: ɵ0 })
722
- ],
723
- declarations: [IDEAAgendaComponent, IDEACalendarComponent, IDEACalendarItemComponent, IDEACalendarCreationComponent],
724
- entryComponents: [
725
- IDEAAgendaComponent,
726
- IDEACalendarComponent,
727
- IDEACalendarItemComponent,
728
- IDEACalendarCreationComponent
729
- ],
730
- exports: [IDEAAgendaComponent, IDEACalendarComponent, IDEACalendarItemComponent, IDEACalendarCreationComponent],
731
- providers: [{ provide: CalendarDateFormatter, useClass: CustomDateFormatter }, IDEACalendarsService]
732
- },] }
733
- ];
734
-
735
- export { CalendarScopes, CustomDateFormatter, EventAttendance, IDEAAgendaComponent, IDEAAgendaModule, IDEACalendarComponent, IDEACalendarCreationComponent, IDEACalendarItemComponent, IDEACalendarsService, ɵ0 };
736
- //# sourceMappingURL=idea-ionic-agenda.js.map