@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,961 +2,965 @@ 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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
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
|
|
122
284
|
if (this.isExpanded) {
|
|
123
|
-
|
|
124
|
-
|
|
285
|
+
this.closePopup();
|
|
286
|
+
this.popupBlurred.emit({ relatedTarget: ev.target });
|
|
125
287
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
this.
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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
|
-
}
|
|
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();
|
|
160
299
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
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
|
+
};
|
|
169
313
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
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
|
|
173
341
|
if (this.view === "day") {
|
|
174
|
-
|
|
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
|
-
}
|
|
342
|
+
this.unfocusCell();
|
|
184
343
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
this.monthNumInFocus += 1;
|
|
192
|
-
}
|
|
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();
|
|
193
350
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
this.
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
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;
|
|
209
423
|
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
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;
|
|
218
434
|
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
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");
|
|
224
446
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
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
|
-
}
|
|
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");
|
|
259
451
|
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
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);
|
|
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();
|
|
310
469
|
}
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
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");
|
|
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();
|
|
564
484
|
}
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
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");
|
|
485
|
+
}
|
|
486
|
+
trapFocusEnd(ev) {
|
|
487
|
+
if (!ev.shiftKey && ev.key === "Tab") {
|
|
488
|
+
ev.preventDefault();
|
|
489
|
+
this.prevButton.focus();
|
|
619
490
|
}
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
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
|
-
}
|
|
491
|
+
}
|
|
492
|
+
trapFocusRight(ev) {
|
|
493
|
+
if (!ev.shiftKey && ev.key === "Tab") {
|
|
494
|
+
ev.preventDefault();
|
|
495
|
+
this.focusCellInView();
|
|
872
496
|
}
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
"
|
|
876
|
-
|
|
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
|
-
}
|
|
497
|
+
}
|
|
498
|
+
focusCellInView() {
|
|
499
|
+
if (this.view === "day") {
|
|
500
|
+
this.focusCell();
|
|
891
501
|
}
|
|
892
|
-
|
|
893
|
-
|
|
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": {}
|
|
502
|
+
else {
|
|
503
|
+
this.focusMonth();
|
|
906
504
|
}
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
"
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
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";
|
|
925
529
|
}
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
"
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
"
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
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");
|
|
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"
|
|
845
|
+
}
|
|
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
|
+
}
|
|
962
966
|
}
|