@watermarkinsights/ripple 5.22.0-alpha.3 → 5.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{app-globals-99c2f8e9.js → app-globals-49be3826.js} +19 -17
- package/dist/cjs/{chartFunctions-d9aa9891.js → chartFunctions-60f65883.js} +1 -40
- package/dist/cjs/{functions-505d6601.js → functions-71af585d.js} +2 -6
- package/dist/cjs/index-788526f5.js +2 -10
- package/dist/cjs/{interfaces-069f135e.js → interfaces-85d78ae9.js} +0 -21
- package/dist/cjs/{intl-e7d7e719.js → intl-169a8805.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/priv-calendar.cjs.entry.js +3 -3
- package/dist/cjs/priv-chart-popover.cjs.entry.js +145 -0
- 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 +3 -3
- package/dist/cjs/wm-chart.cjs.entry.js +5 -5
- package/dist/cjs/wm-date-range.cjs.entry.js +6 -6
- package/dist/cjs/wm-datepicker.cjs.entry.js +6 -6
- 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 +5 -5
- package/dist/cjs/wm-modal-pss_3.cjs.entry.js +6 -6
- package/dist/cjs/wm-modal_3.cjs.entry.js +6 -6
- 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 +7 -7
- package/dist/cjs/wm-pagination.cjs.entry.js +3 -3
- package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +5 -5
- package/dist/cjs/wm-search.cjs.entry.js +4 -4
- package/dist/cjs/wm-snackbar.cjs.entry.js +4 -4
- package/dist/cjs/wm-tab-item_3.cjs.entry.js +7 -7
- 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 +4 -4
- package/dist/collection/collection-manifest.json +0 -3
- package/dist/collection/components/charts/chartFunctions.js +1 -36
- package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.css +9 -11
- package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.js +112 -190
- package/dist/collection/components/charts/wm-chart/wm-chart.js +2 -2
- package/dist/collection/components/charts/wm-line-chart/wm-line-chart.js +2 -2
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.js +2 -2
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.js +1 -1
- package/dist/collection/components/datepickers/priv-calendar/priv-calendar.js +2 -2
- package/dist/collection/components/datepickers/wm-date-range.js +5 -5
- package/dist/collection/components/datepickers/wm-datepicker.js +5 -5
- 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 +4 -4
- package/dist/collection/components/wm-action-menu/wm-action-menu.js +1 -1
- 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 +2 -2
- 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.js +1 -1
- package/dist/collection/components/wm-search/wm-search.js +2 -2
- package/dist/collection/components/wm-snackbar/wm-snackbar.js +2 -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.js +2 -2
- package/dist/collection/global/functions.js +2 -6
- package/dist/collection/global/global.js +18 -16
- package/dist/collection/global/interfaces.js +0 -19
- package/dist/esm/{app-globals-213e1dce.js → app-globals-fec6fcef.js} +19 -17
- package/dist/esm/{chartFunctions-f22160b5.js → chartFunctions-a834e2a9.js} +2 -37
- package/dist/esm/{functions-14aaf49d.js → functions-9df607f2.js} +2 -6
- package/dist/esm/index-130e07bb.js +2 -10
- package/dist/esm/{interfaces-16deca17.js → interfaces-cc5b177f.js} +1 -20
- package/dist/esm/{intl-7b5f8017.js → intl-86bec8ef.js} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/priv-calendar.entry.js +3 -3
- package/dist/esm/priv-chart-popover.entry.js +141 -0
- 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 +3 -3
- package/dist/esm/wm-chart.entry.js +5 -5
- package/dist/esm/wm-date-range.entry.js +6 -6
- package/dist/esm/wm-datepicker.entry.js +6 -6
- 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 +5 -5
- package/dist/esm/wm-modal-pss_3.entry.js +6 -6
- package/dist/esm/wm-modal_3.entry.js +6 -6
- 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 +7 -7
- package/dist/esm/wm-pagination.entry.js +3 -3
- package/dist/esm/wm-progress-indicator_3.entry.js +5 -5
- package/dist/esm/wm-search.entry.js +4 -4
- package/dist/esm/wm-snackbar.entry.js +4 -4
- package/dist/esm/wm-tab-item_3.entry.js +7 -7
- 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 +4 -4
- package/dist/esm-es5/app-globals-fec6fcef.js +1 -0
- package/dist/esm-es5/{chartFunctions-f22160b5.js → chartFunctions-a834e2a9.js} +1 -1
- package/dist/esm-es5/{functions-14aaf49d.js → functions-9df607f2.js} +1 -1
- package/dist/esm-es5/index-130e07bb.js +1 -1
- package/dist/esm-es5/interfaces-cc5b177f.js +1 -0
- package/dist/esm-es5/{intl-7b5f8017.js → intl-86bec8ef.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/priv-calendar.entry.js +1 -1
- package/dist/esm-es5/priv-chart-popover.entry.js +1 -0
- 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.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-135ecb41.system.entry.js → p-0267046a.system.entry.js} +1 -1
- package/dist/ripple/{p-72643f00.entry.js → p-04fe992d.entry.js} +1 -1
- package/dist/ripple/{p-984b3aa2.system.entry.js → p-0a95f175.system.entry.js} +1 -1
- package/dist/ripple/{p-220fa36a.js → p-0c1396e0.js} +1 -1
- package/dist/ripple/{p-91145304.system.entry.js → p-0e3015f2.system.entry.js} +1 -1
- package/dist/ripple/{p-94ec4e2c.entry.js → p-11ae67a9.entry.js} +1 -1
- package/dist/ripple/p-1db0bb59.system.js +1 -0
- package/dist/ripple/{p-37fbdcf9.system.entry.js → p-1dbd86bf.system.entry.js} +1 -1
- package/dist/ripple/{p-7781f941.entry.js → p-1e4b30ac.entry.js} +1 -1
- package/dist/ripple/{p-e50d77b9.entry.js → p-1f26fdb7.entry.js} +1 -1
- package/dist/ripple/{p-6e6a9598.entry.js → p-2451029c.entry.js} +1 -1
- package/dist/ripple/{p-8c378a26.system.entry.js → p-24d20fc6.system.entry.js} +1 -1
- package/dist/ripple/p-2732bddd.js +1 -0
- package/dist/ripple/{p-3d1098fb.system.entry.js → p-285dbfb9.system.entry.js} +1 -1
- package/dist/ripple/{p-c1cbb630.entry.js → p-28b52ec0.entry.js} +1 -1
- package/dist/ripple/{p-093dd5b3.entry.js → p-31558b0e.entry.js} +1 -1
- package/dist/ripple/{p-6ae45e19.entry.js → p-37e6df61.entry.js} +1 -1
- package/dist/ripple/p-42fa7a77.system.js +1 -0
- package/dist/ripple/{p-366f253f.entry.js → p-44dc020c.entry.js} +1 -1
- package/dist/ripple/{p-7a6d6c76.entry.js → p-484c5cc5.entry.js} +1 -1
- package/dist/ripple/{p-241c2d63.entry.js → p-4c374ff7.entry.js} +1 -1
- package/dist/ripple/{p-1124978e.system.entry.js → p-4e9f0f73.system.entry.js} +1 -1
- package/dist/ripple/{p-2b15945c.system.entry.js → p-59101b39.system.entry.js} +1 -1
- package/dist/ripple/p-59ce4f69.js +1 -0
- package/dist/ripple/{p-b00cdcc6.entry.js → p-5b9441ff.entry.js} +1 -1
- package/dist/ripple/p-5dc32453.js +1 -0
- package/dist/ripple/{p-22cbc43b.entry.js → p-6388bf35.entry.js} +1 -1
- package/dist/ripple/{p-b6d2b2c9.system.entry.js → p-6c267b11.system.entry.js} +1 -1
- package/dist/ripple/{p-8d858325.system.entry.js → p-6d0f7f1d.system.entry.js} +1 -1
- package/dist/ripple/{p-99f4dc24.entry.js → p-7233deea.entry.js} +1 -1
- package/dist/ripple/{p-9ea227e3.system.entry.js → p-73914a64.system.entry.js} +1 -1
- package/dist/ripple/{p-9f089a36.system.entry.js → p-75cf1147.system.entry.js} +1 -1
- package/dist/ripple/{p-d2ed3598.system.entry.js → p-7c379888.system.entry.js} +1 -1
- package/dist/ripple/{p-1b7774ab.entry.js → p-7ca0a3cb.entry.js} +1 -1
- package/dist/ripple/{p-e5af888f.system.entry.js → p-813634c0.system.entry.js} +1 -1
- package/dist/ripple/{p-12eaf2d7.entry.js → p-81c8d038.entry.js} +1 -1
- package/dist/ripple/{p-6643047f.system.entry.js → p-8286ed48.system.entry.js} +1 -1
- package/dist/ripple/{p-b41dfeea.system.entry.js → p-840ed2ca.system.entry.js} +1 -1
- package/dist/ripple/{p-21114d99.entry.js → p-886b50fb.entry.js} +1 -1
- package/dist/{cjs/priv-chart-popover_2.cjs.entry.js → ripple/p-88ec49f1.entry.js} +1 -175
- package/dist/ripple/{p-e0743224.entry.js → p-91194c43.entry.js} +1 -1
- package/dist/ripple/{p-f381b796.system.entry.js → p-92d489c8.system.entry.js} +1 -1
- package/dist/ripple/{p-6a18191e.system.entry.js → p-98a81b33.system.entry.js} +1 -1
- package/dist/ripple/{p-43b61559.system.entry.js → p-a09d66e8.system.entry.js} +1 -1
- package/dist/ripple/{p-d6e81f61.entry.js → p-a111374c.entry.js} +1 -1
- package/dist/ripple/{p-28890409.entry.js → p-a19f81a3.entry.js} +1 -1
- package/dist/{cjs/priv-chart-popover-old.cjs.entry.js → ripple/p-a6240a47.entry.js} +1 -145
- package/dist/ripple/p-ac08b0a8.system.js +1 -0
- package/dist/ripple/{p-87992e3d.system.entry.js → p-ac4370ae.system.entry.js} +1 -1
- package/dist/ripple/{p-1c86be31.entry.js → p-ae138b2c.entry.js} +1 -1
- package/dist/ripple/{p-b2875298.system.entry.js → p-afd0ed83.system.entry.js} +1 -1
- package/dist/ripple/{p-c5c98974.system.entry.js → p-b1e58461.system.entry.js} +1 -1
- package/dist/ripple/{p-7568137d.system.entry.js → p-bbf46f8b.system.entry.js} +1 -1
- package/dist/ripple/{p-04f8cae1.system.entry.js → p-bc29023c.system.entry.js} +1 -1
- package/dist/ripple/{p-31468e67.entry.js → p-c0087cd0.entry.js} +1 -1
- package/dist/ripple/{p-30c0aa58.system.entry.js → p-c02a5e64.system.entry.js} +1 -1
- package/dist/ripple/{p-743536ae.system.entry.js → p-cbb67bc3.system.entry.js} +1 -1
- package/dist/ripple/{p-8bb49d8f.system.entry.js → p-ceaee8b9.system.entry.js} +1 -1
- package/dist/ripple/{p-780de72e.system.entry.js → p-d59ded20.system.entry.js} +1 -1
- package/dist/ripple/{p-12f39b2f.entry.js → p-d9a53822.entry.js} +1 -1
- package/dist/ripple/{p-cc0cbbac.entry.js → p-de9e0582.entry.js} +1 -1
- package/dist/ripple/{p-3967eef9.system.js → p-e075695e.system.js} +1 -1
- package/dist/ripple/{p-c24b745f.entry.js → p-e618af10.entry.js} +1 -1
- package/dist/ripple/{p-4ba001c1.entry.js → p-e66ccd7b.entry.js} +1 -1
- package/dist/ripple/{p-bd7a5b99.system.entry.js → p-e6f6b0f4.system.entry.js} +1 -1
- package/dist/ripple/{p-966f2c9e.entry.js → p-e9038796.entry.js} +1 -1
- package/dist/ripple/{p-7cd03a52.entry.js → p-edbfc15c.entry.js} +1 -1
- package/dist/ripple/{p-b52e3001.entry.js → p-ee25af83.entry.js} +1 -1
- package/dist/ripple/{p-a0b38e60.system.js → p-ee9ff51e.system.js} +1 -1
- package/dist/ripple/{p-221dedba.system.entry.js → p-ef7988fe.system.entry.js} +1 -1
- package/dist/ripple/{p-0b2a0825.system.entry.js → p-f1dea7a8.system.entry.js} +1 -1
- package/dist/ripple/p-f297a080.system.js +1 -0
- package/dist/ripple/{p-909f8797.entry.js → p-f5c59ec1.entry.js} +1 -1
- package/dist/ripple/{p-8f96f4f8.entry.js → p-f680ad0f.entry.js} +1 -1
- package/dist/ripple/{p-e72235c6.js → p-f73dd1e7.js} +1 -1
- package/dist/ripple/{p-b8d69c73.system.entry.js → p-f8c12729.system.entry.js} +1 -1
- package/dist/ripple/{p-a7bddbfd.system.entry.js → p-fe330a72.system.entry.js} +1 -1
- package/dist/ripple/ripple.esm.js +1 -1
- package/dist/ripple/ripple.js +1 -1
- package/dist/types/components/charts/chartFunctions.d.ts +1 -9
- package/dist/types/components/charts/priv-chart-popover/priv-chart-popover.d.ts +11 -20
- package/dist/types/components/charts/wm-chart/wm-chart.d.ts +1 -1
- package/dist/types/components/charts/wm-progress-monitor/wm-progress-indicator.d.ts +1 -1
- package/dist/types/components.d.ts +6 -126
- package/dist/types/global/interfaces.d.ts +0 -41
- package/package.json +2 -2
- package/dist/cjs/wm-chart-bar.cjs.entry.js +0 -300
- package/dist/collection/components/charts/priv-chart-popover-old/priv-chart-popover-old.css +0 -961
- package/dist/collection/components/charts/priv-chart-popover-old/priv-chart-popover-old.js +0 -262
- package/dist/collection/components/charts/wm-chart-bar/wm-chart-bar.css +0 -1071
- package/dist/collection/components/charts/wm-chart-bar/wm-chart-bar.js +0 -444
- package/dist/collection/components/charts/wm-chart-legend/wm-chart-legend.css +0 -903
- package/dist/collection/components/charts/wm-chart-legend/wm-chart-legend.js +0 -155
- package/dist/collection/dev/chart-bar.js +0 -110
- package/dist/esm/priv-chart-popover-old.entry.js +0 -141
- package/dist/esm/priv-chart-popover_2.entry.js +0 -170
- package/dist/esm/wm-chart-bar.entry.js +0 -296
- package/dist/esm-es5/app-globals-213e1dce.js +0 -1
- package/dist/esm-es5/interfaces-16deca17.js +0 -1
- package/dist/esm-es5/priv-chart-popover-old.entry.js +0 -1
- package/dist/esm-es5/priv-chart-popover_2.entry.js +0 -1
- package/dist/esm-es5/wm-chart-bar.entry.js +0 -1
- package/dist/ripple/p-0b5e5682.js +0 -1
- package/dist/ripple/p-15bd3b98.entry.js +0 -1
- package/dist/ripple/p-1c133402.system.entry.js +0 -1
- package/dist/ripple/p-25e10302.system.js +0 -1
- package/dist/ripple/p-30874e40.entry.js +0 -1
- package/dist/ripple/p-403e834e.entry.js +0 -1
- package/dist/ripple/p-784fc89d.system.js +0 -1
- package/dist/ripple/p-7a4090bc.system.entry.js +0 -1
- package/dist/ripple/p-c464dfd1.entry.js +0 -1
- package/dist/ripple/p-c604795c.system.js +0 -1
- package/dist/ripple/p-e713ce44.system.js +0 -1
- package/dist/ripple/p-efa7cdcc.js +0 -1
- package/dist/ripple/p-f45addc8.js +0 -1
- package/dist/types/components/charts/priv-chart-popover-old/priv-chart-popover-old.d.ts +0 -26
- package/dist/types/components/charts/wm-chart-bar/wm-chart-bar.d.ts +0 -59
- package/dist/types/components/charts/wm-chart-legend/wm-chart-legend.d.ts +0 -19
|
@@ -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-14aaf49d.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 i(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,a){function s(e){try{c(n.next(e))}catch(e){a(e)}}function o(e){try{c(n["throw"](e))}catch(e){a(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,o)}c((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,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 c([e,t])}}function c(o){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,o[0]&&(r=0)),r)try{if(n=1,i&&(a=o[0]&2?i["return"]:o[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,o[1])).done)return a;if(i=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:r.label++;return{value:o[1],done:false};case 5:r.label++;i=o[1];o=[0];continue;case 7:o=r.ops.pop();r.trys.pop();continue;default:if(!(a=r.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){r=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){r.label=o[1];break}if(o[0]===6&&r.label<a[1]){r.label=a[1];a=o;break}if(a&&r.label<a[2]){r.label=a[2];r.ops.push(o);break}if(a[2])r.ops.pop();r.trys.pop();continue}o=t.call(e,r)}catch(e){o=[6,e];i=0}finally{n=a=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,i=t.length,a;n<i;n++){if(a||!(n in t)){if(!a)a=Array.prototype.slice.call(t,0,n);a[n]=t[n]}}return e.concat(a||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-9df607f2.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 i=toFixed(e+e*t*Math.cos(Math.PI*r/180));var a=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:i,y1:a,x2:s,y2:o}}return{x:i,y:a}}function getArc(e,t,r,n,i){var a=toFixed(i/2*e);return"A ".concat(a,", ").concat(a," 0 ").concat(t," ").concat(toFixed(r),", ").concat(toFixed(n))}function scale(e,t,r,n,i){var a=(e-t)*(i-n)/(r-t)+n;return a<n?n:a>i?i:a}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 i=r/n;var a;if(i>5){a=10*n}else if(i>3){a=5*n}else if(i>2){a=3*n}else if(i>1.5){a=2*n}else if(i>1){a=1.5*n}else{a=n}return a}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,i;var a=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()}i=0;r.forEach((function(r,s){var o=r.getAttribute("amount");if(o==null)return;var c=parseInt(o||"0");var u=amountToPercent(c,a.total,true);var h=s;if(e==="bar6"){h=0}var l={amount:c,visualAmount:c,perc:u,legend:r.getAttribute("legend"),color:n[h]||colors.gray,offset:t,id:"".concat(a.uid,"-").concat(i+1),title:r.getAttribute("popover-title"),text:r.getAttribute("popover-text"),buttonText:r.getAttribute("popover-button-text"),sliceRef:r,inSmallCluster:false,index:i};t+=c;a.slicesDetails.push(l);i++}));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,i){var a=r[i===0?r.length-1:i-1];var s=r[i===r.length-1?0:i+1];var o=amountToPercent(a.amount,t,true);var c=amountToPercent(s.amount,t,true);var u=e.perc===0?8:5;var h=e.perc<4;var l=o<u;var d=c<u;var f=h&&(l||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 i=e/this.total*360;var a=n+i;var s=i>180?"1 1":"0 1";var o=i>180?"1 0":"0 0";var c=this.chartDetails.size/2;var u=this.chartDetails.thickness;var h=1;var l=r==="doughnut";var d=1.5;var f=l?2.25:3;if(i===360){a-=.01}var v=polarToCartesian(c,h,n+d,a);var g=polarToCartesian(c,u,n+f,a);var p="M ".concat(v.x1,", ").concat(v.y1," ");var m=getArc(h,s,v.x2,v.y2,this.chartDetails.size);var b=" L ".concat(g.x2,", ").concat(g.y2," ");var x=getArc(u,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 i=n.some((function(t){return t!==0&&t<e}));if(i){var a=n.map((function(t){return t==0?t:Math.max(t,e)}));var s=a.reduce((function(t,r){return t+(r>e&&r!==0?r:0)}),0);var o=a.reduce((function(t,r){return t+(r>e&&r!==0?0:r)}),0);var c=360-o;var u=s-c;var h=u/c;var l=a.map((function(t){return t>e?t-h*t:t==0?0:e}));var d=0;t=t.map((function(e,t){var n=l[t]/360*r;var i=d;d+=n;return Object.assign(Object.assign({},e),{visualAmount:n,offset:i})}))}return t}function renderDoughnut(e){var t=this;var r=this.chartDetails.size+this.chartDetails.padding;var n=e==="doughnut";var i=n?this.slicesDetails:sortSlicesDetails(this.slicesDetails,this.total);i=applyMinimumAngle(7,i,this.total);var a=i[0].amount;var s=amountToPercent(a,this.total,true);if(s===0&&a>0){s="<1%"}else if(s===100&&a<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(),i.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"},i.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,i=r.y;var a;if(e.perc===0&&e.amount>0){a="<1%"}else if(e.perc===100&&e.amount<this.total){a=">99%"}else{a=e.perc+"%"}return h("text",{class:"value",x:n+"px",y:i+"px","data-segmentindex":e.index},a)}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 i=false;n.forEach((function(t){t.classList.remove("hidden");var n=parseInt(t.dataset.value);if(e.length>0&&n!=0){var a=t.getBoundingClientRect().left-r;e.forEach((function(e){var r=parseInt(e.dataset.value);var s=e.getBoundingClientRect().right>a;if(s){var o=n<r?t:e;o.classList.add("hidden");i=true}}))}if(!t.classList.contains("hidden")&&n>0){e.push(t)}}));(t.isBar||t.isDoughnut)&&t.showHiddenValuesMessage(i)}))}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 i=this.el.shadowRoot.querySelector(".stacked-bar-segments-wrapper");var a=i?i.offsetWidth:this.el.offsetWidth;var s=n/100*a>=t;var o=s||e.amount==0?"".concat(n,"%"):"".concat(t,"px");var c="";if(this.valueFormat=="percentage"){c="".concat(amountToPercent(e.amount,this.total,true)," %")}else if(this.valueFormat=="amount"){c=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(c)))}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 i=48;var a=this.el.getBoundingClientRect().width;var s=a-n-i;var o=getMaxTicks(s);var c=getInterval(r,o);var u=o*c;var l=Math.floor((u-r)/c);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,c,o,r))}));var f=[];for(var v=1;v<=o;v++){var g=abbrNumber(safeMultiplyFloat(v,c));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 i=this;var a=this.currentChartType==="bar6"?t*r:n;var s=amountToPercent(e.amount,a,false);var o=s?s+"%":"1px";var c=abbrNumber(e.amount);var u=this.valueFormat==="amount"?c:"";if(this.currentChartType==="bar6"&&this.valueFormat==="percentage"){u=e.amount+"%"}else if(this.currentChartType==="bar7"&&this.valueFormat==="percentage"){u=(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(i,t,e)},onFocus:function(t){return handleSliceFocus.call(i,t,e)},onKeyDown:function(e){return handleSliceKeyDown.call(i,e)},"data-segmentindex":e.index},h("div",{class:"value"},u))}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 i=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 i(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)}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,abbrNumber as n,getInterval as o,removeSegmentInfoHighlight as r};
|