@gitlab/ui 63.4.0 → 64.0.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 +29 -0
- package/dist/components/base/new_dropdowns/base_dropdown/base_dropdown.js +76 -25
- package/dist/components/base/new_dropdowns/base_dropdown/constants.js +3 -2
- package/dist/components/base/new_dropdowns/constants.js +2 -10
- package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown.js +9 -8
- package/dist/components/base/new_dropdowns/listbox/listbox.js +9 -8
- package/dist/components/charts/bar/bar.js +8 -5
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/utility_classes.css +1 -1
- package/dist/utility_classes.css.map +1 -1
- package/package.json +20 -20
- package/src/components/base/filtered_search/filtered_search.scss +5 -2
- package/src/components/base/new_dropdowns/base_dropdown/base_dropdown.spec.js +97 -58
- package/src/components/base/new_dropdowns/base_dropdown/base_dropdown.vue +78 -23
- package/src/components/base/new_dropdowns/base_dropdown/constants.js +2 -1
- package/src/components/base/new_dropdowns/constants.js +2 -11
- package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.spec.js +10 -4
- package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.vue +9 -7
- package/src/components/base/new_dropdowns/dropdown.scss +3 -0
- package/src/components/base/new_dropdowns/listbox/listbox.spec.js +10 -4
- package/src/components/base/new_dropdowns/listbox/listbox.stories.js +2 -2
- package/src/components/base/new_dropdowns/listbox/listbox.vue +8 -6
- package/src/components/charts/bar/bar.vue +5 -5
- package/src/scss/utilities.scss +10 -0
- package/src/scss/utility-mixins/border.scss +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,32 @@
|
|
|
1
|
+
## [64.0.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v64.0.0...v64.0.1) (2023-05-30)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **GlBarChart:** Replace the getDom to getZr for supporting edge ([5b43cda](https://gitlab.com/gitlab-org/gitlab-ui/commit/5b43cdaafc21287c5efb92482076fa3bbf9aa975))
|
|
7
|
+
* **GlFilteredSearch:** Prevent filtered search token overflow ([3fb3f6c](https://gitlab.com/gitlab-org/gitlab-ui/commit/3fb3f6c621dfd0a70d7d780719c7a1744b748ea0))
|
|
8
|
+
|
|
9
|
+
# [64.0.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v63.4.0...v64.0.0) (2023-05-30)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* **dropdowns:** avoid overflowing the viewport on the vertical axis ([21cd402](https://gitlab.com/gitlab-org/gitlab-ui/commit/21cd402f9598556de4d9fa68b8fe996fc9d554f2))
|
|
15
|
+
* **dropdowns:** migrate to Floating UI ([69b6192](https://gitlab.com/gitlab-org/gitlab-ui/commit/69b619274ea8a4bf70b23d60961d09dbd80f6e79))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### BREAKING CHANGES
|
|
19
|
+
|
|
20
|
+
* **dropdowns:** While Floating UI is similar to Popper.js, its API
|
|
21
|
+
changed slightly. It might be worth reading the migration guide over at
|
|
22
|
+
https://floating-ui.com/docs/migration.
|
|
23
|
+
|
|
24
|
+
`GlDisclosureDropdown` and `GlListbox` previously exposed a way to
|
|
25
|
+
customize Popper.js' config through the `popperOptions` prop. This has
|
|
26
|
+
been deprecated in favor of a `dropdownOffset` prop which accepts the
|
|
27
|
+
same values as Floating UI's `offset` middleware.
|
|
28
|
+
https://floating-ui.com/docs/offset
|
|
29
|
+
|
|
1
30
|
# [63.4.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v63.3.0...v63.4.0) (2023-05-25)
|
|
2
31
|
|
|
3
32
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import uniqueId from 'lodash/uniqueId';
|
|
2
|
-
import {
|
|
2
|
+
import { offset, flip, size, autoUpdate, computePosition } from '@floating-ui/dom';
|
|
3
3
|
import { buttonCategoryOptions, dropdownVariantOptions, buttonSizeOptions, dropdownPlacements } from '../../../../utils/constants';
|
|
4
|
-
import {
|
|
4
|
+
import { GL_DROPDOWN_CONTENTS_CLASS, GL_DROPDOWN_SHOWN, GL_DROPDOWN_HIDDEN, ENTER, SPACE, ARROW_DOWN, GL_DROPDOWN_FOCUS_CONTENT } from '../constants';
|
|
5
5
|
import { isElementFocusable, isElementTabbable, logWarning } from '../../../../utils/utils';
|
|
6
6
|
import GlButton from '../../button/button';
|
|
7
7
|
import GlIcon from '../../icon/icon';
|
|
8
8
|
import { OutsideDirective } from '../../../../directives/outside/outside';
|
|
9
|
-
import { FIXED_WIDTH_CLASS } from './constants';
|
|
9
|
+
import { DEFAULT_OFFSET, FIXED_WIDTH_CLASS } from './constants';
|
|
10
10
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
11
11
|
|
|
12
12
|
var script = {
|
|
@@ -107,10 +107,16 @@ var script = {
|
|
|
107
107
|
required: false,
|
|
108
108
|
default: null
|
|
109
109
|
},
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
/**
|
|
111
|
+
* Custom value to be passed to the offset middleware.
|
|
112
|
+
* https://floating-ui.com/docs/offset
|
|
113
|
+
*/
|
|
114
|
+
offset: {
|
|
115
|
+
type: [Number, Object],
|
|
112
116
|
required: false,
|
|
113
|
-
default: () => ({
|
|
117
|
+
default: () => ({
|
|
118
|
+
mainAxis: DEFAULT_OFFSET
|
|
119
|
+
})
|
|
114
120
|
},
|
|
115
121
|
fluidWidth: {
|
|
116
122
|
type: Boolean,
|
|
@@ -121,6 +127,7 @@ var script = {
|
|
|
121
127
|
data() {
|
|
122
128
|
return {
|
|
123
129
|
visible: false,
|
|
130
|
+
openedYet: false,
|
|
124
131
|
baseDropdownId: uniqueId('base-dropdown-')
|
|
125
132
|
};
|
|
126
133
|
},
|
|
@@ -192,11 +199,26 @@ var script = {
|
|
|
192
199
|
[FIXED_WIDTH_CLASS]: !this.fluidWidth
|
|
193
200
|
};
|
|
194
201
|
},
|
|
195
|
-
|
|
202
|
+
floatingUIConfig() {
|
|
196
203
|
return {
|
|
197
204
|
placement: dropdownPlacements[this.placement],
|
|
198
|
-
|
|
199
|
-
|
|
205
|
+
middleware: [offset(this.offset), flip(), size({
|
|
206
|
+
apply: _ref => {
|
|
207
|
+
var _this$nonScrollableCo;
|
|
208
|
+
let {
|
|
209
|
+
availableHeight,
|
|
210
|
+
elements
|
|
211
|
+
} = _ref;
|
|
212
|
+
const contentsEl = elements.floating.querySelector(`.${GL_DROPDOWN_CONTENTS_CLASS}`);
|
|
213
|
+
if (!contentsEl) {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
const contentsAvailableHeight = availableHeight - ((_this$nonScrollableCo = this.nonScrollableContentHeight) !== null && _this$nonScrollableCo !== void 0 ? _this$nonScrollableCo : 0) - DEFAULT_OFFSET;
|
|
217
|
+
Object.assign(contentsEl.style, {
|
|
218
|
+
maxHeight: `${Math.max(contentsAvailableHeight, 0)}px`
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
})]
|
|
200
222
|
};
|
|
201
223
|
}
|
|
202
224
|
},
|
|
@@ -213,14 +235,10 @@ var script = {
|
|
|
213
235
|
}
|
|
214
236
|
},
|
|
215
237
|
mounted() {
|
|
216
|
-
this.$nextTick(() => {
|
|
217
|
-
this.popper = createPopper(this.toggleElement, this.$refs.content, this.popperConfig);
|
|
218
|
-
});
|
|
219
238
|
this.checkToggleFocusable();
|
|
220
239
|
},
|
|
221
240
|
beforeDestroy() {
|
|
222
|
-
|
|
223
|
-
(_this$popper = this.popper) === null || _this$popper === void 0 ? void 0 : _this$popper.destroy();
|
|
241
|
+
this.stopFloating();
|
|
224
242
|
},
|
|
225
243
|
methods: {
|
|
226
244
|
checkToggleFocusable() {
|
|
@@ -229,24 +247,49 @@ var script = {
|
|
|
229
247
|
Use 'a' or 'button' element instead or make sure to add 'role="button"' along with 'tabindex' otherwise.`, this.$el);
|
|
230
248
|
}
|
|
231
249
|
},
|
|
250
|
+
startFloating() {
|
|
251
|
+
this.calculateNonScrollableAreaHeight();
|
|
252
|
+
this.observer = new MutationObserver(this.calculateNonScrollableAreaHeight);
|
|
253
|
+
this.observer.observe(this.$refs.content, {
|
|
254
|
+
attributes: false,
|
|
255
|
+
childList: true,
|
|
256
|
+
subtree: true
|
|
257
|
+
});
|
|
258
|
+
this.stopAutoUpdate = autoUpdate(this.toggleElement, this.$refs.content, async () => {
|
|
259
|
+
const {
|
|
260
|
+
x,
|
|
261
|
+
y
|
|
262
|
+
} = await computePosition(this.toggleElement, this.$refs.content, this.floatingUIConfig);
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Due to the asynchronous nature of computePosition, it's technically possible for the
|
|
266
|
+
* component to have been destroyed by the time the promise resolves. In such case, we exit
|
|
267
|
+
* early to prevent a TypeError.
|
|
268
|
+
*/
|
|
269
|
+
if (!this.$refs.content) return;
|
|
270
|
+
Object.assign(this.$refs.content.style, {
|
|
271
|
+
left: `${x}px`,
|
|
272
|
+
top: `${y}px`
|
|
273
|
+
});
|
|
274
|
+
});
|
|
275
|
+
},
|
|
276
|
+
stopFloating() {
|
|
277
|
+
var _this$observer, _this$stopAutoUpdate;
|
|
278
|
+
(_this$observer = this.observer) === null || _this$observer === void 0 ? void 0 : _this$observer.disconnect();
|
|
279
|
+
(_this$stopAutoUpdate = this.stopAutoUpdate) === null || _this$stopAutoUpdate === void 0 ? void 0 : _this$stopAutoUpdate.call(this);
|
|
280
|
+
},
|
|
232
281
|
async toggle() {
|
|
233
282
|
this.visible = !this.visible;
|
|
234
283
|
if (this.visible) {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
dropdown's `display="block"` is set (adding CSS class `show`).
|
|
239
|
-
After that we can recalculate its position (calling `popper.update()`).
|
|
240
|
-
https://github.com/floating-ui/floating-ui/issues/630:
|
|
241
|
-
"Unfortunately there's not any way to compute the position of an element not rendered in the document".
|
|
242
|
-
Then we `await` while the new dropdown position is calculated and DOM updated accordingly.
|
|
243
|
-
After we can emit the `GL_DROPDOWN_SHOWN` event to the parent which might interact with updated dropdown,
|
|
244
|
-
e.g. set focus.
|
|
284
|
+
/**
|
|
285
|
+
* We defer the following logic to the next tick as all that comes next relies on the
|
|
286
|
+
* dropdown actually being visible.
|
|
245
287
|
*/
|
|
246
288
|
await this.$nextTick();
|
|
247
|
-
|
|
289
|
+
this.startFloating();
|
|
248
290
|
this.$emit(GL_DROPDOWN_SHOWN);
|
|
249
291
|
} else {
|
|
292
|
+
this.stopFloating();
|
|
250
293
|
this.$emit(GL_DROPDOWN_HIDDEN);
|
|
251
294
|
}
|
|
252
295
|
},
|
|
@@ -293,6 +336,14 @@ var script = {
|
|
|
293
336
|
if (code === ARROW_DOWN) {
|
|
294
337
|
this.$emit(GL_DROPDOWN_FOCUS_CONTENT, event);
|
|
295
338
|
}
|
|
339
|
+
},
|
|
340
|
+
calculateNonScrollableAreaHeight() {
|
|
341
|
+
var _this$$refs$content;
|
|
342
|
+
const scrollableArea = (_this$$refs$content = this.$refs.content) === null || _this$$refs$content === void 0 ? void 0 : _this$$refs$content.querySelector(`.${GL_DROPDOWN_CONTENTS_CLASS}`);
|
|
343
|
+
if (!scrollableArea) return;
|
|
344
|
+
const floatingElementBoundingBox = this.$refs.content.getBoundingClientRect();
|
|
345
|
+
const scrollableAreaBoundingBox = scrollableArea.getBoundingClientRect();
|
|
346
|
+
this.nonScrollableContentHeight = floatingElementBoundingBox.height - scrollableAreaBoundingBox.height;
|
|
296
347
|
}
|
|
297
348
|
}
|
|
298
349
|
};
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
const POPPER_CONFIG = {
|
|
2
|
-
modifiers: [{
|
|
3
|
-
name: 'offset',
|
|
4
|
-
options: {
|
|
5
|
-
offset: [0, 4]
|
|
6
|
-
}
|
|
7
|
-
}]
|
|
8
|
-
};
|
|
9
|
-
|
|
10
1
|
// base dropdown events
|
|
11
2
|
const GL_DROPDOWN_SHOWN = 'shown';
|
|
12
3
|
const GL_DROPDOWN_HIDDEN = 'hidden';
|
|
@@ -19,5 +10,6 @@ const END = 'End';
|
|
|
19
10
|
const ENTER = 'Enter';
|
|
20
11
|
const HOME = 'Home';
|
|
21
12
|
const SPACE = 'Space';
|
|
13
|
+
const GL_DROPDOWN_CONTENTS_CLASS = 'gl-new-dropdown-contents';
|
|
22
14
|
|
|
23
|
-
export { ARROW_DOWN, ARROW_UP, END, ENTER, GL_DROPDOWN_FOCUS_CONTENT, GL_DROPDOWN_HIDDEN, GL_DROPDOWN_SHOWN, HOME,
|
|
15
|
+
export { ARROW_DOWN, ARROW_UP, END, ENTER, GL_DROPDOWN_CONTENTS_CLASS, GL_DROPDOWN_FOCUS_CONTENT, GL_DROPDOWN_HIDDEN, GL_DROPDOWN_SHOWN, HOME, SPACE };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import clamp from 'lodash/clamp';
|
|
2
2
|
import uniqueId from 'lodash/uniqueId';
|
|
3
3
|
import { stopEvent, filterVisible } from '../../../../utils/utils';
|
|
4
|
-
import { GL_DROPDOWN_SHOWN, GL_DROPDOWN_HIDDEN, GL_DROPDOWN_FOCUS_CONTENT, HOME, END, ARROW_UP, ARROW_DOWN, ENTER, SPACE } from '../constants';
|
|
4
|
+
import { GL_DROPDOWN_SHOWN, GL_DROPDOWN_HIDDEN, GL_DROPDOWN_FOCUS_CONTENT, HOME, END, ARROW_UP, ARROW_DOWN, ENTER, SPACE, GL_DROPDOWN_CONTENTS_CLASS } from '../constants';
|
|
5
5
|
import { buttonCategoryOptions, dropdownVariantOptions, buttonSizeOptions, dropdownPlacements } from '../../../../utils/constants';
|
|
6
6
|
import GlBaseDropdown from '../base_dropdown/base_dropdown';
|
|
7
7
|
import GlDisclosureDropdownItem, { ITEM_CLASS } from './disclosure_dropdown_item';
|
|
@@ -154,13 +154,13 @@ var script = {
|
|
|
154
154
|
default: null
|
|
155
155
|
},
|
|
156
156
|
/**
|
|
157
|
-
*
|
|
158
|
-
*
|
|
157
|
+
* Custom offset to be applied to Floating UI's offset middleware.
|
|
158
|
+
* https://floating-ui.com/docs/offset
|
|
159
159
|
*/
|
|
160
|
-
|
|
161
|
-
type: Object,
|
|
160
|
+
dropdownOffset: {
|
|
161
|
+
type: [Number, Object],
|
|
162
162
|
required: false,
|
|
163
|
-
default:
|
|
163
|
+
default: undefined
|
|
164
164
|
},
|
|
165
165
|
/**
|
|
166
166
|
* Lets the dropdown extend to match its content's width, up to a maximum width
|
|
@@ -284,14 +284,15 @@ var script = {
|
|
|
284
284
|
return uniqueId(`disclosure-item-`);
|
|
285
285
|
},
|
|
286
286
|
isItem
|
|
287
|
-
}
|
|
287
|
+
},
|
|
288
|
+
GL_DROPDOWN_CONTENTS_CLASS
|
|
288
289
|
};
|
|
289
290
|
|
|
290
291
|
/* script */
|
|
291
292
|
const __vue_script__ = script;
|
|
292
293
|
|
|
293
294
|
/* template */
|
|
294
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-base-dropdown',{ref:"baseDropdown",staticClass:"gl-disclosure-dropdown",attrs:{"aria-labelledby":_vm.toggleAriaLabelledBy,"toggle-id":_vm.toggleId,"toggle-text":_vm.toggleText,"toggle-class":_vm.toggleClass,"text-sr-only":_vm.textSrOnly,"category":_vm.category,"variant":_vm.variant,"size":_vm.size,"icon":_vm.icon,"disabled":_vm.disabled,"loading":_vm.loading,"no-caret":_vm.noCaret,"placement":_vm.placement,"
|
|
295
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-base-dropdown',{ref:"baseDropdown",staticClass:"gl-disclosure-dropdown",attrs:{"aria-labelledby":_vm.toggleAriaLabelledBy,"toggle-id":_vm.toggleId,"toggle-text":_vm.toggleText,"toggle-class":_vm.toggleClass,"text-sr-only":_vm.textSrOnly,"category":_vm.category,"variant":_vm.variant,"size":_vm.size,"icon":_vm.icon,"disabled":_vm.disabled,"loading":_vm.loading,"no-caret":_vm.noCaret,"placement":_vm.placement,"offset":_vm.dropdownOffset,"fluid-width":_vm.fluidWidth},on:_vm._d({},[_vm.$options.events.GL_DROPDOWN_SHOWN,_vm.onShow,_vm.$options.events.GL_DROPDOWN_HIDDEN,_vm.onHide,_vm.$options.events.GL_DROPDOWN_FOCUS_CONTENT,_vm.onKeydown]),scopedSlots:_vm._u([(_vm.hasCustomToggle)?{key:"toggle",fn:function(){return [_vm._t("toggle")]},proxy:true}:null],null,true)},[_vm._v(" "),_vm._t("header"),_vm._v(" "),_c(_vm.disclosureTag,{ref:"content",tag:"component",class:_vm.$options.GL_DROPDOWN_CONTENTS_CLASS,attrs:{"id":_vm.disclosureId,"aria-labelledby":_vm.listAriaLabelledBy || _vm.toggleId,"data-testid":"disclosure-content","tabindex":"-1"},on:{"keydown":_vm.onKeydown,"click":_vm.handleAutoClose}},[_vm._t("default",function(){return [_vm._l((_vm.items),function(item,index){return [(_vm.isItem(item))?[_c('gl-disclosure-dropdown-item',{key:_vm.uniqueItemId(),attrs:{"item":item},on:{"action":_vm.handleAction},scopedSlots:_vm._u([{key:"list-item",fn:function(){return [_vm._t("list-item",null,{"item":item})]},proxy:true}],null,true)})]:[_c('gl-disclosure-dropdown-group',{key:item.name,attrs:{"bordered":index !== 0,"group":item},on:{"action":_vm.handleAction},scopedSlots:_vm._u([(_vm.$scopedSlots['group-label'])?{key:"group-label",fn:function(){return [_vm._t("group-label",null,{"group":item})]},proxy:true}:null],null,true)},[_vm._v(" "),(_vm.$scopedSlots['list-item'])?_vm._l((item.items),function(groupItem){return _c('gl-disclosure-dropdown-item',{key:_vm.uniqueItemId(),attrs:{"item":groupItem},on:{"action":_vm.handleAction},scopedSlots:_vm._u([{key:"list-item",fn:function(){return [_vm._t("list-item",null,{"item":groupItem})]},proxy:true}],null,true)})}):_vm._e()],2)]]})]})],2),_vm._v(" "),_vm._t("footer")],2)};
|
|
295
296
|
var __vue_staticRenderFns__ = [];
|
|
296
297
|
|
|
297
298
|
/* style */
|
|
@@ -2,7 +2,7 @@ import clamp from 'lodash/clamp';
|
|
|
2
2
|
import uniqueId from 'lodash/uniqueId';
|
|
3
3
|
import isNil from 'lodash/isNil';
|
|
4
4
|
import { stopEvent } from '../../../../utils/utils';
|
|
5
|
-
import { GL_DROPDOWN_SHOWN, GL_DROPDOWN_HIDDEN, HOME, END, ARROW_UP, ARROW_DOWN } from '../constants';
|
|
5
|
+
import { GL_DROPDOWN_SHOWN, GL_DROPDOWN_HIDDEN, GL_DROPDOWN_CONTENTS_CLASS, HOME, END, ARROW_UP, ARROW_DOWN } from '../constants';
|
|
6
6
|
import { buttonCategoryOptions, dropdownVariantOptions, buttonSizeOptions, dropdownPlacements } from '../../../../utils/constants';
|
|
7
7
|
import GlButton from '../../button/button';
|
|
8
8
|
import GlLoadingIcon from '../../loading_icon/loading_icon';
|
|
@@ -287,13 +287,13 @@ var script = {
|
|
|
287
287
|
default: false
|
|
288
288
|
},
|
|
289
289
|
/**
|
|
290
|
-
*
|
|
291
|
-
*
|
|
290
|
+
* Custom offset to be applied to Floating UI's offset middleware.
|
|
291
|
+
* https://floating-ui.com/docs/offset
|
|
292
292
|
*/
|
|
293
|
-
|
|
294
|
-
type: Object,
|
|
293
|
+
dropdownOffset: {
|
|
294
|
+
type: [Number, Object],
|
|
295
295
|
required: false,
|
|
296
|
-
default:
|
|
296
|
+
default: undefined
|
|
297
297
|
},
|
|
298
298
|
/**
|
|
299
299
|
* Lets the dropdown extend to match its content's width, up to a maximum width
|
|
@@ -324,7 +324,8 @@ var script = {
|
|
|
324
324
|
listboxClasses() {
|
|
325
325
|
return {
|
|
326
326
|
'top-scrim-visible': !this.topBoundaryVisible,
|
|
327
|
-
'bottom-scrim-visible': !this.bottomBoundaryVisible
|
|
327
|
+
'bottom-scrim-visible': !this.bottomBoundaryVisible,
|
|
328
|
+
[GL_DROPDOWN_CONTENTS_CLASS]: true
|
|
328
329
|
};
|
|
329
330
|
},
|
|
330
331
|
itemTag() {
|
|
@@ -668,7 +669,7 @@ var script = {
|
|
|
668
669
|
const __vue_script__ = script;
|
|
669
670
|
|
|
670
671
|
/* template */
|
|
671
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-base-dropdown',{ref:"baseDropdown",attrs:{"aria-haspopup":"listbox","aria-labelledby":_vm.toggleAriaLabelledBy,"block":_vm.block,"toggle-id":_vm.toggleId,"toggle-text":_vm.listboxToggleText,"toggle-class":_vm.toggleButtonClasses,"text-sr-only":_vm.textSrOnly,"category":_vm.category,"variant":_vm.variant,"size":_vm.size,"icon":_vm.icon,"disabled":_vm.disabled,"loading":_vm.loading,"no-caret":_vm.noCaret,"placement":_vm.placement,"
|
|
672
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-base-dropdown',{ref:"baseDropdown",attrs:{"aria-haspopup":"listbox","aria-labelledby":_vm.toggleAriaLabelledBy,"block":_vm.block,"toggle-id":_vm.toggleId,"toggle-text":_vm.listboxToggleText,"toggle-class":_vm.toggleButtonClasses,"text-sr-only":_vm.textSrOnly,"category":_vm.category,"variant":_vm.variant,"size":_vm.size,"icon":_vm.icon,"disabled":_vm.disabled,"loading":_vm.loading,"no-caret":_vm.noCaret,"placement":_vm.placement,"offset":_vm.dropdownOffset,"fluid-width":_vm.fluidWidth},on:_vm._d({},[_vm.$options.events.GL_DROPDOWN_SHOWN,_vm.onShow,_vm.$options.events.GL_DROPDOWN_HIDDEN,_vm.onHide]),scopedSlots:_vm._u([(_vm.hasCustomToggle)?{key:"toggle",fn:function(){return [_vm._t("toggle")]},proxy:true}:null],null,true)},[_vm._v(" "),(_vm.headerText)?_c('div',{staticClass:"gl-display-flex gl-align-items-center gl-p-4! gl-min-h-8",class:_vm.$options.HEADER_ITEMS_BORDER_CLASSES},[_c('div',{staticClass:"gl-flex-grow-1 gl-font-weight-bold gl-font-sm gl-pr-2",attrs:{"id":_vm.headerId,"data-testid":"listbox-header-text"}},[_vm._v("\n "+_vm._s(_vm.headerText)+"\n ")]),_vm._v(" "),(_vm.showResetButton)?_c('gl-button',{staticClass:"gl-focus-inset-border-2-blue-400! gl-flex-shrink-0 gl-font-sm! gl-px-2! gl-py-2! gl-w-auto! gl-m-0! gl-max-w-50p gl-text-overflow-ellipsis",attrs:{"category":"tertiary","data-testid":"listbox-reset-button"},on:{"click":_vm.onResetButtonClicked}},[_vm._v("\n "+_vm._s(_vm.resetButtonLabel)+"\n ")]):_vm._e(),_vm._v(" "),(_vm.showSelectAllButton)?_c('gl-button',{staticClass:"gl-focus-inset-border-2-blue-400! gl-flex-shrink-0 gl-font-sm! gl-px-2! gl-py-2! gl-w-auto! gl-m-0! gl-max-w-50p gl-text-overflow-ellipsis",attrs:{"category":"tertiary","data-testid":"listbox-select-all-button"},on:{"click":_vm.onSelectAllButtonClicked}},[_vm._v("\n "+_vm._s(_vm.showSelectAllButtonLabel)+"\n ")]):_vm._e()],1):_vm._e(),_vm._v(" "),(_vm.searchable)?_c('div',{class:_vm.$options.HEADER_ITEMS_BORDER_CLASSES},[_c('gl-listbox-search-input',{ref:"searchBox",attrs:{"aria-owns":_vm.listboxId,"data-testid":"listbox-search-input","placeholder":_vm.searchPlaceholder},on:{"input":_vm.search,"keydown":[function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }$event.preventDefault();},_vm.onKeydown]},model:{value:(_vm.searchStr),callback:function ($$v) {_vm.searchStr=$$v;},expression:"searchStr"}}),_vm._v(" "),(_vm.searching)?_c('gl-loading-icon',{staticClass:"gl-my-3",attrs:{"data-testid":"listbox-search-loader","size":"md"}}):_vm._e()],1):_vm._e(),_vm._v(" "),(_vm.showList)?_c(_vm.listboxTag,{ref:"list",tag:"component",staticClass:"gl-new-dropdown-contents gl-new-dropdown-contents-with-scrim-overlay",class:_vm.listboxClasses,attrs:{"id":_vm.listboxId,"aria-labelledby":_vm.listAriaLabelledBy || _vm.headerId || _vm.toggleId,"role":"listbox","tabindex":"-1"},on:{"keydown":_vm.onKeydown}},[_c(_vm.itemTag,{tag:"component",staticClass:"top-scrim-wrapper",attrs:{"aria-hidden":"true","data-testid":"top-scrim"}},[_c('div',{staticClass:"top-scrim",class:{ 'top-scrim-light': !_vm.hasHeader, 'top-scrim-dark': _vm.hasHeader }})]),_vm._v(" "),_c(_vm.itemTag,{ref:"top-boundary",tag:"component",attrs:{"aria-hidden":"true"}}),_vm._v(" "),_vm._l((_vm.items),function(item,index){return [(_vm.isOption(item))?[_c('gl-listbox-item',_vm._b({key:item.value,attrs:{"data-testid":("listbox-item-" + (item.value)),"is-selected":_vm.isSelected(item),"is-focused":_vm.isFocused(item),"is-check-centered":_vm.isCheckCentered},on:{"select":function($event){return _vm.onSelect(item, $event)}}},'gl-listbox-item',_vm.listboxItemMoreItemsAriaAttributes(index),false),[_vm._t("list-item",function(){return [_vm._v("\n "+_vm._s(item.text)+"\n ")]},{"item":item})],2)]:[_c('gl-listbox-group',{key:item.text,class:_vm.groupClasses(index),attrs:{"name":item.text,"text-sr-only":item.textSrOnly},scopedSlots:_vm._u([(_vm.$scopedSlots['group-label'])?{key:"group-label",fn:function(){return [_vm._t("group-label",null,{"group":item})]},proxy:true}:null],null,true)},[_vm._v(" "),_vm._l((item.options),function(option){return _c('gl-listbox-item',{key:option.value,attrs:{"data-testid":("listbox-item-" + (option.value)),"is-selected":_vm.isSelected(option),"is-focused":_vm.isFocused(option),"is-check-centered":_vm.isCheckCentered},on:{"select":function($event){return _vm.onSelect(option, $event)}}},[_vm._t("list-item",function(){return [_vm._v("\n "+_vm._s(option.text)+"\n ")]},{"item":option})],2)})],2)]]}),_vm._v(" "),(_vm.infiniteScrollLoading)?_c(_vm.itemTag,{tag:"component"},[_c('gl-loading-icon',{staticClass:"gl-my-3",attrs:{"data-testid":"listbox-infinite-scroll-loader","size":"md"}})],1):_vm._e(),_vm._v(" "),(_vm.showIntersectionObserver)?_c('gl-intersection-observer',{on:{"appear":_vm.onIntersectionObserverAppear}}):_vm._e(),_vm._v(" "),_c(_vm.itemTag,{ref:"bottom-boundary",tag:"component",attrs:{"aria-hidden":"true"}}),_vm._v(" "),_c(_vm.itemTag,{tag:"component",staticClass:"bottom-scrim-wrapper",attrs:{"aria-hidden":"true","data-testid":"bottom-scrim"}},[_c('div',{staticClass:"bottom-scrim",class:{ 'gl-rounded-0!': _vm.hasFooter }})])],2):_vm._e(),_vm._v(" "),(_vm.announceSRSearchResults)?_c('span',{staticClass:"gl-sr-only",attrs:{"data-testid":"listbox-number-of-results","aria-live":"assertive"}},[_vm._t("search-summary-sr-only")],2):(_vm.showNoResultsText)?_c('div',{staticClass:"gl-pl-7 gl-pr-5 gl-py-3 gl-font-base gl-text-gray-600",attrs:{"aria-live":"assertive","data-testid":"listbox-no-results-text"}},[_vm._v("\n "+_vm._s(_vm.noResultsText)+"\n ")]):_vm._e(),_vm._v(" "),_vm._t("footer")],2)};
|
|
672
673
|
var __vue_staticRenderFns__ = [];
|
|
673
674
|
|
|
674
675
|
/* style */
|
|
@@ -167,12 +167,15 @@ var script = {
|
|
|
167
167
|
},
|
|
168
168
|
beforeDestroy() {
|
|
169
169
|
if (this.chart) {
|
|
170
|
-
this.chart.
|
|
171
|
-
this.chart.
|
|
170
|
+
this.chart.getZr().off('mousemove', this.debouncedMoveShowTooltip);
|
|
171
|
+
this.chart.getZr().off('mouseout', this.debouncedMoveShowTooltip);
|
|
172
172
|
}
|
|
173
173
|
},
|
|
174
174
|
methods: {
|
|
175
|
-
moveShowTooltip(
|
|
175
|
+
moveShowTooltip(_ref) {
|
|
176
|
+
let {
|
|
177
|
+
event: mouseEvent
|
|
178
|
+
} = _ref;
|
|
176
179
|
this.tooltipPosition = {
|
|
177
180
|
left: `${mouseEvent.zrX + TOOLTIP_LEFT_OFFSET}px`,
|
|
178
181
|
top: `${mouseEvent.zrY}px`
|
|
@@ -182,8 +185,8 @@ var script = {
|
|
|
182
185
|
onCreated(chart) {
|
|
183
186
|
this.chart = chart;
|
|
184
187
|
this.$emit('created', chart);
|
|
185
|
-
chart.
|
|
186
|
-
chart.
|
|
188
|
+
chart.getZr().on('mousemove', this.debouncedMoveShowTooltip);
|
|
189
|
+
chart.getZr().on('mouseout', this.debouncedMoveShowTooltip);
|
|
187
190
|
},
|
|
188
191
|
onLabelChange(params) {
|
|
189
192
|
const {
|