@watermarkinsights/ripple 4.2.0-1 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (367) hide show
  1. package/dist/cjs/chartFunctions-2c3e010e.js +600 -0
  2. package/dist/cjs/{functions-4208c444.js → functions-91da05e9.js} +362 -362
  3. package/dist/cjs/{global-2806c327.js → global-b85941b0.js} +24 -24
  4. package/dist/cjs/{index-f8ef86de.js → index-fae02cd7.js} +150 -436
  5. package/dist/cjs/interfaces-245d7bff.js +38 -0
  6. package/dist/cjs/intl-fa3bb4ae.js +179 -0
  7. package/dist/cjs/loader.cjs.js +13 -4
  8. package/dist/cjs/priv-chart-popover.cjs.entry.js +85 -85
  9. package/dist/cjs/priv-datepicker.cjs.entry.js +637 -637
  10. package/dist/cjs/priv-navigator-button.cjs.entry.js +18 -18
  11. package/dist/cjs/priv-navigator-item.cjs.entry.js +21 -21
  12. package/dist/cjs/ripple.cjs.js +7 -4
  13. package/dist/cjs/wm-action-menu_2.cjs.entry.js +314 -314
  14. package/dist/cjs/wm-button.cjs.entry.js +174 -174
  15. package/dist/cjs/wm-chart-slice.cjs.entry.js +17 -17
  16. package/dist/cjs/wm-chart.cjs.entry.js +164 -164
  17. package/dist/cjs/wm-datepicker.cjs.entry.js +160 -160
  18. package/dist/cjs/wm-file-list.cjs.entry.js +10 -10
  19. package/dist/cjs/wm-file.cjs.entry.js +178 -178
  20. package/dist/cjs/wm-input.cjs.entry.js +102 -102
  21. package/dist/cjs/wm-line-chart.cjs.entry.js +448 -448
  22. package/dist/cjs/wm-modal-footer.cjs.entry.js +27 -27
  23. package/dist/cjs/wm-modal-header.cjs.entry.js +21 -21
  24. package/dist/cjs/wm-modal.cjs.entry.js +92 -92
  25. package/dist/cjs/wm-navigation_3.cjs.entry.js +179 -179
  26. package/dist/cjs/wm-navigator.cjs.entry.js +251 -251
  27. package/dist/cjs/wm-option_2.cjs.entry.js +710 -710
  28. package/dist/cjs/wm-pagination.cjs.entry.js +169 -169
  29. package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +151 -151
  30. package/dist/cjs/wm-search.cjs.entry.js +192 -192
  31. package/dist/cjs/wm-snackbar.cjs.entry.js +114 -114
  32. package/dist/cjs/wm-tab-item_3.cjs.entry.js +247 -247
  33. package/dist/cjs/wm-tag-input.cjs.entry.js +849 -849
  34. package/dist/cjs/wm-tag-option.cjs.entry.js +33 -33
  35. package/dist/cjs/wm-timepicker.cjs.entry.js +270 -270
  36. package/dist/cjs/wm-toggletip.cjs.entry.js +99 -99
  37. package/dist/cjs/wm-uploader.cjs.entry.js +198 -198
  38. package/dist/cjs/wm-wrapper.cjs.entry.js +12 -12
  39. package/dist/collection/collection-manifest.json +41 -41
  40. package/dist/collection/components/charts/chartFunctions.js +456 -456
  41. package/dist/collection/components/charts/chartFunctions.spec.js +13 -13
  42. package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.e2e.js +73 -73
  43. package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.js +254 -257
  44. package/dist/collection/components/charts/screenshots.e2e.js +30 -30
  45. package/dist/collection/components/charts/wm-chart/wm-chart-slice.js +121 -121
  46. package/dist/collection/components/charts/wm-chart/wm-chart.e2e.js +160 -160
  47. package/dist/collection/components/charts/wm-chart/wm-chart.js +381 -382
  48. package/dist/collection/components/charts/wm-chart/wm-chart.spec.js +26 -26
  49. package/dist/collection/components/charts/wm-line-chart/wm-line-chart.css +2 -1
  50. package/dist/collection/components/charts/wm-line-chart/wm-line-chart.e2e.js +138 -138
  51. package/dist/collection/components/charts/wm-line-chart/wm-line-chart.js +717 -717
  52. package/dist/collection/components/charts/wm-line-chart/wm-line-chart.spec.js +106 -106
  53. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.js +202 -202
  54. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.e2e.js +54 -54
  55. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.js +136 -136
  56. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.spec.js +31 -31
  57. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-slice.js +119 -119
  58. package/dist/collection/components/wm-action-menu/wm-action-menu.e2e.js +187 -187
  59. package/dist/collection/components/wm-action-menu/wm-action-menu.js +435 -435
  60. package/dist/collection/components/wm-action-menu/wm-action-menu.spec.js +35 -35
  61. package/dist/collection/components/wm-button/wm-button.e2e.js +58 -58
  62. package/dist/collection/components/wm-button/wm-button.js +452 -454
  63. package/dist/collection/components/wm-button/wm-button.spec.js +63 -63
  64. package/dist/collection/components/wm-datepicker/priv-datepicker/priv-datepicker.js +939 -943
  65. package/dist/collection/components/wm-datepicker/priv-datepicker/priv-datepicker.spec.js +71 -71
  66. package/dist/collection/components/wm-datepicker/wm-datepicker.css +2 -1
  67. package/dist/collection/components/wm-datepicker/wm-datepicker.e2e.js +359 -359
  68. package/dist/collection/components/wm-datepicker/wm-datepicker.js +413 -415
  69. package/dist/collection/components/wm-datepicker/wm-datepicker.spec.js +13 -13
  70. package/dist/collection/components/wm-file/wm-file.js +380 -380
  71. package/dist/collection/components/wm-file/wm-file.spec.js +107 -107
  72. package/dist/collection/components/wm-file-list/wm-file-list.js +42 -42
  73. package/dist/collection/components/wm-file-list/wm-file-list.spec.js +47 -47
  74. package/dist/collection/components/wm-input/wm-input.e2e.js +26 -26
  75. package/dist/collection/components/wm-input/wm-input.js +453 -453
  76. package/dist/collection/components/wm-input/wm-input.spec.js +168 -168
  77. package/dist/collection/components/wm-menuitem/wm-menuitem.e2e.js +18 -18
  78. package/dist/collection/components/wm-menuitem/wm-menuitem.js +436 -446
  79. package/dist/collection/components/wm-menuitem/wm-menuitem.spec.js +46 -46
  80. package/dist/collection/components/wm-modal/wm-modal-footer.js +130 -130
  81. package/dist/collection/components/wm-modal/wm-modal-footer.spec.js +8 -8
  82. package/dist/collection/components/wm-modal/wm-modal-header.js +68 -68
  83. package/dist/collection/components/wm-modal/wm-modal-header.spec.js +5 -5
  84. package/dist/collection/components/wm-modal/wm-modal.e2e.js +65 -65
  85. package/dist/collection/components/wm-modal/wm-modal.js +296 -299
  86. package/dist/collection/components/wm-modal/wm-modal.spec.js +22 -22
  87. package/dist/collection/components/wm-navigation/wm-navigation-hamburger.css +1 -0
  88. package/dist/collection/components/wm-navigation/wm-navigation-hamburger.js +112 -112
  89. package/dist/collection/components/wm-navigation/wm-navigation-item.js +125 -125
  90. package/dist/collection/components/wm-navigation/wm-navigation.css +2 -0
  91. package/dist/collection/components/wm-navigation/wm-navigation.e2e.js +86 -86
  92. package/dist/collection/components/wm-navigation/wm-navigation.js +209 -209
  93. package/dist/collection/components/wm-navigation/wm-navigation.spec.js +79 -79
  94. package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.e2e.js +30 -30
  95. package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.js +103 -103
  96. package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.js +118 -119
  97. package/dist/collection/components/wm-navigator/wm-navigator.e2e.js +180 -180
  98. package/dist/collection/components/wm-navigator/wm-navigator.js +454 -454
  99. package/dist/collection/components/wm-navigator/wm-navigator.spec.js +153 -153
  100. package/dist/collection/components/wm-option/wm-option.e2e.js +19 -19
  101. package/dist/collection/components/wm-option/wm-option.js +463 -474
  102. package/dist/collection/components/wm-option/wm-option.spec.js +39 -39
  103. package/dist/collection/components/wm-pagination/wm-pagination.e2e.js +301 -301
  104. package/dist/collection/components/wm-pagination/wm-pagination.js +327 -327
  105. package/dist/collection/components/wm-search/wm-search.e2e.js +69 -69
  106. package/dist/collection/components/wm-search/wm-search.js +414 -415
  107. package/dist/collection/components/wm-search/wm-search.spec.js +64 -64
  108. package/dist/collection/components/wm-select/wm-select.e2e.js +443 -443
  109. package/dist/collection/components/wm-select/wm-select.js +966 -967
  110. package/dist/collection/components/wm-select/wm-select.spec.js +250 -250
  111. package/dist/collection/components/wm-snackbar/wm-snackbar.e2e.js +114 -114
  112. package/dist/collection/components/wm-snackbar/wm-snackbar.js +207 -209
  113. package/dist/collection/components/wm-snackbar/wm-snackbar.spec.js +4 -4
  114. package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.js +188 -190
  115. package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.js +261 -261
  116. package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.js +104 -104
  117. package/dist/collection/components/wm-tabs/wm-tabs.e2e.js +79 -79
  118. package/dist/collection/components/wm-tabs/wm-tabs.spec.js +6 -6
  119. package/dist/collection/components/wm-tag-input/wm-tag-input.css +4 -2
  120. package/dist/collection/components/wm-tag-input/wm-tag-input.e2e.js +168 -168
  121. package/dist/collection/components/wm-tag-input/wm-tag-input.js +1159 -1159
  122. package/dist/collection/components/wm-tag-input/wm-tag-input.spec.js +147 -147
  123. package/dist/collection/components/wm-tag-input/wm-tag-option/wm-tag-option.js +234 -236
  124. package/dist/collection/components/wm-timepicker/wm-timepicker.css +2 -1
  125. package/dist/collection/components/wm-timepicker/wm-timepicker.e2e.js +147 -147
  126. package/dist/collection/components/wm-timepicker/wm-timepicker.js +527 -531
  127. package/dist/collection/components/wm-timepicker/wm-timepicker.spec.js +151 -151
  128. package/dist/collection/components/wm-toggletip/wm-toggletip.e2e.js +61 -61
  129. package/dist/collection/components/wm-toggletip/wm-toggletip.js +208 -209
  130. package/dist/collection/components/wm-toggletip/wm-toggletip.spec.js +16 -16
  131. package/dist/collection/components/wm-uploader/wm-uploader.e2e.js +56 -56
  132. package/dist/collection/components/wm-uploader/wm-uploader.js +422 -423
  133. package/dist/collection/components/wm-uploader/wm-uploader.spec.js +149 -149
  134. package/dist/collection/components/wm-wrapper/wm-wrapper.js +26 -26
  135. package/dist/collection/global/__mocks__/functions.js +1 -1
  136. package/dist/collection/global/functions.js +510 -510
  137. package/dist/collection/global/functions.spec.js +123 -123
  138. package/dist/collection/global/global.js +16 -16
  139. package/dist/collection/global/interfaces.js +39 -39
  140. package/dist/collection/global/intl.js +162 -162
  141. package/dist/collection/global/services/__mocks__/http-service.js +112 -112
  142. package/dist/collection/global/services/http-service.js +41 -41
  143. package/dist/collection/global/themes/default.js +4 -4
  144. package/dist/collection/global/themes/neutral.js +4 -4
  145. package/dist/collection/lang/lang.spec.js +13 -13
  146. package/dist/esm/chartFunctions-36634c04.js +584 -0
  147. package/dist/esm/{functions-d0e70094.js → functions-5afd09f4.js} +362 -362
  148. package/dist/esm/{global-08dce155.js → global-91088105.js} +24 -24
  149. package/dist/esm/{index-f164fbca.js → index-7e11ea42.js} +150 -436
  150. package/dist/esm/interfaces-89cad2fc.js +35 -0
  151. package/dist/esm/intl-e2da750a.js +174 -0
  152. package/dist/esm/loader.js +14 -5
  153. package/dist/esm/polyfills/css-shim.js +1 -0
  154. package/dist/esm/priv-chart-popover.entry.js +85 -85
  155. package/dist/esm/priv-datepicker.entry.js +637 -637
  156. package/dist/esm/priv-navigator-button.entry.js +18 -18
  157. package/dist/esm/priv-navigator-item.entry.js +21 -21
  158. package/dist/esm/ripple.js +8 -5
  159. package/dist/esm/wm-action-menu_2.entry.js +314 -314
  160. package/dist/esm/wm-button.entry.js +174 -174
  161. package/dist/esm/wm-chart-slice.entry.js +17 -17
  162. package/dist/esm/wm-chart.entry.js +164 -164
  163. package/dist/esm/wm-datepicker.entry.js +160 -160
  164. package/dist/esm/wm-file-list.entry.js +10 -10
  165. package/dist/esm/wm-file.entry.js +178 -178
  166. package/dist/esm/wm-input.entry.js +102 -102
  167. package/dist/esm/wm-line-chart.entry.js +448 -448
  168. package/dist/esm/wm-modal-footer.entry.js +27 -27
  169. package/dist/esm/wm-modal-header.entry.js +21 -21
  170. package/dist/esm/wm-modal.entry.js +92 -92
  171. package/dist/esm/wm-navigation_3.entry.js +179 -179
  172. package/dist/esm/wm-navigator.entry.js +251 -251
  173. package/dist/esm/wm-option_2.entry.js +710 -710
  174. package/dist/esm/wm-pagination.entry.js +169 -169
  175. package/dist/esm/wm-progress-indicator_3.entry.js +151 -151
  176. package/dist/esm/wm-search.entry.js +192 -192
  177. package/dist/esm/wm-snackbar.entry.js +114 -114
  178. package/dist/esm/wm-tab-item_3.entry.js +247 -247
  179. package/dist/esm/wm-tag-input.entry.js +849 -849
  180. package/dist/esm/wm-tag-option.entry.js +33 -33
  181. package/dist/esm/wm-timepicker.entry.js +270 -270
  182. package/dist/esm/wm-toggletip.entry.js +99 -99
  183. package/dist/esm/wm-uploader.entry.js +198 -198
  184. package/dist/esm/wm-wrapper.entry.js +12 -12
  185. package/dist/esm-es5/chartFunctions-36634c04.js +1 -0
  186. package/dist/esm-es5/functions-5afd09f4.js +1 -0
  187. package/dist/esm-es5/global-91088105.js +1 -0
  188. package/dist/esm-es5/index-7e11ea42.js +2 -0
  189. package/dist/esm-es5/{intl-05c9e0c9.js → intl-e2da750a.js} +1 -1
  190. package/dist/esm-es5/loader.js +1 -1
  191. package/dist/esm-es5/priv-chart-popover.entry.js +1 -1
  192. package/dist/esm-es5/priv-datepicker.entry.js +1 -1
  193. package/dist/esm-es5/priv-navigator-button.entry.js +1 -1
  194. package/dist/esm-es5/priv-navigator-item.entry.js +1 -1
  195. package/dist/esm-es5/ripple.js +1 -1
  196. package/dist/esm-es5/wm-action-menu_2.entry.js +1 -1
  197. package/dist/esm-es5/wm-button.entry.js +1 -1
  198. package/dist/esm-es5/wm-chart-slice.entry.js +1 -1
  199. package/dist/esm-es5/wm-chart.entry.js +1 -1
  200. package/dist/esm-es5/wm-datepicker.entry.js +1 -1
  201. package/dist/esm-es5/wm-file-list.entry.js +1 -1
  202. package/dist/esm-es5/wm-file.entry.js +1 -1
  203. package/dist/esm-es5/wm-input.entry.js +1 -1
  204. package/dist/esm-es5/wm-line-chart.entry.js +1 -1
  205. package/dist/esm-es5/wm-modal-footer.entry.js +1 -1
  206. package/dist/esm-es5/wm-modal-header.entry.js +1 -1
  207. package/dist/esm-es5/wm-modal.entry.js +1 -1
  208. package/dist/esm-es5/wm-navigation_3.entry.js +1 -1
  209. package/dist/esm-es5/wm-navigator.entry.js +1 -1
  210. package/dist/esm-es5/wm-option_2.entry.js +1 -1
  211. package/dist/esm-es5/wm-pagination.entry.js +1 -1
  212. package/dist/esm-es5/wm-progress-indicator_3.entry.js +1 -1
  213. package/dist/esm-es5/wm-search.entry.js +1 -1
  214. package/dist/esm-es5/wm-snackbar.entry.js +1 -1
  215. package/dist/esm-es5/wm-tab-item_3.entry.js +1 -1
  216. package/dist/esm-es5/wm-tag-input.entry.js +1 -1
  217. package/dist/esm-es5/wm-tag-option.entry.js +1 -1
  218. package/dist/esm-es5/wm-timepicker.entry.js +1 -1
  219. package/dist/esm-es5/wm-toggletip.entry.js +1 -1
  220. package/dist/esm-es5/wm-uploader.entry.js +1 -1
  221. package/dist/esm-es5/wm-wrapper.entry.js +1 -1
  222. package/dist/loader/index.d.ts +1 -1
  223. package/dist/ripple/p-00acacbe.system.entry.js +1 -0
  224. package/dist/ripple/{p-3446852f.system.entry.js → p-0631be01.system.entry.js} +1 -1
  225. package/dist/ripple/{p-ad6dc751.entry.js → p-0aecac86.entry.js} +1 -1
  226. package/dist/ripple/{p-c717d895.entry.js → p-0d9f70ab.entry.js} +1 -1
  227. package/dist/ripple/{p-b253d2fc.entry.js → p-0f1ff645.entry.js} +1 -1
  228. package/dist/ripple/{p-63f75d43.entry.js → p-1205fdc1.entry.js} +1 -1
  229. package/dist/ripple/{p-27f47edc.entry.js → p-1283e85d.entry.js} +1 -1
  230. package/dist/ripple/{p-43e2a49a.entry.js → p-13594c2e.entry.js} +1 -1
  231. package/dist/ripple/{p-5a921e55.entry.js → p-13af8346.entry.js} +1 -1
  232. package/dist/ripple/{p-ceced3d9.system.entry.js → p-15497721.system.entry.js} +1 -1
  233. package/dist/ripple/p-16363e1c.system.entry.js +1 -0
  234. package/dist/ripple/{p-3a070f35.entry.js → p-19773c40.entry.js} +1 -1
  235. package/dist/ripple/{p-b4d862e1.system.entry.js → p-1cde16a7.system.entry.js} +1 -1
  236. package/dist/ripple/{p-f711c914.entry.js → p-20f5c695.entry.js} +1 -1
  237. package/dist/ripple/{p-13ca30d8.js → p-24b08e1f.js} +1 -1
  238. package/dist/ripple/{p-2c834d27.system.entry.js → p-2a95b63f.system.entry.js} +1 -1
  239. package/dist/ripple/{p-c96a5c94.system.entry.js → p-2e773564.system.entry.js} +1 -1
  240. package/dist/ripple/p-30bf24f8.system.js +2 -0
  241. package/dist/ripple/p-3248c0fa.system.entry.js +1 -0
  242. package/dist/ripple/{p-28e4583c.system.entry.js → p-32b1126c.system.entry.js} +1 -1
  243. package/dist/ripple/{p-aadf8c59.entry.js → p-36049d2f.entry.js} +1 -1
  244. package/dist/ripple/p-3aca2871.js +1 -0
  245. package/dist/ripple/{p-633cd89a.system.entry.js → p-3becce62.system.entry.js} +1 -1
  246. package/dist/ripple/{p-58174f4e.entry.js → p-3c80bf67.entry.js} +1 -1
  247. package/dist/ripple/p-40fcae38.system.js +1 -0
  248. package/dist/ripple/p-47c20b05.entry.js +1 -0
  249. package/dist/ripple/p-4825101c.system.js +1 -0
  250. package/dist/ripple/p-56d64283.system.entry.js +1 -0
  251. package/dist/ripple/p-5e85967a.system.js +1 -0
  252. package/dist/ripple/{p-067d7922.system.entry.js → p-622a7791.system.entry.js} +1 -1
  253. package/dist/ripple/{p-aba5a00e.system.entry.js → p-676c1089.system.entry.js} +1 -1
  254. package/dist/ripple/{p-153701f9.entry.js → p-6abb903c.entry.js} +1 -1
  255. package/dist/ripple/{p-372faf33.entry.js → p-7529706d.entry.js} +1 -1
  256. package/dist/ripple/{p-de349bee.entry.js → p-7962f562.entry.js} +1 -1
  257. package/dist/ripple/{p-8d4734ad.entry.js → p-80aef387.entry.js} +1 -1
  258. package/dist/ripple/{p-8cace32f.entry.js → p-84a7e757.entry.js} +1 -1
  259. package/dist/ripple/{p-9fecbc8a.system.js → p-85f744ed.system.js} +1 -1
  260. package/dist/ripple/{p-05d4e49b.js → p-863e737a.js} +1 -1
  261. package/dist/ripple/{p-7e56da2e.system.entry.js → p-8ea68cb3.system.entry.js} +1 -1
  262. package/dist/ripple/{p-1402cfa2.system.js → p-8f3f903f.system.js} +1 -1
  263. package/dist/ripple/{p-c249063c.entry.js → p-8f8c3705.entry.js} +1 -1
  264. package/dist/ripple/{p-67d48c33.system.entry.js → p-90ea7e3a.system.entry.js} +1 -1
  265. package/dist/ripple/{p-a82a8931.entry.js → p-9288659b.entry.js} +1 -1
  266. package/dist/ripple/{p-6cf7a34a.entry.js → p-935513f8.entry.js} +1 -1
  267. package/dist/ripple/{p-b452d1d7.entry.js → p-a0bf5eef.entry.js} +1 -1
  268. package/dist/ripple/{p-06776596.system.entry.js → p-a1e95b05.system.entry.js} +1 -1
  269. package/dist/ripple/{p-25446670.entry.js → p-a52c5a1c.entry.js} +1 -1
  270. package/dist/ripple/{p-2c4f312d.system.entry.js → p-a5b23781.system.entry.js} +1 -1
  271. package/dist/ripple/p-a6be3cca.system.entry.js +1 -0
  272. package/dist/ripple/{p-fa87bce3.entry.js → p-a9c096b5.entry.js} +1 -1
  273. package/dist/ripple/p-aafa111a.system.js +1 -0
  274. package/dist/ripple/{p-1d8b0039.entry.js → p-ad37cdfd.entry.js} +1 -1
  275. package/dist/ripple/{p-350fe5da.entry.js → p-ae674a54.entry.js} +1 -1
  276. package/dist/ripple/{p-e24ddae1.entry.js → p-b3c73bc9.entry.js} +1 -1
  277. package/dist/ripple/{p-e8b58666.system.entry.js → p-b3e08b14.system.entry.js} +1 -1
  278. package/dist/ripple/p-b5bedd63.js +2 -0
  279. package/dist/ripple/{p-a69c37e0.entry.js → p-b71a83e3.entry.js} +1 -1
  280. package/dist/ripple/p-bd537299.system.entry.js +1 -0
  281. package/dist/ripple/{p-42ebfcfa.entry.js → p-c41603e6.entry.js} +1 -1
  282. package/dist/ripple/{p-5a4d9897.system.entry.js → p-c5e8f8a5.system.entry.js} +1 -1
  283. package/dist/ripple/{p-7a8816d9.system.entry.js → p-c76bbedf.system.entry.js} +1 -1
  284. package/dist/ripple/{p-3af72848.js → p-c7b5ac39.js} +1 -1
  285. package/dist/ripple/{p-361cc8fc.system.entry.js → p-cbd8a60b.system.entry.js} +1 -1
  286. package/dist/ripple/{p-3583d113.system.entry.js → p-d04ba5f8.system.entry.js} +1 -1
  287. package/dist/ripple/{p-1fa2a756.system.entry.js → p-d0f1b8c4.system.entry.js} +1 -1
  288. package/dist/ripple/{p-bdd4f919.system.entry.js → p-d496bc44.system.entry.js} +1 -1
  289. package/dist/ripple/{p-7e8daaac.entry.js → p-deb4f5a2.entry.js} +1 -1
  290. package/dist/ripple/{p-5ac980e2.system.entry.js → p-e3f0b57f.system.entry.js} +1 -1
  291. package/dist/ripple/{p-f1a92576.system.entry.js → p-e4919f95.system.entry.js} +1 -1
  292. package/dist/ripple/{p-49118468.entry.js → p-ed942b42.entry.js} +1 -1
  293. package/dist/ripple/{p-0ecbf569.system.entry.js → p-f30839a1.system.entry.js} +1 -1
  294. package/dist/ripple/{p-d3f9d028.system.entry.js → p-ff14e4ec.system.entry.js} +1 -1
  295. package/dist/ripple/ripple.esm.js +1 -1
  296. package/dist/ripple/ripple.js +20 -16
  297. package/dist/types/components/charts/chartFunctions.d.ts +13 -13
  298. package/dist/types/components/charts/priv-chart-popover/priv-chart-popover.d.ts +24 -24
  299. package/dist/types/components/charts/wm-chart/wm-chart-slice.d.ts +8 -8
  300. package/dist/types/components/charts/wm-chart/wm-chart.d.ts +39 -39
  301. package/dist/types/components/charts/wm-line-chart/wm-line-chart.d.ts +73 -73
  302. package/dist/types/components/charts/wm-progress-monitor/wm-progress-indicator.d.ts +26 -26
  303. package/dist/types/components/charts/wm-progress-monitor/wm-progress-monitor.d.ts +17 -17
  304. package/dist/types/components/charts/wm-progress-monitor/wm-progress-slice.d.ts +7 -7
  305. package/dist/types/components/wm-action-menu/wm-action-menu.d.ts +43 -43
  306. package/dist/types/components/wm-button/wm-button.d.ts +40 -40
  307. package/dist/types/components/wm-datepicker/priv-datepicker/priv-datepicker.d.ts +76 -76
  308. package/dist/types/components/wm-datepicker/wm-datepicker.d.ts +31 -31
  309. package/dist/types/components/wm-file/wm-file.d.ts +40 -40
  310. package/dist/types/components/wm-file-list/wm-file-list.d.ts +3 -3
  311. package/dist/types/components/wm-input/wm-input.d.ts +46 -46
  312. package/dist/types/components/wm-menuitem/wm-menuitem.d.ts +31 -31
  313. package/dist/types/components/wm-modal/wm-modal-footer.d.ts +11 -11
  314. package/dist/types/components/wm-modal/wm-modal-header.d.ts +7 -7
  315. package/dist/types/components/wm-modal/wm-modal.d.ts +24 -24
  316. package/dist/types/components/wm-navigation/wm-navigation-hamburger.d.ts +13 -13
  317. package/dist/types/components/wm-navigation/wm-navigation-item.d.ts +10 -10
  318. package/dist/types/components/wm-navigation/wm-navigation.d.ts +23 -23
  319. package/dist/types/components/wm-navigator/priv-navigator-button/priv-navigator-button.d.ts +7 -7
  320. package/dist/types/components/wm-navigator/priv-navigator-item/priv-navigator-item.d.ts +10 -10
  321. package/dist/types/components/wm-navigator/wm-navigator.d.ts +57 -57
  322. package/dist/types/components/wm-option/wm-option.d.ts +36 -36
  323. package/dist/types/components/wm-pagination/wm-pagination.d.ts +27 -27
  324. package/dist/types/components/wm-search/wm-search.d.ts +73 -73
  325. package/dist/types/components/wm-select/wm-select.d.ts +99 -99
  326. package/dist/types/components/wm-snackbar/wm-snackbar.d.ts +24 -24
  327. package/dist/types/components/wm-tabs/wm-tab-item/wm-tab-item.d.ts +30 -30
  328. package/dist/types/components/wm-tabs/wm-tab-list/wm-tab-list.d.ts +41 -41
  329. package/dist/types/components/wm-tabs/wm-tab-panel/wm-tab-panel.d.ts +16 -16
  330. package/dist/types/components/wm-timepicker/wm-timepicker.d.ts +48 -48
  331. package/dist/types/components/wm-toggletip/wm-toggletip.d.ts +20 -20
  332. package/dist/types/components/wm-uploader/wm-uploader.d.ts +47 -47
  333. package/dist/types/components/wm-wrapper/wm-wrapper.d.ts +4 -4
  334. package/dist/types/components.d.ts +0 -382
  335. package/dist/types/global/__mocks__/functions.d.ts +1 -1
  336. package/dist/types/global/functions.d.ts +4 -4
  337. package/dist/types/global/interfaces.d.ts +49 -49
  338. package/dist/types/global/intl.d.ts +31 -31
  339. package/dist/types/global/services/__mocks__/http-service.d.ts +1 -1
  340. package/dist/types/stencil-public-runtime.d.ts +5 -46
  341. package/package.json +1 -1
  342. package/dist/cjs/chartFunctions-cecf8134.js +0 -600
  343. package/dist/cjs/interfaces-ad9e80a6.js +0 -38
  344. package/dist/cjs/intl-3fafc6d1.js +0 -179
  345. package/dist/esm/chartFunctions-23173fce.js +0 -584
  346. package/dist/esm/interfaces-9b75fb61.js +0 -35
  347. package/dist/esm/intl-05c9e0c9.js +0 -174
  348. package/dist/esm-es5/chartFunctions-23173fce.js +0 -1
  349. package/dist/esm-es5/functions-d0e70094.js +0 -1
  350. package/dist/esm-es5/global-08dce155.js +0 -1
  351. package/dist/esm-es5/index-f164fbca.js +0 -2
  352. package/dist/ripple/p-028ef6db.system.entry.js +0 -1
  353. package/dist/ripple/p-09d62ddd.entry.js +0 -1
  354. package/dist/ripple/p-0fe97e85.system.js +0 -2
  355. package/dist/ripple/p-1453ea51.system.entry.js +0 -1
  356. package/dist/ripple/p-17d3440b.system.js +0 -1
  357. package/dist/ripple/p-1cc91907.system.js +0 -1
  358. package/dist/ripple/p-30b17818.system.entry.js +0 -1
  359. package/dist/ripple/p-4de51706.js +0 -2
  360. package/dist/ripple/p-88406560.system.entry.js +0 -1
  361. package/dist/ripple/p-8f76a838.system.entry.js +0 -1
  362. package/dist/ripple/p-a99b05de.system.entry.js +0 -1
  363. package/dist/ripple/p-c18b398c.system.js +0 -1
  364. package/dist/ripple/p-c235754b.js +0 -1
  365. package/dist/ripple/p-d03095e7.system.js +0 -1
  366. /package/dist/esm-es5/{interfaces-9b75fb61.js → interfaces-89cad2fc.js} +0 -0
  367. /package/dist/ripple/{p-196eb2f3.js → p-c0c111fd.js} +0 -0
@@ -2,965 +2,961 @@ import { h } from "@stencil/core";
2
2
  import { forceUpdate } from "@stencil/core";
3
3
  import { intl, hasRoomRight, shouldOpenUp } from "../../../global/functions";
4
4
  export class PrivDatepicker {
5
- constructor() {
6
- this.popupClicked = true;
7
- this.buttonClicked = true;
8
- this.prevClicked = true;
9
- this.nextClicked = true;
10
- this.openUp = false;
11
- this.calendar_months = [
12
- intl.formatMessage({
13
- id: "date.january",
14
- defaultMessage: "January",
15
- description: "Month of the year",
16
- }),
17
- intl.formatMessage({
18
- id: "date.february",
19
- defaultMessage: "February",
20
- description: "Month of the year",
21
- }),
22
- intl.formatMessage({
23
- id: "date.march",
24
- defaultMessage: "March",
25
- description: "Month of the year",
26
- }),
27
- intl.formatMessage({
28
- id: "date.april",
29
- defaultMessage: "April",
30
- description: "Month of the year",
31
- }),
32
- intl.formatMessage({
33
- id: "date.may",
34
- defaultMessage: "May",
35
- description: "Month of the year",
36
- }),
37
- intl.formatMessage({
38
- id: "date.june",
39
- defaultMessage: "June",
40
- description: "Month of the year",
41
- }),
42
- intl.formatMessage({
43
- id: "date.july",
44
- defaultMessage: "July",
45
- description: "Month of the year",
46
- }),
47
- intl.formatMessage({
48
- id: "date.august",
49
- defaultMessage: "August",
50
- description: "Month of the year",
51
- }),
52
- intl.formatMessage({
53
- id: "date.september",
54
- defaultMessage: "September",
55
- description: "Month of the year",
56
- }),
57
- intl.formatMessage({
58
- id: "date.october",
59
- defaultMessage: "October",
60
- description: "Month of the year",
61
- }),
62
- intl.formatMessage({
63
- id: "date.november",
64
- defaultMessage: "November",
65
- description: "Month of the year",
66
- }),
67
- intl.formatMessage({
68
- id: "date.december",
69
- defaultMessage: "December",
70
- description: "Month of the year",
71
- }),
72
- ];
73
- this.weekdays = [
74
- intl.formatMessage({ id: "date.sunday", defaultMessage: "Sunday" }),
75
- intl.formatMessage({ id: "date.monday", defaultMessage: "Monday" }),
76
- intl.formatMessage({ id: "date.tuesday", defaultMessage: "Tuesday" }),
77
- intl.formatMessage({ id: "date.wednesday", defaultMessage: "Wednesday" }),
78
- intl.formatMessage({ id: "date.thursday", defaultMessage: "Thursday" }),
79
- intl.formatMessage({ id: "date.friday", defaultMessage: "Friday" }),
80
- intl.formatMessage({ id: "date.saturday", defaultMessage: "Saturday" }),
81
- ];
82
- this.renderCalendarDate = (date, index) => {
83
- let monthOfDate = this.removeZeroes(String(date[1]));
84
- let dayOfDate = this.removeZeroes(String(date[2]));
85
- let isThisMonth = monthOfDate === this.monthInFocus ? "current-month" : "";
86
- const dateId = date[0] + date[1] + date[2];
87
- const isToday = this.isDateToday(date);
88
- return (h("div", { role: "gridcell", id: `cell-${dateId}`, class: `date-cell ${isThisMonth}`, "aria-selected": false, "aria-label": `${isToday
89
- ? `${intl.formatMessage({
90
- id: "date.today",
91
- defaultMessage: "today",
92
- description: "calendar button",
93
- })}, `
94
- : ""}${this.weekdays[index]}, ${this.calendar_months[monthOfDate - 1]} ${dayOfDate}, ${date[0]}`, onClick: (ev) => {
95
- this.handleTriggeredDate(ev.target);
96
- }, onKeyDown: (ev) => this.trapFocusEnd(ev), "data-month": date[1], "data-year": date[0], onBlur: (ev) => ev.stopPropagation() }, dayOfDate));
97
- };
98
- this.disabled = false;
99
- this.isExpanded = false;
100
- this.view = "day";
101
- this.date = new Date();
102
- this.selectedYear = this.date.getUTCFullYear();
103
- this.selectedMonth = this.date.getUTCMonth() + 1;
104
- this.selectedDay = this.date.getUTCDate();
105
- this.monthInFocus = this.selectedMonth;
106
- this.yearInFocus = this.selectedYear;
107
- this.dayInFocus = this.selectedDay;
108
- this.monthNumInFocus = this.selectedMonth;
109
- this.isTabbing = false;
110
- }
111
- handleKey(ev) {
112
- this.prevClicked = false;
113
- this.nextClicked = false;
114
- switch (ev.key) {
115
- case "Enter":
116
- ev.preventDefault();
117
- //Clunky exception for blur validation. Remove when blur reworked.
118
- !ev.target.id.includes("popup-title") && ev.target.click();
119
- break;
120
- case "Escape":
121
- ev.preventDefault();
122
- if (this.isExpanded) {
123
- ev.stopPropagation(); // prevents closing of parent modal
124
- this.closePopup(true);
125
- }
126
- break;
127
- case "PageUp":
128
- ev.preventDefault();
129
- this.backOneMonth();
130
- break;
131
- case "PageDown":
132
- ev.preventDefault();
133
- this.forwardOneMonth();
134
- break;
135
- case "Home":
136
- ev.preventDefault();
137
- this.unfocusCell();
138
- this.dayInFocus = 1;
139
- forceUpdate(this.el);
140
- break;
141
- case "End":
142
- ev.preventDefault();
143
- this.unfocusCell();
144
- this.dayInFocus = this.getMonthDays(this.monthInFocus, this.yearInFocus);
145
- forceUpdate(this.el);
146
- break;
147
- case "ArrowLeft":
148
- ev.preventDefault();
149
- if (this.view === "day") {
150
- this.unfocusCell();
151
- if (this.dayInFocus === 1) {
152
- const newMonth = this.getPreviousMonth(this.monthInFocus, this.yearInFocus);
153
- this.monthInFocus = newMonth.month;
154
- this.yearInFocus = newMonth.year;
155
- this.dayInFocus = this.getMonthDays(this.monthInFocus, this.yearInFocus);
156
- }
157
- else {
158
- this.dayInFocus -= 1;
159
- }
160
- }
161
- else {
162
- this.unfocusMonth();
163
- if (this.monthNumInFocus === 0) {
164
- this.monthNumInFocus = 11;
165
- }
166
- else {
167
- this.monthNumInFocus -= 1;
168
- }
169
- }
170
- break;
171
- case "ArrowRight":
172
- ev.preventDefault();
173
- if (this.view === "day") {
174
- this.unfocusCell();
175
- if (this.dayInFocus === this.getMonthDays(this.monthInFocus, this.yearInFocus)) {
176
- const newMonth = this.getNextMonth(this.monthInFocus, this.yearInFocus);
177
- this.monthInFocus = newMonth.month;
178
- this.yearInFocus = newMonth.year;
179
- this.dayInFocus = 1;
180
- }
181
- else {
182
- this.dayInFocus += 1;
183
- }
184
- }
185
- else {
186
- this.unfocusMonth();
187
- if (this.monthNumInFocus === 11) {
188
- this.monthNumInFocus = 0;
189
- }
190
- else {
191
- this.monthNumInFocus += 1;
192
- }
193
- }
194
- break;
195
- case "ArrowUp":
196
- ev.preventDefault();
197
- if (this.view === "day") {
198
- this.unfocusCell();
199
- if (this.dayInFocus < 8) {
200
- const newMonth = this.getPreviousMonth(this.monthInFocus, this.yearInFocus);
201
- this.monthInFocus = newMonth.month;
202
- this.yearInFocus = newMonth.year;
203
- const numDaysToSubtract = 7 - this.dayInFocus;
204
- this.dayInFocus = this.getMonthDays(this.monthInFocus, this.yearInFocus) - numDaysToSubtract;
205
- }
206
- else {
207
- this.dayInFocus -= 7;
208
- }
209
- }
210
- else {
211
- this.unfocusMonth();
212
- if (this.monthNumInFocus < 3) {
213
- this.monthNumInFocus += 9;
214
- }
215
- else {
216
- this.monthNumInFocus -= 3;
217
- }
218
- }
219
- break;
220
- case "ArrowDown":
221
- ev.preventDefault();
222
- if (!this.isExpanded) {
223
- this.openPopup();
224
- }
225
- else {
226
- if (this.view === "day") {
227
- //If the down arrow is pressed from the month button or the arrow buttons, focus should shift to the current cell in focus
228
- if (!(document.activeElement.shadowRoot || document).activeElement.classList.contains("date-cell")) {
229
- this.focusCell();
230
- break;
231
- }
232
- this.unfocusCell();
233
- const changeoverDate = this.getMonthDays(this.monthInFocus, this.yearInFocus) - 7;
234
- if (this.dayInFocus > changeoverDate) {
235
- const newMonth = this.getNextMonth(this.monthInFocus, this.yearInFocus);
236
- this.monthInFocus = newMonth.month;
237
- this.yearInFocus = newMonth.year;
238
- this.dayInFocus = this.dayInFocus - changeoverDate;
239
- }
240
- else {
241
- this.dayInFocus += 7;
242
- }
243
- }
244
- else {
245
- //If the down arrow is pressed from the arrow buttons or the title box, focus should shift to the current month in focus
246
- const activeEl = (document.activeElement.shadowRoot || document).activeElement;
247
- if (activeEl.tagName === "BUTTON" || activeEl.id.includes("popup-title-year")) {
248
- this.focusMonth();
249
- break;
250
- }
251
- this.unfocusMonth();
252
- if (this.monthNumInFocus > 8) {
253
- this.monthNumInFocus -= 9;
254
- }
255
- else {
256
- this.monthNumInFocus += 3;
257
- }
258
- }
259
- }
260
- break;
261
- }
262
- }
263
- toggleTabbingOn(ev) {
264
- const validKeys = ["Tab", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "Enter"];
265
- if (validKeys.includes(ev.key)) {
266
- this.isTabbing = true;
267
- }
268
- }
269
- //Using mousedown prevents this from running when the keydown listener emits ".click()" for when enter is pressed.
270
- toggleTabbingOff() {
271
- this.isTabbing = false;
272
- }
273
- blurHandler(ev) {
274
- if (!this.popupClicked && !this.buttonClicked && this.isExpanded) {
275
- this.closePopup();
276
- // in this case, the PointerEvent target is identical to the blur events relatedTarget, and is passed on as such
277
- this.popupBlurred.emit({ relatedTarget: ev.target });
278
- }
279
- this.popupClicked = false;
280
- this.buttonClicked = false;
281
- }
282
- handleBlurOnWindow(ev) {
283
- // for cases where the user clicks or uses a shortcut to leave the document
5
+ constructor() {
6
+ this.popupClicked = true;
7
+ this.buttonClicked = true;
8
+ this.prevClicked = true;
9
+ this.nextClicked = true;
10
+ this.openUp = false;
11
+ this.calendar_months = [
12
+ intl.formatMessage({
13
+ id: "date.january",
14
+ defaultMessage: "January",
15
+ description: "Month of the year",
16
+ }),
17
+ intl.formatMessage({
18
+ id: "date.february",
19
+ defaultMessage: "February",
20
+ description: "Month of the year",
21
+ }),
22
+ intl.formatMessage({
23
+ id: "date.march",
24
+ defaultMessage: "March",
25
+ description: "Month of the year",
26
+ }),
27
+ intl.formatMessage({
28
+ id: "date.april",
29
+ defaultMessage: "April",
30
+ description: "Month of the year",
31
+ }),
32
+ intl.formatMessage({
33
+ id: "date.may",
34
+ defaultMessage: "May",
35
+ description: "Month of the year",
36
+ }),
37
+ intl.formatMessage({
38
+ id: "date.june",
39
+ defaultMessage: "June",
40
+ description: "Month of the year",
41
+ }),
42
+ intl.formatMessage({
43
+ id: "date.july",
44
+ defaultMessage: "July",
45
+ description: "Month of the year",
46
+ }),
47
+ intl.formatMessage({
48
+ id: "date.august",
49
+ defaultMessage: "August",
50
+ description: "Month of the year",
51
+ }),
52
+ intl.formatMessage({
53
+ id: "date.september",
54
+ defaultMessage: "September",
55
+ description: "Month of the year",
56
+ }),
57
+ intl.formatMessage({
58
+ id: "date.october",
59
+ defaultMessage: "October",
60
+ description: "Month of the year",
61
+ }),
62
+ intl.formatMessage({
63
+ id: "date.november",
64
+ defaultMessage: "November",
65
+ description: "Month of the year",
66
+ }),
67
+ intl.formatMessage({
68
+ id: "date.december",
69
+ defaultMessage: "December",
70
+ description: "Month of the year",
71
+ }),
72
+ ];
73
+ this.weekdays = [
74
+ intl.formatMessage({ id: "date.sunday", defaultMessage: "Sunday" }),
75
+ intl.formatMessage({ id: "date.monday", defaultMessage: "Monday" }),
76
+ intl.formatMessage({ id: "date.tuesday", defaultMessage: "Tuesday" }),
77
+ intl.formatMessage({ id: "date.wednesday", defaultMessage: "Wednesday" }),
78
+ intl.formatMessage({ id: "date.thursday", defaultMessage: "Thursday" }),
79
+ intl.formatMessage({ id: "date.friday", defaultMessage: "Friday" }),
80
+ intl.formatMessage({ id: "date.saturday", defaultMessage: "Saturday" }),
81
+ ];
82
+ this.renderCalendarDate = (date, index) => {
83
+ let monthOfDate = this.removeZeroes(String(date[1]));
84
+ let dayOfDate = this.removeZeroes(String(date[2]));
85
+ let isThisMonth = monthOfDate === this.monthInFocus ? "current-month" : "";
86
+ const dateId = date[0] + date[1] + date[2];
87
+ const isToday = this.isDateToday(date);
88
+ return (h("div", { role: "gridcell", id: `cell-${dateId}`, class: `date-cell ${isThisMonth}`, "aria-selected": false, "aria-label": `${isToday
89
+ ? `${intl.formatMessage({
90
+ id: "date.today",
91
+ defaultMessage: "today",
92
+ description: "calendar button",
93
+ })}, `
94
+ : ""}${this.weekdays[index]}, ${this.calendar_months[monthOfDate - 1]} ${dayOfDate}, ${date[0]}`, onClick: (ev) => {
95
+ this.handleTriggeredDate(ev.target);
96
+ }, onKeyDown: (ev) => this.trapFocusEnd(ev), "data-month": date[1], "data-year": date[0], onBlur: (ev) => ev.stopPropagation() }, dayOfDate));
97
+ };
98
+ this.disabled = false;
99
+ this.isExpanded = false;
100
+ this.view = "day";
101
+ this.date = new Date();
102
+ this.selectedYear = this.date.getUTCFullYear();
103
+ this.selectedMonth = this.date.getUTCMonth() + 1;
104
+ this.selectedDay = this.date.getUTCDate();
105
+ this.monthInFocus = this.selectedMonth;
106
+ this.yearInFocus = this.selectedYear;
107
+ this.dayInFocus = this.selectedDay;
108
+ this.monthNumInFocus = this.selectedMonth;
109
+ this.isTabbing = false;
110
+ }
111
+ handleKey(ev) {
112
+ this.prevClicked = false;
113
+ this.nextClicked = false;
114
+ switch (ev.key) {
115
+ case "Enter":
116
+ ev.preventDefault();
117
+ //Clunky exception for blur validation. Remove when blur reworked.
118
+ !ev.target.id.includes("popup-title") && ev.target.click();
119
+ break;
120
+ case "Escape":
121
+ ev.preventDefault();
284
122
  if (this.isExpanded) {
285
- this.closePopup();
286
- this.popupBlurred.emit({ relatedTarget: ev.target });
123
+ ev.stopPropagation(); // prevents closing of parent modal
124
+ this.closePopup(true);
287
125
  }
288
- }
289
- componentDidUpdate() {
290
- this.handleSelectedDate();
291
- if (this.isExpanded) {
292
- this.prevClicked
293
- ? this.prevButton.focus()
294
- : this.nextClicked
295
- ? this.nextButton.focus()
296
- : this.view === "day"
297
- ? this.focusCell()
298
- : this.focusMonth();
299
- }
300
- }
301
- componentDidLoad() {
302
- this.handleSelectedDate();
303
- }
304
- zeroPad(value, length) {
305
- if (!String.prototype.padStart) {
306
- String.prototype.padStart = function padStart(targetLength, padString) {
307
- targetLength = targetLength - this.length;
308
- if (targetLength > padString.length) {
309
- padString += padString.repeat(targetLength / padString.length);
310
- }
311
- return padString.slice(0, targetLength) + String(this);
312
- };
313
- }
314
- return `${value.toString()}`.padStart(length, "0");
315
- }
316
- removeZeroes(date) {
317
- return +date < 10 ? +date.slice(1) : +date;
318
- }
319
- isDateToday(date) {
320
- const today = new Date();
321
- const todayDateArray = [
322
- today.getFullYear().toString(),
323
- (today.getMonth() + 1).toString(),
324
- today.getDate().toString(),
325
- ];
326
- //Compare today's date to date and return true if they match
327
- return todayDateArray.reduce((result, val, index) => result && this.removeZeroes(date[index]).toString() === val, true);
328
- }
329
- togglePopup() {
330
- this.isExpanded ? this.closePopup() : this.openPopup();
331
- this.buttonClicked = true;
332
- }
333
- closePopup(returnFocus = false) {
334
- this.isExpanded = false;
335
- this.popupEl.classList.remove("open");
336
- window.setTimeout(() => {
337
- //not using display none in order to get measurements of the popup while hidden
338
- this.popupEl.style.visibility = "hidden";
339
- }, 250);
340
- //Reset values so that menu reopens to day view with selected date in focus
126
+ break;
127
+ case "PageUp":
128
+ ev.preventDefault();
129
+ this.backOneMonth();
130
+ break;
131
+ case "PageDown":
132
+ ev.preventDefault();
133
+ this.forwardOneMonth();
134
+ break;
135
+ case "Home":
136
+ ev.preventDefault();
137
+ this.unfocusCell();
138
+ this.dayInFocus = 1;
139
+ forceUpdate(this.el);
140
+ break;
141
+ case "End":
142
+ ev.preventDefault();
143
+ this.unfocusCell();
144
+ this.dayInFocus = this.getMonthDays(this.monthInFocus, this.yearInFocus);
145
+ forceUpdate(this.el);
146
+ break;
147
+ case "ArrowLeft":
148
+ ev.preventDefault();
341
149
  if (this.view === "day") {
342
- this.unfocusCell();
150
+ this.unfocusCell();
151
+ if (this.dayInFocus === 1) {
152
+ const newMonth = this.getPreviousMonth(this.monthInFocus, this.yearInFocus);
153
+ this.monthInFocus = newMonth.month;
154
+ this.yearInFocus = newMonth.year;
155
+ this.dayInFocus = this.getMonthDays(this.monthInFocus, this.yearInFocus);
156
+ }
157
+ else {
158
+ this.dayInFocus -= 1;
159
+ }
343
160
  }
344
- this.monthInFocus = this.selectedMonth;
345
- this.yearInFocus = this.selectedYear;
346
- this.dayInFocus = this.selectedDay;
347
- this.changeView("day");
348
- if (returnFocus) {
349
- this.buttonEl.focus();
161
+ else {
162
+ this.unfocusMonth();
163
+ if (this.monthNumInFocus === 0) {
164
+ this.monthNumInFocus = 11;
165
+ }
166
+ else {
167
+ this.monthNumInFocus -= 1;
168
+ }
350
169
  }
351
- }
352
- openPopup() {
353
- this.panelPosition();
354
- this.setDateValuesForView();
355
- this.prevClicked = false;
356
- this.nextClicked = false;
357
- this.popupEl.style.visibility = "visible";
358
- window.requestAnimationFrame(() => {
359
- this.popupEl.classList.add("open");
360
- });
361
- this.isExpanded = true;
362
- this.focusCell();
363
- }
364
- getMonthDays(month, year) {
365
- const months30 = [4, 6, 9, 11];
366
- const leapYear = year % 4 === 0;
367
- return month === 2 ? (leapYear ? 29 : 28) : months30.includes(month) ? 30 : 31;
368
- }
369
- // 1 => Sunday, 7 => Saturday
370
- getMonthFirstDay(month, year) {
371
- return +new Date(year, month - 1, 1, 12, 0, 0).getDay() + 1;
372
- }
373
- getPreviousMonth(month, year) {
374
- const prevMonth = month > 1 ? month - 1 : 12;
375
- const prevMonthYear = month > 1 ? year : year - 1;
376
- return { month: prevMonth, year: prevMonthYear };
377
- }
378
- getNextMonth(month, year) {
379
- const nextMonth = month < 12 ? month + 1 : 1;
380
- const nextMonthYear = month < 12 ? year : year + 1;
381
- return { month: nextMonth, year: nextMonthYear };
382
- }
383
- getCalendarDates(month, year) {
384
- // Get number of days in the month and the month's first day
385
- const monthDays = this.getMonthDays(month, year);
386
- const monthFirstDay = this.getMonthFirstDay(month, year);
387
- // Get number of days to be displayed from previous and next months
388
- // These ensure a total of 42 days (6 weeks) displayed on the calendar
389
- const daysFromPrevMonth = monthFirstDay - 1;
390
- let daysFromNextMonth = 42 - (daysFromPrevMonth + monthDays);
391
- daysFromNextMonth = daysFromNextMonth > 6 ? daysFromNextMonth - 7 : daysFromNextMonth;
392
- // Get the previous and next months and years
393
- const { month: prevMonth, year: prevMonthYear } = this.getPreviousMonth(month, year);
394
- const { month: nextMonth, year: nextMonthYear } = this.getNextMonth(month, year);
395
- // Get number of days in previous month
396
- const prevMonthDays = this.getMonthDays(prevMonth, prevMonthYear);
397
- // Builds dates to be displayed from previous month. The initialized array is "filled" with an arbitrary number because IE and Edge won't map over an array with empty values.
398
- const prevMonthDates = [...new Array(daysFromPrevMonth).fill("1")].map((_, index) => {
399
- const day = index + 1 + (prevMonthDays - daysFromPrevMonth);
400
- return [prevMonthYear.toString(), this.zeroPad(prevMonth, 2), this.zeroPad(day, 2)];
401
- });
402
- // Builds dates to be displayed from current month. The initialized array is "filled" with an arbitrary number because IE and Edge won't map over an array with empty values.
403
- const thisMonthDates = [...new Array(monthDays).fill("1")].map((_, index) => {
404
- const day = index + 1;
405
- return [year.toString(), this.zeroPad(month, 2), this.zeroPad(day, 2)];
406
- });
407
- // Builds dates to be displayed from next month. The initialized array is "filled" with an arbitrary number because IE and Edge won't map over an array with empty values.
408
- const nextMonthDates = [...new Array(daysFromNextMonth).fill("1")].map((_, index) => {
409
- const day = index + 1;
410
- return [nextMonthYear.toString(), this.zeroPad(nextMonth, 2), this.zeroPad(day, 2)];
411
- });
412
- // Combines all dates from previous, current and next months
413
- return [...prevMonthDates, ...thisMonthDates, ...nextMonthDates];
414
- }
415
- forwardOneMonth() {
416
- this.unfocusCell();
417
- const newMonth = this.getNextMonth(this.monthInFocus, this.yearInFocus);
418
- this.monthInFocus = newMonth.month;
419
- this.yearInFocus = newMonth.year;
420
- const totalDays = this.getMonthDays(this.monthInFocus, this.yearInFocus);
421
- if (this.dayInFocus > this.getMonthDays(this.monthInFocus, this.yearInFocus)) {
422
- this.dayInFocus = totalDays;
170
+ break;
171
+ case "ArrowRight":
172
+ ev.preventDefault();
173
+ if (this.view === "day") {
174
+ this.unfocusCell();
175
+ if (this.dayInFocus === this.getMonthDays(this.monthInFocus, this.yearInFocus)) {
176
+ const newMonth = this.getNextMonth(this.monthInFocus, this.yearInFocus);
177
+ this.monthInFocus = newMonth.month;
178
+ this.yearInFocus = newMonth.year;
179
+ this.dayInFocus = 1;
180
+ }
181
+ else {
182
+ this.dayInFocus += 1;
183
+ }
423
184
  }
424
- this.updateLiveRegion(`Displaying ${this.calendar_months[this.monthInFocus - 1]}, ${this.yearInFocus}`);
425
- }
426
- backOneMonth() {
427
- this.unfocusCell();
428
- const newMonth = this.getPreviousMonth(this.monthInFocus, this.yearInFocus);
429
- this.monthInFocus = newMonth.month;
430
- this.yearInFocus = newMonth.year;
431
- const totalDays = this.getMonthDays(this.monthInFocus, this.yearInFocus);
432
- if (this.dayInFocus > this.getMonthDays(this.monthInFocus, this.yearInFocus)) {
433
- this.dayInFocus = totalDays;
185
+ else {
186
+ this.unfocusMonth();
187
+ if (this.monthNumInFocus === 11) {
188
+ this.monthNumInFocus = 0;
189
+ }
190
+ else {
191
+ this.monthNumInFocus += 1;
192
+ }
434
193
  }
435
- this.updateLiveRegion(`Viewing ${this.calendar_months[this.monthInFocus - 1]}, ${this.yearInFocus}`);
436
- }
437
- handleTriggeredDate(el) {
438
- this.cellTriggered.emit(el);
439
- // change of input value will trigger the function updating selectedDate
440
- this.closePopup(true);
441
- }
442
- handleSelectedDate() {
443
- //Remove old selection status
444
- if (this.selectedDate) {
445
- this.selectedDate.removeAttribute("aria-selected");
194
+ break;
195
+ case "ArrowUp":
196
+ ev.preventDefault();
197
+ if (this.view === "day") {
198
+ this.unfocusCell();
199
+ if (this.dayInFocus < 8) {
200
+ const newMonth = this.getPreviousMonth(this.monthInFocus, this.yearInFocus);
201
+ this.monthInFocus = newMonth.month;
202
+ this.yearInFocus = newMonth.year;
203
+ const numDaysToSubtract = 7 - this.dayInFocus;
204
+ this.dayInFocus = this.getMonthDays(this.monthInFocus, this.yearInFocus) - numDaysToSubtract;
205
+ }
206
+ else {
207
+ this.dayInFocus -= 7;
208
+ }
446
209
  }
447
- //Update selected date to new date inputted/selected
448
- this.selectedDate = this.getCellById(this.selectedYear, this.selectedMonth, this.selectedDay);
449
- if (this.selectedDate) {
450
- this.selectedDate.setAttribute("aria-selected", "true");
210
+ else {
211
+ this.unfocusMonth();
212
+ if (this.monthNumInFocus < 3) {
213
+ this.monthNumInFocus += 9;
214
+ }
215
+ else {
216
+ this.monthNumInFocus -= 3;
217
+ }
451
218
  }
452
- }
453
- getCellById(year, month, day) {
454
- const id = year + this.zeroPad(month, 2) + this.zeroPad(day, 2);
455
- return this.el.querySelector(`#cell-${id}`);
456
- }
457
- unfocusCell() {
458
- const cellToUnfocus = this.getCellById(this.yearInFocus, this.monthInFocus, this.dayInFocus);
459
- cellToUnfocus.tabIndex = -1;
460
- }
461
- focusCell() {
462
- //These two lines of code prevent an error from happening when the day in focus does not exist in a new month selected, e.g., May 31 is in focus, then the user selects "November". It will return focus in the date view to the last day of the month so that focus doesn't fly out of the popup.
463
- const maxDays = this.getMonthDays(this.monthInFocus, this.yearInFocus);
464
- this.dayInFocus = this.dayInFocus > maxDays ? maxDays : this.dayInFocus;
465
- const cellToFocus = this.getCellById(this.yearInFocus, this.monthInFocus, this.dayInFocus);
466
- if (cellToFocus) {
467
- cellToFocus.tabIndex = 0;
468
- cellToFocus.focus();
219
+ break;
220
+ case "ArrowDown":
221
+ ev.preventDefault();
222
+ if (!this.isExpanded) {
223
+ this.openPopup();
469
224
  }
470
- }
471
- unfocusMonth() {
472
- const monthToUnfocus = this.el.querySelector(`#month-${this.monthNumInFocus}`);
473
- monthToUnfocus.tabIndex = -1;
474
- }
475
- focusMonth() {
476
- const monthToFocus = this.el.querySelector(`#month-${this.monthNumInFocus}`);
477
- monthToFocus.tabIndex = 0;
478
- monthToFocus.focus();
479
- }
480
- trapFocusLeft(ev) {
481
- if (ev.shiftKey && ev.key === "Tab") {
482
- ev.preventDefault();
483
- this.focusCellInView();
225
+ else {
226
+ if (this.view === "day") {
227
+ //If the down arrow is pressed from the month button or the arrow buttons, focus should shift to the current cell in focus
228
+ if (!(document.activeElement.shadowRoot || document).activeElement.classList.contains("date-cell")) {
229
+ this.focusCell();
230
+ break;
231
+ }
232
+ this.unfocusCell();
233
+ const changeoverDate = this.getMonthDays(this.monthInFocus, this.yearInFocus) - 7;
234
+ if (this.dayInFocus > changeoverDate) {
235
+ const newMonth = this.getNextMonth(this.monthInFocus, this.yearInFocus);
236
+ this.monthInFocus = newMonth.month;
237
+ this.yearInFocus = newMonth.year;
238
+ this.dayInFocus = this.dayInFocus - changeoverDate;
239
+ }
240
+ else {
241
+ this.dayInFocus += 7;
242
+ }
243
+ }
244
+ else {
245
+ //If the down arrow is pressed from the arrow buttons or the title box, focus should shift to the current month in focus
246
+ const activeEl = (document.activeElement.shadowRoot || document).activeElement;
247
+ if (activeEl.tagName === "BUTTON" || activeEl.id.includes("popup-title-year")) {
248
+ this.focusMonth();
249
+ break;
250
+ }
251
+ this.unfocusMonth();
252
+ if (this.monthNumInFocus > 8) {
253
+ this.monthNumInFocus -= 9;
254
+ }
255
+ else {
256
+ this.monthNumInFocus += 3;
257
+ }
258
+ }
484
259
  }
485
- }
486
- trapFocusEnd(ev) {
487
- if (!ev.shiftKey && ev.key === "Tab") {
488
- ev.preventDefault();
489
- this.prevButton.focus();
260
+ break;
261
+ }
262
+ }
263
+ toggleTabbingOn(ev) {
264
+ const validKeys = ["Tab", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "Enter"];
265
+ if (validKeys.includes(ev.key)) {
266
+ this.isTabbing = true;
267
+ }
268
+ }
269
+ //Using mousedown prevents this from running when the keydown listener emits ".click()" for when enter is pressed.
270
+ toggleTabbingOff() {
271
+ this.isTabbing = false;
272
+ }
273
+ blurHandler(ev) {
274
+ if (!this.popupClicked && !this.buttonClicked && this.isExpanded) {
275
+ this.closePopup();
276
+ // in this case, the PointerEvent target is identical to the blur events relatedTarget, and is passed on as such
277
+ this.popupBlurred.emit({ relatedTarget: ev.target });
278
+ }
279
+ this.popupClicked = false;
280
+ this.buttonClicked = false;
281
+ }
282
+ handleBlurOnWindow(ev) {
283
+ // for cases where the user clicks or uses a shortcut to leave the document
284
+ if (this.isExpanded) {
285
+ this.closePopup();
286
+ this.popupBlurred.emit({ relatedTarget: ev.target });
287
+ }
288
+ }
289
+ componentDidUpdate() {
290
+ this.handleSelectedDate();
291
+ if (this.isExpanded) {
292
+ this.prevClicked
293
+ ? this.prevButton.focus()
294
+ : this.nextClicked
295
+ ? this.nextButton.focus()
296
+ : this.view === "day"
297
+ ? this.focusCell()
298
+ : this.focusMonth();
299
+ }
300
+ }
301
+ componentDidLoad() {
302
+ this.handleSelectedDate();
303
+ }
304
+ zeroPad(value, length) {
305
+ if (!String.prototype.padStart) {
306
+ String.prototype.padStart = function padStart(targetLength, padString) {
307
+ targetLength = targetLength - this.length;
308
+ if (targetLength > padString.length) {
309
+ padString += padString.repeat(targetLength / padString.length);
490
310
  }
491
- }
492
- trapFocusRight(ev) {
493
- if (!ev.shiftKey && ev.key === "Tab") {
494
- ev.preventDefault();
495
- this.focusCellInView();
311
+ return padString.slice(0, targetLength) + String(this);
312
+ };
313
+ }
314
+ return `${value.toString()}`.padStart(length, "0");
315
+ }
316
+ removeZeroes(date) {
317
+ return +date < 10 ? +date.slice(1) : +date;
318
+ }
319
+ isDateToday(date) {
320
+ const today = new Date();
321
+ const todayDateArray = [
322
+ today.getFullYear().toString(),
323
+ (today.getMonth() + 1).toString(),
324
+ today.getDate().toString(),
325
+ ];
326
+ //Compare today's date to date and return true if they match
327
+ return todayDateArray.reduce((result, val, index) => result && this.removeZeroes(date[index]).toString() === val, true);
328
+ }
329
+ togglePopup() {
330
+ this.isExpanded ? this.closePopup() : this.openPopup();
331
+ this.buttonClicked = true;
332
+ }
333
+ closePopup(returnFocus = false) {
334
+ this.isExpanded = false;
335
+ this.popupEl.classList.remove("open");
336
+ window.setTimeout(() => {
337
+ //not using display none in order to get measurements of the popup while hidden
338
+ this.popupEl.style.visibility = "hidden";
339
+ }, 250);
340
+ //Reset values so that menu reopens to day view with selected date in focus
341
+ if (this.view === "day") {
342
+ this.unfocusCell();
343
+ }
344
+ this.monthInFocus = this.selectedMonth;
345
+ this.yearInFocus = this.selectedYear;
346
+ this.dayInFocus = this.selectedDay;
347
+ this.changeView("day");
348
+ if (returnFocus) {
349
+ this.buttonEl.focus();
350
+ }
351
+ }
352
+ openPopup() {
353
+ this.panelPosition();
354
+ this.setDateValuesForView();
355
+ this.prevClicked = false;
356
+ this.nextClicked = false;
357
+ this.popupEl.style.visibility = "visible";
358
+ window.requestAnimationFrame(() => {
359
+ this.popupEl.classList.add("open");
360
+ });
361
+ this.isExpanded = true;
362
+ this.focusCell();
363
+ }
364
+ getMonthDays(month, year) {
365
+ const months30 = [4, 6, 9, 11];
366
+ const leapYear = year % 4 === 0;
367
+ return month === 2 ? (leapYear ? 29 : 28) : months30.includes(month) ? 30 : 31;
368
+ }
369
+ // 1 => Sunday, 7 => Saturday
370
+ getMonthFirstDay(month, year) {
371
+ return +new Date(year, month - 1, 1, 12, 0, 0).getDay() + 1;
372
+ }
373
+ getPreviousMonth(month, year) {
374
+ const prevMonth = month > 1 ? month - 1 : 12;
375
+ const prevMonthYear = month > 1 ? year : year - 1;
376
+ return { month: prevMonth, year: prevMonthYear };
377
+ }
378
+ getNextMonth(month, year) {
379
+ const nextMonth = month < 12 ? month + 1 : 1;
380
+ const nextMonthYear = month < 12 ? year : year + 1;
381
+ return { month: nextMonth, year: nextMonthYear };
382
+ }
383
+ getCalendarDates(month, year) {
384
+ // Get number of days in the month and the month's first day
385
+ const monthDays = this.getMonthDays(month, year);
386
+ const monthFirstDay = this.getMonthFirstDay(month, year);
387
+ // Get number of days to be displayed from previous and next months
388
+ // These ensure a total of 42 days (6 weeks) displayed on the calendar
389
+ const daysFromPrevMonth = monthFirstDay - 1;
390
+ let daysFromNextMonth = 42 - (daysFromPrevMonth + monthDays);
391
+ daysFromNextMonth = daysFromNextMonth > 6 ? daysFromNextMonth - 7 : daysFromNextMonth;
392
+ // Get the previous and next months and years
393
+ const { month: prevMonth, year: prevMonthYear } = this.getPreviousMonth(month, year);
394
+ const { month: nextMonth, year: nextMonthYear } = this.getNextMonth(month, year);
395
+ // Get number of days in previous month
396
+ const prevMonthDays = this.getMonthDays(prevMonth, prevMonthYear);
397
+ // Builds dates to be displayed from previous month. The initialized array is "filled" with an arbitrary number because IE and Edge won't map over an array with empty values.
398
+ const prevMonthDates = [...new Array(daysFromPrevMonth).fill("1")].map((_, index) => {
399
+ const day = index + 1 + (prevMonthDays - daysFromPrevMonth);
400
+ return [prevMonthYear.toString(), this.zeroPad(prevMonth, 2), this.zeroPad(day, 2)];
401
+ });
402
+ // Builds dates to be displayed from current month. The initialized array is "filled" with an arbitrary number because IE and Edge won't map over an array with empty values.
403
+ const thisMonthDates = [...new Array(monthDays).fill("1")].map((_, index) => {
404
+ const day = index + 1;
405
+ return [year.toString(), this.zeroPad(month, 2), this.zeroPad(day, 2)];
406
+ });
407
+ // Builds dates to be displayed from next month. The initialized array is "filled" with an arbitrary number because IE and Edge won't map over an array with empty values.
408
+ const nextMonthDates = [...new Array(daysFromNextMonth).fill("1")].map((_, index) => {
409
+ const day = index + 1;
410
+ return [nextMonthYear.toString(), this.zeroPad(nextMonth, 2), this.zeroPad(day, 2)];
411
+ });
412
+ // Combines all dates from previous, current and next months
413
+ return [...prevMonthDates, ...thisMonthDates, ...nextMonthDates];
414
+ }
415
+ forwardOneMonth() {
416
+ this.unfocusCell();
417
+ const newMonth = this.getNextMonth(this.monthInFocus, this.yearInFocus);
418
+ this.monthInFocus = newMonth.month;
419
+ this.yearInFocus = newMonth.year;
420
+ const totalDays = this.getMonthDays(this.monthInFocus, this.yearInFocus);
421
+ if (this.dayInFocus > this.getMonthDays(this.monthInFocus, this.yearInFocus)) {
422
+ this.dayInFocus = totalDays;
423
+ }
424
+ this.updateLiveRegion(`Displaying ${this.calendar_months[this.monthInFocus - 1]}, ${this.yearInFocus}`);
425
+ }
426
+ backOneMonth() {
427
+ this.unfocusCell();
428
+ const newMonth = this.getPreviousMonth(this.monthInFocus, this.yearInFocus);
429
+ this.monthInFocus = newMonth.month;
430
+ this.yearInFocus = newMonth.year;
431
+ const totalDays = this.getMonthDays(this.monthInFocus, this.yearInFocus);
432
+ if (this.dayInFocus > this.getMonthDays(this.monthInFocus, this.yearInFocus)) {
433
+ this.dayInFocus = totalDays;
434
+ }
435
+ this.updateLiveRegion(`Viewing ${this.calendar_months[this.monthInFocus - 1]}, ${this.yearInFocus}`);
436
+ }
437
+ handleTriggeredDate(el) {
438
+ this.cellTriggered.emit(el);
439
+ // change of input value will trigger the function updating selectedDate
440
+ this.closePopup(true);
441
+ }
442
+ handleSelectedDate() {
443
+ //Remove old selection status
444
+ if (this.selectedDate) {
445
+ this.selectedDate.removeAttribute("aria-selected");
446
+ }
447
+ //Update selected date to new date inputted/selected
448
+ this.selectedDate = this.getCellById(this.selectedYear, this.selectedMonth, this.selectedDay);
449
+ if (this.selectedDate) {
450
+ this.selectedDate.setAttribute("aria-selected", "true");
451
+ }
452
+ }
453
+ getCellById(year, month, day) {
454
+ const id = year + this.zeroPad(month, 2) + this.zeroPad(day, 2);
455
+ return this.el.querySelector(`#cell-${id}`);
456
+ }
457
+ unfocusCell() {
458
+ const cellToUnfocus = this.getCellById(this.yearInFocus, this.monthInFocus, this.dayInFocus);
459
+ cellToUnfocus.tabIndex = -1;
460
+ }
461
+ focusCell() {
462
+ //These two lines of code prevent an error from happening when the day in focus does not exist in a new month selected, e.g., May 31 is in focus, then the user selects "November". It will return focus in the date view to the last day of the month so that focus doesn't fly out of the popup.
463
+ const maxDays = this.getMonthDays(this.monthInFocus, this.yearInFocus);
464
+ this.dayInFocus = this.dayInFocus > maxDays ? maxDays : this.dayInFocus;
465
+ const cellToFocus = this.getCellById(this.yearInFocus, this.monthInFocus, this.dayInFocus);
466
+ if (cellToFocus) {
467
+ cellToFocus.tabIndex = 0;
468
+ cellToFocus.focus();
469
+ }
470
+ }
471
+ unfocusMonth() {
472
+ const monthToUnfocus = this.el.querySelector(`#month-${this.monthNumInFocus}`);
473
+ monthToUnfocus.tabIndex = -1;
474
+ }
475
+ focusMonth() {
476
+ const monthToFocus = this.el.querySelector(`#month-${this.monthNumInFocus}`);
477
+ monthToFocus.tabIndex = 0;
478
+ monthToFocus.focus();
479
+ }
480
+ trapFocusLeft(ev) {
481
+ if (ev.shiftKey && ev.key === "Tab") {
482
+ ev.preventDefault();
483
+ this.focusCellInView();
484
+ }
485
+ }
486
+ trapFocusEnd(ev) {
487
+ if (!ev.shiftKey && ev.key === "Tab") {
488
+ ev.preventDefault();
489
+ this.prevButton.focus();
490
+ }
491
+ }
492
+ trapFocusRight(ev) {
493
+ if (!ev.shiftKey && ev.key === "Tab") {
494
+ ev.preventDefault();
495
+ this.focusCellInView();
496
+ }
497
+ }
498
+ focusCellInView() {
499
+ if (this.view === "day") {
500
+ this.focusCell();
501
+ }
502
+ else {
503
+ this.focusMonth();
504
+ }
505
+ }
506
+ toggleBusyAttribute(state) {
507
+ this.el.querySelector("#wm-container").setAttribute("aria-busy", state);
508
+ }
509
+ setDateValuesForView() {
510
+ this.selectedYear = this.date.getUTCFullYear();
511
+ this.selectedMonth = this.date.getUTCMonth() + 1;
512
+ this.selectedDay = this.date.getUTCDate();
513
+ this.monthInFocus = this.selectedMonth;
514
+ this.yearInFocus = this.selectedYear;
515
+ this.dayInFocus = this.selectedDay;
516
+ this.monthNumInFocus = this.selectedMonth - 1;
517
+ }
518
+ updateLiveRegion(text) {
519
+ let liveRegion = this.el.querySelector("#live-region");
520
+ liveRegion.innerHTML = text;
521
+ }
522
+ panelPosition() {
523
+ const parentDatepickerEl = this.el.getRootNode().host;
524
+ const labelHeight = parentDatepickerEl.shadowRoot.querySelector(".label-wrapper").clientHeight;
525
+ this.openUp = shouldOpenUp(parentDatepickerEl, this.popupEl.clientHeight, labelHeight);
526
+ if (hasRoomRight(parentDatepickerEl, 336)) {
527
+ this.popupEl.style.left = "0";
528
+ this.popupEl.style.right = "auto";
529
+ }
530
+ else {
531
+ this.popupEl.style.right = "0";
532
+ this.popupEl.style.left = "auto";
533
+ }
534
+ }
535
+ changeView(newView) {
536
+ this.view = newView;
537
+ //Ensure month view always opens to the month last visited in date view
538
+ this.monthNumInFocus = this.monthInFocus - 1;
539
+ }
540
+ renderMonths(month, index) {
541
+ return (h("div", { id: `month-${index}`, class: `month ${this.selectedMonth - 1 === index ? "selected" : ""}`, role: "gridcell", tabindex: index + 1 === this.monthInFocus ? 0 : -1, onKeyDown: (ev) => this.trapFocusEnd(ev), onBlur: (ev) => ev.stopPropagation(), onClick: () => {
542
+ this.monthInFocus = index + 1;
543
+ this.changeView("day");
544
+ } }, month));
545
+ }
546
+ render() {
547
+ const dates = this.getCalendarDates(this.monthInFocus, this.yearInFocus);
548
+ return (h("div", { class: "container", id: "wm-container" }, h("button", { disabled: this.disabled, onClick: this.togglePopup.bind(this), "aria-describedby": "date-input", ref: (el) => (this.buttonEl = el), "aria-expanded": `${this.isExpanded}`, class: "toggle", id: "toggle" }, h("span", { class: "calendar", title: intl.formatMessage({
549
+ id: "date.calendarView",
550
+ defaultMessage: "Calendar View",
551
+ description: "Calendar button",
552
+ }) })), h("div", { class: `popup ${this.view}-view ${this.openUp ? "expand-upwards" : ""} ${this.isTabbing ? "user-is-tabbing" : ""}`, id: "popup", ref: (el) => (this.popupEl = el), onClick: () => (this.popupClicked = true), role: "application", "aria-describedby": "application" }, this.view === "day" ? (h("div", { class: "day-view" }, h("div", { class: "calendar-header" }, h("button", { onClick: () => {
553
+ this.prevClicked = true;
554
+ this.popupClicked = true;
555
+ this.backOneMonth();
556
+ }, onKeyDown: (ev) => this.trapFocusLeft(ev), ref: (el) => (this.prevButton = el), class: "arw-btn", "aria-label": intl.formatMessage({
557
+ id: "date.selectPreviousMonth",
558
+ defaultMessage: "Select previous month",
559
+ description: "Calendar button",
560
+ }) }, h("span", { class: "mdi" }, "\uF141")), h("div", { id: "popup-title-month", class: "title-box", tabindex: 0, role: "button", onKeyDown: (ev) => {
561
+ if (ev.key === "Enter" || ev.key === " ") {
562
+ ev.preventDefault();
563
+ this.changeView("month");
496
564
  }
497
- }
498
- focusCellInView() {
499
- if (this.view === "day") {
500
- this.focusCell();
565
+ }, onClick: this.changeView.bind(this, "month"), "aria-label": `${intl.formatMessage({
566
+ id: "date.currentMonth",
567
+ defaultMessage: "current month",
568
+ description: "Calendar button",
569
+ })}: ${this.calendar_months[this.monthInFocus - 1]}
570
+ ${this.yearInFocus}.`, "aria-describedby": "month-title" }, h("span", { class: "title", "aria-hidden": "true" }, this.calendar_months[this.monthInFocus - 1], " ", this.yearInFocus)), h("button", { onClick: () => {
571
+ this.nextClicked = true;
572
+ this.popupClicked = true;
573
+ this.forwardOneMonth();
574
+ }, onKeyDown: (ev) => this.trapFocusRight(ev), "aria-label": intl.formatMessage({
575
+ id: "date.selectNextMonth",
576
+ defaultMessage: "Select next month",
577
+ description: "Calendar button",
578
+ }), ref: (el) => (this.nextButton = el), class: "arw-btn" }, h("span", { class: "mdi" }, "\uF142"))), h("div", { "aria-labelledby": "popup-title-month", role: "grid", class: "date-grid" }, h("div", { role: "rowgroup", class: "date-header" }, h("div", { role: "row", class: "header-row" }, h("div", { role: "columnheader", class: "header-cell" }, h("span", null, intl.formatMessage({
579
+ id: "date.su",
580
+ defaultMessage: "Su",
581
+ description: "Abbreviated day of the week",
582
+ }))), h("div", { role: "columnheader", class: "header-cell" }, h("span", null, intl.formatMessage({
583
+ id: "date.mo",
584
+ defaultMessage: "Mo",
585
+ description: "Abbreviated day of the week",
586
+ }))), h("div", { role: "columnheader", class: "header-cell" }, h("span", null, intl.formatMessage({
587
+ id: "date.tu",
588
+ defaultMessage: "Tu",
589
+ description: "Abbreviated day of the week",
590
+ }))), h("div", { role: "columnheader", class: "header-cell" }, h("span", null, intl.formatMessage({
591
+ id: "date.we",
592
+ defaultMessage: "We",
593
+ description: "Abbreviated day of the week",
594
+ }))), h("div", { role: "columnheader", class: "header-cell" }, h("span", null, intl.formatMessage({
595
+ id: "date.th",
596
+ defaultMessage: "Th",
597
+ description: "Abbreviated day of the week",
598
+ }))), h("div", { role: "columnheader", class: "header-cell" }, h("span", null, intl.formatMessage({
599
+ id: "date.fr",
600
+ defaultMessage: "Fr",
601
+ description: "Abbreviated day of the week",
602
+ }))), h("div", { role: "columnheader", class: "header-cell" }, h("span", null, intl.formatMessage({
603
+ id: "date.sa",
604
+ defaultMessage: "Sa",
605
+ description: "Abbreviated day of the week",
606
+ }))))), h("div", { role: "rowgroup" }, h("div", { role: "row", class: "date-row" }, dates.slice(0, 7).map((date, i) => this.renderCalendarDate(date, i))), h("div", { role: "row" }, dates.slice(7, 14).map((date, i) => this.renderCalendarDate(date, i))), h("div", { role: "row" }, dates.slice(14, 21).map((date, i) => this.renderCalendarDate(date, i))), h("div", { role: "row" }, dates.slice(21, 28).map((date, i) => this.renderCalendarDate(date, i))), h("div", { role: "row" }, dates.slice(28, 35).map((date, i) => this.renderCalendarDate(date, i))), dates.length > 35 ? (h("div", { role: "row" }, dates.slice(35).map((date, i) => this.renderCalendarDate(date, i)))) : (""))))) : (h("div", { class: "month-view" }, h("div", { class: "calendar-header" }, h("button", { onClick: () => {
607
+ this.prevClicked = true;
608
+ this.popupClicked = true;
609
+ this.yearInFocus -= 1;
610
+ this.updateLiveRegion(`${this.yearInFocus} selected.`);
611
+ }, onKeyDown: (ev) => this.trapFocusLeft(ev), "aria-label": intl.formatMessage({
612
+ id: "date.selectPreviousYear",
613
+ defaultMessage: "Select previous year",
614
+ description: "Calendar button",
615
+ }), ref: (el) => (this.prevButton = el), class: "arw-btn" }, h("span", { class: "mdi" }, "\uF141")), h("div", { id: "popup-title-year", tabindex: 0, class: "title-box year", role: "button", onClick: this.changeView.bind(this, "day"), onKeyDown: (ev) => {
616
+ if (ev.key === "Enter" || ev.key === " ") {
617
+ ev.preventDefault();
618
+ this.changeView("day");
501
619
  }
502
- else {
503
- this.focusMonth();
620
+ }, "aria-labelledby": "year-title" }, h("span", { class: "title" }, this.yearInFocus)), h("button", { onClick: () => {
621
+ this.nextClicked = true;
622
+ this.popupClicked = true;
623
+ this.yearInFocus += 1;
624
+ this.updateLiveRegion(`${this.yearInFocus} selected.`);
625
+ }, "aria-label": intl.formatMessage({
626
+ id: "date.selectNextYear",
627
+ defaultMessage: "Select next year",
628
+ description: "Calendar button",
629
+ }), onKeyDown: (ev) => this.trapFocusRight(ev), ref: (el) => (this.nextButton = el), class: "arw-btn" }, h("span", { class: "mdi" }, "\uF142"))), h("div", { "aria-labelledby": "popup-title-year", role: "grid", class: "months" }, h("div", { role: "row", class: "month-row" }, this.calendar_months
630
+ .slice(0, 3)
631
+ .map((month, index) => this.renderMonths(month, index))), h("div", { role: "row", class: "month-row" }, this.calendar_months
632
+ .slice(3, 6)
633
+ .map((month, index) => this.renderMonths(month, index + 3))), h("div", { role: "row", class: "month-row" }, this.calendar_months
634
+ .slice(6, 9)
635
+ .map((month, index) => this.renderMonths(month, index + 6))), h("div", { role: "row", class: "month-row" }, this.calendar_months
636
+ .slice(9)
637
+ .map((month, index) => this.renderMonths(month, index + 9))))))), this.isExpanded && h("div", { id: "live-region", "aria-live": "polite", "aria-relevant": "text", class: "sr-only" }), h("div", { id: "month-title", class: "sr-only" }, intl.formatMessage({
638
+ id: "date.selectMonth",
639
+ defaultMessage: "Activate to select a month.",
640
+ description: "Calendar button",
641
+ })), h("div", { id: "year-title", class: "sr-only" }, intl.formatMessage({
642
+ id: "date.selectYear",
643
+ defaultMessage: "Activate to select a year.",
644
+ description: "Calendar button",
645
+ })), h("div", { id: "application", class: "sr-only" }, intl.formatMessage({
646
+ id: "date.instructions",
647
+ defaultMessage: "Use arrows to select a date in the table. Tab left or right to buttons for selecting previous month, next month, or the month selection table.",
648
+ }))));
649
+ }
650
+ static get is() { return "priv-datepicker"; }
651
+ static get originalStyleUrls() {
652
+ return {
653
+ "$": ["priv-datepicker.scss"]
654
+ };
655
+ }
656
+ static get styleUrls() {
657
+ return {
658
+ "$": ["priv-datepicker.css"]
659
+ };
660
+ }
661
+ static get properties() {
662
+ return {
663
+ "disabled": {
664
+ "type": "boolean",
665
+ "mutable": false,
666
+ "complexType": {
667
+ "original": "boolean",
668
+ "resolved": "boolean",
669
+ "references": {}
670
+ },
671
+ "required": false,
672
+ "optional": false,
673
+ "docs": {
674
+ "tags": [],
675
+ "text": ""
676
+ },
677
+ "attribute": "disabled",
678
+ "reflect": false,
679
+ "defaultValue": "false"
680
+ },
681
+ "isExpanded": {
682
+ "type": "boolean",
683
+ "mutable": true,
684
+ "complexType": {
685
+ "original": "boolean",
686
+ "resolved": "boolean",
687
+ "references": {}
688
+ },
689
+ "required": false,
690
+ "optional": false,
691
+ "docs": {
692
+ "tags": [],
693
+ "text": ""
694
+ },
695
+ "attribute": "is-expanded",
696
+ "reflect": true,
697
+ "defaultValue": "false"
698
+ },
699
+ "view": {
700
+ "type": "string",
701
+ "mutable": true,
702
+ "complexType": {
703
+ "original": "string",
704
+ "resolved": "string",
705
+ "references": {}
706
+ },
707
+ "required": false,
708
+ "optional": false,
709
+ "docs": {
710
+ "tags": [],
711
+ "text": ""
712
+ },
713
+ "attribute": "view",
714
+ "reflect": false,
715
+ "defaultValue": "\"day\""
716
+ },
717
+ "date": {
718
+ "type": "unknown",
719
+ "mutable": false,
720
+ "complexType": {
721
+ "original": "Date",
722
+ "resolved": "Date",
723
+ "references": {
724
+ "Date": {
725
+ "location": "global"
726
+ }
727
+ }
728
+ },
729
+ "required": false,
730
+ "optional": false,
731
+ "docs": {
732
+ "tags": [],
733
+ "text": ""
734
+ },
735
+ "defaultValue": "new Date()"
736
+ },
737
+ "selectedYear": {
738
+ "type": "number",
739
+ "mutable": true,
740
+ "complexType": {
741
+ "original": "number",
742
+ "resolved": "number",
743
+ "references": {}
744
+ },
745
+ "required": false,
746
+ "optional": false,
747
+ "docs": {
748
+ "tags": [],
749
+ "text": ""
750
+ },
751
+ "attribute": "selected-year",
752
+ "reflect": false,
753
+ "defaultValue": "this.date.getUTCFullYear()"
754
+ },
755
+ "selectedMonth": {
756
+ "type": "number",
757
+ "mutable": true,
758
+ "complexType": {
759
+ "original": "number",
760
+ "resolved": "number",
761
+ "references": {}
762
+ },
763
+ "required": false,
764
+ "optional": false,
765
+ "docs": {
766
+ "tags": [],
767
+ "text": ""
768
+ },
769
+ "attribute": "selected-month",
770
+ "reflect": false,
771
+ "defaultValue": "this.date.getUTCMonth() + 1"
772
+ },
773
+ "selectedDay": {
774
+ "type": "number",
775
+ "mutable": true,
776
+ "complexType": {
777
+ "original": "number",
778
+ "resolved": "number",
779
+ "references": {}
780
+ },
781
+ "required": false,
782
+ "optional": false,
783
+ "docs": {
784
+ "tags": [],
785
+ "text": ""
786
+ },
787
+ "attribute": "selected-day",
788
+ "reflect": false,
789
+ "defaultValue": "this.date.getUTCDate()"
790
+ },
791
+ "monthInFocus": {
792
+ "type": "number",
793
+ "mutable": true,
794
+ "complexType": {
795
+ "original": "number",
796
+ "resolved": "number",
797
+ "references": {}
798
+ },
799
+ "required": false,
800
+ "optional": false,
801
+ "docs": {
802
+ "tags": [],
803
+ "text": ""
804
+ },
805
+ "attribute": "month-in-focus",
806
+ "reflect": false,
807
+ "defaultValue": "this.selectedMonth"
808
+ },
809
+ "yearInFocus": {
810
+ "type": "number",
811
+ "mutable": true,
812
+ "complexType": {
813
+ "original": "number",
814
+ "resolved": "number",
815
+ "references": {}
816
+ },
817
+ "required": false,
818
+ "optional": false,
819
+ "docs": {
820
+ "tags": [],
821
+ "text": ""
822
+ },
823
+ "attribute": "year-in-focus",
824
+ "reflect": false,
825
+ "defaultValue": "this.selectedYear"
826
+ },
827
+ "dayInFocus": {
828
+ "type": "number",
829
+ "mutable": true,
830
+ "complexType": {
831
+ "original": "number",
832
+ "resolved": "number",
833
+ "references": {}
834
+ },
835
+ "required": false,
836
+ "optional": false,
837
+ "docs": {
838
+ "tags": [],
839
+ "text": ""
840
+ },
841
+ "attribute": "day-in-focus",
842
+ "reflect": false,
843
+ "defaultValue": "this.selectedDay"
844
+ }
845
+ };
846
+ }
847
+ static get states() {
848
+ return {
849
+ "monthNumInFocus": {},
850
+ "isTabbing": {}
851
+ };
852
+ }
853
+ static get events() {
854
+ return [{
855
+ "method": "cellTriggered",
856
+ "name": "cellTriggered",
857
+ "bubbles": true,
858
+ "cancelable": true,
859
+ "composed": true,
860
+ "docs": {
861
+ "tags": [],
862
+ "text": ""
863
+ },
864
+ "complexType": {
865
+ "original": "HTMLElement",
866
+ "resolved": "HTMLElement",
867
+ "references": {
868
+ "HTMLElement": {
869
+ "location": "global"
870
+ }
871
+ }
504
872
  }
505
- }
506
- toggleBusyAttribute(state) {
507
- this.el.querySelector("#wm-container").setAttribute("aria-busy", state);
508
- }
509
- setDateValuesForView() {
510
- this.selectedYear = this.date.getUTCFullYear();
511
- this.selectedMonth = this.date.getUTCMonth() + 1;
512
- this.selectedDay = this.date.getUTCDate();
513
- this.monthInFocus = this.selectedMonth;
514
- this.yearInFocus = this.selectedYear;
515
- this.dayInFocus = this.selectedDay;
516
- this.monthNumInFocus = this.selectedMonth - 1;
517
- }
518
- updateLiveRegion(text) {
519
- let liveRegion = this.el.querySelector("#live-region");
520
- liveRegion.innerHTML = text;
521
- }
522
- panelPosition() {
523
- const parentDatepickerEl = this.el.getRootNode().host;
524
- const labelHeight = parentDatepickerEl.shadowRoot.querySelector(".label-wrapper").clientHeight;
525
- this.openUp = shouldOpenUp(parentDatepickerEl, this.popupEl.clientHeight, labelHeight);
526
- if (hasRoomRight(parentDatepickerEl, 336)) {
527
- this.popupEl.style.left = "0";
528
- this.popupEl.style.right = "auto";
873
+ }, {
874
+ "method": "toggleButtonClicked",
875
+ "name": "toggleButtonClicked",
876
+ "bubbles": true,
877
+ "cancelable": true,
878
+ "composed": true,
879
+ "docs": {
880
+ "tags": [],
881
+ "text": ""
882
+ },
883
+ "complexType": {
884
+ "original": "HTMLButtonElement",
885
+ "resolved": "HTMLButtonElement",
886
+ "references": {
887
+ "HTMLButtonElement": {
888
+ "location": "global"
889
+ }
890
+ }
529
891
  }
530
- else {
531
- this.popupEl.style.right = "0";
532
- this.popupEl.style.left = "auto";
892
+ }, {
893
+ "method": "popupClosed",
894
+ "name": "popupClosed",
895
+ "bubbles": true,
896
+ "cancelable": true,
897
+ "composed": true,
898
+ "docs": {
899
+ "tags": [],
900
+ "text": ""
901
+ },
902
+ "complexType": {
903
+ "original": "any",
904
+ "resolved": "any",
905
+ "references": {}
533
906
  }
534
- }
535
- changeView(newView) {
536
- this.view = newView;
537
- //Ensure month view always opens to the month last visited in date view
538
- this.monthNumInFocus = this.monthInFocus - 1;
539
- }
540
- renderMonths(month, index) {
541
- return (h("div", { id: `month-${index}`, class: `month ${this.selectedMonth - 1 === index ? "selected" : ""}`, role: "gridcell", tabindex: index + 1 === this.monthInFocus ? 0 : -1, onKeyDown: (ev) => this.trapFocusEnd(ev), onBlur: (ev) => ev.stopPropagation(), onClick: () => {
542
- this.monthInFocus = index + 1;
543
- this.changeView("day");
544
- } }, month));
545
- }
546
- render() {
547
- const dates = this.getCalendarDates(this.monthInFocus, this.yearInFocus);
548
- return (h("div", { class: "container", id: "wm-container" }, h("button", { disabled: this.disabled, onClick: this.togglePopup.bind(this), "aria-describedby": "date-input", ref: (el) => (this.buttonEl = el), "aria-expanded": `${this.isExpanded}`, class: "toggle", id: "toggle" }, h("span", { class: "calendar", title: intl.formatMessage({
549
- id: "date.calendarView",
550
- defaultMessage: "Calendar View",
551
- description: "Calendar button",
552
- }) })), h("div", { class: `popup ${this.view}-view ${this.openUp ? "expand-upwards" : ""} ${this.isTabbing ? "user-is-tabbing" : ""}`, id: "popup", ref: (el) => (this.popupEl = el), onClick: () => (this.popupClicked = true), role: "application", "aria-describedby": "application" }, this.view === "day" ? (h("div", { class: "day-view" }, h("div", { class: "calendar-header" }, h("button", { onClick: () => {
553
- this.prevClicked = true;
554
- this.popupClicked = true;
555
- this.backOneMonth();
556
- }, onKeyDown: (ev) => this.trapFocusLeft(ev), ref: (el) => (this.prevButton = el), class: "arw-btn", "aria-label": intl.formatMessage({
557
- id: "date.selectPreviousMonth",
558
- defaultMessage: "Select previous month",
559
- description: "Calendar button",
560
- }) }, h("span", { class: "mdi" }, "\uF141")), h("div", { id: "popup-title-month", class: "title-box", tabindex: 0, role: "button", onKeyDown: (ev) => {
561
- if (ev.key === "Enter" || ev.key === " ") {
562
- ev.preventDefault();
563
- this.changeView("month");
564
- }
565
- }, onClick: this.changeView.bind(this, "month"), "aria-label": `${intl.formatMessage({
566
- id: "date.currentMonth",
567
- defaultMessage: "current month",
568
- description: "Calendar button",
569
- })}: ${this.calendar_months[this.monthInFocus - 1]}
570
- ${this.yearInFocus}.`, "aria-describedby": "month-title" }, h("span", { class: "title", "aria-hidden": "true" }, this.calendar_months[this.monthInFocus - 1], " ", this.yearInFocus)), h("button", { onClick: () => {
571
- this.nextClicked = true;
572
- this.popupClicked = true;
573
- this.forwardOneMonth();
574
- }, onKeyDown: (ev) => this.trapFocusRight(ev), "aria-label": intl.formatMessage({
575
- id: "date.selectNextMonth",
576
- defaultMessage: "Select next month",
577
- description: "Calendar button",
578
- }), ref: (el) => (this.nextButton = el), class: "arw-btn" }, h("span", { class: "mdi" }, "\uF142"))), h("div", { "aria-labelledby": "popup-title-month", role: "grid", class: "date-grid" }, h("div", { role: "rowgroup", class: "date-header" }, h("div", { role: "row", class: "header-row" }, h("div", { role: "columnheader", class: "header-cell" }, h("span", null, intl.formatMessage({
579
- id: "date.su",
580
- defaultMessage: "Su",
581
- description: "Abbreviated day of the week",
582
- }))), h("div", { role: "columnheader", class: "header-cell" }, h("span", null, intl.formatMessage({
583
- id: "date.mo",
584
- defaultMessage: "Mo",
585
- description: "Abbreviated day of the week",
586
- }))), h("div", { role: "columnheader", class: "header-cell" }, h("span", null, intl.formatMessage({
587
- id: "date.tu",
588
- defaultMessage: "Tu",
589
- description: "Abbreviated day of the week",
590
- }))), h("div", { role: "columnheader", class: "header-cell" }, h("span", null, intl.formatMessage({
591
- id: "date.we",
592
- defaultMessage: "We",
593
- description: "Abbreviated day of the week",
594
- }))), h("div", { role: "columnheader", class: "header-cell" }, h("span", null, intl.formatMessage({
595
- id: "date.th",
596
- defaultMessage: "Th",
597
- description: "Abbreviated day of the week",
598
- }))), h("div", { role: "columnheader", class: "header-cell" }, h("span", null, intl.formatMessage({
599
- id: "date.fr",
600
- defaultMessage: "Fr",
601
- description: "Abbreviated day of the week",
602
- }))), h("div", { role: "columnheader", class: "header-cell" }, h("span", null, intl.formatMessage({
603
- id: "date.sa",
604
- defaultMessage: "Sa",
605
- description: "Abbreviated day of the week",
606
- }))))), h("div", { role: "rowgroup" }, h("div", { role: "row", class: "date-row" }, dates.slice(0, 7).map((date, i) => this.renderCalendarDate(date, i))), h("div", { role: "row" }, dates.slice(7, 14).map((date, i) => this.renderCalendarDate(date, i))), h("div", { role: "row" }, dates.slice(14, 21).map((date, i) => this.renderCalendarDate(date, i))), h("div", { role: "row" }, dates.slice(21, 28).map((date, i) => this.renderCalendarDate(date, i))), h("div", { role: "row" }, dates.slice(28, 35).map((date, i) => this.renderCalendarDate(date, i))), dates.length > 35 ? (h("div", { role: "row" }, dates.slice(35).map((date, i) => this.renderCalendarDate(date, i)))) : (""))))) : (h("div", { class: "month-view" }, h("div", { class: "calendar-header" }, h("button", { onClick: () => {
607
- this.prevClicked = true;
608
- this.popupClicked = true;
609
- this.yearInFocus -= 1;
610
- this.updateLiveRegion(`${this.yearInFocus} selected.`);
611
- }, onKeyDown: (ev) => this.trapFocusLeft(ev), "aria-label": intl.formatMessage({
612
- id: "date.selectPreviousYear",
613
- defaultMessage: "Select previous year",
614
- description: "Calendar button",
615
- }), ref: (el) => (this.prevButton = el), class: "arw-btn" }, h("span", { class: "mdi" }, "\uF141")), h("div", { id: "popup-title-year", tabindex: 0, class: "title-box year", role: "button", onClick: this.changeView.bind(this, "day"), onKeyDown: (ev) => {
616
- if (ev.key === "Enter" || ev.key === " ") {
617
- ev.preventDefault();
618
- this.changeView("day");
619
- }
620
- }, "aria-labelledby": "year-title" }, h("span", { class: "title" }, this.yearInFocus)), h("button", { onClick: () => {
621
- this.nextClicked = true;
622
- this.popupClicked = true;
623
- this.yearInFocus += 1;
624
- this.updateLiveRegion(`${this.yearInFocus} selected.`);
625
- }, "aria-label": intl.formatMessage({
626
- id: "date.selectNextYear",
627
- defaultMessage: "Select next year",
628
- description: "Calendar button",
629
- }), onKeyDown: (ev) => this.trapFocusRight(ev), ref: (el) => (this.nextButton = el), class: "arw-btn" }, h("span", { class: "mdi" }, "\uF142"))), h("div", { "aria-labelledby": "popup-title-year", role: "grid", class: "months" }, h("div", { role: "row", class: "month-row" }, this.calendar_months
630
- .slice(0, 3)
631
- .map((month, index) => this.renderMonths(month, index))), h("div", { role: "row", class: "month-row" }, this.calendar_months
632
- .slice(3, 6)
633
- .map((month, index) => this.renderMonths(month, index + 3))), h("div", { role: "row", class: "month-row" }, this.calendar_months
634
- .slice(6, 9)
635
- .map((month, index) => this.renderMonths(month, index + 6))), h("div", { role: "row", class: "month-row" }, this.calendar_months
636
- .slice(9)
637
- .map((month, index) => this.renderMonths(month, index + 9))))))), this.isExpanded && h("div", { id: "live-region", "aria-live": "polite", "aria-relevant": "text", class: "sr-only" }), h("div", { id: "month-title", class: "sr-only" }, intl.formatMessage({
638
- id: "date.selectMonth",
639
- defaultMessage: "Activate to select a month.",
640
- description: "Calendar button",
641
- })), h("div", { id: "year-title", class: "sr-only" }, intl.formatMessage({
642
- id: "date.selectYear",
643
- defaultMessage: "Activate to select a year.",
644
- description: "Calendar button",
645
- })), h("div", { id: "application", class: "sr-only" }, intl.formatMessage({
646
- id: "date.instructions",
647
- defaultMessage: "Use arrows to select a date in the table. Tab left or right to buttons for selecting previous month, next month, or the month selection table.",
648
- }))));
649
- }
650
- static get is() { return "priv-datepicker"; }
651
- static get originalStyleUrls() {
652
- return {
653
- "$": ["priv-datepicker.scss"]
654
- };
655
- }
656
- static get styleUrls() {
657
- return {
658
- "$": ["priv-datepicker.css"]
659
- };
660
- }
661
- static get properties() {
662
- return {
663
- "disabled": {
664
- "type": "boolean",
665
- "mutable": false,
666
- "complexType": {
667
- "original": "boolean",
668
- "resolved": "boolean",
669
- "references": {}
670
- },
671
- "required": false,
672
- "optional": false,
673
- "docs": {
674
- "tags": [],
675
- "text": ""
676
- },
677
- "attribute": "disabled",
678
- "reflect": false,
679
- "defaultValue": "false"
680
- },
681
- "isExpanded": {
682
- "type": "boolean",
683
- "mutable": true,
684
- "complexType": {
685
- "original": "boolean",
686
- "resolved": "boolean",
687
- "references": {}
688
- },
689
- "required": false,
690
- "optional": false,
691
- "docs": {
692
- "tags": [],
693
- "text": ""
694
- },
695
- "attribute": "is-expanded",
696
- "reflect": true,
697
- "defaultValue": "false"
698
- },
699
- "view": {
700
- "type": "string",
701
- "mutable": true,
702
- "complexType": {
703
- "original": "string",
704
- "resolved": "string",
705
- "references": {}
706
- },
707
- "required": false,
708
- "optional": false,
709
- "docs": {
710
- "tags": [],
711
- "text": ""
712
- },
713
- "attribute": "view",
714
- "reflect": false,
715
- "defaultValue": "\"day\""
716
- },
717
- "date": {
718
- "type": "unknown",
719
- "mutable": false,
720
- "complexType": {
721
- "original": "Date",
722
- "resolved": "Date",
723
- "references": {
724
- "Date": {
725
- "location": "global",
726
- "id": "global::Date"
727
- }
728
- }
729
- },
730
- "required": false,
731
- "optional": false,
732
- "docs": {
733
- "tags": [],
734
- "text": ""
735
- },
736
- "defaultValue": "new Date()"
737
- },
738
- "selectedYear": {
739
- "type": "number",
740
- "mutable": true,
741
- "complexType": {
742
- "original": "number",
743
- "resolved": "number",
744
- "references": {}
745
- },
746
- "required": false,
747
- "optional": false,
748
- "docs": {
749
- "tags": [],
750
- "text": ""
751
- },
752
- "attribute": "selected-year",
753
- "reflect": false,
754
- "defaultValue": "this.date.getUTCFullYear()"
755
- },
756
- "selectedMonth": {
757
- "type": "number",
758
- "mutable": true,
759
- "complexType": {
760
- "original": "number",
761
- "resolved": "number",
762
- "references": {}
763
- },
764
- "required": false,
765
- "optional": false,
766
- "docs": {
767
- "tags": [],
768
- "text": ""
769
- },
770
- "attribute": "selected-month",
771
- "reflect": false,
772
- "defaultValue": "this.date.getUTCMonth() + 1"
773
- },
774
- "selectedDay": {
775
- "type": "number",
776
- "mutable": true,
777
- "complexType": {
778
- "original": "number",
779
- "resolved": "number",
780
- "references": {}
781
- },
782
- "required": false,
783
- "optional": false,
784
- "docs": {
785
- "tags": [],
786
- "text": ""
787
- },
788
- "attribute": "selected-day",
789
- "reflect": false,
790
- "defaultValue": "this.date.getUTCDate()"
791
- },
792
- "monthInFocus": {
793
- "type": "number",
794
- "mutable": true,
795
- "complexType": {
796
- "original": "number",
797
- "resolved": "number",
798
- "references": {}
799
- },
800
- "required": false,
801
- "optional": false,
802
- "docs": {
803
- "tags": [],
804
- "text": ""
805
- },
806
- "attribute": "month-in-focus",
807
- "reflect": false,
808
- "defaultValue": "this.selectedMonth"
809
- },
810
- "yearInFocus": {
811
- "type": "number",
812
- "mutable": true,
813
- "complexType": {
814
- "original": "number",
815
- "resolved": "number",
816
- "references": {}
817
- },
818
- "required": false,
819
- "optional": false,
820
- "docs": {
821
- "tags": [],
822
- "text": ""
823
- },
824
- "attribute": "year-in-focus",
825
- "reflect": false,
826
- "defaultValue": "this.selectedYear"
827
- },
828
- "dayInFocus": {
829
- "type": "number",
830
- "mutable": true,
831
- "complexType": {
832
- "original": "number",
833
- "resolved": "number",
834
- "references": {}
835
- },
836
- "required": false,
837
- "optional": false,
838
- "docs": {
839
- "tags": [],
840
- "text": ""
841
- },
842
- "attribute": "day-in-focus",
843
- "reflect": false,
844
- "defaultValue": "this.selectedDay"
907
+ }, {
908
+ "method": "popupBlurred",
909
+ "name": "popupBlurred",
910
+ "bubbles": true,
911
+ "cancelable": true,
912
+ "composed": true,
913
+ "docs": {
914
+ "tags": [],
915
+ "text": ""
916
+ },
917
+ "complexType": {
918
+ "original": "{ relatedTarget: EventTarget | null }",
919
+ "resolved": "{ relatedTarget: EventTarget | null; }",
920
+ "references": {
921
+ "EventTarget": {
922
+ "location": "global"
845
923
  }
846
- };
847
- }
848
- static get states() {
849
- return {
850
- "monthNumInFocus": {},
851
- "isTabbing": {}
852
- };
853
- }
854
- static get events() {
855
- return [{
856
- "method": "cellTriggered",
857
- "name": "cellTriggered",
858
- "bubbles": true,
859
- "cancelable": true,
860
- "composed": true,
861
- "docs": {
862
- "tags": [],
863
- "text": ""
864
- },
865
- "complexType": {
866
- "original": "HTMLElement",
867
- "resolved": "HTMLElement",
868
- "references": {
869
- "HTMLElement": {
870
- "location": "global",
871
- "id": "global::HTMLElement"
872
- }
873
- }
874
- }
875
- }, {
876
- "method": "toggleButtonClicked",
877
- "name": "toggleButtonClicked",
878
- "bubbles": true,
879
- "cancelable": true,
880
- "composed": true,
881
- "docs": {
882
- "tags": [],
883
- "text": ""
884
- },
885
- "complexType": {
886
- "original": "HTMLButtonElement",
887
- "resolved": "HTMLButtonElement",
888
- "references": {
889
- "HTMLButtonElement": {
890
- "location": "global",
891
- "id": "global::HTMLButtonElement"
892
- }
893
- }
894
- }
895
- }, {
896
- "method": "popupClosed",
897
- "name": "popupClosed",
898
- "bubbles": true,
899
- "cancelable": true,
900
- "composed": true,
901
- "docs": {
902
- "tags": [],
903
- "text": ""
904
- },
905
- "complexType": {
906
- "original": "any",
907
- "resolved": "any",
908
- "references": {}
909
- }
910
- }, {
911
- "method": "popupBlurred",
912
- "name": "popupBlurred",
913
- "bubbles": true,
914
- "cancelable": true,
915
- "composed": true,
916
- "docs": {
917
- "tags": [],
918
- "text": ""
919
- },
920
- "complexType": {
921
- "original": "{ relatedTarget: EventTarget | null }",
922
- "resolved": "{ relatedTarget: EventTarget | null; }",
923
- "references": {
924
- "EventTarget": {
925
- "location": "global",
926
- "id": "global::EventTarget"
927
- }
928
- }
929
- }
930
- }];
931
- }
932
- static get elementRef() { return "el"; }
933
- static get listeners() {
934
- return [{
935
- "name": "keydown",
936
- "method": "handleKey",
937
- "target": undefined,
938
- "capture": false,
939
- "passive": false
940
- }, {
941
- "name": "keydown",
942
- "method": "toggleTabbingOn",
943
- "target": undefined,
944
- "capture": false,
945
- "passive": false
946
- }, {
947
- "name": "mousedown",
948
- "method": "toggleTabbingOff",
949
- "target": "window",
950
- "capture": false,
951
- "passive": true
952
- }, {
953
- "name": "click",
954
- "method": "blurHandler",
955
- "target": "document",
956
- "capture": false,
957
- "passive": false
958
- }, {
959
- "name": "blur",
960
- "method": "handleBlurOnWindow",
961
- "target": "window",
962
- "capture": false,
963
- "passive": false
964
- }];
965
- }
924
+ }
925
+ }
926
+ }];
927
+ }
928
+ static get elementRef() { return "el"; }
929
+ static get listeners() {
930
+ return [{
931
+ "name": "keydown",
932
+ "method": "handleKey",
933
+ "target": undefined,
934
+ "capture": false,
935
+ "passive": false
936
+ }, {
937
+ "name": "keydown",
938
+ "method": "toggleTabbingOn",
939
+ "target": undefined,
940
+ "capture": false,
941
+ "passive": false
942
+ }, {
943
+ "name": "mousedown",
944
+ "method": "toggleTabbingOff",
945
+ "target": "window",
946
+ "capture": false,
947
+ "passive": true
948
+ }, {
949
+ "name": "click",
950
+ "method": "blurHandler",
951
+ "target": "document",
952
+ "capture": false,
953
+ "passive": false
954
+ }, {
955
+ "name": "blur",
956
+ "method": "handleBlurOnWindow",
957
+ "target": "window",
958
+ "capture": false,
959
+ "passive": false
960
+ }];
961
+ }
966
962
  }