@watermarkinsights/ripple 5.12.0 → 5.14.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/{esm/chartFunctions-9099c7e9.js → components/chartFunctions.js} +4 -4
- package/dist/components/functions.js +17465 -0
- package/dist/components/index.d.ts +33 -0
- package/dist/{collection/global/global.js → components/index.js} +52 -2
- package/dist/{collection/global → components}/interfaces.js +6 -4
- package/dist/{esm/intl-a6f16883.js → components/intl.js} +1 -1
- package/dist/components/priv-calendar.d.ts +11 -0
- package/dist/components/priv-calendar.js +6 -0
- package/dist/{esm/priv-calendar.entry.js → components/priv-calendar2.js} +40 -17
- package/dist/components/priv-chart-popover.d.ts +11 -0
- package/dist/components/priv-chart-popover.js +6 -0
- package/dist/{esm/priv-chart-popover.entry.js → components/priv-chart-popover2.js} +32 -13
- package/dist/components/priv-navigator-button.d.ts +11 -0
- package/dist/components/priv-navigator-button.js +6 -0
- package/dist/{esm/priv-navigator-button.entry.js → components/priv-navigator-button2.js} +27 -9
- package/dist/components/priv-navigator-item.d.ts +11 -0
- package/dist/components/priv-navigator-item.js +6 -0
- package/dist/{esm/priv-navigator-item.entry.js → components/priv-navigator-item2.js} +28 -9
- package/dist/components/priv-option-list.d.ts +11 -0
- package/dist/components/priv-option-list.js +6 -0
- package/dist/{esm/priv-option-list.entry.js → components/priv-option-list2.js} +54 -21
- package/dist/components/wm-action-menu.d.ts +11 -0
- package/dist/components/wm-action-menu.js +6 -0
- package/dist/{cjs/wm-pagination.cjs.entry.js → components/wm-action-menu2.js} +216 -212
- package/dist/components/wm-button.d.ts +11 -0
- package/dist/components/wm-button.js +6 -0
- package/dist/{esm/wm-button.entry.js → components/wm-button2.js} +49 -20
- package/dist/components/wm-chart-slice.d.ts +11 -0
- package/dist/components/wm-chart-slice.js +41 -0
- package/dist/components/wm-chart.d.ts +11 -0
- package/dist/{esm/wm-chart.entry.js → components/wm-chart.js} +61 -22
- package/dist/components/wm-date-range.d.ts +11 -0
- package/dist/{esm/wm-date-range.entry.js → components/wm-date-range.js} +66 -23
- package/dist/components/wm-datepicker.d.ts +11 -0
- package/dist/{esm/wm-datepicker.entry.js → components/wm-datepicker.js} +58 -20
- package/dist/components/wm-file-list.d.ts +11 -0
- package/dist/{cjs/wm-file-list.cjs.entry.js → components/wm-file-list.js} +29 -13
- package/dist/components/wm-file.d.ts +11 -0
- package/dist/{esm/wm-file.entry.js → components/wm-file.js} +59 -20
- package/dist/components/wm-input.d.ts +11 -0
- package/dist/{esm/wm-input.entry.js → components/wm-input.js} +54 -22
- package/dist/components/wm-line-chart.d.ts +11 -0
- package/dist/{esm/wm-line-chart.entry.js → components/wm-line-chart.js} +80 -39
- package/dist/components/wm-menuitem.d.ts +11 -0
- package/dist/components/wm-menuitem.js +6 -0
- package/dist/{cjs/wm-optgroup.cjs.entry.js → components/wm-menuitem2.js} +130 -57
- package/dist/components/wm-modal-footer.d.ts +11 -0
- package/dist/components/wm-modal-footer.js +73 -0
- package/dist/components/wm-modal-header.d.ts +11 -0
- package/dist/components/wm-modal-header.js +61 -0
- package/dist/components/wm-modal-pss-footer.d.ts +11 -0
- package/dist/{cjs/priv-chart-popover.cjs.entry.js → components/wm-modal-pss-footer.js} +58 -128
- package/dist/components/wm-modal-pss-header.d.ts +11 -0
- package/dist/components/wm-modal-pss-header.js +64 -0
- package/dist/components/wm-modal-pss.d.ts +11 -0
- package/dist/{cjs/wm-textarea.cjs.entry.js → components/wm-modal-pss.js} +141 -66
- package/dist/components/wm-modal.d.ts +11 -0
- package/dist/{cjs/wm-input.cjs.entry.js → components/wm-modal.js} +140 -103
- package/dist/components/wm-navigation-hamburger.d.ts +11 -0
- package/dist/{ripple/p-f9cade98.entry.js → components/wm-navigation-hamburger.js} +70 -1
- package/dist/components/wm-navigation-item.d.ts +11 -0
- package/dist/components/wm-navigation-item.js +40 -0
- package/dist/components/wm-navigation.d.ts +11 -0
- package/dist/{ripple/p-1a71d867.system.entry.js → components/wm-navigation.js} +144 -1
- package/dist/components/wm-navigator.d.ts +11 -0
- package/dist/{esm/wm-navigator.entry.js → components/wm-navigator.js} +106 -18
- package/dist/components/wm-nested-select.d.ts +11 -0
- package/dist/{esm/wm-nested-select.entry.js → components/wm-nested-select.js} +56 -23
- package/dist/components/wm-optgroup.d.ts +11 -0
- package/dist/{esm/wm-optgroup.entry.js → components/wm-optgroup.js} +49 -11
- package/dist/components/wm-option.d.ts +11 -0
- package/dist/components/wm-option.js +6 -0
- package/dist/{cjs/wm-search.cjs.entry.js → components/wm-option2.js} +168 -165
- package/dist/components/wm-pagination.d.ts +11 -0
- package/dist/{esm/wm-pagination.entry.js → components/wm-pagination.js} +45 -17
- package/dist/components/wm-progress-indicator.d.ts +11 -0
- package/dist/{esm/wm-progress-indicator_3.entry.js → components/wm-progress-indicator.js} +52 -104
- package/dist/components/wm-progress-monitor.d.ts +11 -0
- package/dist/components/wm-progress-monitor.js +93 -0
- package/dist/components/wm-progress-slice.d.ts +11 -0
- package/dist/components/wm-progress-slice.js +37 -0
- package/dist/components/wm-search.d.ts +11 -0
- package/dist/{esm/wm-search.entry.js → components/wm-search.js} +76 -15
- package/dist/components/wm-select.d.ts +11 -0
- package/dist/components/wm-select.js +6 -0
- package/dist/components/wm-select2.js +294 -0
- package/dist/components/wm-snackbar.d.ts +11 -0
- package/dist/{esm/wm-snackbar.entry.js → components/wm-snackbar.js} +41 -16
- package/dist/components/wm-tab-item.d.ts +11 -0
- package/dist/components/wm-tab-item.js +85 -0
- package/dist/components/wm-tab-list.d.ts +11 -0
- package/dist/{cjs/wm-uploader.cjs.entry.js → components/wm-tab-list.js} +174 -281
- package/dist/components/wm-tab-panel.d.ts +11 -0
- package/dist/{esm/wm-file-list.entry.js → components/wm-tab-panel.js} +46 -12
- package/dist/components/wm-tag-input.d.ts +11 -0
- package/dist/{esm/wm-tag-input.entry.js → components/wm-tag-input.js} +64 -32
- package/dist/components/wm-tag-option.d.ts +11 -0
- package/dist/components/wm-tag-option.js +63 -0
- package/dist/components/wm-textarea.d.ts +11 -0
- package/dist/{esm/wm-textarea.entry.js → components/wm-textarea.js} +47 -17
- package/dist/components/wm-timepicker.d.ts +11 -0
- package/dist/{esm/wm-timepicker.entry.js → components/wm-timepicker.js} +51 -20
- package/dist/components/wm-toggletip.d.ts +11 -0
- package/dist/{esm/wm-toggletip.entry.js → components/wm-toggletip.js} +38 -16
- package/dist/components/wm-uploader.d.ts +11 -0
- package/dist/{esm/wm-uploader.entry.js → components/wm-uploader.js} +52 -24
- package/dist/components/wm-wrapper.d.ts +11 -0
- package/dist/components/wm-wrapper.js +34 -0
- package/dist/types/stencil-public-runtime.d.ts +31 -10
- package/package.json +4 -8
- package/dist/cjs/chartFunctions-a1981e06.js +0 -732
- package/dist/cjs/functions-4b187487.js +0 -9679
- package/dist/cjs/global-4e034486.js +0 -85
- package/dist/cjs/index-e86c28b6.js +0 -2649
- package/dist/cjs/index.cjs.js +0 -2
- package/dist/cjs/interfaces-85d78ae9.js +0 -37
- package/dist/cjs/intl-7fd0760e.js +0 -283
- package/dist/cjs/loader.cjs.js +0 -14
- package/dist/cjs/priv-calendar.cjs.entry.js +0 -573
- package/dist/cjs/priv-navigator-button.cjs.entry.js +0 -28
- package/dist/cjs/priv-navigator-item.cjs.entry.js +0 -34
- package/dist/cjs/priv-option-list.cjs.entry.js +0 -392
- package/dist/cjs/ripple.cjs.js +0 -24
- package/dist/cjs/wm-action-menu_2.cjs.entry.js +0 -333
- package/dist/cjs/wm-button.cjs.entry.js +0 -206
- package/dist/cjs/wm-chart-slice.cjs.entry.js +0 -27
- package/dist/cjs/wm-chart.cjs.entry.js +0 -162
- package/dist/cjs/wm-date-range.cjs.entry.js +0 -483
- package/dist/cjs/wm-datepicker.cjs.entry.js +0 -253
- package/dist/cjs/wm-file.cjs.entry.js +0 -193
- package/dist/cjs/wm-line-chart.cjs.entry.js +0 -460
- package/dist/cjs/wm-modal-pss_3.cjs.entry.js +0 -214
- package/dist/cjs/wm-modal_3.cjs.entry.js +0 -212
- package/dist/cjs/wm-navigation_3.cjs.entry.js +0 -185
- package/dist/cjs/wm-navigator.cjs.entry.js +0 -326
- package/dist/cjs/wm-nested-select.cjs.entry.js +0 -314
- package/dist/cjs/wm-option_2.cjs.entry.js +0 -425
- package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +0 -202
- package/dist/cjs/wm-snackbar.cjs.entry.js +0 -181
- package/dist/cjs/wm-tab-item_3.cjs.entry.js +0 -260
- package/dist/cjs/wm-tag-input.cjs.entry.js +0 -891
- package/dist/cjs/wm-tag-option.cjs.entry.js +0 -43
- package/dist/cjs/wm-timepicker.cjs.entry.js +0 -306
- package/dist/cjs/wm-toggletip.cjs.entry.js +0 -182
- package/dist/cjs/wm-wrapper.cjs.entry.js +0 -21
- package/dist/collection/collection-manifest.json +0 -191
- package/dist/collection/components/charts/chartFunctions.js +0 -665
- package/dist/collection/components/charts/chartFunctions.spec.js +0 -16
- package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.css +0 -908
- package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.e2e.js +0 -81
- package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.js +0 -257
- package/dist/collection/components/charts/screenshots.e2e.js +0 -96
- package/dist/collection/components/charts/wm-chart/wm-chart-slice.js +0 -125
- package/dist/collection/components/charts/wm-chart/wm-chart.css +0 -1274
- package/dist/collection/components/charts/wm-chart/wm-chart.e2e.js +0 -213
- package/dist/collection/components/charts/wm-chart/wm-chart.js +0 -422
- package/dist/collection/components/charts/wm-chart/wm-chart.spec.js +0 -37
- package/dist/collection/components/charts/wm-line-chart/wm-line-chart.css +0 -1067
- package/dist/collection/components/charts/wm-line-chart/wm-line-chart.e2e.js +0 -176
- package/dist/collection/components/charts/wm-line-chart/wm-line-chart.js +0 -723
- package/dist/collection/components/charts/wm-line-chart/wm-line-chart.spec.js +0 -163
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.css +0 -1274
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.js +0 -264
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.css +0 -909
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.e2e.js +0 -69
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.js +0 -151
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.spec.js +0 -79
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-slice.js +0 -121
- package/dist/collection/components/datepickers/datepicker.css +0 -1043
- package/dist/collection/components/datepickers/priv-calendar/priv-calendar.css +0 -1279
- package/dist/collection/components/datepickers/priv-calendar/priv-calendar.js +0 -840
- package/dist/collection/components/datepickers/priv-calendar/priv-calendar.spec.js +0 -89
- package/dist/collection/components/datepickers/wm-date-range.e2e.js +0 -443
- package/dist/collection/components/datepickers/wm-date-range.js +0 -845
- package/dist/collection/components/datepickers/wm-date-range.spec.js +0 -22
- package/dist/collection/components/datepickers/wm-datepicker.e2e.js +0 -382
- package/dist/collection/components/datepickers/wm-datepicker.js +0 -520
- package/dist/collection/components/datepickers/wm-datepicker.spec.js +0 -21
- package/dist/collection/components/selects/priv-option-list/priv-option-list.css +0 -918
- package/dist/collection/components/selects/priv-option-list/priv-option-list.js +0 -778
- package/dist/collection/components/selects/wm-nested-select/wm-nested-select.css +0 -1181
- package/dist/collection/components/selects/wm-nested-select/wm-nested-select.js +0 -620
- package/dist/collection/components/selects/wm-optgroup/wm-optgroup.css +0 -830
- package/dist/collection/components/selects/wm-optgroup/wm-optgroup.js +0 -258
- package/dist/collection/components/selects/wm-option/wm-option.css +0 -931
- package/dist/collection/components/selects/wm-option/wm-option.e2e.js +0 -22
- package/dist/collection/components/selects/wm-option/wm-option.js +0 -530
- package/dist/collection/components/selects/wm-option/wm-option.spec.js +0 -63
- package/dist/collection/components/selects/wm-select/wm-select.css +0 -1104
- package/dist/collection/components/selects/wm-select/wm-select.e2e.js +0 -521
- package/dist/collection/components/selects/wm-select/wm-select.js +0 -584
- package/dist/collection/components/selects/wm-select/wm-select.spec.js +0 -271
- package/dist/collection/components/wm-action-menu/wm-action-menu.css +0 -891
- package/dist/collection/components/wm-action-menu/wm-action-menu.e2e.js +0 -200
- package/dist/collection/components/wm-action-menu/wm-action-menu.js +0 -435
- package/dist/collection/components/wm-action-menu/wm-action-menu.spec.js +0 -48
- package/dist/collection/components/wm-button/wm-button.css +0 -1261
- package/dist/collection/components/wm-button/wm-button.e2e.js +0 -55
- package/dist/collection/components/wm-button/wm-button.js +0 -489
- package/dist/collection/components/wm-button/wm-button.spec.js +0 -74
- package/dist/collection/components/wm-file/wm-file.css +0 -927
- package/dist/collection/components/wm-file/wm-file.js +0 -412
- package/dist/collection/components/wm-file/wm-file.spec.js +0 -194
- package/dist/collection/components/wm-file-list/wm-file-list.css +0 -820
- package/dist/collection/components/wm-file-list/wm-file-list.js +0 -45
- package/dist/collection/components/wm-file-list/wm-file-list.spec.js +0 -69
- package/dist/collection/components/wm-input/wm-input.css +0 -992
- package/dist/collection/components/wm-input/wm-input.e2e.js +0 -32
- package/dist/collection/components/wm-input/wm-input.js +0 -471
- package/dist/collection/components/wm-input/wm-input.spec.js +0 -173
- package/dist/collection/components/wm-menuitem/wm-menuitem.css +0 -891
- package/dist/collection/components/wm-menuitem/wm-menuitem.e2e.js +0 -23
- package/dist/collection/components/wm-menuitem/wm-menuitem.js +0 -419
- package/dist/collection/components/wm-menuitem/wm-menuitem.spec.js +0 -54
- package/dist/collection/components/wm-modal/wm-modal-footer.css +0 -845
- package/dist/collection/components/wm-modal/wm-modal-footer.js +0 -141
- package/dist/collection/components/wm-modal/wm-modal-footer.spec.js +0 -11
- package/dist/collection/components/wm-modal/wm-modal-header.css +0 -844
- package/dist/collection/components/wm-modal/wm-modal-header.js +0 -78
- package/dist/collection/components/wm-modal/wm-modal-header.spec.js +0 -8
- package/dist/collection/components/wm-modal/wm-modal.css +0 -891
- package/dist/collection/components/wm-modal/wm-modal.e2e.js +0 -104
- package/dist/collection/components/wm-modal/wm-modal.js +0 -350
- package/dist/collection/components/wm-modal/wm-modal.spec.js +0 -30
- package/dist/collection/components/wm-modal-pss/wm-modal-pss-footer.css +0 -852
- package/dist/collection/components/wm-modal-pss/wm-modal-pss-footer.js +0 -138
- package/dist/collection/components/wm-modal-pss/wm-modal-pss-header.css +0 -846
- package/dist/collection/components/wm-modal-pss/wm-modal-pss-header.js +0 -82
- package/dist/collection/components/wm-modal-pss/wm-modal-pss.css +0 -927
- package/dist/collection/components/wm-modal-pss/wm-modal-pss.js +0 -362
- package/dist/collection/components/wm-navigation/wm-navigation-hamburger.css +0 -847
- package/dist/collection/components/wm-navigation/wm-navigation-hamburger.js +0 -119
- package/dist/collection/components/wm-navigation/wm-navigation-item.css +0 -856
- package/dist/collection/components/wm-navigation/wm-navigation-item.js +0 -98
- package/dist/collection/components/wm-navigation/wm-navigation.css +0 -898
- package/dist/collection/components/wm-navigation/wm-navigation.e2e.js +0 -102
- package/dist/collection/components/wm-navigation/wm-navigation.js +0 -190
- package/dist/collection/components/wm-navigation/wm-navigation.spec.js +0 -91
- package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.css +0 -849
- package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.e2e.js +0 -50
- package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.js +0 -86
- package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.css +0 -830
- package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.js +0 -124
- package/dist/collection/components/wm-navigator/wm-navigator.css +0 -903
- package/dist/collection/components/wm-navigator/wm-navigator.e2e.js +0 -209
- package/dist/collection/components/wm-navigator/wm-navigator.js +0 -496
- package/dist/collection/components/wm-navigator/wm-navigator.spec.js +0 -177
- package/dist/collection/components/wm-pagination/wm-pagination.css +0 -971
- package/dist/collection/components/wm-pagination/wm-pagination.e2e.js +0 -312
- package/dist/collection/components/wm-pagination/wm-pagination.js +0 -363
- package/dist/collection/components/wm-search/wm-search.css +0 -895
- package/dist/collection/components/wm-search/wm-search.e2e.js +0 -76
- package/dist/collection/components/wm-search/wm-search.js +0 -426
- package/dist/collection/components/wm-search/wm-search.spec.js +0 -71
- package/dist/collection/components/wm-snackbar/wm-snackbar.css +0 -1077
- package/dist/collection/components/wm-snackbar/wm-snackbar.e2e.js +0 -112
- package/dist/collection/components/wm-snackbar/wm-snackbar.js +0 -269
- package/dist/collection/components/wm-snackbar/wm-snackbar.spec.js +0 -9
- package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.css +0 -868
- package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.js +0 -175
- package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.css +0 -840
- package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.js +0 -273
- package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.css +0 -825
- package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.js +0 -87
- package/dist/collection/components/wm-tabs/wm-tabs.e2e.js +0 -91
- package/dist/collection/components/wm-tabs/wm-tabs.spec.js +0 -12
- package/dist/collection/components/wm-tag-input/wm-tag-input.css +0 -1275
- package/dist/collection/components/wm-tag-input/wm-tag-input.e2e.js +0 -204
- package/dist/collection/components/wm-tag-input/wm-tag-input.js +0 -1227
- package/dist/collection/components/wm-tag-input/wm-tag-input.spec.js +0 -195
- package/dist/collection/components/wm-tag-input/wm-tag-option/wm-tag-option.js +0 -243
- package/dist/collection/components/wm-textarea/wm-textarea.css +0 -979
- package/dist/collection/components/wm-textarea/wm-textarea.e2e.js +0 -41
- package/dist/collection/components/wm-textarea/wm-textarea.js +0 -313
- package/dist/collection/components/wm-textarea/wm-textarea.spec.js +0 -79
- package/dist/collection/components/wm-timepicker/wm-timepicker.css +0 -1093
- package/dist/collection/components/wm-timepicker/wm-timepicker.e2e.js +0 -163
- package/dist/collection/components/wm-timepicker/wm-timepicker.js +0 -544
- package/dist/collection/components/wm-timepicker/wm-timepicker.spec.js +0 -147
- package/dist/collection/components/wm-toggletip/wm-toggletip.css +0 -1152
- package/dist/collection/components/wm-toggletip/wm-toggletip.e2e.js +0 -69
- package/dist/collection/components/wm-toggletip/wm-toggletip.js +0 -289
- package/dist/collection/components/wm-toggletip/wm-toggletip.spec.js +0 -21
- package/dist/collection/components/wm-uploader/wm-uploader.css +0 -1563
- package/dist/collection/components/wm-uploader/wm-uploader.e2e.js +0 -70
- package/dist/collection/components/wm-uploader/wm-uploader.js +0 -603
- package/dist/collection/components/wm-uploader/wm-uploader.spec.js +0 -234
- package/dist/collection/components/wm-wrapper/wm-wrapper.js +0 -28
- package/dist/collection/dev/button.js +0 -0
- package/dist/collection/dev/chart-small.js +0 -56
- package/dist/collection/dev/chart.js +0 -18
- package/dist/collection/dev/date-range.js +0 -6
- package/dist/collection/dev/datepicker.js +0 -46
- package/dist/collection/dev/file-list.js +0 -16
- package/dist/collection/dev/file.js +0 -0
- package/dist/collection/dev/input.js +0 -6
- package/dist/collection/dev/line-chart.js +0 -0
- package/dist/collection/dev/modal.js +0 -48
- package/dist/collection/dev/navigation.js +0 -13
- package/dist/collection/dev/navigator.js +0 -34
- package/dist/collection/dev/nested-select.js +0 -36
- package/dist/collection/dev/pagination.js +0 -7
- package/dist/collection/dev/progress-monitor.js +0 -0
- package/dist/collection/dev/pss-modal.js +0 -8
- package/dist/collection/dev/scripts.js +0 -49
- package/dist/collection/dev/search.js +0 -72
- package/dist/collection/dev/select.js +0 -57
- package/dist/collection/dev/snackbar.js +0 -54
- package/dist/collection/dev/tabs.js +0 -44
- package/dist/collection/dev/tag-input.js +0 -32
- package/dist/collection/dev/textarea.js +0 -28
- package/dist/collection/dev/timepicker.js +0 -32
- package/dist/collection/dev/toggletip.js +0 -9
- package/dist/collection/dev/uploader.js +0 -139
- package/dist/collection/global/__mocks__/functions.js +0 -6
- package/dist/collection/global/functions.js +0 -825
- package/dist/collection/global/functions.spec.js +0 -126
- package/dist/collection/global/intl.js +0 -274
- package/dist/collection/global/services/__mocks__/http-service.js +0 -130
- package/dist/collection/global/services/http-service.js +0 -50
- package/dist/collection/lang/lang.js +0 -5
- package/dist/collection/lang/lang.spec.js +0 -20
- package/dist/collection/lang/missing.js +0 -43
- package/dist/collection/lang/piglatin.js +0 -101
- package/dist/esm/functions-00e1916b.js +0 -9639
- package/dist/esm/global-c76064cb.js +0 -83
- package/dist/esm/index-558b5a82.js +0 -2618
- package/dist/esm/index.js +0 -1
- package/dist/esm/interfaces-cc5b177f.js +0 -34
- package/dist/esm/loader.js +0 -10
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/esm/ripple.js +0 -19
- package/dist/esm/wm-action-menu_2.entry.js +0 -328
- package/dist/esm/wm-chart-slice.entry.js +0 -23
- package/dist/esm/wm-modal-pss_3.entry.js +0 -208
- package/dist/esm/wm-modal_3.entry.js +0 -206
- package/dist/esm/wm-navigation_3.entry.js +0 -179
- package/dist/esm/wm-option_2.entry.js +0 -420
- package/dist/esm/wm-tab-item_3.entry.js +0 -254
- package/dist/esm/wm-tag-option.entry.js +0 -39
- package/dist/esm/wm-wrapper.entry.js +0 -17
- package/dist/esm-es5/chartFunctions-9099c7e9.js +0 -1
- package/dist/esm-es5/functions-00e1916b.js +0 -1
- package/dist/esm-es5/global-c76064cb.js +0 -1
- package/dist/esm-es5/index-558b5a82.js +0 -1
- package/dist/esm-es5/index.js +0 -0
- package/dist/esm-es5/interfaces-cc5b177f.js +0 -1
- package/dist/esm-es5/intl-a6f16883.js +0 -1
- package/dist/esm-es5/loader.js +0 -1
- package/dist/esm-es5/priv-calendar.entry.js +0 -1
- package/dist/esm-es5/priv-chart-popover.entry.js +0 -1
- package/dist/esm-es5/priv-navigator-button.entry.js +0 -1
- package/dist/esm-es5/priv-navigator-item.entry.js +0 -1
- package/dist/esm-es5/priv-option-list.entry.js +0 -1
- package/dist/esm-es5/ripple.js +0 -1
- package/dist/esm-es5/wm-action-menu_2.entry.js +0 -1
- package/dist/esm-es5/wm-button.entry.js +0 -1
- package/dist/esm-es5/wm-chart-slice.entry.js +0 -1
- package/dist/esm-es5/wm-chart.entry.js +0 -1
- package/dist/esm-es5/wm-date-range.entry.js +0 -1
- package/dist/esm-es5/wm-datepicker.entry.js +0 -1
- package/dist/esm-es5/wm-file-list.entry.js +0 -1
- package/dist/esm-es5/wm-file.entry.js +0 -1
- package/dist/esm-es5/wm-input.entry.js +0 -1
- package/dist/esm-es5/wm-line-chart.entry.js +0 -1
- package/dist/esm-es5/wm-modal-pss_3.entry.js +0 -1
- package/dist/esm-es5/wm-modal_3.entry.js +0 -1
- package/dist/esm-es5/wm-navigation_3.entry.js +0 -1
- package/dist/esm-es5/wm-navigator.entry.js +0 -1
- package/dist/esm-es5/wm-nested-select.entry.js +0 -1
- package/dist/esm-es5/wm-optgroup.entry.js +0 -1
- package/dist/esm-es5/wm-option_2.entry.js +0 -1
- package/dist/esm-es5/wm-pagination.entry.js +0 -1
- package/dist/esm-es5/wm-progress-indicator_3.entry.js +0 -1
- package/dist/esm-es5/wm-search.entry.js +0 -1
- package/dist/esm-es5/wm-snackbar.entry.js +0 -1
- package/dist/esm-es5/wm-tab-item_3.entry.js +0 -1
- package/dist/esm-es5/wm-tag-input.entry.js +0 -1
- package/dist/esm-es5/wm-tag-option.entry.js +0 -1
- package/dist/esm-es5/wm-textarea.entry.js +0 -1
- package/dist/esm-es5/wm-timepicker.entry.js +0 -1
- package/dist/esm-es5/wm-toggletip.entry.js +0 -1
- package/dist/esm-es5/wm-uploader.entry.js +0 -1
- package/dist/esm-es5/wm-wrapper.entry.js +0 -1
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- package/dist/loader/cdn.js +0 -3
- package/dist/loader/index.cjs.js +0 -3
- package/dist/loader/index.d.ts +0 -21
- package/dist/loader/index.es2017.js +0 -3
- package/dist/loader/index.js +0 -4
- package/dist/loader/package.json +0 -11
- package/dist/ripple/index.esm.js +0 -0
- package/dist/ripple/p-05ae54d7.entry.js +0 -1
- package/dist/ripple/p-0d89d63c.system.entry.js +0 -1
- package/dist/ripple/p-118c47eb.system.entry.js +0 -1
- package/dist/ripple/p-1a4b6b02.system.entry.js +0 -1
- package/dist/ripple/p-1a4b7504.system.entry.js +0 -1
- package/dist/ripple/p-1a951dfb.entry.js +0 -1
- package/dist/ripple/p-1c8f550f.system.entry.js +0 -1
- package/dist/ripple/p-1f751b87.js +0 -1
- package/dist/ripple/p-1fac5bf9.js +0 -1
- package/dist/ripple/p-20a8f732.system.entry.js +0 -1
- package/dist/ripple/p-249b56fb.entry.js +0 -1
- package/dist/ripple/p-249d13a1.system.entry.js +0 -1
- package/dist/ripple/p-26906899.entry.js +0 -1
- package/dist/ripple/p-2732bddd.js +0 -1
- package/dist/ripple/p-28119645.system.entry.js +0 -1
- package/dist/ripple/p-2f37f3ee.system.js +0 -1
- package/dist/ripple/p-32bf3f5b.system.entry.js +0 -1
- package/dist/ripple/p-335c03d3.system.entry.js +0 -1
- package/dist/ripple/p-363b534b.entry.js +0 -1
- package/dist/ripple/p-393e4636.js +0 -1
- package/dist/ripple/p-39f79d71.system.entry.js +0 -1
- package/dist/ripple/p-3a231f4b.system.entry.js +0 -1
- package/dist/ripple/p-3d4bb85f.entry.js +0 -1
- package/dist/ripple/p-4228de00.entry.js +0 -1
- package/dist/ripple/p-42fa7a77.system.js +0 -1
- package/dist/ripple/p-48e09589.entry.js +0 -1
- package/dist/ripple/p-4f8fe1d1.system.js +0 -1
- package/dist/ripple/p-50ea2036.system.js +0 -1
- package/dist/ripple/p-522ecb7d.system.entry.js +0 -1
- package/dist/ripple/p-54d6f0f9.entry.js +0 -1
- package/dist/ripple/p-568c595f.js +0 -2
- package/dist/ripple/p-56aeee6e.system.entry.js +0 -1
- package/dist/ripple/p-5e6a4f70.system.js +0 -1
- package/dist/ripple/p-5f082360.system.entry.js +0 -1
- package/dist/ripple/p-5f5fe905.js +0 -1
- package/dist/ripple/p-617c2c75.entry.js +0 -1
- package/dist/ripple/p-6524c53e.system.entry.js +0 -1
- package/dist/ripple/p-65d26233.system.entry.js +0 -1
- package/dist/ripple/p-6834a6d3.entry.js +0 -1
- package/dist/ripple/p-68e04222.entry.js +0 -1
- package/dist/ripple/p-68fddfaa.system.entry.js +0 -1
- package/dist/ripple/p-694903e6.system.entry.js +0 -1
- package/dist/ripple/p-73ca2f26.system.js +0 -1
- package/dist/ripple/p-7b6a65f8.system.entry.js +0 -1
- package/dist/ripple/p-7b7e1eb5.system.entry.js +0 -1
- package/dist/ripple/p-88ebddd7.entry.js +0 -1
- package/dist/ripple/p-8c1d27a7.entry.js +0 -1
- package/dist/ripple/p-8e9c24f3.entry.js +0 -1
- package/dist/ripple/p-8f836507.system.entry.js +0 -1
- package/dist/ripple/p-94495341.entry.js +0 -1
- package/dist/ripple/p-958331bf.entry.js +0 -1
- package/dist/ripple/p-9872623b.entry.js +0 -1
- package/dist/ripple/p-9ab3c088.system.entry.js +0 -1
- package/dist/ripple/p-9aedd599.entry.js +0 -1
- package/dist/ripple/p-9b848151.entry.js +0 -1
- package/dist/ripple/p-a04ef164.system.entry.js +0 -1
- package/dist/ripple/p-a78bb423.system.entry.js +0 -1
- package/dist/ripple/p-a880d9a0.system.entry.js +0 -1
- package/dist/ripple/p-ab8d78cc.system.js +0 -2
- package/dist/ripple/p-adc254e6.entry.js +0 -1
- package/dist/ripple/p-b165d61a.entry.js +0 -1
- package/dist/ripple/p-b39377c7.entry.js +0 -1
- package/dist/ripple/p-b9bca547.entry.js +0 -1
- package/dist/ripple/p-bae2c236.entry.js +0 -1
- package/dist/ripple/p-c53f3704.system.entry.js +0 -1
- package/dist/ripple/p-c56ff16f.entry.js +0 -1
- package/dist/ripple/p-c8cf09a2.system.entry.js +0 -1
- package/dist/ripple/p-cbdceb6e.entry.js +0 -1
- package/dist/ripple/p-cc813406.system.js +0 -1
- package/dist/ripple/p-d20a0f0c.system.entry.js +0 -1
- package/dist/ripple/p-d6111226.entry.js +0 -1
- package/dist/ripple/p-da68c87c.entry.js +0 -1
- package/dist/ripple/p-ddef82fa.system.entry.js +0 -1
- package/dist/ripple/p-dee6d5a3.entry.js +0 -1
- package/dist/ripple/p-e55d5371.entry.js +0 -1
- package/dist/ripple/p-e8c22f01.system.entry.js +0 -1
- package/dist/ripple/p-f555831b.entry.js +0 -1
- package/dist/ripple/p-f5c40e9e.system.entry.js +0 -1
- package/dist/ripple/p-fa09191b.system.entry.js +0 -1
- package/dist/ripple/p-fdfca58b.entry.js +0 -1
- package/dist/ripple/ripple.css +0 -1
- package/dist/ripple/ripple.esm.js +0 -1
- package/dist/ripple/ripple.js +0 -127
- /package/dist/{collection/dev/action-menu.js → types/test-setup.d.ts} +0 -0
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
import { newE2EPage } from "@stencil/core/testing";
|
|
2
|
-
import { AxePuppeteer } from "@axe-core/puppeteer";
|
|
3
|
-
describe("wm-chart", () => {
|
|
4
|
-
let page,
|
|
5
|
-
// @ts-ignore for some reason ts says it's unused
|
|
6
|
-
component,
|
|
7
|
-
// slices: NodeList,
|
|
8
|
-
paths, svg;
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
page = await newE2EPage();
|
|
11
|
-
await page.setContent(`<html lang='en'><head><title>Page</title></head><body><main><h1>Title</h1>
|
|
12
|
-
<wm-chart label="the label"><wm-chart-slice amount="70" legend="Created"></wm-chart-slice><wm-chart-slice amount="2" legend="Not Created"></wm-chart-slice></wm-chart>
|
|
13
|
-
</main></body></html>`);
|
|
14
|
-
component = await page.find("wm-chart");
|
|
15
|
-
svg = await page.find("wm-chart >>> svg");
|
|
16
|
-
// slices = await page.findAll("wm-chart-slice");
|
|
17
|
-
paths = await page.findAll("wm-chart >>> path");
|
|
18
|
-
});
|
|
19
|
-
it("passes Axe tests", async () => {
|
|
20
|
-
const results = await new AxePuppeteer(page).analyze();
|
|
21
|
-
expect(results.violations.length).toBe(0);
|
|
22
|
-
});
|
|
23
|
-
it("renders", async () => {
|
|
24
|
-
expect(svg).toBeTruthy();
|
|
25
|
-
});
|
|
26
|
-
it("renders the right amount of slices and text", async () => {
|
|
27
|
-
let tmpPage = await newE2EPage();
|
|
28
|
-
await tmpPage.setContent(`<wm-chart label="the label">
|
|
29
|
-
<wm-chart-slice amount="100" legend="Created"></wm-chart-slice>
|
|
30
|
-
<wm-chart-slice amount="123" legend="Created"></wm-chart-slice>
|
|
31
|
-
<wm-chart-slice amount="0" legend="Maybe Created"></wm-chart-slice>
|
|
32
|
-
</wm-chart>`);
|
|
33
|
-
let tmpSlices = await tmpPage.findAll("wm-chart-slice");
|
|
34
|
-
let tmpPaths = await tmpPage.findAll("wm-chart >>> path");
|
|
35
|
-
let tmpTexts = await tmpPage.findAll("wm-chart >>> text.value");
|
|
36
|
-
expect(tmpSlices.length).toEqual(3);
|
|
37
|
-
// slices rendered even if amount === 0 for accessibility reasons
|
|
38
|
-
expect(tmpPaths.length).toEqual(tmpSlices.length);
|
|
39
|
-
expect(tmpTexts.length).toEqual(tmpSlices.length - 1);
|
|
40
|
-
});
|
|
41
|
-
it("hides clustered small numbers", async () => {
|
|
42
|
-
// rule: num < 4 && either neighbor < 5
|
|
43
|
-
let page = await newE2EPage();
|
|
44
|
-
await page.setContent(`<wm-chart id="one" label="the label" chart-type="doughnut3">
|
|
45
|
-
<wm-chart-slice amount="75" legend="A"></wm-chart-slice> // 89%
|
|
46
|
-
<wm-chart-slice amount="5" legend="B"></wm-chart-slice> // 6%
|
|
47
|
-
<wm-chart-slice amount="4" legend="C"></wm-chart-slice> // 5%
|
|
48
|
-
</wm-chart>
|
|
49
|
-
<wm-chart id="two" label="the label" chart-type="doughnut3">
|
|
50
|
-
<wm-chart-slice amount="65" legend="A"></wm-chart-slice> // 69%
|
|
51
|
-
<wm-chart-slice amount="14" legend="B"></wm-chart-slice> // 15%
|
|
52
|
-
<wm-chart-slice amount="4" legend="C"></wm-chart-slice> // 4%
|
|
53
|
-
<wm-chart-slice amount="4" legend="D"></wm-chart-slice> // 4%
|
|
54
|
-
<wm-chart-slice amount="4" legend="E"></wm-chart-slice> // 4%
|
|
55
|
-
<wm-chart-slice amount="3" legend="F"></wm-chart-slice> // 3%
|
|
56
|
-
</wm-chart>
|
|
57
|
-
<wm-chart id="three" label="the label" chart-type="doughnut3">
|
|
58
|
-
<wm-chart-slice amount="83" legend="A"></wm-chart-slice> // 83%
|
|
59
|
-
<wm-chart-slice amount="7" legend="B"></wm-chart-slice> // 7%
|
|
60
|
-
<wm-chart-slice amount="6" legend="C"></wm-chart-slice> // 6%
|
|
61
|
-
<wm-chart-slice amount="3" legend="D"></wm-chart-slice> // 3%
|
|
62
|
-
<wm-chart-slice amount="1" legend="E"></wm-chart-slice> // 1%
|
|
63
|
-
<wm-chart-slice amount="0" legend="F"></wm-chart-slice> // 0%
|
|
64
|
-
</wm-chart>`);
|
|
65
|
-
let [one, two, three] = await page.findAll("wm-chart");
|
|
66
|
-
let oneSlices = await one.findAll("wm-chart-slice");
|
|
67
|
-
let onePaths = await page.findAll("#one >>> path");
|
|
68
|
-
let oneTexts = await page.findAll("#one >>> text.value");
|
|
69
|
-
expect(onePaths.length).toEqual(oneSlices.length);
|
|
70
|
-
// All vals should show incl. small ones
|
|
71
|
-
// (they are not neighbors to other small vals)
|
|
72
|
-
expect(oneTexts.length).toEqual(oneSlices.length);
|
|
73
|
-
let twoSlices = await two.findAll("wm-chart-slice");
|
|
74
|
-
let twoPaths = await page.findAll("#two >>> path");
|
|
75
|
-
let twoTexts = await page.findAll("#two >>> text.value");
|
|
76
|
-
expect(twoPaths.length).toEqual(twoSlices.length);
|
|
77
|
-
// 1 small val should be hidden (3%)
|
|
78
|
-
// because it is < 4 and has a neighbor < 5
|
|
79
|
-
expect(twoTexts.length).toEqual(twoSlices.length - 1);
|
|
80
|
-
let threeSlices = await three.findAll("wm-chart-slice");
|
|
81
|
-
let threePaths = await page.findAll("#three >>> path");
|
|
82
|
-
let threeTexts = await page.findAll("#three >>> text.value");
|
|
83
|
-
// 3 small values should be hidden
|
|
84
|
-
expect(threePaths.length).toEqual(threeSlices.length);
|
|
85
|
-
expect(threeTexts.length).toEqual(threeSlices.length - 3);
|
|
86
|
-
});
|
|
87
|
-
it("handles percentages less than 1", async () => {
|
|
88
|
-
let page = await newE2EPage();
|
|
89
|
-
await page.setContent(`<wm-chart id="one" label="the label" chart-type="doughnut3">
|
|
90
|
-
// total 284
|
|
91
|
-
<wm-chart-slice amount="209" legend="A"></wm-chart-slice> // 74%
|
|
92
|
-
<wm-chart-slice amount="40" legend="B"></wm-chart-slice> // 14%
|
|
93
|
-
<wm-chart-slice amount="20" legend="C"></wm-chart-slice> // 7%
|
|
94
|
-
<wm-chart-slice amount="14" legend="D"></wm-chart-slice> // 5%
|
|
95
|
-
<wm-chart-slice amount="1" legend="E"></wm-chart-slice> // <1%
|
|
96
|
-
</wm-chart>
|
|
97
|
-
<wm-chart id="two" label="the label" chart-type="doughnut3">
|
|
98
|
-
// total 284
|
|
99
|
-
<wm-chart-slice amount="209" legend="A"></wm-chart-slice> // 73%
|
|
100
|
-
<wm-chart-slice amount="40" legend="B"></wm-chart-slice> // 14%
|
|
101
|
-
<wm-chart-slice amount="34" legend="C"></wm-chart-slice> // 12%
|
|
102
|
-
<wm-chart-slice amount="1" legend="D"></wm-chart-slice> // <1%
|
|
103
|
-
</wm-chart>`);
|
|
104
|
-
let [one, two] = await page.findAll("wm-chart");
|
|
105
|
-
let oneSlices = await one.findAll("wm-chart-slice");
|
|
106
|
-
let onePaths = await page.findAll("#one >>> path");
|
|
107
|
-
let oneTexts = await page.findAll("#one >>> text.value");
|
|
108
|
-
expect(oneSlices.length).toEqual(5);
|
|
109
|
-
// All paths are rendered
|
|
110
|
-
expect(onePaths.length).toEqual(oneSlices.length);
|
|
111
|
-
// E should be hidden because it borders a percentage < 8
|
|
112
|
-
expect(oneTexts.length).toEqual(oneSlices.length - 1);
|
|
113
|
-
let twoSlices = await two.findAll("wm-chart-slice");
|
|
114
|
-
let twoPaths = await page.findAll("#two >>> path");
|
|
115
|
-
let twoTexts = await page.findAll("#two >>> text.value");
|
|
116
|
-
expect(twoSlices.length).toEqual(4);
|
|
117
|
-
// All paths are rendered
|
|
118
|
-
expect(twoPaths.length).toEqual(twoSlices.length);
|
|
119
|
-
// Even D should be visible because it borders a percentage > 8
|
|
120
|
-
expect(twoTexts.length).toEqual(twoSlices.length);
|
|
121
|
-
});
|
|
122
|
-
it("sets the subinfo value", async () => {
|
|
123
|
-
const comp = await page.find("wm-chart");
|
|
124
|
-
comp.setProperty("subinfo", "subinfo text");
|
|
125
|
-
await page.waitForChanges();
|
|
126
|
-
const subinfo = await page.find("wm-chart >>> .subinfo");
|
|
127
|
-
expect(subinfo.textContent).toEqual("subinfo text");
|
|
128
|
-
});
|
|
129
|
-
it("changes the display values", async () => {
|
|
130
|
-
// type bar2 and bar3
|
|
131
|
-
const tmpPage = await newE2EPage();
|
|
132
|
-
await tmpPage.setContent(`<wm-chart id="bar2chart" chart-type="bar2" label="the label" value-format="percentage"><wm-chart-slice amount="10" legend="Created"></wm-chart-slice><wm-chart-slice amount="10" legend="Not Created"></wm-chart-slice></wm-chart>
|
|
133
|
-
<wm-chart id="bar3chart" chart-type="bar3" label="the label" value-format="amount"><wm-chart-slice amount="70" legend="Created"></wm-chart-slice><wm-chart-slice amount="10" legend="Not Created"></wm-chart-slice></wm-chart>`);
|
|
134
|
-
await tmpPage.waitForChanges();
|
|
135
|
-
const bar2val = await tmpPage.findAll("#bar2chart >>> .value");
|
|
136
|
-
expect(bar2val[0].textContent).toEqual("50%");
|
|
137
|
-
const bar3val = await tmpPage.findAll("#bar3chart >>> .value");
|
|
138
|
-
expect(bar3val[0].textContent).toEqual("70");
|
|
139
|
-
});
|
|
140
|
-
it("handles Arrows and Tab keys", async () => {
|
|
141
|
-
const componentWrapper = await page.find("wm-chart >>> .component-wrapper");
|
|
142
|
-
await page.keyboard.press("Tab");
|
|
143
|
-
await page.waitForChanges();
|
|
144
|
-
await page.keyboard.press("ArrowDown");
|
|
145
|
-
await page.waitForChanges();
|
|
146
|
-
paths = await page.findAll("wm-chart >>> path");
|
|
147
|
-
expect(componentWrapper).toEqualAttribute("tabindex", "-1");
|
|
148
|
-
expect(paths[0]).toEqualAttribute("tabindex", "0");
|
|
149
|
-
expect(paths[1]).toEqualAttribute("tabindex", "-1");
|
|
150
|
-
await page.keyboard.press("ArrowRight");
|
|
151
|
-
await page.waitForChanges();
|
|
152
|
-
paths = await page.findAll("wm-chart >>> path");
|
|
153
|
-
expect(componentWrapper).toEqualAttribute("tabindex", "-1");
|
|
154
|
-
expect(paths[0]).toEqualAttribute("tabindex", "-1");
|
|
155
|
-
expect(paths[1]).toEqualAttribute("tabindex", "0");
|
|
156
|
-
await page.keyboard.press("ArrowLeft");
|
|
157
|
-
await page.waitForChanges();
|
|
158
|
-
paths = await page.findAll("wm-chart >>> path");
|
|
159
|
-
expect(componentWrapper).toEqualAttribute("tabindex", "-1");
|
|
160
|
-
expect(paths[0]).toEqualAttribute("tabindex", "0");
|
|
161
|
-
expect(paths[1]).toEqualAttribute("tabindex", "-1");
|
|
162
|
-
await page.keyboard.press("ArrowUp");
|
|
163
|
-
await page.waitForChanges();
|
|
164
|
-
paths = await page.findAll("wm-chart >>> path");
|
|
165
|
-
expect(componentWrapper).toEqualAttribute("tabindex", "-1");
|
|
166
|
-
expect(paths[0]).toEqualAttribute("tabindex", "-1");
|
|
167
|
-
expect(paths[1]).toEqualAttribute("tabindex", "0");
|
|
168
|
-
await page.keyboard.press("Tab");
|
|
169
|
-
await page.waitForChanges();
|
|
170
|
-
expect(componentWrapper).toEqualAttribute("tabindex", "0");
|
|
171
|
-
expect(paths[0]).toEqualAttribute("tabindex", "-1");
|
|
172
|
-
expect(paths[1]).toEqualAttribute("tabindex", "-1");
|
|
173
|
-
});
|
|
174
|
-
it("opens popover when slice clicked", async () => {
|
|
175
|
-
const tmpPage = await newE2EPage();
|
|
176
|
-
await tmpPage.setContent(`<wm-chart id="one" label="the label" chart-type="doughnut3">
|
|
177
|
-
<wm-chart-slice amount="95" popover-title="A" popover-text="Text A" popover-button-text="A Button" legend="A"></wm-chart-slice>
|
|
178
|
-
<wm-chart-slice amount="5" popover-title="B" popover-text="Text B" popover-button-text="B Button" legend="B"></wm-chart-slice>
|
|
179
|
-
</wm-chart>`);
|
|
180
|
-
await tmpPage.waitForChanges;
|
|
181
|
-
let hasPopover = await tmpPage.find("wm-chart >>> .popover");
|
|
182
|
-
const path = await tmpPage.find("wm-chart >>> path");
|
|
183
|
-
expect(hasPopover).toBeFalsy;
|
|
184
|
-
await path.click();
|
|
185
|
-
await tmpPage.waitForChanges();
|
|
186
|
-
hasPopover = await tmpPage.find("wm-chart >>> .popover");
|
|
187
|
-
expect(hasPopover).toBeTruthy;
|
|
188
|
-
});
|
|
189
|
-
it("activating popover button fires event", async () => {
|
|
190
|
-
const tmpPage = await newE2EPage();
|
|
191
|
-
await tmpPage.setContent(`<wm-chart id="one" label="the label" chart-type="doughnut3">
|
|
192
|
-
<wm-chart-slice amount="5" popover-title="A" popover-text="Text A" popover-button-text="A Button" legend="A"></wm-chart-slice>
|
|
193
|
-
<wm-chart-slice amount="95" popover-title="B" popover-text="Text B" popover-button-text="B Button" legend="B"></wm-chart-slice>
|
|
194
|
-
</wm-chart>
|
|
195
|
-
<div id="indicator"></div>`);
|
|
196
|
-
await tmpPage.waitForChanges;
|
|
197
|
-
await tmpPage.evaluate(async () => {
|
|
198
|
-
const component = await document.querySelector("wm-chart");
|
|
199
|
-
const indicator = await document.querySelector("#indicator");
|
|
200
|
-
await component.addEventListener("wmChartPopoverButtonTriggered", () => (indicator.textContent = "event heard"));
|
|
201
|
-
});
|
|
202
|
-
await tmpPage.waitForChanges;
|
|
203
|
-
const indicator = await tmpPage.find("#indicator");
|
|
204
|
-
expect(indicator.textContent).toBe("");
|
|
205
|
-
await tmpPage.keyboard.press("Tab");
|
|
206
|
-
await tmpPage.waitForChanges();
|
|
207
|
-
await tmpPage.keyboard.press("ArrowDown");
|
|
208
|
-
await tmpPage.waitForChanges();
|
|
209
|
-
await tmpPage.keyboard.press("Enter");
|
|
210
|
-
await tmpPage.waitForChanges();
|
|
211
|
-
expect(indicator.textContent).toBe("event heard");
|
|
212
|
-
});
|
|
213
|
-
});
|
|
@@ -1,422 +0,0 @@
|
|
|
1
|
-
import { h, Host } from "@stencil/core";
|
|
2
|
-
import { forceUpdate } from "@stencil/core";
|
|
3
|
-
import { debounce, generateId } from "../../../global/functions";
|
|
4
|
-
import { amountToPercent, exitChart, getDetails, handleChartKeydown, renderStackedBar, renderSimpleBar, renderDoughnut, renderHiddenValuesMessage, renderInstructionsText, renderLegend, allChartsDetails, removeSegmentInfoHighlight, } from "../chartFunctions";
|
|
5
|
-
import { chartMessages } from "../../../global/intl";
|
|
6
|
-
export class Chart {
|
|
7
|
-
constructor() {
|
|
8
|
-
this.uid = generateId();
|
|
9
|
-
// @ts-ignore-- TS warns this is unused, but its needed in chartFunctions
|
|
10
|
-
this.slicesDetails = [];
|
|
11
|
-
this.debouncedSliceUpdate = debounce(async () => {
|
|
12
|
-
await getDetails.call(this, this.currentChartType);
|
|
13
|
-
forceUpdate(this.el);
|
|
14
|
-
}, 100);
|
|
15
|
-
this.chartType = "doughnut1";
|
|
16
|
-
this.label = undefined;
|
|
17
|
-
this.labelWidth = "150px";
|
|
18
|
-
this.subinfo = undefined;
|
|
19
|
-
this.valueFormat = "none";
|
|
20
|
-
this.showGrid = true;
|
|
21
|
-
this.showLegend = true;
|
|
22
|
-
this.showBarLegend = false;
|
|
23
|
-
this.notStartedColor = false;
|
|
24
|
-
this.printMode = false;
|
|
25
|
-
this.printModeFormat = "amount";
|
|
26
|
-
this.labelPosition = "top";
|
|
27
|
-
this.isTabbing = false;
|
|
28
|
-
this.userIsNavigating = false;
|
|
29
|
-
this.focusedSliceId = undefined;
|
|
30
|
-
}
|
|
31
|
-
get popoverEl() {
|
|
32
|
-
return this.el.shadowRoot.querySelector("priv-chart-popover");
|
|
33
|
-
}
|
|
34
|
-
get sliceEls() {
|
|
35
|
-
return Array.from(this.el.shadowRoot.querySelectorAll(".segment"));
|
|
36
|
-
}
|
|
37
|
-
get currentChartType() {
|
|
38
|
-
return this.chartType;
|
|
39
|
-
}
|
|
40
|
-
get chartDetails() {
|
|
41
|
-
return allChartsDetails[this.currentChartType];
|
|
42
|
-
}
|
|
43
|
-
get ariaLabelText() {
|
|
44
|
-
let text = `${this.label}`;
|
|
45
|
-
if (this.subinfo) {
|
|
46
|
-
text += ` ${this.subinfo}`;
|
|
47
|
-
}
|
|
48
|
-
return text;
|
|
49
|
-
}
|
|
50
|
-
get isDoughnut() {
|
|
51
|
-
return this.chartDetails.category === "doughnut";
|
|
52
|
-
}
|
|
53
|
-
get isStackedBar() {
|
|
54
|
-
return this.chartDetails.category === "stackedBar";
|
|
55
|
-
}
|
|
56
|
-
get isSimpleBar() {
|
|
57
|
-
return this.chartDetails.category === "simpleBar";
|
|
58
|
-
}
|
|
59
|
-
get isBar() {
|
|
60
|
-
return this.isStackedBar || this.isSimpleBar;
|
|
61
|
-
}
|
|
62
|
-
toggleTabbingOn() {
|
|
63
|
-
this.isTabbing = true;
|
|
64
|
-
}
|
|
65
|
-
toggleTabbingOff() {
|
|
66
|
-
this.isTabbing = false;
|
|
67
|
-
}
|
|
68
|
-
handleKeydown(ev) {
|
|
69
|
-
handleChartKeydown.call(this, ev);
|
|
70
|
-
}
|
|
71
|
-
showHiddenValuesMessage(showMsg) {
|
|
72
|
-
const msg = this.el.shadowRoot.querySelector(".hidden-values-warning");
|
|
73
|
-
if (msg) {
|
|
74
|
-
showMsg ? msg.classList.remove("hidden") : msg.classList.add("hidden");
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
// if DOM isn't ready, try again later
|
|
78
|
-
requestAnimationFrame(() => this.showHiddenValuesMessage(showMsg));
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
/* LIFECYCLE METHODS + EVENTS FROM THE CHILDREN */
|
|
82
|
-
async componentWillLoad() {
|
|
83
|
-
if (!this.label) {
|
|
84
|
-
throw new Error("For accessibility purposes, you must provide a label for the chart. See https://components.watermarkinsights.com/chart for more information.");
|
|
85
|
-
}
|
|
86
|
-
await getDetails.call(this, this.currentChartType);
|
|
87
|
-
// rerender on resize
|
|
88
|
-
// unnecessary for doughnuts as layout doesn't change
|
|
89
|
-
if (!this.isDoughnut) {
|
|
90
|
-
const resizeObserver = new ResizeObserver(() => {
|
|
91
|
-
forceUpdate(this.el);
|
|
92
|
-
});
|
|
93
|
-
resizeObserver.observe(this.el);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
handleSliceUpdate() {
|
|
97
|
-
this.debouncedSliceUpdate();
|
|
98
|
-
}
|
|
99
|
-
handlePopoverOpenChanged(ev) {
|
|
100
|
-
const isOpen = ev.detail;
|
|
101
|
-
if (!isOpen) {
|
|
102
|
-
const infoEls = Array.from(this.el.shadowRoot.querySelectorAll("[data-segmentindex]"));
|
|
103
|
-
removeSegmentInfoHighlight(infoEls);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
/* RENDERING */
|
|
107
|
-
renderBarText(s, minimumWidth) {
|
|
108
|
-
let val;
|
|
109
|
-
if (this.valueFormat === "percentage") {
|
|
110
|
-
if (s.perc === 0 && s.amount > 0) {
|
|
111
|
-
val = "<1%";
|
|
112
|
-
}
|
|
113
|
-
else if (s.perc === 100 && s.amount < this.total) {
|
|
114
|
-
val = ">99%";
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
val = s.perc + "%";
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
else if (this.valueFormat === "amount") {
|
|
121
|
-
val = s.amount;
|
|
122
|
-
}
|
|
123
|
-
const segmentPercentage = amountToPercent(s.amount, this.total, false);
|
|
124
|
-
const availableWidth = this.el.offsetWidth;
|
|
125
|
-
const meetsSizeMinimum = (segmentPercentage / 100) * availableWidth >= minimumWidth;
|
|
126
|
-
const renderedWidth = meetsSizeMinimum || s.amount == 0 ? `${segmentPercentage}%` : `${minimumWidth}px`;
|
|
127
|
-
// even though we do not display the value text if it has an amount of 0, we still want to render the value-wrapper
|
|
128
|
-
// in order to not disturb the positioning of the other value texts in the entire row
|
|
129
|
-
return (h("div", { class: `value-wrapper ${meetsSizeMinimum ? "" : "fixed-width"}`, style: { width: renderedWidth } }, h("span", { class: "value", "data-value": s.amount, "data-segmentindex": s.index }, s.amount > 0 && val)));
|
|
130
|
-
}
|
|
131
|
-
drawAxis() {
|
|
132
|
-
if (this.currentChartType === "bar3") {
|
|
133
|
-
return (h("svg", { class: "axis" }, h("line", { x1: "0", x2: "100%", y1: "0", y2: "0" }), h("line", { x1: "0", x2: "0", y1: "0", y2: "-85px" }), h("line", { class: "tick", x1: "0.5", x2: "0.5", y1: "0", y2: "6" }), h("line", { class: "tick", x1: "100%", x2: "100%", y1: "0", y2: "6" })));
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
renderChart() {
|
|
137
|
-
if (this.isSimpleBar) {
|
|
138
|
-
return renderSimpleBar.call(this, this.currentChartType);
|
|
139
|
-
}
|
|
140
|
-
else if (this.isStackedBar && this.total > 0) {
|
|
141
|
-
return renderStackedBar.call(this, this.currentChartType);
|
|
142
|
-
}
|
|
143
|
-
else if (this.isDoughnut && this.total > 0) {
|
|
144
|
-
return renderDoughnut.call(this, this.currentChartType);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
render() {
|
|
148
|
-
return (h(Host, { onBlur: () => exitChart.call(this) }, h("div", { ref: (el) => (this.componentWrapperEl = el), class: `component-wrapper ${this.currentChartType} ${this.isTabbing && !this.userIsNavigating ? "user-is-tabbing" : ""} ${this.labelPosition === "left" && this.currentChartType === "bar4" ? "left-label" : ""}`, role: "application", "aria-label": this.ariaLabelText, tabindex: 0, "aria-roledescription": chartMessages.interactiveChart, "aria-describedby": "chart-instructions" }, h("label", { id: `label-${this.uid}`, class: `label --${this.labelPosition}`, htmlFor: `graphic-${this.uid}` }, h("span", { class: "label-text" }, this.label), this.subinfo ? h("span", { class: "subinfo" }, this.subinfo) : ""), this.isBar && renderLegend.call(this, this.currentChartType), this.renderChart(), this.isDoughnut && renderLegend.call(this, this.currentChartType), h("priv-chart-popover", { class: this.isTabbing ? "user-is-tabbing" : "", onIntChartPopoverOpenChanged: (ev) => this.handlePopoverOpenChanged(ev) }), this.isBar && !this.printMode && renderHiddenValuesMessage()), renderInstructionsText()));
|
|
149
|
-
}
|
|
150
|
-
static get is() { return "wm-chart"; }
|
|
151
|
-
static get encapsulation() { return "shadow"; }
|
|
152
|
-
static get delegatesFocus() { return true; }
|
|
153
|
-
static get originalStyleUrls() {
|
|
154
|
-
return {
|
|
155
|
-
"$": ["wm-chart.scss"]
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
static get styleUrls() {
|
|
159
|
-
return {
|
|
160
|
-
"$": ["wm-chart.css"]
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
static get properties() {
|
|
164
|
-
return {
|
|
165
|
-
"chartType": {
|
|
166
|
-
"type": "string",
|
|
167
|
-
"mutable": false,
|
|
168
|
-
"complexType": {
|
|
169
|
-
"original": "ChartType",
|
|
170
|
-
"resolved": "\"bar\" | \"bar2\" | \"bar3\" | \"bar4\" | \"bar5\" | \"bar6\" | \"bar7\" | \"doughnut\" | \"doughnut1\" | \"doughnut2\" | \"doughnut3\"",
|
|
171
|
-
"references": {
|
|
172
|
-
"ChartType": {
|
|
173
|
-
"location": "import",
|
|
174
|
-
"path": "../../../global/interfaces",
|
|
175
|
-
"id": "src/global/interfaces.ts::ChartType"
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
},
|
|
179
|
-
"required": false,
|
|
180
|
-
"optional": false,
|
|
181
|
-
"docs": {
|
|
182
|
-
"tags": [],
|
|
183
|
-
"text": ""
|
|
184
|
-
},
|
|
185
|
-
"attribute": "chart-type",
|
|
186
|
-
"reflect": false,
|
|
187
|
-
"defaultValue": "\"doughnut1\""
|
|
188
|
-
},
|
|
189
|
-
"label": {
|
|
190
|
-
"type": "string",
|
|
191
|
-
"mutable": false,
|
|
192
|
-
"complexType": {
|
|
193
|
-
"original": "string",
|
|
194
|
-
"resolved": "string | undefined",
|
|
195
|
-
"references": {}
|
|
196
|
-
},
|
|
197
|
-
"required": false,
|
|
198
|
-
"optional": true,
|
|
199
|
-
"docs": {
|
|
200
|
-
"tags": [],
|
|
201
|
-
"text": ""
|
|
202
|
-
},
|
|
203
|
-
"attribute": "label",
|
|
204
|
-
"reflect": false
|
|
205
|
-
},
|
|
206
|
-
"labelWidth": {
|
|
207
|
-
"type": "string",
|
|
208
|
-
"mutable": false,
|
|
209
|
-
"complexType": {
|
|
210
|
-
"original": "string",
|
|
211
|
-
"resolved": "string",
|
|
212
|
-
"references": {}
|
|
213
|
-
},
|
|
214
|
-
"required": false,
|
|
215
|
-
"optional": false,
|
|
216
|
-
"docs": {
|
|
217
|
-
"tags": [],
|
|
218
|
-
"text": ""
|
|
219
|
-
},
|
|
220
|
-
"attribute": "label-width",
|
|
221
|
-
"reflect": false,
|
|
222
|
-
"defaultValue": "\"150px\""
|
|
223
|
-
},
|
|
224
|
-
"subinfo": {
|
|
225
|
-
"type": "string",
|
|
226
|
-
"mutable": false,
|
|
227
|
-
"complexType": {
|
|
228
|
-
"original": "string",
|
|
229
|
-
"resolved": "string | undefined",
|
|
230
|
-
"references": {}
|
|
231
|
-
},
|
|
232
|
-
"required": false,
|
|
233
|
-
"optional": true,
|
|
234
|
-
"docs": {
|
|
235
|
-
"tags": [],
|
|
236
|
-
"text": ""
|
|
237
|
-
},
|
|
238
|
-
"attribute": "subinfo",
|
|
239
|
-
"reflect": false
|
|
240
|
-
},
|
|
241
|
-
"valueFormat": {
|
|
242
|
-
"type": "string",
|
|
243
|
-
"mutable": false,
|
|
244
|
-
"complexType": {
|
|
245
|
-
"original": "\"percentage\" | \"amount\" | \"none\"",
|
|
246
|
-
"resolved": "\"amount\" | \"none\" | \"percentage\"",
|
|
247
|
-
"references": {}
|
|
248
|
-
},
|
|
249
|
-
"required": false,
|
|
250
|
-
"optional": false,
|
|
251
|
-
"docs": {
|
|
252
|
-
"tags": [],
|
|
253
|
-
"text": ""
|
|
254
|
-
},
|
|
255
|
-
"attribute": "value-format",
|
|
256
|
-
"reflect": false,
|
|
257
|
-
"defaultValue": "\"none\""
|
|
258
|
-
},
|
|
259
|
-
"showGrid": {
|
|
260
|
-
"type": "boolean",
|
|
261
|
-
"mutable": false,
|
|
262
|
-
"complexType": {
|
|
263
|
-
"original": "boolean",
|
|
264
|
-
"resolved": "boolean | undefined",
|
|
265
|
-
"references": {}
|
|
266
|
-
},
|
|
267
|
-
"required": false,
|
|
268
|
-
"optional": true,
|
|
269
|
-
"docs": {
|
|
270
|
-
"tags": [],
|
|
271
|
-
"text": ""
|
|
272
|
-
},
|
|
273
|
-
"attribute": "show-grid",
|
|
274
|
-
"reflect": false,
|
|
275
|
-
"defaultValue": "true"
|
|
276
|
-
},
|
|
277
|
-
"showLegend": {
|
|
278
|
-
"type": "boolean",
|
|
279
|
-
"mutable": false,
|
|
280
|
-
"complexType": {
|
|
281
|
-
"original": "boolean",
|
|
282
|
-
"resolved": "boolean",
|
|
283
|
-
"references": {}
|
|
284
|
-
},
|
|
285
|
-
"required": false,
|
|
286
|
-
"optional": false,
|
|
287
|
-
"docs": {
|
|
288
|
-
"tags": [],
|
|
289
|
-
"text": ""
|
|
290
|
-
},
|
|
291
|
-
"attribute": "show-legend",
|
|
292
|
-
"reflect": false,
|
|
293
|
-
"defaultValue": "true"
|
|
294
|
-
},
|
|
295
|
-
"showBarLegend": {
|
|
296
|
-
"type": "boolean",
|
|
297
|
-
"mutable": false,
|
|
298
|
-
"complexType": {
|
|
299
|
-
"original": "boolean",
|
|
300
|
-
"resolved": "boolean",
|
|
301
|
-
"references": {}
|
|
302
|
-
},
|
|
303
|
-
"required": false,
|
|
304
|
-
"optional": false,
|
|
305
|
-
"docs": {
|
|
306
|
-
"tags": [],
|
|
307
|
-
"text": ""
|
|
308
|
-
},
|
|
309
|
-
"attribute": "show-bar-legend",
|
|
310
|
-
"reflect": false,
|
|
311
|
-
"defaultValue": "false"
|
|
312
|
-
},
|
|
313
|
-
"notStartedColor": {
|
|
314
|
-
"type": "boolean",
|
|
315
|
-
"mutable": false,
|
|
316
|
-
"complexType": {
|
|
317
|
-
"original": "boolean",
|
|
318
|
-
"resolved": "boolean",
|
|
319
|
-
"references": {}
|
|
320
|
-
},
|
|
321
|
-
"required": false,
|
|
322
|
-
"optional": false,
|
|
323
|
-
"docs": {
|
|
324
|
-
"tags": [],
|
|
325
|
-
"text": ""
|
|
326
|
-
},
|
|
327
|
-
"attribute": "not-started-color",
|
|
328
|
-
"reflect": false,
|
|
329
|
-
"defaultValue": "false"
|
|
330
|
-
},
|
|
331
|
-
"printMode": {
|
|
332
|
-
"type": "boolean",
|
|
333
|
-
"mutable": false,
|
|
334
|
-
"complexType": {
|
|
335
|
-
"original": "boolean",
|
|
336
|
-
"resolved": "boolean",
|
|
337
|
-
"references": {}
|
|
338
|
-
},
|
|
339
|
-
"required": false,
|
|
340
|
-
"optional": false,
|
|
341
|
-
"docs": {
|
|
342
|
-
"tags": [],
|
|
343
|
-
"text": ""
|
|
344
|
-
},
|
|
345
|
-
"attribute": "print-mode",
|
|
346
|
-
"reflect": false,
|
|
347
|
-
"defaultValue": "false"
|
|
348
|
-
},
|
|
349
|
-
"printModeFormat": {
|
|
350
|
-
"type": "string",
|
|
351
|
-
"mutable": false,
|
|
352
|
-
"complexType": {
|
|
353
|
-
"original": "\"percentage\" | \"amount\"",
|
|
354
|
-
"resolved": "\"amount\" | \"percentage\"",
|
|
355
|
-
"references": {}
|
|
356
|
-
},
|
|
357
|
-
"required": false,
|
|
358
|
-
"optional": false,
|
|
359
|
-
"docs": {
|
|
360
|
-
"tags": [],
|
|
361
|
-
"text": ""
|
|
362
|
-
},
|
|
363
|
-
"attribute": "print-mode-format",
|
|
364
|
-
"reflect": false,
|
|
365
|
-
"defaultValue": "\"amount\""
|
|
366
|
-
},
|
|
367
|
-
"labelPosition": {
|
|
368
|
-
"type": "string",
|
|
369
|
-
"mutable": false,
|
|
370
|
-
"complexType": {
|
|
371
|
-
"original": "\"left\" | \"top\" | \"none\"",
|
|
372
|
-
"resolved": "\"left\" | \"none\" | \"top\"",
|
|
373
|
-
"references": {}
|
|
374
|
-
},
|
|
375
|
-
"required": false,
|
|
376
|
-
"optional": false,
|
|
377
|
-
"docs": {
|
|
378
|
-
"tags": [],
|
|
379
|
-
"text": ""
|
|
380
|
-
},
|
|
381
|
-
"attribute": "label-position",
|
|
382
|
-
"reflect": false,
|
|
383
|
-
"defaultValue": "\"top\""
|
|
384
|
-
}
|
|
385
|
-
};
|
|
386
|
-
}
|
|
387
|
-
static get states() {
|
|
388
|
-
return {
|
|
389
|
-
"isTabbing": {},
|
|
390
|
-
"userIsNavigating": {},
|
|
391
|
-
"focusedSliceId": {}
|
|
392
|
-
};
|
|
393
|
-
}
|
|
394
|
-
static get elementRef() { return "el"; }
|
|
395
|
-
static get listeners() {
|
|
396
|
-
return [{
|
|
397
|
-
"name": "wmUserIsTabbing",
|
|
398
|
-
"method": "toggleTabbingOn",
|
|
399
|
-
"target": "window",
|
|
400
|
-
"capture": false,
|
|
401
|
-
"passive": false
|
|
402
|
-
}, {
|
|
403
|
-
"name": "wmUserIsNotTabbing",
|
|
404
|
-
"method": "toggleTabbingOff",
|
|
405
|
-
"target": "window",
|
|
406
|
-
"capture": false,
|
|
407
|
-
"passive": false
|
|
408
|
-
}, {
|
|
409
|
-
"name": "keydown",
|
|
410
|
-
"method": "handleKeydown",
|
|
411
|
-
"target": undefined,
|
|
412
|
-
"capture": false,
|
|
413
|
-
"passive": false
|
|
414
|
-
}, {
|
|
415
|
-
"name": "wmChartSliceUpdated",
|
|
416
|
-
"method": "handleSliceUpdate",
|
|
417
|
-
"target": undefined,
|
|
418
|
-
"capture": false,
|
|
419
|
-
"passive": false
|
|
420
|
-
}];
|
|
421
|
-
}
|
|
422
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { newSpecPage } from "@stencil/core/testing";
|
|
2
|
-
import * as globalFuncs from "../../../global/functions";
|
|
3
|
-
jest.spyOn(globalFuncs, "generateId");
|
|
4
|
-
// @ts-ignore
|
|
5
|
-
globalFuncs.generateId.mockImplementation(() => "random-id");
|
|
6
|
-
import { Chart } from "./wm-chart";
|
|
7
|
-
// mock ResizeObserver
|
|
8
|
-
global.ResizeObserver = jest.fn().mockImplementation(() => ({
|
|
9
|
-
observe: jest.fn(),
|
|
10
|
-
unobserve: jest.fn(),
|
|
11
|
-
disconnect: jest.fn(),
|
|
12
|
-
}));
|
|
13
|
-
describe("wm-chart", () => {
|
|
14
|
-
it("builds", async () => {
|
|
15
|
-
const page = await newSpecPage({ components: [Chart], html: '<wm-chart label="charty"></wm-chart>' });
|
|
16
|
-
expect(page.root).toMatchSnapshot();
|
|
17
|
-
});
|
|
18
|
-
it("properties and attributes", async () => {
|
|
19
|
-
const page = await newSpecPage({ components: [Chart], html: '<wm-chart label="charty"></wm-chart>' });
|
|
20
|
-
const componentWrapper = page.root.shadowRoot.querySelector(".component-wrapper");
|
|
21
|
-
expect(componentWrapper).toEqualAttribute("role", "application");
|
|
22
|
-
expect(componentWrapper).toEqualAttribute("aria-label", "charty");
|
|
23
|
-
expect(componentWrapper).toEqualAttribute("aria-roledescription", "Interactive chart");
|
|
24
|
-
expect(componentWrapper).toEqualAttribute("aria-describedby", "chart-instructions");
|
|
25
|
-
});
|
|
26
|
-
// needs refactoring before it can be tested
|
|
27
|
-
// it("generates the svg path", () => {
|
|
28
|
-
// const chart = new Chart();
|
|
29
|
-
// expect(chart.getPathData(122, 23)).toEqual("thing");
|
|
30
|
-
// })
|
|
31
|
-
// needs refactoring before it can be tested
|
|
32
|
-
// it("outputs the svg arc syntax", () => {
|
|
33
|
-
// const chart = new Chart();
|
|
34
|
-
// // the 2nd arc is set according to whether we're drawing the inner or outer arc, and whether it's concave or convex
|
|
35
|
-
// expect(chart.getArc(23, "0 1", 34, 66)).toEqual("nene");
|
|
36
|
-
// })
|
|
37
|
-
});
|