django-advanced-report-builder 1.2.9__py3-none-any.whl

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 (360) hide show
  1. advanced_report_builder/.DS_Store +0 -0
  2. advanced_report_builder/.ruff_cache/.gitignore +2 -0
  3. advanced_report_builder/.ruff_cache/0.11.9/16555798982502606642 +0 -0
  4. advanced_report_builder/.ruff_cache/CACHEDIR.TAG +1 -0
  5. advanced_report_builder/__init__.py +0 -0
  6. advanced_report_builder/admin.py +264 -0
  7. advanced_report_builder/apps.py +7 -0
  8. advanced_report_builder/column_types.py +26 -0
  9. advanced_report_builder/columns.py +296 -0
  10. advanced_report_builder/customise.py +2 -0
  11. advanced_report_builder/data_merge/__init__.py +0 -0
  12. advanced_report_builder/data_merge/utils.py +112 -0
  13. advanced_report_builder/data_merge/widget.py +30 -0
  14. advanced_report_builder/duplicate.py +171 -0
  15. advanced_report_builder/exceptions.py +9 -0
  16. advanced_report_builder/field_types.py +466 -0
  17. advanced_report_builder/field_utils.py +401 -0
  18. advanced_report_builder/filter_query.py +862 -0
  19. advanced_report_builder/form_utils.py +12 -0
  20. advanced_report_builder/generate_series.py +14 -0
  21. advanced_report_builder/globals.py +276 -0
  22. advanced_report_builder/includes.py +72 -0
  23. advanced_report_builder/migrations/0001_initial.py +246 -0
  24. advanced_report_builder/migrations/0002_auto_20220209_1657.py +23 -0
  25. advanced_report_builder/migrations/0003_auto_20220215_1219.py +42 -0
  26. advanced_report_builder/migrations/0004_customreport.py +27 -0
  27. advanced_report_builder/migrations/0005_auto_20220303_0958.py +84 -0
  28. advanced_report_builder/migrations/0006_auto_20220310_1147.py +32 -0
  29. advanced_report_builder/migrations/0007_auto_20220322_1939.py +23 -0
  30. advanced_report_builder/migrations/0008_auto_20220404_1144.py +28 -0
  31. advanced_report_builder/migrations/0009_auto_20230428_1554.py +53 -0
  32. advanced_report_builder/migrations/0010_auto_20230428_2033.py +23 -0
  33. advanced_report_builder/migrations/0011_auto_20230620_1449.py +23 -0
  34. advanced_report_builder/migrations/0012_auto_20230718_1642.py +24 -0
  35. advanced_report_builder/migrations/0013_reportqueryorder.py +30 -0
  36. advanced_report_builder/migrations/0014_auto_20240706_2207.py +24 -0
  37. advanced_report_builder/migrations/0015_report_user_created_report_user_updated.py +26 -0
  38. advanced_report_builder/migrations/0016_calendarreport_dashboardreport_options_and_more.py +74 -0
  39. advanced_report_builder/migrations/0017_alter_barchartreport_options_and_more.py +57 -0
  40. advanced_report_builder/migrations/0018_reportquery_target_target_period_type.py +24 -0
  41. advanced_report_builder/migrations/0019_multicellstyle_and_more.py +107 -0
  42. advanced_report_builder/migrations/0020_alter_multicellstyle_font_size.py +18 -0
  43. advanced_report_builder/migrations/0021_multivalueheldquery_and_more.py +36 -0
  44. advanced_report_builder/migrations/0022_dashboardreport_show_options_report_template_style_and_more.py +44 -0
  45. advanced_report_builder/migrations/0023_rename_colour_target_default_colour_and_more.py +41 -0
  46. advanced_report_builder/migrations/0024_alter_target_period_type.py +18 -0
  47. advanced_report_builder/migrations/__init__.py +0 -0
  48. advanced_report_builder/models.py +954 -0
  49. advanced_report_builder/report_builder.py +28 -0
  50. advanced_report_builder/signals.py +3 -0
  51. advanced_report_builder/static/.DS_Store +0 -0
  52. advanced_report_builder/static/advanced_report_builder/.DS_Store +0 -0
  53. advanced_report_builder/static/advanced_report_builder/chart-js/js/chart.esm.js +10553 -0
  54. advanced_report_builder/static/advanced_report_builder/chart-js/js/chart.js +13190 -0
  55. advanced_report_builder/static/advanced_report_builder/chart-js/js/chart.min.js +13 -0
  56. advanced_report_builder/static/advanced_report_builder/chart-js/js/chartjs-adapter-moment.min.js +8 -0
  57. advanced_report_builder/static/advanced_report_builder/chart-js/js/chartjs-plugin-datalabels.min.js +7 -0
  58. advanced_report_builder/static/advanced_report_builder/chart-js/js/chunks/helpers.segment.js +2499 -0
  59. advanced_report_builder/static/advanced_report_builder/chart-js/js/helpers.esm.js +7 -0
  60. advanced_report_builder/static/advanced_report_builder/d3/js/d3.js +20196 -0
  61. advanced_report_builder/static/advanced_report_builder/d3/js/d3.min.js +2 -0
  62. advanced_report_builder/static/advanced_report_builder/d3-funnel/js/d3-funnel.js +6087 -0
  63. advanced_report_builder/static/advanced_report_builder/d3-funnel/js/d3-funnel.min.js +2 -0
  64. advanced_report_builder/static/advanced_report_builder/dashboard/js/dashboard.js +19 -0
  65. advanced_report_builder/static/advanced_report_builder/dot/js/.gitignore +31 -0
  66. advanced_report_builder/static/advanced_report_builder/dot/js/.travis.yml +9 -0
  67. advanced_report_builder/static/advanced_report_builder/dot/js/LICENSE-DOT.txt +24 -0
  68. advanced_report_builder/static/advanced_report_builder/dot/js/README.md +90 -0
  69. advanced_report_builder/static/advanced_report_builder/dot/js/bin/dot-packer +52 -0
  70. advanced_report_builder/static/advanced_report_builder/dot/js/bower.json +21 -0
  71. advanced_report_builder/static/advanced_report_builder/dot/js/doT.js +141 -0
  72. advanced_report_builder/static/advanced_report_builder/dot/js/doT.min.js +8 -0
  73. advanced_report_builder/static/advanced_report_builder/dot/js/doU.js +56 -0
  74. advanced_report_builder/static/advanced_report_builder/dot/js/index.js +143 -0
  75. advanced_report_builder/static/advanced_report_builder/dot/js/package.json +46 -0
  76. advanced_report_builder/static/advanced_report_builder/fullcalendar/.DS_Store +0 -0
  77. advanced_report_builder/static/advanced_report_builder/fullcalendar/LICENSE.txt +20 -0
  78. advanced_report_builder/static/advanced_report_builder/fullcalendar/README.md +10 -0
  79. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/LICENSE.txt +20 -0
  80. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/README.md +8 -0
  81. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/af.js +30 -0
  82. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/ar-dz.js +31 -0
  83. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/ar-kw.js +31 -0
  84. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/ar-ly.js +31 -0
  85. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/ar-ma.js +31 -0
  86. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/ar-sa.js +31 -0
  87. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/ar-tn.js +31 -0
  88. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/ar.js +31 -0
  89. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/bg.js +31 -0
  90. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/bs.js +32 -0
  91. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/ca.js +30 -0
  92. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/cs.js +32 -0
  93. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/da.js +30 -0
  94. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/de.js +33 -0
  95. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/el.js +30 -0
  96. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/en-au.js +17 -0
  97. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/en-gb.js +17 -0
  98. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/en-nz.js +17 -0
  99. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/es-us.js +30 -0
  100. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/es.js +30 -0
  101. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/et.js +32 -0
  102. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/eu.js +30 -0
  103. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/fa.js +33 -0
  104. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/fi.js +30 -0
  105. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/fr-ca.js +27 -0
  106. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/fr-ch.js +31 -0
  107. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/fr.js +31 -0
  108. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/gl.js +30 -0
  109. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/he.js +27 -0
  110. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/hi.js +32 -0
  111. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/hr.js +32 -0
  112. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/hu.js +30 -0
  113. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/id.js +30 -0
  114. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/is.js +30 -0
  115. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/it.js +32 -0
  116. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/ja.js +28 -0
  117. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/ka.js +32 -0
  118. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/kk.js +32 -0
  119. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/ko.js +26 -0
  120. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/lb.js +30 -0
  121. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/lt.js +30 -0
  122. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/lv.js +32 -0
  123. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/mk.js +28 -0
  124. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/ms.js +32 -0
  125. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/nb.js +30 -0
  126. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/nl.js +30 -0
  127. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/nn.js +30 -0
  128. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/pl.js +30 -0
  129. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/pt-br.js +28 -0
  130. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/pt.js +30 -0
  131. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/ro.js +32 -0
  132. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/ru.js +32 -0
  133. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/sk.js +32 -0
  134. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/sl.js +30 -0
  135. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/sq.js +32 -0
  136. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/sr-cyrl.js +32 -0
  137. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/sr.js +32 -0
  138. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/sv.js +30 -0
  139. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/th.js +25 -0
  140. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/tr.js +30 -0
  141. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/uk.js +32 -0
  142. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/vi.js +32 -0
  143. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/zh-cn.js +33 -0
  144. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales/zh-tw.js +26 -0
  145. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales-all.js +1348 -0
  146. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/locales-all.min.js +1 -0
  147. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/main.css +1052 -0
  148. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/main.d.ts +2730 -0
  149. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/main.esm.js +8558 -0
  150. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/main.js +8717 -0
  151. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/main.min.css +1 -0
  152. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/main.min.js +6 -0
  153. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/core/package.json +30 -0
  154. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/daygrid/LICENSE.txt +20 -0
  155. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/daygrid/README.md +8 -0
  156. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/daygrid/main.css +78 -0
  157. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/daygrid/main.d.ts +310 -0
  158. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/daygrid/main.esm.js +1627 -0
  159. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/daygrid/main.js +1641 -0
  160. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/daygrid/main.min.css +1 -0
  161. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/daygrid/main.min.js +6 -0
  162. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/daygrid/package.json +33 -0
  163. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/fullcalendar-yearview/LICENSE +21 -0
  164. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/fullcalendar-yearview/css/main.css +85 -0
  165. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/fullcalendar-yearview/js/main.js +2018 -0
  166. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/google-calendar/LICENSE.txt +20 -0
  167. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/google-calendar/README.md +8 -0
  168. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/google-calendar/main.d.ts +20 -0
  169. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/google-calendar/main.esm.js +162 -0
  170. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/google-calendar/main.js +170 -0
  171. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/google-calendar/main.min.js +6 -0
  172. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/google-calendar/package.json +33 -0
  173. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/interaction/LICENSE.txt +20 -0
  174. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/interaction/README.md +8 -0
  175. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/interaction/main.d.ts +323 -0
  176. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/interaction/main.esm.js +2132 -0
  177. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/interaction/main.js +2143 -0
  178. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/interaction/main.min.js +6 -0
  179. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/interaction/package.json +33 -0
  180. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/list/LICENSE.txt +20 -0
  181. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/list/README.md +8 -0
  182. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/list/main.css +118 -0
  183. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/list/main.d.ts +33 -0
  184. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/list/main.esm.js +335 -0
  185. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/list/main.js +343 -0
  186. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/list/main.min.css +1 -0
  187. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/list/main.min.js +6 -0
  188. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/list/package.json +33 -0
  189. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/luxon/LICENSE.txt +20 -0
  190. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/luxon/README.md +8 -0
  191. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/luxon/main.d.ts +14 -0
  192. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/luxon/main.esm.js +162 -0
  193. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/luxon/main.js +170 -0
  194. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/luxon/main.min.js +6 -0
  195. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/luxon/package.json +34 -0
  196. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/moment/LICENSE.txt +20 -0
  197. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/moment/README.md +8 -0
  198. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/moment/main.d.ts +14 -0
  199. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/moment/main.esm.js +102 -0
  200. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/moment/main.js +110 -0
  201. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/moment/main.min.js +6 -0
  202. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/moment/package.json +34 -0
  203. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/moment-timezone/LICENSE.txt +20 -0
  204. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/moment-timezone/README.md +8 -0
  205. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/moment-timezone/main.d.ts +11 -0
  206. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/moment-timezone/main.esm.js +58 -0
  207. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/moment-timezone/main.js +64 -0
  208. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/moment-timezone/main.min.js +6 -0
  209. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/moment-timezone/package.json +35 -0
  210. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/rrule/LICENSE.txt +20 -0
  211. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/rrule/README.md +8 -0
  212. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/rrule/main.d.ts +9 -0
  213. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/rrule/main.esm.js +121 -0
  214. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/rrule/main.js +128 -0
  215. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/rrule/main.min.js +6 -0
  216. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/rrule/package.json +34 -0
  217. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/timegrid/LICENSE.txt +20 -0
  218. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/timegrid/README.md +8 -0
  219. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/timegrid/main.css +309 -0
  220. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/timegrid/main.d.ts +220 -0
  221. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/timegrid/main.esm.js +1345 -0
  222. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/timegrid/main.js +1357 -0
  223. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/timegrid/main.min.css +1 -0
  224. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/timegrid/main.min.js +6 -0
  225. advanced_report_builder/static/advanced_report_builder/fullcalendar/packages/timegrid/package.json +36 -0
  226. advanced_report_builder/static/advanced_report_builder/fullcalendar/vendor/rrule.js +3782 -0
  227. advanced_report_builder/static/advanced_report_builder/jquery_extendext/js/jQuery.extendext.js +132 -0
  228. advanced_report_builder/static/advanced_report_builder/jquery_extendext/js/jQuery.extendext.min.js +9 -0
  229. advanced_report_builder/static/advanced_report_builder/moment/locales.js +9769 -0
  230. advanced_report_builder/static/advanced_report_builder/moment/locales.min.js +1 -0
  231. advanced_report_builder/static/advanced_report_builder/moment/moment-with-locales.js +14289 -0
  232. advanced_report_builder/static/advanced_report_builder/moment/moment-with-locales.min.js +1 -0
  233. advanced_report_builder/static/advanced_report_builder/moment/moment.min.js +1 -0
  234. advanced_report_builder/static/advanced_report_builder/query_builder/.DS_Store +0 -0
  235. advanced_report_builder/static/advanced_report_builder/query_builder/css/.DS_Store +0 -0
  236. advanced_report_builder/static/advanced_report_builder/query_builder/css/query-builder.dark.css +173 -0
  237. advanced_report_builder/static/advanced_report_builder/query_builder/css/query-builder.dark.min.css +6 -0
  238. advanced_report_builder/static/advanced_report_builder/query_builder/css/query-builder.default.css +173 -0
  239. advanced_report_builder/static/advanced_report_builder/query_builder/css/query-builder.default.min.css +6 -0
  240. advanced_report_builder/static/advanced_report_builder/query_builder/i18n/query-builder.ar.js +80 -0
  241. advanced_report_builder/static/advanced_report_builder/query_builder/i18n/query-builder.az.js +79 -0
  242. advanced_report_builder/static/advanced_report_builder/query_builder/i18n/query-builder.bg.js +79 -0
  243. advanced_report_builder/static/advanced_report_builder/query_builder/i18n/query-builder.cs.js +79 -0
  244. advanced_report_builder/static/advanced_report_builder/query_builder/i18n/query-builder.da.js +56 -0
  245. advanced_report_builder/static/advanced_report_builder/query_builder/i18n/query-builder.de.js +76 -0
  246. advanced_report_builder/static/advanced_report_builder/query_builder/i18n/query-builder.el.js +80 -0
  247. advanced_report_builder/static/advanced_report_builder/query_builder/i18n/query-builder.en.js +83 -0
  248. advanced_report_builder/static/advanced_report_builder/query_builder/i18n/query-builder.es.js +81 -0
  249. advanced_report_builder/static/advanced_report_builder/query_builder/i18n/query-builder.fa-IR.js +79 -0
  250. advanced_report_builder/static/advanced_report_builder/query_builder/i18n/query-builder.fr.js +83 -0
  251. advanced_report_builder/static/advanced_report_builder/query_builder/i18n/query-builder.he.js +81 -0
  252. advanced_report_builder/static/advanced_report_builder/query_builder/i18n/query-builder.it.js +79 -0
  253. advanced_report_builder/static/advanced_report_builder/query_builder/i18n/query-builder.nl.js +76 -0
  254. advanced_report_builder/static/advanced_report_builder/query_builder/i18n/query-builder.no.js +54 -0
  255. advanced_report_builder/static/advanced_report_builder/query_builder/i18n/query-builder.pl.js +80 -0
  256. advanced_report_builder/static/advanced_report_builder/query_builder/i18n/query-builder.pt-BR.js +80 -0
  257. advanced_report_builder/static/advanced_report_builder/query_builder/i18n/query-builder.pt-PT.js +75 -0
  258. advanced_report_builder/static/advanced_report_builder/query_builder/i18n/query-builder.ro.js +54 -0
  259. advanced_report_builder/static/advanced_report_builder/query_builder/i18n/query-builder.ru.js +77 -0
  260. advanced_report_builder/static/advanced_report_builder/query_builder/i18n/query-builder.sq.js +78 -0
  261. advanced_report_builder/static/advanced_report_builder/query_builder/i18n/query-builder.tr.js +82 -0
  262. advanced_report_builder/static/advanced_report_builder/query_builder/i18n/query-builder.ua.js +79 -0
  263. advanced_report_builder/static/advanced_report_builder/query_builder/i18n/query-builder.zh-CN.js +80 -0
  264. advanced_report_builder/static/advanced_report_builder/query_builder/js/.DS_Store +0 -0
  265. advanced_report_builder/static/advanced_report_builder/query_builder/js/plugins/.DS_Store +0 -0
  266. advanced_report_builder/static/advanced_report_builder/query_builder/js/plugins/currency/plugin.js +30 -0
  267. advanced_report_builder/static/advanced_report_builder/query_builder/js/query-builder.js +6200 -0
  268. advanced_report_builder/static/advanced_report_builder/query_builder/js/query-builder.min.js +7 -0
  269. advanced_report_builder/static/advanced_report_builder/query_builder/js/query-builder.standalone.js +6477 -0
  270. advanced_report_builder/static/advanced_report_builder/query_builder/js/query-builder.standalone.min.js +7 -0
  271. advanced_report_builder/static/advanced_report_builder/query_builder/scss/.DS_Store +0 -0
  272. advanced_report_builder/static/advanced_report_builder/query_builder/scss/dark.scss +19 -0
  273. advanced_report_builder/static/advanced_report_builder/query_builder/scss/default.scss +186 -0
  274. advanced_report_builder/static/advanced_report_builder/query_builder/scss/plugins/_bt-checkbox.scss +12 -0
  275. advanced_report_builder/static/advanced_report_builder/query_builder/scss/plugins/_bt-tooltip-errors.scss +9 -0
  276. advanced_report_builder/static/advanced_report_builder/query_builder/scss/plugins/_filter-description.scss +21 -0
  277. advanced_report_builder/static/advanced_report_builder/query_builder/scss/plugins/_invert.scss +5 -0
  278. advanced_report_builder/static/advanced_report_builder/query_builder/scss/plugins/_sortable.scss +28 -0
  279. advanced_report_builder/static/advanced_report_builder/query_builder/scss/plugins/bt-tooltip-errors.scss +9 -0
  280. advanced_report_builder/static/advanced_report_builder/query_builder/scss/plugins/filter-description.scss +21 -0
  281. advanced_report_builder/static/advanced_report_builder/query_builder/scss/plugins/invert.scss +5 -0
  282. advanced_report_builder/static/advanced_report_builder/query_builder/scss/plugins/sortable.scss +27 -0
  283. advanced_report_builder/template_types.py +34 -0
  284. advanced_report_builder/templates/advanced_report_builder/calendar/description_modal.html +12 -0
  285. advanced_report_builder/templates/advanced_report_builder/calendar/middle.html +33 -0
  286. advanced_report_builder/templates/advanced_report_builder/calendar/modal.html +10 -0
  287. advanced_report_builder/templates/advanced_report_builder/calendar/report.html +80 -0
  288. advanced_report_builder/templates/advanced_report_builder/charts/bar/middle.html +122 -0
  289. advanced_report_builder/templates/advanced_report_builder/charts/funnel/middle.html +46 -0
  290. advanced_report_builder/templates/advanced_report_builder/charts/funnel/report.html +34 -0
  291. advanced_report_builder/templates/advanced_report_builder/charts/line/middle.html +119 -0
  292. advanced_report_builder/templates/advanced_report_builder/charts/modal.html +12 -0
  293. advanced_report_builder/templates/advanced_report_builder/charts/modal_field.html +13 -0
  294. advanced_report_builder/templates/advanced_report_builder/charts/pie/middle.html +58 -0
  295. advanced_report_builder/templates/advanced_report_builder/charts/report.html +33 -0
  296. advanced_report_builder/templates/advanced_report_builder/data_merge/data_merge.html +144 -0
  297. advanced_report_builder/templates/advanced_report_builder/datatables/fields/modal.html +13 -0
  298. advanced_report_builder/templates/advanced_report_builder/datatables/fields/single_query_builder.html +87 -0
  299. advanced_report_builder/templates/advanced_report_builder/datatables/modal.html +13 -0
  300. advanced_report_builder/templates/advanced_report_builder/datatables/onclick_menu.html +14 -0
  301. advanced_report_builder/templates/advanced_report_builder/datatables/report.html +37 -0
  302. advanced_report_builder/templates/advanced_report_builder/datatables/select_pivot.html +199 -0
  303. advanced_report_builder/templates/advanced_report_builder/error.html +21 -0
  304. advanced_report_builder/templates/advanced_report_builder/extra_query_modal.html +13 -0
  305. advanced_report_builder/templates/advanced_report_builder/kanban/description_modal.html +12 -0
  306. advanced_report_builder/templates/advanced_report_builder/kanban/middle.html +63 -0
  307. advanced_report_builder/templates/advanced_report_builder/kanban/modal.html +10 -0
  308. advanced_report_builder/templates/advanced_report_builder/kanban/report.html +71 -0
  309. advanced_report_builder/templates/advanced_report_builder/multi_values/held_modal.html +14 -0
  310. advanced_report_builder/templates/advanced_report_builder/multi_values/middle.html +61 -0
  311. advanced_report_builder/templates/advanced_report_builder/multi_values/modal.html +15 -0
  312. advanced_report_builder/templates/advanced_report_builder/multi_values/report.html +19 -0
  313. advanced_report_builder/templates/advanced_report_builder/query_builder.html +88 -0
  314. advanced_report_builder/templates/advanced_report_builder/query_modal.html +12 -0
  315. advanced_report_builder/templates/advanced_report_builder/select_column.html +230 -0
  316. advanced_report_builder/templates/advanced_report_builder/single_values/gauge_middle.html +143 -0
  317. advanced_report_builder/templates/advanced_report_builder/single_values/middle.html +63 -0
  318. advanced_report_builder/templates/advanced_report_builder/single_values/modal.html +13 -0
  319. advanced_report_builder/templates/advanced_report_builder/single_values/report.html +56 -0
  320. advanced_report_builder/toggle.py +9 -0
  321. advanced_report_builder/urls.py +237 -0
  322. advanced_report_builder/utils.py +171 -0
  323. advanced_report_builder/variable_date.py +670 -0
  324. advanced_report_builder/view_types.py +27 -0
  325. advanced_report_builder/views/.DS_Store +0 -0
  326. advanced_report_builder/views/__init__.py +0 -0
  327. advanced_report_builder/views/bar_charts.py +746 -0
  328. advanced_report_builder/views/calendar.py +745 -0
  329. advanced_report_builder/views/charts_base.py +625 -0
  330. advanced_report_builder/views/custom.py +147 -0
  331. advanced_report_builder/views/dashboard.py +357 -0
  332. advanced_report_builder/views/datatables/__init__.py +0 -0
  333. advanced_report_builder/views/datatables/datatables.py +151 -0
  334. advanced_report_builder/views/datatables/modal.py +1151 -0
  335. advanced_report_builder/views/datatables/utils.py +701 -0
  336. advanced_report_builder/views/error_pod.py +50 -0
  337. advanced_report_builder/views/funnel_charts.py +289 -0
  338. advanced_report_builder/views/helpers.py +22 -0
  339. advanced_report_builder/views/kanban.py +868 -0
  340. advanced_report_builder/views/line_charts.py +415 -0
  341. advanced_report_builder/views/modals_base.py +213 -0
  342. advanced_report_builder/views/multi_value.py +1160 -0
  343. advanced_report_builder/views/pie_charts.py +290 -0
  344. advanced_report_builder/views/query_modal/__init__.py +0 -0
  345. advanced_report_builder/views/query_modal/mixin.py +161 -0
  346. advanced_report_builder/views/query_modal/modal.py +274 -0
  347. advanced_report_builder/views/report.py +241 -0
  348. advanced_report_builder/views/report_utils_mixin.py +312 -0
  349. advanced_report_builder/views/reports.py +154 -0
  350. advanced_report_builder/views/single_values.py +792 -0
  351. advanced_report_builder/views/targets/__init__.py +0 -0
  352. advanced_report_builder/views/targets/utils.py +251 -0
  353. advanced_report_builder/views/targets/views.py +139 -0
  354. advanced_report_builder/views/value_base.py +198 -0
  355. advanced_report_builder/widgets.py +5 -0
  356. django_advanced_report_builder-1.2.9.dist-info/METADATA +35 -0
  357. django_advanced_report_builder-1.2.9.dist-info/RECORD +360 -0
  358. django_advanced_report_builder-1.2.9.dist-info/WHEEL +5 -0
  359. django_advanced_report_builder-1.2.9.dist-info/licenses/LICENSE +21 -0
  360. django_advanced_report_builder-1.2.9.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1345 @@
1
+ /*!
2
+ FullCalendar Time Grid Plugin v4.3.0
3
+ Docs & License: https://fullcalendar.io/
4
+ (c) 2019 Adam Shaw
5
+ */
6
+
7
+ import { createFormatter, removeElement, cssToStr, isMultiDayRange, htmlEscape, compareByFieldSpecs, applyStyle, FgEventRenderer, buildSegCompareObj, FillRenderer, memoizeRendering, createDuration, wholeDivideDurations, findElements, PositionCache, startOfDay, asRoughMs, formatIsoTimeString, addDurations, htmlToElement, createElement, multiplyDuration, DateComponent, hasBgRendering, Splitter, diffDays, buildGotoAnchorHtml, getAllDayHtml, ScrollComponent, matchCellWidths, uncompensateScroll, compensateScroll, subtractInnerElHeight, View, memoize, intersectRanges, Slicer, DayHeader, DaySeries, DayTable, createPlugin } from '@fullcalendar/core';
8
+ import { DayBgRow, DayGrid, SimpleDayGrid } from '@fullcalendar/daygrid';
9
+
10
+ /*! *****************************************************************************
11
+ Copyright (c) Microsoft Corporation. All rights reserved.
12
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
13
+ this file except in compliance with the License. You may obtain a copy of the
14
+ License at http://www.apache.org/licenses/LICENSE-2.0
15
+
16
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
18
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
19
+ MERCHANTABLITY OR NON-INFRINGEMENT.
20
+
21
+ See the Apache Version 2.0 License for specific language governing permissions
22
+ and limitations under the License.
23
+ ***************************************************************************** */
24
+ /* global Reflect, Promise */
25
+
26
+ var extendStatics = function(d, b) {
27
+ extendStatics = Object.setPrototypeOf ||
28
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
29
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
30
+ return extendStatics(d, b);
31
+ };
32
+
33
+ function __extends(d, b) {
34
+ extendStatics(d, b);
35
+ function __() { this.constructor = d; }
36
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
37
+ }
38
+
39
+ var __assign = function() {
40
+ __assign = Object.assign || function __assign(t) {
41
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
42
+ s = arguments[i];
43
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
44
+ }
45
+ return t;
46
+ };
47
+ return __assign.apply(this, arguments);
48
+ };
49
+
50
+ /*
51
+ Only handles foreground segs.
52
+ Does not own rendering. Use for low-level util methods by TimeGrid.
53
+ */
54
+ var TimeGridEventRenderer = /** @class */ (function (_super) {
55
+ __extends(TimeGridEventRenderer, _super);
56
+ function TimeGridEventRenderer(timeGrid) {
57
+ var _this = _super.call(this, timeGrid.context) || this;
58
+ _this.timeGrid = timeGrid;
59
+ _this.fullTimeFormat = createFormatter({
60
+ hour: 'numeric',
61
+ minute: '2-digit',
62
+ separator: _this.context.options.defaultRangeSeparator
63
+ });
64
+ return _this;
65
+ }
66
+ // Given an array of foreground segments, render a DOM element for each, computes position,
67
+ // and attaches to the column inner-container elements.
68
+ TimeGridEventRenderer.prototype.attachSegs = function (segs, mirrorInfo) {
69
+ var segsByCol = this.timeGrid.groupSegsByCol(segs);
70
+ // order the segs within each column
71
+ // TODO: have groupSegsByCol do this?
72
+ for (var col = 0; col < segsByCol.length; col++) {
73
+ segsByCol[col] = this.sortEventSegs(segsByCol[col]);
74
+ }
75
+ this.segsByCol = segsByCol;
76
+ this.timeGrid.attachSegsByCol(segsByCol, this.timeGrid.fgContainerEls);
77
+ };
78
+ TimeGridEventRenderer.prototype.detachSegs = function (segs) {
79
+ segs.forEach(function (seg) {
80
+ removeElement(seg.el);
81
+ });
82
+ this.segsByCol = null;
83
+ };
84
+ TimeGridEventRenderer.prototype.computeSegSizes = function (allSegs) {
85
+ var _a = this, timeGrid = _a.timeGrid, segsByCol = _a.segsByCol;
86
+ var colCnt = timeGrid.colCnt;
87
+ timeGrid.computeSegVerticals(allSegs); // horizontals relies on this
88
+ if (segsByCol) {
89
+ for (var col = 0; col < colCnt; col++) {
90
+ this.computeSegHorizontals(segsByCol[col]); // compute horizontal coordinates, z-index's, and reorder the array
91
+ }
92
+ }
93
+ };
94
+ TimeGridEventRenderer.prototype.assignSegSizes = function (allSegs) {
95
+ var _a = this, timeGrid = _a.timeGrid, segsByCol = _a.segsByCol;
96
+ var colCnt = timeGrid.colCnt;
97
+ timeGrid.assignSegVerticals(allSegs); // horizontals relies on this
98
+ if (segsByCol) {
99
+ for (var col = 0; col < colCnt; col++) {
100
+ this.assignSegCss(segsByCol[col]);
101
+ }
102
+ }
103
+ };
104
+ // Computes a default event time formatting string if `eventTimeFormat` is not explicitly defined
105
+ TimeGridEventRenderer.prototype.computeEventTimeFormat = function () {
106
+ return {
107
+ hour: 'numeric',
108
+ minute: '2-digit',
109
+ meridiem: false
110
+ };
111
+ };
112
+ // Computes a default `displayEventEnd` value if one is not expliclty defined
113
+ TimeGridEventRenderer.prototype.computeDisplayEventEnd = function () {
114
+ return true;
115
+ };
116
+ // Renders the HTML for a single event segment's default rendering
117
+ TimeGridEventRenderer.prototype.renderSegHtml = function (seg, mirrorInfo) {
118
+ var view = this.context.view;
119
+ var eventRange = seg.eventRange;
120
+ var eventDef = eventRange.def;
121
+ var eventUi = eventRange.ui;
122
+ var allDay = eventDef.allDay;
123
+ var isDraggable = view.computeEventDraggable(eventDef, eventUi);
124
+ var isResizableFromStart = seg.isStart && view.computeEventStartResizable(eventDef, eventUi);
125
+ var isResizableFromEnd = seg.isEnd && view.computeEventEndResizable(eventDef, eventUi);
126
+ var classes = this.getSegClasses(seg, isDraggable, isResizableFromStart || isResizableFromEnd, mirrorInfo);
127
+ var skinCss = cssToStr(this.getSkinCss(eventUi));
128
+ var timeText;
129
+ var fullTimeText; // more verbose time text. for the print stylesheet
130
+ var startTimeText; // just the start time text
131
+ classes.unshift('fc-time-grid-event');
132
+ // if the event appears to span more than one day...
133
+ if (isMultiDayRange(eventRange.range)) {
134
+ // Don't display time text on segments that run entirely through a day.
135
+ // That would appear as midnight-midnight and would look dumb.
136
+ // Otherwise, display the time text for the *segment's* times (like 6pm-midnight or midnight-10am)
137
+ if (seg.isStart || seg.isEnd) {
138
+ var unzonedStart = seg.start;
139
+ var unzonedEnd = seg.end;
140
+ timeText = this._getTimeText(unzonedStart, unzonedEnd, allDay); // TODO: give the timezones
141
+ fullTimeText = this._getTimeText(unzonedStart, unzonedEnd, allDay, this.fullTimeFormat);
142
+ startTimeText = this._getTimeText(unzonedStart, unzonedEnd, allDay, null, false); // displayEnd=false
143
+ }
144
+ }
145
+ else {
146
+ // Display the normal time text for the *event's* times
147
+ timeText = this.getTimeText(eventRange);
148
+ fullTimeText = this.getTimeText(eventRange, this.fullTimeFormat);
149
+ startTimeText = this.getTimeText(eventRange, null, false); // displayEnd=false
150
+ }
151
+ return '<a class="' + classes.join(' ') + '"' +
152
+ (eventDef.url ?
153
+ ' href="' + htmlEscape(eventDef.url) + '"' :
154
+ '') +
155
+ (skinCss ?
156
+ ' style="' + skinCss + '"' :
157
+ '') +
158
+ '>' +
159
+ '<div class="fc-content">' +
160
+ (timeText ?
161
+ '<div class="fc-time"' +
162
+ ' data-start="' + htmlEscape(startTimeText) + '"' +
163
+ ' data-full="' + htmlEscape(fullTimeText) + '"' +
164
+ '>' +
165
+ '<span>' + htmlEscape(timeText) + '</span>' +
166
+ '</div>' :
167
+ '') +
168
+ (eventDef.title ?
169
+ '<div class="fc-title">' +
170
+ htmlEscape(eventDef.title) +
171
+ '</div>' :
172
+ '') +
173
+ '</div>' +
174
+ /* TODO: write CSS for this
175
+ (isResizableFromStart ?
176
+ '<div class="fc-resizer fc-start-resizer"></div>' :
177
+ ''
178
+ ) +
179
+ */
180
+ (isResizableFromEnd ?
181
+ '<div class="fc-resizer fc-end-resizer"></div>' :
182
+ '') +
183
+ '</a>';
184
+ };
185
+ // Given an array of segments that are all in the same column, sets the backwardCoord and forwardCoord on each.
186
+ // Assumed the segs are already ordered.
187
+ // NOTE: Also reorders the given array by date!
188
+ TimeGridEventRenderer.prototype.computeSegHorizontals = function (segs) {
189
+ var levels;
190
+ var level0;
191
+ var i;
192
+ levels = buildSlotSegLevels(segs);
193
+ computeForwardSlotSegs(levels);
194
+ if ((level0 = levels[0])) {
195
+ for (i = 0; i < level0.length; i++) {
196
+ computeSlotSegPressures(level0[i]);
197
+ }
198
+ for (i = 0; i < level0.length; i++) {
199
+ this.computeSegForwardBack(level0[i], 0, 0);
200
+ }
201
+ }
202
+ };
203
+ // Calculate seg.forwardCoord and seg.backwardCoord for the segment, where both values range
204
+ // from 0 to 1. If the calendar is left-to-right, the seg.backwardCoord maps to "left" and
205
+ // seg.forwardCoord maps to "right" (via percentage). Vice-versa if the calendar is right-to-left.
206
+ //
207
+ // The segment might be part of a "series", which means consecutive segments with the same pressure
208
+ // who's width is unknown until an edge has been hit. `seriesBackwardPressure` is the number of
209
+ // segments behind this one in the current series, and `seriesBackwardCoord` is the starting
210
+ // coordinate of the first segment in the series.
211
+ TimeGridEventRenderer.prototype.computeSegForwardBack = function (seg, seriesBackwardPressure, seriesBackwardCoord) {
212
+ var forwardSegs = seg.forwardSegs;
213
+ var i;
214
+ if (seg.forwardCoord === undefined) { // not already computed
215
+ if (!forwardSegs.length) {
216
+ // if there are no forward segments, this segment should butt up against the edge
217
+ seg.forwardCoord = 1;
218
+ }
219
+ else {
220
+ // sort highest pressure first
221
+ this.sortForwardSegs(forwardSegs);
222
+ // this segment's forwardCoord will be calculated from the backwardCoord of the
223
+ // highest-pressure forward segment.
224
+ this.computeSegForwardBack(forwardSegs[0], seriesBackwardPressure + 1, seriesBackwardCoord);
225
+ seg.forwardCoord = forwardSegs[0].backwardCoord;
226
+ }
227
+ // calculate the backwardCoord from the forwardCoord. consider the series
228
+ seg.backwardCoord = seg.forwardCoord -
229
+ (seg.forwardCoord - seriesBackwardCoord) / // available width for series
230
+ (seriesBackwardPressure + 1); // # of segments in the series
231
+ // use this segment's coordinates to computed the coordinates of the less-pressurized
232
+ // forward segments
233
+ for (i = 0; i < forwardSegs.length; i++) {
234
+ this.computeSegForwardBack(forwardSegs[i], 0, seg.forwardCoord);
235
+ }
236
+ }
237
+ };
238
+ TimeGridEventRenderer.prototype.sortForwardSegs = function (forwardSegs) {
239
+ var objs = forwardSegs.map(buildTimeGridSegCompareObj);
240
+ var specs = [
241
+ // put higher-pressure first
242
+ { field: 'forwardPressure', order: -1 },
243
+ // put segments that are closer to initial edge first (and favor ones with no coords yet)
244
+ { field: 'backwardCoord', order: 1 }
245
+ ].concat(this.context.view.eventOrderSpecs);
246
+ objs.sort(function (obj0, obj1) {
247
+ return compareByFieldSpecs(obj0, obj1, specs);
248
+ });
249
+ return objs.map(function (c) {
250
+ return c._seg;
251
+ });
252
+ };
253
+ // Given foreground event segments that have already had their position coordinates computed,
254
+ // assigns position-related CSS values to their elements.
255
+ TimeGridEventRenderer.prototype.assignSegCss = function (segs) {
256
+ for (var _i = 0, segs_1 = segs; _i < segs_1.length; _i++) {
257
+ var seg = segs_1[_i];
258
+ applyStyle(seg.el, this.generateSegCss(seg));
259
+ if (seg.level > 0) {
260
+ seg.el.classList.add('fc-time-grid-event-inset');
261
+ }
262
+ // if the event is short that the title will be cut off,
263
+ // attach a className that condenses the title into the time area.
264
+ if (seg.eventRange.def.title && seg.bottom - seg.top < 30) {
265
+ seg.el.classList.add('fc-short'); // TODO: "condensed" is a better name
266
+ }
267
+ }
268
+ };
269
+ // Generates an object with CSS properties/values that should be applied to an event segment element.
270
+ // Contains important positioning-related properties that should be applied to any event element, customized or not.
271
+ TimeGridEventRenderer.prototype.generateSegCss = function (seg) {
272
+ var shouldOverlap = this.context.options.slotEventOverlap;
273
+ var backwardCoord = seg.backwardCoord; // the left side if LTR. the right side if RTL. floating-point
274
+ var forwardCoord = seg.forwardCoord; // the right side if LTR. the left side if RTL. floating-point
275
+ var props = this.timeGrid.generateSegVerticalCss(seg); // get top/bottom first
276
+ var isRtl = this.timeGrid.isRtl;
277
+ var left; // amount of space from left edge, a fraction of the total width
278
+ var right; // amount of space from right edge, a fraction of the total width
279
+ if (shouldOverlap) {
280
+ // double the width, but don't go beyond the maximum forward coordinate (1.0)
281
+ forwardCoord = Math.min(1, backwardCoord + (forwardCoord - backwardCoord) * 2);
282
+ }
283
+ if (isRtl) {
284
+ left = 1 - forwardCoord;
285
+ right = backwardCoord;
286
+ }
287
+ else {
288
+ left = backwardCoord;
289
+ right = 1 - forwardCoord;
290
+ }
291
+ props.zIndex = seg.level + 1; // convert from 0-base to 1-based
292
+ props.left = left * 100 + '%';
293
+ props.right = right * 100 + '%';
294
+ if (shouldOverlap && seg.forwardPressure) {
295
+ // add padding to the edge so that forward stacked events don't cover the resizer's icon
296
+ props[isRtl ? 'marginLeft' : 'marginRight'] = 10 * 2; // 10 is a guesstimate of the icon's width
297
+ }
298
+ return props;
299
+ };
300
+ return TimeGridEventRenderer;
301
+ }(FgEventRenderer));
302
+ // Builds an array of segments "levels". The first level will be the leftmost tier of segments if the calendar is
303
+ // left-to-right, or the rightmost if the calendar is right-to-left. Assumes the segments are already ordered by date.
304
+ function buildSlotSegLevels(segs) {
305
+ var levels = [];
306
+ var i;
307
+ var seg;
308
+ var j;
309
+ for (i = 0; i < segs.length; i++) {
310
+ seg = segs[i];
311
+ // go through all the levels and stop on the first level where there are no collisions
312
+ for (j = 0; j < levels.length; j++) {
313
+ if (!computeSlotSegCollisions(seg, levels[j]).length) {
314
+ break;
315
+ }
316
+ }
317
+ seg.level = j;
318
+ (levels[j] || (levels[j] = [])).push(seg);
319
+ }
320
+ return levels;
321
+ }
322
+ // For every segment, figure out the other segments that are in subsequent
323
+ // levels that also occupy the same vertical space. Accumulate in seg.forwardSegs
324
+ function computeForwardSlotSegs(levels) {
325
+ var i;
326
+ var level;
327
+ var j;
328
+ var seg;
329
+ var k;
330
+ for (i = 0; i < levels.length; i++) {
331
+ level = levels[i];
332
+ for (j = 0; j < level.length; j++) {
333
+ seg = level[j];
334
+ seg.forwardSegs = [];
335
+ for (k = i + 1; k < levels.length; k++) {
336
+ computeSlotSegCollisions(seg, levels[k], seg.forwardSegs);
337
+ }
338
+ }
339
+ }
340
+ }
341
+ // Figure out which path forward (via seg.forwardSegs) results in the longest path until
342
+ // the furthest edge is reached. The number of segments in this path will be seg.forwardPressure
343
+ function computeSlotSegPressures(seg) {
344
+ var forwardSegs = seg.forwardSegs;
345
+ var forwardPressure = 0;
346
+ var i;
347
+ var forwardSeg;
348
+ if (seg.forwardPressure === undefined) { // not already computed
349
+ for (i = 0; i < forwardSegs.length; i++) {
350
+ forwardSeg = forwardSegs[i];
351
+ // figure out the child's maximum forward path
352
+ computeSlotSegPressures(forwardSeg);
353
+ // either use the existing maximum, or use the child's forward pressure
354
+ // plus one (for the forwardSeg itself)
355
+ forwardPressure = Math.max(forwardPressure, 1 + forwardSeg.forwardPressure);
356
+ }
357
+ seg.forwardPressure = forwardPressure;
358
+ }
359
+ }
360
+ // Find all the segments in `otherSegs` that vertically collide with `seg`.
361
+ // Append into an optionally-supplied `results` array and return.
362
+ function computeSlotSegCollisions(seg, otherSegs, results) {
363
+ if (results === void 0) { results = []; }
364
+ for (var i = 0; i < otherSegs.length; i++) {
365
+ if (isSlotSegCollision(seg, otherSegs[i])) {
366
+ results.push(otherSegs[i]);
367
+ }
368
+ }
369
+ return results;
370
+ }
371
+ // Do these segments occupy the same vertical space?
372
+ function isSlotSegCollision(seg1, seg2) {
373
+ return seg1.bottom > seg2.top && seg1.top < seg2.bottom;
374
+ }
375
+ function buildTimeGridSegCompareObj(seg) {
376
+ var obj = buildSegCompareObj(seg);
377
+ obj.forwardPressure = seg.forwardPressure;
378
+ obj.backwardCoord = seg.backwardCoord;
379
+ return obj;
380
+ }
381
+
382
+ var TimeGridMirrorRenderer = /** @class */ (function (_super) {
383
+ __extends(TimeGridMirrorRenderer, _super);
384
+ function TimeGridMirrorRenderer() {
385
+ return _super !== null && _super.apply(this, arguments) || this;
386
+ }
387
+ TimeGridMirrorRenderer.prototype.attachSegs = function (segs, mirrorInfo) {
388
+ this.segsByCol = this.timeGrid.groupSegsByCol(segs);
389
+ this.timeGrid.attachSegsByCol(this.segsByCol, this.timeGrid.mirrorContainerEls);
390
+ this.sourceSeg = mirrorInfo.sourceSeg;
391
+ };
392
+ TimeGridMirrorRenderer.prototype.generateSegCss = function (seg) {
393
+ var props = _super.prototype.generateSegCss.call(this, seg);
394
+ var sourceSeg = this.sourceSeg;
395
+ if (sourceSeg && sourceSeg.col === seg.col) {
396
+ var sourceSegProps = _super.prototype.generateSegCss.call(this, sourceSeg);
397
+ props.left = sourceSegProps.left;
398
+ props.right = sourceSegProps.right;
399
+ props.marginLeft = sourceSegProps.marginLeft;
400
+ props.marginRight = sourceSegProps.marginRight;
401
+ }
402
+ return props;
403
+ };
404
+ return TimeGridMirrorRenderer;
405
+ }(TimeGridEventRenderer));
406
+
407
+ var TimeGridFillRenderer = /** @class */ (function (_super) {
408
+ __extends(TimeGridFillRenderer, _super);
409
+ function TimeGridFillRenderer(timeGrid) {
410
+ var _this = _super.call(this, timeGrid.context) || this;
411
+ _this.timeGrid = timeGrid;
412
+ return _this;
413
+ }
414
+ TimeGridFillRenderer.prototype.attachSegs = function (type, segs) {
415
+ var timeGrid = this.timeGrid;
416
+ var containerEls;
417
+ // TODO: more efficient lookup
418
+ if (type === 'bgEvent') {
419
+ containerEls = timeGrid.bgContainerEls;
420
+ }
421
+ else if (type === 'businessHours') {
422
+ containerEls = timeGrid.businessContainerEls;
423
+ }
424
+ else if (type === 'highlight') {
425
+ containerEls = timeGrid.highlightContainerEls;
426
+ }
427
+ timeGrid.attachSegsByCol(timeGrid.groupSegsByCol(segs), containerEls);
428
+ return segs.map(function (seg) {
429
+ return seg.el;
430
+ });
431
+ };
432
+ TimeGridFillRenderer.prototype.computeSegSizes = function (segs) {
433
+ this.timeGrid.computeSegVerticals(segs);
434
+ };
435
+ TimeGridFillRenderer.prototype.assignSegSizes = function (segs) {
436
+ this.timeGrid.assignSegVerticals(segs);
437
+ };
438
+ return TimeGridFillRenderer;
439
+ }(FillRenderer));
440
+
441
+ /* A component that renders one or more columns of vertical time slots
442
+ ----------------------------------------------------------------------------------------------------------------------*/
443
+ // potential nice values for the slot-duration and interval-duration
444
+ // from largest to smallest
445
+ var AGENDA_STOCK_SUB_DURATIONS = [
446
+ { hours: 1 },
447
+ { minutes: 30 },
448
+ { minutes: 15 },
449
+ { seconds: 30 },
450
+ { seconds: 15 }
451
+ ];
452
+ var TimeGrid = /** @class */ (function (_super) {
453
+ __extends(TimeGrid, _super);
454
+ function TimeGrid(context, el, renderProps) {
455
+ var _this = _super.call(this, context, el) || this;
456
+ _this.isSlatSizesDirty = false;
457
+ _this.isColSizesDirty = false;
458
+ _this.renderSlats = memoizeRendering(_this._renderSlats);
459
+ var eventRenderer = _this.eventRenderer = new TimeGridEventRenderer(_this);
460
+ var fillRenderer = _this.fillRenderer = new TimeGridFillRenderer(_this);
461
+ _this.mirrorRenderer = new TimeGridMirrorRenderer(_this);
462
+ var renderColumns = _this.renderColumns = memoizeRendering(_this._renderColumns, _this._unrenderColumns);
463
+ _this.renderBusinessHours = memoizeRendering(fillRenderer.renderSegs.bind(fillRenderer, 'businessHours'), fillRenderer.unrender.bind(fillRenderer, 'businessHours'), [renderColumns]);
464
+ _this.renderDateSelection = memoizeRendering(_this._renderDateSelection, _this._unrenderDateSelection, [renderColumns]);
465
+ _this.renderFgEvents = memoizeRendering(eventRenderer.renderSegs.bind(eventRenderer), eventRenderer.unrender.bind(eventRenderer), [renderColumns]);
466
+ _this.renderBgEvents = memoizeRendering(fillRenderer.renderSegs.bind(fillRenderer, 'bgEvent'), fillRenderer.unrender.bind(fillRenderer, 'bgEvent'), [renderColumns]);
467
+ _this.renderEventSelection = memoizeRendering(eventRenderer.selectByInstanceId.bind(eventRenderer), eventRenderer.unselectByInstanceId.bind(eventRenderer), [_this.renderFgEvents]);
468
+ _this.renderEventDrag = memoizeRendering(_this._renderEventDrag, _this._unrenderEventDrag, [renderColumns]);
469
+ _this.renderEventResize = memoizeRendering(_this._renderEventResize, _this._unrenderEventResize, [renderColumns]);
470
+ _this.processOptions();
471
+ el.innerHTML =
472
+ '<div class="fc-bg"></div>' +
473
+ '<div class="fc-slats"></div>' +
474
+ '<hr class="fc-divider ' + _this.theme.getClass('widgetHeader') + '" style="display:none" />';
475
+ _this.rootBgContainerEl = el.querySelector('.fc-bg');
476
+ _this.slatContainerEl = el.querySelector('.fc-slats');
477
+ _this.bottomRuleEl = el.querySelector('.fc-divider');
478
+ _this.renderProps = renderProps;
479
+ return _this;
480
+ }
481
+ /* Options
482
+ ------------------------------------------------------------------------------------------------------------------*/
483
+ // Parses various options into properties of this object
484
+ TimeGrid.prototype.processOptions = function () {
485
+ var slotDuration = this.opt('slotDuration');
486
+ var snapDuration = this.opt('snapDuration');
487
+ var snapsPerSlot;
488
+ var input;
489
+ slotDuration = createDuration(slotDuration);
490
+ snapDuration = snapDuration ? createDuration(snapDuration) : slotDuration;
491
+ snapsPerSlot = wholeDivideDurations(slotDuration, snapDuration);
492
+ if (snapsPerSlot === null) {
493
+ snapDuration = slotDuration;
494
+ snapsPerSlot = 1;
495
+ // TODO: say warning?
496
+ }
497
+ this.slotDuration = slotDuration;
498
+ this.snapDuration = snapDuration;
499
+ this.snapsPerSlot = snapsPerSlot;
500
+ // might be an array value (for TimelineView).
501
+ // if so, getting the most granular entry (the last one probably).
502
+ input = this.opt('slotLabelFormat');
503
+ if (Array.isArray(input)) {
504
+ input = input[input.length - 1];
505
+ }
506
+ this.labelFormat = createFormatter(input || {
507
+ hour: 'numeric',
508
+ minute: '2-digit',
509
+ omitZeroMinute: true,
510
+ meridiem: 'short'
511
+ });
512
+ input = this.opt('slotLabelInterval');
513
+ this.labelInterval = input ?
514
+ createDuration(input) :
515
+ this.computeLabelInterval(slotDuration);
516
+ };
517
+ // Computes an automatic value for slotLabelInterval
518
+ TimeGrid.prototype.computeLabelInterval = function (slotDuration) {
519
+ var i;
520
+ var labelInterval;
521
+ var slotsPerLabel;
522
+ // find the smallest stock label interval that results in more than one slots-per-label
523
+ for (i = AGENDA_STOCK_SUB_DURATIONS.length - 1; i >= 0; i--) {
524
+ labelInterval = createDuration(AGENDA_STOCK_SUB_DURATIONS[i]);
525
+ slotsPerLabel = wholeDivideDurations(labelInterval, slotDuration);
526
+ if (slotsPerLabel !== null && slotsPerLabel > 1) {
527
+ return labelInterval;
528
+ }
529
+ }
530
+ return slotDuration; // fall back
531
+ };
532
+ /* Rendering
533
+ ------------------------------------------------------------------------------------------------------------------*/
534
+ TimeGrid.prototype.render = function (props) {
535
+ var cells = props.cells;
536
+ this.colCnt = cells.length;
537
+ this.renderSlats(props.dateProfile);
538
+ this.renderColumns(props.cells, props.dateProfile);
539
+ this.renderBusinessHours(props.businessHourSegs);
540
+ this.renderDateSelection(props.dateSelectionSegs);
541
+ this.renderFgEvents(props.fgEventSegs);
542
+ this.renderBgEvents(props.bgEventSegs);
543
+ this.renderEventSelection(props.eventSelection);
544
+ this.renderEventDrag(props.eventDrag);
545
+ this.renderEventResize(props.eventResize);
546
+ };
547
+ TimeGrid.prototype.destroy = function () {
548
+ _super.prototype.destroy.call(this);
549
+ // should unrender everything else too
550
+ this.renderSlats.unrender();
551
+ this.renderColumns.unrender();
552
+ };
553
+ TimeGrid.prototype.updateSize = function (isResize) {
554
+ var _a = this, fillRenderer = _a.fillRenderer, eventRenderer = _a.eventRenderer, mirrorRenderer = _a.mirrorRenderer;
555
+ if (isResize || this.isSlatSizesDirty) {
556
+ this.buildSlatPositions();
557
+ this.isSlatSizesDirty = false;
558
+ }
559
+ if (isResize || this.isColSizesDirty) {
560
+ this.buildColPositions();
561
+ this.isColSizesDirty = false;
562
+ }
563
+ fillRenderer.computeSizes(isResize);
564
+ eventRenderer.computeSizes(isResize);
565
+ mirrorRenderer.computeSizes(isResize);
566
+ fillRenderer.assignSizes(isResize);
567
+ eventRenderer.assignSizes(isResize);
568
+ mirrorRenderer.assignSizes(isResize);
569
+ };
570
+ TimeGrid.prototype._renderSlats = function (dateProfile) {
571
+ var theme = this.theme;
572
+ this.slatContainerEl.innerHTML =
573
+ '<table class="' + theme.getClass('tableGrid') + '">' +
574
+ this.renderSlatRowHtml(dateProfile) +
575
+ '</table>';
576
+ this.slatEls = findElements(this.slatContainerEl, 'tr');
577
+ this.slatPositions = new PositionCache(this.el, this.slatEls, false, true // vertical
578
+ );
579
+ this.isSlatSizesDirty = true;
580
+ };
581
+ // Generates the HTML for the horizontal "slats" that run width-wise. Has a time axis on a side. Depends on RTL.
582
+ TimeGrid.prototype.renderSlatRowHtml = function (dateProfile) {
583
+ var _a = this, dateEnv = _a.dateEnv, theme = _a.theme, isRtl = _a.isRtl;
584
+ var html = '';
585
+ var dayStart = startOfDay(dateProfile.renderRange.start);
586
+ var slotTime = dateProfile.minTime;
587
+ var slotIterator = createDuration(0);
588
+ var slotDate; // will be on the view's first day, but we only care about its time
589
+ var isLabeled;
590
+ var axisHtml;
591
+ // Calculate the time for each slot
592
+ while (asRoughMs(slotTime) < asRoughMs(dateProfile.maxTime)) {
593
+ slotDate = dateEnv.add(dayStart, slotTime);
594
+ isLabeled = wholeDivideDurations(slotIterator, this.labelInterval) !== null;
595
+ axisHtml =
596
+ '<td class="fc-axis fc-time ' + theme.getClass('widgetContent') + '">' +
597
+ (isLabeled ?
598
+ '<span>' + // for matchCellWidths
599
+ htmlEscape(dateEnv.format(slotDate, this.labelFormat)) +
600
+ '</span>' :
601
+ '') +
602
+ '</td>';
603
+ html +=
604
+ '<tr data-time="' + formatIsoTimeString(slotDate) + '"' +
605
+ (isLabeled ? '' : ' class="fc-minor"') +
606
+ '>' +
607
+ (!isRtl ? axisHtml : '') +
608
+ '<td class="' + theme.getClass('widgetContent') + '"></td>' +
609
+ (isRtl ? axisHtml : '') +
610
+ '</tr>';
611
+ slotTime = addDurations(slotTime, this.slotDuration);
612
+ slotIterator = addDurations(slotIterator, this.slotDuration);
613
+ }
614
+ return html;
615
+ };
616
+ TimeGrid.prototype._renderColumns = function (cells, dateProfile) {
617
+ var _a = this, theme = _a.theme, dateEnv = _a.dateEnv, view = _a.view;
618
+ var bgRow = new DayBgRow(this.context);
619
+ this.rootBgContainerEl.innerHTML =
620
+ '<table class="' + theme.getClass('tableGrid') + '">' +
621
+ bgRow.renderHtml({
622
+ cells: cells,
623
+ dateProfile: dateProfile,
624
+ renderIntroHtml: this.renderProps.renderBgIntroHtml
625
+ }) +
626
+ '</table>';
627
+ this.colEls = findElements(this.el, '.fc-day, .fc-disabled-day');
628
+ for (var col = 0; col < this.colCnt; col++) {
629
+ this.publiclyTrigger('dayRender', [
630
+ {
631
+ date: dateEnv.toDate(cells[col].date),
632
+ el: this.colEls[col],
633
+ view: view
634
+ }
635
+ ]);
636
+ }
637
+ if (this.isRtl) {
638
+ this.colEls.reverse();
639
+ }
640
+ this.colPositions = new PositionCache(this.el, this.colEls, true, // horizontal
641
+ false);
642
+ this.renderContentSkeleton();
643
+ this.isColSizesDirty = true;
644
+ };
645
+ TimeGrid.prototype._unrenderColumns = function () {
646
+ this.unrenderContentSkeleton();
647
+ };
648
+ /* Content Skeleton
649
+ ------------------------------------------------------------------------------------------------------------------*/
650
+ // Renders the DOM that the view's content will live in
651
+ TimeGrid.prototype.renderContentSkeleton = function () {
652
+ var parts = [];
653
+ var skeletonEl;
654
+ parts.push(this.renderProps.renderIntroHtml());
655
+ for (var i = 0; i < this.colCnt; i++) {
656
+ parts.push('<td>' +
657
+ '<div class="fc-content-col">' +
658
+ '<div class="fc-event-container fc-mirror-container"></div>' +
659
+ '<div class="fc-event-container"></div>' +
660
+ '<div class="fc-highlight-container"></div>' +
661
+ '<div class="fc-bgevent-container"></div>' +
662
+ '<div class="fc-business-container"></div>' +
663
+ '</div>' +
664
+ '</td>');
665
+ }
666
+ if (this.isRtl) {
667
+ parts.reverse();
668
+ }
669
+ skeletonEl = this.contentSkeletonEl = htmlToElement('<div class="fc-content-skeleton">' +
670
+ '<table>' +
671
+ '<tr>' + parts.join('') + '</tr>' +
672
+ '</table>' +
673
+ '</div>');
674
+ this.colContainerEls = findElements(skeletonEl, '.fc-content-col');
675
+ this.mirrorContainerEls = findElements(skeletonEl, '.fc-mirror-container');
676
+ this.fgContainerEls = findElements(skeletonEl, '.fc-event-container:not(.fc-mirror-container)');
677
+ this.bgContainerEls = findElements(skeletonEl, '.fc-bgevent-container');
678
+ this.highlightContainerEls = findElements(skeletonEl, '.fc-highlight-container');
679
+ this.businessContainerEls = findElements(skeletonEl, '.fc-business-container');
680
+ if (this.isRtl) {
681
+ this.colContainerEls.reverse();
682
+ this.mirrorContainerEls.reverse();
683
+ this.fgContainerEls.reverse();
684
+ this.bgContainerEls.reverse();
685
+ this.highlightContainerEls.reverse();
686
+ this.businessContainerEls.reverse();
687
+ }
688
+ this.el.appendChild(skeletonEl);
689
+ };
690
+ TimeGrid.prototype.unrenderContentSkeleton = function () {
691
+ removeElement(this.contentSkeletonEl);
692
+ };
693
+ // Given a flat array of segments, return an array of sub-arrays, grouped by each segment's col
694
+ TimeGrid.prototype.groupSegsByCol = function (segs) {
695
+ var segsByCol = [];
696
+ var i;
697
+ for (i = 0; i < this.colCnt; i++) {
698
+ segsByCol.push([]);
699
+ }
700
+ for (i = 0; i < segs.length; i++) {
701
+ segsByCol[segs[i].col].push(segs[i]);
702
+ }
703
+ return segsByCol;
704
+ };
705
+ // Given segments grouped by column, insert the segments' elements into a parallel array of container
706
+ // elements, each living within a column.
707
+ TimeGrid.prototype.attachSegsByCol = function (segsByCol, containerEls) {
708
+ var col;
709
+ var segs;
710
+ var i;
711
+ for (col = 0; col < this.colCnt; col++) { // iterate each column grouping
712
+ segs = segsByCol[col];
713
+ for (i = 0; i < segs.length; i++) {
714
+ containerEls[col].appendChild(segs[i].el);
715
+ }
716
+ }
717
+ };
718
+ /* Now Indicator
719
+ ------------------------------------------------------------------------------------------------------------------*/
720
+ TimeGrid.prototype.getNowIndicatorUnit = function () {
721
+ return 'minute'; // will refresh on the minute
722
+ };
723
+ TimeGrid.prototype.renderNowIndicator = function (segs, date) {
724
+ // HACK: if date columns not ready for some reason (scheduler)
725
+ if (!this.colContainerEls) {
726
+ return;
727
+ }
728
+ var top = this.computeDateTop(date);
729
+ var nodes = [];
730
+ var i;
731
+ // render lines within the columns
732
+ for (i = 0; i < segs.length; i++) {
733
+ var lineEl = createElement('div', { className: 'fc-now-indicator fc-now-indicator-line' });
734
+ lineEl.style.top = top + 'px';
735
+ this.colContainerEls[segs[i].col].appendChild(lineEl);
736
+ nodes.push(lineEl);
737
+ }
738
+ // render an arrow over the axis
739
+ if (segs.length > 0) { // is the current time in view?
740
+ var arrowEl = createElement('div', { className: 'fc-now-indicator fc-now-indicator-arrow' });
741
+ arrowEl.style.top = top + 'px';
742
+ this.contentSkeletonEl.appendChild(arrowEl);
743
+ nodes.push(arrowEl);
744
+ }
745
+ this.nowIndicatorEls = nodes;
746
+ };
747
+ TimeGrid.prototype.unrenderNowIndicator = function () {
748
+ if (this.nowIndicatorEls) {
749
+ this.nowIndicatorEls.forEach(removeElement);
750
+ this.nowIndicatorEls = null;
751
+ }
752
+ };
753
+ /* Coordinates
754
+ ------------------------------------------------------------------------------------------------------------------*/
755
+ TimeGrid.prototype.getTotalSlatHeight = function () {
756
+ return this.slatContainerEl.getBoundingClientRect().height;
757
+ };
758
+ // Computes the top coordinate, relative to the bounds of the grid, of the given date.
759
+ // A `startOfDayDate` must be given for avoiding ambiguity over how to treat midnight.
760
+ TimeGrid.prototype.computeDateTop = function (when, startOfDayDate) {
761
+ if (!startOfDayDate) {
762
+ startOfDayDate = startOfDay(when);
763
+ }
764
+ return this.computeTimeTop(createDuration(when.valueOf() - startOfDayDate.valueOf()));
765
+ };
766
+ // Computes the top coordinate, relative to the bounds of the grid, of the given time (a Duration).
767
+ TimeGrid.prototype.computeTimeTop = function (duration) {
768
+ var len = this.slatEls.length;
769
+ var dateProfile = this.props.dateProfile;
770
+ var slatCoverage = (duration.milliseconds - asRoughMs(dateProfile.minTime)) / asRoughMs(this.slotDuration); // floating-point value of # of slots covered
771
+ var slatIndex;
772
+ var slatRemainder;
773
+ // compute a floating-point number for how many slats should be progressed through.
774
+ // from 0 to number of slats (inclusive)
775
+ // constrained because minTime/maxTime might be customized.
776
+ slatCoverage = Math.max(0, slatCoverage);
777
+ slatCoverage = Math.min(len, slatCoverage);
778
+ // an integer index of the furthest whole slat
779
+ // from 0 to number slats (*exclusive*, so len-1)
780
+ slatIndex = Math.floor(slatCoverage);
781
+ slatIndex = Math.min(slatIndex, len - 1);
782
+ // how much further through the slatIndex slat (from 0.0-1.0) must be covered in addition.
783
+ // could be 1.0 if slatCoverage is covering *all* the slots
784
+ slatRemainder = slatCoverage - slatIndex;
785
+ return this.slatPositions.tops[slatIndex] +
786
+ this.slatPositions.getHeight(slatIndex) * slatRemainder;
787
+ };
788
+ // For each segment in an array, computes and assigns its top and bottom properties
789
+ TimeGrid.prototype.computeSegVerticals = function (segs) {
790
+ var eventMinHeight = this.opt('timeGridEventMinHeight');
791
+ var i;
792
+ var seg;
793
+ var dayDate;
794
+ for (i = 0; i < segs.length; i++) {
795
+ seg = segs[i];
796
+ dayDate = this.props.cells[seg.col].date;
797
+ seg.top = this.computeDateTop(seg.start, dayDate);
798
+ seg.bottom = Math.max(seg.top + eventMinHeight, this.computeDateTop(seg.end, dayDate));
799
+ }
800
+ };
801
+ // Given segments that already have their top/bottom properties computed, applies those values to
802
+ // the segments' elements.
803
+ TimeGrid.prototype.assignSegVerticals = function (segs) {
804
+ var i;
805
+ var seg;
806
+ for (i = 0; i < segs.length; i++) {
807
+ seg = segs[i];
808
+ applyStyle(seg.el, this.generateSegVerticalCss(seg));
809
+ }
810
+ };
811
+ // Generates an object with CSS properties for the top/bottom coordinates of a segment element
812
+ TimeGrid.prototype.generateSegVerticalCss = function (seg) {
813
+ return {
814
+ top: seg.top,
815
+ bottom: -seg.bottom // flipped because needs to be space beyond bottom edge of event container
816
+ };
817
+ };
818
+ /* Sizing
819
+ ------------------------------------------------------------------------------------------------------------------*/
820
+ TimeGrid.prototype.buildPositionCaches = function () {
821
+ this.buildColPositions();
822
+ this.buildSlatPositions();
823
+ };
824
+ TimeGrid.prototype.buildColPositions = function () {
825
+ this.colPositions.build();
826
+ };
827
+ TimeGrid.prototype.buildSlatPositions = function () {
828
+ this.slatPositions.build();
829
+ };
830
+ /* Hit System
831
+ ------------------------------------------------------------------------------------------------------------------*/
832
+ TimeGrid.prototype.positionToHit = function (positionLeft, positionTop) {
833
+ var _a = this, dateEnv = _a.dateEnv, snapsPerSlot = _a.snapsPerSlot, slatPositions = _a.slatPositions, colPositions = _a.colPositions;
834
+ var colIndex = colPositions.leftToIndex(positionLeft);
835
+ var slatIndex = slatPositions.topToIndex(positionTop);
836
+ if (colIndex != null && slatIndex != null) {
837
+ var slatTop = slatPositions.tops[slatIndex];
838
+ var slatHeight = slatPositions.getHeight(slatIndex);
839
+ var partial = (positionTop - slatTop) / slatHeight; // floating point number between 0 and 1
840
+ var localSnapIndex = Math.floor(partial * snapsPerSlot); // the snap # relative to start of slat
841
+ var snapIndex = slatIndex * snapsPerSlot + localSnapIndex;
842
+ var dayDate = this.props.cells[colIndex].date;
843
+ var time = addDurations(this.props.dateProfile.minTime, multiplyDuration(this.snapDuration, snapIndex));
844
+ var start = dateEnv.add(dayDate, time);
845
+ var end = dateEnv.add(start, this.snapDuration);
846
+ return {
847
+ col: colIndex,
848
+ dateSpan: {
849
+ range: { start: start, end: end },
850
+ allDay: false
851
+ },
852
+ dayEl: this.colEls[colIndex],
853
+ relativeRect: {
854
+ left: colPositions.lefts[colIndex],
855
+ right: colPositions.rights[colIndex],
856
+ top: slatTop,
857
+ bottom: slatTop + slatHeight
858
+ }
859
+ };
860
+ }
861
+ };
862
+ /* Event Drag Visualization
863
+ ------------------------------------------------------------------------------------------------------------------*/
864
+ TimeGrid.prototype._renderEventDrag = function (state) {
865
+ if (state) {
866
+ this.eventRenderer.hideByHash(state.affectedInstances);
867
+ if (state.isEvent) {
868
+ this.mirrorRenderer.renderSegs(state.segs, { isDragging: true, sourceSeg: state.sourceSeg });
869
+ }
870
+ else {
871
+ this.fillRenderer.renderSegs('highlight', state.segs);
872
+ }
873
+ }
874
+ };
875
+ TimeGrid.prototype._unrenderEventDrag = function (state) {
876
+ if (state) {
877
+ this.eventRenderer.showByHash(state.affectedInstances);
878
+ this.mirrorRenderer.unrender(state.segs, { isDragging: true, sourceSeg: state.sourceSeg });
879
+ this.fillRenderer.unrender('highlight');
880
+ }
881
+ };
882
+ /* Event Resize Visualization
883
+ ------------------------------------------------------------------------------------------------------------------*/
884
+ TimeGrid.prototype._renderEventResize = function (state) {
885
+ if (state) {
886
+ this.eventRenderer.hideByHash(state.affectedInstances);
887
+ this.mirrorRenderer.renderSegs(state.segs, { isResizing: true, sourceSeg: state.sourceSeg });
888
+ }
889
+ };
890
+ TimeGrid.prototype._unrenderEventResize = function (state) {
891
+ if (state) {
892
+ this.eventRenderer.showByHash(state.affectedInstances);
893
+ this.mirrorRenderer.unrender(state.segs, { isResizing: true, sourceSeg: state.sourceSeg });
894
+ }
895
+ };
896
+ /* Selection
897
+ ------------------------------------------------------------------------------------------------------------------*/
898
+ // Renders a visual indication of a selection. Overrides the default, which was to simply render a highlight.
899
+ TimeGrid.prototype._renderDateSelection = function (segs) {
900
+ if (segs) {
901
+ if (this.opt('selectMirror')) {
902
+ this.mirrorRenderer.renderSegs(segs, { isSelecting: true });
903
+ }
904
+ else {
905
+ this.fillRenderer.renderSegs('highlight', segs);
906
+ }
907
+ }
908
+ };
909
+ TimeGrid.prototype._unrenderDateSelection = function (segs) {
910
+ this.mirrorRenderer.unrender(segs, { isSelecting: true });
911
+ this.fillRenderer.unrender('highlight');
912
+ };
913
+ return TimeGrid;
914
+ }(DateComponent));
915
+
916
+ var AllDaySplitter = /** @class */ (function (_super) {
917
+ __extends(AllDaySplitter, _super);
918
+ function AllDaySplitter() {
919
+ return _super !== null && _super.apply(this, arguments) || this;
920
+ }
921
+ AllDaySplitter.prototype.getKeyInfo = function () {
922
+ return {
923
+ allDay: {},
924
+ timed: {}
925
+ };
926
+ };
927
+ AllDaySplitter.prototype.getKeysForDateSpan = function (dateSpan) {
928
+ if (dateSpan.allDay) {
929
+ return ['allDay'];
930
+ }
931
+ else {
932
+ return ['timed'];
933
+ }
934
+ };
935
+ AllDaySplitter.prototype.getKeysForEventDef = function (eventDef) {
936
+ if (!eventDef.allDay) {
937
+ return ['timed'];
938
+ }
939
+ else if (hasBgRendering(eventDef)) {
940
+ return ['timed', 'allDay'];
941
+ }
942
+ else {
943
+ return ['allDay'];
944
+ }
945
+ };
946
+ return AllDaySplitter;
947
+ }(Splitter));
948
+
949
+ var TIMEGRID_ALL_DAY_EVENT_LIMIT = 5;
950
+ var WEEK_HEADER_FORMAT = createFormatter({ week: 'short' });
951
+ /* An abstract class for all timegrid-related views. Displays one more columns with time slots running vertically.
952
+ ----------------------------------------------------------------------------------------------------------------------*/
953
+ // Is a manager for the TimeGrid subcomponent and possibly the DayGrid subcomponent (if allDaySlot is on).
954
+ // Responsible for managing width/height.
955
+ var TimeGridView = /** @class */ (function (_super) {
956
+ __extends(TimeGridView, _super);
957
+ function TimeGridView(context, viewSpec, dateProfileGenerator, parentEl) {
958
+ var _this = _super.call(this, context, viewSpec, dateProfileGenerator, parentEl) || this;
959
+ _this.splitter = new AllDaySplitter();
960
+ /* Header Render Methods
961
+ ------------------------------------------------------------------------------------------------------------------*/
962
+ // Generates the HTML that will go before the day-of week header cells
963
+ _this.renderHeadIntroHtml = function () {
964
+ var _a = _this, theme = _a.theme, dateEnv = _a.dateEnv;
965
+ var range = _this.props.dateProfile.renderRange;
966
+ var dayCnt = diffDays(range.start, range.end);
967
+ var weekText;
968
+ if (_this.opt('weekNumbers')) {
969
+ weekText = dateEnv.format(range.start, WEEK_HEADER_FORMAT);
970
+ return '' +
971
+ '<th class="fc-axis fc-week-number ' + theme.getClass('widgetHeader') + '" ' + _this.axisStyleAttr() + '>' +
972
+ buildGotoAnchorHtml(// aside from link, important for matchCellWidths
973
+ _this, { date: range.start, type: 'week', forceOff: dayCnt > 1 }, htmlEscape(weekText) // inner HTML
974
+ ) +
975
+ '</th>';
976
+ }
977
+ else {
978
+ return '<th class="fc-axis ' + theme.getClass('widgetHeader') + '" ' + _this.axisStyleAttr() + '></th>';
979
+ }
980
+ };
981
+ /* Time Grid Render Methods
982
+ ------------------------------------------------------------------------------------------------------------------*/
983
+ // Generates the HTML that goes before the bg of the TimeGrid slot area. Long vertical column.
984
+ _this.renderTimeGridBgIntroHtml = function () {
985
+ var theme = _this.theme;
986
+ return '<td class="fc-axis ' + theme.getClass('widgetContent') + '" ' + _this.axisStyleAttr() + '></td>';
987
+ };
988
+ // Generates the HTML that goes before all other types of cells.
989
+ // Affects content-skeleton, mirror-skeleton, highlight-skeleton for both the time-grid and day-grid.
990
+ _this.renderTimeGridIntroHtml = function () {
991
+ return '<td class="fc-axis" ' + _this.axisStyleAttr() + '></td>';
992
+ };
993
+ /* Day Grid Render Methods
994
+ ------------------------------------------------------------------------------------------------------------------*/
995
+ // Generates the HTML that goes before the all-day cells
996
+ _this.renderDayGridBgIntroHtml = function () {
997
+ var theme = _this.theme;
998
+ return '' +
999
+ '<td class="fc-axis ' + theme.getClass('widgetContent') + '" ' + _this.axisStyleAttr() + '>' +
1000
+ '<span>' + // needed for matchCellWidths
1001
+ getAllDayHtml(_this) +
1002
+ '</span>' +
1003
+ '</td>';
1004
+ };
1005
+ // Generates the HTML that goes before all other types of cells.
1006
+ // Affects content-skeleton, mirror-skeleton, highlight-skeleton for both the time-grid and day-grid.
1007
+ _this.renderDayGridIntroHtml = function () {
1008
+ return '<td class="fc-axis" ' + _this.axisStyleAttr() + '></td>';
1009
+ };
1010
+ _this.el.classList.add('fc-timeGrid-view');
1011
+ _this.el.innerHTML = _this.renderSkeletonHtml();
1012
+ _this.scroller = new ScrollComponent('hidden', // overflow x
1013
+ 'auto' // overflow y
1014
+ );
1015
+ var timeGridWrapEl = _this.scroller.el;
1016
+ _this.el.querySelector('.fc-body > tr > td').appendChild(timeGridWrapEl);
1017
+ timeGridWrapEl.classList.add('fc-time-grid-container');
1018
+ var timeGridEl = createElement('div', { className: 'fc-time-grid' });
1019
+ timeGridWrapEl.appendChild(timeGridEl);
1020
+ _this.timeGrid = new TimeGrid(_this.context, timeGridEl, {
1021
+ renderBgIntroHtml: _this.renderTimeGridBgIntroHtml,
1022
+ renderIntroHtml: _this.renderTimeGridIntroHtml
1023
+ });
1024
+ if (_this.opt('allDaySlot')) { // should we display the "all-day" area?
1025
+ _this.dayGrid = new DayGrid(// the all-day subcomponent of this view
1026
+ _this.context, _this.el.querySelector('.fc-day-grid'), {
1027
+ renderNumberIntroHtml: _this.renderDayGridIntroHtml,
1028
+ renderBgIntroHtml: _this.renderDayGridBgIntroHtml,
1029
+ renderIntroHtml: _this.renderDayGridIntroHtml,
1030
+ colWeekNumbersVisible: false,
1031
+ cellWeekNumbersVisible: false
1032
+ });
1033
+ // have the day-grid extend it's coordinate area over the <hr> dividing the two grids
1034
+ var dividerEl = _this.el.querySelector('.fc-divider');
1035
+ _this.dayGrid.bottomCoordPadding = dividerEl.getBoundingClientRect().height;
1036
+ }
1037
+ return _this;
1038
+ }
1039
+ TimeGridView.prototype.destroy = function () {
1040
+ _super.prototype.destroy.call(this);
1041
+ this.timeGrid.destroy();
1042
+ if (this.dayGrid) {
1043
+ this.dayGrid.destroy();
1044
+ }
1045
+ this.scroller.destroy();
1046
+ };
1047
+ /* Rendering
1048
+ ------------------------------------------------------------------------------------------------------------------*/
1049
+ // Builds the HTML skeleton for the view.
1050
+ // The day-grid and time-grid components will render inside containers defined by this HTML.
1051
+ TimeGridView.prototype.renderSkeletonHtml = function () {
1052
+ var theme = this.theme;
1053
+ return '' +
1054
+ '<table class="' + theme.getClass('tableGrid') + '">' +
1055
+ (this.opt('columnHeader') ?
1056
+ '<thead class="fc-head">' +
1057
+ '<tr>' +
1058
+ '<td class="fc-head-container ' + theme.getClass('widgetHeader') + '">&nbsp;</td>' +
1059
+ '</tr>' +
1060
+ '</thead>' :
1061
+ '') +
1062
+ '<tbody class="fc-body">' +
1063
+ '<tr>' +
1064
+ '<td class="' + theme.getClass('widgetContent') + '">' +
1065
+ (this.opt('allDaySlot') ?
1066
+ '<div class="fc-day-grid"></div>' +
1067
+ '<hr class="fc-divider ' + theme.getClass('widgetHeader') + '" />' :
1068
+ '') +
1069
+ '</td>' +
1070
+ '</tr>' +
1071
+ '</tbody>' +
1072
+ '</table>';
1073
+ };
1074
+ /* Now Indicator
1075
+ ------------------------------------------------------------------------------------------------------------------*/
1076
+ TimeGridView.prototype.getNowIndicatorUnit = function () {
1077
+ return this.timeGrid.getNowIndicatorUnit();
1078
+ };
1079
+ // subclasses should implement
1080
+ // renderNowIndicator(date: DateMarker) {
1081
+ // }
1082
+ TimeGridView.prototype.unrenderNowIndicator = function () {
1083
+ this.timeGrid.unrenderNowIndicator();
1084
+ };
1085
+ /* Dimensions
1086
+ ------------------------------------------------------------------------------------------------------------------*/
1087
+ TimeGridView.prototype.updateSize = function (isResize, viewHeight, isAuto) {
1088
+ _super.prototype.updateSize.call(this, isResize, viewHeight, isAuto); // will call updateBaseSize. important that executes first
1089
+ this.timeGrid.updateSize(isResize);
1090
+ if (this.dayGrid) {
1091
+ this.dayGrid.updateSize(isResize);
1092
+ }
1093
+ };
1094
+ // Adjusts the vertical dimensions of the view to the specified values
1095
+ TimeGridView.prototype.updateBaseSize = function (isResize, viewHeight, isAuto) {
1096
+ var _this = this;
1097
+ var eventLimit;
1098
+ var scrollerHeight;
1099
+ var scrollbarWidths;
1100
+ // make all axis cells line up
1101
+ this.axisWidth = matchCellWidths(findElements(this.el, '.fc-axis'));
1102
+ // hack to give the view some height prior to timeGrid's columns being rendered
1103
+ // TODO: separate setting height from scroller VS timeGrid.
1104
+ if (!this.timeGrid.colEls) {
1105
+ if (!isAuto) {
1106
+ scrollerHeight = this.computeScrollerHeight(viewHeight);
1107
+ this.scroller.setHeight(scrollerHeight);
1108
+ }
1109
+ return;
1110
+ }
1111
+ // set of fake row elements that must compensate when scroller has scrollbars
1112
+ var noScrollRowEls = findElements(this.el, '.fc-row').filter(function (node) {
1113
+ return !_this.scroller.el.contains(node);
1114
+ });
1115
+ // reset all dimensions back to the original state
1116
+ this.timeGrid.bottomRuleEl.style.display = 'none'; // will be shown later if this <hr> is necessary
1117
+ this.scroller.clear(); // sets height to 'auto' and clears overflow
1118
+ noScrollRowEls.forEach(uncompensateScroll);
1119
+ // limit number of events in the all-day area
1120
+ if (this.dayGrid) {
1121
+ this.dayGrid.removeSegPopover(); // kill the "more" popover if displayed
1122
+ eventLimit = this.opt('eventLimit');
1123
+ if (eventLimit && typeof eventLimit !== 'number') {
1124
+ eventLimit = TIMEGRID_ALL_DAY_EVENT_LIMIT; // make sure "auto" goes to a real number
1125
+ }
1126
+ if (eventLimit) {
1127
+ this.dayGrid.limitRows(eventLimit);
1128
+ }
1129
+ }
1130
+ if (!isAuto) { // should we force dimensions of the scroll container?
1131
+ scrollerHeight = this.computeScrollerHeight(viewHeight);
1132
+ this.scroller.setHeight(scrollerHeight);
1133
+ scrollbarWidths = this.scroller.getScrollbarWidths();
1134
+ if (scrollbarWidths.left || scrollbarWidths.right) { // using scrollbars?
1135
+ // make the all-day and header rows lines up
1136
+ noScrollRowEls.forEach(function (rowEl) {
1137
+ compensateScroll(rowEl, scrollbarWidths);
1138
+ });
1139
+ // the scrollbar compensation might have changed text flow, which might affect height, so recalculate
1140
+ // and reapply the desired height to the scroller.
1141
+ scrollerHeight = this.computeScrollerHeight(viewHeight);
1142
+ this.scroller.setHeight(scrollerHeight);
1143
+ }
1144
+ // guarantees the same scrollbar widths
1145
+ this.scroller.lockOverflow(scrollbarWidths);
1146
+ // if there's any space below the slats, show the horizontal rule.
1147
+ // this won't cause any new overflow, because lockOverflow already called.
1148
+ if (this.timeGrid.getTotalSlatHeight() < scrollerHeight) {
1149
+ this.timeGrid.bottomRuleEl.style.display = '';
1150
+ }
1151
+ }
1152
+ };
1153
+ // given a desired total height of the view, returns what the height of the scroller should be
1154
+ TimeGridView.prototype.computeScrollerHeight = function (viewHeight) {
1155
+ return viewHeight -
1156
+ subtractInnerElHeight(this.el, this.scroller.el); // everything that's NOT the scroller
1157
+ };
1158
+ /* Scroll
1159
+ ------------------------------------------------------------------------------------------------------------------*/
1160
+ // Computes the initial pre-configured scroll state prior to allowing the user to change it
1161
+ TimeGridView.prototype.computeDateScroll = function (duration) {
1162
+ var top = this.timeGrid.computeTimeTop(duration);
1163
+ // zoom can give weird floating-point values. rather scroll a little bit further
1164
+ top = Math.ceil(top);
1165
+ if (top) {
1166
+ top++; // to overcome top border that slots beyond the first have. looks better
1167
+ }
1168
+ return { top: top };
1169
+ };
1170
+ TimeGridView.prototype.queryDateScroll = function () {
1171
+ return { top: this.scroller.getScrollTop() };
1172
+ };
1173
+ TimeGridView.prototype.applyDateScroll = function (scroll) {
1174
+ if (scroll.top !== undefined) {
1175
+ this.scroller.setScrollTop(scroll.top);
1176
+ }
1177
+ };
1178
+ // Generates an HTML attribute string for setting the width of the axis, if it is known
1179
+ TimeGridView.prototype.axisStyleAttr = function () {
1180
+ if (this.axisWidth != null) {
1181
+ return 'style="width:' + this.axisWidth + 'px"';
1182
+ }
1183
+ return '';
1184
+ };
1185
+ return TimeGridView;
1186
+ }(View));
1187
+ TimeGridView.prototype.usesMinMaxTime = true; // indicates that minTime/maxTime affects rendering
1188
+
1189
+ var SimpleTimeGrid = /** @class */ (function (_super) {
1190
+ __extends(SimpleTimeGrid, _super);
1191
+ function SimpleTimeGrid(context, timeGrid) {
1192
+ var _this = _super.call(this, context, timeGrid.el) || this;
1193
+ _this.buildDayRanges = memoize(buildDayRanges);
1194
+ _this.slicer = new TimeGridSlicer();
1195
+ _this.timeGrid = timeGrid;
1196
+ context.calendar.registerInteractiveComponent(_this, {
1197
+ el: _this.timeGrid.el
1198
+ });
1199
+ return _this;
1200
+ }
1201
+ SimpleTimeGrid.prototype.destroy = function () {
1202
+ _super.prototype.destroy.call(this);
1203
+ this.calendar.unregisterInteractiveComponent(this);
1204
+ };
1205
+ SimpleTimeGrid.prototype.render = function (props) {
1206
+ var dateProfile = props.dateProfile, dayTable = props.dayTable;
1207
+ var dayRanges = this.dayRanges = this.buildDayRanges(dayTable, dateProfile, this.dateEnv);
1208
+ this.timeGrid.receiveProps(__assign({}, this.slicer.sliceProps(props, dateProfile, null, this.timeGrid, dayRanges), { dateProfile: dateProfile, cells: dayTable.cells[0] }));
1209
+ };
1210
+ SimpleTimeGrid.prototype.renderNowIndicator = function (date) {
1211
+ this.timeGrid.renderNowIndicator(this.slicer.sliceNowDate(date, this.timeGrid, this.dayRanges), date);
1212
+ };
1213
+ SimpleTimeGrid.prototype.buildPositionCaches = function () {
1214
+ this.timeGrid.buildPositionCaches();
1215
+ };
1216
+ SimpleTimeGrid.prototype.queryHit = function (positionLeft, positionTop) {
1217
+ var rawHit = this.timeGrid.positionToHit(positionLeft, positionTop);
1218
+ if (rawHit) {
1219
+ return {
1220
+ component: this.timeGrid,
1221
+ dateSpan: rawHit.dateSpan,
1222
+ dayEl: rawHit.dayEl,
1223
+ rect: {
1224
+ left: rawHit.relativeRect.left,
1225
+ right: rawHit.relativeRect.right,
1226
+ top: rawHit.relativeRect.top,
1227
+ bottom: rawHit.relativeRect.bottom
1228
+ },
1229
+ layer: 0
1230
+ };
1231
+ }
1232
+ };
1233
+ return SimpleTimeGrid;
1234
+ }(DateComponent));
1235
+ function buildDayRanges(dayTable, dateProfile, dateEnv) {
1236
+ var ranges = [];
1237
+ for (var _i = 0, _a = dayTable.headerDates; _i < _a.length; _i++) {
1238
+ var date = _a[_i];
1239
+ ranges.push({
1240
+ start: dateEnv.add(date, dateProfile.minTime),
1241
+ end: dateEnv.add(date, dateProfile.maxTime)
1242
+ });
1243
+ }
1244
+ return ranges;
1245
+ }
1246
+ var TimeGridSlicer = /** @class */ (function (_super) {
1247
+ __extends(TimeGridSlicer, _super);
1248
+ function TimeGridSlicer() {
1249
+ return _super !== null && _super.apply(this, arguments) || this;
1250
+ }
1251
+ TimeGridSlicer.prototype.sliceRange = function (range, dayRanges) {
1252
+ var segs = [];
1253
+ for (var col = 0; col < dayRanges.length; col++) {
1254
+ var segRange = intersectRanges(range, dayRanges[col]);
1255
+ if (segRange) {
1256
+ segs.push({
1257
+ start: segRange.start,
1258
+ end: segRange.end,
1259
+ isStart: segRange.start.valueOf() === range.start.valueOf(),
1260
+ isEnd: segRange.end.valueOf() === range.end.valueOf(),
1261
+ col: col
1262
+ });
1263
+ }
1264
+ }
1265
+ return segs;
1266
+ };
1267
+ return TimeGridSlicer;
1268
+ }(Slicer));
1269
+
1270
+ var TimeGridView$1 = /** @class */ (function (_super) {
1271
+ __extends(TimeGridView, _super);
1272
+ function TimeGridView(_context, viewSpec, dateProfileGenerator, parentEl) {
1273
+ var _this = _super.call(this, _context, viewSpec, dateProfileGenerator, parentEl) || this;
1274
+ _this.buildDayTable = memoize(buildDayTable);
1275
+ if (_this.opt('columnHeader')) {
1276
+ _this.header = new DayHeader(_this.context, _this.el.querySelector('.fc-head-container'));
1277
+ }
1278
+ _this.simpleTimeGrid = new SimpleTimeGrid(_this.context, _this.timeGrid);
1279
+ if (_this.dayGrid) {
1280
+ _this.simpleDayGrid = new SimpleDayGrid(_this.context, _this.dayGrid);
1281
+ }
1282
+ return _this;
1283
+ }
1284
+ TimeGridView.prototype.destroy = function () {
1285
+ _super.prototype.destroy.call(this);
1286
+ if (this.header) {
1287
+ this.header.destroy();
1288
+ }
1289
+ this.simpleTimeGrid.destroy();
1290
+ if (this.simpleDayGrid) {
1291
+ this.simpleDayGrid.destroy();
1292
+ }
1293
+ };
1294
+ TimeGridView.prototype.render = function (props) {
1295
+ _super.prototype.render.call(this, props); // for flags for updateSize
1296
+ var dateProfile = this.props.dateProfile;
1297
+ var dayTable = this.buildDayTable(dateProfile, this.dateProfileGenerator);
1298
+ var splitProps = this.splitter.splitProps(props);
1299
+ if (this.header) {
1300
+ this.header.receiveProps({
1301
+ dateProfile: dateProfile,
1302
+ dates: dayTable.headerDates,
1303
+ datesRepDistinctDays: true,
1304
+ renderIntroHtml: this.renderHeadIntroHtml
1305
+ });
1306
+ }
1307
+ this.simpleTimeGrid.receiveProps(__assign({}, splitProps['timed'], { dateProfile: dateProfile,
1308
+ dayTable: dayTable }));
1309
+ if (this.simpleDayGrid) {
1310
+ this.simpleDayGrid.receiveProps(__assign({}, splitProps['allDay'], { dateProfile: dateProfile,
1311
+ dayTable: dayTable, nextDayThreshold: this.nextDayThreshold, isRigid: false }));
1312
+ }
1313
+ };
1314
+ TimeGridView.prototype.renderNowIndicator = function (date) {
1315
+ this.simpleTimeGrid.renderNowIndicator(date);
1316
+ };
1317
+ return TimeGridView;
1318
+ }(TimeGridView));
1319
+ function buildDayTable(dateProfile, dateProfileGenerator) {
1320
+ var daySeries = new DaySeries(dateProfile.renderRange, dateProfileGenerator);
1321
+ return new DayTable(daySeries, false);
1322
+ }
1323
+
1324
+ var main = createPlugin({
1325
+ defaultView: 'timeGridWeek',
1326
+ views: {
1327
+ timeGrid: {
1328
+ class: TimeGridView$1,
1329
+ allDaySlot: true,
1330
+ slotDuration: '00:30:00',
1331
+ slotEventOverlap: true // a bad name. confused with overlap/constraint system
1332
+ },
1333
+ timeGridDay: {
1334
+ type: 'timeGrid',
1335
+ duration: { days: 1 }
1336
+ },
1337
+ timeGridWeek: {
1338
+ type: 'timeGrid',
1339
+ duration: { weeks: 1 }
1340
+ }
1341
+ }
1342
+ });
1343
+
1344
+ export default main;
1345
+ export { TimeGridView as AbstractTimeGridView, TimeGrid, TimeGridSlicer, TimeGridView$1 as TimeGridView, buildDayRanges, buildDayTable };