@gitlab/ui 111.10.0 → 111.10.1

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
+ ## [111.10.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v111.10.0...v111.10.1) (2025-03-31)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **GlAreaChart:** Legend is updated on changes ([0caa619](https://gitlab.com/gitlab-org/gitlab-ui/commit/0caa61948ad48ee1098c063bacf3c3ddfff3e804))
7
+
1
8
  # [111.10.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v111.9.1...v111.10.0) (2025-03-28)
2
9
 
3
10
 
@@ -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: '',
@@ -187,23 +188,23 @@ var script = {
187
188
  shouldShowAnnotationsTooltip() {
188
189
  return this.chart && this.hasAnnotations;
189
190
  },
190
- compiledOptions() {
191
- return this.chart ? this.chart.getOption() : null;
192
- },
193
191
  legendStyle() {
194
192
  return {
195
193
  paddingLeft: `${grid.left}px`
196
194
  };
197
195
  },
198
196
  seriesInfo() {
197
+ var _this$compiledOptions;
199
198
  if (this.legendSeriesInfo.length > 0) return this.legendSeriesInfo;
200
- return this.compiledOptions.series.reduce((acc, series, index) => {
199
+ const compiledSeries = ((_this$compiledOptions = this.compiledOptions) === null || _this$compiledOptions === void 0 ? void 0 : _this$compiledOptions.series) || [];
200
+ return compiledSeries.reduce((acc, series, index) => {
201
201
  if (series.type === 'line') {
202
+ var _series$data;
202
203
  acc.push({
203
204
  name: series.name,
204
205
  type: series.lineStyle.type,
205
206
  color: series.lineStyle.color || colorFromDefaultPalette(index),
206
- data: this.includeLegendAvgMax ? series.data.map(data => data[1]) : undefined
207
+ data: this.includeLegendAvgMax ? (_series$data = series.data) === null || _series$data === void 0 ? void 0 : _series$data.map(data => data[1]) : undefined
207
208
  });
208
209
  }
209
210
  return acc;
@@ -242,6 +243,9 @@ var script = {
242
243
  this.chart = chart;
243
244
  this.$emit('created', chart);
244
245
  },
246
+ onUpdated() {
247
+ this.compiledOptions = this.chart.getOption();
248
+ },
245
249
  onChartDataPointMouseOut() {
246
250
  this.showAnnotationsTooltip = false;
247
251
  },
@@ -278,7 +282,7 @@ const __vue_script__ = script;
278
282
  /* template */
279
283
  var __vue_render__ = function () {
280
284
  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)};
285
+ 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
286
  var __vue_staticRenderFns__ = [];
283
287
 
284
288
  /* style */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "111.10.0",
3
+ "version": "111.10.1",
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",
@@ -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: '',
@@ -238,22 +239,20 @@ export default {
238
239
  shouldShowAnnotationsTooltip() {
239
240
  return this.chart && this.hasAnnotations;
240
241
  },
241
- compiledOptions() {
242
- return this.chart ? this.chart.getOption() : null;
243
- },
244
242
  legendStyle() {
245
243
  return { paddingLeft: `${grid.left}px` };
246
244
  },
247
245
  seriesInfo() {
248
246
  if (this.legendSeriesInfo.length > 0) return this.legendSeriesInfo;
249
247
 
250
- return this.compiledOptions.series.reduce((acc, series, index) => {
248
+ const compiledSeries = this.compiledOptions?.series || [];
249
+ return compiledSeries.reduce((acc, series, index) => {
251
250
  if (series.type === 'line') {
252
251
  acc.push({
253
252
  name: series.name,
254
253
  type: series.lineStyle.type,
255
254
  color: series.lineStyle.color || colorFromDefaultPalette(index),
256
- data: this.includeLegendAvgMax ? series.data.map((data) => data[1]) : undefined,
255
+ data: this.includeLegendAvgMax ? series.data?.map((data) => data[1]) : undefined,
257
256
  });
258
257
  }
259
258
  return acc;
@@ -292,6 +291,9 @@ export default {
292
291
  this.chart = chart;
293
292
  this.$emit('created', chart);
294
293
  },
294
+ onUpdated() {
295
+ this.compiledOptions = this.chart.getOption();
296
+ },
295
297
  onChartDataPointMouseOut() {
296
298
  this.showAnnotationsTooltip = false;
297
299
  },
@@ -328,6 +330,7 @@ export default {
328
330
  :options="options"
329
331
  v-on="$listeners"
330
332
  @created="onCreated"
333
+ @updated="onUpdated"
331
334
  />
332
335
  <chart-tooltip
333
336
  v-if="shouldShowAnnotationsTooltip"