@gitlab/ui 138.6.0 → 138.6.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/dist/components/base/breadcrumb/breadcrumb.js +3 -1
- package/dist/components/base/button/button.js +9 -2
- package/dist/components/charts/legend/legend.js +3 -3
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/package.json +2 -2
- package/src/components/base/breadcrumb/breadcrumb.vue +2 -1
- package/src/components/base/button/button.vue +9 -2
- package/src/components/charts/legend/legend.scss +21 -0
- package/src/components/charts/legend/legend.vue +9 -7
- package/dist/components/mixins/safe_link_mixin.js +0 -30
- package/src/components/mixins/safe_link_mixin.js +0 -28
|
@@ -189,7 +189,9 @@ var script = {
|
|
|
189
189
|
// Wait for DOM update so all items get rendered and can be measured.
|
|
190
190
|
await this.$nextTick();
|
|
191
191
|
this.totalBreadcrumbsWidth = 0;
|
|
192
|
-
|
|
192
|
+
|
|
193
|
+
// The component can unmount, or drop the dropdown, while waiting for the DOM update.
|
|
194
|
+
if (!this.$refs.breadcrumbs || !this.$refs.dropdown) return;
|
|
193
195
|
this.$refs.breadcrumbs.forEach((b, index) => {
|
|
194
196
|
const width = b.$el.clientWidth;
|
|
195
197
|
this.totalBreadcrumbsWidth += width;
|
|
@@ -2,7 +2,7 @@ import GlLink from '../link/link';
|
|
|
2
2
|
import { buttonCategoryOptions, buttonVariantOptions, buttonSizeOptions, linkVariantUnstyled } from '../../../utils/constants';
|
|
3
3
|
import { logWarning, stopEvent } from '../../../utils/utils';
|
|
4
4
|
import { isSlotEmpty } from '../../../utils/is_slot_empty';
|
|
5
|
-
import {
|
|
5
|
+
import { SafeLinkDirective } from '../../../directives/safe_link/safe_link';
|
|
6
6
|
import { glButtonConfig } from '../../../config';
|
|
7
7
|
import GlIcon from '../icon/icon';
|
|
8
8
|
import GlLoadingIcon from '../loading_icon/loading_icon';
|
|
@@ -15,7 +15,9 @@ var script = {
|
|
|
15
15
|
GlIcon,
|
|
16
16
|
GlLoadingIcon
|
|
17
17
|
},
|
|
18
|
-
|
|
18
|
+
directives: {
|
|
19
|
+
SafeLink: SafeLinkDirective
|
|
20
|
+
},
|
|
19
21
|
props: {
|
|
20
22
|
/**
|
|
21
23
|
* Set the category of the button.
|
|
@@ -234,6 +236,11 @@ var script = {
|
|
|
234
236
|
}
|
|
235
237
|
},
|
|
236
238
|
computed: {
|
|
239
|
+
safeLinkConfig() {
|
|
240
|
+
return {
|
|
241
|
+
skipSanitization: this.isUnsafeLink
|
|
242
|
+
};
|
|
243
|
+
},
|
|
237
244
|
hasIcon() {
|
|
238
245
|
return this.icon !== '';
|
|
239
246
|
},
|
|
@@ -272,18 +272,18 @@ var script = {
|
|
|
272
272
|
const __vue_script__ = script;
|
|
273
273
|
|
|
274
274
|
/* template */
|
|
275
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-legend",attrs:{"data-testid":"gl-chart-legend"}},[(_vm.layout === _vm.$options.legendLayoutTypes.LEGEND_LAYOUT_INLINE)?[_c('div',{ref:"inlineLegendEl",staticClass:"gl-legend-inline",class:{ 'gl-legend-b-fade': _vm.shouldApplyFadeClass }},_vm._l((_vm.seriesInfo),function(series,key){return _c('
|
|
275
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-legend",attrs:{"data-testid":"gl-chart-legend"}},[(_vm.layout === _vm.$options.legendLayoutTypes.LEGEND_LAYOUT_INLINE)?[_c('div',{ref:"inlineLegendEl",staticClass:"gl-legend-inline",class:{ 'gl-legend-b-fade': _vm.shouldApplyFadeClass }},_vm._l((_vm.seriesInfo),function(series,key){return _c('button',{key:key,staticClass:"gl-legend-inline-series",class:{
|
|
276
276
|
'gl-text-subtle': _vm.disabledSeries[key],
|
|
277
277
|
'gl-text-strong': !_vm.disabledSeries[key],
|
|
278
278
|
'gl-w-full': _vm.seriesNameIsLong(series.name),
|
|
279
279
|
'hover:!gl-cursor-not-allowed':
|
|
280
280
|
_vm.hasOneSeriesElement || _vm.isToggleDisabled(series.name, series.disabled),
|
|
281
|
-
},style:(_vm.fontStyle),attrs:{"aria-disabled":_vm.hasOneSeriesElement || _vm.isToggleDisabled(series.name, series.disabled)
|
|
281
|
+
},style:(_vm.fontStyle),attrs:{"type":"button","aria-pressed":String(!_vm.disabledSeries[key]),"aria-disabled":_vm.hasOneSeriesElement || _vm.isToggleDisabled(series.name, series.disabled)},on:{"click":function($event){return _vm.handleClick(series, key)},"mouseenter":function($event){return _vm.handleMouseEnter(series.name)},"mouseleave":function($event){return _vm.handleMouseLeave(series.name)}}},[_c('gl-chart-series-label',{staticClass:"gl-legend-inline-series-label",class:{ 'gl-w-3/4': _vm.seriesNameIsLong(series.name) },attrs:{"color":_vm.getColor(series.color, key),"type":series.type}},[_c('gl-truncate',{staticClass:"gl-font-bold",attrs:{"text":series.name}})],1),_vm._v(" "),(series.data && series.data.length)?_c('span',{class:{ 'gl-whitespace-nowrap': _vm.seriesNameIsLong(series.name) }},[_vm._v("\n "+_vm._s(_vm.averageText)+": "+_vm._s(_vm.seriesAverage(series.data))+" · "+_vm._s(_vm.maxText)+":\n "+_vm._s(_vm.seriesMax(series.data))+"\n ")]):_vm._e()],1)}),0)]:_vm._e(),_vm._v(" "),(_vm.layout === _vm.$options.legendLayoutTypes.LEGEND_LAYOUT_TABLE)?[_c('div',{staticClass:"gl-legend-tabular gl-legend-b-fade",style:(_vm.fontStyle)},[_c('header',{staticClass:"gl-legend-tabular-header"},[_c('div',{staticClass:"gl-legend-tabular-header-cell"},[_vm._v(_vm._s(_vm.minText))]),_vm._v(" "),_c('div',{staticClass:"gl-legend-tabular-header-cell"},[_vm._v(_vm._s(_vm.maxText))]),_vm._v(" "),_c('div',{staticClass:"gl-legend-tabular-header-cell"},[_vm._v(_vm._s(_vm.averageText))]),_vm._v(" "),_c('div',{staticClass:"gl-legend-tabular-header-cell"},[_vm._v(_vm._s(_vm.currentText))])]),_vm._v(" "),_c('section',{staticClass:"gl-legend-tabular-body"},_vm._l((_vm.seriesInfo),function(series,key){return _c('button',{key:key,staticClass:"gl-legend-tabular-row",class:{
|
|
282
282
|
'gl-text-subtle': _vm.disabledSeries[key],
|
|
283
283
|
'gl-text-strong': !_vm.disabledSeries[key],
|
|
284
284
|
'hover:!gl-cursor-not-allowed':
|
|
285
285
|
_vm.hasOneSeriesElement || _vm.isToggleDisabled(series.name, series.disabled),
|
|
286
|
-
},style:(_vm.fontStyle),attrs:{"aria-disabled":_vm.isToggleDisabled(series.name, series.disabled)
|
|
286
|
+
},style:(_vm.fontStyle),attrs:{"type":"button","aria-pressed":String(!_vm.disabledSeries[key]),"aria-disabled":_vm.hasOneSeriesElement || _vm.isToggleDisabled(series.name, series.disabled)},on:{"click":function($event){return _vm.handleClick(series, key)},"mouseenter":function($event){return _vm.handleMouseEnter(series.name)},"mouseleave":function($event){return _vm.handleMouseLeave(series.name)}}},[_c('div',{staticClass:"gl-legend-tabular-title-cell"},[_c('gl-chart-series-label',{style:(_vm.fontStyle),attrs:{"color":_vm.getColor(series.color, key),"type":series.type}},[_c('gl-truncate',{staticClass:"gl-font-bold",attrs:{"text":series.name}})],1)],1),_vm._v(" "),(_vm.sanitizeSeriesData(series.data).length)?[_c('div',{staticClass:"gl-legend-tabular-details-cell"},[_vm._v(_vm._s(_vm.seriesMin(series.data)))]),_vm._v(" "),_c('div',{staticClass:"gl-legend-tabular-details-cell"},[_vm._v(_vm._s(_vm.seriesMax(series.data)))]),_vm._v(" "),_c('div',{staticClass:"gl-legend-tabular-details-cell"},[_vm._v(_vm._s(_vm.seriesAverage(series.data)))]),_vm._v(" "),_c('div',{staticClass:"gl-legend-tabular-details-cell"},[_vm._v(_vm._s(_vm.seriesLast(series.data)))])]:[_c('div',{staticClass:"gl-legend-tabular-details-cell"},[_vm._v("-")]),_vm._v(" "),_c('div',{staticClass:"gl-legend-tabular-details-cell"},[_vm._v("-")]),_vm._v(" "),_c('div',{staticClass:"gl-legend-tabular-details-cell"},[_vm._v("-")]),_vm._v(" "),_c('div',{staticClass:"gl-legend-tabular-details-cell"},[_vm._v("-")])]],2)}),0)])]:_vm._e()],2)};
|
|
287
287
|
var __vue_staticRenderFns__ = [];
|
|
288
288
|
|
|
289
289
|
/* style */
|