@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.
- package/dist/components/base/alert/alert.js +4 -4
- package/dist/components/base/collapse/collapse.js +3 -4
- package/dist/components/base/datepicker/datepicker.js +1 -1
- package/dist/components/base/filtered_search/filtered_search.js +4 -5
- package/dist/components/base/filtered_search/filtered_search_token.js +8 -9
- package/dist/components/base/filtered_search/filtered_search_token_segment.js +13 -14
- package/dist/components/base/form/form_checkbox/form_checkbox.js +14 -15
- package/dist/components/base/form/form_input/form_input.js +9 -11
- package/dist/components/base/form/form_radio/form_radio.js +14 -15
- package/dist/components/base/form/form_textarea/form_textarea.js +13 -16
- package/dist/components/base/infinite_scroll/infinite_scroll.js +27 -20
- package/dist/components/base/new_dropdowns/constants.js +2 -2
- package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown.js +1 -1
- package/dist/components/base/new_dropdowns/listbox/listbox.js +17 -19
- package/dist/components/base/sorting/sorting.js +2 -2
- package/dist/components/base/tabs/tabs/scrollable_tabs.js +6 -8
- package/dist/components/base/token_selector/token_selector.js +13 -15
- package/dist/components/charts/chart/chart.js +1 -1
- package/dist/components/charts/sparkline/sparkline.js +2 -2
- package/dist/components/dashboards/dashboard_panel/dashboard_panel.js +1 -1
- package/dist/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip-template.js +4 -2
- package/dist/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip.js +3 -1
- package/dist/vendor/bootstrap-vue/src/directives/tooltip/tooltip.js +2 -1
- package/package.json +4 -4
- package/src/components/base/alert/alert.vue +4 -4
- package/src/components/base/collapse/collapse.vue +3 -4
- package/src/components/base/datepicker/datepicker.vue +1 -1
- package/src/components/base/filtered_search/filtered_search.vue +4 -5
- package/src/components/base/filtered_search/filtered_search_token.vue +8 -9
- package/src/components/base/filtered_search/filtered_search_token_segment.vue +10 -11
- package/src/components/base/form/form_checkbox/form_checkbox.vue +14 -15
- package/src/components/base/form/form_input/form_input.vue +9 -11
- package/src/components/base/form/form_radio/form_radio.vue +14 -15
- package/src/components/base/form/form_textarea/form_textarea.vue +13 -16
- package/src/components/base/infinite_scroll/infinite_scroll.vue +22 -20
- package/src/components/base/new_dropdowns/constants.js +2 -2
- package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.vue +1 -1
- package/src/components/base/new_dropdowns/listbox/listbox.vue +17 -19
- package/src/components/base/sorting/sorting.vue +2 -2
- package/src/components/base/tabs/tabs/scrollable_tabs.vue +7 -9
- package/src/components/base/token_selector/token_selector.vue +12 -14
- package/src/components/charts/chart/chart.vue +1 -1
- package/src/components/charts/sparkline/sparkline.vue +2 -2
- package/src/components/dashboards/dashboard_panel/dashboard_panel.vue +2 -2
- package/src/tokens/build/docs/tokens-tailwind-docs.dark.json +34 -0
- package/src/tokens/build/docs/tokens-tailwind-docs.json +34 -0
- package/src/tokens/build/tailwind/tokens.cjs +1 -0
- package/src/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip-template.js +4 -2
- package/src/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip.js +3 -1
- 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": "
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
|
206
|
+
* @event primary-action
|
|
207
207
|
* @type {object}
|
|
208
208
|
*/
|
|
209
|
-
this.$emit('
|
|
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
|
|
215
|
+
* @event secondary-action
|
|
216
216
|
* @type {object}
|
|
217
217
|
*/
|
|
218
|
-
this.$emit('
|
|
218
|
+
this.$emit('secondary-action', event);
|
|
219
219
|
},
|
|
220
220
|
onDismiss() {
|
|
221
221
|
/**
|
|
@@ -402,11 +402,10 @@ export default {
|
|
|
402
402
|
}
|
|
403
403
|
},
|
|
404
404
|
|
|
405
|
-
onClear() {
|
|
406
|
-
this.$nextTick(
|
|
407
|
-
|
|
408
|
-
|
|
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
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
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
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
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
|
-
|
|
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
|
-
|
|
381
|
-
|
|
382
|
-
|
|
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
|
-
|
|
540
|
-
|
|
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
|
-
|
|
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
|
-
|
|
430
|
-
|
|
431
|
-
|
|
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
|
-
|
|
449
|
-
|
|
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
|
-
|
|
61
|
+
await this.$nextTick();
|
|
62
|
+
const { scrollHeight: newScrollHeight } = this.$refs.infiniteContainer;
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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
|
-
|
|
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
|
-
|
|
84
|
-
|
|
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('
|
|
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('
|
|
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 = '
|
|
5
|
-
export const GL_DROPDOWN_FOCUS_CONTENT = '
|
|
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';
|
|
@@ -610,22 +610,21 @@ export default {
|
|
|
610
610
|
},
|
|
611
611
|
},
|
|
612
612
|
items: {
|
|
613
|
-
handler() {
|
|
614
|
-
this.$nextTick(
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
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
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
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
|
-
|
|
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('
|
|
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('
|
|
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
|
-
|
|
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
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
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
|
-
|
|
305
|
-
|
|
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('
|
|
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
|
|
213
|
+
* @event chart-created
|
|
214
214
|
* @type {object}
|
|
215
215
|
*/
|
|
216
|
-
this.$emit('
|
|
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('
|
|
294
|
-
@hidden="$emit('
|
|
293
|
+
@shown="$emit('dropdown-open')"
|
|
294
|
+
@hidden="$emit('dropdown-closed')"
|
|
295
295
|
>
|
|
296
296
|
<template #list-item="{ item }">
|
|
297
297
|
<span>{{ item.text }}</span>
|