@carbon/charts-vue 1.6.1 → 1.6.3

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/charts-vue.umd.js CHANGED
@@ -20765,7 +20765,6 @@ var legend_Legend = /** @class */ (function (_super) {
20765
20765
  var truncationThreshold = tools_Tools.getProperty(truncationOptions, 'threshold');
20766
20766
  var truncationNumCharacter = tools_Tools.getProperty(truncationOptions, 'numCharacter');
20767
20767
  var addedLegendItemsText = svg.selectAll('div.legend-item p');
20768
- var self = this;
20769
20768
  // Add an ID for the checkbox to use through `aria-labelledby`
20770
20769
  addedLegendItemsText.attr('id', function (d, i) {
20771
20770
  var elementToReference = this.parentNode.querySelector('div.checkbox') ||
@@ -20792,7 +20791,7 @@ var legend_Legend = /** @class */ (function (_super) {
20792
20791
  var svg = this.getComponentContainer();
20793
20792
  var options = this.getOptions();
20794
20793
  var legendOptions = tools_Tools.getProperty(options, 'legend');
20795
- var truncationThreshold = tools_Tools.getProperty(legendOptions, 'truncation', 'threshold');
20794
+ var truncation = tools_Tools.getProperty(legendOptions, 'truncation');
20796
20795
  svg.selectAll('div.legend-item')
20797
20796
  .on('mouseover', function (event) {
20798
20797
  self.services.events.dispatchEvent(Events.Legend.ITEM_HOVER, {
@@ -20800,8 +20799,10 @@ var legend_Legend = /** @class */ (function (_super) {
20800
20799
  });
20801
20800
  var hoveredItem = src_select(this);
20802
20801
  hoveredItem.select('div.checkbox').classed('hovered', true);
20802
+ // Show tooltip if character length is greater than threshold & there is no truncation
20803
20803
  var hoveredItemData = hoveredItem.datum();
20804
- if (hoveredItemData.name.length > truncationThreshold) {
20804
+ if (hoveredItemData.name.length > truncation.threshold &&
20805
+ truncation.type !== TruncationTypes.NONE) {
20805
20806
  self.services.events.dispatchEvent(Events.Tooltip.SHOW, {
20806
20807
  event: event,
20807
20808
  hoveredElement: hoveredItem,
@@ -20810,9 +20811,14 @@ var legend_Legend = /** @class */ (function (_super) {
20810
20811
  }
20811
20812
  })
20812
20813
  .on('mousemove', function (event) {
20813
- self.services.events.dispatchEvent(Events.Tooltip.MOVE, {
20814
- event: event,
20815
- });
20814
+ // Emit tooltip move event only if tooltip is shown
20815
+ var hoveredItemData = src_select(this).datum();
20816
+ if (hoveredItemData.name.length > truncation.threshold &&
20817
+ truncation.type !== TruncationTypes.NONE) {
20818
+ self.services.events.dispatchEvent(Events.Tooltip.MOVE, {
20819
+ event: event,
20820
+ });
20821
+ }
20816
20822
  })
20817
20823
  .on('click', function () {
20818
20824
  self.services.events.dispatchEvent(Events.Legend.ITEM_CLICK, {
@@ -20825,7 +20831,12 @@ var legend_Legend = /** @class */ (function (_super) {
20825
20831
  .on('mouseout', function () {
20826
20832
  var hoveredItem = src_select(this);
20827
20833
  hoveredItem.select('div.checkbox').classed('hovered', false);
20828
- self.services.events.dispatchEvent(Events.Tooltip.HIDE);
20834
+ // Emit tooltip hide event only if tooltip is shown
20835
+ var hoveredItemData = hoveredItem.datum();
20836
+ if (hoveredItemData.name.length > truncation.threshold &&
20837
+ truncation.type !== TruncationTypes.NONE) {
20838
+ self.services.events.dispatchEvent(Events.Tooltip.HIDE);
20839
+ }
20829
20840
  self.services.events.dispatchEvent(Events.Legend.ITEM_MOUSEOUT, {
20830
20841
  hoveredElement: hoveredItem,
20831
20842
  });
@@ -20853,7 +20864,7 @@ var legend_Legend = /** @class */ (function (_super) {
20853
20864
  svg.selectAll('g.additional-item').on('mouseover', function (event) {
20854
20865
  var hoveredItem = src_select(this);
20855
20866
  var hoveredItemData = hoveredItem.datum();
20856
- if (hoveredItemData.name.length > truncationThreshold) {
20867
+ if (hoveredItemData.name.length > truncation.threshold) {
20857
20868
  self.services.events.dispatchEvent(Events.Tooltip.SHOW, {
20858
20869
  event: event,
20859
20870
  hoveredElement: hoveredItem,
@@ -24250,7 +24261,8 @@ var tooltip_Tooltip = /** @class */ (function (_super) {
24250
24261
  }
24251
24262
  try {
24252
24263
  // it's a correct ISO format Date string
24253
- if (typeof value === 'string' && (/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(value))) {
24264
+ if (typeof value === 'string' &&
24265
+ /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(value)) {
24254
24266
  return format_format(Date.parse(value), 'MMM d, yyyy');
24255
24267
  }
24256
24268
  }
@@ -35288,7 +35300,7 @@ var alluvial_Alluvial = /** @class */ (function (_super) {
35288
35300
  links.forEach(function (element) { return _this.traverse(direction, element, visited); });
35289
35301
  };
35290
35302
  Alluvial.prototype.getRightArrowIcon = function () {
35291
- return "\n\t\t<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"32\" height=\"32\" viewBox=\"0 0 32 32\">\n\t\t\t<polygon points=\"18 6 16.57 7.393 24.15 15 4 15 4 17 24.15 17 16.57 24.573 18 26 28 16 18 6\"/>\n\t\t\t<rect data-name=\"&lt;Transparent Rectangle&gt;\" style=\"fill: none;\" width=\"32\" height=\"32\"/>\n\t\t</svg>";
35303
+ return "\n\t\t<svg xmlns=\"http://www.w3.org/2000/svg\" class=\"arrow-right\" width=\"32\" height=\"32\" viewBox=\"0 0 32 32\">\n\t\t\t<polygon points=\"18 6 16.57 7.393 24.15 15 4 15 4 17 24.15 17 16.57 24.573 18 26 28 16 18 6\"/>\n\t\t\t<rect width=\"32\" height=\"32\"/>\n\t\t</svg>";
35292
35304
  };
35293
35305
  // Remove event listeners
35294
35306
  Alluvial.prototype.destroy = function () {
@@ -39763,11 +39775,18 @@ var toolbar_Toolbar = /** @class */ (function (_super) {
39763
39775
  .classed('disabled', function (d) { return d.shouldBeDisabled(); })
39764
39776
  .attr('aria-disabled', function (d) { return d.shouldBeDisabled(); })
39765
39777
  .attr('aria-label', function (d) { return d.title; })
39766
- .html(function (d) { return "\n\t\t\t<button\n\t\t\t\tclass=\"cds--overflow-menu__trigger cds--overflow-menu__trigger\"\n\t\t\t\taria-haspopup=\"true\" aria-expanded=\"false\" id=\"" + _this.services.domUtils.generateElementIDString("control-" + d.id) + "\" aria-label=\"" + d.title + "\">\n\t\t\t\t<svg focusable=\"false\" preserveAspectRatio=\"xMidYMid meet\" style=\"will-change: transform; width: " + (d.iconSVG.width !== undefined ? d.iconSVG.width : '20px') + "; height: " + (d.iconSVG.height !== undefined
39767
- ? d.iconSVG.height
39768
- : '20px') + "\" xmlns=\"http://www.w3.org/2000/svg\" class=\"cds--overflow-menu__icon cds--overflow-menu__icon\" viewBox=\"0 0 32 32\" aria-hidden=\"true\">\n\t\t\t\t\t" + d.iconSVG.content + "\n\t\t\t\t</svg>\n\t\t\t</button>"; })
39778
+ .html(function (d) { return "\n\t\t\t<button\n\t\t\t\tclass=\"cds--overflow-menu__trigger cds--overflow-menu__trigger\"\n\t\t\t\taria-haspopup=\"true\" aria-expanded=\"false\" id=\"" + _this.services.domUtils.generateElementIDString("control-" + d.id) + "\" aria-label=\"" + d.title + "\">\n\t\t\t\t<svg focusable=\"false\" preserveAspectRatio=\"xMidYMid meet\" xmlns=\"http://www.w3.org/2000/svg\" class=\"cds--overflow-menu__icon cds--overflow-menu__icon\" viewBox=\"0 0 32 32\" aria-hidden=\"true\">\n\t\t\t\t\t" + d.iconSVG.content + "\n\t\t\t\t</svg>\n\t\t\t</button>"; })
39769
39779
  .each(function (d, index) {
39770
39780
  var _this = this;
39781
+ src_select(this)
39782
+ .select('svg')
39783
+ .style('will-change', 'transform')
39784
+ .style('width', d.iconSVG.width !== undefined
39785
+ ? d.iconSVG.width
39786
+ : '20px')
39787
+ .style('height', d.iconSVG.height !== undefined
39788
+ ? d.iconSVG.height
39789
+ : '20px');
39771
39790
  src_select(this)
39772
39791
  .select('button')
39773
39792
  .on('click', function (event) {