@gitlab/ui 115.8.0 → 115.9.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/dist/components/base/avatar_link/avatar_link.js +1 -1
- package/dist/components/base/avatars_inline/avatars_inline.js +1 -1
- package/dist/components/charts/line/line.js +9 -1
- package/dist/components/charts/shared/tooltip/tooltip.js +116 -16
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/tailwind.css.map +1 -1
- package/package.json +10 -10
- package/src/components/base/avatar_link/avatar_link.vue +1 -1
- package/src/components/base/avatars_inline/avatars_inline.vue +1 -1
- package/src/components/base/markdown/markdown_typescale_demo.html +41 -71
- package/src/components/charts/line/line.vue +9 -0
- package/src/components/charts/shared/tooltip/tooltip.vue +115 -18
- package/src/scss/variables.scss +1 -1
- package/src/components/base/accordion/accordion.md +0 -3
- package/src/components/base/accordion/accordion_item.md +0 -3
- package/src/components/base/alert/alert.md +0 -35
- package/src/components/base/animated_icon/animated_icon.md +0 -4
- package/src/components/base/avatar/avatar.md +0 -1
- package/src/components/base/avatar_labeled/avatar_labeled.md +0 -20
- package/src/components/base/avatar_link/avatar_link.md +0 -33
- package/src/components/base/avatars_inline/avatars_inline.md +0 -38
- package/src/components/base/badge/badge.md +0 -30
- package/src/components/base/banner/banner.md +0 -35
- package/src/components/base/breadcrumb/breadcrumb.md +0 -52
- package/src/components/base/broadcast_message/broadcast_message.md +0 -25
- package/src/components/base/button/button.md +0 -119
- package/src/components/base/button_group/button_group.md +0 -44
- package/src/components/base/card/card.md +0 -4
- package/src/components/base/collapse/collapse.md +0 -64
- package/src/components/base/datepicker/datepicker.md +0 -8
- package/src/components/base/daterange_picker/daterange_picker.md +0 -32
- package/src/components/base/drawer/drawer.md +0 -17
- package/src/components/base/dropdown/dropdown.md +0 -72
- package/src/components/base/dropdown/dropdown_item.md +0 -2
- package/src/components/base/dropdown/dropdown_section_header.md +0 -7
- package/src/components/base/dropdown/dropdown_text.md +0 -7
- package/src/components/base/filtered_search/filtered_search.md +0 -76
- package/src/components/base/filtered_search/filtered_search_suggestion.md +0 -15
- package/src/components/base/filtered_search/filtered_search_suggestion_list.md +0 -13
- package/src/components/base/filtered_search/filtered_search_term.md +0 -7
- package/src/components/base/filtered_search/filtered_search_token.md +0 -23
- package/src/components/base/filtered_search/filtered_search_token_segment.md +0 -14
- package/src/components/base/form/form_checkbox/form_checkbox.md +0 -6
- package/src/components/base/form/form_input/form_input.md +0 -306
- package/src/components/base/form/form_radio/form_radio.md +0 -23
- package/src/components/base/form/form_radio_group/form_radio_group.md +0 -63
- package/src/components/base/form/form_select/form_select.md +0 -1
- package/src/components/base/form/form_textarea/form_textarea.md +0 -3
- package/src/components/base/icon/icon.md +0 -27
- package/src/components/base/infinite_scroll/infinite_scroll.md +0 -104
- package/src/components/base/keyset_pagination/keyset_pagination.md +0 -49
- package/src/components/base/label/label.md +0 -15
- package/src/components/base/link/link.md +0 -187
- package/src/components/base/loading_icon/loading_icon.md +0 -3
- package/src/components/base/modal/modal.md +0 -30
- package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.md +0 -184
- package/src/components/base/new_dropdowns/listbox/listbox.md +0 -195
- package/src/components/base/pagination/pagination.md +0 -45
- package/src/components/base/path/path.md +0 -41
- package/src/components/base/progress_bar/progress_bar.md +0 -25
- package/src/components/base/search_box_by_click/search_box_by_click.md +0 -1
- package/src/components/base/search_box_by_type/search_box_by_type.md +0 -1
- package/src/components/base/segmented_control/segmented_control.md +0 -26
- package/src/components/base/skeleton_loader/skeleton_loader.md +0 -70
- package/src/components/base/sorting/sorting.md +0 -80
- package/src/components/base/table/table.md +0 -71
- package/src/components/base/table_lite/table_lite.md +0 -68
- package/src/components/base/tabs/tabs/tabs.md +0 -80
- package/src/components/base/toast/toast.md +0 -48
- package/src/components/base/toggle/toggle.md +0 -4
- package/src/components/base/token/token.md +0 -12
- package/src/components/base/tooltip/tooltip.md +0 -52
- package/src/scss/typescale/typeface_demo.html +0 -70
- package/src/scss/typescale/typescale.md +0 -81
|
@@ -94,6 +94,14 @@ var script = {
|
|
|
94
94
|
type: [Number, String],
|
|
95
95
|
required: false,
|
|
96
96
|
default: null
|
|
97
|
+
},
|
|
98
|
+
/**
|
|
99
|
+
* Controls whether the tooltip should be pinned when clicked.
|
|
100
|
+
*/
|
|
101
|
+
clickToPinTooltip: {
|
|
102
|
+
type: Boolean,
|
|
103
|
+
required: false,
|
|
104
|
+
default: false
|
|
97
105
|
}
|
|
98
106
|
},
|
|
99
107
|
data() {
|
|
@@ -281,7 +289,7 @@ const __vue_script__ = script;
|
|
|
281
289
|
/* template */
|
|
282
290
|
var __vue_render__ = function () {
|
|
283
291
|
var _obj;
|
|
284
|
-
var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-relative",class:( _obj = {}, _obj[_vm.$options.HEIGHT_AUTO_CLASSES] = _vm.autoHeight, _obj )},[_c('chart',_vm._g(_vm._b({class:{ 'gl-grow': _vm.autoHeight },attrs:{"height":_vm.height,"options":_vm.options},on:{"created":_vm.onCreated,"updated":_vm.onUpdated}},'chart',_vm.$attrs,false),_vm.$listeners)),_vm._v(" "),(_vm.shouldShowAnnotationsTooltip)?_c('chart-tooltip',{ref:"annotationsTooltip",attrs:{"id":"annotationsTooltip","show":_vm.showAnnotationsTooltip,"chart":_vm.chart,"top":_vm.annotationsTooltipPosition.top,"left":_vm.annotationsTooltipPosition.left,"placement":"bottom"},scopedSlots:_vm._u([{key:"title",fn:function(){return [_c('div',[_vm._v(_vm._s(_vm.annotationsTooltipTitle))])]},proxy:true}],null,false,1889294429)},[_vm._v(" "),_c('div',[_vm._v(_vm._s(_vm.annotationsTooltipContent))])]):_vm._e(),_vm._v(" "),(_vm.chart)?_c('chart-tooltip',{ref:"dataTooltip",attrs:{"chart":_vm.chart,"use-default-tooltip-formatter":!_vm.formatTooltipText},scopedSlots:_vm._u([(_vm.$scopedSlots['tooltip-title'])?{key:"title",fn:function(scope){return [_vm._t("tooltip-title",null,null,scope)]}}:null,(_vm.$scopedSlots['tooltip-content'])?{key:"default",fn:function(scope){return [_vm._t("tooltip-content",null,null,scope)]}}:null,(_vm.$scopedSlots['tooltip-value'])?{key:"tooltip-value",fn:function(scope){return [_vm._t("tooltip-value",null,null,scope)]}}:null],null,true)}):_vm._e(),_vm._v(" "),(_vm.hasLegend)?_c('chart-legend',{style:(_vm.legendStyle),attrs:{"chart":_vm.chart,"series-info":_vm.seriesInfo,"text-style":_vm.compiledOptions.textStyle,"min-text":_vm.legendMinText,"max-text":_vm.legendMaxText,"average-text":_vm.legendAverageText,"current-text":_vm.legendCurrentText,"layout":_vm.legendLayout}}):_vm._e()],1)};
|
|
292
|
+
var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-relative",class:( _obj = {}, _obj[_vm.$options.HEIGHT_AUTO_CLASSES] = _vm.autoHeight, _obj )},[_c('chart',_vm._g(_vm._b({class:{ 'gl-grow': _vm.autoHeight },attrs:{"height":_vm.height,"options":_vm.options},on:{"created":_vm.onCreated,"updated":_vm.onUpdated}},'chart',_vm.$attrs,false),_vm.$listeners)),_vm._v(" "),(_vm.shouldShowAnnotationsTooltip)?_c('chart-tooltip',{ref:"annotationsTooltip",attrs:{"id":"annotationsTooltip","show":_vm.showAnnotationsTooltip,"chart":_vm.chart,"top":_vm.annotationsTooltipPosition.top,"left":_vm.annotationsTooltipPosition.left,"placement":"bottom"},scopedSlots:_vm._u([{key:"title",fn:function(){return [_c('div',[_vm._v(_vm._s(_vm.annotationsTooltipTitle))])]},proxy:true}],null,false,1889294429)},[_vm._v(" "),_c('div',[_vm._v(_vm._s(_vm.annotationsTooltipContent))])]):_vm._e(),_vm._v(" "),(_vm.chart)?_c('chart-tooltip',{ref:"dataTooltip",attrs:{"chart":_vm.chart,"use-default-tooltip-formatter":!_vm.formatTooltipText,"click-to-pin":_vm.clickToPinTooltip},scopedSlots:_vm._u([(_vm.$scopedSlots['tooltip-title'])?{key:"title",fn:function(scope){return [_vm._t("tooltip-title",null,null,scope)]}}:null,(_vm.$scopedSlots['tooltip-content'])?{key:"default",fn:function(scope){return [_vm._t("tooltip-content",null,null,scope)]}}:null,(_vm.$scopedSlots['tooltip-value'])?{key:"tooltip-value",fn:function(scope){return [_vm._t("tooltip-value",null,null,scope)]}}:null],null,true)}):_vm._e(),_vm._v(" "),(_vm.hasLegend)?_c('chart-legend',{style:(_vm.legendStyle),attrs:{"chart":_vm.chart,"series-info":_vm.seriesInfo,"text-style":_vm.compiledOptions.textStyle,"min-text":_vm.legendMinText,"max-text":_vm.legendMaxText,"average-text":_vm.legendAverageText,"current-text":_vm.legendCurrentText,"layout":_vm.legendLayout}}):_vm._e()],1)};
|
|
285
293
|
var __vue_staticRenderFns__ = [];
|
|
286
294
|
|
|
287
295
|
/* style */
|
|
@@ -115,12 +115,23 @@ var script = {
|
|
|
115
115
|
type: Boolean,
|
|
116
116
|
required: false,
|
|
117
117
|
default: false
|
|
118
|
+
},
|
|
119
|
+
/**
|
|
120
|
+
* Set to true to enable click-to-pin functionality.
|
|
121
|
+
* When enabled, clicking on a chart point will keep the tooltip open, so the user can interact with the tooltip's content.
|
|
122
|
+
* The tooltip will unpin when clicking again on the chart and not on the tooltip.
|
|
123
|
+
*/
|
|
124
|
+
clickToPin: {
|
|
125
|
+
type: Boolean,
|
|
126
|
+
required: false,
|
|
127
|
+
default: false
|
|
118
128
|
}
|
|
119
129
|
},
|
|
120
130
|
data() {
|
|
121
131
|
return {
|
|
122
|
-
|
|
132
|
+
pointerCoords: null,
|
|
123
133
|
isPointerInChart: false,
|
|
134
|
+
pinnedPosition: null,
|
|
124
135
|
debouncedMouseHandler: debounceByAnimationFrame(this.mouseHandler),
|
|
125
136
|
title: null,
|
|
126
137
|
content: {},
|
|
@@ -139,7 +150,9 @@ var script = {
|
|
|
139
150
|
marginTop: `${-this.yOffset}px`,
|
|
140
151
|
height: `${this.yOffset * 2}px`,
|
|
141
152
|
marginLeft: `${-this.xOffset}px`,
|
|
142
|
-
width: `${this.xOffset * 2}px
|
|
153
|
+
width: `${this.xOffset * 2}px`,
|
|
154
|
+
pointerEvents: this.isPinned ? 'auto' : 'none',
|
|
155
|
+
...this.tooltipPosition
|
|
143
156
|
};
|
|
144
157
|
},
|
|
145
158
|
fixedPosition() {
|
|
@@ -159,16 +172,41 @@ var script = {
|
|
|
159
172
|
}
|
|
160
173
|
return null;
|
|
161
174
|
},
|
|
175
|
+
tooltipPosition() {
|
|
176
|
+
if (this.fixedPosition) {
|
|
177
|
+
return this.fixedPosition;
|
|
178
|
+
}
|
|
179
|
+
if (this.pinnedPosition) {
|
|
180
|
+
return this.pinnedPosition;
|
|
181
|
+
}
|
|
182
|
+
return this.pointerPosition;
|
|
183
|
+
},
|
|
162
184
|
shouldShowPopover() {
|
|
163
185
|
if (this.show !== null) {
|
|
164
186
|
return this.show;
|
|
165
187
|
}
|
|
166
|
-
return this.isPointerInChart;
|
|
188
|
+
return this.isPinned || this.isPointerInChart;
|
|
189
|
+
},
|
|
190
|
+
isPinned() {
|
|
191
|
+
return this.pinnedPosition !== null;
|
|
192
|
+
},
|
|
193
|
+
pointerPosition() {
|
|
194
|
+
if (!this.pointerCoords) {
|
|
195
|
+
return null;
|
|
196
|
+
}
|
|
197
|
+
return {
|
|
198
|
+
left: `${this.pointerCoords.x}px`,
|
|
199
|
+
top: `${this.pointerCoords.y}px`
|
|
200
|
+
};
|
|
167
201
|
}
|
|
168
202
|
},
|
|
169
203
|
created() {
|
|
170
204
|
this.chart.getZr().on('mousemove', this.debouncedMouseHandler);
|
|
171
205
|
this.chart.getZr().on('mouseout', this.debouncedMouseHandler);
|
|
206
|
+
if (this.clickToPin) {
|
|
207
|
+
document.addEventListener('keydown', this.keyDownHandler);
|
|
208
|
+
this.chart.getZr().on('click', this.clickHandler);
|
|
209
|
+
}
|
|
172
210
|
if (this.useDefaultTooltipFormatter) {
|
|
173
211
|
this.chart.setOption({
|
|
174
212
|
xAxis: {
|
|
@@ -193,21 +231,83 @@ var script = {
|
|
|
193
231
|
beforeDestroy() {
|
|
194
232
|
this.chart.getZr().off('mousemove', this.debouncedMouseHandler);
|
|
195
233
|
this.chart.getZr().off('mouseout', this.debouncedMouseHandler);
|
|
234
|
+
if (this.clickToPin) {
|
|
235
|
+
this.chart.getZr().off('click', this.clickHandler);
|
|
236
|
+
document.removeEventListener('keydown', this.keyDownHandler);
|
|
237
|
+
}
|
|
196
238
|
},
|
|
197
239
|
methods: {
|
|
198
|
-
|
|
240
|
+
getEventCoordsWithinChart(_ref) {
|
|
199
241
|
let {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
242
|
+
event
|
|
243
|
+
} = _ref;
|
|
244
|
+
const {
|
|
245
|
+
zrX,
|
|
246
|
+
zrY
|
|
247
|
+
} = event;
|
|
248
|
+
const x = Math.round(zrX);
|
|
249
|
+
const y = Math.round(zrY);
|
|
250
|
+
if (!Number.isFinite(x) || !Number.isFinite(y)) {
|
|
251
|
+
return null;
|
|
252
|
+
}
|
|
253
|
+
if (!this.chart.containPixel('grid', [x, y])) {
|
|
254
|
+
return null;
|
|
255
|
+
}
|
|
256
|
+
return {
|
|
257
|
+
x,
|
|
258
|
+
y
|
|
259
|
+
};
|
|
260
|
+
},
|
|
261
|
+
mouseHandler(event) {
|
|
262
|
+
const coords = this.getEventCoordsWithinChart(event);
|
|
263
|
+
if (!coords) {
|
|
264
|
+
this.isPointerInChart = false;
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
this.pointerCoords = coords;
|
|
268
|
+
this.isPointerInChart = true;
|
|
269
|
+
},
|
|
270
|
+
clickHandler(event) {
|
|
271
|
+
if (!this.getEventCoordsWithinChart(event)) {
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
if (!this.isPinned) {
|
|
275
|
+
this.pinTooltip();
|
|
276
|
+
} else {
|
|
277
|
+
this.unpinTooltip(event.event);
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
pinTooltip() {
|
|
281
|
+
this.pinnedPosition = this.pointerPosition;
|
|
282
|
+
|
|
283
|
+
// prevents any axis pointers from being moved to a new position, they should also be pinned
|
|
284
|
+
this.chart.setOption({
|
|
285
|
+
tooltip: {
|
|
286
|
+
triggerOn: 'none'
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
},
|
|
290
|
+
unpinTooltip() {
|
|
291
|
+
this.pinnedPosition = null;
|
|
292
|
+
|
|
293
|
+
// restores the axis pointers to be unpinned and be triggered by mousemove
|
|
294
|
+
this.chart.setOption({
|
|
295
|
+
tooltip: {
|
|
296
|
+
triggerOn: 'mousemove',
|
|
297
|
+
show: false
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
// shows the tooltip and axis pointer at the position of the click
|
|
302
|
+
this.chart.dispatchAction({
|
|
303
|
+
type: 'showTip',
|
|
304
|
+
x: this.pointerCoords.x,
|
|
305
|
+
y: this.pointerCoords.y
|
|
306
|
+
});
|
|
307
|
+
},
|
|
308
|
+
keyDownHandler(event) {
|
|
309
|
+
if (event.key === 'Escape' && this.isPinned) {
|
|
310
|
+
this.unpinTooltip();
|
|
211
311
|
}
|
|
212
312
|
}
|
|
213
313
|
}
|
|
@@ -217,7 +317,7 @@ var script = {
|
|
|
217
317
|
const __vue_script__ = script;
|
|
218
318
|
|
|
219
319
|
/* template */
|
|
220
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.chart)?_c('div',
|
|
320
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.chart)?_c('div',[_c('div',{staticClass:"gl-chart-tooltip",style:(_vm.targetStyle),attrs:{"id":_vm.targetId}}),_vm._v(" "),_c('gl-popover',_vm._b({attrs:{"show":_vm.shouldShowPopover,"target":_vm.targetId,"container":_vm.targetId,"placement":_vm.placement,"triggers":""},scopedSlots:_vm._u([{key:"title",fn:function(){return [_vm._t("title",function(){return [_vm._v(_vm._s(_vm.title))]},null,{ title: _vm.title, params: _vm.params })]},proxy:true}],null,true)},'gl-popover',_vm.$attrs,false),[_vm._v(" "),_vm._t("default",function(){return [_c('tooltip-default-format',{attrs:{"tooltip-content":_vm.content},scopedSlots:_vm._u([(_vm.$scopedSlots['tooltip-value'])?{key:"tooltip-value",fn:function(scope){return [_vm._t("tooltip-value",null,null,scope)]}}:null],null,true)})]},null,{ content: _vm.content, params: _vm.params })],2)],1):_vm._e()};
|
|
221
321
|
var __vue_staticRenderFns__ = [];
|
|
222
322
|
|
|
223
323
|
/* style */
|