@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.
Files changed (76) hide show
  1. package/dist/components/base/avatar_link/avatar_link.js +1 -1
  2. package/dist/components/base/avatars_inline/avatars_inline.js +1 -1
  3. package/dist/components/charts/line/line.js +9 -1
  4. package/dist/components/charts/shared/tooltip/tooltip.js +116 -16
  5. package/dist/index.css +1 -1
  6. package/dist/index.css.map +1 -1
  7. package/dist/tailwind.css +1 -1
  8. package/dist/tailwind.css.map +1 -1
  9. package/package.json +10 -10
  10. package/src/components/base/avatar_link/avatar_link.vue +1 -1
  11. package/src/components/base/avatars_inline/avatars_inline.vue +1 -1
  12. package/src/components/base/markdown/markdown_typescale_demo.html +41 -71
  13. package/src/components/charts/line/line.vue +9 -0
  14. package/src/components/charts/shared/tooltip/tooltip.vue +115 -18
  15. package/src/scss/variables.scss +1 -1
  16. package/src/components/base/accordion/accordion.md +0 -3
  17. package/src/components/base/accordion/accordion_item.md +0 -3
  18. package/src/components/base/alert/alert.md +0 -35
  19. package/src/components/base/animated_icon/animated_icon.md +0 -4
  20. package/src/components/base/avatar/avatar.md +0 -1
  21. package/src/components/base/avatar_labeled/avatar_labeled.md +0 -20
  22. package/src/components/base/avatar_link/avatar_link.md +0 -33
  23. package/src/components/base/avatars_inline/avatars_inline.md +0 -38
  24. package/src/components/base/badge/badge.md +0 -30
  25. package/src/components/base/banner/banner.md +0 -35
  26. package/src/components/base/breadcrumb/breadcrumb.md +0 -52
  27. package/src/components/base/broadcast_message/broadcast_message.md +0 -25
  28. package/src/components/base/button/button.md +0 -119
  29. package/src/components/base/button_group/button_group.md +0 -44
  30. package/src/components/base/card/card.md +0 -4
  31. package/src/components/base/collapse/collapse.md +0 -64
  32. package/src/components/base/datepicker/datepicker.md +0 -8
  33. package/src/components/base/daterange_picker/daterange_picker.md +0 -32
  34. package/src/components/base/drawer/drawer.md +0 -17
  35. package/src/components/base/dropdown/dropdown.md +0 -72
  36. package/src/components/base/dropdown/dropdown_item.md +0 -2
  37. package/src/components/base/dropdown/dropdown_section_header.md +0 -7
  38. package/src/components/base/dropdown/dropdown_text.md +0 -7
  39. package/src/components/base/filtered_search/filtered_search.md +0 -76
  40. package/src/components/base/filtered_search/filtered_search_suggestion.md +0 -15
  41. package/src/components/base/filtered_search/filtered_search_suggestion_list.md +0 -13
  42. package/src/components/base/filtered_search/filtered_search_term.md +0 -7
  43. package/src/components/base/filtered_search/filtered_search_token.md +0 -23
  44. package/src/components/base/filtered_search/filtered_search_token_segment.md +0 -14
  45. package/src/components/base/form/form_checkbox/form_checkbox.md +0 -6
  46. package/src/components/base/form/form_input/form_input.md +0 -306
  47. package/src/components/base/form/form_radio/form_radio.md +0 -23
  48. package/src/components/base/form/form_radio_group/form_radio_group.md +0 -63
  49. package/src/components/base/form/form_select/form_select.md +0 -1
  50. package/src/components/base/form/form_textarea/form_textarea.md +0 -3
  51. package/src/components/base/icon/icon.md +0 -27
  52. package/src/components/base/infinite_scroll/infinite_scroll.md +0 -104
  53. package/src/components/base/keyset_pagination/keyset_pagination.md +0 -49
  54. package/src/components/base/label/label.md +0 -15
  55. package/src/components/base/link/link.md +0 -187
  56. package/src/components/base/loading_icon/loading_icon.md +0 -3
  57. package/src/components/base/modal/modal.md +0 -30
  58. package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.md +0 -184
  59. package/src/components/base/new_dropdowns/listbox/listbox.md +0 -195
  60. package/src/components/base/pagination/pagination.md +0 -45
  61. package/src/components/base/path/path.md +0 -41
  62. package/src/components/base/progress_bar/progress_bar.md +0 -25
  63. package/src/components/base/search_box_by_click/search_box_by_click.md +0 -1
  64. package/src/components/base/search_box_by_type/search_box_by_type.md +0 -1
  65. package/src/components/base/segmented_control/segmented_control.md +0 -26
  66. package/src/components/base/skeleton_loader/skeleton_loader.md +0 -70
  67. package/src/components/base/sorting/sorting.md +0 -80
  68. package/src/components/base/table/table.md +0 -71
  69. package/src/components/base/table_lite/table_lite.md +0 -68
  70. package/src/components/base/tabs/tabs/tabs.md +0 -80
  71. package/src/components/base/toast/toast.md +0 -48
  72. package/src/components/base/toggle/toggle.md +0 -4
  73. package/src/components/base/token/token.md +0 -12
  74. package/src/components/base/tooltip/tooltip.md +0 -52
  75. package/src/scss/typescale/typeface_demo.html +0 -70
  76. package/src/scss/typescale/typescale.md +0 -81
@@ -2,7 +2,7 @@ import GlLink from '../link/link';
2
2
  import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
3
3
 
4
4
  var script = {
5
- name: 'AvatarLink',
5
+ name: 'GlAvatarLink',
6
6
  components: {
7
7
  GlLink
8
8
  }
@@ -6,7 +6,7 @@ import GlTooltip from '../tooltip/tooltip';
6
6
  import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
7
7
 
8
8
  var script = {
9
- name: 'AvatarsInline',
9
+ name: 'GlAvatarsInline',
10
10
  components: {
11
11
  GlAvatar,
12
12
  GlTooltip
@@ -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
- pointerPosition: null,
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
- mouseHandler(event) {
240
+ getEventCoordsWithinChart(_ref) {
199
241
  let {
200
- zrX: x,
201
- zrY: y
202
- } = event.event;
203
- if (Number.isFinite(x) && Number.isFinite(y)) {
204
- x = Math.round(x);
205
- y = Math.round(y);
206
- this.pointerPosition = {
207
- left: `${x}px`,
208
- top: `${y}px`
209
- };
210
- this.isPointerInChart = this.chart.containPixel('grid', [x, y]);
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',{staticClass:"gl-pointer-events-none"},[_c('div',{staticClass:"gl-chart-tooltip",style:(Object.assign({}, (_vm.fixedPosition || _vm.pointerPosition), _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()};
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 */