@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
|
@@ -3,993 +3,994 @@ import { forceUpdate } from "@stencil/core";
|
|
|
3
3
|
import { generateId, getTextDir, shouldOpenUp, intl, debounce, toBool, handleDisabledAttribute, } from "../../global/functions";
|
|
4
4
|
import { globalMessages } from "../../global/intl";
|
|
5
5
|
export class Select {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
6
|
+
constructor() {
|
|
7
|
+
this.selectAllMessage = intl.formatMessage({
|
|
8
|
+
id: "select.selectAll",
|
|
9
|
+
defaultMessage: "Select All",
|
|
10
|
+
});
|
|
11
|
+
this.deselectAllMessage = intl.formatMessage({
|
|
12
|
+
id: "select.deselectAll",
|
|
13
|
+
defaultMessage: "Deselect All",
|
|
14
|
+
});
|
|
15
|
+
this.allOptionsSelectedMessage = intl.formatMessage({
|
|
16
|
+
id: "select.allOptionsSelected",
|
|
17
|
+
defaultMessage: "All options selected",
|
|
18
|
+
});
|
|
19
|
+
this.allOptionsDeselectedMessage = intl.formatMessage({
|
|
20
|
+
id: "select.allOptionsDeselected",
|
|
21
|
+
defaultMessage: "All options deselected",
|
|
22
|
+
});
|
|
23
|
+
this.keysSoFar = "";
|
|
24
|
+
this.searchIndex = 0;
|
|
25
|
+
this.openUp = false;
|
|
26
|
+
//////////////////////////////////////
|
|
27
|
+
//////////////////////////////////////
|
|
28
|
+
// for multiselect button text
|
|
29
|
+
this.overflowCount = 0;
|
|
30
|
+
this.displayedOptions = [];
|
|
31
|
+
this.debouncedClearKeysSoFar = debounce(() => {
|
|
32
|
+
this.keysSoFar = "";
|
|
33
|
+
}, 500);
|
|
34
|
+
this.debouncedSearch = debounce(() => {
|
|
35
|
+
this.wmSelectSearchChanged.emit({ searchTerm: this.searchTerm });
|
|
36
|
+
if (this.filteredOptions.length) {
|
|
37
|
+
this.announce(this.resultsFoundMessage);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
this.announce(this.noResultsFoundMessage);
|
|
41
|
+
}
|
|
42
|
+
}, 150);
|
|
43
|
+
this.disabled = false;
|
|
44
|
+
this.maxHeight = undefined;
|
|
45
|
+
this.label = undefined;
|
|
46
|
+
this.labelPosition = "top";
|
|
47
|
+
this.requiredField = false;
|
|
48
|
+
this.errorMessage = "";
|
|
49
|
+
this.multiple = false;
|
|
50
|
+
this.search = false;
|
|
51
|
+
this.selectAll = false;
|
|
52
|
+
this.placeholder = intl.formatMessage({
|
|
53
|
+
id: "select.multiPlaceholder",
|
|
54
|
+
defaultMessage: "Make a selection",
|
|
55
|
+
description: "Placeholder text. Use imperative",
|
|
56
|
+
});
|
|
57
|
+
this.searchPlaceholder = intl.formatMessage({
|
|
58
|
+
id: "select.searchPlaceholder",
|
|
59
|
+
defaultMessage: "Search",
|
|
60
|
+
description: "Placeholder text. Use imperative",
|
|
61
|
+
});
|
|
62
|
+
this.allSelectedMessage = intl.formatMessage({
|
|
63
|
+
id: "select.allSelected",
|
|
64
|
+
defaultMessage: "All selected",
|
|
65
|
+
description: "Text displayed when all options are selected",
|
|
66
|
+
});
|
|
67
|
+
this.isTabbing = false;
|
|
68
|
+
this.isExpanded = false;
|
|
69
|
+
this.announcement = "";
|
|
70
|
+
}
|
|
71
|
+
get childOptions() {
|
|
72
|
+
return Array.from(this.el.querySelectorAll("wm-option"));
|
|
73
|
+
}
|
|
74
|
+
get cloneOptions() {
|
|
75
|
+
return Array.from(this.el.shadowRoot.querySelectorAll("wm-option"));
|
|
76
|
+
}
|
|
77
|
+
get allOptionEls() {
|
|
78
|
+
// this includes both slotted wm-options and internally created wm-options
|
|
79
|
+
return this.cloneOptions.concat(this.childOptions);
|
|
80
|
+
}
|
|
81
|
+
get visibleOptionEls() {
|
|
82
|
+
return this.allOptionEls.filter((option) => !option.classList.contains("hidden") && !option.classList.contains("filtered-out"));
|
|
83
|
+
}
|
|
84
|
+
get isDisabled() {
|
|
85
|
+
// string "false" needs to be treated as bool False because react wrappers convert bool to string.
|
|
86
|
+
return toBool(this.disabled);
|
|
87
|
+
}
|
|
26
88
|
//////////////////////////////////////
|
|
89
|
+
// for search variants
|
|
90
|
+
get searchTerm() {
|
|
91
|
+
return this.searchFieldEl ? this.searchFieldEl.value : "";
|
|
92
|
+
}
|
|
93
|
+
get filteredOptions() {
|
|
94
|
+
return this.childOptions.filter((option) => { var _a; return (_a = option.textContent) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(this.searchTerm.toLowerCase()); });
|
|
95
|
+
}
|
|
96
|
+
get selectedOptions() {
|
|
97
|
+
return Array.from(this.el.querySelectorAll("wm-option")).filter((x) => x.selected);
|
|
98
|
+
}
|
|
99
|
+
get allSelected() {
|
|
100
|
+
return this.childOptions.every((option) => option.selected);
|
|
101
|
+
}
|
|
102
|
+
get visibleSelectAllButton() {
|
|
103
|
+
return this.selectAll && this.multiple && this.searchTerm === "";
|
|
104
|
+
}
|
|
27
105
|
//////////////////////////////////////
|
|
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
|
-
// string "false" needs to be treated as bool False because react wrappers convert bool to string.
|
|
86
|
-
return toBool(this.disabled);
|
|
87
|
-
}
|
|
88
|
-
//////////////////////////////////////
|
|
89
|
-
// for search variants
|
|
90
|
-
get searchTerm() {
|
|
91
|
-
return this.searchFieldEl ? this.searchFieldEl.value : "";
|
|
92
|
-
}
|
|
93
|
-
get filteredOptions() {
|
|
94
|
-
return this.childOptions.filter((option) => { var _a; return (_a = option.textContent) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(this.searchTerm.toLowerCase()); });
|
|
95
|
-
}
|
|
96
|
-
get selectedOptions() {
|
|
97
|
-
return Array.from(this.el.querySelectorAll("wm-option")).filter((x) => x.selected);
|
|
98
|
-
}
|
|
99
|
-
get allSelected() {
|
|
100
|
-
return this.childOptions.every((option) => option.selected);
|
|
101
|
-
}
|
|
102
|
-
get visibleSelectAllButton() {
|
|
103
|
-
return this.selectAll && this.multiple && this.searchTerm === "";
|
|
104
|
-
}
|
|
105
|
-
//////////////////////////////////////
|
|
106
|
-
get resultsFoundMessage() {
|
|
107
|
-
return intl.formatMessage({
|
|
108
|
-
id: "select.searchResultsFound",
|
|
109
|
-
defaultMessage: "{numResults, plural, one {1 option found} other {# options found}}",
|
|
110
|
-
description: "The message read by the screen reader, indicating how many results a search returned",
|
|
111
|
-
}, { numResults: this.filteredOptions.length });
|
|
112
|
-
}
|
|
113
|
-
get noResultsFoundMessage() {
|
|
114
|
-
return intl.formatMessage({
|
|
115
|
-
id: "select.noSearchResults",
|
|
116
|
-
defaultMessage: "No results found. Please try your search again.",
|
|
117
|
-
description: "The message displayed when no options pass the search filter",
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
toggleTabbingOn() {
|
|
121
|
-
this.isTabbing = true;
|
|
122
|
-
}
|
|
123
|
-
toggleTabbingOff() {
|
|
124
|
-
this.isTabbing = false;
|
|
125
|
-
}
|
|
126
|
-
handleOptionSelection(ev) {
|
|
127
|
-
this.focusOption(ev.detail);
|
|
128
|
-
if (!this.multiple) {
|
|
129
|
-
this.close();
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
handleOptionCloneSelection(ev) {
|
|
133
|
-
const correspondingOption = this.findCorrespondingOption(ev.detail);
|
|
134
|
-
correspondingOption.click();
|
|
135
|
-
}
|
|
136
|
-
handleChildEnter() {
|
|
137
|
-
// only occurs for multiselects. handle the click, then close
|
|
138
|
-
this.close();
|
|
139
|
-
}
|
|
140
|
-
handleChildUp(ev) {
|
|
141
|
-
this.moveUp(ev.detail);
|
|
142
|
-
}
|
|
143
|
-
handleChildDown(ev) {
|
|
144
|
-
this.moveDown(ev.detail);
|
|
145
|
-
}
|
|
146
|
-
moveToFirstOption() {
|
|
147
|
-
this.focusOption(this.visibleOptionEls[0]);
|
|
148
|
-
}
|
|
149
|
-
moveToLastOption() {
|
|
150
|
-
this.focusOption(this.visibleOptionEls[this.visibleOptionEls.length - 1]);
|
|
151
|
-
}
|
|
152
|
-
closePopupOnEscape() {
|
|
153
|
-
this.close();
|
|
154
|
-
}
|
|
155
|
-
handleOptionBlur(ev) {
|
|
156
|
-
// if the Option is blurred to something other than the component emit a blur event with the appropriate relatedTarget
|
|
157
|
-
// keeps our component's blur events accurate, and closes when focusing browser address bar
|
|
158
|
-
if (!this.isElOrChild(ev.detail.relatedTarget)) {
|
|
159
|
-
const event = new CustomEvent("blur");
|
|
160
|
-
// @ts-ignore
|
|
161
|
-
event.relatedTarget = ev.detail.relatedTarget;
|
|
162
|
-
this.el.dispatchEvent(event);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
handleClick(ev) {
|
|
166
|
-
if (!this.isElOrChild(ev.target)) {
|
|
167
|
-
this.close();
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
handleSelectAllClick() {
|
|
171
|
-
this.allSelected ? this.deselectAllOptions() : this.selectAllOptions();
|
|
172
|
-
}
|
|
173
|
-
selectAllOptions() {
|
|
174
|
-
this.announce(this.allOptionsSelectedMessage);
|
|
175
|
-
this.wmSelectAllSelected.emit();
|
|
176
|
-
}
|
|
177
|
-
deselectAllOptions() {
|
|
178
|
-
this.announce(this.allOptionsDeselectedMessage);
|
|
179
|
-
this.wmSelectAllDeselected.emit();
|
|
180
|
-
}
|
|
181
|
-
handleButtonBlur(ev) {
|
|
182
|
-
if (this.isElOrChild(ev.relatedTarget)) {
|
|
183
|
-
// do not emit a blur event when opening the dropdown and focusing the Options
|
|
184
|
-
ev.stopPropagation();
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
handleSearchFieldBlur(ev) {
|
|
188
|
-
this.searchFieldWrapperEl.classList.remove("focus");
|
|
189
|
-
if (this.isElOrChild(ev.relatedTarget)) {
|
|
190
|
-
// do not emit a blur event when moving from searchfield to options
|
|
191
|
-
ev.stopPropagation();
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
handleKey(ev) {
|
|
195
|
-
switch (ev.key) {
|
|
196
|
-
case "ArrowDown":
|
|
197
|
-
if (this.isExpanded === false) {
|
|
198
|
-
ev.preventDefault();
|
|
199
|
-
this.open("next");
|
|
106
|
+
get resultsFoundMessage() {
|
|
107
|
+
return intl.formatMessage({
|
|
108
|
+
id: "select.searchResultsFound",
|
|
109
|
+
defaultMessage: "{numResults, plural, one {1 option found} other {# options found}}",
|
|
110
|
+
description: "The message read by the screen reader, indicating how many results a search returned",
|
|
111
|
+
}, { numResults: this.filteredOptions.length });
|
|
112
|
+
}
|
|
113
|
+
get noResultsFoundMessage() {
|
|
114
|
+
return intl.formatMessage({
|
|
115
|
+
id: "select.noSearchResults",
|
|
116
|
+
defaultMessage: "No results found. Please try your search again.",
|
|
117
|
+
description: "The message displayed when no options pass the search filter",
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
toggleTabbingOn() {
|
|
121
|
+
this.isTabbing = true;
|
|
122
|
+
}
|
|
123
|
+
toggleTabbingOff() {
|
|
124
|
+
this.isTabbing = false;
|
|
125
|
+
}
|
|
126
|
+
handleOptionSelection(ev) {
|
|
127
|
+
this.focusOption(ev.detail);
|
|
128
|
+
if (!this.multiple) {
|
|
129
|
+
this.close();
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
handleOptionCloneSelection(ev) {
|
|
133
|
+
const correspondingOption = this.findCorrespondingOption(ev.detail);
|
|
134
|
+
correspondingOption.click();
|
|
135
|
+
}
|
|
136
|
+
handleChildEnter() {
|
|
137
|
+
// only occurs for multiselects. handle the click, then close
|
|
138
|
+
this.close();
|
|
139
|
+
}
|
|
140
|
+
handleChildUp(ev) {
|
|
141
|
+
this.moveUp(ev.detail);
|
|
142
|
+
}
|
|
143
|
+
handleChildDown(ev) {
|
|
144
|
+
this.moveDown(ev.detail);
|
|
145
|
+
}
|
|
146
|
+
moveToFirstOption() {
|
|
147
|
+
this.focusOption(this.visibleOptionEls[0]);
|
|
148
|
+
}
|
|
149
|
+
moveToLastOption() {
|
|
150
|
+
this.focusOption(this.visibleOptionEls[this.visibleOptionEls.length - 1]);
|
|
151
|
+
}
|
|
152
|
+
closePopupOnEscape() {
|
|
153
|
+
this.close();
|
|
154
|
+
}
|
|
155
|
+
handleOptionBlur(ev) {
|
|
156
|
+
// if the Option is blurred to something other than the component emit a blur event with the appropriate relatedTarget
|
|
157
|
+
// keeps our component's blur events accurate, and closes when focusing browser address bar
|
|
158
|
+
if (!this.isElOrChild(ev.detail.relatedTarget)) {
|
|
159
|
+
const event = new CustomEvent("blur");
|
|
160
|
+
// @ts-ignore
|
|
161
|
+
event.relatedTarget = ev.detail.relatedTarget;
|
|
162
|
+
this.el.dispatchEvent(event);
|
|
200
163
|
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
if (this.
|
|
204
|
-
|
|
205
|
-
this.open("previous");
|
|
164
|
+
}
|
|
165
|
+
handleClick(ev) {
|
|
166
|
+
if (!this.isElOrChild(ev.target)) {
|
|
167
|
+
this.close();
|
|
206
168
|
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
childList: true,
|
|
224
|
-
attributes: true,
|
|
225
|
-
subtree: true,
|
|
226
|
-
attributeFilter: ["selected"],
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
handleChildChange(_) {
|
|
230
|
-
// on update of children or children selected state, reset button text and rerender
|
|
231
|
-
this.setButtonText();
|
|
232
|
-
forceUpdate(this.el);
|
|
233
|
-
}
|
|
234
|
-
componentDidLoad() {
|
|
235
|
-
this.wmSelectDidLoad.emit();
|
|
236
|
-
this.dropdownEl.classList.add("hidden");
|
|
237
|
-
forceUpdate(this.el);
|
|
238
|
-
// Dev can overwrite the max-height rule set in the Sass file
|
|
239
|
-
if (this.maxHeight) {
|
|
240
|
-
this.listboxEl.style.maxHeight = this.maxHeight;
|
|
241
|
-
}
|
|
242
|
-
if (this.multiple) {
|
|
243
|
-
this.updateOptionVisibility();
|
|
244
|
-
}
|
|
245
|
-
this.setButtonText();
|
|
246
|
-
}
|
|
247
|
-
componentWillUpdate() {
|
|
248
|
-
if (this.multiple) {
|
|
249
|
-
// find last visible clone option and apply .last class
|
|
250
|
-
const visibleCloneOptions = this.visibleOptionEls.filter((option) => option.classList.contains("clone"));
|
|
251
|
-
visibleCloneOptions.forEach((option, idx) => {
|
|
252
|
-
if (idx === visibleCloneOptions.length - 1) {
|
|
253
|
-
option.classList.add("last");
|
|
169
|
+
}
|
|
170
|
+
handleSelectAllClick() {
|
|
171
|
+
this.allSelected ? this.deselectAllOptions() : this.selectAllOptions();
|
|
172
|
+
}
|
|
173
|
+
selectAllOptions() {
|
|
174
|
+
this.announce(this.allOptionsSelectedMessage);
|
|
175
|
+
this.wmSelectAllSelected.emit();
|
|
176
|
+
}
|
|
177
|
+
deselectAllOptions() {
|
|
178
|
+
this.announce(this.allOptionsDeselectedMessage);
|
|
179
|
+
this.wmSelectAllDeselected.emit();
|
|
180
|
+
}
|
|
181
|
+
handleButtonBlur(ev) {
|
|
182
|
+
if (this.isElOrChild(ev.relatedTarget)) {
|
|
183
|
+
// do not emit a blur event when opening the dropdown and focusing the Options
|
|
184
|
+
ev.stopPropagation();
|
|
254
185
|
}
|
|
255
|
-
|
|
256
|
-
|
|
186
|
+
}
|
|
187
|
+
handleSearchFieldBlur(ev) {
|
|
188
|
+
this.searchFieldWrapperEl.classList.remove("focus");
|
|
189
|
+
if (this.isElOrChild(ev.relatedTarget)) {
|
|
190
|
+
// do not emit a blur event when moving from searchfield to options
|
|
191
|
+
ev.stopPropagation();
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
handleKey(ev) {
|
|
195
|
+
switch (ev.key) {
|
|
196
|
+
case "ArrowDown":
|
|
197
|
+
if (this.isExpanded === false) {
|
|
198
|
+
ev.preventDefault();
|
|
199
|
+
this.open("next");
|
|
200
|
+
}
|
|
201
|
+
break;
|
|
202
|
+
case "ArrowUp":
|
|
203
|
+
if (this.isExpanded === false) {
|
|
204
|
+
ev.preventDefault();
|
|
205
|
+
this.open("previous");
|
|
206
|
+
}
|
|
207
|
+
break;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
componentWillLoad() {
|
|
211
|
+
if (!this.label) {
|
|
212
|
+
console.error("For accessibility purposes, this component requires a label (even if `label-position` is set to `none`).");
|
|
213
|
+
}
|
|
214
|
+
if (!this.multiple && this.selectedOptions.length === 0) {
|
|
215
|
+
console.error("wm-select should have one initial option selected");
|
|
216
|
+
}
|
|
217
|
+
if (document.body.classList.contains("wmcl-user-is-tabbing")) {
|
|
218
|
+
this.toggleTabbingOn();
|
|
219
|
+
}
|
|
220
|
+
handleDisabledAttribute(this.el, this.isDisabled);
|
|
221
|
+
const mutationObserver = new MutationObserver((mutationRecordList) => mutationRecordList.forEach((mutationRecord) => this.handleChildChange(mutationRecord)));
|
|
222
|
+
mutationObserver.observe(this.el, {
|
|
223
|
+
childList: true,
|
|
224
|
+
attributes: true,
|
|
225
|
+
subtree: true,
|
|
226
|
+
attributeFilter: ["selected"],
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
handleChildChange(_) {
|
|
230
|
+
// on update of children or children selected state, reset button text and rerender
|
|
231
|
+
this.setButtonText();
|
|
232
|
+
forceUpdate(this.el);
|
|
233
|
+
}
|
|
234
|
+
componentDidLoad() {
|
|
235
|
+
this.wmSelectDidLoad.emit();
|
|
236
|
+
this.dropdownEl.classList.add("hidden");
|
|
237
|
+
forceUpdate(this.el);
|
|
238
|
+
// Dev can overwrite the max-height rule set in the Sass file
|
|
239
|
+
if (this.maxHeight) {
|
|
240
|
+
this.listboxEl.style.maxHeight = this.maxHeight;
|
|
241
|
+
}
|
|
242
|
+
if (this.multiple) {
|
|
243
|
+
this.updateOptionVisibility();
|
|
244
|
+
}
|
|
245
|
+
this.setButtonText();
|
|
246
|
+
}
|
|
247
|
+
componentWillUpdate() {
|
|
248
|
+
if (this.multiple) {
|
|
249
|
+
// find last visible clone option and apply .last class
|
|
250
|
+
const visibleCloneOptions = this.visibleOptionEls.filter((option) => option.classList.contains("clone"));
|
|
251
|
+
visibleCloneOptions.forEach((option, idx) => {
|
|
252
|
+
if (idx === visibleCloneOptions.length - 1) {
|
|
253
|
+
option.classList.add("last");
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
option.classList.remove("last");
|
|
257
|
+
}
|
|
258
|
+
});
|
|
257
259
|
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
260
|
+
}
|
|
261
|
+
moveUp(el) {
|
|
262
|
+
const focusableEls = this.visibleOptionEls;
|
|
263
|
+
if (this.selectAllEl) {
|
|
264
|
+
focusableEls.unshift(this.selectAllEl);
|
|
265
|
+
}
|
|
266
|
+
if (this.searchFieldEl) {
|
|
267
|
+
focusableEls.unshift(this.searchFieldEl);
|
|
268
|
+
}
|
|
269
|
+
const prevEl = focusableEls[focusableEls.indexOf(el) - 1] || focusableEls[focusableEls.length - 1];
|
|
270
|
+
if (prevEl) {
|
|
271
|
+
this.focusOption(prevEl);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
moveDown(el) {
|
|
275
|
+
const focusableEls = this.visibleOptionEls;
|
|
276
|
+
if (this.selectAllEl) {
|
|
277
|
+
focusableEls.unshift(this.selectAllEl);
|
|
278
|
+
}
|
|
279
|
+
if (this.searchFieldEl) {
|
|
280
|
+
focusableEls.unshift(this.searchFieldEl);
|
|
281
|
+
}
|
|
282
|
+
const nextEl = focusableEls[focusableEls.indexOf(el) + 1] || focusableEls[0];
|
|
283
|
+
if (nextEl) {
|
|
284
|
+
this.focusOption(nextEl);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
open(optionToSelect) {
|
|
288
|
+
if (!this.isDisabled) {
|
|
289
|
+
const elHeight = this.el.clientHeight;
|
|
290
|
+
const buttonHeight = this.buttonEl.clientHeight;
|
|
291
|
+
this.openUp = shouldOpenUp(this.el, this.dropdownEl.clientHeight,
|
|
292
|
+
// when opening up, dropdown covers both label and button
|
|
293
|
+
elHeight,
|
|
294
|
+
// when opening down, dropdown covers only the button
|
|
295
|
+
buttonHeight);
|
|
296
|
+
this.isExpanded = true;
|
|
297
|
+
this.dropdownEl.classList.remove("hidden");
|
|
298
|
+
window.requestAnimationFrame(() => {
|
|
299
|
+
switch (optionToSelect) {
|
|
300
|
+
case "next":
|
|
301
|
+
// search variant focuses search field
|
|
302
|
+
// all others focus option "after" last selected option (this can be the first option)
|
|
303
|
+
if (this.search) {
|
|
304
|
+
this.searchFieldEl.focus();
|
|
305
|
+
this.listboxEl.scrollTop = 0;
|
|
306
|
+
}
|
|
307
|
+
else {
|
|
308
|
+
this.moveDown(this.visibleOptionEls.filter((x) => x.selected).slice(-1)[0]);
|
|
309
|
+
}
|
|
310
|
+
break;
|
|
311
|
+
case "previous":
|
|
312
|
+
// search variant focuses last option
|
|
313
|
+
// all others focus option "above" first selected option (this can be the last option)
|
|
314
|
+
if (this.search) {
|
|
315
|
+
this.focusOption(this.visibleOptionEls[this.visibleOptionEls.length - 1]);
|
|
316
|
+
}
|
|
317
|
+
else {
|
|
318
|
+
this.moveUp(this.visibleOptionEls.filter((x) => x.selected)[0]);
|
|
319
|
+
}
|
|
320
|
+
break;
|
|
321
|
+
default:
|
|
322
|
+
// search variant focuses search field
|
|
323
|
+
// all others focus the selected option
|
|
324
|
+
// if no option is selected (empty multiselect), focuses first option
|
|
325
|
+
if (this.search) {
|
|
326
|
+
this.searchFieldEl.focus();
|
|
327
|
+
this.listboxEl.scrollTop = 0;
|
|
328
|
+
}
|
|
329
|
+
else if (this.selectedOptions.length > 0) {
|
|
330
|
+
this.focusOption(this.visibleOptionEls.filter((x) => x.selected)[0]);
|
|
331
|
+
}
|
|
332
|
+
else {
|
|
333
|
+
this.focusOption(this.visibleOptionEls[0]);
|
|
334
|
+
}
|
|
335
|
+
break;
|
|
336
|
+
}
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
close(returnFocus = true) {
|
|
341
|
+
if (this.isExpanded) {
|
|
342
|
+
this.isExpanded = false;
|
|
343
|
+
this.allOptionEls.map((i) => (i.focused = false));
|
|
344
|
+
window.setTimeout(() => {
|
|
345
|
+
this.dropdownEl.classList.add("hidden");
|
|
346
|
+
if (this.multiple) {
|
|
347
|
+
this.updateOptionVisibility();
|
|
348
|
+
}
|
|
349
|
+
// clear search field, reset filtered / bolded state of wm-options
|
|
350
|
+
if (this.search) {
|
|
351
|
+
this.searchFieldEl.value = "";
|
|
352
|
+
this.wmSelectSearchChanged.emit({ searchTerm: this.searchTerm });
|
|
353
|
+
}
|
|
354
|
+
// Returns focus to button after popup closes (no need if user is tabbing)
|
|
355
|
+
// Delay is necessary for screenreader to get new expanded state before focus
|
|
356
|
+
// window.requestAnimationFrame is probably enough, but since we are already using setTimeout it may as well be here
|
|
357
|
+
// also UX wise, it makes sense for the button to only be focused after the animation is complete
|
|
358
|
+
if (returnFocus) {
|
|
359
|
+
this.buttonEl.focus();
|
|
360
|
+
}
|
|
361
|
+
}, 150);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
updateOptionVisibility() {
|
|
365
|
+
// this runs for search multiselects, where selected options are rendered at the top of the dropdown list
|
|
366
|
+
// slotted wm-options are hidden if selected, and clone wm-options are made visible if selected
|
|
367
|
+
this.childOptions.forEach((option, idx) => {
|
|
368
|
+
const cloneOption = this.cloneOptions[idx];
|
|
369
|
+
if (option.selected) {
|
|
370
|
+
option.classList.add("hidden");
|
|
371
|
+
cloneOption.classList.remove("hidden");
|
|
306
372
|
}
|
|
307
373
|
else {
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
break;
|
|
311
|
-
case "previous":
|
|
312
|
-
// search variant focuses last option
|
|
313
|
-
// all others focus option "above" first selected option (this can be the last option)
|
|
314
|
-
if (this.search) {
|
|
315
|
-
this.focusOption(this.visibleOptionEls[this.visibleOptionEls.length - 1]);
|
|
374
|
+
option.classList.remove("hidden");
|
|
375
|
+
cloneOption.classList.add("hidden");
|
|
316
376
|
}
|
|
317
|
-
|
|
318
|
-
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
focusOption(option) {
|
|
380
|
+
this.allOptionEls.forEach((i) => (i.focused = i === option));
|
|
381
|
+
// option must be scrolledIntoView before focused
|
|
382
|
+
// if focus is called first the option might be positioned incorrectly (in the center of the dropdown) and scrollIntoView will do nothing as the option will already be in view
|
|
383
|
+
option.scrollIntoView({ block: "nearest" });
|
|
384
|
+
// scrollIntoView does not work when the container of the element it's called on is not rendered to the page (in our case the dropdown is still closed and has transform: scaleY(0))
|
|
385
|
+
// when opening the dropdown, scrollIntoView must be delayed to a point where the browser recognizes content within it as able to be scrolled to
|
|
386
|
+
// in Safari in particular, the soonest this seems to happen is 20ms. The longest we can wait before any jumping in the open dropdown is noticeable is 60ms
|
|
387
|
+
window.setTimeout(() => option.scrollIntoView({ block: "nearest" }), 60);
|
|
388
|
+
option.focus();
|
|
389
|
+
}
|
|
390
|
+
findAndFocusOption(ev) {
|
|
391
|
+
const letterPressed = ev.detail.letter.toLowerCase();
|
|
392
|
+
const optionPressed = ev.detail.optionEl;
|
|
393
|
+
if (!this.keysSoFar && letterPressed == " ") {
|
|
394
|
+
// if the first key entered is space, treat as a click. Otherwise include in
|
|
395
|
+
optionPressed.click();
|
|
396
|
+
}
|
|
397
|
+
else {
|
|
398
|
+
if (!this.keysSoFar) {
|
|
399
|
+
// if first character entered, set currently focused option as the starting index for the search
|
|
400
|
+
this.visibleOptionEls.forEach((option, idx) => {
|
|
401
|
+
if (option.focused) {
|
|
402
|
+
this.searchIndex = idx;
|
|
403
|
+
}
|
|
404
|
+
});
|
|
319
405
|
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
if (this.search) {
|
|
326
|
-
this.searchFieldEl.focus();
|
|
327
|
-
this.listboxEl.scrollTop = 0;
|
|
406
|
+
this.keysSoFar += letterPressed;
|
|
407
|
+
let nextMatch = this.findMatchInRange(this.visibleOptionEls, this.searchIndex + 1, this.visibleOptionEls.length);
|
|
408
|
+
if (!nextMatch) {
|
|
409
|
+
// if match can't be found from starting option downwards, search from top
|
|
410
|
+
nextMatch = this.findMatchInRange(this.visibleOptionEls, 0, this.searchIndex);
|
|
328
411
|
}
|
|
329
|
-
|
|
330
|
-
|
|
412
|
+
if (nextMatch) {
|
|
413
|
+
// findMatchInRange still might have returned null, only focus if match found
|
|
414
|
+
this.focusOption(nextMatch);
|
|
331
415
|
}
|
|
332
|
-
|
|
333
|
-
|
|
416
|
+
this.debouncedClearKeysSoFar();
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
findMatchInRange(list, startIndex, endIndex) {
|
|
420
|
+
let match = null;
|
|
421
|
+
let optionsInRange = list.slice(startIndex, endIndex);
|
|
422
|
+
// Find the first option starting with the keysSoFar substring, searching in
|
|
423
|
+
// the specified range of options
|
|
424
|
+
optionsInRange.forEach((option) => {
|
|
425
|
+
const label = option.textContent;
|
|
426
|
+
if (!match && label && label.toLowerCase().startsWith(this.keysSoFar)) {
|
|
427
|
+
match = option;
|
|
334
428
|
}
|
|
335
|
-
|
|
429
|
+
});
|
|
430
|
+
return match;
|
|
431
|
+
}
|
|
432
|
+
findCorrespondingOption(el) {
|
|
433
|
+
// if clone, returns the child wm-option
|
|
434
|
+
// if child wm-option, returns clone
|
|
435
|
+
const isClone = el.classList.contains("clone");
|
|
436
|
+
return isClone
|
|
437
|
+
? this.childOptions[this.cloneOptions.indexOf(el)]
|
|
438
|
+
: this.cloneOptions[this.childOptions.indexOf(el)];
|
|
439
|
+
}
|
|
440
|
+
isElOrChild(el) {
|
|
441
|
+
var _a;
|
|
442
|
+
// determines whether or not the element is the component, a child of the component, or exists within the component's shadowroot
|
|
443
|
+
return el === this.el || this.el.contains(el) || ((_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.contains(el));
|
|
444
|
+
}
|
|
445
|
+
exposeErrors() {
|
|
446
|
+
// When the error changes, a new id is set for the error container and the button's aria-describedby attribute is updated accordingly. This is to make sure the screen reader announces teh updated errors in Firefox. See this longstanding bug: https://bugzilla.mozilla.org/show_bug.cgi?id=493683
|
|
447
|
+
const newId = generateId();
|
|
448
|
+
this.errorContainer.id = `wm-errors-${newId}`;
|
|
449
|
+
this.buttonEl.setAttribute("aria-describedby", `wm-errors-${newId}`);
|
|
450
|
+
}
|
|
451
|
+
handleDisabledChange() {
|
|
452
|
+
handleDisabledAttribute(this.el, this.isDisabled);
|
|
453
|
+
}
|
|
454
|
+
renderErrorContainer() {
|
|
455
|
+
return (h("div", { id: "wm-errors", class: this.errorMessage ? "error-message" : "", ref: (el) => (this.errorContainer = el), "aria-live": "assertive", "aria-atomic": "true" }, this.errorMessage));
|
|
456
|
+
}
|
|
457
|
+
handleComponentBlur(ev) {
|
|
458
|
+
// Do not close or emit custom blur event when blurring to an element inside (wm-option)
|
|
459
|
+
if (!this.el.contains(ev.relatedTarget)) {
|
|
460
|
+
this.close(false);
|
|
461
|
+
this.wmSelectBlurred.emit();
|
|
336
462
|
}
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
463
|
+
}
|
|
464
|
+
// on search field or select all. keydown on options is handled via events.
|
|
465
|
+
handleKeyDown(ev) {
|
|
466
|
+
const el = ev.target;
|
|
467
|
+
switch (ev.key) {
|
|
468
|
+
case "ArrowDown":
|
|
469
|
+
ev.preventDefault();
|
|
470
|
+
this.moveDown(ev.target);
|
|
471
|
+
break;
|
|
472
|
+
case "ArrowUp":
|
|
473
|
+
ev.preventDefault();
|
|
474
|
+
this.moveUp(ev.target);
|
|
475
|
+
break;
|
|
476
|
+
case "Escape":
|
|
477
|
+
ev.preventDefault();
|
|
478
|
+
this.close();
|
|
479
|
+
break;
|
|
480
|
+
case "Enter":
|
|
481
|
+
if (el === this.selectAllEl) {
|
|
482
|
+
ev.preventDefault();
|
|
483
|
+
this.handleSelectAllClick();
|
|
484
|
+
this.close();
|
|
485
|
+
}
|
|
486
|
+
break;
|
|
487
|
+
case " ":
|
|
488
|
+
if (el === this.selectAllEl) {
|
|
489
|
+
ev.preventDefault();
|
|
490
|
+
this.handleSelectAllClick();
|
|
491
|
+
}
|
|
492
|
+
break;
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
setButtonText() {
|
|
496
|
+
this.displayedOptions = this.childOptions
|
|
497
|
+
.filter((x) => x.selected)
|
|
498
|
+
.map((y) => (!y.classList.contains("hidden") ? y : this.findCorrespondingOption(y)));
|
|
499
|
+
// handle overflow + counter for multiselect
|
|
346
500
|
if (this.multiple) {
|
|
347
|
-
|
|
501
|
+
// this is a fixed measurement accounting for the max width of a 3 character overflow counter
|
|
502
|
+
const overflowCounterWidth = 38;
|
|
503
|
+
const computedStyle = window.getComputedStyle(this.buttonEl);
|
|
504
|
+
// there seems to be no quick way to get an elements width without padding, except for subtracting padding manually
|
|
505
|
+
const paddingLeft = parseInt(computedStyle.getPropertyValue("padding-left").slice(0, -2));
|
|
506
|
+
const paddingRight = parseInt(computedStyle.getPropertyValue("padding-right").slice(0, -2));
|
|
507
|
+
const availableSpace = this.buttonEl.clientWidth - paddingLeft - paddingRight - overflowCounterWidth;
|
|
508
|
+
let optionsWidths = this.displayedOptions.map((x) => x.shadowRoot.querySelector(".option-wrapper").clientWidth);
|
|
509
|
+
let optionsTotalWidth = optionsWidths.reduce((acc, x) => acc + x, 0);
|
|
510
|
+
this.overflowCount = 0;
|
|
511
|
+
while (optionsTotalWidth > availableSpace && this.displayedOptions.length > 1) {
|
|
512
|
+
this.overflowCount++;
|
|
513
|
+
optionsTotalWidth -= optionsWidths[optionsWidths.length - 1];
|
|
514
|
+
optionsWidths.pop();
|
|
515
|
+
this.displayedOptions.pop();
|
|
516
|
+
}
|
|
348
517
|
}
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
518
|
+
}
|
|
519
|
+
announce(message) {
|
|
520
|
+
// \u00A0 is a non-breaking space character, which causes the message to be read as a new one
|
|
521
|
+
if (this.liveRegionEl.textContent === message) {
|
|
522
|
+
message += "\u00A0";
|
|
353
523
|
}
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
this.buttonEl.focus();
|
|
524
|
+
this.announcement = message;
|
|
525
|
+
}
|
|
526
|
+
renderButtonText() {
|
|
527
|
+
if (this.multiple && this.displayedOptions.length < 1) {
|
|
528
|
+
return h("span", null, this.placeholder);
|
|
360
529
|
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
}
|
|
364
|
-
updateOptionVisibility() {
|
|
365
|
-
// this runs for search multiselects, where selected options are rendered at the top of the dropdown list
|
|
366
|
-
// slotted wm-options are hidden if selected, and clone wm-options are made visible if selected
|
|
367
|
-
this.childOptions.forEach((option, idx) => {
|
|
368
|
-
const cloneOption = this.cloneOptions[idx];
|
|
369
|
-
if (option.selected) {
|
|
370
|
-
option.classList.add("hidden");
|
|
371
|
-
cloneOption.classList.remove("hidden");
|
|
372
|
-
}
|
|
373
|
-
else {
|
|
374
|
-
option.classList.remove("hidden");
|
|
375
|
-
cloneOption.classList.add("hidden");
|
|
376
|
-
}
|
|
377
|
-
});
|
|
378
|
-
}
|
|
379
|
-
focusOption(option) {
|
|
380
|
-
this.allOptionEls.forEach((i) => (i.focused = i === option));
|
|
381
|
-
// option must be scrolledIntoView before focused
|
|
382
|
-
// if focus is called first the option might be positioned incorrectly (in the center of the dropdown) and scrollIntoView will do nothing as the option will already be in view
|
|
383
|
-
option.scrollIntoView({ block: "nearest" });
|
|
384
|
-
// scrollIntoView does not work when the container of the element it's called on is not rendered to the page (in our case the dropdown is still closed and has transform: scaleY(0))
|
|
385
|
-
// when opening the dropdown, scrollIntoView must be delayed to a point where the browser recognizes content within it as able to be scrolled to
|
|
386
|
-
// in Safari in particular, the soonest this seems to happen is 20ms. The longest we can wait before any jumping in the open dropdown is noticeable is 60ms
|
|
387
|
-
window.setTimeout(() => option.scrollIntoView({ block: "nearest" }), 60);
|
|
388
|
-
option.focus();
|
|
389
|
-
}
|
|
390
|
-
findAndFocusOption(ev) {
|
|
391
|
-
const letterPressed = ev.detail.letter.toLowerCase();
|
|
392
|
-
const optionPressed = ev.detail.optionEl;
|
|
393
|
-
if (!this.keysSoFar && letterPressed == " ") {
|
|
394
|
-
// if the first key entered is space, treat as a click. Otherwise include in
|
|
395
|
-
optionPressed.click();
|
|
396
|
-
}
|
|
397
|
-
else {
|
|
398
|
-
if (!this.keysSoFar) {
|
|
399
|
-
// if first character entered, set currently focused option as the starting index for the search
|
|
400
|
-
this.visibleOptionEls.forEach((option, idx) => {
|
|
401
|
-
if (option.focused) {
|
|
402
|
-
this.searchIndex = idx;
|
|
403
|
-
}
|
|
404
|
-
});
|
|
405
|
-
}
|
|
406
|
-
this.keysSoFar += letterPressed;
|
|
407
|
-
let nextMatch = this.findMatchInRange(this.visibleOptionEls, this.searchIndex + 1, this.visibleOptionEls.length);
|
|
408
|
-
if (!nextMatch) {
|
|
409
|
-
// if match can't be found from starting option downwards, search from top
|
|
410
|
-
nextMatch = this.findMatchInRange(this.visibleOptionEls, 0, this.searchIndex);
|
|
411
|
-
}
|
|
412
|
-
if (nextMatch) {
|
|
413
|
-
// findMatchInRange still might have returned null, only focus if match found
|
|
414
|
-
this.focusOption(nextMatch);
|
|
415
|
-
}
|
|
416
|
-
this.debouncedClearKeysSoFar();
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
findMatchInRange(list, startIndex, endIndex) {
|
|
420
|
-
let match = null;
|
|
421
|
-
let optionsInRange = list.slice(startIndex, endIndex);
|
|
422
|
-
// Find the first option starting with the keysSoFar substring, searching in
|
|
423
|
-
// the specified range of options
|
|
424
|
-
optionsInRange.forEach((option) => {
|
|
425
|
-
const label = option.textContent;
|
|
426
|
-
if (!match && label && label.toLowerCase().startsWith(this.keysSoFar)) {
|
|
427
|
-
match = option;
|
|
428
|
-
}
|
|
429
|
-
});
|
|
430
|
-
return match;
|
|
431
|
-
}
|
|
432
|
-
findCorrespondingOption(el) {
|
|
433
|
-
// if clone, returns the child wm-option
|
|
434
|
-
// if child wm-option, returns clone
|
|
435
|
-
const isClone = el.classList.contains("clone");
|
|
436
|
-
return isClone
|
|
437
|
-
? this.childOptions[this.cloneOptions.indexOf(el)]
|
|
438
|
-
: this.cloneOptions[this.childOptions.indexOf(el)];
|
|
439
|
-
}
|
|
440
|
-
isElOrChild(el) {
|
|
441
|
-
var _a;
|
|
442
|
-
// determines whether or not the element is the component, a child of the component, or exists within the component's shadowroot
|
|
443
|
-
return el === this.el || this.el.contains(el) || ((_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.contains(el));
|
|
444
|
-
}
|
|
445
|
-
exposeErrors() {
|
|
446
|
-
// When the error changes, a new id is set for the error container and the button's aria-describedby attribute is updated accordingly. This is to make sure the screen reader announces teh updated errors in Firefox. See this longstanding bug: https://bugzilla.mozilla.org/show_bug.cgi?id=493683
|
|
447
|
-
const newId = generateId();
|
|
448
|
-
this.errorContainer.id = `wm-errors-${newId}`;
|
|
449
|
-
this.buttonEl.setAttribute("aria-describedby", `wm-errors-${newId}`);
|
|
450
|
-
}
|
|
451
|
-
handleDisabledChange() {
|
|
452
|
-
handleDisabledAttribute(this.el, this.isDisabled);
|
|
453
|
-
}
|
|
454
|
-
renderErrorContainer() {
|
|
455
|
-
return (h("div", { id: "wm-errors", class: this.errorMessage ? "error-message" : "", ref: (el) => (this.errorContainer = el), "aria-live": "assertive", "aria-atomic": "true" }, this.errorMessage));
|
|
456
|
-
}
|
|
457
|
-
handleComponentBlur(ev) {
|
|
458
|
-
// Do not close or emit custom blur event when blurring to an element inside (wm-option)
|
|
459
|
-
if (!this.el.contains(ev.relatedTarget)) {
|
|
460
|
-
this.close(false);
|
|
461
|
-
this.wmSelectBlurred.emit();
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
// on search field or select all. keydown on options is handled via events.
|
|
465
|
-
handleKeyDown(ev) {
|
|
466
|
-
const el = ev.target;
|
|
467
|
-
switch (ev.key) {
|
|
468
|
-
case "ArrowDown":
|
|
469
|
-
ev.preventDefault();
|
|
470
|
-
this.moveDown(ev.target);
|
|
471
|
-
break;
|
|
472
|
-
case "ArrowUp":
|
|
473
|
-
ev.preventDefault();
|
|
474
|
-
this.moveUp(ev.target);
|
|
475
|
-
break;
|
|
476
|
-
case "Escape":
|
|
477
|
-
ev.preventDefault();
|
|
478
|
-
this.close();
|
|
479
|
-
break;
|
|
480
|
-
case "Enter":
|
|
481
|
-
if (el === this.selectAllEl) {
|
|
482
|
-
ev.preventDefault();
|
|
483
|
-
this.handleSelectAllClick();
|
|
484
|
-
this.close();
|
|
530
|
+
else if (this.multiple && this.allSelected && this.overflowCount > 0) {
|
|
531
|
+
return this.allSelectedMessage;
|
|
485
532
|
}
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
if (el === this.selectAllEl) {
|
|
489
|
-
ev.preventDefault();
|
|
490
|
-
this.handleSelectAllClick();
|
|
533
|
+
else {
|
|
534
|
+
return this.displayedOptions.map((x, idx) => (h("span", null, idx > 0 ? ", " : "", x.textContent)));
|
|
491
535
|
}
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
.filter((x) => x.selected)
|
|
498
|
-
.map((y) => (!y.classList.contains("hidden") ? y : this.findCorrespondingOption(y)));
|
|
499
|
-
// handle overflow + counter for multiselect
|
|
500
|
-
if (this.multiple) {
|
|
501
|
-
// this is a fixed measurement accounting for the max width of a 3 character overflow counter
|
|
502
|
-
const overflowCounterWidth = 38;
|
|
503
|
-
const computedStyle = window.getComputedStyle(this.buttonEl);
|
|
504
|
-
// there seems to be no quick way to get an elements width without padding, except for subtracting padding manually
|
|
505
|
-
const paddingLeft = parseInt(computedStyle.getPropertyValue("padding-left").slice(0, -2));
|
|
506
|
-
const paddingRight = parseInt(computedStyle.getPropertyValue("padding-right").slice(0, -2));
|
|
507
|
-
const availableSpace = this.buttonEl.clientWidth - paddingLeft - paddingRight - overflowCounterWidth;
|
|
508
|
-
let optionsWidths = this.displayedOptions.map((x) => x.shadowRoot.querySelector(".option-wrapper").clientWidth);
|
|
509
|
-
let optionsTotalWidth = optionsWidths.reduce((acc, x) => acc + x, 0);
|
|
510
|
-
this.overflowCount = 0;
|
|
511
|
-
while (optionsTotalWidth > availableSpace && this.displayedOptions.length > 1) {
|
|
512
|
-
this.overflowCount++;
|
|
513
|
-
optionsTotalWidth -= optionsWidths[optionsWidths.length - 1];
|
|
514
|
-
optionsWidths.pop();
|
|
515
|
-
this.displayedOptions.pop();
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
announce(message) {
|
|
520
|
-
// \u00A0 is a non-breaking space character, which causes the message to be read as a new one
|
|
521
|
-
if (this.liveRegionEl.textContent === message) {
|
|
522
|
-
message += "\u00A0";
|
|
523
|
-
}
|
|
524
|
-
this.announcement = message;
|
|
525
|
-
}
|
|
526
|
-
renderButtonText() {
|
|
527
|
-
if (this.multiple && this.displayedOptions.length < 1) {
|
|
528
|
-
return h("span", null, this.placeholder);
|
|
529
|
-
}
|
|
530
|
-
else if (this.multiple && this.allSelected && this.overflowCount > 0) {
|
|
531
|
-
return this.allSelectedMessage;
|
|
532
|
-
}
|
|
533
|
-
else {
|
|
534
|
-
return this.displayedOptions.map((x, idx) => (h("span", null, idx > 0 ? ", " : "", x.textContent)));
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
renderSubinfo() {
|
|
538
|
-
// multiselects cannot have subinfo for options
|
|
539
|
-
if (!this.multiple && this.selectedOptions.length > 0 && this.selectedOptions[0].subinfo) {
|
|
540
|
-
return h("span", { class: "subinfo" }, this.selectedOptions[0].subinfo);
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
renderOverflowCount() {
|
|
544
|
-
if (this.overflowCount > 0 && !this.allSelected) {
|
|
545
|
-
return (h("span", null, h("span", { class: "overflow-counter" }, "+", this.overflowCount)));
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
renderSearchField() {
|
|
549
|
-
return (h("div", { class: "search" }, h("div", { class: "searchfield-wrapper", ref: (el) => (this.searchFieldWrapperEl = el) }, h("div", { class: "icon" }), h("input", { ref: (el) => (this.searchFieldEl = el), class: "searchfield", role: "combobox", "aria-controls": "list", "aria-expanded": this.isExpanded ? "true" : "false", onKeyDown: (ev) => this.handleKeyDown(ev), onFocus: () => this.searchFieldWrapperEl.classList.add("focus"), onBlur: (ev) => this.handleSearchFieldBlur(ev), onInput: () => this.debouncedSearch(), placeholder: this.searchPlaceholder }))));
|
|
550
|
-
}
|
|
551
|
-
renderSearchFailedMessage() {
|
|
552
|
-
return h("div", { class: "search-results-message" }, this.noResultsFoundMessage);
|
|
553
|
-
}
|
|
554
|
-
renderSelectAllButton() {
|
|
555
|
-
return (h("button", { ref: (el) => (this.selectAllEl = el), class: "select-all", onClick: () => this.handleSelectAllClick(), onKeyDown: (ev) => this.handleKeyDown(ev), tabindex: "-1" }, this.allSelected ? this.deselectAllMessage : this.selectAllMessage));
|
|
556
|
-
}
|
|
557
|
-
renderCloneOptions() {
|
|
558
|
-
return Array.from(this.el.children).map((option) => {
|
|
559
|
-
return (h("wm-option", { class: "clone", selected: option.selected }, option.textContent));
|
|
560
|
-
});
|
|
561
|
-
}
|
|
562
|
-
render() {
|
|
563
|
-
const buttonProps = {
|
|
564
|
-
id: "selectbtn",
|
|
565
|
-
["disabled"]: this.isDisabled,
|
|
566
|
-
["aria-controls"]: "list",
|
|
567
|
-
["aria-labelledby"]: "label selectbtn",
|
|
568
|
-
["aria-describedby"]: "wm-errors",
|
|
569
|
-
["aria-expanded"]: this.isExpanded ? "true" : "false",
|
|
570
|
-
onClick: () => (this.isExpanded ? this.close() : this.open()),
|
|
571
|
-
};
|
|
572
|
-
return (h(Host, { onBlur: (ev) => this.handleComponentBlur(ev) }, h("div", { class: `wrapper ${getTextDir()} label-${this.labelPosition} ${this.errorMessage ? "invalid" : ""}` }, h("div", { class: "label-wrapper" }, h("label", { class: "label", id: "label", htmlFor: "selectbtn" }, this.label,
|
|
573
|
-
// we can't use aria-required or required attributes because it's invalid on the elements we're using (button controlling a listbox)
|
|
574
|
-
this.requiredField ? (h("span", { class: "required" }, h("span", { class: "sr-only" }, globalMessages.requiredField), h("span", { "aria-hidden": "true" }, "*"))) : (""))), h("div", { class: "button-wrapper" }, h("button", Object.assign({}, buttonProps, { class: `displayedoption ${this.isTabbing ? "user-is-tabbing" : ""}`, ref: (el) => (this.buttonEl = el), onBlur: (ev) => this.handleButtonBlur(ev), onFocus: () => this.close() }), h("span", { class: this.selectedOptions.length > 0 && this.selectedOptions.filter((x) => x.subinfo).length > 0
|
|
575
|
-
? "overflowcontrol hassubinfo"
|
|
576
|
-
: "overflowcontrol" }, h("span", { class: "button-text" }, this.renderButtonText()), this.renderSubinfo()), this.renderOverflowCount()), h("div", { class: `dropdown ${this.isExpanded ? "open" : ""} ${this.openUp ? "upwards" : ""}`, ref: (el) => (this.dropdownEl = el) }, this.search && this.renderSearchField(), this.visibleSelectAllButton && this.renderSelectAllButton(), h("div", { id: "list", class: "options-wrapper", tabindex: -1, role: "listbox", "aria-multiselectable": this.multiple ? "true" : null, "aria-labelledby": "label", ref: (el) => (this.listboxEl = el) }, this.search && this.filteredOptions.length === 0 && this.renderSearchFailedMessage(), this.multiple && this.renderCloneOptions(), h("slot", null))), this.renderErrorContainer(), h("div", { id: "announcement", "aria-live": "polite", class: "sr-only", ref: (el) => (this.liveRegionEl = el) }, this.announcement)))));
|
|
577
|
-
}
|
|
578
|
-
static get is() { return "wm-select"; }
|
|
579
|
-
static get encapsulation() { return "shadow"; }
|
|
580
|
-
static get delegatesFocus() { return true; }
|
|
581
|
-
static get originalStyleUrls() {
|
|
582
|
-
return {
|
|
583
|
-
"$": ["wm-select.scss"]
|
|
584
|
-
};
|
|
585
|
-
}
|
|
586
|
-
static get styleUrls() {
|
|
587
|
-
return {
|
|
588
|
-
"$": ["wm-select.css"]
|
|
589
|
-
};
|
|
590
|
-
}
|
|
591
|
-
static get properties() {
|
|
592
|
-
return {
|
|
593
|
-
"disabled": {
|
|
594
|
-
"type": "boolean",
|
|
595
|
-
"mutable": false,
|
|
596
|
-
"complexType": {
|
|
597
|
-
"original": "boolean",
|
|
598
|
-
"resolved": "boolean",
|
|
599
|
-
"references": {}
|
|
600
|
-
},
|
|
601
|
-
"required": false,
|
|
602
|
-
"optional": false,
|
|
603
|
-
"docs": {
|
|
604
|
-
"tags": [],
|
|
605
|
-
"text": ""
|
|
606
|
-
},
|
|
607
|
-
"attribute": "disabled",
|
|
608
|
-
"reflect": true,
|
|
609
|
-
"defaultValue": "false"
|
|
610
|
-
},
|
|
611
|
-
"maxHeight": {
|
|
612
|
-
"type": "string",
|
|
613
|
-
"mutable": false,
|
|
614
|
-
"complexType": {
|
|
615
|
-
"original": "string",
|
|
616
|
-
"resolved": "string | undefined",
|
|
617
|
-
"references": {}
|
|
618
|
-
},
|
|
619
|
-
"required": false,
|
|
620
|
-
"optional": true,
|
|
621
|
-
"docs": {
|
|
622
|
-
"tags": [],
|
|
623
|
-
"text": ""
|
|
624
|
-
},
|
|
625
|
-
"attribute": "max-height",
|
|
626
|
-
"reflect": false
|
|
627
|
-
},
|
|
628
|
-
"label": {
|
|
629
|
-
"type": "string",
|
|
630
|
-
"mutable": true,
|
|
631
|
-
"complexType": {
|
|
632
|
-
"original": "string",
|
|
633
|
-
"resolved": "string | undefined",
|
|
634
|
-
"references": {}
|
|
635
|
-
},
|
|
636
|
-
"required": false,
|
|
637
|
-
"optional": true,
|
|
638
|
-
"docs": {
|
|
639
|
-
"tags": [],
|
|
640
|
-
"text": ""
|
|
641
|
-
},
|
|
642
|
-
"attribute": "label",
|
|
643
|
-
"reflect": false
|
|
644
|
-
},
|
|
645
|
-
"labelPosition": {
|
|
646
|
-
"type": "string",
|
|
647
|
-
"mutable": false,
|
|
648
|
-
"complexType": {
|
|
649
|
-
"original": "\"top\" | \"left\" | \"none\"",
|
|
650
|
-
"resolved": "\"left\" | \"none\" | \"top\"",
|
|
651
|
-
"references": {}
|
|
652
|
-
},
|
|
653
|
-
"required": false,
|
|
654
|
-
"optional": false,
|
|
655
|
-
"docs": {
|
|
656
|
-
"tags": [],
|
|
657
|
-
"text": ""
|
|
658
|
-
},
|
|
659
|
-
"attribute": "label-position",
|
|
660
|
-
"reflect": false,
|
|
661
|
-
"defaultValue": "\"top\""
|
|
662
|
-
},
|
|
663
|
-
"requiredField": {
|
|
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": "required-field",
|
|
678
|
-
"reflect": false,
|
|
679
|
-
"defaultValue": "false"
|
|
680
|
-
},
|
|
681
|
-
"errorMessage": {
|
|
682
|
-
"type": "string",
|
|
683
|
-
"mutable": true,
|
|
684
|
-
"complexType": {
|
|
685
|
-
"original": "string",
|
|
686
|
-
"resolved": "string",
|
|
687
|
-
"references": {}
|
|
688
|
-
},
|
|
689
|
-
"required": false,
|
|
690
|
-
"optional": false,
|
|
691
|
-
"docs": {
|
|
692
|
-
"tags": [],
|
|
693
|
-
"text": ""
|
|
694
|
-
},
|
|
695
|
-
"attribute": "error-message",
|
|
696
|
-
"reflect": false,
|
|
697
|
-
"defaultValue": "\"\""
|
|
698
|
-
},
|
|
699
|
-
"multiple": {
|
|
700
|
-
"type": "boolean",
|
|
701
|
-
"mutable": false,
|
|
702
|
-
"complexType": {
|
|
703
|
-
"original": "boolean",
|
|
704
|
-
"resolved": "boolean",
|
|
705
|
-
"references": {}
|
|
706
|
-
},
|
|
707
|
-
"required": false,
|
|
708
|
-
"optional": false,
|
|
709
|
-
"docs": {
|
|
710
|
-
"tags": [],
|
|
711
|
-
"text": ""
|
|
712
|
-
},
|
|
713
|
-
"attribute": "multiple",
|
|
714
|
-
"reflect": false,
|
|
715
|
-
"defaultValue": "false"
|
|
716
|
-
},
|
|
717
|
-
"search": {
|
|
718
|
-
"type": "boolean",
|
|
719
|
-
"mutable": false,
|
|
720
|
-
"complexType": {
|
|
721
|
-
"original": "boolean",
|
|
722
|
-
"resolved": "boolean",
|
|
723
|
-
"references": {}
|
|
724
|
-
},
|
|
725
|
-
"required": false,
|
|
726
|
-
"optional": false,
|
|
727
|
-
"docs": {
|
|
728
|
-
"tags": [],
|
|
729
|
-
"text": ""
|
|
730
|
-
},
|
|
731
|
-
"attribute": "search",
|
|
732
|
-
"reflect": false,
|
|
733
|
-
"defaultValue": "false"
|
|
734
|
-
},
|
|
735
|
-
"selectAll": {
|
|
736
|
-
"type": "boolean",
|
|
737
|
-
"mutable": false,
|
|
738
|
-
"complexType": {
|
|
739
|
-
"original": "boolean",
|
|
740
|
-
"resolved": "boolean",
|
|
741
|
-
"references": {}
|
|
742
|
-
},
|
|
743
|
-
"required": false,
|
|
744
|
-
"optional": false,
|
|
745
|
-
"docs": {
|
|
746
|
-
"tags": [],
|
|
747
|
-
"text": ""
|
|
748
|
-
},
|
|
749
|
-
"attribute": "select-all",
|
|
750
|
-
"reflect": false,
|
|
751
|
-
"defaultValue": "false"
|
|
752
|
-
},
|
|
753
|
-
"placeholder": {
|
|
754
|
-
"type": "string",
|
|
755
|
-
"mutable": false,
|
|
756
|
-
"complexType": {
|
|
757
|
-
"original": "string",
|
|
758
|
-
"resolved": "string",
|
|
759
|
-
"references": {}
|
|
760
|
-
},
|
|
761
|
-
"required": false,
|
|
762
|
-
"optional": false,
|
|
763
|
-
"docs": {
|
|
764
|
-
"tags": [],
|
|
765
|
-
"text": ""
|
|
766
|
-
},
|
|
767
|
-
"attribute": "placeholder",
|
|
768
|
-
"reflect": false,
|
|
769
|
-
"defaultValue": "intl.formatMessage({\n id: \"select.multiPlaceholder\",\n defaultMessage: \"Make a selection\",\n description: \"Placeholder text. Use imperative\",\n })"
|
|
770
|
-
},
|
|
771
|
-
"searchPlaceholder": {
|
|
772
|
-
"type": "string",
|
|
773
|
-
"mutable": false,
|
|
774
|
-
"complexType": {
|
|
775
|
-
"original": "string",
|
|
776
|
-
"resolved": "string",
|
|
777
|
-
"references": {}
|
|
778
|
-
},
|
|
779
|
-
"required": false,
|
|
780
|
-
"optional": false,
|
|
781
|
-
"docs": {
|
|
782
|
-
"tags": [],
|
|
783
|
-
"text": ""
|
|
784
|
-
},
|
|
785
|
-
"attribute": "search-placeholder",
|
|
786
|
-
"reflect": false,
|
|
787
|
-
"defaultValue": "intl.formatMessage({\n id: \"select.searchPlaceholder\",\n defaultMessage: \"Search\",\n description: \"Placeholder text. Use imperative\",\n })"
|
|
788
|
-
},
|
|
789
|
-
"allSelectedMessage": {
|
|
790
|
-
"type": "string",
|
|
791
|
-
"mutable": false,
|
|
792
|
-
"complexType": {
|
|
793
|
-
"original": "string",
|
|
794
|
-
"resolved": "string",
|
|
795
|
-
"references": {}
|
|
796
|
-
},
|
|
797
|
-
"required": false,
|
|
798
|
-
"optional": false,
|
|
799
|
-
"docs": {
|
|
800
|
-
"tags": [],
|
|
801
|
-
"text": ""
|
|
802
|
-
},
|
|
803
|
-
"attribute": "all-selected-message",
|
|
804
|
-
"reflect": false,
|
|
805
|
-
"defaultValue": "intl.formatMessage({\n id: \"select.allSelected\",\n defaultMessage: \"All selected\",\n description: \"Text displayed when all options are selected\",\n })"
|
|
806
|
-
}
|
|
807
|
-
};
|
|
808
|
-
}
|
|
809
|
-
static get states() {
|
|
810
|
-
return {
|
|
811
|
-
"isTabbing": {},
|
|
812
|
-
"isExpanded": {},
|
|
813
|
-
"announcement": {}
|
|
814
|
-
};
|
|
815
|
-
}
|
|
816
|
-
static get events() {
|
|
817
|
-
return [{
|
|
818
|
-
"method": "wmSelectDidLoad",
|
|
819
|
-
"name": "wmSelectDidLoad",
|
|
820
|
-
"bubbles": true,
|
|
821
|
-
"cancelable": true,
|
|
822
|
-
"composed": true,
|
|
823
|
-
"docs": {
|
|
824
|
-
"tags": [],
|
|
825
|
-
"text": ""
|
|
826
|
-
},
|
|
827
|
-
"complexType": {
|
|
828
|
-
"original": "void",
|
|
829
|
-
"resolved": "void",
|
|
830
|
-
"references": {}
|
|
536
|
+
}
|
|
537
|
+
renderSubinfo() {
|
|
538
|
+
// multiselects cannot have subinfo for options
|
|
539
|
+
if (!this.multiple && this.selectedOptions.length > 0 && this.selectedOptions[0].subinfo) {
|
|
540
|
+
return h("span", { class: "subinfo" }, this.selectedOptions[0].subinfo);
|
|
831
541
|
}
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
"cancelable": true,
|
|
837
|
-
"composed": true,
|
|
838
|
-
"docs": {
|
|
839
|
-
"tags": [],
|
|
840
|
-
"text": ""
|
|
841
|
-
},
|
|
842
|
-
"complexType": {
|
|
843
|
-
"original": "void",
|
|
844
|
-
"resolved": "void",
|
|
845
|
-
"references": {}
|
|
542
|
+
}
|
|
543
|
+
renderOverflowCount() {
|
|
544
|
+
if (this.overflowCount > 0 && !this.allSelected) {
|
|
545
|
+
return (h("span", null, h("span", { class: "overflow-counter" }, "+", this.overflowCount)));
|
|
846
546
|
}
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
"
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
"
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
547
|
+
}
|
|
548
|
+
renderSearchField() {
|
|
549
|
+
return (h("div", { class: "search" }, h("div", { class: "searchfield-wrapper", ref: (el) => (this.searchFieldWrapperEl = el) }, h("div", { class: "icon" }), h("input", { ref: (el) => (this.searchFieldEl = el), class: "searchfield", role: "combobox", "aria-controls": "list", "aria-expanded": this.isExpanded ? "true" : "false", onKeyDown: (ev) => this.handleKeyDown(ev), onFocus: () => this.searchFieldWrapperEl.classList.add("focus"), onBlur: (ev) => this.handleSearchFieldBlur(ev), onInput: () => this.debouncedSearch(), placeholder: this.searchPlaceholder }))));
|
|
550
|
+
}
|
|
551
|
+
renderSearchFailedMessage() {
|
|
552
|
+
return h("div", { class: "search-results-message" }, this.noResultsFoundMessage);
|
|
553
|
+
}
|
|
554
|
+
renderSelectAllButton() {
|
|
555
|
+
return (h("button", { ref: (el) => (this.selectAllEl = el), class: "select-all", onClick: () => this.handleSelectAllClick(), onKeyDown: (ev) => this.handleKeyDown(ev), tabindex: "-1" }, this.allSelected ? this.deselectAllMessage : this.selectAllMessage));
|
|
556
|
+
}
|
|
557
|
+
renderCloneOptions() {
|
|
558
|
+
return Array.from(this.el.children).map((option) => {
|
|
559
|
+
return (h("wm-option", { class: "clone", selected: option.selected }, option.textContent));
|
|
560
|
+
});
|
|
561
|
+
}
|
|
562
|
+
render() {
|
|
563
|
+
const buttonProps = {
|
|
564
|
+
id: "selectbtn",
|
|
565
|
+
["disabled"]: this.isDisabled,
|
|
566
|
+
["aria-controls"]: "list",
|
|
567
|
+
["aria-labelledby"]: "label selectbtn",
|
|
568
|
+
["aria-describedby"]: "wm-errors",
|
|
569
|
+
["aria-expanded"]: this.isExpanded ? "true" : "false",
|
|
570
|
+
onClick: () => (this.isExpanded ? this.close() : this.open()),
|
|
571
|
+
};
|
|
572
|
+
return (h(Host, { onBlur: (ev) => this.handleComponentBlur(ev) }, h("div", { class: `wrapper ${getTextDir()} label-${this.labelPosition} ${this.errorMessage ? "invalid" : ""}` }, h("div", { class: "label-wrapper" }, h("label", { class: "label", id: "label", htmlFor: "selectbtn" }, this.label,
|
|
573
|
+
// we can't use aria-required or required attributes because it's invalid on the elements we're using (button controlling a listbox)
|
|
574
|
+
this.requiredField ? (h("span", { class: "required" }, h("span", { class: "sr-only" }, globalMessages.requiredField), h("span", { "aria-hidden": "true" }, "*"))) : (""))), h("div", { class: "button-wrapper" }, h("button", Object.assign({}, buttonProps, { class: `displayedoption ${this.isTabbing ? "user-is-tabbing" : ""}`, ref: (el) => (this.buttonEl = el), onBlur: (ev) => this.handleButtonBlur(ev), onFocus: () => this.close() }), h("span", { class: this.selectedOptions.length > 0 && this.selectedOptions.filter((x) => x.subinfo).length > 0
|
|
575
|
+
? "overflowcontrol hassubinfo"
|
|
576
|
+
: "overflowcontrol" }, h("span", { class: "button-text" }, this.renderButtonText()), this.renderSubinfo()), this.renderOverflowCount()), h("div", { class: `dropdown ${this.isExpanded ? "open" : ""} ${this.openUp ? "upwards" : ""}`, ref: (el) => (this.dropdownEl = el) }, this.search && this.renderSearchField(), this.visibleSelectAllButton && this.renderSelectAllButton(), h("div", { id: "list", class: "options-wrapper", tabindex: -1, role: "listbox", "aria-multiselectable": this.multiple ? "true" : null, "aria-labelledby": "label", ref: (el) => (this.listboxEl = el) }, this.search && this.filteredOptions.length === 0 && this.renderSearchFailedMessage(), this.multiple && this.renderCloneOptions(), h("slot", null))), this.renderErrorContainer(), h("div", { id: "announcement", "aria-live": "polite", class: "sr-only", ref: (el) => (this.liveRegionEl = el) }, this.announcement)))));
|
|
577
|
+
}
|
|
578
|
+
static get is() { return "wm-select"; }
|
|
579
|
+
static get encapsulation() { return "shadow"; }
|
|
580
|
+
static get delegatesFocus() { return true; }
|
|
581
|
+
static get originalStyleUrls() {
|
|
582
|
+
return {
|
|
583
|
+
"$": ["wm-select.scss"]
|
|
584
|
+
};
|
|
585
|
+
}
|
|
586
|
+
static get styleUrls() {
|
|
587
|
+
return {
|
|
588
|
+
"$": ["wm-select.css"]
|
|
589
|
+
};
|
|
590
|
+
}
|
|
591
|
+
static get properties() {
|
|
592
|
+
return {
|
|
593
|
+
"disabled": {
|
|
594
|
+
"type": "boolean",
|
|
595
|
+
"mutable": false,
|
|
596
|
+
"complexType": {
|
|
597
|
+
"original": "boolean",
|
|
598
|
+
"resolved": "boolean",
|
|
599
|
+
"references": {}
|
|
600
|
+
},
|
|
601
|
+
"required": false,
|
|
602
|
+
"optional": false,
|
|
603
|
+
"docs": {
|
|
604
|
+
"tags": [],
|
|
605
|
+
"text": ""
|
|
606
|
+
},
|
|
607
|
+
"attribute": "disabled",
|
|
608
|
+
"reflect": true,
|
|
609
|
+
"defaultValue": "false"
|
|
610
|
+
},
|
|
611
|
+
"maxHeight": {
|
|
612
|
+
"type": "string",
|
|
613
|
+
"mutable": false,
|
|
614
|
+
"complexType": {
|
|
615
|
+
"original": "string",
|
|
616
|
+
"resolved": "string | undefined",
|
|
617
|
+
"references": {}
|
|
618
|
+
},
|
|
619
|
+
"required": false,
|
|
620
|
+
"optional": true,
|
|
621
|
+
"docs": {
|
|
622
|
+
"tags": [],
|
|
623
|
+
"text": ""
|
|
624
|
+
},
|
|
625
|
+
"attribute": "max-height",
|
|
626
|
+
"reflect": false
|
|
627
|
+
},
|
|
628
|
+
"label": {
|
|
629
|
+
"type": "string",
|
|
630
|
+
"mutable": true,
|
|
631
|
+
"complexType": {
|
|
632
|
+
"original": "string",
|
|
633
|
+
"resolved": "string | undefined",
|
|
634
|
+
"references": {}
|
|
635
|
+
},
|
|
636
|
+
"required": false,
|
|
637
|
+
"optional": true,
|
|
638
|
+
"docs": {
|
|
639
|
+
"tags": [],
|
|
640
|
+
"text": ""
|
|
641
|
+
},
|
|
642
|
+
"attribute": "label",
|
|
643
|
+
"reflect": false
|
|
644
|
+
},
|
|
645
|
+
"labelPosition": {
|
|
646
|
+
"type": "string",
|
|
647
|
+
"mutable": false,
|
|
648
|
+
"complexType": {
|
|
649
|
+
"original": "\"top\" | \"left\" | \"none\"",
|
|
650
|
+
"resolved": "\"left\" | \"none\" | \"top\"",
|
|
651
|
+
"references": {}
|
|
652
|
+
},
|
|
653
|
+
"required": false,
|
|
654
|
+
"optional": false,
|
|
655
|
+
"docs": {
|
|
656
|
+
"tags": [],
|
|
657
|
+
"text": ""
|
|
658
|
+
},
|
|
659
|
+
"attribute": "label-position",
|
|
660
|
+
"reflect": false,
|
|
661
|
+
"defaultValue": "\"top\""
|
|
662
|
+
},
|
|
663
|
+
"requiredField": {
|
|
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": "required-field",
|
|
678
|
+
"reflect": false,
|
|
679
|
+
"defaultValue": "false"
|
|
680
|
+
},
|
|
681
|
+
"errorMessage": {
|
|
682
|
+
"type": "string",
|
|
683
|
+
"mutable": true,
|
|
684
|
+
"complexType": {
|
|
685
|
+
"original": "string",
|
|
686
|
+
"resolved": "string",
|
|
687
|
+
"references": {}
|
|
688
|
+
},
|
|
689
|
+
"required": false,
|
|
690
|
+
"optional": false,
|
|
691
|
+
"docs": {
|
|
692
|
+
"tags": [],
|
|
693
|
+
"text": ""
|
|
694
|
+
},
|
|
695
|
+
"attribute": "error-message",
|
|
696
|
+
"reflect": false,
|
|
697
|
+
"defaultValue": "\"\""
|
|
698
|
+
},
|
|
699
|
+
"multiple": {
|
|
700
|
+
"type": "boolean",
|
|
701
|
+
"mutable": false,
|
|
702
|
+
"complexType": {
|
|
703
|
+
"original": "boolean",
|
|
704
|
+
"resolved": "boolean",
|
|
705
|
+
"references": {}
|
|
706
|
+
},
|
|
707
|
+
"required": false,
|
|
708
|
+
"optional": false,
|
|
709
|
+
"docs": {
|
|
710
|
+
"tags": [],
|
|
711
|
+
"text": ""
|
|
712
|
+
},
|
|
713
|
+
"attribute": "multiple",
|
|
714
|
+
"reflect": false,
|
|
715
|
+
"defaultValue": "false"
|
|
716
|
+
},
|
|
717
|
+
"search": {
|
|
718
|
+
"type": "boolean",
|
|
719
|
+
"mutable": false,
|
|
720
|
+
"complexType": {
|
|
721
|
+
"original": "boolean",
|
|
722
|
+
"resolved": "boolean",
|
|
723
|
+
"references": {}
|
|
724
|
+
},
|
|
725
|
+
"required": false,
|
|
726
|
+
"optional": false,
|
|
727
|
+
"docs": {
|
|
728
|
+
"tags": [],
|
|
729
|
+
"text": ""
|
|
730
|
+
},
|
|
731
|
+
"attribute": "search",
|
|
732
|
+
"reflect": false,
|
|
733
|
+
"defaultValue": "false"
|
|
734
|
+
},
|
|
735
|
+
"selectAll": {
|
|
736
|
+
"type": "boolean",
|
|
737
|
+
"mutable": false,
|
|
738
|
+
"complexType": {
|
|
739
|
+
"original": "boolean",
|
|
740
|
+
"resolved": "boolean",
|
|
741
|
+
"references": {}
|
|
742
|
+
},
|
|
743
|
+
"required": false,
|
|
744
|
+
"optional": false,
|
|
745
|
+
"docs": {
|
|
746
|
+
"tags": [],
|
|
747
|
+
"text": ""
|
|
748
|
+
},
|
|
749
|
+
"attribute": "select-all",
|
|
750
|
+
"reflect": false,
|
|
751
|
+
"defaultValue": "false"
|
|
752
|
+
},
|
|
753
|
+
"placeholder": {
|
|
754
|
+
"type": "string",
|
|
755
|
+
"mutable": false,
|
|
756
|
+
"complexType": {
|
|
757
|
+
"original": "string",
|
|
758
|
+
"resolved": "string",
|
|
759
|
+
"references": {}
|
|
760
|
+
},
|
|
761
|
+
"required": false,
|
|
762
|
+
"optional": false,
|
|
763
|
+
"docs": {
|
|
764
|
+
"tags": [],
|
|
765
|
+
"text": ""
|
|
766
|
+
},
|
|
767
|
+
"attribute": "placeholder",
|
|
768
|
+
"reflect": false,
|
|
769
|
+
"defaultValue": "intl.formatMessage({\n id: \"select.multiPlaceholder\",\n defaultMessage: \"Make a selection\",\n description: \"Placeholder text. Use imperative\",\n })"
|
|
770
|
+
},
|
|
771
|
+
"searchPlaceholder": {
|
|
772
|
+
"type": "string",
|
|
773
|
+
"mutable": false,
|
|
774
|
+
"complexType": {
|
|
775
|
+
"original": "string",
|
|
776
|
+
"resolved": "string",
|
|
777
|
+
"references": {}
|
|
778
|
+
},
|
|
779
|
+
"required": false,
|
|
780
|
+
"optional": false,
|
|
781
|
+
"docs": {
|
|
782
|
+
"tags": [],
|
|
783
|
+
"text": ""
|
|
784
|
+
},
|
|
785
|
+
"attribute": "search-placeholder",
|
|
786
|
+
"reflect": false,
|
|
787
|
+
"defaultValue": "intl.formatMessage({\n id: \"select.searchPlaceholder\",\n defaultMessage: \"Search\",\n description: \"Placeholder text. Use imperative\",\n })"
|
|
788
|
+
},
|
|
789
|
+
"allSelectedMessage": {
|
|
790
|
+
"type": "string",
|
|
791
|
+
"mutable": false,
|
|
792
|
+
"complexType": {
|
|
793
|
+
"original": "string",
|
|
794
|
+
"resolved": "string",
|
|
795
|
+
"references": {}
|
|
796
|
+
},
|
|
797
|
+
"required": false,
|
|
798
|
+
"optional": false,
|
|
799
|
+
"docs": {
|
|
800
|
+
"tags": [],
|
|
801
|
+
"text": ""
|
|
802
|
+
},
|
|
803
|
+
"attribute": "all-selected-message",
|
|
804
|
+
"reflect": false,
|
|
805
|
+
"defaultValue": "intl.formatMessage({\n id: \"select.allSelected\",\n defaultMessage: \"All selected\",\n description: \"Text displayed when all options are selected\",\n })"
|
|
863
806
|
}
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
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
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
807
|
+
};
|
|
808
|
+
}
|
|
809
|
+
static get states() {
|
|
810
|
+
return {
|
|
811
|
+
"isTabbing": {},
|
|
812
|
+
"isExpanded": {},
|
|
813
|
+
"announcement": {}
|
|
814
|
+
};
|
|
815
|
+
}
|
|
816
|
+
static get events() {
|
|
817
|
+
return [{
|
|
818
|
+
"method": "wmSelectDidLoad",
|
|
819
|
+
"name": "wmSelectDidLoad",
|
|
820
|
+
"bubbles": true,
|
|
821
|
+
"cancelable": true,
|
|
822
|
+
"composed": true,
|
|
823
|
+
"docs": {
|
|
824
|
+
"tags": [],
|
|
825
|
+
"text": ""
|
|
826
|
+
},
|
|
827
|
+
"complexType": {
|
|
828
|
+
"original": "void",
|
|
829
|
+
"resolved": "void",
|
|
830
|
+
"references": {}
|
|
831
|
+
}
|
|
832
|
+
}, {
|
|
833
|
+
"method": "wmSelectBlurred",
|
|
834
|
+
"name": "wmSelectBlurred",
|
|
835
|
+
"bubbles": true,
|
|
836
|
+
"cancelable": true,
|
|
837
|
+
"composed": true,
|
|
838
|
+
"docs": {
|
|
839
|
+
"tags": [],
|
|
840
|
+
"text": ""
|
|
841
|
+
},
|
|
842
|
+
"complexType": {
|
|
843
|
+
"original": "void",
|
|
844
|
+
"resolved": "void",
|
|
845
|
+
"references": {}
|
|
846
|
+
}
|
|
847
|
+
}, {
|
|
848
|
+
"method": "wmSelectSearchChanged",
|
|
849
|
+
"name": "wmSelectSearchChanged",
|
|
850
|
+
"bubbles": true,
|
|
851
|
+
"cancelable": true,
|
|
852
|
+
"composed": true,
|
|
853
|
+
"docs": {
|
|
854
|
+
"tags": [],
|
|
855
|
+
"text": ""
|
|
856
|
+
},
|
|
857
|
+
"complexType": {
|
|
858
|
+
"original": "Object",
|
|
859
|
+
"resolved": "Object",
|
|
860
|
+
"references": {
|
|
861
|
+
"Object": {
|
|
862
|
+
"location": "global",
|
|
863
|
+
"id": "global::Object"
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
}, {
|
|
868
|
+
"method": "wmSelectAllSelected",
|
|
869
|
+
"name": "wmSelectAllSelected",
|
|
870
|
+
"bubbles": true,
|
|
871
|
+
"cancelable": true,
|
|
872
|
+
"composed": true,
|
|
873
|
+
"docs": {
|
|
874
|
+
"tags": [],
|
|
875
|
+
"text": ""
|
|
876
|
+
},
|
|
877
|
+
"complexType": {
|
|
878
|
+
"original": "any",
|
|
879
|
+
"resolved": "any",
|
|
880
|
+
"references": {}
|
|
881
|
+
}
|
|
882
|
+
}, {
|
|
883
|
+
"method": "wmSelectAllDeselected",
|
|
884
|
+
"name": "wmSelectAllDeselected",
|
|
885
|
+
"bubbles": true,
|
|
886
|
+
"cancelable": true,
|
|
887
|
+
"composed": true,
|
|
888
|
+
"docs": {
|
|
889
|
+
"tags": [],
|
|
890
|
+
"text": ""
|
|
891
|
+
},
|
|
892
|
+
"complexType": {
|
|
893
|
+
"original": "any",
|
|
894
|
+
"resolved": "any",
|
|
895
|
+
"references": {}
|
|
896
|
+
}
|
|
897
|
+
}];
|
|
898
|
+
}
|
|
899
|
+
static get elementRef() { return "el"; }
|
|
900
|
+
static get watchers() {
|
|
901
|
+
return [{
|
|
902
|
+
"propName": "errorMessage",
|
|
903
|
+
"methodName": "exposeErrors"
|
|
904
|
+
}, {
|
|
905
|
+
"propName": "disabled",
|
|
906
|
+
"methodName": "handleDisabledChange"
|
|
907
|
+
}];
|
|
908
|
+
}
|
|
909
|
+
static get listeners() {
|
|
910
|
+
return [{
|
|
911
|
+
"name": "wmUserIsTabbing",
|
|
912
|
+
"method": "toggleTabbingOn",
|
|
913
|
+
"target": "window",
|
|
914
|
+
"capture": false,
|
|
915
|
+
"passive": false
|
|
916
|
+
}, {
|
|
917
|
+
"name": "wmUserIsNotTabbing",
|
|
918
|
+
"method": "toggleTabbingOff",
|
|
919
|
+
"target": "window",
|
|
920
|
+
"capture": false,
|
|
921
|
+
"passive": false
|
|
922
|
+
}, {
|
|
923
|
+
"name": "wmOptionSelected",
|
|
924
|
+
"method": "handleOptionSelection",
|
|
925
|
+
"target": undefined,
|
|
926
|
+
"capture": false,
|
|
927
|
+
"passive": false
|
|
928
|
+
}, {
|
|
929
|
+
"name": "intCloneClicked",
|
|
930
|
+
"method": "handleOptionCloneSelection",
|
|
931
|
+
"target": undefined,
|
|
932
|
+
"capture": false,
|
|
933
|
+
"passive": false
|
|
934
|
+
}, {
|
|
935
|
+
"name": "wmEnterKeyPressed",
|
|
936
|
+
"method": "handleChildEnter",
|
|
937
|
+
"target": undefined,
|
|
938
|
+
"capture": false,
|
|
939
|
+
"passive": false
|
|
940
|
+
}, {
|
|
941
|
+
"name": "wmKeyUpPressed",
|
|
942
|
+
"method": "handleChildUp",
|
|
943
|
+
"target": undefined,
|
|
944
|
+
"capture": false,
|
|
945
|
+
"passive": false
|
|
946
|
+
}, {
|
|
947
|
+
"name": "wmKeyDownPressed",
|
|
948
|
+
"method": "handleChildDown",
|
|
949
|
+
"target": undefined,
|
|
950
|
+
"capture": false,
|
|
951
|
+
"passive": false
|
|
952
|
+
}, {
|
|
953
|
+
"name": "wmHomeKeyPressed",
|
|
954
|
+
"method": "moveToFirstOption",
|
|
955
|
+
"target": undefined,
|
|
956
|
+
"capture": false,
|
|
957
|
+
"passive": false
|
|
958
|
+
}, {
|
|
959
|
+
"name": "wmEndKeyPressed",
|
|
960
|
+
"method": "moveToLastOption",
|
|
961
|
+
"target": undefined,
|
|
962
|
+
"capture": false,
|
|
963
|
+
"passive": false
|
|
964
|
+
}, {
|
|
965
|
+
"name": "wmEscKeyPressed",
|
|
966
|
+
"method": "closePopupOnEscape",
|
|
967
|
+
"target": undefined,
|
|
968
|
+
"capture": false,
|
|
969
|
+
"passive": false
|
|
970
|
+
}, {
|
|
971
|
+
"name": "wmOptionBlurred",
|
|
972
|
+
"method": "handleOptionBlur",
|
|
973
|
+
"target": undefined,
|
|
974
|
+
"capture": false,
|
|
975
|
+
"passive": false
|
|
976
|
+
}, {
|
|
977
|
+
"name": "click",
|
|
978
|
+
"method": "handleClick",
|
|
979
|
+
"target": "document",
|
|
980
|
+
"capture": true,
|
|
981
|
+
"passive": false
|
|
982
|
+
}, {
|
|
983
|
+
"name": "keydown",
|
|
984
|
+
"method": "handleKey",
|
|
985
|
+
"target": undefined,
|
|
986
|
+
"capture": false,
|
|
987
|
+
"passive": false
|
|
988
|
+
}, {
|
|
989
|
+
"name": "wmLetterPressed",
|
|
990
|
+
"method": "findAndFocusOption",
|
|
991
|
+
"target": undefined,
|
|
992
|
+
"capture": false,
|
|
993
|
+
"passive": false
|
|
994
|
+
}];
|
|
995
|
+
}
|
|
995
996
|
}
|