@gitlab/ui 128.2.3 → 128.4.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/dist/components/base/breadcrumb/breadcrumb.js +12 -1
- package/dist/components/base/form/form_fields/form_fields.js +8 -3
- package/dist/components/base/form/form_group/form_group.js +1 -1
- package/dist/components/base/popover/popover.js +3 -3
- package/dist/components/base/token_selector/token_selector.js +2 -2
- package/dist/components/mixins/tooltip_mixin.js +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/vendor/bootstrap-vue/src/components/tooltip/tooltip.js +9 -22
- package/package.json +5 -5
- package/src/components/base/breadcrumb/breadcrumb.scss +5 -2
- package/src/components/base/breadcrumb/breadcrumb.vue +20 -3
- package/src/components/base/form/form_fields/form_fields.vue +8 -3
- package/src/components/base/form/form_group/form_group.vue +1 -1
- package/src/components/base/popover/popover.vue +3 -3
- package/src/components/base/token_selector/token_selector.vue +2 -2
- package/src/components/mixins/tooltip_mixin.js +1 -1
- package/src/vendor/bootstrap-vue/src/components/tooltip/tooltip.js +8 -21
- package/dist/utils/unique_id.js +0 -18
- package/src/utils/unique_id.js +0 -17
|
@@ -158,12 +158,21 @@ var script = {
|
|
|
158
158
|
} else {
|
|
159
159
|
this.resizeDone = true;
|
|
160
160
|
}
|
|
161
|
-
this.
|
|
161
|
+
this.updateClipboardButtonWidth();
|
|
162
162
|
},
|
|
163
163
|
beforeDestroy() {
|
|
164
164
|
this.disableAutoResize();
|
|
165
165
|
},
|
|
166
166
|
methods: {
|
|
167
|
+
updateClipboardButtonWidth() {
|
|
168
|
+
if (!this.showClipboardButton) {
|
|
169
|
+
this.clipboardButtonWidth = 0;
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
const element = this.$refs.clipboardButton.$el;
|
|
173
|
+
const marginLeft = parseInt(getComputedStyle(element).marginLeft, 10);
|
|
174
|
+
this.clipboardButtonWidth = element.offsetWidth + marginLeft;
|
|
175
|
+
},
|
|
167
176
|
resetItems() {
|
|
168
177
|
this.fittingItems = [...this.items];
|
|
169
178
|
this.overflowingItems = [];
|
|
@@ -209,6 +218,8 @@ var script = {
|
|
|
209
218
|
if (widthNeeded + this.dropdownWidth < containerWidth) break;
|
|
210
219
|
}
|
|
211
220
|
}
|
|
221
|
+
const truncatedItemMaxWidth = Math.max(0, containerWidth - (this.dropdownWidth + this.clipboardButtonWidth));
|
|
222
|
+
this.$el.style.setProperty('--gl-breadcrumb-truncated-item-max-width', `${truncatedItemMaxWidth}px`);
|
|
212
223
|
this.resizeDone = true;
|
|
213
224
|
},
|
|
214
225
|
isLastItem(index) {
|
|
@@ -27,11 +27,12 @@ var script = {
|
|
|
27
27
|
*
|
|
28
28
|
* @typedef {object} FieldDefinition
|
|
29
29
|
* @template TValue=string
|
|
30
|
-
* @property {string} label - Label text to show for this field.
|
|
30
|
+
* @property {string | null | undefined} label - Label text to show for this field. When explicitly set to null, the label is suppressed. When undefined or not provided, the field name is used as the label.
|
|
31
31
|
* @property {undefined | Object} groupAttrs - Properties that are passed to the group wrapping this field.
|
|
32
32
|
* @property {undefined | Object} inputAttrs - Properties that are passed to the actual input for this field.
|
|
33
33
|
* @property {undefined | function(string): TValue} mapValue - Function that maps the inputted string value to the field's actual value (e.g. a Number).
|
|
34
34
|
* @property {undefined | Array<function(TValue): string | undefined>=} validators - Collection of validator functions.
|
|
35
|
+
* @property {undefined | boolean} fieldset - When true, renders the form group as a fieldset with legend instead of div with label.
|
|
35
36
|
*
|
|
36
37
|
* @type {{ [key: string]: FieldDefinition }}
|
|
37
38
|
*/
|
|
@@ -130,7 +131,7 @@ var script = {
|
|
|
130
131
|
return {
|
|
131
132
|
...field,
|
|
132
133
|
id,
|
|
133
|
-
label: field
|
|
134
|
+
label: this.getFieldLabel(field, fieldName),
|
|
134
135
|
inputSlot,
|
|
135
136
|
groupPassthroughSlots,
|
|
136
137
|
afterSlotName
|
|
@@ -168,6 +169,10 @@ var script = {
|
|
|
168
169
|
await this.$nextTick();
|
|
169
170
|
return this.hasAllFieldsValid();
|
|
170
171
|
},
|
|
172
|
+
getFieldLabel(field, fieldName) {
|
|
173
|
+
if (field.label === null) return undefined;
|
|
174
|
+
return field.label || fieldName;
|
|
175
|
+
},
|
|
171
176
|
getMappedValue(fieldName, val) {
|
|
172
177
|
const field = this.fields[fieldName];
|
|
173
178
|
if (isFunction(field === null || field === void 0 ? void 0 : field.mapValue)) {
|
|
@@ -248,7 +253,7 @@ const __vue_script__ = script;
|
|
|
248
253
|
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-form-fields-loop',{attrs:{"fields":_vm.fieldsToRender},scopedSlots:_vm._u([{key:"default",fn:function(ref){
|
|
249
254
|
var field = ref.field;
|
|
250
255
|
var fieldName = ref.fieldName;
|
|
251
|
-
return [_c('gl-form-group',_vm._b({key:field.id,attrs:{"label":field.label,"label-for":field.id,"invalid-feedback":_vm.fieldValidationProps[fieldName].invalidFeedback,"state":_vm.fieldValidationProps[fieldName].state},scopedSlots:_vm._u([_vm._l((field.groupPassthroughSlots),function(ref){
|
|
256
|
+
return [_c('gl-form-group',_vm._b({key:field.id,attrs:{"label":field.label,"label-for":field.fieldset ? undefined : field.id,"invalid-feedback":_vm.fieldValidationProps[fieldName].invalidFeedback,"state":_vm.fieldValidationProps[fieldName].state},scopedSlots:_vm._u([_vm._l((field.groupPassthroughSlots),function(ref){
|
|
252
257
|
var slotName = ref.slotName;
|
|
253
258
|
var childSlotName = ref.childSlotName;
|
|
254
259
|
return {key:childSlotName,fn:function(){return [_vm._t(slotName)]},proxy:true}})],null,true)},'gl-form-group',field.groupAttrs,false),[_c('gl-form-field-validator',{attrs:{"value":_vm.fieldValues[fieldName],"validators":field.validators,"should-validate":_vm.fieldDirtyStatuses[fieldName]},on:{"update":function($event){return _vm.onFieldValidationUpdate(fieldName, $event)}}}),_vm._v(" "),_vm._v(" "),_vm._t(field.inputSlot.slotName,function(){return [_c('gl-form-input',_vm._b({attrs:{"id":field.id,"value":_vm.fieldValues[fieldName],"state":_vm.fieldValidationProps[fieldName].state},on:{"input":function($event){return _vm.onFieldInput(fieldName, $event)},"blur":function($event){return _vm.onFieldBlur(fieldName)}}},'gl-form-input',field.inputAttrs,false))]},null,field.inputSlot.attrs)],2),_vm._v(" "),_vm._t(field.afterSlotName)]}}],null,true)})};
|
|
@@ -77,7 +77,7 @@ var script = {
|
|
|
77
77
|
const __vue_script__ = script;
|
|
78
78
|
|
|
79
79
|
/* template */
|
|
80
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-form-group',_vm._b({staticClass:"gl-form-group",attrs:{"label-class":_vm.actualLabelClass},scopedSlots:_vm._u([{key:"label",fn:function(){return [_vm._t("label",function(){return [_vm._v("\n "+_vm._s(_vm.$attrs.label)+"\n "),(_vm.optional)?_c('span',{staticClass:"optional-label",attrs:{"data-testid":"optional-label"}},[_vm._v(_vm._s(_vm.optionalText))]):_vm._e()]}),_vm._v(" "),(_vm.hasLabelDescription)?_c('div',{staticClass:"label-description",attrs:{"data-testid":"label-description"}},[_vm._t("label-description",function(){return [_vm._v(_vm._s(_vm.labelDescription))]})],2):_vm._e()]},proxy:true},_vm._l((Object.keys(_vm.$slots)),function(slot){return {key:slot,fn:function(){return [_vm._t(slot)]},proxy:true}})],null,true)},'b-form-group',_vm.$attrs,false))};
|
|
80
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-form-group',_vm._b({staticClass:"gl-form-group",attrs:{"label-class":_vm.actualLabelClass},scopedSlots:_vm._u([(_vm.$attrs.label || _vm.$scopedSlots.label)?{key:"label",fn:function(){return [_vm._t("label",function(){return [_vm._v("\n "+_vm._s(_vm.$attrs.label)+"\n "),(_vm.optional)?_c('span',{staticClass:"optional-label",attrs:{"data-testid":"optional-label"}},[_vm._v(_vm._s(_vm.optionalText))]):_vm._e()]}),_vm._v(" "),(_vm.hasLabelDescription)?_c('div',{staticClass:"label-description",attrs:{"data-testid":"label-description"}},[_vm._t("label-description",function(){return [_vm._v(_vm._s(_vm.labelDescription))]})],2):_vm._e()]},proxy:true}:null,_vm._l((Object.keys(_vm.$slots)),function(slot){return {key:slot,fn:function(){return [_vm._t(slot)]},proxy:true}})],null,true)},'b-form-group',_vm.$attrs,false))};
|
|
81
81
|
var __vue_staticRenderFns__ = [];
|
|
82
82
|
|
|
83
83
|
/* style */
|
|
@@ -92,8 +92,8 @@ var script = {
|
|
|
92
92
|
}
|
|
93
93
|
return [];
|
|
94
94
|
},
|
|
95
|
-
|
|
96
|
-
this.$refs[popoverRefName].
|
|
95
|
+
closePopover(e) {
|
|
96
|
+
this.$refs[popoverRefName].close();
|
|
97
97
|
/**
|
|
98
98
|
* Emitted when the close button is clicked (requires showCloseButton to be `true`).
|
|
99
99
|
*/
|
|
@@ -107,7 +107,7 @@ var script = {
|
|
|
107
107
|
const __vue_script__ = script;
|
|
108
108
|
|
|
109
109
|
/* template */
|
|
110
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-popover',_vm._g(_vm._b({ref:_vm.$options.popoverRefName,attrs:{"custom-class":_vm.customClass,"triggers":_vm.triggers,"title":_vm.title,"placement":_vm.placement,"boundary-padding":_vm.boundaryPadding},scopedSlots:_vm._u([(_vm.shouldShowTitle)?{key:"title",fn:function(){return [_vm._t("title",function(){return [_vm._v("\n "+_vm._s(_vm.title)+"\n ")]}),_vm._v(" "),(_vm.showCloseButton)?_c('div',{staticClass:"-gl-mr-3 -gl-mt-2 gl-ml-3 gl-h-0"},[_c('close-button',{class:{ 'gl-float-right gl-mt-2': !_vm.hasTitle },attrs:{"data-testid":"close-button"},on:{"click":_vm.
|
|
110
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-popover',_vm._g(_vm._b({ref:_vm.$options.popoverRefName,attrs:{"custom-class":_vm.customClass,"triggers":_vm.triggers,"title":_vm.title,"placement":_vm.placement,"boundary-padding":_vm.boundaryPadding},scopedSlots:_vm._u([(_vm.shouldShowTitle)?{key:"title",fn:function(){return [_vm._t("title",function(){return [_vm._v("\n "+_vm._s(_vm.title)+"\n ")]}),_vm._v(" "),(_vm.showCloseButton)?_c('div',{staticClass:"-gl-mr-3 -gl-mt-2 gl-ml-3 gl-h-0"},[_c('close-button',{class:{ 'gl-float-right gl-mt-2': !_vm.hasTitle },attrs:{"data-testid":"close-button"},on:{"click":_vm.closePopover}})],1):_vm._e()]},proxy:true}:null,(_vm.$scopedSlots.default)?{key:"default",fn:function(){return [_vm._t("default")]},proxy:true}:null],null,true)},'b-popover',_vm.$attrs,false),_vm.$listeners))};
|
|
111
111
|
var __vue_staticRenderFns__ = [];
|
|
112
112
|
|
|
113
113
|
/* style */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import uniqueId from 'lodash/uniqueId';
|
|
2
2
|
import { tokensValidator } from './helpers';
|
|
3
3
|
import GlTokenContainer from './token_container';
|
|
4
4
|
import GlTokenSelectorDropdown from './token_selector_dropdown';
|
|
@@ -244,7 +244,7 @@ var script = {
|
|
|
244
244
|
},
|
|
245
245
|
created() {
|
|
246
246
|
// Each instance must have a unique ID for proper ARIA relationships
|
|
247
|
-
this.uniqueId =
|
|
247
|
+
this.uniqueId = uniqueId('token-selector-');
|
|
248
248
|
},
|
|
249
249
|
methods: {
|
|
250
250
|
handleFocus(event) {
|
|
@@ -11,7 +11,7 @@ var tooltip_mixin = tooltipRefName => ({
|
|
|
11
11
|
* https://bootstrap-vue.org/docs/components/popover#programmatically-show-and-hide-popover
|
|
12
12
|
* https://bootstrap-vue.org/docs/components/tooltip#programmatically-show-and-hide-tooltip
|
|
13
13
|
*/
|
|
14
|
-
tooltipActionEvents.forEach(event => this.$on(event, () => this.$refs[tooltipRefName]
|
|
14
|
+
tooltipActionEvents.forEach(event => this.$on(event, () => this.$refs[tooltipRefName][event]()));
|
|
15
15
|
},
|
|
16
16
|
beforeDestroy() {
|
|
17
17
|
tooltipActionEvents.forEach(event => this.$off(event));
|