@watermarkinsights/ripple 0.0.1 → 0.1.0-alpha.1
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-3db2fdd3.js +103 -0
- package/dist/cjs/chartFunctions-0d47b1f4.js +906 -0
- package/dist/cjs/functions-761cb9f2.js +10694 -0
- package/dist/cjs/index-bb947bd5.js +1843 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/interfaces-33cd6161.js +82 -0
- package/dist/cjs/intl-9e9388a7.js +291 -0
- package/dist/cjs/loader.cjs.js +15 -0
- package/dist/cjs/priv-calendar.cjs.entry.js +580 -0
- package/dist/cjs/priv-chart-popover-old.cjs.entry.js +146 -0
- package/dist/cjs/priv-chart-popover_2.cjs.entry.js +204 -0
- package/dist/cjs/priv-navigator-button.cjs.entry.js +29 -0
- package/dist/cjs/priv-navigator-item.cjs.entry.js +35 -0
- package/dist/cjs/priv-option-list.cjs.entry.js +391 -0
- package/dist/cjs/ripple.cjs.js +25 -0
- package/dist/cjs/wm-action-menu_2.cjs.entry.js +525 -0
- package/dist/cjs/wm-button.cjs.entry.js +280 -0
- package/dist/cjs/wm-chart-bar.cjs.entry.js +444 -0
- package/dist/cjs/wm-chart-column.cjs.entry.js +629 -0
- package/dist/cjs/wm-chart-slice.cjs.entry.js +27 -0
- package/dist/cjs/wm-chart-stack.cjs.entry.js +447 -0
- package/dist/cjs/wm-chart.cjs.entry.js +163 -0
- package/dist/cjs/wm-date-range.cjs.entry.js +591 -0
- package/dist/cjs/wm-datepicker.cjs.entry.js +399 -0
- package/dist/{ripple/wm-tab-panel.entry.js → cjs/wm-file-list.cjs.entry.js} +15 -24
- package/dist/cjs/wm-file.cjs.entry.js +210 -0
- package/dist/cjs/wm-flyout.cjs.entry.js +178 -0
- package/dist/{ripple/wm-modal.entry.js → cjs/wm-input.cjs.entry.js} +108 -110
- package/dist/cjs/wm-line-chart.cjs.entry.js +541 -0
- package/dist/cjs/wm-modal-pss_3.cjs.entry.js +220 -0
- package/dist/cjs/wm-modal_3.cjs.entry.js +238 -0
- package/dist/cjs/wm-navigation_3.cjs.entry.js +188 -0
- package/dist/cjs/wm-navigator.cjs.entry.js +334 -0
- package/dist/cjs/wm-nested-select.cjs.entry.js +322 -0
- package/dist/{ripple/wm-textarea.entry.js → cjs/wm-optgroup.cjs.entry.js} +62 -57
- package/dist/cjs/wm-option_2.cjs.entry.js +536 -0
- package/dist/{ripple/wm-navigation.entry.js → cjs/wm-pagination.cjs.entry.js} +204 -91
- package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +204 -0
- package/dist/{ripple/wm-flyout.entry.js → cjs/wm-search.cjs.entry.js} +168 -139
- package/dist/{ripple/wm-datepicker.entry.js → cjs/wm-snackbar.cjs.entry.js} +152 -223
- package/dist/cjs/wm-tab-item_3.cjs.entry.js +357 -0
- package/dist/cjs/wm-tag-input.cjs.entry.js +985 -0
- package/dist/cjs/wm-tag-option.cjs.entry.js +51 -0
- package/dist/{ripple/wm-modal-pss.entry.js → cjs/wm-textarea.cjs.entry.js} +70 -111
- package/dist/{ripple/wm-progress-indicator.entry.js → cjs/wm-timepicker.cjs.entry.js} +296 -78
- package/dist/cjs/wm-toggletip.cjs.entry.js +252 -0
- package/dist/cjs/wm-uploader.cjs.entry.js +341 -0
- package/dist/cjs/wm-wrapper.cjs.entry.js +21 -0
- package/dist/collection/collection-manifest.json +207 -0
- package/dist/collection/components/charts/chartFunctions.js +831 -0
- package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.css +995 -0
- package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.js +345 -0
- package/dist/collection/components/charts/priv-chart-popover-old/priv-chart-popover-old.css +990 -0
- package/dist/collection/components/charts/priv-chart-popover-old/priv-chart-popover-old.js +268 -0
- package/dist/collection/components/charts/wm-chart/wm-chart-slice.js +177 -0
- package/dist/collection/components/charts/wm-chart/wm-chart.css +1326 -0
- package/dist/collection/components/charts/wm-chart/wm-chart.js +549 -0
- package/dist/collection/components/charts/wm-chart-bar/wm-chart-bar.css +1236 -0
- package/dist/collection/components/charts/wm-chart-bar/wm-chart-bar.js +725 -0
- package/dist/collection/components/charts/wm-chart-column/wm-chart-column.css +1335 -0
- package/dist/collection/components/charts/wm-chart-column/wm-chart-column.js +914 -0
- package/dist/collection/components/charts/wm-chart-legend/wm-chart-legend.css +1006 -0
- package/dist/collection/components/charts/wm-chart-legend/wm-chart-legend.js +310 -0
- package/dist/collection/components/charts/wm-chart-stack/wm-chart-stack.css +1466 -0
- package/dist/collection/components/charts/wm-chart-stack/wm-chart-stack.js +709 -0
- package/dist/collection/components/charts/wm-line-chart/wm-line-chart.css +1208 -0
- package/dist/collection/components/charts/wm-line-chart/wm-line-chart.js +999 -0
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.css +1326 -0
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.js +320 -0
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.css +967 -0
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.js +232 -0
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-slice.js +167 -0
- package/dist/collection/components/datepickers/datepicker.css +1147 -0
- package/dist/collection/components/datepickers/priv-calendar/priv-calendar.css +1415 -0
- package/dist/collection/components/datepickers/priv-calendar/priv-calendar.js +857 -0
- package/dist/collection/components/datepickers/wm-date-range.js +1158 -0
- package/dist/collection/components/datepickers/wm-datepicker.js +875 -0
- package/dist/collection/components/selects/priv-option-list/priv-option-list.css +999 -0
- package/dist/collection/components/selects/priv-option-list/priv-option-list.js +784 -0
- package/dist/collection/components/selects/wm-nested-select/wm-nested-select.css +1259 -0
- package/dist/collection/components/selects/wm-nested-select/wm-nested-select.js +805 -0
- package/dist/collection/components/selects/wm-optgroup/wm-optgroup.css +909 -0
- package/dist/collection/components/selects/wm-optgroup/wm-optgroup.js +363 -0
- package/dist/collection/components/selects/wm-option/wm-option.css +1033 -0
- package/dist/collection/components/selects/wm-option/wm-option.js +665 -0
- package/dist/collection/components/selects/wm-select/wm-select.css +1174 -0
- package/dist/collection/components/selects/wm-select/wm-select.js +878 -0
- package/dist/collection/components/wm-action-menu/wm-action-menu.css +1690 -0
- package/dist/collection/components/wm-action-menu/wm-action-menu.js +932 -0
- package/dist/collection/components/wm-button/wm-button.css +1630 -0
- package/dist/collection/components/wm-button/wm-button.js +794 -0
- package/dist/collection/components/wm-file/wm-file.css +1086 -0
- package/dist/collection/components/wm-file/wm-file.js +536 -0
- package/dist/collection/components/wm-file-list/wm-file-list.css +899 -0
- package/dist/collection/components/wm-file-list/wm-file-list.js +118 -0
- package/dist/collection/components/wm-flyout/wm-flyout.css +1091 -0
- package/dist/collection/components/wm-flyout/wm-flyout.js +651 -0
- package/dist/collection/components/wm-input/wm-input.css +1095 -0
- package/dist/collection/components/wm-input/wm-input.js +653 -0
- package/dist/collection/components/wm-menuitem/wm-menuitem.css +982 -0
- package/dist/collection/components/wm-menuitem/wm-menuitem.js +515 -0
- package/dist/collection/components/wm-modal/wm-modal-footer.css +927 -0
- package/dist/collection/components/wm-modal/wm-modal-footer.js +199 -0
- package/dist/collection/components/wm-modal/wm-modal-header.css +926 -0
- package/dist/collection/components/wm-modal/wm-modal-header.js +110 -0
- package/dist/collection/components/wm-modal/wm-modal.css +983 -0
- package/dist/collection/components/wm-modal/wm-modal.js +534 -0
- package/dist/collection/components/wm-modal-pss/wm-modal-pss-footer.css +931 -0
- package/dist/collection/components/wm-modal-pss/wm-modal-pss-footer.js +142 -0
- package/dist/collection/components/wm-modal-pss/wm-modal-pss-header.css +925 -0
- package/dist/collection/components/wm-modal-pss/wm-modal-pss-header.js +86 -0
- package/dist/collection/components/wm-modal-pss/wm-modal-pss.css +1007 -0
- package/dist/collection/components/wm-modal-pss/wm-modal-pss.js +369 -0
- package/dist/collection/components/wm-navigation/wm-navigation-hamburger.css +926 -0
- package/dist/collection/components/wm-navigation/wm-navigation-hamburger.js +153 -0
- package/dist/collection/components/wm-navigation/wm-navigation-item.css +935 -0
- package/dist/collection/components/wm-navigation/wm-navigation-item.js +140 -0
- package/dist/collection/components/wm-navigation/wm-navigation.css +977 -0
- package/dist/collection/components/wm-navigation/wm-navigation.js +246 -0
- package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.css +929 -0
- package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.js +90 -0
- package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.css +918 -0
- package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.js +128 -0
- package/dist/collection/components/wm-navigator/wm-navigator.css +990 -0
- package/dist/collection/components/wm-navigator/wm-navigator.js +597 -0
- package/dist/collection/components/wm-pagination/wm-pagination.css +1044 -0
- package/dist/collection/components/wm-pagination/wm-pagination.js +487 -0
- package/dist/collection/components/wm-search/wm-search.css +983 -0
- package/dist/collection/components/wm-search/wm-search.js +604 -0
- package/dist/collection/components/wm-snackbar/wm-snackbar.css +1150 -0
- package/dist/collection/components/wm-snackbar/wm-snackbar.js +363 -0
- package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.css +958 -0
- package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.js +233 -0
- package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.css +966 -0
- package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.js +461 -0
- package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.css +906 -0
- package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.js +132 -0
- package/dist/collection/components/wm-tag-input/wm-tag-input.css +1423 -0
- package/dist/collection/components/wm-tag-input/wm-tag-input.js +1511 -0
- package/dist/collection/components/wm-tag-input/wm-tag-option/wm-tag-option.js +328 -0
- package/dist/collection/components/wm-textarea/wm-textarea.css +1065 -0
- package/dist/collection/components/wm-textarea/wm-textarea.js +423 -0
- package/dist/collection/components/wm-timepicker/wm-timepicker.css +1174 -0
- package/dist/collection/components/wm-timepicker/wm-timepicker.js +728 -0
- package/dist/collection/components/wm-toggletip/wm-toggletip.css +1296 -0
- package/dist/collection/components/wm-toggletip/wm-toggletip.js +455 -0
- package/dist/collection/components/wm-uploader/wm-uploader.css +1987 -0
- package/dist/collection/components/wm-uploader/wm-uploader.js +760 -0
- package/dist/collection/components/wm-wrapper/wm-wrapper.js +31 -0
- package/dist/collection/dev/action-menu.js +18 -0
- package/dist/collection/dev/button.js +12 -0
- package/dist/collection/dev/chart-bar.js +430 -0
- package/dist/collection/dev/chart-column.js +459 -0
- package/dist/collection/dev/chart-small.js +56 -0
- package/dist/collection/dev/chart-stack.js +205 -0
- package/dist/collection/dev/chart.js +18 -0
- package/dist/collection/dev/date-range.js +14 -0
- package/dist/collection/dev/datepicker.js +46 -0
- package/dist/collection/dev/file-list.js +16 -0
- package/dist/collection/dev/file.js +0 -0
- package/dist/collection/dev/flyout.js +194 -0
- package/dist/collection/dev/input.js +6 -0
- package/dist/collection/dev/line-chart.js +45 -0
- package/dist/collection/dev/modal.js +48 -0
- package/dist/collection/dev/navigation.js +13 -0
- package/dist/collection/dev/navigator.js +34 -0
- package/dist/collection/dev/nested-select.js +36 -0
- package/dist/collection/dev/pagination.js +7 -0
- package/dist/collection/dev/progress-monitor.js +0 -0
- package/dist/collection/dev/pss-modal.js +8 -0
- package/dist/collection/dev/scripts.js +49 -0
- package/dist/collection/dev/search.js +72 -0
- package/dist/collection/dev/select.js +57 -0
- package/dist/collection/dev/snackbar.js +68 -0
- package/dist/collection/dev/tabs.js +44 -0
- package/dist/collection/dev/tag-input.js +32 -0
- package/dist/collection/dev/textarea.js +28 -0
- package/dist/collection/dev/timepicker.js +32 -0
- package/dist/collection/dev/toggletip.js +9 -0
- package/dist/collection/dev/uploader.js +139 -0
- package/dist/collection/global/__mocks__/functions.js +6 -0
- package/dist/collection/global/functions.js +907 -0
- package/dist/{ripple/app-globals-B7cOtGhY.js → collection/global/global.js} +16 -87
- package/dist/collection/global/interfaces.js +94 -0
- package/dist/collection/global/intl.js +281 -0
- package/dist/collection/global/services/__mocks__/http-service.js +130 -0
- package/dist/collection/global/services/http-service.js +50 -0
- package/dist/collection/lang/lang.js +5 -0
- package/dist/collection/lang/missing.js +43 -0
- package/dist/collection/lang/piglatin.js +101 -0
- package/dist/docs/docs.d.ts +435 -0
- package/dist/docs/docs.json +14178 -0
- package/dist/docs/props-reference.json +2079 -0
- package/dist/docs/skill/index.md +33 -0
- package/dist/docs/skill/wm-action-menu.md +116 -0
- package/dist/docs/skill/wm-button.md +121 -0
- package/dist/docs/skill/wm-chart-bar.md +156 -0
- package/dist/docs/skill/wm-chart-column.md +122 -0
- package/dist/docs/skill/wm-chart-legend.md +91 -0
- package/dist/docs/skill/wm-chart-slice.md +101 -0
- package/dist/docs/skill/wm-chart-stack.md +147 -0
- package/dist/docs/skill/wm-chart.md +139 -0
- package/dist/docs/skill/wm-date-range.md +176 -0
- package/dist/docs/skill/wm-datepicker.md +153 -0
- package/dist/docs/skill/wm-file-list.md +105 -0
- package/dist/docs/skill/wm-file.md +91 -0
- package/dist/docs/skill/wm-flyout.md +209 -0
- package/dist/docs/skill/wm-input.md +134 -0
- package/dist/docs/skill/wm-line-chart.md +135 -0
- package/dist/docs/skill/wm-menuitem.md +64 -0
- package/dist/docs/skill/wm-modal-footer.md +81 -0
- package/dist/docs/skill/wm-modal-header.md +71 -0
- package/dist/docs/skill/wm-modal.md +172 -0
- package/dist/docs/skill/wm-navigation-hamburger.md +61 -0
- package/dist/docs/skill/wm-navigation-item.md +78 -0
- package/dist/docs/skill/wm-navigation.md +82 -0
- package/dist/docs/skill/wm-navigator.md +106 -0
- package/dist/docs/skill/wm-nested-select.md +160 -0
- package/dist/docs/skill/wm-optgroup.md +72 -0
- package/dist/docs/skill/wm-option.md +67 -0
- package/dist/docs/skill/wm-pagination.md +114 -0
- package/dist/docs/skill/wm-progress-indicator.md +75 -0
- package/dist/docs/skill/wm-progress-monitor.md +120 -0
- package/dist/docs/skill/wm-progress-slice.md +67 -0
- package/dist/docs/skill/wm-search.md +180 -0
- package/dist/docs/skill/wm-select.md +169 -0
- package/dist/docs/skill/wm-snackbar.md +130 -0
- package/dist/docs/skill/wm-tab-item.md +45 -0
- package/dist/docs/skill/wm-tab-list.md +139 -0
- package/dist/docs/skill/wm-tab-panel.md +39 -0
- package/dist/docs/skill/wm-tag-input.md +187 -0
- package/dist/docs/skill/wm-tag-option.md +60 -0
- package/dist/docs/skill/wm-textarea.md +102 -0
- package/dist/docs/skill/wm-timepicker.md +156 -0
- package/dist/docs/skill/wm-toggletip.md +98 -0
- package/dist/docs/skill/wm-uploader.md +154 -0
- package/dist/docs/skill/wm-wrapper.md +5 -0
- package/dist/esm/app-globals-a1092590.js +101 -0
- package/dist/{ripple/chartFunctions-CmeM8Tyx.js → esm/chartFunctions-58637dc9.js} +159 -3
- package/dist/{ripple/functions-DVLl0rH_.js → esm/functions-65f1594c.js} +374 -7830
- package/dist/esm/index-3425d80d.js +1813 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/interfaces-8778346d.js +77 -0
- package/dist/{ripple/intl-7p27BJSM.js → esm/intl-d518f362.js} +11 -4
- package/dist/esm/loader.js +11 -0
- package/dist/{ripple → esm}/priv-calendar.entry.js +143 -133
- package/dist/esm/priv-chart-popover-old.entry.js +142 -0
- package/dist/esm/priv-chart-popover_2.entry.js +199 -0
- package/dist/{ripple → esm}/priv-navigator-button.entry.js +5 -4
- package/dist/{ripple → esm}/priv-navigator-item.entry.js +5 -4
- package/dist/{ripple → esm}/priv-option-list.entry.js +18 -16
- package/dist/esm/ripple.js +20 -0
- package/dist/esm/wm-action-menu_2.entry.js +520 -0
- package/dist/{ripple/wm-modal-header.entry.js → esm/wm-button.entry.js} +264 -24
- package/dist/esm/wm-chart-bar.entry.js +440 -0
- package/dist/esm/wm-chart-column.entry.js +625 -0
- package/dist/{ripple → esm}/wm-chart-slice.entry.js +6 -1
- package/dist/esm/wm-chart-stack.entry.js +443 -0
- package/dist/esm/wm-chart.entry.js +159 -0
- package/dist/{ripple → esm}/wm-date-range.entry.js +224 -114
- package/dist/esm/wm-datepicker.entry.js +395 -0
- package/dist/{ripple → esm}/wm-file-list.entry.js +5 -4
- package/dist/{ripple → esm}/wm-file.entry.js +48 -24
- package/dist/esm/wm-flyout.entry.js +174 -0
- package/dist/{ripple → esm}/wm-input.entry.js +23 -7
- package/dist/{ripple → esm}/wm-line-chart.entry.js +182 -94
- package/dist/esm/wm-modal-pss_3.entry.js +214 -0
- package/dist/esm/wm-modal_3.entry.js +232 -0
- package/dist/esm/wm-navigation_3.entry.js +182 -0
- package/dist/{ripple → esm}/wm-navigator.entry.js +26 -64
- package/dist/{ripple → esm}/wm-nested-select.entry.js +35 -25
- package/dist/{ripple → esm}/wm-optgroup.entry.js +17 -5
- package/dist/esm/wm-option_2.entry.js +531 -0
- package/dist/{ripple → esm}/wm-pagination.entry.js +16 -14
- package/dist/esm/wm-progress-indicator_3.entry.js +198 -0
- package/dist/{ripple → esm}/wm-search.entry.js +15 -31
- package/dist/{ripple → esm}/wm-snackbar.entry.js +32 -45
- package/dist/esm/wm-tab-item_3.entry.js +351 -0
- package/dist/{ripple → esm}/wm-tag-input.entry.js +169 -65
- package/dist/{ripple → esm}/wm-tag-option.entry.js +14 -2
- package/dist/{ripple/wm-menuitem.entry.js → esm/wm-textarea.entry.js} +65 -100
- package/dist/{ripple → esm}/wm-timepicker.entry.js +33 -12
- package/dist/{ripple → esm}/wm-toggletip.entry.js +105 -33
- package/dist/esm/wm-uploader.entry.js +337 -0
- package/dist/{ripple → esm}/wm-wrapper.entry.js +1 -1
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/loader/cdn.js +1 -0
- package/dist/loader/index.cjs.js +1 -0
- package/dist/loader/index.d.ts +24 -0
- package/dist/loader/index.es2017.js +1 -0
- package/dist/loader/index.js +2 -0
- package/dist/loader/package.json +11 -0
- package/dist/ripple/index.esm.js +0 -1
- package/dist/ripple/p-0d364411.entry.js +1 -0
- package/dist/ripple/p-156c4d1d.entry.js +1 -0
- package/dist/ripple/{wm-modal-footer.entry.js → p-26d8c356.entry.js} +1 -44
- package/dist/ripple/p-2b23ce49.entry.js +1 -0
- package/dist/ripple/p-2b7cc2c1.entry.js +1 -0
- package/dist/ripple/p-34bde06a.entry.js +1 -0
- package/dist/ripple/p-35db9386.entry.js +1 -0
- package/dist/ripple/p-38a987ac.entry.js +1 -0
- package/dist/ripple/p-38b05894.entry.js +1 -0
- package/dist/ripple/p-38dee4ab.entry.js +1 -0
- package/dist/ripple/p-3a19d019.entry.js +1 -0
- package/dist/ripple/p-451d4de2.js +1 -0
- package/dist/ripple/p-507f2cf4.entry.js +1 -0
- package/dist/ripple/p-59f74ead.entry.js +1 -0
- package/dist/ripple/p-5c2fc42a.entry.js +1 -0
- package/dist/ripple/p-680d7606.entry.js +1 -0
- package/dist/ripple/p-683264db.js +1 -0
- package/dist/ripple/p-6db681c8.entry.js +1 -0
- package/dist/ripple/p-6e3c2bbc.js +1 -0
- package/dist/ripple/p-6f1cabab.entry.js +1 -0
- package/dist/ripple/p-72d135ee.entry.js +1 -0
- package/dist/ripple/p-7799953c.entry.js +1 -0
- package/dist/ripple/p-83c3db60.js +2 -0
- package/dist/ripple/{wm-progress-monitor.entry.js → p-83cdad78.entry.js} +1 -71
- package/dist/ripple/p-87ef0cfa.entry.js +1 -0
- package/dist/ripple/p-88e44511.entry.js +1 -0
- package/dist/ripple/p-8f8e4eb8.entry.js +1 -0
- package/dist/ripple/p-936adffb.entry.js +1 -0
- package/dist/ripple/p-9755192c.entry.js +1 -0
- package/dist/ripple/p-9c5c591b.js +1 -0
- package/dist/ripple/p-9ea38d96.entry.js +1 -0
- package/dist/ripple/p-be3e4e7c.entry.js +1 -0
- package/dist/ripple/p-c9c7df12.entry.js +1 -0
- package/dist/ripple/p-d7a1be0b.entry.js +1 -0
- package/dist/ripple/p-dab86523.entry.js +1 -0
- package/dist/ripple/{wm-tab-list.entry.js → p-e4aa6e27.entry.js} +1 -175
- package/dist/ripple/p-ebe9f38c.js +1 -0
- package/dist/ripple/p-ed053612.entry.js +1 -0
- package/dist/ripple/p-f43f621b.entry.js +1 -0
- package/dist/ripple/p-f48d30d6.entry.js +1 -0
- package/dist/ripple/{wm-action-menu.entry.js → p-f6aad57c.entry.js} +1 -201
- package/dist/ripple/p-f6e1beb5.entry.js +1 -0
- package/dist/ripple/p-fc843bb8.entry.js +1 -0
- package/dist/ripple/{priv-chart-popover.entry.js → p-fd997764.entry.js} +1 -134
- package/dist/ripple/p-fffb46ad.entry.js +1 -0
- package/dist/ripple/ripple.esm.js +1 -48
- package/dist/types/components/charts/chartFunctions.d.ts +15 -2
- package/dist/types/components/charts/priv-chart-popover/priv-chart-popover.d.ts +25 -11
- package/dist/types/components/charts/priv-chart-popover-old/priv-chart-popover-old.d.ts +31 -0
- package/dist/types/components/charts/wm-chart/wm-chart-slice.d.ts +52 -0
- package/dist/types/components/charts/wm-chart/wm-chart.d.ts +113 -1
- package/dist/types/components/charts/wm-chart-bar/wm-chart-bar.d.ts +195 -0
- package/dist/types/components/charts/wm-chart-column/wm-chart-column.d.ts +184 -0
- package/dist/types/components/charts/wm-chart-legend/wm-chart-legend.d.ts +110 -0
- package/dist/types/components/charts/wm-chart-stack/wm-chart-stack.d.ts +194 -0
- package/dist/types/components/charts/wm-line-chart/wm-line-chart.d.ts +156 -11
- package/dist/types/components/charts/wm-progress-monitor/wm-progress-indicator.d.ts +53 -1
- package/dist/types/components/charts/wm-progress-monitor/wm-progress-monitor.d.ts +85 -0
- package/dist/types/components/charts/wm-progress-monitor/wm-progress-slice.d.ts +44 -0
- package/dist/types/components/datepickers/priv-calendar/priv-calendar.d.ts +19 -3
- package/dist/types/components/datepickers/wm-date-range.d.ts +205 -14
- package/dist/types/components/datepickers/wm-datepicker.d.ts +189 -11
- package/dist/types/components/selects/priv-option-list/priv-option-list.d.ts +6 -0
- package/dist/types/components/selects/wm-nested-select/wm-nested-select.d.ts +165 -1
- package/dist/types/components/selects/wm-optgroup/wm-optgroup.d.ts +87 -0
- package/dist/types/components/selects/wm-option/wm-option.d.ts +117 -0
- package/dist/types/components/selects/wm-select/wm-select.d.ts +193 -12
- package/dist/types/components/wm-action-menu/wm-action-menu.d.ts +207 -2
- package/dist/types/components/wm-button/wm-button.d.ts +191 -0
- package/dist/types/components/wm-file/wm-file.d.ts +110 -1
- package/dist/types/components/wm-file-list/wm-file-list.d.ts +72 -0
- package/dist/types/components/wm-flyout/wm-flyout.d.ts +205 -0
- package/dist/types/components/wm-input/wm-input.d.ts +161 -1
- package/dist/types/components/wm-menuitem/wm-menuitem.d.ts +79 -0
- package/dist/types/components/wm-modal/wm-modal-footer.d.ts +54 -0
- package/dist/types/components/wm-modal/wm-modal-header.d.ts +30 -0
- package/dist/types/components/wm-modal/wm-modal.d.ts +160 -0
- package/dist/types/components/wm-modal-pss/wm-modal-pss-footer.d.ts +4 -0
- package/dist/types/components/wm-modal-pss/wm-modal-pss-header.d.ts +4 -0
- package/dist/types/components/wm-modal-pss/wm-modal-pss.d.ts +6 -0
- package/dist/types/components/wm-navigation/wm-navigation-hamburger.d.ts +34 -0
- package/dist/types/components/wm-navigation/wm-navigation-item.d.ts +41 -0
- package/dist/types/components/wm-navigation/wm-navigation.d.ts +57 -0
- package/dist/types/components/wm-navigator/priv-navigator-button/priv-navigator-button.d.ts +4 -0
- package/dist/types/components/wm-navigator/priv-navigator-item/priv-navigator-item.d.ts +4 -0
- package/dist/types/components/wm-navigator/wm-navigator.d.ts +93 -4
- package/dist/types/components/wm-pagination/wm-pagination.d.ts +100 -1
- package/dist/types/components/wm-search/wm-search.d.ts +158 -6
- package/dist/types/components/wm-snackbar/wm-snackbar.d.ts +103 -1
- package/dist/types/components/wm-tabs/wm-tab-item/wm-tab-item.d.ts +55 -3
- package/dist/types/components/wm-tabs/wm-tab-list/wm-tab-list.d.ts +119 -20
- package/dist/types/components/wm-tabs/wm-tab-panel/wm-tab-panel.d.ts +35 -2
- package/dist/types/components/wm-tag-input/wm-tag-input.d.ts +199 -5
- package/dist/types/components/wm-tag-input/wm-tag-option/wm-tag-option.d.ts +68 -0
- package/dist/types/components/wm-textarea/wm-textarea.d.ts +99 -0
- package/dist/types/components/wm-timepicker/wm-timepicker.d.ts +147 -0
- package/dist/types/components/wm-toggletip/wm-toggletip.d.ts +88 -2
- package/dist/types/components/wm-uploader/wm-uploader.d.ts +145 -3
- package/dist/types/components/wm-wrapper/wm-wrapper.d.ts +3 -0
- package/dist/types/components.d.ts +11523 -95
- package/dist/types/global/functions.d.ts +7 -2
- package/dist/types/global/interfaces.d.ts +92 -2
- package/dist/types/global/intl.d.ts +3 -0
- package/dist/types/stencil-public-runtime.d.ts +0 -28
- package/package.json +4 -33
- package/dist/components/index.d.ts +0 -33
- package/dist/components/priv-calendar.d.ts +0 -11
- package/dist/components/priv-chart-popover.d.ts +0 -11
- package/dist/components/priv-navigator-button.d.ts +0 -11
- package/dist/components/priv-navigator-item.d.ts +0 -11
- package/dist/components/priv-option-list.d.ts +0 -11
- package/dist/components/wm-action-menu.d.ts +0 -11
- package/dist/components/wm-button.d.ts +0 -11
- package/dist/components/wm-chart-slice.d.ts +0 -11
- package/dist/components/wm-chart.d.ts +0 -11
- package/dist/components/wm-date-range.d.ts +0 -11
- package/dist/components/wm-datepicker.d.ts +0 -11
- package/dist/components/wm-file-list.d.ts +0 -11
- package/dist/components/wm-file.d.ts +0 -11
- package/dist/components/wm-flyout.d.ts +0 -11
- package/dist/components/wm-input.d.ts +0 -11
- package/dist/components/wm-line-chart.d.ts +0 -11
- package/dist/components/wm-menuitem.d.ts +0 -11
- package/dist/components/wm-modal-footer.d.ts +0 -11
- package/dist/components/wm-modal-header.d.ts +0 -11
- package/dist/components/wm-modal-pss-footer.d.ts +0 -11
- package/dist/components/wm-modal-pss-header.d.ts +0 -11
- package/dist/components/wm-modal-pss.d.ts +0 -11
- package/dist/components/wm-modal.d.ts +0 -11
- package/dist/components/wm-navigation-hamburger.d.ts +0 -11
- package/dist/components/wm-navigation-item.d.ts +0 -11
- package/dist/components/wm-navigation.d.ts +0 -11
- package/dist/components/wm-navigator.d.ts +0 -11
- package/dist/components/wm-nested-select.d.ts +0 -11
- package/dist/components/wm-optgroup.d.ts +0 -11
- package/dist/components/wm-option.d.ts +0 -11
- package/dist/components/wm-pagination.d.ts +0 -11
- package/dist/components/wm-progress-indicator.d.ts +0 -11
- package/dist/components/wm-progress-monitor.d.ts +0 -11
- package/dist/components/wm-progress-slice.d.ts +0 -11
- package/dist/components/wm-search.d.ts +0 -11
- package/dist/components/wm-select.d.ts +0 -11
- package/dist/components/wm-snackbar.d.ts +0 -11
- package/dist/components/wm-tab-item.d.ts +0 -11
- package/dist/components/wm-tab-list.d.ts +0 -11
- package/dist/components/wm-tab-panel.d.ts +0 -11
- package/dist/components/wm-tag-input.d.ts +0 -11
- package/dist/components/wm-tag-option.d.ts +0 -11
- package/dist/components/wm-textarea.d.ts +0 -11
- package/dist/components/wm-timepicker.d.ts +0 -11
- package/dist/components/wm-toggletip.d.ts +0 -11
- package/dist/components/wm-uploader.d.ts +0 -11
- package/dist/components/wm-wrapper.d.ts +0 -11
- package/dist/ripple/index-CU5QNCKv.js +0 -4167
- package/dist/ripple/interfaces-CrANcZM9.js +0 -53
- package/dist/ripple/wm-button.entry.js +0 -197
- package/dist/ripple/wm-chart.entry.js +0 -157
- package/dist/ripple/wm-modal-pss-footer.entry.js +0 -40
- package/dist/ripple/wm-modal-pss-header.entry.js +0 -39
- package/dist/ripple/wm-navigation-hamburger.entry.js +0 -48
- package/dist/ripple/wm-navigation-item.entry.js +0 -18
- package/dist/ripple/wm-option.entry.js +0 -171
- package/dist/ripple/wm-progress-slice.entry.js +0 -13
- package/dist/ripple/wm-select.entry.js +0 -249
- package/dist/ripple/wm-tab-item.entry.js +0 -63
- package/dist/ripple/wm-uploader.entry.js +0 -313
|
@@ -0,0 +1,914 @@
|
|
|
1
|
+
import { h, Host, forceUpdate, } from "@stencil/core";
|
|
2
|
+
import { chartPalettes, patternKey, } from "../../../global/interfaces";
|
|
3
|
+
import { suffixNumber, renderInstructionsText, findLargestNiceInterval, getMaxTicks, findNiceRoundNumber, formatDisplayValue, groupProcessedData, computeLegendData, sortGroupedData, inferDecimalPlacesForUnitValue, } from "../chartFunctions";
|
|
4
|
+
import { chartMessages } from "../../../global/intl";
|
|
5
|
+
import { isElOrChild, debounce } from "../../../global/functions";
|
|
6
|
+
/**
|
|
7
|
+
* Renders a vertical column chart for comparing values across nominal categories or showing
|
|
8
|
+
* distribution across interval/ratio ranges. Data and configuration are set via JavaScript
|
|
9
|
+
* properties (`chart.config` and `chart.data`) — not HTML attributes. Supports single-color,
|
|
10
|
+
* discrete palette, semantic palette, and grouped columns.
|
|
11
|
+
*
|
|
12
|
+
* **Preferred** over wm-chart's bar subtypes for comparison and distribution use cases.
|
|
13
|
+
* Use this component (or wm-chart-bar) instead of `<wm-chart chart-type="bar*">`. When
|
|
14
|
+
* columns exceed available width, the chart scrolls horizontally.
|
|
15
|
+
*
|
|
16
|
+
* @category Data Visualization
|
|
17
|
+
* @displayName Column Chart
|
|
18
|
+
*
|
|
19
|
+
* @keyboardInteraction
|
|
20
|
+
* - **Tab**: Enters the chart wrapper.
|
|
21
|
+
* - **Arrow Down / Right**: Focuses the first column; subsequent presses cycle to the next.
|
|
22
|
+
* - **Arrow Up / Left**: Cycles to the previous column.
|
|
23
|
+
* - **Enter**: Activates the popover button when the popover is open.
|
|
24
|
+
* - **Escape**: Closes the open popover.
|
|
25
|
+
* - **Tab** (from within): Exits the chart and clears focus.
|
|
26
|
+
*
|
|
27
|
+
* @accessibility
|
|
28
|
+
* - `config.label` is required — used as the chart's `aria-label`.
|
|
29
|
+
* - Each column receives an `aria-label` composed of the category axis label, group name (if
|
|
30
|
+
* grouped), bar legend, and display value.
|
|
31
|
+
* - The chart renders with `role="application"` and `aria-roledescription="Interactive chart"`.
|
|
32
|
+
* - In `print-mode`, keyboard interaction instructions are removed from the DOM.
|
|
33
|
+
*
|
|
34
|
+
* @usageNotes
|
|
35
|
+
* - Set `id` on the element to use with an external `wm-chart-legend` via `chart-ids`.
|
|
36
|
+
* - Use `print-width` to fix chart width for exported PDFs or print stylesheets (accepts `px`,
|
|
37
|
+
* `in`, or `cm`). The chart will wrap columns across multiple plots when they exceed the
|
|
38
|
+
* available `print-width`.
|
|
39
|
+
* - For grouped charts, each `ChartData` item must include a `groupName` field.
|
|
40
|
+
*
|
|
41
|
+
* @example {html} Single-color column chart
|
|
42
|
+
* <wm-chart-column id="enrollment-chart"></wm-chart-column>
|
|
43
|
+
* <script>
|
|
44
|
+
* const chart = document.querySelector('#enrollment-chart');
|
|
45
|
+
* chart.config = { label: 'Enrollment by term', gridMax: 'auto', valueFormat: 'amount',
|
|
46
|
+
* categoryAxisLabel: 'Term', valueAxisLabel: 'Students' };
|
|
47
|
+
* chart.data = [{ barLegend: 'Fall 2023', amount: 310 }, { barLegend: 'Spring 2024', amount: 280 }];
|
|
48
|
+
* </script>
|
|
49
|
+
*
|
|
50
|
+
* @example {react} Single-color column chart
|
|
51
|
+
* <WmChartColumn ref={chartRef} />
|
|
52
|
+
* // In useEffect: chartRef.current.config = {...}; chartRef.current.data = [...];
|
|
53
|
+
*
|
|
54
|
+
* @example {html} Grouped column chart
|
|
55
|
+
* <wm-chart-column id="grouped-chart"></wm-chart-column>
|
|
56
|
+
* <script>
|
|
57
|
+
* const chart = document.querySelector('#grouped-chart');
|
|
58
|
+
* chart.config = { label: 'Enrollment by term and program', gridMax: 'auto',
|
|
59
|
+
* showLegend: 'bottom' };
|
|
60
|
+
* chart.data = [
|
|
61
|
+
* { barLegend: 'Biology', amount: 120, groupName: 'Fall 2023' },
|
|
62
|
+
* { barLegend: 'English', amount: 95, groupName: 'Fall 2023' },
|
|
63
|
+
* ];
|
|
64
|
+
* </script>
|
|
65
|
+
*
|
|
66
|
+
* @example {react} Grouped column chart
|
|
67
|
+
* <WmChartColumn ref={chartRef} />
|
|
68
|
+
* // In useEffect: chartRef.current.config = {...}; chartRef.current.data = [...];
|
|
69
|
+
*
|
|
70
|
+
*/
|
|
71
|
+
export class ChartColumn {
|
|
72
|
+
constructor() {
|
|
73
|
+
this.gridMax = 0;
|
|
74
|
+
this.isGrouped = false;
|
|
75
|
+
this.legendData = [];
|
|
76
|
+
this.plotColumnWidth = 0;
|
|
77
|
+
this.plotDivisions = 1; // the number of vertical divisions that can fit in a single plot. Divisions refer to either bars or groups depending on chart configuration
|
|
78
|
+
this.userIsPrinting = false;
|
|
79
|
+
this.debouncedAdjustLayout = debounce(() => {
|
|
80
|
+
if (this.config && this.processedData) {
|
|
81
|
+
this.gridInfo = this.calculateGridInfo();
|
|
82
|
+
this.updateSpacing();
|
|
83
|
+
requestAnimationFrame(() => {
|
|
84
|
+
if (this.isPlotWidthLimited) {
|
|
85
|
+
this.determinePlots();
|
|
86
|
+
forceUpdate(this.el);
|
|
87
|
+
}
|
|
88
|
+
if (!this.isPlotWidthLimited) {
|
|
89
|
+
const allPlotAreaEls = this.el.shadowRoot.querySelectorAll(".plot-area");
|
|
90
|
+
allPlotAreaEls.forEach((plotAreaEl) => this.updateScrollFade(plotAreaEl));
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}, 20);
|
|
95
|
+
this.config = undefined;
|
|
96
|
+
this.data = undefined;
|
|
97
|
+
this.printWidth = undefined;
|
|
98
|
+
this.printMode = undefined;
|
|
99
|
+
this.patternMode = undefined;
|
|
100
|
+
this.subinfo = undefined;
|
|
101
|
+
this.processedData = new Map();
|
|
102
|
+
this.gridInfo = undefined;
|
|
103
|
+
this.isKeying = false;
|
|
104
|
+
}
|
|
105
|
+
////////////////////////////////////////////////////////////
|
|
106
|
+
// #region Getters
|
|
107
|
+
////////////////////////////////////////////////////////////
|
|
108
|
+
get colorPalette() {
|
|
109
|
+
var _a;
|
|
110
|
+
let defaultPaletteName = this.isGrouped ? "discrete" : "wmcolor-dataviz-discrete-01";
|
|
111
|
+
let paletteName = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.colors) || defaultPaletteName;
|
|
112
|
+
let palette = [];
|
|
113
|
+
if (paletteName === "semantic") {
|
|
114
|
+
palette = chartPalettes.semantic;
|
|
115
|
+
}
|
|
116
|
+
else if (paletteName === "discrete") {
|
|
117
|
+
palette = chartPalettes.discrete;
|
|
118
|
+
}
|
|
119
|
+
else if (paletteName.startsWith("wmcolor")) {
|
|
120
|
+
palette = [paletteName];
|
|
121
|
+
}
|
|
122
|
+
return palette;
|
|
123
|
+
}
|
|
124
|
+
get sort() {
|
|
125
|
+
var _a;
|
|
126
|
+
return ((_a = this.config) === null || _a === void 0 ? void 0 : _a.sort) || "none"; // default to none
|
|
127
|
+
}
|
|
128
|
+
get showLegend() {
|
|
129
|
+
var _a;
|
|
130
|
+
return ((_a = this.config) === null || _a === void 0 ? void 0 : _a.showLegend) || "none"; // default to none
|
|
131
|
+
}
|
|
132
|
+
get subinfoText() {
|
|
133
|
+
var _a;
|
|
134
|
+
return this.subinfo || ((_a = this.config) === null || _a === void 0 ? void 0 : _a.subinfo) || "";
|
|
135
|
+
}
|
|
136
|
+
get gridVisible() {
|
|
137
|
+
var _a, _b, _c;
|
|
138
|
+
return !!this.gridInfo && ((_a = this.config) === null || _a === void 0 ? void 0 : _a.gridMax) != undefined && ((_c = (_b = this.config) === null || _b === void 0 ? void 0 : _b.showGrid) !== null && _c !== void 0 ? _c : true);
|
|
139
|
+
}
|
|
140
|
+
get flattenedData() {
|
|
141
|
+
return [...this.processedData.values()].flat();
|
|
142
|
+
}
|
|
143
|
+
get columnCount() {
|
|
144
|
+
if (this.isGrouped) {
|
|
145
|
+
return this.processedData.size;
|
|
146
|
+
}
|
|
147
|
+
let count = 0;
|
|
148
|
+
this.processedData.forEach((items) => {
|
|
149
|
+
count += items.length;
|
|
150
|
+
});
|
|
151
|
+
return count;
|
|
152
|
+
}
|
|
153
|
+
get isPlotWidthLimited() {
|
|
154
|
+
var _a;
|
|
155
|
+
return !!((this.printMode || ((_a = this.config) === null || _a === void 0 ? void 0 : _a.printMode) || this.userIsPrinting) && this.printWidth);
|
|
156
|
+
}
|
|
157
|
+
get printWidthPx() {
|
|
158
|
+
var _a, _b, _c;
|
|
159
|
+
const PPI = 96;
|
|
160
|
+
const inchToCm = 1 / 2.54;
|
|
161
|
+
if ((_a = this.printWidth) === null || _a === void 0 ? void 0 : _a.endsWith("px")) {
|
|
162
|
+
return parseFloat(this.printWidth.replace("px", ""));
|
|
163
|
+
}
|
|
164
|
+
else if ((_b = this.printWidth) === null || _b === void 0 ? void 0 : _b.endsWith("in")) {
|
|
165
|
+
return parseFloat(this.printWidth.replace("in", "")) * PPI;
|
|
166
|
+
}
|
|
167
|
+
else if ((_c = this.printWidth) === null || _c === void 0 ? void 0 : _c.endsWith("cm")) {
|
|
168
|
+
return parseFloat(this.printWidth.replace("cm", "")) * PPI * inchToCm;
|
|
169
|
+
}
|
|
170
|
+
return 0;
|
|
171
|
+
}
|
|
172
|
+
getAvailablePlotWidth(padding) {
|
|
173
|
+
// Returns the width available to render columns within, given a total chart width of `printWidth`
|
|
174
|
+
var _a;
|
|
175
|
+
const componentWidth = this.printWidthPx;
|
|
176
|
+
const plotAreaEl = this.el.shadowRoot.querySelector(".plot-area");
|
|
177
|
+
const plotWidth = (_a = plotAreaEl === null || plotAreaEl === void 0 ? void 0 : plotAreaEl.getBoundingClientRect().width) !== null && _a !== void 0 ? _a : 0;
|
|
178
|
+
const plotChromeHorizontal = Math.max(0, componentWidth - plotWidth);
|
|
179
|
+
return Math.max(0, componentWidth - plotChromeHorizontal - 2 * padding);
|
|
180
|
+
}
|
|
181
|
+
// #endregion getters
|
|
182
|
+
////////////////////////////////////////////////////////////
|
|
183
|
+
// #region Component lifecycle
|
|
184
|
+
////////////////////////////////////////////////////////////
|
|
185
|
+
componentDidLoad() {
|
|
186
|
+
const resizeObserver = new ResizeObserver(() => this.debouncedAdjustLayout());
|
|
187
|
+
resizeObserver.observe(this.componentWrapperEl);
|
|
188
|
+
if (this.config && this.data) {
|
|
189
|
+
this.handleConfigDataChange();
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
updateSpacing() {
|
|
193
|
+
if (this.isGrouped) {
|
|
194
|
+
// In grouped charts, label-overhang determines the spacing between columns within a group, AND space between groups themselves
|
|
195
|
+
const valueElements = this.el.shadowRoot.querySelectorAll(".value");
|
|
196
|
+
const maxLabelWidth = Array.from(valueElements).reduce((max, el) => Math.max(max, el.offsetWidth), 0);
|
|
197
|
+
const barWidth = 24;
|
|
198
|
+
let labelOverhang = Math.max(0, (maxLabelWidth - barWidth) / 2);
|
|
199
|
+
this.componentWrapperEl.style.setProperty("--label-overhang", `${labelOverhang}px`);
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
// In ungrouped charts, column spacing is determined by the width of the longest x-axis label
|
|
203
|
+
const measureLabelEls = this.el.shadowRoot.querySelectorAll(".--measure-width");
|
|
204
|
+
const longestLabelWidth = Array.from(measureLabelEls).reduce((max, el) => Math.max(max, el.offsetWidth), 0);
|
|
205
|
+
// Cap at 120px max
|
|
206
|
+
this.plotColumnWidth = Math.min(longestLabelWidth + 1, 120); // add 1px buffer for subpixel rendering
|
|
207
|
+
const chartCenterEl = this.el.shadowRoot.querySelector(".chart-center");
|
|
208
|
+
chartCenterEl === null || chartCenterEl === void 0 ? void 0 : chartCenterEl.style.setProperty("--plot-column-width", `${this.plotColumnWidth}px`);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
// #endregion component lifecycle
|
|
212
|
+
////////////////////////////////////////////////////////////
|
|
213
|
+
// #region Data processing
|
|
214
|
+
////////////////////////////////////////////////////////////
|
|
215
|
+
handleConfigDataChange() {
|
|
216
|
+
if (this.config && this.data) {
|
|
217
|
+
const largest = Math.max(...this.data.map((item) => item.amount));
|
|
218
|
+
if (this.config.gridMax == "auto") {
|
|
219
|
+
this.gridMax = findNiceRoundNumber(largest);
|
|
220
|
+
}
|
|
221
|
+
else if (!!this.config.gridMax) {
|
|
222
|
+
this.gridMax = this.config.gridMax;
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
// fallback to 1 and chart should not render
|
|
226
|
+
this.gridMax = 1;
|
|
227
|
+
}
|
|
228
|
+
this.isGrouped = this.data.some((item) => item.groupName);
|
|
229
|
+
this.processedData = this.buildProcessedData();
|
|
230
|
+
this.plotDivisions = this.isGrouped ? this.processedData.size : this.data.length; // default to total number of items in chart, or number of groups in grouped charts
|
|
231
|
+
this.legendData = this.isGrouped
|
|
232
|
+
? computeLegendData(this.processedData).map((item) => (Object.assign(Object.assign({}, item), { printValue: "" })))
|
|
233
|
+
: computeLegendData(this.processedData);
|
|
234
|
+
this.propagateExternalLegendData();
|
|
235
|
+
this.debouncedAdjustLayout();
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
buildProcessedData() {
|
|
239
|
+
var _a, _b, _c, _d;
|
|
240
|
+
if (!this.data) {
|
|
241
|
+
return new Map();
|
|
242
|
+
}
|
|
243
|
+
let processedData = [];
|
|
244
|
+
const defaultValueFormat = "amount";
|
|
245
|
+
const defaultPrintModeFormat = "amount";
|
|
246
|
+
const fallbackColor = "wmcolor-dataviz-discrete-01";
|
|
247
|
+
const itemTotal = this.data.reduce((acc, item) => acc + item.amount, 0);
|
|
248
|
+
const valueFormat = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.valueFormat) || defaultValueFormat;
|
|
249
|
+
const printModeFormat = ((_b = this.config) === null || _b === void 0 ? void 0 : _b.printModeFormat) || defaultPrintModeFormat;
|
|
250
|
+
const decimalPlaces = (_d = (_c = this.config) === null || _c === void 0 ? void 0 : _c.decimalPlaces) !== null && _d !== void 0 ? _d : 0;
|
|
251
|
+
// For grouped data, matching barLegends share color indices
|
|
252
|
+
const barLegendColorMap = new Map();
|
|
253
|
+
if (this.isGrouped) {
|
|
254
|
+
let incrementingIndex = 0;
|
|
255
|
+
this.data.forEach((item) => {
|
|
256
|
+
if (!barLegendColorMap.has(item.barLegend)) {
|
|
257
|
+
barLegendColorMap.set(item.barLegend, incrementingIndex);
|
|
258
|
+
incrementingIndex++;
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
processedData = this.data.map((item, index) => {
|
|
263
|
+
const colorIndex = this.isGrouped ? barLegendColorMap.get(item.barLegend) || 0 : index;
|
|
264
|
+
const barColor = item.color
|
|
265
|
+
? item.color
|
|
266
|
+
: this.colorPalette.length === 1
|
|
267
|
+
? this.colorPalette[0]
|
|
268
|
+
: this.colorPalette[colorIndex] || fallbackColor;
|
|
269
|
+
const amount = decimalPlaces > 0 ? parseFloat(item.amount.toFixed(decimalPlaces)) : item.amount;
|
|
270
|
+
return {
|
|
271
|
+
barLegend: item.barLegend,
|
|
272
|
+
amount: amount,
|
|
273
|
+
gridPercent: (amount / this.gridMax) * 100,
|
|
274
|
+
displayValue: formatDisplayValue(amount, itemTotal, valueFormat, decimalPlaces),
|
|
275
|
+
printValue: formatDisplayValue(amount, itemTotal, printModeFormat, decimalPlaces),
|
|
276
|
+
color: barColor,
|
|
277
|
+
popoverTitle: item.popoverTitle,
|
|
278
|
+
popoverText: item.popoverText,
|
|
279
|
+
popoverButtonText: item.popoverButtonText,
|
|
280
|
+
groupName: item.groupName,
|
|
281
|
+
};
|
|
282
|
+
});
|
|
283
|
+
if (this.isGrouped) {
|
|
284
|
+
processedData = sortGroupedData(processedData);
|
|
285
|
+
}
|
|
286
|
+
else if (this.sort === "ascending") {
|
|
287
|
+
processedData.sort((a, b) => a.amount - b.amount);
|
|
288
|
+
}
|
|
289
|
+
else if (this.sort === "descending") {
|
|
290
|
+
processedData.sort((a, b) => b.amount - a.amount);
|
|
291
|
+
}
|
|
292
|
+
return groupProcessedData(processedData);
|
|
293
|
+
}
|
|
294
|
+
propagateExternalLegendData() {
|
|
295
|
+
document.querySelectorAll("wm-chart-legend").forEach((legend) => {
|
|
296
|
+
var _a, _b;
|
|
297
|
+
if (legend.chartIds.split(" ").includes(this.el.id)) {
|
|
298
|
+
legend.processedData = this.legendData;
|
|
299
|
+
legend.patternMode = ((_a = this.patternMode) !== null && _a !== void 0 ? _a : (_b = this.config) === null || _b === void 0 ? void 0 : _b.patternMode) ? "vertical" : undefined;
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
calculateGridInfo() {
|
|
304
|
+
var _a, _b, _c;
|
|
305
|
+
const firstBarAreaEl = this.el.shadowRoot.querySelector(".bar-area");
|
|
306
|
+
const barAreaHeight = (_a = firstBarAreaEl === null || firstBarAreaEl === void 0 ? void 0 : firstBarAreaEl.getBoundingClientRect().height) !== null && _a !== void 0 ? _a : 0;
|
|
307
|
+
const maxTicks = barAreaHeight > 0 ? getMaxTicks(barAreaHeight) : 1;
|
|
308
|
+
const { numIntervals, interval } = findLargestNiceInterval(maxTicks, this.gridMax);
|
|
309
|
+
const tickLabels = [];
|
|
310
|
+
for (let i = 1; i <= numIntervals; i++) {
|
|
311
|
+
const tickValue = i * interval;
|
|
312
|
+
const decimalPlaces = (_c = (_b = this.config) === null || _b === void 0 ? void 0 : _b.decimalPlaces) !== null && _c !== void 0 ? _c : inferDecimalPlacesForUnitValue(tickValue);
|
|
313
|
+
tickLabels.push(suffixNumber(tickValue, decimalPlaces));
|
|
314
|
+
}
|
|
315
|
+
return {
|
|
316
|
+
numTicks: numIntervals,
|
|
317
|
+
interval: interval,
|
|
318
|
+
backgroundSize: `${100 / numIntervals}%`,
|
|
319
|
+
tickLabels: tickLabels,
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
determinePlotDivisions(divisionWidth, divisionGap, availableWidth) {
|
|
323
|
+
// Given a uniform division width and gap, determines how many divisions can fit in a row
|
|
324
|
+
let divisionsPerRow = Math.floor((availableWidth + divisionGap) / (divisionWidth + divisionGap));
|
|
325
|
+
if (divisionsPerRow <= 0)
|
|
326
|
+
divisionsPerRow = 1; // In the event no divisions can fit in a row force at least one
|
|
327
|
+
return divisionsPerRow;
|
|
328
|
+
}
|
|
329
|
+
determinePlots() {
|
|
330
|
+
var _a, _b;
|
|
331
|
+
this.componentWrapperEl.style.setProperty("--forced-width", `${this.printWidthPx}px`); // Wrapper width needs to be set so accurate measurements are taken
|
|
332
|
+
if (this.isGrouped) {
|
|
333
|
+
const groupedEdgePadding = 32;
|
|
334
|
+
const availablePlotWidth = this.getAvailablePlotWidth(groupedEdgePadding);
|
|
335
|
+
// By design, each group has the same number of columns and therefore the same width
|
|
336
|
+
const firstGroupEl = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(".bar-area.grouped .group-columns");
|
|
337
|
+
const groupWidth = (_b = firstGroupEl === null || firstGroupEl === void 0 ? void 0 : firstGroupEl.getBoundingClientRect().width) !== null && _b !== void 0 ? _b : 0;
|
|
338
|
+
const firstBarAreaEl = this.el.shadowRoot.querySelector(".bar-area");
|
|
339
|
+
const groupGap = firstBarAreaEl ? parseFloat(getComputedStyle(firstBarAreaEl).columnGap) : 0;
|
|
340
|
+
this.plotDivisions = this.determinePlotDivisions(groupWidth, groupGap, availablePlotWidth);
|
|
341
|
+
}
|
|
342
|
+
else {
|
|
343
|
+
const columnGap = 24;
|
|
344
|
+
const availablePlotWidth = Math.round(this.getAvailablePlotWidth(0));
|
|
345
|
+
this.plotDivisions = this.determinePlotDivisions(this.plotColumnWidth, columnGap, availablePlotWidth);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
// #endregion data processing
|
|
349
|
+
////////////////////////////////////////////////////////////
|
|
350
|
+
// #region Keyboard interaction and Event handling
|
|
351
|
+
////////////////////////////////////////////////////////////
|
|
352
|
+
handleChartKeyDown(ev) {
|
|
353
|
+
switch (ev.key) {
|
|
354
|
+
case "ArrowDown":
|
|
355
|
+
case "ArrowRight":
|
|
356
|
+
ev.preventDefault();
|
|
357
|
+
if (this.el.shadowRoot.activeElement === this.componentWrapperEl) {
|
|
358
|
+
this.focusBar(0);
|
|
359
|
+
}
|
|
360
|
+
break;
|
|
361
|
+
case "Tab":
|
|
362
|
+
this.clearFocus();
|
|
363
|
+
break;
|
|
364
|
+
case "Escape":
|
|
365
|
+
ev.preventDefault();
|
|
366
|
+
ev.stopPropagation();
|
|
367
|
+
if (this.popoverEl.open) {
|
|
368
|
+
this.popoverEl.open = false;
|
|
369
|
+
}
|
|
370
|
+
break;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
handleBarKeyDown(ev, item) {
|
|
374
|
+
const barIdx = this.flattenedData.indexOf(item);
|
|
375
|
+
switch (ev.key) {
|
|
376
|
+
case "ArrowUp":
|
|
377
|
+
case "ArrowLeft":
|
|
378
|
+
ev.preventDefault();
|
|
379
|
+
this.focusBar(barIdx - 1);
|
|
380
|
+
break;
|
|
381
|
+
case "ArrowDown":
|
|
382
|
+
case "ArrowRight":
|
|
383
|
+
ev.preventDefault();
|
|
384
|
+
this.focusBar(barIdx + 1);
|
|
385
|
+
break;
|
|
386
|
+
case "Enter":
|
|
387
|
+
if (this.popoverEl.open) {
|
|
388
|
+
const popoverBtn = this.popoverEl.querySelector("button");
|
|
389
|
+
popoverBtn && popoverBtn.click();
|
|
390
|
+
}
|
|
391
|
+
break;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
handleBarClick(ev, item) {
|
|
395
|
+
this.openPopover(item, { x: ev.clientX, y: ev.clientY });
|
|
396
|
+
this.highlightBar(item);
|
|
397
|
+
}
|
|
398
|
+
handleLegendItemClick(ev) {
|
|
399
|
+
if (ev.target.nodeName === "WM-CHART-LEGEND") {
|
|
400
|
+
const legendEl = ev.target;
|
|
401
|
+
if (legendEl.chartIds.includes(this.el.id)) {
|
|
402
|
+
this.handleLegendFocus(ev.detail.idx);
|
|
403
|
+
this.scrollToBar(ev.detail.idx);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
handleLegendItemHover(ev) {
|
|
408
|
+
if (ev.target.nodeName === "WM-CHART-LEGEND") {
|
|
409
|
+
const legendEl = ev.target;
|
|
410
|
+
if (legendEl.chartIds.includes(this.el.id)) {
|
|
411
|
+
this.handleLegendFocus(ev.detail.idx);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
handleBeforePrint() {
|
|
416
|
+
if (this.printWidth) {
|
|
417
|
+
this.userIsPrinting = true;
|
|
418
|
+
this.handleConfigDataChange();
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
handleAfterPrint() {
|
|
422
|
+
if (this.printWidth) {
|
|
423
|
+
this.userIsPrinting = false;
|
|
424
|
+
this.handleConfigDataChange();
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
handleLegendFocus(idx) {
|
|
428
|
+
var _a;
|
|
429
|
+
if (idx == -1) {
|
|
430
|
+
this.clearHighlights();
|
|
431
|
+
}
|
|
432
|
+
else {
|
|
433
|
+
const barLegend = (_a = this.legendData[idx]) === null || _a === void 0 ? void 0 : _a.barLegend;
|
|
434
|
+
if (barLegend) {
|
|
435
|
+
this.highlightBarsByLegend(barLegend);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
handleDocumentClick(_ev) {
|
|
440
|
+
// Clear highlights when highlight is set from an external legend (not opening a popover)
|
|
441
|
+
if (!this.popoverEl.open) {
|
|
442
|
+
this.clearHighlights();
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
updateScrollFade(plotAreaEl) {
|
|
446
|
+
const fadeDistance = 42;
|
|
447
|
+
if (plotAreaEl.scrollLeft > 0) {
|
|
448
|
+
plotAreaEl.style.setProperty("--left-fade-distance", `${fadeDistance}px`);
|
|
449
|
+
}
|
|
450
|
+
else {
|
|
451
|
+
plotAreaEl.style.setProperty("--left-fade-distance", "0px");
|
|
452
|
+
}
|
|
453
|
+
if (plotAreaEl.scrollLeft + plotAreaEl.clientWidth + 1 < plotAreaEl.scrollWidth) {
|
|
454
|
+
plotAreaEl.style.setProperty("--right-fade-distance", `${fadeDistance}px`);
|
|
455
|
+
}
|
|
456
|
+
else {
|
|
457
|
+
plotAreaEl.style.setProperty("--right-fade-distance", "0px");
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
// #endregion keyboard interaction and event handling
|
|
461
|
+
////////////////////////////////////////////////////////////
|
|
462
|
+
// #region Focus and Highlighting
|
|
463
|
+
////////////////////////////////////////////////////////////
|
|
464
|
+
handleUserIsKeying() {
|
|
465
|
+
this.isKeying = true;
|
|
466
|
+
}
|
|
467
|
+
handleUserIsNotKeying() {
|
|
468
|
+
this.isKeying = false;
|
|
469
|
+
}
|
|
470
|
+
handleComponentBlur(ev) {
|
|
471
|
+
if (!isElOrChild(this.el, ev.relatedTarget)) {
|
|
472
|
+
this.clearFocus();
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
focusBar(barIdx) {
|
|
476
|
+
const bars = this.el.shadowRoot.querySelectorAll(".bar");
|
|
477
|
+
const wrappedIdx = ((barIdx % bars.length) + bars.length) % bars.length;
|
|
478
|
+
const barToFocus = bars[wrappedIdx];
|
|
479
|
+
barToFocus.focus();
|
|
480
|
+
const item = this.flattenedData[wrappedIdx];
|
|
481
|
+
if (item) {
|
|
482
|
+
this.highlightBar(item);
|
|
483
|
+
const cornerOffset = 12;
|
|
484
|
+
this.openPopover(item, {
|
|
485
|
+
x: barToFocus.getBoundingClientRect().left + cornerOffset,
|
|
486
|
+
y: barToFocus.getBoundingClientRect().top + cornerOffset,
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
scrollToBar(barIdx) {
|
|
491
|
+
const labelEls = this.el.shadowRoot.querySelectorAll(`.x-axis .bar-legend`);
|
|
492
|
+
const labelToFocus = labelEls[barIdx];
|
|
493
|
+
const plotAreaParent = labelToFocus === null || labelToFocus === void 0 ? void 0 : labelToFocus.closest(".plot-area");
|
|
494
|
+
if (labelToFocus && plotAreaParent) {
|
|
495
|
+
const labelLeft = labelToFocus.offsetLeft;
|
|
496
|
+
const labelRight = labelLeft + labelToFocus.offsetWidth;
|
|
497
|
+
const scrollLeft = plotAreaParent.scrollLeft;
|
|
498
|
+
const visibleRight = scrollLeft + plotAreaParent.clientWidth;
|
|
499
|
+
const isLabelVisible = labelLeft >= scrollLeft && labelRight <= visibleRight;
|
|
500
|
+
if (!isLabelVisible) {
|
|
501
|
+
plotAreaParent.scrollTo({
|
|
502
|
+
left: labelToFocus.offsetLeft - 12,
|
|
503
|
+
behavior: "smooth",
|
|
504
|
+
});
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
handlePopoverToggled(_ev) {
|
|
509
|
+
setTimeout(() => {
|
|
510
|
+
// allow time for the popover to reopen if the click that closed it was on a bar, to prevent flash
|
|
511
|
+
if (this.popoverEl.open) {
|
|
512
|
+
const chartData = this.popoverEl.chartData;
|
|
513
|
+
const item = this.flattenedData.find((item) => item.barLegend === (chartData === null || chartData === void 0 ? void 0 : chartData.barLegend) && item.groupName === (chartData === null || chartData === void 0 ? void 0 : chartData.groupName));
|
|
514
|
+
item && this.highlightBar(item);
|
|
515
|
+
}
|
|
516
|
+
else {
|
|
517
|
+
this.clearHighlights();
|
|
518
|
+
}
|
|
519
|
+
}, 30);
|
|
520
|
+
}
|
|
521
|
+
openPopover(clickedProcessedData, coords) {
|
|
522
|
+
if (!this.data || !this.config) {
|
|
523
|
+
return;
|
|
524
|
+
}
|
|
525
|
+
let matchingChartData = this.data.find((item) => item.barLegend === clickedProcessedData.barLegend && item.groupName === clickedProcessedData.groupName);
|
|
526
|
+
if (matchingChartData) {
|
|
527
|
+
const popoverButtonText = matchingChartData.popoverButtonText || this.config.popoverButtonText || "";
|
|
528
|
+
this.componentWrapperEl.classList.toggle("hide-focus-ring", !!popoverButtonText);
|
|
529
|
+
this.popoverEl.chartData = matchingChartData;
|
|
530
|
+
this.popoverEl.header = matchingChartData.popoverTitle || this.config.popoverTitle || "";
|
|
531
|
+
this.popoverEl.text = matchingChartData.popoverText || this.config.popoverText || "";
|
|
532
|
+
this.popoverEl.buttonText = popoverButtonText;
|
|
533
|
+
this.popoverEl.coords = coords;
|
|
534
|
+
window.setTimeout(() => {
|
|
535
|
+
this.popoverEl.open = true;
|
|
536
|
+
this.popoverEl.announceContents();
|
|
537
|
+
}, 30);
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
clearHighlights() {
|
|
541
|
+
const barItems = this.el.shadowRoot.querySelectorAll(".bar-wrapper");
|
|
542
|
+
barItems.forEach((barItem) => {
|
|
543
|
+
barItem.classList.remove("faded");
|
|
544
|
+
});
|
|
545
|
+
this.wmChartBarHighlighted.emit({ idx: -1 });
|
|
546
|
+
}
|
|
547
|
+
highlightBar(item) {
|
|
548
|
+
const idx = this.flattenedData.indexOf(item);
|
|
549
|
+
const barItems = this.el.shadowRoot.querySelectorAll(".bar-wrapper");
|
|
550
|
+
barItems.forEach((barItem) => {
|
|
551
|
+
barItem.classList.add("faded");
|
|
552
|
+
});
|
|
553
|
+
barItems[idx].classList.remove("faded");
|
|
554
|
+
const legendIdx = this.legendData.findIndex((legendItem) => legendItem.barLegend === item.barLegend);
|
|
555
|
+
this.wmChartBarHighlighted.emit({ idx: legendIdx });
|
|
556
|
+
}
|
|
557
|
+
highlightBarsByLegend(barLegend) {
|
|
558
|
+
const barItems = this.el.shadowRoot.querySelectorAll(".bar-wrapper");
|
|
559
|
+
barItems.forEach((barItem, idx) => {
|
|
560
|
+
var _a;
|
|
561
|
+
if (((_a = this.flattenedData[idx]) === null || _a === void 0 ? void 0 : _a.barLegend) === barLegend) {
|
|
562
|
+
barItem.classList.remove("faded");
|
|
563
|
+
}
|
|
564
|
+
else {
|
|
565
|
+
barItem.classList.add("faded");
|
|
566
|
+
}
|
|
567
|
+
});
|
|
568
|
+
}
|
|
569
|
+
clearFocus() {
|
|
570
|
+
if (this.popoverEl.open) {
|
|
571
|
+
this.popoverEl.open = false;
|
|
572
|
+
}
|
|
573
|
+
this.clearHighlights();
|
|
574
|
+
}
|
|
575
|
+
// #endregion focus and highlighting
|
|
576
|
+
////////////////////////////////////////////////////////////
|
|
577
|
+
// #region Rendering
|
|
578
|
+
////////////////////////////////////////////////////////////
|
|
579
|
+
renderBarValue(item, barPercent) {
|
|
580
|
+
var _a, _b, _c;
|
|
581
|
+
return (h("div", { class: "value vertical", style: { "--offset": `calc(${barPercent}% + 12px)` } }, h("span", null, item.displayValue), ((_a = this.config) === null || _a === void 0 ? void 0 : _a.valueFormat) === "percentage" && this.isGrouped && (h("span", { class: "supplemental-value" }, "(", item.amount.toFixed((_c = (_b = this.config) === null || _b === void 0 ? void 0 : _b.decimalPlaces) !== null && _c !== void 0 ? _c : 0), ")"))));
|
|
582
|
+
}
|
|
583
|
+
renderGrid() {
|
|
584
|
+
var _a;
|
|
585
|
+
const backgroundSize = (_a = this.gridInfo) === null || _a === void 0 ? void 0 : _a.backgroundSize;
|
|
586
|
+
return h("div", { class: "grid-lines", style: { "--background-size": backgroundSize } });
|
|
587
|
+
}
|
|
588
|
+
renderYAxis() {
|
|
589
|
+
var _a, _b;
|
|
590
|
+
const numTicks = ((_a = this.gridInfo) === null || _a === void 0 ? void 0 : _a.numTicks) || 1;
|
|
591
|
+
return (h("div", { class: `y-axis ${this.isGrouped ? "grouped" : ""}`, "aria-hidden": "true" }, (_b = this.gridInfo) === null || _b === void 0 ? void 0 :
|
|
592
|
+
_b.tickLabels.map((label, idx) => {
|
|
593
|
+
const percentFromTop = 100 - ((idx + 1) / numTicks) * 100;
|
|
594
|
+
return (h("div", { class: "tick", key: label, style: { "--offset": `${percentFromTop}%` } }, h("span", null, label)));
|
|
595
|
+
}), h("div", { class: "tick zero" }, h("span", null, "0"))));
|
|
596
|
+
}
|
|
597
|
+
renderLegend(orientation) {
|
|
598
|
+
var _a, _b, _c, _d, _e;
|
|
599
|
+
return (h("div", { class: `legend --${orientation} --${this.showLegend}` }, h("wm-chart-legend", { orientation: orientation, chartIds: this.el.id, processedData: this.legendData, printMode: (_c = (_a = this.printMode) !== null && _a !== void 0 ? _a : (_b = this.config) === null || _b === void 0 ? void 0 : _b.printMode) !== null && _c !== void 0 ? _c : false, patternMode: ((_d = this.patternMode) !== null && _d !== void 0 ? _d : (_e = this.config) === null || _e === void 0 ? void 0 : _e.patternMode) ? "vertical" : undefined, onWmLegendItemClick: (ev) => this.handleLegendItemClick(ev), onWmLegendItemHover: (ev) => this.handleLegendItemHover(ev) })));
|
|
600
|
+
}
|
|
601
|
+
renderPlotContainers() {
|
|
602
|
+
const totalDivisions = this.isGrouped ? this.processedData.size : this.flattenedData.length;
|
|
603
|
+
const plotCount = Math.ceil(totalDivisions / this.plotDivisions);
|
|
604
|
+
return (h("div", { class: "chart-center", style: {
|
|
605
|
+
"--plot-column-count": this.plotDivisions.toString(),
|
|
606
|
+
"--plot-column-width": this.isGrouped ? "1fr" : `${this.plotColumnWidth}px`,
|
|
607
|
+
} }, Array.from({ length: plotCount }, (_, plotIdx) => this.renderPlot(plotIdx, totalDivisions))));
|
|
608
|
+
}
|
|
609
|
+
renderPlot(plotIdx, totalDivisions) {
|
|
610
|
+
var _a, _b;
|
|
611
|
+
const indexStart = plotIdx * this.plotDivisions;
|
|
612
|
+
const indexSpan = Math.min(this.plotDivisions, totalDivisions - indexStart);
|
|
613
|
+
const columnIndices = Array.from({ length: indexSpan }, (_, j) => indexStart + j);
|
|
614
|
+
return (h("div", { class: "plot-container", key: `plot-container-${plotIdx}` }, h("div", { class: "left-axis-label" }, h("span", { class: "axis-label-text" }, (_a = this.config) === null || _a === void 0 ? void 0 : _a.valueAxisLabel)), this.gridVisible && this.renderYAxis(), h("div", { class: `plot-area ${this.isGrouped ? "grouped" : ""} ${this.isPlotWidthLimited ? "no-scroll" : ""}`, onScroll: (ev) => (this.isPlotWidthLimited ? undefined : this.updateScrollFade(ev.target)), tabindex: "-1" }, this.gridVisible && this.renderGrid(), h("div", { class: `bar-area ${this.isKeying ? "user-is-keying" : ""} ${this.isGrouped ? "grouped" : ""}` }, ((_b = this.config) === null || _b === void 0 ? void 0 : _b.gridMax) != undefined && this.renderColumns(columnIndices)), h("div", { class: `x-axis ${this.isGrouped ? "grouped" : ""}` }, this.renderXAxis(columnIndices)), this.isPlotWidthLimited && this.renderCategoryAxisLabel()), !this.isPlotWidthLimited && this.renderCategoryAxisLabel()));
|
|
615
|
+
}
|
|
616
|
+
renderCategoryAxisLabel() {
|
|
617
|
+
var _a;
|
|
618
|
+
return (h("div", { class: "bottom-axis-label" }, h("span", { class: "axis-label-text" }, (_a = this.config) === null || _a === void 0 ? void 0 : _a.categoryAxisLabel)));
|
|
619
|
+
}
|
|
620
|
+
renderColumns(indices) {
|
|
621
|
+
// indices refers to bar index or group index, depending on chart configuration
|
|
622
|
+
const columnEls = [];
|
|
623
|
+
const groupKeys = [...this.processedData.keys()];
|
|
624
|
+
indices.forEach((idx) => {
|
|
625
|
+
if (this.isGrouped) {
|
|
626
|
+
const groupName = groupKeys[idx];
|
|
627
|
+
const items = this.processedData.get(groupName);
|
|
628
|
+
columnEls.push(h("div", { key: `group-${groupName}`, class: "group-columns" }, items.map((item) => this.renderBar(item, idx)), h("div", { class: "group-underline" })));
|
|
629
|
+
}
|
|
630
|
+
else {
|
|
631
|
+
const item = this.flattenedData[idx];
|
|
632
|
+
columnEls.push(this.renderBar(item, idx));
|
|
633
|
+
}
|
|
634
|
+
});
|
|
635
|
+
return columnEls;
|
|
636
|
+
}
|
|
637
|
+
renderBar(item, idx) {
|
|
638
|
+
var _a, _b, _c, _d;
|
|
639
|
+
if (!this.gridInfo)
|
|
640
|
+
return;
|
|
641
|
+
const effectiveGridMax = this.gridInfo.numTicks * this.gridInfo.interval;
|
|
642
|
+
const barPercent = effectiveGridMax > 0 ? (item.amount / effectiveGridMax) * 100 : 0;
|
|
643
|
+
let patternClass = "";
|
|
644
|
+
if ((_a = this.patternMode) !== null && _a !== void 0 ? _a : (_b = this.config) === null || _b === void 0 ? void 0 : _b.patternMode) {
|
|
645
|
+
patternClass = (_c = patternKey[item.color]) !== null && _c !== void 0 ? _c : "";
|
|
646
|
+
}
|
|
647
|
+
return (h("div", { key: `bar-${item.groupName}-${item.barLegend}-${idx}`, class: "bar-wrapper" }, this.renderBarValue(item, barPercent), h("div", { class: `bar ${patternClass}`, style: { "--bar-length": `${barPercent}%`, "--bar-color": `var(--${item.color})` }, onClick: (ev) => this.handleBarClick(ev, item), onKeyDown: (ev) => this.handleBarKeyDown(ev, item), tabindex: "-1", "aria-label": `${(_d = this.config) === null || _d === void 0 ? void 0 : _d.categoryAxisLabel}, ${item.groupName ? `${item.groupName},` : ""} ${item.barLegend} ${item.displayValue}` })));
|
|
648
|
+
}
|
|
649
|
+
renderXAxis(indices) {
|
|
650
|
+
const legends = [];
|
|
651
|
+
if (this.isGrouped) {
|
|
652
|
+
const groupNames = [...this.processedData.keys()];
|
|
653
|
+
indices.forEach((idx) => {
|
|
654
|
+
const groupName = groupNames[idx];
|
|
655
|
+
legends.push(h("div", { key: `legend-${groupName}`, class: "group-legend" }, h("span", null, groupName)));
|
|
656
|
+
});
|
|
657
|
+
}
|
|
658
|
+
else {
|
|
659
|
+
const flatData = this.flattenedData;
|
|
660
|
+
indices.forEach((idx) => {
|
|
661
|
+
const item = flatData[idx];
|
|
662
|
+
if (!item)
|
|
663
|
+
return;
|
|
664
|
+
legends.push(h("div", { key: `legend-${idx}-${item.barLegend}`, class: "bar-legend" }, h("span", null, item.barLegend), h("div", { class: "--measure-wrapper" }, h("span", { class: "--measure-width" }, item.barLegend))));
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
return legends;
|
|
668
|
+
}
|
|
669
|
+
// #endregion rendering
|
|
670
|
+
render() {
|
|
671
|
+
var _a, _b, _c, _d, _e, _f;
|
|
672
|
+
return (h(Host, { key: '9d479e3ec4009da93674780ef3acbfdc3d843cc2' }, h("div", { key: '3073e31e87ae929ea4d338159d7c47f9df7916e7', class: "popover-wrapper" }, h("priv-chart-popover", { key: 'ab816b2f99987b30abc0b5bc87256b7e86ade640', ref: (el) => (this.popoverEl = el), onIntChartPopoverToggled: (ev) => this.handlePopoverToggled(ev) })), h("div", { key: '097ff1a745cb73af419d723865daec586c107c17', ref: (el) => (this.componentWrapperEl = el), class: `component-wrapper ${((_a = this.printMode) !== null && _a !== void 0 ? _a : (_b = this.config) === null || _b === void 0 ? void 0 : _b.printMode) ? "print-mode" : ""}`, style: this.isPlotWidthLimited ? { "--forced-width": `${this.printWidthPx}px` } : undefined, tabindex: "0", role: "application", onKeyDown: (ev) => this.handleChartKeyDown(ev), onBlur: (ev) => this.handleComponentBlur(ev), "aria-roledescription": chartMessages.interactiveChart, "aria-describedby": "chart-instructions", "aria-label": (_c = this.config) === null || _c === void 0 ? void 0 : _c.label }, ((_e = (_d = this.config) === null || _d === void 0 ? void 0 : _d.showLabel) !== null && _e !== void 0 ? _e : true) && (h("label", { key: '5cd67325246ce2d354e46e535ec0a12ec804e9fb', id: "label", class: "label" }, h("span", { key: '70636108033bb273dce23bfb20c3a95b230eada7', class: "label-text" }, (_f = this.config) === null || _f === void 0 ? void 0 : _f.label), this.subinfoText ? h("span", { class: "subinfo" }, this.subinfoText) : "")), this.showLegend === "top" && this.renderLegend("horizontal"), h("div", { key: 'f358d1ebcc925a05f26a49ba0350cc7e937575f3', class: "chart-wrapper" }, h("div", { key: 'f7187f76ae1833a492fc1f7e3e1fd02443246ebe', class: "chart-left-side" }, this.showLegend === "left" && this.renderLegend("vertical")), this.data && this.renderPlotContainers(), h("div", { key: '4b8cce2f3b29a95a4f4cc2ff5e4011080d857c35', class: "chart-right-side" }, this.showLegend === "right" && this.renderLegend("vertical"))), this.showLegend === "bottom" && this.renderLegend("horizontal"), renderInstructionsText())));
|
|
673
|
+
}
|
|
674
|
+
static get is() { return "wm-chart-column"; }
|
|
675
|
+
static get encapsulation() { return "shadow"; }
|
|
676
|
+
static get delegatesFocus() { return true; }
|
|
677
|
+
static get originalStyleUrls() {
|
|
678
|
+
return {
|
|
679
|
+
"$": ["wm-chart-column.scss"]
|
|
680
|
+
};
|
|
681
|
+
}
|
|
682
|
+
static get styleUrls() {
|
|
683
|
+
return {
|
|
684
|
+
"$": ["wm-chart-column.css"]
|
|
685
|
+
};
|
|
686
|
+
}
|
|
687
|
+
static get properties() {
|
|
688
|
+
return {
|
|
689
|
+
"config": {
|
|
690
|
+
"type": "unknown",
|
|
691
|
+
"mutable": false,
|
|
692
|
+
"complexType": {
|
|
693
|
+
"original": "ChartConfig",
|
|
694
|
+
"resolved": "undefined | { label: string; showLabel: boolean; valueAxisLabel: string; categoryAxisLabel: string; printMode: boolean; printModeFormat: \"amount\" | \"percentage\"; gridMax: number | \"auto\"; sort?: \"ascending\" | \"descending\" | \"none\" | undefined; showLegend?: \"top\" | \"bottom\" | \"left\" | \"right\" | \"none\" | undefined; showGrid?: boolean | undefined; subinfo?: string | undefined; valueFormat?: \"amount\" | \"percentage\" | \"none\" | undefined; colors?: string | undefined; popoverTitle?: string | undefined; popoverText?: string | undefined; popoverButtonText?: string | undefined; decimalPlaces?: number | undefined; patternMode?: boolean | undefined; }",
|
|
695
|
+
"references": {
|
|
696
|
+
"ChartConfig": {
|
|
697
|
+
"location": "import",
|
|
698
|
+
"path": "../../../global/interfaces",
|
|
699
|
+
"id": "src/global/interfaces.ts::ChartConfig"
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
},
|
|
703
|
+
"required": false,
|
|
704
|
+
"optional": true,
|
|
705
|
+
"docs": {
|
|
706
|
+
"tags": [{
|
|
707
|
+
"name": "description",
|
|
708
|
+
"text": "Chart configuration object. Set via JavaScript property \u2014 not an HTML\nattribute. See the `ChartConfig` interface for the full list of options (label, gridMax,\nvalueFormat, colors, showLegend, etc.)."
|
|
709
|
+
}],
|
|
710
|
+
"text": ""
|
|
711
|
+
}
|
|
712
|
+
},
|
|
713
|
+
"data": {
|
|
714
|
+
"type": "unknown",
|
|
715
|
+
"mutable": false,
|
|
716
|
+
"complexType": {
|
|
717
|
+
"original": "ChartData[]",
|
|
718
|
+
"resolved": "ChartData[] | undefined",
|
|
719
|
+
"references": {
|
|
720
|
+
"ChartData": {
|
|
721
|
+
"location": "import",
|
|
722
|
+
"path": "../../../global/interfaces",
|
|
723
|
+
"id": "src/global/interfaces.ts::ChartData"
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
},
|
|
727
|
+
"required": false,
|
|
728
|
+
"optional": true,
|
|
729
|
+
"docs": {
|
|
730
|
+
"tags": [{
|
|
731
|
+
"name": "description",
|
|
732
|
+
"text": "Array of data items to render. Set via JavaScript property \u2014 not an HTML\nattribute. Each item must include at least `barLegend` and `amount`; grouped charts also\nrequire `groupName`. See the `ChartData` interface."
|
|
733
|
+
}],
|
|
734
|
+
"text": ""
|
|
735
|
+
}
|
|
736
|
+
},
|
|
737
|
+
"printWidth": {
|
|
738
|
+
"type": "string",
|
|
739
|
+
"mutable": false,
|
|
740
|
+
"complexType": {
|
|
741
|
+
"original": "string",
|
|
742
|
+
"resolved": "string | undefined",
|
|
743
|
+
"references": {}
|
|
744
|
+
},
|
|
745
|
+
"required": false,
|
|
746
|
+
"optional": true,
|
|
747
|
+
"docs": {
|
|
748
|
+
"tags": [{
|
|
749
|
+
"name": "description",
|
|
750
|
+
"text": "Fixed chart width for print or PDF export. Accepts `px`, `in`, or `cm` (e.g.\n`\"7.5in\"`). When set alongside `print-mode` or during `window.print()`, columns that\nexceed the available width wrap across multiple plot rows."
|
|
751
|
+
}],
|
|
752
|
+
"text": ""
|
|
753
|
+
},
|
|
754
|
+
"attribute": "print-width",
|
|
755
|
+
"reflect": false
|
|
756
|
+
},
|
|
757
|
+
"printMode": {
|
|
758
|
+
"type": "boolean",
|
|
759
|
+
"mutable": false,
|
|
760
|
+
"complexType": {
|
|
761
|
+
"original": "boolean",
|
|
762
|
+
"resolved": "boolean | undefined",
|
|
763
|
+
"references": {}
|
|
764
|
+
},
|
|
765
|
+
"required": false,
|
|
766
|
+
"optional": true,
|
|
767
|
+
"docs": {
|
|
768
|
+
"tags": [{
|
|
769
|
+
"name": "description",
|
|
770
|
+
"text": "When true, column values are included in the legend and keyboard interaction\ninstructions are removed from the DOM \u2014 suitable for printed output. Takes precedence over\n`config.printMode`."
|
|
771
|
+
}, {
|
|
772
|
+
"name": "default",
|
|
773
|
+
"text": "false"
|
|
774
|
+
}],
|
|
775
|
+
"text": ""
|
|
776
|
+
},
|
|
777
|
+
"attribute": "print-mode",
|
|
778
|
+
"reflect": false
|
|
779
|
+
},
|
|
780
|
+
"patternMode": {
|
|
781
|
+
"type": "boolean",
|
|
782
|
+
"mutable": false,
|
|
783
|
+
"complexType": {
|
|
784
|
+
"original": "boolean",
|
|
785
|
+
"resolved": "boolean | undefined",
|
|
786
|
+
"references": {}
|
|
787
|
+
},
|
|
788
|
+
"required": false,
|
|
789
|
+
"optional": true,
|
|
790
|
+
"docs": {
|
|
791
|
+
"tags": [{
|
|
792
|
+
"name": "description",
|
|
793
|
+
"text": "When true, applies a hatching pattern fill to columns in addition to color,\nimproving distinguishability for users with color vision deficiencies. Takes precedence\nover `config.patternMode`."
|
|
794
|
+
}, {
|
|
795
|
+
"name": "default",
|
|
796
|
+
"text": "false"
|
|
797
|
+
}],
|
|
798
|
+
"text": ""
|
|
799
|
+
},
|
|
800
|
+
"attribute": "pattern-mode",
|
|
801
|
+
"reflect": false
|
|
802
|
+
},
|
|
803
|
+
"subinfo": {
|
|
804
|
+
"type": "string",
|
|
805
|
+
"mutable": false,
|
|
806
|
+
"complexType": {
|
|
807
|
+
"original": "string",
|
|
808
|
+
"resolved": "string | undefined",
|
|
809
|
+
"references": {}
|
|
810
|
+
},
|
|
811
|
+
"required": false,
|
|
812
|
+
"optional": true,
|
|
813
|
+
"docs": {
|
|
814
|
+
"tags": [{
|
|
815
|
+
"name": "description",
|
|
816
|
+
"text": "Optional secondary text displayed beneath the chart label. Takes precedence\nover `config.subinfo`."
|
|
817
|
+
}],
|
|
818
|
+
"text": ""
|
|
819
|
+
},
|
|
820
|
+
"attribute": "subinfo",
|
|
821
|
+
"reflect": false
|
|
822
|
+
}
|
|
823
|
+
};
|
|
824
|
+
}
|
|
825
|
+
static get states() {
|
|
826
|
+
return {
|
|
827
|
+
"processedData": {},
|
|
828
|
+
"gridInfo": {},
|
|
829
|
+
"isKeying": {}
|
|
830
|
+
};
|
|
831
|
+
}
|
|
832
|
+
static get events() {
|
|
833
|
+
return [{
|
|
834
|
+
"method": "wmChartBarHighlighted",
|
|
835
|
+
"name": "wmChartBarHighlighted",
|
|
836
|
+
"bubbles": true,
|
|
837
|
+
"cancelable": true,
|
|
838
|
+
"composed": true,
|
|
839
|
+
"docs": {
|
|
840
|
+
"tags": [{
|
|
841
|
+
"name": "internal",
|
|
842
|
+
"text": undefined
|
|
843
|
+
}, {
|
|
844
|
+
"name": "description",
|
|
845
|
+
"text": "Internal signal used to synchronize column highlight state with an external\nwm-chart-legend \u2014 not for application use."
|
|
846
|
+
}],
|
|
847
|
+
"text": ""
|
|
848
|
+
},
|
|
849
|
+
"complexType": {
|
|
850
|
+
"original": "{ idx: number }",
|
|
851
|
+
"resolved": "{ idx: number; }",
|
|
852
|
+
"references": {}
|
|
853
|
+
}
|
|
854
|
+
}];
|
|
855
|
+
}
|
|
856
|
+
static get elementRef() { return "el"; }
|
|
857
|
+
static get watchers() {
|
|
858
|
+
return [{
|
|
859
|
+
"propName": "config",
|
|
860
|
+
"methodName": "handleConfigDataChange"
|
|
861
|
+
}, {
|
|
862
|
+
"propName": "data",
|
|
863
|
+
"methodName": "handleConfigDataChange"
|
|
864
|
+
}, {
|
|
865
|
+
"propName": "printWidth",
|
|
866
|
+
"methodName": "handleConfigDataChange"
|
|
867
|
+
}];
|
|
868
|
+
}
|
|
869
|
+
static get listeners() {
|
|
870
|
+
return [{
|
|
871
|
+
"name": "wmLegendItemClick",
|
|
872
|
+
"method": "handleLegendItemClick",
|
|
873
|
+
"target": "document",
|
|
874
|
+
"capture": false,
|
|
875
|
+
"passive": false
|
|
876
|
+
}, {
|
|
877
|
+
"name": "wmLegendItemHover",
|
|
878
|
+
"method": "handleLegendItemHover",
|
|
879
|
+
"target": "document",
|
|
880
|
+
"capture": false,
|
|
881
|
+
"passive": false
|
|
882
|
+
}, {
|
|
883
|
+
"name": "beforeprint",
|
|
884
|
+
"method": "handleBeforePrint",
|
|
885
|
+
"target": "window",
|
|
886
|
+
"capture": false,
|
|
887
|
+
"passive": false
|
|
888
|
+
}, {
|
|
889
|
+
"name": "afterprint",
|
|
890
|
+
"method": "handleAfterPrint",
|
|
891
|
+
"target": "window",
|
|
892
|
+
"capture": false,
|
|
893
|
+
"passive": false
|
|
894
|
+
}, {
|
|
895
|
+
"name": "click",
|
|
896
|
+
"method": "handleDocumentClick",
|
|
897
|
+
"target": "document",
|
|
898
|
+
"capture": true,
|
|
899
|
+
"passive": false
|
|
900
|
+
}, {
|
|
901
|
+
"name": "wmUserIsKeying",
|
|
902
|
+
"method": "handleUserIsKeying",
|
|
903
|
+
"target": "window",
|
|
904
|
+
"capture": false,
|
|
905
|
+
"passive": false
|
|
906
|
+
}, {
|
|
907
|
+
"name": "wmUserIsNotTabbing",
|
|
908
|
+
"method": "handleUserIsNotKeying",
|
|
909
|
+
"target": "window",
|
|
910
|
+
"capture": false,
|
|
911
|
+
"passive": false
|
|
912
|
+
}];
|
|
913
|
+
}
|
|
914
|
+
}
|