@watermarkinsights/ripple 5.3.0-9 → 5.3.1-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-86227b27.js → chartFunctions-0238043b.js} +3 -3
- package/dist/cjs/{functions-05e7ad5a.js → functions-3be85c6d.js} +7 -104
- package/dist/{esm/app-globals-17afed20.js → cjs/global-c7fa7be9.js} +2 -7
- package/dist/cjs/index-e86c28b6.js +2641 -0
- package/dist/cjs/{intl-2b550151.js → intl-567eb9d8.js} +1 -1
- package/dist/cjs/loader.cjs.js +3 -4
- package/dist/cjs/priv-calendar.cjs.entry.js +26 -27
- package/dist/cjs/priv-chart-popover.cjs.entry.js +17 -16
- package/dist/cjs/priv-navigator-button.cjs.entry.js +3 -4
- package/dist/cjs/priv-navigator-item.cjs.entry.js +3 -4
- package/dist/cjs/ripple.cjs.js +11 -12
- package/dist/cjs/wm-action-menu_2.cjs.entry.js +6 -8
- package/dist/cjs/wm-button.cjs.entry.js +4 -5
- package/dist/cjs/wm-chart-slice.cjs.entry.js +1 -1
- package/dist/cjs/wm-chart.cjs.entry.js +6 -7
- package/dist/cjs/wm-date-range.cjs.entry.js +12 -14
- package/dist/cjs/wm-datepicker.cjs.entry.js +7 -8
- package/dist/cjs/wm-file-list.cjs.entry.js +3 -4
- package/dist/cjs/wm-file.cjs.entry.js +4 -5
- package/dist/cjs/wm-input.cjs.entry.js +5 -6
- package/dist/cjs/wm-line-chart.cjs.entry.js +14 -15
- package/dist/cjs/wm-modal-footer.cjs.entry.js +3 -4
- package/dist/cjs/wm-modal-header.cjs.entry.js +5 -6
- package/dist/cjs/wm-modal.cjs.entry.js +5 -6
- package/dist/cjs/wm-navigation_3.cjs.entry.js +10 -13
- package/dist/cjs/wm-navigator.cjs.entry.js +3 -4
- package/dist/cjs/wm-option_2.cjs.entry.js +8 -10
- package/dist/cjs/wm-pagination.cjs.entry.js +4 -5
- package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +7 -9
- package/dist/cjs/wm-search.cjs.entry.js +6 -7
- package/dist/cjs/wm-snackbar.cjs.entry.js +42 -33
- package/dist/cjs/wm-tab-item_3.cjs.entry.js +8 -11
- package/dist/cjs/wm-tag-input.cjs.entry.js +7 -8
- package/dist/cjs/wm-tag-option.cjs.entry.js +2 -2
- package/dist/cjs/wm-textarea.cjs.entry.js +5 -6
- package/dist/cjs/wm-timepicker.cjs.entry.js +5 -6
- package/dist/cjs/wm-toggletip.cjs.entry.js +5 -6
- package/dist/cjs/wm-uploader.cjs.entry.js +6 -7
- package/dist/cjs/wm-wrapper.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/charts/chartFunctions.js +1 -1
- package/dist/collection/components/charts/chartFunctions.spec.js +16 -0
- package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.e2e.js +81 -0
- package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.js +14 -12
- package/dist/collection/components/charts/screenshots.e2e.js +96 -0
- package/dist/collection/components/charts/wm-chart/wm-chart.e2e.js +213 -0
- package/dist/collection/components/charts/wm-chart/wm-chart.js +1 -1
- package/dist/collection/components/charts/wm-chart/wm-chart.spec.js +37 -0
- package/dist/collection/components/charts/wm-line-chart/wm-line-chart.e2e.js +176 -0
- package/dist/collection/components/charts/wm-line-chart/wm-line-chart.js +9 -9
- package/dist/collection/components/charts/wm-line-chart/wm-line-chart.spec.js +163 -0
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.js +1 -1
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.e2e.js +69 -0
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.js +1 -1
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.spec.js +79 -0
- package/dist/collection/components/datepickers/priv-calendar/priv-calendar.css +23 -17
- package/dist/collection/components/datepickers/priv-calendar/priv-calendar.js +22 -22
- package/dist/collection/components/datepickers/priv-calendar/priv-calendar.spec.js +89 -0
- package/dist/collection/components/datepickers/wm-date-range.e2e.js +443 -0
- package/dist/collection/components/datepickers/wm-date-range.js +17 -22
- package/dist/collection/components/datepickers/wm-date-range.spec.js +22 -0
- package/dist/collection/components/datepickers/wm-datepicker.e2e.js +382 -0
- package/dist/collection/components/datepickers/wm-datepicker.js +12 -16
- package/dist/collection/components/datepickers/wm-datepicker.spec.js +21 -0
- package/dist/collection/components/wm-action-menu/wm-action-menu.e2e.js +200 -0
- package/dist/collection/components/wm-action-menu/wm-action-menu.js +1 -1
- package/dist/collection/components/wm-action-menu/wm-action-menu.spec.js +48 -0
- package/dist/collection/components/wm-button/wm-button.e2e.js +55 -0
- package/dist/collection/components/wm-button/wm-button.js +1 -1
- package/dist/collection/components/wm-button/wm-button.spec.js +74 -0
- package/dist/collection/components/wm-file/wm-file.js +1 -1
- package/dist/collection/components/wm-file/wm-file.spec.js +194 -0
- package/dist/collection/components/wm-file-list/wm-file-list.js +1 -1
- package/dist/collection/components/wm-file-list/wm-file-list.spec.js +69 -0
- package/dist/collection/components/wm-input/wm-input.e2e.js +32 -0
- package/dist/collection/components/wm-input/wm-input.js +1 -1
- package/dist/collection/components/wm-input/wm-input.spec.js +173 -0
- package/dist/collection/components/wm-menuitem/wm-menuitem.e2e.js +23 -0
- package/dist/collection/components/wm-menuitem/wm-menuitem.js +1 -1
- package/dist/collection/components/wm-menuitem/wm-menuitem.spec.js +54 -0
- package/dist/collection/components/wm-modal/wm-modal-footer.js +1 -1
- package/dist/collection/components/wm-modal/wm-modal-footer.spec.js +11 -0
- package/dist/collection/components/wm-modal/wm-modal-header.js +1 -1
- package/dist/collection/components/wm-modal/wm-modal-header.spec.js +8 -0
- package/dist/collection/components/wm-modal/wm-modal.e2e.js +104 -0
- package/dist/collection/components/wm-modal/wm-modal.js +2 -2
- package/dist/collection/components/wm-modal/wm-modal.spec.js +30 -0
- package/dist/collection/components/wm-navigation/wm-navigation-hamburger.js +1 -1
- package/dist/collection/components/wm-navigation/wm-navigation-item.js +1 -1
- package/dist/collection/components/wm-navigation/wm-navigation.e2e.js +102 -0
- package/dist/collection/components/wm-navigation/wm-navigation.js +2 -2
- package/dist/collection/components/wm-navigation/wm-navigation.spec.js +91 -0
- package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.e2e.js +50 -0
- package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.js +1 -1
- package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.js +1 -1
- package/dist/collection/components/wm-navigator/wm-navigator.e2e.js +209 -0
- package/dist/collection/components/wm-navigator/wm-navigator.spec.js +177 -0
- package/dist/collection/components/wm-option/wm-option.e2e.js +22 -0
- package/dist/collection/components/wm-option/wm-option.js +1 -1
- package/dist/collection/components/wm-option/wm-option.spec.js +63 -0
- package/dist/collection/components/wm-pagination/wm-pagination.e2e.js +312 -0
- package/dist/collection/components/wm-pagination/wm-pagination.js +1 -1
- package/dist/collection/components/wm-search/wm-search.e2e.js +76 -0
- package/dist/collection/components/wm-search/wm-search.js +4 -5
- package/dist/collection/components/wm-search/wm-search.spec.js +71 -0
- package/dist/collection/components/wm-select/wm-select.e2e.js +521 -0
- package/dist/collection/components/wm-select/wm-select.js +2 -2
- package/dist/collection/components/wm-select/wm-select.spec.js +271 -0
- package/dist/collection/components/wm-snackbar/wm-snackbar.css +40 -21
- package/dist/collection/components/wm-snackbar/wm-snackbar.e2e.js +112 -0
- package/dist/collection/components/wm-snackbar/wm-snackbar.js +37 -27
- package/dist/collection/components/wm-snackbar/wm-snackbar.spec.js +9 -0
- package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.js +1 -1
- package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.js +1 -1
- package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.js +1 -1
- package/dist/collection/components/wm-tabs/wm-tabs.e2e.js +91 -0
- package/dist/collection/components/wm-tabs/wm-tabs.spec.js +12 -0
- package/dist/collection/components/wm-tag-input/wm-tag-input.e2e.js +204 -0
- package/dist/collection/components/wm-tag-input/wm-tag-input.js +3 -3
- package/dist/collection/components/wm-tag-input/wm-tag-input.spec.js +195 -0
- package/dist/collection/components/wm-textarea/wm-textarea.e2e.js +41 -0
- package/dist/collection/components/wm-textarea/wm-textarea.js +1 -1
- package/dist/collection/components/wm-textarea/wm-textarea.spec.js +79 -0
- package/dist/collection/components/wm-timepicker/wm-timepicker.e2e.js +163 -0
- package/dist/collection/components/wm-timepicker/wm-timepicker.js +8 -11
- package/dist/collection/components/wm-timepicker/wm-timepicker.spec.js +147 -0
- package/dist/collection/components/wm-toggletip/wm-toggletip.e2e.js +69 -0
- package/dist/collection/components/wm-toggletip/wm-toggletip.js +2 -2
- package/dist/collection/components/wm-toggletip/wm-toggletip.spec.js +21 -0
- package/dist/collection/components/wm-uploader/wm-uploader.e2e.js +70 -0
- package/dist/collection/components/wm-uploader/wm-uploader.js +2 -2
- package/dist/collection/components/wm-uploader/wm-uploader.spec.js +234 -0
- package/dist/collection/global/functions.spec.js +126 -0
- package/dist/collection/lang/lang.spec.js +20 -0
- package/dist/esm/{chartFunctions-da985798.js → chartFunctions-036fdb89.js} +3 -3
- package/dist/esm/{functions-25781571.js → functions-46843ea0.js} +8 -105
- package/dist/{cjs/app-globals-4606bf8f.js → esm/global-56d6c80b.js} +1 -10
- package/dist/esm/index-558b5a82.js +2610 -0
- package/dist/esm/{intl-df3d34d1.js → intl-8b8740b9.js} +1 -1
- package/dist/esm/loader.js +4 -5
- package/dist/esm/polyfills/core-js.js +0 -0
- package/dist/esm/polyfills/dom.js +0 -0
- package/dist/esm/polyfills/es5-html-element.js +0 -0
- package/dist/esm/polyfills/index.js +0 -0
- package/dist/esm/polyfills/system.js +0 -0
- package/dist/esm/priv-calendar.entry.js +26 -27
- package/dist/esm/priv-chart-popover.entry.js +17 -16
- package/dist/esm/priv-navigator-button.entry.js +3 -4
- package/dist/esm/priv-navigator-item.entry.js +3 -4
- package/dist/esm/ripple.js +12 -13
- package/dist/esm/wm-action-menu_2.entry.js +6 -8
- package/dist/esm/wm-button.entry.js +4 -5
- package/dist/esm/wm-chart-slice.entry.js +1 -1
- package/dist/esm/wm-chart.entry.js +6 -7
- package/dist/esm/wm-date-range.entry.js +12 -14
- package/dist/esm/wm-datepicker.entry.js +7 -8
- package/dist/esm/wm-file-list.entry.js +3 -4
- package/dist/esm/wm-file.entry.js +4 -5
- package/dist/esm/wm-input.entry.js +5 -6
- package/dist/esm/wm-line-chart.entry.js +14 -15
- package/dist/esm/wm-modal-footer.entry.js +3 -4
- package/dist/esm/wm-modal-header.entry.js +5 -6
- package/dist/esm/wm-modal.entry.js +5 -6
- package/dist/esm/wm-navigation_3.entry.js +10 -13
- package/dist/esm/wm-navigator.entry.js +3 -4
- package/dist/esm/wm-option_2.entry.js +8 -10
- package/dist/esm/wm-pagination.entry.js +4 -5
- package/dist/esm/wm-progress-indicator_3.entry.js +7 -9
- package/dist/esm/wm-search.entry.js +6 -7
- package/dist/esm/wm-snackbar.entry.js +42 -33
- package/dist/esm/wm-tab-item_3.entry.js +8 -11
- package/dist/esm/wm-tag-input.entry.js +7 -8
- package/dist/esm/wm-tag-option.entry.js +2 -2
- package/dist/esm/wm-textarea.entry.js +5 -6
- package/dist/esm/wm-timepicker.entry.js +5 -6
- package/dist/esm/wm-toggletip.entry.js +5 -6
- package/dist/esm/wm-uploader.entry.js +6 -7
- package/dist/esm/wm-wrapper.entry.js +1 -1
- package/dist/esm-es5/{chartFunctions-da985798.js → chartFunctions-036fdb89.js} +1 -1
- package/dist/esm-es5/functions-46843ea0.js +1 -0
- package/dist/esm-es5/global-56d6c80b.js +1 -0
- package/dist/esm-es5/index-558b5a82.js +1 -0
- package/dist/esm-es5/{intl-df3d34d1.js → intl-8b8740b9.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/priv-calendar.entry.js +1 -1
- package/dist/esm-es5/priv-chart-popover.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-date-range.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-textarea.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/cdn.js +2 -1
- package/dist/loader/index.cjs.js +2 -1
- package/dist/loader/index.d.ts +0 -3
- package/dist/loader/index.es2017.js +2 -1
- package/dist/loader/index.js +2 -1
- package/dist/ripple/p-09a31f0c.entry.js +1 -0
- package/dist/ripple/p-0aa17cac.entry.js +1 -0
- package/dist/ripple/p-0dc51fad.entry.js +1 -0
- package/dist/ripple/p-0ea8609b.system.entry.js +1 -0
- package/dist/ripple/{p-a9d89ac8.system.js → p-1ac66a15.system.js} +1 -1
- package/dist/ripple/p-22ed3b52.system.js +1 -0
- package/dist/ripple/p-240124b0.system.entry.js +1 -0
- package/dist/ripple/p-26fbc7f5.system.entry.js +1 -0
- package/dist/ripple/p-294b38ca.system.entry.js +1 -0
- package/dist/ripple/p-2b05bf05.entry.js +1 -0
- package/dist/ripple/{p-72bdebb5.system.entry.js → p-2ba7e68e.system.entry.js} +1 -1
- package/dist/ripple/p-311923b2.system.entry.js +1 -0
- package/dist/ripple/p-3183bba8.entry.js +1 -0
- package/dist/ripple/p-31976813.entry.js +1 -0
- package/dist/ripple/{p-823d7b4e.system.entry.js → p-32bf3f5b.system.entry.js} +1 -1
- package/dist/ripple/p-33679b9d.entry.js +1 -0
- package/dist/ripple/p-34b5830f.system.js +1 -0
- package/dist/ripple/p-3568472c.entry.js +1 -0
- package/dist/ripple/p-359d45dc.entry.js +1 -0
- package/dist/ripple/{p-67a7f0b0.entry.js → p-3a44e1c8.entry.js} +1 -1
- package/dist/ripple/{p-672ae2cb.entry.js → p-42d1c301.entry.js} +1 -1
- package/dist/ripple/{p-041e579b.entry.js → p-45abd8fe.entry.js} +1 -1
- package/dist/ripple/{p-13b1d775.entry.js → p-48e09589.entry.js} +1 -1
- package/dist/ripple/p-4e56f3f5.system.entry.js +1 -0
- package/dist/ripple/{p-9f06ed3b.system.entry.js → p-5029fcd8.system.entry.js} +1 -1
- package/dist/ripple/p-568c595f.js +2 -0
- package/dist/ripple/p-591918a4.entry.js +1 -0
- package/dist/ripple/{p-bee8ab6e.entry.js → p-624a2812.entry.js} +1 -1
- package/dist/ripple/p-62a8f09c.entry.js +1 -0
- package/dist/ripple/{p-043901ab.system.entry.js → p-65d26233.system.entry.js} +1 -1
- package/dist/ripple/p-75ba63ba.entry.js +1 -0
- package/dist/ripple/{p-ac40417b.system.entry.js → p-79106e23.system.entry.js} +1 -1
- package/dist/ripple/p-7e6f5a1e.system.entry.js +1 -0
- package/dist/ripple/p-8029af07.system.entry.js +1 -0
- package/dist/ripple/{p-8e72de50.entry.js → p-8159cdf5.entry.js} +1 -1
- package/dist/ripple/p-822618d7.entry.js +1 -0
- package/dist/ripple/p-86d655fb.system.entry.js +1 -0
- package/dist/ripple/p-884294c6.entry.js +1 -0
- package/dist/ripple/{p-cd0cc88d.entry.js → p-88ebddd7.entry.js} +1 -1
- package/dist/ripple/p-8fbddb6c.system.entry.js +1 -0
- package/dist/ripple/p-902a54c5.entry.js +1 -0
- package/dist/ripple/p-905dd4da.system.entry.js +1 -0
- package/dist/ripple/{p-aab56a37.system.entry.js → p-a152cf3a.system.entry.js} +1 -1
- package/dist/ripple/{p-468a0218.entry.js → p-a37cf34a.entry.js} +1 -1
- package/dist/ripple/p-a8524a48.entry.js +1 -0
- package/dist/ripple/p-ab8d78cc.system.js +2 -0
- package/dist/ripple/p-afe08b14.entry.js +1 -0
- package/dist/ripple/p-b2214a37.system.js +1 -0
- package/dist/ripple/{p-6fe35d1e.system.entry.js → p-b7ead395.system.entry.js} +1 -1
- package/dist/ripple/p-bc5e9d24.entry.js +1 -0
- package/dist/ripple/p-c3ac0ad7.system.entry.js +1 -0
- package/dist/ripple/p-c4b9d46d.entry.js +1 -0
- package/dist/ripple/p-c885c7f9.entry.js +1 -0
- package/dist/ripple/p-c91b10f3.system.entry.js +1 -0
- package/dist/ripple/p-c9543950.system.entry.js +1 -0
- package/dist/ripple/p-cacfbaf1.system.entry.js +1 -0
- package/dist/ripple/{p-2e3728f1.entry.js → p-cc4a429b.entry.js} +1 -1
- package/dist/ripple/p-ce9a8bd1.entry.js +1 -0
- package/dist/ripple/p-d24882a7.system.entry.js +1 -0
- package/dist/ripple/p-d33d6e96.system.entry.js +1 -0
- package/dist/ripple/{p-777b8ebc.system.js → p-d4b209ec.system.js} +1 -1
- package/dist/ripple/{p-f54e9ed0.js → p-d79fdf0b.js} +1 -1
- package/dist/ripple/{p-fcf76854.js → p-d837c1f5.js} +1 -1
- package/dist/ripple/{p-d93c51dd.system.entry.js → p-df1a11f1.system.entry.js} +1 -1
- package/dist/ripple/p-df2560f3.system.entry.js +1 -0
- package/dist/ripple/p-e3bcdde8.system.entry.js +1 -0
- package/dist/ripple/p-e3de5bbd.system.entry.js +1 -0
- package/dist/ripple/p-e7a64841.system.entry.js +1 -0
- package/dist/ripple/p-e83a98d3.entry.js +1 -0
- package/dist/ripple/p-e995f7f0.js +1 -0
- package/dist/ripple/p-eaac6bcd.entry.js +1 -0
- package/dist/ripple/p-f67fd802.system.entry.js +1 -0
- package/dist/ripple/p-fd9cb5b7.js +1 -0
- package/dist/ripple/p-fe8d02c3.system.entry.js +1 -0
- package/dist/ripple/{p-b0c566b5.system.entry.js → p-ffb31979.system.entry.js} +1 -1
- package/dist/ripple/ripple.esm.js +1 -1
- package/dist/ripple/ripple.js +1 -1
- package/dist/types/components/charts/priv-chart-popover/priv-chart-popover.d.ts +1 -2
- package/dist/types/components/wm-snackbar/wm-snackbar.d.ts +2 -2
- package/dist/types/stencil-public-runtime.d.ts +10 -3
- package/package.json +1 -1
- package/dist/cjs/index-788526f5.js +0 -1851
- package/dist/esm/index-130e07bb.js +0 -1820
- package/dist/esm-es5/app-globals-17afed20.js +0 -1
- package/dist/esm-es5/functions-25781571.js +0 -1
- package/dist/esm-es5/index-130e07bb.js +0 -1
- package/dist/ripple/p-0abc9300.entry.js +0 -1
- package/dist/ripple/p-0af94825.entry.js +0 -1
- package/dist/ripple/p-0ff41567.system.entry.js +0 -1
- package/dist/ripple/p-13fc2164.entry.js +0 -1
- package/dist/ripple/p-155224a2.system.entry.js +0 -1
- package/dist/ripple/p-1f09134c.entry.js +0 -1
- package/dist/ripple/p-298c2675.entry.js +0 -1
- package/dist/ripple/p-31781d88.system.entry.js +0 -1
- package/dist/ripple/p-31d7ecf9.system.entry.js +0 -1
- package/dist/ripple/p-341ebafa.entry.js +0 -1
- package/dist/ripple/p-35f209d9.system.entry.js +0 -1
- package/dist/ripple/p-376efca9.entry.js +0 -1
- package/dist/ripple/p-3b5f4364.system.entry.js +0 -1
- package/dist/ripple/p-418ed08c.system.entry.js +0 -1
- package/dist/ripple/p-4670ccb4.system.js +0 -1
- package/dist/ripple/p-488e1690.entry.js +0 -1
- package/dist/ripple/p-4978eebe.entry.js +0 -1
- package/dist/ripple/p-4b7a444c.system.entry.js +0 -1
- package/dist/ripple/p-4baaf026.entry.js +0 -1
- package/dist/ripple/p-56766bb2.entry.js +0 -1
- package/dist/ripple/p-5caaf651.system.entry.js +0 -1
- package/dist/ripple/p-5ece78e5.system.entry.js +0 -1
- package/dist/ripple/p-681c5f0f.system.entry.js +0 -1
- package/dist/ripple/p-691ecf14.entry.js +0 -1
- package/dist/ripple/p-6d0e5159.system.entry.js +0 -1
- package/dist/ripple/p-6d56676e.system.entry.js +0 -1
- package/dist/ripple/p-71a18f64.entry.js +0 -1
- package/dist/ripple/p-737c7172.system.js +0 -1
- package/dist/ripple/p-74ee1ed1.js +0 -1
- package/dist/ripple/p-799d06ad.system.entry.js +0 -1
- package/dist/ripple/p-7eab6bea.system.entry.js +0 -1
- package/dist/ripple/p-7fb95b89.entry.js +0 -1
- package/dist/ripple/p-85cbeb7d.system.entry.js +0 -1
- package/dist/ripple/p-88cfd58d.js +0 -1
- package/dist/ripple/p-8d075bcf.system.entry.js +0 -1
- package/dist/ripple/p-a2b807ba.system.entry.js +0 -1
- package/dist/ripple/p-a2bbb62d.entry.js +0 -1
- package/dist/ripple/p-a62e7532.entry.js +0 -1
- package/dist/ripple/p-b7307be6.system.entry.js +0 -1
- package/dist/ripple/p-c2181de0.entry.js +0 -1
- package/dist/ripple/p-ca76dc92.entry.js +0 -1
- package/dist/ripple/p-cef8a45b.system.js +0 -2
- package/dist/ripple/p-d00b8233.system.js +0 -1
- package/dist/ripple/p-d5ba9de1.system.entry.js +0 -1
- package/dist/ripple/p-d9da0502.js +0 -2
- package/dist/ripple/p-db10990a.entry.js +0 -1
- package/dist/ripple/p-e2fe86a7.system.entry.js +0 -1
- package/dist/ripple/p-e85b1f40.entry.js +0 -1
- package/dist/ripple/p-ea0dfadf.system.entry.js +0 -1
- package/dist/ripple/p-eb14b354.entry.js +0 -1
- package/dist/ripple/p-f17fd62b.entry.js +0 -1
- package/dist/ripple/p-fabe4ca4.entry.js +0 -1
- package/dist/ripple/p-fbaae34d.system.entry.js +0 -1
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { newSpecPage } from "@stencil/core/testing";
|
|
2
|
+
import * as globalFuncs from "../../global/functions";
|
|
3
|
+
jest.spyOn(globalFuncs, "getTextDir").mockImplementation(() => "rtl");
|
|
4
|
+
import { Select } from "./wm-select";
|
|
5
|
+
import { Option } from "../wm-option/wm-option";
|
|
6
|
+
// mock MutationObserver
|
|
7
|
+
global.MutationObserver = jest.fn().mockImplementation(() => ({
|
|
8
|
+
observe: jest.fn(),
|
|
9
|
+
unobserve: jest.fn(),
|
|
10
|
+
disconnect: jest.fn(),
|
|
11
|
+
}));
|
|
12
|
+
describe("wm-select", () => {
|
|
13
|
+
it("builds", async () => {
|
|
14
|
+
const comp = await newSpecPage({
|
|
15
|
+
components: [Select, Option],
|
|
16
|
+
html: '<wm-select label="mock label"><wm-option selected></wm-option></wm-select>',
|
|
17
|
+
});
|
|
18
|
+
expect(comp.root).toMatchSnapshot();
|
|
19
|
+
});
|
|
20
|
+
it("has the right props", () => {
|
|
21
|
+
const select = new Select();
|
|
22
|
+
expect(select).toHaveProperty("label");
|
|
23
|
+
expect(select).toHaveProperty("labelPosition");
|
|
24
|
+
expect(select).toHaveProperty("maxHeight");
|
|
25
|
+
expect(select).toHaveProperty("requiredField");
|
|
26
|
+
expect(select).toHaveProperty("errorMessage");
|
|
27
|
+
expect(select).toHaveProperty("disabled");
|
|
28
|
+
expect(select).toHaveProperty("multiple");
|
|
29
|
+
expect(select).toHaveProperty("search");
|
|
30
|
+
expect(select).toHaveProperty("selectAll");
|
|
31
|
+
expect(select).toHaveProperty("placeholder");
|
|
32
|
+
expect(select).toHaveProperty("isExpanded");
|
|
33
|
+
expect(select).toHaveProperty("childOptions");
|
|
34
|
+
expect(select).toHaveProperty("keysSoFar");
|
|
35
|
+
expect(select).toHaveProperty("searchIndex");
|
|
36
|
+
});
|
|
37
|
+
it("has the right roles", async () => {
|
|
38
|
+
const page = await newSpecPage({
|
|
39
|
+
components: [Select, Option],
|
|
40
|
+
html: '<wm-select id="random-id" search label="mock label"><wm-option selected>First option</wm-option></wm-select>',
|
|
41
|
+
});
|
|
42
|
+
const searchFieldEl = await page.root.shadowRoot.querySelector(".searchfield");
|
|
43
|
+
const listboxEl = await page.root.shadowRoot.querySelector("#list");
|
|
44
|
+
expect(listboxEl).toEqualAttribute("role", "listbox");
|
|
45
|
+
expect(listboxEl).not.toHaveAttribute("aria-multiselectable"); // only multiselect
|
|
46
|
+
expect(searchFieldEl).toEqualAttribute("role", "combobox");
|
|
47
|
+
});
|
|
48
|
+
it("multiselect has multiselectable aria attr", async () => {
|
|
49
|
+
const page = await newSpecPage({
|
|
50
|
+
components: [Select, Option],
|
|
51
|
+
html: '<wm-select multiple label="mock label"><wm-option>1</wm-option></wm-select>',
|
|
52
|
+
});
|
|
53
|
+
const listboxEl = await page.root.shadowRoot.querySelector("#list");
|
|
54
|
+
expect(listboxEl).toHaveAttribute("aria-multiselectable");
|
|
55
|
+
});
|
|
56
|
+
it("displays error message", async () => {
|
|
57
|
+
const page = await newSpecPage({
|
|
58
|
+
components: [Select, Option],
|
|
59
|
+
html: '<wm-select error-message="test error" label="mock label"><wm-option selected></wm-option></wm-select>',
|
|
60
|
+
});
|
|
61
|
+
const errorMessage = await page.root.shadowRoot.querySelector(".error-message");
|
|
62
|
+
expect(errorMessage.textContent).toBe("test error");
|
|
63
|
+
});
|
|
64
|
+
it("adapts options correctly - multiselect", async () => {
|
|
65
|
+
const page = await newSpecPage({
|
|
66
|
+
components: [Select, Option],
|
|
67
|
+
html: '<wm-select multiple label="mock label"><wm-option></wm-option></wm-select>',
|
|
68
|
+
});
|
|
69
|
+
const option = await page.root.querySelector("wm-option");
|
|
70
|
+
expect(option === null || option === void 0 ? void 0 : option.classList.contains("multi-option")).toBe(true);
|
|
71
|
+
});
|
|
72
|
+
describe("reacts to wm-option events", () => {
|
|
73
|
+
it("handles option Enter", () => {
|
|
74
|
+
// handleChildEnter
|
|
75
|
+
const component = new Select();
|
|
76
|
+
const mockClose = (component.close = jest.fn());
|
|
77
|
+
component.handleChildEnter();
|
|
78
|
+
expect(mockClose).toHaveBeenCalledTimes(1);
|
|
79
|
+
jest.restoreAllMocks();
|
|
80
|
+
});
|
|
81
|
+
it("handles option Up", () => {
|
|
82
|
+
// handleChildUp
|
|
83
|
+
const component = new Select();
|
|
84
|
+
const mockMoveUp = (component.moveUp = jest.fn());
|
|
85
|
+
const optionEl = document.createElement("option");
|
|
86
|
+
const event = { detail: optionEl };
|
|
87
|
+
component.handleChildUp(event);
|
|
88
|
+
expect(mockMoveUp).toHaveBeenCalledTimes(1);
|
|
89
|
+
expect(mockMoveUp).toHaveBeenCalledWith(optionEl);
|
|
90
|
+
jest.restoreAllMocks();
|
|
91
|
+
});
|
|
92
|
+
it("handles option Down", () => {
|
|
93
|
+
// handleChildDown
|
|
94
|
+
const component = new Select();
|
|
95
|
+
const mockMoveDown = (component.moveDown = jest.fn());
|
|
96
|
+
const optionEl = document.createElement("option");
|
|
97
|
+
const event = { detail: optionEl };
|
|
98
|
+
component.handleChildDown(event);
|
|
99
|
+
expect(mockMoveDown).toHaveBeenCalledTimes(1);
|
|
100
|
+
expect(mockMoveDown).toHaveBeenCalledWith(optionEl);
|
|
101
|
+
jest.restoreAllMocks();
|
|
102
|
+
});
|
|
103
|
+
it("handles option Home", () => {
|
|
104
|
+
// moveToFirstOption
|
|
105
|
+
const component = new Select();
|
|
106
|
+
const mockFocusOption = (component.focusOption = jest.fn());
|
|
107
|
+
const option1 = document.createElement("option");
|
|
108
|
+
option1.textContent = "1";
|
|
109
|
+
const option2 = document.createElement("option");
|
|
110
|
+
option2.textContent = "2";
|
|
111
|
+
const option3 = document.createElement("option");
|
|
112
|
+
option3.textContent = "3";
|
|
113
|
+
jest
|
|
114
|
+
.spyOn(component, "visibleOptionEls", "get")
|
|
115
|
+
// @ts-ignore
|
|
116
|
+
.mockReturnValue([option1, option2, option3]);
|
|
117
|
+
component.moveToFirstOption();
|
|
118
|
+
expect(mockFocusOption).toHaveBeenCalledTimes(1);
|
|
119
|
+
expect(mockFocusOption).toHaveBeenCalledWith(option1);
|
|
120
|
+
jest.restoreAllMocks();
|
|
121
|
+
});
|
|
122
|
+
it("handles option End", () => {
|
|
123
|
+
// moveToLastOption
|
|
124
|
+
const component = new Select();
|
|
125
|
+
const mockFocusOption = (component.focusOption = jest.fn());
|
|
126
|
+
const option1 = document.createElement("option");
|
|
127
|
+
option1.textContent = "1";
|
|
128
|
+
const option2 = document.createElement("option");
|
|
129
|
+
option2.textContent = "2";
|
|
130
|
+
const option3 = document.createElement("option");
|
|
131
|
+
option3.textContent = "3";
|
|
132
|
+
jest
|
|
133
|
+
.spyOn(component, "visibleOptionEls", "get")
|
|
134
|
+
// @ts-ignore
|
|
135
|
+
.mockReturnValue([option1, option2, option3]);
|
|
136
|
+
component.moveToLastOption();
|
|
137
|
+
expect(mockFocusOption).toHaveBeenCalledTimes(1);
|
|
138
|
+
expect(mockFocusOption).toHaveBeenCalledWith(option3);
|
|
139
|
+
jest.restoreAllMocks();
|
|
140
|
+
});
|
|
141
|
+
it("handles option Escape", () => {
|
|
142
|
+
// closePopupOnEscape
|
|
143
|
+
const component = new Select();
|
|
144
|
+
const mockClose = (component.close = jest.fn());
|
|
145
|
+
component.closePopupOnEscape();
|
|
146
|
+
expect(mockClose).toHaveBeenCalledTimes(1);
|
|
147
|
+
expect(mockClose).toHaveBeenCalledWith();
|
|
148
|
+
jest.restoreAllMocks();
|
|
149
|
+
});
|
|
150
|
+
it("handles option Blur", () => {
|
|
151
|
+
// handleOptionBlur
|
|
152
|
+
const component = new Select();
|
|
153
|
+
const blurObserver = jest.fn();
|
|
154
|
+
const fakeTarget = document.createElement("div");
|
|
155
|
+
component.el.addEventListener("blur", blurObserver);
|
|
156
|
+
component.handleOptionBlur({ detail: { relatedTarget: component.el } });
|
|
157
|
+
expect(blurObserver).toHaveBeenCalledTimes(0);
|
|
158
|
+
jest.clearAllMocks();
|
|
159
|
+
component.handleOptionBlur({ detail: { relatedTarget: fakeTarget } });
|
|
160
|
+
expect(blurObserver).toHaveBeenCalledTimes(1);
|
|
161
|
+
expect(blurObserver.mock.calls[0][0].relatedTarget).toStrictEqual(fakeTarget);
|
|
162
|
+
jest.clearAllMocks();
|
|
163
|
+
jest.restoreAllMocks();
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
it("prevent button blur", () => {
|
|
167
|
+
const component = new Select();
|
|
168
|
+
const mockStopPropagation = jest.fn();
|
|
169
|
+
const event = { stopPropagation: mockStopPropagation };
|
|
170
|
+
const fakeTarget = document.createElement("div");
|
|
171
|
+
// @ts-ignore
|
|
172
|
+
event.relatedTarget = fakeTarget;
|
|
173
|
+
component.handleButtonBlur(event);
|
|
174
|
+
expect(mockStopPropagation).toHaveBeenCalledTimes(0);
|
|
175
|
+
jest.clearAllMocks();
|
|
176
|
+
// @ts-ignore
|
|
177
|
+
event.relatedTarget = component.el;
|
|
178
|
+
component.handleButtonBlur(event);
|
|
179
|
+
expect(mockStopPropagation).toHaveBeenCalledTimes(1);
|
|
180
|
+
jest.clearAllMocks();
|
|
181
|
+
jest.restoreAllMocks();
|
|
182
|
+
});
|
|
183
|
+
it("handles keydowns", () => {
|
|
184
|
+
const component = new Select();
|
|
185
|
+
const mockPreventDefault = jest.fn();
|
|
186
|
+
const event = { preventDefault: mockPreventDefault, key: "" };
|
|
187
|
+
const mockOpen = (component.open = jest.fn());
|
|
188
|
+
// @ts-ignore
|
|
189
|
+
event.key = "ArrowDown";
|
|
190
|
+
component.isExpanded = false;
|
|
191
|
+
component.handleKey(event);
|
|
192
|
+
expect(mockPreventDefault).toHaveBeenCalledTimes(1);
|
|
193
|
+
expect(mockOpen).toHaveBeenCalledTimes(1);
|
|
194
|
+
expect(mockOpen).toHaveBeenCalledWith("next");
|
|
195
|
+
jest.clearAllMocks();
|
|
196
|
+
component.isExpanded = true;
|
|
197
|
+
component.handleKey(event);
|
|
198
|
+
expect(mockPreventDefault).toHaveBeenCalledTimes(0);
|
|
199
|
+
expect(mockOpen).toHaveBeenCalledTimes(0);
|
|
200
|
+
jest.clearAllMocks();
|
|
201
|
+
// @ts-ignore
|
|
202
|
+
event.key = "ArrowUp";
|
|
203
|
+
component.isExpanded = false;
|
|
204
|
+
component.handleKey(event);
|
|
205
|
+
expect(mockPreventDefault).toHaveBeenCalledTimes(1);
|
|
206
|
+
expect(mockOpen).toHaveBeenCalledTimes(1);
|
|
207
|
+
expect(mockOpen).toHaveBeenCalledWith("previous");
|
|
208
|
+
jest.clearAllMocks();
|
|
209
|
+
component.isExpanded = true;
|
|
210
|
+
component.handleKey(event);
|
|
211
|
+
expect(mockPreventDefault).toHaveBeenCalledTimes(0);
|
|
212
|
+
expect(mockOpen).toHaveBeenCalledTimes(0);
|
|
213
|
+
jest.clearAllMocks();
|
|
214
|
+
// any other key
|
|
215
|
+
// @ts-ignore
|
|
216
|
+
event.key = "f";
|
|
217
|
+
component.handleKey(event);
|
|
218
|
+
expect(mockPreventDefault).toHaveBeenCalledTimes(0);
|
|
219
|
+
expect(mockOpen).toHaveBeenCalledTimes(0);
|
|
220
|
+
jest.clearAllMocks();
|
|
221
|
+
jest.restoreAllMocks();
|
|
222
|
+
});
|
|
223
|
+
describe("select-all option", () => {
|
|
224
|
+
it("shows select-all button when prop is set and multiple is set", async () => {
|
|
225
|
+
const page = await newSpecPage({
|
|
226
|
+
components: [Select, Option],
|
|
227
|
+
html: '<wm-select multiple select-all label="mock label"><wm-option></wm-option></wm-select>',
|
|
228
|
+
});
|
|
229
|
+
const btn = page.root.shadowRoot.querySelector(".select-all");
|
|
230
|
+
expect(btn).not.toBeNull();
|
|
231
|
+
});
|
|
232
|
+
it("doesn't show select-all button when prop is not set", async () => {
|
|
233
|
+
const page = await newSpecPage({
|
|
234
|
+
components: [Select, Option],
|
|
235
|
+
html: '<wm-select label="mock label"><wm-option selected></wm-option></wm-select>',
|
|
236
|
+
});
|
|
237
|
+
const btn = page.root.shadowRoot.querySelector(".select-all");
|
|
238
|
+
expect(btn).toBeNull();
|
|
239
|
+
});
|
|
240
|
+
it("doesn't show select-all button when prop is set but multiple is not", async () => {
|
|
241
|
+
const page = await newSpecPage({
|
|
242
|
+
components: [Select, Option],
|
|
243
|
+
html: '<wm-select select-all label="mock label"><wm-option selected></wm-option></wm-select>',
|
|
244
|
+
});
|
|
245
|
+
const btn = page.root.shadowRoot.querySelector(".select-all");
|
|
246
|
+
expect(btn).toBeNull();
|
|
247
|
+
});
|
|
248
|
+
it("button text is 'Select all'", async () => {
|
|
249
|
+
const page = await newSpecPage({
|
|
250
|
+
components: [Select, Option],
|
|
251
|
+
html: `<wm-select multiple select-all label="mock label">
|
|
252
|
+
<wm-option>first</wm-option>
|
|
253
|
+
<wm-option>second</wm-option>
|
|
254
|
+
</wm-select>`,
|
|
255
|
+
});
|
|
256
|
+
const btn = page.root.shadowRoot.querySelector(".select-all");
|
|
257
|
+
expect(btn.textContent).toBe("Select All");
|
|
258
|
+
});
|
|
259
|
+
it("button text is 'Deselect all' when all options are selected", async () => {
|
|
260
|
+
const page = await newSpecPage({
|
|
261
|
+
components: [Select, Option],
|
|
262
|
+
html: `<wm-select multiple select-all label="mock label">
|
|
263
|
+
<wm-option selected>first</wm-option>
|
|
264
|
+
<wm-option selected>second</wm-option>
|
|
265
|
+
</wm-select>`,
|
|
266
|
+
});
|
|
267
|
+
const btn = page.root.shadowRoot.querySelector(".select-all");
|
|
268
|
+
expect(btn.textContent).toBe("Deselect All");
|
|
269
|
+
});
|
|
270
|
+
});
|
|
271
|
+
});
|
|
@@ -38,9 +38,6 @@
|
|
|
38
38
|
--wmcolor-snackbar-text: var(--wmcolor-text-ondark);
|
|
39
39
|
position: fixed;
|
|
40
40
|
bottom: 0;
|
|
41
|
-
left: 1.25rem;
|
|
42
|
-
right: 1.25rem;
|
|
43
|
-
z-index: 2001;
|
|
44
41
|
}
|
|
45
42
|
:host * {
|
|
46
43
|
box-sizing: border-box;
|
|
@@ -51,10 +48,17 @@
|
|
|
51
48
|
max-width: 35.5rem;
|
|
52
49
|
max-height: 17.5rem;
|
|
53
50
|
overflow: auto;
|
|
54
|
-
padding:
|
|
51
|
+
padding: 1.125rem;
|
|
55
52
|
display: flex;
|
|
56
|
-
flex-direction: column
|
|
53
|
+
flex-direction: column;
|
|
57
54
|
gap: 1.25rem;
|
|
55
|
+
position: fixed;
|
|
56
|
+
bottom: 0.75rem;
|
|
57
|
+
left: 0.75rem;
|
|
58
|
+
z-index: 2001;
|
|
59
|
+
}
|
|
60
|
+
:host .list-wrapper.empty {
|
|
61
|
+
visibility: hidden;
|
|
58
62
|
}
|
|
59
63
|
:host .wm-snack-wrapper {
|
|
60
64
|
width: 100%;
|
|
@@ -101,6 +105,21 @@
|
|
|
101
105
|
transform: scale(1);
|
|
102
106
|
}
|
|
103
107
|
}
|
|
108
|
+
:host .wm-snack-wrapper .wm-snackbar.shrink {
|
|
109
|
+
animation: shrink 0.25s;
|
|
110
|
+
animation-fill-mode: forwards;
|
|
111
|
+
animation-timing-function: ease-in-out;
|
|
112
|
+
}
|
|
113
|
+
@keyframes shrink {
|
|
114
|
+
0% {
|
|
115
|
+
opacity: 1;
|
|
116
|
+
transform: scale(1);
|
|
117
|
+
}
|
|
118
|
+
100% {
|
|
119
|
+
opacity: 0;
|
|
120
|
+
transform: scale(0.9);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
104
123
|
:host .wm-snack-wrapper .wm-snackbar .link {
|
|
105
124
|
letter-spacing: 0;
|
|
106
125
|
text-transform: none;
|
|
@@ -145,7 +164,7 @@
|
|
|
145
164
|
:host .wm-snack-wrapper .wm-snackbar.active:not(button) {
|
|
146
165
|
opacity: 1;
|
|
147
166
|
}
|
|
148
|
-
:host .wm-snack-wrapper .wm-snackbar .
|
|
167
|
+
:host .wm-snack-wrapper .wm-snackbar .content-wrapper {
|
|
149
168
|
display: -webkit-box;
|
|
150
169
|
display: -webkit-flex;
|
|
151
170
|
display: -ms-flexbox;
|
|
@@ -162,31 +181,31 @@
|
|
|
162
181
|
position: relative;
|
|
163
182
|
padding: 0;
|
|
164
183
|
}
|
|
165
|
-
:host .wm-snack-wrapper .wm-snackbar .
|
|
184
|
+
:host .wm-snack-wrapper .wm-snackbar .content-wrapper .msg-wrapper {
|
|
166
185
|
display: flex;
|
|
167
186
|
flex-wrap: wrap;
|
|
168
187
|
gap: 12px;
|
|
169
188
|
width: 100%;
|
|
170
189
|
align-items: center;
|
|
171
190
|
}
|
|
172
|
-
:host .wm-snack-wrapper .wm-snackbar .
|
|
191
|
+
:host .wm-snack-wrapper .wm-snackbar .content-wrapper .msg-wrapper .msg {
|
|
173
192
|
display: block;
|
|
174
193
|
flex: 0 0 0;
|
|
175
194
|
min-width: fit-content;
|
|
176
195
|
}
|
|
177
|
-
:host .wm-snack-wrapper .wm-snackbar .
|
|
196
|
+
:host .wm-snack-wrapper .wm-snackbar .content-wrapper .msg-wrapper .msg.long {
|
|
178
197
|
min-width: 216px;
|
|
179
198
|
flex: 1 0 0;
|
|
180
199
|
}
|
|
181
|
-
:host .wm-snack-wrapper .wm-snackbar .
|
|
200
|
+
:host .wm-snack-wrapper .wm-snackbar .content-wrapper .msg-wrapper .link {
|
|
182
201
|
display: flex;
|
|
183
202
|
flex: 0 0 auto;
|
|
184
203
|
}
|
|
185
|
-
:host .wm-snack-wrapper .wm-snackbar .
|
|
204
|
+
:host .wm-snack-wrapper .wm-snackbar .content-wrapper .msg-wrapper .link span {
|
|
186
205
|
display: block;
|
|
187
206
|
white-space: nowrap;
|
|
188
207
|
}
|
|
189
|
-
:host .wm-snack-wrapper .wm-snackbar .
|
|
208
|
+
:host .wm-snack-wrapper .wm-snackbar .content-wrapper .closesnack {
|
|
190
209
|
-webkit-box-shadow: none;
|
|
191
210
|
-moz-box-shadow: none;
|
|
192
211
|
box-shadow: none;
|
|
@@ -207,7 +226,7 @@
|
|
|
207
226
|
text-align: center;
|
|
208
227
|
letter-spacing: normal;
|
|
209
228
|
}
|
|
210
|
-
:host .wm-snack-wrapper .wm-snackbar .
|
|
229
|
+
:host .wm-snack-wrapper .wm-snackbar .content-wrapper .closesnack:before {
|
|
211
230
|
display: inline-block;
|
|
212
231
|
font: normal normal normal 24px/1 "Material Design Icons";
|
|
213
232
|
font-size: inherit;
|
|
@@ -218,18 +237,18 @@
|
|
|
218
237
|
content: "\f156";
|
|
219
238
|
font-size: 1.12rem;
|
|
220
239
|
}
|
|
221
|
-
:host .wm-snack-wrapper .wm-snackbar .
|
|
240
|
+
:host .wm-snack-wrapper .wm-snackbar .content-wrapper .closesnack:hover {
|
|
222
241
|
background-color: var(--wmcolor-snackbar-close-background-hover);
|
|
223
242
|
color: var(--wmcolor-snackbar-close-icon-hover);
|
|
224
243
|
}
|
|
225
|
-
:host .wm-snack-wrapper .wm-snackbar .
|
|
244
|
+
:host .wm-snack-wrapper .wm-snackbar .content-wrapper .closesnack:focus {
|
|
226
245
|
outline: none;
|
|
227
246
|
}
|
|
228
|
-
:host .wm-snack-wrapper .wm-snackbar .
|
|
247
|
+
:host .wm-snack-wrapper .wm-snackbar .content-wrapper .closesnack::-moz-focus-inner {
|
|
229
248
|
border: 0;
|
|
230
249
|
outline: none;
|
|
231
250
|
}
|
|
232
|
-
:host .wm-snack-wrapper .wm-snackbar .
|
|
251
|
+
:host .wm-snack-wrapper .wm-snackbar .content-wrapper .closesnack:active {
|
|
233
252
|
-ms-transform: scale(0.9, 0.9);
|
|
234
253
|
-webkit-transform: scale(0.9, 0.9);
|
|
235
254
|
-moz-transform: scale(0.9, 0.9);
|
|
@@ -264,11 +283,11 @@
|
|
|
264
283
|
left: 0;
|
|
265
284
|
}
|
|
266
285
|
|
|
267
|
-
.user-is-tabbing .wm-snack-wrapper .wm-snackbar .
|
|
286
|
+
.user-is-tabbing .wm-snack-wrapper .wm-snackbar .content-wrapper .closesnack:focus:not(:active) {
|
|
268
287
|
outline: 3px solid var(--wmcolor-interactive-focus);
|
|
269
288
|
outline-offset: 0;
|
|
270
289
|
}
|
|
271
|
-
.user-is-tabbing .wm-snack-wrapper .wm-snackbar .
|
|
290
|
+
.user-is-tabbing .wm-snack-wrapper .wm-snackbar .content-wrapper .closesnack:focus:not(:active) > .tooltip {
|
|
272
291
|
clip: auto;
|
|
273
292
|
width: auto;
|
|
274
293
|
height: auto;
|
|
@@ -281,13 +300,13 @@
|
|
|
281
300
|
transform: translateX(-50%);
|
|
282
301
|
}
|
|
283
302
|
@media screen and (min-width: 48rem) {
|
|
284
|
-
.user-is-tabbing .wm-snack-wrapper .wm-snackbar .
|
|
303
|
+
.user-is-tabbing .wm-snack-wrapper .wm-snackbar .content-wrapper .closesnack:focus:not(:active) > .tooltip {
|
|
285
304
|
top: 2.0625rem;
|
|
286
305
|
left: auto;
|
|
287
306
|
}
|
|
288
307
|
}
|
|
289
308
|
|
|
290
|
-
.user-is-tabbing .wm-snack-wrapper .wm-snackbar .
|
|
309
|
+
.user-is-tabbing .wm-snack-wrapper .wm-snackbar .content-wrapper .link:focus:not(:active) {
|
|
291
310
|
outline: 3px solid var(--wmcolor-interactive-focus);
|
|
292
311
|
outline-offset: 2px;
|
|
293
312
|
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { newE2EPage } from "@stencil/core/testing";
|
|
2
|
+
describe("wm-snackbar", () => {
|
|
3
|
+
let page;
|
|
4
|
+
beforeEach(async () => {
|
|
5
|
+
page = await newE2EPage();
|
|
6
|
+
await page.setContent("<wm-button id='create-snack' onclick='generateSnackbar()'></wm-button><wm-snackbar notifications='[]' id='snack'></wm-snackbar ><script>function generateSnackbar() { const snackbar = document.getElementById('snack'); const id = '3'; let notifications = JSON.parse(snackbar.notifications); let newNotification = {'id': id, message: 'You did something', link: 'Undo'}; let updatedNotifications = [ ...notifications, newNotification ]; snackbar.notifications = JSON.stringify(updatedNotifications); }</script>");
|
|
7
|
+
await page.evaluate(async () => {
|
|
8
|
+
document.addEventListener("wmSnackbarSnackFinished", (ev) => {
|
|
9
|
+
const snackbar = document.querySelector("wm-snackbar");
|
|
10
|
+
let newSnacks = JSON.parse(snackbar.notifications).filter((snack) => +snack.id !== +ev.detail.id);
|
|
11
|
+
snackbar.notifications = JSON.stringify(newSnacks);
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
afterEach(async () => {
|
|
16
|
+
jest.clearAllTimers();
|
|
17
|
+
});
|
|
18
|
+
// RENDER
|
|
19
|
+
it("it displays a snackbar when it receives a notification", async () => {
|
|
20
|
+
//generate snackbar
|
|
21
|
+
const button = await page.find("wm-button");
|
|
22
|
+
button.click(); //perform action that generates a notification
|
|
23
|
+
await page.waitForChanges();
|
|
24
|
+
const snackbar = await page.find("wm-snackbar >>> .content-wrapper");
|
|
25
|
+
expect(snackbar).not.toBeNull();
|
|
26
|
+
});
|
|
27
|
+
it("it displays multiple snackbars when it receives more than one notification", async () => {
|
|
28
|
+
//generate snackbars
|
|
29
|
+
const button = await page.find("wm-button");
|
|
30
|
+
button.click();
|
|
31
|
+
await page.waitForChanges();
|
|
32
|
+
button.click();
|
|
33
|
+
await page.waitForChanges();
|
|
34
|
+
const snackbars = await page.findAll("wm-snackbar >>> .content-wrapper");
|
|
35
|
+
expect(snackbars.length).toBe(2);
|
|
36
|
+
});
|
|
37
|
+
it("dismisses the snackbar after 20 seconds if the user is clicking and not tabbing", async () => {
|
|
38
|
+
//generate snackbar
|
|
39
|
+
const snackExpired = await page.spyOnEvent("wmSnackbarSnackFinished");
|
|
40
|
+
const button = await page.find("wm-button");
|
|
41
|
+
button.click();
|
|
42
|
+
await page.waitForChanges();
|
|
43
|
+
let snack = await page.find("wm-snackbar >>> .content-wrapper");
|
|
44
|
+
expect(snack).not.toBeNull();
|
|
45
|
+
await new Promise((resolve) => {
|
|
46
|
+
setTimeout(() => {
|
|
47
|
+
resolve("");
|
|
48
|
+
}, 21000);
|
|
49
|
+
});
|
|
50
|
+
snack = await page.find("wm-snackbar >>> .content-wrapper");
|
|
51
|
+
expect(snack).toBeNull();
|
|
52
|
+
expect(snackExpired).toHaveReceivedEventDetail({
|
|
53
|
+
id: "3",
|
|
54
|
+
message: "You did something",
|
|
55
|
+
link: "Undo",
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
it("dismisses the snackbar when the close button is clicked", async () => {
|
|
59
|
+
//generate snackbar
|
|
60
|
+
const triggerButton = await page.find("wm-button");
|
|
61
|
+
triggerButton.click();
|
|
62
|
+
await page.waitForChanges();
|
|
63
|
+
//press close button
|
|
64
|
+
const closeButton = await page.find("wm-snackbar >>> button");
|
|
65
|
+
closeButton.click();
|
|
66
|
+
await page.waitForChanges();
|
|
67
|
+
const snackbar = await page.find("wm-snackbar >>> .content-wrapper");
|
|
68
|
+
expect(snackbar).toBeNull();
|
|
69
|
+
});
|
|
70
|
+
//ACCESSIBILITY
|
|
71
|
+
it("renders an aria-live region", async () => {
|
|
72
|
+
const element = await page.find("wm-snackbar >>> #wm-live-region-snack");
|
|
73
|
+
expect(element).toEqualAttribute("aria-live", "polite");
|
|
74
|
+
});
|
|
75
|
+
it("focuses the action link in snackbar if the user is tabbing", async () => {
|
|
76
|
+
//generate snackbar
|
|
77
|
+
await page.keyboard.press("Tab");
|
|
78
|
+
await page.keyboard.press("Enter");
|
|
79
|
+
await page.waitForChanges();
|
|
80
|
+
const focusedElId = await page.evaluate(() => document.activeElement.shadowRoot.activeElement.id);
|
|
81
|
+
const link = await page.find("wm-snackbar >>> .link");
|
|
82
|
+
expect(focusedElId).toBe(link.id);
|
|
83
|
+
});
|
|
84
|
+
it("dismisses the snackbar when enter is pressed on close button and returns focus to last active element before snackbar was created", async () => {
|
|
85
|
+
//generate snackbar
|
|
86
|
+
await page.keyboard.press("Tab");
|
|
87
|
+
await page.keyboard.press("Enter");
|
|
88
|
+
await page.waitForChanges();
|
|
89
|
+
//press close button
|
|
90
|
+
await page.keyboard.press("Tab");
|
|
91
|
+
await page.keyboard.press("Enter");
|
|
92
|
+
await page.waitForChanges();
|
|
93
|
+
const snackbar = await page.find("wm-snackbar >>> .content-wrapper");
|
|
94
|
+
expect(snackbar).toBeNull();
|
|
95
|
+
const focusedElId = await page.evaluate(() => document.activeElement.id);
|
|
96
|
+
expect(focusedElId).toBe("create-snack");
|
|
97
|
+
});
|
|
98
|
+
it("dismisses the snackbar if the user tabs out of it and it returns focus to last active element before snackbar was created", async () => {
|
|
99
|
+
//generate snackbar
|
|
100
|
+
await page.keyboard.press("Tab");
|
|
101
|
+
await page.keyboard.press("Enter");
|
|
102
|
+
await page.waitForChanges();
|
|
103
|
+
//tab out
|
|
104
|
+
await page.keyboard.press("Tab");
|
|
105
|
+
await page.keyboard.press("Tab");
|
|
106
|
+
await page.waitForChanges();
|
|
107
|
+
const snackbar = await page.find("wm-snackbar >>> .content-wrapper");
|
|
108
|
+
expect(snackbar).toBeNull();
|
|
109
|
+
const focusedElId = await page.evaluate(() => document.activeElement.id);
|
|
110
|
+
expect(focusedElId).toBe("create-snack");
|
|
111
|
+
});
|
|
112
|
+
});
|
|
@@ -25,11 +25,13 @@ export class Snackbar {
|
|
|
25
25
|
updateSnacks(newValue) {
|
|
26
26
|
const prevParsedNotifications = [...this.parsedNotifications];
|
|
27
27
|
this.parsedNotifications = [...JSON.parse(newValue)];
|
|
28
|
-
this.
|
|
28
|
+
this.resetUpdatedNotifications(prevParsedNotifications);
|
|
29
29
|
if (prevParsedNotifications.length < this.parsedNotifications.length) {
|
|
30
30
|
const latestNotification = this.parsedNotifications[0];
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
if (!latestNotification.link) {
|
|
32
|
+
const newTimer = window.setTimeout(() => this.snackExpired(latestNotification.id), 6000);
|
|
33
|
+
this.timers = Object.assign({ [latestNotification.id]: newTimer }, this.timers);
|
|
34
|
+
}
|
|
33
35
|
// don't announce link if user is tabbing because link is focused after announcement
|
|
34
36
|
this.announce(`${latestNotification.message} ${this.isTabbing ? "" : latestNotification.link}`);
|
|
35
37
|
if (this.isTabbing && latestNotification.link) {
|
|
@@ -44,7 +46,19 @@ export class Snackbar {
|
|
|
44
46
|
}
|
|
45
47
|
this.setMinWidths();
|
|
46
48
|
}
|
|
47
|
-
|
|
49
|
+
setMinWidths() {
|
|
50
|
+
// wait for render to get updated scrollWidth
|
|
51
|
+
requestAnimationFrame(() => {
|
|
52
|
+
const msgEls = this.el.shadowRoot.querySelectorAll(".msg");
|
|
53
|
+
msgEls.forEach((msgEl) => {
|
|
54
|
+
msgEl.classList.remove("long");
|
|
55
|
+
if (msgEl.scrollWidth > 216) {
|
|
56
|
+
msgEl.classList.add("long");
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
resetUpdatedNotifications(prevNotifications) {
|
|
48
62
|
let updatedNotifications = [];
|
|
49
63
|
prevNotifications.forEach((prevNotification) => {
|
|
50
64
|
this.parsedNotifications.forEach((newNotification) => {
|
|
@@ -60,8 +74,10 @@ export class Snackbar {
|
|
|
60
74
|
window.requestAnimationFrame(() => notifEl.classList.add("grow"));
|
|
61
75
|
}
|
|
62
76
|
this.stopTimer(updatedNotification);
|
|
63
|
-
|
|
64
|
-
|
|
77
|
+
if (!updatedNotification.link) {
|
|
78
|
+
const newTimer = window.setTimeout(() => this.snackExpired(updatedNotification.id), 6000);
|
|
79
|
+
this.timers = Object.assign({ [updatedNotification.id]: newTimer }, this.timers);
|
|
80
|
+
}
|
|
65
81
|
this.announce(`${updatedNotification.message} ${this.isTabbing ? "" : updatedNotification.link}`);
|
|
66
82
|
});
|
|
67
83
|
}
|
|
@@ -93,12 +109,17 @@ export class Snackbar {
|
|
|
93
109
|
endSnack(notification) {
|
|
94
110
|
//App listens for wmSnackbarSnackFinished event and deletes the emitted notification.
|
|
95
111
|
this.stopTimer(notification);
|
|
96
|
-
this.
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
112
|
+
const notifEl = this.el.shadowRoot.querySelector(`#snack-${notification.id}`);
|
|
113
|
+
notifEl.classList.add("shrink");
|
|
114
|
+
setTimeout(() => {
|
|
115
|
+
// wait for animation to complete, then emit event for removal
|
|
116
|
+
this.wmSnackbarSnackFinished.emit({
|
|
117
|
+
id: notification.id,
|
|
118
|
+
message: notification.message,
|
|
119
|
+
link: notification.link,
|
|
120
|
+
newWindow: notification.newWindow,
|
|
121
|
+
});
|
|
122
|
+
}, 250);
|
|
102
123
|
}
|
|
103
124
|
snackLinkClicked(notification) {
|
|
104
125
|
//App listens for wmSnackbarActionTriggered event, deletes emitted notification, and takes over focus.
|
|
@@ -117,18 +138,6 @@ export class Snackbar {
|
|
|
117
138
|
delete this.timers[notification.id];
|
|
118
139
|
}
|
|
119
140
|
}
|
|
120
|
-
setMinWidths() {
|
|
121
|
-
// wait for render to get updated scrollWidth
|
|
122
|
-
requestAnimationFrame(() => {
|
|
123
|
-
const msgEls = this.el.shadowRoot.querySelectorAll(".msg");
|
|
124
|
-
msgEls.forEach((msgEl) => {
|
|
125
|
-
msgEl.classList.remove("long");
|
|
126
|
-
if (msgEl.scrollWidth > 216) {
|
|
127
|
-
msgEl.classList.add("long");
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
141
|
announce(message) {
|
|
133
142
|
if (this.liveRegionEl.textContent === message) {
|
|
134
143
|
message += "\u00A0";
|
|
@@ -136,15 +145,16 @@ export class Snackbar {
|
|
|
136
145
|
this.announcement = message;
|
|
137
146
|
}
|
|
138
147
|
renderSnackbars() {
|
|
139
|
-
return
|
|
148
|
+
return this.parsedNotifications.map((notification) => (h("div", { class: "wm-snack-wrapper", key: `snack-${notification.id}` }, h("div", { id: `snack-${notification.id}`, class: "wm-snackbar active neutral" }, h("div", { class: "sr-only", tabindex: notification.link ? 0 : -1, onFocus: () => notification.link && this.snackDismissed(notification) }), h("div", { class: "content-wrapper" }, h("div", { class: "msg-wrapper" }, h("span", { class: "msg" }, notification.message), notification.link && (h("a", { id: `action-${notification.id}`, class: `link ${notification.newWindow ? "new-window" : ""}`, "aria-label": `Click to ${notification.link}...${notification.newWindow ? " " + globalMessages.newWindow : ""}`, tabindex: 0, onClick: () => {
|
|
140
149
|
this.snackLinkClicked(notification);
|
|
141
150
|
}, onKeyDown: (ev) => ev.key === "Enter" && this.snackLinkClicked(notification) }, h("span", { "aria-hidden": "true" }, notification.link)))), h("button", { id: `close-button-${notification.id}`, "aria-label": "Close this notification", class: "closesnack", tabindex: notification.link ? 0 : -1, onClick: () => this.snackDismissed(notification), onMouseEnter: (ev) => showTooltip("bottom", ev.target, globalMessages.close), onMouseLeave: () => hideTooltip(), onFocus: (ev) => this.isTabbing && showTooltip("bottom", ev.target, globalMessages.close), onBlur: () => hideTooltip() })), h("div", { class: "sr-only", tabindex: notification.link ? 0 : -1, onFocus: () => notification.link && this.snackDismissed(notification) })))));
|
|
142
151
|
}
|
|
143
152
|
render() {
|
|
144
|
-
return (h(Host,
|
|
153
|
+
return (h(Host, null, h("div", { ref: (el) => (this.snackAreaEl = el), class: {
|
|
145
154
|
"list-wrapper": true,
|
|
146
155
|
"user-is-tabbing": this.isTabbing,
|
|
147
|
-
|
|
156
|
+
empty: this.parsedNotifications.length == 0,
|
|
157
|
+
} }, this.renderSnackbars()), h("div", { class: "sr-only", "aria-live": "polite", "aria-atomic": "false", id: `wm-live-region-${this.uid}`, ref: (el) => (this.liveRegionEl = el) }, this.announcement)));
|
|
148
158
|
}
|
|
149
159
|
static get is() { return "wm-snackbar"; }
|
|
150
160
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { newSpecPage } from "@stencil/core/testing";
|
|
2
|
+
jest.mock("../../global/functions");
|
|
3
|
+
import { Snackbar } from "./wm-snackbar";
|
|
4
|
+
describe("wm-snackbar", () => {
|
|
5
|
+
it("builds", async () => {
|
|
6
|
+
const comp = await newSpecPage({ components: [Snackbar], html: "<wm-snackbar><wm-snackbar>" });
|
|
7
|
+
expect(comp.root).toMatchSnapshot();
|
|
8
|
+
});
|
|
9
|
+
});
|