@gitlab/ui 42.20.0 → 42.22.1
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 +21 -0
- package/dist/components/base/alert/alert.js +1 -0
- package/dist/components/base/badge/badge.js +1 -0
- package/dist/components/base/button/button.js +2 -0
- package/dist/components/base/drawer/drawer.js +1 -0
- package/dist/components/base/dropdown/dropdown.js +1 -0
- package/dist/components/base/filtered_search/filtered_search_token_segment.js +1 -0
- package/dist/components/base/form/form_combobox/form_combobox.js +31 -35
- package/dist/components/base/form/form_group/form_group.js +1 -0
- package/dist/components/base/modal/modal.js +4 -1
- package/dist/components/base/toggle/toggle.js +1 -0
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/utility_classes.css +1 -1
- package/dist/utility_classes.css.map +1 -1
- package/package.json +3 -3
- package/src/components/base/alert/alert.vue +1 -0
- package/src/components/base/badge/badge.vue +1 -0
- package/src/components/base/button/button.vue +2 -0
- package/src/components/base/carousel/carousel.vue +1 -0
- package/src/components/base/carousel/carousel_slide.vue +1 -0
- package/src/components/base/drawer/drawer.vue +1 -0
- package/src/components/base/dropdown/dropdown.vue +1 -0
- package/src/components/base/filtered_search/filtered_search_token_segment.vue +1 -0
- package/src/components/base/form/form_combobox/form_combobox.scss +1 -5
- package/src/components/base/form/form_combobox/form_combobox.spec.js +26 -14
- package/src/components/base/form/form_combobox/form_combobox.vue +38 -32
- package/src/components/base/form/form_group/form_group.vue +2 -0
- package/src/components/base/form/form_select/form_select.scss +1 -0
- package/src/components/base/form/form_select/form_select.vue +1 -0
- package/src/components/base/modal/modal.vue +3 -0
- package/src/components/base/table/table.scss +4 -0
- package/src/components/base/table/table.stories.js +12 -2
- package/src/components/base/tabs/tab/tab.vue +1 -0
- package/src/components/base/tabs/tabs/scrollable_tabs.vue +1 -0
- package/src/components/base/tabs/tabs/tabs.vue +1 -0
- package/src/components/base/toggle/toggle.vue +1 -0
- package/src/scss/utilities.scss +8 -0
- package/src/scss/utility-mixins/flex.scss +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
## [42.22.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v42.22.0...v42.22.1) (2022-07-19)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **GlTable:** adjust table caption padding ([f74c132](https://gitlab.com/gitlab-org/gitlab-ui/commit/f74c13229724070ec76534eb3f8ff37ef1f20d41))
|
|
7
|
+
|
|
8
|
+
# [42.22.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v42.21.0...v42.22.0) (2022-07-15)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **css:** add gl-flex-basis-third ([e457c39](https://gitlab.com/gitlab-org/gitlab-ui/commit/e457c39a51bb0b87035bbbff52785565e0f7478e))
|
|
14
|
+
|
|
15
|
+
# [42.21.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v42.20.0...v42.21.0) (2022-07-14)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* **css:** Added background no repeat to select dropdown ([5a3fdf9](https://gitlab.com/gitlab-org/gitlab-ui/commit/5a3fdf90edf5329822afb04503e5c7bc7847c695))
|
|
21
|
+
|
|
1
22
|
# [42.20.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v42.19.0...v42.20.0) (2022-07-13)
|
|
2
23
|
|
|
3
24
|
|
|
@@ -70,6 +70,7 @@ var script = {
|
|
|
70
70
|
},
|
|
71
71
|
|
|
72
72
|
hasIconOnly() {
|
|
73
|
+
// eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots
|
|
73
74
|
return Object.keys(this.$slots).length === 0 && this.hasIcon;
|
|
74
75
|
},
|
|
75
76
|
|
|
@@ -105,6 +106,7 @@ var script = {
|
|
|
105
106
|
},
|
|
106
107
|
|
|
107
108
|
mounted() {
|
|
109
|
+
// eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots
|
|
108
110
|
if (!this.$slots.default && !this.$attrs['aria-label'] && !this.$props.label) {
|
|
109
111
|
logWarning('[gl-button]: Accessible name missing. Please add inner text or aria-label.');
|
|
110
112
|
}
|
|
@@ -126,6 +126,7 @@ var script = {
|
|
|
126
126
|
hasOptionsOrSuggestions() {
|
|
127
127
|
var _this$options2;
|
|
128
128
|
|
|
129
|
+
// eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots
|
|
129
130
|
return ((_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2.length) || this.$slots.suggestions;
|
|
130
131
|
},
|
|
131
132
|
|
|
@@ -53,6 +53,15 @@ var script = {
|
|
|
53
53
|
type: Boolean,
|
|
54
54
|
required: false,
|
|
55
55
|
default: false
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Placeholder text for input field
|
|
60
|
+
*/
|
|
61
|
+
placeholder: {
|
|
62
|
+
type: String,
|
|
63
|
+
required: false,
|
|
64
|
+
default: undefined
|
|
56
65
|
}
|
|
57
66
|
},
|
|
58
67
|
|
|
@@ -94,17 +103,8 @@ var script = {
|
|
|
94
103
|
},
|
|
95
104
|
watch: {
|
|
96
105
|
tokenList(newList) {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
// For API driven tokens, we don't need extra filtering
|
|
100
|
-
return token;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
return token.toLowerCase().includes(this.value.toLowerCase());
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
if (filteredTokens.length) {
|
|
107
|
-
this.openSuggestions(filteredTokens);
|
|
106
|
+
if (newList.length) {
|
|
107
|
+
this.openSuggestions(newList);
|
|
108
108
|
} else {
|
|
109
109
|
this.results = [];
|
|
110
110
|
this.arrowCounter = -1;
|
|
@@ -134,42 +134,34 @@ var script = {
|
|
|
134
134
|
}
|
|
135
135
|
},
|
|
136
136
|
|
|
137
|
-
|
|
138
|
-
var _this$$refs$
|
|
137
|
+
focusItem(index) {
|
|
138
|
+
var _this$$refs$suggestio;
|
|
139
139
|
|
|
140
|
-
|
|
140
|
+
(_this$$refs$suggestio = this.$refs.suggestionsMenu.querySelectorAll('.gl-new-dropdown-item')[index]) === null || _this$$refs$suggestio === void 0 ? void 0 : _this$$refs$suggestio.querySelector('button').focus();
|
|
141
|
+
},
|
|
142
|
+
|
|
143
|
+
onArrowDown(e) {
|
|
144
|
+
e.preventDefault();
|
|
145
|
+
let newCount = this.arrowCounter + 1;
|
|
141
146
|
|
|
142
147
|
if (newCount >= this.allItems.length) {
|
|
143
|
-
|
|
144
|
-
return;
|
|
148
|
+
newCount = 0;
|
|
145
149
|
}
|
|
146
150
|
|
|
147
151
|
this.arrowCounter = newCount;
|
|
148
|
-
|
|
152
|
+
this.focusItem(newCount);
|
|
149
153
|
},
|
|
150
154
|
|
|
151
|
-
onArrowUp() {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
const newCount = this.arrowCounter - 1;
|
|
155
|
+
onArrowUp(e) {
|
|
156
|
+
e.preventDefault();
|
|
157
|
+
let newCount = this.arrowCounter - 1;
|
|
155
158
|
|
|
156
159
|
if (newCount < 0) {
|
|
157
|
-
|
|
158
|
-
return;
|
|
160
|
+
newCount = this.allItems.length - 1;
|
|
159
161
|
}
|
|
160
162
|
|
|
161
163
|
this.arrowCounter = newCount;
|
|
162
|
-
|
|
163
|
-
},
|
|
164
|
-
|
|
165
|
-
onEnter() {
|
|
166
|
-
const focusedItem = this.allItems[this.arrowCounter] || this.value;
|
|
167
|
-
|
|
168
|
-
if (focusedItem.fn) {
|
|
169
|
-
this.selectAction(focusedItem);
|
|
170
|
-
} else {
|
|
171
|
-
this.selectToken(focusedItem);
|
|
172
|
-
}
|
|
164
|
+
this.focusItem(newCount);
|
|
173
165
|
},
|
|
174
166
|
|
|
175
167
|
onEsc() {
|
|
@@ -224,6 +216,10 @@ var script = {
|
|
|
224
216
|
value.fn();
|
|
225
217
|
this.$emit('input', this.value);
|
|
226
218
|
this.closeSuggestions();
|
|
219
|
+
},
|
|
220
|
+
|
|
221
|
+
resetCounter() {
|
|
222
|
+
this.arrowCounter = -1;
|
|
227
223
|
}
|
|
228
224
|
|
|
229
225
|
}
|
|
@@ -233,7 +229,7 @@ var script = {
|
|
|
233
229
|
const __vue_script__ = script;
|
|
234
230
|
|
|
235
231
|
/* template */
|
|
236
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-form-combobox dropdown",attrs:{"role":"combobox","aria-owns":_vm.suggestionsId,"aria-expanded":_vm.ariaExpanded}},[_c('gl-form-group',{attrs:{"label":_vm.labelText,"label-for":_vm.inputId,"label-sr-only":_vm.labelSrOnly}},[_c('gl-form-input',{attrs:{"id":_vm.inputId,"value":_vm.displayedValue,"type":"text","role":"searchbox","autocomplete":_vm.showAutocomplete,"aria-autocomplete":"list","aria-controls":_vm.suggestionsId,"aria-haspopup":"listbox","autofocus":_vm.autofocus},on:{"input":_vm.onEntry,"keydown":[function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"down",40,$event.key,["Down","ArrowDown"])){ return null; }return _vm.onArrowDown($event)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"up",38,$event.key,["Up","ArrowUp"])){ return null; }return _vm.onArrowUp($event)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"
|
|
232
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-form-combobox dropdown",attrs:{"role":"combobox","aria-owns":_vm.suggestionsId,"aria-expanded":_vm.ariaExpanded}},[_c('gl-form-group',{attrs:{"label":_vm.labelText,"label-for":_vm.inputId,"label-sr-only":_vm.labelSrOnly}},[_c('gl-form-input',{attrs:{"id":_vm.inputId,"value":_vm.displayedValue,"type":"text","role":"searchbox","autocomplete":_vm.showAutocomplete,"aria-autocomplete":"list","aria-controls":_vm.suggestionsId,"aria-haspopup":"listbox","autofocus":_vm.autofocus,"placeholder":_vm.placeholder},on:{"input":_vm.onEntry,"focus":_vm.resetCounter,"keydown":[function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"down",40,$event.key,["Down","ArrowDown"])){ return null; }return _vm.onArrowDown($event)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"up",38,$event.key,["Up","ArrowUp"])){ return null; }return _vm.onArrowUp($event)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"esc",27,$event.key,["Esc","Escape"])){ return null; }$event.stopPropagation();return _vm.onEsc($event)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"tab",9,$event.key,"Tab")){ return null; }return _vm.closeSuggestions($event)}]}})],1),_vm._v(" "),_c('ul',{directives:[{name:"show",rawName:"v-show",value:(_vm.showSuggestions && !_vm.userDismissedResults),expression:"showSuggestions && !userDismissedResults"}],ref:"suggestionsMenu",staticClass:"dropdown-menu gl-w-full gl-form-combobox-inner gl-list-style-none gl-pl-0 gl-mb-0 gl-display-flex gl-flex-direction-column",attrs:{"id":_vm.suggestionsId,"data-testid":"combobox-dropdown"},on:{"keydown":[function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"down",40,$event.key,["Down","ArrowDown"])){ return null; }return _vm.onArrowDown($event)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"up",38,$event.key,["Up","ArrowUp"])){ return null; }return _vm.onArrowUp($event)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"esc",27,$event.key,["Esc","Escape"])){ return null; }$event.stopPropagation();return _vm.onEsc($event)}]}},[_c('li',{staticClass:"gl-overflow-y-auto show-dropdown"},[_c('ul',{staticClass:"gl-list-style-none gl-pl-0 gl-mb-0"},_vm._l((_vm.results),function(result,i){return _c('gl-dropdown-item',{key:i,ref:"results",refInFor:true,attrs:{"role":"option","aria-selected":i === _vm.arrowCounter,"tabindex":"-1"},on:{"click":function($event){return _vm.selectToken(result)}},nativeOn:{"keydown":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }return _vm.selectToken(result)}}},[_vm._t("result",[_vm._v(_vm._s(result))],{"item":result})],2)}),1)]),_vm._v(" "),(_vm.resultsLength > 0 && _vm.actionList.length > 0)?_c('gl-dropdown-divider'):_vm._e(),_vm._v(" "),_c('li',[_c('ul',{staticClass:"gl-list-style-none gl-pl-0 gl-mb-0"},_vm._l((_vm.actionList),function(action,i){return _c('gl-dropdown-item',{key:i + _vm.resultsLength,attrs:{"role":"option","aria-selected":i + _vm.resultsLength === _vm.arrowCounter,"tabindex":"-1","data-testid":"combobox-action"},on:{"click":function($event){return _vm.selectAction(action)}},nativeOn:{"keydown":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }return _vm.selectAction(action)}}},[_vm._t("action",[_vm._v(_vm._s(action.label))],{"item":action})],2)}),1)])],1)],1)};
|
|
237
233
|
var __vue_staticRenderFns__ = [];
|
|
238
234
|
|
|
239
235
|
/* style */
|
|
@@ -84,15 +84,18 @@ var script = {
|
|
|
84
84
|
},
|
|
85
85
|
computed: {
|
|
86
86
|
shouldRenderModalOk() {
|
|
87
|
+
// eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots
|
|
87
88
|
return Boolean(this.$slots['modal-ok']);
|
|
88
89
|
},
|
|
89
90
|
|
|
90
91
|
shouldRenderModalCancel() {
|
|
92
|
+
// eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots
|
|
91
93
|
return Boolean(this.$slots['modal-cancel']);
|
|
92
94
|
},
|
|
93
95
|
|
|
94
96
|
shouldRenderModalFooter() {
|
|
95
|
-
return Boolean(this.actionCancel || this.actionSecondary || this.actionPrimary ||
|
|
97
|
+
return Boolean(this.actionCancel || this.actionSecondary || this.actionPrimary || // eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots
|
|
98
|
+
this.$slots['modal-footer']);
|
|
96
99
|
}
|
|
97
100
|
|
|
98
101
|
},
|