@gitlab/ui 47.0.1 → 48.1.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 +20 -0
- package/README.md +6 -6
- package/dist/components/base/new_dropdowns/listbox/listbox.js +14 -1
- package/dist/index.css.map +1 -1
- package/dist/utility_classes.css.map +1 -1
- package/package.json +2 -2
- package/src/components/base/new_dropdowns/listbox/listbox.spec.js +20 -4
- package/src/components/base/new_dropdowns/listbox/listbox.stories.js +18 -30
- package/src/components/base/new_dropdowns/listbox/listbox.vue +26 -4
- package/src/scss/utility-mixins/index.scss +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
# [48.1.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v48.0.0...v48.1.0) (2022-10-21)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* Add table utility classes ([2fcde37](https://gitlab.com/gitlab-org/gitlab-ui/commit/2fcde37120ae6f69929d4d7724a78e49ab0cd1ab))
|
|
7
|
+
|
|
8
|
+
# [48.0.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v47.0.1...v48.0.0) (2022-10-19)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **GlListbox:** convert header slot to a prop ([976250e](https://gitlab.com/gitlab-org/gitlab-ui/commit/976250ef04e72f0899762669aa16defb3a599c1e))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### BREAKING CHANGES
|
|
17
|
+
|
|
18
|
+
* **GlListbox:** GlListbox usages should be updated to pass the header
|
|
19
|
+
via the `headerText` prop instead of the `header` slot.
|
|
20
|
+
|
|
1
21
|
## [47.0.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v47.0.0...v47.0.1) (2022-10-18)
|
|
2
22
|
|
|
3
23
|
|
package/README.md
CHANGED
|
@@ -72,19 +72,19 @@ Go to <http://localhost:9001/>
|
|
|
72
72
|
Components’ unit tests live in the `tests/components`. The tests are organized following the same
|
|
73
73
|
directory structure used to organize components.
|
|
74
74
|
|
|
75
|
-
`yarn test:unit` runs all unit tests.
|
|
75
|
+
- `yarn test:unit` runs all unit tests.
|
|
76
76
|
|
|
77
|
-
`yarn test:unit:watch` runs all unit tests in watch mode.
|
|
77
|
+
- `yarn test:unit:watch` runs all unit tests in watch mode.
|
|
78
78
|
|
|
79
|
-
`yarn test:unit:debug` runs all unit tests and allow to attach a debugger to the test runner process.
|
|
79
|
+
- `yarn test:unit:debug` runs all unit tests and allow to attach a debugger to the test runner process.
|
|
80
80
|
|
|
81
|
-
`yarn jest [name_pattern]` runs spec files that match the specified name pattern.
|
|
81
|
+
- `yarn jest [name_pattern]` runs spec files that match the specified name pattern.
|
|
82
82
|
|
|
83
83
|
#### Examples
|
|
84
84
|
|
|
85
|
-
`yarn jest datepicker` will match all spec files with a name that contains the word _datepicker_.
|
|
85
|
+
- `yarn jest datepicker` will match all spec files with a name that contains the word _datepicker_.
|
|
86
86
|
|
|
87
|
-
`yarn jest datepicker -t "when draw event is emitted"` goes a step further and only runs the test
|
|
87
|
+
- `yarn jest datepicker -t "when draw event is emitted"` goes a step further and only runs the test
|
|
88
88
|
with a description that matches the argument passed to the `t` flag.
|
|
89
89
|
|
|
90
90
|
### SCSS tests
|
|
@@ -12,9 +12,11 @@ import { itemsValidator, isOption, flattenedOptions } from './utils';
|
|
|
12
12
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
13
13
|
|
|
14
14
|
const ITEM_SELECTOR = '[role="option"]';
|
|
15
|
+
const HEADER_ITEMS_BORDER_CLASSES = ['gl-border-b-1', 'gl-border-b-solid', 'gl-border-b-gray-200'];
|
|
15
16
|
const GROUP_TOP_BORDER_CLASSES = ['gl-border-t', 'gl-pt-3', 'gl-mt-3'];
|
|
16
17
|
const SEARCH_INPUT_SELECTOR = '.gl-search-box-by-type-input';
|
|
17
18
|
var script = {
|
|
19
|
+
HEADER_ITEMS_BORDER_CLASSES,
|
|
18
20
|
events: {
|
|
19
21
|
GL_DROPDOWN_SHOWN,
|
|
20
22
|
GL_DROPDOWN_HIDDEN
|
|
@@ -77,6 +79,13 @@ var script = {
|
|
|
77
79
|
default: false
|
|
78
80
|
},
|
|
79
81
|
|
|
82
|
+
/** The header text */
|
|
83
|
+
headerText: {
|
|
84
|
+
type: String,
|
|
85
|
+
required: false,
|
|
86
|
+
default: ''
|
|
87
|
+
},
|
|
88
|
+
|
|
80
89
|
/**
|
|
81
90
|
* Styling option - dropdown's toggle category
|
|
82
91
|
*/
|
|
@@ -278,6 +287,10 @@ var script = {
|
|
|
278
287
|
|
|
279
288
|
announceSRSearchResults() {
|
|
280
289
|
return this.searchable && !this.showNoResultsText && this.$scopedSlots['search-summary-sr-only'];
|
|
290
|
+
},
|
|
291
|
+
|
|
292
|
+
headerId() {
|
|
293
|
+
return this.headerText && _uniqueId('listbox-header-');
|
|
281
294
|
}
|
|
282
295
|
|
|
283
296
|
},
|
|
@@ -467,7 +480,7 @@ var script = {
|
|
|
467
480
|
const __vue_script__ = script;
|
|
468
481
|
|
|
469
482
|
/* template */
|
|
470
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-base-dropdown',{ref:"baseDropdown",attrs:{"aria-haspopup":"listbox","aria-labelledby":_vm.toggleAriaLabelledBy,"toggle-id":_vm.toggleId,"toggle-text":_vm.listboxToggleText,"toggle-class":_vm.toggleClass,"text-sr-only":_vm.textSrOnly,"category":_vm.category,"variant":_vm.variant,"size":_vm.size,"icon":_vm.icon,"disabled":_vm.disabled,"loading":_vm.loading,"no-caret":_vm.noCaret,"right":_vm.right},on:_vm._d({},[_vm.$options.events.GL_DROPDOWN_SHOWN,_vm.onShow,_vm.$options.events.GL_DROPDOWN_HIDDEN,_vm.onHide])},[_vm.
|
|
483
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-base-dropdown',{ref:"baseDropdown",attrs:{"aria-haspopup":"listbox","aria-labelledby":_vm.toggleAriaLabelledBy,"toggle-id":_vm.toggleId,"toggle-text":_vm.listboxToggleText,"toggle-class":_vm.toggleClass,"text-sr-only":_vm.textSrOnly,"category":_vm.category,"variant":_vm.variant,"size":_vm.size,"icon":_vm.icon,"disabled":_vm.disabled,"loading":_vm.loading,"no-caret":_vm.noCaret,"right":_vm.right},on:_vm._d({},[_vm.$options.events.GL_DROPDOWN_SHOWN,_vm.onShow,_vm.$options.events.GL_DROPDOWN_HIDDEN,_vm.onHide])},[(_vm.headerText)?_c('div',{staticClass:"gl-display-flex gl-align-items-center gl-p-3",class:_vm.$options.HEADER_ITEMS_BORDER_CLASSES},[_c('div',{staticClass:"gl-flex-grow-1 gl-font-weight-bold gl-font-sm",attrs:{"id":_vm.headerId,"data-testid":"listbox-header-text"}},[_vm._v("\n "+_vm._s(_vm.headerText)+"\n ")])]):_vm._e(),_vm._v(" "),(_vm.searchable)?_c('div',{class:_vm.$options.HEADER_ITEMS_BORDER_CLASSES},[_c('gl-search-box-by-type',{ref:"searchBox",attrs:{"aria-owns":_vm.listboxId,"data-testid":"listbox-search-input"},on:{"input":_vm.search,"keydown":_vm.onKeydown},model:{value:(_vm.searchStr),callback:function ($$v) {_vm.searchStr=$$v;},expression:"searchStr"}}),_vm._v(" "),(_vm.searching)?_c('gl-loading-icon',{staticClass:"gl-my-3",attrs:{"data-testid":"listbox-search-loader","size":"md"}}):_vm._e()],1):_vm._e(),_vm._v(" "),(_vm.showList)?_c(_vm.listboxTag,{ref:"list",tag:"component",staticClass:"gl-new-dropdown-contents gl-list-style-none gl-pl-0 gl-mb-0",attrs:{"id":"listbox","aria-labelledby":_vm.listAriaLabelledBy || _vm.headerId || _vm.toggleId,"role":"listbox","tabindex":"-1"},on:{"keydown":_vm.onKeydown}},[_vm._l((_vm.items),function(item,index){return [(_vm.isOption(item))?[_c('gl-listbox-item',{key:item.value,attrs:{"is-selected":_vm.isSelected(item),"is-focused":_vm.isFocused(item),"is-check-centered":_vm.isCheckCentered},on:{"select":function($event){return _vm.onSelect(item, $event)}}},[_vm._t("list-item",function(){return [_vm._v("\n "+_vm._s(item.text)+"\n ")]},{"item":item})],2)]:[_c('gl-listbox-group',{key:item.text,class:_vm.groupClasses(index),attrs:{"name":item.text},scopedSlots:_vm._u([(_vm.$scopedSlots['group-label'])?{key:"group-label",fn:function(){return [_vm._t("group-label",null,{"group":item})]},proxy:true}:null],null,true)},[_vm._v(" "),_vm._l((item.options),function(option){return _c('gl-listbox-item',{key:option.value,attrs:{"is-selected":_vm.isSelected(option),"is-focused":_vm.isFocused(option),"is-check-centered":_vm.isCheckCentered},on:{"select":function($event){return _vm.onSelect(option, $event)}}},[_vm._t("list-item",function(){return [_vm._v("\n "+_vm._s(option.text)+"\n ")]},{"item":option})],2)})],2)]]})],2):_vm._e(),_vm._v(" "),(_vm.announceSRSearchResults)?_c('span',{staticClass:"gl-sr-only",attrs:{"data-testid":"listbox-number-of-results","aria-live":"assertive"}},[_vm._t("search-summary-sr-only")],2):(_vm.showNoResultsText)?_c('div',{staticClass:"gl-pl-7 gl-pr-5 gl-pt-3 gl-font-base gl-text-gray-600",attrs:{"aria-live":"assertive","data-testid":"listbox-no-results-text"}},[_vm._v("\n "+_vm._s(_vm.noResultsText)+"\n ")]):_vm._e(),_vm._v(" "),_vm._t("footer")],2)};
|
|
471
484
|
var __vue_staticRenderFns__ = [];
|
|
472
485
|
|
|
473
486
|
/* style */
|