@gitlab/ui 114.2.0 → 114.3.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.
@@ -307,7 +307,11 @@ var script = {
307
307
  if (this.tokens.length === 1) {
308
308
  return;
309
309
  }
310
- this.tokens.splice(idx, 1);
310
+ const [destroyedToken] = this.tokens.splice(idx, 1);
311
+ /**
312
+ * Emitted when a token is destroyed, with the token as the payload.
313
+ */
314
+ this.$emit('token-destroy', destroyedToken);
311
315
 
312
316
  // First, attempt to honor the user's activation intent behind the
313
317
  // destruction of the token, if any. Otherwise, try to maintain the
@@ -348,6 +352,10 @@ var script = {
348
352
  this.activeTokenIdx = idx + newStrings.length;
349
353
  },
350
354
  completeToken() {
355
+ /**
356
+ * Emitted when a token is completed, with the token as the payload.
357
+ */
358
+ this.$emit('token-complete', this.activeToken);
351
359
  if (this.activeTokenIdx === this.lastTokenIdx - 1) {
352
360
  this.activeTokenIdx = this.lastTokenIdx;
353
361
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "114.2.0",
3
+ "version": "114.3.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -331,7 +331,11 @@ export default {
331
331
  return;
332
332
  }
333
333
 
334
- this.tokens.splice(idx, 1);
334
+ const [destroyedToken] = this.tokens.splice(idx, 1);
335
+ /**
336
+ * Emitted when a token is destroyed, with the token as the payload.
337
+ */
338
+ this.$emit('token-destroy', destroyedToken);
335
339
 
336
340
  // First, attempt to honor the user's activation intent behind the
337
341
  // destruction of the token, if any. Otherwise, try to maintain the
@@ -371,6 +375,11 @@ export default {
371
375
  },
372
376
 
373
377
  completeToken() {
378
+ /**
379
+ * Emitted when a token is completed, with the token as the payload.
380
+ */
381
+ this.$emit('token-complete', this.activeToken);
382
+
374
383
  if (this.activeTokenIdx === this.lastTokenIdx - 1) {
375
384
  this.activeTokenIdx = this.lastTokenIdx;
376
385
  } else {