@gitlab/ui 109.2.0 → 110.0.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 +20 -0
- package/dist/charts.js +0 -1
- package/dist/components/base/dropdown/dropdown_item.js +13 -1
- package/dist/components/base/form/form_combobox/form_combobox.js +13 -4
- package/dist/components/charts/area/area.js +1 -1
- package/dist/components/charts/bar/bar.js +2 -2
- package/dist/components/charts/column/column.js +1 -1
- package/dist/components/charts/discrete_scatter/discrete_scatter.js +2 -2
- package/dist/components/charts/heatmap/heatmap.js +2 -2
- package/dist/components/charts/line/line.js +1 -1
- package/dist/components/charts/{tooltip → shared/tooltip}/tooltip.js +6 -6
- package/dist/components/{shared_components/charts → charts/shared/tooltip/tooltip_default_format}/tooltip_default_format.js +1 -1
- package/dist/components/charts/sparkline/sparkline.js +1 -1
- package/dist/components/charts/stacked_column/stacked_column.js +2 -2
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-item-button.js +5 -3
- package/package.json +1 -1
- package/src/charts.js +0 -1
- package/src/components/base/dropdown/dropdown_item.vue +16 -1
- package/src/components/base/form/form_combobox/form_combobox.vue +67 -49
- package/src/components/charts/area/area.vue +1 -1
- package/src/components/charts/bar/bar.vue +2 -2
- package/src/components/charts/column/column.vue +1 -1
- package/src/components/charts/discrete_scatter/discrete_scatter.vue +2 -2
- package/src/components/charts/heatmap/heatmap.vue +2 -2
- package/src/components/charts/line/line.vue +1 -1
- package/src/components/charts/{tooltip → shared/tooltip}/tooltip.vue +7 -6
- package/src/components/{shared_components/charts → charts/shared/tooltip/tooltip_default_format}/tooltip_default_format.vue +1 -1
- package/src/components/charts/sparkline/sparkline.vue +1 -1
- package/src/components/charts/stacked_column/stacked_column.vue +2 -2
- package/src/scss/components.scss +2 -2
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-item-button.js +5 -3
- /package/src/components/charts/{tooltip → shared/tooltip}/tooltip.md +0 -0
- /package/src/components/charts/{tooltip → shared/tooltip}/tooltip.scss +0 -0
- /package/src/components/{shared_components/charts → charts/shared/tooltip/tooltip_default_format}/tooltip_default_format.scss +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
# [110.0.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v109.2.1...v110.0.0) (2025-03-07)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **charts:** Removes GlChartTooltip component from published package ([99517f4](https://gitlab.com/gitlab-org/gitlab-ui/commit/99517f418f6b9116a724eba247dc004403557a77))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### BREAKING CHANGES
|
|
10
|
+
|
|
11
|
+
* **charts:** GlChartTooltip cannot be imported
|
|
12
|
+
from '@gitlab/ui/dist/charts'
|
|
13
|
+
|
|
14
|
+
## [109.2.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v109.2.0...v109.2.1) (2025-03-07)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **combobox:** Combobox ARIA labeling ([2d46733](https://gitlab.com/gitlab-org/gitlab-ui/commit/2d4673351a44c8413188dbe708a06ea973694a32))
|
|
20
|
+
|
|
1
21
|
# [109.2.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v109.1.0...v109.2.0) (2025-03-05)
|
|
2
22
|
|
|
3
23
|
|
package/dist/charts.js
CHANGED
|
@@ -5,7 +5,6 @@ export { default as GlGaugeChart } from './components/charts/gauge/gauge';
|
|
|
5
5
|
export { default as GlLineChart } from './components/charts/line/line';
|
|
6
6
|
export { default as GlChartLegend } from './components/charts/legend/legend';
|
|
7
7
|
export { default as GlChartSeriesLabel } from './components/charts/series_label/series_label';
|
|
8
|
-
export { default as GlChartTooltip } from './components/charts/tooltip/tooltip';
|
|
9
8
|
export { default as GlHeatmap } from './components/charts/heatmap';
|
|
10
9
|
export { default as GlColumnChart } from './components/charts/column/column';
|
|
11
10
|
export { default as GlStackedColumnChart } from './components/charts/stacked_column/stacked_column';
|
|
@@ -59,6 +59,11 @@ var script = {
|
|
|
59
59
|
type: String,
|
|
60
60
|
required: false,
|
|
61
61
|
default: ''
|
|
62
|
+
},
|
|
63
|
+
role: {
|
|
64
|
+
type: String,
|
|
65
|
+
required: false,
|
|
66
|
+
default: null
|
|
62
67
|
}
|
|
63
68
|
},
|
|
64
69
|
computed: {
|
|
@@ -70,6 +75,13 @@ var script = {
|
|
|
70
75
|
// Support 'href' and Vue Router's 'to'
|
|
71
76
|
return href || to ? BDropdownItem : BDropdownItemButton;
|
|
72
77
|
},
|
|
78
|
+
bootstrapComponentProps() {
|
|
79
|
+
const props = {
|
|
80
|
+
...this.$attrs
|
|
81
|
+
};
|
|
82
|
+
if (this.role) props.role = this.role;
|
|
83
|
+
return props;
|
|
84
|
+
},
|
|
73
85
|
iconColorCss() {
|
|
74
86
|
return variantCssColorMap[this.iconColor] || 'gl-fill-icon-default';
|
|
75
87
|
},
|
|
@@ -94,7 +106,7 @@ var script = {
|
|
|
94
106
|
const __vue_script__ = script;
|
|
95
107
|
|
|
96
108
|
/* template */
|
|
97
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c(_vm.bootstrapComponent,_vm._g(_vm._b({tag:"component",staticClass:"gl-dropdown-item"},'component',_vm
|
|
109
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c(_vm.bootstrapComponent,_vm._g(_vm._b({tag:"component",staticClass:"gl-dropdown-item"},'component',_vm.bootstrapComponentProps,false),_vm.$listeners),[(_vm.shouldShowCheckIcon)?_c('gl-icon',{class:['gl-dropdown-item-check-icon', { 'gl-invisible': !_vm.isChecked }, _vm.checkedClasses],attrs:{"name":"mobile-issue-close","data-testid":"dropdown-item-checkbox"}}):_vm._e(),_vm._v(" "),(_vm.iconName)?_c('gl-icon',{class:['gl-dropdown-item-icon', _vm.iconColorCss],attrs:{"name":_vm.iconName}}):_vm._e(),_vm._v(" "),(_vm.avatarUrl)?_c('gl-avatar',{attrs:{"size":32,"src":_vm.avatarUrl}}):_vm._e(),_vm._v(" "),_c('div',{staticClass:"gl-dropdown-item-text-wrapper"},[_c('p',{staticClass:"gl-dropdown-item-text-primary"},[_vm._t("default")],2),_vm._v(" "),(_vm.secondaryText)?_c('p',{staticClass:"gl-dropdown-item-text-secondary"},[_vm._v(_vm._s(_vm.secondaryText))]):_vm._e()]),_vm._v(" "),(_vm.iconRightName)?_c('gl-button',{attrs:{"size":"small","icon":_vm.iconRightName,"aria-label":_vm.iconRightAriaLabel || _vm.iconRightName},on:{"click":function($event){$event.stopPropagation();$event.preventDefault();return _vm.handleClickIconRight.apply(null, arguments)}}}):_vm._e()],1)};
|
|
98
110
|
var __vue_staticRenderFns__ = [];
|
|
99
111
|
|
|
100
112
|
/* style */
|
|
@@ -68,12 +68,13 @@ var script = {
|
|
|
68
68
|
arrowCounter: -1,
|
|
69
69
|
userDismissedResults: false,
|
|
70
70
|
suggestionsId: uniqueId('token-suggestions-'),
|
|
71
|
-
inputId: uniqueId('token-input-')
|
|
71
|
+
inputId: uniqueId('token-input-'),
|
|
72
|
+
dropdownItemComponent: GlDropdownItem
|
|
72
73
|
};
|
|
73
74
|
},
|
|
74
75
|
computed: {
|
|
75
|
-
|
|
76
|
-
return this.showSuggestions.
|
|
76
|
+
isExpanded() {
|
|
77
|
+
return this.showSuggestions && !this.userDismissedResults;
|
|
77
78
|
},
|
|
78
79
|
showAutocomplete() {
|
|
79
80
|
return this.showSuggestions ? 'off' : 'on';
|
|
@@ -140,6 +141,14 @@ var script = {
|
|
|
140
141
|
this.arrowCounter = newCount;
|
|
141
142
|
this.focusItem(newCount);
|
|
142
143
|
},
|
|
144
|
+
onArrowLeft() {
|
|
145
|
+
// don't prevent default, we want the cursor to move
|
|
146
|
+
this.$refs.input.focus();
|
|
147
|
+
},
|
|
148
|
+
onArrowRight() {
|
|
149
|
+
// don't prevent default, we want the cursor to move
|
|
150
|
+
this.$refs.input.focus();
|
|
151
|
+
},
|
|
143
152
|
onEsc() {
|
|
144
153
|
if (!this.showSuggestions) {
|
|
145
154
|
this.$emit('input', '');
|
|
@@ -195,7 +204,7 @@ var script = {
|
|
|
195
204
|
const __vue_script__ = script;
|
|
196
205
|
|
|
197
206
|
/* template */
|
|
198
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-form-combobox dropdown"
|
|
207
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-form-combobox dropdown"},[_c('gl-form-group',{attrs:{"label":_vm.labelText,"label-for":_vm.inputId,"label-sr-only":_vm.labelSrOnly}},[_c('gl-form-input',{ref:"input",attrs:{"id":_vm.inputId,"value":_vm.displayedValue,"type":"text","role":"combobox","aria-expanded":String(_vm.isExpanded),"aria-controls":_vm.suggestionsId,"aria-owns":_vm.isExpanded ? _vm.suggestionsId : null,"aria-autocomplete":"list","aria-haspopup":"listbox","aria-activedescendant":_vm.arrowCounter >= 0 ? (_vm.suggestionsId + "-option-" + _vm.arrowCounter) : undefined,"autofocus":_vm.autofocus,"placeholder":_vm.placeholder},on:{"input":_vm.onEntry,"focus":_vm.resetCounter,"keydown":[function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"down",40,$event.key,["Down","ArrowDown"])){ return null; }return _vm.onArrowDown.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"up",38,$event.key,["Up","ArrowUp"])){ return null; }return _vm.onArrowUp.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"left",37,$event.key,["Left","ArrowLeft"])){ return null; }if('button' in $event && $event.button !== 0){ return null; }return _vm.onArrowLeft.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"right",39,$event.key,["Right","ArrowRight"])){ return null; }if('button' in $event && $event.button !== 2){ return null; }return _vm.onArrowRight.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"esc",27,$event.key,["Esc","Escape"])){ return null; }$event.stopPropagation();return _vm.onEsc.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"tab",9,$event.key,"Tab")){ return null; }return _vm.closeSuggestions.apply(null, arguments)}]}})],1),_vm._v(" "),_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.isExpanded),expression:"isExpanded"}],ref:"suggestionsMenu",staticClass:"dropdown-menu gl-form-combobox-inner gl-mb-0 gl-flex gl-w-full gl-list-none gl-flex-col gl-border-dropdown gl-bg-dropdown gl-pl-0",attrs:{"id":_vm.suggestionsId,"data-testid":"combobox-dropdown","role":"listbox"},on:{"keydown":[function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"down",40,$event.key,["Down","ArrowDown"])){ return null; }return _vm.onArrowDown.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"up",38,$event.key,["Up","ArrowUp"])){ return null; }return _vm.onArrowUp.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"left",37,$event.key,["Left","ArrowLeft"])){ return null; }if('button' in $event && $event.button !== 0){ return null; }return _vm.onArrowLeft.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"right",39,$event.key,["Right","ArrowRight"])){ return null; }if('button' in $event && $event.button !== 2){ return null; }return _vm.onArrowRight.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"esc",27,$event.key,["Esc","Escape"])){ return null; }$event.stopPropagation();return _vm.onEsc.apply(null, arguments)}]}},[_c('div',{staticClass:"gl-overflow-y-auto"},_vm._l((_vm.results),function(result,i){return _c('gl-dropdown-item',{key:i,ref:"results",refInFor:true,attrs:{"id":(_vm.suggestionsId + "-option-" + i),"active":i === _vm.arrowCounter,"tabindex":"-1","role":"option","data-testid":"combobox-result"},on:{"click":function($event){return _vm.selectToken(result)}},nativeOn:{"keydown":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }return _vm.selectToken(result)}}},[_vm._t("result",function(){return [_vm._v(_vm._s(result))]},{"item":result})],2)}),1),_vm._v(" "),(_vm.resultsLength > 0 && _vm.actionList.length > 0)?_c('gl-dropdown-divider',{attrs:{"aria-hidden":"true"}}):_vm._e(),_vm._v(" "),_c('div',_vm._l((_vm.actionList),function(action,i){return _c('gl-dropdown-item',{key:i + _vm.resultsLength,attrs:{"id":(_vm.suggestionsId + "-option-" + (i + _vm.resultsLength)),"active":i + _vm.resultsLength === _vm.arrowCounter,"tabindex":"-1","role":"option","data-testid":"combobox-action"},on:{"click":function($event){return _vm.selectAction(action)},"keydown":[function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"left",37,$event.key,["Left","ArrowLeft"])){ return null; }if('button' in $event && $event.button !== 0){ return null; }return _vm.onArrowLeft.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"right",39,$event.key,["Right","ArrowRight"])){ return null; }if('button' in $event && $event.button !== 2){ return null; }return _vm.onArrowRight.apply(null, arguments)}]},nativeOn:{"keydown":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }return _vm.selectAction(action)}}},[_vm._t("action",function(){return [_vm._v(_vm._s(action.label))]},{"item":action})],2)}),1)],1)],1)};
|
|
199
208
|
var __vue_staticRenderFns__ = [];
|
|
200
209
|
|
|
201
210
|
/* style */
|
|
@@ -5,7 +5,7 @@ import { colorFromDefaultPalette } from '../../../utils/charts/theme';
|
|
|
5
5
|
import { seriesHasAnnotations, isDataPointAnnotation } from '../../../utils/charts/utils';
|
|
6
6
|
import Chart from '../chart/chart';
|
|
7
7
|
import ChartLegend from '../legend/legend';
|
|
8
|
-
import ChartTooltip from '../tooltip/tooltip';
|
|
8
|
+
import ChartTooltip from '../shared/tooltip/tooltip';
|
|
9
9
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
10
10
|
|
|
11
11
|
//
|
|
@@ -5,9 +5,9 @@ import { HEIGHT_AUTO_CLASSES } from '../../../utils/charts/constants';
|
|
|
5
5
|
import { colorFromDefaultPalette } from '../../../utils/charts/theme';
|
|
6
6
|
import { engineeringNotation } from '../../../utils/number_utils';
|
|
7
7
|
import { hexToRgba } from '../../../utils/utils';
|
|
8
|
-
import TooltipDefaultFormat from '
|
|
8
|
+
import TooltipDefaultFormat from '../shared/tooltip/tooltip_default_format/tooltip_default_format';
|
|
9
9
|
import Chart from '../chart/chart';
|
|
10
|
-
import ChartTooltip from '../tooltip/tooltip';
|
|
10
|
+
import ChartTooltip from '../shared/tooltip/tooltip';
|
|
11
11
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
12
12
|
|
|
13
13
|
//
|
|
@@ -4,7 +4,7 @@ import { CHART_TYPE_LINE, HEIGHT_AUTO_CLASSES } from '../../../utils/charts/cons
|
|
|
4
4
|
import { colorFromDefaultPalette } from '../../../utils/charts/theme';
|
|
5
5
|
import { columnOptions } from '../../../utils/constants';
|
|
6
6
|
import Chart from '../chart/chart';
|
|
7
|
-
import ChartTooltip from '../tooltip/tooltip';
|
|
7
|
+
import ChartTooltip from '../shared/tooltip/tooltip';
|
|
8
8
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
9
9
|
|
|
10
10
|
//
|
|
@@ -3,9 +3,9 @@ import { GRAY_200 } from '../../../tokens/build/js/tokens';
|
|
|
3
3
|
import { defaultChartOptions, dataZoomAdjustments, mergeSeriesToOptions } from '../../../utils/charts/config';
|
|
4
4
|
import { colorFromDefaultPalette } from '../../../utils/charts/theme';
|
|
5
5
|
import { HEIGHT_AUTO_CLASSES } from '../../../utils/charts/constants';
|
|
6
|
-
import TooltipDefaultFormat from '
|
|
6
|
+
import TooltipDefaultFormat from '../shared/tooltip/tooltip_default_format/tooltip_default_format';
|
|
7
7
|
import Chart from '../chart/chart';
|
|
8
|
-
import ChartTooltip from '../tooltip/tooltip';
|
|
8
|
+
import ChartTooltip from '../shared/tooltip/tooltip';
|
|
9
9
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
10
10
|
|
|
11
11
|
var script = {
|
|
@@ -4,10 +4,10 @@ import { getTooltipTitle, getTooltipContent } from '../../../utils/charts/config
|
|
|
4
4
|
import { HEIGHT_AUTO_CLASSES } from '../../../utils/charts/constants';
|
|
5
5
|
import { heatmapHues } from '../../../utils/charts/theme';
|
|
6
6
|
import { engineeringNotation } from '../../../utils/number_utils';
|
|
7
|
-
import TooltipDefaultFormat from '
|
|
7
|
+
import TooltipDefaultFormat from '../shared/tooltip/tooltip_default_format/tooltip_default_format';
|
|
8
8
|
import Chart from '../chart/chart';
|
|
9
9
|
import ChartLegend from '../legend/legend';
|
|
10
|
-
import ChartTooltip from '../tooltip/tooltip';
|
|
10
|
+
import ChartTooltip from '../shared/tooltip/tooltip';
|
|
11
11
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
12
12
|
|
|
13
13
|
//
|
|
@@ -6,7 +6,7 @@ import { colorFromDefaultPalette } from '../../../utils/charts/theme';
|
|
|
6
6
|
import { seriesHasAnnotations, isDataPointAnnotation } from '../../../utils/charts/utils';
|
|
7
7
|
import Chart from '../chart/chart';
|
|
8
8
|
import ChartLegend from '../legend/legend';
|
|
9
|
-
import ChartTooltip from '../tooltip/tooltip';
|
|
9
|
+
import ChartTooltip from '../shared/tooltip/tooltip';
|
|
10
10
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
11
11
|
|
|
12
12
|
//
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as echarts from 'echarts';
|
|
2
|
-
import { uid, debounceByAnimationFrame } from '
|
|
3
|
-
import GlPopover from '
|
|
4
|
-
import { popoverPlacements } from '
|
|
5
|
-
import { TOOLTIP_LEFT_OFFSET, TOOLTIP_TOP_OFFSET } from '
|
|
6
|
-
import { getTooltipTitle, getTooltipContent } from '
|
|
7
|
-
import TooltipDefaultFormat from '
|
|
2
|
+
import { uid, debounceByAnimationFrame } from '../../../../utils/utils';
|
|
3
|
+
import GlPopover from '../../../base/popover/popover';
|
|
4
|
+
import { popoverPlacements } from '../../../../utils/constants';
|
|
5
|
+
import { TOOLTIP_LEFT_OFFSET, TOOLTIP_TOP_OFFSET } from '../../../../utils/charts/constants';
|
|
6
|
+
import { getTooltipTitle, getTooltipContent } from '../../../../utils/charts/config';
|
|
7
|
+
import TooltipDefaultFormat from './tooltip_default_format/tooltip_default_format';
|
|
8
8
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
9
9
|
|
|
10
10
|
//
|
|
@@ -5,7 +5,7 @@ import { GlResizeObserverDirective } from '../../../directives/resize_observer/r
|
|
|
5
5
|
import { defaultChartOptions, mergeSeriesToOptions, symbolSize } from '../../../utils/charts/config';
|
|
6
6
|
import { HEIGHT_AUTO_HORIZONTAL_LAYOUT_CLASSES } from '../../../utils/charts/constants';
|
|
7
7
|
import Chart from '../chart/chart';
|
|
8
|
-
import ChartTooltip from '../tooltip/tooltip';
|
|
8
|
+
import ChartTooltip from '../shared/tooltip/tooltip';
|
|
9
9
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
10
10
|
|
|
11
11
|
//
|
|
@@ -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/tooltip/tooltip_default_format/tooltip_default_format';
|
|
6
7
|
import Chart from '../chart/chart';
|
|
7
8
|
import ChartLegend from '../legend/legend';
|
|
8
|
-
import ChartTooltip from '../tooltip/tooltip';
|
|
9
|
-
import TooltipDefaultFormat from '../../shared_components/charts/tooltip_default_format';
|
|
9
|
+
import ChartTooltip from '../shared/tooltip/tooltip';
|
|
10
10
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
11
11
|
|
|
12
12
|
const yAxisDefaults = {
|
|
@@ -13,7 +13,8 @@ const props = makePropsConfigurable({
|
|
|
13
13
|
activeClass: makeProp(PROP_TYPE_STRING, 'active'),
|
|
14
14
|
buttonClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),
|
|
15
15
|
disabled: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
16
|
-
variant: makeProp(PROP_TYPE_STRING)
|
|
16
|
+
variant: makeProp(PROP_TYPE_STRING),
|
|
17
|
+
role: makeProp(PROP_TYPE_STRING, 'menuitem')
|
|
17
18
|
}, NAME_DROPDOWN_ITEM_BUTTON);
|
|
18
19
|
|
|
19
20
|
// --- Main component ---
|
|
@@ -36,9 +37,10 @@ const BDropdownItemButton = /*#__PURE__*/extend({
|
|
|
36
37
|
computedAttrs() {
|
|
37
38
|
return {
|
|
38
39
|
...this.bvAttrs,
|
|
39
|
-
role:
|
|
40
|
+
role: this.role,
|
|
40
41
|
type: 'button',
|
|
41
|
-
disabled: this.disabled
|
|
42
|
+
disabled: this.disabled,
|
|
43
|
+
'aria-selected': this.active ? 'true' : null
|
|
42
44
|
};
|
|
43
45
|
}
|
|
44
46
|
},
|
package/package.json
CHANGED
package/src/charts.js
CHANGED
|
@@ -5,7 +5,6 @@ export { default as GlGaugeChart } from './components/charts/gauge/gauge.vue';
|
|
|
5
5
|
export { default as GlLineChart } from './components/charts/line/line.vue';
|
|
6
6
|
export { default as GlChartLegend } from './components/charts/legend/legend.vue';
|
|
7
7
|
export { default as GlChartSeriesLabel } from './components/charts/series_label/series_label.vue';
|
|
8
|
-
export { default as GlChartTooltip } from './components/charts/tooltip/tooltip.vue';
|
|
9
8
|
export { default as GlHeatmap } from './components/charts/heatmap';
|
|
10
9
|
export { default as GlColumnChart } from './components/charts/column/column.vue';
|
|
11
10
|
export { default as GlStackedColumnChart } from './components/charts/stacked_column/stacked_column.vue';
|
|
@@ -60,6 +60,11 @@ export default {
|
|
|
60
60
|
required: false,
|
|
61
61
|
default: '',
|
|
62
62
|
},
|
|
63
|
+
role: {
|
|
64
|
+
type: String,
|
|
65
|
+
required: false,
|
|
66
|
+
default: null,
|
|
67
|
+
},
|
|
63
68
|
},
|
|
64
69
|
computed: {
|
|
65
70
|
bootstrapComponent() {
|
|
@@ -67,6 +72,11 @@ export default {
|
|
|
67
72
|
// Support 'href' and Vue Router's 'to'
|
|
68
73
|
return href || to ? BDropdownItem : BDropdownItemButton;
|
|
69
74
|
},
|
|
75
|
+
bootstrapComponentProps() {
|
|
76
|
+
const props = { ...this.$attrs };
|
|
77
|
+
if (this.role) props.role = this.role;
|
|
78
|
+
return props;
|
|
79
|
+
},
|
|
70
80
|
iconColorCss() {
|
|
71
81
|
return variantCssColorMap[this.iconColor] || 'gl-fill-icon-default';
|
|
72
82
|
},
|
|
@@ -90,7 +100,12 @@ export default {
|
|
|
90
100
|
</script>
|
|
91
101
|
|
|
92
102
|
<template>
|
|
93
|
-
<component
|
|
103
|
+
<component
|
|
104
|
+
:is="bootstrapComponent"
|
|
105
|
+
class="gl-dropdown-item"
|
|
106
|
+
v-bind="bootstrapComponentProps"
|
|
107
|
+
v-on="$listeners"
|
|
108
|
+
>
|
|
94
109
|
<gl-icon
|
|
95
110
|
v-if="shouldShowCheckIcon"
|
|
96
111
|
name="mobile-issue-close"
|
|
@@ -70,11 +70,12 @@ export default {
|
|
|
70
70
|
userDismissedResults: false,
|
|
71
71
|
suggestionsId: uniqueId('token-suggestions-'),
|
|
72
72
|
inputId: uniqueId('token-input-'),
|
|
73
|
+
dropdownItemComponent: GlDropdownItem,
|
|
73
74
|
};
|
|
74
75
|
},
|
|
75
76
|
computed: {
|
|
76
|
-
|
|
77
|
-
return this.showSuggestions.
|
|
77
|
+
isExpanded() {
|
|
78
|
+
return this.showSuggestions && !this.userDismissedResults;
|
|
78
79
|
},
|
|
79
80
|
showAutocomplete() {
|
|
80
81
|
return this.showSuggestions ? 'off' : 'on';
|
|
@@ -149,6 +150,14 @@ export default {
|
|
|
149
150
|
this.arrowCounter = newCount;
|
|
150
151
|
this.focusItem(newCount);
|
|
151
152
|
},
|
|
153
|
+
onArrowLeft() {
|
|
154
|
+
// don't prevent default, we want the cursor to move
|
|
155
|
+
this.$refs.input.focus();
|
|
156
|
+
},
|
|
157
|
+
onArrowRight() {
|
|
158
|
+
// don't prevent default, we want the cursor to move
|
|
159
|
+
this.$refs.input.focus();
|
|
160
|
+
},
|
|
152
161
|
onEsc() {
|
|
153
162
|
if (!this.showSuggestions) {
|
|
154
163
|
this.$emit('input', '');
|
|
@@ -202,79 +211,88 @@ export default {
|
|
|
202
211
|
},
|
|
203
212
|
};
|
|
204
213
|
</script>
|
|
214
|
+
|
|
205
215
|
<template>
|
|
206
|
-
<div
|
|
207
|
-
class="gl-form-combobox dropdown"
|
|
208
|
-
role="combobox"
|
|
209
|
-
:aria-owns="suggestionsId"
|
|
210
|
-
:aria-expanded="ariaExpanded"
|
|
211
|
-
>
|
|
216
|
+
<div class="gl-form-combobox dropdown">
|
|
212
217
|
<gl-form-group :label="labelText" :label-for="inputId" :label-sr-only="labelSrOnly">
|
|
213
218
|
<gl-form-input
|
|
214
219
|
:id="inputId"
|
|
220
|
+
ref="input"
|
|
215
221
|
:value="displayedValue"
|
|
216
222
|
type="text"
|
|
217
|
-
role="
|
|
218
|
-
:
|
|
219
|
-
aria-autocomplete="list"
|
|
223
|
+
role="combobox"
|
|
224
|
+
:aria-expanded="String(isExpanded)"
|
|
220
225
|
:aria-controls="suggestionsId"
|
|
226
|
+
:aria-owns="isExpanded ? suggestionsId : null"
|
|
227
|
+
aria-autocomplete="list"
|
|
221
228
|
aria-haspopup="listbox"
|
|
229
|
+
:aria-activedescendant="
|
|
230
|
+
arrowCounter >= 0 ? `${suggestionsId}-option-${arrowCounter}` : undefined
|
|
231
|
+
"
|
|
222
232
|
:autofocus="autofocus"
|
|
223
233
|
:placeholder="placeholder"
|
|
224
234
|
@input="onEntry"
|
|
225
235
|
@focus="resetCounter"
|
|
226
236
|
@keydown.down="onArrowDown"
|
|
227
237
|
@keydown.up="onArrowUp"
|
|
238
|
+
@keydown.left="onArrowLeft"
|
|
239
|
+
@keydown.right="onArrowRight"
|
|
228
240
|
@keydown.esc.stop="onEsc"
|
|
229
241
|
@keydown.tab="closeSuggestions"
|
|
230
242
|
/>
|
|
231
243
|
</gl-form-group>
|
|
232
244
|
|
|
233
|
-
<
|
|
234
|
-
v-show="
|
|
245
|
+
<div
|
|
246
|
+
v-show="isExpanded"
|
|
235
247
|
:id="suggestionsId"
|
|
236
248
|
ref="suggestionsMenu"
|
|
237
249
|
data-testid="combobox-dropdown"
|
|
250
|
+
role="listbox"
|
|
238
251
|
class="dropdown-menu gl-form-combobox-inner gl-mb-0 gl-flex gl-w-full gl-list-none gl-flex-col gl-border-dropdown gl-bg-dropdown gl-pl-0"
|
|
239
252
|
@keydown.down="onArrowDown"
|
|
240
253
|
@keydown.up="onArrowUp"
|
|
254
|
+
@keydown.left="onArrowLeft"
|
|
255
|
+
@keydown.right="onArrowRight"
|
|
241
256
|
@keydown.esc.stop="onEsc"
|
|
242
257
|
>
|
|
243
|
-
<
|
|
244
|
-
<
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
</
|
|
259
|
-
</
|
|
260
|
-
|
|
261
|
-
<
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
258
|
+
<div class="gl-overflow-y-auto">
|
|
259
|
+
<gl-dropdown-item
|
|
260
|
+
v-for="(result, i) in results"
|
|
261
|
+
:id="`${suggestionsId}-option-${i}`"
|
|
262
|
+
ref="results"
|
|
263
|
+
:key="i"
|
|
264
|
+
:active="i === arrowCounter"
|
|
265
|
+
tabindex="-1"
|
|
266
|
+
role="option"
|
|
267
|
+
data-testid="combobox-result"
|
|
268
|
+
@click="selectToken(result)"
|
|
269
|
+
@keydown.enter.native="selectToken(result)"
|
|
270
|
+
>
|
|
271
|
+
<!-- @slot The suggestion result item to display. -->
|
|
272
|
+
<slot name="result" :item="result">{{ result }}</slot>
|
|
273
|
+
</gl-dropdown-item>
|
|
274
|
+
</div>
|
|
275
|
+
|
|
276
|
+
<gl-dropdown-divider v-if="resultsLength > 0 && actionList.length > 0" aria-hidden="true" />
|
|
277
|
+
|
|
278
|
+
<div>
|
|
279
|
+
<gl-dropdown-item
|
|
280
|
+
v-for="(action, i) in actionList"
|
|
281
|
+
:id="`${suggestionsId}-option-${i + resultsLength}`"
|
|
282
|
+
:key="i + resultsLength"
|
|
283
|
+
:active="i + resultsLength === arrowCounter"
|
|
284
|
+
tabindex="-1"
|
|
285
|
+
role="option"
|
|
286
|
+
data-testid="combobox-action"
|
|
287
|
+
@click="selectAction(action)"
|
|
288
|
+
@keydown.enter.native="selectAction(action)"
|
|
289
|
+
@keydown.left="onArrowLeft"
|
|
290
|
+
@keydown.right="onArrowRight"
|
|
291
|
+
>
|
|
292
|
+
<!-- @slot The action item to display. -->
|
|
293
|
+
<slot name="action" :item="action">{{ action.label }}</slot>
|
|
294
|
+
</gl-dropdown-item>
|
|
295
|
+
</div>
|
|
296
|
+
</div>
|
|
279
297
|
</div>
|
|
280
298
|
</template>
|
|
@@ -41,7 +41,7 @@ import { colorFromDefaultPalette } from '../../../utils/charts/theme';
|
|
|
41
41
|
import { seriesHasAnnotations, isDataPointAnnotation } from '../../../utils/charts/utils';
|
|
42
42
|
import Chart from '../chart/chart.vue';
|
|
43
43
|
import ChartLegend from '../legend/legend.vue';
|
|
44
|
-
import ChartTooltip from '../tooltip/tooltip.vue';
|
|
44
|
+
import ChartTooltip from '../shared/tooltip/tooltip.vue';
|
|
45
45
|
|
|
46
46
|
export default {
|
|
47
47
|
name: 'GlAreaChart',
|
|
@@ -7,9 +7,9 @@ import { HEIGHT_AUTO_CLASSES } from '../../../utils/charts/constants';
|
|
|
7
7
|
import { colorFromDefaultPalette } from '../../../utils/charts/theme';
|
|
8
8
|
import { engineeringNotation } from '../../../utils/number_utils';
|
|
9
9
|
import { hexToRgba } from '../../../utils/utils';
|
|
10
|
-
import TooltipDefaultFormat from '
|
|
10
|
+
import TooltipDefaultFormat from '../shared/tooltip/tooltip_default_format/tooltip_default_format.vue';
|
|
11
11
|
import Chart from '../chart/chart.vue';
|
|
12
|
-
import ChartTooltip from '../tooltip/tooltip.vue';
|
|
12
|
+
import ChartTooltip from '../shared/tooltip/tooltip.vue';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* `nameGap` in charts/config is set to 50 but it is not
|
|
@@ -15,7 +15,7 @@ import { CHART_TYPE_LINE, HEIGHT_AUTO_CLASSES } from '../../../utils/charts/cons
|
|
|
15
15
|
import { colorFromDefaultPalette } from '../../../utils/charts/theme';
|
|
16
16
|
import { columnOptions } from '../../../utils/constants';
|
|
17
17
|
import Chart from '../chart/chart.vue';
|
|
18
|
-
import ChartTooltip from '../tooltip/tooltip.vue';
|
|
18
|
+
import ChartTooltip from '../shared/tooltip/tooltip.vue';
|
|
19
19
|
|
|
20
20
|
const yAxisDefaults = {
|
|
21
21
|
...yAxis,
|
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
} from '../../../utils/charts/config';
|
|
9
9
|
import { colorFromDefaultPalette } from '../../../utils/charts/theme';
|
|
10
10
|
import { HEIGHT_AUTO_CLASSES } from '../../../utils/charts/constants';
|
|
11
|
-
import TooltipDefaultFormat from '
|
|
11
|
+
import TooltipDefaultFormat from '../shared/tooltip/tooltip_default_format/tooltip_default_format.vue';
|
|
12
12
|
import Chart from '../chart/chart.vue';
|
|
13
|
-
import ChartTooltip from '../tooltip/tooltip.vue';
|
|
13
|
+
import ChartTooltip from '../shared/tooltip/tooltip.vue';
|
|
14
14
|
|
|
15
15
|
export default {
|
|
16
16
|
name: 'GlDiscreteScatterChart',
|
|
@@ -6,10 +6,10 @@ import { getTooltipTitle, getTooltipContent } from '../../../utils/charts/config
|
|
|
6
6
|
import { HEIGHT_AUTO_CLASSES } from '../../../utils/charts/constants';
|
|
7
7
|
import { heatmapHues } from '../../../utils/charts/theme';
|
|
8
8
|
import { engineeringNotation } from '../../../utils/number_utils';
|
|
9
|
-
import TooltipDefaultFormat from '
|
|
9
|
+
import TooltipDefaultFormat from '../shared/tooltip/tooltip_default_format/tooltip_default_format.vue';
|
|
10
10
|
import Chart from '../chart/chart.vue';
|
|
11
11
|
import ChartLegend from '../legend/legend.vue';
|
|
12
|
-
import ChartTooltip from '../tooltip/tooltip.vue';
|
|
12
|
+
import ChartTooltip from '../shared/tooltip/tooltip.vue';
|
|
13
13
|
|
|
14
14
|
const defaultOptions = {
|
|
15
15
|
visualMap: {
|
|
@@ -44,7 +44,7 @@ import { colorFromDefaultPalette } from '../../../utils/charts/theme';
|
|
|
44
44
|
import { seriesHasAnnotations, isDataPointAnnotation } from '../../../utils/charts/utils';
|
|
45
45
|
import Chart from '../chart/chart.vue';
|
|
46
46
|
import ChartLegend from '../legend/legend.vue';
|
|
47
|
-
import ChartTooltip from '../tooltip/tooltip.vue';
|
|
47
|
+
import ChartTooltip from '../shared/tooltip/tooltip.vue';
|
|
48
48
|
|
|
49
49
|
export default {
|
|
50
50
|
name: 'GlLineChart',
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
<!-- eslint-disable vue/multi-word-component-names -->
|
|
2
2
|
<script>
|
|
3
3
|
import * as echarts from 'echarts';
|
|
4
|
-
import { uid, debounceByAnimationFrame } from '
|
|
5
|
-
import GlPopover from '
|
|
6
|
-
import { popoverPlacements } from '
|
|
7
|
-
import { TOOLTIP_LEFT_OFFSET, TOOLTIP_TOP_OFFSET } from '
|
|
8
|
-
import { getTooltipTitle, getTooltipContent } from '
|
|
9
|
-
|
|
4
|
+
import { uid, debounceByAnimationFrame } from '../../../../utils/utils';
|
|
5
|
+
import GlPopover from '../../../base/popover/popover.vue';
|
|
6
|
+
import { popoverPlacements } from '../../../../utils/constants';
|
|
7
|
+
import { TOOLTIP_LEFT_OFFSET, TOOLTIP_TOP_OFFSET } from '../../../../utils/charts/constants';
|
|
8
|
+
import { getTooltipTitle, getTooltipContent } from '../../../../utils/charts/config';
|
|
9
|
+
|
|
10
|
+
import TooltipDefaultFormat from './tooltip_default_format/tooltip_default_format.vue';
|
|
10
11
|
|
|
11
12
|
export default {
|
|
12
13
|
name: 'GlChartTooltip',
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from '../../../utils/charts/config';
|
|
12
12
|
import { HEIGHT_AUTO_HORIZONTAL_LAYOUT_CLASSES } from '../../../utils/charts/constants';
|
|
13
13
|
import Chart from '../chart/chart.vue';
|
|
14
|
-
import ChartTooltip from '../tooltip/tooltip.vue';
|
|
14
|
+
import ChartTooltip from '../shared/tooltip/tooltip.vue';
|
|
15
15
|
|
|
16
16
|
// the padding is needed so the mark points don't overflow when visible
|
|
17
17
|
const gridPadding = symbolSize / 2;
|
|
@@ -22,10 +22,10 @@ import {
|
|
|
22
22
|
} from '../../../utils/charts/constants';
|
|
23
23
|
import { colorFromDefaultPalette } from '../../../utils/charts/theme';
|
|
24
24
|
import { columnOptions } from '../../../utils/constants';
|
|
25
|
+
import TooltipDefaultFormat from '../shared/tooltip/tooltip_default_format/tooltip_default_format.vue';
|
|
25
26
|
import Chart from '../chart/chart.vue';
|
|
26
27
|
import ChartLegend from '../legend/legend.vue';
|
|
27
|
-
import ChartTooltip from '../tooltip/tooltip.vue';
|
|
28
|
-
import TooltipDefaultFormat from '../../shared_components/charts/tooltip_default_format.vue';
|
|
28
|
+
import ChartTooltip from '../shared/tooltip/tooltip.vue';
|
|
29
29
|
|
|
30
30
|
const yAxisDefaults = {
|
|
31
31
|
...yAxis,
|
package/src/scss/components.scss
CHANGED
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
@import '../components/charts/legend/legend';
|
|
70
70
|
@import '../components/charts/series_label/series_label';
|
|
71
71
|
@import '../components/charts/single_stat/single_stat';
|
|
72
|
-
@import '../components/charts/tooltip/tooltip';
|
|
73
|
-
@import '../components/
|
|
72
|
+
@import '../components/charts/shared/tooltip/tooltip';
|
|
73
|
+
@import '../components/charts/shared/tooltip/tooltip_default_format/tooltip_default_format';
|
|
74
74
|
@import '../components/utilities/truncate/truncate';
|
|
75
75
|
@import '../components/utilities/truncate_text/truncate_text';
|
|
76
76
|
@import '../components/base/new_dropdowns/dropdown';
|
|
@@ -18,7 +18,8 @@ export const props = makePropsConfigurable(
|
|
|
18
18
|
activeClass: makeProp(PROP_TYPE_STRING, 'active'),
|
|
19
19
|
buttonClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),
|
|
20
20
|
disabled: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
21
|
-
variant: makeProp(PROP_TYPE_STRING)
|
|
21
|
+
variant: makeProp(PROP_TYPE_STRING),
|
|
22
|
+
role: makeProp(PROP_TYPE_STRING, 'menuitem')
|
|
22
23
|
},
|
|
23
24
|
NAME_DROPDOWN_ITEM_BUTTON
|
|
24
25
|
)
|
|
@@ -42,9 +43,10 @@ export const BDropdownItemButton = /*#__PURE__*/ extend({
|
|
|
42
43
|
computedAttrs() {
|
|
43
44
|
return {
|
|
44
45
|
...this.bvAttrs,
|
|
45
|
-
role:
|
|
46
|
+
role: this.role,
|
|
46
47
|
type: 'button',
|
|
47
|
-
disabled: this.disabled
|
|
48
|
+
disabled: this.disabled,
|
|
49
|
+
'aria-selected': this.active ? 'true' : null
|
|
48
50
|
}
|
|
49
51
|
}
|
|
50
52
|
},
|
|
File without changes
|
|
File without changes
|