@gitlab/ui 78.10.1 → 78.11.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
+ # [78.11.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v78.10.1...v78.11.0) (2024-04-10)
2
+
3
+
4
+ ### Features
5
+
6
+ * **GlHeatmap:** Add prop to show/hide tooltip ([77a0484](https://gitlab.com/gitlab-org/gitlab-ui/commit/77a0484dcb95f19fb32aa30069465fd64a1dec9b))
7
+
1
8
  ## [78.10.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v78.10.0...v78.10.1) (2024-04-09)
2
9
 
3
10
 
@@ -104,6 +104,11 @@ var script = {
104
104
  type: [Number, String],
105
105
  required: false,
106
106
  default: null
107
+ },
108
+ showTooltip: {
109
+ type: Boolean,
110
+ default: true,
111
+ required: false
107
112
  }
108
113
  },
109
114
  data() {
@@ -260,7 +265,7 @@ const __vue_script__ = script;
260
265
  /* template */
261
266
  var __vue_render__ = function () {
262
267
  var _obj;
263
- var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-heatmap",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.computedOptions},on:{"created":_vm.onCreated}},'chart',_vm.$attrs,false),_vm.$listeners)),_vm._v(" "),(_vm.chart)?_c('chart-tooltip',{attrs:{"chart":_vm.chart,"top":_vm.tooltip.top,"left":_vm.tooltip.left},scopedSlots:_vm._u([{key:"title",fn:function(){return [(_vm.formatTooltipText)?_vm._t("tooltip-title"):_c('div',[_vm._v(_vm._s(_vm.tooltip.title))])]},proxy:true}],null,true)},[_vm._v(" "),(_vm.formatTooltipText)?_vm._t("tooltip-content"):_c('tooltip-default-format',{attrs:{"tooltip-content":_vm.tooltip.content}})],2):_vm._e(),_vm._v(" "),(_vm.compiledOptions)?_c('chart-legend',{style:(_vm.legendStyle),attrs:{"chart":_vm.chart,"series-info":_vm.seriesInfo,"text-style":_vm.compiledOptions.textStyle,"max-text":_vm.legendMaxText,"average-text":_vm.legendAverageText}}):_vm._e()],1)};
268
+ var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-heatmap",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.computedOptions},on:{"created":_vm.onCreated}},'chart',_vm.$attrs,false),_vm.$listeners)),_vm._v(" "),(_vm.chart)?_c('chart-tooltip',{attrs:{"chart":_vm.chart,"top":_vm.tooltip.top,"left":_vm.tooltip.left,"show":_vm.showTooltip},scopedSlots:_vm._u([{key:"title",fn:function(){return [(_vm.formatTooltipText)?_vm._t("tooltip-title"):_c('div',[_vm._v(_vm._s(_vm.tooltip.title))])]},proxy:true}],null,true)},[_vm._v(" "),(_vm.formatTooltipText)?_vm._t("tooltip-content"):_c('tooltip-default-format',{attrs:{"tooltip-content":_vm.tooltip.content}})],2):_vm._e(),_vm._v(" "),(_vm.compiledOptions)?_c('chart-legend',{style:(_vm.legendStyle),attrs:{"chart":_vm.chart,"series-info":_vm.seriesInfo,"text-style":_vm.compiledOptions.textStyle,"max-text":_vm.legendMaxText,"average-text":_vm.legendAverageText}}):_vm._e()],1)};
264
269
  var __vue_staticRenderFns__ = [];
265
270
 
266
271
  /* style */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 09 Apr 2024 14:01:48 GMT
3
+ * Generated on Wed, 10 Apr 2024 09:37:45 GMT
4
4
  */
5
5
 
6
6
  :root {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 09 Apr 2024 14:01:48 GMT
3
+ * Generated on Wed, 10 Apr 2024 09:37:45 GMT
4
4
  */
5
5
 
6
6
  :root.gl-dark {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 09 Apr 2024 14:01:48 GMT
3
+ * Generated on Wed, 10 Apr 2024 09:37:45 GMT
4
4
  */
5
5
 
6
6
  export const DATA_VIZ_GREEN_50 = "#133a03";
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 09 Apr 2024 14:01:48 GMT
3
+ * Generated on Wed, 10 Apr 2024 09:37:45 GMT
4
4
  */
5
5
 
6
6
  export const DATA_VIZ_GREEN_50 = "#ddfab7";
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Tue, 09 Apr 2024 14:01:48 GMT
3
+ // Generated on Wed, 10 Apr 2024 09:37:45 GMT
4
4
 
5
5
  $gl-text-tertiary: #737278 !default;
6
6
  $gl-text-secondary: #89888d !default;
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Tue, 09 Apr 2024 14:01:48 GMT
3
+ // Generated on Wed, 10 Apr 2024 09:37:45 GMT
4
4
 
5
5
  $gl-text-tertiary: #89888d !default;
6
6
  $gl-text-secondary: #737278 !default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "78.10.1",
3
+ "version": "78.11.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -93,10 +93,10 @@
93
93
  },
94
94
  "devDependencies": {
95
95
  "@arkweid/lefthook": "0.7.7",
96
- "@babel/core": "^7.24.3",
96
+ "@babel/core": "^7.24.4",
97
97
  "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
98
98
  "@babel/plugin-proposal-optional-chaining": "^7.21.0",
99
- "@babel/preset-env": "^7.24.3",
99
+ "@babel/preset-env": "^7.24.4",
100
100
  "@babel/preset-react": "^7.24.1",
101
101
  "@cypress/grep": "^4.0.1",
102
102
  "@gitlab/eslint-plugin": "19.5.0",
@@ -131,7 +131,7 @@
131
131
  "babel-jest": "29.0.1",
132
132
  "babel-loader": "^8.0.5",
133
133
  "bootstrap": "4.6.2",
134
- "cypress": "13.7.0",
134
+ "cypress": "13.7.2",
135
135
  "cypress-axe": "^1.4.0",
136
136
  "cypress-real-events": "^1.11.0",
137
137
  "dompurify": "^3.0.0",
@@ -1,5 +1,6 @@
1
1
  import { shallowMount } from '@vue/test-utils';
2
2
 
3
+ import { nextTick } from 'vue';
3
4
  import { createMockChartInstance } from '~helpers/chart_stubs';
4
5
  import { expectHeightAutoClasses } from '~helpers/chart_height';
5
6
  import Chart from '../chart/chart.vue';
@@ -76,6 +77,22 @@ describe('heatmap component', () => {
76
77
  });
77
78
  });
78
79
 
80
+ describe('showTooltip', () => {
81
+ it('is true by default', async () => {
82
+ createComponent();
83
+ await nextTick();
84
+
85
+ expect(findChartTooltip().props('show')).toBe(true);
86
+ });
87
+
88
+ it('sets show prop on the tooltip component', async () => {
89
+ createComponent({ showTooltip: false });
90
+ await nextTick();
91
+
92
+ expect(findChartTooltip().props('show')).toBe(false);
93
+ });
94
+ });
95
+
79
96
  describe('height', () => {
80
97
  expectHeightAutoClasses({
81
98
  createComponent,
@@ -25,6 +25,7 @@ const template = `
25
25
  :y-axis-name="yAxisName"
26
26
  :options="options"
27
27
  :height="height"
28
+ :show-tooltip="showTooltip"
28
29
  />
29
30
  `;
30
31
 
@@ -36,6 +37,7 @@ const generateProps = ({
36
37
  yAxisName = 'Day',
37
38
  options = {},
38
39
  height = null,
40
+ showTooltip = true,
39
41
  } = {}) => ({
40
42
  data,
41
43
  xAxisLabels,
@@ -44,6 +46,7 @@ const generateProps = ({
44
46
  yAxisName,
45
47
  options,
46
48
  height,
49
+ showTooltip,
47
50
  });
48
51
 
49
52
  const Template = (args, { argTypes }) => ({
@@ -106,6 +106,11 @@ export default {
106
106
  required: false,
107
107
  default: null,
108
108
  },
109
+ showTooltip: {
110
+ type: Boolean,
111
+ default: true,
112
+ required: false,
113
+ },
109
114
  },
110
115
  data() {
111
116
  return {
@@ -258,7 +263,13 @@ export default {
258
263
  @created="onCreated"
259
264
  v-on="$listeners"
260
265
  />
261
- <chart-tooltip v-if="chart" :chart="chart" :top="tooltip.top" :left="tooltip.left">
266
+ <chart-tooltip
267
+ v-if="chart"
268
+ :chart="chart"
269
+ :top="tooltip.top"
270
+ :left="tooltip.left"
271
+ :show="showTooltip"
272
+ >
262
273
  <template #title>
263
274
  <slot v-if="formatTooltipText" name="tooltip-title"></slot>
264
275
  <div v-else>{{ tooltip.title }}</div>