@gitlab/ui 136.3.1 → 137.0.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.
Files changed (50) hide show
  1. package/dist/components/base/alert/alert.js +4 -4
  2. package/dist/components/base/collapse/collapse.js +3 -4
  3. package/dist/components/base/datepicker/datepicker.js +1 -1
  4. package/dist/components/base/filtered_search/filtered_search.js +4 -5
  5. package/dist/components/base/filtered_search/filtered_search_token.js +8 -9
  6. package/dist/components/base/filtered_search/filtered_search_token_segment.js +13 -14
  7. package/dist/components/base/form/form_checkbox/form_checkbox.js +14 -15
  8. package/dist/components/base/form/form_input/form_input.js +9 -11
  9. package/dist/components/base/form/form_radio/form_radio.js +14 -15
  10. package/dist/components/base/form/form_textarea/form_textarea.js +13 -16
  11. package/dist/components/base/infinite_scroll/infinite_scroll.js +27 -20
  12. package/dist/components/base/new_dropdowns/constants.js +2 -2
  13. package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown.js +1 -1
  14. package/dist/components/base/new_dropdowns/listbox/listbox.js +17 -19
  15. package/dist/components/base/sorting/sorting.js +2 -2
  16. package/dist/components/base/tabs/tabs/scrollable_tabs.js +6 -8
  17. package/dist/components/base/token_selector/token_selector.js +13 -15
  18. package/dist/components/charts/chart/chart.js +1 -1
  19. package/dist/components/charts/sparkline/sparkline.js +2 -2
  20. package/dist/components/dashboards/dashboard_panel/dashboard_panel.js +1 -1
  21. package/dist/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip-template.js +4 -2
  22. package/dist/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip.js +3 -1
  23. package/dist/vendor/bootstrap-vue/src/directives/tooltip/tooltip.js +2 -1
  24. package/package.json +4 -4
  25. package/src/components/base/alert/alert.vue +4 -4
  26. package/src/components/base/collapse/collapse.vue +3 -4
  27. package/src/components/base/datepicker/datepicker.vue +1 -1
  28. package/src/components/base/filtered_search/filtered_search.vue +4 -5
  29. package/src/components/base/filtered_search/filtered_search_token.vue +8 -9
  30. package/src/components/base/filtered_search/filtered_search_token_segment.vue +10 -11
  31. package/src/components/base/form/form_checkbox/form_checkbox.vue +14 -15
  32. package/src/components/base/form/form_input/form_input.vue +9 -11
  33. package/src/components/base/form/form_radio/form_radio.vue +14 -15
  34. package/src/components/base/form/form_textarea/form_textarea.vue +13 -16
  35. package/src/components/base/infinite_scroll/infinite_scroll.vue +22 -20
  36. package/src/components/base/new_dropdowns/constants.js +2 -2
  37. package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.vue +1 -1
  38. package/src/components/base/new_dropdowns/listbox/listbox.vue +17 -19
  39. package/src/components/base/sorting/sorting.vue +2 -2
  40. package/src/components/base/tabs/tabs/scrollable_tabs.vue +7 -9
  41. package/src/components/base/token_selector/token_selector.vue +12 -14
  42. package/src/components/charts/chart/chart.vue +1 -1
  43. package/src/components/charts/sparkline/sparkline.vue +2 -2
  44. package/src/components/dashboards/dashboard_panel/dashboard_panel.vue +2 -2
  45. package/src/tokens/build/docs/tokens-tailwind-docs.dark.json +34 -0
  46. package/src/tokens/build/docs/tokens-tailwind-docs.json +34 -0
  47. package/src/tokens/build/tailwind/tokens.cjs +1 -0
  48. package/src/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip-template.js +4 -2
  49. package/src/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip.js +3 -1
  50. package/src/vendor/bootstrap-vue/src/directives/tooltip/tooltip.js +2 -1
@@ -217,7 +217,8 @@ const applyTooltip = (el, bindings, vnode) => {
217
217
  id: config.id,
218
218
  interactive: config.interactive,
219
219
  disabled: config.disabled,
220
- html: config.html
220
+ html: config.html,
221
+ isDirective: true
221
222
  };
222
223
  const oldData = el[BV_TOOLTIP].__bv_prev_data__;
223
224
  el[BV_TOOLTIP].__bv_prev_data__ = data;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "136.3.1",
3
+ "version": "137.0.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -140,7 +140,7 @@
140
140
  "autoprefixer": "10.5.4",
141
141
  "axe-playwright": "^2.2.2",
142
142
  "babel-loader": "^9.2.1",
143
- "cypress": "15.20.1",
143
+ "cypress": "15.21.0",
144
144
  "cypress-real-events": "^1.15.0",
145
145
  "dompurify": "^3.1.2",
146
146
  "emoji-regex": "^10.6.0",
@@ -169,13 +169,13 @@
169
169
  "rollup-plugin-string": "^3.0.0",
170
170
  "rollup-plugin-svg": "^2.0.0",
171
171
  "rollup-plugin-vue": "^5.1.9",
172
- "sass": "^1.102.0",
172
+ "sass": "^1.103.1",
173
173
  "sass-loader": "^10.5.2",
174
174
  "sass-true": "^9",
175
175
  "start-server-and-test": "^2.1.5",
176
176
  "storybook": "^7.6.24",
177
177
  "storybook-dark-mode": "4.0.2",
178
- "style-dictionary": "^5.5.1",
178
+ "style-dictionary": "^5.5.2",
179
179
  "style-loader": "^4",
180
180
  "tailwindcss": "3.4.19",
181
181
  "vue": "2.7.16",
@@ -203,19 +203,19 @@ export default {
203
203
  /**
204
204
  * Emitted when the primary action button is clicked.
205
205
  *
206
- * @event primaryAction
206
+ * @event primary-action
207
207
  * @type {object}
208
208
  */
209
- this.$emit('primaryAction', event);
209
+ this.$emit('primary-action', event);
210
210
  },
211
211
  secondaryButtonClicked(event) {
212
212
  /**
213
213
  * Emitted when the secondary action button is clicked.
214
214
  *
215
- * @event secondaryAction
215
+ * @event secondary-action
216
216
  * @type {object}
217
217
  */
218
- this.$emit('secondaryAction', event);
218
+ this.$emit('secondary-action', event);
219
219
  },
220
220
  onDismiss() {
221
221
  /**
@@ -71,10 +71,9 @@ export default {
71
71
  }
72
72
  },
73
73
  },
74
- mounted() {
75
- this.$nextTick(() => {
76
- this.emitState();
77
- });
74
+ async mounted() {
75
+ await this.$nextTick();
76
+ this.emitState();
78
77
  },
79
78
  beforeDestroy() {
80
79
  // Trigger state emit if needed
@@ -434,7 +434,7 @@ export default {
434
434
  /**
435
435
  * Emitted when the datepicker draws a new month.
436
436
  */
437
- this.$emit('monthChange');
437
+ this.$emit('month-change');
438
438
  },
439
439
  onKeydown() {
440
440
  if (this.textInput === '') {
@@ -402,11 +402,10 @@ export default {
402
402
  }
403
403
  },
404
404
 
405
- onClear() {
406
- this.$nextTick(() => {
407
- this.activeTokenIdx = this.lastTokenIdx;
408
- this.$emit('clear');
409
- });
405
+ async onClear() {
406
+ await this.$nextTick();
407
+ this.activeTokenIdx = this.lastTokenIdx;
408
+ this.$emit('clear');
410
409
  },
411
410
 
412
411
  submit() {
@@ -247,18 +247,17 @@ export default {
247
247
  }
248
248
  },
249
249
 
250
- replaceToken(newType) {
250
+ async replaceToken(newType) {
251
251
  const newTokenConfig = this.availableTokens.find(({ type }) => type === newType);
252
252
 
253
253
  if (newTokenConfig === this.config) {
254
- this.$nextTick(() => {
255
- /**
256
- * Emitted when this term token will lose its focus.
257
- *
258
- * @event deactivate
259
- */
260
- this.$emit('deactivate');
261
- });
254
+ await this.$nextTick();
255
+ /**
256
+ * Emitted when this term token will lose its focus.
257
+ *
258
+ * @event deactivate
259
+ */
260
+ this.$emit('deactivate');
262
261
  return;
263
262
  }
264
263
 
@@ -316,20 +316,19 @@ export default {
316
316
  );
317
317
  },
318
318
 
319
- activate() {
319
+ async activate() {
320
320
  this.fallbackValue = this.value;
321
321
 
322
- this.$nextTick(() => {
323
- const { input } = this.$refs;
324
- if (input) {
325
- input.focus();
326
- input.scrollIntoView({ block: 'nearest', inline: 'end' });
327
- this.alignSuggestions(input);
328
- if (this.cursorPosition === 'start') {
329
- input?.setSelectionRange(0, 0);
330
- }
322
+ await this.$nextTick();
323
+ const { input } = this.$refs;
324
+ if (input) {
325
+ input.focus();
326
+ input.scrollIntoView({ block: 'nearest', inline: 'end' });
327
+ this.alignSuggestions(input);
328
+ if (this.cursorPosition === 'start') {
329
+ input?.setSelectionRange(0, 0);
331
330
  }
332
- });
331
+ }
333
332
  },
334
333
 
335
334
  deactivate() {
@@ -221,7 +221,7 @@ export default {
221
221
  }
222
222
  }
223
223
  },
224
- handleChange({ target: { checked, indeterminate } }) {
224
+ async handleChange({ target: { checked, indeterminate } }) {
225
225
  const { value, uncheckedValue } = this;
226
226
 
227
227
  // Update `computedLocalChecked`
@@ -241,26 +241,25 @@ export default {
241
241
  this.computedLocalChecked = localChecked;
242
242
 
243
243
  // Fire events in a `$nextTick()` to ensure the `v-model` is updated
244
- this.$nextTick(() => {
244
+ await this.$nextTick();
245
+ /**
246
+ * Emitted when selected value(s) is changed due to user interaction.
247
+ *
248
+ * @event change
249
+ */
250
+ this.$emit('change', localChecked);
251
+
252
+ // If this is a child of a group, we emit a change event on it as well
253
+ if (this.isGroup) {
245
254
  /**
246
255
  * Emitted when selected value(s) is changed due to user interaction.
247
256
  *
248
257
  * @event change
249
258
  */
250
- this.$emit('change', localChecked);
251
-
252
- // If this is a child of a group, we emit a change event on it as well
253
- if (this.isGroup) {
254
- /**
255
- * Emitted when selected value(s) is changed due to user interaction.
256
- *
257
- * @event change
258
- */
259
- this.group.$emit('change', localChecked);
260
- }
259
+ this.group.$emit('change', localChecked);
260
+ }
261
261
 
262
- this.$emit('indeterminate', indeterminate);
263
- });
262
+ this.$emit('indeterminate', indeterminate);
264
263
  },
265
264
  setIndeterminate(state) {
266
265
  // Indeterminate only supported in single checkbox mode
@@ -373,14 +373,13 @@ export default {
373
373
  // Create private non-reactive props
374
374
  this.$_inputDebounceTimer = null;
375
375
  },
376
- mounted() {
376
+ async mounted() {
377
377
  this.setWheelStopper(this.noWheel);
378
378
  this.handleAutofocus();
379
- this.$nextTick(() => {
380
- // Update DOM with auto-generated ID after mount
381
- // to prevent SSR hydration errors
382
- this.localId = uniqueId('gl-form-input-');
383
- });
379
+ await this.$nextTick();
380
+ // Update DOM with auto-generated ID after mount
381
+ // to prevent SSR hydration errors
382
+ this.localId = uniqueId('gl-form-input-');
384
383
  },
385
384
  deactivated() {
386
385
  // Turn off listeners when keep-alive component deactivated
@@ -534,11 +533,10 @@ export default {
534
533
  stopEvent(event, { propagation: false });
535
534
  this.blur();
536
535
  },
537
- handleAutofocus() {
538
- this.$nextTick(() => {
539
- window.requestAnimationFrame(() => {
540
- if (this.autofocus && isVisible(this.$refs.input)) this.focus();
541
- });
536
+ async handleAutofocus() {
537
+ await this.$nextTick();
538
+ window.requestAnimationFrame(() => {
539
+ if (this.autofocus && isVisible(this.$refs.input)) this.focus();
542
540
  });
543
541
  },
544
542
  select(...args) {
@@ -171,33 +171,32 @@ export default {
171
171
  this.$emit('input', newValue);
172
172
  }
173
173
  },
174
- handleChange() {
174
+ async handleChange() {
175
175
  const { value } = this;
176
176
 
177
177
  // Update `computedLocalChecked`
178
178
  this.computedLocalChecked = value;
179
179
 
180
180
  // Fire events in a `$nextTick()` to ensure the `v-model` is updated
181
- this.$nextTick(() => {
181
+ await this.$nextTick();
182
+ /**
183
+ * Emitted when the selected value is changed due to user interaction
184
+ *
185
+ * @event change
186
+ * @type {boolean} current selected value of radio group
187
+ */
188
+ this.$emit('change', value);
189
+
190
+ // If this is a child of a group, we emit a change event on it as well
191
+ if (this.isGroup) {
182
192
  /**
183
193
  * Emitted when the selected value is changed due to user interaction
184
194
  *
185
195
  * @event change
186
196
  * @type {boolean} current selected value of radio group
187
197
  */
188
- this.$emit('change', value);
189
-
190
- // If this is a child of a group, we emit a change event on it as well
191
- if (this.isGroup) {
192
- /**
193
- * Emitted when the selected value is changed due to user interaction
194
- *
195
- * @event change
196
- * @type {boolean} current selected value of radio group
197
- */
198
- this.group.$emit('change', value);
199
- }
200
- });
198
+ this.group.$emit('change', value);
199
+ }
201
200
  },
202
201
  focus() {
203
202
  if (!this.disabled) {
@@ -315,11 +315,10 @@ export default {
315
315
  created() {
316
316
  this.$_inputDebounceTimer = null;
317
317
  },
318
- mounted() {
318
+ async mounted() {
319
319
  this.handleAutofocus();
320
- this.$nextTick(() => {
321
- this.localId = uniqueId('gl-form-textarea-');
322
- });
320
+ await this.$nextTick();
321
+ this.localId = uniqueId('gl-form-textarea-');
323
322
  },
324
323
  beforeDestroy() {
325
324
  this.clearDebounce();
@@ -424,13 +423,12 @@ export default {
424
423
  */
425
424
  this.$emit('blur', event);
426
425
  },
427
- handleAutofocus() {
428
- this.$nextTick(() => {
429
- window.requestAnimationFrame(() => {
430
- if (this.autofocus && isVisible(this.$refs.input)) {
431
- this.focus();
432
- }
433
- });
426
+ async handleAutofocus() {
427
+ await this.$nextTick();
428
+ window.requestAnimationFrame(() => {
429
+ if (this.autofocus && isVisible(this.$refs.input)) {
430
+ this.focus();
431
+ }
434
432
  });
435
433
  },
436
434
  handleKeyPress(e) {
@@ -443,11 +441,10 @@ export default {
443
441
  this.$emit('submit');
444
442
  }
445
443
  },
446
- setHeight() {
447
- this.$nextTick(() => {
448
- window.requestAnimationFrame(() => {
449
- this.heightInPx = this.computeHeight();
450
- });
444
+ async setHeight() {
445
+ await this.$nextTick();
446
+ window.requestAnimationFrame(() => {
447
+ this.heightInPx = this.computeHeight();
451
448
  });
452
449
  },
453
450
  computeHeight() {
@@ -51,39 +51,41 @@ export default {
51
51
  },
52
52
  },
53
53
  watch: {
54
- fetchedItems(newVal, oldVal) {
54
+ async fetchedItems(newVal, oldVal) {
55
55
  // Re-adjust scroll to the current item if more items are added
56
56
  if (newVal > oldVal) {
57
57
  const { scrollHeight, scrollTop } = this.$refs.infiniteContainer;
58
58
  // Only when scrolled to the top
59
59
  if (scrollHeight !== 0 && scrollTop === 0) {
60
60
  // Wait until the DOM is fully updated to adjust scroll
61
- this.$nextTick(() => {
62
- const { scrollHeight: newScrollHeight } = this.$refs.infiniteContainer;
61
+ await this.$nextTick();
62
+ const { scrollHeight: newScrollHeight } = this.$refs.infiniteContainer;
63
63
 
64
- // New scrollTop is the new height, minus the old height
65
- // minus a small space to allow the user to trigger a scroll once more
66
- let top = newScrollHeight - scrollHeight - adjustScrollGap;
64
+ // New scrollTop is the new height, minus the old height
65
+ // minus a small space to allow the user to trigger a scroll once more
66
+ let top = newScrollHeight - scrollHeight - adjustScrollGap;
67
67
 
68
- // Never adjust to 0, or a new event may be be triggered
69
- if (top < 1) {
70
- top = 1;
71
- }
68
+ // Never adjust to 0, or a new event may be be triggered
69
+ if (top < 1) {
70
+ top = 1;
71
+ }
72
72
 
73
- this.scrollTo({ top });
74
- });
73
+ this.scrollTo({ top });
75
74
  }
76
75
  }
77
76
  },
78
77
  },
79
78
 
80
- mounted() {
79
+ async mounted() {
81
80
  // Scroll to bottom for reverse effect
82
- this.$nextTick(() => {
83
- if (this.$listeners.topReached && !this.$listeners.bottomReached) {
84
- this.scrollDown();
85
- }
86
- });
81
+ await this.$nextTick();
82
+
83
+ // Check both kebab-case (Vue 2) and camelCase (@vue/compat) $listeners.
84
+ const listening = (...names) => names.some((name) => this.$listeners[name]);
85
+
86
+ if (listening('top-reached', 'topReached') && !listening('bottom-reached', 'bottomReached')) {
87
+ this.scrollDown();
88
+ }
87
89
  },
88
90
 
89
91
  methods: {
@@ -119,13 +121,13 @@ export default {
119
121
  /**
120
122
  * Emitted when item container is scrolled to the top
121
123
  */
122
- this.$emit('topReached');
124
+ this.$emit('top-reached');
123
125
  }, throttleDuration),
124
126
  bottomReached: throttle(function bottomReachedThrottled() {
125
127
  /**
126
128
  * Emitted when item container is scrolled to the bottom
127
129
  */
128
- this.$emit('bottomReached');
130
+ this.$emit('bottom-reached');
129
131
  }, throttleDuration),
130
132
  itemsListHeight() {
131
133
  return this.$refs.infiniteContainer.scrollHeight;
@@ -1,8 +1,8 @@
1
1
  // base dropdown events
2
2
  export const GL_DROPDOWN_SHOWN = 'shown';
3
3
  export const GL_DROPDOWN_HIDDEN = 'hidden';
4
- export const GL_DROPDOWN_BEFORE_CLOSE = 'beforeClose';
5
- export const GL_DROPDOWN_FOCUS_CONTENT = 'focusContent';
4
+ export const GL_DROPDOWN_BEFORE_CLOSE = 'before-close';
5
+ export const GL_DROPDOWN_FOCUS_CONTENT = 'focus-content';
6
6
 
7
7
  // KeyboardEvent.code values
8
8
  export const ARROW_DOWN = 'ArrowDown';
@@ -296,7 +296,7 @@ export default {
296
296
  /**
297
297
  * Emitted when dropdown is about to be closed
298
298
  *
299
- * @event beforeClose
299
+ * @event before-close
300
300
  */
301
301
  this.$emit(GL_DROPDOWN_BEFORE_CLOSE, event);
302
302
  },
@@ -610,22 +610,21 @@ export default {
610
610
  },
611
611
  },
612
612
  items: {
613
- handler() {
614
- this.$nextTick(() => {
615
- /* Every time the list of items changes (on search),
616
- * the observed elements are recreated, thus we need to start obesrving them again */
617
- this.observeScroll();
613
+ async handler() {
614
+ await this.$nextTick();
615
+ /* Every time the list of items changes (on search),
616
+ * the observed elements are recreated, thus we need to start obesrving them again */
617
+ this.observeScroll();
618
618
 
619
- /**
620
- * Every time the list of items changes, and there is a search string,
621
- * we want to visually highlight the first enabled item
622
- */
623
- if (this.searchHasOptions) {
624
- this.nextFocusedItemIndex = this.getFirstEnabledIndex();
625
- } else {
626
- this.nextFocusedItemIndex = null;
627
- }
628
- });
619
+ /**
620
+ * Every time the list of items changes, and there is a search string,
621
+ * we want to visually highlight the first enabled item
622
+ */
623
+ if (this.searchHasOptions) {
624
+ this.nextFocusedItemIndex = this.getFirstEnabledIndex();
625
+ } else {
626
+ this.nextFocusedItemIndex = null;
627
+ }
629
628
  },
630
629
  },
631
630
  ...(process.env.NODE_ENV !== 'production'
@@ -831,7 +830,7 @@ export default {
831
830
 
832
831
  this.focusItem(nextIndex, elements);
833
832
  },
834
- focusItem(index, elements, keepSearchFocused = false) {
833
+ async focusItem(index, elements, keepSearchFocused = false) {
835
834
  this.nextFocusedItemIndex = index;
836
835
 
837
836
  // Always update the activeItemId when focus changes
@@ -847,9 +846,8 @@ export default {
847
846
  elements[index]?.focus();
848
847
  }
849
848
 
850
- this.$nextTick(() => {
851
- this.scrollActiveItemIntoView();
852
- });
849
+ await this.$nextTick();
850
+ this.scrollActiveItemIntoView();
853
851
  },
854
852
  focusSearchInput() {
855
853
  this.$refs.searchBox.focusInput();
@@ -152,7 +152,7 @@ export default {
152
152
  *
153
153
  * @property {boolean} isAscending
154
154
  */
155
- this.$emit('sortDirectionChange', newDirection);
155
+ this.$emit('sort-direction-change', newDirection);
156
156
  },
157
157
  onSortByChanged(event) {
158
158
  /**
@@ -164,7 +164,7 @@ export default {
164
164
  *
165
165
  * @property {string|number} value
166
166
  */
167
- this.$emit('sortByChange', event);
167
+ this.$emit('sort-by-change', event);
168
168
  },
169
169
  },
170
170
  };
@@ -72,25 +72,23 @@ export default {
72
72
  .reduce((acc, key) => Object.assign(acc, { [key]: this.$attrs[key] }), {});
73
73
  },
74
74
  },
75
- mounted() {
76
- this.$nextTick(() => {
77
- this.navScrollWidth = this.getScrollWidth();
78
- });
79
-
75
+ async mounted() {
80
76
  this.handleNavScroll = debounce((e) => {
81
77
  this.scrollLeft = e.target.scrollLeft;
82
78
  }, 100);
83
79
 
84
80
  this.getNavContainer().addEventListener('scroll', this.handleNavScroll);
81
+
82
+ await this.$nextTick();
83
+ this.navScrollWidth = this.getScrollWidth();
85
84
  },
86
85
  beforeDestroy() {
87
86
  this.getNavContainer().removeEventListener('scroll', this.handleNavScroll);
88
87
  },
89
- updated() {
88
+ async updated() {
90
89
  // Whenever tabs are added or removed we need to recalculate the reactive scrollWidth
91
- this.$nextTick(() => {
92
- this.navScrollWidth = this.getScrollWidth();
93
- });
90
+ await this.$nextTick();
91
+ this.navScrollWidth = this.getScrollWidth();
94
92
  },
95
93
  methods: {
96
94
  handleResize({ contentRect: { width } }) {
@@ -222,7 +222,7 @@ export default {
222
222
  },
223
223
  },
224
224
  watch: {
225
- inputText(newValue, oldValue) {
225
+ async inputText(newValue, oldValue) {
226
226
  if (newValue !== oldValue) {
227
227
  /**
228
228
  * Fired when user types in the token selector
@@ -242,13 +242,12 @@ export default {
242
242
  // Wait a tick so `text-input` event can be used to validate
243
243
  // the value and change the `allowUserDefinedTokens` and/or
244
244
  // `hideDropdownWithNoItems` props
245
- this.$nextTick(() => {
246
- if (this.hideDropdown) {
247
- this.closeDropdown();
248
- } else if (newValue !== '') {
249
- this.openDropdown();
250
- }
251
- });
245
+ await this.$nextTick();
246
+ if (this.hideDropdown) {
247
+ this.closeDropdown();
248
+ } else if (newValue !== '') {
249
+ this.openDropdown();
250
+ }
252
251
  }
253
252
  },
254
253
  },
@@ -286,7 +285,7 @@ export default {
286
285
  this.triggerTokenFocusNextBackspace = true;
287
286
  }
288
287
  },
289
- handleBlur(event) {
288
+ async handleBlur(event) {
290
289
  /**
291
290
  * Fired when the token selector is blurred
292
291
  *
@@ -300,11 +299,10 @@ export default {
300
299
  // Workaround is to:
301
300
  // 1. Explicitly focus the dropdown menu item button on `mousedown` event. (see './token_selector_dropdown.vue')
302
301
  // 2. Use `nextTick` so `blur` event is fired after the `mousedown` event
303
- this.$nextTick(() => {
304
- if (!event.relatedTarget?.closest?.('.dropdown-item')) {
305
- this.closeDropdown();
306
- }
307
- });
302
+ await this.$nextTick();
303
+ if (!event.relatedTarget?.closest?.('.dropdown-item')) {
304
+ this.closeDropdown();
305
+ }
308
306
  },
309
307
  handleEnter() {
310
308
  if (this.focusedDropdownItem && this.dropdownIsOpen) {
@@ -171,7 +171,7 @@ export default {
171
171
  * @property {object} chart The chart instance
172
172
  * @property {object} params A params object, see also https://echarts.apache.org/en/api.html#events.Mouse%20events
173
173
  */
174
- this.$emit('chartItemClicked', { chart: this.chart, params });
174
+ this.$emit('chart-item-clicked', { chart: this.chart, params });
175
175
  },
176
176
  handleResize() {
177
177
  this.chart.resize();
@@ -210,10 +210,10 @@ export default {
210
210
  /**
211
211
  * Emitted when the chart is created.
212
212
  * The payload contains the echarts instance.
213
- * @event chartCreated
213
+ * @event chart-created
214
214
  * @type {object}
215
215
  */
216
- this.$emit('chartCreated', chartInstance);
216
+ this.$emit('chart-created', chartInstance);
217
217
  },
218
218
  handleResize() {
219
219
  this.chartInstance.resize();
@@ -290,8 +290,8 @@ export default {
290
290
  category="tertiary"
291
291
  positioning-strategy="fixed"
292
292
  size="small"
293
- @shown="$emit('dropdownOpen')"
294
- @hidden="$emit('dropdownClosed')"
293
+ @shown="$emit('dropdown-open')"
294
+ @hidden="$emit('dropdown-closed')"
295
295
  >
296
296
  <template #list-item="{ item }">
297
297
  <span>{{ item.text }}</span>