@gitlab/ui 131.1.0 → 131.3.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/filtered_search/filtered_search.js +15 -4
- package/dist/components/base/filtered_search/filtered_search_term.js +1 -1
- package/dist/components/base/filtered_search/filtered_search_token_segment.js +1 -1
- package/dist/components/base/form/form_checkbox/form_checkbox.js +1 -2
- package/dist/components/base/form/form_checkbox/form_checkbox_group.js +1 -1
- package/dist/components/base/form/form_radio/form_radio.js +1 -1
- package/dist/components/base/form/form_radio_group/form_radio_group.js +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/utils/equality_utils.js +84 -0
- package/dist/vendor/bootstrap-vue/src/components/button/button-close.js +20 -5
- package/dist/vendor/bootstrap-vue/src/components/button/button.js +36 -8
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-item.js +12 -4
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-text.js +16 -5
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown.js +99 -23
- package/dist/vendor/bootstrap-vue/src/components/form/form-text.js +20 -5
- package/dist/vendor/bootstrap-vue/src/components/form/form.js +20 -5
- package/dist/vendor/bootstrap-vue/src/components/layout/form-row.js +5 -2
- package/dist/vendor/bootstrap-vue/src/components/table/tbody.js +10 -3
- package/dist/vendor/bootstrap-vue/src/components/table/td.js +28 -7
- package/dist/vendor/bootstrap-vue/src/components/table/tfoot.js +5 -2
- package/dist/vendor/bootstrap-vue/src/components/table/thead.js +5 -2
- package/dist/vendor/bootstrap-vue/src/components/table/tr.js +5 -2
- package/dist/vendor/bootstrap-vue/src/components/tabs/tab.js +51 -12
- package/package.json +9 -9
- package/src/components/base/filtered_search/filtered_search.vue +16 -4
- package/src/components/base/filtered_search/filtered_search_term.vue +1 -1
- package/src/components/base/filtered_search/filtered_search_token_segment.vue +2 -1
- package/src/components/base/form/form_checkbox/form_checkbox.vue +1 -2
- package/src/components/base/form/form_checkbox/form_checkbox_group.vue +1 -1
- package/src/components/base/form/form_radio/form_radio.vue +1 -1
- package/src/components/base/form/form_radio_group/form_radio_group.vue +1 -1
- package/src/components/base/table/table.scss +8 -0
- package/src/utils/equality_utils.js +82 -0
- package/src/vendor/bootstrap-vue/src/components/button/button-close.js +20 -5
- package/src/vendor/bootstrap-vue/src/components/button/button.js +36 -8
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-item.js +12 -4
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-text.js +16 -5
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown.js +99 -24
- package/src/vendor/bootstrap-vue/src/components/form/form-text.js +20 -5
- package/src/vendor/bootstrap-vue/src/components/form/form.js +20 -5
- package/src/vendor/bootstrap-vue/src/components/layout/form-row.js +5 -2
- package/src/vendor/bootstrap-vue/src/components/table/tbody.js +10 -3
- package/src/vendor/bootstrap-vue/src/components/table/td.js +28 -7
- package/src/vendor/bootstrap-vue/src/components/table/tfoot.js +5 -2
- package/src/vendor/bootstrap-vue/src/components/table/thead.js +5 -2
- package/src/vendor/bootstrap-vue/src/components/table/tr.js +5 -2
- package/src/vendor/bootstrap-vue/src/components/tabs/tab.js +51 -12
|
@@ -327,10 +327,15 @@ var script = {
|
|
|
327
327
|
// Preserve the active token's active status (it shifted down one index)
|
|
328
328
|
this.activeTokenIdx -= 1;
|
|
329
329
|
} else if (idx === this.activeTokenIdx) {
|
|
330
|
-
// User destroyed the active token;
|
|
331
|
-
|
|
330
|
+
// User destroyed the active token; activate the last token so focus
|
|
331
|
+
// moves to the search input rather than being lost.
|
|
332
|
+
this.activeTokenIdx = this.lastTokenIdx;
|
|
333
|
+
} else if (this.activeTokenIdx === null) {
|
|
334
|
+
// No token was active (e.g. clicking the X button on an inactive token);
|
|
335
|
+
// activate the last token so focus moves to the search input.
|
|
336
|
+
this.activeTokenIdx = this.lastTokenIdx;
|
|
332
337
|
}
|
|
333
|
-
// Do nothing if
|
|
338
|
+
// Do nothing if idx > this.activeTokenIdx,
|
|
334
339
|
// to preserve the active state of the remaining tokens.
|
|
335
340
|
},
|
|
336
341
|
replaceToken(idx, token) {
|
|
@@ -365,6 +370,12 @@ var script = {
|
|
|
365
370
|
this.activeTokenIdx = null;
|
|
366
371
|
}
|
|
367
372
|
},
|
|
373
|
+
onClear() {
|
|
374
|
+
this.$nextTick(() => {
|
|
375
|
+
this.activeTokenIdx = this.lastTokenIdx;
|
|
376
|
+
this.$emit('clear');
|
|
377
|
+
});
|
|
378
|
+
},
|
|
368
379
|
submit() {
|
|
369
380
|
/**
|
|
370
381
|
* Emitted when search is submitted
|
|
@@ -379,7 +390,7 @@ var script = {
|
|
|
379
390
|
const __vue_script__ = script;
|
|
380
391
|
|
|
381
392
|
/* template */
|
|
382
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-search-box-by-click',_vm._b({attrs:{"value":_vm.tokens,"history-items":_vm.historyItems,"clearable":_vm.hasValue,"search-button-attributes":_vm.searchButtonAttributes,"show-search-button":_vm.showSearchButton,"disabled":_vm.viewOnly,"wrapper-attributes":{ 'data-testid': 'filtered-search-input' }},on:{"submit":_vm.submit,"input":_vm.applyNewValue,"history-item-selected":function($event){return _vm.$emit('history-item-selected', $event)},"clear":
|
|
393
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-search-box-by-click',_vm._b({attrs:{"value":_vm.tokens,"history-items":_vm.historyItems,"clearable":_vm.hasValue,"search-button-attributes":_vm.searchButtonAttributes,"show-search-button":_vm.showSearchButton,"disabled":_vm.viewOnly,"wrapper-attributes":{ 'data-testid': 'filtered-search-input' }},on:{"submit":_vm.submit,"input":_vm.applyNewValue,"history-item-selected":function($event){return _vm.$emit('history-item-selected', $event)},"clear":_vm.onClear,"clear-history":function($event){return _vm.$emit('clear-history')}},scopedSlots:_vm._u([{key:"history-item",fn:function(slotScope){return [_vm._t("history-item",null,null,slotScope)]}},{key:"input",fn:function(){return [_c('div',{staticClass:"gl-filtered-search-scrollable-container",class:{
|
|
383
394
|
'gl-filtered-search-scrollable-container-with-search-button': _vm.showSearchButton,
|
|
384
395
|
'gl-filtered-search-view-only': _vm.viewOnly,
|
|
385
396
|
}},[_c('div',{staticClass:"gl-filtered-search-scrollable"},_vm._l((_vm.tokens),function(token,idx){return _c(_vm.getTokenComponent(token.type),{key:token.id,ref:"tokens",refInFor:true,tag:"component",class:_vm.getTokenClassList(idx),attrs:{"config":_vm.getTokenEntry(token.type),"active":_vm.activeTokenIdx === idx,"cursor-position":_vm.intendedCursorPosition,"available-tokens":_vm.currentAvailableTokens,"current-value":_vm.tokens,"index":idx,"placeholder":_vm.termPlaceholder,"show-friendly-text":_vm.showFriendlyText,"search-input-attributes":_vm.searchInputAttributes,"view-only":_vm.viewOnly,"is-last-token":_vm.isLastToken(idx),"search-text-option-label":_vm.searchTextOptionLabel,"applied-tokens":_vm.appliedTokens},on:{"activate":function($event){return _vm.activate(idx)},"deactivate":function($event){return _vm.deactivate(token)},"destroy":function($event){return _vm.destroyToken(idx, $event)},"replace":function($event){return _vm.replaceToken(idx, $event)},"complete":_vm.completeToken,"submit":_vm.submit,"split":function($event){return _vm.createTokens(idx, $event)},"previous":_vm.activatePreviousToken,"next":_vm.activateNextToken},model:{value:(token.value),callback:function ($$v) {_vm.$set(token, "value", $$v);},expression:"token.value"}})}),1)]),_vm._v(" "),_c('portal-target',{key:_vm.activeTokenIdx,ref:"menu",style:(_vm.suggestionsStyle),attrs:{"name":_vm.portalName,"slim":""}})]},proxy:true}],null,true)},'gl-search-box-by-click',_vm.$attrs,false))};
|
|
@@ -89,7 +89,7 @@ var script = {
|
|
|
89
89
|
},
|
|
90
90
|
computed: {
|
|
91
91
|
showInput() {
|
|
92
|
-
return this.termsAsTokens() || Boolean(this.placeholder);
|
|
92
|
+
return this.termsAsTokens() || Boolean(this.placeholder) || this.isLastToken;
|
|
93
93
|
},
|
|
94
94
|
showToken() {
|
|
95
95
|
return this.termsAsTokens() && Boolean(this.value.data);
|
|
@@ -409,7 +409,7 @@ const __vue_script__ = script;
|
|
|
409
409
|
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',_vm._g(_vm._b({staticClass:"gl-filtered-search-token-segment",class:{
|
|
410
410
|
'gl-filtered-search-token-segment-active': _vm.active,
|
|
411
411
|
'!gl-cursor-text': _vm.viewOnly,
|
|
412
|
-
},attrs:{"data-testid":"filtered-search-token-segment"}},'div',_vm.containerAttributes,false),_vm.viewOnly ? {} : { mousedown: _vm.emitIfInactive }),[(_vm.active)?[_vm._t("before-input",null,null,{ submitValue: _vm.applySuggestion }),_vm._v(" "),_vm._t("input",function(){return [(((_vm.searchInputAttributes).type)==='checkbox')?_c('input',_vm._b({directives:[{name:"model",rawName:"v-model",value:(_vm.inputValue),expression:"inputValue"}],ref:"input",staticClass:"gl-filtered-search-token-segment-input",class:{ 'gl-filtered-search-token-segment-input-disabled': _vm.viewOnly },attrs:{"data-testid":"filtered-search-token-segment-input","aria-label":_vm.label,"disabled":_vm.viewOnly,"type":"checkbox"},domProps:{"checked":Array.isArray(_vm.inputValue)?_vm._i(_vm.inputValue,null)>-1:(_vm.inputValue)},on:{"keydown":_vm.handleInputKeydown,"blur":_vm.handleBlur,"change":function($event){var $$a=_vm.inputValue,$$el=$event.target,$$c=$$el.checked?(true):(false);if(Array.isArray($$a)){var $$v=null,$$i=_vm._i($$a,$$v);if($$el.checked){$$i<0&&(_vm.inputValue=$$a.concat([$$v]));}else {$$i>-1&&(_vm.inputValue=$$a.slice(0,$$i).concat($$a.slice($$i+1)));}}else {_vm.inputValue=$$c;}}}},'input',_vm.searchInputAttributes,false)):(((_vm.searchInputAttributes).type)==='radio')?_c('input',_vm._b({directives:[{name:"model",rawName:"v-model",value:(_vm.inputValue),expression:"inputValue"}],ref:"input",staticClass:"gl-filtered-search-token-segment-input",class:{ 'gl-filtered-search-token-segment-input-disabled': _vm.viewOnly },attrs:{"data-testid":"filtered-search-token-segment-input","aria-label":_vm.label,"disabled":_vm.viewOnly,"type":"radio"},domProps:{"checked":_vm._q(_vm.inputValue,null)},on:{"keydown":_vm.handleInputKeydown,"blur":_vm.handleBlur,"change":function($event){_vm.inputValue=null;}}},'input',_vm.searchInputAttributes,false)):_c('input',_vm._b({directives:[{name:"model",rawName:"v-model",value:(_vm.inputValue),expression:"inputValue"}],ref:"input",staticClass:"gl-filtered-search-token-segment-input",class:{ 'gl-filtered-search-token-segment-input-disabled': _vm.viewOnly },attrs:{"data-testid":"filtered-search-token-segment-input","aria-label":_vm.label,"disabled":_vm.viewOnly,"type":(_vm.searchInputAttributes).type},domProps:{"value":(_vm.inputValue)},on:{"keydown":_vm.handleInputKeydown,"blur":_vm.handleBlur,"input":function($event){if($event.target.composing){ return; }_vm.inputValue=$event.target.value;}}},'input',_vm.searchInputAttributes,false))]},null,{ submitValue: _vm.applySuggestion }),_vm._v(" "),_c('portal',{key:("operator-" + _vm._uid),attrs:{"to":_vm.portalName}},[(_vm.hasOptionsOrSuggestions)?_c('gl-filtered-search-suggestion-list',{key:("operator-" + _vm._uid),ref:"suggestions",attrs:{"role":"list","tabindex":"
|
|
412
|
+
},attrs:{"data-testid":"filtered-search-token-segment"}},'div',_vm.containerAttributes,false),_vm.viewOnly ? {} : { mousedown: _vm.emitIfInactive }),[(_vm.active)?[_vm._t("before-input",null,null,{ submitValue: _vm.applySuggestion }),_vm._v(" "),_vm._t("input",function(){return [(((_vm.searchInputAttributes).type)==='checkbox')?_c('input',_vm._b({directives:[{name:"model",rawName:"v-model",value:(_vm.inputValue),expression:"inputValue"}],ref:"input",staticClass:"gl-filtered-search-token-segment-input",class:{ 'gl-filtered-search-token-segment-input-disabled': _vm.viewOnly },attrs:{"data-testid":"filtered-search-token-segment-input","aria-label":_vm.label,"disabled":_vm.viewOnly,"type":"checkbox"},domProps:{"checked":Array.isArray(_vm.inputValue)?_vm._i(_vm.inputValue,null)>-1:(_vm.inputValue)},on:{"keydown":_vm.handleInputKeydown,"blur":_vm.handleBlur,"change":function($event){var $$a=_vm.inputValue,$$el=$event.target,$$c=$$el.checked?(true):(false);if(Array.isArray($$a)){var $$v=null,$$i=_vm._i($$a,$$v);if($$el.checked){$$i<0&&(_vm.inputValue=$$a.concat([$$v]));}else {$$i>-1&&(_vm.inputValue=$$a.slice(0,$$i).concat($$a.slice($$i+1)));}}else {_vm.inputValue=$$c;}}}},'input',_vm.searchInputAttributes,false)):(((_vm.searchInputAttributes).type)==='radio')?_c('input',_vm._b({directives:[{name:"model",rawName:"v-model",value:(_vm.inputValue),expression:"inputValue"}],ref:"input",staticClass:"gl-filtered-search-token-segment-input",class:{ 'gl-filtered-search-token-segment-input-disabled': _vm.viewOnly },attrs:{"data-testid":"filtered-search-token-segment-input","aria-label":_vm.label,"disabled":_vm.viewOnly,"type":"radio"},domProps:{"checked":_vm._q(_vm.inputValue,null)},on:{"keydown":_vm.handleInputKeydown,"blur":_vm.handleBlur,"change":function($event){_vm.inputValue=null;}}},'input',_vm.searchInputAttributes,false)):_c('input',_vm._b({directives:[{name:"model",rawName:"v-model",value:(_vm.inputValue),expression:"inputValue"}],ref:"input",staticClass:"gl-filtered-search-token-segment-input",class:{ 'gl-filtered-search-token-segment-input-disabled': _vm.viewOnly },attrs:{"data-testid":"filtered-search-token-segment-input","aria-label":_vm.label,"disabled":_vm.viewOnly,"type":(_vm.searchInputAttributes).type},domProps:{"value":(_vm.inputValue)},on:{"keydown":_vm.handleInputKeydown,"blur":_vm.handleBlur,"input":function($event){if($event.target.composing){ return; }_vm.inputValue=$event.target.value;}}},'input',_vm.searchInputAttributes,false))]},null,{ submitValue: _vm.applySuggestion }),_vm._v(" "),_c('portal',{key:("operator-" + _vm._uid),attrs:{"to":_vm.portalName}},[(_vm.hasOptionsOrSuggestions)?_c('gl-filtered-search-suggestion-list',{key:("operator-" + _vm._uid),ref:"suggestions",attrs:{"role":"list","tabindex":"-1","data-testid":"filtered-search-suggestion-list","initial-value":_vm.defaultSuggestedValue},on:{"suggestion":_vm.applySuggestion}},[(_vm.options)?[_vm._l((_vm.options),function(option,idx){return [(_vm.showHeader(option))?[(idx > 0)?_c('li',{key:("separator-" + idx)},[_c('hr',{staticClass:"gl-border-t -gl-mx-2 gl-my-2"})]):_vm._e(),_vm._v(" "),_c('li',{key:("header-" + idx),staticClass:"gl-mx-0 gl-pb-2 gl-pl-5 gl-pt-3 gl-text-sm gl-font-bold gl-text-strong",attrs:{"role":"presentation","data-testid":"filtered-search-section-header"}},[_vm._v("\n "+_vm._s(option.title)+"\n ")])]:_c('gl-filtered-search-suggestion',{key:((option.value) + "-" + idx),attrs:{"value":option.value,"icon-name":option.icon}},[_vm._t("option",function(){return [(option.component)?[_c(option.component,{tag:"component",attrs:{"option":option}})]:[_vm._v("\n "+_vm._s(option[_vm.optionTextField])+"\n ")]]},null,{ option: option })],2)]})]:_vm._t("suggestions")],2):_vm._e()],1)]:_vm._t("view",function(){return [_vm._v(_vm._s(_vm.inputValue))]},null,{ label: _vm.label, inputValue: _vm.inputValue })],2)};
|
|
413
413
|
var __vue_staticRenderFns__ = [];
|
|
414
414
|
|
|
415
415
|
/* style */
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { uniqueId, isBoolean } from 'lodash-es';
|
|
2
|
-
import { looseEqual } from '../../../../
|
|
3
|
-
import { looseIndexOf } from '../../../../vendor/bootstrap-vue/src/utils/loose-index-of';
|
|
2
|
+
import { looseIndexOf, looseEqual } from '../../../../utils/equality_utils';
|
|
4
3
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
5
4
|
|
|
6
5
|
var script = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { uniqueId, isBoolean, omit, pick } from 'lodash-es';
|
|
2
|
-
import { looseEqual } from '../../../../
|
|
2
|
+
import { looseEqual } from '../../../../utils/equality_utils';
|
|
3
3
|
import { formOptionsMixin } from '../../../../vendor/bootstrap-vue/src/mixins/form-options';
|
|
4
4
|
import { SafeHtmlDirective } from '../../../../directives/safe_html/safe_html';
|
|
5
5
|
import GlFormCheckbox from './form_checkbox';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { uniqueId, isBoolean } from 'lodash-es';
|
|
2
|
-
import { looseEqual } from '../../../../
|
|
2
|
+
import { looseEqual } from '../../../../utils/equality_utils';
|
|
3
3
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
4
4
|
|
|
5
5
|
var script = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { uniqueId, isBoolean, omit, pick } from 'lodash-es';
|
|
2
|
-
import { looseEqual } from '../../../../
|
|
2
|
+
import { looseEqual } from '../../../../utils/equality_utils';
|
|
3
3
|
import { formOptionsMixin } from '../../../../vendor/bootstrap-vue/src/mixins/form-options';
|
|
4
4
|
import { SafeHtmlDirective } from '../../../../directives/safe_html/safe_html';
|
|
5
5
|
import GlFormRadio from '../form_radio/form_radio';
|