@watermarkinsights/ripple 5.3.0-3 → 5.3.0-4
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-a8999ce1.js → chartFunctions-0238043b.js} +4 -4
- package/dist/cjs/{functions-05e7ad5a.js → functions-3be85c6d.js} +7 -104
- package/dist/{esm/app-globals-bc617542.js → cjs/global-6a36ad09.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 +6 -7
- package/dist/cjs/priv-chart-popover.cjs.entry.js +5 -6
- 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 +7 -8
- 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 +6 -7
- 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 +2 -2
- 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 +2 -2
- 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 +2 -1
- package/dist/collection/components/datepickers/priv-calendar/priv-calendar.js +2 -2
- 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 +12 -16
- 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.e2e.js +112 -0
- package/dist/collection/components/wm-snackbar/wm-snackbar.js +2 -2
- 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-f4bc4821.js → chartFunctions-036fdb89.js} +4 -4
- package/dist/esm/{functions-25781571.js → functions-46843ea0.js} +8 -105
- package/dist/{cjs/app-globals-4191e8d6.js → esm/global-bcdca57d.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 +6 -7
- package/dist/esm/priv-chart-popover.entry.js +5 -6
- 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 +7 -8
- 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 +6 -7
- 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-f4bc4821.js → chartFunctions-036fdb89.js} +1 -1
- package/dist/esm-es5/functions-46843ea0.js +1 -0
- package/dist/esm-es5/global-bcdca57d.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-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-1c32dc29.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-2f1d2fe3.system.entry.js → p-2ba7e68e.system.entry.js} +1 -1
- package/dist/ripple/p-2de2c954.js +1 -0
- 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-4b0d5b98.entry.js +1 -0
- package/dist/ripple/p-4e56f3f5.system.entry.js +1 -0
- package/dist/ripple/{p-9176672f.system.entry.js → p-5029fcd8.system.entry.js} +1 -1
- package/dist/ripple/p-54922aa3.system.entry.js +1 -0
- package/dist/ripple/p-568c595f.js +2 -0
- package/dist/ripple/p-591918a4.entry.js +1 -0
- package/dist/ripple/p-5b9de05a.system.entry.js +1 -0
- package/dist/ripple/p-5d9bccfb.entry.js +1 -0
- package/dist/ripple/p-61bcfba6.system.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-64e929d6.system.entry.js +1 -0
- package/dist/ripple/{p-043901ab.system.entry.js → p-65d26233.system.entry.js} +1 -1
- package/dist/ripple/p-685db40b.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-aab56a37.system.entry.js → p-a152cf3a.system.entry.js} +1 -1
- package/dist/ripple/{p-75a79896.entry.js → p-a37cf34a.entry.js} +1 -1
- package/dist/ripple/p-ab8d78cc.system.js +2 -0
- package/dist/ripple/p-b516b418.entry.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-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-96bd1868.system.js → p-d4b209ec.system.js} +1 -1
- package/dist/ripple/{p-f54e9ed0.js → p-d79fdf0b.js} +1 -1
- package/dist/ripple/{p-f8250ca9.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-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-fe8d02c3.system.entry.js +1 -0
- package/dist/ripple/{p-799d06ad.system.entry.js → p-ff23d5e2.system.entry.js} +1 -1
- 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/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-bc617542.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-15f8ea28.system.entry.js +0 -1
- package/dist/ripple/p-1c4d2203.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-439d0c1f.system.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-4baaf026.entry.js +0 -1
- package/dist/ripple/p-4c24711f.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-6d0e5159.system.entry.js +0 -1
- package/dist/ripple/p-6d56676e.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-90c76565.entry.js +0 -1
- package/dist/ripple/p-a62e7532.entry.js +0 -1
- package/dist/ripple/p-a78001e2.system.js +0 -1
- package/dist/ripple/p-a8661c35.system.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-cef8a45b.system.js +0 -2
- 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-e4d8a800.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-f741e7c4.entry.js +0 -1
- package/dist/ripple/p-f8613ec2.js +0 -1
- package/dist/ripple/p-fabe4ca4.entry.js +0 -1
- package/dist/ripple/p-fbaae34d.system.entry.js +0 -1
- package/dist/types/components/datepickers/priv-calendar/priv-calendar.d.ts +0 -77
- package/dist/types/components/datepickers/wm-date-range.d.ts +0 -73
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { newE2EPage } from "@stencil/core/testing";
|
|
2
|
+
import { AxePuppeteer } from "@axe-core/puppeteer";
|
|
3
|
+
describe("wm-action-menu", () => {
|
|
4
|
+
let page;
|
|
5
|
+
beforeEach(async () => {
|
|
6
|
+
page = await newE2EPage();
|
|
7
|
+
await page.setContent("<html lang='en'><head><title>Page</title></head><body><main><h1>Title</h1><wm-action-menu id='test' tooltip='menu name'><wm-menuitem id='first' onClick='action()'>First action</wm-menuitem><wm-menuitem id='second'>Second action</wm-menuitem><wm-menuitem id='third'>Third action</wm-menuitem></wm-action-menu><script>function action() {document.getElementById('first').innerHTML = 'Changed text'}</script></main></body></html>");
|
|
8
|
+
});
|
|
9
|
+
it("passes Axe checks", async () => {
|
|
10
|
+
const results = await new AxePuppeteer(page).analyze();
|
|
11
|
+
expect(results.violations.length).toBe(0);
|
|
12
|
+
});
|
|
13
|
+
//ATTRIBUTES;
|
|
14
|
+
it("has the right WAI_ARIA roles, states and properties", async () => {
|
|
15
|
+
const wmbtn = await page.find("wm-action-menu >>> wm-button");
|
|
16
|
+
const menu = await page.find("wm-action-menu >>> #menu-test");
|
|
17
|
+
const second = await page.find("#second");
|
|
18
|
+
const third = await page.find("#third");
|
|
19
|
+
await page.waitForChanges();
|
|
20
|
+
// check aria-expanded attribute
|
|
21
|
+
expect(wmbtn).toEqualAttribute("aria-expanded", "false");
|
|
22
|
+
// If the element with the aria-expanded attribute controls the expansion of another grouping container that is not 'owned by' the element, the author SHOULD reference the container by using the aria-controls attribute.
|
|
23
|
+
// src: https://www.w3.org/WAI/PF/aria/states_and_properties#aria-expanded
|
|
24
|
+
expect(wmbtn).toEqualAttribute("aria-controls", "menu-test");
|
|
25
|
+
// An element that contains or owns all the menu items has role menu.
|
|
26
|
+
expect(menu).toEqualAttribute("role", "menu");
|
|
27
|
+
expect(menu).toEqualAttribute("tabindex", "-1");
|
|
28
|
+
// Each menuitem in the menu has role menuitem.
|
|
29
|
+
expect(second).toEqualAttribute("role", "menuitem"); // just checking one randomly
|
|
30
|
+
expect(third).toEqualAttribute("tabindex", "-1");
|
|
31
|
+
});
|
|
32
|
+
// Down Arrow: Moves focus to the first menuitem. If the dropdown is collapsed, it also expands the list.
|
|
33
|
+
// Up Arrow: Moves focus to the last menuitem. If the dropdown is collapsed, it also expands the list.
|
|
34
|
+
it("handles Up and Down Arrow keys", async () => {
|
|
35
|
+
const wmbtn = await page.find("wm-action-menu >>> wm-button");
|
|
36
|
+
expect(wmbtn.getAttribute("aria-expanded")).toEqual("false");
|
|
37
|
+
await page.keyboard.press("Tab");
|
|
38
|
+
await page.waitForChanges();
|
|
39
|
+
await page.keyboard.press("ArrowDown");
|
|
40
|
+
await page.waitForChanges();
|
|
41
|
+
expect(wmbtn.getAttribute("aria-expanded")).toEqual("true");
|
|
42
|
+
const first = await page.find("wm-menuitem#first >>> div");
|
|
43
|
+
const second = await page.find("wm-menuitem#second >>> div");
|
|
44
|
+
expect(first).toHaveClass("focus");
|
|
45
|
+
await page.keyboard.press("ArrowDown");
|
|
46
|
+
await page.waitForChanges();
|
|
47
|
+
expect(second).toHaveClass("focus");
|
|
48
|
+
await page.keyboard.press("ArrowUp");
|
|
49
|
+
await page.waitForChanges();
|
|
50
|
+
expect(first).toHaveClass("focus");
|
|
51
|
+
await page.keyboard.press("Enter");
|
|
52
|
+
await page.waitForChanges();
|
|
53
|
+
await page.waitForTimeout(500); //allow closing animation and setTimeout to finish
|
|
54
|
+
expect(wmbtn.getAttribute("aria-expanded")).toEqual("false");
|
|
55
|
+
await page.keyboard.press("ArrowUp");
|
|
56
|
+
await page.waitForChanges();
|
|
57
|
+
// after the action runs the dropdown close and the dev should focus the relevant element.
|
|
58
|
+
// in case they don't, focus will return to the body. The component checks that and brings focus
|
|
59
|
+
// back to the button when that's the case.
|
|
60
|
+
// Things seem to happen differently with headless chrome / puppeteer. Focus stays on the menuitem even after
|
|
61
|
+
// it has become unable to have focus in normal browsers (after dropdown closes). Focus never gets to body.
|
|
62
|
+
// So here we simply test that the active el is not the body
|
|
63
|
+
const activeEl = await page.evaluate(() => document.activeElement.tagName);
|
|
64
|
+
expect(activeEl).not.toEqual("BODY");
|
|
65
|
+
expect(wmbtn.getAttribute("aria-expanded")).toEqual("true");
|
|
66
|
+
await page.keyboard.press("ArrowUp");
|
|
67
|
+
await page.waitForChanges();
|
|
68
|
+
expect(second).toHaveClass("focus");
|
|
69
|
+
});
|
|
70
|
+
// Home: If the dropdown is displayed, moves focus to first menuitem.
|
|
71
|
+
// End: If the dropdown is displayed, moves focus to last menuitem.
|
|
72
|
+
it("handles Home and End keys", async () => {
|
|
73
|
+
await page.keyboard.press("Tab");
|
|
74
|
+
await page.keyboard.press("Enter");
|
|
75
|
+
await page.waitForTimeout(40);
|
|
76
|
+
await page.keyboard.press("ArrowDown");
|
|
77
|
+
await page.keyboard.press("ArrowDown");
|
|
78
|
+
await page.waitForChanges();
|
|
79
|
+
const focusedEl = await page.find("wm-menuitem#third >>> div");
|
|
80
|
+
expect(focusedEl).toHaveClass("focus");
|
|
81
|
+
await page.keyboard.press("Home");
|
|
82
|
+
await page.waitForChanges();
|
|
83
|
+
const homefocusedEl = await page.find("wm-menuitem#first >>> div");
|
|
84
|
+
expect(focusedEl).not.toHaveClass("focus");
|
|
85
|
+
expect(homefocusedEl).toHaveClass("focus");
|
|
86
|
+
await page.keyboard.press("End");
|
|
87
|
+
await page.waitForChanges();
|
|
88
|
+
const endfocusedEl = await page.find("wm-menuitem#third >>> div");
|
|
89
|
+
expect(endfocusedEl).toHaveClass("focus");
|
|
90
|
+
});
|
|
91
|
+
// - Type a character: focus moves to the next menuitem with a name that starts with the typed character.
|
|
92
|
+
// - Type multiple characters in rapid succession: focus moves to the next menuitem with a name that starts with the string of characters typed
|
|
93
|
+
it("handles typing", async () => {
|
|
94
|
+
await page.keyboard.press("Tab");
|
|
95
|
+
await page.keyboard.press("Enter");
|
|
96
|
+
await page.waitForChanges();
|
|
97
|
+
await page.keyboard.press("t");
|
|
98
|
+
await page.waitForChanges();
|
|
99
|
+
const focusedEl = await page.find("wm-menuitem#third >>> div");
|
|
100
|
+
expect(focusedEl).toHaveClass("focus");
|
|
101
|
+
});
|
|
102
|
+
// OPEN / CLOSE
|
|
103
|
+
// Spacebar: Should open the popup (we didn't implement, comes for free. Test is to make sure we don't break it)
|
|
104
|
+
it("handles the Spacebar key", async () => {
|
|
105
|
+
await page.keyboard.press("Tab");
|
|
106
|
+
await page.keyboard.press("Space");
|
|
107
|
+
await page.waitForChanges();
|
|
108
|
+
const wmbtn = await page.find("wm-action-menu >>> wm-button");
|
|
109
|
+
expect(wmbtn.getAttribute("aria-expanded")).toEqual("true");
|
|
110
|
+
});
|
|
111
|
+
// Escape: If the menu is displayed, closes the popup and returns focus to the button.
|
|
112
|
+
it("handles the Escape key", async () => {
|
|
113
|
+
await page.keyboard.press("Tab");
|
|
114
|
+
await page.keyboard.press("Enter");
|
|
115
|
+
await page.waitForChanges();
|
|
116
|
+
const wmbtn = await page.find("wm-action-menu >>> wm-button");
|
|
117
|
+
expect(wmbtn.getAttribute("aria-expanded")).toEqual("true");
|
|
118
|
+
await page.keyboard.press("ArrowDown");
|
|
119
|
+
await page.keyboard.press("Escape");
|
|
120
|
+
await page.waitForChanges();
|
|
121
|
+
await page.waitForTimeout(500); //allow closing animation and setTimeout to finish
|
|
122
|
+
expect(wmbtn.getAttribute("aria-expanded")).toEqual("false");
|
|
123
|
+
const activeElId = await page.evaluate(() => document.activeElement.id);
|
|
124
|
+
expect(activeElId).toEqual("test");
|
|
125
|
+
//When dropdown reopens, focus returns to first element
|
|
126
|
+
await page.keyboard.press("Enter");
|
|
127
|
+
await page.waitForChanges();
|
|
128
|
+
expect(wmbtn.getAttribute("aria-expanded")).toEqual("true");
|
|
129
|
+
const focusedEl = await page.find("wm-menuitem#first >>> div");
|
|
130
|
+
expect(focusedEl).toHaveClass("focus"); //
|
|
131
|
+
});
|
|
132
|
+
// Enter:
|
|
133
|
+
// - If the focus is on the button, it expands the dropdown and places focuses on the first menuitem.
|
|
134
|
+
// - If the dropdown is open, it closes the dropdown.
|
|
135
|
+
it("opens and closes the dropdown when enter key is pressed", async () => {
|
|
136
|
+
await page.keyboard.press("Tab");
|
|
137
|
+
const wmbtn = await page.find("wm-action-menu >>> wm-button");
|
|
138
|
+
await page.keyboard.press("Enter");
|
|
139
|
+
await page.waitForChanges();
|
|
140
|
+
expect(wmbtn.getAttribute("aria-expanded")).toEqual("true");
|
|
141
|
+
await page.keyboard.press("Enter");
|
|
142
|
+
await page.waitForChanges();
|
|
143
|
+
expect(wmbtn.getAttribute("aria-expanded")).toEqual("false");
|
|
144
|
+
});
|
|
145
|
+
it("runs the onClick function passed to the menuitem when clicked or key pressed", async () => {
|
|
146
|
+
page = await newE2EPage();
|
|
147
|
+
await page.setContent(`<html lang='en'><head><title>Page</title></head><body><main><h1>Title</h1>
|
|
148
|
+
<wm-action-menu id='test' tooltip='menu name'>
|
|
149
|
+
<wm-menuitem id='first' onClick='action()'>First action</wm-menuitem>
|
|
150
|
+
</wm-action-menu>
|
|
151
|
+
<div id='changeMe'>default</div>
|
|
152
|
+
<script>
|
|
153
|
+
function action() {
|
|
154
|
+
document.getElementById('changeMe').textContent += "&"
|
|
155
|
+
}
|
|
156
|
+
</script></main></body></html>`);
|
|
157
|
+
const div = await page.find("#changeMe");
|
|
158
|
+
await page.keyboard.press("Tab");
|
|
159
|
+
await page.waitForChanges();
|
|
160
|
+
await page.keyboard.press("Enter");
|
|
161
|
+
await page.waitForChanges();
|
|
162
|
+
await page.keyboard.press("Enter");
|
|
163
|
+
await page.waitForChanges();
|
|
164
|
+
expect(div.textContent).toBe("default&");
|
|
165
|
+
await page.waitForTimeout(300); // make sure menu is closed before reopening (closes after the 250ms animation)
|
|
166
|
+
await page.keyboard.press("Enter");
|
|
167
|
+
await page.waitForChanges();
|
|
168
|
+
await page.click("#first");
|
|
169
|
+
await page.waitForChanges();
|
|
170
|
+
expect(div.textContent).toBe("default&&");
|
|
171
|
+
});
|
|
172
|
+
it("doesn't open the dropdown if the dropdown is disabled", async () => {
|
|
173
|
+
await page.evaluate(() => document.querySelector("wm-action-menu").setAttribute("disabled", "true"));
|
|
174
|
+
await page.keyboard.press("Tab");
|
|
175
|
+
await page.keyboard.press("Enter");
|
|
176
|
+
await page.waitForChanges();
|
|
177
|
+
const wmbtn = await page.find("wm-action-menu >>> wm-button");
|
|
178
|
+
await page.waitForChanges();
|
|
179
|
+
expect(wmbtn.getAttribute("aria-expanded")).toEqual("false");
|
|
180
|
+
});
|
|
181
|
+
// TOOLTIP
|
|
182
|
+
it("renders a tooltip when type is icon", async () => {
|
|
183
|
+
await page.keyboard.press("Tab");
|
|
184
|
+
await page.waitForChanges();
|
|
185
|
+
const tooltipEl = await page.find("#wm-tooltip");
|
|
186
|
+
expect(tooltipEl.textContent).toBe("menu name");
|
|
187
|
+
});
|
|
188
|
+
it("uses the label instead of tooltip text", async () => {
|
|
189
|
+
page = await newE2EPage();
|
|
190
|
+
await page.setContent("<wm-action-menu icon='f1c0' action-menu-type='icon' tooltip='delete' label-for-identical-buttons='delete this particular thing'><wm-menuitem>1</wm-menuitem></wm-action-menu>");
|
|
191
|
+
// use case: when the tooltip is something like "edit" and there are several buttons on a page, the aria label should be more specific than the tooltip
|
|
192
|
+
const wmbtn = await page.find("wm-action-menu >>> wm-button");
|
|
193
|
+
const btn = wmbtn.shadowRoot.querySelector("button");
|
|
194
|
+
await page.keyboard.press("Tab");
|
|
195
|
+
await page.waitForChanges();
|
|
196
|
+
const tooltipEl = await page.find("#wm-tooltip");
|
|
197
|
+
expect(tooltipEl.textContent).toEqual("delete");
|
|
198
|
+
expect(btn).toEqualAttribute("aria-label", "delete this particular thing");
|
|
199
|
+
});
|
|
200
|
+
});
|
|
@@ -190,7 +190,7 @@ export class ActionMenu {
|
|
|
190
190
|
return null;
|
|
191
191
|
}
|
|
192
192
|
render() {
|
|
193
|
-
return (h(Host, {
|
|
193
|
+
return (h(Host, { onBlur: () => this.close(false) }, h("div", { class: getTextDir() }, h("wm-button", { "button-type": this.internalButtonType, tooltip: this.tooltip, "custom-background": this.darkMode ? "dark" : undefined, "label-for-identical-buttons": this.labelForIdenticalButtons, icon: this.actionMenuType === "icon" ? "f1d9" : "", iconSize: this.actionMenuType === "icon" ? "24px" : undefined, id: "menubtn", onClick: () => (this.isExpanded ? this.close() : this.open()), onBlur: (ev) => this.handleButtonBlur(ev), disabled: this.disabled, ref: (el) => (this.wmButtonEl = el), "tooltip-position": this.tooltipPosition || this.horizontalPosition, "aria-haspopup": "true", "aria-expanded": this.isExpanded ? "true" : "false", "aria-controls": "menu" }, this.buttonText), h("div", { class: `dropdown ${this.openUp ? "open-up" : ""} ${this.horizontalPosition} ${this.isExpanded ? "open" : ""} hidden`, id: "menu", tabindex: -1, role: "menu", ref: (el) => (this.itemsEl = el) }, h("slot", null)))));
|
|
194
194
|
}
|
|
195
195
|
static get is() { return "wm-action-menu"; }
|
|
196
196
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { newSpecPage } from "@stencil/core/testing";
|
|
2
|
+
import { ActionMenu } from "./wm-action-menu";
|
|
3
|
+
import { Menuitem } from "../wm-menuitem/wm-menuitem";
|
|
4
|
+
import * as globalFuncs from "../../global/functions";
|
|
5
|
+
jest.spyOn(globalFuncs, "getTextDir").mockImplementation(() => "rtl");
|
|
6
|
+
jest.spyOn(globalFuncs, "generateId");
|
|
7
|
+
// @ts-ignore
|
|
8
|
+
globalFuncs.generateId.mockImplementation(() => "random-id");
|
|
9
|
+
describe("wm-action-menu", () => {
|
|
10
|
+
it("builds", async () => {
|
|
11
|
+
const page = await newSpecPage({
|
|
12
|
+
components: [ActionMenu, Menuitem],
|
|
13
|
+
html: "<wm-action-menu action-menu-type='icon' tooltip='Menu Name'><wm-menuitem icon='f3eb' onClick='someFunction()'>Menuitem one</wm-menuitem></wm-action-menu>",
|
|
14
|
+
});
|
|
15
|
+
expect(page.root).toMatchSnapshot();
|
|
16
|
+
});
|
|
17
|
+
it("has the right props", () => {
|
|
18
|
+
const menu = new ActionMenu();
|
|
19
|
+
expect(menu).toHaveProperty("childItems");
|
|
20
|
+
expect(menu).toHaveProperty("keysSoFar");
|
|
21
|
+
expect(menu).toHaveProperty("searchIndex");
|
|
22
|
+
expect(menu).toHaveProperty("tooltipPosition");
|
|
23
|
+
expect(menu).toHaveProperty("actionMenuType");
|
|
24
|
+
expect(menu).toHaveProperty("buttonText");
|
|
25
|
+
expect(menu).toHaveProperty("tooltip");
|
|
26
|
+
expect(menu).toHaveProperty("labelForIdenticalButtons");
|
|
27
|
+
});
|
|
28
|
+
describe("error throwing", () => {
|
|
29
|
+
it("throws error when action-menu-type is text/selector but no button-text is passed", async () => {
|
|
30
|
+
const mockFunc = jest.fn();
|
|
31
|
+
console.error = mockFunc;
|
|
32
|
+
await newSpecPage({
|
|
33
|
+
components: [ActionMenu, Menuitem],
|
|
34
|
+
html: "<wm-action-menu action-menu-type='text'><wm-menuitem icon='f3eb' onClick='someFunction()'>Menuitem one</wm-menuitem></wm-action-menu>",
|
|
35
|
+
});
|
|
36
|
+
expect(mockFunc).toHaveBeenCalledWith("wm-action-menu should have a valid button-text property when action-menu-type is set to 'text' or 'selector'");
|
|
37
|
+
});
|
|
38
|
+
it("throws error when action-menu-type is icon but no tooltip is passed", async () => {
|
|
39
|
+
const mockFunc = jest.fn();
|
|
40
|
+
console.error = mockFunc;
|
|
41
|
+
await newSpecPage({
|
|
42
|
+
components: [ActionMenu, Menuitem],
|
|
43
|
+
html: "<wm-action-menu action-menu-type='icon'><wm-menuitem icon='f3eb' onClick='someFunction()'>Menuitem one</wm-menuitem></wm-action-menu>",
|
|
44
|
+
});
|
|
45
|
+
expect(mockFunc).toHaveBeenCalledWith("wm-action-menu should have a valid tooltip when action-menu-type is set to 'icon'");
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { newE2EPage } from "@stencil/core/testing";
|
|
2
|
+
import { AxePuppeteer } from "@axe-core/puppeteer";
|
|
3
|
+
describe("wm-button", () => {
|
|
4
|
+
let page;
|
|
5
|
+
beforeEach(async () => {
|
|
6
|
+
page = await newE2EPage();
|
|
7
|
+
});
|
|
8
|
+
it("passes Axe checks", async () => {
|
|
9
|
+
await page.setContent(`<html lang='en'><head><title>Page</title></head><body><main><h1>Title</h1>
|
|
10
|
+
<wm-button>Click me</wm-button>
|
|
11
|
+
</main></body></html>`);
|
|
12
|
+
const results = await new AxePuppeteer(page).analyze();
|
|
13
|
+
expect(results.violations.length).toBe(0);
|
|
14
|
+
});
|
|
15
|
+
it("renders a button", async () => {
|
|
16
|
+
await page.setContent("<wm-button></wm-button>");
|
|
17
|
+
const element = await page.find("wm-button >>> button");
|
|
18
|
+
expect(element).not.toBeNull();
|
|
19
|
+
});
|
|
20
|
+
it("delegates focus", async () => {
|
|
21
|
+
await page.setContent("<wm-button>click here</wm-button>");
|
|
22
|
+
const wmButton = await page.find("wm-button");
|
|
23
|
+
wmButton.focus();
|
|
24
|
+
let activeEl = await page.evaluate(async () => {
|
|
25
|
+
let el = await document.activeElement.shadowRoot.activeElement;
|
|
26
|
+
return el.nodeName;
|
|
27
|
+
});
|
|
28
|
+
expect(activeEl).toBe("BUTTON");
|
|
29
|
+
});
|
|
30
|
+
it("renders a tooltip for text-only buttons if text is truncated", async () => {
|
|
31
|
+
await page.setContent("<wm-button text-wrap='false' style='width: 100px' button-type='textonly'>Text-only button with a very long text and text-wrap set to false</wm-button>");
|
|
32
|
+
await page.waitForChanges();
|
|
33
|
+
await page.keyboard.press("Tab");
|
|
34
|
+
await page.waitForChanges();
|
|
35
|
+
const tooltip = await page.find("#wm-tooltip");
|
|
36
|
+
expect(tooltip.textContent).toEqual("Text-only button with a very long text and text-wrap set to false");
|
|
37
|
+
});
|
|
38
|
+
it("uses the label instead of tooltip text", async () => {
|
|
39
|
+
// use case: when the tooltip is something like "edit" and there are several buttons on a page, the aria label should be more specific than the tooltip
|
|
40
|
+
await page.setContent("<wm-button button-type='icononly' icon='f1c0' tooltip='delete' label-for-identical-buttons='Delete item 37' ></wm-button>");
|
|
41
|
+
await page.waitForChanges();
|
|
42
|
+
const btn = await page.find("wm-button >>> button");
|
|
43
|
+
expect(btn.getAttribute("aria-label")).toBe("Delete item 37");
|
|
44
|
+
});
|
|
45
|
+
it("renders the passed-in property button type property as a class", async () => {
|
|
46
|
+
await page.setContent("<wm-button></wm-button>");
|
|
47
|
+
const component = await page.find("wm-button");
|
|
48
|
+
const defaultButton = await page.find("wm-button >>> button");
|
|
49
|
+
expect(defaultButton).toHaveClass("-secondary");
|
|
50
|
+
component.setProperty("buttonType", "primary");
|
|
51
|
+
const primaryButton = await page.find("wm-button >>> button");
|
|
52
|
+
await page.waitForChanges();
|
|
53
|
+
expect(primaryButton).toHaveClass("-primary");
|
|
54
|
+
});
|
|
55
|
+
});
|
|
@@ -166,7 +166,7 @@ export class Button {
|
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
render() {
|
|
169
|
-
return (h(Host, {
|
|
169
|
+
return (h(Host, { class: `${this.isDisabled ? "button-disabled" : ""} -${this.buttonType}` }, h("button", { id: this.id, class: `${this.buttonClasses}`, disabled: this.isDisabled, ref: (el) => (this.buttonEl = el), "aria-label": this.getAriaLabel(), "aria-hasPopup": this.ariaPopup ? "menu" : null, onMouseEnter: (ev) => this.handleMouseEnter(ev), onMouseLeave: () => hideTooltip(), onFocus: (ev) => this.handleFocus(ev), onBlur: () => hideTooltip(), onClick: () => hideTooltip() }, this.icon && (h("span", { class: "mdi", style: this.iconStyles, "aria-hidden": "true" }, String.fromCodePoint(parseInt(`0x${this.icon}`)))), h("span", { class: "button-text" }, h("slot", null)))));
|
|
170
170
|
}
|
|
171
171
|
static get is() { return "wm-button"; }
|
|
172
172
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { newSpecPage } from "@stencil/core/testing";
|
|
2
|
+
import * as globalFunctions from "../../global/functions";
|
|
3
|
+
jest.spyOn(globalFunctions, "generateId").mockReturnValue("random-id");
|
|
4
|
+
import { Button } from "./wm-button";
|
|
5
|
+
describe("button", () => {
|
|
6
|
+
it("builds", async () => {
|
|
7
|
+
const page = await newSpecPage({
|
|
8
|
+
components: [Button],
|
|
9
|
+
html: "<wm-button></wm-button>",
|
|
10
|
+
});
|
|
11
|
+
expect(page.root).toMatchSnapshot();
|
|
12
|
+
});
|
|
13
|
+
it("has style and an icon type props with default values", async () => {
|
|
14
|
+
const page = await newSpecPage({
|
|
15
|
+
components: [Button],
|
|
16
|
+
html: "<wm-button></wm-button>",
|
|
17
|
+
});
|
|
18
|
+
const button = page.root;
|
|
19
|
+
const buttonEl = page.root.shadowRoot.querySelector("button");
|
|
20
|
+
expect(button).toHaveProperty("buttonType");
|
|
21
|
+
expect(button.buttonType).toEqual("secondary");
|
|
22
|
+
expect(buttonEl).toHaveClass("-secondary");
|
|
23
|
+
expect(button).toHaveProperty("icon");
|
|
24
|
+
expect(button.icon).toEqual(undefined);
|
|
25
|
+
expect(button).toHaveProperty("iconSize");
|
|
26
|
+
expect(button.iconSize).toBeUndefined;
|
|
27
|
+
});
|
|
28
|
+
it("has a method that validates the style property and resets an invalid property to a button type of secondary", async () => {
|
|
29
|
+
const page = await newSpecPage({
|
|
30
|
+
components: [Button],
|
|
31
|
+
html: "<wm-button></wm-button>",
|
|
32
|
+
});
|
|
33
|
+
const button = page.root;
|
|
34
|
+
expect(button).toHaveProperty("buttonType");
|
|
35
|
+
button.setAttribute("button-type", "foobar");
|
|
36
|
+
expect(button.buttonType).toEqual("secondary");
|
|
37
|
+
});
|
|
38
|
+
it("sets the aria label if the property labelForIdenticalButtons is passed", async () => {
|
|
39
|
+
const page = await newSpecPage({
|
|
40
|
+
components: [Button],
|
|
41
|
+
html: "<wm-button label-for-identical-buttons='read this instead of the text'>Button</wm-button>",
|
|
42
|
+
});
|
|
43
|
+
const button = page.root.shadowRoot.querySelector("button");
|
|
44
|
+
expect(button).toEqualAttribute("aria-label", "read this instead of the text");
|
|
45
|
+
});
|
|
46
|
+
// TOOLTIP
|
|
47
|
+
describe("error throwing", () => {
|
|
48
|
+
it("throws error when icononly or navigational button used without tooltip", async () => {
|
|
49
|
+
const mockFunc = jest.fn();
|
|
50
|
+
console.error = mockFunc;
|
|
51
|
+
await newSpecPage({
|
|
52
|
+
components: [Button],
|
|
53
|
+
html: "<wm-button icon='f1c0' button-type='icononly'></wm-button>",
|
|
54
|
+
});
|
|
55
|
+
expect(mockFunc).toHaveBeenCalledWith("wm-button should have a valid 'tooltip' property when button-type is set to 'icononly' or 'navigational'.");
|
|
56
|
+
const mockFunc2 = jest.fn();
|
|
57
|
+
console.error = mockFunc2;
|
|
58
|
+
await newSpecPage({
|
|
59
|
+
components: [Button],
|
|
60
|
+
html: "<wm-button icon='f1c0' button-type='navigational'></wm-button>",
|
|
61
|
+
});
|
|
62
|
+
expect(mockFunc2).toHaveBeenCalledWith("wm-button should have a valid 'tooltip' property when button-type is set to 'icononly' or 'navigational'.");
|
|
63
|
+
});
|
|
64
|
+
it("throws error when icononly button used without icon", async () => {
|
|
65
|
+
const mockFunc = jest.fn();
|
|
66
|
+
console.error = mockFunc;
|
|
67
|
+
await newSpecPage({
|
|
68
|
+
components: [Button],
|
|
69
|
+
html: "<wm-button button-type='icononly' tooltip='edit'></wm-button>",
|
|
70
|
+
});
|
|
71
|
+
expect(mockFunc).toHaveBeenCalledWith("wm-button should have a valid 'icon' property when button-type is set to 'icononly' or 'navigational'.");
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
});
|
|
@@ -168,7 +168,7 @@ export class File {
|
|
|
168
168
|
return (h("div", { class: `file-wrapper ${this.progress === 100 ? "checked" : ""}` }, h("div", { class: `file ${this.errorMessage ? "--error" : ""}` }, this.renderFileName(), !this.errorMessage && (h("div", { class: `right-group ${this.isCondensed ? "condensed" : ""}` }, this.renderFileInfo(), this.fileActions !== "" && this.renderFileControls())), this.errorMessage && (h("wm-button", { "permanently-delete": true, "button-type": "textonly", "label-for-identical-buttons": this.generateClearButtonLabel(this.name), onClick: () => this.wmFileErrorCleared.emit() }, this.clearButtonText))), this.errorMessage && h("div", { class: "error-message" }, this.errorMessage)));
|
|
169
169
|
}
|
|
170
170
|
render() {
|
|
171
|
-
return h(Host, {
|
|
171
|
+
return h(Host, { role: "listitem" }, this.isUploading ? this.renderFileInProgress() : this.renderFile());
|
|
172
172
|
}
|
|
173
173
|
static get is() { return "wm-file"; }
|
|
174
174
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { newSpecPage } from "@stencil/core/testing";
|
|
2
|
+
import { File } from "./wm-file";
|
|
3
|
+
// mock ResizeObserver
|
|
4
|
+
global.ResizeObserver = jest.fn().mockImplementation(() => ({
|
|
5
|
+
observe: jest.fn(),
|
|
6
|
+
unobserve: jest.fn(),
|
|
7
|
+
disconnect: jest.fn(),
|
|
8
|
+
}));
|
|
9
|
+
describe("wm-file", () => {
|
|
10
|
+
let html, page;
|
|
11
|
+
async function createPageHelper() {
|
|
12
|
+
return await newSpecPage({
|
|
13
|
+
components: [File],
|
|
14
|
+
html: `<wm-file
|
|
15
|
+
id="file1"
|
|
16
|
+
name="File retrieved from server"
|
|
17
|
+
type="pdf"
|
|
18
|
+
last-updated="10/30/97 3:46 PM"
|
|
19
|
+
size="22 KB"
|
|
20
|
+
file-actions="download preview delete"
|
|
21
|
+
>
|
|
22
|
+
</wm-file>`,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
it("renders green check alongside recently uploaded files", async () => {
|
|
26
|
+
html = `<wm-file
|
|
27
|
+
id="file1"
|
|
28
|
+
name="File retrieved from server"
|
|
29
|
+
type="pdf"
|
|
30
|
+
last-updated="10/30/97 3:46 PM"
|
|
31
|
+
size="22 KB"
|
|
32
|
+
file-actions="download preview delete"
|
|
33
|
+
progress="100"
|
|
34
|
+
>
|
|
35
|
+
</wm-file>`;
|
|
36
|
+
page = await newSpecPage({ components: [File], html });
|
|
37
|
+
await page.waitForChanges();
|
|
38
|
+
const fileWrapperEl = page.root.shadowRoot.querySelector(".file-wrapper");
|
|
39
|
+
expect(fileWrapperEl).toHaveClass("checked");
|
|
40
|
+
});
|
|
41
|
+
it("renders file actions in the proper order", async () => {
|
|
42
|
+
html = `<wm-file
|
|
43
|
+
id="file1"
|
|
44
|
+
name="File retrieved from server"
|
|
45
|
+
type="pdf"
|
|
46
|
+
last-updated="10/30/97 3:46 PM"
|
|
47
|
+
size="22 KB"
|
|
48
|
+
file-actions="download delete preview"
|
|
49
|
+
>
|
|
50
|
+
</wm-file>`;
|
|
51
|
+
page = await newSpecPage({ components: [File], html });
|
|
52
|
+
await page.waitForChanges();
|
|
53
|
+
const fileActionEls = page.root.shadowRoot.querySelectorAll("wm-button");
|
|
54
|
+
expect(fileActionEls[0]).toEqualAttribute("tooltip", "Preview");
|
|
55
|
+
expect(fileActionEls[1]).toEqualAttribute("tooltip", "Download");
|
|
56
|
+
expect(fileActionEls[2]).toEqualAttribute("tooltip", "Delete");
|
|
57
|
+
});
|
|
58
|
+
it("defaults available actions to download and delete", async () => {
|
|
59
|
+
html = `<wm-file
|
|
60
|
+
id="file1"
|
|
61
|
+
name="File retrieved from server"
|
|
62
|
+
type="pdf"
|
|
63
|
+
last-updated="10/30/97 3:46 PM"
|
|
64
|
+
size="22 KB"
|
|
65
|
+
>
|
|
66
|
+
</wm-file>`;
|
|
67
|
+
page = await newSpecPage({ components: [File], html });
|
|
68
|
+
await page.waitForChanges();
|
|
69
|
+
const deleteButton = page.root.shadowRoot.querySelector(".delete-button");
|
|
70
|
+
const downloadButton = page.root.shadowRoot.querySelector(".download-button");
|
|
71
|
+
const previewButton = page.root.shadowRoot.querySelector(".preview-button");
|
|
72
|
+
expect(deleteButton).toBeTruthy();
|
|
73
|
+
expect(downloadButton).toBeTruthy();
|
|
74
|
+
expect(previewButton).toBeFalsy();
|
|
75
|
+
});
|
|
76
|
+
it("displays no file actions when an empty string is passed", async () => {
|
|
77
|
+
html = `<wm-file
|
|
78
|
+
id="file1"
|
|
79
|
+
name="File retrieved from server"
|
|
80
|
+
type="pdf"
|
|
81
|
+
last-updated="10/30/97 3:46 PM"
|
|
82
|
+
size="22 KB"
|
|
83
|
+
file-actions=""
|
|
84
|
+
>
|
|
85
|
+
</wm-file>`;
|
|
86
|
+
page = await newSpecPage({ components: [File], html });
|
|
87
|
+
await page.waitForChanges();
|
|
88
|
+
const deleteButton = page.root.shadowRoot.querySelector(".delete-button");
|
|
89
|
+
const downloadButton = page.root.shadowRoot.querySelector(".download-button");
|
|
90
|
+
const previewButton = page.root.shadowRoot.querySelector(".preview-button");
|
|
91
|
+
expect(deleteButton).toBeFalsy();
|
|
92
|
+
expect(downloadButton).toBeFalsy();
|
|
93
|
+
expect(previewButton).toBeFalsy();
|
|
94
|
+
});
|
|
95
|
+
it("renders timestamp by default, size if specified, or none based on show-info prop", async () => {
|
|
96
|
+
page = await createPageHelper();
|
|
97
|
+
await page.waitForChanges();
|
|
98
|
+
let fileInfoEl = page.root.shadowRoot.querySelector(".file-info");
|
|
99
|
+
expect(fileInfoEl.textContent).toBe("10/30/97 3:46 PM");
|
|
100
|
+
page = await newSpecPage({
|
|
101
|
+
components: [File],
|
|
102
|
+
html: `<wm-file
|
|
103
|
+
id="file1"
|
|
104
|
+
name="File retrieved from server"
|
|
105
|
+
type="pdf"
|
|
106
|
+
last-updated="10/30/97 3:46 PM"
|
|
107
|
+
size="22 KB"
|
|
108
|
+
file-actions="download preview delete"
|
|
109
|
+
show-info="size"
|
|
110
|
+
>
|
|
111
|
+
</wm-file>`,
|
|
112
|
+
});
|
|
113
|
+
await page.waitForChanges();
|
|
114
|
+
fileInfoEl = page.root.shadowRoot.querySelector(".file-info");
|
|
115
|
+
expect(fileInfoEl.textContent).toBe("22 KB");
|
|
116
|
+
page = await newSpecPage({
|
|
117
|
+
components: [File],
|
|
118
|
+
html: `<wm-file
|
|
119
|
+
id="file1"
|
|
120
|
+
name="File retrieved from server"
|
|
121
|
+
type="pdf"
|
|
122
|
+
last-updated="10/30/97 3:46 PM"
|
|
123
|
+
size="22 KB"
|
|
124
|
+
file-actions="download preview delete"
|
|
125
|
+
show-info="time"
|
|
126
|
+
>
|
|
127
|
+
</wm-file>`,
|
|
128
|
+
});
|
|
129
|
+
await page.waitForChanges();
|
|
130
|
+
fileInfoEl = page.root.shadowRoot.querySelector(".file-info");
|
|
131
|
+
expect(fileInfoEl.textContent).toBe("10/30/97 3:46 PM");
|
|
132
|
+
page = await newSpecPage({
|
|
133
|
+
components: [File],
|
|
134
|
+
html: `<wm-file
|
|
135
|
+
id="file1"
|
|
136
|
+
name="File retrieved from server"
|
|
137
|
+
type="pdf"
|
|
138
|
+
last-updated="10/30/97 3:46 PM"
|
|
139
|
+
size="22 KB"
|
|
140
|
+
file-actions="download preview delete"
|
|
141
|
+
show-info="none"
|
|
142
|
+
>
|
|
143
|
+
</wm-file>`,
|
|
144
|
+
});
|
|
145
|
+
await page.waitForChanges();
|
|
146
|
+
fileInfoEl = page.root.shadowRoot.querySelector(".file-info");
|
|
147
|
+
expect(fileInfoEl).toBeFalsy();
|
|
148
|
+
});
|
|
149
|
+
it("emits the appropriate events when user clicks the buttons", async () => {
|
|
150
|
+
const filePreviewedSpy = jest.fn();
|
|
151
|
+
const fileDownloadedSpy = jest.fn();
|
|
152
|
+
const fileDeletedSpy = jest.fn();
|
|
153
|
+
html = `<wm-file
|
|
154
|
+
id="file1"
|
|
155
|
+
name="File retrieved from server"
|
|
156
|
+
type="pdf"
|
|
157
|
+
last-updated="10/30/97 3:46 PM"
|
|
158
|
+
size="22 KB"
|
|
159
|
+
file-actions="download preview delete"
|
|
160
|
+
>
|
|
161
|
+
</wm-file>`;
|
|
162
|
+
page = await newSpecPage({ components: [File], html });
|
|
163
|
+
await page.waitForChanges();
|
|
164
|
+
page.root.addEventListener("wmFilePreview", filePreviewedSpy);
|
|
165
|
+
page.root.addEventListener("wmFileDownload", fileDownloadedSpy);
|
|
166
|
+
page.root.addEventListener("wmFileDelete", fileDeletedSpy);
|
|
167
|
+
// wmFilePreview
|
|
168
|
+
page.root.shadowRoot.querySelector(".preview-button").click();
|
|
169
|
+
await page.waitForChanges();
|
|
170
|
+
expect(filePreviewedSpy.mock.calls[0][0].target.id).toBe("file1");
|
|
171
|
+
// wmFileDownload
|
|
172
|
+
page.root.shadowRoot.querySelector(".download-button").click();
|
|
173
|
+
await page.waitForChanges();
|
|
174
|
+
expect(fileDownloadedSpy.mock.calls[0][0].target.id).toBe("file1");
|
|
175
|
+
// wmFileDelete
|
|
176
|
+
page.root.shadowRoot.querySelector(".delete-button").click();
|
|
177
|
+
await page.waitForChanges();
|
|
178
|
+
expect(fileDeletedSpy.mock.calls[0][0].target.id).toBe("file1");
|
|
179
|
+
jest.restoreAllMocks();
|
|
180
|
+
});
|
|
181
|
+
it("renders with an error if one is passed", async () => {
|
|
182
|
+
html = `<wm-file
|
|
183
|
+
id="file1"
|
|
184
|
+
error-message="Example error message"
|
|
185
|
+
file='{"id": "file1", "name": "File retrieved from server.pdf", "lastUpdated": "10/30/97 3:46 PM", "size": "22 KB", "fileActions": "download preview delete"}'
|
|
186
|
+
></wm-file>`;
|
|
187
|
+
page = await newSpecPage({ components: [File], html });
|
|
188
|
+
await page.waitForChanges();
|
|
189
|
+
const fileDiv = page.root.shadowRoot.querySelector(".file");
|
|
190
|
+
expect(fileDiv).toHaveClass("--error");
|
|
191
|
+
const errorText = page.root.shadowRoot.querySelector(".error-message");
|
|
192
|
+
expect(errorText.textContent).toBe("Example error message");
|
|
193
|
+
});
|
|
194
|
+
});
|
|
@@ -4,7 +4,7 @@ export class FileList {
|
|
|
4
4
|
this.showInfo = "last-updated";
|
|
5
5
|
}
|
|
6
6
|
render() {
|
|
7
|
-
return (h("div", {
|
|
7
|
+
return (h("div", { role: "list", class: "list-wrapper" }, h("slot", null)));
|
|
8
8
|
}
|
|
9
9
|
static get is() { return "wm-file-list"; }
|
|
10
10
|
static get encapsulation() { return "shadow"; }
|