@watermarkinsights/ripple 5.23.0-alpha.1 → 5.23.0-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{app-globals-d5560aa2.js → app-globals-cc1392c1.js} +26 -17
- package/dist/cjs/{chartFunctions-97471b69.js → chartFunctions-8d17cbb8.js} +19 -1
- package/dist/cjs/{functions-71af585d.js → functions-156cc201.js} +2 -2
- package/dist/cjs/{interfaces-069f135e.js → interfaces-8419be91.js} +22 -21
- package/dist/cjs/{intl-169a8805.js → intl-789e4b6c.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/priv-calendar.cjs.entry.js +26 -13
- package/dist/cjs/priv-chart-popover-old.cjs.entry.js +2 -2
- package/dist/cjs/priv-chart-popover_2.cjs.entry.js +8 -8
- package/dist/cjs/priv-navigator-button.cjs.entry.js +1 -1
- package/dist/cjs/priv-navigator-item.cjs.entry.js +1 -1
- package/dist/cjs/priv-option-list.cjs.entry.js +3 -3
- package/dist/cjs/ripple.cjs.js +2 -2
- package/dist/cjs/wm-action-menu_2.cjs.entry.js +4 -4
- package/dist/cjs/wm-button.cjs.entry.js +4 -4
- package/dist/cjs/wm-chart-bar.cjs.entry.js +51 -29
- package/dist/cjs/wm-chart.cjs.entry.js +3 -3
- package/dist/cjs/wm-date-range.cjs.entry.js +1 -1
- package/dist/cjs/wm-datepicker.cjs.entry.js +1 -1
- package/dist/cjs/wm-file-list.cjs.entry.js +1 -1
- package/dist/cjs/wm-file.cjs.entry.js +2 -2
- package/dist/cjs/wm-flyout.cjs.entry.js +3 -3
- package/dist/cjs/wm-input.cjs.entry.js +3 -3
- package/dist/cjs/wm-line-chart.cjs.entry.js +3 -3
- package/dist/cjs/wm-modal-pss_3.cjs.entry.js +6 -6
- package/dist/cjs/wm-modal_3.cjs.entry.js +8 -10
- package/dist/cjs/wm-navigation_3.cjs.entry.js +6 -6
- package/dist/cjs/wm-navigator.cjs.entry.js +2 -2
- package/dist/cjs/wm-nested-select.cjs.entry.js +5 -5
- package/dist/cjs/wm-optgroup.cjs.entry.js +2 -2
- package/dist/cjs/wm-option_2.cjs.entry.js +49 -38
- package/dist/cjs/wm-pagination.cjs.entry.js +4 -4
- package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +2 -2
- package/dist/cjs/wm-search.cjs.entry.js +5 -5
- package/dist/cjs/wm-snackbar.cjs.entry.js +5 -5
- package/dist/cjs/wm-tab-item_3.cjs.entry.js +8 -8
- package/dist/cjs/wm-tag-input.cjs.entry.js +4 -4
- package/dist/cjs/wm-tag-option.cjs.entry.js +1 -1
- package/dist/cjs/wm-textarea.cjs.entry.js +3 -3
- package/dist/cjs/wm-timepicker.cjs.entry.js +3 -3
- package/dist/cjs/wm-toggletip.cjs.entry.js +4 -4
- package/dist/cjs/wm-uploader.cjs.entry.js +5 -5
- package/dist/collection/components/charts/chartFunctions.js +17 -0
- package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.css +22 -22
- package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.js +5 -17
- package/dist/collection/components/charts/priv-chart-popover-old/priv-chart-popover-old.css +10 -8
- package/dist/collection/components/charts/wm-chart-bar/wm-chart-bar.css +2 -21
- package/dist/collection/components/charts/wm-chart-bar/wm-chart-bar.js +50 -40
- package/dist/collection/components/charts/wm-chart-legend/wm-chart-legend.js +2 -2
- package/dist/collection/components/datepickers/priv-calendar/priv-calendar.js +30 -12
- package/dist/collection/components/selects/priv-option-list/priv-option-list.js +1 -1
- package/dist/collection/components/selects/wm-nested-select/wm-nested-select.js +3 -3
- package/dist/collection/components/selects/wm-optgroup/wm-optgroup.js +1 -1
- package/dist/collection/components/selects/wm-option/wm-option.js +1 -1
- package/dist/collection/components/selects/wm-select/wm-select.js +46 -35
- package/dist/collection/components/wm-action-menu/wm-action-menu.js +1 -1
- package/dist/collection/components/wm-button/wm-button.css +14 -15
- package/dist/collection/components/wm-button/wm-button.js +1 -1
- package/dist/collection/components/wm-file/wm-file.js +1 -1
- package/dist/collection/components/wm-file-list/wm-file-list.js +1 -1
- package/dist/collection/components/wm-flyout/wm-flyout.js +1 -1
- package/dist/collection/components/wm-input/wm-input.js +1 -1
- package/dist/collection/components/wm-menuitem/wm-menuitem.js +1 -1
- package/dist/collection/components/wm-modal/wm-modal-footer.js +1 -1
- package/dist/collection/components/wm-modal/wm-modal-header.js +1 -1
- package/dist/collection/components/wm-modal/wm-modal.js +4 -6
- 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.js +1 -1
- package/dist/collection/components/wm-modal-pss/wm-modal-pss.js +2 -2
- package/dist/collection/components/wm-navigation/wm-navigation-hamburger.js +1 -1
- package/dist/collection/components/wm-navigation/wm-navigation-item.js +1 -1
- package/dist/collection/components/wm-navigation/wm-navigation.js +2 -2
- package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.js +1 -1
- package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.js +1 -1
- package/dist/collection/components/wm-pagination/wm-pagination.css +12 -17
- package/dist/collection/components/wm-pagination/wm-pagination.js +1 -1
- package/dist/collection/components/wm-search/wm-search.css +8 -8
- package/dist/collection/components/wm-search/wm-search.js +2 -2
- package/dist/collection/components/wm-snackbar/wm-snackbar.css +10 -13
- package/dist/collection/components/wm-snackbar/wm-snackbar.js +2 -2
- package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.css +3 -2
- package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.js +2 -2
- package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.js +3 -3
- package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.js +1 -1
- package/dist/collection/components/wm-tag-input/wm-tag-input.js +2 -2
- package/dist/collection/components/wm-textarea/wm-textarea.js +1 -1
- package/dist/collection/components/wm-timepicker/wm-timepicker.js +2 -2
- package/dist/collection/components/wm-toggletip/wm-toggletip.js +3 -3
- package/dist/collection/components/wm-uploader/wm-uploader.css +23 -16
- package/dist/collection/components/wm-uploader/wm-uploader.js +2 -2
- package/dist/collection/dev/chart-bar.js +77 -41
- package/dist/collection/global/functions.js +2 -2
- package/dist/collection/global/global.js +25 -16
- package/dist/collection/global/interfaces.js +21 -19
- package/dist/esm/{app-globals-2d0df1cb.js → app-globals-47a9cf9f.js} +26 -17
- package/dist/esm/{chartFunctions-9c95674d.js → chartFunctions-93592f14.js} +19 -2
- package/dist/esm/{functions-2cfbd8c7.js → functions-c1d5f184.js} +2 -2
- package/dist/esm/{interfaces-30d10bc0.js → interfaces-7e50d034.js} +22 -20
- package/dist/esm/{intl-23d21b06.js → intl-8c69d10b.js} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/priv-calendar.entry.js +26 -13
- package/dist/esm/priv-chart-popover-old.entry.js +2 -2
- package/dist/esm/priv-chart-popover_2.entry.js +8 -8
- package/dist/esm/priv-navigator-button.entry.js +1 -1
- package/dist/esm/priv-navigator-item.entry.js +1 -1
- package/dist/esm/priv-option-list.entry.js +3 -3
- package/dist/esm/ripple.js +2 -2
- package/dist/esm/wm-action-menu_2.entry.js +4 -4
- package/dist/esm/wm-button.entry.js +4 -4
- package/dist/esm/wm-chart-bar.entry.js +51 -29
- package/dist/esm/wm-chart.entry.js +3 -3
- package/dist/esm/wm-date-range.entry.js +1 -1
- package/dist/esm/wm-datepicker.entry.js +1 -1
- package/dist/esm/wm-file-list.entry.js +1 -1
- package/dist/esm/wm-file.entry.js +2 -2
- package/dist/esm/wm-flyout.entry.js +3 -3
- package/dist/esm/wm-input.entry.js +3 -3
- package/dist/esm/wm-line-chart.entry.js +3 -3
- package/dist/esm/wm-modal-pss_3.entry.js +6 -6
- package/dist/esm/wm-modal_3.entry.js +8 -10
- package/dist/esm/wm-navigation_3.entry.js +6 -6
- package/dist/esm/wm-navigator.entry.js +2 -2
- package/dist/esm/wm-nested-select.entry.js +5 -5
- package/dist/esm/wm-optgroup.entry.js +2 -2
- package/dist/esm/wm-option_2.entry.js +49 -38
- package/dist/esm/wm-pagination.entry.js +4 -4
- package/dist/esm/wm-progress-indicator_3.entry.js +2 -2
- package/dist/esm/wm-search.entry.js +5 -5
- package/dist/esm/wm-snackbar.entry.js +5 -5
- package/dist/esm/wm-tab-item_3.entry.js +8 -8
- package/dist/esm/wm-tag-input.entry.js +4 -4
- package/dist/esm/wm-tag-option.entry.js +1 -1
- package/dist/esm/wm-textarea.entry.js +3 -3
- package/dist/esm/wm-timepicker.entry.js +3 -3
- package/dist/esm/wm-toggletip.entry.js +4 -4
- package/dist/esm/wm-uploader.entry.js +5 -5
- package/dist/esm-es5/app-globals-47a9cf9f.js +1 -0
- package/dist/esm-es5/{chartFunctions-9c95674d.js → chartFunctions-93592f14.js} +1 -1
- package/dist/esm-es5/{functions-2cfbd8c7.js → functions-c1d5f184.js} +1 -1
- package/dist/esm-es5/interfaces-7e50d034.js +1 -0
- package/dist/esm-es5/{intl-23d21b06.js → intl-8c69d10b.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-old.entry.js +1 -1
- package/dist/esm-es5/priv-chart-popover_2.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-bar.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-flyout.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/ripple/{p-5f50c561.system.entry.js → p-0356e736.system.entry.js} +1 -1
- package/dist/ripple/{p-0abc1b51.system.entry.js → p-086da1c5.system.entry.js} +1 -1
- package/dist/ripple/{p-b939d3cb.system.entry.js → p-0886099f.system.entry.js} +1 -1
- package/dist/ripple/{p-5cbbaf69.system.entry.js → p-08ba2a77.system.entry.js} +1 -1
- package/dist/ripple/{p-d49676b7.system.entry.js → p-0e418fe4.system.entry.js} +1 -1
- package/dist/ripple/{p-15ab0cf9.system.entry.js → p-0efafbd8.system.entry.js} +1 -1
- package/dist/ripple/{p-62cdc8c6.system.entry.js → p-154af337.system.entry.js} +1 -1
- package/dist/ripple/{p-909f8797.entry.js → p-1641d37f.entry.js} +1 -1
- package/dist/ripple/{p-9dc0fcd6.system.entry.js → p-17f3fa47.system.entry.js} +1 -1
- package/dist/ripple/p-227d5b55.entry.js +1 -0
- package/dist/ripple/{p-0ef91339.entry.js → p-23f08f5a.entry.js} +1 -1
- package/dist/ripple/{p-b3092643.entry.js → p-24598e3e.entry.js} +1 -1
- package/dist/ripple/{p-8c20ccd2.entry.js → p-24ce5997.entry.js} +1 -1
- package/dist/ripple/{p-b089276a.entry.js → p-25043b32.entry.js} +1 -1
- package/dist/ripple/{p-10f93b97.system.entry.js → p-262d5bd5.system.entry.js} +1 -1
- package/dist/ripple/{p-8888e7f0.system.entry.js → p-275386c1.system.entry.js} +1 -1
- package/dist/ripple/{p-60aa6bec.system.entry.js → p-2d042b40.system.entry.js} +1 -1
- package/dist/ripple/{p-1802aedc.system.entry.js → p-2d5bd606.system.entry.js} +1 -1
- package/dist/ripple/{p-79ec0bb2.entry.js → p-3410da36.entry.js} +1 -1
- package/dist/ripple/p-3436e819.entry.js +1 -0
- package/dist/ripple/{p-6d375c14.system.entry.js → p-35dfeacb.system.entry.js} +1 -1
- package/dist/ripple/{p-cf845266.entry.js → p-367df770.entry.js} +1 -1
- package/dist/ripple/{p-ad8132aa.entry.js → p-3b2e7166.entry.js} +1 -1
- package/dist/ripple/p-3c7207e0.js +1 -0
- package/dist/ripple/{p-d522499c.entry.js → p-3de0e2b0.entry.js} +1 -1
- package/dist/ripple/{p-575f24e8.system.entry.js → p-46c77ecb.system.entry.js} +1 -1
- package/dist/ripple/{p-3e10eb3d.entry.js → p-48950aef.entry.js} +1 -1
- package/dist/ripple/{p-8d858325.system.entry.js → p-4934d53f.system.entry.js} +1 -1
- package/dist/ripple/{p-d6ca433c.entry.js → p-49b75a61.entry.js} +1 -1
- package/dist/ripple/{p-78edd963.entry.js → p-4b813987.entry.js} +1 -1
- package/dist/ripple/p-4e3a8545.system.js +1 -0
- package/dist/ripple/{p-1124978e.system.entry.js → p-55cdf672.system.entry.js} +1 -1
- package/dist/ripple/p-625d4010.entry.js +1 -0
- package/dist/ripple/{p-377cf709.entry.js → p-6434eacf.entry.js} +1 -1
- package/dist/ripple/{p-9246f0dc.js → p-6a2fb1a1.js} +1 -1
- package/dist/ripple/{p-79b3dfc8.entry.js → p-724fbe77.entry.js} +1 -1
- package/dist/ripple/{p-0b2a0825.system.entry.js → p-74b5624a.system.entry.js} +1 -1
- package/dist/ripple/p-75816848.system.js +1 -0
- package/dist/ripple/{p-bc271e17.system.entry.js → p-7c103a48.system.entry.js} +1 -1
- package/dist/ripple/{p-35ef7bba.entry.js → p-7f4a409e.entry.js} +1 -1
- package/dist/ripple/{p-bc052b23.entry.js → p-86f5e918.entry.js} +1 -1
- package/dist/ripple/p-8a4d79dc.system.entry.js +1 -0
- package/dist/ripple/p-8ac14bb1.system.js +1 -0
- package/dist/ripple/{p-f6d60ed8.system.entry.js → p-90f0283c.system.entry.js} +1 -1
- package/dist/ripple/{p-01e8cea6.entry.js → p-94842057.entry.js} +1 -1
- package/dist/ripple/{p-78524594.entry.js → p-986d1792.entry.js} +1 -1
- package/dist/ripple/{p-966f2c9e.entry.js → p-9bcdb6ae.entry.js} +1 -1
- package/dist/ripple/{p-b313c3d3.system.entry.js → p-a289d92b.system.entry.js} +1 -1
- package/dist/ripple/{p-c8c8e85f.system.js → p-a402c6bb.system.js} +1 -1
- package/dist/ripple/{p-21114d99.entry.js → p-aecb621d.entry.js} +1 -1
- package/dist/ripple/{p-34574dc8.system.entry.js → p-af9e6028.system.entry.js} +1 -1
- package/dist/ripple/p-b1afda53.entry.js +1 -0
- package/dist/ripple/p-b37fbb7e.entry.js +1 -0
- package/dist/ripple/{p-d62f5fd3.entry.js → p-b589b0da.entry.js} +1 -1
- package/dist/ripple/{p-576f4d06.system.entry.js → p-bfe3c687.system.entry.js} +1 -1
- package/dist/ripple/{p-2e71fe42.entry.js → p-c04fad73.entry.js} +1 -1
- package/dist/ripple/{p-f2a1f116.entry.js → p-c3ba7789.entry.js} +1 -1
- package/dist/ripple/{p-26d92a96.system.entry.js → p-c5030fa3.system.entry.js} +1 -1
- package/dist/ripple/{p-cab65a05.system.entry.js → p-c97b06b5.system.entry.js} +1 -1
- package/dist/ripple/{p-d13b78fd.system.entry.js → p-cd5aa832.system.entry.js} +1 -1
- package/dist/ripple/p-cda66d45.js +1 -0
- package/dist/ripple/{p-a0c4a12e.entry.js → p-d002e65f.entry.js} +1 -1
- package/dist/ripple/{p-fda4032a.system.entry.js → p-d4051c50.system.entry.js} +1 -1
- package/dist/ripple/{p-6394d25d.entry.js → p-d9d16c9d.entry.js} +1 -1
- package/dist/ripple/{p-bf83369d.system.entry.js → p-da88bdfa.system.entry.js} +1 -1
- package/dist/ripple/{p-0ad87064.system.entry.js → p-defdef0c.system.entry.js} +1 -1
- package/dist/ripple/{p-21480984.entry.js → p-e70f1e74.entry.js} +1 -1
- package/dist/ripple/p-eee663f4.system.entry.js +1 -0
- package/dist/ripple/{p-325393da.js → p-f031ced7.js} +1 -1
- package/dist/ripple/{p-685863a1.system.entry.js → p-f2b09954.system.entry.js} +1 -1
- package/dist/ripple/{p-c8d6b61a.system.js → p-f503991a.system.js} +1 -1
- package/dist/ripple/{p-7e0efb95.entry.js → p-f6844f41.entry.js} +1 -1
- package/dist/ripple/{p-2f925b25.system.entry.js → p-f7742db8.system.entry.js} +1 -1
- package/dist/ripple/{p-32f95573.system.entry.js → p-f91c86d2.system.entry.js} +1 -1
- package/dist/ripple/{p-51cd1c0f.entry.js → p-fc67950d.entry.js} +1 -1
- package/dist/ripple/{p-d4877cbc.system.entry.js → p-fce3ce5c.system.entry.js} +1 -1
- package/dist/ripple/{p-1c9c0cf2.system.entry.js → p-fe49bfb7.system.entry.js} +1 -1
- package/dist/ripple/{p-56d17ec6.js → p-fe625125.js} +1 -1
- package/dist/ripple/{p-84d88288.entry.js → p-ff25bdd6.entry.js} +1 -1
- package/dist/ripple/p-ff911a16.system.js +1 -0
- package/dist/ripple/p-ffa6f621.entry.js +1 -0
- package/dist/ripple/ripple.esm.js +1 -1
- package/dist/ripple/ripple.js +1 -1
- package/dist/types/components/charts/chartFunctions.d.ts +1 -0
- package/dist/types/components/charts/priv-chart-popover/priv-chart-popover.d.ts +1 -1
- package/dist/types/components/charts/wm-chart-bar/wm-chart-bar.d.ts +8 -16
- package/dist/types/components/datepickers/priv-calendar/priv-calendar.d.ts +5 -1
- package/dist/types/components/selects/wm-select/wm-select.d.ts +3 -2
- package/dist/types/components.d.ts +2 -2
- package/dist/types/global/interfaces.d.ts +13 -5
- package/package.json +3 -3
- package/dist/esm-es5/app-globals-2d0df1cb.js +0 -1
- package/dist/esm-es5/interfaces-30d10bc0.js +0 -1
- package/dist/ripple/p-0d03f838.js +0 -1
- package/dist/ripple/p-1430f504.entry.js +0 -1
- package/dist/ripple/p-157468c5.entry.js +0 -1
- package/dist/ripple/p-1eae5841.entry.js +0 -1
- package/dist/ripple/p-30a65553.system.js +0 -1
- package/dist/ripple/p-3989274d.system.entry.js +0 -1
- package/dist/ripple/p-6646191c.entry.js +0 -1
- package/dist/ripple/p-7ee3f5ab.system.entry.js +0 -1
- package/dist/ripple/p-874cc540.system.js +0 -1
- package/dist/ripple/p-8aee3856.system.js +0 -1
- package/dist/ripple/p-b4ce79cd.entry.js +0 -1
- package/dist/ripple/p-c4e4a44c.entry.js +0 -1
- package/dist/ripple/p-d6effc35.system.js +0 -1
- package/dist/ripple/p-f210f4ff.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./index-130e07bb.js";var version="5.23.0-alpha.11";if(window.navigator.plugins.length>0){console.log("%cRipple component library %c%s","color: #575195; font-weight: bold","font-weight: bold",version)}function wmComponentKeys(o){if(o.key=="Tab"){var n=new Event("wmUserIsTabbing");window.dispatchEvent(n);document.querySelector("body").classList.add("wmcl-user-is-tabbing")}if(o.key=="ArrowLeft"||o.key=="ArrowUp"||o.key=="ArrowRight"||o.key=="ArrowDown"){var n=new Event("wmUserIsKeying");window.dispatchEvent(n);document.querySelector("body").classList.add("wmcl-user-is-keying")}}function wmComponentMouseDownOnce(){var o=new Event("wmUserIsNotTabbing");window.dispatchEvent(o);document.querySelector("body").classList.remove("wmcl-user-is-tabbing");document.querySelector("body").classList.remove("wmcl-user-is-keying")}window.addEventListener("keydown",wmComponentKeys);window.addEventListener("mousedown",wmComponentMouseDownOnce);var tooltipContainer=document.createElement("div");tooltipContainer.id="wm-tooltip-container";var tooltipEl=document.createElement("div");tooltipEl.id="wm-tooltip";tooltipEl.classList.add("wm-tooltip");tooltipEl.setAttribute("popover","manual");tooltipEl.setAttribute("aria-hidden","true");var tooltipStyles=document.createElement("style");tooltipStyles.textContent="\n.wm-tooltip {\n position: fixed;\n overflow: hidden;\n pointer-events: none;\n line-height: normal;\n font-family: inherit;\n font-size: 0.875rem;\n text-transform: none;\n font-weight: normal;\n background: var(--wmcolor-tooltip-background);\n color: var(--wmcolor-tooltip-text);\n z-index: 999999;\n max-width: var(--wmTooltipMaxWidth, 13.75rem);\n margin-right: 1.5rem;\n padding: 0.375rem;\n transition-property: opacity;\n transition-delay: 0s;\n opacity: 0;\n inset: unset;\n top: 0;\n left: 0;\n transform: translateZ(0);\n will-change: transform;\n transform: translate(var(--wmTooltipLeft), var(--wmTooltipTop));\n border: none;\n}\n\n.wm-tooltip:popover-open {\n opacity: 0;\n}\n\n.wm-tooltip.show {\n transition-delay: 500ms;\n opacity: 1;\n}\n";var body=document.querySelector("body");if(body){document.head.appendChild(tooltipStyles);tooltipContainer.appendChild(tooltipEl);body.appendChild(tooltipContainer)}else{document.addEventListener("DOMContentLoaded",(function(){var o=document.querySelector("body");document.head.appendChild(tooltipStyles);tooltipContainer.appendChild(tooltipEl);o.appendChild(tooltipContainer)}))}var globalFn=function(){};var globalScripts=globalFn;export{globalScripts as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,r,n){function a(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function o(e){try{u(n["throw"](e))}catch(e){i(e)}}function u(e){e.done?r(e.value):a(e.value).then(s,o)}u((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,a,i,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(e){return function(t){return u([e,t])}}function u(o){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,o[0]&&(r=0)),r)try{if(n=1,a&&(i=o[0]&2?a["return"]:o[0]?a["throw"]||((i=a["return"])&&i.call(a),0):a.next)&&!(i=i.call(a,o[1])).done)return i;if(a=0,i)o=[o[0]&2,i.value];switch(o[0]){case 0:case 1:i=o;break;case 4:r.label++;return{value:o[1],done:false};case 5:r.label++;a=o[1];o=[0];continue;case 7:o=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){r=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){r.label=o[1];break}if(o[0]===6&&r.label<i[1]){r.label=i[1];i=o;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(o);break}if(i[2])r.ops.pop();r.trys.pop();continue}o=t.call(e,r)}catch(e){o=[6,e];a=0}finally{n=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,a=t.length,i;n<a;n++){if(i||!(n in t)){if(!i)i=Array.prototype.slice.call(t,0,n);i[n]=t[n]}}return e.concat(i||Array.prototype.slice.call(t))};import{h}from"./index-130e07bb.js";import{i as intl,c as checkForActiveElInShadow,e as safeMultiplyFloat,f as getPosition}from"./functions-2cfbd8c7.js";var colors={salmon:"#ff5f4e",cyan:"#19a1a9",forest:"#088000",sleet:"#7f97ad",midnight:"#2e1b46",lavender:"#8b86ca",periwinkle:"#575195",gray:"#6b6b6b"};var allChartsDetails={doughnut:{size:155,colors:[colors.forest,colors.gray],thickness:.73,padding:25,category:"doughnut"},doughnut1:{size:130,colors:[colors.lavender,colors.midnight,colors.gray],thickness:.5,padding:90,category:"doughnut"},doughnut2:{size:130,colors:[colors.periwinkle,colors.cyan,colors.midnight,colors.salmon,colors.gray],thickness:.5,padding:90,category:"doughnut"},doughnut3:{size:130,colors:[colors.lavender,colors.midnight,"#0089e4",colors.forest,"#ea8500","#d54f41","#146ca9"],thickness:.5,padding:90,category:"doughnut"},bar:{size:350,colors:[colors.forest,colors.gray],padding:0,category:"stackedBar"},bar2:{size:400,colors:[colors.gray,colors.lavender,colors.periwinkle,colors.midnight,colors.cyan,colors.salmon],padding:0,category:"stackedBar"},bar3:{size:300,colors:["#0d696e",colors.cyan,"#8e4129",colors.salmon],padding:0,category:"stackedBar"},bar4:{size:400,colors:[colors.salmon,colors.cyan,colors.periwinkle],padding:0,category:"stackedBar"},bar5:{size:400,colors:[colors.gray,colors.lavender,colors.midnight,"#0089e4",colors.forest,"#ea8500","#d54f41","#146ca9"],padding:0,category:"stackedBar"},bar6:{size:400,colors:[colors.lavender],padding:0,category:"simpleBar"},bar7:{size:400,colors:[colors.periwinkle,colors.cyan,colors.salmon,colors.gray],padding:0,category:"simpleBar"}};function showValue(e){return e==="percentage"||e==="amount"?"show-values":""}var textHiddenMessage=intl.formatMessage({id:"chart.hiddenValues",defaultMessage:"Values are hidden when too close together.",description:"Text displayed when a chart has some values hidden"});var seeDetailsMessage=intl.formatMessage({id:"chart.clickToSeeDetails",defaultMessage:"Click or use arrow keys to see details.",description:"Text displayed, guiding user to interact to see more details."});function abbrNumber(e){return e>999||e<-999?Math.round(e/100)/10+"K":e}function amountToPercent(e,t,r){return r?Math.round(e*100/t):Math.round(e*1e4/t)/100}function amountToDegree(e,t){return e*360/t}function toFixed(e){return parseFloat((Math.floor(e*100)/100).toFixed(2))}function polarToCartesian(e,t,r,n){var a=toFixed(e+e*t*Math.cos(Math.PI*r/180));var i=toFixed(e+e*t*Math.sin(Math.PI*r/180));if(n!==undefined){var s=toFixed(e+e*t*Math.cos(Math.PI*n/180));var o=toFixed(e+e*t*Math.sin(Math.PI*n/180));return{x1:a,y1:i,x2:s,y2:o}}return{x:a,y:i}}function getArc(e,t,r,n,a){var i=toFixed(a/2*e);return"A ".concat(i,", ").concat(i," 0 ").concat(t," ").concat(toFixed(r),", ").concat(toFixed(n))}function scale(e,t,r,n,a){var i=(e-t)*(a-n)/(r-t)+n;return i<n?n:i>a?a:i}function minSpacing(e){return scale(e,300,900,70,150)}function getMaxTicks(e){return Math.round(e/minSpacing(e))}function getInterval(e,t){var r=e/t;var n=Math.pow(10,Math.floor(Math.log10(r)));var a=r/n;var i;if(a>5){i=10*n}else if(a>3){i=5*n}else if(a>2){i=3*n}else if(a>1.5){i=2*n}else if(a>1){i=1.5*n}else{i=n}return i}function handleSliceKeyDown(e){if(this.popoverEl&&this.popoverEl.open&&e.key==="Enter"){var t=this.popoverEl.querySelector("button");t&&t.click()}}function handleSliceClick(e,t){if(this.popoverEl&&!this.isTabbing){t.coords={x:e.clientX,y:e.clientY};openPopover(this.popoverEl,t);highlightSegmentInfo(Array.from(this.el.shadowRoot.querySelectorAll("[data-segmentindex")),t)}}function handleSliceFocus(e,t){if(this.popoverEl&&this.isTabbing){this.focusedSliceId=t.id;t.coords=getPosition(e.target);t.coords.x=t.coords.x+30;t.coords.y=t.coords.y+30;openPopover(this.popoverEl,t);highlightSegmentInfo(Array.from(this.el.shadowRoot.querySelectorAll("[data-segmentindex")),t)}}function handleChartKeydown(e){switch(e.key){case"ArrowUp":case"ArrowLeft":e.preventDefault();this.isTabbing=true;focusPrevious.call(this);break;case"ArrowRight":case"ArrowDown":e.preventDefault();this.isTabbing=true;focusNext.call(this);break;case"Tab":exitChart.call(this);break;case"Escape":this.popoverEl.open=false;this.userIsNavigating=false;break}}function openPopover(e,t){e.open=false;if(t.title&&t.text){e.sliceDetails=Object.assign({},t);window.setTimeout((function(){return e.open=true}),30)}}function focusNext(){var e=checkForActiveElInShadow(document.activeElement);var t=(this.sliceEls.indexOf(e)+1)%this.sliceEls.length;focusSlice.call(this,t)}function focusPrevious(){if(this.sliceEls){var e=checkForActiveElInShadow(document.activeElement);var t=this.sliceEls.indexOf(e);if(t===-1){t=0}else if(t===0){t=this.sliceEls.length-1}else{t-=1}focusSlice.call(this,t)}}function focusSlice(e){var t=this;if(this.sliceEls&&this.el){this.userIsNavigating=true;this.componentWrapperEl.tabIndex=-1;this.el.focusable=false;this.sliceEls.map((function(e){e.tabIndex=-1;e.focusable=false}));this.sliceEls[e].tabIndex=0;this.sliceEls[e].focusable=true;this.sliceEls[e].focus();this.focusedSliceId=this.sliceEls[e].id;window.setTimeout((function(){if(t.popoverEl){t.popoverEl.open=true}}),10)}}function exitChart(){var e=this;this.focusedSliceId=undefined;this.sliceEls&&this.sliceEls.map((function(e){e.tabIndex=-1;e.focusable=false}));this.userIsNavigating=false;window.setTimeout((function(){e.componentWrapperEl.tabIndex=0;e.el.focusable=true;if(e.popoverEl){e.popoverEl.open=false}}),100)}function getDetails(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,a;var i=this;return __generator(this,(function(s){this.slicesDetails=[];t=0;r=Array.from(this.el.children);this.total=r.reduce((function(e,t){var r=parseInt(t.getAttribute("amount")||"0");return e+r}),0);n=__spreadArray([],allChartsDetails[e].colors,true);if(this.chartType==="bar2"){if(r.length<=5){n.splice(1,1)}if(r.length<=4){n.splice(2,1)}}if(e==="bar3"&&r.length===2){n=[n[1],n[3]]}if(e==="doughnut2"&&r.length<5){n.splice(2,1);if(r.length<4){n.shift()}}if(e==="bar5"&&!this.notStartedColor){n.shift()}a=0;r.forEach((function(r,s){var o=r.getAttribute("amount");if(o==null)return;var u=parseInt(o||"0");var c=amountToPercent(u,i.total,true);var l=s;if(e==="bar6"){l=0}var h={amount:u,visualAmount:u,perc:c,legend:r.getAttribute("legend"),color:n[l]||colors.gray,offset:t,id:"".concat(i.uid,"-").concat(a+1),title:r.getAttribute("popover-title"),text:r.getAttribute("popover-text"),buttonText:r.getAttribute("popover-button-text"),sliceRef:r,inSmallCluster:false,index:a};t+=u;i.slicesDetails.push(h);a++}));return[2]}))}))}function sortSlicesDetails(e,t){var r=__spreadArray([],e,true).sort((function(e,t){return e.amount===t.amount?0:e.amount>t.amount?-1:1}));var n=0;r.filter((function(e){return e.amount>0})).forEach((function(e,a){var i=r[a===0?r.length-1:a-1];var s=r[a===r.length-1?0:a+1];var o=amountToPercent(i.amount,t,true);var u=amountToPercent(s.amount,t,true);var c=e.perc===0?8:5;var l=e.perc<4;var h=o<c;var d=u<c;var f=l&&(h||d);e.inSmallCluster=f;e.offset=n;n+=e.amount}));return r}function getPathData(e,t,r){var n=amountToDegree(t,this.total)-90;var a=e/this.total*360;var i=n+a;var s=a>180?"1 1":"0 1";var o=a>180?"1 0":"0 0";var u=this.chartDetails.size/2;var c=this.chartDetails.thickness;var l=1;var h=r==="doughnut";var d=1.5;var f=h?2.25:3;if(a===360){i-=.01}var v=polarToCartesian(u,l,n+d,i);var g=polarToCartesian(u,c,n+f,i);var p="M ".concat(v.x1,", ").concat(v.y1," ");var m=getArc(l,s,v.x2,v.y2,this.chartDetails.size);var b=" L ".concat(g.x2,", ").concat(g.y2," ");var x=getArc(c,o,g.x1,g.y1,this.chartDetails.size);return p+m+b+x+" z"}function renderInstructionsText(){var e=intl.formatMessage({id:"chart.instructions",defaultMessage:"Use arrow keys to browse elements, press Tab to exit.",description:"For screen readers only, instructions on how to interact with the chart component"});return h("div",{id:"chart-instructions"},e)}function renderFilter(){return h("defs",null,h("filter",{id:"wmHoverDropShadow"},h("feGaussianBlur",{stdDeviation:"3"}),h("feOffset",{result:"offsetblur"}),h("feFlood",{"flood-color":"#333"}),h("feComposite",{operator:"in",in2:"offsetblur"}),h("feMerge",null,h("feMergeNode",null),h("feMergeNode",{in:"SourceGraphic"}))))}function applyMinimumAngle(e,t,r){var n=t.map((function(e){return amountToDegree(e.amount,r)}));var a=n.some((function(t){return t!==0&&t<e}));if(a){var i=n.map((function(t){return t==0?t:Math.max(t,e)}));var s=i.reduce((function(t,r){return t+(r>e&&r!==0?r:0)}),0);var o=i.reduce((function(t,r){return t+(r>e&&r!==0?0:r)}),0);var u=360-o;var c=s-u;var l=c/u;var h=i.map((function(t){return t>e?t-l*t:t==0?0:e}));var d=0;t=t.map((function(e,t){var n=h[t]/360*r;var a=d;d+=n;return Object.assign(Object.assign({},e),{visualAmount:n,offset:a})}))}return t}function renderDoughnut(e){var t=this;var r=this.chartDetails.size+this.chartDetails.padding;var n=e==="doughnut";var a=n?this.slicesDetails:sortSlicesDetails(this.slicesDetails,this.total);a=applyMinimumAngle(7,a,this.total);var i=a[0].amount;var s=amountToPercent(i,this.total,true);if(s===0&&i>0){s="<1%"}else if(s===100&&i<this.total){s=">99%"}else{s=s+"%"}return h("div",{class:"chart-wrapper doughnut-wrapper"},h("svg",{width:r+"px",height:r+"px",id:"graphic-".concat(this.uid),class:"doughnut-svg"},renderFilter(),a.map((function(r){return renderPath.call(t,r,e)})),renderFocusOutline.call(this),n?h("text",{class:"value",x:"50%",y:"50%","font-size":"1.5rem","font-weight":"500","text-anchor":"middle","dominant-baseline":"middle"},s):h("g",{transform:"translate(".concat(this.chartDetails.padding/2,", ").concat(this.chartDetails.padding/2,")"),"text-anchor":"middle","dominant-baseline":"middle"},a.map((function(e){return e.amount>0&&!e.inSmallCluster?renderDoughnutText.call(t,e):""})))))}function highlightSegmentInfo(e,t){e.forEach((function(e){if(e.dataset.segmentindex&&parseInt(e.dataset.segmentindex)!==t.index){e.classList.add("faded")}else{e.classList.remove("faded")}}))}function removeSegmentInfoHighlight(e){e.forEach((function(e){e.classList.remove("faded")}))}function renderPath(e,t){var r=this;var n=amountToPercent(e.amount,this.total,true)+"%";return!isNaN(e.amount)&&h("g",{transform:"translate(".concat(this.chartDetails.padding/2,", ").concat(this.chartDetails.padding/2,")")},h("path",{id:e.id,class:"segment doughnut-segment",fill:e.visualAmount?e.color:"transparent",d:getPathData.call(this,e.visualAmount,e.offset,t),onClick:function(t){return handleSliceClick.call(r,t,e)},onFocus:function(t){return handleSliceFocus.call(r,t,e)},onKeyDown:function(e){return handleSliceKeyDown.call(r,e)},role:"img","aria-label":"".concat(e.legend,", ").concat(n),"data-segmentindex":e.index}))}function renderFocusOutline(){return this.isTabbing?h("g",{transform:"translate(".concat(this.chartDetails.padding/2,", ").concat(this.chartDetails.padding/2,")")},h("use",{tabindex:-1,id:"kfbg1",xlinkHref:"#".concat(this.focusedSliceId)}),h("use",{tabindex:-1,id:"kfstroke",xlinkHref:"#".concat(this.focusedSliceId)}),h("use",{tabindex:-1,id:"kfbg2",xlinkHref:"#".concat(this.focusedSliceId)})):""}function renderDoughnutText(e){var t=amountToDegree(e.offset+e.visualAmount/2,this.total);var r=polarToCartesian(this.chartDetails.size/2,1.4,t-90),n=r.x,a=r.y;var i;if(e.perc===0&&e.amount>0){i="<1%"}else if(e.perc===100&&e.amount<this.total){i=">99%"}else{i=e.perc+"%"}return h("text",{class:"value",x:n+"px",y:a+"px","data-segmentindex":e.index},i)}function renderStackedBar(e){var t=this;var r=e==="bar";var n=this.el.shadowRoot.querySelectorAll(".value");if(n.length>0){requestAnimationFrame((function(){var e=[];var r=4;var a=false;n.forEach((function(t){t.classList.remove("hidden");var n=parseInt(t.dataset.value);if(e.length>0&&n!=0){var i=t.getBoundingClientRect().left-r;e.forEach((function(e){var r=parseInt(e.dataset.value);var s=e.getBoundingClientRect().right>i;if(s){var o=n<r?t:e;o.classList.add("hidden");a=true}}))}if(!t.classList.contains("hidden")&&n>0){e.push(t)}}));(t.isBar||t.isDoughnut)&&t.showHiddenValuesMessage(a)}))}return h("div",{class:"chart-wrapper bar-wrapper"},r?h("div",{class:"single-perc"},amountToPercent(this.slicesDetails[0].amount,this.total,true)+"%"):"",this.chartType==="bar3"&&this.drawAxis(),h("div",{class:"inner-stacked-bar-wrapper ".concat(showValue(this.valueFormat))},!r?h("div",{class:"values ".concat(this.valueFormat)},this.slicesDetails.map((function(e){return t.renderBarText(e,5)}))):"",h("div",{class:"stacked-bar-segments-wrapper"},this.slicesDetails.map((function(e){return renderStackedBarSegment.call(t,e,5)}))),r?renderCompletionMessage.call(this):""),this.chartType==="bar3"?h("div",{class:"bar3-axis-label","aria-hidden":"true"},h("span",null,"0%"),h("span",null,"100%")):"")}function renderStackedBarSegment(e,t){var r=this;var n=amountToPercent(e.amount,this.total,false);var a=this.el.shadowRoot.querySelector(".stacked-bar-segments-wrapper");var i=a?a.offsetWidth:this.el.offsetWidth;var s=n/100*i>=t;var o=s||e.amount==0?"".concat(n,"%"):"".concat(t,"px");var u="";if(this.valueFormat=="percentage"){u="".concat(amountToPercent(e.amount,this.total,true)," %")}else if(this.valueFormat=="amount"){u=e.amount.toString()}return h("div",{class:"segment stacked-bar-segment ".concat(amountToPercent(e.amount,this.total,false)===0?"zero":""," ").concat(s?"":"fixed-width"),style:{backgroundColor:e.color,width:o},onClick:function(t){return handleSliceClick.call(r,t,e)},onFocus:function(t){return handleSliceFocus.call(r,t,e)},onKeyDown:function(e){return handleSliceKeyDown.call(r,e)},"data-segmentindex":e.index},h("span",{class:"sr-only"},"".concat(e.legend," ").concat(u)))}function renderSimpleBar(e){var t=this;var r=this.slicesDetails.map((function(e){return e.amount})).reduce((function(e,t){return e>t?e:t}));var n=parseInt(getComputedStyle(this.el).getPropertyValue("--labelWidth"),10);var a=48;var i=this.el.getBoundingClientRect().width;var s=i-n-a;var o=getMaxTicks(s);var u=getInterval(r,o);var c=o*u;var l=Math.floor((c-r)/u);o-=l;this.el.style.setProperty("--backgroundSize",100/o+"%");this.el.style.setProperty("--labelWidth",this.labelWidth);if(e==="bar7"&&!this.showBarLegend){this.el.style.setProperty("--labelWidth","0px")}var d=[];this.slicesDetails.forEach((function(n){n.legend&&d.push(renderSimpleBarLegend(n.legend,t.showBarLegend,e));d.push(renderSimpleBarItem.call(t,n,u,o,r))}));var f=[];for(var v=1;v<=o;v++){var g=abbrNumber(safeMultiplyFloat(v,u));f.push(h("div",{class:"tick"},h("span",null,g)))}var p=e==="bar6"&&this.showGrid&&this.el.getBoundingClientRect().width>300;return h("div",{class:"chart-wrapper simple-bar-wrapper"},h("div",{class:"chart ".concat(showValue(this.valueFormat))},p&&h("div",{class:"gridlines"}),h("div",{class:"rows"},d)),p&&h("div",{class:"x-axis","aria-hidden":"true"},h("div",{class:"zero"},h("span",null,"0")),f))}function renderSimpleBarLegend(e,t,r){var n=r==="bar7"&&!t?" hidden":"";return h("label",{class:"label".concat(n)},e)}function renderSimpleBarItem(e,t,r,n){var a=this;var i=this.currentChartType==="bar6"?t*r:n;var s=amountToPercent(e.amount,i,false);var o=s?s+"%":"1px";var u=abbrNumber(e.amount);var c=this.valueFormat==="amount"?u:"";if(this.currentChartType==="bar6"&&this.valueFormat==="percentage"){c=e.amount+"%"}else if(this.currentChartType==="bar7"&&this.valueFormat==="percentage"){c=(this.total===0?"0":amountToPercent(e.amount,this.total,true))+"%"}return h("div",{class:"bar segment",style:{backgroundColor:e.color,width:o},onClick:function(t){return handleSliceClick.call(a,t,e)},onFocus:function(t){return handleSliceFocus.call(a,t,e)},onKeyDown:function(e){return handleSliceKeyDown.call(a,e)},"data-segmentindex":e.index},h("div",{class:"value"},c))}function renderLegend(e){var t=this;if(this.showLegend){var r=this.slicesDetails.reduce((function(e,t){return e=t.inSmallCluster?true:e}),false);this.isDoughnut&&this.showHiddenValuesMessage(r);return h("div",{class:"legend-wrapper"},h("div",{class:"legend ".concat(e," ").concat(this.mode==="bar"?"--top":"--bottom"),"aria-hidden":"true"},this.slicesDetails.map((function(e){var r=t.printModeFormat=="amount"?"".concat(e.amount,"/").concat(t.total):"".concat(amountToPercent(e.amount,t.total,true),"%");if(!!e.amount||!!e.legend){return renderLegendItem.call(t,{key:e.legend,color:e.color},r,e)}}))),this.isDoughnut&&!this.printMode&&renderHiddenValuesMessage())}}function renderLegendItem(e,t,r){var n=this;if(t===void 0){t=""}if(r===void 0){r=null}var a=function(e){if(r){r.coords={x:e.clientX,y:e.clientY};openPopover(n.popoverEl,r);highlightSegmentInfo(Array.from(n.el.shadowRoot.querySelectorAll("[data-segmentindex")),r)}};return h("div",{class:"legend-item",onClick:function(e){return a(e)},"data-segmentindex":r?r.index:null},h("div",{class:"legend-color",style:{backgroundColor:e.color}}),h("div",{class:"legend-text"},e.key,t&&h("span",{class:"print-value ".concat(this.printMode?"force-visible":"")},": ",t)))}function renderCompletionMessage(){if(this.completionMessage){return h("div",{class:"completion-message"},this.completionMessage)}}function renderHiddenValuesMessage(){return h("div",{class:"hidden-values-warning hidden"},textHiddenMessage,h("br",null),seeDetailsMessage)}function formatDisplayValue(e,t,r){switch(r){case"amount":return e.toLocaleString();case"percentage":return"".concat(Math.round(e/t*100).toFixed(0),"%");default:case"none":return""}}function isNiceInterval(e,t){if(t===void 0){t=[1,1.5,2,2.5,3,5,10]}var r=Math.pow(10,Math.floor(Math.log10(e)));var n=e/r;var a=t.some((function(e){return Math.abs(n-e)<1e-4}));return a}function suffixNumber(e){if(e>=1e6)return"".concat((e/1e6).toFixed(e%1e6===0?0:1),"M");if(e>=1e3)return"".concat((e/1e3).toFixed(e%1e3===0?0:1),"K");return e.toString()}function findLargestNiceInterval(e,t){for(var r=e;r>=1;r--){var n=t/r;if(isNiceInterval(n)){return{numIntervals:r,interval:n}}}return{numIntervals:1,interval:t}}export{allChartsDetails as a,renderSimpleBar as b,renderStackedBar as c,renderDoughnut as d,renderInstructionsText as e,renderLegend as f,getDetails as g,handleChartKeydown as h,renderHiddenValuesMessage as i,exitChart as j,amountToPercent as k,renderCompletionMessage as l,renderLegendItem as m,formatDisplayValue as n,findLargestNiceInterval as o,getMaxTicks as p,abbrNumber as q,removeSegmentInfoHighlight as r,suffixNumber as s,getInterval as t};
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,r,n){function a(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function o(e){try{u(n["throw"](e))}catch(e){i(e)}}function u(e){e.done?r(e.value):a(e.value).then(s,o)}u((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,a,i,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(e){return function(t){return u([e,t])}}function u(o){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,o[0]&&(r=0)),r)try{if(n=1,a&&(i=o[0]&2?a["return"]:o[0]?a["throw"]||((i=a["return"])&&i.call(a),0):a.next)&&!(i=i.call(a,o[1])).done)return i;if(a=0,i)o=[o[0]&2,i.value];switch(o[0]){case 0:case 1:i=o;break;case 4:r.label++;return{value:o[1],done:false};case 5:r.label++;a=o[1];o=[0];continue;case 7:o=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){r=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){r.label=o[1];break}if(o[0]===6&&r.label<i[1]){r.label=i[1];i=o;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(o);break}if(i[2])r.ops.pop();r.trys.pop();continue}o=t.call(e,r)}catch(e){o=[6,e];a=0}finally{n=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,a=t.length,i;n<a;n++){if(i||!(n in t)){if(!i)i=Array.prototype.slice.call(t,0,n);i[n]=t[n]}}return e.concat(i||Array.prototype.slice.call(t))};import{h}from"./index-130e07bb.js";import{i as intl,c as checkForActiveElInShadow,e as safeMultiplyFloat,f as getPosition}from"./functions-c1d5f184.js";var colors={salmon:"#ff5f4e",cyan:"#19a1a9",forest:"#088000",sleet:"#7f97ad",midnight:"#2e1b46",lavender:"#8b86ca",periwinkle:"#575195",gray:"#6b6b6b"};var allChartsDetails={doughnut:{size:155,colors:[colors.forest,colors.gray],thickness:.73,padding:25,category:"doughnut"},doughnut1:{size:130,colors:[colors.lavender,colors.midnight,colors.gray],thickness:.5,padding:90,category:"doughnut"},doughnut2:{size:130,colors:[colors.periwinkle,colors.cyan,colors.midnight,colors.salmon,colors.gray],thickness:.5,padding:90,category:"doughnut"},doughnut3:{size:130,colors:[colors.lavender,colors.midnight,"#0089e4",colors.forest,"#ea8500","#d54f41","#146ca9"],thickness:.5,padding:90,category:"doughnut"},bar:{size:350,colors:[colors.forest,colors.gray],padding:0,category:"stackedBar"},bar2:{size:400,colors:[colors.gray,colors.lavender,colors.periwinkle,colors.midnight,colors.cyan,colors.salmon],padding:0,category:"stackedBar"},bar3:{size:300,colors:["#0d696e",colors.cyan,"#8e4129",colors.salmon],padding:0,category:"stackedBar"},bar4:{size:400,colors:[colors.salmon,colors.cyan,colors.periwinkle],padding:0,category:"stackedBar"},bar5:{size:400,colors:[colors.gray,colors.lavender,colors.midnight,"#0089e4",colors.forest,"#ea8500","#d54f41","#146ca9"],padding:0,category:"stackedBar"},bar6:{size:400,colors:[colors.lavender],padding:0,category:"simpleBar"},bar7:{size:400,colors:[colors.periwinkle,colors.cyan,colors.salmon,colors.gray],padding:0,category:"simpleBar"}};function showValue(e){return e==="percentage"||e==="amount"?"show-values":""}var textHiddenMessage=intl.formatMessage({id:"chart.hiddenValues",defaultMessage:"Values are hidden when too close together.",description:"Text displayed when a chart has some values hidden"});var seeDetailsMessage=intl.formatMessage({id:"chart.clickToSeeDetails",defaultMessage:"Click or use arrow keys to see details.",description:"Text displayed, guiding user to interact to see more details."});function abbrNumber(e){return e>999||e<-999?Math.round(e/100)/10+"K":e}function amountToPercent(e,t,r){return r?Math.round(e*100/t):Math.round(e*1e4/t)/100}function amountToDegree(e,t){return e*360/t}function toFixed(e){return parseFloat((Math.floor(e*100)/100).toFixed(2))}function polarToCartesian(e,t,r,n){var a=toFixed(e+e*t*Math.cos(Math.PI*r/180));var i=toFixed(e+e*t*Math.sin(Math.PI*r/180));if(n!==undefined){var s=toFixed(e+e*t*Math.cos(Math.PI*n/180));var o=toFixed(e+e*t*Math.sin(Math.PI*n/180));return{x1:a,y1:i,x2:s,y2:o}}return{x:a,y:i}}function getArc(e,t,r,n,a){var i=toFixed(a/2*e);return"A ".concat(i,", ").concat(i," 0 ").concat(t," ").concat(toFixed(r),", ").concat(toFixed(n))}function scale(e,t,r,n,a){var i=(e-t)*(a-n)/(r-t)+n;return i<n?n:i>a?a:i}function minSpacing(e){return scale(e,300,900,70,150)}function getMaxTicks(e){return Math.round(e/minSpacing(e))}function getInterval(e,t){var r=e/t;var n=Math.pow(10,Math.floor(Math.log10(r)));var a=r/n;var i;if(a>5){i=10*n}else if(a>3){i=5*n}else if(a>2){i=3*n}else if(a>1.5){i=2*n}else if(a>1){i=1.5*n}else{i=n}return i}function handleSliceKeyDown(e){if(this.popoverEl&&this.popoverEl.open&&e.key==="Enter"){var t=this.popoverEl.querySelector("button");t&&t.click()}}function handleSliceClick(e,t){if(this.popoverEl&&!this.isTabbing){t.coords={x:e.clientX,y:e.clientY};openPopover(this.popoverEl,t);highlightSegmentInfo(Array.from(this.el.shadowRoot.querySelectorAll("[data-segmentindex")),t)}}function handleSliceFocus(e,t){if(this.popoverEl&&this.isTabbing){this.focusedSliceId=t.id;t.coords=getPosition(e.target);t.coords.x=t.coords.x+30;t.coords.y=t.coords.y+30;openPopover(this.popoverEl,t);highlightSegmentInfo(Array.from(this.el.shadowRoot.querySelectorAll("[data-segmentindex")),t)}}function handleChartKeydown(e){switch(e.key){case"ArrowUp":case"ArrowLeft":e.preventDefault();this.isTabbing=true;focusPrevious.call(this);break;case"ArrowRight":case"ArrowDown":e.preventDefault();this.isTabbing=true;focusNext.call(this);break;case"Tab":exitChart.call(this);break;case"Escape":this.popoverEl.open=false;this.userIsNavigating=false;break}}function openPopover(e,t){e.open=false;if(t.title&&t.text){e.sliceDetails=Object.assign({},t);window.setTimeout((function(){return e.open=true}),30)}}function focusNext(){var e=checkForActiveElInShadow(document.activeElement);var t=(this.sliceEls.indexOf(e)+1)%this.sliceEls.length;focusSlice.call(this,t)}function focusPrevious(){if(this.sliceEls){var e=checkForActiveElInShadow(document.activeElement);var t=this.sliceEls.indexOf(e);if(t===-1){t=0}else if(t===0){t=this.sliceEls.length-1}else{t-=1}focusSlice.call(this,t)}}function focusSlice(e){var t=this;if(this.sliceEls&&this.el){this.userIsNavigating=true;this.componentWrapperEl.tabIndex=-1;this.el.focusable=false;this.sliceEls.map((function(e){e.tabIndex=-1;e.focusable=false}));this.sliceEls[e].tabIndex=0;this.sliceEls[e].focusable=true;this.sliceEls[e].focus();this.focusedSliceId=this.sliceEls[e].id;window.setTimeout((function(){if(t.popoverEl){t.popoverEl.open=true}}),10)}}function exitChart(){var e=this;this.focusedSliceId=undefined;this.sliceEls&&this.sliceEls.map((function(e){e.tabIndex=-1;e.focusable=false}));this.userIsNavigating=false;window.setTimeout((function(){e.componentWrapperEl.tabIndex=0;e.el.focusable=true;if(e.popoverEl){e.popoverEl.open=false}}),100)}function getDetails(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,a;var i=this;return __generator(this,(function(s){this.slicesDetails=[];t=0;r=Array.from(this.el.children);this.total=r.reduce((function(e,t){var r=parseInt(t.getAttribute("amount")||"0");return e+r}),0);n=__spreadArray([],allChartsDetails[e].colors,true);if(this.chartType==="bar2"){if(r.length<=5){n.splice(1,1)}if(r.length<=4){n.splice(2,1)}}if(e==="bar3"&&r.length===2){n=[n[1],n[3]]}if(e==="doughnut2"&&r.length<5){n.splice(2,1);if(r.length<4){n.shift()}}if(e==="bar5"&&!this.notStartedColor){n.shift()}a=0;r.forEach((function(r,s){var o=r.getAttribute("amount");if(o==null)return;var u=parseInt(o||"0");var c=amountToPercent(u,i.total,true);var l=s;if(e==="bar6"){l=0}var h={amount:u,visualAmount:u,perc:c,legend:r.getAttribute("legend"),color:n[l]||colors.gray,offset:t,id:"".concat(i.uid,"-").concat(a+1),title:r.getAttribute("popover-title"),text:r.getAttribute("popover-text"),buttonText:r.getAttribute("popover-button-text"),sliceRef:r,inSmallCluster:false,index:a};t+=u;i.slicesDetails.push(h);a++}));return[2]}))}))}function sortSlicesDetails(e,t){var r=__spreadArray([],e,true).sort((function(e,t){return e.amount===t.amount?0:e.amount>t.amount?-1:1}));var n=0;r.filter((function(e){return e.amount>0})).forEach((function(e,a){var i=r[a===0?r.length-1:a-1];var s=r[a===r.length-1?0:a+1];var o=amountToPercent(i.amount,t,true);var u=amountToPercent(s.amount,t,true);var c=e.perc===0?8:5;var l=e.perc<4;var h=o<c;var d=u<c;var f=l&&(h||d);e.inSmallCluster=f;e.offset=n;n+=e.amount}));return r}function getPathData(e,t,r){var n=amountToDegree(t,this.total)-90;var a=e/this.total*360;var i=n+a;var s=a>180?"1 1":"0 1";var o=a>180?"1 0":"0 0";var u=this.chartDetails.size/2;var c=this.chartDetails.thickness;var l=1;var h=r==="doughnut";var d=1.5;var f=h?2.25:3;if(a===360){i-=.01}var v=polarToCartesian(u,l,n+d,i);var g=polarToCartesian(u,c,n+f,i);var p="M ".concat(v.x1,", ").concat(v.y1," ");var m=getArc(l,s,v.x2,v.y2,this.chartDetails.size);var b=" L ".concat(g.x2,", ").concat(g.y2," ");var x=getArc(c,o,g.x1,g.y1,this.chartDetails.size);return p+m+b+x+" z"}function renderInstructionsText(){var e=intl.formatMessage({id:"chart.instructions",defaultMessage:"Use arrow keys to browse elements, press Tab to exit.",description:"For screen readers only, instructions on how to interact with the chart component"});return h("div",{id:"chart-instructions"},e)}function renderFilter(){return h("defs",null,h("filter",{id:"wmHoverDropShadow"},h("feGaussianBlur",{stdDeviation:"3"}),h("feOffset",{result:"offsetblur"}),h("feFlood",{"flood-color":"#333"}),h("feComposite",{operator:"in",in2:"offsetblur"}),h("feMerge",null,h("feMergeNode",null),h("feMergeNode",{in:"SourceGraphic"}))))}function applyMinimumAngle(e,t,r){var n=t.map((function(e){return amountToDegree(e.amount,r)}));var a=n.some((function(t){return t!==0&&t<e}));if(a){var i=n.map((function(t){return t==0?t:Math.max(t,e)}));var s=i.reduce((function(t,r){return t+(r>e&&r!==0?r:0)}),0);var o=i.reduce((function(t,r){return t+(r>e&&r!==0?0:r)}),0);var u=360-o;var c=s-u;var l=c/u;var h=i.map((function(t){return t>e?t-l*t:t==0?0:e}));var d=0;t=t.map((function(e,t){var n=h[t]/360*r;var a=d;d+=n;return Object.assign(Object.assign({},e),{visualAmount:n,offset:a})}))}return t}function renderDoughnut(e){var t=this;var r=this.chartDetails.size+this.chartDetails.padding;var n=e==="doughnut";var a=n?this.slicesDetails:sortSlicesDetails(this.slicesDetails,this.total);a=applyMinimumAngle(7,a,this.total);var i=a[0].amount;var s=amountToPercent(i,this.total,true);if(s===0&&i>0){s="<1%"}else if(s===100&&i<this.total){s=">99%"}else{s=s+"%"}return h("div",{class:"chart-wrapper doughnut-wrapper"},h("svg",{width:r+"px",height:r+"px",id:"graphic-".concat(this.uid),class:"doughnut-svg"},renderFilter(),a.map((function(r){return renderPath.call(t,r,e)})),renderFocusOutline.call(this),n?h("text",{class:"value",x:"50%",y:"50%","font-size":"1.5rem","font-weight":"500","text-anchor":"middle","dominant-baseline":"middle"},s):h("g",{transform:"translate(".concat(this.chartDetails.padding/2,", ").concat(this.chartDetails.padding/2,")"),"text-anchor":"middle","dominant-baseline":"middle"},a.map((function(e){return e.amount>0&&!e.inSmallCluster?renderDoughnutText.call(t,e):""})))))}function highlightSegmentInfo(e,t){e.forEach((function(e){if(e.dataset.segmentindex&&parseInt(e.dataset.segmentindex)!==t.index){e.classList.add("faded")}else{e.classList.remove("faded")}}))}function removeSegmentInfoHighlight(e){e.forEach((function(e){e.classList.remove("faded")}))}function renderPath(e,t){var r=this;var n=amountToPercent(e.amount,this.total,true)+"%";return!isNaN(e.amount)&&h("g",{transform:"translate(".concat(this.chartDetails.padding/2,", ").concat(this.chartDetails.padding/2,")")},h("path",{id:e.id,class:"segment doughnut-segment",fill:e.visualAmount?e.color:"transparent",d:getPathData.call(this,e.visualAmount,e.offset,t),onClick:function(t){return handleSliceClick.call(r,t,e)},onFocus:function(t){return handleSliceFocus.call(r,t,e)},onKeyDown:function(e){return handleSliceKeyDown.call(r,e)},role:"img","aria-label":"".concat(e.legend,", ").concat(n),"data-segmentindex":e.index}))}function renderFocusOutline(){return this.isTabbing?h("g",{transform:"translate(".concat(this.chartDetails.padding/2,", ").concat(this.chartDetails.padding/2,")")},h("use",{tabindex:-1,id:"kfbg1",xlinkHref:"#".concat(this.focusedSliceId)}),h("use",{tabindex:-1,id:"kfstroke",xlinkHref:"#".concat(this.focusedSliceId)}),h("use",{tabindex:-1,id:"kfbg2",xlinkHref:"#".concat(this.focusedSliceId)})):""}function renderDoughnutText(e){var t=amountToDegree(e.offset+e.visualAmount/2,this.total);var r=polarToCartesian(this.chartDetails.size/2,1.4,t-90),n=r.x,a=r.y;var i;if(e.perc===0&&e.amount>0){i="<1%"}else if(e.perc===100&&e.amount<this.total){i=">99%"}else{i=e.perc+"%"}return h("text",{class:"value",x:n+"px",y:a+"px","data-segmentindex":e.index},i)}function renderStackedBar(e){var t=this;var r=e==="bar";var n=this.el.shadowRoot.querySelectorAll(".value");if(n.length>0){requestAnimationFrame((function(){var e=[];var r=4;var a=false;n.forEach((function(t){t.classList.remove("hidden");var n=parseInt(t.dataset.value);if(e.length>0&&n!=0){var i=t.getBoundingClientRect().left-r;e.forEach((function(e){var r=parseInt(e.dataset.value);var s=e.getBoundingClientRect().right>i;if(s){var o=n<r?t:e;o.classList.add("hidden");a=true}}))}if(!t.classList.contains("hidden")&&n>0){e.push(t)}}));(t.isBar||t.isDoughnut)&&t.showHiddenValuesMessage(a)}))}return h("div",{class:"chart-wrapper bar-wrapper"},r?h("div",{class:"single-perc"},amountToPercent(this.slicesDetails[0].amount,this.total,true)+"%"):"",this.chartType==="bar3"&&this.drawAxis(),h("div",{class:"inner-stacked-bar-wrapper ".concat(showValue(this.valueFormat))},!r?h("div",{class:"values ".concat(this.valueFormat)},this.slicesDetails.map((function(e){return t.renderBarText(e,5)}))):"",h("div",{class:"stacked-bar-segments-wrapper"},this.slicesDetails.map((function(e){return renderStackedBarSegment.call(t,e,5)}))),r?renderCompletionMessage.call(this):""),this.chartType==="bar3"?h("div",{class:"bar3-axis-label","aria-hidden":"true"},h("span",null,"0%"),h("span",null,"100%")):"")}function renderStackedBarSegment(e,t){var r=this;var n=amountToPercent(e.amount,this.total,false);var a=this.el.shadowRoot.querySelector(".stacked-bar-segments-wrapper");var i=a?a.offsetWidth:this.el.offsetWidth;var s=n/100*i>=t;var o=s||e.amount==0?"".concat(n,"%"):"".concat(t,"px");var u="";if(this.valueFormat=="percentage"){u="".concat(amountToPercent(e.amount,this.total,true)," %")}else if(this.valueFormat=="amount"){u=e.amount.toString()}return h("div",{class:"segment stacked-bar-segment ".concat(amountToPercent(e.amount,this.total,false)===0?"zero":""," ").concat(s?"":"fixed-width"),style:{backgroundColor:e.color,width:o},onClick:function(t){return handleSliceClick.call(r,t,e)},onFocus:function(t){return handleSliceFocus.call(r,t,e)},onKeyDown:function(e){return handleSliceKeyDown.call(r,e)},"data-segmentindex":e.index},h("span",{class:"sr-only"},"".concat(e.legend," ").concat(u)))}function renderSimpleBar(e){var t=this;var r=this.slicesDetails.map((function(e){return e.amount})).reduce((function(e,t){return e>t?e:t}));var n=parseInt(getComputedStyle(this.el).getPropertyValue("--labelWidth"),10);var a=48;var i=this.el.getBoundingClientRect().width;var s=i-n-a;var o=getMaxTicks(s);var u=getInterval(r,o);var c=o*u;var l=Math.floor((c-r)/u);o-=l;this.el.style.setProperty("--backgroundSize",100/o+"%");this.el.style.setProperty("--labelWidth",this.labelWidth);if(e==="bar7"&&!this.showBarLegend){this.el.style.setProperty("--labelWidth","0px")}var d=[];this.slicesDetails.forEach((function(n){n.legend&&d.push(renderSimpleBarLegend(n.legend,t.showBarLegend,e));d.push(renderSimpleBarItem.call(t,n,u,o,r))}));var f=[];for(var v=1;v<=o;v++){var g=abbrNumber(safeMultiplyFloat(v,u));f.push(h("div",{class:"tick"},h("span",null,g)))}var p=e==="bar6"&&this.showGrid&&this.el.getBoundingClientRect().width>300;return h("div",{class:"chart-wrapper simple-bar-wrapper"},h("div",{class:"chart ".concat(showValue(this.valueFormat))},p&&h("div",{class:"gridlines"}),h("div",{class:"rows"},d)),p&&h("div",{class:"x-axis","aria-hidden":"true"},h("div",{class:"zero"},h("span",null,"0")),f))}function renderSimpleBarLegend(e,t,r){var n=r==="bar7"&&!t?" hidden":"";return h("label",{class:"label".concat(n)},e)}function renderSimpleBarItem(e,t,r,n){var a=this;var i=this.currentChartType==="bar6"?t*r:n;var s=amountToPercent(e.amount,i,false);var o=s?s+"%":"1px";var u=abbrNumber(e.amount);var c=this.valueFormat==="amount"?u:"";if(this.currentChartType==="bar6"&&this.valueFormat==="percentage"){c=e.amount+"%"}else if(this.currentChartType==="bar7"&&this.valueFormat==="percentage"){c=(this.total===0?"0":amountToPercent(e.amount,this.total,true))+"%"}return h("div",{class:"bar segment",style:{backgroundColor:e.color,width:o},onClick:function(t){return handleSliceClick.call(a,t,e)},onFocus:function(t){return handleSliceFocus.call(a,t,e)},onKeyDown:function(e){return handleSliceKeyDown.call(a,e)},"data-segmentindex":e.index},h("div",{class:"value"},c))}function renderLegend(e){var t=this;if(this.showLegend){var r=this.slicesDetails.reduce((function(e,t){return e=t.inSmallCluster?true:e}),false);this.isDoughnut&&this.showHiddenValuesMessage(r);return h("div",{class:"legend-wrapper"},h("div",{class:"legend ".concat(e," ").concat(this.mode==="bar"?"--top":"--bottom"),"aria-hidden":"true"},this.slicesDetails.map((function(e){var r=t.printModeFormat=="amount"?"".concat(e.amount,"/").concat(t.total):"".concat(amountToPercent(e.amount,t.total,true),"%");if(!!e.amount||!!e.legend){return renderLegendItem.call(t,{key:e.legend,color:e.color},r,e)}}))),this.isDoughnut&&!this.printMode&&renderHiddenValuesMessage())}}function renderLegendItem(e,t,r){var n=this;if(t===void 0){t=""}if(r===void 0){r=null}var a=function(e){if(r){r.coords={x:e.clientX,y:e.clientY};openPopover(n.popoverEl,r);highlightSegmentInfo(Array.from(n.el.shadowRoot.querySelectorAll("[data-segmentindex")),r)}};return h("div",{class:"legend-item",onClick:function(e){return a(e)},"data-segmentindex":r?r.index:null},h("div",{class:"legend-color",style:{backgroundColor:e.color}}),h("div",{class:"legend-text"},e.key,t&&h("span",{class:"print-value ".concat(this.printMode?"force-visible":"")},": ",t)))}function renderCompletionMessage(){if(this.completionMessage){return h("div",{class:"completion-message"},this.completionMessage)}}function renderHiddenValuesMessage(){return h("div",{class:"hidden-values-warning hidden"},textHiddenMessage,h("br",null),seeDetailsMessage)}function formatDisplayValue(e,t,r){switch(r){case"amount":return e.toLocaleString();case"percentage":return"".concat(Math.round(e/t*100).toFixed(0),"%");default:case"none":return""}}function isNiceInterval(e,t){if(t===void 0){t=[1,1.5,2,2.5,3,5,10]}var r=Math.pow(10,Math.floor(Math.log10(e)));var n=e/r;var a=t.some((function(e){return Math.abs(n-e)<1e-4}));return a}function suffixNumber(e){if(e>=1e6)return"".concat((e/1e6).toFixed(e%1e6===0?0:1),"M");if(e>=1e3)return"".concat((e/1e3).toFixed(e%1e3===0?0:1),"K");return e.toString()}function findLargestNiceInterval(e,t){for(var r=e;r>=1;r--){var n=t/r;if(isNiceInterval(n)){return{numIntervals:r,interval:n}}}return{numIntervals:1,interval:t}}function findNiceRoundNumber(e){if(e<=0)return 0;var t=[1,1.5,2,2.5,3,5,10];var r=Math.pow(10,Math.floor(Math.log10(e)));var n=e/r;for(var a=0,i=t;a<i.length;a++){var s=i[a];if(s>=n){return s*r}}return 10*r}export{allChartsDetails as a,renderSimpleBar as b,renderStackedBar as c,renderDoughnut as d,renderInstructionsText as e,renderLegend as f,getDetails as g,handleChartKeydown as h,renderHiddenValuesMessage as i,exitChart as j,amountToPercent as k,renderCompletionMessage as l,renderLegendItem as m,findNiceRoundNumber as n,formatDisplayValue as o,findLargestNiceInterval as p,getMaxTicks as q,removeSegmentInfoHighlight as r,suffixNumber as s,abbrNumber as t,getInterval as u};
|