@gitlab/ui 122.12.0 → 122.13.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/new_dropdowns/base_dropdown/base_dropdown.js +28 -2
- package/dist/components/base/new_dropdowns/base_dropdown/dropdown_container.js +32 -0
- package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown.js +3 -4
- package/dist/components/base/token_selector/token_container.js +6 -1
- package/dist/components/base/token_selector/token_selector.js +5 -28
- package/dist/components/base/token_selector/token_selector_dropdown.js +1 -1
- package/dist/components/dashboards/dashboard_panel/dashboard_panel.js +9 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/tailwind.css.map +1 -1
- package/package.json +1 -1
- package/src/components/base/form/form_group/form_group.scss +1 -1
- package/src/components/base/new_dropdowns/base_dropdown/base_dropdown.vue +54 -17
- package/src/components/base/new_dropdowns/base_dropdown/dropdown_container.js +34 -0
- package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.vue +2 -3
- package/src/components/base/new_dropdowns/dropdown.scss +51 -48
- package/src/components/base/token_selector/token_container.vue +11 -1
- package/src/components/base/token_selector/token_selector.vue +4 -33
- package/src/components/base/token_selector/token_selector_dropdown.vue +2 -4
- package/src/components/dashboards/dashboard_panel/dashboard_panel.vue +9 -0
- package/dist/utils/unique_id.js +0 -18
- package/src/utils/unique_id.js +0 -17
|
@@ -6,14 +6,19 @@ import { logWarning, isElementFocusable, isElementTabbable, stopEvent } from '..
|
|
|
6
6
|
import { OutsideDirective } from '../../../../directives/outside/outside';
|
|
7
7
|
import GlButton from '../../button/button';
|
|
8
8
|
import GlIcon from '../../icon/icon';
|
|
9
|
+
import DropdownContainer from './dropdown_container';
|
|
9
10
|
import { DEFAULT_OFFSET, FIXED_WIDTH_CLASS, ARROW_X_MINIMUM } from './constants';
|
|
10
11
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
11
12
|
|
|
12
13
|
const BASE_DROPDOWN_CLASS = 'gl-new-dropdown';
|
|
14
|
+
const DROPDOWN_CONTAINER_CLASS = 'gl-new-dropdown-container';
|
|
13
15
|
var script = {
|
|
14
16
|
name: 'BaseDropdown',
|
|
17
|
+
expose: ['open', 'close', 'closeAndFocus', 'containsElement'],
|
|
15
18
|
BASE_DROPDOWN_CLASS,
|
|
19
|
+
DROPDOWN_CONTAINER_CLASS,
|
|
16
20
|
components: {
|
|
21
|
+
DropdownContainer,
|
|
17
22
|
GlButton,
|
|
18
23
|
GlIcon
|
|
19
24
|
},
|
|
@@ -437,6 +442,17 @@ var script = {
|
|
|
437
442
|
}
|
|
438
443
|
this.toggle(event);
|
|
439
444
|
},
|
|
445
|
+
clickedToggle(event) {
|
|
446
|
+
var _this$$refs$toggle$co, _this$$refs$toggle2, _this$$refs$toggle$$e, _this$$refs$toggle$$e2;
|
|
447
|
+
return ((_this$$refs$toggle$co = (_this$$refs$toggle2 = this.$refs.toggle).contains) === null || _this$$refs$toggle$co === void 0 ? void 0 : _this$$refs$toggle$co.call(_this$$refs$toggle2, event.target)) || ((_this$$refs$toggle$$e = this.$refs.toggle.$el) === null || _this$$refs$toggle$$e === void 0 ? void 0 : (_this$$refs$toggle$$e2 = _this$$refs$toggle$$e.contains) === null || _this$$refs$toggle$$e2 === void 0 ? void 0 : _this$$refs$toggle$$e2.call(_this$$refs$toggle$$e, event.target));
|
|
448
|
+
},
|
|
449
|
+
handleClickOutside(event) {
|
|
450
|
+
// Ignore "click outside" events if the toggle was clicked
|
|
451
|
+
if (this.clickedToggle(event)) {
|
|
452
|
+
return;
|
|
453
|
+
}
|
|
454
|
+
this.close(event);
|
|
455
|
+
},
|
|
440
456
|
/**
|
|
441
457
|
* Closes the dropdown and returns the focus to the toggle unless it has has moved outside
|
|
442
458
|
* of the dropdown, meaning that the consumer needed to put some other element in focus.
|
|
@@ -500,6 +516,16 @@ var script = {
|
|
|
500
516
|
const floatingElementBoundingBox = this.$refs.content.getBoundingClientRect();
|
|
501
517
|
const scrollableAreaBoundingBox = scrollableArea.getBoundingClientRect();
|
|
502
518
|
this.nonScrollableContentHeight = floatingElementBoundingBox.height - scrollableAreaBoundingBox.height;
|
|
519
|
+
},
|
|
520
|
+
/**
|
|
521
|
+
* Public method which returns `true` if the given element is in the DOM tree of this component,
|
|
522
|
+
* and `false` otherwise.
|
|
523
|
+
*
|
|
524
|
+
* Useful for checking whether an event was dispatched against something in this dropdown,
|
|
525
|
+
* e.g., pressing <kbd>Esc</kbd>.
|
|
526
|
+
*/
|
|
527
|
+
containsElement(element) {
|
|
528
|
+
return element.closest(`.${BASE_DROPDOWN_CLASS}`) === this.$el || element.closest(`.${DROPDOWN_CONTAINER_CLASS}`) === this.$refs.dropdownContainer;
|
|
503
529
|
}
|
|
504
530
|
}
|
|
505
531
|
};
|
|
@@ -508,7 +534,7 @@ var script = {
|
|
|
508
534
|
const __vue_script__ = script;
|
|
509
535
|
|
|
510
536
|
/* template */
|
|
511
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{
|
|
537
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:[_vm.$options.BASE_DROPDOWN_CLASS, { '!gl-block': _vm.block }]},[_c(_vm.toggleComponent,_vm._g(_vm._b({ref:"toggle",tag:"component",attrs:{"id":_vm.toggleId,"data-testid":"base-dropdown-toggle"}},'component',_vm.toggleAttributes,false),_vm.toggleListeners),[_vm._t("toggle",function(){return [_c('span',{staticClass:"gl-new-dropdown-button-text",class:{ 'gl-sr-only': _vm.textSrOnly }},[_vm._v("\n "+_vm._s(_vm.toggleText)+"\n ")]),_vm._v(" "),(!_vm.noCaret)?_c('gl-icon',{staticClass:"gl-button-icon gl-new-dropdown-chevron",attrs:{"name":"chevron-down"}}):_vm._e()]})],2),_vm._v(" "),_c('dropdown-container',{attrs:{"positioning-strategy":_vm.positioningStrategy}},[_c('div',{directives:[{name:"outside",rawName:"v-outside.click.focusin",value:(_vm.handleClickOutside),expression:"handleClickOutside",modifiers:{"click":true,"focusin":true}}],ref:"dropdownContainer",class:_vm.$options.DROPDOWN_CONTAINER_CLASS},[_c('div',{ref:"content",staticClass:"gl-new-dropdown-panel",class:_vm.panelClasses,attrs:{"id":_vm.baseDropdownId,"data-testid":"base-dropdown-menu"},on:{"keydown":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"esc",27,$event.key,["Esc","Escape"])){ return null; }$event.stopPropagation();$event.preventDefault();return _vm.closeAndFocus.apply(null, arguments)}}},[_c('div',{ref:"dropdownArrow",staticClass:"gl-new-dropdown-arrow"}),_vm._v(" "),_c('div',{staticClass:"gl-new-dropdown-inner"},[_vm._t("default",null,{"visible":_vm.visible})],2)])])])],1)};
|
|
512
538
|
var __vue_staticRenderFns__ = [];
|
|
513
539
|
|
|
514
540
|
/* style */
|
|
@@ -540,4 +566,4 @@ var __vue_staticRenderFns__ = [];
|
|
|
540
566
|
undefined
|
|
541
567
|
);
|
|
542
568
|
|
|
543
|
-
export {
|
|
569
|
+
export { __vue_component__ as default };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { MountingPortal } from 'portal-vue';
|
|
2
|
+
import { POSITION_ABSOLUTE, POSITION_FIXED } from '../constants';
|
|
3
|
+
|
|
4
|
+
/* eslint-disable import/no-default-export */
|
|
5
|
+
var dropdown_container = {
|
|
6
|
+
props: {
|
|
7
|
+
/**
|
|
8
|
+
* Strategy to be applied by computePosition. If this is set to fixed, the dropdown's position
|
|
9
|
+
* needs to be set to fixed in CSS as well.
|
|
10
|
+
* https://floating-ui.com/docs/computePosition#strategy
|
|
11
|
+
*/
|
|
12
|
+
positioningStrategy: {
|
|
13
|
+
type: String,
|
|
14
|
+
required: false,
|
|
15
|
+
default: POSITION_ABSOLUTE,
|
|
16
|
+
validator: strategy => [POSITION_ABSOLUTE, POSITION_FIXED].includes(strategy)
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
render(createElement) {
|
|
20
|
+
if (this.positioningStrategy === POSITION_FIXED) {
|
|
21
|
+
return createElement(MountingPortal, {
|
|
22
|
+
props: {
|
|
23
|
+
mountTo: 'body',
|
|
24
|
+
append: true
|
|
25
|
+
}
|
|
26
|
+
}, [this.$scopedSlots.default()]);
|
|
27
|
+
}
|
|
28
|
+
return this.$scopedSlots.default();
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export { dropdown_container as default };
|
|
@@ -3,7 +3,7 @@ import uniqueId from 'lodash/uniqueId';
|
|
|
3
3
|
import { stopEvent, filterVisible } from '../../../../utils/utils';
|
|
4
4
|
import { GL_DROPDOWN_SHOWN, GL_DROPDOWN_HIDDEN, GL_DROPDOWN_BEFORE_CLOSE, GL_DROPDOWN_FOCUS_CONTENT, POSITION_ABSOLUTE, POSITION_FIXED, HOME, END, ARROW_UP, ARROW_DOWN, ENTER, SPACE, GL_DROPDOWN_CONTENTS_CLASS } from '../constants';
|
|
5
5
|
import { buttonCategoryOptions, dropdownVariantOptions, buttonSizeOptions, dropdownPlacements } from '../../../../utils/constants';
|
|
6
|
-
import GlBaseDropdown
|
|
6
|
+
import GlBaseDropdown from '../base_dropdown/base_dropdown';
|
|
7
7
|
import GlDisclosureDropdownItem, { ITEM_CLASS } from './disclosure_dropdown_item';
|
|
8
8
|
import GlDisclosureDropdownGroup from './disclosure_dropdown_group';
|
|
9
9
|
import { itemsValidator, hasOnlyListItems, isItem } from './utils';
|
|
@@ -11,7 +11,6 @@ import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
|
11
11
|
|
|
12
12
|
//
|
|
13
13
|
|
|
14
|
-
const DROPDOWN_SELECTOR = `.${BASE_DROPDOWN_CLASS}`;
|
|
15
14
|
const ITEM_SELECTOR = `.${ITEM_CLASS}`;
|
|
16
15
|
var script = {
|
|
17
16
|
name: 'GlDisclosureDropdown',
|
|
@@ -325,7 +324,7 @@ var script = {
|
|
|
325
324
|
});
|
|
326
325
|
},
|
|
327
326
|
handleAutoClose(e) {
|
|
328
|
-
if (this.autoClose && e.target.closest(ITEM_SELECTOR) &&
|
|
327
|
+
if (this.autoClose && e.target.closest(ITEM_SELECTOR) && this.$refs.baseDropdown.containsElement(e.target)) {
|
|
329
328
|
this.closeAndFocus();
|
|
330
329
|
}
|
|
331
330
|
},
|
|
@@ -373,4 +372,4 @@ var __vue_staticRenderFns__ = [];
|
|
|
373
372
|
undefined
|
|
374
373
|
);
|
|
375
374
|
|
|
376
|
-
export {
|
|
375
|
+
export { ITEM_SELECTOR, __vue_component__ as default };
|
|
@@ -16,6 +16,11 @@ var script = {
|
|
|
16
16
|
validator: tokensValidator,
|
|
17
17
|
required: true
|
|
18
18
|
},
|
|
19
|
+
state: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
required: false,
|
|
22
|
+
default: null
|
|
23
|
+
},
|
|
19
24
|
registerFocusOnToken: {
|
|
20
25
|
type: Function,
|
|
21
26
|
required: true
|
|
@@ -125,7 +130,7 @@ var script = {
|
|
|
125
130
|
const __vue_script__ = script;
|
|
126
131
|
|
|
127
132
|
/* template */
|
|
128
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-flex gl-w-full gl-flex-nowrap gl-items-start"},[_c('div',{staticClass:"gl-flex gl-grow gl-flex-wrap gl-items-start"},[_c('div',{ref:"tokenContainer",staticClass:"-gl-mx-1 -gl-my-1 gl-flex gl-w-auto gl-list-none gl-flex-wrap gl-items-center gl-p-0",on:{"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.handleLeftArrow.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.handleRightArrow.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"home",undefined,$event.key,undefined)){ return null; }return _vm.handleHome.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"end",undefined,$event.key,undefined)){ return null; }return _vm.handleEnd.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"delete",[8,46],$event.key,["Backspace","Delete","Del"])){ return null; }return _vm.handleDelete.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"esc",27,$event.key,["Esc","Escape"])){ return null; }return _vm.handleEscape.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"tab",9,$event.key,"Tab")){ return null; }if($event.ctrlKey||$event.shiftKey||$event.altKey||$event.metaKey){ return null; }$event.preventDefault();return _vm.handleTab.apply(null, arguments)}]}},_vm._l((_vm.tokens),function(token,index){return _c('div',{key:token.id,ref:"tokens",refInFor:true,staticClass:"gl-token-selector-token-container gl-px-1 gl-py-2 gl-outline-none",attrs:{"data-token-id":token.id,"
|
|
133
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-flex gl-w-full gl-flex-nowrap gl-items-start"},[_c('div',{staticClass:"gl-flex gl-grow gl-flex-wrap gl-items-start"},[_c('div',{ref:"tokenContainer",staticClass:"-gl-mx-1 -gl-my-1 gl-flex gl-w-auto gl-list-none gl-flex-wrap gl-items-center gl-p-0",attrs:{"role":"listbox","aria-multiselectable":"false","aria-orientation":"horizontal","aria-invalid":_vm.state === false && 'true',"aria-label":"token list"},on:{"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.handleLeftArrow.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.handleRightArrow.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"home",undefined,$event.key,undefined)){ return null; }return _vm.handleHome.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"end",undefined,$event.key,undefined)){ return null; }return _vm.handleEnd.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"delete",[8,46],$event.key,["Backspace","Delete","Del"])){ return null; }return _vm.handleDelete.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"esc",27,$event.key,["Esc","Escape"])){ return null; }return _vm.handleEscape.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"tab",9,$event.key,"Tab")){ return null; }if($event.ctrlKey||$event.shiftKey||$event.altKey||$event.metaKey){ return null; }$event.preventDefault();return _vm.handleTab.apply(null, arguments)}]}},_vm._l((_vm.tokens),function(token,index){return _c('div',{key:token.id,ref:"tokens",refInFor:true,staticClass:"gl-token-selector-token-container gl-px-1 gl-py-2 gl-outline-none",attrs:{"data-token-id":token.id,"role":"option","tabindex":"-1"},on:{"focus":function($event){_vm.bindFocusEvent ? _vm.handleTokenFocus(index) : null;}}},[_c('gl-token',{staticClass:"gl-cursor-default",class:token.class,style:(token.style),attrs:{"view-only":_vm.viewOnly},on:{"close":function($event){return _vm.handleClose(token)}}},[_vm._t("token-content",function(){return [_c('span',[_vm._v("\n "+_vm._s(token.name)+"\n ")])]},{"token":token})],2)],1)}),0),_vm._v(" "),_vm._t("text-input")],2),_vm._v(" "),(_vm.showClearAllButton)?_c('div',{staticClass:"gl-ml-3 gl-p-1"},[_c('gl-button',{attrs:{"size":"small","aria-label":"Clear all","icon":"clear","category":"tertiary","data-testid":"clear-all-button"},on:{"click":function($event){$event.stopPropagation();return _vm.$emit('clear-all')}}})],1):_vm._e()])};
|
|
129
134
|
var __vue_staticRenderFns__ = [];
|
|
130
135
|
|
|
131
136
|
/* 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';
|
|
@@ -6,7 +6,7 @@ import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
|
6
6
|
|
|
7
7
|
var script = {
|
|
8
8
|
name: 'GlTokenSelector',
|
|
9
|
-
componentId:
|
|
9
|
+
componentId: uniqueId('token-selector'),
|
|
10
10
|
components: {
|
|
11
11
|
GlTokenContainer,
|
|
12
12
|
GlTokenSelectorDropdown
|
|
@@ -75,7 +75,7 @@ var script = {
|
|
|
75
75
|
default: ''
|
|
76
76
|
},
|
|
77
77
|
/**
|
|
78
|
-
* The
|
|
78
|
+
* The autocomplete attribute value for the underlying `input` element
|
|
79
79
|
*/
|
|
80
80
|
autocomplete: {
|
|
81
81
|
type: String,
|
|
@@ -83,21 +83,7 @@ var script = {
|
|
|
83
83
|
default: 'off'
|
|
84
84
|
},
|
|
85
85
|
/**
|
|
86
|
-
* The `aria-
|
|
87
|
-
* Input must have an aria-label or aria-labelledby prop or it will be inaccessible.
|
|
88
|
-
*
|
|
89
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-label
|
|
90
|
-
*/
|
|
91
|
-
ariaLabel: {
|
|
92
|
-
type: String,
|
|
93
|
-
required: false,
|
|
94
|
-
default: null
|
|
95
|
-
},
|
|
96
|
-
/**
|
|
97
|
-
* The `aria-labelledby` attribute value for the underlying `input` element.
|
|
98
|
-
* String must match the unique ID on a text element to create an accessible label.
|
|
99
|
-
*
|
|
100
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-labelledby
|
|
86
|
+
* The `aria-labelledby` attribute value for the underlying `input` element
|
|
101
87
|
*/
|
|
102
88
|
ariaLabelledby: {
|
|
103
89
|
type: String,
|
|
@@ -378,15 +364,6 @@ var script = {
|
|
|
378
364
|
clearAll() {
|
|
379
365
|
this.$emit('input', []);
|
|
380
366
|
this.focusTextInput();
|
|
381
|
-
},
|
|
382
|
-
handleAriaInvalid() {
|
|
383
|
-
const {
|
|
384
|
-
state
|
|
385
|
-
} = this;
|
|
386
|
-
return state === false ? 'true' : null;
|
|
387
|
-
},
|
|
388
|
-
handleAriaActiveDescendent(value) {
|
|
389
|
-
return value ? `${this.$options.componentId}-dropdown-item-${value.id}` : null;
|
|
390
367
|
}
|
|
391
368
|
}
|
|
392
369
|
};
|
|
@@ -403,7 +380,7 @@ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=
|
|
|
403
380
|
_vm.containerClass,
|
|
404
381
|
_vm.stateClass ],on:{"click":_vm.handleContainerClick}},[(_vm.showEmptyPlaceholder)?_vm._t("empty-placeholder"):_vm._e(),_vm._v(" "),_c('gl-token-container',{attrs:{"tokens":_vm.selectedTokens,"state":_vm.state,"register-focus-on-token":_vm.registerFocusOnToken,"view-only":_vm.viewOnly,"show-clear-all-button":_vm.showClearAllButton},on:{"token-remove":_vm.removeToken,"cancel-focus":_vm.cancelTokenFocus,"clear-all":_vm.clearAll},scopedSlots:_vm._u([{key:"token-content",fn:function(ref){
|
|
405
382
|
var token = ref.token;
|
|
406
|
-
return [_vm._t("token-content",null,{"token":token})]}},{key:"text-input",fn:function(){return [_c('input',_vm._b({ref:"textInput",staticClass:"gl-token-selector-input gl-h-auto gl-w-4/10 gl-grow gl-border-none gl-bg-transparent gl-px-1 gl-font-regular gl-text-base gl-leading-normal gl-text-default gl-outline-none",attrs:{"type":"text","
|
|
383
|
+
return [_vm._t("token-content",null,{"token":token})]}},{key:"text-input",fn:function(){return [_c('input',_vm._b({ref:"textInput",staticClass:"gl-token-selector-input gl-h-auto gl-w-4/10 gl-grow gl-border-none gl-bg-transparent gl-px-1 gl-font-regular gl-text-base gl-leading-normal gl-text-default gl-outline-none",attrs:{"type":"text","autocomplete":_vm.autocomplete,"aria-labelledby":_vm.ariaLabelledby,"placeholder":_vm.placeholder,"disabled":_vm.viewOnly},domProps:{"value":_vm.inputText},on:{"input":function($event){_vm.inputText = $event.target.value;},"focus":_vm.handleFocus,"blur":_vm.handleBlur,"keydown":[function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }return _vm.handleEnter.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"esc",27,$event.key,["Esc","Escape"])){ return null; }return _vm.handleEscape.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"delete",[8,46],$event.key,["Backspace","Delete","Del"])){ return null; }return _vm.handleBackspace.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"up",38,$event.key,["Up","ArrowUp"])){ return null; }$event.preventDefault();return _vm.dropdownEventHandlers.handleUpArrow.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"down",40,$event.key,["Down","ArrowDown"])){ return null; }$event.preventDefault();return _vm.dropdownEventHandlers.handleDownArrow.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"home",undefined,$event.key,undefined)){ return null; }return _vm.dropdownEventHandlers.handleHomeKey.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"end",undefined,$event.key,undefined)){ return null; }return _vm.dropdownEventHandlers.handleEndKey.apply(null, arguments)},function($event){$event.stopPropagation();return _vm.$emit('keydown', $event)}],"click":_vm.handleInputClick}},'input',_vm.textInputAttrs,false))]},proxy:true}],null,true)})],2),_vm._v(" "),_c('gl-token-selector-dropdown',{attrs:{"menu-class":_vm.menuClass,"show":_vm.dropdownIsOpen,"loading":_vm.loading,"dropdown-items":_vm.filteredDropdownItems,"selected-tokens":_vm.selectedTokens,"input-text":_vm.inputText,"user-defined-token-can-be-added":_vm.userDefinedTokenCanBeAdded,"component-id":_vm.$options.componentId,"register-dropdown-event-handlers":_vm.registerDropdownEventHandlers,"register-reset-focused-dropdown-item":_vm.registerResetFocusedDropdownItem},on:{"dropdown-item-click":_vm.addToken,"show":_vm.openDropdown},scopedSlots:_vm._u([{key:"loading-content",fn:function(){return [_vm._t("loading-content")]},proxy:true},{key:"user-defined-token-content",fn:function(){return [_vm._t("user-defined-token-content",null,{"inputText":_vm.inputText})]},proxy:true},{key:"no-results-content",fn:function(){return [_vm._t("no-results-content")]},proxy:true},{key:"dropdown-item-content",fn:function(ref){
|
|
407
384
|
var dropdownItem = ref.dropdownItem;
|
|
408
385
|
return [_vm._t("dropdown-item-content",null,{"dropdownItem":dropdownItem})]}},{key:"dropdown-footer",fn:function(){return [_vm._t("dropdown-footer")]},proxy:true}],null,true),model:{value:(_vm.focusedDropdownItem),callback:function ($$v) {_vm.focusedDropdownItem=$$v;},expression:"focusedDropdownItem"}})],1)};
|
|
409
386
|
var __vue_staticRenderFns__ = [];
|
|
@@ -188,7 +188,7 @@ var script = {
|
|
|
188
188
|
const __vue_script__ = script;
|
|
189
189
|
|
|
190
190
|
/* template */
|
|
191
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"dropdown b-dropdown gl-dropdown gl-relative",class:{ show: _vm.show }},[_c('ul',{ref:"dropdownMenu",staticClass:"dropdown-menu gl-absolute",class:[{ show: _vm.show }, _vm.menuClass],attrs:{"
|
|
191
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"dropdown b-dropdown gl-dropdown gl-relative",class:{ show: _vm.show }},[_c('ul',{ref:"dropdownMenu",staticClass:"dropdown-menu gl-absolute",class:[{ show: _vm.show }, _vm.menuClass],attrs:{"role":"menu","aria-activedescendant":_vm.dropdownItemIdAttribute(_vm.focusedDropdownItem)}},[(_vm.loading)?_c('gl-dropdown-item',{attrs:{"disabled":""}},[_vm._t("loading-content",function(){return [_vm._v("Searching...")]})],2):_vm._e(),_vm._v(" "),_vm._l((_vm.dropdownItems),function(dropdownItem){return _c('gl-dropdown-item',{key:dropdownItem.id,ref:"dropdownItems",refInFor:true,attrs:{"id":_vm.dropdownItemIdAttribute(dropdownItem),"data-dropdown-item-id":dropdownItem.id,"active":_vm.dropdownItemIsFocused(dropdownItem),"active-class":"is-focused","tabindex":"-1"},on:{"click":function($event){return _vm.handleDropdownItemClick(dropdownItem)}}},[_c('div',{staticClass:"-gl-mx-4 -gl-my-3 gl-px-4 gl-py-3",on:{"mousedown":function($event){return _vm.handleMousedown(dropdownItem)}}},[_vm._t("dropdown-item-content",function(){return [_vm._v("\n "+_vm._s(dropdownItem.name)+"\n ")]},{"dropdownItem":dropdownItem})],2)])}),_vm._v(" "),(_vm.userDefinedTokenCanBeAdded)?_c('gl-dropdown-item',{ref:_vm.userDefinedToken.id,attrs:{"id":_vm.dropdownItemIdAttribute(_vm.userDefinedToken),"data-dropdown-item-id":_vm.userDefinedToken.id,"active":_vm.dropdownItemIsFocused(_vm.userDefinedToken),"active-class":"is-focused","tabindex":"-1"},on:{"click":function($event){return _vm.handleDropdownItemClick(_vm.userDefinedToken)}}},[_c('div',{staticClass:"-gl-mx-4 -gl-my-3 gl-px-4 gl-py-3",on:{"mousedown":function($event){return _vm.handleMousedown(_vm.userDefinedToken)}}},[_vm._t("user-defined-token-content",function(){return [_vm._v("\n Add \""+_vm._s(_vm.inputText)+"\"\n ")]},{"inputText":_vm.inputText})],2)]):(!_vm.dropdownItems.length)?_c('gl-dropdown-item',{attrs:{"disabled":""}},[_vm._t("no-results-content",function(){return [_vm._v("No matches found")]})],2):_vm._e(),_vm._v(" "),_vm._t("dropdown-footer")],2)])};
|
|
192
192
|
var __vue_staticRenderFns__ = [];
|
|
193
193
|
|
|
194
194
|
/* style */
|
|
@@ -86,6 +86,14 @@ var script = {
|
|
|
86
86
|
required: false,
|
|
87
87
|
default: () => ({})
|
|
88
88
|
},
|
|
89
|
+
/**
|
|
90
|
+
* CSS classes to apply to the title popover (gets passed to the `css-classes` prop of the `GlPopover` component).
|
|
91
|
+
*/
|
|
92
|
+
titlePopoverClasses: {
|
|
93
|
+
type: Array,
|
|
94
|
+
required: false,
|
|
95
|
+
default: () => []
|
|
96
|
+
},
|
|
89
97
|
/**
|
|
90
98
|
* Set to `true` to show the loading state.
|
|
91
99
|
*/
|
|
@@ -182,7 +190,7 @@ var script = {
|
|
|
182
190
|
const __vue_script__ = script;
|
|
183
191
|
|
|
184
192
|
/* template */
|
|
185
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-border gl-h-full !gl-overflow-visible gl-rounded-lg gl-bg-white gl-p-5",class:_vm.containerClasses,attrs:{"id":_vm.panelId}},[_c('div',{staticClass:"gl-flex gl-h-full gl-flex-col"},[_c('div',{staticClass:"gl-flex gl-items-start gl-justify-between",attrs:{"data-testid":"panel-title"}},[_c('div',{staticClass:"gl-flex gl-items-center gl-overflow-hidden gl-pb-3"},[(_vm.hasTitleIcon)?_c('gl-icon',{staticClass:"gl-mr-2",class:_vm.titleIconClass,attrs:{"name":_vm.titleIcon,"data-testid":"panel-title-icon"}}):_vm._e(),_vm._v(" "),(_vm.hasTitle)?_c('gl-truncate',{staticClass:"gl-min-w-0 gl-font-bold gl-text-default",attrs:{"text":_vm.title,"with-tooltip":""}}):_vm._e(),_vm._v(" "),(_vm.hasTitlePopover)?[_c('gl-icon',{staticClass:"gl-ml-2 gl-min-w-5",attrs:{"id":_vm.titlePopoverId,"data-testid":"panel-title-popover-icon","name":"information-o","variant":"info"}}),_vm._v(" "),_c('gl-popover',{attrs:{"data-testid":"panel-title-popover","boundary":"viewport","target":_vm.titlePopoverId},scopedSlots:_vm._u([(_vm.hasInfoPopoverTitleSlot)?{key:"title",fn:function(){return [_vm._t("info-popover-title")]},proxy:true}:null],null,true)},[_vm._v(" "),(_vm.hasInfoPopoverContentSlot)?[_vm._t("info-popover-content")]:_vm._e(),_vm._v(" "),(!_vm.hasInfoPopoverContentSlot)?[(_vm.hasTitlePopoverLink)?_c('gl-sprintf',{attrs:{"message":_vm.titlePopover.description},scopedSlots:_vm._u([{key:"link",fn:function(ref){
|
|
193
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-border gl-h-full !gl-overflow-visible gl-rounded-lg gl-bg-white gl-p-5",class:_vm.containerClasses,attrs:{"id":_vm.panelId}},[_c('div',{staticClass:"gl-flex gl-h-full gl-flex-col"},[_c('div',{staticClass:"gl-flex gl-items-start gl-justify-between",attrs:{"data-testid":"panel-title"}},[_c('div',{staticClass:"gl-flex gl-items-center gl-overflow-hidden gl-pb-3"},[(_vm.hasTitleIcon)?_c('gl-icon',{staticClass:"gl-mr-2",class:_vm.titleIconClass,attrs:{"name":_vm.titleIcon,"data-testid":"panel-title-icon"}}):_vm._e(),_vm._v(" "),(_vm.hasTitle)?_c('gl-truncate',{staticClass:"gl-min-w-0 gl-font-bold gl-text-default",attrs:{"text":_vm.title,"with-tooltip":""}}):_vm._e(),_vm._v(" "),(_vm.hasTitlePopover)?[_c('gl-icon',{staticClass:"gl-ml-2 gl-min-w-5",attrs:{"id":_vm.titlePopoverId,"data-testid":"panel-title-popover-icon","name":"information-o","variant":"info"}}),_vm._v(" "),_c('gl-popover',{attrs:{"data-testid":"panel-title-popover","boundary":"viewport","target":_vm.titlePopoverId,"css-classes":_vm.titlePopoverClasses},scopedSlots:_vm._u([(_vm.hasInfoPopoverTitleSlot)?{key:"title",fn:function(){return [_vm._t("info-popover-title")]},proxy:true}:null],null,true)},[_vm._v(" "),(_vm.hasInfoPopoverContentSlot)?[_vm._t("info-popover-content")]:_vm._e(),_vm._v(" "),(!_vm.hasInfoPopoverContentSlot)?[(_vm.hasTitlePopoverLink)?_c('gl-sprintf',{attrs:{"message":_vm.titlePopover.description},scopedSlots:_vm._u([{key:"link",fn:function(ref){
|
|
186
194
|
var content = ref.content;
|
|
187
195
|
return [_c('gl-link',{staticClass:"gl-text-sm",attrs:{"href":_vm.titlePopover.descriptionLink}},[_vm._v(_vm._s(content))])]}}],null,false,3051540671)}):[_vm._v(" "+_vm._s(_vm.titlePopover.description)+" ")]]:_vm._e()],2)]:_vm._e()],2),_vm._v(" "),(_vm.shouldShowActions || _vm.$scopedSlots.filters)?_c('div',{staticClass:"gl-flex gl-flex-col gl-items-end gl-gap-2",attrs:{"data-testid":"panel-actions-filters-container"}},[(_vm.shouldShowActions)?_c('gl-disclosure-dropdown',{attrs:{"items":_vm.actions,"icon":"ellipsis_v","toggle-text":_vm.actionsToggleText,"text-sr-only":"","no-caret":"","placement":"bottom-end","fluid-width":"","toggle-class":"gl-ml-1","category":"tertiary","positioning-strategy":"fixed","size":"small"},on:{"shown":function($event){return _vm.$emit('dropdownOpen')},"hidden":function($event){return _vm.$emit('dropdownClosed')}},scopedSlots:_vm._u([{key:"list-item",fn:function(ref){
|
|
188
196
|
var item = ref.item;
|