@gitlab/ui 66.27.0 → 66.28.0

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
@@ -1,3 +1,10 @@
1
+ # [66.28.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v66.27.0...v66.28.0) (2023-10-12)
2
+
3
+
4
+ ### Features
5
+
6
+ * **GlDiscreteScatterChart:** Add disableTooltip prop ([cd430c2](https://gitlab.com/gitlab-org/gitlab-ui/commit/cd430c2ca17749af3c2fca21164141d80d1edd3a))
7
+
1
8
  # [66.27.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v66.26.0...v66.27.0) (2023-10-11)
2
9
 
3
10
 
@@ -45,6 +45,11 @@ var script = {
45
45
  required: false,
46
46
  default: null
47
47
  },
48
+ disableTooltip: {
49
+ type: Boolean,
50
+ required: false,
51
+ default: () => false
52
+ },
48
53
  /**
49
54
  * Sets the chart's height in pixels. Set to `"auto"` to use the height of the container.
50
55
  */
@@ -168,7 +173,7 @@ const __vue_script__ = script;
168
173
  /* template */
169
174
  var __vue_render__ = function () {
170
175
  var _obj;
171
- var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"position-relative",class:( _obj = {}, _obj[_vm.$options.HEIGHT_AUTO_CLASSES] = _vm.autoHeight, _obj )},[_c('chart',_vm._g(_vm._b({class:{ 'gl-flex-grow-1': _vm.autoHeight },attrs:{"height":_vm.height,"options":_vm.options},on:{"created":_vm.onCreated}},'chart',_vm.$attrs,false),_vm.$listeners)),_vm._v(" "),(_vm.chart)?_c('chart-tooltip',{attrs:{"show":_vm.showTooltip,"chart":_vm.chart,"top":_vm.tooltipPosition.top,"left":_vm.tooltipPosition.left},scopedSlots:_vm._u([{key:"title",fn:function(){return [_vm._t("tooltip-title",function(){return [_vm._v(_vm._s(_vm.tooltipTitle)+" ("+_vm._s(_vm.xAxisTitle)+")")]})]},proxy:true}],null,true)},[_vm._v(" "),_vm._t("tooltip-content",function(){return [_c('tooltip-default-format',{attrs:{"tooltip-content":_vm.tooltipContent}})]})],2):_vm._e()],1)};
176
+ var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"position-relative",class:( _obj = {}, _obj[_vm.$options.HEIGHT_AUTO_CLASSES] = _vm.autoHeight, _obj )},[_c('chart',_vm._g(_vm._b({class:{ 'gl-flex-grow-1': _vm.autoHeight },attrs:{"height":_vm.height,"options":_vm.options},on:{"created":_vm.onCreated}},'chart',_vm.$attrs,false),_vm.$listeners)),_vm._v(" "),(!_vm.disableTooltip && _vm.chart)?_c('chart-tooltip',{attrs:{"show":_vm.showTooltip,"chart":_vm.chart,"top":_vm.tooltipPosition.top,"left":_vm.tooltipPosition.left},scopedSlots:_vm._u([{key:"title",fn:function(){return [_vm._t("tooltip-title",function(){return [_vm._v(_vm._s(_vm.tooltipTitle)+" ("+_vm._s(_vm.xAxisTitle)+")")]})]},proxy:true}],null,true)},[_vm._v(" "),_vm._t("tooltip-content",function(){return [_c('tooltip-default-format',{attrs:{"tooltip-content":_vm.tooltipContent}})]})],2):_vm._e()],1)};
172
177
  var __vue_staticRenderFns__ = [];
173
178
 
174
179
  /* style */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Wed, 11 Oct 2023 16:10:59 GMT
3
+ * Generated on Thu, 12 Oct 2023 06:30:08 GMT
4
4
  */
5
5
 
6
6
  :root {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Wed, 11 Oct 2023 16:10:59 GMT
3
+ * Generated on Thu, 12 Oct 2023 06:30:09 GMT
4
4
  */
5
5
 
6
6
  :root {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Wed, 11 Oct 2023 16:10:59 GMT
3
+ * Generated on Thu, 12 Oct 2023 06:30:09 GMT
4
4
  */
5
5
 
6
6
  export const BLACK = "#fff";
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Wed, 11 Oct 2023 16:10:59 GMT
3
+ * Generated on Thu, 12 Oct 2023 06:30:08 GMT
4
4
  */
5
5
 
6
6
  export const BLACK = "#000";
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Wed, 11 Oct 2023 16:10:59 GMT
3
+ // Generated on Thu, 12 Oct 2023 06:30:09 GMT
4
4
 
5
5
  $red-950: #fff4f3;
6
6
  $red-900: #fcf1ef;
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Wed, 11 Oct 2023 16:10:59 GMT
3
+ // Generated on Thu, 12 Oct 2023 06:30:09 GMT
4
4
 
5
5
  $gl-line-height-52: 3.25rem;
6
6
  $gl-line-height-44: 2.75rem;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "66.27.0",
3
+ "version": "66.28.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -2,6 +2,7 @@ import { shallowMount } from '@vue/test-utils';
2
2
  import { createMockChartInstance } from '~helpers/chart_stubs';
3
3
  import { expectHeightAutoClasses } from '~helpers/chart_height';
4
4
  import Chart from '../chart/chart.vue';
5
+ import ChartTooltip from '../tooltip/tooltip.vue';
5
6
  import DiscreteScatterChart from './discrete_scatter.vue';
6
7
 
7
8
  let mockChartInstance;
@@ -38,4 +39,20 @@ describe('column chart component', () => {
38
39
  findChart,
39
40
  });
40
41
  });
42
+
43
+ describe('disable-tooltip', () => {
44
+ it('is set to false by default', async () => {
45
+ createComponent();
46
+
47
+ await findChart().vm.$emit('created', mockChartInstance);
48
+
49
+ expect(wrapper.findComponent(ChartTooltip).exists()).toBe(true);
50
+ });
51
+
52
+ it('disables the tooltip', () => {
53
+ createComponent({ disableTooltip: true });
54
+
55
+ expect(wrapper.findComponent(ChartTooltip).exists()).toBe(false);
56
+ });
57
+ });
41
58
  });
@@ -11,6 +11,7 @@ const Template = (args, { argTypes }) => ({
11
11
  :x-axis-title="xAxisTitle"
12
12
  data-testid="discrete-scatter-chart"
13
13
  :height="height"
14
+ :disableTooltip="disableTooltip"
14
15
  />
15
16
  `,
16
17
  });
@@ -49,6 +49,11 @@ export default {
49
49
  required: false,
50
50
  default: null,
51
51
  },
52
+ disableTooltip: {
53
+ type: Boolean,
54
+ required: false,
55
+ default: () => false,
56
+ },
52
57
  /**
53
58
  * Sets the chart's height in pixels. Set to `"auto"` to use the height of the container.
54
59
  */
@@ -187,7 +192,7 @@ export default {
187
192
  @created="onCreated"
188
193
  />
189
194
  <chart-tooltip
190
- v-if="chart"
195
+ v-if="!disableTooltip && chart"
191
196
  :show="showTooltip"
192
197
  :chart="chart"
193
198
  :top="tooltipPosition.top"