@gitlab/ui 71.1.0 → 71.1.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 +7 -0
- package/dist/components/base/filtered_search/filtered_search_term.js +6 -3
- package/dist/components/base/filtered_search/filtered_search_token.js +8 -5
- package/dist/tokens/css/tokens.css +1 -1
- package/dist/tokens/css/tokens.dark.css +1 -1
- package/dist/tokens/js/tokens.dark.js +1 -1
- package/dist/tokens/js/tokens.js +1 -1
- package/dist/tokens/scss/_tokens.dark.scss +1 -1
- package/dist/tokens/scss/_tokens.scss +1 -1
- package/package.json +2 -2
- package/src/components/base/filtered_search/filtered_search.spec.js +1 -1
- package/src/components/base/filtered_search/filtered_search_term.vue +7 -3
- package/src/components/base/filtered_search/filtered_search_token.spec.js +1 -0
- package/src/components/base/filtered_search/filtered_search_token.vue +10 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [71.1.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v71.1.0...v71.1.1) (2023-11-28)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **GlFilteredSearch:** Make close button keyboard accessible ([78d809c](https://gitlab.com/gitlab-org/gitlab-ui/commit/78d809ccd7065ee61c90e09f48daa014f697557a))
|
|
7
|
+
|
|
1
8
|
# [71.1.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v71.0.0...v71.1.0) (2023-11-24)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -122,7 +122,8 @@ var script = {
|
|
|
122
122
|
},
|
|
123
123
|
eventListeners() {
|
|
124
124
|
return this.viewOnly ? {} : {
|
|
125
|
-
mousedown: this.
|
|
125
|
+
mousedown: this.stopMousedownOnCloseButton,
|
|
126
|
+
close: this.destroyByClose
|
|
126
127
|
};
|
|
127
128
|
}
|
|
128
129
|
},
|
|
@@ -139,12 +140,14 @@ var script = {
|
|
|
139
140
|
intent: INTENT_ACTIVATE_PREVIOUS
|
|
140
141
|
});
|
|
141
142
|
},
|
|
142
|
-
|
|
143
|
+
stopMousedownOnCloseButton(event) {
|
|
143
144
|
if (event.target.closest(TOKEN_CLOSE_SELECTOR)) {
|
|
144
145
|
stopEvent(event);
|
|
145
|
-
this.$emit('destroy');
|
|
146
146
|
}
|
|
147
147
|
},
|
|
148
|
+
destroyByClose() {
|
|
149
|
+
this.$emit('destroy');
|
|
150
|
+
},
|
|
148
151
|
onComplete(type) {
|
|
149
152
|
if (type === TERM_TOKEN_TYPE) {
|
|
150
153
|
// We've completed this term token
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import cloneDeep from 'lodash/cloneDeep';
|
|
2
2
|
import isEqual from 'lodash/isEqual';
|
|
3
3
|
import GlToken from '../token/token';
|
|
4
|
+
import { stopEvent } from '../../../utils/utils';
|
|
4
5
|
import GlFilteredSearchTokenSegment from './filtered_search_token_segment';
|
|
5
6
|
import { tokenToOption, createTerm, TOKEN_CLOSE_SELECTOR } from './filtered_search_utils';
|
|
6
7
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
@@ -116,7 +117,8 @@ var script = {
|
|
|
116
117
|
},
|
|
117
118
|
eventListeners() {
|
|
118
119
|
return this.viewOnly ? {} : {
|
|
119
|
-
mousedown: this.
|
|
120
|
+
mousedown: this.stopMousedownOnCloseButton,
|
|
121
|
+
close: this.destroyByClose
|
|
120
122
|
};
|
|
121
123
|
}
|
|
122
124
|
},
|
|
@@ -315,12 +317,13 @@ var script = {
|
|
|
315
317
|
*/
|
|
316
318
|
this.$emit('complete');
|
|
317
319
|
},
|
|
318
|
-
|
|
320
|
+
stopMousedownOnCloseButton(event) {
|
|
319
321
|
if (event.target.closest(TOKEN_CLOSE_SELECTOR)) {
|
|
320
|
-
event
|
|
321
|
-
event.stopPropagation();
|
|
322
|
-
this.$emit('destroy');
|
|
322
|
+
stopEvent(event);
|
|
323
323
|
}
|
|
324
|
+
},
|
|
325
|
+
destroyByClose() {
|
|
326
|
+
this.$emit('destroy');
|
|
324
327
|
}
|
|
325
328
|
}
|
|
326
329
|
};
|
package/dist/tokens/js/tokens.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "71.1.
|
|
3
|
+
"version": "71.1.1",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
"babel-loader": "^8.0.5",
|
|
123
123
|
"babel-plugin-require-context-hook": "^1.0.0",
|
|
124
124
|
"bootstrap": "4.6.2",
|
|
125
|
-
"cypress": "13.
|
|
125
|
+
"cypress": "13.6.0",
|
|
126
126
|
"cypress-axe": "^1.4.0",
|
|
127
127
|
"cypress-real-events": "^1.11.0",
|
|
128
128
|
"dompurify": "^3.0.0",
|
|
@@ -809,7 +809,7 @@ describe('Filtered search integration tests', () => {
|
|
|
809
809
|
wrapper.findAllComponents(GlFilteredSearchToken).wrappers.map((cmp) => cmp.props('active'))
|
|
810
810
|
).toEqual([false, false, false]);
|
|
811
811
|
|
|
812
|
-
await wrapper.find('.gl-token-close').trigger('
|
|
812
|
+
await wrapper.find('.gl-token-close').trigger('click');
|
|
813
813
|
|
|
814
814
|
expect(
|
|
815
815
|
wrapper.findAllComponents(GlFilteredSearchToken).wrappers.map((cmp) => cmp.props('active'))
|
|
@@ -125,7 +125,9 @@ export default {
|
|
|
125
125
|
},
|
|
126
126
|
},
|
|
127
127
|
eventListeners() {
|
|
128
|
-
return this.viewOnly
|
|
128
|
+
return this.viewOnly
|
|
129
|
+
? {}
|
|
130
|
+
: { mousedown: this.stopMousedownOnCloseButton, close: this.destroyByClose };
|
|
129
131
|
},
|
|
130
132
|
},
|
|
131
133
|
methods: {
|
|
@@ -139,12 +141,14 @@ export default {
|
|
|
139
141
|
*/
|
|
140
142
|
this.$emit('destroy', { intent: INTENT_ACTIVATE_PREVIOUS });
|
|
141
143
|
},
|
|
142
|
-
|
|
144
|
+
stopMousedownOnCloseButton(event) {
|
|
143
145
|
if (event.target.closest(TOKEN_CLOSE_SELECTOR)) {
|
|
144
146
|
stopEvent(event);
|
|
145
|
-
this.$emit('destroy');
|
|
146
147
|
}
|
|
147
148
|
},
|
|
149
|
+
destroyByClose() {
|
|
150
|
+
this.$emit('destroy');
|
|
151
|
+
},
|
|
148
152
|
onComplete(type) {
|
|
149
153
|
if (type === TERM_TOKEN_TYPE) {
|
|
150
154
|
// We've completed this term token
|
|
@@ -274,6 +274,7 @@ describe('Filtered search token', () => {
|
|
|
274
274
|
preventDefault: preventDefaultSpy,
|
|
275
275
|
stopPropagation: stopPropagationSpy,
|
|
276
276
|
});
|
|
277
|
+
closeWrapper.trigger('click');
|
|
277
278
|
|
|
278
279
|
expect(preventDefaultSpy).toHaveBeenCalled();
|
|
279
280
|
expect(stopPropagationSpy).toHaveBeenCalled();
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import cloneDeep from 'lodash/cloneDeep';
|
|
3
3
|
import isEqual from 'lodash/isEqual';
|
|
4
4
|
import GlToken from '../token/token.vue';
|
|
5
|
+
import { stopEvent } from '../../../utils/utils';
|
|
5
6
|
import GlFilteredSearchTokenSegment from './filtered_search_token_segment.vue';
|
|
6
7
|
import { createTerm, tokenToOption, TOKEN_CLOSE_SELECTOR } from './filtered_search_utils';
|
|
7
8
|
|
|
@@ -118,7 +119,9 @@ export default {
|
|
|
118
119
|
},
|
|
119
120
|
|
|
120
121
|
eventListeners() {
|
|
121
|
-
return this.viewOnly
|
|
122
|
+
return this.viewOnly
|
|
123
|
+
? {}
|
|
124
|
+
: { mousedown: this.stopMousedownOnCloseButton, close: this.destroyByClose };
|
|
122
125
|
},
|
|
123
126
|
},
|
|
124
127
|
segments: {
|
|
@@ -310,13 +313,15 @@ export default {
|
|
|
310
313
|
this.$emit('complete');
|
|
311
314
|
},
|
|
312
315
|
|
|
313
|
-
|
|
316
|
+
stopMousedownOnCloseButton(event) {
|
|
314
317
|
if (event.target.closest(TOKEN_CLOSE_SELECTOR)) {
|
|
315
|
-
event
|
|
316
|
-
event.stopPropagation();
|
|
317
|
-
this.$emit('destroy');
|
|
318
|
+
stopEvent(event);
|
|
318
319
|
}
|
|
319
320
|
},
|
|
321
|
+
|
|
322
|
+
destroyByClose() {
|
|
323
|
+
this.$emit('destroy');
|
|
324
|
+
},
|
|
320
325
|
},
|
|
321
326
|
};
|
|
322
327
|
</script>
|