@watermarkinsights/ripple 4.3.0 → 4.4.0-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/chartFunctions-cecf8134.js +600 -0
- package/dist/cjs/{functions-91da05e9.js → functions-4208c444.js} +362 -362
- package/dist/cjs/{global-20d48c6c.js → global-bd289a67.js} +24 -24
- package/dist/cjs/{index-fae02cd7.js → index-f8ef86de.js} +436 -150
- package/dist/cjs/interfaces-ad9e80a6.js +38 -0
- package/dist/cjs/intl-3fafc6d1.js +179 -0
- package/dist/cjs/loader.cjs.js +4 -13
- package/dist/cjs/priv-chart-popover.cjs.entry.js +85 -85
- package/dist/cjs/priv-datepicker.cjs.entry.js +637 -637
- package/dist/cjs/priv-navigator-button.cjs.entry.js +18 -18
- package/dist/cjs/priv-navigator-item.cjs.entry.js +21 -21
- package/dist/cjs/ripple.cjs.js +4 -7
- package/dist/cjs/wm-action-menu_2.cjs.entry.js +314 -314
- package/dist/cjs/wm-button.cjs.entry.js +174 -174
- package/dist/cjs/wm-chart-slice.cjs.entry.js +17 -17
- package/dist/cjs/wm-chart.cjs.entry.js +164 -164
- package/dist/cjs/wm-datepicker.cjs.entry.js +160 -160
- package/dist/cjs/wm-file-list.cjs.entry.js +10 -10
- package/dist/cjs/wm-file.cjs.entry.js +178 -178
- package/dist/cjs/wm-input.cjs.entry.js +102 -102
- package/dist/cjs/wm-line-chart.cjs.entry.js +462 -462
- package/dist/cjs/wm-modal-footer.cjs.entry.js +27 -27
- package/dist/cjs/wm-modal-header.cjs.entry.js +21 -21
- package/dist/cjs/wm-modal.cjs.entry.js +92 -92
- package/dist/cjs/wm-navigation_3.cjs.entry.js +179 -179
- package/dist/cjs/wm-navigator.cjs.entry.js +255 -251
- package/dist/cjs/wm-option_2.cjs.entry.js +710 -710
- package/dist/cjs/wm-pagination.cjs.entry.js +169 -169
- package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +151 -151
- package/dist/cjs/wm-search.cjs.entry.js +192 -192
- package/dist/cjs/wm-snackbar.cjs.entry.js +114 -114
- package/dist/cjs/wm-tab-item_3.cjs.entry.js +247 -247
- package/dist/cjs/wm-tag-input.cjs.entry.js +849 -849
- package/dist/cjs/wm-tag-option.cjs.entry.js +33 -33
- package/dist/cjs/wm-timepicker.cjs.entry.js +270 -270
- package/dist/cjs/wm-toggletip.cjs.entry.js +99 -99
- package/dist/cjs/wm-uploader.cjs.entry.js +198 -198
- package/dist/cjs/wm-wrapper.cjs.entry.js +12 -12
- package/dist/collection/collection-manifest.json +41 -41
- package/dist/collection/components/charts/chartFunctions.js +456 -456
- package/dist/collection/components/charts/chartFunctions.spec.js +13 -13
- package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.e2e.js +73 -73
- package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.js +257 -254
- package/dist/collection/components/charts/screenshots.e2e.js +30 -30
- package/dist/collection/components/charts/wm-chart/wm-chart-slice.js +121 -121
- package/dist/collection/components/charts/wm-chart/wm-chart.e2e.js +160 -160
- package/dist/collection/components/charts/wm-chart/wm-chart.js +382 -381
- package/dist/collection/components/charts/wm-chart/wm-chart.spec.js +26 -26
- package/dist/collection/components/charts/wm-line-chart/wm-line-chart.css +1 -2
- package/dist/collection/components/charts/wm-line-chart/wm-line-chart.e2e.js +138 -138
- package/dist/collection/components/charts/wm-line-chart/wm-line-chart.js +731 -731
- package/dist/collection/components/charts/wm-line-chart/wm-line-chart.spec.js +106 -106
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.js +202 -202
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.e2e.js +54 -54
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.js +136 -136
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.spec.js +31 -31
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-slice.js +119 -119
- package/dist/collection/components/wm-action-menu/wm-action-menu.e2e.js +187 -187
- package/dist/collection/components/wm-action-menu/wm-action-menu.js +435 -435
- package/dist/collection/components/wm-action-menu/wm-action-menu.spec.js +35 -35
- package/dist/collection/components/wm-button/wm-button.e2e.js +58 -58
- package/dist/collection/components/wm-button/wm-button.js +454 -452
- package/dist/collection/components/wm-button/wm-button.spec.js +63 -63
- package/dist/collection/components/wm-datepicker/priv-datepicker/priv-datepicker.js +943 -939
- package/dist/collection/components/wm-datepicker/priv-datepicker/priv-datepicker.spec.js +71 -71
- package/dist/collection/components/wm-datepicker/wm-datepicker.css +1 -2
- package/dist/collection/components/wm-datepicker/wm-datepicker.e2e.js +359 -359
- package/dist/collection/components/wm-datepicker/wm-datepicker.js +415 -413
- package/dist/collection/components/wm-datepicker/wm-datepicker.spec.js +13 -13
- package/dist/collection/components/wm-file/wm-file.js +380 -380
- package/dist/collection/components/wm-file/wm-file.spec.js +107 -107
- package/dist/collection/components/wm-file-list/wm-file-list.js +42 -42
- package/dist/collection/components/wm-file-list/wm-file-list.spec.js +47 -47
- package/dist/collection/components/wm-input/wm-input.e2e.js +26 -26
- package/dist/collection/components/wm-input/wm-input.js +453 -453
- package/dist/collection/components/wm-input/wm-input.spec.js +168 -168
- package/dist/collection/components/wm-menuitem/wm-menuitem.e2e.js +18 -18
- package/dist/collection/components/wm-menuitem/wm-menuitem.js +446 -436
- package/dist/collection/components/wm-menuitem/wm-menuitem.spec.js +46 -46
- package/dist/collection/components/wm-modal/wm-modal-footer.js +130 -130
- package/dist/collection/components/wm-modal/wm-modal-footer.spec.js +8 -8
- package/dist/collection/components/wm-modal/wm-modal-header.js +68 -68
- package/dist/collection/components/wm-modal/wm-modal-header.spec.js +5 -5
- package/dist/collection/components/wm-modal/wm-modal.e2e.js +65 -65
- package/dist/collection/components/wm-modal/wm-modal.js +299 -296
- package/dist/collection/components/wm-modal/wm-modal.spec.js +22 -22
- package/dist/collection/components/wm-navigation/wm-navigation-hamburger.css +0 -1
- package/dist/collection/components/wm-navigation/wm-navigation-hamburger.js +112 -112
- package/dist/collection/components/wm-navigation/wm-navigation-item.js +125 -125
- package/dist/collection/components/wm-navigation/wm-navigation.css +0 -2
- package/dist/collection/components/wm-navigation/wm-navigation.e2e.js +86 -86
- package/dist/collection/components/wm-navigation/wm-navigation.js +209 -209
- package/dist/collection/components/wm-navigation/wm-navigation.spec.js +79 -79
- package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.e2e.js +30 -30
- package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.js +103 -103
- package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.js +119 -118
- package/dist/collection/components/wm-navigator/wm-navigator.e2e.js +180 -180
- package/dist/collection/components/wm-navigator/wm-navigator.js +458 -454
- package/dist/collection/components/wm-navigator/wm-navigator.spec.js +153 -153
- package/dist/collection/components/wm-option/wm-option.e2e.js +19 -19
- package/dist/collection/components/wm-option/wm-option.js +474 -463
- package/dist/collection/components/wm-option/wm-option.spec.js +39 -39
- package/dist/collection/components/wm-pagination/wm-pagination.e2e.js +301 -301
- package/dist/collection/components/wm-pagination/wm-pagination.js +327 -327
- package/dist/collection/components/wm-search/wm-search.e2e.js +69 -69
- package/dist/collection/components/wm-search/wm-search.js +415 -414
- package/dist/collection/components/wm-search/wm-search.spec.js +64 -64
- package/dist/collection/components/wm-select/wm-select.e2e.js +443 -443
- package/dist/collection/components/wm-select/wm-select.js +967 -966
- package/dist/collection/components/wm-select/wm-select.spec.js +250 -250
- package/dist/collection/components/wm-snackbar/wm-snackbar.e2e.js +114 -114
- package/dist/collection/components/wm-snackbar/wm-snackbar.js +209 -207
- package/dist/collection/components/wm-snackbar/wm-snackbar.spec.js +4 -4
- package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.js +190 -188
- package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.js +261 -261
- package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.js +104 -104
- package/dist/collection/components/wm-tabs/wm-tabs.e2e.js +79 -79
- package/dist/collection/components/wm-tabs/wm-tabs.spec.js +6 -6
- package/dist/collection/components/wm-tag-input/wm-tag-input.css +2 -4
- package/dist/collection/components/wm-tag-input/wm-tag-input.e2e.js +168 -168
- package/dist/collection/components/wm-tag-input/wm-tag-input.js +1159 -1159
- package/dist/collection/components/wm-tag-input/wm-tag-input.spec.js +147 -147
- package/dist/collection/components/wm-tag-input/wm-tag-option/wm-tag-option.js +236 -234
- package/dist/collection/components/wm-timepicker/wm-timepicker.css +1 -2
- package/dist/collection/components/wm-timepicker/wm-timepicker.e2e.js +147 -147
- package/dist/collection/components/wm-timepicker/wm-timepicker.js +531 -527
- package/dist/collection/components/wm-timepicker/wm-timepicker.spec.js +151 -151
- package/dist/collection/components/wm-toggletip/wm-toggletip.e2e.js +61 -61
- package/dist/collection/components/wm-toggletip/wm-toggletip.js +209 -208
- package/dist/collection/components/wm-toggletip/wm-toggletip.spec.js +16 -16
- package/dist/collection/components/wm-uploader/wm-uploader.e2e.js +56 -56
- package/dist/collection/components/wm-uploader/wm-uploader.js +423 -422
- package/dist/collection/components/wm-uploader/wm-uploader.spec.js +149 -149
- package/dist/collection/components/wm-wrapper/wm-wrapper.js +26 -26
- package/dist/collection/global/__mocks__/functions.js +1 -1
- package/dist/collection/global/functions.js +510 -510
- package/dist/collection/global/functions.spec.js +123 -123
- package/dist/collection/global/global.js +16 -16
- package/dist/collection/global/interfaces.js +39 -39
- package/dist/collection/global/intl.js +162 -162
- package/dist/collection/global/services/__mocks__/http-service.js +112 -112
- package/dist/collection/global/services/http-service.js +41 -41
- package/dist/collection/global/themes/default.js +4 -4
- package/dist/collection/global/themes/neutral.js +4 -4
- package/dist/collection/lang/lang.spec.js +13 -13
- package/dist/esm/chartFunctions-23173fce.js +584 -0
- package/dist/esm/{functions-5afd09f4.js → functions-d0e70094.js} +362 -362
- package/dist/esm/{global-d4a9e80e.js → global-4569c7b8.js} +24 -24
- package/dist/esm/{index-7e11ea42.js → index-f164fbca.js} +436 -150
- package/dist/esm/interfaces-9b75fb61.js +35 -0
- package/dist/esm/intl-05c9e0c9.js +174 -0
- package/dist/esm/loader.js +5 -14
- package/dist/esm/priv-chart-popover.entry.js +85 -85
- package/dist/esm/priv-datepicker.entry.js +637 -637
- package/dist/esm/priv-navigator-button.entry.js +18 -18
- package/dist/esm/priv-navigator-item.entry.js +21 -21
- package/dist/esm/ripple.js +5 -8
- package/dist/esm/wm-action-menu_2.entry.js +314 -314
- package/dist/esm/wm-button.entry.js +174 -174
- package/dist/esm/wm-chart-slice.entry.js +17 -17
- package/dist/esm/wm-chart.entry.js +164 -164
- package/dist/esm/wm-datepicker.entry.js +160 -160
- package/dist/esm/wm-file-list.entry.js +10 -10
- package/dist/esm/wm-file.entry.js +178 -178
- package/dist/esm/wm-input.entry.js +102 -102
- package/dist/esm/wm-line-chart.entry.js +462 -462
- package/dist/esm/wm-modal-footer.entry.js +27 -27
- package/dist/esm/wm-modal-header.entry.js +21 -21
- package/dist/esm/wm-modal.entry.js +92 -92
- package/dist/esm/wm-navigation_3.entry.js +179 -179
- package/dist/esm/wm-navigator.entry.js +255 -251
- package/dist/esm/wm-option_2.entry.js +710 -710
- package/dist/esm/wm-pagination.entry.js +169 -169
- package/dist/esm/wm-progress-indicator_3.entry.js +151 -151
- package/dist/esm/wm-search.entry.js +192 -192
- package/dist/esm/wm-snackbar.entry.js +114 -114
- package/dist/esm/wm-tab-item_3.entry.js +247 -247
- package/dist/esm/wm-tag-input.entry.js +849 -849
- package/dist/esm/wm-tag-option.entry.js +33 -33
- package/dist/esm/wm-timepicker.entry.js +270 -270
- package/dist/esm/wm-toggletip.entry.js +99 -99
- package/dist/esm/wm-uploader.entry.js +198 -198
- package/dist/esm/wm-wrapper.entry.js +12 -12
- package/dist/esm-es5/chartFunctions-23173fce.js +1 -0
- package/dist/esm-es5/functions-d0e70094.js +1 -0
- package/dist/esm-es5/global-4569c7b8.js +1 -0
- package/dist/esm-es5/index-f164fbca.js +2 -0
- package/dist/esm-es5/{intl-e2da750a.js → intl-05c9e0c9.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/priv-chart-popover.entry.js +1 -1
- package/dist/esm-es5/priv-datepicker.entry.js +1 -1
- package/dist/esm-es5/priv-navigator-button.entry.js +1 -1
- package/dist/esm-es5/priv-navigator-item.entry.js +1 -1
- package/dist/esm-es5/ripple.js +1 -1
- package/dist/esm-es5/wm-action-menu_2.entry.js +1 -1
- package/dist/esm-es5/wm-button.entry.js +1 -1
- package/dist/esm-es5/wm-chart-slice.entry.js +1 -1
- package/dist/esm-es5/wm-chart.entry.js +1 -1
- package/dist/esm-es5/wm-datepicker.entry.js +1 -1
- package/dist/esm-es5/wm-file-list.entry.js +1 -1
- package/dist/esm-es5/wm-file.entry.js +1 -1
- package/dist/esm-es5/wm-input.entry.js +1 -1
- package/dist/esm-es5/wm-line-chart.entry.js +1 -1
- package/dist/esm-es5/wm-modal-footer.entry.js +1 -1
- package/dist/esm-es5/wm-modal-header.entry.js +1 -1
- package/dist/esm-es5/wm-modal.entry.js +1 -1
- package/dist/esm-es5/wm-navigation_3.entry.js +1 -1
- package/dist/esm-es5/wm-navigator.entry.js +1 -1
- package/dist/esm-es5/wm-option_2.entry.js +1 -1
- package/dist/esm-es5/wm-pagination.entry.js +1 -1
- package/dist/esm-es5/wm-progress-indicator_3.entry.js +1 -1
- package/dist/esm-es5/wm-search.entry.js +1 -1
- package/dist/esm-es5/wm-snackbar.entry.js +1 -1
- package/dist/esm-es5/wm-tab-item_3.entry.js +1 -1
- package/dist/esm-es5/wm-tag-input.entry.js +1 -1
- package/dist/esm-es5/wm-tag-option.entry.js +1 -1
- package/dist/esm-es5/wm-timepicker.entry.js +1 -1
- package/dist/esm-es5/wm-toggletip.entry.js +1 -1
- package/dist/esm-es5/wm-uploader.entry.js +1 -1
- package/dist/esm-es5/wm-wrapper.entry.js +1 -1
- package/dist/loader/index.d.ts +1 -1
- package/dist/ripple/p-028ef6db.system.entry.js +1 -0
- package/dist/ripple/{p-863e737a.js → p-05d4e49b.js} +1 -1
- package/dist/ripple/{p-a1e95b05.system.entry.js → p-06776596.system.entry.js} +1 -1
- package/dist/ripple/{p-622a7791.system.entry.js → p-067d7922.system.entry.js} +1 -1
- package/dist/ripple/p-09d62ddd.entry.js +1 -0
- package/dist/ripple/{p-f30839a1.system.entry.js → p-0ecbf569.system.entry.js} +1 -1
- package/dist/ripple/p-0fe97e85.system.js +2 -0
- package/dist/ripple/{p-24b08e1f.js → p-13ca30d8.js} +1 -1
- package/dist/ripple/{p-8f3f903f.system.js → p-1402cfa2.system.js} +1 -1
- package/dist/ripple/p-1453ea51.system.entry.js +1 -0
- package/dist/ripple/{p-6abb903c.entry.js → p-153701f9.entry.js} +1 -1
- package/dist/ripple/p-1cc91907.system.js +1 -0
- package/dist/ripple/{p-ad37cdfd.entry.js → p-1d8b0039.entry.js} +1 -1
- package/dist/ripple/{p-d0f1b8c4.system.entry.js → p-1fa2a756.system.entry.js} +1 -1
- package/dist/ripple/{p-a52c5a1c.entry.js → p-25446670.entry.js} +1 -1
- package/dist/ripple/{p-1283e85d.entry.js → p-27f47edc.entry.js} +1 -1
- package/dist/ripple/{p-32b1126c.system.entry.js → p-28e4583c.system.entry.js} +1 -1
- package/dist/ripple/{p-a5b23781.system.entry.js → p-2c4f312d.system.entry.js} +1 -1
- package/dist/ripple/p-30b17818.system.entry.js +1 -0
- package/dist/ripple/{p-0631be01.system.entry.js → p-3446852f.system.entry.js} +1 -1
- package/dist/ripple/{p-ae674a54.entry.js → p-350fe5da.entry.js} +1 -1
- package/dist/ripple/{p-d04ba5f8.system.entry.js → p-3583d113.system.entry.js} +1 -1
- package/dist/ripple/{p-cbd8a60b.system.entry.js → p-361cc8fc.system.entry.js} +1 -1
- package/dist/ripple/{p-7529706d.entry.js → p-372faf33.entry.js} +1 -1
- package/dist/ripple/{p-19773c40.entry.js → p-3a070f35.entry.js} +1 -1
- package/dist/ripple/{p-c7b5ac39.js → p-3af72848.js} +1 -1
- package/dist/ripple/{p-c41603e6.entry.js → p-42ebfcfa.entry.js} +1 -1
- package/dist/ripple/{p-13594c2e.entry.js → p-43e2a49a.entry.js} +1 -1
- package/dist/ripple/{p-ed942b42.entry.js → p-49118468.entry.js} +1 -1
- package/dist/ripple/p-49c85d1a.system.js +1 -0
- package/dist/ripple/p-4de51706.js +2 -0
- package/dist/ripple/{p-3c80bf67.entry.js → p-58174f4e.entry.js} +1 -1
- package/dist/ripple/{p-c5e8f8a5.system.entry.js → p-5a4d9897.system.entry.js} +1 -1
- package/dist/ripple/{p-e3f0b57f.system.entry.js → p-5ac980e2.system.entry.js} +1 -1
- package/dist/ripple/{p-3becce62.system.entry.js → p-633cd89a.system.entry.js} +1 -1
- package/dist/ripple/{p-1205fdc1.entry.js → p-63f75d43.entry.js} +1 -1
- package/dist/ripple/{p-90ea7e3a.system.entry.js → p-67d48c33.system.entry.js} +1 -1
- package/dist/ripple/{p-8ef87907.entry.js → p-6caaf85f.entry.js} +1 -1
- package/dist/ripple/{p-935513f8.entry.js → p-6cf7a34a.entry.js} +1 -1
- package/dist/ripple/p-73289c2c.system.js +1 -0
- package/dist/ripple/{p-c76bbedf.system.entry.js → p-7a8816d9.system.entry.js} +1 -1
- package/dist/ripple/{p-8ea68cb3.system.entry.js → p-7e56da2e.system.entry.js} +1 -1
- package/dist/ripple/{p-deb4f5a2.entry.js → p-7e8daaac.entry.js} +1 -1
- package/dist/ripple/p-88406560.system.entry.js +1 -0
- package/dist/ripple/{p-84a7e757.entry.js → p-8cace32f.entry.js} +1 -1
- package/dist/ripple/{p-80aef387.entry.js → p-8d4734ad.entry.js} +1 -1
- package/dist/ripple/p-8f76a838.system.entry.js +1 -0
- package/dist/ripple/p-934c1b6b.js +1 -0
- package/dist/ripple/{p-85f744ed.system.js → p-9fecbc8a.system.js} +1 -1
- package/dist/ripple/{p-b71a83e3.entry.js → p-a69c37e0.entry.js} +1 -1
- package/dist/ripple/{p-9288659b.entry.js → p-a82a8931.entry.js} +1 -1
- package/dist/ripple/p-a99b05de.system.entry.js +1 -0
- package/dist/ripple/{p-36049d2f.entry.js → p-aadf8c59.entry.js} +1 -1
- package/dist/ripple/{p-676c1089.system.entry.js → p-aba5a00e.system.entry.js} +1 -1
- package/dist/ripple/{p-0aecac86.entry.js → p-ad6dc751.entry.js} +1 -1
- package/dist/ripple/{p-0f1ff645.entry.js → p-b253d2fc.entry.js} +1 -1
- package/dist/ripple/p-b2ff4723.system.entry.js +1 -0
- package/dist/ripple/{p-a0bf5eef.entry.js → p-b452d1d7.entry.js} +1 -1
- package/dist/ripple/{p-1cde16a7.system.entry.js → p-b4d862e1.system.entry.js} +1 -1
- package/dist/ripple/{p-d496bc44.system.entry.js → p-bdd4f919.system.entry.js} +1 -1
- package/dist/ripple/p-c18b398c.system.js +1 -0
- package/dist/ripple/{p-8f8c3705.entry.js → p-c249063c.entry.js} +1 -1
- package/dist/ripple/p-c344a69c.entry.js +1 -0
- package/dist/ripple/{p-0d9f70ab.entry.js → p-c717d895.entry.js} +1 -1
- package/dist/ripple/{p-2e773564.system.entry.js → p-c96a5c94.system.entry.js} +1 -1
- package/dist/ripple/{p-15497721.system.entry.js → p-ceced3d9.system.entry.js} +1 -1
- package/dist/ripple/{p-d428e9bb.system.entry.js → p-d16f91e9.system.entry.js} +1 -1
- package/dist/ripple/{p-ff14e4ec.system.entry.js → p-d3f9d028.system.entry.js} +1 -1
- package/dist/ripple/{p-7962f562.entry.js → p-de349bee.entry.js} +1 -1
- package/dist/ripple/{p-b3c73bc9.entry.js → p-e24ddae1.entry.js} +1 -1
- package/dist/ripple/{p-b3e08b14.system.entry.js → p-e8b58666.system.entry.js} +1 -1
- package/dist/ripple/{p-a9c096b5.entry.js → p-fa87bce3.entry.js} +1 -1
- package/dist/ripple/ripple.esm.js +1 -1
- package/dist/ripple/ripple.js +16 -20
- package/dist/types/components/charts/chartFunctions.d.ts +13 -13
- package/dist/types/components/charts/priv-chart-popover/priv-chart-popover.d.ts +24 -24
- package/dist/types/components/charts/wm-chart/wm-chart-slice.d.ts +8 -8
- package/dist/types/components/charts/wm-chart/wm-chart.d.ts +39 -39
- package/dist/types/components/charts/wm-line-chart/wm-line-chart.d.ts +74 -74
- package/dist/types/components/charts/wm-progress-monitor/wm-progress-indicator.d.ts +26 -26
- package/dist/types/components/charts/wm-progress-monitor/wm-progress-monitor.d.ts +17 -17
- package/dist/types/components/charts/wm-progress-monitor/wm-progress-slice.d.ts +7 -7
- package/dist/types/components/wm-action-menu/wm-action-menu.d.ts +43 -43
- package/dist/types/components/wm-button/wm-button.d.ts +40 -40
- package/dist/types/components/wm-datepicker/priv-datepicker/priv-datepicker.d.ts +76 -76
- package/dist/types/components/wm-datepicker/wm-datepicker.d.ts +31 -31
- package/dist/types/components/wm-file/wm-file.d.ts +40 -40
- package/dist/types/components/wm-file-list/wm-file-list.d.ts +3 -3
- package/dist/types/components/wm-input/wm-input.d.ts +46 -46
- package/dist/types/components/wm-menuitem/wm-menuitem.d.ts +31 -31
- package/dist/types/components/wm-modal/wm-modal-footer.d.ts +11 -11
- package/dist/types/components/wm-modal/wm-modal-header.d.ts +7 -7
- package/dist/types/components/wm-modal/wm-modal.d.ts +24 -24
- package/dist/types/components/wm-navigation/wm-navigation-hamburger.d.ts +13 -13
- package/dist/types/components/wm-navigation/wm-navigation-item.d.ts +10 -10
- package/dist/types/components/wm-navigation/wm-navigation.d.ts +23 -23
- package/dist/types/components/wm-navigator/priv-navigator-button/priv-navigator-button.d.ts +7 -7
- package/dist/types/components/wm-navigator/priv-navigator-item/priv-navigator-item.d.ts +10 -10
- package/dist/types/components/wm-navigator/wm-navigator.d.ts +57 -57
- package/dist/types/components/wm-option/wm-option.d.ts +36 -36
- package/dist/types/components/wm-pagination/wm-pagination.d.ts +27 -27
- package/dist/types/components/wm-search/wm-search.d.ts +73 -73
- package/dist/types/components/wm-select/wm-select.d.ts +99 -99
- package/dist/types/components/wm-snackbar/wm-snackbar.d.ts +24 -24
- package/dist/types/components/wm-tabs/wm-tab-item/wm-tab-item.d.ts +30 -30
- package/dist/types/components/wm-tabs/wm-tab-list/wm-tab-list.d.ts +41 -41
- package/dist/types/components/wm-tabs/wm-tab-panel/wm-tab-panel.d.ts +16 -16
- package/dist/types/components/wm-tag-input/wm-tag-input.d.ts +114 -114
- package/dist/types/components/wm-tag-input/wm-tag-option/wm-tag-option.d.ts +15 -15
- package/dist/types/components/wm-timepicker/wm-timepicker.d.ts +48 -48
- package/dist/types/components/wm-toggletip/wm-toggletip.d.ts +20 -20
- package/dist/types/components/wm-uploader/wm-uploader.d.ts +47 -47
- package/dist/types/components/wm-wrapper/wm-wrapper.d.ts +4 -4
- package/dist/types/components.d.ts +382 -0
- package/dist/types/global/__mocks__/functions.d.ts +1 -1
- package/dist/types/global/functions.d.ts +4 -4
- package/dist/types/global/interfaces.d.ts +49 -49
- package/dist/types/global/intl.d.ts +31 -31
- package/dist/types/global/services/__mocks__/http-service.d.ts +1 -1
- package/dist/types/stencil-public-runtime.d.ts +46 -5
- package/package.json +1 -1
- package/dist/cjs/chartFunctions-2c3e010e.js +0 -600
- package/dist/cjs/interfaces-245d7bff.js +0 -38
- package/dist/cjs/intl-fa3bb4ae.js +0 -179
- package/dist/esm/chartFunctions-36634c04.js +0 -584
- package/dist/esm/interfaces-89cad2fc.js +0 -35
- package/dist/esm/intl-e2da750a.js +0 -174
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm-es5/chartFunctions-36634c04.js +0 -1
- package/dist/esm-es5/functions-5afd09f4.js +0 -1
- package/dist/esm-es5/global-d4a9e80e.js +0 -1
- package/dist/esm-es5/index-7e11ea42.js +0 -2
- package/dist/ripple/p-00acacbe.system.entry.js +0 -1
- package/dist/ripple/p-0f889b84.system.js +0 -1
- package/dist/ripple/p-13af8346.entry.js +0 -1
- package/dist/ripple/p-16363e1c.system.entry.js +0 -1
- package/dist/ripple/p-2a95b63f.system.entry.js +0 -1
- package/dist/ripple/p-30bf24f8.system.js +0 -2
- package/dist/ripple/p-3248c0fa.system.entry.js +0 -1
- package/dist/ripple/p-47c20b05.entry.js +0 -1
- package/dist/ripple/p-56d64283.system.entry.js +0 -1
- package/dist/ripple/p-5e85967a.system.js +0 -1
- package/dist/ripple/p-9b2034f6.js +0 -1
- package/dist/ripple/p-a3d07be5.system.js +0 -1
- package/dist/ripple/p-a6be3cca.system.entry.js +0 -1
- package/dist/ripple/p-aafa111a.system.js +0 -1
- package/dist/ripple/p-b5bedd63.js +0 -2
- package/dist/ripple/p-bd537299.system.entry.js +0 -1
- /package/dist/esm-es5/{interfaces-89cad2fc.js → interfaces-9b75fb61.js} +0 -0
- /package/dist/ripple/{p-c0c111fd.js → p-196eb2f3.js} +0 -0
|
@@ -2,663 +2,663 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const functions = require('./functions-
|
|
5
|
+
const index = require('./index-f8ef86de.js');
|
|
6
|
+
const functions = require('./functions-4208c444.js');
|
|
7
7
|
|
|
8
8
|
const privDatepickerCss = ".toggle{all:unset;cursor:pointer;padding:0 0.375rem;height:2.375rem;background-color:var(--wmcolor-datepicker-toggle-background);border:none;-moz-border-top-right-radius:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px;-moz-border-bottom-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px}.toggle span::after{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\f0ed\";font-size:1.5rem;color:var(--wmcolor-datepicker-toggle-icon);padding:0;line-height:2.5rem}.toggle:hover{-webkit-box-shadow:none;box-shadow:none;background:var(--wmcolor-datepicker-toggle-background-hover)}.toggle:disabled{pointer-events:none;-webkit-box-shadow:none;box-shadow:none;background-color:var(--wmcolor-datepicker-toggle-background-disabled)}.toggle:disabled .calendar::after{color:var(--wmcolor-datepicker-toggle-icon-disabled)}[dir=RTL] .toggle{right:auto;left:0}.toggle:focus{outline:none}.toggle::-moz-focus-inner{border:0}.user-is-tabbing .toggle:focus{-webkit-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus);-moz-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus);box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus)}.user-is-tabbing .toggle:focus::-moz-focus-inner{border:0}.popup{visibility:hidden;font-family:inherit;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;-webkit-box-shadow:0px 4px 15px 0px rgba(0, 0, 0, 0.2);box-shadow:0px 4px 15px 0px rgba(0, 0, 0, 0.2);width:21rem;z-index:10;position:absolute;left:0;top:40px;min-height:21.0625rem;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-webkit-transform-origin:center top;transform-origin:center top;-webkit-transform:scale(1, 0);transform:scale(1, 0);background-color:var(--wmcolor-datepicker-background)}.popup.open{-webkit-transform:scale(1, 1);transform:scale(1, 1)}.popup.expand-upwards{top:auto;bottom:2.375rem;-webkit-transform-origin:center bottom;transform-origin:center bottom}.popup .calendar-header{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;position:relative;padding:0.9375rem 0.25rem}.popup .calendar-header .title-box{height:2.625rem;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;border:1px solid;font-weight:500;font-size:0.875rem;background:var(--wmcolor-datepicker-selector-background);cursor:pointer;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;padding:0 0.375rem 0 0.75rem;border-color:var(--wmcolor-datepicker-selector-border);color:var(--wmcolor-datepicker-selector-text)}.popup .calendar-header .title-box:after{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\f140\";padding-left:0.75rem;font-size:1.12rem}.popup .calendar-header .title-box.year:after{content:\"\\f143\"}.popup .calendar-header .title-box::-moz-focus-inner{border:0}.popup .calendar-header .title-box:focus{outline:none}.popup .calendar-header .arw-btn{cursor:pointer;-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;border-radius:50%;width:2.75rem;height:2.75rem;border:none;color:var(--wmcolor-datepicker-navigation-text);background:var(--wmcolor-datepicker-navigation-background);padding:0;-webkit-box-shadow:none;box-shadow:none;line-height:2.75rem}.popup .calendar-header .arw-btn .mdi{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:1.5rem;font-weight:normal;line-height:2.75rem}.popup .calendar-header .arw-btn:hover{background-color:var(--wmcolor-datepicker-navigation-background-hover)}.popup .calendar-header .arw-btn:focus{outline:none}.popup .calendar-header .arw-btn:active{-ms-transform:scale(0.9, 0.9);-webkit-transform:scale(0.9, 0.9);-moz-transform:scale(0.9, 0.9);transform:scale(0.9, 0.9)}.popup .day-view{min-width:100%}.popup .day-view .date-grid{width:100%;text-align:center;border-collapse:collapse;margin-bottom:0.4375rem;color:var(--wmcolor-datepicker-day-text-outside)}.popup .day-view .date-grid .date-row:first-child .date-cell{margin-top:0.125rem}.popup .day-view .date-grid .date-header{background-color:var(--wmcolor-datepicker-weekdays-background)}.popup .day-view .date-grid .header-cell{height:2.0625rem;line-height:2.0625rem;width:2.75rem;margin:0 calc((14.28% - 44px) / 2);padding:0;display:inline-block;font-size:0.8125rem;font-weight:bold;color:var(--wmcolor-datepicker-weekdays-text);border:none}.popup .day-view .date-grid .date-cell{cursor:pointer;display:inline-block;padding:0;-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;border-radius:50%;height:2.75rem;width:2.75rem;margin:0 calc((14.28% - 44px) / 2);font-size:0.875rem;font-weight:500;line-height:2.75rem}.popup .day-view .date-grid .date-cell:focus{outline:none}.popup .day-view .date-grid .date-cell:hover{background-color:var(--wmcolor-datepicker-day-background-hover)}.popup .day-view .date-grid .date-cell.current-month{color:var(--wmcolor-datepicker-day-text)}.popup .day-view .date-grid .date-cell.current-month[aria-selected=true]{background-color:var(--wmcolor-datepicker-day-background-selected);color:var(--wmcolor-datepicker-day-text-selected)}.popup .day-view .date-grid .date-cell:active{background-color:var(--wmcolor-datepicker-day-background-selected);color:var(--wmcolor-datepicker-day-text-selected)}.popup .month-view .months{border-top:2px solid;border-top-color:var(--wmcolor-datepicker-month-border);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.popup .month-view .month-row{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;width:100%;border-bottom:2px solid;border-bottom-color:var(--wmcolor-datepicker-month-border)}.popup .month-view .month{cursor:pointer;text-align:center;width:100%;height:4rem;line-height:4rem;font-weight:500;color:var(--wmcolor-datepicker-month-text)}.popup .month-view .month:not(:last-child){border-right:2px solid;border-right-color:var(--wmcolor-datepicker-month-border)}.popup .month-view .month:focus{outline:none}.popup .month-view .month:hover{border-right-color:transparent;background-color:var(--wmcolor-datepicker-month-background-hover)}.popup .month-view .month:active,.popup .month-view .month.selected{background-color:var(--wmcolor-datepicker-month-background-selected);color:var(--wmcolor-datepicker-month-text-selected)}.popup.user-is-tabbing button:focus,.popup.user-is-tabbing .title-box:focus,.popup.user-is-tabbing .date-cell:focus,.popup.user-is-tabbing .month:focus{-webkit-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus);-moz-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus);box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus);border:none;z-index:11}.popup.user-is-tabbing button:focus::-moz-focus-inner,.popup.user-is-tabbing .title-box:focus::-moz-focus-inner,.popup.user-is-tabbing .date-cell:focus::-moz-focus-inner,.popup.user-is-tabbing .month:focus::-moz-focus-inner{border:0}.sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}";
|
|
9
9
|
|
|
10
10
|
const PrivDatepicker = class {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
11
|
+
constructor(hostRef) {
|
|
12
|
+
index.registerInstance(this, hostRef);
|
|
13
|
+
this.cellTriggered = index.createEvent(this, "cellTriggered", 7);
|
|
14
|
+
this.toggleButtonClicked = index.createEvent(this, "toggleButtonClicked", 7);
|
|
15
|
+
this.popupClosed = index.createEvent(this, "popupClosed", 7);
|
|
16
|
+
this.popupBlurred = index.createEvent(this, "popupBlurred", 7);
|
|
17
|
+
this.popupClicked = true;
|
|
18
|
+
this.buttonClicked = true;
|
|
19
|
+
this.prevClicked = true;
|
|
20
|
+
this.nextClicked = true;
|
|
21
|
+
this.openUp = false;
|
|
22
|
+
this.calendar_months = [
|
|
23
|
+
functions.intl.formatMessage({
|
|
24
|
+
id: "date.january",
|
|
25
|
+
defaultMessage: "January",
|
|
26
|
+
description: "Month of the year",
|
|
27
|
+
}),
|
|
28
|
+
functions.intl.formatMessage({
|
|
29
|
+
id: "date.february",
|
|
30
|
+
defaultMessage: "February",
|
|
31
|
+
description: "Month of the year",
|
|
32
|
+
}),
|
|
33
|
+
functions.intl.formatMessage({
|
|
34
|
+
id: "date.march",
|
|
35
|
+
defaultMessage: "March",
|
|
36
|
+
description: "Month of the year",
|
|
37
|
+
}),
|
|
38
|
+
functions.intl.formatMessage({
|
|
39
|
+
id: "date.april",
|
|
40
|
+
defaultMessage: "April",
|
|
41
|
+
description: "Month of the year",
|
|
42
|
+
}),
|
|
43
|
+
functions.intl.formatMessage({
|
|
44
|
+
id: "date.may",
|
|
45
|
+
defaultMessage: "May",
|
|
46
|
+
description: "Month of the year",
|
|
47
|
+
}),
|
|
48
|
+
functions.intl.formatMessage({
|
|
49
|
+
id: "date.june",
|
|
50
|
+
defaultMessage: "June",
|
|
51
|
+
description: "Month of the year",
|
|
52
|
+
}),
|
|
53
|
+
functions.intl.formatMessage({
|
|
54
|
+
id: "date.july",
|
|
55
|
+
defaultMessage: "July",
|
|
56
|
+
description: "Month of the year",
|
|
57
|
+
}),
|
|
58
|
+
functions.intl.formatMessage({
|
|
59
|
+
id: "date.august",
|
|
60
|
+
defaultMessage: "August",
|
|
61
|
+
description: "Month of the year",
|
|
62
|
+
}),
|
|
63
|
+
functions.intl.formatMessage({
|
|
64
|
+
id: "date.september",
|
|
65
|
+
defaultMessage: "September",
|
|
66
|
+
description: "Month of the year",
|
|
67
|
+
}),
|
|
68
|
+
functions.intl.formatMessage({
|
|
69
|
+
id: "date.october",
|
|
70
|
+
defaultMessage: "October",
|
|
71
|
+
description: "Month of the year",
|
|
72
|
+
}),
|
|
73
|
+
functions.intl.formatMessage({
|
|
74
|
+
id: "date.november",
|
|
75
|
+
defaultMessage: "November",
|
|
76
|
+
description: "Month of the year",
|
|
77
|
+
}),
|
|
78
|
+
functions.intl.formatMessage({
|
|
79
|
+
id: "date.december",
|
|
80
|
+
defaultMessage: "December",
|
|
81
|
+
description: "Month of the year",
|
|
82
|
+
}),
|
|
83
|
+
];
|
|
84
|
+
this.weekdays = [
|
|
85
|
+
functions.intl.formatMessage({ id: "date.sunday", defaultMessage: "Sunday" }),
|
|
86
|
+
functions.intl.formatMessage({ id: "date.monday", defaultMessage: "Monday" }),
|
|
87
|
+
functions.intl.formatMessage({ id: "date.tuesday", defaultMessage: "Tuesday" }),
|
|
88
|
+
functions.intl.formatMessage({ id: "date.wednesday", defaultMessage: "Wednesday" }),
|
|
89
|
+
functions.intl.formatMessage({ id: "date.thursday", defaultMessage: "Thursday" }),
|
|
90
|
+
functions.intl.formatMessage({ id: "date.friday", defaultMessage: "Friday" }),
|
|
91
|
+
functions.intl.formatMessage({ id: "date.saturday", defaultMessage: "Saturday" }),
|
|
92
|
+
];
|
|
93
|
+
this.renderCalendarDate = (date, index$1) => {
|
|
94
|
+
let monthOfDate = this.removeZeroes(String(date[1]));
|
|
95
|
+
let dayOfDate = this.removeZeroes(String(date[2]));
|
|
96
|
+
let isThisMonth = monthOfDate === this.monthInFocus ? "current-month" : "";
|
|
97
|
+
const dateId = date[0] + date[1] + date[2];
|
|
98
|
+
const isToday = this.isDateToday(date);
|
|
99
|
+
return (index.h("div", { role: "gridcell", id: `cell-${dateId}`, class: `date-cell ${isThisMonth}`, "aria-selected": false, "aria-label": `${isToday
|
|
100
|
+
? `${functions.intl.formatMessage({
|
|
101
|
+
id: "date.today",
|
|
102
|
+
defaultMessage: "today",
|
|
103
|
+
description: "calendar button",
|
|
104
|
+
})}, `
|
|
105
|
+
: ""}${this.weekdays[index$1]}, ${this.calendar_months[monthOfDate - 1]} ${dayOfDate}, ${date[0]}`, onClick: (ev) => {
|
|
106
|
+
this.handleTriggeredDate(ev.target);
|
|
107
|
+
}, onKeyDown: (ev) => this.trapFocusEnd(ev), "data-month": date[1], "data-year": date[0], onBlur: (ev) => ev.stopPropagation() }, dayOfDate));
|
|
108
|
+
};
|
|
109
|
+
this.disabled = false;
|
|
110
|
+
this.isExpanded = false;
|
|
111
|
+
this.view = "day";
|
|
112
|
+
this.date = new Date();
|
|
113
|
+
this.selectedYear = this.date.getUTCFullYear();
|
|
114
|
+
this.selectedMonth = this.date.getUTCMonth() + 1;
|
|
115
|
+
this.selectedDay = this.date.getUTCDate();
|
|
116
|
+
this.monthInFocus = this.selectedMonth;
|
|
117
|
+
this.yearInFocus = this.selectedYear;
|
|
118
|
+
this.dayInFocus = this.selectedDay;
|
|
119
|
+
this.monthNumInFocus = this.selectedMonth;
|
|
120
|
+
this.isTabbing = false;
|
|
121
|
+
}
|
|
122
|
+
handleKey(ev) {
|
|
123
|
+
this.prevClicked = false;
|
|
124
|
+
this.nextClicked = false;
|
|
125
|
+
switch (ev.key) {
|
|
126
|
+
case "Enter":
|
|
127
|
+
ev.preventDefault();
|
|
128
|
+
//Clunky exception for blur validation. Remove when blur reworked.
|
|
129
|
+
!ev.target.id.includes("popup-title") && ev.target.click();
|
|
130
|
+
break;
|
|
131
|
+
case "Escape":
|
|
132
|
+
ev.preventDefault();
|
|
133
|
+
if (this.isExpanded) {
|
|
134
|
+
ev.stopPropagation(); // prevents closing of parent modal
|
|
135
|
+
this.closePopup(true);
|
|
136
|
+
}
|
|
137
|
+
break;
|
|
138
|
+
case "PageUp":
|
|
139
|
+
ev.preventDefault();
|
|
140
|
+
this.backOneMonth();
|
|
141
|
+
break;
|
|
142
|
+
case "PageDown":
|
|
143
|
+
ev.preventDefault();
|
|
144
|
+
this.forwardOneMonth();
|
|
145
|
+
break;
|
|
146
|
+
case "Home":
|
|
147
|
+
ev.preventDefault();
|
|
148
|
+
this.unfocusCell();
|
|
149
|
+
this.dayInFocus = 1;
|
|
150
|
+
index.forceUpdate(this.el);
|
|
151
|
+
break;
|
|
152
|
+
case "End":
|
|
153
|
+
ev.preventDefault();
|
|
154
|
+
this.unfocusCell();
|
|
155
|
+
this.dayInFocus = this.getMonthDays(this.monthInFocus, this.yearInFocus);
|
|
156
|
+
index.forceUpdate(this.el);
|
|
157
|
+
break;
|
|
158
|
+
case "ArrowLeft":
|
|
159
|
+
ev.preventDefault();
|
|
160
|
+
if (this.view === "day") {
|
|
161
|
+
this.unfocusCell();
|
|
162
|
+
if (this.dayInFocus === 1) {
|
|
163
|
+
const newMonth = this.getPreviousMonth(this.monthInFocus, this.yearInFocus);
|
|
164
|
+
this.monthInFocus = newMonth.month;
|
|
165
|
+
this.yearInFocus = newMonth.year;
|
|
166
|
+
this.dayInFocus = this.getMonthDays(this.monthInFocus, this.yearInFocus);
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
this.dayInFocus -= 1;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
this.unfocusMonth();
|
|
174
|
+
if (this.monthNumInFocus === 0) {
|
|
175
|
+
this.monthNumInFocus = 11;
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
this.monthNumInFocus -= 1;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
break;
|
|
182
|
+
case "ArrowRight":
|
|
183
|
+
ev.preventDefault();
|
|
184
|
+
if (this.view === "day") {
|
|
185
|
+
this.unfocusCell();
|
|
186
|
+
if (this.dayInFocus === this.getMonthDays(this.monthInFocus, this.yearInFocus)) {
|
|
187
|
+
const newMonth = this.getNextMonth(this.monthInFocus, this.yearInFocus);
|
|
188
|
+
this.monthInFocus = newMonth.month;
|
|
189
|
+
this.yearInFocus = newMonth.year;
|
|
190
|
+
this.dayInFocus = 1;
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
this.dayInFocus += 1;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
this.unfocusMonth();
|
|
198
|
+
if (this.monthNumInFocus === 11) {
|
|
199
|
+
this.monthNumInFocus = 0;
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
this.monthNumInFocus += 1;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
break;
|
|
206
|
+
case "ArrowUp":
|
|
207
|
+
ev.preventDefault();
|
|
208
|
+
if (this.view === "day") {
|
|
209
|
+
this.unfocusCell();
|
|
210
|
+
if (this.dayInFocus < 8) {
|
|
211
|
+
const newMonth = this.getPreviousMonth(this.monthInFocus, this.yearInFocus);
|
|
212
|
+
this.monthInFocus = newMonth.month;
|
|
213
|
+
this.yearInFocus = newMonth.year;
|
|
214
|
+
const numDaysToSubtract = 7 - this.dayInFocus;
|
|
215
|
+
this.dayInFocus = this.getMonthDays(this.monthInFocus, this.yearInFocus) - numDaysToSubtract;
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
this.dayInFocus -= 7;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
this.unfocusMonth();
|
|
223
|
+
if (this.monthNumInFocus < 3) {
|
|
224
|
+
this.monthNumInFocus += 9;
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
this.monthNumInFocus -= 3;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
break;
|
|
231
|
+
case "ArrowDown":
|
|
232
|
+
ev.preventDefault();
|
|
233
|
+
if (!this.isExpanded) {
|
|
234
|
+
this.openPopup();
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
if (this.view === "day") {
|
|
238
|
+
//If the down arrow is pressed from the month button or the arrow buttons, focus should shift to the current cell in focus
|
|
239
|
+
if (!(document.activeElement.shadowRoot || document).activeElement.classList.contains("date-cell")) {
|
|
240
|
+
this.focusCell();
|
|
241
|
+
break;
|
|
242
|
+
}
|
|
243
|
+
this.unfocusCell();
|
|
244
|
+
const changeoverDate = this.getMonthDays(this.monthInFocus, this.yearInFocus) - 7;
|
|
245
|
+
if (this.dayInFocus > changeoverDate) {
|
|
246
|
+
const newMonth = this.getNextMonth(this.monthInFocus, this.yearInFocus);
|
|
247
|
+
this.monthInFocus = newMonth.month;
|
|
248
|
+
this.yearInFocus = newMonth.year;
|
|
249
|
+
this.dayInFocus = this.dayInFocus - changeoverDate;
|
|
250
|
+
}
|
|
251
|
+
else {
|
|
252
|
+
this.dayInFocus += 7;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
//If the down arrow is pressed from the arrow buttons or the title box, focus should shift to the current month in focus
|
|
257
|
+
const activeEl = (document.activeElement.shadowRoot || document).activeElement;
|
|
258
|
+
if (activeEl.tagName === "BUTTON" || activeEl.id.includes("popup-title-year")) {
|
|
259
|
+
this.focusMonth();
|
|
260
|
+
break;
|
|
261
|
+
}
|
|
262
|
+
this.unfocusMonth();
|
|
263
|
+
if (this.monthNumInFocus > 8) {
|
|
264
|
+
this.monthNumInFocus -= 9;
|
|
265
|
+
}
|
|
266
|
+
else {
|
|
267
|
+
this.monthNumInFocus += 3;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
break;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
toggleTabbingOn(ev) {
|
|
275
|
+
const validKeys = ["Tab", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "Enter"];
|
|
276
|
+
if (validKeys.includes(ev.key)) {
|
|
277
|
+
this.isTabbing = true;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
//Using mousedown prevents this from running when the keydown listener emits ".click()" for when enter is pressed.
|
|
281
|
+
toggleTabbingOff() {
|
|
282
|
+
this.isTabbing = false;
|
|
283
|
+
}
|
|
284
|
+
blurHandler(ev) {
|
|
285
|
+
if (!this.popupClicked && !this.buttonClicked && this.isExpanded) {
|
|
286
|
+
this.closePopup();
|
|
287
|
+
// in this case, the PointerEvent target is identical to the blur events relatedTarget, and is passed on as such
|
|
288
|
+
this.popupBlurred.emit({ relatedTarget: ev.target });
|
|
289
|
+
}
|
|
290
|
+
this.popupClicked = false;
|
|
291
|
+
this.buttonClicked = false;
|
|
292
|
+
}
|
|
293
|
+
handleBlurOnWindow(ev) {
|
|
294
|
+
// for cases where the user clicks or uses a shortcut to leave the document
|
|
133
295
|
if (this.isExpanded) {
|
|
134
|
-
|
|
135
|
-
|
|
296
|
+
this.closePopup();
|
|
297
|
+
this.popupBlurred.emit({ relatedTarget: ev.target });
|
|
136
298
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
this.
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
299
|
+
}
|
|
300
|
+
componentDidUpdate() {
|
|
301
|
+
this.handleSelectedDate();
|
|
302
|
+
if (this.isExpanded) {
|
|
303
|
+
this.prevClicked
|
|
304
|
+
? this.prevButton.focus()
|
|
305
|
+
: this.nextClicked
|
|
306
|
+
? this.nextButton.focus()
|
|
307
|
+
: this.view === "day"
|
|
308
|
+
? this.focusCell()
|
|
309
|
+
: this.focusMonth();
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
componentDidLoad() {
|
|
313
|
+
this.handleSelectedDate();
|
|
314
|
+
}
|
|
315
|
+
zeroPad(value, length) {
|
|
316
|
+
if (!String.prototype.padStart) {
|
|
317
|
+
String.prototype.padStart = function padStart(targetLength, padString) {
|
|
318
|
+
targetLength = targetLength - this.length;
|
|
319
|
+
if (targetLength > padString.length) {
|
|
320
|
+
padString += padString.repeat(targetLength / padString.length);
|
|
321
|
+
}
|
|
322
|
+
return padString.slice(0, targetLength) + String(this);
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
return `${value.toString()}`.padStart(length, "0");
|
|
326
|
+
}
|
|
327
|
+
removeZeroes(date) {
|
|
328
|
+
return +date < 10 ? +date.slice(1) : +date;
|
|
329
|
+
}
|
|
330
|
+
isDateToday(date) {
|
|
331
|
+
const today = new Date();
|
|
332
|
+
const todayDateArray = [
|
|
333
|
+
today.getFullYear().toString(),
|
|
334
|
+
(today.getMonth() + 1).toString(),
|
|
335
|
+
today.getDate().toString(),
|
|
336
|
+
];
|
|
337
|
+
//Compare today's date to date and return true if they match
|
|
338
|
+
return todayDateArray.reduce((result, val, index) => result && this.removeZeroes(date[index]).toString() === val, true);
|
|
339
|
+
}
|
|
340
|
+
togglePopup() {
|
|
341
|
+
this.isExpanded ? this.closePopup() : this.openPopup();
|
|
342
|
+
this.buttonClicked = true;
|
|
343
|
+
}
|
|
344
|
+
closePopup(returnFocus = false) {
|
|
345
|
+
this.isExpanded = false;
|
|
346
|
+
this.popupEl.classList.remove("open");
|
|
347
|
+
window.setTimeout(() => {
|
|
348
|
+
//not using display none in order to get measurements of the popup while hidden
|
|
349
|
+
this.popupEl.style.visibility = "hidden";
|
|
350
|
+
}, 250);
|
|
351
|
+
//Reset values so that menu reopens to day view with selected date in focus
|
|
352
|
+
if (this.view === "day") {
|
|
353
|
+
this.unfocusCell();
|
|
354
|
+
}
|
|
355
|
+
this.monthInFocus = this.selectedMonth;
|
|
356
|
+
this.yearInFocus = this.selectedYear;
|
|
357
|
+
this.dayInFocus = this.selectedDay;
|
|
358
|
+
this.changeView("day");
|
|
359
|
+
if (returnFocus) {
|
|
360
|
+
this.buttonEl.focus();
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
openPopup() {
|
|
364
|
+
this.panelPosition();
|
|
365
|
+
this.setDateValuesForView();
|
|
366
|
+
this.prevClicked = false;
|
|
367
|
+
this.nextClicked = false;
|
|
368
|
+
this.popupEl.style.visibility = "visible";
|
|
369
|
+
window.requestAnimationFrame(() => {
|
|
370
|
+
this.popupEl.classList.add("open");
|
|
371
|
+
});
|
|
372
|
+
this.isExpanded = true;
|
|
373
|
+
this.focusCell();
|
|
374
|
+
}
|
|
375
|
+
getMonthDays(month, year) {
|
|
376
|
+
const months30 = [4, 6, 9, 11];
|
|
377
|
+
const leapYear = year % 4 === 0;
|
|
378
|
+
return month === 2 ? (leapYear ? 29 : 28) : months30.includes(month) ? 30 : 31;
|
|
379
|
+
}
|
|
380
|
+
// 1 => Sunday, 7 => Saturday
|
|
381
|
+
getMonthFirstDay(month, year) {
|
|
382
|
+
return +new Date(year, month - 1, 1, 12, 0, 0).getDay() + 1;
|
|
383
|
+
}
|
|
384
|
+
getPreviousMonth(month, year) {
|
|
385
|
+
const prevMonth = month > 1 ? month - 1 : 12;
|
|
386
|
+
const prevMonthYear = month > 1 ? year : year - 1;
|
|
387
|
+
return { month: prevMonth, year: prevMonthYear };
|
|
388
|
+
}
|
|
389
|
+
getNextMonth(month, year) {
|
|
390
|
+
const nextMonth = month < 12 ? month + 1 : 1;
|
|
391
|
+
const nextMonthYear = month < 12 ? year : year + 1;
|
|
392
|
+
return { month: nextMonth, year: nextMonthYear };
|
|
393
|
+
}
|
|
394
|
+
getCalendarDates(month, year) {
|
|
395
|
+
// Get number of days in the month and the month's first day
|
|
396
|
+
const monthDays = this.getMonthDays(month, year);
|
|
397
|
+
const monthFirstDay = this.getMonthFirstDay(month, year);
|
|
398
|
+
// Get number of days to be displayed from previous and next months
|
|
399
|
+
// These ensure a total of 42 days (6 weeks) displayed on the calendar
|
|
400
|
+
const daysFromPrevMonth = monthFirstDay - 1;
|
|
401
|
+
let daysFromNextMonth = 42 - (daysFromPrevMonth + monthDays);
|
|
402
|
+
daysFromNextMonth = daysFromNextMonth > 6 ? daysFromNextMonth - 7 : daysFromNextMonth;
|
|
403
|
+
// Get the previous and next months and years
|
|
404
|
+
const { month: prevMonth, year: prevMonthYear } = this.getPreviousMonth(month, year);
|
|
405
|
+
const { month: nextMonth, year: nextMonthYear } = this.getNextMonth(month, year);
|
|
406
|
+
// Get number of days in previous month
|
|
407
|
+
const prevMonthDays = this.getMonthDays(prevMonth, prevMonthYear);
|
|
408
|
+
// 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.
|
|
409
|
+
const prevMonthDates = [...new Array(daysFromPrevMonth).fill("1")].map((_, index) => {
|
|
410
|
+
const day = index + 1 + (prevMonthDays - daysFromPrevMonth);
|
|
411
|
+
return [prevMonthYear.toString(), this.zeroPad(prevMonth, 2), this.zeroPad(day, 2)];
|
|
412
|
+
});
|
|
413
|
+
// 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.
|
|
414
|
+
const thisMonthDates = [...new Array(monthDays).fill("1")].map((_, index) => {
|
|
415
|
+
const day = index + 1;
|
|
416
|
+
return [year.toString(), this.zeroPad(month, 2), this.zeroPad(day, 2)];
|
|
417
|
+
});
|
|
418
|
+
// 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.
|
|
419
|
+
const nextMonthDates = [...new Array(daysFromNextMonth).fill("1")].map((_, index) => {
|
|
420
|
+
const day = index + 1;
|
|
421
|
+
return [nextMonthYear.toString(), this.zeroPad(nextMonth, 2), this.zeroPad(day, 2)];
|
|
422
|
+
});
|
|
423
|
+
// Combines all dates from previous, current and next months
|
|
424
|
+
return [...prevMonthDates, ...thisMonthDates, ...nextMonthDates];
|
|
425
|
+
}
|
|
426
|
+
forwardOneMonth() {
|
|
148
427
|
this.unfocusCell();
|
|
149
|
-
this.
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
428
|
+
const newMonth = this.getNextMonth(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(`Displaying ${this.calendar_months[this.monthInFocus - 1]}, ${this.yearInFocus}`);
|
|
436
|
+
}
|
|
437
|
+
backOneMonth() {
|
|
154
438
|
this.unfocusCell();
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
this.unfocusCell();
|
|
162
|
-
if (this.dayInFocus === 1) {
|
|
163
|
-
const newMonth = this.getPreviousMonth(this.monthInFocus, this.yearInFocus);
|
|
164
|
-
this.monthInFocus = newMonth.month;
|
|
165
|
-
this.yearInFocus = newMonth.year;
|
|
166
|
-
this.dayInFocus = this.getMonthDays(this.monthInFocus, this.yearInFocus);
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
this.dayInFocus -= 1;
|
|
170
|
-
}
|
|
439
|
+
const newMonth = this.getPreviousMonth(this.monthInFocus, this.yearInFocus);
|
|
440
|
+
this.monthInFocus = newMonth.month;
|
|
441
|
+
this.yearInFocus = newMonth.year;
|
|
442
|
+
const totalDays = this.getMonthDays(this.monthInFocus, this.yearInFocus);
|
|
443
|
+
if (this.dayInFocus > this.getMonthDays(this.monthInFocus, this.yearInFocus)) {
|
|
444
|
+
this.dayInFocus = totalDays;
|
|
171
445
|
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
446
|
+
this.updateLiveRegion(`Viewing ${this.calendar_months[this.monthInFocus - 1]}, ${this.yearInFocus}`);
|
|
447
|
+
}
|
|
448
|
+
handleTriggeredDate(el) {
|
|
449
|
+
this.cellTriggered.emit(el);
|
|
450
|
+
// change of input value will trigger the function updating selectedDate
|
|
451
|
+
this.closePopup(true);
|
|
452
|
+
}
|
|
453
|
+
handleSelectedDate() {
|
|
454
|
+
//Remove old selection status
|
|
455
|
+
if (this.selectedDate) {
|
|
456
|
+
this.selectedDate.removeAttribute("aria-selected");
|
|
180
457
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
this.unfocusCell();
|
|
186
|
-
if (this.dayInFocus === this.getMonthDays(this.monthInFocus, this.yearInFocus)) {
|
|
187
|
-
const newMonth = this.getNextMonth(this.monthInFocus, this.yearInFocus);
|
|
188
|
-
this.monthInFocus = newMonth.month;
|
|
189
|
-
this.yearInFocus = newMonth.year;
|
|
190
|
-
this.dayInFocus = 1;
|
|
191
|
-
}
|
|
192
|
-
else {
|
|
193
|
-
this.dayInFocus += 1;
|
|
194
|
-
}
|
|
458
|
+
//Update selected date to new date inputted/selected
|
|
459
|
+
this.selectedDate = this.getCellById(this.selectedYear, this.selectedMonth, this.selectedDay);
|
|
460
|
+
if (this.selectedDate) {
|
|
461
|
+
this.selectedDate.setAttribute("aria-selected", "true");
|
|
195
462
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
463
|
+
}
|
|
464
|
+
getCellById(year, month, day) {
|
|
465
|
+
const id = year + this.zeroPad(month, 2) + this.zeroPad(day, 2);
|
|
466
|
+
return this.el.querySelector(`#cell-${id}`);
|
|
467
|
+
}
|
|
468
|
+
unfocusCell() {
|
|
469
|
+
const cellToUnfocus = this.getCellById(this.yearInFocus, this.monthInFocus, this.dayInFocus);
|
|
470
|
+
cellToUnfocus.tabIndex = -1;
|
|
471
|
+
}
|
|
472
|
+
focusCell() {
|
|
473
|
+
//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.
|
|
474
|
+
const maxDays = this.getMonthDays(this.monthInFocus, this.yearInFocus);
|
|
475
|
+
this.dayInFocus = this.dayInFocus > maxDays ? maxDays : this.dayInFocus;
|
|
476
|
+
const cellToFocus = this.getCellById(this.yearInFocus, this.monthInFocus, this.dayInFocus);
|
|
477
|
+
if (cellToFocus) {
|
|
478
|
+
cellToFocus.tabIndex = 0;
|
|
479
|
+
cellToFocus.focus();
|
|
204
480
|
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
this.
|
|
219
|
-
}
|
|
481
|
+
}
|
|
482
|
+
unfocusMonth() {
|
|
483
|
+
const monthToUnfocus = this.el.querySelector(`#month-${this.monthNumInFocus}`);
|
|
484
|
+
monthToUnfocus.tabIndex = -1;
|
|
485
|
+
}
|
|
486
|
+
focusMonth() {
|
|
487
|
+
const monthToFocus = this.el.querySelector(`#month-${this.monthNumInFocus}`);
|
|
488
|
+
monthToFocus.tabIndex = 0;
|
|
489
|
+
monthToFocus.focus();
|
|
490
|
+
}
|
|
491
|
+
trapFocusLeft(ev) {
|
|
492
|
+
if (ev.shiftKey && ev.key === "Tab") {
|
|
493
|
+
ev.preventDefault();
|
|
494
|
+
this.focusCellInView();
|
|
220
495
|
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
else {
|
|
227
|
-
this.monthNumInFocus -= 3;
|
|
228
|
-
}
|
|
496
|
+
}
|
|
497
|
+
trapFocusEnd(ev) {
|
|
498
|
+
if (!ev.shiftKey && ev.key === "Tab") {
|
|
499
|
+
ev.preventDefault();
|
|
500
|
+
this.prevButton.focus();
|
|
229
501
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
ev.
|
|
233
|
-
|
|
234
|
-
|
|
502
|
+
}
|
|
503
|
+
trapFocusRight(ev) {
|
|
504
|
+
if (!ev.shiftKey && ev.key === "Tab") {
|
|
505
|
+
ev.preventDefault();
|
|
506
|
+
this.focusCellInView();
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
focusCellInView() {
|
|
510
|
+
if (this.view === "day") {
|
|
511
|
+
this.focusCell();
|
|
235
512
|
}
|
|
236
513
|
else {
|
|
237
|
-
|
|
238
|
-
//If the down arrow is pressed from the month button or the arrow buttons, focus should shift to the current cell in focus
|
|
239
|
-
if (!(document.activeElement.shadowRoot || document).activeElement.classList.contains("date-cell")) {
|
|
240
|
-
this.focusCell();
|
|
241
|
-
break;
|
|
242
|
-
}
|
|
243
|
-
this.unfocusCell();
|
|
244
|
-
const changeoverDate = this.getMonthDays(this.monthInFocus, this.yearInFocus) - 7;
|
|
245
|
-
if (this.dayInFocus > changeoverDate) {
|
|
246
|
-
const newMonth = this.getNextMonth(this.monthInFocus, this.yearInFocus);
|
|
247
|
-
this.monthInFocus = newMonth.month;
|
|
248
|
-
this.yearInFocus = newMonth.year;
|
|
249
|
-
this.dayInFocus = this.dayInFocus - changeoverDate;
|
|
250
|
-
}
|
|
251
|
-
else {
|
|
252
|
-
this.dayInFocus += 7;
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
else {
|
|
256
|
-
//If the down arrow is pressed from the arrow buttons or the title box, focus should shift to the current month in focus
|
|
257
|
-
const activeEl = (document.activeElement.shadowRoot || document).activeElement;
|
|
258
|
-
if (activeEl.tagName === "BUTTON" || activeEl.id.includes("popup-title-year")) {
|
|
259
|
-
this.focusMonth();
|
|
260
|
-
break;
|
|
261
|
-
}
|
|
262
|
-
this.unfocusMonth();
|
|
263
|
-
if (this.monthNumInFocus > 8) {
|
|
264
|
-
this.monthNumInFocus -= 9;
|
|
265
|
-
}
|
|
266
|
-
else {
|
|
267
|
-
this.monthNumInFocus += 3;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
514
|
+
this.focusMonth();
|
|
270
515
|
}
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
if (this.isExpanded) {
|
|
296
|
-
this.closePopup();
|
|
297
|
-
this.popupBlurred.emit({ relatedTarget: ev.target });
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
componentDidUpdate() {
|
|
301
|
-
this.handleSelectedDate();
|
|
302
|
-
if (this.isExpanded) {
|
|
303
|
-
this.prevClicked
|
|
304
|
-
? this.prevButton.focus()
|
|
305
|
-
: this.nextClicked
|
|
306
|
-
? this.nextButton.focus()
|
|
307
|
-
: this.view === "day"
|
|
308
|
-
? this.focusCell()
|
|
309
|
-
: this.focusMonth();
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
componentDidLoad() {
|
|
313
|
-
this.handleSelectedDate();
|
|
314
|
-
}
|
|
315
|
-
zeroPad(value, length) {
|
|
316
|
-
if (!String.prototype.padStart) {
|
|
317
|
-
String.prototype.padStart = function padStart(targetLength, padString) {
|
|
318
|
-
targetLength = targetLength - this.length;
|
|
319
|
-
if (targetLength > padString.length) {
|
|
320
|
-
padString += padString.repeat(targetLength / padString.length);
|
|
516
|
+
}
|
|
517
|
+
toggleBusyAttribute(state) {
|
|
518
|
+
this.el.querySelector("#wm-container").setAttribute("aria-busy", state);
|
|
519
|
+
}
|
|
520
|
+
setDateValuesForView() {
|
|
521
|
+
this.selectedYear = this.date.getUTCFullYear();
|
|
522
|
+
this.selectedMonth = this.date.getUTCMonth() + 1;
|
|
523
|
+
this.selectedDay = this.date.getUTCDate();
|
|
524
|
+
this.monthInFocus = this.selectedMonth;
|
|
525
|
+
this.yearInFocus = this.selectedYear;
|
|
526
|
+
this.dayInFocus = this.selectedDay;
|
|
527
|
+
this.monthNumInFocus = this.selectedMonth - 1;
|
|
528
|
+
}
|
|
529
|
+
updateLiveRegion(text) {
|
|
530
|
+
let liveRegion = this.el.querySelector("#live-region");
|
|
531
|
+
liveRegion.innerHTML = text;
|
|
532
|
+
}
|
|
533
|
+
panelPosition() {
|
|
534
|
+
const parentDatepickerEl = this.el.getRootNode().host;
|
|
535
|
+
const labelHeight = parentDatepickerEl.shadowRoot.querySelector(".label-wrapper").clientHeight;
|
|
536
|
+
this.openUp = functions.shouldOpenUp(parentDatepickerEl, this.popupEl.clientHeight, labelHeight);
|
|
537
|
+
if (functions.hasRoomRight(parentDatepickerEl, 336)) {
|
|
538
|
+
this.popupEl.style.left = "0";
|
|
539
|
+
this.popupEl.style.right = "auto";
|
|
321
540
|
}
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
return `${value.toString()}`.padStart(length, "0");
|
|
326
|
-
}
|
|
327
|
-
removeZeroes(date) {
|
|
328
|
-
return +date < 10 ? +date.slice(1) : +date;
|
|
329
|
-
}
|
|
330
|
-
isDateToday(date) {
|
|
331
|
-
const today = new Date();
|
|
332
|
-
const todayDateArray = [
|
|
333
|
-
today.getFullYear().toString(),
|
|
334
|
-
(today.getMonth() + 1).toString(),
|
|
335
|
-
today.getDate().toString(),
|
|
336
|
-
];
|
|
337
|
-
//Compare today's date to date and return true if they match
|
|
338
|
-
return todayDateArray.reduce((result, val, index) => result && this.removeZeroes(date[index]).toString() === val, true);
|
|
339
|
-
}
|
|
340
|
-
togglePopup() {
|
|
341
|
-
this.isExpanded ? this.closePopup() : this.openPopup();
|
|
342
|
-
this.buttonClicked = true;
|
|
343
|
-
}
|
|
344
|
-
closePopup(returnFocus = false) {
|
|
345
|
-
this.isExpanded = false;
|
|
346
|
-
this.popupEl.classList.remove("open");
|
|
347
|
-
window.setTimeout(() => {
|
|
348
|
-
//not using display none in order to get measurements of the popup while hidden
|
|
349
|
-
this.popupEl.style.visibility = "hidden";
|
|
350
|
-
}, 250);
|
|
351
|
-
//Reset values so that menu reopens to day view with selected date in focus
|
|
352
|
-
if (this.view === "day") {
|
|
353
|
-
this.unfocusCell();
|
|
354
|
-
}
|
|
355
|
-
this.monthInFocus = this.selectedMonth;
|
|
356
|
-
this.yearInFocus = this.selectedYear;
|
|
357
|
-
this.dayInFocus = this.selectedDay;
|
|
358
|
-
this.changeView("day");
|
|
359
|
-
if (returnFocus) {
|
|
360
|
-
this.buttonEl.focus();
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
openPopup() {
|
|
364
|
-
this.panelPosition();
|
|
365
|
-
this.setDateValuesForView();
|
|
366
|
-
this.prevClicked = false;
|
|
367
|
-
this.nextClicked = false;
|
|
368
|
-
this.popupEl.style.visibility = "visible";
|
|
369
|
-
window.requestAnimationFrame(() => {
|
|
370
|
-
this.popupEl.classList.add("open");
|
|
371
|
-
});
|
|
372
|
-
this.isExpanded = true;
|
|
373
|
-
this.focusCell();
|
|
374
|
-
}
|
|
375
|
-
getMonthDays(month, year) {
|
|
376
|
-
const months30 = [4, 6, 9, 11];
|
|
377
|
-
const leapYear = year % 4 === 0;
|
|
378
|
-
return month === 2 ? (leapYear ? 29 : 28) : months30.includes(month) ? 30 : 31;
|
|
379
|
-
}
|
|
380
|
-
// 1 => Sunday, 7 => Saturday
|
|
381
|
-
getMonthFirstDay(month, year) {
|
|
382
|
-
return +new Date(year, month - 1, 1, 12, 0, 0).getDay() + 1;
|
|
383
|
-
}
|
|
384
|
-
getPreviousMonth(month, year) {
|
|
385
|
-
const prevMonth = month > 1 ? month - 1 : 12;
|
|
386
|
-
const prevMonthYear = month > 1 ? year : year - 1;
|
|
387
|
-
return { month: prevMonth, year: prevMonthYear };
|
|
388
|
-
}
|
|
389
|
-
getNextMonth(month, year) {
|
|
390
|
-
const nextMonth = month < 12 ? month + 1 : 1;
|
|
391
|
-
const nextMonthYear = month < 12 ? year : year + 1;
|
|
392
|
-
return { month: nextMonth, year: nextMonthYear };
|
|
393
|
-
}
|
|
394
|
-
getCalendarDates(month, year) {
|
|
395
|
-
// Get number of days in the month and the month's first day
|
|
396
|
-
const monthDays = this.getMonthDays(month, year);
|
|
397
|
-
const monthFirstDay = this.getMonthFirstDay(month, year);
|
|
398
|
-
// Get number of days to be displayed from previous and next months
|
|
399
|
-
// These ensure a total of 42 days (6 weeks) displayed on the calendar
|
|
400
|
-
const daysFromPrevMonth = monthFirstDay - 1;
|
|
401
|
-
let daysFromNextMonth = 42 - (daysFromPrevMonth + monthDays);
|
|
402
|
-
daysFromNextMonth = daysFromNextMonth > 6 ? daysFromNextMonth - 7 : daysFromNextMonth;
|
|
403
|
-
// Get the previous and next months and years
|
|
404
|
-
const { month: prevMonth, year: prevMonthYear } = this.getPreviousMonth(month, year);
|
|
405
|
-
const { month: nextMonth, year: nextMonthYear } = this.getNextMonth(month, year);
|
|
406
|
-
// Get number of days in previous month
|
|
407
|
-
const prevMonthDays = this.getMonthDays(prevMonth, prevMonthYear);
|
|
408
|
-
// 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.
|
|
409
|
-
const prevMonthDates = [...new Array(daysFromPrevMonth).fill("1")].map((_, index) => {
|
|
410
|
-
const day = index + 1 + (prevMonthDays - daysFromPrevMonth);
|
|
411
|
-
return [prevMonthYear.toString(), this.zeroPad(prevMonth, 2), this.zeroPad(day, 2)];
|
|
412
|
-
});
|
|
413
|
-
// 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.
|
|
414
|
-
const thisMonthDates = [...new Array(monthDays).fill("1")].map((_, index) => {
|
|
415
|
-
const day = index + 1;
|
|
416
|
-
return [year.toString(), this.zeroPad(month, 2), this.zeroPad(day, 2)];
|
|
417
|
-
});
|
|
418
|
-
// 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.
|
|
419
|
-
const nextMonthDates = [...new Array(daysFromNextMonth).fill("1")].map((_, index) => {
|
|
420
|
-
const day = index + 1;
|
|
421
|
-
return [nextMonthYear.toString(), this.zeroPad(nextMonth, 2), this.zeroPad(day, 2)];
|
|
422
|
-
});
|
|
423
|
-
// Combines all dates from previous, current and next months
|
|
424
|
-
return [...prevMonthDates, ...thisMonthDates, ...nextMonthDates];
|
|
425
|
-
}
|
|
426
|
-
forwardOneMonth() {
|
|
427
|
-
this.unfocusCell();
|
|
428
|
-
const newMonth = this.getNextMonth(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(`Displaying ${this.calendar_months[this.monthInFocus - 1]}, ${this.yearInFocus}`);
|
|
436
|
-
}
|
|
437
|
-
backOneMonth() {
|
|
438
|
-
this.unfocusCell();
|
|
439
|
-
const newMonth = this.getPreviousMonth(this.monthInFocus, this.yearInFocus);
|
|
440
|
-
this.monthInFocus = newMonth.month;
|
|
441
|
-
this.yearInFocus = newMonth.year;
|
|
442
|
-
const totalDays = this.getMonthDays(this.monthInFocus, this.yearInFocus);
|
|
443
|
-
if (this.dayInFocus > this.getMonthDays(this.monthInFocus, this.yearInFocus)) {
|
|
444
|
-
this.dayInFocus = totalDays;
|
|
445
|
-
}
|
|
446
|
-
this.updateLiveRegion(`Viewing ${this.calendar_months[this.monthInFocus - 1]}, ${this.yearInFocus}`);
|
|
447
|
-
}
|
|
448
|
-
handleTriggeredDate(el) {
|
|
449
|
-
this.cellTriggered.emit(el);
|
|
450
|
-
// change of input value will trigger the function updating selectedDate
|
|
451
|
-
this.closePopup(true);
|
|
452
|
-
}
|
|
453
|
-
handleSelectedDate() {
|
|
454
|
-
//Remove old selection status
|
|
455
|
-
if (this.selectedDate) {
|
|
456
|
-
this.selectedDate.removeAttribute("aria-selected");
|
|
457
|
-
}
|
|
458
|
-
//Update selected date to new date inputted/selected
|
|
459
|
-
this.selectedDate = this.getCellById(this.selectedYear, this.selectedMonth, this.selectedDay);
|
|
460
|
-
if (this.selectedDate) {
|
|
461
|
-
this.selectedDate.setAttribute("aria-selected", "true");
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
getCellById(year, month, day) {
|
|
465
|
-
const id = year + this.zeroPad(month, 2) + this.zeroPad(day, 2);
|
|
466
|
-
return this.el.querySelector(`#cell-${id}`);
|
|
467
|
-
}
|
|
468
|
-
unfocusCell() {
|
|
469
|
-
const cellToUnfocus = this.getCellById(this.yearInFocus, this.monthInFocus, this.dayInFocus);
|
|
470
|
-
cellToUnfocus.tabIndex = -1;
|
|
471
|
-
}
|
|
472
|
-
focusCell() {
|
|
473
|
-
//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.
|
|
474
|
-
const maxDays = this.getMonthDays(this.monthInFocus, this.yearInFocus);
|
|
475
|
-
this.dayInFocus = this.dayInFocus > maxDays ? maxDays : this.dayInFocus;
|
|
476
|
-
const cellToFocus = this.getCellById(this.yearInFocus, this.monthInFocus, this.dayInFocus);
|
|
477
|
-
if (cellToFocus) {
|
|
478
|
-
cellToFocus.tabIndex = 0;
|
|
479
|
-
cellToFocus.focus();
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
unfocusMonth() {
|
|
483
|
-
const monthToUnfocus = this.el.querySelector(`#month-${this.monthNumInFocus}`);
|
|
484
|
-
monthToUnfocus.tabIndex = -1;
|
|
485
|
-
}
|
|
486
|
-
focusMonth() {
|
|
487
|
-
const monthToFocus = this.el.querySelector(`#month-${this.monthNumInFocus}`);
|
|
488
|
-
monthToFocus.tabIndex = 0;
|
|
489
|
-
monthToFocus.focus();
|
|
490
|
-
}
|
|
491
|
-
trapFocusLeft(ev) {
|
|
492
|
-
if (ev.shiftKey && ev.key === "Tab") {
|
|
493
|
-
ev.preventDefault();
|
|
494
|
-
this.focusCellInView();
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
trapFocusEnd(ev) {
|
|
498
|
-
if (!ev.shiftKey && ev.key === "Tab") {
|
|
499
|
-
ev.preventDefault();
|
|
500
|
-
this.prevButton.focus();
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
trapFocusRight(ev) {
|
|
504
|
-
if (!ev.shiftKey && ev.key === "Tab") {
|
|
505
|
-
ev.preventDefault();
|
|
506
|
-
this.focusCellInView();
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
focusCellInView() {
|
|
510
|
-
if (this.view === "day") {
|
|
511
|
-
this.focusCell();
|
|
512
|
-
}
|
|
513
|
-
else {
|
|
514
|
-
this.focusMonth();
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
toggleBusyAttribute(state) {
|
|
518
|
-
this.el.querySelector("#wm-container").setAttribute("aria-busy", state);
|
|
519
|
-
}
|
|
520
|
-
setDateValuesForView() {
|
|
521
|
-
this.selectedYear = this.date.getUTCFullYear();
|
|
522
|
-
this.selectedMonth = this.date.getUTCMonth() + 1;
|
|
523
|
-
this.selectedDay = this.date.getUTCDate();
|
|
524
|
-
this.monthInFocus = this.selectedMonth;
|
|
525
|
-
this.yearInFocus = this.selectedYear;
|
|
526
|
-
this.dayInFocus = this.selectedDay;
|
|
527
|
-
this.monthNumInFocus = this.selectedMonth - 1;
|
|
528
|
-
}
|
|
529
|
-
updateLiveRegion(text) {
|
|
530
|
-
let liveRegion = this.el.querySelector("#live-region");
|
|
531
|
-
liveRegion.innerHTML = text;
|
|
532
|
-
}
|
|
533
|
-
panelPosition() {
|
|
534
|
-
const parentDatepickerEl = this.el.getRootNode().host;
|
|
535
|
-
const labelHeight = parentDatepickerEl.shadowRoot.querySelector(".label-wrapper").clientHeight;
|
|
536
|
-
this.openUp = functions.shouldOpenUp(parentDatepickerEl, this.popupEl.clientHeight, labelHeight);
|
|
537
|
-
if (functions.hasRoomRight(parentDatepickerEl, 336)) {
|
|
538
|
-
this.popupEl.style.left = "0";
|
|
539
|
-
this.popupEl.style.right = "auto";
|
|
540
|
-
}
|
|
541
|
-
else {
|
|
542
|
-
this.popupEl.style.right = "0";
|
|
543
|
-
this.popupEl.style.left = "auto";
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
changeView(newView) {
|
|
547
|
-
this.view = newView;
|
|
548
|
-
//Ensure month view always opens to the month last visited in date view
|
|
549
|
-
this.monthNumInFocus = this.monthInFocus - 1;
|
|
550
|
-
}
|
|
551
|
-
renderMonths(month, index$1) {
|
|
552
|
-
return (index.h("div", { id: `month-${index$1}`, class: `month ${this.selectedMonth - 1 === index$1 ? "selected" : ""}`, role: "gridcell", tabindex: index$1 + 1 === this.monthInFocus ? 0 : -1, onKeyDown: (ev) => this.trapFocusEnd(ev), onBlur: (ev) => ev.stopPropagation(), onClick: () => {
|
|
553
|
-
this.monthInFocus = index$1 + 1;
|
|
554
|
-
this.changeView("day");
|
|
555
|
-
} }, month));
|
|
556
|
-
}
|
|
557
|
-
render() {
|
|
558
|
-
const dates = this.getCalendarDates(this.monthInFocus, this.yearInFocus);
|
|
559
|
-
return (index.h("div", { class: "container", id: "wm-container" }, index.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" }, index.h("span", { class: "calendar", title: functions.intl.formatMessage({
|
|
560
|
-
id: "date.calendarView",
|
|
561
|
-
defaultMessage: "Calendar View",
|
|
562
|
-
description: "Calendar button",
|
|
563
|
-
}) })), index.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" ? (index.h("div", { class: "day-view" }, index.h("div", { class: "calendar-header" }, index.h("button", { onClick: () => {
|
|
564
|
-
this.prevClicked = true;
|
|
565
|
-
this.popupClicked = true;
|
|
566
|
-
this.backOneMonth();
|
|
567
|
-
}, onKeyDown: (ev) => this.trapFocusLeft(ev), ref: (el) => (this.prevButton = el), class: "arw-btn", "aria-label": functions.intl.formatMessage({
|
|
568
|
-
id: "date.selectPreviousMonth",
|
|
569
|
-
defaultMessage: "Select previous month",
|
|
570
|
-
description: "Calendar button",
|
|
571
|
-
}) }, index.h("span", { class: "mdi" }, "\uF141")), index.h("div", { id: "popup-title-month", class: "title-box", tabindex: 0, role: "button", onKeyDown: (ev) => {
|
|
572
|
-
if (ev.key === "Enter" || ev.key === " ") {
|
|
573
|
-
ev.preventDefault();
|
|
574
|
-
this.changeView("month");
|
|
541
|
+
else {
|
|
542
|
+
this.popupEl.style.right = "0";
|
|
543
|
+
this.popupEl.style.left = "auto";
|
|
575
544
|
}
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
545
|
+
}
|
|
546
|
+
changeView(newView) {
|
|
547
|
+
this.view = newView;
|
|
548
|
+
//Ensure month view always opens to the month last visited in date view
|
|
549
|
+
this.monthNumInFocus = this.monthInFocus - 1;
|
|
550
|
+
}
|
|
551
|
+
renderMonths(month, index$1) {
|
|
552
|
+
return (index.h("div", { id: `month-${index$1}`, class: `month ${this.selectedMonth - 1 === index$1 ? "selected" : ""}`, role: "gridcell", tabindex: index$1 + 1 === this.monthInFocus ? 0 : -1, onKeyDown: (ev) => this.trapFocusEnd(ev), onBlur: (ev) => ev.stopPropagation(), onClick: () => {
|
|
553
|
+
this.monthInFocus = index$1 + 1;
|
|
554
|
+
this.changeView("day");
|
|
555
|
+
} }, month));
|
|
556
|
+
}
|
|
557
|
+
render() {
|
|
558
|
+
const dates = this.getCalendarDates(this.monthInFocus, this.yearInFocus);
|
|
559
|
+
return (index.h("div", { class: "container", id: "wm-container" }, index.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" }, index.h("span", { class: "calendar", title: functions.intl.formatMessage({
|
|
560
|
+
id: "date.calendarView",
|
|
561
|
+
defaultMessage: "Calendar View",
|
|
562
|
+
description: "Calendar button",
|
|
563
|
+
}) })), index.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" ? (index.h("div", { class: "day-view" }, index.h("div", { class: "calendar-header" }, index.h("button", { onClick: () => {
|
|
564
|
+
this.prevClicked = true;
|
|
565
|
+
this.popupClicked = true;
|
|
566
|
+
this.backOneMonth();
|
|
567
|
+
}, onKeyDown: (ev) => this.trapFocusLeft(ev), ref: (el) => (this.prevButton = el), class: "arw-btn", "aria-label": functions.intl.formatMessage({
|
|
568
|
+
id: "date.selectPreviousMonth",
|
|
569
|
+
defaultMessage: "Select previous month",
|
|
570
|
+
description: "Calendar button",
|
|
571
|
+
}) }, index.h("span", { class: "mdi" }, "\uF141")), index.h("div", { id: "popup-title-month", class: "title-box", tabindex: 0, role: "button", onKeyDown: (ev) => {
|
|
572
|
+
if (ev.key === "Enter" || ev.key === " ") {
|
|
573
|
+
ev.preventDefault();
|
|
574
|
+
this.changeView("month");
|
|
575
|
+
}
|
|
576
|
+
}, onClick: this.changeView.bind(this, "month"), "aria-label": `${functions.intl.formatMessage({
|
|
577
|
+
id: "date.currentMonth",
|
|
578
|
+
defaultMessage: "current month",
|
|
579
|
+
description: "Calendar button",
|
|
580
|
+
})}: ${this.calendar_months[this.monthInFocus - 1]}
|
|
581
581
|
${this.yearInFocus}.`, "aria-describedby": "month-title" }, index.h("span", { class: "title", "aria-hidden": "true" }, this.calendar_months[this.monthInFocus - 1], " ", this.yearInFocus)), index.h("button", { onClick: () => {
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
582
|
+
this.nextClicked = true;
|
|
583
|
+
this.popupClicked = true;
|
|
584
|
+
this.forwardOneMonth();
|
|
585
|
+
}, onKeyDown: (ev) => this.trapFocusRight(ev), "aria-label": functions.intl.formatMessage({
|
|
586
|
+
id: "date.selectNextMonth",
|
|
587
|
+
defaultMessage: "Select next month",
|
|
588
|
+
description: "Calendar button",
|
|
589
|
+
}), ref: (el) => (this.nextButton = el), class: "arw-btn" }, index.h("span", { class: "mdi" }, "\uF142"))), index.h("div", { "aria-labelledby": "popup-title-month", role: "grid", class: "date-grid" }, index.h("div", { role: "rowgroup", class: "date-header" }, index.h("div", { role: "row", class: "header-row" }, index.h("div", { role: "columnheader", class: "header-cell" }, index.h("span", null, functions.intl.formatMessage({
|
|
590
|
+
id: "date.su",
|
|
591
|
+
defaultMessage: "Su",
|
|
592
|
+
description: "Abbreviated day of the week",
|
|
593
|
+
}))), index.h("div", { role: "columnheader", class: "header-cell" }, index.h("span", null, functions.intl.formatMessage({
|
|
594
|
+
id: "date.mo",
|
|
595
|
+
defaultMessage: "Mo",
|
|
596
|
+
description: "Abbreviated day of the week",
|
|
597
|
+
}))), index.h("div", { role: "columnheader", class: "header-cell" }, index.h("span", null, functions.intl.formatMessage({
|
|
598
|
+
id: "date.tu",
|
|
599
|
+
defaultMessage: "Tu",
|
|
600
|
+
description: "Abbreviated day of the week",
|
|
601
|
+
}))), index.h("div", { role: "columnheader", class: "header-cell" }, index.h("span", null, functions.intl.formatMessage({
|
|
602
|
+
id: "date.we",
|
|
603
|
+
defaultMessage: "We",
|
|
604
|
+
description: "Abbreviated day of the week",
|
|
605
|
+
}))), index.h("div", { role: "columnheader", class: "header-cell" }, index.h("span", null, functions.intl.formatMessage({
|
|
606
|
+
id: "date.th",
|
|
607
|
+
defaultMessage: "Th",
|
|
608
|
+
description: "Abbreviated day of the week",
|
|
609
|
+
}))), index.h("div", { role: "columnheader", class: "header-cell" }, index.h("span", null, functions.intl.formatMessage({
|
|
610
|
+
id: "date.fr",
|
|
611
|
+
defaultMessage: "Fr",
|
|
612
|
+
description: "Abbreviated day of the week",
|
|
613
|
+
}))), index.h("div", { role: "columnheader", class: "header-cell" }, index.h("span", null, functions.intl.formatMessage({
|
|
614
|
+
id: "date.sa",
|
|
615
|
+
defaultMessage: "Sa",
|
|
616
|
+
description: "Abbreviated day of the week",
|
|
617
|
+
}))))), index.h("div", { role: "rowgroup" }, index.h("div", { role: "row", class: "date-row" }, dates.slice(0, 7).map((date, i) => this.renderCalendarDate(date, i))), index.h("div", { role: "row" }, dates.slice(7, 14).map((date, i) => this.renderCalendarDate(date, i))), index.h("div", { role: "row" }, dates.slice(14, 21).map((date, i) => this.renderCalendarDate(date, i))), index.h("div", { role: "row" }, dates.slice(21, 28).map((date, i) => this.renderCalendarDate(date, i))), index.h("div", { role: "row" }, dates.slice(28, 35).map((date, i) => this.renderCalendarDate(date, i))), dates.length > 35 ? (index.h("div", { role: "row" }, dates.slice(35).map((date, i) => this.renderCalendarDate(date, i)))) : (""))))) : (index.h("div", { class: "month-view" }, index.h("div", { class: "calendar-header" }, index.h("button", { onClick: () => {
|
|
618
|
+
this.prevClicked = true;
|
|
619
|
+
this.popupClicked = true;
|
|
620
|
+
this.yearInFocus -= 1;
|
|
621
|
+
this.updateLiveRegion(`${this.yearInFocus} selected.`);
|
|
622
|
+
}, onKeyDown: (ev) => this.trapFocusLeft(ev), "aria-label": functions.intl.formatMessage({
|
|
623
|
+
id: "date.selectPreviousYear",
|
|
624
|
+
defaultMessage: "Select previous year",
|
|
625
|
+
description: "Calendar button",
|
|
626
|
+
}), ref: (el) => (this.prevButton = el), class: "arw-btn" }, index.h("span", { class: "mdi" }, "\uF141")), index.h("div", { id: "popup-title-year", tabindex: 0, class: "title-box year", role: "button", onClick: this.changeView.bind(this, "day"), onKeyDown: (ev) => {
|
|
627
|
+
if (ev.key === "Enter" || ev.key === " ") {
|
|
628
|
+
ev.preventDefault();
|
|
629
|
+
this.changeView("day");
|
|
630
|
+
}
|
|
631
|
+
}, "aria-labelledby": "year-title" }, index.h("span", { class: "title" }, this.yearInFocus)), index.h("button", { onClick: () => {
|
|
632
|
+
this.nextClicked = true;
|
|
633
|
+
this.popupClicked = true;
|
|
634
|
+
this.yearInFocus += 1;
|
|
635
|
+
this.updateLiveRegion(`${this.yearInFocus} selected.`);
|
|
636
|
+
}, "aria-label": functions.intl.formatMessage({
|
|
637
|
+
id: "date.selectNextYear",
|
|
638
|
+
defaultMessage: "Select next year",
|
|
639
|
+
description: "Calendar button",
|
|
640
|
+
}), onKeyDown: (ev) => this.trapFocusRight(ev), ref: (el) => (this.nextButton = el), class: "arw-btn" }, index.h("span", { class: "mdi" }, "\uF142"))), index.h("div", { "aria-labelledby": "popup-title-year", role: "grid", class: "months" }, index.h("div", { role: "row", class: "month-row" }, this.calendar_months
|
|
641
|
+
.slice(0, 3)
|
|
642
|
+
.map((month, index) => this.renderMonths(month, index))), index.h("div", { role: "row", class: "month-row" }, this.calendar_months
|
|
643
|
+
.slice(3, 6)
|
|
644
|
+
.map((month, index) => this.renderMonths(month, index + 3))), index.h("div", { role: "row", class: "month-row" }, this.calendar_months
|
|
645
|
+
.slice(6, 9)
|
|
646
|
+
.map((month, index) => this.renderMonths(month, index + 6))), index.h("div", { role: "row", class: "month-row" }, this.calendar_months
|
|
647
|
+
.slice(9)
|
|
648
|
+
.map((month, index) => this.renderMonths(month, index + 9))))))), this.isExpanded && index.h("div", { id: "live-region", "aria-live": "polite", "aria-relevant": "text", class: "sr-only" }), index.h("div", { id: "month-title", class: "sr-only" }, functions.intl.formatMessage({
|
|
649
|
+
id: "date.selectMonth",
|
|
650
|
+
defaultMessage: "Activate to select a month.",
|
|
651
|
+
description: "Calendar button",
|
|
652
|
+
})), index.h("div", { id: "year-title", class: "sr-only" }, functions.intl.formatMessage({
|
|
653
|
+
id: "date.selectYear",
|
|
654
|
+
defaultMessage: "Activate to select a year.",
|
|
655
|
+
description: "Calendar button",
|
|
656
|
+
})), index.h("div", { id: "application", class: "sr-only" }, functions.intl.formatMessage({
|
|
657
|
+
id: "date.instructions",
|
|
658
|
+
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.",
|
|
659
|
+
}))));
|
|
660
|
+
}
|
|
661
|
+
get el() { return index.getElement(this); }
|
|
662
662
|
};
|
|
663
663
|
PrivDatepicker.style = privDatepickerCss;
|
|
664
664
|
|