@watermarkinsights/ripple 4.3.0 → 4.4.0-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/chartFunctions-cecf8134.js +600 -0
- package/dist/cjs/{functions-91da05e9.js → functions-4208c444.js} +362 -362
- package/dist/cjs/{global-20d48c6c.js → global-bd289a67.js} +24 -24
- package/dist/cjs/{index-fae02cd7.js → index-f8ef86de.js} +436 -150
- package/dist/cjs/interfaces-ad9e80a6.js +38 -0
- package/dist/cjs/intl-3fafc6d1.js +179 -0
- package/dist/cjs/loader.cjs.js +4 -13
- package/dist/cjs/priv-chart-popover.cjs.entry.js +85 -85
- package/dist/cjs/priv-datepicker.cjs.entry.js +637 -637
- package/dist/cjs/priv-navigator-button.cjs.entry.js +18 -18
- package/dist/cjs/priv-navigator-item.cjs.entry.js +21 -21
- package/dist/cjs/ripple.cjs.js +4 -7
- package/dist/cjs/wm-action-menu_2.cjs.entry.js +314 -314
- package/dist/cjs/wm-button.cjs.entry.js +174 -174
- package/dist/cjs/wm-chart-slice.cjs.entry.js +17 -17
- package/dist/cjs/wm-chart.cjs.entry.js +164 -164
- package/dist/cjs/wm-datepicker.cjs.entry.js +160 -160
- package/dist/cjs/wm-file-list.cjs.entry.js +10 -10
- package/dist/cjs/wm-file.cjs.entry.js +178 -178
- package/dist/cjs/wm-input.cjs.entry.js +102 -102
- package/dist/cjs/wm-line-chart.cjs.entry.js +462 -462
- package/dist/cjs/wm-modal-footer.cjs.entry.js +27 -27
- package/dist/cjs/wm-modal-header.cjs.entry.js +21 -21
- package/dist/cjs/wm-modal.cjs.entry.js +92 -92
- package/dist/cjs/wm-navigation_3.cjs.entry.js +179 -179
- package/dist/cjs/wm-navigator.cjs.entry.js +255 -251
- package/dist/cjs/wm-option_2.cjs.entry.js +710 -710
- package/dist/cjs/wm-pagination.cjs.entry.js +169 -169
- package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +151 -151
- package/dist/cjs/wm-search.cjs.entry.js +192 -192
- package/dist/cjs/wm-snackbar.cjs.entry.js +114 -114
- package/dist/cjs/wm-tab-item_3.cjs.entry.js +247 -247
- package/dist/cjs/wm-tag-input.cjs.entry.js +849 -849
- package/dist/cjs/wm-tag-option.cjs.entry.js +33 -33
- package/dist/cjs/wm-timepicker.cjs.entry.js +270 -270
- package/dist/cjs/wm-toggletip.cjs.entry.js +99 -99
- package/dist/cjs/wm-uploader.cjs.entry.js +198 -198
- package/dist/cjs/wm-wrapper.cjs.entry.js +12 -12
- package/dist/collection/collection-manifest.json +41 -41
- package/dist/collection/components/charts/chartFunctions.js +456 -456
- package/dist/collection/components/charts/chartFunctions.spec.js +13 -13
- package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.e2e.js +73 -73
- package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.js +257 -254
- package/dist/collection/components/charts/screenshots.e2e.js +30 -30
- package/dist/collection/components/charts/wm-chart/wm-chart-slice.js +121 -121
- package/dist/collection/components/charts/wm-chart/wm-chart.e2e.js +160 -160
- package/dist/collection/components/charts/wm-chart/wm-chart.js +382 -381
- package/dist/collection/components/charts/wm-chart/wm-chart.spec.js +26 -26
- package/dist/collection/components/charts/wm-line-chart/wm-line-chart.css +1 -2
- package/dist/collection/components/charts/wm-line-chart/wm-line-chart.e2e.js +138 -138
- package/dist/collection/components/charts/wm-line-chart/wm-line-chart.js +731 -731
- package/dist/collection/components/charts/wm-line-chart/wm-line-chart.spec.js +106 -106
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.js +202 -202
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.e2e.js +54 -54
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.js +136 -136
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.spec.js +31 -31
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-slice.js +119 -119
- package/dist/collection/components/wm-action-menu/wm-action-menu.e2e.js +187 -187
- package/dist/collection/components/wm-action-menu/wm-action-menu.js +435 -435
- package/dist/collection/components/wm-action-menu/wm-action-menu.spec.js +35 -35
- package/dist/collection/components/wm-button/wm-button.e2e.js +58 -58
- package/dist/collection/components/wm-button/wm-button.js +454 -452
- package/dist/collection/components/wm-button/wm-button.spec.js +63 -63
- package/dist/collection/components/wm-datepicker/priv-datepicker/priv-datepicker.js +943 -939
- package/dist/collection/components/wm-datepicker/priv-datepicker/priv-datepicker.spec.js +71 -71
- package/dist/collection/components/wm-datepicker/wm-datepicker.css +1 -2
- package/dist/collection/components/wm-datepicker/wm-datepicker.e2e.js +359 -359
- package/dist/collection/components/wm-datepicker/wm-datepicker.js +415 -413
- package/dist/collection/components/wm-datepicker/wm-datepicker.spec.js +13 -13
- package/dist/collection/components/wm-file/wm-file.js +380 -380
- package/dist/collection/components/wm-file/wm-file.spec.js +107 -107
- package/dist/collection/components/wm-file-list/wm-file-list.js +42 -42
- package/dist/collection/components/wm-file-list/wm-file-list.spec.js +47 -47
- package/dist/collection/components/wm-input/wm-input.e2e.js +26 -26
- package/dist/collection/components/wm-input/wm-input.js +453 -453
- package/dist/collection/components/wm-input/wm-input.spec.js +168 -168
- package/dist/collection/components/wm-menuitem/wm-menuitem.e2e.js +18 -18
- package/dist/collection/components/wm-menuitem/wm-menuitem.js +446 -436
- package/dist/collection/components/wm-menuitem/wm-menuitem.spec.js +46 -46
- package/dist/collection/components/wm-modal/wm-modal-footer.js +130 -130
- package/dist/collection/components/wm-modal/wm-modal-footer.spec.js +8 -8
- package/dist/collection/components/wm-modal/wm-modal-header.js +68 -68
- package/dist/collection/components/wm-modal/wm-modal-header.spec.js +5 -5
- package/dist/collection/components/wm-modal/wm-modal.e2e.js +65 -65
- package/dist/collection/components/wm-modal/wm-modal.js +299 -296
- package/dist/collection/components/wm-modal/wm-modal.spec.js +22 -22
- package/dist/collection/components/wm-navigation/wm-navigation-hamburger.css +0 -1
- package/dist/collection/components/wm-navigation/wm-navigation-hamburger.js +112 -112
- package/dist/collection/components/wm-navigation/wm-navigation-item.js +125 -125
- package/dist/collection/components/wm-navigation/wm-navigation.css +0 -2
- package/dist/collection/components/wm-navigation/wm-navigation.e2e.js +86 -86
- package/dist/collection/components/wm-navigation/wm-navigation.js +209 -209
- package/dist/collection/components/wm-navigation/wm-navigation.spec.js +79 -79
- package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.e2e.js +30 -30
- package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.js +103 -103
- package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.js +119 -118
- package/dist/collection/components/wm-navigator/wm-navigator.e2e.js +180 -180
- package/dist/collection/components/wm-navigator/wm-navigator.js +458 -454
- package/dist/collection/components/wm-navigator/wm-navigator.spec.js +153 -153
- package/dist/collection/components/wm-option/wm-option.e2e.js +19 -19
- package/dist/collection/components/wm-option/wm-option.js +474 -463
- package/dist/collection/components/wm-option/wm-option.spec.js +39 -39
- package/dist/collection/components/wm-pagination/wm-pagination.e2e.js +301 -301
- package/dist/collection/components/wm-pagination/wm-pagination.js +327 -327
- package/dist/collection/components/wm-search/wm-search.e2e.js +69 -69
- package/dist/collection/components/wm-search/wm-search.js +415 -414
- package/dist/collection/components/wm-search/wm-search.spec.js +64 -64
- package/dist/collection/components/wm-select/wm-select.e2e.js +443 -443
- package/dist/collection/components/wm-select/wm-select.js +967 -966
- package/dist/collection/components/wm-select/wm-select.spec.js +250 -250
- package/dist/collection/components/wm-snackbar/wm-snackbar.e2e.js +114 -114
- package/dist/collection/components/wm-snackbar/wm-snackbar.js +209 -207
- package/dist/collection/components/wm-snackbar/wm-snackbar.spec.js +4 -4
- package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.js +190 -188
- package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.js +261 -261
- package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.js +104 -104
- package/dist/collection/components/wm-tabs/wm-tabs.e2e.js +79 -79
- package/dist/collection/components/wm-tabs/wm-tabs.spec.js +6 -6
- package/dist/collection/components/wm-tag-input/wm-tag-input.css +2 -4
- package/dist/collection/components/wm-tag-input/wm-tag-input.e2e.js +168 -168
- package/dist/collection/components/wm-tag-input/wm-tag-input.js +1159 -1159
- package/dist/collection/components/wm-tag-input/wm-tag-input.spec.js +147 -147
- package/dist/collection/components/wm-tag-input/wm-tag-option/wm-tag-option.js +236 -234
- package/dist/collection/components/wm-timepicker/wm-timepicker.css +1 -2
- package/dist/collection/components/wm-timepicker/wm-timepicker.e2e.js +147 -147
- package/dist/collection/components/wm-timepicker/wm-timepicker.js +531 -527
- package/dist/collection/components/wm-timepicker/wm-timepicker.spec.js +151 -151
- package/dist/collection/components/wm-toggletip/wm-toggletip.e2e.js +61 -61
- package/dist/collection/components/wm-toggletip/wm-toggletip.js +209 -208
- package/dist/collection/components/wm-toggletip/wm-toggletip.spec.js +16 -16
- package/dist/collection/components/wm-uploader/wm-uploader.e2e.js +56 -56
- package/dist/collection/components/wm-uploader/wm-uploader.js +423 -422
- package/dist/collection/components/wm-uploader/wm-uploader.spec.js +149 -149
- package/dist/collection/components/wm-wrapper/wm-wrapper.js +26 -26
- package/dist/collection/global/__mocks__/functions.js +1 -1
- package/dist/collection/global/functions.js +510 -510
- package/dist/collection/global/functions.spec.js +123 -123
- package/dist/collection/global/global.js +16 -16
- package/dist/collection/global/interfaces.js +39 -39
- package/dist/collection/global/intl.js +162 -162
- package/dist/collection/global/services/__mocks__/http-service.js +112 -112
- package/dist/collection/global/services/http-service.js +41 -41
- package/dist/collection/global/themes/default.js +4 -4
- package/dist/collection/global/themes/neutral.js +4 -4
- package/dist/collection/lang/lang.spec.js +13 -13
- package/dist/esm/chartFunctions-23173fce.js +584 -0
- package/dist/esm/{functions-5afd09f4.js → functions-d0e70094.js} +362 -362
- package/dist/esm/{global-d4a9e80e.js → global-4569c7b8.js} +24 -24
- package/dist/esm/{index-7e11ea42.js → index-f164fbca.js} +436 -150
- package/dist/esm/interfaces-9b75fb61.js +35 -0
- package/dist/esm/intl-05c9e0c9.js +174 -0
- package/dist/esm/loader.js +5 -14
- package/dist/esm/priv-chart-popover.entry.js +85 -85
- package/dist/esm/priv-datepicker.entry.js +637 -637
- package/dist/esm/priv-navigator-button.entry.js +18 -18
- package/dist/esm/priv-navigator-item.entry.js +21 -21
- package/dist/esm/ripple.js +5 -8
- package/dist/esm/wm-action-menu_2.entry.js +314 -314
- package/dist/esm/wm-button.entry.js +174 -174
- package/dist/esm/wm-chart-slice.entry.js +17 -17
- package/dist/esm/wm-chart.entry.js +164 -164
- package/dist/esm/wm-datepicker.entry.js +160 -160
- package/dist/esm/wm-file-list.entry.js +10 -10
- package/dist/esm/wm-file.entry.js +178 -178
- package/dist/esm/wm-input.entry.js +102 -102
- package/dist/esm/wm-line-chart.entry.js +462 -462
- package/dist/esm/wm-modal-footer.entry.js +27 -27
- package/dist/esm/wm-modal-header.entry.js +21 -21
- package/dist/esm/wm-modal.entry.js +92 -92
- package/dist/esm/wm-navigation_3.entry.js +179 -179
- package/dist/esm/wm-navigator.entry.js +255 -251
- package/dist/esm/wm-option_2.entry.js +710 -710
- package/dist/esm/wm-pagination.entry.js +169 -169
- package/dist/esm/wm-progress-indicator_3.entry.js +151 -151
- package/dist/esm/wm-search.entry.js +192 -192
- package/dist/esm/wm-snackbar.entry.js +114 -114
- package/dist/esm/wm-tab-item_3.entry.js +247 -247
- package/dist/esm/wm-tag-input.entry.js +849 -849
- package/dist/esm/wm-tag-option.entry.js +33 -33
- package/dist/esm/wm-timepicker.entry.js +270 -270
- package/dist/esm/wm-toggletip.entry.js +99 -99
- package/dist/esm/wm-uploader.entry.js +198 -198
- package/dist/esm/wm-wrapper.entry.js +12 -12
- package/dist/esm-es5/chartFunctions-23173fce.js +1 -0
- package/dist/esm-es5/functions-d0e70094.js +1 -0
- package/dist/esm-es5/global-4569c7b8.js +1 -0
- package/dist/esm-es5/index-f164fbca.js +2 -0
- package/dist/esm-es5/{intl-e2da750a.js → intl-05c9e0c9.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/priv-chart-popover.entry.js +1 -1
- package/dist/esm-es5/priv-datepicker.entry.js +1 -1
- package/dist/esm-es5/priv-navigator-button.entry.js +1 -1
- package/dist/esm-es5/priv-navigator-item.entry.js +1 -1
- package/dist/esm-es5/ripple.js +1 -1
- package/dist/esm-es5/wm-action-menu_2.entry.js +1 -1
- package/dist/esm-es5/wm-button.entry.js +1 -1
- package/dist/esm-es5/wm-chart-slice.entry.js +1 -1
- package/dist/esm-es5/wm-chart.entry.js +1 -1
- package/dist/esm-es5/wm-datepicker.entry.js +1 -1
- package/dist/esm-es5/wm-file-list.entry.js +1 -1
- package/dist/esm-es5/wm-file.entry.js +1 -1
- package/dist/esm-es5/wm-input.entry.js +1 -1
- package/dist/esm-es5/wm-line-chart.entry.js +1 -1
- package/dist/esm-es5/wm-modal-footer.entry.js +1 -1
- package/dist/esm-es5/wm-modal-header.entry.js +1 -1
- package/dist/esm-es5/wm-modal.entry.js +1 -1
- package/dist/esm-es5/wm-navigation_3.entry.js +1 -1
- package/dist/esm-es5/wm-navigator.entry.js +1 -1
- package/dist/esm-es5/wm-option_2.entry.js +1 -1
- package/dist/esm-es5/wm-pagination.entry.js +1 -1
- package/dist/esm-es5/wm-progress-indicator_3.entry.js +1 -1
- package/dist/esm-es5/wm-search.entry.js +1 -1
- package/dist/esm-es5/wm-snackbar.entry.js +1 -1
- package/dist/esm-es5/wm-tab-item_3.entry.js +1 -1
- package/dist/esm-es5/wm-tag-input.entry.js +1 -1
- package/dist/esm-es5/wm-tag-option.entry.js +1 -1
- package/dist/esm-es5/wm-timepicker.entry.js +1 -1
- package/dist/esm-es5/wm-toggletip.entry.js +1 -1
- package/dist/esm-es5/wm-uploader.entry.js +1 -1
- package/dist/esm-es5/wm-wrapper.entry.js +1 -1
- package/dist/loader/index.d.ts +1 -1
- package/dist/ripple/p-028ef6db.system.entry.js +1 -0
- package/dist/ripple/{p-863e737a.js → p-05d4e49b.js} +1 -1
- package/dist/ripple/{p-a1e95b05.system.entry.js → p-06776596.system.entry.js} +1 -1
- package/dist/ripple/{p-622a7791.system.entry.js → p-067d7922.system.entry.js} +1 -1
- package/dist/ripple/p-09d62ddd.entry.js +1 -0
- package/dist/ripple/{p-f30839a1.system.entry.js → p-0ecbf569.system.entry.js} +1 -1
- package/dist/ripple/p-0fe97e85.system.js +2 -0
- package/dist/ripple/{p-24b08e1f.js → p-13ca30d8.js} +1 -1
- package/dist/ripple/{p-8f3f903f.system.js → p-1402cfa2.system.js} +1 -1
- package/dist/ripple/p-1453ea51.system.entry.js +1 -0
- package/dist/ripple/{p-6abb903c.entry.js → p-153701f9.entry.js} +1 -1
- package/dist/ripple/p-1cc91907.system.js +1 -0
- package/dist/ripple/{p-ad37cdfd.entry.js → p-1d8b0039.entry.js} +1 -1
- package/dist/ripple/{p-d0f1b8c4.system.entry.js → p-1fa2a756.system.entry.js} +1 -1
- package/dist/ripple/{p-a52c5a1c.entry.js → p-25446670.entry.js} +1 -1
- package/dist/ripple/{p-1283e85d.entry.js → p-27f47edc.entry.js} +1 -1
- package/dist/ripple/{p-32b1126c.system.entry.js → p-28e4583c.system.entry.js} +1 -1
- package/dist/ripple/{p-a5b23781.system.entry.js → p-2c4f312d.system.entry.js} +1 -1
- package/dist/ripple/p-30b17818.system.entry.js +1 -0
- package/dist/ripple/{p-0631be01.system.entry.js → p-3446852f.system.entry.js} +1 -1
- package/dist/ripple/{p-ae674a54.entry.js → p-350fe5da.entry.js} +1 -1
- package/dist/ripple/{p-d04ba5f8.system.entry.js → p-3583d113.system.entry.js} +1 -1
- package/dist/ripple/{p-cbd8a60b.system.entry.js → p-361cc8fc.system.entry.js} +1 -1
- package/dist/ripple/{p-7529706d.entry.js → p-372faf33.entry.js} +1 -1
- package/dist/ripple/{p-19773c40.entry.js → p-3a070f35.entry.js} +1 -1
- package/dist/ripple/{p-c7b5ac39.js → p-3af72848.js} +1 -1
- package/dist/ripple/{p-c41603e6.entry.js → p-42ebfcfa.entry.js} +1 -1
- package/dist/ripple/{p-13594c2e.entry.js → p-43e2a49a.entry.js} +1 -1
- package/dist/ripple/{p-ed942b42.entry.js → p-49118468.entry.js} +1 -1
- package/dist/ripple/p-49c85d1a.system.js +1 -0
- package/dist/ripple/p-4de51706.js +2 -0
- package/dist/ripple/{p-3c80bf67.entry.js → p-58174f4e.entry.js} +1 -1
- package/dist/ripple/{p-c5e8f8a5.system.entry.js → p-5a4d9897.system.entry.js} +1 -1
- package/dist/ripple/{p-e3f0b57f.system.entry.js → p-5ac980e2.system.entry.js} +1 -1
- package/dist/ripple/{p-3becce62.system.entry.js → p-633cd89a.system.entry.js} +1 -1
- package/dist/ripple/{p-1205fdc1.entry.js → p-63f75d43.entry.js} +1 -1
- package/dist/ripple/{p-90ea7e3a.system.entry.js → p-67d48c33.system.entry.js} +1 -1
- package/dist/ripple/{p-8ef87907.entry.js → p-6caaf85f.entry.js} +1 -1
- package/dist/ripple/{p-935513f8.entry.js → p-6cf7a34a.entry.js} +1 -1
- package/dist/ripple/p-73289c2c.system.js +1 -0
- package/dist/ripple/{p-c76bbedf.system.entry.js → p-7a8816d9.system.entry.js} +1 -1
- package/dist/ripple/{p-8ea68cb3.system.entry.js → p-7e56da2e.system.entry.js} +1 -1
- package/dist/ripple/{p-deb4f5a2.entry.js → p-7e8daaac.entry.js} +1 -1
- package/dist/ripple/p-88406560.system.entry.js +1 -0
- package/dist/ripple/{p-84a7e757.entry.js → p-8cace32f.entry.js} +1 -1
- package/dist/ripple/{p-80aef387.entry.js → p-8d4734ad.entry.js} +1 -1
- package/dist/ripple/p-8f76a838.system.entry.js +1 -0
- package/dist/ripple/p-934c1b6b.js +1 -0
- package/dist/ripple/{p-85f744ed.system.js → p-9fecbc8a.system.js} +1 -1
- package/dist/ripple/{p-b71a83e3.entry.js → p-a69c37e0.entry.js} +1 -1
- package/dist/ripple/{p-9288659b.entry.js → p-a82a8931.entry.js} +1 -1
- package/dist/ripple/p-a99b05de.system.entry.js +1 -0
- package/dist/ripple/{p-36049d2f.entry.js → p-aadf8c59.entry.js} +1 -1
- package/dist/ripple/{p-676c1089.system.entry.js → p-aba5a00e.system.entry.js} +1 -1
- package/dist/ripple/{p-0aecac86.entry.js → p-ad6dc751.entry.js} +1 -1
- package/dist/ripple/{p-0f1ff645.entry.js → p-b253d2fc.entry.js} +1 -1
- package/dist/ripple/p-b2ff4723.system.entry.js +1 -0
- package/dist/ripple/{p-a0bf5eef.entry.js → p-b452d1d7.entry.js} +1 -1
- package/dist/ripple/{p-1cde16a7.system.entry.js → p-b4d862e1.system.entry.js} +1 -1
- package/dist/ripple/{p-d496bc44.system.entry.js → p-bdd4f919.system.entry.js} +1 -1
- package/dist/ripple/p-c18b398c.system.js +1 -0
- package/dist/ripple/{p-8f8c3705.entry.js → p-c249063c.entry.js} +1 -1
- package/dist/ripple/p-c344a69c.entry.js +1 -0
- package/dist/ripple/{p-0d9f70ab.entry.js → p-c717d895.entry.js} +1 -1
- package/dist/ripple/{p-2e773564.system.entry.js → p-c96a5c94.system.entry.js} +1 -1
- package/dist/ripple/{p-15497721.system.entry.js → p-ceced3d9.system.entry.js} +1 -1
- package/dist/ripple/{p-d428e9bb.system.entry.js → p-d16f91e9.system.entry.js} +1 -1
- package/dist/ripple/{p-ff14e4ec.system.entry.js → p-d3f9d028.system.entry.js} +1 -1
- package/dist/ripple/{p-7962f562.entry.js → p-de349bee.entry.js} +1 -1
- package/dist/ripple/{p-b3c73bc9.entry.js → p-e24ddae1.entry.js} +1 -1
- package/dist/ripple/{p-b3e08b14.system.entry.js → p-e8b58666.system.entry.js} +1 -1
- package/dist/ripple/{p-a9c096b5.entry.js → p-fa87bce3.entry.js} +1 -1
- package/dist/ripple/ripple.esm.js +1 -1
- package/dist/ripple/ripple.js +16 -20
- package/dist/types/components/charts/chartFunctions.d.ts +13 -13
- package/dist/types/components/charts/priv-chart-popover/priv-chart-popover.d.ts +24 -24
- package/dist/types/components/charts/wm-chart/wm-chart-slice.d.ts +8 -8
- package/dist/types/components/charts/wm-chart/wm-chart.d.ts +39 -39
- package/dist/types/components/charts/wm-line-chart/wm-line-chart.d.ts +74 -74
- package/dist/types/components/charts/wm-progress-monitor/wm-progress-indicator.d.ts +26 -26
- package/dist/types/components/charts/wm-progress-monitor/wm-progress-monitor.d.ts +17 -17
- package/dist/types/components/charts/wm-progress-monitor/wm-progress-slice.d.ts +7 -7
- package/dist/types/components/wm-action-menu/wm-action-menu.d.ts +43 -43
- package/dist/types/components/wm-button/wm-button.d.ts +40 -40
- package/dist/types/components/wm-datepicker/priv-datepicker/priv-datepicker.d.ts +76 -76
- package/dist/types/components/wm-datepicker/wm-datepicker.d.ts +31 -31
- package/dist/types/components/wm-file/wm-file.d.ts +40 -40
- package/dist/types/components/wm-file-list/wm-file-list.d.ts +3 -3
- package/dist/types/components/wm-input/wm-input.d.ts +46 -46
- package/dist/types/components/wm-menuitem/wm-menuitem.d.ts +31 -31
- package/dist/types/components/wm-modal/wm-modal-footer.d.ts +11 -11
- package/dist/types/components/wm-modal/wm-modal-header.d.ts +7 -7
- package/dist/types/components/wm-modal/wm-modal.d.ts +24 -24
- package/dist/types/components/wm-navigation/wm-navigation-hamburger.d.ts +13 -13
- package/dist/types/components/wm-navigation/wm-navigation-item.d.ts +10 -10
- package/dist/types/components/wm-navigation/wm-navigation.d.ts +23 -23
- package/dist/types/components/wm-navigator/priv-navigator-button/priv-navigator-button.d.ts +7 -7
- package/dist/types/components/wm-navigator/priv-navigator-item/priv-navigator-item.d.ts +10 -10
- package/dist/types/components/wm-navigator/wm-navigator.d.ts +57 -57
- package/dist/types/components/wm-option/wm-option.d.ts +36 -36
- package/dist/types/components/wm-pagination/wm-pagination.d.ts +27 -27
- package/dist/types/components/wm-search/wm-search.d.ts +73 -73
- package/dist/types/components/wm-select/wm-select.d.ts +99 -99
- package/dist/types/components/wm-snackbar/wm-snackbar.d.ts +24 -24
- package/dist/types/components/wm-tabs/wm-tab-item/wm-tab-item.d.ts +30 -30
- package/dist/types/components/wm-tabs/wm-tab-list/wm-tab-list.d.ts +41 -41
- package/dist/types/components/wm-tabs/wm-tab-panel/wm-tab-panel.d.ts +16 -16
- package/dist/types/components/wm-tag-input/wm-tag-input.d.ts +114 -114
- package/dist/types/components/wm-tag-input/wm-tag-option/wm-tag-option.d.ts +15 -15
- package/dist/types/components/wm-timepicker/wm-timepicker.d.ts +48 -48
- package/dist/types/components/wm-toggletip/wm-toggletip.d.ts +20 -20
- package/dist/types/components/wm-uploader/wm-uploader.d.ts +47 -47
- package/dist/types/components/wm-wrapper/wm-wrapper.d.ts +4 -4
- package/dist/types/components.d.ts +382 -0
- package/dist/types/global/__mocks__/functions.d.ts +1 -1
- package/dist/types/global/functions.d.ts +4 -4
- package/dist/types/global/interfaces.d.ts +49 -49
- package/dist/types/global/intl.d.ts +31 -31
- package/dist/types/global/services/__mocks__/http-service.d.ts +1 -1
- package/dist/types/stencil-public-runtime.d.ts +46 -5
- package/package.json +1 -1
- package/dist/cjs/chartFunctions-2c3e010e.js +0 -600
- package/dist/cjs/interfaces-245d7bff.js +0 -38
- package/dist/cjs/intl-fa3bb4ae.js +0 -179
- package/dist/esm/chartFunctions-36634c04.js +0 -584
- package/dist/esm/interfaces-89cad2fc.js +0 -35
- package/dist/esm/intl-e2da750a.js +0 -174
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm-es5/chartFunctions-36634c04.js +0 -1
- package/dist/esm-es5/functions-5afd09f4.js +0 -1
- package/dist/esm-es5/global-d4a9e80e.js +0 -1
- package/dist/esm-es5/index-7e11ea42.js +0 -2
- package/dist/ripple/p-00acacbe.system.entry.js +0 -1
- package/dist/ripple/p-0f889b84.system.js +0 -1
- package/dist/ripple/p-13af8346.entry.js +0 -1
- package/dist/ripple/p-16363e1c.system.entry.js +0 -1
- package/dist/ripple/p-2a95b63f.system.entry.js +0 -1
- package/dist/ripple/p-30bf24f8.system.js +0 -2
- package/dist/ripple/p-3248c0fa.system.entry.js +0 -1
- package/dist/ripple/p-47c20b05.entry.js +0 -1
- package/dist/ripple/p-56d64283.system.entry.js +0 -1
- package/dist/ripple/p-5e85967a.system.js +0 -1
- package/dist/ripple/p-9b2034f6.js +0 -1
- package/dist/ripple/p-a3d07be5.system.js +0 -1
- package/dist/ripple/p-a6be3cca.system.entry.js +0 -1
- package/dist/ripple/p-aafa111a.system.js +0 -1
- package/dist/ripple/p-b5bedd63.js +0 -2
- package/dist/ripple/p-bd537299.system.entry.js +0 -1
- /package/dist/esm-es5/{interfaces-89cad2fc.js → interfaces-9b75fb61.js} +0 -0
- /package/dist/ripple/{p-c0c111fd.js → p-196eb2f3.js} +0 -0
|
@@ -2,867 +2,867 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const functions = require('./functions-
|
|
7
|
-
const intl = require('./intl-
|
|
5
|
+
const index = require('./index-f8ef86de.js');
|
|
6
|
+
const functions = require('./functions-4208c444.js');
|
|
7
|
+
const intl = require('./intl-3fafc6d1.js');
|
|
8
8
|
|
|
9
9
|
const wmTagInputCss = ":host{--wmcolor-taginput-altrow-background-table:var(--wmcolor-table-altrow-background);--wmcolor-taginput-border:var(--wmcolor-input-border);--wmcolor-taginput-charcount-background:var(--wmcolor-input-charcount-background);--wmcolor-taginput-header-background-table:var(--wmcolor-table-header-background);--wmcolor-taginput-help-text:var(--wmcolor-text);--wmcolor-taginput-icon:var(--wmcolor-icon-accent);--wmcolor-taginput-maxtags-background:var(--wmcolor-background-readonly);--wmcolor-taginput-maxtags-border:var(--wmcolor-input-border);--wmcolor-taginput-maxtags-text:var(--wmcolor-text);--wmcolor-taginput-option-background-hover:var(--wmcolor-option-background-hover);--wmcolor-taginput-option-background:var(--wmcolor-option-background);--wmcolor-taginput-option-border:var(--wmcolor-option-border);--wmcolor-taginput-option-text-selected:var(--wmcolor-option-text-disabled);--wmcolor-taginput-option-text:var(--wmcolor-interactive);--wmcolor-taginput-row-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-taginput-row-background-selected:var(--wmcolor-table-row-background-selected);--wmcolor-taginput-row-background-table:var(--wmcolor-table-row-background);--wmcolor-taginput-row-border-selected:var(--wmcolor-table-row-border-selected);--wmcolor-taginput-tag-background-focus:var(--wmcolor-palelilacgray-dark);--wmcolor-taginput-tag-background-highlight:var(--wmcolor-background-highlight);--wmcolor-taginput-tag-background-locked:var(--wmcolor-interactive-disabled);--wmcolor-taginput-tag-background:var(--wmcolor-palelilacgray);--wmcolor-taginput-tag-text-locked:var(--wmcolor-text-ondark);--wmcolor-taginput-tag-text:var(--wmcolor-text);--wmcolor-taginput-tagbutton-background-hover:var(--wmcolor-button-background-icononly-hover);--wmcolor-taginput-tagbutton-border:var(--wmcolor-button-border-icononly);--wmcolor-taginput-tagbutton-icon-hover:var(--wmcolor-button-icon-icononly-hover);--wmcolor-taginput-tagbutton-icon:var(--wmcolor-button-icon-icononly);font-family:inherit;width:100%;display:block;max-height:80vh}:host *{-webkit-box-sizing:border-box;box-sizing:border-box;font-size:14px}:host .wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:0.875rem}:host .wrapper .label{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}:host .wrapper .label .required{color:var(--wmcolor-text-required)}:host .wrapper.label-left{-ms-flex-direction:row;flex-direction:row}:host .wrapper.label-left .label-wrapper{line-height:2.5rem}:host .wrapper.label-left .label-wrapper .label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:2.5rem;white-space:normal;margin-bottom:0;margin-right:0.75rem}:host .wrapper.label-none label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .wrapper.invalid .label{color:var(--wmcolor-text-error)}:host .wrapper.invalid .label:after{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\f026\";margin-left:0.3125rem}[dir=RTL] :host .wrapper.invalid .label:after{margin-left:0;margin-right:0.3125rem}:host .wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}:host .wrapper{width:100%;height:100%;max-height:inherit;min-height:inherit;position:relative}:host .field-wrapper{position:relative;width:100%;border:1px solid;border-color:var(--wmcolor-taginput-border);-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px}:host .field-wrapper.focused{-webkit-box-shadow:0 0 0 1px var(--wmcolor-input-border-focus);-moz-box-shadow:0 0 0 1px var(--wmcolor-input-border-focus);box-shadow:0 0 0 1px var(--wmcolor-input-border-focus);outline:none;border-color:var(--wmcolor-input-border-focus)}:host .field-wrapper.invalid{-webkit-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);-moz-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);box-shadow:0 0 0 1px var(--wmcolor-input-border-error);border-color:var(--wmcolor-input-border-error)}:host .wrapper:not(.label-left) .field-wrapper{-ms-flex-negative:0;flex-shrink:0}:host .character-count{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:5rem;background-color:var(--wmcolor-taginput-charcount-background);font-size:0.875rem;font-weight:500;-ms-flex-item-align:stretch;align-self:stretch}:host .tags-and-input-wrapper{position:relative;width:100%;padding:8px 8px 8px 0;overflow:auto;max-height:200px}:host .tags-and-input-wrapper.in-modal{max-height:20vh}:host .upper-row{width:100%;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-pack:justify;justify-content:space-between}:host .upper-row:before{-ms-flex-item-align:start;align-self:flex-start;display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\f349\";color:var(--wmcolor-taginput-icon);padding:0.75rem 0.5rem 0.75rem 0.75rem;line-height:normal;font-size:1.12rem}:host .lower-row{width:100%;min-height:1.875rem}:host #max-tags{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:1.875rem;background-color:var(--wmcolor-taginput-maxtags-background);padding:0.5rem 1rem;color:var(--wmcolor-taginput-maxtags-text);font-size:0.875rem;border-top:1px solid var(--wmcolor-taginput-maxtags-border);border-radius:0 0 3px 3px}:host .tag-area{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding:0;margin:0;gap:8px}:host .tag-area:focus{outline:none}:host .tag-area li{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;height:1.75rem;list-style:none;color:var(--wmcolor-taginput-tag-text);background-color:var(--wmcolor-taginput-tag-background);padding:0.5rem 0.625rem;-webkit-transition:background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);transition:background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);white-space:pre}:host .tag-area li.highlight{-webkit-animation:fadeIn 1s;animation:fadeIn 1s}@-webkit-keyframes fadeIn{0%{background-color:var(--wmcolor-taginput-tag-background)}50%{background-color:var(--wmcolor-taginput-tag-background-highlight)}100%{background-color:var(--wmcolor-taginput-tag-background)}}@keyframes fadeIn{0%{background-color:var(--wmcolor-taginput-tag-background)}50%{background-color:var(--wmcolor-taginput-tag-background-highlight)}100%{background-color:var(--wmcolor-taginput-tag-background)}}:host .tag-area li.focused{background-color:var(--wmcolor-taginput-tag-background-focus)}:host .tag-area li.locked{background-color:var(--wmcolor-taginput-tag-background-locked);color:var(--wmcolor-taginput-tag-text-locked)}:host .tag-area li .icon{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:1.25rem;width:1.25rem;padding:0;margin-left:0.5rem}:host .tag-area li .icon.remove-btn{border:1px solid var(--wmcolor-taginput-tagbutton-border);color:var(--wmcolor-taginput-tagbutton-icon);border-radius:50%;cursor:pointer;-webkit-transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1), color 500ms cubic-bezier(0.4, 0, 0.2, 1);transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1), color 500ms cubic-bezier(0.4, 0, 0.2, 1)}:host .tag-area li .icon.remove-btn:hover{color:var(--wmcolor-taginput-tagbutton-icon-hover);background-color:var(--wmcolor-taginput-tagbutton-background-hover)}:host .tag-area li .icon.remove-btn:before{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\f156\"}:host .tag-area li .icon.lock{color:var(--wmcolor-taginput-tag-text-locked)}:host .tag-area li .icon.lock:before{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\f341\"}:host .input{font-family:inherit;border:none;height:1.75rem;padding:0;margin:0;right:8px}:host .input:focus{outline:none}:host .tag-area:not(.empty)+.input.extended{-webkit-margin-before:8px;margin-block-start:8px}:host .dropdown-wrapper{margin:0;padding:0;-webkit-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0);-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;position:absolute;top:calc(100% + 2px);right:0;z-index:100;width:100%;font-size:0.875rem}:host .dropdown-wrapper .dropdown{-webkit-overflow-scrolling:touch;overflow:auto;max-height:12.5rem;margin:0;padding:0}:host .dropdown-wrapper.open{-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1)}:host .dropdown-wrapper.upwards{top:unset;bottom:calc(100% + 2px);-ms-transform-origin:center bottom;-webkit-transform-origin:center bottom;-moz-transform-origin:center bottom;transform-origin:center bottom}:host .dropdown-wrapper li,:host .dropdown-wrapper div{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:0 1rem;background:var(--wmcolor-taginput-option-background);list-style:none;min-height:2.6875rem;white-space:pre-wrap;overflow-wrap:anywhere}:host .dropdown-wrapper li.option,:host .dropdown-wrapper li.add-new-btn,:host .dropdown-wrapper div.option,:host .dropdown-wrapper div.add-new-btn{cursor:pointer;color:var(--wmcolor-taginput-option-text);font-weight:bold;width:100%;border:none}:host .dropdown-wrapper li.option[aria-selected=true],:host .dropdown-wrapper li.add-new-btn[aria-selected=true],:host .dropdown-wrapper div.option[aria-selected=true],:host .dropdown-wrapper div.add-new-btn[aria-selected=true]{color:var(--wmcolor-taginput-option-text-selected);font-style:italic;font-weight:normal;cursor:unset}:host .dropdown-wrapper li.option:hover:not([aria-selected=true]),:host .dropdown-wrapper li.option.focused,:host .dropdown-wrapper li.add-new-btn:hover:not([aria-selected=true]),:host .dropdown-wrapper li.add-new-btn.focused,:host .dropdown-wrapper div.option:hover:not([aria-selected=true]),:host .dropdown-wrapper div.option.focused,:host .dropdown-wrapper div.add-new-btn:hover:not([aria-selected=true]),:host .dropdown-wrapper div.add-new-btn.focused{outline:none;background:var(--wmcolor-taginput-option-background-hover)}:host .dropdown-wrapper li.help-text,:host .dropdown-wrapper div.help-text{color:var(--wmcolor-taginput-help-text);height:auto;min-height:2.6875rem;padding-top:0.25rem;padding-bottom:0.25rem;white-space:normal}:host .dropdown-wrapper li:not(:last-child),:host .dropdown-wrapper div:not(:last-child){border-bottom:2px solid var(--wmcolor-taginput-option-border)}:host .info-text{font-style:italic;margin-top:0.25rem}:host .table-wrapper{overflow:auto;margin-top:1.5rem}:host .table-wrapper #table{width:100%;border-spacing:0px}:host .table-wrapper #table.fixed-widths{table-layout:fixed}:host .table-wrapper #table .headers{height:2.5rem;background-color:var(--wmcolor-taginput-header-background-table)}:host .table-wrapper #table .headers th{text-align:left;font-size:0.75rem;font-weight:700;text-transform:uppercase;padding:0 1.5rem}:host .table-wrapper tr:nth-child(even){background-color:var(--wmcolor-taginput-altrow-background-table)}:host .table-wrapper tr.selected,:host .table-wrapper tr.locked{background-color:var(--wmcolor-taginput-row-background-selected);-webkit-box-shadow:inset 0 0 0 1px var(--wmcolor-taginput-row-border-selected);box-shadow:inset 0 0 0 1px var(--wmcolor-taginput-row-border-selected);font-weight:500}:host .table-wrapper tr.focused:not(.locked),:host .table-wrapper tr:hover:not(.locked){background-color:var(--wmcolor-taginput-row-background-hover);-webkit-box-shadow:none;box-shadow:none}:host .table-wrapper tr.locked td{cursor:auto}:host .table-wrapper tr.locked td:first-child .cell-content-wrapper:before{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\f33e\";margin-right:0.5rem;color:var(--wmcolor-taginput-tag-text)}:host .table-wrapper td{height:3.75rem;vertical-align:middle;padding:0 1.5rem;cursor:pointer}:host .table-wrapper td.focused{-webkit-box-shadow:inset 0 2px 2px 0 rgba(244, 243, 246, 0.2), inset 0 2px 2px 0 rgba(0, 0, 0, 0.1), inset 0 0 4px 3px var(--wmcolor-interactive-focus);box-shadow:inset 0 2px 2px 0 rgba(244, 243, 246, 0.2), inset 0 2px 2px 0 rgba(0, 0, 0, 0.1), inset 0 0 4px 3px var(--wmcolor-interactive-focus)}:host .table-wrapper td .cell-content-wrapper.trunc{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host .table-wrapper td .description{display:none}:host .no-results{padding:1.25rem 1.5rem}:host .sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host #error{display:block;font-style:italic;color:var(--wmcolor-text-error);font-size:0.875rem;margin-top:0.25rem}";
|
|
10
10
|
|
|
11
11
|
const TagInput = class {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
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
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
ev.preventDefault();
|
|
390
|
-
this.resetInput();
|
|
391
|
-
let option;
|
|
392
|
-
if (this.isTable) {
|
|
393
|
-
option = ev.target;
|
|
394
|
-
option = this.tagOptionFromEl(option.closest("tr"));
|
|
395
|
-
}
|
|
396
|
-
else {
|
|
397
|
-
option = this.tagOptionFromEl(ev.target);
|
|
398
|
-
}
|
|
399
|
-
// if someone wants to attach a click event listener on wm-tag-option
|
|
400
|
-
option.click();
|
|
401
|
-
if (!option.locked) {
|
|
402
|
-
option.selected
|
|
403
|
-
? this.isTable && option.emitDeselectedEvent() // dropdown doesn't deselect on option click
|
|
404
|
-
: option.emitSelectedEvent();
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
// From wm-button
|
|
408
|
-
// we need to listen for scroll events during the capture phase because they do not bubble up
|
|
409
|
-
// there can be layouts where the main content has 100vh and overflows
|
|
410
|
-
// in these cases window will register no scroll events unless we catch on they way down
|
|
411
|
-
dismissTooltip() {
|
|
412
|
-
if (this.tooltipVisible) {
|
|
413
|
-
functions.hideTooltip();
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
handleInputKeyDown(ev) {
|
|
417
|
-
if (/^.$/.test(ev.key) && this.charCount >= this.characterLimit) {
|
|
418
|
-
this.announce(this.generateCharacterLimitWarning(this.charCount, this.characterLimit));
|
|
419
|
-
}
|
|
420
|
-
// prevent keydown triggering on tag area
|
|
421
|
-
ev.stopPropagation();
|
|
422
|
-
switch (ev.key) {
|
|
423
|
-
case "Enter":
|
|
424
|
-
ev.preventDefault();
|
|
425
|
-
this.handleInputEnter();
|
|
426
|
-
break;
|
|
427
|
-
case "ArrowDown":
|
|
428
|
-
ev.preventDefault();
|
|
429
|
-
this.handleInputArrowDown();
|
|
430
|
-
break;
|
|
431
|
-
case "ArrowUp":
|
|
12
|
+
constructor(hostRef) {
|
|
13
|
+
index.registerInstance(this, hostRef);
|
|
14
|
+
this.wmTagInputTagAdded = index.createEvent(this, "wmTagInputTagAdded", 7);
|
|
15
|
+
this.addNewHelpText = functions.intl.formatMessage({
|
|
16
|
+
id: "tagInput.addNewHelpText",
|
|
17
|
+
defaultMessage: "Press the Enter or Comma key to add a new tag.",
|
|
18
|
+
description: "Help text appearing in a dropdown. Use imperative",
|
|
19
|
+
});
|
|
20
|
+
this.selectionHelpText = functions.intl.formatMessage({
|
|
21
|
+
id: "tagInput.selectionHelpText",
|
|
22
|
+
defaultMessage: "Search and select a tag.",
|
|
23
|
+
description: "Help text appearing in a dropdown. Use imperative",
|
|
24
|
+
});
|
|
25
|
+
this.maxTagsReachedMessage = functions.intl.formatMessage({
|
|
26
|
+
id: "tagInput.maxTagsReached",
|
|
27
|
+
defaultMessage: "No more tags can be added because the limit has been reached.",
|
|
28
|
+
});
|
|
29
|
+
this.tagAreaInstructions = functions.intl.formatMessage({
|
|
30
|
+
id: "tagInput.tagAreaInstructions",
|
|
31
|
+
defaultMessage: "tag selection. Press Backspace or Delete to remove a tag.",
|
|
32
|
+
});
|
|
33
|
+
this.tagsAddedMessage = functions.intl.formatMessage({
|
|
34
|
+
id: "tagInput.tagsAdded",
|
|
35
|
+
defaultMessage: "Tags added",
|
|
36
|
+
description: "Full message for context: 'Tags added: x/y",
|
|
37
|
+
});
|
|
38
|
+
this.openUp = false;
|
|
39
|
+
this.inModal = false;
|
|
40
|
+
this.lastAddedTags = []; // the tag(s) added by the user on their last action (for highlighting)
|
|
41
|
+
this.debouncedUpdate = functions.debounce(() => index.forceUpdate(this.el), 30);
|
|
42
|
+
this.label = undefined;
|
|
43
|
+
this.errorMessage = undefined;
|
|
44
|
+
this.info = undefined;
|
|
45
|
+
this.labelPosition = "top";
|
|
46
|
+
this.maxTags = undefined;
|
|
47
|
+
this.placeholder = undefined;
|
|
48
|
+
this.requiredField = false;
|
|
49
|
+
this.tagInputType = "dropdown";
|
|
50
|
+
this.helpText = undefined;
|
|
51
|
+
this.addNew = true;
|
|
52
|
+
this.characterLimit = 50;
|
|
53
|
+
this.colHeaders = undefined;
|
|
54
|
+
this.colWidths = undefined;
|
|
55
|
+
this.colWrap = undefined;
|
|
56
|
+
this.isExpanded = false;
|
|
57
|
+
this.liveRegionMessage = "";
|
|
58
|
+
this.focusedOption = undefined;
|
|
59
|
+
this.focusedColumn = 0;
|
|
60
|
+
this.focusedTagIndex = undefined;
|
|
61
|
+
this.tagsList = [];
|
|
62
|
+
}
|
|
63
|
+
get isDropdown() {
|
|
64
|
+
return this.tagInputType === "dropdown";
|
|
65
|
+
}
|
|
66
|
+
get isTable() {
|
|
67
|
+
return this.tagInputType === "table";
|
|
68
|
+
}
|
|
69
|
+
get charCount() {
|
|
70
|
+
return this.inputEl ? this.inputEl.value.length : 0;
|
|
71
|
+
}
|
|
72
|
+
get tooltipVisible() {
|
|
73
|
+
return document.getElementById("wm-tooltip").classList.contains("show");
|
|
74
|
+
}
|
|
75
|
+
get optionEls() {
|
|
76
|
+
return Array.from(this.el.querySelectorAll("wm-tag-option"));
|
|
77
|
+
}
|
|
78
|
+
// list of options matching user query
|
|
79
|
+
get filteredOptionEls() {
|
|
80
|
+
const query = this.inputEl ? this.inputEl.value.toLowerCase() : "";
|
|
81
|
+
const list = Array.from(this.optionEls).filter((o) => {
|
|
82
|
+
let values = "";
|
|
83
|
+
if (this.isDropdown) {
|
|
84
|
+
values = o.textContent.toLowerCase();
|
|
85
|
+
}
|
|
86
|
+
else if (this.isTable) {
|
|
87
|
+
values = [o.col1, o.col2, o.col3, o.col4].join("").toLowerCase();
|
|
88
|
+
}
|
|
89
|
+
return values.includes(query);
|
|
90
|
+
});
|
|
91
|
+
return list;
|
|
92
|
+
}
|
|
93
|
+
// the ones that should be rendered as tags
|
|
94
|
+
get taggedOptions() {
|
|
95
|
+
return this.optionEls.filter((o) => o.selected || o.locked);
|
|
96
|
+
}
|
|
97
|
+
// for visual stuff (measuring, truncating...)
|
|
98
|
+
get _tagEls() {
|
|
99
|
+
return this.tagAreaEl ? Array.from(this.tagAreaEl.querySelectorAll(".tag")) : [];
|
|
100
|
+
}
|
|
101
|
+
// unlocked and selected tags, i.e. the ones that the user can interact with.
|
|
102
|
+
// (as opposed to locked tags who can't be focused / deleted)
|
|
103
|
+
// used for focus logic
|
|
104
|
+
get focusableTags() {
|
|
105
|
+
return this._tagEls.filter((t) => !t.classList.contains("locked"));
|
|
106
|
+
}
|
|
107
|
+
get focusedTag() {
|
|
108
|
+
if (this.focusedTagIndex !== undefined && this.focusedTagIndex >= 0)
|
|
109
|
+
return this.focusableTags[this.focusedTagIndex];
|
|
110
|
+
}
|
|
111
|
+
// get the wm-tag-option, given the internal representation (dropdown li or table tr)
|
|
112
|
+
tagOptionFromEl(el) {
|
|
113
|
+
return el.id === "add-new-btn" ? undefined : this.el.querySelector("#" + el.id);
|
|
114
|
+
}
|
|
115
|
+
// get the wm-tag-option, given the internal representation of a tag
|
|
116
|
+
tagOptionFromTag(el) {
|
|
117
|
+
const id = el.id.replace("tag-", "");
|
|
118
|
+
return this.el.querySelector("#" + id);
|
|
119
|
+
}
|
|
120
|
+
// get the internal representation of a wm-tag-option
|
|
121
|
+
elFromTagOption(el) {
|
|
122
|
+
return this.el.shadowRoot.querySelector("#" + el.id);
|
|
123
|
+
}
|
|
124
|
+
// focusedOption state refers to the wm-tag-option. This gets the corresponding element in the shadow DOM, or the "Add New" button.
|
|
125
|
+
get _focusedOption() {
|
|
126
|
+
if (!!this.focusedOption) {
|
|
127
|
+
return this.elFromTagOption(this.focusedOption);
|
|
128
|
+
}
|
|
129
|
+
else if (this.addNewButton && this.addNewButton.classList.contains("focused")) {
|
|
130
|
+
return this.addNewButton;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
get _focusedCell() {
|
|
134
|
+
if (!!this._focusedOption) {
|
|
135
|
+
const allCells = Array.from(this._focusedOption.querySelectorAll("td"));
|
|
136
|
+
const index = this.focusedColumn || 0;
|
|
137
|
+
return allCells[index];
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
get inputActiveDescendantId() {
|
|
141
|
+
if (this._focusedOption) {
|
|
142
|
+
if (this.isTable) {
|
|
143
|
+
const cells = Array.from(this._focusedOption.querySelectorAll("td"));
|
|
144
|
+
return cells[this.focusedColumn].id;
|
|
145
|
+
}
|
|
146
|
+
return this._focusedOption.id;
|
|
147
|
+
}
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
get tagLimitReached() {
|
|
151
|
+
return !!(this.maxTags && this.taggedOptions.length >= this.maxTags);
|
|
152
|
+
}
|
|
153
|
+
get noResultsMessage() {
|
|
154
|
+
return functions.intl.formatMessage({
|
|
155
|
+
id: "tagInput.noResults",
|
|
156
|
+
defaultMessage: "No results match your search.",
|
|
157
|
+
description: "Message displayed when a user's search returns empty.",
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
get inputMinimumWidth() {
|
|
161
|
+
if (this._tagEls) {
|
|
162
|
+
// 150px is the minimum width of the input field, or the length of the placeholder text
|
|
163
|
+
const inputElStyles = getComputedStyle(this.inputEl);
|
|
164
|
+
const tagElStyles = getComputedStyle(this._tagEls[this._tagEls.length - 1]);
|
|
165
|
+
const inputElBuffer = [
|
|
166
|
+
inputElStyles.paddingLeft,
|
|
167
|
+
inputElStyles.paddingRight,
|
|
168
|
+
inputElStyles.marginLeft,
|
|
169
|
+
inputElStyles.marginRight,
|
|
170
|
+
tagElStyles.marginRight,
|
|
171
|
+
].reduce((prev, curr) => prev + parseInt(curr.replace("px", "")), 0);
|
|
172
|
+
const minimumWidth = Math.max(150, functions.measureText(this.inputEl, this.placeholder).width + inputElBuffer);
|
|
173
|
+
return minimumWidth;
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
return 150;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
getTagName(o) {
|
|
180
|
+
// when the user is typing and adding a new option, all we can pass is the text typed. so for the dropdown type the tag name is the identifier. It also takes care of duplicates. Table variant requires an id as the tag name is the first column but we want to allow duplicates here (e.g. people with the same name)
|
|
181
|
+
return this.isDropdown ? o.textContent : o.col1;
|
|
182
|
+
}
|
|
183
|
+
isExistingTag(tag) {
|
|
184
|
+
const list = this.optionEls.map((o) => this.getTagName(o).toLowerCase());
|
|
185
|
+
return list.includes(tag.toLowerCase());
|
|
186
|
+
}
|
|
187
|
+
tagAddedMessage(tag) {
|
|
188
|
+
return functions.intl.formatMessage({
|
|
189
|
+
id: "tagInput.tagAdded",
|
|
190
|
+
defaultMessage: "{tagName} added.",
|
|
191
|
+
description: "A confirmation for adding a tag.",
|
|
192
|
+
}, { tagName: tag });
|
|
193
|
+
}
|
|
194
|
+
tagRemovedMessage(tag) {
|
|
195
|
+
return functions.intl.formatMessage({
|
|
196
|
+
id: "tagInput.tagRemoved",
|
|
197
|
+
defaultMessage: "{tagName} removed.",
|
|
198
|
+
description: "A confirmation for removing a tag.",
|
|
199
|
+
}, { tagName: tag });
|
|
200
|
+
}
|
|
201
|
+
tagAlreadyAddedMessage(tag) {
|
|
202
|
+
return functions.intl.formatMessage({
|
|
203
|
+
id: "tagInput.tagAlreadyAdded",
|
|
204
|
+
defaultMessage: "{tagName} has already been added.",
|
|
205
|
+
description: "An alert for adding a tag that is already present.",
|
|
206
|
+
}, { tagName: tag });
|
|
207
|
+
}
|
|
208
|
+
isElOrChild(el) {
|
|
209
|
+
return el === this.el || this.el.shadowRoot.contains(el) || this.el.contains(el);
|
|
210
|
+
}
|
|
211
|
+
componentWillLoad() {
|
|
212
|
+
if (!this.placeholder) {
|
|
213
|
+
this.placeholder = this.createPlaceholderDefault(this.addNew, this.optionEls.length > 0);
|
|
214
|
+
}
|
|
215
|
+
if (!this.label) {
|
|
216
|
+
console.error("wm-tag-input must have a label property");
|
|
217
|
+
}
|
|
218
|
+
this.el.focus = () => {
|
|
219
|
+
const firstFocusableTag = this.focusableTags[0];
|
|
220
|
+
if (firstFocusableTag) {
|
|
221
|
+
this.tagAreaEl.focus();
|
|
222
|
+
this.focusTag(firstFocusableTag);
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
this.inputEl.focus();
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
// on resize of component, trigger componentDidRender -> positionInput
|
|
229
|
+
const resizeObserver = new ResizeObserver(() => this.debouncedUpdate());
|
|
230
|
+
resizeObserver.observe(this.el);
|
|
231
|
+
// if within wm-modal, change max-height to vh unit
|
|
232
|
+
if (this.el.closest("wm-modal")) {
|
|
233
|
+
this.inModal = true;
|
|
234
|
+
}
|
|
235
|
+
const lockedTags = [];
|
|
236
|
+
const regularTags = [];
|
|
237
|
+
this.optionEls.forEach((o) => {
|
|
238
|
+
if (o.locked) {
|
|
239
|
+
lockedTags.push(o);
|
|
240
|
+
}
|
|
241
|
+
else if (o.selected) {
|
|
242
|
+
regularTags.push(o);
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
this.tagsList = [...lockedTags, ...regularTags];
|
|
246
|
+
}
|
|
247
|
+
componentDidLoad() {
|
|
248
|
+
// Set up observer to announce changes in selected tags, or removed user-added tags
|
|
249
|
+
const observerAnnouncer = new MutationObserver((optionListMutations) => optionListMutations.forEach((mutationRecord) => this.handleChangeAnnouncement(mutationRecord)));
|
|
250
|
+
observerAnnouncer.observe(this.el, {
|
|
251
|
+
subtree: true,
|
|
252
|
+
attributes: true,
|
|
253
|
+
attributeFilter: ["selected"],
|
|
254
|
+
childList: true,
|
|
255
|
+
});
|
|
256
|
+
// Set up observer that ensures parent reload
|
|
257
|
+
// when children wm-tag-options are removed
|
|
258
|
+
const optionListObserver = new MutationObserver((optionListMutations) => optionListMutations.forEach((mutationRecord) => this.handleOptionListChange(mutationRecord)));
|
|
259
|
+
optionListObserver.observe(this.el, {
|
|
260
|
+
childList: true,
|
|
261
|
+
});
|
|
262
|
+
// Set up the observer that will handle focus
|
|
263
|
+
// when tag list changes
|
|
264
|
+
if (!!this.tagAreaEl) {
|
|
265
|
+
const tagListObserver = new MutationObserver((tagListMutations) => tagListMutations.forEach((mutationRecord) => this.handleTagListChange(mutationRecord)));
|
|
266
|
+
tagListObserver.observe(this.tagAreaEl, {
|
|
267
|
+
childList: true,
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
handleChangeAnnouncement(mutationRecord) {
|
|
272
|
+
const tagOptionEl = mutationRecord.target;
|
|
273
|
+
if (mutationRecord.type == "childList" && mutationRecord.removedNodes.length > 0) {
|
|
274
|
+
// announce deselection of user-added tag, whose element removal is picked up
|
|
275
|
+
this.announce(this.tagRemovedMessage(mutationRecord.removedNodes[0].textContent));
|
|
276
|
+
}
|
|
277
|
+
else if (mutationRecord.type == "attributes") {
|
|
278
|
+
// announce selection or deselection of all kinds of tags
|
|
279
|
+
if (tagOptionEl.selected) {
|
|
280
|
+
this.announce(this.tagAddedMessage(tagOptionEl.textContent));
|
|
281
|
+
}
|
|
282
|
+
else {
|
|
283
|
+
this.announce(this.tagRemovedMessage(tagOptionEl.textContent));
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
handleOptionListChange(record) {
|
|
288
|
+
const addedNodes = Array.from(record.addedNodes);
|
|
289
|
+
if (addedNodes.length > 0) {
|
|
290
|
+
addedNodes.forEach((n) => !this.tagsList.includes(n) && this.tagsList.push(n));
|
|
291
|
+
}
|
|
292
|
+
const removedNodes = Array.from(record.removedNodes);
|
|
293
|
+
if (removedNodes.length > 0) {
|
|
294
|
+
this.tagsList = this.tagsList.filter((t) => !removedNodes.includes(t));
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
handleTagOptionSelected(ev) {
|
|
298
|
+
const selOption = ev.target;
|
|
299
|
+
this.tagsList = this.tagsList.concat(selOption);
|
|
300
|
+
}
|
|
301
|
+
handleTagOptionDeselected(ev) {
|
|
302
|
+
const deselOption = ev.target;
|
|
303
|
+
this.tagsList = this.tagsList.filter((t) => t != deselOption);
|
|
304
|
+
}
|
|
305
|
+
handleTagListChange(mutationRecord) {
|
|
306
|
+
// there are 2 cases: the option still exists but is no longer selected,
|
|
307
|
+
// or it was removed altogether
|
|
308
|
+
const removedTag = mutationRecord.removedNodes[0];
|
|
309
|
+
if (!!removedTag) {
|
|
310
|
+
// this is a trick. focusedTag gets the ref from an index. When an element
|
|
311
|
+
// is removed it will fall back on the new element with that index if it exists
|
|
312
|
+
if (this.focusedTag) {
|
|
313
|
+
this.focusTag(this.focusedTag);
|
|
314
|
+
}
|
|
315
|
+
else if (this.focusableTags.length > 0) {
|
|
316
|
+
// Otherwise the last tag was deleted and we reassign to the new last tag.
|
|
317
|
+
const tagToFocus = this.focusableTags[this.focusableTags.length - 1];
|
|
318
|
+
this.focusTag(tagToFocus);
|
|
319
|
+
}
|
|
320
|
+
else {
|
|
321
|
+
// unless there are no more tags...
|
|
322
|
+
this.inputEl.focus();
|
|
323
|
+
}
|
|
324
|
+
this.lastAddedTags = [];
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
componentDidRender() {
|
|
328
|
+
this.positionInput();
|
|
329
|
+
// check each tag if truncation is needed
|
|
330
|
+
this._tagEls.forEach((tag) => {
|
|
331
|
+
const textEl = tag.querySelector(".tag-text");
|
|
332
|
+
const wrapper = this.el.shadowRoot.querySelector(".tags-and-input-wrapper");
|
|
333
|
+
const leftBound = textEl.getBoundingClientRect().left;
|
|
334
|
+
// the numbers represent spacing values for padding, margin, and delete icon
|
|
335
|
+
const rightBound = wrapper.getBoundingClientRect().right - 10 - 8 - 28;
|
|
336
|
+
const id = tag.id.replace("tag-", "");
|
|
337
|
+
const optionEl = id && this.el.querySelector("#" + id);
|
|
338
|
+
if (optionEl) {
|
|
339
|
+
// tag text for table variant is first column text
|
|
340
|
+
textEl.textContent = functions.truncateText(textEl, this.getTagName(optionEl), rightBound - leftBound, 5);
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
createPlaceholderDefault(addNew, hasOptions) {
|
|
345
|
+
const addAndSearchPlaceholder = functions.intl.formatMessage({
|
|
346
|
+
id: "tagInput.placeholderAddAndSearch",
|
|
347
|
+
defaultMessage: "Add or search for a tag",
|
|
348
|
+
description: "Placeholder text. Use imperative",
|
|
349
|
+
});
|
|
350
|
+
const searchPlaceholder = functions.intl.formatMessage({
|
|
351
|
+
id: "tagInput.placeholderSearch",
|
|
352
|
+
defaultMessage: "Search and select a tag",
|
|
353
|
+
description: "Placeholder text. Use imperative",
|
|
354
|
+
});
|
|
355
|
+
const addPlaceholder = functions.intl.formatMessage({
|
|
356
|
+
id: "tagInput.placeholderAdd",
|
|
357
|
+
defaultMessage: "Add a new tag",
|
|
358
|
+
description: "Placeholder text. Use imperative",
|
|
359
|
+
});
|
|
360
|
+
let placeholder = "";
|
|
361
|
+
if (addNew && hasOptions) {
|
|
362
|
+
placeholder = addAndSearchPlaceholder;
|
|
363
|
+
}
|
|
364
|
+
else if (!addNew && hasOptions) {
|
|
365
|
+
placeholder = searchPlaceholder;
|
|
366
|
+
}
|
|
367
|
+
else if (addNew) {
|
|
368
|
+
placeholder = addPlaceholder;
|
|
369
|
+
}
|
|
370
|
+
return placeholder;
|
|
371
|
+
}
|
|
372
|
+
handleErrorMessageChange() {
|
|
373
|
+
if (this.errorMessage) {
|
|
374
|
+
this.announce(this.errorMessage);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
handleClick(ev) {
|
|
378
|
+
const el = ev.target;
|
|
379
|
+
if (this.isDropdown && !this.el.contains(el) && this.isExpanded) {
|
|
380
|
+
this.closeDropdown();
|
|
381
|
+
}
|
|
382
|
+
else if (Array.from(this.el.children).includes(el)) {
|
|
383
|
+
const option = el;
|
|
384
|
+
const tagName = this.getTagName(option);
|
|
385
|
+
this.lastAddedTags = [tagName];
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
handleOptionClick(ev) {
|
|
432
389
|
ev.preventDefault();
|
|
433
|
-
this.
|
|
434
|
-
|
|
435
|
-
case "ArrowLeft":
|
|
390
|
+
this.resetInput();
|
|
391
|
+
let option;
|
|
436
392
|
if (this.isTable) {
|
|
437
|
-
|
|
438
|
-
|
|
393
|
+
option = ev.target;
|
|
394
|
+
option = this.tagOptionFromEl(option.closest("tr"));
|
|
439
395
|
}
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
if (this.
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
396
|
+
else {
|
|
397
|
+
option = this.tagOptionFromEl(ev.target);
|
|
398
|
+
}
|
|
399
|
+
// if someone wants to attach a click event listener on wm-tag-option
|
|
400
|
+
option.click();
|
|
401
|
+
if (!option.locked) {
|
|
402
|
+
option.selected
|
|
403
|
+
? this.isTable && option.emitDeselectedEvent() // dropdown doesn't deselect on option click
|
|
404
|
+
: option.emitSelectedEvent();
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
// From wm-button
|
|
408
|
+
// we need to listen for scroll events during the capture phase because they do not bubble up
|
|
409
|
+
// there can be layouts where the main content has 100vh and overflows
|
|
410
|
+
// in these cases window will register no scroll events unless we catch on they way down
|
|
411
|
+
dismissTooltip() {
|
|
412
|
+
if (this.tooltipVisible) {
|
|
413
|
+
functions.hideTooltip();
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
handleInputKeyDown(ev) {
|
|
417
|
+
if (/^.$/.test(ev.key) && this.charCount >= this.characterLimit) {
|
|
418
|
+
this.announce(this.generateCharacterLimitWarning(this.charCount, this.characterLimit));
|
|
419
|
+
}
|
|
420
|
+
// prevent keydown triggering on tag area
|
|
421
|
+
ev.stopPropagation();
|
|
422
|
+
switch (ev.key) {
|
|
423
|
+
case "Enter":
|
|
424
|
+
ev.preventDefault();
|
|
425
|
+
this.handleInputEnter();
|
|
426
|
+
break;
|
|
427
|
+
case "ArrowDown":
|
|
428
|
+
ev.preventDefault();
|
|
429
|
+
this.handleInputArrowDown();
|
|
430
|
+
break;
|
|
431
|
+
case "ArrowUp":
|
|
432
|
+
ev.preventDefault();
|
|
433
|
+
this.handleInputArrowUp();
|
|
434
|
+
break;
|
|
435
|
+
case "ArrowLeft":
|
|
436
|
+
if (this.isTable) {
|
|
437
|
+
ev.preventDefault();
|
|
438
|
+
this.focusPrevCell();
|
|
439
|
+
}
|
|
440
|
+
break;
|
|
441
|
+
case "ArrowRight":
|
|
442
|
+
if (this.isTable) {
|
|
443
|
+
ev.preventDefault();
|
|
444
|
+
this.focusNextCell();
|
|
445
|
+
}
|
|
446
|
+
break;
|
|
447
|
+
case "Escape":
|
|
448
|
+
if (this.isDropdown && this.isExpanded) {
|
|
449
|
+
this.closeDropdown();
|
|
450
|
+
}
|
|
451
|
+
break;
|
|
452
|
+
case "ArrowLeft":
|
|
453
|
+
case "Backspace":
|
|
454
|
+
this.handleInputBackspace();
|
|
455
|
+
break;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
handleInputFocus() {
|
|
459
|
+
if (this.isDropdown) {
|
|
460
|
+
this.openDropdown();
|
|
461
|
+
this.clearOptionFocus();
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
handleInputChanged(ev) {
|
|
465
|
+
this.clearOptionFocus();
|
|
466
|
+
if (this.isDropdown) {
|
|
467
|
+
if (this.charCount >= this.characterLimit - 5) {
|
|
468
|
+
this.announce(this.generateCharacterLimitWarning(this.charCount, this.characterLimit));
|
|
469
|
+
}
|
|
470
|
+
if (!this.isExpanded) {
|
|
471
|
+
this.openDropdown();
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
const val = ev.target.value;
|
|
475
|
+
if (val.includes(",") && this.addNew) {
|
|
476
|
+
this.addTags(val);
|
|
477
|
+
}
|
|
478
|
+
else {
|
|
479
|
+
this.announceExistingOptions();
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
handleInputEnter() {
|
|
483
|
+
// user has selected an option in the list
|
|
484
|
+
if (this.focusedOption) {
|
|
485
|
+
const tagName = this.getTagName(this.focusedOption);
|
|
486
|
+
this.lastAddedTags = [tagName];
|
|
487
|
+
this.focusedOption.click();
|
|
488
|
+
this.focusedOption.selected
|
|
489
|
+
? this.isTable && this.focusedOption.emitDeselectedEvent()
|
|
490
|
+
: this.focusedOption.emitSelectedEvent();
|
|
491
|
+
this.resetInput();
|
|
492
|
+
}
|
|
493
|
+
else if (this.isDropdown) {
|
|
494
|
+
// user is adding a new tag
|
|
495
|
+
const tagName = this.inputEl.value;
|
|
496
|
+
if (!!tagName) {
|
|
497
|
+
this.isExistingTag(tagName) ? this.announce(this.tagAlreadyAddedMessage(tagName)) : this.addTags(tagName);
|
|
498
|
+
this.resetInput();
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
handleInputArrowDown() {
|
|
503
|
+
if (this.isDropdown) {
|
|
504
|
+
if (!this.isExpanded) {
|
|
505
|
+
this.openDropdown();
|
|
506
|
+
}
|
|
507
|
+
else {
|
|
508
|
+
let items = [];
|
|
509
|
+
// the id check prevents a bug where the ref is reassigned to the first option causing it to be added twice (after adding a new user option)
|
|
510
|
+
if (this.addNewButton && this.addNewButton.id === "add-new-btn") {
|
|
511
|
+
items.push(this.addNewButton);
|
|
512
|
+
}
|
|
513
|
+
this.filteredOptionEls.forEach((o) => {
|
|
514
|
+
items.push(this.elFromTagOption(o));
|
|
515
|
+
});
|
|
516
|
+
const next = functions.findNext(items, this._focusedOption, true);
|
|
517
|
+
this.focusOption(next);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
else {
|
|
521
|
+
const items = this.filteredOptionEls.filter((o) => !o.locked).map((o) => this.elFromTagOption(o));
|
|
522
|
+
const next = functions.findNext(items, this._focusedOption, true);
|
|
523
|
+
this.focusOption(next);
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
handleInputArrowUp() {
|
|
527
|
+
if (this.isDropdown) {
|
|
528
|
+
if (!this.isExpanded) {
|
|
529
|
+
this.openDropdown();
|
|
530
|
+
}
|
|
531
|
+
else {
|
|
532
|
+
let items = [];
|
|
533
|
+
if (this.addNewButton) {
|
|
534
|
+
items.push(this.addNewButton);
|
|
535
|
+
}
|
|
536
|
+
this.filteredOptionEls.forEach((o) => {
|
|
537
|
+
items.push(this.elFromTagOption(o));
|
|
538
|
+
});
|
|
539
|
+
const prev = functions.findPrev(items, this._focusedOption, true);
|
|
540
|
+
this.focusOption(prev);
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
else {
|
|
544
|
+
const items = this.filteredOptionEls.filter((o) => !o.locked).map((o) => this.elFromTagOption(o));
|
|
545
|
+
const prev = functions.findPrev(items, this._focusedOption, true);
|
|
546
|
+
this.focusOption(prev);
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
handleInputBackspace() {
|
|
550
|
+
if (this.inputEl.value === "" && this.focusableTags.length > 0) {
|
|
551
|
+
// wait for events to finish firing before redirecting focus
|
|
552
|
+
// prevents double input in input area and tag area
|
|
553
|
+
window.requestAnimationFrame(() => {
|
|
554
|
+
this.tagAreaEl.focus();
|
|
555
|
+
this.focusTag(this.focusableTags[this.focusableTags.length - 1]);
|
|
556
|
+
});
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
handleTagAreaKeyDown(ev) {
|
|
560
|
+
switch (ev.key) {
|
|
561
|
+
case "ArrowLeft":
|
|
562
|
+
case "ArrowUp":
|
|
563
|
+
ev.preventDefault();
|
|
564
|
+
if (this.focusedTag) {
|
|
565
|
+
const prev = functions.findPrev(this.focusableTags, this.focusedTag, true);
|
|
566
|
+
this.focusTag(prev);
|
|
567
|
+
}
|
|
568
|
+
break;
|
|
569
|
+
case "ArrowRight":
|
|
570
|
+
case "ArrowDown":
|
|
571
|
+
ev.preventDefault();
|
|
572
|
+
if (this.focusedTag) {
|
|
573
|
+
const next = functions.findNext(this.focusableTags, this.focusedTag, true);
|
|
574
|
+
this.focusTag(next);
|
|
575
|
+
}
|
|
576
|
+
break;
|
|
577
|
+
case "Backspace":
|
|
578
|
+
case "Delete":
|
|
579
|
+
if (this.focusedTag) {
|
|
580
|
+
const option = this.tagOptionFromTag(this.focusedTag);
|
|
581
|
+
if (!option.locked) {
|
|
582
|
+
option.emitDeselectedEvent();
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
break;
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
handleBlur(ev) {
|
|
589
|
+
this.dismissTooltip();
|
|
590
|
+
this.clearOptionFocus();
|
|
591
|
+
const relTarget = ev.relatedTarget;
|
|
592
|
+
if (!this.isElOrChild(relTarget)) {
|
|
593
|
+
this.fieldWrapperEl.classList.remove("focused");
|
|
594
|
+
if (this.isDropdown) {
|
|
595
|
+
this.closeDropdown();
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
handleTagAreaFocus(ev) {
|
|
600
|
+
if (this.isDropdown) {
|
|
601
|
+
this.closeDropdown();
|
|
602
|
+
}
|
|
603
|
+
if (this.focusableTags.length > 0) {
|
|
604
|
+
const relTarget = ev.relatedTarget;
|
|
605
|
+
if (relTarget && relTarget.id === "input") {
|
|
606
|
+
const lastFocusableTag = this.focusableTags[this.focusableTags.length - 1];
|
|
607
|
+
this.focusTag(lastFocusableTag);
|
|
608
|
+
}
|
|
609
|
+
else {
|
|
610
|
+
const firstFocusableTag = this.focusableTags[0];
|
|
611
|
+
this.focusTag(firstFocusableTag);
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
focusPrevCell() {
|
|
616
|
+
if (this.focusedOption) {
|
|
617
|
+
if (this.focusedColumn > 0) {
|
|
618
|
+
this.focusedColumn -= 1;
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
focusNextCell() {
|
|
623
|
+
if (this._focusedOption) {
|
|
624
|
+
const lastCellIdx = this._focusedOption.querySelectorAll("td").length - 1;
|
|
625
|
+
if (this.focusedColumn < lastCellIdx) {
|
|
626
|
+
this.focusedColumn += 1;
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
focusOption(optionToFocus) {
|
|
631
|
+
if (optionToFocus) {
|
|
632
|
+
// will be undefined for the "Add New" button
|
|
633
|
+
this.focusedOption = this.tagOptionFromEl(optionToFocus);
|
|
634
|
+
if (optionToFocus === this.addNewButton) {
|
|
635
|
+
this.addNewButton.classList.add("focused");
|
|
636
|
+
}
|
|
637
|
+
else {
|
|
638
|
+
this.addNewButton && this.addNewButton.classList.remove("focused");
|
|
639
|
+
}
|
|
640
|
+
if (this.isTable) {
|
|
641
|
+
// tooltip
|
|
642
|
+
const contentWrapper = this._focusedOption.querySelector(".cell-content-wrapper");
|
|
643
|
+
const isTruncated = contentWrapper.scrollWidth > contentWrapper.clientWidth;
|
|
644
|
+
this.dismissTooltip();
|
|
645
|
+
if (isTruncated) {
|
|
646
|
+
// innerText is necessary vs textContent, as innerText ignores sr-only / display: none text
|
|
647
|
+
functions.showTooltip("bottom", this._focusedOption, this._focusedOption.innerText);
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
optionToFocus.scrollIntoView({ block: "nearest" });
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
showTooltipIfTruncated(el) {
|
|
654
|
+
const displayedText = el.querySelector(".tag-text").textContent;
|
|
655
|
+
const id = el.id.replace("tag-", "");
|
|
656
|
+
if (id) {
|
|
657
|
+
const tagEl = this.el.querySelector("#" + id);
|
|
658
|
+
const fullText = this.getTagName(tagEl);
|
|
659
|
+
if (displayedText !== fullText && displayedText.includes("...")) {
|
|
660
|
+
functions.showTooltip("bottom", el, fullText);
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
focusTag(element) {
|
|
665
|
+
// technically it's the tag area that has focus. This function handles the aria-activedescendant value within that parent
|
|
666
|
+
this.focusedTagIndex = this.focusableTags.indexOf(element);
|
|
667
|
+
element.scrollIntoView({ block: "nearest" });
|
|
668
|
+
window.requestAnimationFrame(() => {
|
|
669
|
+
functions.hideTooltip();
|
|
670
|
+
this.showTooltipIfTruncated(element);
|
|
515
671
|
});
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
672
|
+
}
|
|
673
|
+
clearOptionFocus() {
|
|
674
|
+
this.focusedOption = undefined;
|
|
675
|
+
this.focusedColumn = 0;
|
|
676
|
+
}
|
|
677
|
+
openDropdown() {
|
|
678
|
+
// offset of -2px to avoid overlapping the focus border
|
|
679
|
+
this.openUp = functions.shouldOpenUp(this.el, this.dropdownEl.clientHeight, this.el.clientHeight, -2);
|
|
680
|
+
this.isExpanded = true;
|
|
681
|
+
}
|
|
682
|
+
closeDropdown() {
|
|
683
|
+
this.clearOptionFocus();
|
|
684
|
+
this.isExpanded = false;
|
|
685
|
+
}
|
|
686
|
+
resetInput() {
|
|
687
|
+
this.inputEl.value = "";
|
|
688
|
+
}
|
|
689
|
+
announce(message) {
|
|
690
|
+
// \u00A0 is a non-breaking space character, which causes the message to be read as a new one
|
|
691
|
+
if (this.liveRegionEl.textContent === message) {
|
|
692
|
+
message += "\u00A0";
|
|
693
|
+
}
|
|
694
|
+
this.liveRegionMessage = message;
|
|
695
|
+
}
|
|
696
|
+
addTags(tagNames) {
|
|
697
|
+
// covers both typing "," and pasting in text that includes ","
|
|
698
|
+
// if tag added without "," (typing enter), split puts the whole string in an array
|
|
699
|
+
this.lastAddedTags = tagNames.split(",").filter((t) => t.match(/\S/));
|
|
700
|
+
this.lastAddedTags.forEach((tag) => {
|
|
701
|
+
this.wmTagInputTagAdded.emit(tag);
|
|
538
702
|
});
|
|
539
|
-
|
|
540
|
-
this.
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
ev.preventDefault();
|
|
564
|
-
if (this.focusedTag) {
|
|
565
|
-
const prev = functions.findPrev(this.focusableTags, this.focusedTag, true);
|
|
566
|
-
this.focusTag(prev);
|
|
703
|
+
this.announce(this.tagAddedMessage(this.lastAddedTags.join(", ")));
|
|
704
|
+
this.resetInput();
|
|
705
|
+
}
|
|
706
|
+
announceExistingOptions() {
|
|
707
|
+
// request animation frame to wait for re-rendering of filtered options
|
|
708
|
+
window.requestAnimationFrame(() => {
|
|
709
|
+
let numResults = 0;
|
|
710
|
+
if (this.isDropdown) {
|
|
711
|
+
numResults = this.optionEls.length;
|
|
712
|
+
}
|
|
713
|
+
else if (this.isTable) {
|
|
714
|
+
numResults = this.filteredOptionEls.length;
|
|
715
|
+
}
|
|
716
|
+
const existingOptionsMessage = functions.intl.formatMessage({
|
|
717
|
+
id: "tagInput.existingOptions",
|
|
718
|
+
defaultMessage: "{num, plural, one {1 existing option.} other {# existing options.}}",
|
|
719
|
+
}, { num: numResults });
|
|
720
|
+
this.announce(existingOptionsMessage);
|
|
721
|
+
});
|
|
722
|
+
}
|
|
723
|
+
generateCharacterLimitWarning(charCount, charLimit) {
|
|
724
|
+
let message = intl.globalMessages.getCharactersEntered(charCount, charLimit);
|
|
725
|
+
if (charCount >= charLimit) {
|
|
726
|
+
message += ` ${intl.globalMessages.characterLimitReached}`;
|
|
567
727
|
}
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
const
|
|
611
|
-
this.
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
728
|
+
return message;
|
|
729
|
+
}
|
|
730
|
+
positionInput() {
|
|
731
|
+
if (this.tagAreaEl) {
|
|
732
|
+
const lastTag = this._tagEls[this._tagEls.length - 1];
|
|
733
|
+
// default placement to fall back to when no tags are present, or not enough space is available
|
|
734
|
+
this.inputEl.style.position = "static";
|
|
735
|
+
this.inputEl.style.width = "100%";
|
|
736
|
+
this.inputEl.classList.add("extended");
|
|
737
|
+
if (lastTag) {
|
|
738
|
+
const spaceAvailable = this.tagAreaEl.getBoundingClientRect().right - lastTag.getBoundingClientRect().right;
|
|
739
|
+
if (spaceAvailable >= this.inputMinimumWidth) {
|
|
740
|
+
// because the input has right: 0px
|
|
741
|
+
// all thats needed to properly place it is setting position: absolute, top, and width
|
|
742
|
+
this.inputEl.style.position = "absolute";
|
|
743
|
+
this.inputEl.style.top = lastTag.offsetTop.toString() + "px";
|
|
744
|
+
this.inputEl.style.width = (spaceAvailable - 8).toString() + "px";
|
|
745
|
+
this.inputEl.classList.remove("extended");
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
handleTagMouseEnter(ev) {
|
|
751
|
+
this.showTooltipIfTruncated(ev.target);
|
|
752
|
+
}
|
|
753
|
+
renderDropdown() {
|
|
754
|
+
return (index.h("div", { class: `dropdown-wrapper ${this.isExpanded ? "open" : ""} ${this.openUp ? "upwards" : ""}`, ref: (el) => (this.dropdownEl = el) }, index.h("div", { id: "help-text", class: "help-text" }, this.renderHelpText()), index.h("ul", { class: "dropdown", id: "dropdown", role: "listbox", "aria-multiselectable": "true", "aria-expanded": this.isExpanded ? "true" : "false", "aria-label": this.label, tabindex: -1 }, this.inputEl && this.renderAddNewButton(), this.filteredOptionEls.map((o) => this.renderListItem(o)))));
|
|
755
|
+
}
|
|
756
|
+
renderHelpText() {
|
|
757
|
+
if (this.helpText)
|
|
758
|
+
return this.helpText;
|
|
759
|
+
let helpText = "";
|
|
760
|
+
if (this.optionEls.length > 0) {
|
|
761
|
+
helpText = this.selectionHelpText;
|
|
762
|
+
}
|
|
763
|
+
if (this.addNew) {
|
|
764
|
+
helpText += " " + this.addNewHelpText;
|
|
765
|
+
}
|
|
766
|
+
return helpText;
|
|
767
|
+
}
|
|
768
|
+
renderAddNewButton() {
|
|
769
|
+
const inputValue = this.inputEl.value.trim();
|
|
770
|
+
const hasNonWhiteSpaceCharacters = this.inputEl.value.match(/\S/);
|
|
771
|
+
const optionAlreadyExists = this.isExistingTag(this.inputEl.value.trim());
|
|
772
|
+
return (this.addNew &&
|
|
773
|
+
hasNonWhiteSpaceCharacters &&
|
|
774
|
+
!optionAlreadyExists && (index.h("li", { ref: (el) => (this.addNewButton = el), id: "add-new-btn", class: "add-new-btn", onClick: () => this.addTags(inputValue) }, "Add " + inputValue)));
|
|
775
|
+
}
|
|
776
|
+
renderTable() {
|
|
777
|
+
return (index.h("div", { class: "table-wrapper", onScroll: () => this.dismissTooltip() }, index.h("table", { id: "table", role: "grid", class: `${this.colWidths ? "fixed-widths" : ""}`, "aria-label": this.label, "aria-multiselectable": "true" }, this.renderTableHeaders(), this.filteredOptionEls.length ? (this.filteredOptionEls.map((o) => this.renderTableRow(o))) : (index.h("div", { class: "no-results" }, this.noResultsMessage)))));
|
|
778
|
+
}
|
|
779
|
+
renderTableHeaders() {
|
|
780
|
+
return (index.h("tr", { class: "headers", role: "row" }, functions.csvToArray(this.colHeaders).map((header, idx) => {
|
|
781
|
+
let overflowRule = "wrap";
|
|
782
|
+
if (this.colWrap && functions.csvToArray(this.colWrap)[idx]) {
|
|
783
|
+
overflowRule = functions.csvToArray(this.colWrap)[idx];
|
|
784
|
+
}
|
|
785
|
+
return (index.h("th", { class: `header-cell ${overflowRule}`, role: "columnheader",
|
|
786
|
+
// @ts-ignore
|
|
787
|
+
width: this.colWidths ? functions.csvToArray(this.colWidths)[idx] : "" }, header));
|
|
788
|
+
})));
|
|
789
|
+
}
|
|
790
|
+
renderTag(o) {
|
|
791
|
+
const focused = this.focusedTag && this.focusedTag.id === "tag-" + o.id ? "focused" : "";
|
|
792
|
+
const tagName = this.getTagName(o);
|
|
793
|
+
const highlight = this.lastAddedTags.includes(tagName) ? "highlight" : "";
|
|
794
|
+
return (index.h("li", { id: "tag-" + o.id, role: "option", class: `tag ${highlight} ${focused} ${o.locked ? "locked" : ""}`, onMouseEnter: (ev) => this.handleTagMouseEnter(ev), onMouseLeave: functions.hideTooltip }, index.h("span", { class: "sr-only" }, tagName), index.h("span", { class: "tag-text", "aria-hidden": "true" }, tagName), o.locked ? (index.h("div", { class: "icon lock" })) : (index.h("button", { class: "icon remove-btn", tabIndex: -1, onClick: () => o.emitDeselectedEvent() }))));
|
|
795
|
+
}
|
|
796
|
+
renderTags() {
|
|
797
|
+
return this.tagsList.map((o) => this.renderTag(o));
|
|
798
|
+
}
|
|
799
|
+
renderTagCounter() {
|
|
800
|
+
if (this.maxTags) {
|
|
801
|
+
return (index.h("div", { class: "lower-row" }, index.h("div", { id: "max-tags" }, this.renderMaxTags())));
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
renderMaxTags() {
|
|
805
|
+
if (this.helpText) {
|
|
806
|
+
return this.helpText;
|
|
807
|
+
}
|
|
808
|
+
else {
|
|
809
|
+
let msg = `${this.tagsAddedMessage}: ${this.taggedOptions.length}/${this.maxTags}`;
|
|
810
|
+
if (this.tagLimitReached) {
|
|
811
|
+
msg += `- ${this.maxTagsReachedMessage}`;
|
|
812
|
+
}
|
|
813
|
+
return msg;
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
handleCellMouseEnter(ev) {
|
|
817
|
+
const cell = ev.target;
|
|
818
|
+
const contentWrapper = cell.querySelector(".cell-content-wrapper");
|
|
643
819
|
const isTruncated = contentWrapper.scrollWidth > contentWrapper.clientWidth;
|
|
644
|
-
this.dismissTooltip();
|
|
645
820
|
if (isTruncated) {
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
if (this.liveRegionEl.textContent === message) {
|
|
692
|
-
message += "\u00A0";
|
|
693
|
-
}
|
|
694
|
-
this.liveRegionMessage = message;
|
|
695
|
-
}
|
|
696
|
-
addTags(tagNames) {
|
|
697
|
-
// covers both typing "," and pasting in text that includes ","
|
|
698
|
-
// if tag added without "," (typing enter), split puts the whole string in an array
|
|
699
|
-
this.lastAddedTags = tagNames.split(",").filter((t) => t.match(/\S/));
|
|
700
|
-
this.lastAddedTags.forEach((tag) => {
|
|
701
|
-
this.wmTagInputTagAdded.emit(tag);
|
|
702
|
-
});
|
|
703
|
-
this.announce(this.tagAddedMessage(this.lastAddedTags.join(", ")));
|
|
704
|
-
this.resetInput();
|
|
705
|
-
}
|
|
706
|
-
announceExistingOptions() {
|
|
707
|
-
// request animation frame to wait for re-rendering of filtered options
|
|
708
|
-
window.requestAnimationFrame(() => {
|
|
709
|
-
let numResults = 0;
|
|
710
|
-
if (this.isDropdown) {
|
|
711
|
-
numResults = this.optionEls.length;
|
|
712
|
-
}
|
|
713
|
-
else if (this.isTable) {
|
|
714
|
-
numResults = this.filteredOptionEls.length;
|
|
715
|
-
}
|
|
716
|
-
const existingOptionsMessage = functions.intl.formatMessage({
|
|
717
|
-
id: "tagInput.existingOptions",
|
|
718
|
-
defaultMessage: "{num, plural, one {1 existing option.} other {# existing options.}}",
|
|
719
|
-
}, { num: numResults });
|
|
720
|
-
this.announce(existingOptionsMessage);
|
|
721
|
-
});
|
|
722
|
-
}
|
|
723
|
-
generateCharacterLimitWarning(charCount, charLimit) {
|
|
724
|
-
let message = intl.globalMessages.getCharactersEntered(charCount, charLimit);
|
|
725
|
-
if (charCount >= charLimit) {
|
|
726
|
-
message += ` ${intl.globalMessages.characterLimitReached}`;
|
|
727
|
-
}
|
|
728
|
-
return message;
|
|
729
|
-
}
|
|
730
|
-
positionInput() {
|
|
731
|
-
if (this.tagAreaEl) {
|
|
732
|
-
const lastTag = this._tagEls[this._tagEls.length - 1];
|
|
733
|
-
// default placement to fall back to when no tags are present, or not enough space is available
|
|
734
|
-
this.inputEl.style.position = "static";
|
|
735
|
-
this.inputEl.style.width = "100%";
|
|
736
|
-
this.inputEl.classList.add("extended");
|
|
737
|
-
if (lastTag) {
|
|
738
|
-
const spaceAvailable = this.tagAreaEl.getBoundingClientRect().right - lastTag.getBoundingClientRect().right;
|
|
739
|
-
if (spaceAvailable >= this.inputMinimumWidth) {
|
|
740
|
-
// because the input has right: 0px
|
|
741
|
-
// all thats needed to properly place it is setting position: absolute, top, and width
|
|
742
|
-
this.inputEl.style.position = "absolute";
|
|
743
|
-
this.inputEl.style.top = lastTag.offsetTop.toString() + "px";
|
|
744
|
-
this.inputEl.style.width = (spaceAvailable - 8).toString() + "px";
|
|
745
|
-
this.inputEl.classList.remove("extended");
|
|
746
|
-
}
|
|
747
|
-
}
|
|
748
|
-
}
|
|
749
|
-
}
|
|
750
|
-
handleTagMouseEnter(ev) {
|
|
751
|
-
this.showTooltipIfTruncated(ev.target);
|
|
752
|
-
}
|
|
753
|
-
renderDropdown() {
|
|
754
|
-
return (index.h("div", { class: `dropdown-wrapper ${this.isExpanded ? "open" : ""} ${this.openUp ? "upwards" : ""}`, ref: (el) => (this.dropdownEl = el) }, index.h("div", { id: "help-text", class: "help-text" }, this.renderHelpText()), index.h("ul", { class: "dropdown", id: "dropdown", role: "listbox", "aria-multiselectable": "true", "aria-expanded": this.isExpanded ? "true" : "false", "aria-label": this.label, tabindex: -1 }, this.inputEl && this.renderAddNewButton(), this.filteredOptionEls.map((o) => this.renderListItem(o)))));
|
|
755
|
-
}
|
|
756
|
-
renderHelpText() {
|
|
757
|
-
if (this.helpText)
|
|
758
|
-
return this.helpText;
|
|
759
|
-
let helpText = "";
|
|
760
|
-
if (this.optionEls.length > 0) {
|
|
761
|
-
helpText = this.selectionHelpText;
|
|
762
|
-
}
|
|
763
|
-
if (this.addNew) {
|
|
764
|
-
helpText += " " + this.addNewHelpText;
|
|
765
|
-
}
|
|
766
|
-
return helpText;
|
|
767
|
-
}
|
|
768
|
-
renderAddNewButton() {
|
|
769
|
-
const inputValue = this.inputEl.value.trim();
|
|
770
|
-
const hasNonWhiteSpaceCharacters = this.inputEl.value.match(/\S/);
|
|
771
|
-
const optionAlreadyExists = this.isExistingTag(this.inputEl.value.trim());
|
|
772
|
-
return (this.addNew &&
|
|
773
|
-
hasNonWhiteSpaceCharacters &&
|
|
774
|
-
!optionAlreadyExists && (index.h("li", { ref: (el) => (this.addNewButton = el), id: "add-new-btn", class: "add-new-btn", onClick: () => this.addTags(inputValue) }, "Add " + inputValue)));
|
|
775
|
-
}
|
|
776
|
-
renderTable() {
|
|
777
|
-
return (index.h("div", { class: "table-wrapper", onScroll: () => this.dismissTooltip() }, index.h("table", { id: "table", role: "grid", class: `${this.colWidths ? "fixed-widths" : ""}`, "aria-label": this.label, "aria-multiselectable": "true" }, this.renderTableHeaders(), this.filteredOptionEls.length ? (this.filteredOptionEls.map((o) => this.renderTableRow(o))) : (index.h("div", { class: "no-results" }, this.noResultsMessage)))));
|
|
778
|
-
}
|
|
779
|
-
renderTableHeaders() {
|
|
780
|
-
return (index.h("tr", { class: "headers", role: "row" }, functions.csvToArray(this.colHeaders).map((header, idx) => {
|
|
781
|
-
let overflowRule = "wrap";
|
|
782
|
-
if (this.colWrap && functions.csvToArray(this.colWrap)[idx]) {
|
|
783
|
-
overflowRule = functions.csvToArray(this.colWrap)[idx];
|
|
784
|
-
}
|
|
785
|
-
return (index.h("th", { class: `header-cell ${overflowRule}`, role: "columnheader",
|
|
786
|
-
// @ts-ignore
|
|
787
|
-
width: this.colWidths ? functions.csvToArray(this.colWidths)[idx] : "" }, header));
|
|
788
|
-
})));
|
|
789
|
-
}
|
|
790
|
-
renderTag(o) {
|
|
791
|
-
const focused = this.focusedTag && this.focusedTag.id === "tag-" + o.id ? "focused" : "";
|
|
792
|
-
const tagName = this.getTagName(o);
|
|
793
|
-
const highlight = this.lastAddedTags.includes(tagName) ? "highlight" : "";
|
|
794
|
-
return (index.h("li", { id: "tag-" + o.id, role: "option", class: `tag ${highlight} ${focused} ${o.locked ? "locked" : ""}`, onMouseEnter: (ev) => this.handleTagMouseEnter(ev), onMouseLeave: functions.hideTooltip }, index.h("span", { class: "sr-only" }, tagName), index.h("span", { class: "tag-text", "aria-hidden": "true" }, tagName), o.locked ? (index.h("div", { class: "icon lock" })) : (index.h("button", { class: "icon remove-btn", tabIndex: -1, onClick: () => o.emitDeselectedEvent() }))));
|
|
795
|
-
}
|
|
796
|
-
renderTags() {
|
|
797
|
-
return this.tagsList.map((o) => this.renderTag(o));
|
|
798
|
-
}
|
|
799
|
-
renderTagCounter() {
|
|
800
|
-
if (this.maxTags) {
|
|
801
|
-
return (index.h("div", { class: "lower-row" }, index.h("div", { id: "max-tags" }, this.renderMaxTags())));
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
renderMaxTags() {
|
|
805
|
-
if (this.helpText) {
|
|
806
|
-
return this.helpText;
|
|
807
|
-
}
|
|
808
|
-
else {
|
|
809
|
-
let msg = `${this.tagsAddedMessage}: ${this.taggedOptions.length}/${this.maxTags}`;
|
|
810
|
-
if (this.tagLimitReached) {
|
|
811
|
-
msg += `- ${this.maxTagsReachedMessage}`;
|
|
812
|
-
}
|
|
813
|
-
return msg;
|
|
814
|
-
}
|
|
815
|
-
}
|
|
816
|
-
handleCellMouseEnter(ev) {
|
|
817
|
-
const cell = ev.target;
|
|
818
|
-
const contentWrapper = cell.querySelector(".cell-content-wrapper");
|
|
819
|
-
const isTruncated = contentWrapper.scrollWidth > contentWrapper.clientWidth;
|
|
820
|
-
if (isTruncated) {
|
|
821
|
-
// innerText is necessary vs textContent, as innerText ignores sr-only / display: none text
|
|
822
|
-
functions.showTooltip("bottom", cell, cell.innerText);
|
|
823
|
-
}
|
|
824
|
-
}
|
|
825
|
-
renderTableCells(o) {
|
|
826
|
-
const colValues = [o.col1, o.col2, o.col3, o.col4].filter((val) => !!val);
|
|
827
|
-
return colValues.map((val, idx) => {
|
|
828
|
-
const cellId = `${o.id}-col${idx + 1}`;
|
|
829
|
-
let overflowRule = "wrap";
|
|
830
|
-
if (this.colWrap && functions.csvToArray(this.colWrap)[idx]) {
|
|
831
|
-
overflowRule = functions.csvToArray(this.colWrap)[idx];
|
|
832
|
-
}
|
|
833
|
-
const classes = {
|
|
834
|
-
focused: !!this._focusedCell && cellId === this._focusedCell.id,
|
|
835
|
-
};
|
|
836
|
-
return (index.h("td", { id: cellId, class: classes, role: "gridcell", "aria-describedby": `${cellId}-description`, "aria-selected": o.selected ? "true" : "false", onMouseEnter: (ev) => this.handleCellMouseEnter(ev), onMouseLeave: () => functions.hideTooltip() }, index.h("div", { class: `cell-content-wrapper ${overflowRule}` }, val), index.h("div", { class: "description", id: `${cellId}-description` }, o.locked ? "locked" : "")));
|
|
837
|
-
});
|
|
838
|
-
}
|
|
839
|
-
renderTableRow(o) {
|
|
840
|
-
const classes = {
|
|
841
|
-
selected: o.selected,
|
|
842
|
-
locked: o.locked,
|
|
843
|
-
focused: this.focusedOption && o === this.focusedOption ? true : false,
|
|
844
|
-
};
|
|
845
|
-
return (index.h("tr", { id: o.id, class: classes, onClick: (ev) => this.handleOptionClick(ev) }, this.renderTableCells(o)));
|
|
846
|
-
}
|
|
847
|
-
renderListItem(o) {
|
|
848
|
-
if (!!this.inputEl) {
|
|
849
|
-
const isFocused = this.focusedOption && o === this.focusedOption;
|
|
850
|
-
return (index.h("li", { id: o.id, role: "option", class: `option ${isFocused ? "focused" : ""}`, "aria-selected": o.selected ? "true" : "false", onClick: (ev) => this.handleOptionClick(ev) }, o.textContent));
|
|
851
|
-
}
|
|
852
|
-
}
|
|
853
|
-
render() {
|
|
854
|
-
return (index.h("div", { class: `wrapper label-${this.labelPosition} ${this.errorMessage ? "invalid" : ""}` }, index.h("div", { class: "label-wrapper" }, index.h("label", { class: "label", htmlFor: "input" }, this.label, this.requiredField && (index.h("span", { class: "required", "aria-hidden": "true" }, "*")))), index.h("div", { class: `field-wrapper ${this.el.shadowRoot.activeElement === this.inputEl ? "focused" : ""} ${this.errorMessage ? "invalid" : ""}`, ref: (el) => (this.fieldWrapperEl = el) }, index.h("div", { class: "upper-row" }, index.h("div", { class: `tags-and-input-wrapper ${this.inModal ? "in-modal" : ""}` }, index.h("ul", { ref: (el) => (this.tagAreaEl = el), class: `tag-area ${this.taggedOptions.length === 0 && "empty"}`, role: "listbox", "aria-activedescendant": this.focusedTag ? this.focusedTag.id : null, "aria-orientation": "horizontal", "aria-label": `${this.label} ${this.tagAreaInstructions}`, tabindex: this.focusableTags.length > 0 ? 0 : -1, "aria-describedby": `info max-tags`, onFocus: (ev) => this.handleTagAreaFocus(ev), onBlur: (ev) => {
|
|
855
|
-
this.focusedTagIndex = undefined;
|
|
856
|
-
this.handleBlur(ev);
|
|
857
|
-
}, onKeyDown: (ev) => this.handleTagAreaKeyDown(ev) }, this.renderTags()), index.h("input", { id: "input", class: "input", role: "combobox", ref: (el) => (this.inputEl = el), autocomplete: "off", "aria-required": this.requiredField ? "true" : null, "aria-controls": this.tagInputType, "aria-describedby": `help-text${this.errorMessage ? " error " : ""}`, "aria-label": `${this.label} ${this.isDropdown ? intl.globalMessages.getCharacterLimit(this.characterLimit) : ""}`, "aria-expanded": this.isDropdown ? this.isExpanded.toString() : null, "aria-activedescendant": this.inputActiveDescendantId, placeholder: this.placeholder, maxLength: this.isDropdown ? this.characterLimit : undefined, onInput: (ev) => this.handleInputChanged(ev), onBlur: (ev) => {
|
|
858
|
-
this.handleBlur(ev);
|
|
859
|
-
}, onFocus: () => this.handleInputFocus(), onKeyDown: (ev) => this.handleInputKeyDown(ev) })), this.isDropdown && (index.h("div", { class: "character-count" }, this.charCount, "/", this.characterLimit))), this.renderTagCounter(), this.isDropdown && this.renderDropdown()), this.info && (index.h("div", { id: "info", class: "info-text" }, this.info)), this.errorMessage && index.h("div", { id: "error" }, this.errorMessage), index.h("div", { class: "sr-only", "aria-live": "assertive", ref: (el) => (this.liveRegionEl = el), "aria-atomic": "true" }, this.liveRegionMessage), this.isTable && this.renderTable()));
|
|
860
|
-
}
|
|
861
|
-
static get delegatesFocus() { return true; }
|
|
862
|
-
get el() { return index.getElement(this); }
|
|
863
|
-
static get watchers() { return {
|
|
864
|
-
"errorMessage": ["handleErrorMessageChange"]
|
|
865
|
-
}; }
|
|
821
|
+
// innerText is necessary vs textContent, as innerText ignores sr-only / display: none text
|
|
822
|
+
functions.showTooltip("bottom", cell, cell.innerText);
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
renderTableCells(o) {
|
|
826
|
+
const colValues = [o.col1, o.col2, o.col3, o.col4].filter((val) => !!val);
|
|
827
|
+
return colValues.map((val, idx) => {
|
|
828
|
+
const cellId = `${o.id}-col${idx + 1}`;
|
|
829
|
+
let overflowRule = "wrap";
|
|
830
|
+
if (this.colWrap && functions.csvToArray(this.colWrap)[idx]) {
|
|
831
|
+
overflowRule = functions.csvToArray(this.colWrap)[idx];
|
|
832
|
+
}
|
|
833
|
+
const classes = {
|
|
834
|
+
focused: !!this._focusedCell && cellId === this._focusedCell.id,
|
|
835
|
+
};
|
|
836
|
+
return (index.h("td", { id: cellId, class: classes, role: "gridcell", "aria-describedby": `${cellId}-description`, "aria-selected": o.selected ? "true" : "false", onMouseEnter: (ev) => this.handleCellMouseEnter(ev), onMouseLeave: () => functions.hideTooltip() }, index.h("div", { class: `cell-content-wrapper ${overflowRule}` }, val), index.h("div", { class: "description", id: `${cellId}-description` }, o.locked ? "locked" : "")));
|
|
837
|
+
});
|
|
838
|
+
}
|
|
839
|
+
renderTableRow(o) {
|
|
840
|
+
const classes = {
|
|
841
|
+
selected: o.selected,
|
|
842
|
+
locked: o.locked,
|
|
843
|
+
focused: this.focusedOption && o === this.focusedOption ? true : false,
|
|
844
|
+
};
|
|
845
|
+
return (index.h("tr", { id: o.id, class: classes, onClick: (ev) => this.handleOptionClick(ev) }, this.renderTableCells(o)));
|
|
846
|
+
}
|
|
847
|
+
renderListItem(o) {
|
|
848
|
+
if (!!this.inputEl) {
|
|
849
|
+
const isFocused = this.focusedOption && o === this.focusedOption;
|
|
850
|
+
return (index.h("li", { id: o.id, role: "option", class: `option ${isFocused ? "focused" : ""}`, "aria-selected": o.selected ? "true" : "false", onClick: (ev) => this.handleOptionClick(ev) }, o.textContent));
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
render() {
|
|
854
|
+
return (index.h("div", { class: `wrapper label-${this.labelPosition} ${this.errorMessage ? "invalid" : ""}` }, index.h("div", { class: "label-wrapper" }, index.h("label", { class: "label", htmlFor: "input" }, this.label, this.requiredField && (index.h("span", { class: "required", "aria-hidden": "true" }, "*")))), index.h("div", { class: `field-wrapper ${this.el.shadowRoot.activeElement === this.inputEl ? "focused" : ""} ${this.errorMessage ? "invalid" : ""}`, ref: (el) => (this.fieldWrapperEl = el) }, index.h("div", { class: "upper-row" }, index.h("div", { class: `tags-and-input-wrapper ${this.inModal ? "in-modal" : ""}` }, index.h("ul", { ref: (el) => (this.tagAreaEl = el), class: `tag-area ${this.taggedOptions.length === 0 && "empty"}`, role: "listbox", "aria-activedescendant": this.focusedTag ? this.focusedTag.id : null, "aria-orientation": "horizontal", "aria-label": `${this.label} ${this.tagAreaInstructions}`, tabindex: this.focusableTags.length > 0 ? 0 : -1, "aria-describedby": `info max-tags`, onFocus: (ev) => this.handleTagAreaFocus(ev), onBlur: (ev) => {
|
|
855
|
+
this.focusedTagIndex = undefined;
|
|
856
|
+
this.handleBlur(ev);
|
|
857
|
+
}, onKeyDown: (ev) => this.handleTagAreaKeyDown(ev) }, this.renderTags()), index.h("input", { id: "input", class: "input", role: "combobox", ref: (el) => (this.inputEl = el), autocomplete: "off", "aria-required": this.requiredField ? "true" : null, "aria-controls": this.tagInputType, "aria-describedby": `help-text${this.errorMessage ? " error " : ""}`, "aria-label": `${this.label} ${this.isDropdown ? intl.globalMessages.getCharacterLimit(this.characterLimit) : ""}`, "aria-expanded": this.isDropdown ? this.isExpanded.toString() : null, "aria-activedescendant": this.inputActiveDescendantId, placeholder: this.placeholder, maxLength: this.isDropdown ? this.characterLimit : undefined, onInput: (ev) => this.handleInputChanged(ev), onBlur: (ev) => {
|
|
858
|
+
this.handleBlur(ev);
|
|
859
|
+
}, onFocus: () => this.handleInputFocus(), onKeyDown: (ev) => this.handleInputKeyDown(ev) })), this.isDropdown && (index.h("div", { class: "character-count" }, this.charCount, "/", this.characterLimit))), this.renderTagCounter(), this.isDropdown && this.renderDropdown()), this.info && (index.h("div", { id: "info", class: "info-text" }, this.info)), this.errorMessage && index.h("div", { id: "error" }, this.errorMessage), index.h("div", { class: "sr-only", "aria-live": "assertive", ref: (el) => (this.liveRegionEl = el), "aria-atomic": "true" }, this.liveRegionMessage), this.isTable && this.renderTable()));
|
|
860
|
+
}
|
|
861
|
+
static get delegatesFocus() { return true; }
|
|
862
|
+
get el() { return index.getElement(this); }
|
|
863
|
+
static get watchers() { return {
|
|
864
|
+
"errorMessage": ["handleErrorMessageChange"]
|
|
865
|
+
}; }
|
|
866
866
|
};
|
|
867
867
|
TagInput.style = wmTagInputCss;
|
|
868
868
|
|