@watermarkinsights/ripple 5.33.0-alpha.0 → 5.33.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-k3bip5HZ.js +8 -0
- package/dist/cjs/{chartFunctions-0d47b1f4.js → chartFunctions-fWIttqIZ.js} +22 -70
- package/dist/cjs/functions-Bag4HsFG.js +9318 -0
- package/dist/cjs/{index-bb947bd5.js → index-BKdkswfl.js} +1208 -567
- package/dist/cjs/{intl-9e9388a7.js → intl-BeSU8JeX.js} +1 -1
- package/dist/cjs/loader.cjs.js +3 -5
- package/dist/cjs/priv-calendar.cjs.entry.js +11 -15
- package/dist/cjs/priv-chart-popover-old.cjs.entry.js +11 -11
- package/dist/cjs/priv-chart-popover_2.cjs.entry.js +39 -21
- package/dist/cjs/priv-navigator-button.cjs.entry.js +3 -6
- package/dist/cjs/priv-navigator-item.cjs.entry.js +3 -6
- package/dist/cjs/priv-option-list.cjs.entry.js +11 -17
- package/dist/cjs/ripple.cjs.js +7 -7
- package/dist/cjs/wm-action-menu_2.cjs.entry.js +43 -29
- package/dist/cjs/wm-button.cjs.entry.js +41 -22
- package/dist/cjs/wm-chart-bar.cjs.entry.js +13 -18
- package/dist/cjs/wm-chart-column.cjs.entry.js +18 -22
- package/dist/cjs/wm-chart-slice.cjs.entry.js +1 -8
- package/dist/cjs/wm-chart-stack.cjs.entry.js +13 -17
- package/dist/cjs/wm-chart.cjs.entry.js +60 -19
- package/dist/cjs/wm-date-range.cjs.entry.js +65 -24
- package/dist/cjs/wm-datepicker.cjs.entry.js +44 -20
- package/dist/cjs/wm-file-list.cjs.entry.js +8 -6
- package/dist/cjs/wm-file.cjs.entry.js +16 -16
- package/dist/cjs/wm-flyout.cjs.entry.js +28 -19
- package/dist/cjs/wm-input.cjs.entry.js +46 -20
- package/dist/cjs/wm-line-chart.cjs.entry.js +55 -32
- package/dist/cjs/wm-modal-pss_3.cjs.entry.js +14 -18
- package/dist/cjs/wm-modal_3.cjs.entry.js +58 -17
- package/dist/cjs/wm-navigation_3.cjs.entry.js +20 -22
- package/dist/cjs/wm-navigator.cjs.entry.js +28 -17
- package/dist/cjs/wm-nested-select.cjs.entry.js +62 -16
- package/dist/cjs/wm-optgroup.cjs.entry.js +22 -9
- package/dist/cjs/wm-option_2.cjs.entry.js +89 -27
- package/dist/cjs/wm-pagination.cjs.entry.js +47 -17
- package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +29 -30
- package/dist/cjs/wm-search.cjs.entry.js +61 -12
- package/dist/cjs/wm-snackbar.cjs.entry.js +19 -12
- package/dist/cjs/wm-tab-item_3.cjs.entry.js +39 -22
- package/dist/cjs/wm-tag-input.cjs.entry.js +41 -28
- package/dist/cjs/wm-tag-option.cjs.entry.js +15 -9
- package/dist/cjs/wm-textarea.cjs.entry.js +46 -15
- package/dist/cjs/wm-timepicker.cjs.entry.js +41 -18
- package/dist/cjs/wm-toggletip.cjs.entry.js +23 -13
- package/dist/cjs/wm-uploader.cjs.entry.js +31 -19
- package/dist/cjs/wm-wrapper.cjs.entry.js +1 -3
- package/dist/collection/collection-manifest.json +3 -2
- package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.js +26 -13
- package/dist/collection/components/charts/priv-chart-popover-old/priv-chart-popover-old.js +9 -5
- package/dist/collection/components/charts/wm-chart/wm-chart-slice.js +20 -17
- package/dist/collection/components/charts/wm-chart/wm-chart.css +3 -1
- package/dist/collection/components/charts/wm-chart/wm-chart.js +94 -25
- package/dist/collection/components/charts/wm-chart-bar/wm-chart-bar.js +22 -16
- package/dist/collection/components/charts/wm-chart-column/wm-chart-column.js +28 -21
- package/dist/collection/components/charts/wm-chart-legend/wm-chart-legend.css +6 -4
- package/dist/collection/components/charts/wm-chart-legend/wm-chart-legend.js +38 -8
- package/dist/collection/components/charts/wm-chart-stack/wm-chart-stack.js +22 -15
- package/dist/collection/components/charts/wm-line-chart/wm-line-chart.js +106 -48
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.css +3 -1
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.js +40 -19
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.js +12 -9
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-slice.js +20 -17
- package/dist/collection/components/datepickers/datepicker.css +13 -9
- package/dist/collection/components/datepickers/priv-calendar/priv-calendar.css +2 -2
- package/dist/collection/components/datepickers/priv-calendar/priv-calendar.js +25 -16
- package/dist/collection/components/datepickers/wm-date-range.js +84 -26
- package/dist/collection/components/datepickers/wm-datepicker.js +57 -20
- package/dist/collection/components/selects/priv-option-list/priv-option-list.js +30 -19
- package/dist/collection/components/selects/wm-nested-select/wm-nested-select.css +9 -7
- package/dist/collection/components/selects/wm-nested-select/wm-nested-select.js +98 -23
- package/dist/collection/components/selects/wm-optgroup/wm-optgroup.js +28 -6
- package/dist/collection/components/selects/wm-option/wm-option.js +32 -7
- package/dist/collection/components/selects/wm-select/wm-select.css +9 -7
- package/dist/collection/components/selects/wm-select/wm-select.js +94 -27
- package/dist/collection/components/wm-action-menu/wm-action-menu.css +6 -6
- package/dist/collection/components/wm-action-menu/wm-action-menu.js +63 -36
- package/dist/collection/components/wm-button/wm-button.css +6 -6
- package/dist/collection/components/wm-button/wm-button.js +85 -37
- package/dist/collection/components/wm-file/wm-file.js +46 -25
- package/dist/collection/components/wm-file-list/wm-file-list.js +8 -1
- package/dist/collection/components/wm-flyout/wm-flyout.js +54 -26
- package/dist/collection/components/wm-input/wm-input.css +7 -5
- package/dist/collection/components/wm-input/wm-input.js +98 -37
- package/dist/collection/components/wm-menuitem/wm-menuitem.js +24 -5
- package/dist/collection/components/wm-modal/wm-modal-footer.js +36 -5
- package/dist/collection/components/wm-modal/wm-modal-header.js +14 -2
- package/dist/collection/components/wm-modal/wm-modal.js +30 -7
- package/dist/collection/components/wm-modal-pss/wm-modal-pss-footer.js +15 -5
- package/dist/collection/components/wm-modal-pss/wm-modal-pss-header.js +6 -2
- package/dist/collection/components/wm-modal-pss/wm-modal-pss.js +15 -8
- package/dist/collection/components/wm-navigation/wm-navigation-hamburger.js +6 -5
- package/dist/collection/components/wm-navigation/wm-navigation-item.js +12 -11
- package/dist/collection/components/wm-navigation/wm-navigation.js +9 -2
- package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.js +6 -2
- package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.js +9 -3
- package/dist/collection/components/wm-navigator/wm-navigator.js +46 -20
- package/dist/collection/components/wm-pagination/wm-pagination.js +54 -13
- package/dist/collection/components/wm-search/wm-search.js +74 -10
- package/dist/collection/components/wm-snackbar/wm-snackbar.js +14 -4
- package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.js +19 -4
- package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.css +3 -1
- package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.js +12 -10
- package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.js +17 -2
- package/dist/collection/components/wm-tag-input/wm-tag-input.css +4 -4
- package/dist/collection/components/wm-tag-input/wm-tag-input.js +81 -41
- package/dist/collection/components/wm-tag-input/wm-tag-option/wm-tag-option.js +32 -14
- package/dist/collection/components/wm-textarea/wm-textarea.css +7 -5
- package/dist/collection/components/wm-textarea/wm-textarea.js +72 -20
- package/dist/collection/components/wm-timepicker/wm-timepicker.css +9 -7
- package/dist/collection/components/wm-timepicker/wm-timepicker.js +55 -19
- package/dist/collection/components/wm-toggletip/wm-toggletip.js +38 -14
- package/dist/collection/components/wm-uploader/wm-uploader.css +10 -10
- package/dist/collection/components/wm-uploader/wm-uploader.js +63 -28
- package/dist/collection/global/global.js +5 -3
- package/dist/docs/docs.d.ts +45 -0
- package/dist/docs/docs.json +1063 -300
- package/dist/docs/skill/wm-nested-select.md +3 -0
- package/dist/docs/skill/wm-optgroup.md +3 -0
- package/dist/docs/skill/wm-progress-monitor.md +3 -0
- package/dist/docs/skill/wm-select.md +3 -0
- package/dist/esm/app-globals-B_mHcIXc.js +6 -0
- package/dist/esm/{chartFunctions-58637dc9.js → chartFunctions-C2cx-qVA.js} +23 -71
- package/dist/esm/functions-UejPfcUp.js +9276 -0
- package/dist/esm/{index-3425d80d.js → index-BGfrNNVL.js} +1205 -563
- package/dist/esm/{intl-d518f362.js → intl-1Kev15g9.js} +1 -1
- package/dist/esm/loader.js +4 -4
- package/dist/esm/priv-calendar.entry.js +11 -13
- package/dist/esm/priv-chart-popover-old.entry.js +11 -9
- package/dist/esm/priv-chart-popover_2.entry.js +39 -19
- package/dist/esm/priv-navigator-button.entry.js +3 -4
- package/dist/esm/priv-navigator-item.entry.js +3 -4
- package/dist/esm/priv-option-list.entry.js +11 -15
- package/dist/esm/ripple.js +6 -5
- package/dist/esm/wm-action-menu_2.entry.js +43 -27
- package/dist/esm/wm-button.entry.js +41 -20
- package/dist/esm/wm-chart-bar.entry.js +13 -16
- package/dist/esm/wm-chart-column.entry.js +18 -20
- package/dist/esm/wm-chart-slice.entry.js +1 -6
- package/dist/esm/wm-chart-stack.entry.js +13 -15
- package/dist/esm/wm-chart.entry.js +60 -17
- package/dist/esm/wm-date-range.entry.js +65 -22
- package/dist/esm/wm-datepicker.entry.js +44 -18
- package/dist/esm/wm-file-list.entry.js +8 -4
- package/dist/esm/wm-file.entry.js +16 -14
- package/dist/esm/wm-flyout.entry.js +28 -17
- package/dist/esm/wm-input.entry.js +46 -18
- package/dist/esm/wm-line-chart.entry.js +55 -30
- package/dist/esm/wm-modal-pss_3.entry.js +14 -16
- package/dist/esm/wm-modal_3.entry.js +58 -15
- package/dist/esm/wm-navigation_3.entry.js +20 -20
- package/dist/esm/wm-navigator.entry.js +28 -15
- package/dist/esm/wm-nested-select.entry.js +62 -14
- package/dist/esm/wm-optgroup.entry.js +22 -7
- package/dist/esm/wm-option_2.entry.js +89 -25
- package/dist/esm/wm-pagination.entry.js +47 -15
- package/dist/esm/wm-progress-indicator_3.entry.js +29 -28
- package/dist/esm/wm-search.entry.js +61 -10
- package/dist/esm/wm-snackbar.entry.js +19 -10
- package/dist/esm/wm-tab-item_3.entry.js +39 -20
- package/dist/esm/wm-tag-input.entry.js +41 -26
- package/dist/esm/wm-tag-option.entry.js +15 -7
- package/dist/esm/wm-textarea.entry.js +46 -13
- package/dist/esm/wm-timepicker.entry.js +41 -16
- package/dist/esm/wm-toggletip.entry.js +23 -11
- package/dist/esm/wm-uploader.entry.js +31 -17
- package/dist/esm/wm-wrapper.entry.js +1 -1
- package/dist/loader/index.d.ts +1 -1
- package/dist/ripple/{p-72d135ee.entry.js → p-040297d7.entry.js} +1 -1
- package/dist/ripple/p-042fabc0.entry.js +1 -0
- package/dist/ripple/p-08cae5a7.entry.js +1 -0
- package/dist/ripple/p-0e8b0df5.entry.js +1 -0
- package/dist/ripple/{p-680d7606.entry.js → p-119e90f5.entry.js} +1 -1
- package/dist/ripple/p-314c60f6.entry.js +1 -0
- package/dist/ripple/p-3202e4d3.entry.js +1 -0
- package/dist/ripple/p-3864cffe.entry.js +1 -0
- package/dist/ripple/{p-59f74ead.entry.js → p-38b62547.entry.js} +1 -1
- package/dist/ripple/p-3a457452.entry.js +1 -0
- package/dist/ripple/p-405ad89b.entry.js +1 -0
- package/dist/ripple/{p-156c4d1d.entry.js → p-4096c755.entry.js} +1 -1
- package/dist/ripple/p-40bab7fb.entry.js +1 -0
- package/dist/ripple/{p-83cdad78.entry.js → p-4ea49dfc.entry.js} +1 -1
- package/dist/ripple/p-52a3dde4.entry.js +1 -0
- package/dist/ripple/{p-c9c7df12.entry.js → p-55d81cee.entry.js} +1 -1
- package/dist/ripple/p-5e1d3de1.entry.js +1 -0
- package/dist/ripple/{p-be3e4e7c.entry.js → p-656c98cb.entry.js} +1 -1
- package/dist/ripple/p-658145e6.entry.js +1 -0
- package/dist/ripple/p-6c2c87c3.entry.js +1 -0
- package/dist/ripple/p-7462e17c.entry.js +1 -0
- package/dist/ripple/p-7ec2ceb8.entry.js +1 -0
- package/dist/ripple/{p-34bde06a.entry.js → p-8488893b.entry.js} +1 -1
- package/dist/ripple/p-8f610e63.entry.js +1 -0
- package/dist/ripple/{p-3a19d019.entry.js → p-9fb9bd10.entry.js} +1 -1
- package/dist/ripple/p-BGfrNNVL.js +3 -0
- package/dist/ripple/p-CEatyzC3.js +1 -0
- package/dist/ripple/{p-6e3c2bbc.js → p-DHTrj5UR.js} +1 -1
- package/dist/ripple/p-UejPfcUp.js +1 -0
- package/dist/ripple/{p-26d8c356.entry.js → p-a470be87.entry.js} +1 -1
- package/dist/ripple/p-a7d9313d.entry.js +1 -0
- package/dist/ripple/p-a7ea11c3.entry.js +1 -0
- package/dist/ripple/{p-38b05894.entry.js → p-a8e2fbb9.entry.js} +1 -1
- package/dist/ripple/p-aa316c78.entry.js +1 -0
- package/dist/ripple/p-bd2328b0.entry.js +1 -0
- package/dist/ripple/p-c07dd034.entry.js +1 -0
- package/dist/ripple/p-d51a2cd1.entry.js +1 -0
- package/dist/ripple/p-d735a0b3.entry.js +1 -0
- package/dist/ripple/p-db2a5d7f.entry.js +1 -0
- package/dist/ripple/p-dc2d2704.entry.js +1 -0
- package/dist/ripple/p-e17229a4.entry.js +1 -0
- package/dist/ripple/p-e90711ae.entry.js +1 -0
- package/dist/ripple/p-ef65953a.entry.js +1 -0
- package/dist/ripple/{p-683264db.js → p-k9O4HQSf.js} +1 -1
- package/dist/ripple/ripple.esm.js +1 -1
- package/dist/types/components.d.ts +788 -131
- package/dist/types/global/global.d.ts +2 -1
- package/dist/types/stencil-public-runtime.d.ts +207 -8
- package/package.json +7 -6
- package/dist/cjs/app-globals-2570c638.js +0 -103
- package/dist/cjs/functions-761cb9f2.js +0 -10694
- package/dist/esm/app-globals-b0fd0ed2.js +0 -101
- package/dist/esm/functions-65f1594c.js +0 -10652
- package/dist/loader/package.json +0 -11
- package/dist/ripple/p-0d364411.entry.js +0 -1
- package/dist/ripple/p-2b23ce49.entry.js +0 -1
- package/dist/ripple/p-2b7cc2c1.entry.js +0 -1
- package/dist/ripple/p-35db9386.entry.js +0 -1
- package/dist/ripple/p-38a987ac.entry.js +0 -1
- package/dist/ripple/p-38dee4ab.entry.js +0 -1
- package/dist/ripple/p-42694075.js +0 -1
- package/dist/ripple/p-507f2cf4.entry.js +0 -1
- package/dist/ripple/p-5c2fc42a.entry.js +0 -1
- package/dist/ripple/p-5f132a77.entry.js +0 -1
- package/dist/ripple/p-6f1cabab.entry.js +0 -1
- package/dist/ripple/p-7799953c.entry.js +0 -1
- package/dist/ripple/p-83c3db60.js +0 -2
- package/dist/ripple/p-87ef0cfa.entry.js +0 -1
- package/dist/ripple/p-88e44511.entry.js +0 -1
- package/dist/ripple/p-8f8e4eb8.entry.js +0 -1
- package/dist/ripple/p-936adffb.entry.js +0 -1
- package/dist/ripple/p-9755192c.entry.js +0 -1
- package/dist/ripple/p-9c5c591b.js +0 -1
- package/dist/ripple/p-9ea38d96.entry.js +0 -1
- package/dist/ripple/p-d7a1be0b.entry.js +0 -1
- package/dist/ripple/p-dab86523.entry.js +0 -1
- package/dist/ripple/p-e4aa6e27.entry.js +0 -1
- package/dist/ripple/p-ed053612.entry.js +0 -1
- package/dist/ripple/p-f43f621b.entry.js +0 -1
- package/dist/ripple/p-f48d30d6.entry.js +0 -1
- package/dist/ripple/p-f6aad57c.entry.js +0 -1
- package/dist/ripple/p-f6e1beb5.entry.js +0 -1
- package/dist/ripple/p-fd997764.entry.js +0 -1
- package/dist/ripple/p-fe0345dd.entry.js +0 -1
- package/dist/ripple/p-fffb46ad.entry.js +0 -1
- /package/dist/cjs/{interfaces-33cd6161.js → interfaces-Cx1dCx1x.js} +0 -0
- /package/dist/esm/{interfaces-8778346d.js → interfaces-D9qMfha9.js} +0 -0
- /package/dist/ripple/{p-ebe9f38c.js → p-D9qMfha9.js} +0 -0
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
var index = require('./index-BKdkswfl.js');
|
|
4
|
+
var functions = require('./functions-Bag4HsFG.js');
|
|
5
5
|
|
|
6
6
|
const colors = {
|
|
7
7
|
salmon: "#ff5f4e",
|
|
8
8
|
cyan: "#19a1a9",
|
|
9
9
|
forest: "#088000",
|
|
10
|
-
sleet: "#7f97ad",
|
|
11
10
|
midnight: "#2e1b46",
|
|
12
11
|
lavender: "#8b86ca",
|
|
13
12
|
periwinkle: "#575195",
|
|
@@ -435,15 +434,7 @@ function renderInstructionsText() {
|
|
|
435
434
|
return index.h("div", { id: "chart-instructions" }, chartInstructions);
|
|
436
435
|
}
|
|
437
436
|
function renderFilter() {
|
|
438
|
-
return (index.h("defs", null,
|
|
439
|
-
index.h("filter", { id: "wmHoverDropShadow" },
|
|
440
|
-
index.h("feGaussianBlur", { stdDeviation: "3" }),
|
|
441
|
-
index.h("feOffset", { result: "offsetblur" }),
|
|
442
|
-
index.h("feFlood", { "flood-color": "#333" }),
|
|
443
|
-
index.h("feComposite", { operator: "in", in2: "offsetblur" }),
|
|
444
|
-
index.h("feMerge", null,
|
|
445
|
-
index.h("feMergeNode", null),
|
|
446
|
-
index.h("feMergeNode", { in: "SourceGraphic" })))));
|
|
437
|
+
return (index.h("defs", null, index.h("filter", { id: "wmHoverDropShadow" }, index.h("feGaussianBlur", { stdDeviation: "3" }), index.h("feOffset", { result: "offsetblur" }), index.h("feFlood", { "flood-color": "#333" }), index.h("feComposite", { operator: "in", in2: "offsetblur" }), index.h("feMerge", null, index.h("feMergeNode", null), index.h("feMergeNode", { in: "SourceGraphic" })))));
|
|
447
438
|
}
|
|
448
439
|
function applyMinimumAngle(minimumAngle, slicesDetails, total) {
|
|
449
440
|
const allAngles = slicesDetails.map((s) => amountToDegree(s.amount, total));
|
|
@@ -494,12 +485,7 @@ function renderDoughnut(chartType) {
|
|
|
494
485
|
else {
|
|
495
486
|
perc = perc + "%";
|
|
496
487
|
}
|
|
497
|
-
return (index.h("div", { class: "chart-wrapper doughnut-wrapper" },
|
|
498
|
-
index.h("svg", { width: outerSize + "px", height: outerSize + "px", id: `graphic-${this.uid}`, class: "doughnut-svg" },
|
|
499
|
-
renderFilter(),
|
|
500
|
-
slicesDetails.map((s) => renderPath.call(this, s, chartType)),
|
|
501
|
-
renderFocusOutline.call(this),
|
|
502
|
-
isProgressIndicator ? (index.h("text", { class: "value", x: "50%", y: "50%", "font-size": "1.5rem", "font-weight": "500", "text-anchor": "middle", "dominant-baseline": "middle" }, perc)) : (index.h("g", { transform: `translate(${this.chartDetails.padding / 2}, ${this.chartDetails.padding / 2})`, "text-anchor": "middle", "dominant-baseline": "middle" }, slicesDetails.map((s) => s.amount > 0 && !s.inSmallCluster ? renderDoughnutText.call(this, s) : ""))))));
|
|
488
|
+
return (index.h("div", { class: "chart-wrapper doughnut-wrapper" }, index.h("svg", { width: outerSize + "px", height: outerSize + "px", id: `graphic-${this.uid}`, class: "doughnut-svg" }, renderFilter(), slicesDetails.map((s) => renderPath.call(this, s, chartType)), renderFocusOutline.call(this), isProgressIndicator ? (index.h("text", { class: "value", x: "50%", y: "50%", "font-size": "1.5rem", "font-weight": "500", "text-anchor": "middle", "dominant-baseline": "middle" }, perc)) : (index.h("g", { transform: `translate(${this.chartDetails.padding / 2}, ${this.chartDetails.padding / 2})`, "text-anchor": "middle", "dominant-baseline": "middle" }, slicesDetails.map((s) => s.amount > 0 && !s.inSmallCluster ? renderDoughnutText.call(this, s) : ""))))));
|
|
503
489
|
}
|
|
504
490
|
function highlightSegmentInfo(infoEls, s) {
|
|
505
491
|
infoEls.forEach((el) => {
|
|
@@ -518,14 +504,10 @@ function removeSegmentInfoHighlight(infoEls) {
|
|
|
518
504
|
}
|
|
519
505
|
function renderPath(s, chartType) {
|
|
520
506
|
const percentageValue = amountToPercent(s.amount, this.total, true) + "%";
|
|
521
|
-
return (!isNaN(s.amount) && (index.h("g", { transform: `translate(${this.chartDetails.padding / 2}, ${this.chartDetails.padding / 2})` },
|
|
522
|
-
index.h("path", { id: s.id, class: "segment doughnut-segment", fill: s.visualAmount ? s.color : "transparent", d: getPathData.call(this, s.visualAmount, s.offset, chartType), onClick: (ev) => handleSliceClick.call(this, ev, s), onFocus: (ev) => handleSliceFocus.call(this, ev, s), onKeyDown: (ev) => handleSliceKeyDown.call(this, ev), role: "img", "aria-label": `${s.legend}, ${percentageValue}`, "data-segmentindex": s.index }))));
|
|
507
|
+
return (!isNaN(s.amount) && (index.h("g", { transform: `translate(${this.chartDetails.padding / 2}, ${this.chartDetails.padding / 2})` }, index.h("path", { id: s.id, class: "segment doughnut-segment", fill: s.visualAmount ? s.color : "transparent", d: getPathData.call(this, s.visualAmount, s.offset, chartType), onClick: (ev) => handleSliceClick.call(this, ev, s), onFocus: (ev) => handleSliceFocus.call(this, ev, s), onKeyDown: (ev) => handleSliceKeyDown.call(this, ev), role: "img", "aria-label": `${s.legend}, ${percentageValue}`, "data-segmentindex": s.index }))));
|
|
523
508
|
}
|
|
524
509
|
function renderFocusOutline() {
|
|
525
|
-
return this.isTabbing ? (index.h("g", { transform: `translate(${this.chartDetails.padding / 2}, ${this.chartDetails.padding / 2})` },
|
|
526
|
-
index.h("use", { tabindex: -1, id: "kfbg1", xlinkHref: `#${this.focusedSliceId}` }),
|
|
527
|
-
index.h("use", { tabindex: -1, id: "kfstroke", xlinkHref: `#${this.focusedSliceId}` }),
|
|
528
|
-
index.h("use", { tabindex: -1, id: "kfbg2", xlinkHref: `#${this.focusedSliceId}` }))) : ("");
|
|
510
|
+
return this.isTabbing ? (index.h("g", { transform: `translate(${this.chartDetails.padding / 2}, ${this.chartDetails.padding / 2})` }, index.h("use", { tabindex: -1, id: "kfbg1", xlinkHref: `#${this.focusedSliceId}` }), index.h("use", { tabindex: -1, id: "kfstroke", xlinkHref: `#${this.focusedSliceId}` }), index.h("use", { tabindex: -1, id: "kfbg2", xlinkHref: `#${this.focusedSliceId}` }))) : ("");
|
|
529
511
|
}
|
|
530
512
|
function renderDoughnutText(s) {
|
|
531
513
|
const arcMiddle = amountToDegree(s.offset + s.visualAmount / 2, this.total);
|
|
@@ -581,16 +563,7 @@ function renderStackedBar(chartType) {
|
|
|
581
563
|
(this.isBar || this.isDoughnut) && this.showHiddenValuesMessage(showMsg);
|
|
582
564
|
});
|
|
583
565
|
}
|
|
584
|
-
return (index.h("div", { class: "chart-wrapper bar-wrapper" },
|
|
585
|
-
isHybridBar ? (index.h("div", { class: "single-perc" }, amountToPercent(this.slicesDetails[0].amount, this.total, true) + "%")) : (""),
|
|
586
|
-
this.chartType === "bar3" && this.drawAxis(),
|
|
587
|
-
index.h("div", { class: `inner-stacked-bar-wrapper ${showValue(this.valueFormat)}` },
|
|
588
|
-
!isHybridBar ? (index.h("div", { class: `values ${this.valueFormat}` }, this.slicesDetails.map((s) => this.renderBarText(s, 5)))) : (""),
|
|
589
|
-
index.h("div", { class: "stacked-bar-segments-wrapper" }, this.slicesDetails.map((s) => renderStackedBarSegment.call(this, s, 5))),
|
|
590
|
-
isHybridBar ? renderCompletionMessage.call(this) : ""),
|
|
591
|
-
this.chartType === "bar3" ? (index.h("div", { class: "bar3-axis-label", "aria-hidden": "true" },
|
|
592
|
-
index.h("span", null, "0%"),
|
|
593
|
-
index.h("span", null, "100%"))) : ("")));
|
|
566
|
+
return (index.h("div", { class: "chart-wrapper bar-wrapper" }, isHybridBar ? (index.h("div", { class: "single-perc" }, amountToPercent(this.slicesDetails[0].amount, this.total, true) + "%")) : (""), this.chartType === "bar3" && this.drawAxis(), index.h("div", { class: `inner-stacked-bar-wrapper ${showValue(this.valueFormat)}` }, !isHybridBar ? (index.h("div", { class: `values ${this.valueFormat}` }, this.slicesDetails.map((s) => this.renderBarText(s, 5)))) : (""), index.h("div", { class: "stacked-bar-segments-wrapper" }, this.slicesDetails.map((s) => renderStackedBarSegment.call(this, s, 5))), isHybridBar ? renderCompletionMessage.call(this) : ""), this.chartType === "bar3" ? (index.h("div", { class: "bar3-axis-label", "aria-hidden": "true" }, index.h("span", null, "0%"), index.h("span", null, "100%"))) : ("")));
|
|
594
567
|
}
|
|
595
568
|
function renderStackedBarSegment(s, minimumWidth) {
|
|
596
569
|
const segmentPercentage = amountToPercent(s.amount, this.total, false);
|
|
@@ -608,8 +581,7 @@ function renderStackedBarSegment(s, minimumWidth) {
|
|
|
608
581
|
return (index.h("div", { class: `segment stacked-bar-segment ${amountToPercent(s.amount, this.total, false) === 0 ? "zero" : ""} ${meetsSizeMinimum ? "" : "fixed-width"}`, style: {
|
|
609
582
|
backgroundColor: s.color,
|
|
610
583
|
width: renderedWidth,
|
|
611
|
-
}, onClick: (ev) => handleSliceClick.call(this, ev, s), onFocus: (ev) => handleSliceFocus.call(this, ev, s), onKeyDown: (ev) => handleSliceKeyDown.call(this, ev), "data-segmentindex": s.index },
|
|
612
|
-
index.h("span", { class: "sr-only" }, `${s.legend} ${segmentValue}`)));
|
|
584
|
+
}, onClick: (ev) => handleSliceClick.call(this, ev, s), onFocus: (ev) => handleSliceFocus.call(this, ev, s), onKeyDown: (ev) => handleSliceKeyDown.call(this, ev), "data-segmentindex": s.index }, index.h("span", { class: "sr-only" }, `${s.legend} ${segmentValue}`)));
|
|
613
585
|
}
|
|
614
586
|
function renderSimpleBar(chartType) {
|
|
615
587
|
// find largest number and get interval, numTicks, chartMaxVal for all.
|
|
@@ -644,18 +616,10 @@ function renderSimpleBar(chartType) {
|
|
|
644
616
|
const ticks = [];
|
|
645
617
|
for (let i = 1; i <= numTicks; i++) {
|
|
646
618
|
const tickVal = abbrNumber(functions.safeMultiplyFloat(i, interval));
|
|
647
|
-
ticks.push(index.h("div", { class: "tick" },
|
|
648
|
-
index.h("span", null, tickVal)));
|
|
619
|
+
ticks.push(index.h("div", { class: "tick" }, index.h("span", null, tickVal)));
|
|
649
620
|
}
|
|
650
621
|
const showGrid = chartType === "bar6" && this.showGrid && this.el.getBoundingClientRect().width > 300;
|
|
651
|
-
return (index.h("div", { class: "chart-wrapper simple-bar-wrapper" },
|
|
652
|
-
index.h("div", { class: `chart ${showValue(this.valueFormat)}` },
|
|
653
|
-
showGrid && index.h("div", { class: "gridlines" }),
|
|
654
|
-
index.h("div", { class: "rows" }, rows)),
|
|
655
|
-
showGrid && (index.h("div", { class: "x-axis", "aria-hidden": "true" },
|
|
656
|
-
index.h("div", { class: "zero" },
|
|
657
|
-
index.h("span", null, "0")),
|
|
658
|
-
ticks))));
|
|
622
|
+
return (index.h("div", { class: "chart-wrapper simple-bar-wrapper" }, index.h("div", { class: `chart ${showValue(this.valueFormat)}` }, showGrid && index.h("div", { class: "gridlines" }), index.h("div", { class: "rows" }, rows)), showGrid && (index.h("div", { class: "x-axis", "aria-hidden": "true" }, index.h("div", { class: "zero" }, index.h("span", null, "0")), ticks))));
|
|
659
623
|
}
|
|
660
624
|
function renderSimpleBarLegend(legend, show, chartType) {
|
|
661
625
|
// not sure how to collapse the left column to 0 width with CSS grid. text should still be available to SR.
|
|
@@ -677,25 +641,22 @@ function renderSimpleBarItem(s, interval, ticks, largest) {
|
|
|
677
641
|
return (index.h("div", { class: "bar segment", style: {
|
|
678
642
|
backgroundColor: s.color,
|
|
679
643
|
width: cssWidth,
|
|
680
|
-
}, onClick: (ev) => handleSliceClick.call(this, ev, s), onFocus: (ev) => handleSliceFocus.call(this, ev, s), onKeyDown: (ev) => handleSliceKeyDown.call(this, ev), "data-segmentindex": s.index },
|
|
681
|
-
index.h("div", { class: "value" }, displayValue)));
|
|
644
|
+
}, onClick: (ev) => handleSliceClick.call(this, ev, s), onFocus: (ev) => handleSliceFocus.call(this, ev, s), onKeyDown: (ev) => handleSliceKeyDown.call(this, ev), "data-segmentindex": s.index }, index.h("div", { class: "value" }, displayValue)));
|
|
682
645
|
}
|
|
683
646
|
function renderLegend(chartType) {
|
|
684
647
|
// legend is hidden for bar1 and bar6 types regardless of showLegend value
|
|
685
648
|
if (this.showLegend) {
|
|
686
649
|
const showMsg = this.slicesDetails.reduce((hasCluster, cur) => (hasCluster = cur.inSmallCluster ? true : hasCluster), false);
|
|
687
650
|
this.isDoughnut && this.showHiddenValuesMessage(showMsg);
|
|
688
|
-
return (index.h("div", { class: "legend-wrapper" },
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
})),
|
|
698
|
-
this.isDoughnut && !this.printMode && renderHiddenValuesMessage()));
|
|
651
|
+
return (index.h("div", { class: "legend-wrapper" }, index.h("div", { class: `legend ${chartType} ${this.mode === "bar" ? "--top" : "--bottom"}`, "aria-hidden": "true" }, this.slicesDetails.map((s) => {
|
|
652
|
+
const printValue = this.printModeFormat == "amount"
|
|
653
|
+
? `${s.amount}/${this.total}`
|
|
654
|
+
: `${amountToPercent(s.amount, this.total, true)}%`;
|
|
655
|
+
// when both legend and amount are omitted, the legend is not shown for that particular option (it's been deactivated by the user)
|
|
656
|
+
if (!!s.amount || !!s.legend) {
|
|
657
|
+
return renderLegendItem.call(this, { key: s.legend, color: s.color }, printValue, s);
|
|
658
|
+
}
|
|
659
|
+
})), this.isDoughnut && !this.printMode && renderHiddenValuesMessage()));
|
|
699
660
|
}
|
|
700
661
|
}
|
|
701
662
|
function renderLegendItem(legendItem, printValue = "", s = null) {
|
|
@@ -706,13 +667,7 @@ function renderLegendItem(legendItem, printValue = "", s = null) {
|
|
|
706
667
|
highlightSegmentInfo(Array.from(this.el.shadowRoot.querySelectorAll("[data-segmentindex")), s);
|
|
707
668
|
}
|
|
708
669
|
};
|
|
709
|
-
return (index.h("div", { class: "legend-item", onClick: (ev) => handleLegendItemClick(ev), "data-segmentindex": s ? s.index : null },
|
|
710
|
-
index.h("div", { class: "legend-color", style: { backgroundColor: legendItem.color } }),
|
|
711
|
-
index.h("div", { class: "legend-text" },
|
|
712
|
-
legendItem.key,
|
|
713
|
-
printValue && index.h("span", { class: `print-value ${this.printMode ? "force-visible" : ""}` },
|
|
714
|
-
": ",
|
|
715
|
-
printValue))));
|
|
670
|
+
return (index.h("div", { class: "legend-item", onClick: (ev) => handleLegendItemClick(ev), "data-segmentindex": s ? s.index : null }, index.h("div", { class: "legend-color", style: { backgroundColor: legendItem.color } }), index.h("div", { class: "legend-text" }, legendItem.key, printValue && index.h("span", { class: `print-value ${this.printMode ? "force-visible" : ""}` }, ": ", printValue))));
|
|
716
671
|
}
|
|
717
672
|
function renderCompletionMessage() {
|
|
718
673
|
if (this.completionMessage) {
|
|
@@ -720,10 +675,7 @@ function renderCompletionMessage() {
|
|
|
720
675
|
}
|
|
721
676
|
}
|
|
722
677
|
function renderHiddenValuesMessage() {
|
|
723
|
-
return (index.h("div", { class: "hidden-values-warning hidden" },
|
|
724
|
-
textHiddenMessage,
|
|
725
|
-
index.h("br", null),
|
|
726
|
-
seeDetailsMessage));
|
|
678
|
+
return (index.h("div", { class: "hidden-values-warning hidden" }, textHiddenMessage, index.h("br", null), seeDetailsMessage));
|
|
727
679
|
}
|
|
728
680
|
function formatDisplayValue(amount, amountTotal, valueFormat, decimalPlaces = 0) {
|
|
729
681
|
switch (valueFormat) {
|