@fullcalendar/core 7.0.0-beta.4 → 7.0.0-beta.5

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 (599) hide show
  1. package/LICENSE.md +1 -1
  2. package/README.md +7 -1
  3. package/{index.cjs → cjs/index.cjs} +491 -365
  4. package/cjs/internal-classnames.cjs +11 -0
  5. package/{internal-common.cjs → cjs/internal-common.cjs} +5221 -5034
  6. package/{internal.cjs → cjs/internal.cjs} +24 -19
  7. package/{locales → cjs/locales}/af.cjs +8 -10
  8. package/{locales → cjs/locales}/ar-dz.cjs +7 -10
  9. package/{locales → cjs/locales}/ar-kw.cjs +7 -10
  10. package/{locales → cjs/locales}/ar-ly.cjs +7 -10
  11. package/{locales → cjs/locales}/ar-ma.cjs +7 -10
  12. package/{locales → cjs/locales}/ar-sa.cjs +7 -10
  13. package/{locales → cjs/locales}/ar-tn.cjs +7 -10
  14. package/{locales → cjs/locales}/ar.cjs +7 -10
  15. package/{locales → cjs/locales}/az.cjs +8 -11
  16. package/{locales → cjs/locales}/bg.cjs +8 -10
  17. package/{locales → cjs/locales}/bn.cjs +7 -10
  18. package/{locales → cjs/locales}/bs.cjs +10 -12
  19. package/{locales → cjs/locales}/ca.cjs +10 -12
  20. package/{locales → cjs/locales}/cs.cjs +9 -11
  21. package/{locales → cjs/locales}/cy.cjs +8 -11
  22. package/{locales → cjs/locales}/da.cjs +8 -11
  23. package/cjs/locales/de-at.cjs +57 -0
  24. package/cjs/locales/de.cjs +57 -0
  25. package/{locales → cjs/locales}/el.cjs +9 -11
  26. package/{locales → cjs/locales}/en-au.cjs +4 -5
  27. package/{locales → cjs/locales}/en-gb.cjs +4 -5
  28. package/{locales → cjs/locales}/en-nz.cjs +4 -5
  29. package/{locales → cjs/locales}/eo.cjs +10 -12
  30. package/cjs/locales/es-us.cjs +34 -0
  31. package/cjs/locales/es.cjs +40 -0
  32. package/{locales → cjs/locales}/et.cjs +10 -12
  33. package/{locales → cjs/locales}/eu.cjs +10 -12
  34. package/{locales → cjs/locales}/fa.cjs +9 -11
  35. package/{locales → cjs/locales}/fi.cjs +10 -12
  36. package/cjs/locales/fr-ca.cjs +21 -0
  37. package/{locales → cjs/locales}/fr-ch.cjs +10 -12
  38. package/{locales → cjs/locales}/fr.cjs +10 -13
  39. package/cjs/locales/gl.cjs +40 -0
  40. package/{locales → cjs/locales}/he.cjs +8 -11
  41. package/{locales → cjs/locales}/hi.cjs +9 -11
  42. package/{locales → cjs/locales}/hr.cjs +10 -12
  43. package/{locales → cjs/locales}/hu.cjs +8 -11
  44. package/{locales → cjs/locales}/hy-am.cjs +9 -11
  45. package/{locales → cjs/locales}/id.cjs +10 -12
  46. package/{locales → cjs/locales}/is.cjs +8 -11
  47. package/{locales → cjs/locales}/it.cjs +10 -12
  48. package/{locales → cjs/locales}/ja.cjs +7 -10
  49. package/cjs/locales/ka.cjs +27 -0
  50. package/{locales → cjs/locales}/kk.cjs +9 -12
  51. package/{locales → cjs/locales}/km.cjs +7 -10
  52. package/{locales → cjs/locales}/ko.cjs +7 -10
  53. package/{locales → cjs/locales}/ku.cjs +7 -10
  54. package/{locales → cjs/locales}/lb.cjs +10 -12
  55. package/{locales → cjs/locales}/lt.cjs +10 -12
  56. package/{locales → cjs/locales}/lv.cjs +10 -12
  57. package/{locales → cjs/locales}/mk.cjs +9 -11
  58. package/{locales → cjs/locales}/ms.cjs +10 -12
  59. package/{locales → cjs/locales}/nb.cjs +11 -17
  60. package/{locales → cjs/locales}/ne.cjs +7 -10
  61. package/{locales → cjs/locales}/nl.cjs +8 -10
  62. package/{locales → cjs/locales}/nn.cjs +8 -11
  63. package/{locales → cjs/locales}/pl.cjs +10 -12
  64. package/cjs/locales/pt-br.cjs +40 -0
  65. package/{locales → cjs/locales}/pt.cjs +10 -12
  66. package/{locales → cjs/locales}/ro.cjs +10 -12
  67. package/{locales → cjs/locales}/ru.cjs +10 -12
  68. package/{locales → cjs/locales}/si-lk.cjs +9 -11
  69. package/{locales → cjs/locales}/sk.cjs +9 -11
  70. package/{locales → cjs/locales}/sl.cjs +7 -10
  71. package/{locales → cjs/locales}/sm.cjs +7 -10
  72. package/{locales → cjs/locales}/sq.cjs +10 -12
  73. package/{locales → cjs/locales}/sr-cyrl.cjs +9 -11
  74. package/{locales → cjs/locales}/sr.cjs +9 -11
  75. package/cjs/locales/sv.cjs +41 -0
  76. package/{locales → cjs/locales}/ta-in.cjs +8 -11
  77. package/{locales → cjs/locales}/th.cjs +9 -12
  78. package/{locales → cjs/locales}/tr.cjs +9 -11
  79. package/cjs/locales/ug.cjs +18 -0
  80. package/{locales → cjs/locales}/uk.cjs +10 -12
  81. package/{locales → cjs/locales}/uz-cy.cjs +7 -10
  82. package/{locales → cjs/locales}/uz.cjs +8 -10
  83. package/{locales → cjs/locales}/vi.cjs +9 -11
  84. package/{locales → cjs/locales}/zh-cn.cjs +7 -10
  85. package/{locales → cjs/locales}/zh-tw.cjs +7 -10
  86. package/{preact.cjs → cjs/preact.cjs} +1 -0
  87. package/esm/index.d.ts +53 -0
  88. package/{index.js → esm/index.js} +493 -369
  89. package/esm/internal-classnames.d.ts +1 -0
  90. package/esm/internal-classnames.js +3 -0
  91. package/{internal-common.d.ts → esm/internal-common.d.ts} +714 -692
  92. package/{internal-common.js → esm/internal-common.js} +5194 -5011
  93. package/esm/internal.d.ts +5 -0
  94. package/esm/internal.js +3 -0
  95. package/{locales → esm/locales}/af.js +8 -10
  96. package/{locales → esm/locales}/ar-dz.js +7 -10
  97. package/{locales → esm/locales}/ar-kw.js +7 -10
  98. package/{locales → esm/locales}/ar-ly.js +7 -10
  99. package/{locales → esm/locales}/ar-ma.js +7 -10
  100. package/{locales → esm/locales}/ar-sa.js +7 -10
  101. package/{locales → esm/locales}/ar-tn.js +7 -10
  102. package/{locales → esm/locales}/ar.js +7 -10
  103. package/{locales → esm/locales}/az.js +8 -11
  104. package/{locales → esm/locales}/bg.js +8 -10
  105. package/{locales → esm/locales}/bn.js +7 -10
  106. package/{locales → esm/locales}/bs.js +10 -12
  107. package/esm/locales/ca.js +21 -0
  108. package/{locales → esm/locales}/cs.js +9 -11
  109. package/{locales → esm/locales}/cy.js +8 -11
  110. package/{locales → esm/locales}/da.js +8 -11
  111. package/esm/locales/de-at.js +53 -0
  112. package/esm/locales/de.js +53 -0
  113. package/{locales → esm/locales}/el.js +9 -11
  114. package/{locales → esm/locales}/en-au.js +4 -5
  115. package/{locales → esm/locales}/en-gb.js +4 -5
  116. package/{locales → esm/locales}/en-nz.js +4 -5
  117. package/esm/locales/eo.js +21 -0
  118. package/esm/locales/es-us.js +30 -0
  119. package/esm/locales/es.js +36 -0
  120. package/{locales → esm/locales}/et.js +10 -12
  121. package/esm/locales/eu.js +21 -0
  122. package/{locales → esm/locales}/fa.js +9 -11
  123. package/esm/locales/fi.js +21 -0
  124. package/esm/locales/fr-ca.js +17 -0
  125. package/esm/locales/fr-ch.js +21 -0
  126. package/esm/locales/fr.js +21 -0
  127. package/esm/locales/gl.js +36 -0
  128. package/esm/locales/he.js +17 -0
  129. package/{locales → esm/locales}/hi.js +9 -11
  130. package/{locales → esm/locales}/hr.js +10 -12
  131. package/{locales → esm/locales}/hu.js +8 -11
  132. package/{locales → esm/locales}/hy-am.js +9 -11
  133. package/esm/locales/id.js +21 -0
  134. package/{locales → esm/locales}/is.js +8 -11
  135. package/{locales → esm/locales}/it.js +10 -12
  136. package/{locales → esm/locales}/ja.js +7 -10
  137. package/esm/locales/ka.js +23 -0
  138. package/esm/locales/kk.js +22 -0
  139. package/{locales → esm/locales}/km.js +7 -10
  140. package/esm/locales/ko.js +16 -0
  141. package/{locales → esm/locales}/ku.js +7 -10
  142. package/esm/locales/lb.js +21 -0
  143. package/esm/locales/lt.js +21 -0
  144. package/esm/locales/lv.js +23 -0
  145. package/esm/locales/mk.js +19 -0
  146. package/{locales → esm/locales}/ms.js +10 -12
  147. package/{locales → esm/locales}/nb.js +11 -17
  148. package/{locales → esm/locales}/ne.js +7 -10
  149. package/{locales → esm/locales}/nl.js +8 -10
  150. package/{locales → esm/locales}/nn.js +8 -11
  151. package/esm/locales/pl.js +21 -0
  152. package/esm/locales/pt-br.js +36 -0
  153. package/esm/locales/pt.js +21 -0
  154. package/{locales → esm/locales}/ro.js +10 -12
  155. package/esm/locales/ru.js +23 -0
  156. package/esm/locales/si-lk.js +21 -0
  157. package/{locales → esm/locales}/sk.js +9 -11
  158. package/{locales → esm/locales}/sl.js +7 -10
  159. package/esm/locales/sm.js +16 -0
  160. package/{locales → esm/locales}/sq.js +10 -12
  161. package/{locales → esm/locales}/sr-cyrl.js +9 -11
  162. package/{locales → esm/locales}/sr.js +9 -11
  163. package/esm/locales/sv.js +37 -0
  164. package/esm/locales/ta-in.js +22 -0
  165. package/esm/locales/th.js +22 -0
  166. package/{locales → esm/locales}/tr.js +9 -11
  167. package/esm/locales/ug.js +14 -0
  168. package/esm/locales/uk.js +23 -0
  169. package/{locales → esm/locales}/uz-cy.js +7 -10
  170. package/{locales → esm/locales}/uz.js +8 -10
  171. package/{locales → esm/locales}/vi.js +9 -11
  172. package/{locales → esm/locales}/zh-cn.js +7 -10
  173. package/esm/locales/zh-tw.js +16 -0
  174. package/{preact.d.ts → esm/preact.d.ts} +4 -3
  175. package/esm/preact.js +3 -0
  176. package/{locales/af.global.js → global/locales/af.js} +12 -14
  177. package/global/locales/af.min.js +6 -0
  178. package/{locales/ar-dz.global.js → global/locales/ar-dz.js} +11 -14
  179. package/global/locales/ar-dz.min.js +6 -0
  180. package/{locales/ar-kw.global.js → global/locales/ar-kw.js} +11 -14
  181. package/global/locales/ar-kw.min.js +6 -0
  182. package/{locales/ar-ly.global.js → global/locales/ar-ly.js} +11 -14
  183. package/global/locales/ar-ly.min.js +6 -0
  184. package/{locales/ar-ma.global.js → global/locales/ar-ma.js} +11 -14
  185. package/global/locales/ar-ma.min.js +6 -0
  186. package/{locales/ar-sa.global.js → global/locales/ar-sa.js} +11 -14
  187. package/global/locales/ar-sa.min.js +6 -0
  188. package/{locales/ar-tn.global.js → global/locales/ar-tn.js} +11 -14
  189. package/global/locales/ar-tn.min.js +6 -0
  190. package/{locales/ar.global.js → global/locales/ar.js} +11 -14
  191. package/global/locales/ar.min.js +6 -0
  192. package/{locales/az.global.js → global/locales/az.js} +12 -15
  193. package/global/locales/az.min.js +6 -0
  194. package/{locales/bg.global.js → global/locales/bg.js} +12 -14
  195. package/global/locales/bg.min.js +6 -0
  196. package/{locales/bn.global.js → global/locales/bn.js} +11 -14
  197. package/global/locales/bn.min.js +6 -0
  198. package/global/locales/bs.js +33 -0
  199. package/global/locales/bs.min.js +6 -0
  200. package/global/locales/ca.js +31 -0
  201. package/global/locales/ca.min.js +6 -0
  202. package/{locales/cs.global.js → global/locales/cs.js} +13 -15
  203. package/global/locales/cs.min.js +6 -0
  204. package/global/locales/cy.js +30 -0
  205. package/global/locales/cy.min.js +6 -0
  206. package/global/locales/da.js +30 -0
  207. package/global/locales/da.min.js +6 -0
  208. package/global/locales/de-at.js +63 -0
  209. package/global/locales/de-at.min.js +6 -0
  210. package/global/locales/de.js +63 -0
  211. package/global/locales/de.min.js +6 -0
  212. package/global/locales/el.js +31 -0
  213. package/global/locales/el.min.js +6 -0
  214. package/{locales/en-au.global.js → global/locales/en-au.js} +8 -9
  215. package/global/locales/en-au.min.js +6 -0
  216. package/{locales/en-gb.global.js → global/locales/en-gb.js} +8 -9
  217. package/global/locales/en-gb.min.js +6 -0
  218. package/{locales/en-nz.global.js → global/locales/en-nz.js} +8 -9
  219. package/global/locales/en-nz.min.js +6 -0
  220. package/global/locales/eo.js +31 -0
  221. package/global/locales/eo.min.js +6 -0
  222. package/global/locales/es-us.js +40 -0
  223. package/global/locales/es-us.min.js +6 -0
  224. package/global/locales/es.js +46 -0
  225. package/global/locales/es.min.js +6 -0
  226. package/global/locales/et.js +33 -0
  227. package/global/locales/et.min.js +6 -0
  228. package/global/locales/eu.js +31 -0
  229. package/global/locales/eu.min.js +6 -0
  230. package/{locales/fa.global.js → global/locales/fa.js} +13 -15
  231. package/global/locales/fa.min.js +6 -0
  232. package/global/locales/fi.js +31 -0
  233. package/global/locales/fi.min.js +6 -0
  234. package/global/locales/fr-ca.js +27 -0
  235. package/global/locales/fr-ca.min.js +6 -0
  236. package/global/locales/fr-ch.js +31 -0
  237. package/global/locales/fr-ch.min.js +6 -0
  238. package/global/locales/fr.js +31 -0
  239. package/global/locales/fr.min.js +6 -0
  240. package/global/locales/gl.js +46 -0
  241. package/global/locales/gl.min.js +6 -0
  242. package/global/locales/he.js +27 -0
  243. package/global/locales/he.min.js +6 -0
  244. package/{locales/hi.global.js → global/locales/hi.js} +13 -15
  245. package/global/locales/hi.min.js +6 -0
  246. package/global/locales/hr.js +33 -0
  247. package/global/locales/hr.min.js +6 -0
  248. package/global/locales/hu.js +30 -0
  249. package/global/locales/hu.min.js +6 -0
  250. package/{locales/hy-am.global.js → global/locales/hy-am.js} +13 -15
  251. package/global/locales/hy-am.min.js +6 -0
  252. package/global/locales/id.js +31 -0
  253. package/global/locales/id.min.js +6 -0
  254. package/global/locales/is.js +30 -0
  255. package/global/locales/is.min.js +6 -0
  256. package/global/locales/it.js +33 -0
  257. package/global/locales/it.min.js +6 -0
  258. package/global/locales/ja.js +28 -0
  259. package/global/locales/ja.min.js +6 -0
  260. package/global/locales/ka.js +33 -0
  261. package/global/locales/ka.min.js +6 -0
  262. package/global/locales/kk.js +32 -0
  263. package/global/locales/kk.min.js +6 -0
  264. package/{locales/km.global.js → global/locales/km.js} +11 -14
  265. package/global/locales/km.min.js +6 -0
  266. package/global/locales/ko.js +26 -0
  267. package/global/locales/ko.min.js +6 -0
  268. package/{locales/ku.global.js → global/locales/ku.js} +11 -14
  269. package/global/locales/ku.min.js +6 -0
  270. package/global/locales/lb.js +31 -0
  271. package/global/locales/lb.min.js +6 -0
  272. package/global/locales/lt.js +31 -0
  273. package/global/locales/lt.min.js +6 -0
  274. package/global/locales/lv.js +33 -0
  275. package/global/locales/lv.min.js +6 -0
  276. package/global/locales/mk.js +29 -0
  277. package/global/locales/mk.min.js +6 -0
  278. package/global/locales/ms.js +33 -0
  279. package/global/locales/ms.min.js +6 -0
  280. package/{locales/nb.global.js → global/locales/nb.js} +15 -21
  281. package/global/locales/nb.min.js +6 -0
  282. package/{locales/ne.global.js → global/locales/ne.js} +11 -14
  283. package/global/locales/ne.min.js +6 -0
  284. package/{locales/nl.global.js → global/locales/nl.js} +12 -14
  285. package/global/locales/nl.min.js +6 -0
  286. package/global/locales/nn.js +30 -0
  287. package/global/locales/nn.min.js +6 -0
  288. package/global/locales/pl.js +31 -0
  289. package/global/locales/pl.min.js +6 -0
  290. package/global/locales/pt-br.js +46 -0
  291. package/global/locales/pt-br.min.js +6 -0
  292. package/global/locales/pt.js +31 -0
  293. package/global/locales/pt.min.js +6 -0
  294. package/global/locales/ro.js +33 -0
  295. package/global/locales/ro.min.js +6 -0
  296. package/global/locales/ru.js +33 -0
  297. package/global/locales/ru.min.js +6 -0
  298. package/global/locales/si-lk.js +31 -0
  299. package/global/locales/si-lk.min.js +6 -0
  300. package/{locales/sk.global.js → global/locales/sk.js} +13 -15
  301. package/global/locales/sk.min.js +6 -0
  302. package/{locales/sl.global.js → global/locales/sl.js} +11 -14
  303. package/global/locales/sl.min.js +6 -0
  304. package/global/locales/sm.js +26 -0
  305. package/global/locales/sm.min.js +6 -0
  306. package/global/locales/sq.js +33 -0
  307. package/global/locales/sq.min.js +6 -0
  308. package/{locales/sr-cyrl.global.js → global/locales/sr-cyrl.js} +13 -15
  309. package/global/locales/sr-cyrl.min.js +6 -0
  310. package/{locales/sr.global.js → global/locales/sr.js} +13 -15
  311. package/global/locales/sr.min.js +6 -0
  312. package/global/locales/sv.js +47 -0
  313. package/global/locales/sv.min.js +6 -0
  314. package/global/locales/ta-in.js +32 -0
  315. package/global/locales/ta-in.min.js +6 -0
  316. package/global/locales/th.js +32 -0
  317. package/global/locales/th.min.js +6 -0
  318. package/{locales/tr.global.js → global/locales/tr.js} +13 -15
  319. package/global/locales/tr.min.js +6 -0
  320. package/global/locales/ug.js +24 -0
  321. package/global/locales/ug.min.js +6 -0
  322. package/global/locales/uk.js +33 -0
  323. package/global/locales/uk.min.js +6 -0
  324. package/{locales/uz-cy.global.js → global/locales/uz-cy.js} +11 -14
  325. package/global/locales/uz-cy.min.js +6 -0
  326. package/{locales/uz.global.js → global/locales/uz.js} +12 -14
  327. package/global/locales/uz.min.js +6 -0
  328. package/{locales/vi.global.js → global/locales/vi.js} +13 -15
  329. package/global/locales/vi.min.js +6 -0
  330. package/{locales/zh-cn.global.js → global/locales/zh-cn.js} +11 -14
  331. package/global/locales/zh-cn.min.js +6 -0
  332. package/global/locales/zh-tw.js +26 -0
  333. package/global/locales/zh-tw.min.js +6 -0
  334. package/global/locales-all.js +1730 -0
  335. package/global/locales-all.min.js +6 -0
  336. package/{index.global.js → global.js} +5164 -4848
  337. package/global.min.js +6 -0
  338. package/package.json +53 -35
  339. package/skeleton.css +477 -0
  340. package/skeleton.min.css +1 -0
  341. package/skeleton.styles.js +30 -0
  342. package/index.d.ts +0 -48
  343. package/index.global.min.js +0 -6
  344. package/internal.d.ts +0 -4
  345. package/internal.js +0 -3
  346. package/locales/af.global.min.js +0 -6
  347. package/locales/ar-dz.global.min.js +0 -6
  348. package/locales/ar-kw.global.min.js +0 -6
  349. package/locales/ar-ly.global.min.js +0 -6
  350. package/locales/ar-ma.global.min.js +0 -6
  351. package/locales/ar-sa.global.min.js +0 -6
  352. package/locales/ar-tn.global.min.js +0 -6
  353. package/locales/ar.global.min.js +0 -6
  354. package/locales/az.global.min.js +0 -6
  355. package/locales/bg.global.min.js +0 -6
  356. package/locales/bn.global.min.js +0 -6
  357. package/locales/bs.global.js +0 -35
  358. package/locales/bs.global.min.js +0 -6
  359. package/locales/ca.global.js +0 -33
  360. package/locales/ca.global.min.js +0 -6
  361. package/locales/ca.js +0 -23
  362. package/locales/cs.global.min.js +0 -6
  363. package/locales/cy.global.js +0 -33
  364. package/locales/cy.global.min.js +0 -6
  365. package/locales/da.global.js +0 -33
  366. package/locales/da.global.min.js +0 -6
  367. package/locales/de-at.cjs +0 -62
  368. package/locales/de-at.global.js +0 -68
  369. package/locales/de-at.global.min.js +0 -6
  370. package/locales/de-at.js +0 -58
  371. package/locales/de.cjs +0 -62
  372. package/locales/de.global.js +0 -68
  373. package/locales/de.global.min.js +0 -6
  374. package/locales/de.js +0 -58
  375. package/locales/el.global.js +0 -33
  376. package/locales/el.global.min.js +0 -6
  377. package/locales/en-au.global.min.js +0 -6
  378. package/locales/en-gb.global.min.js +0 -6
  379. package/locales/en-nz.global.min.js +0 -6
  380. package/locales/eo.global.js +0 -33
  381. package/locales/eo.global.min.js +0 -6
  382. package/locales/eo.js +0 -23
  383. package/locales/es-us.cjs +0 -27
  384. package/locales/es-us.global.js +0 -33
  385. package/locales/es-us.global.min.js +0 -6
  386. package/locales/es-us.js +0 -23
  387. package/locales/es.cjs +0 -45
  388. package/locales/es.global.js +0 -51
  389. package/locales/es.global.min.js +0 -6
  390. package/locales/es.js +0 -41
  391. package/locales/et.global.js +0 -35
  392. package/locales/et.global.min.js +0 -6
  393. package/locales/eu.global.js +0 -33
  394. package/locales/eu.global.min.js +0 -6
  395. package/locales/eu.js +0 -23
  396. package/locales/fa.global.min.js +0 -6
  397. package/locales/fi.global.js +0 -33
  398. package/locales/fi.global.min.js +0 -6
  399. package/locales/fi.js +0 -23
  400. package/locales/fr-ca.cjs +0 -23
  401. package/locales/fr-ca.global.js +0 -29
  402. package/locales/fr-ca.global.min.js +0 -6
  403. package/locales/fr-ca.js +0 -19
  404. package/locales/fr-ch.global.js +0 -33
  405. package/locales/fr-ch.global.min.js +0 -6
  406. package/locales/fr-ch.js +0 -23
  407. package/locales/fr.global.js +0 -34
  408. package/locales/fr.global.min.js +0 -6
  409. package/locales/fr.js +0 -24
  410. package/locales/gl.cjs +0 -45
  411. package/locales/gl.global.js +0 -51
  412. package/locales/gl.global.min.js +0 -6
  413. package/locales/gl.js +0 -41
  414. package/locales/he.global.js +0 -30
  415. package/locales/he.global.min.js +0 -6
  416. package/locales/he.js +0 -20
  417. package/locales/hi.global.min.js +0 -6
  418. package/locales/hr.global.js +0 -35
  419. package/locales/hr.global.min.js +0 -6
  420. package/locales/hu.global.js +0 -33
  421. package/locales/hu.global.min.js +0 -6
  422. package/locales/hy-am.global.min.js +0 -6
  423. package/locales/id.global.js +0 -33
  424. package/locales/id.global.min.js +0 -6
  425. package/locales/id.js +0 -23
  426. package/locales/is.global.js +0 -33
  427. package/locales/is.global.min.js +0 -6
  428. package/locales/it.global.js +0 -35
  429. package/locales/it.global.min.js +0 -6
  430. package/locales/ja.global.js +0 -31
  431. package/locales/ja.global.min.js +0 -6
  432. package/locales/ka.cjs +0 -29
  433. package/locales/ka.global.js +0 -35
  434. package/locales/ka.global.min.js +0 -6
  435. package/locales/ka.js +0 -25
  436. package/locales/kk.global.js +0 -35
  437. package/locales/kk.global.min.js +0 -6
  438. package/locales/kk.js +0 -25
  439. package/locales/km.global.min.js +0 -6
  440. package/locales/ko.global.js +0 -29
  441. package/locales/ko.global.min.js +0 -6
  442. package/locales/ko.js +0 -19
  443. package/locales/ku.global.min.js +0 -6
  444. package/locales/lb.global.js +0 -33
  445. package/locales/lb.global.min.js +0 -6
  446. package/locales/lb.js +0 -23
  447. package/locales/lt.global.js +0 -33
  448. package/locales/lt.global.min.js +0 -6
  449. package/locales/lt.js +0 -23
  450. package/locales/lv.global.js +0 -35
  451. package/locales/lv.global.min.js +0 -6
  452. package/locales/lv.js +0 -25
  453. package/locales/mk.global.js +0 -31
  454. package/locales/mk.global.min.js +0 -6
  455. package/locales/mk.js +0 -21
  456. package/locales/ms.global.js +0 -35
  457. package/locales/ms.global.min.js +0 -6
  458. package/locales/nb.global.min.js +0 -6
  459. package/locales/ne.global.min.js +0 -6
  460. package/locales/nl.global.min.js +0 -6
  461. package/locales/nn.global.js +0 -33
  462. package/locales/nn.global.min.js +0 -6
  463. package/locales/pl.global.js +0 -33
  464. package/locales/pl.global.min.js +0 -6
  465. package/locales/pl.js +0 -23
  466. package/locales/pt-br.cjs +0 -45
  467. package/locales/pt-br.global.js +0 -51
  468. package/locales/pt-br.global.min.js +0 -6
  469. package/locales/pt-br.js +0 -41
  470. package/locales/pt.global.js +0 -33
  471. package/locales/pt.global.min.js +0 -6
  472. package/locales/pt.js +0 -23
  473. package/locales/ro.global.js +0 -35
  474. package/locales/ro.global.min.js +0 -6
  475. package/locales/ru.global.js +0 -35
  476. package/locales/ru.global.min.js +0 -6
  477. package/locales/ru.js +0 -25
  478. package/locales/si-lk.global.js +0 -33
  479. package/locales/si-lk.global.min.js +0 -6
  480. package/locales/si-lk.js +0 -23
  481. package/locales/sk.global.min.js +0 -6
  482. package/locales/sl.global.min.js +0 -6
  483. package/locales/sm.global.js +0 -29
  484. package/locales/sm.global.min.js +0 -6
  485. package/locales/sm.js +0 -19
  486. package/locales/sq.global.js +0 -35
  487. package/locales/sq.global.min.js +0 -6
  488. package/locales/sr-cyrl.global.min.js +0 -6
  489. package/locales/sr.global.min.js +0 -6
  490. package/locales/sv.cjs +0 -46
  491. package/locales/sv.global.js +0 -52
  492. package/locales/sv.global.min.js +0 -6
  493. package/locales/sv.js +0 -42
  494. package/locales/ta-in.global.js +0 -35
  495. package/locales/ta-in.global.min.js +0 -6
  496. package/locales/ta-in.js +0 -25
  497. package/locales/th.global.js +0 -35
  498. package/locales/th.global.min.js +0 -6
  499. package/locales/th.js +0 -25
  500. package/locales/tr.global.min.js +0 -6
  501. package/locales/ug.cjs +0 -20
  502. package/locales/ug.global.js +0 -26
  503. package/locales/ug.global.min.js +0 -6
  504. package/locales/ug.js +0 -16
  505. package/locales/uk.global.js +0 -35
  506. package/locales/uk.global.min.js +0 -6
  507. package/locales/uk.js +0 -25
  508. package/locales/uz-cy.global.min.js +0 -6
  509. package/locales/uz.global.min.js +0 -6
  510. package/locales/vi.global.min.js +0 -6
  511. package/locales/zh-cn.global.min.js +0 -6
  512. package/locales/zh-tw.global.js +0 -29
  513. package/locales/zh-tw.global.min.js +0 -6
  514. package/locales/zh-tw.js +0 -19
  515. package/locales-all.global.js +0 -1927
  516. package/locales-all.global.min.js +0 -6
  517. package/preact.js +0 -3
  518. /package/{locales-all.cjs → cjs/locales-all.cjs} +0 -0
  519. /package/{locales → esm/locales}/af.d.ts +0 -0
  520. /package/{locales → esm/locales}/ar-dz.d.ts +0 -0
  521. /package/{locales → esm/locales}/ar-kw.d.ts +0 -0
  522. /package/{locales → esm/locales}/ar-ly.d.ts +0 -0
  523. /package/{locales → esm/locales}/ar-ma.d.ts +0 -0
  524. /package/{locales → esm/locales}/ar-sa.d.ts +0 -0
  525. /package/{locales → esm/locales}/ar-tn.d.ts +0 -0
  526. /package/{locales → esm/locales}/ar.d.ts +0 -0
  527. /package/{locales → esm/locales}/az.d.ts +0 -0
  528. /package/{locales → esm/locales}/bg.d.ts +0 -0
  529. /package/{locales → esm/locales}/bn.d.ts +0 -0
  530. /package/{locales → esm/locales}/bs.d.ts +0 -0
  531. /package/{locales → esm/locales}/ca.d.ts +0 -0
  532. /package/{locales → esm/locales}/cs.d.ts +0 -0
  533. /package/{locales → esm/locales}/cy.d.ts +0 -0
  534. /package/{locales → esm/locales}/da.d.ts +0 -0
  535. /package/{locales → esm/locales}/de-at.d.ts +0 -0
  536. /package/{locales → esm/locales}/de.d.ts +0 -0
  537. /package/{locales → esm/locales}/el.d.ts +0 -0
  538. /package/{locales → esm/locales}/en-au.d.ts +0 -0
  539. /package/{locales → esm/locales}/en-gb.d.ts +0 -0
  540. /package/{locales → esm/locales}/en-nz.d.ts +0 -0
  541. /package/{locales → esm/locales}/eo.d.ts +0 -0
  542. /package/{locales → esm/locales}/es-us.d.ts +0 -0
  543. /package/{locales → esm/locales}/es.d.ts +0 -0
  544. /package/{locales → esm/locales}/et.d.ts +0 -0
  545. /package/{locales → esm/locales}/eu.d.ts +0 -0
  546. /package/{locales → esm/locales}/fa.d.ts +0 -0
  547. /package/{locales → esm/locales}/fi.d.ts +0 -0
  548. /package/{locales → esm/locales}/fr-ca.d.ts +0 -0
  549. /package/{locales → esm/locales}/fr-ch.d.ts +0 -0
  550. /package/{locales → esm/locales}/fr.d.ts +0 -0
  551. /package/{locales → esm/locales}/gl.d.ts +0 -0
  552. /package/{locales → esm/locales}/he.d.ts +0 -0
  553. /package/{locales → esm/locales}/hi.d.ts +0 -0
  554. /package/{locales → esm/locales}/hr.d.ts +0 -0
  555. /package/{locales → esm/locales}/hu.d.ts +0 -0
  556. /package/{locales → esm/locales}/hy-am.d.ts +0 -0
  557. /package/{locales → esm/locales}/id.d.ts +0 -0
  558. /package/{locales → esm/locales}/is.d.ts +0 -0
  559. /package/{locales → esm/locales}/it.d.ts +0 -0
  560. /package/{locales → esm/locales}/ja.d.ts +0 -0
  561. /package/{locales → esm/locales}/ka.d.ts +0 -0
  562. /package/{locales → esm/locales}/kk.d.ts +0 -0
  563. /package/{locales → esm/locales}/km.d.ts +0 -0
  564. /package/{locales → esm/locales}/ko.d.ts +0 -0
  565. /package/{locales → esm/locales}/ku.d.ts +0 -0
  566. /package/{locales → esm/locales}/lb.d.ts +0 -0
  567. /package/{locales → esm/locales}/lt.d.ts +0 -0
  568. /package/{locales → esm/locales}/lv.d.ts +0 -0
  569. /package/{locales → esm/locales}/mk.d.ts +0 -0
  570. /package/{locales → esm/locales}/ms.d.ts +0 -0
  571. /package/{locales → esm/locales}/nb.d.ts +0 -0
  572. /package/{locales → esm/locales}/ne.d.ts +0 -0
  573. /package/{locales → esm/locales}/nl.d.ts +0 -0
  574. /package/{locales → esm/locales}/nn.d.ts +0 -0
  575. /package/{locales → esm/locales}/pl.d.ts +0 -0
  576. /package/{locales → esm/locales}/pt-br.d.ts +0 -0
  577. /package/{locales → esm/locales}/pt.d.ts +0 -0
  578. /package/{locales → esm/locales}/ro.d.ts +0 -0
  579. /package/{locales → esm/locales}/ru.d.ts +0 -0
  580. /package/{locales → esm/locales}/si-lk.d.ts +0 -0
  581. /package/{locales → esm/locales}/sk.d.ts +0 -0
  582. /package/{locales → esm/locales}/sl.d.ts +0 -0
  583. /package/{locales → esm/locales}/sm.d.ts +0 -0
  584. /package/{locales → esm/locales}/sq.d.ts +0 -0
  585. /package/{locales → esm/locales}/sr-cyrl.d.ts +0 -0
  586. /package/{locales → esm/locales}/sr.d.ts +0 -0
  587. /package/{locales → esm/locales}/sv.d.ts +0 -0
  588. /package/{locales → esm/locales}/ta-in.d.ts +0 -0
  589. /package/{locales → esm/locales}/th.d.ts +0 -0
  590. /package/{locales → esm/locales}/tr.d.ts +0 -0
  591. /package/{locales → esm/locales}/ug.d.ts +0 -0
  592. /package/{locales → esm/locales}/uk.d.ts +0 -0
  593. /package/{locales → esm/locales}/uz-cy.d.ts +0 -0
  594. /package/{locales → esm/locales}/uz.d.ts +0 -0
  595. /package/{locales → esm/locales}/vi.d.ts +0 -0
  596. /package/{locales → esm/locales}/zh-cn.d.ts +0 -0
  597. /package/{locales → esm/locales}/zh-tw.d.ts +0 -0
  598. /package/{locales-all.d.ts → esm/locales-all.d.ts} +0 -0
  599. /package/{locales-all.js → esm/locales-all.js} +0 -0
@@ -15,39 +15,34 @@ const MINIMAL_RAW_EN_LOCALE = {
15
15
  doy: 4, // 4 days need to be within the year to be considered the first week
16
16
  },
17
17
  direction: 'ltr',
18
- buttonText: {
19
- prev: 'prev',
20
- next: 'next',
21
- prevYear: 'prev year',
22
- nextYear: 'next year',
23
- year: 'year',
24
- today: 'today',
25
- month: 'month',
26
- week: 'week',
27
- day: 'day',
28
- list: 'list',
29
- },
30
- weekText: 'W',
31
- weekTextLong: 'Week',
18
+ todayText: 'Today',
19
+ prevText: 'Prev',
20
+ nextText: 'Next',
21
+ prevYearText: 'Prev year',
22
+ nextYearText: 'Next year',
23
+ yearText: 'Year',
24
+ monthText: 'Month',
25
+ weekText: 'Week',
26
+ dayText: 'Day',
27
+ listText: 'List',
32
28
  closeHint: 'Close',
33
29
  eventsHint: 'Events',
34
- allDayText: 'all-day',
35
- timedText: 'timed',
30
+ allDayText: 'All-day',
31
+ timedText: 'Timed',
36
32
  moreLinkText: 'more',
37
33
  noEventsText: 'No events to display',
38
34
  };
35
+ /*
36
+ Includes things we don't want other locales to inherit,
37
+ things that derive from other translatable strings.
38
+ */
39
39
  const RAW_EN_LOCALE = Object.assign(Object.assign({}, MINIMAL_RAW_EN_LOCALE), {
40
- // Includes things we don't want other locales to inherit,
41
- // things that derive from other translatable strings.
42
- buttonHints: {
43
- prev: 'Previous $0',
44
- next: 'Next $0',
45
- today(buttonText, unit) {
46
- return (unit === 'day')
47
- ? 'Today'
48
- : `This ${buttonText}`;
49
- },
50
- }, viewHint: '$0 view', viewChangeHint: 'Change view', navLinkHint: 'Go to $0', moreLinkHint(eventCnt) {
40
+ // if a locale doesn't define this, fall back to weekText, don't use EN
41
+ weekTextShort: 'W', todayHint: (unitText, unit) => {
42
+ return (unit === 'day')
43
+ ? 'Today'
44
+ : `This ${unitText}`;
45
+ }, prevHint: 'Previous $0', nextHint: 'Next $0', viewHint: '$0 view', viewChangeHint: 'Change view', navLinkHint: 'Go to $0', moreLinkHint(eventCnt) {
51
46
  return `Show ${eventCnt} more event${eventCnt === 1 ? '' : 's'}`;
52
47
  } });
53
48
  function organizeRawLocales(explicitRawLocales) {
@@ -88,7 +83,7 @@ function queryRawLocale(codes, available) {
88
83
  return null;
89
84
  }
90
85
  function parseLocale(codeArg, codes, raw) {
91
- let merged = internalCommon.mergeProps([MINIMAL_RAW_EN_LOCALE, raw], ['buttonText']);
86
+ let merged = internalCommon.mergeCalendarOptions(MINIMAL_RAW_EN_LOCALE, raw);
92
87
  delete merged.code; // don't want this part of the options
93
88
  let { week } = merged;
94
89
  delete merged.week;
@@ -128,7 +123,6 @@ function createPlugin(input) {
128
123
  eventDropTransformers: input.eventDropTransformers || [],
129
124
  componentInteractions: input.componentInteractions || [],
130
125
  calendarInteractions: input.calendarInteractions || [],
131
- themeClasses: input.themeClasses || {},
132
126
  eventSourceDefs: input.eventSourceDefs || [],
133
127
  cmdFormatter: input.cmdFormatter,
134
128
  recurringTypes: input.recurringTypes || [],
@@ -139,6 +133,7 @@ function createPlugin(input) {
139
133
  scrollerSyncerClass: input.scrollerSyncerClass || null,
140
134
  listenerRefiners: input.listenerRefiners || {},
141
135
  optionRefiners: input.optionRefiners || {},
136
+ optionDefaults: input.optionDefaults ? [input.optionDefaults] : [],
142
137
  propSetHandlers: input.propSetHandlers || {},
143
138
  };
144
139
  }
@@ -166,7 +161,6 @@ function buildPluginHooks(pluginDefs, globalDefs) {
166
161
  eventDropTransformers: [],
167
162
  componentInteractions: [],
168
163
  calendarInteractions: [],
169
- themeClasses: {},
170
164
  eventSourceDefs: [],
171
165
  cmdFormatter: null,
172
166
  recurringTypes: [],
@@ -177,6 +171,7 @@ function buildPluginHooks(pluginDefs, globalDefs) {
177
171
  scrollerSyncerClass: null,
178
172
  listenerRefiners: {},
179
173
  optionRefiners: {},
174
+ optionDefaults: [],
180
175
  propSetHandlers: {},
181
176
  };
182
177
  function addDefs(defs) {
@@ -228,7 +223,7 @@ function combineHooks(hooks0, hooks1) {
228
223
  dateSelectionTransformers: hooks0.dateSelectionTransformers.concat(hooks1.dateSelectionTransformers),
229
224
  datePointTransforms: hooks0.datePointTransforms.concat(hooks1.datePointTransforms),
230
225
  dateSpanTransforms: hooks0.dateSpanTransforms.concat(hooks1.dateSpanTransforms),
231
- views: Object.assign(Object.assign({}, hooks0.views), hooks1.views),
226
+ views: internalCommon.mergeViewOptionsMap(hooks0.views, hooks1.views),
232
227
  viewPropsTransformers: hooks0.viewPropsTransformers.concat(hooks1.viewPropsTransformers),
233
228
  isPropsValid: hooks1.isPropsValid || hooks0.isPropsValid,
234
229
  externalDefTransforms: hooks0.externalDefTransforms.concat(hooks1.externalDefTransforms),
@@ -236,7 +231,6 @@ function combineHooks(hooks0, hooks1) {
236
231
  eventDropTransformers: hooks0.eventDropTransformers.concat(hooks1.eventDropTransformers),
237
232
  calendarInteractions: hooks0.calendarInteractions.concat(hooks1.calendarInteractions),
238
233
  componentInteractions: hooks0.componentInteractions.concat(hooks1.componentInteractions),
239
- themeClasses: Object.assign(Object.assign({}, hooks0.themeClasses), hooks1.themeClasses),
240
234
  eventSourceDefs: hooks0.eventSourceDefs.concat(hooks1.eventSourceDefs),
241
235
  cmdFormatter: hooks1.cmdFormatter || hooks0.cmdFormatter,
242
236
  recurringTypes: hooks0.recurringTypes.concat(hooks1.recurringTypes),
@@ -247,6 +241,7 @@ function combineHooks(hooks0, hooks1) {
247
241
  scrollerSyncerClass: hooks0.scrollerSyncerClass || hooks1.scrollerSyncerClass,
248
242
  listenerRefiners: Object.assign(Object.assign({}, hooks0.listenerRefiners), hooks1.listenerRefiners),
249
243
  optionRefiners: Object.assign(Object.assign({}, hooks0.optionRefiners), hooks1.optionRefiners),
244
+ optionDefaults: hooks0.optionDefaults.concat(hooks1.optionDefaults),
250
245
  propSetHandlers: Object.assign(Object.assign({}, hooks0.propSetHandlers), hooks1.propSetHandlers),
251
246
  };
252
247
  }
@@ -260,32 +255,6 @@ function compareOptionalDates(date0, date1) {
260
255
  return new Date(Math.max(date0.valueOf(), date1.valueOf()));
261
256
  }
262
257
 
263
- class StandardTheme extends internalCommon.Theme {
264
- }
265
- StandardTheme.prototype.classes = {
266
- root: 'fc-theme-standard',
267
- buttonGroup: 'fc-button-group',
268
- button: 'fc-button fc-button-primary',
269
- buttonActive: 'fc-button-active',
270
- };
271
- StandardTheme.prototype.baseIconClass = 'fc-icon';
272
- StandardTheme.prototype.iconClasses = {
273
- close: 'fc-icon-x',
274
- prev: 'fc-icon-chevron-left',
275
- next: 'fc-icon-chevron-right',
276
- prevYear: 'fc-icon-chevrons-left',
277
- nextYear: 'fc-icon-chevrons-right',
278
- };
279
- StandardTheme.prototype.rtlIconClasses = {
280
- prev: 'fc-icon-chevron-right',
281
- next: 'fc-icon-chevron-left',
282
- prevYear: 'fc-icon-chevrons-right',
283
- nextYear: 'fc-icon-chevrons-left',
284
- };
285
- StandardTheme.prototype.iconOverrideOption = 'buttonIcons'; // TODO: make TS-friendly
286
- StandardTheme.prototype.iconOverrideCustomButtonOption = 'icon';
287
- StandardTheme.prototype.iconOverridePrefix = 'fc-icon-';
288
-
289
258
  function compileViewDefs(defaultConfigs, overrideConfigs) {
290
259
  let hash = {};
291
260
  let viewType;
@@ -330,8 +299,8 @@ function buildViewDef(viewType, hash, defaultConfigs, overrideConfigs) {
330
299
  return {
331
300
  type: viewType,
332
301
  component: theComponent,
333
- defaults: Object.assign(Object.assign({}, (superDef ? superDef.defaults : {})), (defaultConfig ? defaultConfig.rawOptions : {})),
334
- overrides: Object.assign(Object.assign({}, (superDef ? superDef.overrides : {})), (overrideConfig ? overrideConfig.rawOptions : {})),
302
+ defaults: internalCommon.mergeCalendarOptions(superDef ? superDef.defaults : {}, defaultConfig ? defaultConfig.rawOptions : {}),
303
+ overrides: internalCommon.mergeCalendarOptions(superDef ? superDef.overrides : {}, overrideConfig ? overrideConfig.rawOptions : {}),
335
304
  };
336
305
  }
337
306
 
@@ -359,16 +328,21 @@ function parseViewConfig(input) {
359
328
  };
360
329
  }
361
330
  function createViewHookComponent(options) {
362
- return (viewProps) => (preact.createElement(internalCommon.ViewContextType.Consumer, null, (context) => (preact.createElement(internalCommon.ContentContainer, { tag: "div", className: internalCommon.buildViewClassName(context.viewSpec), renderProps: Object.assign(Object.assign({}, viewProps), { nextDayThreshold: context.options.nextDayThreshold }), generatorName: undefined, customGenerator: options.content, classNameGenerator: options.classNames, didMount: options.didMount, willUnmount: options.willUnmount }))));
331
+ return (viewProps) => (preact.createElement(internalCommon.ViewContextType.Consumer, null, (context) => {
332
+ var _a;
333
+ return (preact.createElement(internalCommon.ContentContainer, { tag: "div", className: internalCommon.generateClassName(options.viewClass, {
334
+ view: context.viewApi,
335
+ }), renderProps: Object.assign(Object.assign({}, viewProps), { nextDayThreshold: options.nextDayThreshold }), generatorName: undefined, customGenerator: options.content, classNameGenerator: ((_a = options.class) !== null && _a !== void 0 ? _a : options.className), didMount: options.didMount, willUnmount: options.willUnmount }));
336
+ }));
363
337
  }
364
338
 
365
- function buildViewSpecs(defaultInputs, optionOverrides, dynamicOptionOverrides, localeDefaults) {
339
+ function buildViewSpecs(defaultInputs, optionOverrides, dynamicOptionOverrides) {
366
340
  let defaultConfigs = parseViewConfigs(defaultInputs);
367
341
  let overrideConfigs = parseViewConfigs(optionOverrides.views);
368
342
  let viewDefs = compileViewDefs(defaultConfigs, overrideConfigs);
369
- return internalCommon.mapHash(viewDefs, (viewDef) => buildViewSpec(viewDef, overrideConfigs, optionOverrides, dynamicOptionOverrides, localeDefaults));
343
+ return internalCommon.mapHash(viewDefs, (viewDef) => buildViewSpec(viewDef, overrideConfigs, optionOverrides, dynamicOptionOverrides));
370
344
  }
371
- function buildViewSpec(viewDef, overrideConfigs, optionOverrides, dynamicOptionOverrides, localeDefaults) {
345
+ function buildViewSpec(viewDef, overrideConfigs, optionOverrides, dynamicOptionOverrides) {
372
346
  let durationInput = viewDef.overrides.duration ||
373
347
  viewDef.defaults.duration ||
374
348
  dynamicOptionOverrides.duration ||
@@ -388,34 +362,6 @@ function buildViewSpec(viewDef, overrideConfigs, optionOverrides, dynamicOptionO
388
362
  }
389
363
  }
390
364
  }
391
- let queryButtonText = (optionsSubset) => {
392
- let buttonTextMap = optionsSubset.buttonText || {};
393
- let buttonTextKey = viewDef.defaults.buttonTextKey;
394
- if (buttonTextKey != null && buttonTextMap[buttonTextKey] != null) {
395
- return buttonTextMap[buttonTextKey];
396
- }
397
- if (buttonTextMap[viewDef.type] != null) {
398
- return buttonTextMap[viewDef.type];
399
- }
400
- if (buttonTextMap[singleUnit] != null) {
401
- return buttonTextMap[singleUnit];
402
- }
403
- return null;
404
- };
405
- let queryButtonTitle = (optionsSubset) => {
406
- let buttonHints = optionsSubset.buttonHints || {};
407
- let buttonKey = viewDef.defaults.buttonTextKey; // use same key as text
408
- if (buttonKey != null && buttonHints[buttonKey] != null) {
409
- return buttonHints[buttonKey];
410
- }
411
- if (buttonHints[viewDef.type] != null) {
412
- return buttonHints[viewDef.type];
413
- }
414
- if (buttonHints[singleUnit] != null) {
415
- return buttonHints[singleUnit];
416
- }
417
- return null;
418
- };
419
365
  return {
420
366
  type: viewDef.type,
421
367
  component: viewDef.component,
@@ -424,21 +370,6 @@ function buildViewSpec(viewDef, overrideConfigs, optionOverrides, dynamicOptionO
424
370
  singleUnit,
425
371
  optionDefaults: viewDef.defaults,
426
372
  optionOverrides: Object.assign(Object.assign({}, singleUnitOverrides), viewDef.overrides),
427
- buttonTextOverride: queryButtonText(dynamicOptionOverrides) ||
428
- queryButtonText(optionOverrides) || // constructor-specified buttonText lookup hash takes precedence
429
- viewDef.overrides.buttonText,
430
- buttonTextDefault: queryButtonText(localeDefaults) ||
431
- viewDef.defaults.buttonText ||
432
- queryButtonText(internalCommon.BASE_OPTION_DEFAULTS) ||
433
- viewDef.type,
434
- // not DRY
435
- buttonTitleOverride: queryButtonTitle(dynamicOptionOverrides) ||
436
- queryButtonTitle(optionOverrides) ||
437
- viewDef.overrides.buttonHint,
438
- buttonTitleDefault: queryButtonTitle(localeDefaults) ||
439
- viewDef.defaults.buttonHint ||
440
- queryButtonTitle(internalCommon.BASE_OPTION_DEFAULTS),
441
- // will eventually fall back to buttonText
442
373
  };
443
374
  }
444
375
  // hack to get memoization working
@@ -713,17 +644,17 @@ function reduceEventResize(currentResize, action) {
713
644
  }
714
645
  }
715
646
 
716
- function parseToolbars(calendarOptions, calendarOptionOverrides, theme, viewSpecs, calendarApi) {
717
- let header = calendarOptions.headerToolbar ? parseToolbar(calendarOptions.headerToolbar, calendarOptions, calendarOptionOverrides, theme, viewSpecs, calendarApi) : null;
718
- let footer = calendarOptions.footerToolbar ? parseToolbar(calendarOptions.footerToolbar, calendarOptions, calendarOptionOverrides, theme, viewSpecs, calendarApi) : null;
647
+ function parseToolbars(calendarOptions, viewSpecs, calendarApi) {
648
+ let header = calendarOptions.headerToolbar ? parseToolbar(calendarOptions.headerToolbar, calendarOptions, viewSpecs, calendarApi) : null;
649
+ let footer = calendarOptions.footerToolbar ? parseToolbar(calendarOptions.footerToolbar, calendarOptions, viewSpecs, calendarApi) : null;
719
650
  return { header, footer };
720
651
  }
721
- function parseToolbar(sectionStrHash, calendarOptions, calendarOptionOverrides, theme, viewSpecs, calendarApi) {
652
+ function parseToolbar(sectionStrHash, calendarOptions, viewSpecs, calendarApi) {
722
653
  let isRtl = calendarOptions.direction === 'rtl';
723
654
  let viewsWithButtons = [];
724
655
  let hasTitle = false;
725
656
  function processSectionStr(sectionStr) {
726
- let sectionRes = parseSection(sectionStr, calendarOptions, calendarOptionOverrides, theme, viewSpecs, calendarApi);
657
+ let sectionRes = parseSection(sectionStr, calendarOptions, viewSpecs, calendarApi);
727
658
  viewsWithButtons.push(...sectionRes.viewsWithButtons);
728
659
  hasTitle = hasTitle || sectionRes.hasTitle;
729
660
  return sectionRes.widgets;
@@ -742,82 +673,92 @@ function parseToolbar(sectionStrHash, calendarOptions, calendarOptionOverrides,
742
673
  /*
743
674
  BAD: querying icons and text here. should be done at render time
744
675
  */
745
- function parseSection(sectionStr, calendarOptions, // defaults+overrides, then refined
746
- calendarOptionOverrides, // overrides only!, unrefined :(
747
- theme, viewSpecs, calendarApi) {
748
- let isRtl = calendarOptions.direction === 'rtl';
749
- let calendarCustomButtons = calendarOptions.customButtons || {};
750
- let calendarButtonTextOverrides = calendarOptionOverrides.buttonText || {};
751
- let calendarButtonText = calendarOptions.buttonText || {};
752
- let calendarButtonHintOverrides = calendarOptionOverrides.buttonHints || {};
753
- let calendarButtonHints = calendarOptions.buttonHints || {};
676
+ function parseSection(sectionStr, calendarOptions, viewSpecs, calendarApi) {
677
+ let calendarButtons = calendarOptions.buttons || {};
678
+ let customElements = calendarOptions.toolbarElements || {};
754
679
  let sectionSubstrs = sectionStr ? sectionStr.split(' ') : [];
755
680
  let viewsWithButtons = [];
756
681
  let hasTitle = false;
757
- let widgets = sectionSubstrs.map((buttonGroupStr) => (buttonGroupStr.split(',').map((buttonName) => {
758
- if (buttonName === 'title') {
682
+ let widgets = sectionSubstrs.map((buttonGroupStr) => (buttonGroupStr.split(',').map((name) => {
683
+ var _a;
684
+ if (name === 'title') {
759
685
  hasTitle = true;
760
- return { buttonName };
686
+ return { name };
687
+ }
688
+ if (customElements[name]) {
689
+ return { name, customElement: customElements[name] };
761
690
  }
762
- let customButtonProps;
763
691
  let viewSpec;
764
- let buttonClick;
765
- let buttonIcon; // only one of these will be set
766
- let buttonText; // "
692
+ let buttonInput = calendarButtons[name] || {};
693
+ let buttonText;
767
694
  let buttonHint;
768
- let isView = false;
769
- // ^ for the title="" attribute, for accessibility
770
- if ((customButtonProps = calendarCustomButtons[buttonName])) {
695
+ let buttonClick;
696
+ if ((viewSpec = viewSpecs[name])) {
697
+ viewsWithButtons.push(name);
698
+ const buttonTextKey = viewSpec.optionDefaults.buttonTextKey;
699
+ buttonText = buttonInput.text ||
700
+ (buttonTextKey ? calendarOptions[buttonTextKey] : '') ||
701
+ (viewSpec.singleUnit ? calendarOptions[viewSpec.singleUnit + 'Text'] : '') ||
702
+ name;
703
+ /*
704
+ buttons{}.hint(viewButtonText, viewName)
705
+ viewHint(viewButtonText, viewName)
706
+ */
707
+ buttonHint = internalCommon.formatWithOrdinals(buttonInput.hint || calendarOptions.viewHint, [buttonText, name], // ordinal arguments
708
+ buttonText);
771
709
  buttonClick = (ev) => {
772
- if (customButtonProps.click) {
773
- customButtonProps.click.call(ev.target, ev, ev.target); // TODO: use Calendar this context?
710
+ var _a;
711
+ (_a = buttonInput === null || buttonInput === void 0 ? void 0 : buttonInput.click) === null || _a === void 0 ? void 0 : _a.call(buttonInput, ev);
712
+ if (!ev.defaultPrevented) {
713
+ calendarApi.changeView(name);
774
714
  }
775
715
  };
776
- (buttonIcon = theme.getCustomButtonIconClass(customButtonProps)) ||
777
- (buttonIcon = theme.getIconClass(buttonName, isRtl)) ||
778
- (buttonText = customButtonProps.text);
779
- buttonHint = customButtonProps.hint || customButtonProps.text;
780
- }
781
- else if ((viewSpec = viewSpecs[buttonName])) {
782
- isView = true;
783
- viewsWithButtons.push(buttonName);
784
- buttonClick = () => {
785
- calendarApi.changeView(buttonName);
786
- };
787
- (buttonText = viewSpec.buttonTextOverride) ||
788
- (buttonIcon = theme.getIconClass(buttonName, isRtl)) ||
789
- (buttonText = viewSpec.buttonTextDefault);
790
- let textFallback = viewSpec.buttonTextOverride ||
791
- viewSpec.buttonTextDefault;
792
- buttonHint = internalCommon.formatWithOrdinals(viewSpec.buttonTitleOverride ||
793
- viewSpec.buttonTitleDefault ||
794
- calendarOptions.viewHint, [textFallback, buttonName], // view-name = buttonName
795
- textFallback);
796
- }
797
- else if (calendarApi[buttonName]) { // a calendarApi method
798
- buttonClick = () => {
799
- calendarApi[buttonName]();
800
- };
801
- (buttonText = calendarButtonTextOverrides[buttonName]) ||
802
- (buttonIcon = theme.getIconClass(buttonName, isRtl)) ||
803
- (buttonText = calendarButtonText[buttonName]); // everything else is considered default
804
- if (buttonName === 'prevYear' || buttonName === 'nextYear') {
805
- let prevOrNext = buttonName === 'prevYear' ? 'prev' : 'next';
806
- buttonHint = internalCommon.formatWithOrdinals(calendarButtonHintOverrides[prevOrNext] ||
807
- calendarButtonHints[prevOrNext], [
808
- calendarButtonText.year || 'year',
809
- 'year',
810
- ], calendarButtonText[buttonName]);
716
+ }
717
+ else {
718
+ buttonText = buttonInput.text ||
719
+ calendarOptions[name + 'Text'] ||
720
+ name;
721
+ /*
722
+ button{}.hint(currentUnitText, currentUnit)
723
+ prevHint(currentUnitUnitext, currentUnit)
724
+ nextHint -- same
725
+ todayHint -- same
726
+ */
727
+ if (name === 'prevYear') {
728
+ buttonHint = internalCommon.formatWithOrdinals(buttonInput.hint || calendarOptions.prevHint, [calendarOptions.yearText, 'year'], buttonText);
729
+ }
730
+ else if (name === 'nextYear') {
731
+ buttonHint = internalCommon.formatWithOrdinals(buttonInput.hint || calendarOptions.nextHint, [calendarOptions.yearText, 'year'], buttonText);
811
732
  }
812
733
  else {
813
- buttonHint = (navUnit) => internalCommon.formatWithOrdinals(calendarButtonHintOverrides[buttonName] ||
814
- calendarButtonHints[buttonName], [
815
- calendarButtonText[navUnit] || navUnit,
816
- navUnit,
817
- ], calendarButtonText[buttonName]);
734
+ buttonHint = (currentUnit) => {
735
+ return internalCommon.formatWithOrdinals(buttonInput.hint || calendarOptions[name + 'Hint'], // todayHint/prevHint/nextHint
736
+ [calendarOptions[currentUnit + 'Text'], currentUnit], // ordinal arguments
737
+ buttonText);
738
+ };
818
739
  }
740
+ buttonClick = (ev) => {
741
+ var _a, _b;
742
+ (_a = buttonInput === null || buttonInput === void 0 ? void 0 : buttonInput.click) === null || _a === void 0 ? void 0 : _a.call(buttonInput, ev);
743
+ if (!ev.defaultPrevented) {
744
+ (_b = calendarApi[name]) === null || _b === void 0 ? void 0 : _b.call(calendarApi);
745
+ }
746
+ };
819
747
  }
820
- return { buttonName, buttonClick, buttonIcon, buttonText, buttonHint, isView };
748
+ return {
749
+ name,
750
+ isView: Boolean(viewSpec),
751
+ buttonText,
752
+ buttonHint,
753
+ buttonDisplay: buttonInput.display,
754
+ buttonIconClass: buttonInput.iconClass,
755
+ buttonIconContent: buttonInput.iconContent,
756
+ buttonClick,
757
+ buttonIsPrimary: buttonInput.isPrimary || false,
758
+ buttonClass: (_a = buttonInput.class) !== null && _a !== void 0 ? _a : buttonInput.className,
759
+ buttonDidMount: buttonInput.didMount,
760
+ buttonWillUnmount: buttonInput.willUnmount,
761
+ };
821
762
  })));
822
763
  return { widgets, viewsWithButtons, hasTitle };
823
764
  }
@@ -1034,6 +975,10 @@ function expandRanges(daysOfWeek, startTime, framingRange, dateEnv) {
1034
975
  const changeHandlerPlugin = createPlugin({
1035
976
  name: 'change-handler',
1036
977
  optionChangeHandlers: {
978
+ controller(controller, context) {
979
+ // TODO: the initial setting is in CalendarDataManager
980
+ controller._setApi(context.calendarApi);
981
+ },
1037
982
  events(events, context) {
1038
983
  handleEventSources([events], context);
1039
984
  },
@@ -1165,14 +1110,14 @@ function buildTitle(dateProfile, viewOptions, dateEnv) {
1165
1110
  else { // for day units or smaller, use the actual day range
1166
1111
  range = dateProfile.activeRange;
1167
1112
  }
1168
- return dateEnv.formatRange(range.start, range.end, internalCommon.createFormatter(viewOptions.titleFormat || buildTitleFormat(dateProfile)), {
1113
+ return dateEnv.formatRange(range.start, range.end, internalCommon.createFormatter(viewOptions.titleFormat || buildTitleFormat(dateProfile, dateEnv)), {
1169
1114
  isEndExclusive: dateProfile.isRangeAllDay,
1170
1115
  defaultSeparator: viewOptions.titleRangeSeparator,
1171
1116
  });
1172
1117
  }
1173
1118
  // Generates the format string that should be used to generate the title for the current date range.
1174
1119
  // Attempts to compute the most appropriate format if not explicitly specified with `titleFormat`.
1175
- function buildTitleFormat(dateProfile) {
1120
+ function buildTitleFormat(dateProfile, dateEnv) {
1176
1121
  let { currentRangeUnit } = dateProfile;
1177
1122
  if (currentRangeUnit === 'year') {
1178
1123
  return { year: 'numeric' };
@@ -1182,8 +1127,12 @@ function buildTitleFormat(dateProfile) {
1182
1127
  }
1183
1128
  let days = internalCommon.diffWholeDays(dateProfile.currentRange.start, dateProfile.currentRange.end);
1184
1129
  if (days !== null && days > 1) {
1185
- // multi-day range. shorter, like "Sep 9 - 10 2014"
1186
- return { year: 'numeric', month: 'short', day: 'numeric' };
1130
+ return {
1131
+ year: 'numeric',
1132
+ month: dateEnv.getMonth(dateProfile.activeRange.start) !== dateEnv.getMonth(dateProfile.activeRange.end)
1133
+ ? 'short' // different months? do "Sep - Oct 2014"
1134
+ : 'long', // same month? do "September 2014"
1135
+ };
1187
1136
  }
1188
1137
  // one day. longer, like "September 9 2014"
1189
1138
  return { year: 'numeric', month: 'long', day: 'numeric' };
@@ -1198,13 +1147,12 @@ class CalendarDataManager {
1198
1147
  this.buildLocale = internalCommon.memoize(buildLocale);
1199
1148
  this.buildPluginHooks = buildBuildPluginHooks();
1200
1149
  this.buildDateEnv = internalCommon.memoize(buildDateEnv$1);
1201
- this.buildTheme = internalCommon.memoize(buildTheme);
1202
1150
  this.parseToolbars = internalCommon.memoize(parseToolbars);
1203
1151
  this.buildViewSpecs = internalCommon.memoize(buildViewSpecs);
1204
1152
  this.buildDateProfileGenerator = internalCommon.memoizeObjArg(buildDateProfileGenerator);
1205
1153
  this.buildViewApi = internalCommon.memoize(buildViewApi);
1206
1154
  this.buildViewUiProps = internalCommon.memoizeObjArg(buildViewUiProps);
1207
- this.buildEventUiBySource = internalCommon.memoize(buildEventUiBySource, internalCommon.isPropsEqual);
1155
+ this.buildEventUiBySource = internalCommon.memoize(buildEventUiBySource, internalCommon.isPropsEqualShallow);
1208
1156
  this.buildEventUiBases = internalCommon.memoize(buildEventUiBases);
1209
1157
  this.parseContextBusinessHours = internalCommon.memoizeObjArg(parseContextBusinessHours);
1210
1158
  this.buildTitle = internalCommon.memoize(buildTitle);
@@ -1225,13 +1173,19 @@ class CalendarDataManager {
1225
1173
  this.actionRunner.pause();
1226
1174
  let dynamicOptionOverrides = {};
1227
1175
  let optionsData = this.computeOptionsData(props.optionOverrides, dynamicOptionOverrides, props.calendarApi);
1228
- let currentViewType = optionsData.calendarOptions.initialView || optionsData.pluginHooks.initialView;
1176
+ let currentViewType = optionsData.calendarOptions.initialView ||
1177
+ optionsData.pluginHooks.initialView;
1229
1178
  let currentViewData = this.computeCurrentViewData(currentViewType, optionsData, props.optionOverrides, dynamicOptionOverrides);
1230
1179
  // wire things up
1231
1180
  // TODO: not DRY
1232
1181
  props.calendarApi.currentDataManager = this;
1233
1182
  this.emitter.setThisContext(props.calendarApi);
1234
1183
  this.emitter.setOptions(currentViewData.options);
1184
+ // NOTE: subsequent updates detected by options-change-handlers.ts
1185
+ const controllerOption = optionsData.calendarOptions.controller;
1186
+ if (controllerOption) {
1187
+ controllerOption._setApi(props.calendarApi);
1188
+ }
1235
1189
  let currentDate = internalCommon.getInitialDate(optionsData.calendarOptions, optionsData.dateEnv);
1236
1190
  let dateProfile = currentViewData.dateProfileGenerator.build(currentDate);
1237
1191
  if (!internalCommon.rangeContainsMarker(dateProfile.activeRange, currentDate)) {
@@ -1373,7 +1327,8 @@ class CalendarDataManager {
1373
1327
  let oldData = this.data;
1374
1328
  let optionsData = this.computeOptionsData(props.optionOverrides, state.dynamicOptionOverrides, props.calendarApi);
1375
1329
  let currentViewData = this.computeCurrentViewData(state.currentViewType, optionsData, props.optionOverrides, state.dynamicOptionOverrides);
1376
- let data = this.data = Object.assign(Object.assign(Object.assign({ viewTitle: this.buildTitle(state.dateProfile, currentViewData.options, optionsData.dateEnv), calendarApi: props.calendarApi, dispatch: this.dispatch, emitter: this.emitter, getCurrentData: this.getCurrentData }, optionsData), currentViewData), state);
1330
+ let viewTitle = this.buildTitle(state.dateProfile, currentViewData.options, optionsData.dateEnv);
1331
+ let data = this.data = Object.assign(Object.assign(Object.assign({ viewTitle, calendarApi: props.calendarApi, dispatch: this.dispatch, emitter: this.emitter, getCurrentData: this.getCurrentData }, optionsData), currentViewData), state);
1377
1332
  let changeHandlers = optionsData.pluginHooks.optionChangeHandlers;
1378
1333
  let oldCalendarOptions = oldData && oldData.calendarOptions;
1379
1334
  let newCalendarOptions = optionsData.calendarOptions;
@@ -1403,18 +1358,15 @@ class CalendarDataManager {
1403
1358
  dynamicOptionOverrides === this.stableDynamicOptionOverrides) {
1404
1359
  return this.stableCalendarOptionsData;
1405
1360
  }
1406
- let { refinedOptions, pluginHooks, localeDefaults, availableLocaleData, extra, } = this.processRawCalendarOptions(optionOverrides, dynamicOptionOverrides);
1407
- warnUnknownOptions(extra);
1408
- let dateEnv = this.buildDateEnv(refinedOptions.timeZone, refinedOptions.locale, refinedOptions.weekNumberCalculation, refinedOptions.firstDay, refinedOptions.weekText, pluginHooks, availableLocaleData, refinedOptions.defaultRangeSeparator);
1409
- let viewSpecs = this.buildViewSpecs(pluginHooks.views, this.stableOptionOverrides, this.stableDynamicOptionOverrides, localeDefaults);
1410
- let theme = this.buildTheme(refinedOptions, pluginHooks);
1411
- let toolbarConfig = this.parseToolbars(refinedOptions, this.stableOptionOverrides, theme, viewSpecs, calendarApi);
1361
+ let { refinedOptions, pluginHooks, localeDefaults, availableLocaleData, } = this.processRawCalendarOptions(optionOverrides, dynamicOptionOverrides);
1362
+ let dateEnv = this.buildDateEnv(refinedOptions.timeZone, refinedOptions.locale, refinedOptions.weekNumberCalculation, refinedOptions.firstDay, refinedOptions.weekText, refinedOptions.weekTextShort, pluginHooks, availableLocaleData, refinedOptions.defaultRangeSeparator);
1363
+ let viewSpecs = this.buildViewSpecs(pluginHooks.views, this.stableOptionOverrides, this.stableDynamicOptionOverrides);
1364
+ let toolbarConfig = this.parseToolbars(refinedOptions, viewSpecs, calendarApi);
1412
1365
  return this.stableCalendarOptionsData = {
1413
1366
  calendarOptions: refinedOptions,
1414
1367
  pluginHooks,
1415
1368
  dateEnv,
1416
1369
  viewSpecs,
1417
- theme,
1418
1370
  toolbarConfig,
1419
1371
  localeDefaults,
1420
1372
  availableRawLocales: availableLocaleData.map,
@@ -1422,23 +1374,13 @@ class CalendarDataManager {
1422
1374
  }
1423
1375
  // always called from behind a memoizer
1424
1376
  processRawCalendarOptions(optionOverrides, dynamicOptionOverrides) {
1425
- let { locales, locale } = internalCommon.mergeRawOptions([
1426
- internalCommon.BASE_OPTION_DEFAULTS,
1427
- optionOverrides,
1428
- dynamicOptionOverrides,
1429
- ]);
1377
+ let { locales, locale } = internalCommon.mergeCalendarOptions(internalCommon.BASE_OPTION_DEFAULTS, optionOverrides, dynamicOptionOverrides);
1430
1378
  let availableLocaleData = this.organizeRawLocales(locales);
1431
1379
  let availableRawLocales = availableLocaleData.map;
1432
1380
  let localeDefaults = this.buildLocale(locale || availableLocaleData.defaultCode, availableRawLocales).options;
1433
1381
  let pluginHooks = this.buildPluginHooks(optionOverrides.plugins || [], globalPlugins);
1434
- let refiners = this.currentCalendarOptionsRefiners = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, internalCommon.BASE_OPTION_REFINERS), internalCommon.CALENDAR_LISTENER_REFINERS), internalCommon.CALENDAR_OPTION_REFINERS), pluginHooks.listenerRefiners), pluginHooks.optionRefiners);
1435
- let extra = {};
1436
- let raw = internalCommon.mergeRawOptions([
1437
- internalCommon.BASE_OPTION_DEFAULTS,
1438
- localeDefaults,
1439
- optionOverrides,
1440
- dynamicOptionOverrides,
1441
- ]);
1382
+ let refiners = this.currentCalendarOptionsRefiners = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, internalCommon.BASE_OPTION_REFINERS), internalCommon.CALENDAR_LISTENER_REFINERS), internalCommon.CALENDAR_ONLY_OPTION_REFINERS), pluginHooks.listenerRefiners), pluginHooks.optionRefiners);
1383
+ let raw = internalCommon.mergeCalendarOptions(internalCommon.BASE_OPTION_DEFAULTS, ...pluginHooks.optionDefaults, localeDefaults, filterKnownOptions(internalCommon.mergeCalendarOptions(optionOverrides, dynamicOptionOverrides), refiners));
1442
1384
  let refined = {};
1443
1385
  let currentRaw = this.currentCalendarOptionsInput;
1444
1386
  let currentRefined = this.currentCalendarOptionsRefined;
@@ -1446,16 +1388,17 @@ class CalendarDataManager {
1446
1388
  for (let optionName in raw) {
1447
1389
  if (this.optionsForRefining.indexOf(optionName) === -1 && (raw[optionName] === currentRaw[optionName] || (internalCommon.COMPLEX_OPTION_COMPARATORS[optionName] &&
1448
1390
  (optionName in currentRaw) &&
1449
- internalCommon.COMPLEX_OPTION_COMPARATORS[optionName](currentRaw[optionName], raw[optionName])))) {
1391
+ internalCommon.COMPLEX_OPTION_COMPARATORS[optionName](currentRaw[optionName], raw[optionName])) || (
1392
+ // see options-manip
1393
+ currentRaw[optionName] && currentRaw[optionName].parts &&
1394
+ raw[optionName] && raw[optionName].parts &&
1395
+ internalCommon.isArraysEqual(currentRaw[optionName].parts, raw[optionName].parts)))) {
1450
1396
  refined[optionName] = currentRefined[optionName];
1451
1397
  }
1452
1398
  else if (refiners[optionName]) {
1453
1399
  refined[optionName] = refiners[optionName](raw[optionName]);
1454
1400
  anyChanges = true;
1455
1401
  }
1456
- else {
1457
- extra[optionName] = currentRaw[optionName];
1458
- }
1459
1402
  }
1460
1403
  if (anyChanges) {
1461
1404
  this.currentCalendarOptionsInput = raw;
@@ -1471,7 +1414,6 @@ class CalendarDataManager {
1471
1414
  pluginHooks,
1472
1415
  availableLocaleData,
1473
1416
  localeDefaults,
1474
- extra,
1475
1417
  };
1476
1418
  }
1477
1419
  _computeCurrentViewData(viewType, optionsData, optionOverrides, dynamicOptionOverrides) {
@@ -1479,8 +1421,7 @@ class CalendarDataManager {
1479
1421
  if (!viewSpec) {
1480
1422
  throw new Error(`viewType "${viewType}" is not available. Please make sure you've loaded all neccessary plugins`);
1481
1423
  }
1482
- let { refinedOptions, extra } = this.processRawViewOptions(viewSpec, optionsData.pluginHooks, optionsData.localeDefaults, optionOverrides, dynamicOptionOverrides);
1483
- warnUnknownOptions(extra);
1424
+ let { refinedOptions } = this.processRawViewOptions(viewSpec, optionsData.pluginHooks, optionsData.localeDefaults, optionOverrides, dynamicOptionOverrides);
1484
1425
  let dateProfileGenerator = this.buildDateProfileGenerator({
1485
1426
  dateProfileGeneratorClass: viewSpec.optionDefaults.dateProfileGeneratorClass,
1486
1427
  duration: viewSpec.duration,
@@ -1505,24 +1446,19 @@ class CalendarDataManager {
1505
1446
  return { viewSpec, options: refinedOptions, dateProfileGenerator, viewApi };
1506
1447
  }
1507
1448
  processRawViewOptions(viewSpec, pluginHooks, localeDefaults, optionOverrides, dynamicOptionOverrides) {
1508
- let raw = internalCommon.mergeRawOptions([
1509
- internalCommon.BASE_OPTION_DEFAULTS,
1510
- viewSpec.optionDefaults,
1511
- localeDefaults,
1512
- optionOverrides,
1513
- viewSpec.optionOverrides,
1514
- dynamicOptionOverrides,
1515
- ]);
1516
- let refiners = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, internalCommon.BASE_OPTION_REFINERS), internalCommon.CALENDAR_LISTENER_REFINERS), internalCommon.CALENDAR_OPTION_REFINERS), internalCommon.VIEW_OPTION_REFINERS), pluginHooks.listenerRefiners), pluginHooks.optionRefiners);
1449
+ let refiners = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, internalCommon.BASE_OPTION_REFINERS), internalCommon.CALENDAR_LISTENER_REFINERS), internalCommon.CALENDAR_ONLY_OPTION_REFINERS), internalCommon.VIEW_ONLY_OPTION_REFINERS), pluginHooks.listenerRefiners), pluginHooks.optionRefiners);
1450
+ let raw = internalCommon.mergeCalendarOptions(internalCommon.BASE_OPTION_DEFAULTS, ...pluginHooks.optionDefaults, viewSpec.optionDefaults, localeDefaults, filterKnownOptions(internalCommon.mergeCalendarOptions(optionOverrides, viewSpec.optionOverrides, dynamicOptionOverrides), refiners));
1517
1451
  let refined = {};
1518
1452
  let currentRaw = this.currentViewOptionsInput;
1519
1453
  let currentRefined = this.currentViewOptionsRefined;
1520
1454
  let anyChanges = false;
1521
- let extra = {};
1522
1455
  for (let optionName in raw) {
1523
- if (raw[optionName] === currentRaw[optionName] ||
1524
- (internalCommon.COMPLEX_OPTION_COMPARATORS[optionName] &&
1525
- internalCommon.COMPLEX_OPTION_COMPARATORS[optionName](raw[optionName], currentRaw[optionName]))) {
1456
+ if (raw[optionName] === currentRaw[optionName] || (internalCommon.COMPLEX_OPTION_COMPARATORS[optionName] &&
1457
+ internalCommon.COMPLEX_OPTION_COMPARATORS[optionName](raw[optionName], currentRaw[optionName])) || (
1458
+ // see options-manip
1459
+ currentRaw[optionName] && currentRaw[optionName].parts &&
1460
+ raw[optionName] && raw[optionName].parts &&
1461
+ internalCommon.isArraysEqual(currentRaw[optionName].parts, raw[optionName].parts))) {
1526
1462
  refined[optionName] = currentRefined[optionName];
1527
1463
  }
1528
1464
  else {
@@ -1536,9 +1472,6 @@ class CalendarDataManager {
1536
1472
  else if (refiners[optionName]) {
1537
1473
  refined[optionName] = refiners[optionName](raw[optionName]);
1538
1474
  }
1539
- else {
1540
- extra[optionName] = raw[optionName];
1541
- }
1542
1475
  anyChanges = true;
1543
1476
  }
1544
1477
  }
@@ -1549,11 +1482,10 @@ class CalendarDataManager {
1549
1482
  return {
1550
1483
  rawOptions: this.currentViewOptionsInput,
1551
1484
  refinedOptions: this.currentViewOptionsRefined,
1552
- extra,
1553
1485
  };
1554
1486
  }
1555
1487
  }
1556
- function buildDateEnv$1(timeZone, explicitLocale, weekNumberCalculation, firstDay, weekText, pluginHooks, availableLocaleData, defaultSeparator) {
1488
+ function buildDateEnv$1(timeZone, explicitLocale, weekNumberCalculation, firstDay, weekText, weekTextShort, pluginHooks, availableLocaleData, defaultSeparator) {
1557
1489
  let locale = buildLocale(explicitLocale || availableLocaleData.defaultCode, availableLocaleData.map);
1558
1490
  return new internalCommon.DateEnv({
1559
1491
  calendarSystem: 'gregory',
@@ -1563,14 +1495,11 @@ function buildDateEnv$1(timeZone, explicitLocale, weekNumberCalculation, firstDa
1563
1495
  weekNumberCalculation,
1564
1496
  firstDay,
1565
1497
  weekText,
1498
+ weekTextShort,
1566
1499
  cmdFormatter: pluginHooks.cmdFormatter,
1567
1500
  defaultSeparator,
1568
1501
  });
1569
1502
  }
1570
- function buildTheme(options, pluginHooks) {
1571
- let ThemeClass = pluginHooks.themeClasses[options.themeSystem] || StandardTheme;
1572
- return new ThemeClass(options);
1573
- }
1574
1503
  function buildDateProfileGenerator(props) {
1575
1504
  let DateProfileGeneratorClass = props.dateProfileGeneratorClass || internalCommon.DateProfileGenerator;
1576
1505
  return new DateProfileGeneratorClass(props);
@@ -1581,8 +1510,13 @@ function buildViewApi(type, getCurrentData, dateEnv) {
1581
1510
  function buildEventUiBySource(eventSources) {
1582
1511
  return internalCommon.mapHash(eventSources, (eventSource) => eventSource.ui);
1583
1512
  }
1513
+ /*
1514
+ The result of this is processed by compileEventUi
1515
+ */
1584
1516
  function buildEventUiBases(eventDefs, eventUiSingleBase, eventUiBySource) {
1585
- let eventUiBases = { '': eventUiSingleBase };
1517
+ let eventUiBases = {
1518
+ '': eventUiSingleBase, // fallback
1519
+ };
1586
1520
  for (let defId in eventDefs) {
1587
1521
  let def = eventDefs[defId];
1588
1522
  if (def.sourceId && eventUiBySource[def.sourceId]) {
@@ -1592,7 +1526,7 @@ function buildEventUiBases(eventDefs, eventUiSingleBase, eventUiBySource) {
1592
1526
  return eventUiBases;
1593
1527
  }
1594
1528
  function buildViewUiProps(calendarContext) {
1595
- let { options } = calendarContext;
1529
+ const { options } = calendarContext;
1596
1530
  return {
1597
1531
  eventUiSingleBase: internalCommon.createEventUi({
1598
1532
  display: options.eventDisplay,
@@ -1602,11 +1536,9 @@ function buildViewUiProps(calendarContext) {
1602
1536
  constraint: options.eventConstraint,
1603
1537
  overlap: typeof options.eventOverlap === 'boolean' ? options.eventOverlap : undefined,
1604
1538
  allow: options.eventAllow,
1605
- backgroundColor: options.eventBackgroundColor,
1606
- borderColor: options.eventBorderColor,
1607
- textColor: options.eventTextColor,
1608
- color: options.eventColor,
1609
- // classNames: options.eventClassNames // render hook will handle this
1539
+ // color: options.eventColor, // StandardEvent/BgEvent will handle this
1540
+ // contrastColor: options.eventContrastColor, // StandardEvent/BgEvent will handle this
1541
+ // className: options.eventClass // render hook will handle this
1610
1542
  }, calendarContext),
1611
1543
  selectionConfig: internalCommon.createEventUi({
1612
1544
  constraint: options.selectConstraint,
@@ -1626,74 +1558,14 @@ function computeIsLoading(state, context) {
1626
1558
  function parseContextBusinessHours(calendarContext) {
1627
1559
  return internalCommon.parseBusinessHours(calendarContext.options.businessHours, calendarContext);
1628
1560
  }
1629
- function warnUnknownOptions(options, viewName) {
1630
- for (let optionName in options) {
1631
- console.warn(`Unknown option '${optionName}'` +
1632
- (viewName ? ` for view '${viewName}'` : ''));
1633
- }
1634
- }
1635
-
1636
- class ToolbarSection extends internalCommon.BaseComponent {
1637
- render() {
1638
- let children = this.props.widgetGroups.map((widgetGroup) => this.renderWidgetGroup(widgetGroup));
1639
- return preact.createElement('div', {
1640
- className: 'fc-toolbar-section fc-toolbar-' + this.props.name
1641
- }, ...children);
1642
- }
1643
- renderWidgetGroup(widgetGroup) {
1644
- let { props, context } = this;
1645
- let { options, theme } = context;
1646
- let children = [];
1647
- let isOnlyButtons = true;
1648
- let isOnlyView = true;
1649
- for (const widget of widgetGroup) {
1650
- const { buttonName, isView } = widget;
1651
- if (buttonName === 'title') {
1652
- isOnlyButtons = false;
1653
- }
1654
- else if (!isView) {
1655
- isOnlyView = false;
1656
- }
1561
+ function filterKnownOptions(options, optionRefiners) {
1562
+ const knownOptions = {};
1563
+ for (const optionName in options) {
1564
+ if (optionRefiners[optionName]) {
1565
+ knownOptions[optionName] = options[optionName];
1657
1566
  }
1658
- for (let widget of widgetGroup) {
1659
- let { buttonName, buttonClick, buttonText, buttonIcon, buttonHint } = widget;
1660
- if (buttonName === 'title') {
1661
- children.push(preact.createElement("div", { role: 'heading', "aria-level": options.headingLevel, id: props.titleId, className: 'fc-toolbar-title' }, props.title));
1662
- }
1663
- else {
1664
- let isPressed = buttonName === props.activeButton;
1665
- let isDisabled = (!props.isTodayEnabled && buttonName === 'today') ||
1666
- (!props.isPrevEnabled && buttonName === 'prev') ||
1667
- (!props.isNextEnabled && buttonName === 'next');
1668
- children.push(preact.createElement("button", Object.assign({ type: "button", disabled: isDisabled }, ((isOnlyButtons && isOnlyView)
1669
- ? { 'role': 'tab', 'aria-selected': isPressed }
1670
- : { 'aria-pressed': isPressed }), { "aria-label": typeof buttonHint === 'function' ? buttonHint(props.navUnit) : buttonHint, className: internalCommon.joinClassNames(`fc-${buttonName}-button`, theme.getClassName('button'), isPressed && theme.getClassName('buttonActive')), onClick: buttonClick }), buttonText || (buttonIcon ? preact.createElement("span", { className: buttonIcon, "aria-hidden": true }) : '')));
1671
- }
1672
- }
1673
- if (children.length > 1) {
1674
- return preact.createElement('div', {
1675
- role: (isOnlyButtons && isOnlyView) ? 'tablist' : undefined,
1676
- 'aria-label': (isOnlyButtons && isOnlyView) ? options.viewChangeHint : undefined,
1677
- className: isOnlyButtons ? theme.getClassName('buttonGroup') : undefined,
1678
- }, ...children);
1679
- }
1680
- return children[0];
1681
- }
1682
- }
1683
-
1684
- class Toolbar extends internalCommon.BaseComponent {
1685
- render() {
1686
- let { model, className } = this.props;
1687
- let { sectionWidgets } = model;
1688
- return (preact.createElement("div", { className: internalCommon.joinClassNames(className, 'fc-toolbar') },
1689
- this.renderSection('start', sectionWidgets.start),
1690
- this.renderSection('center', sectionWidgets.center),
1691
- this.renderSection('end', sectionWidgets.end)));
1692
- }
1693
- renderSection(key, widgetGroups) {
1694
- let { props } = this;
1695
- return (preact.createElement(ToolbarSection, { key: key, name: key, widgetGroups: widgetGroups, title: props.title, titleId: props.titleId, navUnit: props.navUnit, activeButton: props.activeButton, isTodayEnabled: props.isTodayEnabled, isPrevEnabled: props.isPrevEnabled, isNextEnabled: props.isNextEnabled }));
1696
1567
  }
1568
+ return knownOptions;
1697
1569
  }
1698
1570
 
1699
1571
  /*
@@ -1716,7 +1588,7 @@ class EventClicking extends internalCommon.Interaction {
1716
1588
  });
1717
1589
  }
1718
1590
  };
1719
- this.destroy = internalCommon.listenBySelector(settings.el, 'click', '.fc-event', // on both fg and bg events
1591
+ this.destroy = internalCommon.listenBySelector(settings.el, 'click', `.${internalCommon.classNames.internalEvent}`, // on both fg and bg events
1720
1592
  this.handleSegClick);
1721
1593
  }
1722
1594
  }
@@ -1746,7 +1618,7 @@ class EventHovering extends internalCommon.Interaction {
1746
1618
  this.triggerEvent('eventMouseLeave', ev, segEl);
1747
1619
  }
1748
1620
  };
1749
- this.removeHoverListeners = internalCommon.listenToHoverBySelector(settings.el, '.fc-event', // on both fg and bg events
1621
+ this.removeHoverListeners = internalCommon.listenToHoverBySelector(settings.el, `.${internalCommon.classNames.internalEvent}`, // on both fg and bg events
1750
1622
  this.handleSegEnter, this.handleSegLeave);
1751
1623
  }
1752
1624
  destroy() {
@@ -1767,20 +1639,123 @@ class EventHovering extends internalCommon.Interaction {
1767
1639
  }
1768
1640
  }
1769
1641
 
1770
- class ViewHarness extends preact.Component {
1642
+ class ButtonIcon extends internalCommon.BaseComponent {
1643
+ render() {
1644
+ const { contentGenerator, className } = this.props;
1645
+ if (contentGenerator) {
1646
+ // TODO: somehow give className to the svg?
1647
+ return (preact.createElement(internalCommon.ContentContainer, { tag: 'span', style: { display: 'contents' }, attrs: { 'aria-hidden': true }, renderProps: {}, generatorName: undefined, customGenerator: contentGenerator }));
1648
+ }
1649
+ if (className !== undefined) {
1650
+ return (preact.createElement("span", { "aria-hidden": true, className: className }));
1651
+ }
1652
+ }
1653
+ }
1654
+
1655
+ class ToolbarSection extends internalCommon.BaseComponent {
1656
+ render() {
1657
+ let { props } = this;
1658
+ let { options } = this.context;
1659
+ let children = props.widgetGroups.map((widgetGroup) => this.renderWidgetGroup(widgetGroup));
1660
+ return preact.createElement('div', {
1661
+ className: internalCommon.generateClassName(options.toolbarSectionClass, { name: props.name }),
1662
+ }, ...children);
1663
+ }
1664
+ renderWidgetGroup(widgetGroup) {
1665
+ var _a;
1666
+ let { props, context } = this;
1667
+ let { options } = context;
1668
+ let children = [];
1669
+ let isOnlyButtons = true;
1670
+ let isOnlyView = true;
1671
+ for (const widget of widgetGroup) {
1672
+ const { name, isView } = widget;
1673
+ if (name === 'title') {
1674
+ isOnlyButtons = false;
1675
+ }
1676
+ else if (!isView) {
1677
+ isOnlyView = false;
1678
+ }
1679
+ }
1680
+ for (let widget of widgetGroup) {
1681
+ let { name, customElement, buttonHint } = widget;
1682
+ if (name === 'title') {
1683
+ children.push(preact.createElement("div", { role: 'heading', "aria-level": options.headingLevel, id: props.titleId, className: internalCommon.joinArrayishClassNames(options.toolbarTitleClass) }, props.title));
1684
+ }
1685
+ else if (customElement) {
1686
+ children.push(preact.createElement(internalCommon.ContentContainer, { tag: 'span', style: { display: 'contents' }, renderProps: {}, generatorName: undefined, customGenerator: customElement }));
1687
+ }
1688
+ else {
1689
+ let isSelected = name === props.selectedButton;
1690
+ let isDisabled = (!props.isTodayEnabled && name === 'today') ||
1691
+ (!props.isPrevEnabled && name === 'prev') ||
1692
+ (!props.isNextEnabled && name === 'next');
1693
+ let buttonDisplay = (_a = widget.buttonDisplay) !== null && _a !== void 0 ? _a : options.buttonDisplay;
1694
+ if (buttonDisplay === 'auto') {
1695
+ buttonDisplay = (widget.buttonIconContent || widget.buttonIconClass)
1696
+ ? 'icon'
1697
+ : 'text';
1698
+ }
1699
+ let iconNode;
1700
+ if (buttonDisplay !== 'text') {
1701
+ iconNode = (preact.createElement(ButtonIcon, { className: widget.buttonIconClass, contentGenerator: widget.buttonIconContent }));
1702
+ }
1703
+ let inGroup = widgetGroup.length > 1 && isOnlyButtons;
1704
+ let inViewGroup = inGroup && isOnlyView;
1705
+ let renderProps = {
1706
+ name,
1707
+ text: widget.buttonText,
1708
+ isPrimary: widget.buttonIsPrimary,
1709
+ isSelected,
1710
+ isDisabled,
1711
+ isIconOnly: buttonDisplay === 'icon',
1712
+ inGroup,
1713
+ inSelectGroup: inViewGroup,
1714
+ };
1715
+ children.push(preact.createElement(internalCommon.ContentContainer, { tag: 'button', attrs: Object.assign(Object.assign({ type: 'button', disabled: isDisabled }, ((isOnlyButtons && isOnlyView)
1716
+ ? { 'role': 'tab', 'aria-selected': isSelected }
1717
+ : { 'aria-pressed': isSelected })), { 'aria-label': typeof buttonHint === 'function'
1718
+ ? buttonHint(props.navUnit)
1719
+ : buttonHint, onClick: widget.buttonClick }), className: internalCommon.joinClassNames(internalCommon.generateClassName(options.buttonClass, renderProps), !isDisabled && internalCommon.classNames.cursorPointer, inGroup && internalCommon.joinClassNames(isSelected ? internalCommon.classNames.z1 : internalCommon.classNames.z0, internalCommon.classNames.focusZ2)), renderProps: renderProps, generatorName: undefined, classNameGenerator: widget.buttonClass, didMount: widget.buttonDidMount, willUnmount: widget.buttonWillUnmount }, () => (buttonDisplay === 'text'
1720
+ ? widget.buttonText
1721
+ : buttonDisplay === 'icon'
1722
+ ? iconNode
1723
+ : buttonDisplay === 'icon-text'
1724
+ ? (preact.createElement(preact.Fragment, null,
1725
+ iconNode,
1726
+ widget.buttonText))
1727
+ : (preact.createElement(preact.Fragment, null,
1728
+ widget.buttonText,
1729
+ iconNode)) // text-icon
1730
+ )));
1731
+ }
1732
+ }
1733
+ if (children.length > 1) {
1734
+ return preact.createElement('div', {
1735
+ role: (isOnlyButtons && isOnlyView) ? 'tablist' : undefined,
1736
+ 'aria-label': (isOnlyButtons && isOnlyView) ? options.viewChangeHint : undefined,
1737
+ className: internalCommon.joinClassNames(internalCommon.generateClassName(options.buttonGroupClass, { isSelectGroup: isOnlyView }), internalCommon.classNames.isolate),
1738
+ }, ...children);
1739
+ }
1740
+ return children[0];
1741
+ }
1742
+ }
1743
+
1744
+ class Toolbar extends internalCommon.BaseComponent {
1771
1745
  render() {
1772
- const { props } = this;
1773
- return (preact.createElement("div", { className: internalCommon.joinClassNames('fc-view-outer', props.height != null
1774
- ? 'fc-view-outer-static'
1775
- : props.heightLiquid
1776
- ? 'fc-view-outer-liquid'
1777
- : props.aspectRatio != null
1778
- && 'fc-view-outer-aspect-ratio'), style: {
1779
- height: props.height,
1780
- paddingBottom: props.aspectRatio != null
1781
- ? `${(1 / props.aspectRatio) * 100}%`
1782
- : undefined
1783
- } }, props.children));
1746
+ let { props } = this;
1747
+ let options = this.context.options;
1748
+ let { sectionWidgets } = props.model;
1749
+ return (preact.createElement("div", { className: internalCommon.joinClassNames(props.className, internalCommon.generateClassName(options.toolbarClass, {
1750
+ borderlessX: props.borderlessX,
1751
+ })) },
1752
+ this.renderSection('start', sectionWidgets.start),
1753
+ this.renderSection('center', sectionWidgets.center),
1754
+ this.renderSection('end', sectionWidgets.end)));
1755
+ }
1756
+ renderSection(key, widgetGroups) {
1757
+ let { props } = this;
1758
+ return (preact.createElement(ToolbarSection, { key: key, name: key, widgetGroups: widgetGroups, title: props.title, titleId: props.titleId, navUnit: props.navUnit, selectedButton: props.selectedButton, isTodayEnabled: props.isTodayEnabled, isPrevEnabled: props.isPrevEnabled, isNextEnabled: props.isNextEnabled }));
1784
1759
  }
1785
1760
  }
1786
1761
 
@@ -1789,7 +1764,6 @@ class CalendarContent extends internalCommon.PureComponent {
1789
1764
  super(...arguments);
1790
1765
  this.buildViewContext = internalCommon.memoize(internalCommon.buildViewContext);
1791
1766
  this.buildViewPropTransformers = internalCommon.memoize(buildViewPropTransformers);
1792
- this.buildToolbarProps = internalCommon.memoize(buildToolbarProps);
1793
1767
  this.interactionsStore = {};
1794
1768
  this.viewTitleId = internalCommon.getUniqueDomId();
1795
1769
  // Component Registration
@@ -1823,10 +1797,9 @@ class CalendarContent extends internalCommon.PureComponent {
1823
1797
  renders INSIDE of an outer div
1824
1798
  */
1825
1799
  render() {
1800
+ var _a;
1826
1801
  let { props } = this;
1827
- let { toolbarConfig, options } = props;
1828
- let toolbarProps = this.buildToolbarProps(props.viewSpec, props.dateProfile, props.dateProfileGenerator, props.currentDate, internalCommon.getNow(props.options.now, props.dateEnv), // TODO: use NowTimer????
1829
- props.viewTitle);
1802
+ let { toolbarProps, toolbarConfig, options } = props;
1830
1803
  let viewHeight;
1831
1804
  let viewHeightLiquid = false;
1832
1805
  let viewAspectRatio;
@@ -1840,13 +1813,19 @@ class CalendarContent extends internalCommon.PureComponent {
1840
1813
  else {
1841
1814
  viewAspectRatio = Math.max(options.aspectRatio, 0.5); // prevent from getting too tall
1842
1815
  }
1843
- let viewContext = this.buildViewContext(props.viewSpec, props.viewApi, props.options, props.dateProfileGenerator, props.dateEnv, props.theme, props.pluginHooks, props.dispatch, props.getCurrentData, props.emitter, props.calendarApi, this.registerInteractiveComponent, this.unregisterInteractiveComponent);
1816
+ let viewContext = this.buildViewContext(props.viewSpec, props.viewApi, props.options, props.dateProfileGenerator, props.dateEnv, props.pluginHooks, props.dispatch, props.getCurrentData, props.emitter, props.calendarApi, this.registerInteractiveComponent, this.unregisterInteractiveComponent);
1817
+ let borderlessX = (_a = options.borderlessX) !== null && _a !== void 0 ? _a : options.borderless; // TODO: DRY
1844
1818
  return (preact.createElement(internalCommon.ViewContextType.Provider, { value: viewContext },
1845
- toolbarConfig.header && (preact.createElement(Toolbar, Object.assign({ className: "fc-header-toolbar", model: toolbarConfig.header, titleId: this.viewTitleId }, toolbarProps))),
1846
- preact.createElement(ViewHarness, { height: viewHeight, heightLiquid: viewHeightLiquid, aspectRatio: viewAspectRatio },
1847
- this.renderView(props, toolbarProps.title),
1819
+ toolbarConfig.header && (preact.createElement(Toolbar, Object.assign({ className: internalCommon.generateClassName(options.headerToolbarClass, { borderlessX }), model: toolbarConfig.header, borderlessX: borderlessX, titleId: this.viewTitleId }, toolbarProps))),
1820
+ preact.createElement("div", { className: internalCommon.joinClassNames(internalCommon.classNames.flexCol, internalCommon.classNames.rel, viewHeightLiquid && internalCommon.classNames.liquid), style: {
1821
+ height: viewHeight,
1822
+ paddingBottom: viewAspectRatio != null
1823
+ ? `${(1 / viewAspectRatio) * 100}%`
1824
+ : undefined
1825
+ } },
1826
+ this.renderView(internalCommon.joinClassNames((viewHeightLiquid || viewHeight) && internalCommon.classNames.liquid, viewAspectRatio != null && internalCommon.classNames.fill, internalCommon.classNames.internalView), toolbarProps.title),
1848
1827
  this.buildAppendContent()),
1849
- toolbarConfig.footer && (preact.createElement(Toolbar, Object.assign({ className: "fc-footer-toolbar", model: toolbarConfig.footer }, toolbarProps)))));
1828
+ toolbarConfig.footer && (preact.createElement(Toolbar, Object.assign({ className: internalCommon.generateClassName(options.footerToolbarClass, { borderlessX }), model: toolbarConfig.footer, borderlessX: borderlessX }, toolbarProps)))));
1850
1829
  }
1851
1830
  componentDidMount() {
1852
1831
  let { props } = this;
@@ -1877,10 +1856,17 @@ class CalendarContent extends internalCommon.PureComponent {
1877
1856
  let children = props.pluginHooks.viewContainerAppends.map((buildAppendContent) => buildAppendContent(props));
1878
1857
  return preact.createElement(preact.Fragment, {}, ...children);
1879
1858
  }
1880
- renderView(props, title) {
1881
- let { pluginHooks } = props;
1882
- let { viewSpec, toolbarConfig } = props;
1859
+ renderView(className, title) {
1860
+ var _a, _b, _c;
1861
+ let { props } = this;
1862
+ let { pluginHooks, viewSpec, toolbarConfig, options } = props;
1863
+ // TODO: DRY
1864
+ let { borderless } = options;
1865
+ let calendarBorderlessX = (_a = options.borderlessX) !== null && _a !== void 0 ? _a : borderless;
1866
+ let calendarBorderlessTop = (_b = options.borderlessTop) !== null && _b !== void 0 ? _b : borderless;
1867
+ let calendarBorderlessBottom = (_c = options.borderlessBottom) !== null && _c !== void 0 ? _c : borderless;
1883
1868
  let viewProps = {
1869
+ className,
1884
1870
  dateProfile: props.dateProfile,
1885
1871
  businessHours: props.businessHours,
1886
1872
  eventStore: props.renderableEventStore,
@@ -1892,6 +1878,10 @@ class CalendarContent extends internalCommon.PureComponent {
1892
1878
  forPrint: props.forPrint,
1893
1879
  labelId: toolbarConfig.header && toolbarConfig.header.hasTitle ? this.viewTitleId : undefined,
1894
1880
  labelStr: toolbarConfig.header && toolbarConfig.header.hasTitle ? undefined : title,
1881
+ borderlessX: calendarBorderlessX,
1882
+ borderlessTop: toolbarConfig.header ? false : calendarBorderlessTop,
1883
+ borderlessBottom: toolbarConfig.footer ? false : calendarBorderlessBottom,
1884
+ noEdgeEffects: calendarBorderlessX || calendarBorderlessTop || calendarBorderlessBottom,
1895
1885
  };
1896
1886
  let transformers = this.buildViewPropTransformers(pluginHooks.viewPropsTransformers);
1897
1887
  for (let transformer of transformers) {
@@ -1901,20 +1891,6 @@ class CalendarContent extends internalCommon.PureComponent {
1901
1891
  return (preact.createElement(ViewComponent, Object.assign({}, viewProps)));
1902
1892
  }
1903
1893
  }
1904
- function buildToolbarProps(viewSpec, dateProfile, dateProfileGenerator, currentDate, now, title) {
1905
- // don't force any date-profiles to valid date profiles (the `false`) so that we can tell if it's invalid
1906
- let todayInfo = dateProfileGenerator.build(now, undefined, false); // TODO: need `undefined` or else INFINITE LOOP for some reason
1907
- let prevInfo = dateProfileGenerator.buildPrev(dateProfile, currentDate, false);
1908
- let nextInfo = dateProfileGenerator.buildNext(dateProfile, currentDate, false);
1909
- return {
1910
- title,
1911
- activeButton: viewSpec.type,
1912
- navUnit: viewSpec.singleUnit,
1913
- isTodayEnabled: todayInfo.isValid && !internalCommon.rangeContainsMarker(dateProfile.currentRange, now),
1914
- isPrevEnabled: prevInfo.isValid,
1915
- isNextEnabled: nextInfo.isValid,
1916
- };
1917
- }
1918
1894
  // Plugin
1919
1895
  // -----------------------------------------------------------------------------------------------------------------
1920
1896
  function buildViewPropTransformers(theClasses) {
@@ -1927,9 +1903,10 @@ Vanilla JS API
1927
1903
  class Calendar extends internalCommon.CalendarImpl {
1928
1904
  constructor(el, optionOverrides = {}) {
1929
1905
  super();
1906
+ this.buildToolbarProps = internalCommon.memoize(buildToolbarProps);
1930
1907
  this.isRendering = false;
1931
1908
  this.isRendered = false;
1932
- this.currentClassNames = [];
1909
+ this.currentClassName = '';
1933
1910
  this.customContentRenderId = 0;
1934
1911
  this.handleAction = (action) => {
1935
1912
  // actions we know we want to render immediately
@@ -1948,22 +1925,25 @@ class Calendar extends internalCommon.CalendarImpl {
1948
1925
  this.isRendered = true;
1949
1926
  let { currentData } = this;
1950
1927
  internalCommon.flushSync(() => {
1951
- preact.render(preact.createElement(internalCommon.CalendarRoot, { options: currentData.calendarOptions, theme: currentData.theme, emitter: currentData.emitter }, (classNames, height, forPrint) => {
1952
- this.setClassNames(classNames);
1928
+ preact.render(preact.createElement(internalCommon.CalendarRoot, { options: currentData.calendarOptions, emitter: currentData.emitter }, (isRtl, className, height, forPrint) => {
1929
+ this.setIsRtl(isRtl);
1930
+ this.setClassName(className);
1953
1931
  this.setHeight(height);
1932
+ const toolbarProps = this.toolbarProps = this.buildToolbarProps(currentData.viewSpec, currentData.dateProfile, currentData.dateProfileGenerator, currentData.currentDate, internalCommon.getNow(currentData.options.now, currentData.dateEnv), // TODO: use NowTimer????
1933
+ currentData.viewTitle);
1954
1934
  return (preact.createElement(internalCommon.RenderId.Provider, { value: this.customContentRenderId },
1955
- preact.createElement(CalendarContent, Object.assign({ forPrint: forPrint }, currentData))));
1935
+ preact.createElement(CalendarContent, Object.assign({ forPrint: forPrint, toolbarProps: toolbarProps }, currentData))));
1956
1936
  }), this.el);
1957
1937
  });
1958
1938
  }
1959
1939
  else if (this.isRendered) {
1960
1940
  this.isRendered = false;
1961
1941
  preact.render(null, this.el);
1962
- this.setClassNames([]);
1942
+ this.setIsRtl(false);
1943
+ this.setClassName('');
1963
1944
  this.setHeight('');
1964
1945
  }
1965
1946
  };
1966
- internalCommon.ensureElHasStyles(el);
1967
1947
  this.el = el;
1968
1948
  this.renderRunner = new internalCommon.DelayedRunner(this.handleRenderRequest);
1969
1949
  new CalendarDataManager({
@@ -1992,11 +1972,6 @@ class Calendar extends internalCommon.CalendarImpl {
1992
1972
  this.renderRunner.request();
1993
1973
  }
1994
1974
  }
1995
- updateSize() {
1996
- internalCommon.flushSync(() => {
1997
- super.updateSize();
1998
- });
1999
- }
2000
1975
  batchRendering(func) {
2001
1976
  this.renderRunner.pause('batchRendering');
2002
1977
  func();
@@ -2011,21 +1986,170 @@ class Calendar extends internalCommon.CalendarImpl {
2011
1986
  resetOptions(optionOverrides, changedOptionNames) {
2012
1987
  this.currentDataManager.resetOptions(optionOverrides, changedOptionNames);
2013
1988
  }
2014
- setClassNames(classNames) {
2015
- if (!internalCommon.isArraysEqual(classNames, this.currentClassNames)) {
1989
+ /*
1990
+ TODO: DRY with toolbar-parse.ts and ToolbarSection
1991
+ */
1992
+ getButtonState() {
1993
+ var _a;
1994
+ const { currentData, toolbarProps } = this;
1995
+ const options = currentData.calendarOptions;
1996
+ const buttonConfigs = options.buttons || {};
1997
+ const viewSpecs = currentData.viewSpecs;
1998
+ const buttonState = {
1999
+ today: {
2000
+ text: options.todayText,
2001
+ hint: options.todayHint,
2002
+ isDisabled: !toolbarProps.isTodayEnabled,
2003
+ },
2004
+ prev: {
2005
+ text: options.prevText,
2006
+ hint: options.prevHint,
2007
+ isDisabled: !toolbarProps.isPrevEnabled,
2008
+ },
2009
+ next: {
2010
+ text: options.nextText,
2011
+ hint: options.nextHint,
2012
+ isDisabled: !toolbarProps.isNextEnabled,
2013
+ },
2014
+ prevYear: {
2015
+ text: options.prevYearText,
2016
+ hint: internalCommon.formatWithOrdinals(options.prevHint, [options.yearText, 'year'], options.prevYearText),
2017
+ isDisabled: false,
2018
+ },
2019
+ nextYear: {
2020
+ text: options.prevYearText,
2021
+ hint: internalCommon.formatWithOrdinals(options.nextHint, [options.yearText, 'year'], options.nextYearText),
2022
+ isDisabled: false,
2023
+ },
2024
+ };
2025
+ for (const viewSpecName in viewSpecs) {
2026
+ const viewSpec = viewSpecs[viewSpecName];
2027
+ const buttonTextKey = viewSpec.optionDefaults.buttonTextKey;
2028
+ const buttonText = ((_a = buttonConfigs[viewSpecName]) === null || _a === void 0 ? void 0 : _a.text) ||
2029
+ (buttonTextKey ? options[buttonTextKey] : '') ||
2030
+ (viewSpec.singleUnit ? options[viewSpec.singleUnit + 'Text'] : '') ||
2031
+ viewSpecName;
2032
+ const buttonHint = internalCommon.formatWithOrdinals(options.viewHint, [buttonText, viewSpecName], // ordinal arguments
2033
+ buttonText);
2034
+ buttonState[viewSpecName] = {
2035
+ text: buttonText,
2036
+ hint: buttonHint,
2037
+ };
2038
+ }
2039
+ return buttonState;
2040
+ }
2041
+ setClassName(className) {
2042
+ if (className !== this.currentClassName) {
2016
2043
  let { classList } = this.el;
2017
- for (let className of this.currentClassNames) {
2018
- classList.remove(className);
2044
+ for (let singleClassName of this.currentClassName.split(' ')) {
2045
+ if (singleClassName) {
2046
+ classList.remove(singleClassName);
2047
+ }
2019
2048
  }
2020
- for (let className of classNames) {
2021
- classList.add(className);
2049
+ for (let singleClassName of className.split(' ')) {
2050
+ if (singleClassName) {
2051
+ classList.add(singleClassName);
2052
+ }
2022
2053
  }
2023
- this.currentClassNames = classNames;
2054
+ this.currentClassName = className;
2024
2055
  }
2025
2056
  }
2026
2057
  setHeight(height) {
2027
2058
  internalCommon.applyStyleProp(this.el, 'height', height);
2028
2059
  }
2060
+ setIsRtl(isRtl) {
2061
+ if (isRtl) {
2062
+ this.el.dir = 'rtl';
2063
+ }
2064
+ else {
2065
+ this.el.removeAttribute('dir');
2066
+ }
2067
+ }
2068
+ }
2069
+ function buildToolbarProps(viewSpec, dateProfile, dateProfileGenerator, currentDate, now, title) {
2070
+ // don't force any date-profiles to valid date profiles (the `false`) so that we can tell if it's invalid
2071
+ let todayInfo = dateProfileGenerator.build(now, undefined, false); // TODO: need `undefined` or else INFINITE LOOP for some reason
2072
+ let prevInfo = dateProfileGenerator.buildPrev(dateProfile, currentDate, false);
2073
+ let nextInfo = dateProfileGenerator.buildNext(dateProfile, currentDate, false);
2074
+ return {
2075
+ title,
2076
+ selectedButton: viewSpec.type,
2077
+ navUnit: viewSpec.singleUnit,
2078
+ isTodayEnabled: todayInfo.isValid && !internalCommon.rangeContainsMarker(dateProfile.currentRange, now),
2079
+ isPrevEnabled: prevInfo.isValid,
2080
+ isNextEnabled: nextInfo.isValid,
2081
+ };
2082
+ }
2083
+
2084
+ const blankButtonState = {
2085
+ text: '', hint: '', isDisabled: false,
2086
+ };
2087
+ class CalendarController {
2088
+ constructor(handleDateChange) {
2089
+ this.handleDateChange = handleDateChange;
2090
+ }
2091
+ today() {
2092
+ var _a;
2093
+ (_a = this.calendarApi) === null || _a === void 0 ? void 0 : _a.today();
2094
+ }
2095
+ prev() {
2096
+ var _a;
2097
+ (_a = this.calendarApi) === null || _a === void 0 ? void 0 : _a.prev();
2098
+ }
2099
+ next() {
2100
+ var _a;
2101
+ (_a = this.calendarApi) === null || _a === void 0 ? void 0 : _a.next();
2102
+ }
2103
+ prevYear() {
2104
+ var _a;
2105
+ (_a = this.calendarApi) === null || _a === void 0 ? void 0 : _a.prevYear();
2106
+ }
2107
+ nextYear() {
2108
+ var _a;
2109
+ (_a = this.calendarApi) === null || _a === void 0 ? void 0 : _a.nextYear();
2110
+ }
2111
+ gotoDate(zonedDateInput) {
2112
+ var _a;
2113
+ (_a = this.calendarApi) === null || _a === void 0 ? void 0 : _a.gotoDate(zonedDateInput);
2114
+ }
2115
+ incrementDate(duration) {
2116
+ var _a;
2117
+ (_a = this.calendarApi) === null || _a === void 0 ? void 0 : _a.incrementDate(duration);
2118
+ }
2119
+ changeView(viewType) {
2120
+ var _a;
2121
+ (_a = this.calendarApi) === null || _a === void 0 ? void 0 : _a.changeView(viewType);
2122
+ }
2123
+ get view() {
2124
+ var _a;
2125
+ return (_a = this.calendarApi) === null || _a === void 0 ? void 0 : _a.view;
2126
+ }
2127
+ getDate() {
2128
+ var _a;
2129
+ return (_a = this.calendarApi) === null || _a === void 0 ? void 0 : _a.getDate();
2130
+ }
2131
+ getButtonState() {
2132
+ const { calendarApi } = this;
2133
+ return (calendarApi && calendarApi.getButtonState()) || {
2134
+ today: blankButtonState,
2135
+ prev: blankButtonState,
2136
+ next: blankButtonState,
2137
+ prevYear: blankButtonState,
2138
+ nextYear: blankButtonState,
2139
+ };
2140
+ }
2141
+ _setApi(calendarApi) {
2142
+ if (this.calendarApi !== calendarApi) {
2143
+ if (this.calendarApi) {
2144
+ this.calendarApi.off('datesSet', this.handleDateChange);
2145
+ this.calendarApi = undefined;
2146
+ }
2147
+ if (calendarApi) {
2148
+ this.calendarApi = calendarApi;
2149
+ calendarApi.on('datesSet', this.handleDateChange);
2150
+ }
2151
+ }
2152
+ }
2029
2153
  }
2030
2154
 
2031
2155
  function formatDate(dateInput, options = {}) {
@@ -2037,7 +2161,7 @@ function formatDate(dateInput, options = {}) {
2037
2161
  }
2038
2162
  return dateEnv.format(dateMeta.marker, formatter, {
2039
2163
  forcedTzo: dateMeta.forcedTzo,
2040
- });
2164
+ })[0];
2041
2165
  }
2042
2166
  function formatRange(startInput, endInput, options) {
2043
2167
  let dateEnv = buildDateEnv(typeof options === 'object' && options ? options : {}); // pass in if non-null object
@@ -2069,10 +2193,12 @@ function sliceEvents(props, allDay) {
2069
2193
  return internalCommon.sliceEventStore(props.eventStore, props.eventUiBases, props.dateProfile.activeRange, allDay ? props.nextDayThreshold : null).fg;
2070
2194
  }
2071
2195
 
2072
- const version = '7.0.0-beta.4';
2196
+ const version = '7.0.0-beta.5';
2073
2197
 
2074
2198
  exports.JsonRequestError = internalCommon.JsonRequestError;
2199
+ exports.joinClassNames = internalCommon.joinClassNames;
2075
2200
  exports.Calendar = Calendar;
2201
+ exports.CalendarController = CalendarController;
2076
2202
  exports.createPlugin = createPlugin;
2077
2203
  exports.formatDate = formatDate;
2078
2204
  exports.formatRange = formatRange;