@gitlab/ui 111.10.0 → 111.10.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
@@ -1,3 +1,17 @@
1
+ ## [111.10.2](https://gitlab.com/gitlab-org/gitlab-ui/compare/v111.10.1...v111.10.2) (2025-04-01)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **GlToggle:** Fix label required if slot is used ([c39ca40](https://gitlab.com/gitlab-org/gitlab-ui/commit/c39ca40c6f364f8e73a5d88eb7254c64c65057c4))
7
+
8
+ ## [111.10.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v111.10.0...v111.10.1) (2025-03-31)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **GlAreaChart:** Legend is updated on changes ([0caa619](https://gitlab.com/gitlab-org/gitlab-ui/commit/0caa61948ad48ee1098c063bacf3c3ddfff3e804))
14
+
1
15
  # [111.10.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v111.9.1...v111.10.0) (2025-03-28)
2
16
 
3
17
 
@@ -52,7 +52,8 @@ var script = {
52
52
  */
53
53
  label: {
54
54
  type: String,
55
- required: true
55
+ required: false,
56
+ default: null
56
57
  },
57
58
  /**
58
59
  * The toggle's description.
@@ -107,6 +107,7 @@ var script = {
107
107
  // https://gitlab.com/gitlab-org/gitlab-ui/-/issues/618
108
108
  return {
109
109
  chart: null,
110
+ compiledOptions: null,
110
111
  showAnnotationsTooltip: false,
111
112
  annotationsTooltipTitle: '',
112
113
  annotationsTooltipContent: '',
@@ -151,9 +152,6 @@ var script = {
151
152
  axisTick: {
152
153
  show: false
153
154
  }
154
- },
155
- legend: {
156
- show: false
157
155
  }
158
156
  };
159
157
 
@@ -187,23 +185,23 @@ var script = {
187
185
  shouldShowAnnotationsTooltip() {
188
186
  return this.chart && this.hasAnnotations;
189
187
  },
190
- compiledOptions() {
191
- return this.chart ? this.chart.getOption() : null;
192
- },
193
188
  legendStyle() {
194
189
  return {
195
190
  paddingLeft: `${grid.left}px`
196
191
  };
197
192
  },
198
193
  seriesInfo() {
194
+ var _this$compiledOptions;
199
195
  if (this.legendSeriesInfo.length > 0) return this.legendSeriesInfo;
200
- return this.compiledOptions.series.reduce((acc, series, index) => {
196
+ const compiledSeries = ((_this$compiledOptions = this.compiledOptions) === null || _this$compiledOptions === void 0 ? void 0 : _this$compiledOptions.series) || [];
197
+ return compiledSeries.reduce((acc, series, index) => {
201
198
  if (series.type === 'line') {
199
+ var _series$data;
202
200
  acc.push({
203
201
  name: series.name,
204
202
  type: series.lineStyle.type,
205
203
  color: series.lineStyle.color || colorFromDefaultPalette(index),
206
- data: this.includeLegendAvgMax ? series.data.map(data => data[1]) : undefined
204
+ data: this.includeLegendAvgMax ? (_series$data = series.data) === null || _series$data === void 0 ? void 0 : _series$data.map(data => data[1]) : undefined
207
205
  });
208
206
  }
209
207
  return acc;
@@ -242,6 +240,9 @@ var script = {
242
240
  this.chart = chart;
243
241
  this.$emit('created', chart);
244
242
  },
243
+ onUpdated() {
244
+ this.compiledOptions = this.chart.getOption();
245
+ },
245
246
  onChartDataPointMouseOut() {
246
247
  this.showAnnotationsTooltip = false;
247
248
  },
@@ -278,7 +279,7 @@ const __vue_script__ = script;
278
279
  /* template */
279
280
  var __vue_render__ = function () {
280
281
  var _obj;
281
- var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-relative",class:( _obj = {}, _obj[_vm.$options.HEIGHT_AUTO_CLASSES] = _vm.autoHeight, _obj )},[_c('chart',_vm._g(_vm._b({class:{ 'gl-grow': _vm.autoHeight },attrs:{"height":_vm.height,"options":_vm.options},on:{"created":_vm.onCreated}},'chart',_vm.$attrs,false),_vm.$listeners)),_vm._v(" "),(_vm.shouldShowAnnotationsTooltip)?_c('chart-tooltip',{ref:"annotationsTooltip",attrs:{"id":"annotationsTooltip","show":_vm.showAnnotationsTooltip,"top":_vm.annotationsTooltipPosition.top,"left":_vm.annotationsTooltipPosition.left,"chart":_vm.chart,"placement":"bottom"},scopedSlots:_vm._u([{key:"title",fn:function(){return [_c('div',[_vm._v(_vm._s(_vm.annotationsTooltipTitle))])]},proxy:true}],null,false,1889294429)},[_vm._v(" "),_c('div',[_vm._v(_vm._s(_vm.annotationsTooltipContent))])]):_vm._e(),_vm._v(" "),(_vm.chart)?_c('chart-tooltip',{ref:"dataTooltip",attrs:{"chart":_vm.chart,"use-default-tooltip-formatter":!_vm.formatTooltipText},scopedSlots:_vm._u([(_vm.$scopedSlots['tooltip-title'])?{key:"title",fn:function(scope){return [_vm._t("tooltip-title",null,null,scope)]}}:null,(_vm.$scopedSlots['tooltip-content'])?{key:"default",fn:function(scope){return [_vm._t("tooltip-content",null,null,scope)]}}:null,(_vm.$scopedSlots['tooltip-value'])?{key:"tooltip-value",fn:function(scope){return [_vm._t("tooltip-value",null,null,scope)]}}:null],null,true)}):_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,"min-text":_vm.legendMinText,"max-text":_vm.legendMaxText,"average-text":_vm.legendAverageText,"current-text":_vm.legendCurrentText,"layout":_vm.legendLayout}}):_vm._e()],1)};
282
+ var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-relative",class:( _obj = {}, _obj[_vm.$options.HEIGHT_AUTO_CLASSES] = _vm.autoHeight, _obj )},[_c('chart',_vm._g(_vm._b({class:{ 'gl-grow': _vm.autoHeight },attrs:{"height":_vm.height,"options":_vm.options},on:{"created":_vm.onCreated,"updated":_vm.onUpdated}},'chart',_vm.$attrs,false),_vm.$listeners)),_vm._v(" "),(_vm.shouldShowAnnotationsTooltip)?_c('chart-tooltip',{ref:"annotationsTooltip",attrs:{"id":"annotationsTooltip","show":_vm.showAnnotationsTooltip,"top":_vm.annotationsTooltipPosition.top,"left":_vm.annotationsTooltipPosition.left,"chart":_vm.chart,"placement":"bottom"},scopedSlots:_vm._u([{key:"title",fn:function(){return [_c('div',[_vm._v(_vm._s(_vm.annotationsTooltipTitle))])]},proxy:true}],null,false,1889294429)},[_vm._v(" "),_c('div',[_vm._v(_vm._s(_vm.annotationsTooltipContent))])]):_vm._e(),_vm._v(" "),(_vm.chart)?_c('chart-tooltip',{ref:"dataTooltip",attrs:{"chart":_vm.chart,"use-default-tooltip-formatter":!_vm.formatTooltipText},scopedSlots:_vm._u([(_vm.$scopedSlots['tooltip-title'])?{key:"title",fn:function(scope){return [_vm._t("tooltip-title",null,null,scope)]}}:null,(_vm.$scopedSlots['tooltip-content'])?{key:"default",fn:function(scope){return [_vm._t("tooltip-content",null,null,scope)]}}:null,(_vm.$scopedSlots['tooltip-value'])?{key:"tooltip-value",fn:function(scope){return [_vm._t("tooltip-value",null,null,scope)]}}:null],null,true)}):_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,"min-text":_vm.legendMinText,"max-text":_vm.legendMaxText,"average-text":_vm.legendAverageText,"current-text":_vm.legendCurrentText,"layout":_vm.legendLayout}}):_vm._e()],1)};
282
283
  var __vue_staticRenderFns__ = [];
283
284
 
284
285
  /* style */
@@ -52,6 +52,9 @@ const defaultOptions = {
52
52
  separator: '...'
53
53
  })
54
54
  }
55
+ },
56
+ legend: {
57
+ show: false
55
58
  }
56
59
  };
57
60
  var script = {
@@ -146,9 +149,6 @@ var script = {
146
149
  formatter: this.onLabelChange
147
150
  }
148
151
  }
149
- },
150
- legend: {
151
- show: false
152
152
  }
153
153
  }, this.option, dataZoomAdjustments(this.option.dataZoom));
154
154
  // All chart options can be merged but series
@@ -163,10 +163,7 @@ var script = {
163
163
  ...yAxisDefaults,
164
164
  name: this.secondaryDataTitle,
165
165
  show: this.hasSecondaryAxis
166
- }] : yAxisPrimary,
167
- legend: {
168
- show: false
169
- }
166
+ }] : yAxisPrimary
170
167
  }, this.option, dataZoomAdjustments(this.option.dataZoom));
171
168
  // All chart options can be merged but series
172
169
  // needs to be handled specially
@@ -108,9 +108,6 @@ var script = {
108
108
  yAxis: {
109
109
  type: 'value',
110
110
  name: this.yAxisTitle
111
- },
112
- legend: {
113
- show: false
114
111
  }
115
112
  }, this.option, dataZoomAdjustments(this.option.dataZoom));
116
113
  // All chart options can be merged but series
@@ -149,9 +149,6 @@ var script = {
149
149
  color: 'var(--gl-chart-axis-line-color)'
150
150
  }
151
151
  }
152
- },
153
- legend: {
154
- show: false
155
152
  }
156
153
  };
157
154
 
@@ -230,10 +230,7 @@ var script = {
230
230
  ...yAxisDefaults,
231
231
  name: this.secondaryDataTitle,
232
232
  show: this.hasSecondaryAxis
233
- }],
234
- legend: {
235
- show: false
236
- }
233
+ }]
237
234
  };
238
235
 
239
236
  // `formatTooltipText` is deprecated, these added options should be
@@ -44,7 +44,10 @@ const grid = {
44
44
  const defaultChartOptions = {
45
45
  grid,
46
46
  xAxis,
47
- yAxis
47
+ yAxis,
48
+ legend: {
49
+ show: false
50
+ }
48
51
  };
49
52
  const gridWithSecondaryYAxis = {
50
53
  ...grid,
@@ -21,46 +21,6 @@ const mockDefaultDataZoomConfig = {
21
21
  nameGap: 67
22
22
  }
23
23
  };
24
- const mockDefaultChartOptions = {
25
- grid: {
26
- top: 16,
27
- bottom: 44,
28
- left: 64,
29
- right: 32
30
- },
31
- xAxis: {
32
- name: 'Value',
33
- type: 'value',
34
- nameLocation: 'center',
35
- boundaryGap: false,
36
- splitLine: {
37
- show: false
38
- },
39
- axisPointer: {
40
- show: true,
41
- label: {},
42
- lineStyle: {
43
- type: 'solid'
44
- }
45
- }
46
- },
47
- yAxis: {
48
- name: 'Value',
49
- type: 'value',
50
- nameLocation: 'center',
51
- nameGap: 50,
52
- axisLabel: {},
53
- axisTick: {
54
- show: false
55
- }
56
- },
57
- legend: {
58
- show: false
59
- },
60
- aria: {
61
- enabled: true
62
- }
63
- };
64
24
 
65
25
  /**
66
26
  * This is currently used in area.stories.js and line.stories.js
@@ -211,4 +171,4 @@ const mockSecondaryTrendlineData = [{
211
171
  data: [['Joe', 220], ['Sarah', 392], ['Tom', 291], ['Mary', 594], ['Mike', 320], ['Ben', 230], ['Jane', 120], ['Anne', 290]]
212
172
  }];
213
173
 
214
- export { mockAnnotationsConfigs, mockAnnotationsSeries, mockDefaultBarChartConfig, mockDefaultBarData, mockDefaultChartOptions, mockDefaultDataZoomConfig, mockDefaultLineChartConfig, mockDefaultLineData, mockDefaultStackedBarData, mockDefaultStackedLineData, mockRawBarData, mockSecondaryBarData, mockSecondaryData, mockSecondaryTrendlineData };
174
+ export { mockAnnotationsConfigs, mockAnnotationsSeries, mockDefaultBarChartConfig, mockDefaultBarData, mockDefaultDataZoomConfig, mockDefaultLineChartConfig, mockDefaultLineData, mockDefaultStackedBarData, mockDefaultStackedLineData, mockRawBarData, mockSecondaryBarData, mockSecondaryData, mockSecondaryTrendlineData };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "111.10.0",
3
+ "version": "111.10.2",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -108,7 +108,7 @@
108
108
  "@gitlab/eslint-plugin": "20.7.1",
109
109
  "@gitlab/fonts": "^1.3.0",
110
110
  "@gitlab/stylelint-config": "6.2.2",
111
- "@gitlab/svgs": "3.123.0",
111
+ "@gitlab/svgs": "3.126.0",
112
112
  "@jest/test-sequencer": "^29.7.0",
113
113
  "@rollup/plugin-commonjs": "^11.1.0",
114
114
  "@rollup/plugin-node-resolve": "^7.1.3",
@@ -142,7 +142,7 @@
142
142
  "axe-playwright": "^2.1.0",
143
143
  "babel-jest": "29.0.1",
144
144
  "babel-loader": "^8.0.5",
145
- "cypress": "14.2.0",
145
+ "cypress": "14.2.1",
146
146
  "cypress-real-events": "^1.11.0",
147
147
  "dompurify": "^3.1.2",
148
148
  "emoji-regex": "^10.0.0",
@@ -54,7 +54,8 @@ export default {
54
54
  */
55
55
  label: {
56
56
  type: String,
57
- required: true,
57
+ required: false,
58
+ default: null,
58
59
  },
59
60
  /**
60
61
  * The toggle's description.
@@ -141,6 +141,7 @@ export default {
141
141
  // https://gitlab.com/gitlab-org/gitlab-ui/-/issues/618
142
142
  return {
143
143
  chart: null,
144
+ compiledOptions: null,
144
145
  showAnnotationsTooltip: false,
145
146
  annotationsTooltipTitle: '',
146
147
  annotationsTooltipContent: '',
@@ -192,9 +193,6 @@ export default {
192
193
  show: false,
193
194
  },
194
195
  },
195
- legend: {
196
- show: false,
197
- },
198
196
  };
199
197
 
200
198
  // `formatTooltipText` is deprecated, these added options should be
@@ -238,22 +236,20 @@ export default {
238
236
  shouldShowAnnotationsTooltip() {
239
237
  return this.chart && this.hasAnnotations;
240
238
  },
241
- compiledOptions() {
242
- return this.chart ? this.chart.getOption() : null;
243
- },
244
239
  legendStyle() {
245
240
  return { paddingLeft: `${grid.left}px` };
246
241
  },
247
242
  seriesInfo() {
248
243
  if (this.legendSeriesInfo.length > 0) return this.legendSeriesInfo;
249
244
 
250
- return this.compiledOptions.series.reduce((acc, series, index) => {
245
+ const compiledSeries = this.compiledOptions?.series || [];
246
+ return compiledSeries.reduce((acc, series, index) => {
251
247
  if (series.type === 'line') {
252
248
  acc.push({
253
249
  name: series.name,
254
250
  type: series.lineStyle.type,
255
251
  color: series.lineStyle.color || colorFromDefaultPalette(index),
256
- data: this.includeLegendAvgMax ? series.data.map((data) => data[1]) : undefined,
252
+ data: this.includeLegendAvgMax ? series.data?.map((data) => data[1]) : undefined,
257
253
  });
258
254
  }
259
255
  return acc;
@@ -292,6 +288,9 @@ export default {
292
288
  this.chart = chart;
293
289
  this.$emit('created', chart);
294
290
  },
291
+ onUpdated() {
292
+ this.compiledOptions = this.chart.getOption();
293
+ },
295
294
  onChartDataPointMouseOut() {
296
295
  this.showAnnotationsTooltip = false;
297
296
  },
@@ -328,6 +327,7 @@ export default {
328
327
  :options="options"
329
328
  v-on="$listeners"
330
329
  @created="onCreated"
330
+ @updated="onUpdated"
331
331
  />
332
332
  <chart-tooltip
333
333
  v-if="shouldShowAnnotationsTooltip"
@@ -53,6 +53,9 @@ const defaultOptions = {
53
53
  }),
54
54
  },
55
55
  },
56
+ legend: {
57
+ show: false,
58
+ },
56
59
  };
57
60
 
58
61
  export default {
@@ -152,9 +155,6 @@ export default {
152
155
  },
153
156
  },
154
157
  },
155
- legend: {
156
- show: false,
157
- },
158
158
  },
159
159
  this.option,
160
160
  dataZoomAdjustments(this.option.dataZoom)
@@ -150,9 +150,6 @@ export default {
150
150
  },
151
151
  ]
152
152
  : yAxisPrimary,
153
- legend: {
154
- show: false,
155
- },
156
153
  },
157
154
  this.option,
158
155
  dataZoomAdjustments(this.option.dataZoom)
@@ -123,9 +123,6 @@ export default {
123
123
  type: 'value',
124
124
  name: this.yAxisTitle,
125
125
  },
126
- legend: {
127
- show: false,
128
- },
129
126
  },
130
127
  this.option,
131
128
  dataZoomAdjustments(this.option.dataZoom)
@@ -190,9 +190,6 @@ export default {
190
190
  },
191
191
  },
192
192
  },
193
- legend: {
194
- show: false,
195
- },
196
193
  };
197
194
 
198
195
  // `formatTooltipText` is deprecated, these added options should be
@@ -221,9 +221,6 @@ export default {
221
221
  show: this.hasSecondaryAxis,
222
222
  },
223
223
  ],
224
- legend: {
225
- show: false,
226
- },
227
224
  };
228
225
 
229
226
  // `formatTooltipText` is deprecated, these added options should be
@@ -49,6 +49,9 @@ export const defaultChartOptions = {
49
49
  grid,
50
50
  xAxis,
51
51
  yAxis,
52
+ legend: {
53
+ show: false,
54
+ },
52
55
  };
53
56
 
54
57
  export const gridWithSecondaryYAxis = {
@@ -25,47 +25,6 @@ export const mockDefaultDataZoomConfig = {
25
25
  },
26
26
  };
27
27
 
28
- export const mockDefaultChartOptions = {
29
- grid: {
30
- top: 16,
31
- bottom: 44,
32
- left: 64,
33
- right: 32,
34
- },
35
- xAxis: {
36
- name: 'Value',
37
- type: 'value',
38
- nameLocation: 'center',
39
- boundaryGap: false,
40
- splitLine: {
41
- show: false,
42
- },
43
- axisPointer: {
44
- show: true,
45
- label: {},
46
- lineStyle: {
47
- type: 'solid',
48
- },
49
- },
50
- },
51
- yAxis: {
52
- name: 'Value',
53
- type: 'value',
54
- nameLocation: 'center',
55
- nameGap: 50,
56
- axisLabel: {},
57
- axisTick: {
58
- show: false,
59
- },
60
- },
61
- legend: {
62
- show: false,
63
- },
64
- aria: {
65
- enabled: true,
66
- },
67
- };
68
-
69
28
  /**
70
29
  * This is currently used in area.stories.js and line.stories.js
71
30
  */