@gitlab/ui 49.10.0 → 49.11.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 +14 -0
- package/dist/components/base/filtered_search/filtered_search_token.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +3 -3
- package/src/components/base/filtered_search/filtered_search_token.spec.js +17 -0
- package/src/components/base/filtered_search/filtered_search_token.vue +2 -2
- package/src/index.js +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [49.11.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v49.10.1...v49.11.0) (2022-11-16)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **GlListbox:** Add GlCollapsibleListbox alias ([b83558f](https://gitlab.com/gitlab-org/gitlab-ui/commit/b83558f62656b68cd7e9480f148903905cf3a53f))
|
|
7
|
+
|
|
8
|
+
## [49.10.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v49.10.0...v49.10.1) (2022-11-15)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **GlFilteredSearch:** Show operator friendly text first ([9cbe638](https://gitlab.com/gitlab-org/gitlab-ui/commit/9cbe63855c9958a4ebc685e01c1414eca9921739))
|
|
14
|
+
|
|
1
15
|
# [49.10.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v49.9.1...v49.10.0) (2022-11-15)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -321,7 +321,7 @@ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=
|
|
|
321
321
|
var inputValue = ref.inputValue;
|
|
322
322
|
return [_c('gl-token',{staticClass:"gl-filtered-search-token-type",class:_vm.getAdditionalSegmentClasses(_vm.$options.segments.SEGMENT_TITLE),attrs:{"view-only":""}},[_vm._v("\n "+_vm._s(inputValue)+"\n ")])]}}])}),_vm._v(" "),_c('gl-filtered-search-token-segment',{key:"operator-segment",attrs:{"active":_vm.isSegmentActive(_vm.$options.segments.SEGMENT_OPERATOR),"cursor-position":_vm.intendedCursorPosition,"options":_vm.operators,"custom-input-keydown-handler":_vm.handleOperatorKeydown,"view-only":_vm.viewOnly},on:{"activate":function($event){return _vm.activateSegment(_vm.$options.segments.SEGMENT_OPERATOR)},"backspace":_vm.replaceWithTermIfEmpty,"complete":function($event){return _vm.activateSegment(_vm.$options.segments.SEGMENT_DATA)},"deactivate":function($event){return _vm.$emit('deactivate')},"previous":_vm.activatePreviousTitleSegment,"next":_vm.activateNextDataSegment},scopedSlots:_vm._u([{key:"view",fn:function(){return [_c('gl-token',{staticClass:"gl-filtered-search-token-operator",class:_vm.getAdditionalSegmentClasses(_vm.$options.segments.SEGMENT_OPERATOR),attrs:{"variant":"search-value","view-only":""}},[_vm._v("\n "+_vm._s(_vm.operatorDescription)+"\n ")])]},proxy:true},{key:"option",fn:function(ref){
|
|
323
323
|
var option = ref.option;
|
|
324
|
-
return [_c('div',{staticClass:"gl-display-flex"},[_vm._v("\n "+_vm._s(option.value)+"\n "),(option.description)?_c('span',{staticClass:"gl-filtered-search-token-operator-description"},[_vm._v("\n "+_vm._s(option.description)+"\n ")]):_vm._e()])]}}]),model:{value:(_vm.tokenValue.operator),callback:function ($$v) {_vm.$set(_vm.tokenValue, "operator", $$v);},expression:"tokenValue.operator"}}),_vm._v(" "),(_vm.hasDataOrDataSegmentIsCurrentlyActive)?_c('gl-filtered-search-token-segment',{key:"data-segment",attrs:{"active":_vm.isSegmentActive(_vm.$options.segments.SEGMENT_DATA),"cursor-position":_vm.intendedCursorPosition,"multi-select":_vm.config.multiSelect,"options":_vm.config.options,"view-only":_vm.viewOnly,"option-text-field":"title"},on:{"activate":_vm.activateDataSegment,"backspace":function($event){return _vm.activateSegment(_vm.$options.segments.SEGMENT_OPERATOR)},"complete":_vm.handleComplete,"select":function($event){return _vm.$emit('select', $event)},"submit":function($event){return _vm.$emit('submit')},"deactivate":function($event){return _vm.$emit('deactivate')},"split":function($event){return _vm.$emit('split', $event)},"previous":_vm.activatePreviousOperatorSegment,"next":function($event){return _vm.$emit('next')}},scopedSlots:_vm._u([{key:"suggestions",fn:function(){return [_vm._t("suggestions")]},proxy:true},{key:"view",fn:function(ref){
|
|
324
|
+
return [_c('div',{staticClass:"gl-display-flex"},[_vm._v("\n "+_vm._s(_vm.showFriendlyText ? option.description : option.value)+"\n "),(option.description)?_c('span',{staticClass:"gl-filtered-search-token-operator-description"},[_vm._v("\n "+_vm._s(_vm.showFriendlyText ? option.value : option.description)+"\n ")]):_vm._e()])]}}]),model:{value:(_vm.tokenValue.operator),callback:function ($$v) {_vm.$set(_vm.tokenValue, "operator", $$v);},expression:"tokenValue.operator"}}),_vm._v(" "),(_vm.hasDataOrDataSegmentIsCurrentlyActive)?_c('gl-filtered-search-token-segment',{key:"data-segment",attrs:{"active":_vm.isSegmentActive(_vm.$options.segments.SEGMENT_DATA),"cursor-position":_vm.intendedCursorPosition,"multi-select":_vm.config.multiSelect,"options":_vm.config.options,"view-only":_vm.viewOnly,"option-text-field":"title"},on:{"activate":_vm.activateDataSegment,"backspace":function($event){return _vm.activateSegment(_vm.$options.segments.SEGMENT_OPERATOR)},"complete":_vm.handleComplete,"select":function($event){return _vm.$emit('select', $event)},"submit":function($event){return _vm.$emit('submit')},"deactivate":function($event){return _vm.$emit('deactivate')},"split":function($event){return _vm.$emit('split', $event)},"previous":_vm.activatePreviousOperatorSegment,"next":function($event){return _vm.$emit('next')}},scopedSlots:_vm._u([{key:"suggestions",fn:function(){return [_vm._t("suggestions")]},proxy:true},{key:"view",fn:function(ref){
|
|
325
325
|
var inputValue = ref.inputValue;
|
|
326
326
|
return [_vm._t("view-token",function(){return [_c('gl-token',_vm._g({staticClass:"gl-filtered-search-token-data",class:_vm.getAdditionalSegmentClasses(_vm.$options.segments.SEGMENT_DATA),attrs:{"variant":"search-value","view-only":_vm.viewOnly}},_vm.eventListeners),[_c('span',{staticClass:"gl-filtered-search-token-data-content"},[_vm._t("view",function(){return [_vm._v(_vm._s(inputValue))]},null,{ inputValue: inputValue })],2)])]},null,{
|
|
327
327
|
inputValue: inputValue,
|
package/dist/index.js
CHANGED
|
@@ -44,7 +44,7 @@ export { default as GlDropdownSectionHeader } from './components/base/dropdown/d
|
|
|
44
44
|
export { default as GlDropdownDivider } from './components/base/dropdown/dropdown_divider';
|
|
45
45
|
export { default as GlDropdownText } from './components/base/dropdown/dropdown_text';
|
|
46
46
|
export { default as GlDropdown } from './components/base/dropdown/dropdown';
|
|
47
|
-
export { default as GlListbox } from './components/base/new_dropdowns/listbox/listbox';
|
|
47
|
+
export { default as GlCollapsibleListbox, default as GlListbox } from './components/base/new_dropdowns/listbox/listbox';
|
|
48
48
|
export { default as GlListboxItem } from './components/base/new_dropdowns/listbox/listbox_item';
|
|
49
49
|
export { default as GlPath } from './components/base/path/path';
|
|
50
50
|
export { default as GlTable } from './components/base/table/table';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "49.
|
|
3
|
+
"version": "49.11.0",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -150,9 +150,9 @@
|
|
|
150
150
|
"stylelint": "14.9.1",
|
|
151
151
|
"stylelint-config-prettier": "9.0.4",
|
|
152
152
|
"stylelint-prettier": "2.0.0",
|
|
153
|
-
"vue": "2.7.
|
|
153
|
+
"vue": "2.7.14",
|
|
154
154
|
"vue-loader": "^15.8.3",
|
|
155
|
-
"vue-template-compiler": "2.7.
|
|
155
|
+
"vue-template-compiler": "2.7.14",
|
|
156
156
|
"vue-test-utils-compat": "^0.0.10"
|
|
157
157
|
},
|
|
158
158
|
"release": {
|
|
@@ -355,4 +355,21 @@ describe('Filtered search token', () => {
|
|
|
355
355
|
}
|
|
356
356
|
);
|
|
357
357
|
});
|
|
358
|
+
|
|
359
|
+
describe('showFriendlyText prop', () => {
|
|
360
|
+
it.each`
|
|
361
|
+
showFriendlyText | operator | text
|
|
362
|
+
${false} | ${'='} | ${'='}
|
|
363
|
+
${false} | ${'!='} | ${'!='}
|
|
364
|
+
${true} | ${'='} | ${'is'}
|
|
365
|
+
${true} | ${'!='} | ${'is not'}
|
|
366
|
+
`(
|
|
367
|
+
'displays "$text" when operator="$operator" and showFriendlyText="$showFriendlyText"',
|
|
368
|
+
({ showFriendlyText, operator, text }) => {
|
|
369
|
+
mountComponent({ value: { operator }, showFriendlyText });
|
|
370
|
+
|
|
371
|
+
expect(findOperatorSegment().text()).toBe(text);
|
|
372
|
+
}
|
|
373
|
+
);
|
|
374
|
+
});
|
|
358
375
|
});
|
|
@@ -376,9 +376,9 @@ export default {
|
|
|
376
376
|
|
|
377
377
|
<template #option="{ option }">
|
|
378
378
|
<div class="gl-display-flex">
|
|
379
|
-
{{ option.value }}
|
|
379
|
+
{{ showFriendlyText ? option.description : option.value }}
|
|
380
380
|
<span v-if="option.description" class="gl-filtered-search-token-operator-description">
|
|
381
|
-
{{ option.description }}
|
|
381
|
+
{{ showFriendlyText ? option.value : option.description }}
|
|
382
382
|
</span>
|
|
383
383
|
</div>
|
|
384
384
|
</template>
|
package/src/index.js
CHANGED
|
@@ -52,7 +52,10 @@ export { default as GlDropdownDivider } from './components/base/dropdown/dropdow
|
|
|
52
52
|
export { default as GlDropdownText } from './components/base/dropdown/dropdown_text.vue';
|
|
53
53
|
export { default as GlDropdown } from './components/base/dropdown/dropdown.vue';
|
|
54
54
|
// new components aiming to replace GlDropdown - start
|
|
55
|
-
export {
|
|
55
|
+
export {
|
|
56
|
+
default as GlListbox,
|
|
57
|
+
default as GlCollapsibleListbox,
|
|
58
|
+
} from './components/base/new_dropdowns/listbox/listbox.vue';
|
|
56
59
|
export { default as GlListboxItem } from './components/base/new_dropdowns/listbox/listbox_item.vue';
|
|
57
60
|
// new components aiming to replace GlDropdown - end
|
|
58
61
|
export { default as GlPath } from './components/base/path/path.vue';
|