@gitlab/ui 71.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "71.0.0",
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.5.1",
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('mousedown');
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 ? {} : { mousedown: this.destroyByClose };
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
- destroyByClose(event) {
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 ? {} : { mousedown: this.destroyByClose };
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
- destroyByClose(event) {
316
+ stopMousedownOnCloseButton(event) {
314
317
  if (event.target.closest(TOKEN_CLOSE_SELECTOR)) {
315
- event.preventDefault();
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>
@@ -8361,6 +8361,48 @@ $gl-animate-skeleton-loader-max-width: 64 * $grid-size;
8361
8361
  .gl-text-overflow-ellipsis\! {
8362
8362
  text-overflow: ellipsis !important;
8363
8363
  }
8364
+ .gl-line-clamp-1 {
8365
+ white-space: normal;
8366
+ -webkit-line-clamp: 1;
8367
+ -webkit-box-orient: vertical;
8368
+ display: -webkit-box;
8369
+ overflow: hidden;
8370
+ }
8371
+ .gl-line-clamp-1\! {
8372
+ white-space: normal !important;
8373
+ -webkit-line-clamp: 1 !important;
8374
+ -webkit-box-orient: vertical !important;
8375
+ display: -webkit-box !important;
8376
+ overflow: hidden !important;
8377
+ }
8378
+ .gl-line-clamp-2 {
8379
+ white-space: normal;
8380
+ -webkit-line-clamp: 2;
8381
+ -webkit-box-orient: vertical;
8382
+ display: -webkit-box;
8383
+ overflow: hidden;
8384
+ }
8385
+ .gl-line-clamp-2\! {
8386
+ white-space: normal !important;
8387
+ -webkit-line-clamp: 2 !important;
8388
+ -webkit-box-orient: vertical !important;
8389
+ display: -webkit-box !important;
8390
+ overflow: hidden !important;
8391
+ }
8392
+ .gl-line-clamp-3 {
8393
+ white-space: normal;
8394
+ -webkit-line-clamp: 3;
8395
+ -webkit-box-orient: vertical;
8396
+ display: -webkit-box;
8397
+ overflow: hidden;
8398
+ }
8399
+ .gl-line-clamp-3\! {
8400
+ white-space: normal !important;
8401
+ -webkit-line-clamp: 3 !important;
8402
+ -webkit-box-orient: vertical !important;
8403
+ display: -webkit-box !important;
8404
+ overflow: hidden !important;
8405
+ }
8364
8406
  .gl-text-indent-0 {
8365
8407
  text-indent: 0;
8366
8408
  }
@@ -67,6 +67,38 @@
67
67
  text-overflow: ellipsis;
68
68
  }
69
69
 
70
+ /**
71
+ * Line clamp utilities
72
+ *
73
+ * Naming convention: gl-line-clamp-{value}
74
+ */
75
+ @mixin gl-line-clamp-1 {
76
+ white-space: normal;
77
+ -webkit-line-clamp: 1;
78
+ -webkit-box-orient: vertical;
79
+ // stylelint-disable-next-line value-no-vendor-prefix
80
+ display: -webkit-box;
81
+ overflow: hidden;
82
+ }
83
+
84
+ @mixin gl-line-clamp-2 {
85
+ white-space: normal;
86
+ -webkit-line-clamp: 2;
87
+ -webkit-box-orient: vertical;
88
+ // stylelint-disable-next-line value-no-vendor-prefix
89
+ display: -webkit-box;
90
+ overflow: hidden;
91
+ }
92
+
93
+ @mixin gl-line-clamp-3 {
94
+ white-space: normal;
95
+ -webkit-line-clamp: 3;
96
+ -webkit-box-orient: vertical;
97
+ // stylelint-disable-next-line value-no-vendor-prefix
98
+ display: -webkit-box;
99
+ overflow: hidden;
100
+ }
101
+
70
102
  /**
71
103
  * Text indent utilities
72
104
  *