@watermarkinsights/ripple 5.15.0-alpha.0 → 5.15.0-alpha.2
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-d84804db.js → app-globals-07a183eb.js} +1 -1
- package/dist/cjs/{chartFunctions-153f5288.js → chartFunctions-439c6fd4.js} +1 -1
- package/dist/cjs/{functions-b6a2c8c1.js → functions-dd27bda3.js} +43 -6
- package/dist/cjs/{intl-ae08308b.js → intl-6d72b4a0.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/priv-calendar.cjs.entry.js +2 -2
- package/dist/cjs/priv-chart-popover.cjs.entry.js +2 -2
- 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 +3 -3
- package/dist/cjs/wm-button.cjs.entry.js +2 -2
- package/dist/cjs/wm-chart.cjs.entry.js +4 -4
- package/dist/cjs/wm-date-range.cjs.entry.js +2 -2
- package/dist/cjs/wm-datepicker.cjs.entry.js +2 -2
- 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 +4 -4
- package/dist/cjs/wm-modal-pss_3.cjs.entry.js +5 -5
- package/dist/cjs/wm-modal_3.cjs.entry.js +5 -5
- package/dist/cjs/wm-navigation_3.cjs.entry.js +5 -5
- package/dist/cjs/wm-navigator.cjs.entry.js +2 -2
- package/dist/cjs/wm-nested-select.cjs.entry.js +3 -3
- package/dist/cjs/wm-optgroup.cjs.entry.js +2 -2
- package/dist/cjs/wm-option_2.cjs.entry.js +4 -4
- package/dist/cjs/wm-pagination.cjs.entry.js +3 -3
- package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +4 -4
- package/dist/cjs/wm-search.cjs.entry.js +3 -3
- package/dist/cjs/wm-snackbar.cjs.entry.js +3 -3
- package/dist/cjs/wm-tab-item_3.cjs.entry.js +4 -4
- package/dist/cjs/wm-tag-input.cjs.entry.js +3 -3
- 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 +2 -2
- package/dist/cjs/wm-toggletip.cjs.entry.js +57 -5
- package/dist/cjs/wm-uploader.cjs.entry.js +5 -5
- package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.css +13 -0
- package/dist/collection/components/charts/wm-chart/wm-chart.css +13 -0
- package/dist/collection/components/charts/wm-line-chart/wm-line-chart.css +13 -0
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.css +13 -0
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.css +13 -0
- package/dist/collection/components/datepickers/datepicker.css +13 -0
- package/dist/collection/components/datepickers/priv-calendar/priv-calendar.css +13 -0
- package/dist/collection/components/selects/priv-option-list/priv-option-list.css +13 -0
- package/dist/collection/components/selects/wm-nested-select/wm-nested-select.css +13 -0
- package/dist/collection/components/selects/wm-optgroup/wm-optgroup.css +13 -0
- package/dist/collection/components/selects/wm-option/wm-option.css +13 -0
- package/dist/collection/components/selects/wm-select/wm-select.css +13 -0
- package/dist/collection/components/wm-action-menu/wm-action-menu.css +13 -0
- package/dist/collection/components/wm-button/wm-button.css +15 -3
- package/dist/collection/components/wm-file/wm-file.css +13 -0
- package/dist/collection/components/wm-file-list/wm-file-list.css +13 -0
- package/dist/collection/components/wm-flyout/wm-flyout.css +13 -0
- package/dist/collection/components/wm-input/wm-input.css +13 -0
- package/dist/collection/components/wm-menuitem/wm-menuitem.css +13 -0
- package/dist/collection/components/wm-modal/wm-modal-footer.css +13 -0
- package/dist/collection/components/wm-modal/wm-modal-header.css +13 -0
- package/dist/collection/components/wm-modal/wm-modal.css +13 -0
- package/dist/collection/components/wm-modal-pss/wm-modal-pss-footer.css +13 -0
- package/dist/collection/components/wm-modal-pss/wm-modal-pss-header.css +13 -0
- package/dist/collection/components/wm-modal-pss/wm-modal-pss.css +13 -0
- package/dist/collection/components/wm-navigation/wm-navigation-hamburger.css +13 -0
- package/dist/collection/components/wm-navigation/wm-navigation-item.css +13 -0
- package/dist/collection/components/wm-navigation/wm-navigation.css +13 -0
- package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.css +13 -0
- package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.css +13 -0
- package/dist/collection/components/wm-navigator/wm-navigator.css +13 -0
- package/dist/collection/components/wm-pagination/wm-pagination.css +13 -0
- package/dist/collection/components/wm-search/wm-search.css +13 -0
- package/dist/collection/components/wm-snackbar/wm-snackbar.css +13 -0
- package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.css +13 -0
- package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.css +13 -0
- package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.css +13 -0
- package/dist/collection/components/wm-tag-input/wm-tag-input.css +13 -0
- package/dist/collection/components/wm-textarea/wm-textarea.css +13 -0
- package/dist/collection/components/wm-timepicker/wm-timepicker.css +13 -0
- package/dist/collection/components/wm-toggletip/wm-toggletip.css +77 -0
- package/dist/collection/components/wm-toggletip/wm-toggletip.js +73 -3
- package/dist/collection/components/wm-uploader/wm-uploader.css +15 -3
- package/dist/collection/components/wm-uploader/wm-uploader.js +2 -2
- package/dist/collection/global/functions.js +43 -6
- package/dist/esm/{app-globals-3753b41d.js → app-globals-abcc4b57.js} +1 -1
- package/dist/esm/{chartFunctions-de9bcba9.js → chartFunctions-6749593d.js} +1 -1
- package/dist/esm/{functions-85bc4418.js → functions-dabfd76f.js} +43 -6
- package/dist/esm/{intl-a0456c63.js → intl-43676e71.js} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/priv-calendar.entry.js +2 -2
- package/dist/esm/priv-chart-popover.entry.js +2 -2
- 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 +3 -3
- package/dist/esm/wm-button.entry.js +2 -2
- package/dist/esm/wm-chart.entry.js +4 -4
- package/dist/esm/wm-date-range.entry.js +2 -2
- package/dist/esm/wm-datepicker.entry.js +2 -2
- 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 +4 -4
- package/dist/esm/wm-modal-pss_3.entry.js +5 -5
- package/dist/esm/wm-modal_3.entry.js +5 -5
- package/dist/esm/wm-navigation_3.entry.js +5 -5
- package/dist/esm/wm-navigator.entry.js +2 -2
- package/dist/esm/wm-nested-select.entry.js +3 -3
- package/dist/esm/wm-optgroup.entry.js +2 -2
- package/dist/esm/wm-option_2.entry.js +4 -4
- package/dist/esm/wm-pagination.entry.js +3 -3
- package/dist/esm/wm-progress-indicator_3.entry.js +4 -4
- package/dist/esm/wm-search.entry.js +3 -3
- package/dist/esm/wm-snackbar.entry.js +3 -3
- package/dist/esm/wm-tab-item_3.entry.js +4 -4
- package/dist/esm/wm-tag-input.entry.js +3 -3
- 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 +2 -2
- package/dist/esm/wm-toggletip.entry.js +57 -5
- package/dist/esm/wm-uploader.entry.js +5 -5
- package/dist/esm-es5/{app-globals-3753b41d.js → app-globals-abcc4b57.js} +1 -1
- package/dist/esm-es5/{chartFunctions-de9bcba9.js → chartFunctions-6749593d.js} +1 -1
- package/dist/esm-es5/{functions-85bc4418.js → functions-dabfd76f.js} +1 -1
- package/dist/esm-es5/{intl-a0456c63.js → intl-43676e71.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/priv-calendar.entry.js +1 -1
- package/dist/esm-es5/priv-chart-popover.entry.js +1 -1
- package/dist/esm-es5/priv-navigator-button.entry.js +1 -1
- package/dist/esm-es5/priv-navigator-item.entry.js +1 -1
- package/dist/esm-es5/priv-option-list.entry.js +1 -1
- package/dist/esm-es5/ripple.js +1 -1
- package/dist/esm-es5/wm-action-menu_2.entry.js +1 -1
- package/dist/esm-es5/wm-button.entry.js +1 -1
- package/dist/esm-es5/wm-chart.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-02c8e3ed.entry.js +1 -0
- package/dist/ripple/{p-5d29ac58.system.entry.js → p-05f3cecb.entry.js} +1 -1
- package/dist/ripple/p-07d8e479.entry.js +1 -0
- package/dist/ripple/p-0830cddd.entry.js +1 -0
- package/dist/ripple/p-0b5bfa16.entry.js +1 -0
- package/dist/ripple/p-160fda33.entry.js +1 -0
- package/dist/ripple/p-16926b84.entry.js +1 -0
- package/dist/ripple/{p-a5031dab.entry.js → p-1a3037aa.entry.js} +1 -1
- package/dist/ripple/p-1ba2fb24.entry.js +1 -0
- package/dist/ripple/p-1e0e334f.entry.js +1 -0
- package/dist/ripple/p-1f8dfb77.system.entry.js +1 -0
- package/dist/ripple/p-1fe343d5.entry.js +1 -0
- package/dist/ripple/p-269f8445.entry.js +1 -0
- package/dist/ripple/p-26c3d8d2.entry.js +1 -0
- package/dist/ripple/p-2e99436b.system.entry.js +1 -0
- package/dist/ripple/{p-99ee6fbf.system.entry.js → p-37336393.system.entry.js} +1 -1
- package/dist/ripple/p-393ffdac.system.entry.js +1 -0
- package/dist/ripple/p-3f85b8f4.entry.js +1 -0
- package/dist/ripple/{p-79c56ebe.js → p-3f98056c.js} +1 -1
- package/dist/ripple/{p-92d8c5bd.system.js → p-41120a33.system.js} +1 -1
- package/dist/ripple/p-4410b59a.entry.js +1 -0
- package/dist/ripple/{p-256e98c1.js → p-49a347e1.js} +1 -1
- package/dist/ripple/p-4d10bc9b.entry.js +1 -0
- package/dist/ripple/p-4f156fee.system.entry.js +1 -0
- package/dist/ripple/p-552859db.system.entry.js +1 -0
- package/dist/ripple/{p-53f05aee.system.entry.js → p-56bc17c1.entry.js} +1 -1
- package/dist/ripple/p-571ba04c.system.entry.js +1 -0
- package/dist/ripple/{p-e9c4ed97.entry.js → p-5a5b2d59.entry.js} +1 -1
- package/dist/ripple/{p-2db5e316.entry.js → p-5ad86026.entry.js} +1 -1
- package/dist/ripple/p-5ae30ac7.system.entry.js +1 -0
- package/dist/ripple/p-5dc1810a.system.entry.js +1 -0
- package/dist/ripple/p-610d0e09.system.entry.js +1 -0
- package/dist/ripple/p-61cca0ff.system.entry.js +1 -0
- package/dist/ripple/p-63abbde7.entry.js +1 -0
- package/dist/ripple/p-6932515a.system.entry.js +1 -0
- package/dist/ripple/p-693a52ab.entry.js +1 -0
- package/dist/ripple/p-6ab35628.system.entry.js +1 -0
- package/dist/ripple/p-6ab4e970.entry.js +1 -0
- package/dist/ripple/p-6d248f1b.entry.js +1 -0
- package/dist/ripple/{p-5dff57fb.entry.js → p-6f60b787.system.entry.js} +1 -1
- package/dist/ripple/{p-66a90fbd.system.entry.js → p-7a36cfec.entry.js} +1 -1
- package/dist/ripple/{p-db9aa520.system.js → p-89316785.system.js} +1 -1
- package/dist/ripple/p-8c19079b.entry.js +1 -0
- package/dist/ripple/p-8e820303.system.entry.js +1 -0
- package/dist/ripple/{p-ae5d9927.system.entry.js → p-8f70cd7d.system.entry.js} +1 -1
- package/dist/ripple/p-96753d47.system.entry.js +1 -0
- package/dist/ripple/p-976664cf.system.entry.js +1 -0
- package/dist/ripple/{p-eb253749.system.js → p-9a87f3a0.system.js} +1 -1
- package/dist/ripple/{p-3a16d089.entry.js → p-9cf2f18e.system.entry.js} +1 -1
- package/dist/ripple/p-a05c2a02.entry.js +1 -0
- package/dist/ripple/{p-af59f267.js → p-a2c8937d.js} +1 -1
- package/dist/ripple/{p-c47e258d.system.entry.js → p-afcc7cdb.system.entry.js} +1 -1
- package/dist/ripple/p-b4804a9b.system.entry.js +1 -0
- package/dist/ripple/{p-243c6b62.system.js → p-ba399879.system.js} +1 -1
- package/dist/ripple/p-bacccb48.system.js +1 -0
- package/dist/ripple/p-c0f72da2.system.entry.js +1 -0
- package/dist/ripple/p-c1fc6def.entry.js +1 -0
- package/dist/ripple/{p-ffe8376a.entry.js → p-c646d8a4.entry.js} +1 -1
- package/dist/ripple/p-c7ea9124.system.entry.js +1 -0
- package/dist/ripple/p-cadbb7ce.system.entry.js +1 -0
- package/dist/ripple/p-cbfeebcc.system.entry.js +1 -0
- package/dist/ripple/p-cd059f8a.system.entry.js +1 -0
- package/dist/ripple/p-cd3ab20f.system.entry.js +1 -0
- package/dist/ripple/{p-9cfd9bd9.js → p-d0cf99ea.js} +1 -1
- package/dist/ripple/{p-35f260f9.system.entry.js → p-d333d851.system.entry.js} +1 -1
- package/dist/ripple/{p-fcb7edda.entry.js → p-d5664836.system.entry.js} +1 -1
- package/dist/ripple/{p-315198e2.system.entry.js → p-d9c019dd.system.entry.js} +1 -1
- package/dist/ripple/p-da52d8ba.entry.js +1 -0
- package/dist/ripple/p-dea44ca1.entry.js +1 -0
- package/dist/ripple/p-e177b02a.entry.js +1 -0
- package/dist/ripple/{p-d5994e7c.entry.js → p-e39839c8.system.entry.js} +1 -1
- package/dist/ripple/{p-ab9af951.system.entry.js → p-eb92950a.system.entry.js} +1 -1
- package/dist/ripple/p-f1ce688c.system.entry.js +1 -0
- package/dist/ripple/{p-021e46ae.system.entry.js → p-f8ef4fb3.entry.js} +1 -1
- package/dist/ripple/p-fe31f7b7.entry.js +1 -0
- package/dist/ripple/ripple.esm.js +1 -1
- package/dist/ripple/ripple.js +1 -1
- package/dist/types/components/wm-toggletip/wm-toggletip.d.ts +10 -1
- package/dist/types/components.d.ts +2 -0
- package/package.json +2 -2
- package/dist/ripple/p-0c53ba0c.entry.js +0 -1
- package/dist/ripple/p-17498c9d.system.entry.js +0 -1
- package/dist/ripple/p-18c26666.entry.js +0 -1
- package/dist/ripple/p-1c52ac0f.system.entry.js +0 -1
- package/dist/ripple/p-22c205c0.entry.js +0 -1
- package/dist/ripple/p-2aea4c9a.system.entry.js +0 -1
- package/dist/ripple/p-2dd4af68.entry.js +0 -1
- package/dist/ripple/p-4f48dc05.entry.js +0 -1
- package/dist/ripple/p-50efe5f9.entry.js +0 -1
- package/dist/ripple/p-51800e01.entry.js +0 -1
- package/dist/ripple/p-56517851.system.entry.js +0 -1
- package/dist/ripple/p-56b2b902.system.entry.js +0 -1
- package/dist/ripple/p-56ddcb43.entry.js +0 -1
- package/dist/ripple/p-5b3f4f30.system.entry.js +0 -1
- package/dist/ripple/p-61af9bfc.entry.js +0 -1
- package/dist/ripple/p-7360ce37.entry.js +0 -1
- package/dist/ripple/p-74a2e246.system.entry.js +0 -1
- package/dist/ripple/p-7825cbab.system.js +0 -1
- package/dist/ripple/p-7a6f535f.system.entry.js +0 -1
- package/dist/ripple/p-7f2dd7a9.entry.js +0 -1
- package/dist/ripple/p-8273a880.system.entry.js +0 -1
- package/dist/ripple/p-857ed23b.entry.js +0 -1
- package/dist/ripple/p-886b3dc1.system.entry.js +0 -1
- package/dist/ripple/p-9772a990.system.entry.js +0 -1
- package/dist/ripple/p-97b26258.entry.js +0 -1
- package/dist/ripple/p-9c4deec8.system.entry.js +0 -1
- package/dist/ripple/p-9e1c3aff.system.entry.js +0 -1
- package/dist/ripple/p-9f29e5e4.system.entry.js +0 -1
- package/dist/ripple/p-a2f5e287.system.entry.js +0 -1
- package/dist/ripple/p-a389ccd3.system.entry.js +0 -1
- package/dist/ripple/p-b02789de.entry.js +0 -1
- package/dist/ripple/p-b94b321e.entry.js +0 -1
- package/dist/ripple/p-bbb37d6e.entry.js +0 -1
- package/dist/ripple/p-bff9eb65.entry.js +0 -1
- package/dist/ripple/p-c04b1220.entry.js +0 -1
- package/dist/ripple/p-c3ab1c4b.system.entry.js +0 -1
- package/dist/ripple/p-ca3b0bb2.entry.js +0 -1
- package/dist/ripple/p-cd5c59ef.system.entry.js +0 -1
- package/dist/ripple/p-d019d91e.system.entry.js +0 -1
- package/dist/ripple/p-d748064a.system.entry.js +0 -1
- package/dist/ripple/p-d88a38be.system.entry.js +0 -1
- package/dist/ripple/p-dd4b472e.entry.js +0 -1
- package/dist/ripple/p-de1215f6.entry.js +0 -1
- package/dist/ripple/p-e1d41109.entry.js +0 -1
- package/dist/ripple/p-e8325573.entry.js +0 -1
- package/dist/ripple/p-e870d3b6.system.entry.js +0 -1
- package/dist/ripple/p-f07452f0.system.entry.js +0 -1
- package/dist/ripple/p-f3e5f455.entry.js +0 -1
- package/dist/ripple/p-fd045847.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
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-85bc4418.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};
|
|
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{c(n.next(e))}catch(e){i(e)}}function o(e){try{c(n["throw"](e))}catch(e){i(e)}}function c(e){e.done?r(e.value):a(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(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 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,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-dabfd76f.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 c=parseInt(o||"0");var u=amountToPercent(c,i.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(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+=c;i.slicesDetails.push(l);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 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 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 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(a===360){i-=.01}var v=polarToCartesian(c,h,n+d,i);var g=polarToCartesian(c,u,n+f,i);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 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 c=360-o;var u=s-c;var h=u/c;var l=i.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 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 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 a=48;var i=this.el.getBoundingClientRect().width;var s=i-n-a;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 a=this;var i=this.currentChartType==="bar6"?t*r:n;var s=amountToPercent(e.amount,i,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(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"},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 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)}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};
|