@watermarkinsights/ripple 3.7.0-1 → 3.7.0-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const version = "3.7.0-1";
3
+ const version = "3.7.0-2";
4
4
 
5
5
  // PRINT RIPPLE VERSION IN CONSOLE
6
6
  // test envs return 0 for plugin.length
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-cd179539.js');
6
- require('./global-31bd3bd9.js');
6
+ require('./global-98c5eb78.js');
7
7
 
8
8
  /*
9
9
  Stencil Client Patch Esm v2.8.1 | MIT Licensed | https://stenciljs.com
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const index = require('./index-cd179539.js');
4
- require('./global-31bd3bd9.js');
4
+ require('./global-98c5eb78.js');
5
5
 
6
6
  /*
7
7
  Stencil Client Patch Browser v2.8.1 | MIT Licensed | https://stenciljs.com
@@ -400,7 +400,7 @@ const Chart = class {
400
400
  return (index.h("div", { class: "chart-wrapper doughnut-wrapper" }, index.h("svg", { width: outerSize + "px", height: outerSize + "px", ref: (el) => (this.doughnutEl = el), id: `graphic-${this.uid}`, class: "doughnut-svg" }, this.renderFilter(), this.slicesData.map((s) => this.renderPath(s)), this.currentChartType === "doughnut0" ? (index.h("text", { class: "value", x: "50%", y: "50%", "font-size": "1.5rem", "font-weight": "500", "text-anchor": "middle", "dominant-baseline": "middle" }, this.amountToPercent(this.slicesData[0].amount, true) + "%")) : (index.h("g", { transform: `translate(${this.chartData.padding / 2}, ${this.chartData.padding / 2})`, "text-anchor": "middle", "dominant-baseline": "middle" }, this.slicesData.map((s) => (s.amount > 0 ? this.renderDoughnutText(s) : "")))))));
401
401
  }
402
402
  renderPath(s) {
403
- return (index.h("g", { transform: `translate(${this.chartData.padding / 2}, ${this.chartData.padding / 2})` }, index.h("path", { id: s.id, class: "doughnut-segment", fill: s.amount ? s.color : "transparent", d: this.getPathData(s.amount, s.offset), onClick: (ev) => this.handleSliceClick(ev, s), onFocus: (ev) => this.handleSliceFocus(ev, s), onKeyDown: (ev) => this.handleSliceKeyDown(ev) }), index.h("text", { class: "sr-only" }, s.legend)));
403
+ return (index.h("g", { transform: `translate(${this.chartData.padding / 2}, ${this.chartData.padding / 2})` }, index.h("path", { id: s.id, class: "doughnut-segment", fill: s.amount ? s.color : "transparent", d: this.getPathData(s.amount, s.offset), onClick: (ev) => this.handleSliceClick(ev, s), onFocus: (ev) => this.handleSliceFocus(ev, s), onKeyDown: (ev) => this.handleSliceKeyDown(ev), role: "img", "aria-label": s.legend })));
404
404
  }
405
405
  renderDoughnutText(s) {
406
406
  if (!s.inSmallCluster) {
@@ -406,8 +406,7 @@ export class Chart {
406
406
  }
407
407
  renderPath(s) {
408
408
  return (h("g", { transform: `translate(${this.chartData.padding / 2}, ${this.chartData.padding / 2})` },
409
- h("path", { id: s.id, class: "doughnut-segment", fill: s.amount ? s.color : "transparent", d: this.getPathData(s.amount, s.offset), onClick: (ev) => this.handleSliceClick(ev, s), onFocus: (ev) => this.handleSliceFocus(ev, s), onKeyDown: (ev) => this.handleSliceKeyDown(ev) }),
410
- h("text", { class: "sr-only" }, s.legend)));
409
+ h("path", { id: s.id, class: "doughnut-segment", fill: s.amount ? s.color : "transparent", d: this.getPathData(s.amount, s.offset), onClick: (ev) => this.handleSliceClick(ev, s), onFocus: (ev) => this.handleSliceFocus(ev, s), onKeyDown: (ev) => this.handleSliceKeyDown(ev), role: "img", "aria-label": s.legend })));
411
410
  }
412
411
  renderDoughnutText(s) {
413
412
  if (!s.inSmallCluster) {
@@ -1,4 +1,4 @@
1
- const version = "3.7.0-1";
1
+ const version = "3.7.0-2";
2
2
 
3
3
  // PRINT RIPPLE VERSION IN CONSOLE
4
4
  // test envs return 0 for plugin.length
@@ -1,5 +1,5 @@
1
1
  import { p as promiseResolve, b as bootstrapLazy } from './index-66f8130e.js';
2
- import './global-f9c720e6.js';
2
+ import './global-6ee09028.js';
3
3
 
4
4
  /*
5
5
  Stencil Client Patch Esm v2.8.1 | MIT Licensed | https://stenciljs.com
@@ -1,5 +1,5 @@
1
1
  import { p as promiseResolve, b as bootstrapLazy } from './index-66f8130e.js';
2
- import './global-f9c720e6.js';
2
+ import './global-6ee09028.js';
3
3
 
4
4
  /*
5
5
  Stencil Client Patch Browser v2.8.1 | MIT Licensed | https://stenciljs.com
@@ -396,7 +396,7 @@ const Chart = class {
396
396
  return (h("div", { class: "chart-wrapper doughnut-wrapper" }, h("svg", { width: outerSize + "px", height: outerSize + "px", ref: (el) => (this.doughnutEl = el), id: `graphic-${this.uid}`, class: "doughnut-svg" }, this.renderFilter(), this.slicesData.map((s) => this.renderPath(s)), this.currentChartType === "doughnut0" ? (h("text", { class: "value", x: "50%", y: "50%", "font-size": "1.5rem", "font-weight": "500", "text-anchor": "middle", "dominant-baseline": "middle" }, this.amountToPercent(this.slicesData[0].amount, true) + "%")) : (h("g", { transform: `translate(${this.chartData.padding / 2}, ${this.chartData.padding / 2})`, "text-anchor": "middle", "dominant-baseline": "middle" }, this.slicesData.map((s) => (s.amount > 0 ? this.renderDoughnutText(s) : "")))))));
397
397
  }
398
398
  renderPath(s) {
399
- return (h("g", { transform: `translate(${this.chartData.padding / 2}, ${this.chartData.padding / 2})` }, h("path", { id: s.id, class: "doughnut-segment", fill: s.amount ? s.color : "transparent", d: this.getPathData(s.amount, s.offset), onClick: (ev) => this.handleSliceClick(ev, s), onFocus: (ev) => this.handleSliceFocus(ev, s), onKeyDown: (ev) => this.handleSliceKeyDown(ev) }), h("text", { class: "sr-only" }, s.legend)));
399
+ return (h("g", { transform: `translate(${this.chartData.padding / 2}, ${this.chartData.padding / 2})` }, h("path", { id: s.id, class: "doughnut-segment", fill: s.amount ? s.color : "transparent", d: this.getPathData(s.amount, s.offset), onClick: (ev) => this.handleSliceClick(ev, s), onFocus: (ev) => this.handleSliceFocus(ev, s), onKeyDown: (ev) => this.handleSliceKeyDown(ev), role: "img", "aria-label": s.legend })));
400
400
  }
401
401
  renderDoughnutText(s) {
402
402
  if (!s.inSmallCluster) {
@@ -1 +1 @@
1
- window.navigator.plugins.length>0&&console.log("Ripple component library","3.7.0-1"),window.addEventListener("keydown",(function(n){var o=n.key||n.keyCode;if("Tab"==o||9===o){var e=new Event("wmUserIsTabbing");window.dispatchEvent(e),document.querySelector("body").classList.add("wmcl-user-is-tabbing")}"ArrowLeft"!=o&&37!==o&&"ArrowUp"!=o&&38!==o&&"ArrowRight"!=o&&39!==o&&"ArrowDown"!=o&&40!==o||(e=new Event("wmUserIsKeying"),window.dispatchEvent(e),document.querySelector("body").classList.add("wmcl-user-is-keying"))})),window.addEventListener("mousedown",(function(){var n=new Event("wmUserIsNotTabbing");window.dispatchEvent(n),document.querySelector("body").classList.remove("wmcl-user-is-tabbing"),document.querySelector("body").classList.remove("wmcl-user-is-keying")}));const n=document.createElement("div");n.id="wm-tooltip-container";const o=document.createElement("div");o.id="wm-tooltip",o.setAttribute("aria-hidden","true"),o.style.position="fixed",o.style.overflow="hidden",o.style.pointerEvents="none",o.style.lineHeight="normal",o.style.fontFamily="inherit",o.style.fontSize="0.875rem",o.style.textTransform="none",o.style.fontWeight="normal",o.style.background="black",o.style.color="#fff",o.style.zIndex="999999",o.style.maxWidth="13.75rem",o.style.marginRight="1.5rem",o.style.padding="0.375rem",o.style.transitionProperty="opacity",o.style.transitionDelay="opacity",o.style.opacity="0",n.appendChild(o),document.querySelector("body").appendChild(n);
1
+ window.navigator.plugins.length>0&&console.log("Ripple component library","3.7.0-2"),window.addEventListener("keydown",(function(n){var o=n.key||n.keyCode;if("Tab"==o||9===o){var e=new Event("wmUserIsTabbing");window.dispatchEvent(e),document.querySelector("body").classList.add("wmcl-user-is-tabbing")}"ArrowLeft"!=o&&37!==o&&"ArrowUp"!=o&&38!==o&&"ArrowRight"!=o&&39!==o&&"ArrowDown"!=o&&40!==o||(e=new Event("wmUserIsKeying"),window.dispatchEvent(e),document.querySelector("body").classList.add("wmcl-user-is-keying"))})),window.addEventListener("mousedown",(function(){var n=new Event("wmUserIsNotTabbing");window.dispatchEvent(n),document.querySelector("body").classList.remove("wmcl-user-is-tabbing"),document.querySelector("body").classList.remove("wmcl-user-is-keying")}));const n=document.createElement("div");n.id="wm-tooltip-container";const o=document.createElement("div");o.id="wm-tooltip",o.setAttribute("aria-hidden","true"),o.style.position="fixed",o.style.overflow="hidden",o.style.pointerEvents="none",o.style.lineHeight="normal",o.style.fontFamily="inherit",o.style.fontSize="0.875rem",o.style.textTransform="none",o.style.fontWeight="normal",o.style.background="black",o.style.color="#fff",o.style.zIndex="999999",o.style.maxWidth="13.75rem",o.style.marginRight="1.5rem",o.style.padding="0.375rem",o.style.transitionProperty="opacity",o.style.transitionDelay="opacity",o.style.opacity="0",n.appendChild(o),document.querySelector("body").appendChild(n);
@@ -0,0 +1 @@
1
+ import{r as e,f as t,h as r,H as n,g as a}from"./p-9baa3039.js";import{g as i,d as o,b as s,f as p,i as h,c as l}from"./p-b5edcf38.js";const c=class{constructor(r){e(this,r),this.chartType="doughnut1",this.showLegend=!0,this.notStartedColor=!1,this.labelPosition="top",this.isTabbing=!1,this.uid=i(),this.slicesData=[],this.colors={salmon:"#ff5f4e",cyan:"#19a1a9",forest:"#088000",sleet:"#7f97ad",midnight:"#2e1b46",lavender:"#8b86ca"},this.types={doughnut0:{size:155,colors:[this.colors.forest,"#bfbfbf"],thickness:.73,padding:25,isBar:!1},doughnut1:{size:130,colors:[this.colors.lavender,this.colors.midnight,"#d4d4d4"],thickness:.5,padding:90,isBar:!1},doughnut2:{size:130,colors:[this.colors.cyan,this.colors.salmon,"#d4d4d4"],thickness:.5,padding:90,isBar:!1},doughnut3:{size:130,colors:[this.colors.lavender,this.colors.midnight,"#919834","#c177cf","#c16e00","#029af2","#2a6993"],thickness:.5,padding:90,isBar:!1},bar1:{size:350,colors:[this.colors.forest,"#bfbfbf"],padding:0,isBar:!0},bar2:{size:400,colors:["#d4d4d4",this.colors.sleet,this.colors.cyan,this.colors.salmon],padding:0,isBar:!0},bar3:{size:300,colors:["#0d696e",this.colors.cyan,"#8e4129",this.colors.salmon],padding:0,isBar:!0},bar4:{size:400,colors:["#d4d4d4",this.colors.sleet,"#33a919"],padding:0,isBar:!0},bar5:{size:400,colors:["#d4d4d4",this.colors.lavender,this.colors.midnight,"#919834","#c177cf","#c16e00","#029af2","#2a6993"],padding:0,isBar:!0}},this.debouncedResize=o((async()=>{this.setHybridType(),await this.getData(),t(this.el)}),10),this.debouncedSliceUpdate=o((async()=>{await this.getData(),t(this.el)}),100)}get tempValueFormat(){return this.valueFormat||this.showValues||"none"}get sliceEls(){const e=this.currentChartType.includes("bar"),t=this.currentChartType.includes("doughnut");return e?Array.from(this.barEl.querySelectorAll(".bar-segment")):t?Array.from(this.doughnutEl.querySelectorAll(".doughnut-segment")):void 0}get currentChartType(){return"hybrid"===this.chartType?this.hybridType:this.chartType}toggleTabbingOn(){this.isTabbing=!0}toggleTabbingOff(){this.isTabbing=!1}handleKeydown(e){switch(e.keyCode){case 37:case 38:e.preventDefault(),this.isTabbing=!0,this.focusPrevious();break;case 39:case 40:e.preventDefault(),this.isTabbing=!0,this.focusNext();break;case 9:this.exitChart();break;case 27:this.popoverEl.open=!1}}handleSliceClick(e,t){this.popoverEl&&!this.isTabbing&&(t.coords={x:e.clientX,y:e.clientY},this.openPopover(t))}handleSliceFocus(e,t){this.popoverEl&&this.isTabbing&&(t.coords=s(e.target),this.openPopover(t))}handleSliceKeyDown(e){if(this.popoverEl&&this.popoverEl.open&&"Enter"===e.key){const e=this.popoverEl.querySelector("button");e&&e.click()}}focusNext(){const e=l(document.activeElement),t=(this.sliceEls.indexOf(e)+1)%this.sliceEls.length;this.focusSlice(t)}focusPrevious(){if(this.sliceEls){const e=l(document.activeElement);let t=this.sliceEls.indexOf(e);-1===t?t=0:0===t?t=this.sliceEls.length-1:t-=1,this.focusSlice(t)}}focusSlice(e){this.sliceEls&&this.el&&(this.popoverEl&&(this.popoverEl.open=!1),this.el.tabIndex=-1,this.el.focusable=!1,this.sliceEls.map((e=>{e.tabIndex=-1,e.focusable=!1})),this.sliceEls[e].tabIndex=0,this.sliceEls[e].focusable=!0,this.sliceEls[e].focus(),window.setTimeout((()=>{this.popoverEl&&(this.popoverEl.open=!0)}),10))}exitChart(){this.sliceEls&&this.sliceEls.map((e=>{e.tabIndex=-1,e.focusable=!1})),window.setTimeout((()=>{this.el&&(this.el.tabIndex=0,this.el.focusable=!0,this.popoverEl&&(this.popoverEl.open=!1))}),100)}openPopover(e){if(this.popoverEl&&e.title&&e.text){this.popoverEl.popoverTitle=e.title,this.popoverEl.popoverText=e.text,this.popoverEl.buttonText=e.buttonText,this.popoverEl.coords=e.coords,this.popoverEl.sliceRef=e.sliceRef,window.setTimeout((()=>{this.popoverEl&&(this.popoverEl.open=!0)}),30);const t=o((async()=>{this.popoverEl.open=!1}),10);document.addEventListener("scroll",(()=>{t()}));const r=p(this.el);r&&r.addEventListener("scroll",(()=>{t()}))}}amountToPercent(e,t){return t?Math.round(100*e/this.total):Math.round(1e4*e/this.total)/100}amountToDegree(e){return 360*e/this.total}toFixed(e){return parseFloat((Math.floor(100*e)/100).toFixed(2))}polarToCartesian(e,t,r,n){var a=this.toFixed(e+e*t*Math.cos(Math.PI*r/180)),i=this.toFixed(e+e*t*Math.sin(Math.PI*r/180));return void 0!==n?{x1:a,y1:i,x2:this.toFixed(e+e*t*Math.cos(Math.PI*n/180)),y2:this.toFixed(e+e*t*Math.sin(Math.PI*n/180))}:{x:a,y:i}}getPathData(e,t){var r=this.amountToDegree(t)-90,n=e/this.total*360,a=r+n,i=n>180?"1 1":"0 1",o=n>180?"1 0":"0 0",s=this.chartData.size/2,p=this.chartData.thickness;360===n&&(a-=.01);var h=this.polarToCartesian(s,1,r+1.5,a),l=this.polarToCartesian(s,p,r+3,a);return`M ${h.x1}, ${h.y1} `+this.getArc(1,i,h.x2,h.y2)+` L ${l.x2}, ${l.y2} `+this.getArc(p,o,l.x1,l.y1)+" z"}getArc(e,t,r,n){var a=this.toFixed(this.chartData.size/2*e);return`A ${a}, ${a} 0 ${t} ${this.toFixed(r)}, ${this.toFixed(n)}`}setHybridType(){this.hybridType=window.innerWidth>1340?"doughnut0":"bar1"}async getData(){this.slicesData=[];let e=0;const t=this.el.querySelectorAll("wm-chart-slice");this.total=Array.from(t).reduce(((e,t)=>e+parseInt(t.getAttribute("amount")||"0")),0),t.forEach(((r,n)=>{const a=parseInt(r.getAttribute("amount")||"0"),i=this.amountToPercent(a,!0),o=this.amountToPercent(parseInt(t[0===n?t.length-1:n-1].getAttribute("amount")||"0"),!0),s=this.amountToPercent(parseInt(t[n===t.length-1?0:n+1].getAttribute("amount")||"0"),!0);let p=i<4&&(o<5||s<5);0===i&&a>0&&(s<8||o<8)&&(p=!0);const h=this.types[this.currentChartType].colors["bar5"===this.currentChartType?this.notStartedColor?n:n+1:n],l={amount:a,perc:i,legend:r.getAttribute("legend"),color:h||"#d4d4d4",offset:e,id:`${this.uid}-${n+1}`,title:r.getAttribute("popover-title"),text:r.getAttribute("popover-text"),buttonText:r.getAttribute("popover-button-text"),sliceRef:r,inSmallCluster:p};e+=a,this.slicesData.push(l)})),this.chartData=this.types[this.currentChartType]}handleResize(){"hybrid"===this.chartType&&this.debouncedResize()}async componentWillLoad(){if(!this.label)throw new Error("For accessibility purposes, you must provide a label for the chart. See https://components.watermarkinsights.com/chart for more information.");this.showValues&&console.warn("wm-chart: show-values has been deprecated as of v3.1.0. Please use value-format instead."),"hybrid"===this.chartType&&this.setHybridType(),await this.getData()}handleSliceUpdate(){this.debouncedSliceUpdate()}renderFilter(){return r("defs",null,r("filter",{id:"wmHoverDropShadow"},r("feGaussianBlur",{stdDeviation:"3"}),r("feOffset",{result:"offsetblur"}),r("feFlood",{"flood-color":"#333"}),r("feComposite",{operator:"in",in2:"offsetblur"}),r("feMerge",null,r("feMergeNode",null),r("feMergeNode",{in:"SourceGraphic"}))))}renderDoughnut(){const e=this.chartData.size+this.chartData.padding;return r("div",{class:"chart-wrapper doughnut-wrapper"},r("svg",{width:e+"px",height:e+"px",ref:e=>this.doughnutEl=e,id:`graphic-${this.uid}`,class:"doughnut-svg"},this.renderFilter(),this.slicesData.map((e=>this.renderPath(e))),"doughnut0"===this.currentChartType?r("text",{class:"value",x:"50%",y:"50%","font-size":"1.5rem","font-weight":"500","text-anchor":"middle","dominant-baseline":"middle"},this.amountToPercent(this.slicesData[0].amount,!0)+"%"):r("g",{transform:`translate(${this.chartData.padding/2}, ${this.chartData.padding/2})`,"text-anchor":"middle","dominant-baseline":"middle"},this.slicesData.map((e=>e.amount>0?this.renderDoughnutText(e):"")))))}renderPath(e){return r("g",{transform:`translate(${this.chartData.padding/2}, ${this.chartData.padding/2})`},r("path",{id:e.id,class:"doughnut-segment",fill:e.amount?e.color:"transparent",d:this.getPathData(e.amount,e.offset),onClick:t=>this.handleSliceClick(t,e),onFocus:t=>this.handleSliceFocus(t,e),onKeyDown:e=>this.handleSliceKeyDown(e),role:"img","aria-label":e.legend}))}renderDoughnutText(e){if(!e.inSmallCluster){const t=this.amountToDegree(e.offset+e.amount/2);let{x:n,y:a}=this.polarToCartesian(this.chartData.size/2,1.4,t-90);return r("text",{class:"value",x:n+"px",y:a+"px"},`${e.perc>0?e.perc:"<1"}%`)}}renderBar(){return r("div",{class:"chart-wrapper bar-wrapper"},"bar1"===this.currentChartType?r("div",{class:"single-perc"},this.amountToPercent(this.slicesData[0].amount,!0)+"%"):"",this.drawAxis(),r("div",{class:{"inner-bar-wrapper":!0,"show-values":"percentage"===this.tempValueFormat||"amount"===this.tempValueFormat}},"bar1"!==this.currentChartType?r("div",null,this.slicesData.map(((e,t)=>e.perc>0?this.renderBarText(e,t):""))):"",r("div",{class:"bar-segments-wrapper",ref:e=>this.barEl=e},this.slicesData.map(((e,t)=>this.renderBarSegment(e,t)))),this.renderCompletionMessage()))}renderBarSegment(e,t){const n=t!==this.slicesData.length-1,a=`calc(${this.amountToPercent(e.amount,!1)}%${n?" - 2px":""})`;return r("div",{class:"bar-segment "+(0===this.amountToPercent(e.amount,!1)?"zero":""),style:{backgroundColor:e.color,width:a},onClick:t=>this.handleSliceClick(t,e),onFocus:t=>this.handleSliceFocus(t,e),onKeyDown:e=>this.handleSliceKeyDown(e)},r("text",{class:"sr-only"},e.legend))}renderBarText(e,t){let n;if("percentage"===this.tempValueFormat)n=e.perc+"%";else{if("amount"!==this.tempValueFormat)return;n=e.amount}return r("span",{class:"value",style:{width:`calc(${this.amountToPercent(e.amount,!1)}%\n ${t!==this.slicesData.length-1?" - 2px":""}`}},n)}drawAxis(){if("bar3"===this.currentChartType)return r("svg",{class:"axis"},r("line",{x1:"0",x2:"100%",y1:"0",y2:"0"}),r("line",{x1:"0",x2:"0",y1:"0",y2:"-85px"}),r("line",{class:"tick",x1:"0.5",x2:"0.5",y1:"0",y2:"6"}),r("text",{x:"0.5",y:"-6"},"0%"),r("line",{class:"tick",x1:"100%",x2:"100%",y1:"0",y2:"6"}),r("text",{x:"100%",y:"-6"},"100%"))}renderCompletionMessage(){if("hybrid"===this.chartType&&this.completionMessage)return r("div",{class:"completion-message"},this.completionMessage)}renderLegend(){if(this.showLegend){const e=this.slicesData.reduce(((e,t)=>!!t.inSmallCluster||e),!1);return r("div",{class:"legend-wrapper"},r("div",{class:"legend "+(this.chartData.isBar?"--top":"--bottom"),"aria-hidden":"true"},this.total>0?this.slicesData.map((e=>{if(e.amount||e.legend)return r("div",{class:"legend-item"},r("div",{class:"legend-color",style:{"background-color":e.color}}),r("div",{class:"legend-text"},e.legend))})):""),!this.chartData.isBar&&e?r("div",{class:"cluster-warning"},h.formatMessage({id:"chart.hiddenPercentages",defaultMessage:"Percentages smaller than 5% are not shown when too close to each other."}),r("br",null),h.formatMessage({id:"chart.clickToSeeDetails",defaultMessage:"Click or use arrow keys to see details."})):"")}}render(){return r(n,{role:"application","aria-label":this.label+", "+h.formatMessage({id:"chart.interactiveChart",defaultMessage:"Interactive chart. Use arrow keys to browse elements, press Tab to exit."}),tabindex:"0"},r("div",{class:`component-wrapper ${this.currentChartType} ${this.isTabbing?"user-is-tabbing":""} ${"left"===this.labelPosition&&"bar4"===this.chartType?"left-label":""}`},r("label",{class:"label",id:`label-${this.uid}`,htmlFor:`graphic-${this.uid}`},r("span",{class:"label-text"},this.label),this.subinfo?r("span",{class:"subinfo"},this.subinfo):""),this.chartData.isBar?this.renderLegend():"",this.total>0&&this.chartData.isBar?this.renderBar():this.renderDoughnut(),this.chartData.isBar?"":this.renderLegend(),r("priv-chart-popover",{class:this.isTabbing?"user-is-tabbing":"",ref:e=>this.popoverEl=e}),"doughnut0"===this.hybridType?this.renderCompletionMessage():""))}get el(){return a(this)}};c.style=".component-wrapper{display:flex;flex-direction:column;align-items:center;font-size:0.875rem;position:relative;}.component-wrapper .label{display:block;margin:0;padding-bottom:0.25rem;font-weight:500;position:relative}.component-wrapper .label .subinfo{display:block;font-weight:normal;font-style:italic;bottom:0.25rem;width:100%;color:#6b6b6b}.component-wrapper .legend-wrapper{display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center}.component-wrapper .legend-wrapper .legend{display:flex;align-items:center;flex-wrap:wrap;text-align:center;padding-top:0.25rem;padding-bottom:0.75rem;box-sizing:border-box}.component-wrapper .legend-wrapper .legend.--top{margin-top:-0.75rem}.component-wrapper .legend-wrapper .legend.--top .legend-item{padding-top:0.75rem}.component-wrapper .legend-wrapper .legend.--top .legend-color{top:0.75rem}.component-wrapper .legend-wrapper .legend.--bottom{margin-bottom:-0.75rem}.component-wrapper .legend-wrapper .legend.--bottom .legend-item{padding-bottom:0.75rem}.component-wrapper .legend-wrapper .legend.--bottom .legend-color{top:-0.75rem}.component-wrapper .legend-wrapper .legend .legend-item{position:relative}.component-wrapper .legend-wrapper .legend .legend-item:not(:last-of-type){padding-right:1.25rem}.component-wrapper .legend-wrapper .legend .legend-text{padding-left:1rem;line-height:1}.component-wrapper .legend-wrapper .legend .legend-color{position:absolute;left:0;bottom:0;margin:auto;width:0.6875rem;height:0.6875rem}.component-wrapper .legend-wrapper .cluster-warning{font-size:0.75rem;font-style:italic;max-width:100%}.component-wrapper .doughnut-svg,.component-wrapper .inner-bar-wrapper{overflow:visible}.component-wrapper .bar-wrapper{flex-grow:1;width:100%}.component-wrapper .bar-wrapper .inner-bar-wrapper{width:100%}.component-wrapper .bar-wrapper .inner-bar-wrapper .bar-segments-wrapper{display:flex}.component-wrapper .bar-wrapper .inner-bar-wrapper .bar-segments-wrapper .bar-segment{height:30px;cursor:pointer}.component-wrapper .bar-wrapper .inner-bar-wrapper .bar-segments-wrapper .bar-segment:not(.zero):not(:last-of-type){margin-right:2px}.component-wrapper .doughnut-wrapper{-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;border-radius:4px}.component-wrapper .doughnut-wrapper .doughnut-segment{cursor:pointer}.component-wrapper .value{display:inline-block;text-align:center}.component-wrapper .value:not(:last-of-type){margin-right:2px}.component-wrapper path:active,.component-wrapper path:hover,.component-wrapper path:focus,.component-wrapper .bar-segment:active,.component-wrapper .bar-segment:hover,.component-wrapper .bar-segment:focus{outline:none}.component-wrapper path:active.bar-segment,.component-wrapper path:hover.bar-segment,.component-wrapper path:focus.bar-segment,.component-wrapper .bar-segment:active.bar-segment,.component-wrapper .bar-segment:hover.bar-segment,.component-wrapper .bar-segment:focus.bar-segment{-webkit-box-shadow:0px 0px 6px #333;-moz-box-shadow:0px 0px 6px #333;box-shadow:0px 0px 6px #333}.component-wrapper path:active.doughnut-segment,.component-wrapper path:hover.doughnut-segment,.component-wrapper path:focus.doughnut-segment,.component-wrapper .bar-segment:active.doughnut-segment,.component-wrapper .bar-segment:hover.doughnut-segment,.component-wrapper .bar-segment:focus.doughnut-segment{filter:url(#wmHoverDropShadow)}.component-wrapper path::-moz-focus-inner,.component-wrapper .bar-segment::-moz-focus-inner{border:0;outline:none}.component-wrapper.doughnut1 label,.component-wrapper.doughnut1 .label-text,.component-wrapper.doughnut2 label,.component-wrapper.doughnut2 .label-text,.component-wrapper.doughnut3 label,.component-wrapper.doughnut3 .label-text{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}.component-wrapper.doughnut0{align-items:center}.component-wrapper.doughnut0 label{text-align:center;width:100%;padding-bottom:1.5rem}.component-wrapper.doughnut0 label .subinfo{position:absolute}.component-wrapper.doughnut0 .legend{display:flex}.component-wrapper.doughnut0 .completion-message{padding-top:0.625rem}.component-wrapper.bar1{padding:1.25rem;align-items:flex-start}.component-wrapper.bar1 label{display:flex;flex-direction:column}.component-wrapper.bar1 label .subinfo{position:initial}.component-wrapper.bar1 .legend{display:none}.component-wrapper.bar1 .chart-wrapper{display:flex}.component-wrapper.bar1 .chart-wrapper .single-perc{width:4rem;flex:none;display:flex;height:30px;align-items:center}.component-wrapper.bar1 .chart-wrapper .inner-bar-wrapper{flex:1}.component-wrapper.bar1 .chart-wrapper .completion-message{width:100%;text-align:right;margin-top:0.25rem}@media screen and (min-width: 768px){.component-wrapper.bar1{flex-direction:row}.component-wrapper.bar1 label{display:flex;justify-content:center;min-height:30px;width:12rem;text-align:left;padding-right:1.25rem;padding-bottom:0;flex:none}.component-wrapper.bar1 .bar-wrapper{flex-direction:row-reverse}.component-wrapper.bar1 .bar-wrapper .single-perc{text-align:center;padding-left:0.5rem;justify-content:center}}.component-wrapper.bar2,.component-wrapper.bar3,.component-wrapper.bar4,.component-wrapper.bar5{align-items:flex-start}.component-wrapper.bar2 .inner-bar-wrapper,.component-wrapper.bar4 .inner-bar-wrapper,.component-wrapper.bar5 .inner-bar-wrapper{height:30px;margin-bottom:0}.component-wrapper.bar2 .inner-bar-wrapper.show-values,.component-wrapper.bar4 .inner-bar-wrapper.show-values,.component-wrapper.bar5 .inner-bar-wrapper.show-values{height:60px;margin-top:0}.component-wrapper.bar3 .legend{padding-bottom:1.25rem}.component-wrapper.bar3 .chart-wrapper{position:relative;height:100px}.component-wrapper.bar3 .chart-wrapper .inner-bar-wrapper{position:absolute;top:35px;left:0;right:0;bottom:0;height:30px}.component-wrapper.bar3 .chart-wrapper .inner-bar-wrapper text{fill:#4a4a4a}.component-wrapper.bar3 .chart-wrapper .axis{position:absolute;top:0;left:0;height:90px;width:100%;overflow:visible;transform:translateY(90px)}.component-wrapper.bar3 .chart-wrapper .axis line{stroke:#eeedf4;stroke-width:1px}.component-wrapper.bar3 .chart-wrapper .axis text{transform:translate(4px, 24px);text-anchor:middle}.component-wrapper.left-label{flex-direction:row}.component-wrapper.left-label .label{width:12rem;padding-right:1.25rem;flex:none;align-self:flex-end;min-height:30px;display:flex;align-items:center}:host(:focus){outline:none}:host(:focus) .component-wrapper.user-is-tabbing .bar-segments-wrapper,:host(:focus) .component-wrapper.user-is-tabbing .doughnut-wrapper{-webkit-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px #61279e;-moz-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px #61279e;box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px #61279e}:host(:focus) .component-wrapper.user-is-tabbing .bar-segments-wrapper::-moz-focus-inner,:host(:focus) .component-wrapper.user-is-tabbing .doughnut-wrapper::-moz-focus-inner{border:0}";export{c as wm_chart}
@@ -1 +1 @@
1
- import{p as e,b as t}from"./p-9baa3039.js";import"./p-afc2d462.js";(()=>{const t=import.meta.url,a={};return""!==t&&(a.resourcesUrl=new URL(".",t).href),e(a)})().then((e=>t(JSON.parse('[["p-7d9c18b9",[[1,"wm-tab-list",{"customBackground":[1,"custom-background"],"customPadding":[1,"custom-padding"],"selectedTab":[1,"selected-tab"],"controllerEnabled":[4,"controller-enabled"]},[[0,"tabItemLoaded","tabItemLoaded"],[0,"wmTabSelected","handleTabSelected"],[0,"keydownOnTabItem","handleKeydown"],[9,"resize","setLayout"]]],[1,"wm-tab-item",{"selected":[4],"show":[4],"tabId":[1,"tab-id"]},[[4,"keydown","toggleTabbingOn"],[4,"click","toggleTabbingOff"]]],[0,"wm-tab-panel",{"active":[1028],"tabId":[1025,"tab-id"]},[[4,"keydown","toggleTabbingOn"],[4,"click","toggleTabbingOff"]]]]],["p-f3569e91",[[1,"wm-navigator",{"userName":[1,"user-name"],"email":[1],"authType":[2,"auth-type"],"connectionName":[1,"connection-name"],"logoutUrl":[1,"logout-url"],"products":[1],"loadFromUserinfo":[4,"load-from-userinfo"],"isOpen":[32],"isTabbing":[32],"itemIndexToFocus":[32]},[[8,"wmUserIsTabbing","toggleTabbingOn"],[8,"wmUserIsNotTabbing","toggleTabbingOff"],[0,"keydown","handleKeys"],[0,"keydownOnNavItem","handleKeydown"],[4,"click","handleClick"],[0,"buttonActivated","handleButtonClick"]]]]],["p-da1435f1",[[1,"wm-network-uploader",{"getPath":[1,"get-path"],"requestUploadPath":[1,"request-upload-path"],"uploadPath":[1,"upload-path"],"requestDownloadPath":[1,"request-download-path"],"deletePath":[1,"delete-path"],"associatedData":[1,"associated-data"],"buttonText":[1,"button-text"],"emptyStateText":[1,"empty-state-text"],"icon":[1],"fileTypes":[1,"file-types"],"maxSize":[2,"max-size"],"maxFiles":[2,"max-files"],"sortBy":[1,"sort-by"],"isTabbing":[32],"fileList":[32],"inProgressList":[32],"errorList":[32],"notif":[32],"snackbar":[32],"numFilesInProgress":[32]},[[8,"wmUserIsTabbing","toggleTabbingOn"],[8,"wmUserIsNotTabbing","toggleTabbingOff"],[0,"wmUploadProgress","handleUploadProgress"],[0,"userFinishedSnack","handleFinishedSnack"]]]]],["p-8a4bac13",[[1,"wm-action-menu",{"tooltipPosition":[1,"tooltip-position"],"actionMenuType":[1,"action-menu-type"],"buttonType":[1,"button-type"],"buttonText":[1,"button-text"],"disabled":[516],"tooltip":[1],"labelForIdenticalButtons":[1,"label-for-identical-buttons"],"isExpanded":[32]},[[0,"wmMenuitemClicked","handleClickedItem"],[0,"wmKeyUpPressed","handleKeyUp"],[0,"wmKeyDownPressed","handleKeyDown"],[0,"wmHomeKeyPressed","handleHomeKey"],[0,"wmEndKeyPressed","handleEndKey"],[0,"wmTabKeyPressed","handleTabKey"],[0,"wmEscKeyPressed","handleEscKey"],[4,"click","handleClick"],[0,"keydown","handleKey"],[0,"wmMenuitemBlurred","handleMenuitemBlur"],[0,"wmLetterPressed","findAndFocusItem"]]],[1,"wm-menuitem",{"disabled":[4],"focused":[4],"icon":[1025],"description":[1],"isKeying":[32]},[[8,"wmUserIsKeying","toggleKeyingOn"],[8,"wmUserIsTabbing","toggleKeyingOn"],[8,"wmUserIsNotKeying","toggleKeyingOff"],[8,"wmUserIsNotTabbing","toggleKeyingOff"],[0,"keydown","handleKeydown"],[0,"click","handleClick"],[0,"blur","handleBlur"]]]]],["p-9d6e4c64",[[1,"wm-chart",{"chartType":[1,"chart-type"],"label":[1],"subinfo":[1],"completionMessage":[1,"completion-message"],"valueFormat":[1,"value-format"],"showValues":[1,"show-values"],"showLegend":[4,"show-legend"],"notStartedColor":[4,"not-started-color"],"labelPosition":[1,"label-position"],"isTabbing":[32]},[[8,"wmUserIsTabbing","toggleTabbingOn"],[8,"wmUserIsNotTabbing","toggleTabbingOff"],[0,"keydown","handleKeydown"],[9,"resize","handleResize"],[0,"wmChartSliceUpdated","handleSliceUpdate"]]]]],["p-e3765b8e",[[1,"wm-datepicker",{"value":[1025],"disabled":[4],"dateFormat":[1025,"date-format"],"errorMessage":[513,"error-message"],"labelPosition":[1025,"label-position"],"label":[1025],"requiredField":[4,"required-field"],"preventValidation":[1,"prevent-validation"],"displayError":[32]},[[0,"keydown","handleTabbingOn"],[0,"click","handleTabbingOff"],[0,"popupClosed","handlePopupClosed"],[0,"cellTriggered","handleCellTriggered"]]]]],["p-bc9ca97b",[[0,"wm-modal-footer",{"secondaryText":[1,"secondary-text"],"primaryText":[1,"primary-text"],"infoText":[1,"info-text"],"primaryActionDisabled":[4,"primary-action-disabled"],"deleteStyle":[4,"delete-style"]},[[4,"focusLastElement","focusLastEl"]]]]],["p-111f705a",[[0,"wm-modal-header",{"heading":[1],"subheading":[1]},[[4,"focusFirstElement","focusFirstEl"]]]]],["p-0c488d9d",[[1,"wm-search",{"searchType":[1025,"search-type"],"disabled":[516],"placeholder":[1],"label":[1],"numResults":[1026,"num-results"],"value":[1537],"highlightedId":[1,"highlighted-id"],"highlightedName":[1,"highlighted-name"],"isTabbing":[32],"highlightedNum":[32],"previousBlurredValue":[32],"parentModal":[32],"updateValue":[64]},[[8,"wmUserIsTabbing","toggleTabbingOn"],[8,"wmUserIsNotTabbing","toggleTabbingOff"]]]]],["p-4414cb64",[[1,"wm-uploader",{"uploaderType":[1025,"uploader-type"],"type":[1],"buttonText":[1,"button-text"],"info":[1],"emptyStateText":[1,"empty-state-text"],"icon":[1],"fileTypes":[1,"file-types"],"maxSize":[2,"max-size"],"maxFiles":[2,"max-files"],"sortBy":[1,"sort-by"],"files":[1],"filesToUpload":[16],"rejectedFiles":[1,"rejected-files"],"isTabbing":[32],"errorList":[32],"notif":[32],"numFilesInProgress":[32]},[[8,"wmUserIsTabbing","toggleTabbingOn"],[8,"wmUserIsNotTabbing","toggleTabbingOff"],[0,"wmUploadProgress","handleUploadProgress"]]]]],["p-8b0eb05e",[[0,"wm-chart-slice",{"legend":[1],"amount":[1]}]]],["p-787469ab",[[1,"wm-input",{"label":[1],"labelPosition":[1,"label-position"],"value":[1537],"disabled":[516],"info":[1],"placeholder":[1],"requiredField":[4,"required-field"],"errorMessage":[1,"error-message"],"characterLimit":[2,"character-limit"],"preventValidation":[1,"prevent-validation"],"type":[1],"step":[2],"min":[2],"max":[2],"announcement":[32],"displayedErrorMessage":[32]}]]],["p-ad73d523",[[0,"wm-modal",{"open":[1540],"isOpen":[1540,"is-open"],"elementToFocus":[1025,"element-to-focus"],"modalType":[513,"modal-type"],"isTypeDialog":[516,"is-type-dialog"],"uid":[1537],"emitCloseEvent":[64],"emitPrimaryEvent":[64],"emitSecondaryEvent":[64]},[[0,"click","handleClick"],[0,"keydown","closeModalOnEscape"]]]]],["p-cd466a5b",[[1,"wm-pagination",{"currentPage":[2,"current-page"],"totalItems":[2,"total-items"],"itemsPerPage":[2,"items-per-page"],"value":[2],"isLargeViewport":[4,"is-large-viewport"],"isTabbing":[32],"srAnnouncement":[32]},[[8,"wmUserIsTabbing","toggleTabbingOn"],[8,"wmUserIsNotTabbing","toggleTabbingOff"],[9,"resize","handleResize"]]]]],["p-bd05632b",[[1,"wm-tag-input",{"label":[1],"labelPosition":[1,"label-position"],"options":[1025],"selectedTags":[1537,"selected-tags"],"info":[1],"addNew":[4,"add-new"],"placeholder":[1025],"characterLimit":[2,"character-limit"],"maxTags":[2,"max-tags"],"focusedListItem":[32],"focusedTag":[32],"isExpanded":[32],"tagsList":[32],"optionsList":[32],"charCount":[32],"liveRegionMessage":[32]},[[4,"click","closeIfNotElOrChild"],[9,"resize","handleResize"]]]]],["p-2caeca6b",[[1,"wm-timepicker",{"disabled":[4],"value":[1537],"errorMessage":[1,"error-message"],"label":[1],"labelPosition":[1,"label-position"],"requiredField":[4,"required-field"],"preventValidation":[1,"prevent-validation"],"selectedOption":[32],"isExpanded":[32],"isTabbing":[32],"displayedErrorMessage":[32]},[[8,"wmUserIsTabbing","toggleTabbingOn"],[8,"wmUserIsNotTabbing","toggleTabbingOff"],[0,"keydown","handleKey"]]]]],["p-30f13477",[[1,"wm-toggletip",{"label":[1],"tooltip":[1025],"tooltipText":[1,"tooltip-text"],"tooltipPosition":[1537,"tooltip-position"],"isOpen":[32],"isTabbing":[32]},[[0,"keydown","handleKeydown"],[8,"wmUserIsTabbing","toggleTabbingOn"],[8,"wmUserIsNotTabbing","toggleTabbingOff"],[4,"click","handleClick"]]]]],["p-0c58f50d",[[0,"wm-wrapper"]]],["p-b9656d44",[[0,"priv-chart-popover",{"sliceRef":[16],"popoverTitle":[1,"popover-title"],"popoverText":[1,"popover-text"],"buttonText":[1,"button-text"],"open":[1028],"coords":[16]},[[4,"click","handleClickOnDocument"],[0,"click","handleClick"]]]]],["p-c0b0510a",[[0,"priv-datepicker",{"disabled":[4],"isExpanded":[1540,"is-expanded"],"view":[1537],"date":[1040],"selectedYear":[1026,"selected-year"],"selectedMonth":[1026,"selected-month"],"selectedDay":[1026,"selected-day"],"monthInFocus":[1026,"month-in-focus"],"yearInFocus":[1026,"year-in-focus"],"dayInFocus":[1026,"day-in-focus"],"parentId":[1537,"parent-id"],"monthNumInFocus":[32]},[[0,"keydown","handleKey"],[0,"keydown","toggleTabbingOn"],[9,"mousedown","toggleTabbingOff"],[4,"click","blurHandler"],[8,"blur","handleBlurOnWindow"]]]]],["p-11c09317",[[1,"priv-navigator-button",{"expanded":[1028],"altText":[1,"alt-text"],"isTabbing":[1028,"is-tabbing"]}]]],["p-99db8501",[[1,"priv-navigator-item",{"selected":[1028],"focused":[1028],"link":[1025]},[[0,"keydown","handleKeyDown"]]]]],["p-938a5ba4",[[1,"wm-snackbar",{"notifications":[1537]},[[4,"keydown","checkForTabbing"],[5,"mouseover","handleMouse"]]]]],["p-266e4bc2",[[1,"wm-option",{"value":[1],"subinfo":[1025],"disabled":[516],"selected":[516],"focused":[4]},[[0,"keydown","handleKeydown"],[0,"click","handleSelection"],[0,"blur","handleBlur"]]],[1,"wm-select",{"disabled":[516],"invalid":[1028],"maxHeight":[1,"max-height"],"label":[1025],"labelPosition":[1,"label-position"],"requiredField":[4,"required-field"],"errorMessage":[1025,"error-message"],"multiple":[4],"placeholder":[1],"allSelectedMessage":[1,"all-selected-message"],"isTabbing":[32],"isExpanded":[32]},[[8,"wmUserIsTabbing","toggleTabbingOn"],[8,"wmUserIsNotTabbing","toggleTabbingOff"],[0,"wmOptionSelected","handleOptionSelection"],[0,"wmEnterKeyPressed","handleChildEnter"],[0,"wmKeyUpPressed","handleChildUp"],[0,"wmKeyDownPressed","handleChildDown"],[0,"wmHomeKeyPressed","moveToFirstItem"],[0,"wmEndKeyPressed","moveToLastItem"],[0,"wmTabKeyPressed","handleTabKey"],[0,"wmEscKeyPressed","closePopupOnEscape"],[0,"wmOptionBlurred","handleOptionBlur"],[6,"click","handleClick"],[0,"keydown","handleKey"],[0,"wmLetterPressed","findAndFocusItem"]]]]],["p-5585f23e",[[1,"wm-button",{"disabled":[516],"buttonType":[1025,"button-type"],"buttonStyle":[1025,"button-style"],"icon":[1537],"iconSize":[1,"icon-size"],"tooltip":[1537],"labelForIdenticalButtons":[1,"label-for-identical-buttons"],"tooltipPosition":[1,"tooltip-position"],"permanentlyDelete":[4,"permanently-delete"],"textWrap":[4,"text-wrap"],"customBackground":[1,"custom-background"],"tooltipVisible":[1028,"tooltip-visible"],"adjustedTooltipPosition":[32],"isTabbing":[32]},[[8,"wmUserIsTabbing","toggleTabbingOn"],[8,"wmUserIsNotTabbing","toggleTabbingOff"],[9,"scroll","handleScroll"],[0,"keydown","handleKeydown"]]]]]]'),e)));
1
+ import{p as e,b as t}from"./p-9baa3039.js";import"./p-421bf744.js";(()=>{const t=import.meta.url,a={};return""!==t&&(a.resourcesUrl=new URL(".",t).href),e(a)})().then((e=>t(JSON.parse('[["p-7d9c18b9",[[1,"wm-tab-list",{"customBackground":[1,"custom-background"],"customPadding":[1,"custom-padding"],"selectedTab":[1,"selected-tab"],"controllerEnabled":[4,"controller-enabled"]},[[0,"tabItemLoaded","tabItemLoaded"],[0,"wmTabSelected","handleTabSelected"],[0,"keydownOnTabItem","handleKeydown"],[9,"resize","setLayout"]]],[1,"wm-tab-item",{"selected":[4],"show":[4],"tabId":[1,"tab-id"]},[[4,"keydown","toggleTabbingOn"],[4,"click","toggleTabbingOff"]]],[0,"wm-tab-panel",{"active":[1028],"tabId":[1025,"tab-id"]},[[4,"keydown","toggleTabbingOn"],[4,"click","toggleTabbingOff"]]]]],["p-f3569e91",[[1,"wm-navigator",{"userName":[1,"user-name"],"email":[1],"authType":[2,"auth-type"],"connectionName":[1,"connection-name"],"logoutUrl":[1,"logout-url"],"products":[1],"loadFromUserinfo":[4,"load-from-userinfo"],"isOpen":[32],"isTabbing":[32],"itemIndexToFocus":[32]},[[8,"wmUserIsTabbing","toggleTabbingOn"],[8,"wmUserIsNotTabbing","toggleTabbingOff"],[0,"keydown","handleKeys"],[0,"keydownOnNavItem","handleKeydown"],[4,"click","handleClick"],[0,"buttonActivated","handleButtonClick"]]]]],["p-da1435f1",[[1,"wm-network-uploader",{"getPath":[1,"get-path"],"requestUploadPath":[1,"request-upload-path"],"uploadPath":[1,"upload-path"],"requestDownloadPath":[1,"request-download-path"],"deletePath":[1,"delete-path"],"associatedData":[1,"associated-data"],"buttonText":[1,"button-text"],"emptyStateText":[1,"empty-state-text"],"icon":[1],"fileTypes":[1,"file-types"],"maxSize":[2,"max-size"],"maxFiles":[2,"max-files"],"sortBy":[1,"sort-by"],"isTabbing":[32],"fileList":[32],"inProgressList":[32],"errorList":[32],"notif":[32],"snackbar":[32],"numFilesInProgress":[32]},[[8,"wmUserIsTabbing","toggleTabbingOn"],[8,"wmUserIsNotTabbing","toggleTabbingOff"],[0,"wmUploadProgress","handleUploadProgress"],[0,"userFinishedSnack","handleFinishedSnack"]]]]],["p-8a4bac13",[[1,"wm-action-menu",{"tooltipPosition":[1,"tooltip-position"],"actionMenuType":[1,"action-menu-type"],"buttonType":[1,"button-type"],"buttonText":[1,"button-text"],"disabled":[516],"tooltip":[1],"labelForIdenticalButtons":[1,"label-for-identical-buttons"],"isExpanded":[32]},[[0,"wmMenuitemClicked","handleClickedItem"],[0,"wmKeyUpPressed","handleKeyUp"],[0,"wmKeyDownPressed","handleKeyDown"],[0,"wmHomeKeyPressed","handleHomeKey"],[0,"wmEndKeyPressed","handleEndKey"],[0,"wmTabKeyPressed","handleTabKey"],[0,"wmEscKeyPressed","handleEscKey"],[4,"click","handleClick"],[0,"keydown","handleKey"],[0,"wmMenuitemBlurred","handleMenuitemBlur"],[0,"wmLetterPressed","findAndFocusItem"]]],[1,"wm-menuitem",{"disabled":[4],"focused":[4],"icon":[1025],"description":[1],"isKeying":[32]},[[8,"wmUserIsKeying","toggleKeyingOn"],[8,"wmUserIsTabbing","toggleKeyingOn"],[8,"wmUserIsNotKeying","toggleKeyingOff"],[8,"wmUserIsNotTabbing","toggleKeyingOff"],[0,"keydown","handleKeydown"],[0,"click","handleClick"],[0,"blur","handleBlur"]]]]],["p-74438aab",[[1,"wm-chart",{"chartType":[1,"chart-type"],"label":[1],"subinfo":[1],"completionMessage":[1,"completion-message"],"valueFormat":[1,"value-format"],"showValues":[1,"show-values"],"showLegend":[4,"show-legend"],"notStartedColor":[4,"not-started-color"],"labelPosition":[1,"label-position"],"isTabbing":[32]},[[8,"wmUserIsTabbing","toggleTabbingOn"],[8,"wmUserIsNotTabbing","toggleTabbingOff"],[0,"keydown","handleKeydown"],[9,"resize","handleResize"],[0,"wmChartSliceUpdated","handleSliceUpdate"]]]]],["p-e3765b8e",[[1,"wm-datepicker",{"value":[1025],"disabled":[4],"dateFormat":[1025,"date-format"],"errorMessage":[513,"error-message"],"labelPosition":[1025,"label-position"],"label":[1025],"requiredField":[4,"required-field"],"preventValidation":[1,"prevent-validation"],"displayError":[32]},[[0,"keydown","handleTabbingOn"],[0,"click","handleTabbingOff"],[0,"popupClosed","handlePopupClosed"],[0,"cellTriggered","handleCellTriggered"]]]]],["p-bc9ca97b",[[0,"wm-modal-footer",{"secondaryText":[1,"secondary-text"],"primaryText":[1,"primary-text"],"infoText":[1,"info-text"],"primaryActionDisabled":[4,"primary-action-disabled"],"deleteStyle":[4,"delete-style"]},[[4,"focusLastElement","focusLastEl"]]]]],["p-111f705a",[[0,"wm-modal-header",{"heading":[1],"subheading":[1]},[[4,"focusFirstElement","focusFirstEl"]]]]],["p-0c488d9d",[[1,"wm-search",{"searchType":[1025,"search-type"],"disabled":[516],"placeholder":[1],"label":[1],"numResults":[1026,"num-results"],"value":[1537],"highlightedId":[1,"highlighted-id"],"highlightedName":[1,"highlighted-name"],"isTabbing":[32],"highlightedNum":[32],"previousBlurredValue":[32],"parentModal":[32],"updateValue":[64]},[[8,"wmUserIsTabbing","toggleTabbingOn"],[8,"wmUserIsNotTabbing","toggleTabbingOff"]]]]],["p-4414cb64",[[1,"wm-uploader",{"uploaderType":[1025,"uploader-type"],"type":[1],"buttonText":[1,"button-text"],"info":[1],"emptyStateText":[1,"empty-state-text"],"icon":[1],"fileTypes":[1,"file-types"],"maxSize":[2,"max-size"],"maxFiles":[2,"max-files"],"sortBy":[1,"sort-by"],"files":[1],"filesToUpload":[16],"rejectedFiles":[1,"rejected-files"],"isTabbing":[32],"errorList":[32],"notif":[32],"numFilesInProgress":[32]},[[8,"wmUserIsTabbing","toggleTabbingOn"],[8,"wmUserIsNotTabbing","toggleTabbingOff"],[0,"wmUploadProgress","handleUploadProgress"]]]]],["p-8b0eb05e",[[0,"wm-chart-slice",{"legend":[1],"amount":[1]}]]],["p-787469ab",[[1,"wm-input",{"label":[1],"labelPosition":[1,"label-position"],"value":[1537],"disabled":[516],"info":[1],"placeholder":[1],"requiredField":[4,"required-field"],"errorMessage":[1,"error-message"],"characterLimit":[2,"character-limit"],"preventValidation":[1,"prevent-validation"],"type":[1],"step":[2],"min":[2],"max":[2],"announcement":[32],"displayedErrorMessage":[32]}]]],["p-ad73d523",[[0,"wm-modal",{"open":[1540],"isOpen":[1540,"is-open"],"elementToFocus":[1025,"element-to-focus"],"modalType":[513,"modal-type"],"isTypeDialog":[516,"is-type-dialog"],"uid":[1537],"emitCloseEvent":[64],"emitPrimaryEvent":[64],"emitSecondaryEvent":[64]},[[0,"click","handleClick"],[0,"keydown","closeModalOnEscape"]]]]],["p-cd466a5b",[[1,"wm-pagination",{"currentPage":[2,"current-page"],"totalItems":[2,"total-items"],"itemsPerPage":[2,"items-per-page"],"value":[2],"isLargeViewport":[4,"is-large-viewport"],"isTabbing":[32],"srAnnouncement":[32]},[[8,"wmUserIsTabbing","toggleTabbingOn"],[8,"wmUserIsNotTabbing","toggleTabbingOff"],[9,"resize","handleResize"]]]]],["p-bd05632b",[[1,"wm-tag-input",{"label":[1],"labelPosition":[1,"label-position"],"options":[1025],"selectedTags":[1537,"selected-tags"],"info":[1],"addNew":[4,"add-new"],"placeholder":[1025],"characterLimit":[2,"character-limit"],"maxTags":[2,"max-tags"],"focusedListItem":[32],"focusedTag":[32],"isExpanded":[32],"tagsList":[32],"optionsList":[32],"charCount":[32],"liveRegionMessage":[32]},[[4,"click","closeIfNotElOrChild"],[9,"resize","handleResize"]]]]],["p-2caeca6b",[[1,"wm-timepicker",{"disabled":[4],"value":[1537],"errorMessage":[1,"error-message"],"label":[1],"labelPosition":[1,"label-position"],"requiredField":[4,"required-field"],"preventValidation":[1,"prevent-validation"],"selectedOption":[32],"isExpanded":[32],"isTabbing":[32],"displayedErrorMessage":[32]},[[8,"wmUserIsTabbing","toggleTabbingOn"],[8,"wmUserIsNotTabbing","toggleTabbingOff"],[0,"keydown","handleKey"]]]]],["p-30f13477",[[1,"wm-toggletip",{"label":[1],"tooltip":[1025],"tooltipText":[1,"tooltip-text"],"tooltipPosition":[1537,"tooltip-position"],"isOpen":[32],"isTabbing":[32]},[[0,"keydown","handleKeydown"],[8,"wmUserIsTabbing","toggleTabbingOn"],[8,"wmUserIsNotTabbing","toggleTabbingOff"],[4,"click","handleClick"]]]]],["p-0c58f50d",[[0,"wm-wrapper"]]],["p-b9656d44",[[0,"priv-chart-popover",{"sliceRef":[16],"popoverTitle":[1,"popover-title"],"popoverText":[1,"popover-text"],"buttonText":[1,"button-text"],"open":[1028],"coords":[16]},[[4,"click","handleClickOnDocument"],[0,"click","handleClick"]]]]],["p-c0b0510a",[[0,"priv-datepicker",{"disabled":[4],"isExpanded":[1540,"is-expanded"],"view":[1537],"date":[1040],"selectedYear":[1026,"selected-year"],"selectedMonth":[1026,"selected-month"],"selectedDay":[1026,"selected-day"],"monthInFocus":[1026,"month-in-focus"],"yearInFocus":[1026,"year-in-focus"],"dayInFocus":[1026,"day-in-focus"],"parentId":[1537,"parent-id"],"monthNumInFocus":[32]},[[0,"keydown","handleKey"],[0,"keydown","toggleTabbingOn"],[9,"mousedown","toggleTabbingOff"],[4,"click","blurHandler"],[8,"blur","handleBlurOnWindow"]]]]],["p-11c09317",[[1,"priv-navigator-button",{"expanded":[1028],"altText":[1,"alt-text"],"isTabbing":[1028,"is-tabbing"]}]]],["p-99db8501",[[1,"priv-navigator-item",{"selected":[1028],"focused":[1028],"link":[1025]},[[0,"keydown","handleKeyDown"]]]]],["p-938a5ba4",[[1,"wm-snackbar",{"notifications":[1537]},[[4,"keydown","checkForTabbing"],[5,"mouseover","handleMouse"]]]]],["p-266e4bc2",[[1,"wm-option",{"value":[1],"subinfo":[1025],"disabled":[516],"selected":[516],"focused":[4]},[[0,"keydown","handleKeydown"],[0,"click","handleSelection"],[0,"blur","handleBlur"]]],[1,"wm-select",{"disabled":[516],"invalid":[1028],"maxHeight":[1,"max-height"],"label":[1025],"labelPosition":[1,"label-position"],"requiredField":[4,"required-field"],"errorMessage":[1025,"error-message"],"multiple":[4],"placeholder":[1],"allSelectedMessage":[1,"all-selected-message"],"isTabbing":[32],"isExpanded":[32]},[[8,"wmUserIsTabbing","toggleTabbingOn"],[8,"wmUserIsNotTabbing","toggleTabbingOff"],[0,"wmOptionSelected","handleOptionSelection"],[0,"wmEnterKeyPressed","handleChildEnter"],[0,"wmKeyUpPressed","handleChildUp"],[0,"wmKeyDownPressed","handleChildDown"],[0,"wmHomeKeyPressed","moveToFirstItem"],[0,"wmEndKeyPressed","moveToLastItem"],[0,"wmTabKeyPressed","handleTabKey"],[0,"wmEscKeyPressed","closePopupOnEscape"],[0,"wmOptionBlurred","handleOptionBlur"],[6,"click","handleClick"],[0,"keydown","handleKey"],[0,"wmLetterPressed","findAndFocusItem"]]]]],["p-5585f23e",[[1,"wm-button",{"disabled":[516],"buttonType":[1025,"button-type"],"buttonStyle":[1025,"button-style"],"icon":[1537],"iconSize":[1,"icon-size"],"tooltip":[1537],"labelForIdenticalButtons":[1,"label-for-identical-buttons"],"tooltipPosition":[1,"tooltip-position"],"permanentlyDelete":[4,"permanently-delete"],"textWrap":[4,"text-wrap"],"customBackground":[1,"custom-background"],"tooltipVisible":[1028,"tooltip-visible"],"adjustedTooltipPosition":[32],"isTabbing":[32]},[[8,"wmUserIsTabbing","toggleTabbingOn"],[8,"wmUserIsNotTabbing","toggleTabbingOff"],[9,"scroll","handleScroll"],[0,"keydown","handleKeydown"]]]]]]'),e)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@watermarkinsights/ripple",
3
- "version": "3.7.0-1",
3
+ "version": "3.7.0-2",
4
4
  "description": "Ripple Component Library",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",
@@ -1 +0,0 @@
1
- import{r as e,f as t,h as r,H as n,g as a}from"./p-9baa3039.js";import{g as i,d as o,b as s,f as p,i as h,c as l}from"./p-b5edcf38.js";const c=class{constructor(r){e(this,r),this.chartType="doughnut1",this.showLegend=!0,this.notStartedColor=!1,this.labelPosition="top",this.isTabbing=!1,this.uid=i(),this.slicesData=[],this.colors={salmon:"#ff5f4e",cyan:"#19a1a9",forest:"#088000",sleet:"#7f97ad",midnight:"#2e1b46",lavender:"#8b86ca"},this.types={doughnut0:{size:155,colors:[this.colors.forest,"#bfbfbf"],thickness:.73,padding:25,isBar:!1},doughnut1:{size:130,colors:[this.colors.lavender,this.colors.midnight,"#d4d4d4"],thickness:.5,padding:90,isBar:!1},doughnut2:{size:130,colors:[this.colors.cyan,this.colors.salmon,"#d4d4d4"],thickness:.5,padding:90,isBar:!1},doughnut3:{size:130,colors:[this.colors.lavender,this.colors.midnight,"#919834","#c177cf","#c16e00","#029af2","#2a6993"],thickness:.5,padding:90,isBar:!1},bar1:{size:350,colors:[this.colors.forest,"#bfbfbf"],padding:0,isBar:!0},bar2:{size:400,colors:["#d4d4d4",this.colors.sleet,this.colors.cyan,this.colors.salmon],padding:0,isBar:!0},bar3:{size:300,colors:["#0d696e",this.colors.cyan,"#8e4129",this.colors.salmon],padding:0,isBar:!0},bar4:{size:400,colors:["#d4d4d4",this.colors.sleet,"#33a919"],padding:0,isBar:!0},bar5:{size:400,colors:["#d4d4d4",this.colors.lavender,this.colors.midnight,"#919834","#c177cf","#c16e00","#029af2","#2a6993"],padding:0,isBar:!0}},this.debouncedResize=o((async()=>{this.setHybridType(),await this.getData(),t(this.el)}),10),this.debouncedSliceUpdate=o((async()=>{await this.getData(),t(this.el)}),100)}get tempValueFormat(){return this.valueFormat||this.showValues||"none"}get sliceEls(){const e=this.currentChartType.includes("bar"),t=this.currentChartType.includes("doughnut");return e?Array.from(this.barEl.querySelectorAll(".bar-segment")):t?Array.from(this.doughnutEl.querySelectorAll(".doughnut-segment")):void 0}get currentChartType(){return"hybrid"===this.chartType?this.hybridType:this.chartType}toggleTabbingOn(){this.isTabbing=!0}toggleTabbingOff(){this.isTabbing=!1}handleKeydown(e){switch(e.keyCode){case 37:case 38:e.preventDefault(),this.isTabbing=!0,this.focusPrevious();break;case 39:case 40:e.preventDefault(),this.isTabbing=!0,this.focusNext();break;case 9:this.exitChart();break;case 27:this.popoverEl.open=!1}}handleSliceClick(e,t){this.popoverEl&&!this.isTabbing&&(t.coords={x:e.clientX,y:e.clientY},this.openPopover(t))}handleSliceFocus(e,t){this.popoverEl&&this.isTabbing&&(t.coords=s(e.target),this.openPopover(t))}handleSliceKeyDown(e){if(this.popoverEl&&this.popoverEl.open&&"Enter"===e.key){const e=this.popoverEl.querySelector("button");e&&e.click()}}focusNext(){const e=l(document.activeElement),t=(this.sliceEls.indexOf(e)+1)%this.sliceEls.length;this.focusSlice(t)}focusPrevious(){if(this.sliceEls){const e=l(document.activeElement);let t=this.sliceEls.indexOf(e);-1===t?t=0:0===t?t=this.sliceEls.length-1:t-=1,this.focusSlice(t)}}focusSlice(e){this.sliceEls&&this.el&&(this.popoverEl&&(this.popoverEl.open=!1),this.el.tabIndex=-1,this.el.focusable=!1,this.sliceEls.map((e=>{e.tabIndex=-1,e.focusable=!1})),this.sliceEls[e].tabIndex=0,this.sliceEls[e].focusable=!0,this.sliceEls[e].focus(),window.setTimeout((()=>{this.popoverEl&&(this.popoverEl.open=!0)}),10))}exitChart(){this.sliceEls&&this.sliceEls.map((e=>{e.tabIndex=-1,e.focusable=!1})),window.setTimeout((()=>{this.el&&(this.el.tabIndex=0,this.el.focusable=!0,this.popoverEl&&(this.popoverEl.open=!1))}),100)}openPopover(e){if(this.popoverEl&&e.title&&e.text){this.popoverEl.popoverTitle=e.title,this.popoverEl.popoverText=e.text,this.popoverEl.buttonText=e.buttonText,this.popoverEl.coords=e.coords,this.popoverEl.sliceRef=e.sliceRef,window.setTimeout((()=>{this.popoverEl&&(this.popoverEl.open=!0)}),30);const t=o((async()=>{this.popoverEl.open=!1}),10);document.addEventListener("scroll",(()=>{t()}));const r=p(this.el);r&&r.addEventListener("scroll",(()=>{t()}))}}amountToPercent(e,t){return t?Math.round(100*e/this.total):Math.round(1e4*e/this.total)/100}amountToDegree(e){return 360*e/this.total}toFixed(e){return parseFloat((Math.floor(100*e)/100).toFixed(2))}polarToCartesian(e,t,r,n){var a=this.toFixed(e+e*t*Math.cos(Math.PI*r/180)),i=this.toFixed(e+e*t*Math.sin(Math.PI*r/180));return void 0!==n?{x1:a,y1:i,x2:this.toFixed(e+e*t*Math.cos(Math.PI*n/180)),y2:this.toFixed(e+e*t*Math.sin(Math.PI*n/180))}:{x:a,y:i}}getPathData(e,t){var r=this.amountToDegree(t)-90,n=e/this.total*360,a=r+n,i=n>180?"1 1":"0 1",o=n>180?"1 0":"0 0",s=this.chartData.size/2,p=this.chartData.thickness;360===n&&(a-=.01);var h=this.polarToCartesian(s,1,r+1.5,a),l=this.polarToCartesian(s,p,r+3,a);return`M ${h.x1}, ${h.y1} `+this.getArc(1,i,h.x2,h.y2)+` L ${l.x2}, ${l.y2} `+this.getArc(p,o,l.x1,l.y1)+" z"}getArc(e,t,r,n){var a=this.toFixed(this.chartData.size/2*e);return`A ${a}, ${a} 0 ${t} ${this.toFixed(r)}, ${this.toFixed(n)}`}setHybridType(){this.hybridType=window.innerWidth>1340?"doughnut0":"bar1"}async getData(){this.slicesData=[];let e=0;const t=this.el.querySelectorAll("wm-chart-slice");this.total=Array.from(t).reduce(((e,t)=>e+parseInt(t.getAttribute("amount")||"0")),0),t.forEach(((r,n)=>{const a=parseInt(r.getAttribute("amount")||"0"),i=this.amountToPercent(a,!0),o=this.amountToPercent(parseInt(t[0===n?t.length-1:n-1].getAttribute("amount")||"0"),!0),s=this.amountToPercent(parseInt(t[n===t.length-1?0:n+1].getAttribute("amount")||"0"),!0);let p=i<4&&(o<5||s<5);0===i&&a>0&&(s<8||o<8)&&(p=!0);const h=this.types[this.currentChartType].colors["bar5"===this.currentChartType?this.notStartedColor?n:n+1:n],l={amount:a,perc:i,legend:r.getAttribute("legend"),color:h||"#d4d4d4",offset:e,id:`${this.uid}-${n+1}`,title:r.getAttribute("popover-title"),text:r.getAttribute("popover-text"),buttonText:r.getAttribute("popover-button-text"),sliceRef:r,inSmallCluster:p};e+=a,this.slicesData.push(l)})),this.chartData=this.types[this.currentChartType]}handleResize(){"hybrid"===this.chartType&&this.debouncedResize()}async componentWillLoad(){if(!this.label)throw new Error("For accessibility purposes, you must provide a label for the chart. See https://components.watermarkinsights.com/chart for more information.");this.showValues&&console.warn("wm-chart: show-values has been deprecated as of v3.1.0. Please use value-format instead."),"hybrid"===this.chartType&&this.setHybridType(),await this.getData()}handleSliceUpdate(){this.debouncedSliceUpdate()}renderFilter(){return r("defs",null,r("filter",{id:"wmHoverDropShadow"},r("feGaussianBlur",{stdDeviation:"3"}),r("feOffset",{result:"offsetblur"}),r("feFlood",{"flood-color":"#333"}),r("feComposite",{operator:"in",in2:"offsetblur"}),r("feMerge",null,r("feMergeNode",null),r("feMergeNode",{in:"SourceGraphic"}))))}renderDoughnut(){const e=this.chartData.size+this.chartData.padding;return r("div",{class:"chart-wrapper doughnut-wrapper"},r("svg",{width:e+"px",height:e+"px",ref:e=>this.doughnutEl=e,id:`graphic-${this.uid}`,class:"doughnut-svg"},this.renderFilter(),this.slicesData.map((e=>this.renderPath(e))),"doughnut0"===this.currentChartType?r("text",{class:"value",x:"50%",y:"50%","font-size":"1.5rem","font-weight":"500","text-anchor":"middle","dominant-baseline":"middle"},this.amountToPercent(this.slicesData[0].amount,!0)+"%"):r("g",{transform:`translate(${this.chartData.padding/2}, ${this.chartData.padding/2})`,"text-anchor":"middle","dominant-baseline":"middle"},this.slicesData.map((e=>e.amount>0?this.renderDoughnutText(e):"")))))}renderPath(e){return r("g",{transform:`translate(${this.chartData.padding/2}, ${this.chartData.padding/2})`},r("path",{id:e.id,class:"doughnut-segment",fill:e.amount?e.color:"transparent",d:this.getPathData(e.amount,e.offset),onClick:t=>this.handleSliceClick(t,e),onFocus:t=>this.handleSliceFocus(t,e),onKeyDown:e=>this.handleSliceKeyDown(e)}),r("text",{class:"sr-only"},e.legend))}renderDoughnutText(e){if(!e.inSmallCluster){const t=this.amountToDegree(e.offset+e.amount/2);let{x:n,y:a}=this.polarToCartesian(this.chartData.size/2,1.4,t-90);return r("text",{class:"value",x:n+"px",y:a+"px"},`${e.perc>0?e.perc:"<1"}%`)}}renderBar(){return r("div",{class:"chart-wrapper bar-wrapper"},"bar1"===this.currentChartType?r("div",{class:"single-perc"},this.amountToPercent(this.slicesData[0].amount,!0)+"%"):"",this.drawAxis(),r("div",{class:{"inner-bar-wrapper":!0,"show-values":"percentage"===this.tempValueFormat||"amount"===this.tempValueFormat}},"bar1"!==this.currentChartType?r("div",null,this.slicesData.map(((e,t)=>e.perc>0?this.renderBarText(e,t):""))):"",r("div",{class:"bar-segments-wrapper",ref:e=>this.barEl=e},this.slicesData.map(((e,t)=>this.renderBarSegment(e,t)))),this.renderCompletionMessage()))}renderBarSegment(e,t){const n=t!==this.slicesData.length-1,a=`calc(${this.amountToPercent(e.amount,!1)}%${n?" - 2px":""})`;return r("div",{class:"bar-segment "+(0===this.amountToPercent(e.amount,!1)?"zero":""),style:{backgroundColor:e.color,width:a},onClick:t=>this.handleSliceClick(t,e),onFocus:t=>this.handleSliceFocus(t,e),onKeyDown:e=>this.handleSliceKeyDown(e)},r("text",{class:"sr-only"},e.legend))}renderBarText(e,t){let n;if("percentage"===this.tempValueFormat)n=e.perc+"%";else{if("amount"!==this.tempValueFormat)return;n=e.amount}return r("span",{class:"value",style:{width:`calc(${this.amountToPercent(e.amount,!1)}%\n ${t!==this.slicesData.length-1?" - 2px":""}`}},n)}drawAxis(){if("bar3"===this.currentChartType)return r("svg",{class:"axis"},r("line",{x1:"0",x2:"100%",y1:"0",y2:"0"}),r("line",{x1:"0",x2:"0",y1:"0",y2:"-85px"}),r("line",{class:"tick",x1:"0.5",x2:"0.5",y1:"0",y2:"6"}),r("text",{x:"0.5",y:"-6"},"0%"),r("line",{class:"tick",x1:"100%",x2:"100%",y1:"0",y2:"6"}),r("text",{x:"100%",y:"-6"},"100%"))}renderCompletionMessage(){if("hybrid"===this.chartType&&this.completionMessage)return r("div",{class:"completion-message"},this.completionMessage)}renderLegend(){if(this.showLegend){const e=this.slicesData.reduce(((e,t)=>!!t.inSmallCluster||e),!1);return r("div",{class:"legend-wrapper"},r("div",{class:"legend "+(this.chartData.isBar?"--top":"--bottom"),"aria-hidden":"true"},this.total>0?this.slicesData.map((e=>{if(e.amount||e.legend)return r("div",{class:"legend-item"},r("div",{class:"legend-color",style:{"background-color":e.color}}),r("div",{class:"legend-text"},e.legend))})):""),!this.chartData.isBar&&e?r("div",{class:"cluster-warning"},h.formatMessage({id:"chart.hiddenPercentages",defaultMessage:"Percentages smaller than 5% are not shown when too close to each other."}),r("br",null),h.formatMessage({id:"chart.clickToSeeDetails",defaultMessage:"Click or use arrow keys to see details."})):"")}}render(){return r(n,{role:"application","aria-label":this.label+", "+h.formatMessage({id:"chart.interactiveChart",defaultMessage:"Interactive chart. Use arrow keys to browse elements, press Tab to exit."}),tabindex:"0"},r("div",{class:`component-wrapper ${this.currentChartType} ${this.isTabbing?"user-is-tabbing":""} ${"left"===this.labelPosition&&"bar4"===this.chartType?"left-label":""}`},r("label",{class:"label",id:`label-${this.uid}`,htmlFor:`graphic-${this.uid}`},r("span",{class:"label-text"},this.label),this.subinfo?r("span",{class:"subinfo"},this.subinfo):""),this.chartData.isBar?this.renderLegend():"",this.total>0&&this.chartData.isBar?this.renderBar():this.renderDoughnut(),this.chartData.isBar?"":this.renderLegend(),r("priv-chart-popover",{class:this.isTabbing?"user-is-tabbing":"",ref:e=>this.popoverEl=e}),"doughnut0"===this.hybridType?this.renderCompletionMessage():""))}get el(){return a(this)}};c.style=".component-wrapper{display:flex;flex-direction:column;align-items:center;font-size:0.875rem;position:relative;}.component-wrapper .label{display:block;margin:0;padding-bottom:0.25rem;font-weight:500;position:relative}.component-wrapper .label .subinfo{display:block;font-weight:normal;font-style:italic;bottom:0.25rem;width:100%;color:#6b6b6b}.component-wrapper .legend-wrapper{display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center}.component-wrapper .legend-wrapper .legend{display:flex;align-items:center;flex-wrap:wrap;text-align:center;padding-top:0.25rem;padding-bottom:0.75rem;box-sizing:border-box}.component-wrapper .legend-wrapper .legend.--top{margin-top:-0.75rem}.component-wrapper .legend-wrapper .legend.--top .legend-item{padding-top:0.75rem}.component-wrapper .legend-wrapper .legend.--top .legend-color{top:0.75rem}.component-wrapper .legend-wrapper .legend.--bottom{margin-bottom:-0.75rem}.component-wrapper .legend-wrapper .legend.--bottom .legend-item{padding-bottom:0.75rem}.component-wrapper .legend-wrapper .legend.--bottom .legend-color{top:-0.75rem}.component-wrapper .legend-wrapper .legend .legend-item{position:relative}.component-wrapper .legend-wrapper .legend .legend-item:not(:last-of-type){padding-right:1.25rem}.component-wrapper .legend-wrapper .legend .legend-text{padding-left:1rem;line-height:1}.component-wrapper .legend-wrapper .legend .legend-color{position:absolute;left:0;bottom:0;margin:auto;width:0.6875rem;height:0.6875rem}.component-wrapper .legend-wrapper .cluster-warning{font-size:0.75rem;font-style:italic;max-width:100%}.component-wrapper .doughnut-svg,.component-wrapper .inner-bar-wrapper{overflow:visible}.component-wrapper .bar-wrapper{flex-grow:1;width:100%}.component-wrapper .bar-wrapper .inner-bar-wrapper{width:100%}.component-wrapper .bar-wrapper .inner-bar-wrapper .bar-segments-wrapper{display:flex}.component-wrapper .bar-wrapper .inner-bar-wrapper .bar-segments-wrapper .bar-segment{height:30px;cursor:pointer}.component-wrapper .bar-wrapper .inner-bar-wrapper .bar-segments-wrapper .bar-segment:not(.zero):not(:last-of-type){margin-right:2px}.component-wrapper .doughnut-wrapper{-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;border-radius:4px}.component-wrapper .doughnut-wrapper .doughnut-segment{cursor:pointer}.component-wrapper .value{display:inline-block;text-align:center}.component-wrapper .value:not(:last-of-type){margin-right:2px}.component-wrapper path:active,.component-wrapper path:hover,.component-wrapper path:focus,.component-wrapper .bar-segment:active,.component-wrapper .bar-segment:hover,.component-wrapper .bar-segment:focus{outline:none}.component-wrapper path:active.bar-segment,.component-wrapper path:hover.bar-segment,.component-wrapper path:focus.bar-segment,.component-wrapper .bar-segment:active.bar-segment,.component-wrapper .bar-segment:hover.bar-segment,.component-wrapper .bar-segment:focus.bar-segment{-webkit-box-shadow:0px 0px 6px #333;-moz-box-shadow:0px 0px 6px #333;box-shadow:0px 0px 6px #333}.component-wrapper path:active.doughnut-segment,.component-wrapper path:hover.doughnut-segment,.component-wrapper path:focus.doughnut-segment,.component-wrapper .bar-segment:active.doughnut-segment,.component-wrapper .bar-segment:hover.doughnut-segment,.component-wrapper .bar-segment:focus.doughnut-segment{filter:url(#wmHoverDropShadow)}.component-wrapper path::-moz-focus-inner,.component-wrapper .bar-segment::-moz-focus-inner{border:0;outline:none}.component-wrapper.doughnut1 label,.component-wrapper.doughnut1 .label-text,.component-wrapper.doughnut2 label,.component-wrapper.doughnut2 .label-text,.component-wrapper.doughnut3 label,.component-wrapper.doughnut3 .label-text{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}.component-wrapper.doughnut0{align-items:center}.component-wrapper.doughnut0 label{text-align:center;width:100%;padding-bottom:1.5rem}.component-wrapper.doughnut0 label .subinfo{position:absolute}.component-wrapper.doughnut0 .legend{display:flex}.component-wrapper.doughnut0 .completion-message{padding-top:0.625rem}.component-wrapper.bar1{padding:1.25rem;align-items:flex-start}.component-wrapper.bar1 label{display:flex;flex-direction:column}.component-wrapper.bar1 label .subinfo{position:initial}.component-wrapper.bar1 .legend{display:none}.component-wrapper.bar1 .chart-wrapper{display:flex}.component-wrapper.bar1 .chart-wrapper .single-perc{width:4rem;flex:none;display:flex;height:30px;align-items:center}.component-wrapper.bar1 .chart-wrapper .inner-bar-wrapper{flex:1}.component-wrapper.bar1 .chart-wrapper .completion-message{width:100%;text-align:right;margin-top:0.25rem}@media screen and (min-width: 768px){.component-wrapper.bar1{flex-direction:row}.component-wrapper.bar1 label{display:flex;justify-content:center;min-height:30px;width:12rem;text-align:left;padding-right:1.25rem;padding-bottom:0;flex:none}.component-wrapper.bar1 .bar-wrapper{flex-direction:row-reverse}.component-wrapper.bar1 .bar-wrapper .single-perc{text-align:center;padding-left:0.5rem;justify-content:center}}.component-wrapper.bar2,.component-wrapper.bar3,.component-wrapper.bar4,.component-wrapper.bar5{align-items:flex-start}.component-wrapper.bar2 .inner-bar-wrapper,.component-wrapper.bar4 .inner-bar-wrapper,.component-wrapper.bar5 .inner-bar-wrapper{height:30px;margin-bottom:0}.component-wrapper.bar2 .inner-bar-wrapper.show-values,.component-wrapper.bar4 .inner-bar-wrapper.show-values,.component-wrapper.bar5 .inner-bar-wrapper.show-values{height:60px;margin-top:0}.component-wrapper.bar3 .legend{padding-bottom:1.25rem}.component-wrapper.bar3 .chart-wrapper{position:relative;height:100px}.component-wrapper.bar3 .chart-wrapper .inner-bar-wrapper{position:absolute;top:35px;left:0;right:0;bottom:0;height:30px}.component-wrapper.bar3 .chart-wrapper .inner-bar-wrapper text{fill:#4a4a4a}.component-wrapper.bar3 .chart-wrapper .axis{position:absolute;top:0;left:0;height:90px;width:100%;overflow:visible;transform:translateY(90px)}.component-wrapper.bar3 .chart-wrapper .axis line{stroke:#eeedf4;stroke-width:1px}.component-wrapper.bar3 .chart-wrapper .axis text{transform:translate(4px, 24px);text-anchor:middle}.component-wrapper.left-label{flex-direction:row}.component-wrapper.left-label .label{width:12rem;padding-right:1.25rem;flex:none;align-self:flex-end;min-height:30px;display:flex;align-items:center}:host(:focus){outline:none}:host(:focus) .component-wrapper.user-is-tabbing .bar-segments-wrapper,:host(:focus) .component-wrapper.user-is-tabbing .doughnut-wrapper{-webkit-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px #61279e;-moz-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px #61279e;box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px #61279e}:host(:focus) .component-wrapper.user-is-tabbing .bar-segments-wrapper::-moz-focus-inner,:host(:focus) .component-wrapper.user-is-tabbing .doughnut-wrapper::-moz-focus-inner{border:0}";export{c as wm_chart}