@watermarkinsights/ripple 5.10.0-14 → 5.10.0-16
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/README.md +3 -3
- package/dist/cjs/{chartFunctions-a3a08880.js → chartFunctions-c4046c7a.js} +3 -3
- package/dist/cjs/{functions-5ac8a62f.js → functions-e24249e6.js} +7 -104
- package/dist/{esm/app-globals-69d4c258.js → cjs/global-705d39bd.js} +3 -8
- package/dist/cjs/index-e86c28b6.js +2649 -0
- package/dist/cjs/{intl-57d1cfd1.js → intl-790f6c37.js} +11 -15
- package/dist/cjs/loader.cjs.js +4 -5
- package/dist/cjs/priv-calendar.cjs.entry.js +6 -7
- package/dist/cjs/priv-chart-popover.cjs.entry.js +6 -7
- package/dist/cjs/priv-navigator-button.cjs.entry.js +4 -5
- package/dist/cjs/priv-navigator-item.cjs.entry.js +4 -5
- package/dist/cjs/priv-option-list.cjs.entry.js +5 -6
- package/dist/cjs/ripple.cjs.js +12 -13
- package/dist/cjs/wm-action-menu_2.cjs.entry.js +8 -10
- package/dist/cjs/wm-button.cjs.entry.js +5 -6
- package/dist/cjs/wm-chart-slice.cjs.entry.js +1 -1
- package/dist/cjs/wm-chart.cjs.entry.js +7 -8
- package/dist/cjs/wm-date-range.cjs.entry.js +9 -10
- package/dist/cjs/wm-datepicker.cjs.entry.js +9 -10
- package/dist/cjs/wm-file-list.cjs.entry.js +4 -5
- package/dist/cjs/wm-file.cjs.entry.js +5 -6
- package/dist/cjs/wm-input.cjs.entry.js +6 -7
- package/dist/cjs/wm-line-chart.cjs.entry.js +15 -16
- package/dist/cjs/wm-modal-pss_3.cjs.entry.js +13 -16
- package/dist/cjs/wm-modal_3.cjs.entry.js +13 -16
- package/dist/cjs/wm-navigation_3.cjs.entry.js +13 -16
- package/dist/cjs/wm-navigator.cjs.entry.js +4 -5
- package/dist/cjs/wm-nested-select.cjs.entry.js +8 -9
- package/dist/cjs/wm-optgroup.cjs.entry.js +5 -6
- package/dist/cjs/wm-option_2.cjs.entry.js +10 -12
- package/dist/cjs/wm-pagination.cjs.entry.js +5 -6
- package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +9 -11
- package/dist/cjs/wm-search.cjs.entry.js +7 -8
- package/dist/cjs/wm-snackbar.cjs.entry.js +7 -8
- package/dist/cjs/wm-tab-item_3.cjs.entry.js +11 -14
- package/dist/cjs/wm-tag-input.cjs.entry.js +8 -9
- package/dist/cjs/wm-tag-option.cjs.entry.js +2 -2
- package/dist/cjs/wm-textarea.cjs.entry.js +6 -7
- package/dist/cjs/wm-timepicker.cjs.entry.js +6 -7
- package/dist/cjs/wm-toggletip.cjs.entry.js +6 -7
- package/dist/cjs/wm-uploader.cjs.entry.js +98 -17
- 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.css +5 -5
- 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.css +5 -5
- 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.css +5 -5
- 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.css +5 -5
- 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.css +5 -5
- 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/datepicker.css +5 -5
- package/dist/collection/components/datepickers/priv-calendar/priv-calendar.css +5 -5
- 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 +13 -17
- 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 +13 -17
- package/dist/collection/components/datepickers/wm-datepicker.spec.js +21 -0
- package/dist/collection/components/selects/priv-option-list/priv-option-list.css +5 -5
- package/dist/collection/components/selects/priv-option-list/priv-option-list.js +5 -7
- package/dist/collection/components/selects/wm-nested-select/wm-nested-select.css +5 -5
- package/dist/collection/components/selects/wm-nested-select/wm-nested-select.js +3 -3
- package/dist/collection/components/selects/wm-optgroup/wm-optgroup.css +5 -5
- package/dist/collection/components/selects/wm-optgroup/wm-optgroup.js +1 -1
- package/dist/collection/components/selects/wm-option/wm-option.css +5 -5
- package/dist/collection/components/selects/wm-option/wm-option.e2e.js +22 -0
- package/dist/collection/components/selects/wm-option/wm-option.js +1 -1
- package/dist/collection/components/selects/wm-option/wm-option.spec.js +63 -0
- package/dist/collection/components/selects/wm-select/wm-select.css +5 -5
- package/dist/collection/components/selects/wm-select/wm-select.e2e.js +521 -0
- package/dist/collection/components/selects/wm-select/wm-select.js +2 -2
- package/dist/collection/components/selects/wm-select/wm-select.spec.js +271 -0
- package/dist/collection/components/wm-action-menu/wm-action-menu.css +5 -5
- 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.css +5 -5
- 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.css +5 -5
- 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.css +5 -5
- 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.css +5 -5
- 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.css +5 -5
- 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.css +5 -5
- 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.css +5 -5
- 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.css +5 -5
- 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-modal-pss/wm-modal-pss-footer.css +5 -5
- package/dist/collection/components/wm-modal-pss/wm-modal-pss-footer.js +1 -1
- package/dist/collection/components/wm-modal-pss/wm-modal-pss-header.css +5 -5
- package/dist/collection/components/wm-modal-pss/wm-modal-pss-header.js +1 -1
- package/dist/collection/components/wm-modal-pss/wm-modal-pss.css +5 -5
- package/dist/collection/components/wm-modal-pss/wm-modal-pss.js +2 -2
- package/dist/collection/components/wm-navigation/wm-navigation-hamburger.css +5 -5
- package/dist/collection/components/wm-navigation/wm-navigation-hamburger.js +1 -1
- package/dist/collection/components/wm-navigation/wm-navigation-item.css +5 -5
- package/dist/collection/components/wm-navigation/wm-navigation-item.js +1 -1
- package/dist/collection/components/wm-navigation/wm-navigation.css +5 -5
- 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.css +5 -5
- 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.css +5 -5
- package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.js +2 -2
- package/dist/collection/components/wm-navigator/wm-navigator.css +5 -5
- 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-pagination/wm-pagination.css +5 -5
- 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.css +5 -5
- 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-snackbar/wm-snackbar.css +5 -5
- 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.css +5 -5
- 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.css +5 -5
- 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.css +5 -5
- 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.css +5 -5
- 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.css +5 -5
- 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.css +5 -5
- 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.css +5 -5
- 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.css +154 -13
- package/dist/collection/components/wm-uploader/wm-uploader.e2e.js +70 -0
- package/dist/collection/components/wm-uploader/wm-uploader.js +154 -11
- package/dist/collection/components/wm-uploader/wm-uploader.spec.js +234 -0
- package/dist/collection/global/functions.spec.js +126 -0
- package/dist/collection/global/global.js +1 -1
- package/dist/collection/global/intl.js +10 -14
- package/dist/collection/lang/lang.spec.js +20 -0
- package/dist/collection/lang/missing.js +43 -43
- package/dist/collection/lang/piglatin.js +93 -93
- package/dist/esm/{chartFunctions-21d5a3d3.js → chartFunctions-5555bab0.js} +3 -3
- package/dist/esm/{functions-f39e6177.js → functions-8800c690.js} +8 -105
- package/dist/{cjs/app-globals-385434e8.js → esm/global-a377e5a4.js} +2 -11
- package/dist/esm/index-558b5a82.js +2618 -0
- package/dist/esm/{intl-dda73e98.js → intl-82ebfb79.js} +11 -15
- package/dist/esm/loader.js +5 -6
- 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 +6 -7
- package/dist/esm/priv-navigator-button.entry.js +4 -5
- package/dist/esm/priv-navigator-item.entry.js +4 -5
- package/dist/esm/priv-option-list.entry.js +5 -6
- package/dist/esm/ripple.js +13 -14
- package/dist/esm/wm-action-menu_2.entry.js +8 -10
- package/dist/esm/wm-button.entry.js +5 -6
- package/dist/esm/wm-chart-slice.entry.js +1 -1
- package/dist/esm/wm-chart.entry.js +7 -8
- package/dist/esm/wm-date-range.entry.js +9 -10
- package/dist/esm/wm-datepicker.entry.js +9 -10
- package/dist/esm/wm-file-list.entry.js +4 -5
- package/dist/esm/wm-file.entry.js +5 -6
- package/dist/esm/wm-input.entry.js +6 -7
- package/dist/esm/wm-line-chart.entry.js +15 -16
- package/dist/esm/wm-modal-pss_3.entry.js +13 -16
- package/dist/esm/wm-modal_3.entry.js +13 -16
- package/dist/esm/wm-navigation_3.entry.js +13 -16
- package/dist/esm/wm-navigator.entry.js +4 -5
- package/dist/esm/wm-nested-select.entry.js +8 -9
- package/dist/esm/wm-optgroup.entry.js +5 -6
- package/dist/esm/wm-option_2.entry.js +10 -12
- package/dist/esm/wm-pagination.entry.js +5 -6
- package/dist/esm/wm-progress-indicator_3.entry.js +9 -11
- package/dist/esm/wm-search.entry.js +7 -8
- package/dist/esm/wm-snackbar.entry.js +7 -8
- package/dist/esm/wm-tab-item_3.entry.js +11 -14
- package/dist/esm/wm-tag-input.entry.js +8 -9
- package/dist/esm/wm-tag-option.entry.js +2 -2
- package/dist/esm/wm-textarea.entry.js +6 -7
- package/dist/esm/wm-timepicker.entry.js +6 -7
- package/dist/esm/wm-toggletip.entry.js +6 -7
- package/dist/esm/wm-uploader.entry.js +98 -17
- package/dist/esm/wm-wrapper.entry.js +1 -1
- package/dist/esm-es5/{chartFunctions-21d5a3d3.js → chartFunctions-5555bab0.js} +1 -1
- package/dist/esm-es5/functions-8800c690.js +1 -0
- package/dist/esm-es5/global-a377e5a4.js +1 -0
- package/dist/esm-es5/index-558b5a82.js +1 -0
- package/dist/esm-es5/{intl-dda73e98.js → intl-82ebfb79.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/priv-option-list.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-pss_3.entry.js +1 -1
- package/dist/esm-es5/wm-modal_3.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-nested-select.entry.js +1 -1
- package/dist/esm-es5/wm-optgroup.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-04502e9c.entry.js +1 -0
- package/dist/ripple/p-0aa8c50e.entry.js +1 -0
- package/dist/ripple/p-0b4b0741.system.entry.js +1 -0
- package/dist/ripple/p-0bffcc33.entry.js +1 -0
- package/dist/ripple/p-0d082f95.entry.js +1 -0
- package/dist/ripple/p-0eddc626.entry.js +1 -0
- package/dist/ripple/p-0fc6dab9.system.entry.js +1 -0
- package/dist/ripple/{p-73ce9af7.js → p-11d66b54.js} +1 -1
- package/dist/ripple/p-1887c39d.entry.js +1 -0
- package/dist/ripple/p-1a4d00a9.system.entry.js +1 -0
- package/dist/ripple/p-1bb48113.system.entry.js +1 -0
- package/dist/ripple/p-1f695ead.system.entry.js +1 -0
- package/dist/ripple/p-21a4a455.system.entry.js +1 -0
- package/dist/ripple/p-221a7c22.entry.js +1 -0
- package/dist/ripple/{p-37b044c7.system.js → p-2ce69098.system.js} +1 -1
- package/dist/ripple/{p-823d7b4e.system.entry.js → p-32bf3f5b.system.entry.js} +1 -1
- package/dist/ripple/p-34014c8d.system.entry.js +1 -0
- package/dist/ripple/p-34218322.system.entry.js +1 -0
- package/dist/ripple/p-3bdb760a.entry.js +1 -0
- package/dist/ripple/p-3c3c6b29.system.entry.js +1 -0
- package/dist/ripple/p-3fb7444d.system.entry.js +1 -0
- package/dist/ripple/p-40129c5d.js +1 -0
- package/dist/ripple/{p-c34c9cbb.system.entry.js → p-4743176d.system.entry.js} +1 -1
- package/dist/ripple/{p-13b1d775.entry.js → p-48e09589.entry.js} +1 -1
- package/dist/ripple/p-4abcb864.entry.js +1 -0
- package/dist/ripple/p-4edb481f.system.entry.js +1 -0
- package/dist/ripple/p-50501e07.entry.js +1 -0
- package/dist/ripple/p-51718b06.system.entry.js +1 -0
- package/dist/ripple/{p-44526834.entry.js → p-53975533.entry.js} +1 -1
- package/dist/ripple/p-568c595f.js +2 -0
- package/dist/ripple/{p-f41ab9ea.js → p-599dd035.js} +1 -1
- package/dist/ripple/{p-61769bc6.entry.js → p-5a2b1e2b.system.entry.js} +1 -1
- package/dist/ripple/p-5f78dd11.entry.js +1 -0
- package/dist/ripple/p-5fe90111.entry.js +1 -0
- package/dist/ripple/{p-043901ab.system.entry.js → p-65d26233.system.entry.js} +1 -1
- package/dist/ripple/{p-470ee72d.system.entry.js → p-68f39a1f.system.entry.js} +1 -1
- package/dist/ripple/p-6a7fd013.system.entry.js +1 -0
- package/dist/ripple/p-6b859ff2.entry.js +1 -0
- package/dist/ripple/p-72bf2c06.system.entry.js +1 -0
- package/dist/ripple/p-76a9ae45.system.js +1 -0
- package/dist/ripple/{p-b0dddc8b.system.js → p-7a647f51.system.js} +1 -1
- package/dist/ripple/p-7cf74ee6.system.js +1 -0
- package/dist/ripple/p-7f0ca371.system.entry.js +1 -0
- package/dist/ripple/p-7f7c5da2.system.entry.js +1 -0
- package/dist/ripple/p-88ae8914.system.entry.js +1 -0
- package/dist/ripple/p-88c968e7.system.entry.js +1 -0
- package/dist/ripple/{p-cd0cc88d.entry.js → p-88ebddd7.entry.js} +1 -1
- package/dist/ripple/p-8d7ecab9.entry.js +1 -0
- package/dist/ripple/p-8fcebe03.entry.js +1 -0
- package/dist/ripple/p-919fd2b6.entry.js +1 -0
- package/dist/ripple/p-950dc6c4.system.entry.js +1 -0
- package/dist/ripple/p-9f2a0e0a.entry.js +1 -0
- package/dist/ripple/p-9f38f65d.system.entry.js +1 -0
- package/dist/ripple/p-a0e84979.entry.js +1 -0
- package/dist/ripple/p-ab8d78cc.system.js +2 -0
- package/dist/ripple/{p-2d3c8179.system.entry.js → p-ac625334.system.entry.js} +1 -1
- package/dist/ripple/p-b0512477.system.entry.js +1 -0
- package/dist/ripple/p-b0ada8f7.system.entry.js +1 -0
- package/dist/ripple/p-b1fe3bbc.system.entry.js +1 -0
- package/dist/ripple/p-b72aa60b.entry.js +1 -0
- package/dist/ripple/{p-76d248e6.entry.js → p-b976c84b.entry.js} +1 -1
- package/dist/ripple/p-bc566798.entry.js +1 -0
- package/dist/ripple/p-c0f370f9.system.entry.js +1 -0
- package/dist/ripple/p-c6c43720.entry.js +1 -0
- package/dist/ripple/p-ce191133.entry.js +1 -0
- package/dist/ripple/{p-4de2ab7e.system.entry.js → p-d168b8bc.entry.js} +1 -1
- package/dist/ripple/p-d8bc3fd7.system.entry.js +1 -0
- package/dist/ripple/p-dadb480d.system.entry.js +1 -0
- package/dist/ripple/p-dcbed420.entry.js +1 -0
- package/dist/ripple/{p-f03dd608.system.entry.js → p-df387590.entry.js} +1 -1
- package/dist/ripple/p-e49d3992.entry.js +1 -0
- package/dist/ripple/p-e5b62488.entry.js +1 -0
- package/dist/ripple/{p-86520ba3.system.entry.js → p-e5c8a584.entry.js} +1 -1
- package/dist/ripple/p-eca78c2b.js +1 -0
- package/dist/ripple/p-edd87140.system.js +1 -0
- package/dist/ripple/p-ef980041.system.entry.js +1 -0
- package/dist/ripple/p-f623828b.entry.js +1 -0
- package/dist/ripple/p-f94b8117.system.entry.js +1 -0
- package/dist/ripple/p-fef994ea.entry.js +1 -0
- package/dist/ripple/ripple.css +1 -1
- package/dist/ripple/ripple.esm.js +1 -1
- package/dist/ripple/ripple.js +1 -1
- package/dist/types/components/wm-uploader/wm-uploader.d.ts +16 -2
- package/dist/types/components.d.ts +10 -6
- package/dist/types/global/intl.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 -1859
- package/dist/esm/index-130e07bb.js +0 -1828
- package/dist/esm-es5/app-globals-69d4c258.js +0 -1
- package/dist/esm-es5/functions-f39e6177.js +0 -1
- package/dist/esm-es5/index-130e07bb.js +0 -1
- package/dist/ripple/p-01621baa.system.entry.js +0 -1
- package/dist/ripple/p-066e22a8.entry.js +0 -1
- package/dist/ripple/p-0b9cfafd.entry.js +0 -1
- package/dist/ripple/p-1b022b07.entry.js +0 -1
- package/dist/ripple/p-1b3c81cd.system.entry.js +0 -1
- package/dist/ripple/p-1dbc5def.system.entry.js +0 -1
- package/dist/ripple/p-1e9e2b61.entry.js +0 -1
- package/dist/ripple/p-23d2a65e.system.entry.js +0 -1
- package/dist/ripple/p-2a825f9b.system.entry.js +0 -1
- package/dist/ripple/p-382d18ef.entry.js +0 -1
- package/dist/ripple/p-3bf21b98.entry.js +0 -1
- package/dist/ripple/p-3d1bb82e.system.entry.js +0 -1
- package/dist/ripple/p-3de00415.entry.js +0 -1
- package/dist/ripple/p-3f486eed.system.js +0 -1
- package/dist/ripple/p-446adb62.entry.js +0 -1
- package/dist/ripple/p-457b0368.entry.js +0 -1
- package/dist/ripple/p-45bb1cca.entry.js +0 -1
- package/dist/ripple/p-4a88d7f0.system.entry.js +0 -1
- package/dist/ripple/p-4b41b2b2.system.entry.js +0 -1
- package/dist/ripple/p-54bf5f8f.system.entry.js +0 -1
- package/dist/ripple/p-55175883.system.entry.js +0 -1
- package/dist/ripple/p-585d7d8b.entry.js +0 -1
- package/dist/ripple/p-5d7bb3db.system.entry.js +0 -1
- package/dist/ripple/p-60bfae00.system.entry.js +0 -1
- package/dist/ripple/p-6182809b.system.entry.js +0 -1
- package/dist/ripple/p-69111fc9.entry.js +0 -1
- package/dist/ripple/p-6e674694.entry.js +0 -1
- package/dist/ripple/p-7936661f.entry.js +0 -1
- package/dist/ripple/p-7d2bdfa7.system.entry.js +0 -1
- package/dist/ripple/p-7e8ce599.entry.js +0 -1
- package/dist/ripple/p-834d3b6e.system.entry.js +0 -1
- package/dist/ripple/p-84bbdb6c.system.entry.js +0 -1
- package/dist/ripple/p-86aa69a1.system.entry.js +0 -1
- package/dist/ripple/p-89419541.system.entry.js +0 -1
- package/dist/ripple/p-89a2db02.js +0 -1
- package/dist/ripple/p-8c5e08b0.entry.js +0 -1
- package/dist/ripple/p-8ee66c9b.entry.js +0 -1
- package/dist/ripple/p-8f6688d1.entry.js +0 -1
- package/dist/ripple/p-8fd93b85.system.js +0 -1
- package/dist/ripple/p-916ac4da.system.entry.js +0 -1
- package/dist/ripple/p-9bc259e7.system.entry.js +0 -1
- package/dist/ripple/p-9d50b702.entry.js +0 -1
- package/dist/ripple/p-a377f8ca.system.entry.js +0 -1
- package/dist/ripple/p-a388c103.system.entry.js +0 -1
- package/dist/ripple/p-a80168b0.entry.js +0 -1
- package/dist/ripple/p-aabde755.entry.js +0 -1
- package/dist/ripple/p-b0268240.js +0 -1
- package/dist/ripple/p-b25b3606.system.js +0 -1
- package/dist/ripple/p-b6427999.system.entry.js +0 -1
- package/dist/ripple/p-c1031d35.system.entry.js +0 -1
- package/dist/ripple/p-c679e48c.system.entry.js +0 -1
- package/dist/ripple/p-c92ef4d6.entry.js +0 -1
- package/dist/ripple/p-cef8a45b.system.js +0 -2
- package/dist/ripple/p-d52910b9.entry.js +0 -1
- package/dist/ripple/p-d9da0502.js +0 -2
- package/dist/ripple/p-da765ca3.entry.js +0 -1
- package/dist/ripple/p-dad57469.entry.js +0 -1
- package/dist/ripple/p-e06014b0.entry.js +0 -1
- package/dist/ripple/p-e69169a2.system.entry.js +0 -1
- package/dist/ripple/p-eeccd224.entry.js +0 -1
- package/dist/ripple/p-eee1dcec.entry.js +0 -1
- package/dist/ripple/p-fdfca672.entry.js +0 -1
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import AxePuppeteer from "@axe-core/puppeteer";
|
|
2
|
+
import { newE2EPage } from "@stencil/core/testing";
|
|
3
|
+
describe("wm-tag-input", () => {
|
|
4
|
+
// ts throws erroneous warning about vars being unused...
|
|
5
|
+
// @ts-ignore
|
|
6
|
+
let page, el, input;
|
|
7
|
+
beforeEach(async () => {
|
|
8
|
+
page = await newE2EPage();
|
|
9
|
+
await page.setContent(`<html lang='en'><head><title>Page</title></head><body><main><h1>Title</h1>
|
|
10
|
+
<wm-tag-input label='label'>
|
|
11
|
+
<wm-tag-option>One</wm-tag-option>
|
|
12
|
+
<wm-tag-option>Two</wm-tag-option>
|
|
13
|
+
<wm-tag-option>Three</wm-tag-option>
|
|
14
|
+
</wm-tag-input>
|
|
15
|
+
</main></body></html>`);
|
|
16
|
+
el = await page.find("wm-tag-input");
|
|
17
|
+
input = await page.find("wm-tag-input >>> input");
|
|
18
|
+
await page.waitForChanges();
|
|
19
|
+
});
|
|
20
|
+
it("passes Axe checks", async () => {
|
|
21
|
+
const results = await new AxePuppeteer(page).analyze();
|
|
22
|
+
expect(results.violations.length).toBe(0);
|
|
23
|
+
});
|
|
24
|
+
it.skip("uses Enter and Comma to add a new tag", async () => {
|
|
25
|
+
page = await newE2EPage();
|
|
26
|
+
await page.setContent(`<html lang='en'><head><title>Page</title></head><body><main><h1>Title</h1>
|
|
27
|
+
<wm-tag-input label='label'></wm-tag-input>
|
|
28
|
+
</main></body></html>`);
|
|
29
|
+
await page.waitForChanges();
|
|
30
|
+
await page.keyboard.press("Tab");
|
|
31
|
+
await page.waitForChanges();
|
|
32
|
+
await page.keyboard.type("Hello");
|
|
33
|
+
await page.waitForChanges();
|
|
34
|
+
await page.keyboard.press("Enter");
|
|
35
|
+
await page.waitForChanges();
|
|
36
|
+
let tags = await page.findAll("wm-tag-input >>> .tag");
|
|
37
|
+
expect(tags[0].textContent).toBe("Hello");
|
|
38
|
+
await page.keyboard.type("Apple");
|
|
39
|
+
await page.waitForChanges();
|
|
40
|
+
await page.keyboard.type(",");
|
|
41
|
+
await page.waitForChanges();
|
|
42
|
+
tags = await page.findAll("wm-tag-input >>> .tag");
|
|
43
|
+
expect(tags[1].textContent).toBe("Apple");
|
|
44
|
+
// it clears the input when adding a tag
|
|
45
|
+
const input = await page.find("wm-tag-input >>> input");
|
|
46
|
+
const inputValue = await input.getProperty("value");
|
|
47
|
+
expect(inputValue).toBe("");
|
|
48
|
+
// it includes user-added options in the dropdown
|
|
49
|
+
const listItems = await page.findAll("wm-tag-input >>> .option");
|
|
50
|
+
expect(listItems[0].textContent).toBe("Apple");
|
|
51
|
+
expect(listItems[1].textContent).toBe("Hello");
|
|
52
|
+
// it shows tags in the order they are added
|
|
53
|
+
await page.keyboard.type("Third");
|
|
54
|
+
await page.waitForChanges();
|
|
55
|
+
await page.keyboard.press("Enter");
|
|
56
|
+
await page.waitForChanges();
|
|
57
|
+
tags = await page.findAll("wm-tag-input >>> .tag");
|
|
58
|
+
expect(tags[0].textContent).toBe("Hello");
|
|
59
|
+
expect(tags[1].textContent).toBe("Apple");
|
|
60
|
+
expect(tags[2].textContent).toBe("Third");
|
|
61
|
+
});
|
|
62
|
+
it("displays column1 text instead of id for table variant", async () => {
|
|
63
|
+
page = await newE2EPage();
|
|
64
|
+
await page.setContent(`<html lang='en'><head><title>Page</title></head><body><main><h1>Title</h1>
|
|
65
|
+
<wm-tag-input
|
|
66
|
+
tag-input-type="table"
|
|
67
|
+
label="Share Access"
|
|
68
|
+
col-headers="Name,Email,Role"
|
|
69
|
+
col-widths=",40%,20%"
|
|
70
|
+
col-wrap="wrap,trunc,wrap"
|
|
71
|
+
>
|
|
72
|
+
<wm-tag-option selected id="johnprice1" col1="John Price" col2="john.price1@university.edu" col3="Admin" locked></wm-tag-option>
|
|
73
|
+
<wm-tag-option id="johnprice2" col1="John Price" col2="john.price2@university.edu" col3="Faculty"></wm-tag-option>
|
|
74
|
+
<wm-tag-option id="samsandwich" col1="Sam Sandwich" col2="sam.sandwich@university.edu" col3="Faculty"></wm-tag-option>
|
|
75
|
+
</wm-tag-input>
|
|
76
|
+
</main></body></html>`);
|
|
77
|
+
await page.waitForChanges();
|
|
78
|
+
let tagTextList = await page.findAll("wm-tag-input >>> .tag-text");
|
|
79
|
+
expect(tagTextList[0].textContent).toBe("John Price");
|
|
80
|
+
});
|
|
81
|
+
it("does not allow adding tags if add-new prop is false", async () => {
|
|
82
|
+
page = await newE2EPage();
|
|
83
|
+
await page.setContent(`<html lang='en'><head><title>Page</title></head><body><main><h1>Title</h1>
|
|
84
|
+
<wm-tag-input label='label' add-new="false"></wm-tag-input>
|
|
85
|
+
</main></body></html>`);
|
|
86
|
+
await page.keyboard.press("Tab");
|
|
87
|
+
await page.waitForChanges();
|
|
88
|
+
await page.keyboard.press("Tab");
|
|
89
|
+
await page.waitForChanges();
|
|
90
|
+
await page.keyboard.type("New Tag");
|
|
91
|
+
await page.waitForChanges();
|
|
92
|
+
await page.keyboard.press("Enter");
|
|
93
|
+
await page.waitForChanges();
|
|
94
|
+
const tags = await page.findAll("wm-tag-input >>> .tag");
|
|
95
|
+
expect(tags.length).toBe(0);
|
|
96
|
+
});
|
|
97
|
+
it("does not allow duplicate tags to be added", async () => {
|
|
98
|
+
page = await newE2EPage();
|
|
99
|
+
await page.setContent(`<html lang='en'><head><title>Page</title></head><body><main><h1>Title</h1>
|
|
100
|
+
<wm-tag-input label='label'>
|
|
101
|
+
<wm-tag-option selected>one</wm-tag-option>
|
|
102
|
+
</wm-tag-input>
|
|
103
|
+
</main></body></html>`);
|
|
104
|
+
let tags = await page.findAll("wm-tag-input >>> .tag");
|
|
105
|
+
expect(tags.length).toBe(1);
|
|
106
|
+
await page.keyboard.press("Tab");
|
|
107
|
+
await page.waitForChanges();
|
|
108
|
+
await page.keyboard.press("Tab");
|
|
109
|
+
await page.waitForChanges();
|
|
110
|
+
await page.keyboard.type("one");
|
|
111
|
+
await page.waitForChanges();
|
|
112
|
+
await page.keyboard.press("Enter");
|
|
113
|
+
await page.waitForChanges();
|
|
114
|
+
await page.keyboard.press("Delete");
|
|
115
|
+
await page.keyboard.press("Delete");
|
|
116
|
+
await page.keyboard.press("Delete");
|
|
117
|
+
await page.waitForChanges();
|
|
118
|
+
// it is case insensitive
|
|
119
|
+
await page.keyboard.type("OnE");
|
|
120
|
+
await page.waitForChanges();
|
|
121
|
+
await page.keyboard.press("Enter");
|
|
122
|
+
await page.waitForChanges();
|
|
123
|
+
expect(tags.length).toBe(1);
|
|
124
|
+
});
|
|
125
|
+
it("opens dropdown when input field is focused", async () => {
|
|
126
|
+
const dropdown = await page.find("wm-tag-input >>> .dropdown-wrapper");
|
|
127
|
+
expect(dropdown).not.toHaveClass("open");
|
|
128
|
+
await input.focus();
|
|
129
|
+
expect(dropdown).toHaveClass("open");
|
|
130
|
+
});
|
|
131
|
+
it("closes dropdown", async () => {
|
|
132
|
+
//
|
|
133
|
+
// when pressing escape twice
|
|
134
|
+
// when clicking outside of component
|
|
135
|
+
// when tabbing out of component
|
|
136
|
+
// not while tabbing inside of component
|
|
137
|
+
});
|
|
138
|
+
it("renders the add new button when typing in the input", async () => { });
|
|
139
|
+
it("removes only user-added tags from the dropdown", async () => {
|
|
140
|
+
// Removing a pre-existing tag will have it still in the dropdown
|
|
141
|
+
// removing a user-added tag will remove it from the dropdown
|
|
142
|
+
});
|
|
143
|
+
it("navigates the dropdown with arrow keys", async () => {
|
|
144
|
+
let options = await page.findAll("wm-tag-input >>> .option");
|
|
145
|
+
await page.keyboard.press("Tab");
|
|
146
|
+
await page.waitForChanges();
|
|
147
|
+
await page.keyboard.press("ArrowDown");
|
|
148
|
+
await page.waitForChanges();
|
|
149
|
+
expect(options[0]).toHaveClass("focused");
|
|
150
|
+
expect(options[1]).not.toHaveClass("focused");
|
|
151
|
+
expect(options[2]).not.toHaveClass("focused");
|
|
152
|
+
await page.keyboard.press("ArrowDown");
|
|
153
|
+
await page.waitForChanges();
|
|
154
|
+
expect(options[0]).not.toHaveClass("focused");
|
|
155
|
+
expect(options[1]).toHaveClass("focused");
|
|
156
|
+
expect(options[2]).not.toHaveClass("focused");
|
|
157
|
+
await page.keyboard.press("ArrowDown");
|
|
158
|
+
await page.waitForChanges();
|
|
159
|
+
expect(options[0]).not.toHaveClass("focused");
|
|
160
|
+
expect(options[1]).not.toHaveClass("focused");
|
|
161
|
+
expect(options[2]).toHaveClass("focused");
|
|
162
|
+
await page.keyboard.press("ArrowDown");
|
|
163
|
+
await page.waitForChanges();
|
|
164
|
+
expect(options[0]).toHaveClass("focused");
|
|
165
|
+
expect(options[1]).not.toHaveClass("focused");
|
|
166
|
+
expect(options[2]).not.toHaveClass("focused");
|
|
167
|
+
await page.keyboard.press("ArrowUp");
|
|
168
|
+
await page.waitForChanges();
|
|
169
|
+
expect(options[0]).not.toHaveClass("focused");
|
|
170
|
+
expect(options[1]).not.toHaveClass("focused");
|
|
171
|
+
expect(options[2]).toHaveClass("focused");
|
|
172
|
+
});
|
|
173
|
+
it("navigates tags with left and right keys", async () => {
|
|
174
|
+
page = await newE2EPage();
|
|
175
|
+
await page.setContent(`<html lang='en'><head><title>Page</title></head><body><main><h1>Title</h1>
|
|
176
|
+
<wm-tag-input label='label'>
|
|
177
|
+
<wm-tag-option selected>One</wm-tag-option>
|
|
178
|
+
<wm-tag-option selected>Two</wm-tag-option>
|
|
179
|
+
<wm-tag-option selected>Three</wm-tag-option>
|
|
180
|
+
</wm-tag-input>
|
|
181
|
+
</main></body></html>`);
|
|
182
|
+
let tags = await page.findAll("wm-tag-input >>> .tag");
|
|
183
|
+
await page.keyboard.press("Tab");
|
|
184
|
+
await page.waitForChanges();
|
|
185
|
+
expect(tags[0]).toHaveClass("focused");
|
|
186
|
+
expect(tags[1]).not.toHaveClass("focused");
|
|
187
|
+
expect(tags[2]).not.toHaveClass("focused");
|
|
188
|
+
await page.keyboard.press("ArrowRight");
|
|
189
|
+
await page.waitForChanges();
|
|
190
|
+
expect(tags[0]).not.toHaveClass("focused");
|
|
191
|
+
expect(tags[1]).toHaveClass("focused");
|
|
192
|
+
expect(tags[2]).not.toHaveClass("focused");
|
|
193
|
+
await page.keyboard.press("ArrowLeft");
|
|
194
|
+
await page.waitForChanges();
|
|
195
|
+
expect(tags[0]).toHaveClass("focused");
|
|
196
|
+
expect(tags[1]).not.toHaveClass("focused");
|
|
197
|
+
expect(tags[2]).not.toHaveClass("focused");
|
|
198
|
+
await page.keyboard.press("ArrowLeft");
|
|
199
|
+
await page.waitForChanges();
|
|
200
|
+
expect(tags[0]).not.toHaveClass("focused");
|
|
201
|
+
expect(tags[1]).not.toHaveClass("focused");
|
|
202
|
+
expect(tags[2]).toHaveClass("focused");
|
|
203
|
+
});
|
|
204
|
+
});
|
|
@@ -858,12 +858,12 @@ export class TagInput {
|
|
|
858
858
|
}
|
|
859
859
|
}
|
|
860
860
|
render() {
|
|
861
|
-
return (h("div", {
|
|
861
|
+
return (h("div", { class: `wrapper label-${this.labelPosition} ${this.errorMessage ? "invalid" : ""}` }, h("div", { class: "label-wrapper" }, h("label", { class: "label", htmlFor: "input" }, this.label, this.requiredField && (h("span", { class: "required", "aria-hidden": "true" }, "*")))), h("div", { class: `field-wrapper ${this.el.shadowRoot.activeElement === this.inputEl ? "focused" : ""} ${this.errorMessage ? "invalid" : ""}`, ref: (el) => (this.fieldWrapperEl = el) }, h("div", { class: "upper-row" }, h("div", { class: `tags-and-input-wrapper ${this.inModal ? "in-modal" : ""}` }, h("ul", { ref: (el) => (this.tagAreaEl = el), class: `tag-area ${this.taggedOptions.length === 0 && "empty"} ${this.isKeying ? "user-is-keying" : ""}`, role: "listbox", "aria-activedescendant": this.focusedTag ? this.focusedTag.id : null, "aria-orientation": "horizontal", "aria-label": `${this.label} ${this.tagAreaInstructions}`, tabindex: this._tagEls.length > 0 ? 0 : -1, "aria-describedby": `info max-tags`, onFocus: (ev) => this.handleTagAreaFocus(ev), onBlur: (ev) => {
|
|
862
862
|
this.focusedTagIndex = undefined;
|
|
863
863
|
this.handleBlur(ev);
|
|
864
|
-
}, onKeyDown: (ev) => this.handleTagAreaKeyDown(ev) }, this.renderTags()), h("input", {
|
|
864
|
+
}, onKeyDown: (ev) => this.handleTagAreaKeyDown(ev) }, this.renderTags()), h("input", { id: "input", class: "input", role: "combobox", ref: (el) => (this.inputEl = el), autocomplete: "off", "aria-required": this.requiredField ? "true" : null, "aria-controls": this.tagInputType, "aria-describedby": `help-text${this.errorMessage ? " error " : ""} max-tags`, "aria-label": `${this.label} ${this.isDropdown ? globalMessages.getCharacterLimit(this.characterLimit) : ""}`, "aria-expanded": this.isDropdown ? this.isExpanded.toString() : null, "aria-activedescendant": this.inputActiveDescendantId, placeholder: this.placeholder, maxLength: this.isDropdown ? this.characterLimit : undefined, onInput: (ev) => this.handleInputChanged(ev), onBlur: (ev) => {
|
|
865
865
|
this.handleBlur(ev);
|
|
866
|
-
}, onFocus: () => this.handleInputFocus(), onKeyDown: (ev) => this.handleInputKeyDown(ev) })), this.isDropdown && (h("div", {
|
|
866
|
+
}, onFocus: () => this.handleInputFocus(), onKeyDown: (ev) => this.handleInputKeyDown(ev) })), this.isDropdown && (h("div", { class: "character-count" }, this.charCount, "/", this.characterLimit))), this.renderTagCounter(), this.isDropdown && this.renderDropdown()), this.info && (h("div", { id: "info", class: "info-text" }, this.info)), h("div", { id: "error" }, this.errorMessage), h("div", { class: "sr-only", "aria-live": "polite", ref: (el) => (this.liveRegionEl = el), "aria-atomic": "true" }, this.liveRegionMessage), this.isTable && this.renderTable()));
|
|
867
867
|
}
|
|
868
868
|
static get is() { return "wm-tag-input"; }
|
|
869
869
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { newSpecPage } from "@stencil/core/testing";
|
|
2
|
+
import { TagInput } from "./wm-tag-input";
|
|
3
|
+
import { TagOption } from "./wm-tag-option/wm-tag-option";
|
|
4
|
+
import * as globalFuncs from "../../global/functions";
|
|
5
|
+
jest.spyOn(globalFuncs, "generateId");
|
|
6
|
+
// @ts-ignore
|
|
7
|
+
globalFuncs.generateId.mockImplementation(() => "random-id");
|
|
8
|
+
// mock observers
|
|
9
|
+
global.ResizeObserver = jest.fn().mockImplementation(() => ({
|
|
10
|
+
observe: jest.fn(),
|
|
11
|
+
unobserve: jest.fn(),
|
|
12
|
+
disconnect: jest.fn(),
|
|
13
|
+
}));
|
|
14
|
+
global.MutationObserver = jest.fn().mockImplementation(() => ({
|
|
15
|
+
observe: jest.fn(),
|
|
16
|
+
unobserve: jest.fn(),
|
|
17
|
+
disconnect: jest.fn(),
|
|
18
|
+
}));
|
|
19
|
+
// mockComputedStyle, component measures the placeholder on render to properly position the input
|
|
20
|
+
global.getComputedStyle = jest
|
|
21
|
+
.fn()
|
|
22
|
+
.mockImplementation(() => ({
|
|
23
|
+
paddingLeft: "0px",
|
|
24
|
+
paddingRight: "0px",
|
|
25
|
+
marginLeft: "0px",
|
|
26
|
+
marginRight: "0px",
|
|
27
|
+
}));
|
|
28
|
+
describe("taginput", () => {
|
|
29
|
+
let page;
|
|
30
|
+
beforeEach(async () => {
|
|
31
|
+
page = await newSpecPage({
|
|
32
|
+
components: [TagInput, TagOption],
|
|
33
|
+
html: `<wm-tag-input id="input" label="label">
|
|
34
|
+
<wm-tag-option>one</wm-tag-option>
|
|
35
|
+
<wm-tag-option>two</wm-tag-option>
|
|
36
|
+
<wm-tag-option>three</wm-tag-option>
|
|
37
|
+
<wm-tag-option>four</wm-tag-option>
|
|
38
|
+
</wm-tag-input>`,
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
it("builds", async () => {
|
|
42
|
+
expect(page.root).toMatchSnapshot();
|
|
43
|
+
});
|
|
44
|
+
it("has right aria roles", async () => {
|
|
45
|
+
page = await newSpecPage({
|
|
46
|
+
components: [TagInput, TagOption],
|
|
47
|
+
html: `<wm-tag-input label="label" info="info text">
|
|
48
|
+
<wm-tag-option selected>one</wm-tag-option>
|
|
49
|
+
<wm-tag-option>two</wm-tag-option>
|
|
50
|
+
<wm-tag-option selected>three</wm-tag-option>
|
|
51
|
+
<wm-tag-option>four</wm-tag-option>
|
|
52
|
+
</wm-tag-input>`,
|
|
53
|
+
});
|
|
54
|
+
const label = await page.root.shadowRoot.querySelector("label");
|
|
55
|
+
expect(label.textContent).toBe("label");
|
|
56
|
+
const input = await page.root.shadowRoot.querySelector("input");
|
|
57
|
+
expect(input).toEqualAttribute("role", "combobox");
|
|
58
|
+
expect(input).toEqualAttribute("aria-label", "label 50 characters allowed.");
|
|
59
|
+
const helpText = await page.root.shadowRoot.querySelector(".help-text");
|
|
60
|
+
expect(input).toEqualAttribute("aria-describedby", helpText.id);
|
|
61
|
+
const dropdown = await page.root.shadowRoot.querySelector(".dropdown");
|
|
62
|
+
expect(dropdown).toEqualAttribute("role", "listbox");
|
|
63
|
+
expect(dropdown).toHaveAttribute("aria-multiselectable");
|
|
64
|
+
const options = await page.root.shadowRoot.querySelectorAll(".option");
|
|
65
|
+
options.forEach((option) => {
|
|
66
|
+
expect(option).toEqualAttribute("role", "option");
|
|
67
|
+
});
|
|
68
|
+
const tagArea = await page.root.shadowRoot.querySelector(".tag-area");
|
|
69
|
+
expect(tagArea).toEqualAttribute("role", "listbox");
|
|
70
|
+
expect(tagArea).toEqualAttribute("aria-label", "label tag selection. Press Backspace or Delete to remove a tag.");
|
|
71
|
+
expect(tagArea).toEqualAttribute("aria-describedby", "info max-tags");
|
|
72
|
+
expect(tagArea).toEqualAttribute("aria-orientation", "horizontal");
|
|
73
|
+
const tags = await page.root.shadowRoot.querySelectorAll(".tag");
|
|
74
|
+
tags.forEach((tag) => {
|
|
75
|
+
expect(tag).toEqualAttribute("role", "option");
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
it("changes help text when options are not provided", async () => {
|
|
79
|
+
// not editable with options
|
|
80
|
+
page = await newSpecPage({
|
|
81
|
+
components: [TagInput, TagOption],
|
|
82
|
+
html: `<wm-tag-input label="label" add-new="false">
|
|
83
|
+
<wm-tag-option>One</wm-tag-option>
|
|
84
|
+
<wm-tag-option>Two</wm-tag-option>
|
|
85
|
+
<wm-tag-option>Three</wm-tag-option>
|
|
86
|
+
</wm-tag-input>`,
|
|
87
|
+
});
|
|
88
|
+
const el = page.root;
|
|
89
|
+
let helpText = await el.shadowRoot.querySelector(".help-text");
|
|
90
|
+
expect(helpText.textContent).toBe("Search and select a tag.");
|
|
91
|
+
// editable with options
|
|
92
|
+
page = await newSpecPage({
|
|
93
|
+
components: [TagInput, TagOption],
|
|
94
|
+
html: `<wm-tag-input label="label">
|
|
95
|
+
<wm-tag-option>One</wm-tag-option>
|
|
96
|
+
<wm-tag-option>Two</wm-tag-option>
|
|
97
|
+
<wm-tag-option>Three</wm-tag-option>
|
|
98
|
+
</wm-tag-input>`,
|
|
99
|
+
});
|
|
100
|
+
helpText = await page.root.shadowRoot.querySelector(".help-text");
|
|
101
|
+
expect(helpText.textContent).toBe("Search and select a tag. Press the Enter or Comma key to add a new tag.");
|
|
102
|
+
// editable without options
|
|
103
|
+
page = await newSpecPage({
|
|
104
|
+
components: [TagInput, TagOption],
|
|
105
|
+
html: `<wm-tag-input label="label"></wm-tag-input>`,
|
|
106
|
+
});
|
|
107
|
+
helpText = await page.root.shadowRoot.querySelector(".help-text");
|
|
108
|
+
expect(helpText.textContent).toBe(" Press the Enter or Comma key to add a new tag.");
|
|
109
|
+
});
|
|
110
|
+
it("shows the appropriate default placeholder text", async () => {
|
|
111
|
+
// editable with options
|
|
112
|
+
await page.setContent(`<wm-tag-input label="label">
|
|
113
|
+
<wm-tag-option>One</wm-tag-option>
|
|
114
|
+
<wm-tag-option>Two</wm-tag-option>
|
|
115
|
+
</wm-tag-input>`);
|
|
116
|
+
let input = await page.root.shadowRoot.querySelector("input");
|
|
117
|
+
expect(input).toEqualAttribute("placeholder", "Add or search for a tag");
|
|
118
|
+
// editable without options
|
|
119
|
+
page = await newSpecPage({
|
|
120
|
+
components: [TagInput, TagOption],
|
|
121
|
+
html: `<wm-tag-input label="label"></wm-tag-input>`,
|
|
122
|
+
});
|
|
123
|
+
input = await page.root.shadowRoot.querySelector("input");
|
|
124
|
+
expect(input).toEqualAttribute("placeholder", "Add a new tag");
|
|
125
|
+
// not editable
|
|
126
|
+
page = await newSpecPage({
|
|
127
|
+
components: [TagInput, TagOption],
|
|
128
|
+
html: `<wm-tag-input label="label" add-new="false">
|
|
129
|
+
<wm-tag-option>One</wm-tag-option>
|
|
130
|
+
<wm-tag-option>Two</wm-tag-option>
|
|
131
|
+
<wm-tag-option>Three</wm-tag-option>
|
|
132
|
+
</wm-tag-input>`,
|
|
133
|
+
});
|
|
134
|
+
input = await page.root.shadowRoot.querySelector("input");
|
|
135
|
+
expect(input).toEqualAttribute("placeholder", "Search and select a tag");
|
|
136
|
+
});
|
|
137
|
+
it("throws error if no label prop is passed", async () => {
|
|
138
|
+
const mockConsoleError = (console.error = jest.fn());
|
|
139
|
+
await page.setContent(`<wm-tag-input></wm-tag-input>`);
|
|
140
|
+
expect(mockConsoleError).toHaveBeenCalledWith("wm-tag-input must have a label property");
|
|
141
|
+
jest.restoreAllMocks();
|
|
142
|
+
});
|
|
143
|
+
describe("handles announcements", () => {
|
|
144
|
+
it("announces live region notifications", async () => {
|
|
145
|
+
// announce
|
|
146
|
+
const component = new TagInput();
|
|
147
|
+
const div = document.createElement("div");
|
|
148
|
+
div.textContent = "";
|
|
149
|
+
//@ts-ignore
|
|
150
|
+
component.liveRegionEl = div;
|
|
151
|
+
component.announce("Message");
|
|
152
|
+
expect(component.liveRegionMessage).toBe("Message");
|
|
153
|
+
});
|
|
154
|
+
it("announces existing options", async () => {
|
|
155
|
+
// announceExistingOptions
|
|
156
|
+
const component = new TagInput();
|
|
157
|
+
const element1 = {};
|
|
158
|
+
const element2 = {};
|
|
159
|
+
const mockAnnounce = (component.announce = jest.fn());
|
|
160
|
+
jest.spyOn(component, "optionEls", "get").mockReturnValue([element1, element2]);
|
|
161
|
+
const spyRequestAnimationFrame = jest
|
|
162
|
+
.spyOn(window, "requestAnimationFrame")
|
|
163
|
+
//@ts-ignore
|
|
164
|
+
.mockImplementation((cb) => cb());
|
|
165
|
+
component.announceExistingOptions();
|
|
166
|
+
expect(spyRequestAnimationFrame).toHaveBeenCalledTimes(1);
|
|
167
|
+
expect(mockAnnounce).toHaveBeenCalledTimes(1);
|
|
168
|
+
expect(mockAnnounce).toHaveBeenLastCalledWith("2 existing options.");
|
|
169
|
+
jest.clearAllMocks();
|
|
170
|
+
jest.spyOn(component, "optionEls", "get").mockReturnValue([element1]);
|
|
171
|
+
component.announceExistingOptions();
|
|
172
|
+
expect(spyRequestAnimationFrame).toHaveBeenCalledTimes(1);
|
|
173
|
+
expect(mockAnnounce).toHaveBeenCalledTimes(1);
|
|
174
|
+
expect(mockAnnounce).toHaveBeenLastCalledWith("1 existing option.");
|
|
175
|
+
jest.clearAllMocks();
|
|
176
|
+
jest.spyOn(component, "optionEls", "get").mockReturnValue([]);
|
|
177
|
+
component.announceExistingOptions();
|
|
178
|
+
expect(spyRequestAnimationFrame).toHaveBeenCalledTimes(1);
|
|
179
|
+
expect(mockAnnounce).toHaveBeenCalledTimes(1);
|
|
180
|
+
expect(mockAnnounce).toHaveBeenLastCalledWith("0 existing options.");
|
|
181
|
+
jest.restoreAllMocks();
|
|
182
|
+
});
|
|
183
|
+
it("announces character limits warnings", async () => {
|
|
184
|
+
const component = new TagInput();
|
|
185
|
+
let message = component.generateCharacterLimitWarning(0, 50);
|
|
186
|
+
expect(message).toBe("0 of 50 characters entered.");
|
|
187
|
+
message = component.generateCharacterLimitWarning(30, 50);
|
|
188
|
+
expect(message).toBe("30 of 50 characters entered.");
|
|
189
|
+
message = component.generateCharacterLimitWarning(50, 50);
|
|
190
|
+
expect(message).toBe("50 of 50 characters entered. No additional characters will be entered.");
|
|
191
|
+
message = component.generateCharacterLimitWarning(75, 50);
|
|
192
|
+
expect(message).toBe("75 of 50 characters entered. No additional characters will be entered.");
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
});
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
-webkit-mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M15,14C12.33,14 7,15.33 7,18V20H23V18C23,15.33 17.67,14 15,14M6,10V7H4V10H1V12H4V15H6V12H9V10M15,12A4,4 0 0,0 19,8A4,4 0 0,0 15,4A4,4 0 0,0 11,8A4,4 0 0,0 15,12Z'/%3E%3C/svg%3E%0A");
|
|
59
59
|
mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M15,14C12.33,14 7,15.33 7,18V20H23V18C23,15.33 17.67,14 15,14M6,10V7H4V10H1V12H4V15H6V12H9V10M15,12A4,4 0 0,0 19,8A4,4 0 0,0 15,4A4,4 0 0,0 11,8A4,4 0 0,0 15,12Z'/%3E%3C/svg%3E%0A");
|
|
60
60
|
}
|
|
61
|
-
.svg-icon.svg-add-
|
|
61
|
+
.svg-icon.svg-add-outline:before {
|
|
62
62
|
-webkit-mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M13,7H11V11H7V13H11V17H13V13H17V11H13V7Z'/%3E%3C/svg%3E%0A");
|
|
63
63
|
mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M13,7H11V11H7V13H11V17H13V13H17V11H13V7Z'/%3E%3C/svg%3E%0A");
|
|
64
64
|
}
|
|
@@ -74,10 +74,6 @@
|
|
|
74
74
|
-webkit-mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M19.8 22.6L17.15 20H6.5Q4.2 20 2.6 18.4T1 14.5Q1 12.58 2.19 11.08 3.38 9.57 5.25 9.15 5.33 8.95 5.4 8.76 5.5 8.57 5.55 8.35L1.4 4.2L2.8 2.8L21.2 21.2M6.5 18H15.15L7.1 9.95Q7.05 10.23 7.03 10.5 7 10.73 7 11H6.5Q5.05 11 4.03 12.03 3 13.05 3 14.5 3 15.95 4.03 17 5.05 18 6.5 18M11.13 14M21.6 18.75L20.15 17.35Q20.58 17 20.79 16.54 21 16.08 21 15.5 21 14.45 20.27 13.73 19.55 13 18.5 13H17V11Q17 8.93 15.54 7.46 14.08 6 12 6 11.33 6 10.7 6.16 10.07 6.33 9.5 6.68L8.05 5.23Q8.93 4.63 9.91 4.31 10.9 4 12 4 14.93 4 16.96 6.04 19 8.07 19 11 20.73 11.2 21.86 12.5 23 13.78 23 15.5 23 16.5 22.63 17.31 22.25 18.15 21.6 18.75M14.83 12.03Z'/%3E%3C/svg%3E%0A");
|
|
75
75
|
mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M19.8 22.6L17.15 20H6.5Q4.2 20 2.6 18.4T1 14.5Q1 12.58 2.19 11.08 3.38 9.57 5.25 9.15 5.33 8.95 5.4 8.76 5.5 8.57 5.55 8.35L1.4 4.2L2.8 2.8L21.2 21.2M6.5 18H15.15L7.1 9.95Q7.05 10.23 7.03 10.5 7 10.73 7 11H6.5Q5.05 11 4.03 12.03 3 13.05 3 14.5 3 15.95 4.03 17 5.05 18 6.5 18M11.13 14M21.6 18.75L20.15 17.35Q20.58 17 20.79 16.54 21 16.08 21 15.5 21 14.45 20.27 13.73 19.55 13 18.5 13H17V11Q17 8.93 15.54 7.46 14.08 6 12 6 11.33 6 10.7 6.16 10.07 6.33 9.5 6.68L8.05 5.23Q8.93 4.63 9.91 4.31 10.9 4 12 4 14.93 4 16.96 6.04 19 8.07 19 11 20.73 11.2 21.86 12.5 23 13.78 23 15.5 23 16.5 22.63 17.31 22.25 18.15 21.6 18.75M14.83 12.03Z'/%3E%3C/svg%3E%0A");
|
|
76
76
|
}
|
|
77
|
-
.svg-icon.svg-apps:before {
|
|
78
|
-
-webkit-mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M16,20H20V16H16M16,14H20V10H16M10,8H14V4H10M16,8H20V4H16M10,14H14V10H10M4,14H8V10H4M4,20H8V16H4M10,20H14V16H10M4,8H8V4H4V8Z'/%3E%3C/svg%3E%0A");
|
|
79
|
-
mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M16,20H20V16H16M16,14H20V10H16M10,8H14V4H10M16,8H20V4H16M10,14H14V10H10M4,14H8V10H4M4,20H8V16H4M10,20H14V16H10M4,8H8V4H4V8Z'/%3E%3C/svg%3E%0A");
|
|
80
|
-
}
|
|
81
77
|
.svg-icon.svg-attach:before {
|
|
82
78
|
-webkit-mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M16.5,6V17.5A4,4 0 0,1 12.5,21.5A4,4 0 0,1 8.5,17.5V5A2.5,2.5 0 0,1 11,2.5A2.5,2.5 0 0,1 13.5,5V15.5A1,1 0 0,1 12.5,16.5A1,1 0 0,1 11.5,15.5V6H10V15.5A2.5,2.5 0 0,0 12.5,18A2.5,2.5 0 0,0 15,15.5V5A4,4 0 0,0 11,1A4,4 0 0,0 7,5V17.5A5.5,5.5 0 0,0 12.5,23A5.5,5.5 0 0,0 18,17.5V6H16.5Z'/%3E%3C/svg%3E%0A");
|
|
83
79
|
mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M16.5,6V17.5A4,4 0 0,1 12.5,21.5A4,4 0 0,1 8.5,17.5V5A2.5,2.5 0 0,1 11,2.5A2.5,2.5 0 0,1 13.5,5V15.5A1,1 0 0,1 12.5,16.5A1,1 0 0,1 11.5,15.5V6H10V15.5A2.5,2.5 0 0,0 12.5,18A2.5,2.5 0 0,0 15,15.5V5A4,4 0 0,0 11,1A4,4 0 0,0 7,5V17.5A5.5,5.5 0 0,0 12.5,23A5.5,5.5 0 0,0 18,17.5V6H16.5Z'/%3E%3C/svg%3E%0A");
|
|
@@ -202,6 +198,10 @@
|
|
|
202
198
|
-webkit-mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2C6.47,2 2,6.47 2,12C2,17.53 6.47,22 12,22C17.53,22 22,17.53 22,12C22,6.47 17.53,2 12,2M14.59,8L12,10.59L9.41,8L8,9.41L10.59,12L8,14.59L9.41,16L12,13.41L14.59,16L16,14.59L13.41,12L16,9.41L14.59,8Z'/%3E%3C/svg%3E%0A");
|
|
203
199
|
mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2C6.47,2 2,6.47 2,12C2,17.53 6.47,22 12,22C17.53,22 22,17.53 22,12C22,6.47 17.53,2 12,2M14.59,8L12,10.59L9.41,8L8,9.41L10.59,12L8,14.59L9.41,16L12,13.41L14.59,16L16,14.59L13.41,12L16,9.41L14.59,8Z'/%3E%3C/svg%3E%0A");
|
|
204
200
|
}
|
|
201
|
+
.svg-icon.svg-reset:before {
|
|
202
|
+
-webkit-mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M12,5V1L7,6L12,11V7A6,6 0 0,1 18,13A6,6 0 0,1 12,19A6,6 0 0,1 6,13H4A8,8 0 0,0 12,21A8,8 0 0,0 20,13A8,8 0 0,0 12,5Z'/%3E%3C/svg%3E%0A");
|
|
203
|
+
mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M12,5V1L7,6L12,11V7A6,6 0 0,1 18,13A6,6 0 0,1 12,19A6,6 0 0,1 6,13H4A8,8 0 0,0 12,21A8,8 0 0,0 20,13A8,8 0 0,0 12,5Z'/%3E%3C/svg%3E%0A");
|
|
204
|
+
}
|
|
205
205
|
.svg-icon.svg-restore:before {
|
|
206
206
|
-webkit-mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M13.5,8H12V13L16.28,15.54L17,14.33L13.5,12.25V8M13,3A9,9 0 0,0 4,12H1L4.96,16.03L9,12H6A7,7 0 0,1 13,5A7,7 0 0,1 20,12A7,7 0 0,1 13,19C11.07,19 9.32,18.21 8.06,16.94L6.64,18.36C8.27,20 10.5,21 13,21A9,9 0 0,0 22,12A9,9 0 0,0 13,3'/%3E%3C/svg%3E%0A");
|
|
207
207
|
mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M13.5,8H12V13L16.28,15.54L17,14.33L13.5,12.25V8M13,3A9,9 0 0,0 4,12H1L4.96,16.03L9,12H6A7,7 0 0,1 13,5A7,7 0 0,1 20,12A7,7 0 0,1 13,19C11.07,19 9.32,18.21 8.06,16.94L6.64,18.36C8.27,20 10.5,21 13,21A9,9 0 0,0 22,12A9,9 0 0,0 13,3'/%3E%3C/svg%3E%0A");
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import AxePuppeteer from "@axe-core/puppeteer";
|
|
2
|
+
import { newE2EPage } from "@stencil/core/testing";
|
|
3
|
+
describe("wm-textarea", () => {
|
|
4
|
+
// ts throws erroneous warning about vars being unused...
|
|
5
|
+
// @ts-ignore
|
|
6
|
+
let page, el, textarea;
|
|
7
|
+
beforeEach(async () => {
|
|
8
|
+
page = await newE2EPage();
|
|
9
|
+
await page.setContent(`<html lang='en'><head><title>Page</title></head><body><main><h1>Title</h1>
|
|
10
|
+
<wm-textarea label='label' character-limit="20"></wm-textarea>
|
|
11
|
+
</main></body></html>`);
|
|
12
|
+
el = await page.find("wm-textarea");
|
|
13
|
+
textarea = await page.find("wm-textarea >>> textarea");
|
|
14
|
+
await page.waitForChanges();
|
|
15
|
+
});
|
|
16
|
+
it("passes Axe checks", async () => {
|
|
17
|
+
const results = await new AxePuppeteer(page).analyze();
|
|
18
|
+
expect(results.violations.length).toBe(0);
|
|
19
|
+
});
|
|
20
|
+
it("updates character count on text entry", async () => {
|
|
21
|
+
await page.keyboard.press("Tab");
|
|
22
|
+
await page.keyboard.type("1234");
|
|
23
|
+
await page.waitForChanges();
|
|
24
|
+
const characterCount = await page.find("wm-textarea >>> .character-count");
|
|
25
|
+
expect(characterCount.textContent).toBe("4/20");
|
|
26
|
+
});
|
|
27
|
+
it("emits event on value change", async () => {
|
|
28
|
+
const eventSpy = await el.spyOnEvent("wmTextareaValueChanged");
|
|
29
|
+
await el.focus();
|
|
30
|
+
await page.keyboard.type("1234");
|
|
31
|
+
await page.waitForChanges();
|
|
32
|
+
expect(eventSpy).toHaveReceivedEventTimes(0);
|
|
33
|
+
await page.keyboard.press("Tab");
|
|
34
|
+
expect(eventSpy).toHaveReceivedEventTimes(1);
|
|
35
|
+
await el.focus();
|
|
36
|
+
await page.keyboard.press("Tab");
|
|
37
|
+
await page.waitForChanges();
|
|
38
|
+
// expect event to still have fired only once, because value has not changed
|
|
39
|
+
expect(eventSpy).toHaveReceivedEventTimes(1);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -65,7 +65,7 @@ export class Textarea {
|
|
|
65
65
|
this.announcement = message;
|
|
66
66
|
}
|
|
67
67
|
render() {
|
|
68
|
-
return (h("div", {
|
|
68
|
+
return (h("div", { class: `wrapper label-${this.labelPosition} ${this.errorMessage ? "invalid" : ""}` }, h("div", { class: "label-wrapper" }, h("label", { htmlFor: "inputfield", class: "label" }, this.label, this.characterLimit && (h("span", { class: "sr-only" }, " ", globalMessages.getCharacterLimit(this.characterLimit))), this.requiredField && (h("span", { class: "required", "aria-hidden": "true" }, "*")))), h("div", { class: "inner-wrapper" }, h("div", { class: `inputfield-wrapper ${this.errorMessage ? "invalid" : ""}`, style: this.inputWidth ? { width: this.inputWidth } : {} }, h("textarea", { id: "inputfield", disabled: this.isDisabled, "aria-describedby": "info error", onInput: (ev) => this.handleInput(ev), onBlur: () => this.handleBlur(), placeholder: this.placeholder, autocomplete: "off", "aria-required": this.requiredField ? "true" : null, value: this.value, rows: 3, style: { height: this.inputHeight } }), this.characterLimit && typeof this.characterLimit === "number" ? (h("div", { class: `character-count ${this.value.length > this.characterLimit ? "exceeded" : ""}` }, this.charCount, "/", this.characterLimit)) : ("")), this.info && (h("div", { id: "info", class: "info" }, this.info)), h("div", { id: "error", class: "error-message" }, this.errorMessage), h("div", { id: "live-polite", class: "sr-only", "aria-live": "polite", "aria-atomic": "true", ref: (el) => (this.liveRegionEl = el) }, this.announcement))));
|
|
69
69
|
}
|
|
70
70
|
static get is() { return "wm-textarea"; }
|
|
71
71
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { newSpecPage } from "@stencil/core/testing";
|
|
2
|
+
import { Textarea } from "./wm-textarea";
|
|
3
|
+
// mock observers
|
|
4
|
+
// global.ResizeObserver = jest.fn().mockImplementation(() => ({
|
|
5
|
+
// observe: jest.fn(),
|
|
6
|
+
// unobserve: jest.fn(),
|
|
7
|
+
// disconnect: jest.fn(),
|
|
8
|
+
// }));
|
|
9
|
+
// global.MutationObserver = jest.fn().mockImplementation(() => ({
|
|
10
|
+
// observe: jest.fn(),
|
|
11
|
+
// unobserve: jest.fn(),
|
|
12
|
+
// disconnect: jest.fn(),
|
|
13
|
+
// }));
|
|
14
|
+
describe("textarea", () => {
|
|
15
|
+
let page;
|
|
16
|
+
let component;
|
|
17
|
+
beforeEach(async () => {
|
|
18
|
+
page = await newSpecPage({
|
|
19
|
+
components: [Textarea],
|
|
20
|
+
html: `<wm-textarea id="textarea" label="label"></wm-textarea>`,
|
|
21
|
+
});
|
|
22
|
+
component = page.root;
|
|
23
|
+
});
|
|
24
|
+
it("builds", async () => {
|
|
25
|
+
expect(page.root).toMatchSnapshot();
|
|
26
|
+
});
|
|
27
|
+
it("has right aria roles", async () => {
|
|
28
|
+
page = await newSpecPage({
|
|
29
|
+
components: [Textarea],
|
|
30
|
+
html: `<wm-textarea id="textarea" label="label" disabled required-field></wm-textarea>`,
|
|
31
|
+
});
|
|
32
|
+
const textarea = await page.root.shadowRoot.querySelector("textarea");
|
|
33
|
+
expect(textarea).toEqualAttribute("aria-describedby", "info error");
|
|
34
|
+
expect(textarea).toHaveAttribute("disabled");
|
|
35
|
+
const error = await page.root.shadowRoot.querySelector("#error");
|
|
36
|
+
expect(error).toEqualAttribute("aria-live", "assertive");
|
|
37
|
+
const livePolite = await page.root.shadowRoot.querySelector("#live-polite");
|
|
38
|
+
expect(livePolite).toEqualAttribute("aria-live", "polite");
|
|
39
|
+
});
|
|
40
|
+
it("sets initial value from textcontent", async () => {
|
|
41
|
+
page = await newSpecPage({
|
|
42
|
+
components: [Textarea],
|
|
43
|
+
html: `<wm-textarea id="textarea" label="label">Initial value</wm-textarea>`,
|
|
44
|
+
});
|
|
45
|
+
component = page.root;
|
|
46
|
+
expect(component.value).toBe("Initial value");
|
|
47
|
+
});
|
|
48
|
+
it("renders character limit", async () => {
|
|
49
|
+
page = await newSpecPage({
|
|
50
|
+
components: [Textarea],
|
|
51
|
+
html: `<wm-textarea id="textarea" label="label" character-limit="20">Hello</wm-textarea>`,
|
|
52
|
+
});
|
|
53
|
+
component = page.root;
|
|
54
|
+
const characterLimitArea = await page.root.shadowRoot.querySelector(".character-count");
|
|
55
|
+
expect(characterLimitArea.textContent).toBe("5/20");
|
|
56
|
+
});
|
|
57
|
+
it("properties override height and width", async () => {
|
|
58
|
+
page = await newSpecPage({
|
|
59
|
+
components: [Textarea],
|
|
60
|
+
html: `<wm-textarea id="textarea" label="label" input-width="200px" input-height="300px"></wm-textarea>`,
|
|
61
|
+
});
|
|
62
|
+
component = page.root;
|
|
63
|
+
const textarea = await component.shadowRoot.querySelector("textarea");
|
|
64
|
+
expect(textarea).toEqualAttribute("style", "height: 300px;");
|
|
65
|
+
const widthWrapper = await component.shadowRoot.querySelector(".inputfield-wrapper");
|
|
66
|
+
expect(widthWrapper).toEqualAttribute("style", "width: 200px;");
|
|
67
|
+
});
|
|
68
|
+
it("displays info and error-message properties", async () => {
|
|
69
|
+
page = await newSpecPage({
|
|
70
|
+
components: [Textarea],
|
|
71
|
+
html: `<wm-textarea id="textarea" label="label" info="example info text" error-message="example error text"></wm-textarea>`,
|
|
72
|
+
});
|
|
73
|
+
component = page.root;
|
|
74
|
+
const info = await component.shadowRoot.querySelector("#info");
|
|
75
|
+
expect(info.textContent).toBe("example info text");
|
|
76
|
+
const error = await component.shadowRoot.querySelector("#error");
|
|
77
|
+
expect(error.textContent).toBe("example error text");
|
|
78
|
+
});
|
|
79
|
+
});
|