@gitlab/ui 108.6.0 → 108.8.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,18 @@
1
+ # [108.8.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v108.7.0...v108.8.0) (2025-02-27)
2
+
3
+
4
+ ### Features
5
+
6
+ * **GlDatepicker:** use variant prop on GlIcon for disabled control ([f64fe84](https://gitlab.com/gitlab-org/gitlab-ui/commit/f64fe843b018b4fe04ea8626c38d942b729bd279))
7
+ * **GlLabel:** update scoped label title text color to text.color.strong ([6df7597](https://gitlab.com/gitlab-org/gitlab-ui/commit/6df7597071f2e24800a784b164616a1a7a5b5f44))
8
+
9
+ # [108.7.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v108.6.0...v108.7.0) (2025-02-26)
10
+
11
+
12
+ ### Features
13
+
14
+ * **GlStackedColumnChart:** Simplify chart tooltip API ([837c638](https://gitlab.com/gitlab-org/gitlab-ui/commit/837c638616a4cf1856482859b04a8315f2c99b65))
15
+
1
16
  # [108.6.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v108.5.0...v108.6.0) (2025-02-26)
2
17
 
3
18
 
@@ -380,7 +380,7 @@ var script = {
380
380
  const __vue_script__ = script;
381
381
 
382
382
  /* template */
383
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:_vm.datepickerClasses},[(_vm.showDefaultField)?_c('div',{staticClass:"gl-flex gl-items-start gl-gap-3"},[_c('div',{staticClass:"gl-relative gl-flex gl-grow"},[_vm._t("default",function(){return [_c('gl-form-input',{class:_vm.renderClearButton ? '!gl-pr-9' : '!gl-pr-7',attrs:{"id":_vm.inputId,"name":_vm.inputName,"data-testid":"gl-datepicker-input","value":_vm.formattedDate,"placeholder":_vm.placeholder,"autocomplete":_vm.inputAutocomplete,"disabled":_vm.disabled,"aria-label":_vm.inputLabel,"state":_vm.state},on:{"keydown":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }return _vm.onKeydown.apply(null, arguments)}},model:{value:(_vm.textInput),callback:function ($$v) {_vm.textInput=$$v;},expression:"textInput"}})]},{"formattedDate":_vm.formattedDate}),_vm._v(" "),_c('div',{staticClass:"gl-datepicker-actions"},[(_vm.renderClearButton)?_c('gl-button',{staticClass:"gl-pointer-events-auto",attrs:{"data-testid":"clear-button","aria-label":"Clear date","category":"tertiary","size":"small","icon":"clear"},on:{"click":_vm.cleared}}):_vm._e(),_vm._v(" "),(_vm.triggerOnFocus || _vm.disabled)?_c('span',{staticClass:"gl-px-2",class:_vm.disabled ? 'gl-text-gray-400' : 'gl-text-gray-500',attrs:{"data-testid":"datepicker-calendar-icon"}},[_c('gl-icon',{staticClass:"gl-block",attrs:{"name":"calendar","size":16}})],1):_c('gl-button',{ref:"calendarTriggerBtn",staticClass:"gl-pointer-events-auto",attrs:{"aria-label":"Open datepicker","category":"tertiary","size":"small","icon":"calendar"}})],1)],2),_vm._v(" "),_vm._t("after")],2):_vm._t("default",null,{"formattedDate":_vm.formattedDate})],2)};
383
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:_vm.datepickerClasses},[(_vm.showDefaultField)?_c('div',{staticClass:"gl-flex gl-items-start gl-gap-3"},[_c('div',{staticClass:"gl-relative gl-flex gl-grow"},[_vm._t("default",function(){return [_c('gl-form-input',{class:_vm.renderClearButton ? '!gl-pr-9' : '!gl-pr-7',attrs:{"id":_vm.inputId,"name":_vm.inputName,"data-testid":"gl-datepicker-input","value":_vm.formattedDate,"placeholder":_vm.placeholder,"autocomplete":_vm.inputAutocomplete,"disabled":_vm.disabled,"aria-label":_vm.inputLabel,"state":_vm.state},on:{"keydown":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }return _vm.onKeydown.apply(null, arguments)}},model:{value:(_vm.textInput),callback:function ($$v) {_vm.textInput=$$v;},expression:"textInput"}})]},{"formattedDate":_vm.formattedDate}),_vm._v(" "),_c('div',{staticClass:"gl-datepicker-actions"},[(_vm.renderClearButton)?_c('gl-button',{staticClass:"gl-pointer-events-auto",attrs:{"data-testid":"clear-button","aria-label":"Clear date","category":"tertiary","size":"small","icon":"clear"},on:{"click":_vm.cleared}}):_vm._e(),_vm._v(" "),(_vm.triggerOnFocus || _vm.disabled)?_c('span',{staticClass:"gl-px-2"},[_c('gl-icon',{staticClass:"gl-block",attrs:{"data-testid":"datepicker-calendar-icon","name":"calendar","size":16,"variant":_vm.disabled ? 'disabled' : 'default'}})],1):_c('gl-button',{ref:"calendarTriggerBtn",staticClass:"gl-pointer-events-auto",attrs:{"aria-label":"Open datepicker","category":"tertiary","size":"small","icon":"calendar"}})],1)],2),_vm._v(" "),_vm._t("after")],2):_vm._t("default",null,{"formattedDate":_vm.formattedDate})],2)};
384
384
  var __vue_staticRenderFns__ = [];
385
385
 
386
386
  /* style */
@@ -3,10 +3,10 @@ import { yAxis, generateBarSeries, generateLineSeries, defaultChartOptions, grid
3
3
  import { LEGEND_AVERAGE_TEXT, LEGEND_MAX_TEXT, LEGEND_MIN_TEXT, LEGEND_CURRENT_TEXT, LEGEND_LAYOUT_INLINE, LEGEND_LAYOUT_TABLE, CHART_TYPE_LINE, HEIGHT_AUTO_CLASSES } from '../../../utils/charts/constants';
4
4
  import { colorFromDefaultPalette } from '../../../utils/charts/theme';
5
5
  import { columnOptions } from '../../../utils/constants';
6
- import TooltipDefaultFormat from '../../shared_components/charts/tooltip_default_format';
7
6
  import Chart from '../chart/chart';
8
7
  import ChartLegend from '../legend/legend';
9
8
  import ChartTooltip from '../tooltip/tooltip';
9
+ import TooltipDefaultFormat from '../../shared_components/charts/tooltip_default_format';
10
10
  import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
11
11
 
12
12
  const yAxisDefaults = {
@@ -112,6 +112,12 @@ var script = {
112
112
  return [LEGEND_LAYOUT_INLINE, LEGEND_LAYOUT_TABLE].indexOf(layout) !== -1;
113
113
  }
114
114
  },
115
+ /**
116
+ * Callback called when showing or refreshing a tooltip.
117
+ * **Deprecated:** Use slots `#tooltip-title`, `#tooltip-content` or `#tooltip-value`.
118
+ *
119
+ * @deprecated Use slots `#tooltip-title`, `#tooltip-content` or `#tooltip-value`.
120
+ */
115
121
  formatTooltipText: {
116
122
  type: Function,
117
123
  required: false,
@@ -133,9 +139,7 @@ var script = {
133
139
  },
134
140
  data() {
135
141
  return {
136
- chart: null,
137
- tooltipTitle: '',
138
- tooltipContent: {}
142
+ chart: null
139
143
  };
140
144
  },
141
145
  computed: {
@@ -216,7 +220,7 @@ var script = {
216
220
  show: true,
217
221
  type: 'none',
218
222
  label: {
219
- formatter: this.onLabelChange
223
+ formatter: this.formatTooltipText
220
224
  }
221
225
  },
222
226
  data: this.groupBy,
@@ -272,28 +276,34 @@ var script = {
272
276
  this.chart = chart;
273
277
  this.$emit('created', chart);
274
278
  },
275
- defaultFormatTooltipText(params) {
276
- const {
277
- tooltipContent
278
- } = params.seriesData.reverse().reduce((acc, bar) => {
279
- acc.tooltipContent[bar.seriesName] = {
280
- value: bar.value,
281
- index: bar.seriesIndex,
282
- color: this.getColor(bar.seriesIndex)
283
- };
284
- return acc;
285
- }, {
286
- tooltipContent: {}
287
- });
288
- this.tooltipTitle = params.value;
289
- this.$set(this, 'tooltipContent', tooltipContent);
279
+ getTooltipTitle(_ref4) {
280
+ var _options$xAxis, _options$xAxis$;
281
+ let {
282
+ params
283
+ } = _ref4;
284
+ if (!params) return '';
285
+ const options = this.chart.getOption();
286
+ const titleAxisName = options === null || options === void 0 ? void 0 : (_options$xAxis = options.xAxis) === null || _options$xAxis === void 0 ? void 0 : (_options$xAxis$ = _options$xAxis[0]) === null || _options$xAxis$ === void 0 ? void 0 : _options$xAxis$.name;
287
+ return titleAxisName ? `${params.value} (${titleAxisName})` : params.value;
290
288
  },
291
- onLabelChange(params) {
292
- if (this.formatTooltipText) {
293
- this.formatTooltipText(params);
294
- } else {
295
- this.defaultFormatTooltipText(params);
296
- }
289
+ getTooltipContent(_ref5) {
290
+ let {
291
+ params
292
+ } = _ref5;
293
+ if (!params) return {};
294
+ const tooltipContentEntries = params.seriesData.toSorted((a, b) => b.seriesIndex - a.seriesIndex) // Invert stacking order so it matches chart (see https://github.com/apache/echarts/issues/14700)
295
+ .map(_ref6 => {
296
+ let {
297
+ seriesName = '',
298
+ value,
299
+ borderColor
300
+ } = _ref6;
301
+ return [seriesName, {
302
+ value,
303
+ color: borderColor
304
+ }];
305
+ });
306
+ return Object.fromEntries(tooltipContentEntries);
297
307
  }
298
308
  },
299
309
  HEIGHT_AUTO_CLASSES
@@ -305,7 +315,7 @@ const __vue_script__ = script;
305
315
  /* template */
306
316
  var __vue_render__ = function () {
307
317
  var _obj;
308
- 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.chart)?_c('chart-tooltip',{attrs:{"chart":_vm.chart},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(),_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)};
318
+ 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.chart)?_c('chart-tooltip',{attrs:{"chart":_vm.chart,"use-default-tooltip-formatter":!_vm.formatTooltipText},scopedSlots:_vm._u([{key:"title",fn:function(scope){return [_vm._t("tooltip-title",function(){return [_vm._v(_vm._s(_vm.getTooltipTitle(scope)))]},null,scope)]}},{key:"default",fn:function(scope){return [_vm._t("tooltip-content",function(){return [_c('tooltip-default-format',{attrs:{"tooltip-content":_vm.getTooltipContent(scope)},scopedSlots:_vm._u([(_vm.$scopedSlots['tooltip-value'])?{key:"tooltip-value",fn:function(valueScope){return [_vm._t("tooltip-value",null,null,valueScope)]}}:null],null,true)})]},null,scope)]}}],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)};
309
319
  var __vue_staticRenderFns__ = [];
310
320
 
311
321
  /* style */