@carbon/charts-vue 1.6.1 → 1.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.6.2](https://github.com/carbon-design-system/carbon-charts/compare/v1.6.1...v1.6.2) (2022-12-06)
7
+
8
+ **Note:** Version bump only for package @carbon/charts-vue
9
+
10
+
11
+
12
+
13
+
6
14
  ## [1.6.1](https://github.com/carbon-design-system/carbon-charts/compare/v1.6.0...v1.6.1) (2022-10-20)
7
15
 
8
16
  **Note:** Version bump only for package @carbon/charts-vue
@@ -20756,7 +20756,6 @@ var legend_Legend = /** @class */ (function (_super) {
20756
20756
  var truncationThreshold = tools_Tools.getProperty(truncationOptions, 'threshold');
20757
20757
  var truncationNumCharacter = tools_Tools.getProperty(truncationOptions, 'numCharacter');
20758
20758
  var addedLegendItemsText = svg.selectAll('div.legend-item p');
20759
- var self = this;
20760
20759
  // Add an ID for the checkbox to use through `aria-labelledby`
20761
20760
  addedLegendItemsText.attr('id', function (d, i) {
20762
20761
  var elementToReference = this.parentNode.querySelector('div.checkbox') ||
@@ -20783,7 +20782,7 @@ var legend_Legend = /** @class */ (function (_super) {
20783
20782
  var svg = this.getComponentContainer();
20784
20783
  var options = this.getOptions();
20785
20784
  var legendOptions = tools_Tools.getProperty(options, 'legend');
20786
- var truncationThreshold = tools_Tools.getProperty(legendOptions, 'truncation', 'threshold');
20785
+ var truncation = tools_Tools.getProperty(legendOptions, 'truncation');
20787
20786
  svg.selectAll('div.legend-item')
20788
20787
  .on('mouseover', function (event) {
20789
20788
  self.services.events.dispatchEvent(Events.Legend.ITEM_HOVER, {
@@ -20791,8 +20790,10 @@ var legend_Legend = /** @class */ (function (_super) {
20791
20790
  });
20792
20791
  var hoveredItem = src_select(this);
20793
20792
  hoveredItem.select('div.checkbox').classed('hovered', true);
20793
+ // Show tooltip if character length is greater than threshold & there is no truncation
20794
20794
  var hoveredItemData = hoveredItem.datum();
20795
- if (hoveredItemData.name.length > truncationThreshold) {
20795
+ if (hoveredItemData.name.length > truncation.threshold &&
20796
+ truncation.type !== TruncationTypes.NONE) {
20796
20797
  self.services.events.dispatchEvent(Events.Tooltip.SHOW, {
20797
20798
  event: event,
20798
20799
  hoveredElement: hoveredItem,
@@ -20801,9 +20802,14 @@ var legend_Legend = /** @class */ (function (_super) {
20801
20802
  }
20802
20803
  })
20803
20804
  .on('mousemove', function (event) {
20804
- self.services.events.dispatchEvent(Events.Tooltip.MOVE, {
20805
- event: event,
20806
- });
20805
+ // Emit tooltip move event only if tooltip is shown
20806
+ var hoveredItemData = src_select(this).datum();
20807
+ if (hoveredItemData.name.length > truncation.threshold &&
20808
+ truncation.type !== TruncationTypes.NONE) {
20809
+ self.services.events.dispatchEvent(Events.Tooltip.MOVE, {
20810
+ event: event,
20811
+ });
20812
+ }
20807
20813
  })
20808
20814
  .on('click', function () {
20809
20815
  self.services.events.dispatchEvent(Events.Legend.ITEM_CLICK, {
@@ -20816,7 +20822,12 @@ var legend_Legend = /** @class */ (function (_super) {
20816
20822
  .on('mouseout', function () {
20817
20823
  var hoveredItem = src_select(this);
20818
20824
  hoveredItem.select('div.checkbox').classed('hovered', false);
20819
- self.services.events.dispatchEvent(Events.Tooltip.HIDE);
20825
+ // Emit tooltip hide event only if tooltip is shown
20826
+ var hoveredItemData = hoveredItem.datum();
20827
+ if (hoveredItemData.name.length > truncation.threshold &&
20828
+ truncation.type !== TruncationTypes.NONE) {
20829
+ self.services.events.dispatchEvent(Events.Tooltip.HIDE);
20830
+ }
20820
20831
  self.services.events.dispatchEvent(Events.Legend.ITEM_MOUSEOUT, {
20821
20832
  hoveredElement: hoveredItem,
20822
20833
  });
@@ -20844,7 +20855,7 @@ var legend_Legend = /** @class */ (function (_super) {
20844
20855
  svg.selectAll('g.additional-item').on('mouseover', function (event) {
20845
20856
  var hoveredItem = src_select(this);
20846
20857
  var hoveredItemData = hoveredItem.datum();
20847
- if (hoveredItemData.name.length > truncationThreshold) {
20858
+ if (hoveredItemData.name.length > truncation.threshold) {
20848
20859
  self.services.events.dispatchEvent(Events.Tooltip.SHOW, {
20849
20860
  event: event,
20850
20861
  hoveredElement: hoveredItem,