@gitlab/ui 49.0.1 → 49.0.3

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 (128) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/components/base/accordion/accordion.js +2 -8
  3. package/dist/components/base/accordion/accordion_item.js +0 -14
  4. package/dist/components/base/alert/alert.js +4 -22
  5. package/dist/components/base/avatar/avatar.js +0 -7
  6. package/dist/components/base/avatar_labeled/avatar_labeled.js +0 -2
  7. package/dist/components/base/avatars_inline/avatars_inline.js +2 -10
  8. package/dist/components/base/badge/badge.js +0 -8
  9. package/dist/components/base/banner/banner.js +0 -10
  10. package/dist/components/base/breadcrumb/breadcrumb.js +0 -12
  11. package/dist/components/base/breadcrumb/breadcrumb_item.js +0 -2
  12. package/dist/components/base/broadcast_message/broadcast_message.js +0 -3
  13. package/dist/components/base/button/button.js +0 -11
  14. package/dist/components/base/card/card.js +1 -2
  15. package/dist/components/base/datepicker/datepicker.js +7 -42
  16. package/dist/components/base/daterange_picker/daterange_picker.js +0 -23
  17. package/dist/components/base/drawer/drawer.js +0 -13
  18. package/dist/components/base/dropdown/dropdown.js +3 -17
  19. package/dist/components/base/dropdown/dropdown_item.js +2 -8
  20. package/dist/components/base/filtered_search/common_story_options.js +1 -2
  21. package/dist/components/base/filtered_search/filtered_search.js +9 -61
  22. package/dist/components/base/filtered_search/filtered_search_suggestion.js +0 -6
  23. package/dist/components/base/filtered_search/filtered_search_suggestion_list.js +0 -16
  24. package/dist/components/base/filtered_search/filtered_search_term.js +0 -9
  25. package/dist/components/base/filtered_search/filtered_search_token.js +10 -49
  26. package/dist/components/base/filtered_search/filtered_search_token_segment.js +3 -56
  27. package/dist/components/base/filtered_search/filtered_search_utils.js +7 -24
  28. package/dist/components/base/form/form_checkbox/form_checkbox.js +0 -2
  29. package/dist/components/base/form/form_checkbox_tree/checkbox_tree_node.js +0 -4
  30. package/dist/components/base/form/form_checkbox_tree/form_checkbox_tree.js +0 -10
  31. package/dist/components/base/form/form_checkbox_tree/models/node.js +1 -10
  32. package/dist/components/base/form/form_checkbox_tree/models/tree.js +16 -37
  33. package/dist/components/base/form/form_combobox/form_combobox.js +2 -36
  34. package/dist/components/base/form/form_group/form_group.js +2 -7
  35. package/dist/components/base/form/form_input/form_input.js +2 -8
  36. package/dist/components/base/form/form_input_group/form_input_group.js +0 -5
  37. package/dist/components/base/form/form_input_group/form_input_group_mixin.js +0 -8
  38. package/dist/components/base/form/form_radio_group/form_radio_group.js +0 -2
  39. package/dist/components/base/form/form_select/form_select.js +0 -3
  40. package/dist/components/base/form/form_textarea/form_textarea.js +2 -7
  41. package/dist/components/base/icon/icon.js +4 -14
  42. package/dist/components/base/infinite_scroll/infinite_scroll.js +7 -21
  43. package/dist/components/base/keyset_pagination/keyset_pagination.js +0 -9
  44. package/dist/components/base/label/label.js +0 -12
  45. package/dist/components/base/loading_icon/loading_icon.js +7 -10
  46. package/dist/components/base/markdown/markdown.js +1 -0
  47. package/dist/components/base/modal/modal.js +7 -27
  48. package/dist/components/base/new_dropdowns/base_dropdown/base_dropdown.js +0 -25
  49. package/dist/components/base/new_dropdowns/constants.js +4 -2
  50. package/dist/components/base/new_dropdowns/listbox/listbox.js +0 -63
  51. package/dist/components/base/new_dropdowns/listbox/listbox_group.js +0 -2
  52. package/dist/components/base/new_dropdowns/listbox/listbox_item.js +0 -5
  53. package/dist/components/base/new_dropdowns/listbox/utils.js +0 -7
  54. package/dist/components/base/paginated_list/paginated_list.js +0 -15
  55. package/dist/components/base/pagination/pagination.js +14 -72
  56. package/dist/components/base/path/path.js +0 -29
  57. package/dist/components/base/popover/popover.js +0 -5
  58. package/dist/components/base/search_box_by_click/search_box_by_click.js +1 -26
  59. package/dist/components/base/search_box_by_type/search_box_by_type.js +2 -12
  60. package/dist/components/base/segmented_control/segmented_control.js +0 -10
  61. package/dist/components/base/skeleton_loader/skeleton_loader.js +0 -19
  62. package/dist/components/base/skeleton_loading/skeleton_loading.js +0 -3
  63. package/dist/components/base/sorting/sorting.js +1 -9
  64. package/dist/components/base/sorting/sorting_item.js +4 -6
  65. package/dist/components/base/table/table.js +0 -4
  66. package/dist/components/base/tabs/tab/tab.js +2 -6
  67. package/dist/components/base/tabs/tabs/scrollable_tabs.js +0 -21
  68. package/dist/components/base/tabs/tabs/tabs.js +8 -33
  69. package/dist/components/base/toast/toast.js +4 -15
  70. package/dist/components/base/toggle/toggle.js +0 -18
  71. package/dist/components/base/token/token.js +0 -4
  72. package/dist/components/base/token_selector/token_container.js +0 -24
  73. package/dist/components/base/token_selector/token_selector.js +10 -61
  74. package/dist/components/base/token_selector/token_selector_dropdown.js +4 -32
  75. package/dist/components/charts/area/area.js +8 -32
  76. package/dist/components/charts/bar/bar.js +7 -19
  77. package/dist/components/charts/chart/chart.js +1 -22
  78. package/dist/components/charts/column/column.js +8 -18
  79. package/dist/components/charts/discrete_scatter/discrete_scatter.js +2 -13
  80. package/dist/components/charts/gauge/gauge.js +0 -15
  81. package/dist/components/charts/heatmap/heatmap.js +3 -16
  82. package/dist/components/charts/legend/legend.js +2 -24
  83. package/dist/components/charts/line/line.js +8 -34
  84. package/dist/components/charts/series_label/series_label.js +0 -12
  85. package/dist/components/charts/single_stat/single_stat.js +0 -8
  86. package/dist/components/charts/sparkline/sparkline.js +1 -16
  87. package/dist/components/charts/stacked_column/stacked_column.js +8 -26
  88. package/dist/components/charts/tooltip/tooltip.js +0 -6
  89. package/dist/components/mixins/button_mixin.js +0 -1
  90. package/dist/components/mixins/safe_link_mixin.js +0 -1
  91. package/dist/components/mixins/toolbox_mixin.js +0 -1
  92. package/dist/components/mixins/tooltip_mixin.js +1 -2
  93. package/dist/components/regions/empty_state/empty_state.js +0 -12
  94. package/dist/components/utilities/animated_number/animated_number.js +0 -16
  95. package/dist/components/utilities/friendly_wrap/friendly_wrap.js +0 -3
  96. package/dist/components/utilities/intersection_observer/intersection_observer.js +0 -7
  97. package/dist/components/utilities/intersperse/intersperse.js +3 -9
  98. package/dist/components/utilities/sprintf/sprintf.js +9 -23
  99. package/dist/components/utilities/truncate/truncate.js +0 -10
  100. package/dist/config.js +3 -4
  101. package/dist/directives/hover_load/hover_load.js +2 -8
  102. package/dist/directives/outside/get_event_like_time_stamp.js +4 -2
  103. package/dist/directives/outside/outside.js +5 -20
  104. package/dist/directives/resize_observer/resize_observer.js +0 -10
  105. package/dist/directives/safe_html/safe_html.js +5 -6
  106. package/dist/directives/safe_link/mock_data.js +1 -1
  107. package/dist/directives/safe_link/safe_link.js +0 -13
  108. package/dist/utils/breakpoints.js +0 -3
  109. package/dist/utils/charts/config.js +29 -42
  110. package/dist/utils/charts/constants.js +8 -8
  111. package/dist/utils/charts/mock_data.js +2 -2
  112. package/dist/utils/charts/story_config.js +1 -1
  113. package/dist/utils/charts/theme.js +1 -3
  114. package/dist/utils/charts/utils.js +2 -6
  115. package/dist/utils/constants.js +10 -7
  116. package/dist/utils/data_utils.js +5 -4
  117. package/dist/utils/datetime_utility.js +4 -4
  118. package/dist/utils/number_utils.js +7 -11
  119. package/dist/utils/stories_utils.js +1 -1
  120. package/dist/utils/story_decorators/container.js +0 -1
  121. package/dist/utils/string_utils.js +0 -14
  122. package/dist/utils/test_utils.js +3 -2
  123. package/dist/utils/use_fake_date.js +0 -4
  124. package/dist/utils/use_mock_intersection_observer.js +4 -19
  125. package/dist/utils/utils.js +5 -14
  126. package/package.json +3 -3
  127. package/src/components/base/pagination/pagination.vue +2 -2
  128. package/src/components/base/toast/toast.js +1 -0
@@ -7,6 +7,7 @@ import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
7
7
 
8
8
  //
9
9
 
10
+ // the padding is needed so the mark points don't overflow when visible
10
11
  const gridPadding = symbolSize / 2;
11
12
  var script = {
12
13
  components: {
@@ -24,7 +25,6 @@ var script = {
24
25
  type: Array,
25
26
  required: true
26
27
  },
27
-
28
28
  /**
29
29
  * Controls the label that is shown within the chart's tooltip. Use it to describe your data.
30
30
  */
@@ -33,7 +33,6 @@ var script = {
33
33
  required: false,
34
34
  default: ''
35
35
  },
36
-
37
36
  /**
38
37
  * Sets the chart's height in pixel.
39
38
  */
@@ -42,7 +41,6 @@ var script = {
42
41
  required: false,
43
42
  default: 50
44
43
  },
45
-
46
44
  /**
47
45
  * If enabled will show the value of the latest "y" data-point on the side right of the chart.
48
46
  */
@@ -52,7 +50,6 @@ var script = {
52
50
  default: true
53
51
  }
54
52
  },
55
-
56
53
  data() {
57
54
  return {
58
55
  chartInstance: null,
@@ -67,7 +64,6 @@ var script = {
67
64
  }
68
65
  };
69
66
  },
70
-
71
67
  computed: {
72
68
  options() {
73
69
  const sparkLineChartOptions = {
@@ -100,7 +96,6 @@ var script = {
100
96
  const mergedOptions = merge({}, defaultChartOptions, sparkLineChartOptions);
101
97
  return mergeSeriesToOptions(mergedOptions, this.series);
102
98
  },
103
-
104
99
  series() {
105
100
  const {
106
101
  data
@@ -125,12 +120,10 @@ var script = {
125
120
  data
126
121
  };
127
122
  },
128
-
129
123
  lastYValue() {
130
124
  const latestEntry = this.data.slice(-1)[0];
131
125
  return latestEntry[1];
132
126
  }
133
-
134
127
  },
135
128
  methods: {
136
129
  onChartCreated(chartInstance) {
@@ -141,24 +134,19 @@ var script = {
141
134
  * @event chartCreated
142
135
  * @type {object}
143
136
  */
144
-
145
137
  this.$emit('chartCreated', chartInstance);
146
138
  },
147
-
148
139
  handleResize() {
149
140
  this.chartInstance.resize();
150
141
  },
151
-
152
142
  hideTooltip() {
153
143
  this.tooltip.show = false;
154
144
  },
155
-
156
145
  formatTooltipText(_ref) {
157
146
  let [xValue, yValue] = _ref;
158
147
  this.tooltip.title = xValue;
159
148
  this.tooltip.content = yValue;
160
149
  },
161
-
162
150
  setTooltipPosition(data) {
163
151
  const [left, top] = this.chartInstance.convertToPixel('grid', data);
164
152
  this.tooltip.position = {
@@ -166,7 +154,6 @@ var script = {
166
154
  top: `${top}px`
167
155
  };
168
156
  },
169
-
170
157
  // This function is called any time the axis pointer is changed (the black bubble showing which
171
158
  // point on the line is selected). Note that it will not trigger if the axis pointer is removed,
172
159
  // only when it changes from one point to another or is shown for the first time.
@@ -181,14 +168,12 @@ var script = {
181
168
  const {
182
169
  data
183
170
  } = firstEntry;
184
-
185
171
  if (data) {
186
172
  this.tooltip.show = true;
187
173
  this.formatTooltipText(data);
188
174
  this.setTooltipPosition(data);
189
175
  }
190
176
  }
191
-
192
177
  }
193
178
  };
194
179
 
@@ -11,7 +11,8 @@ import ChartLegend from '../legend/legend';
11
11
  import ChartTooltip from '../tooltip/tooltip';
12
12
  import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
13
13
 
14
- const yAxisDefaults = { ...yAxis,
14
+ const yAxisDefaults = {
15
+ ...yAxis,
15
16
  nameLocation: 'center',
16
17
  axisTick: {
17
18
  show: false
@@ -104,11 +105,9 @@ var script = {
104
105
  type: String,
105
106
  required: false,
106
107
  default: LEGEND_LAYOUT_INLINE,
107
-
108
108
  validator(layout) {
109
109
  return [LEGEND_LAYOUT_INLINE, LEGEND_LAYOUT_TABLE].indexOf(layout) !== -1;
110
110
  }
111
-
112
111
  },
113
112
  formatTooltipText: {
114
113
  type: Function,
@@ -121,7 +120,6 @@ var script = {
121
120
  default: null
122
121
  }
123
122
  },
124
-
125
123
  data() {
126
124
  return {
127
125
  chart: null,
@@ -135,12 +133,10 @@ var script = {
135
133
  debouncedMoveShowTooltip: debounceByAnimationFrame(this.moveShowTooltip)
136
134
  };
137
135
  },
138
-
139
136
  computed: {
140
137
  hasSecondaryAxis() {
141
138
  return Boolean(this.secondaryData.length);
142
139
  },
143
-
144
140
  barSeries() {
145
141
  return this.bars.map((_ref, index) => {
146
142
  let {
@@ -157,7 +153,6 @@ var script = {
157
153
  });
158
154
  });
159
155
  },
160
-
161
156
  lineSeries() {
162
157
  const offset = this.bars.length;
163
158
  return this.lines.map((_ref2, index) => {
@@ -173,7 +168,6 @@ var script = {
173
168
  });
174
169
  });
175
170
  },
176
-
177
171
  secondarySeries() {
178
172
  const offset = this.bars.length + this.lines.length;
179
173
  return this.secondaryData.map((_ref3, index) => {
@@ -198,11 +192,9 @@ var script = {
198
192
  });
199
193
  });
200
194
  },
201
-
202
195
  series() {
203
196
  return [...this.barSeries, ...this.lineSeries, ...this.secondarySeries];
204
197
  },
205
-
206
198
  options() {
207
199
  const mergedOptions = merge({}, defaultChartOptions, {
208
200
  grid: this.hasSecondaryAxis ? gridWithSecondaryYAxis : grid,
@@ -226,31 +218,30 @@ var script = {
226
218
  name: this.xAxisTitle,
227
219
  type: this.xAxisType
228
220
  },
229
- yAxis: [{ ...yAxisDefaults,
221
+ yAxis: [{
222
+ ...yAxisDefaults,
230
223
  name: this.yAxisTitle
231
- }, { ...yAxisDefaults,
224
+ }, {
225
+ ...yAxisDefaults,
232
226
  name: this.secondaryDataTitle,
233
227
  show: this.hasSecondaryAxis
234
228
  }],
235
229
  legend: {
236
230
  show: false
237
231
  }
238
- }, this.option, dataZoomAdjustments(this.option.dataZoom), this.toolboxAdjustments); // All chart options can be merged but series
232
+ }, this.option, dataZoomAdjustments(this.option.dataZoom), this.toolboxAdjustments);
233
+ // All chart options can be merged but series
239
234
  // needs to be handled specially
240
-
241
235
  return mergeSeriesToOptions(mergedOptions, this.series);
242
236
  },
243
-
244
237
  legendStyle() {
245
238
  return {
246
239
  paddingLeft: `${grid.left}px`
247
240
  };
248
241
  },
249
-
250
242
  compiledOptions() {
251
243
  return this.chart ? this.chart.getOption() : null;
252
244
  },
253
-
254
245
  seriesInfo() {
255
246
  return this.compiledOptions.series.reduce((acc, series, index) => {
256
247
  acc.push({
@@ -263,21 +254,16 @@ var script = {
263
254
  return acc;
264
255
  }, []);
265
256
  }
266
-
267
257
  },
268
-
269
258
  beforeDestroy() {
270
259
  this.chart.getDom().removeEventListener('mousemove', this.debouncedMoveShowTooltip);
271
260
  this.chart.getDom().removeEventListener('mouseout', this.debouncedMoveShowTooltip);
272
261
  },
273
-
274
262
  methods: {
275
263
  getColor(index) {
276
264
  var _this$customPalette;
277
-
278
265
  return this.customPalette ? (_this$customPalette = this.customPalette) === null || _this$customPalette === void 0 ? void 0 : _this$customPalette[index] : colorFromDefaultPalette(index);
279
266
  },
280
-
281
267
  moveShowTooltip(mouseEvent) {
282
268
  this.tooltipPosition = {
283
269
  left: `${mouseEvent.zrX}px`,
@@ -285,14 +271,12 @@ var script = {
285
271
  };
286
272
  this.showTooltip = this.chart.containPixel('grid', [mouseEvent.zrX, mouseEvent.zrY]);
287
273
  },
288
-
289
274
  onCreated(chart) {
290
275
  chart.getDom().addEventListener('mousemove', this.debouncedMoveShowTooltip);
291
276
  chart.getDom().addEventListener('mouseout', this.debouncedMoveShowTooltip);
292
277
  this.chart = chart;
293
278
  this.$emit('created', chart);
294
279
  },
295
-
296
280
  defaultFormatTooltipText(params) {
297
281
  const {
298
282
  tooltipContent
@@ -309,7 +293,6 @@ var script = {
309
293
  this.tooltipTitle = params.value;
310
294
  this.$set(this, 'tooltipContent', tooltipContent);
311
295
  },
312
-
313
296
  onLabelChange(params) {
314
297
  if (this.formatTooltipText) {
315
298
  this.formatTooltipText(params);
@@ -317,7 +300,6 @@ var script = {
317
300
  this.defaultFormatTooltipText(params);
318
301
  }
319
302
  }
320
-
321
303
  }
322
304
  };
323
305
 
@@ -14,11 +14,9 @@ var script = {
14
14
  chart: {
15
15
  type: Object,
16
16
  required: true,
17
-
18
17
  validator(chart) {
19
18
  return Object.is(chart, echarts.getInstanceByDom(chart.getDom()));
20
19
  }
21
-
22
20
  },
23
21
  id: {
24
22
  type: String,
@@ -57,20 +55,16 @@ var script = {
57
55
  // `this.id` can be used to uniquely identify them
58
56
  return `${this.chart.getDom().getAttribute('_echarts_instance_')}-tooltip-${this.id}`;
59
57
  },
60
-
61
58
  containerPosition() {
62
59
  const props = ['top', 'bottom', 'left', 'right'];
63
60
  return props.reduce((accumulator, prop) => {
64
61
  const position = this[prop];
65
-
66
62
  if (position) {
67
63
  accumulator[prop] = position;
68
64
  }
69
-
70
65
  return accumulator;
71
66
  }, {});
72
67
  }
73
-
74
68
  }
75
69
  };
76
70
 
@@ -5,7 +5,6 @@ const ButtonMixin = {
5
5
  buttonSize() {
6
6
  return buttonSizeOptionsMap[this.size];
7
7
  }
8
-
9
8
  }
10
9
  };
11
10
 
@@ -24,7 +24,6 @@ const SafeLinkMixin = {
24
24
  skipSanitization: this.isUnsafeLink
25
25
  };
26
26
  }
27
-
28
27
  }
29
28
  };
30
29
 
@@ -39,7 +39,6 @@ var toolbox_mixin = {
39
39
  backIconPath: this.toolboxBackIconPath
40
40
  }) : {};
41
41
  }
42
-
43
42
  }
44
43
  };
45
44
 
@@ -1,5 +1,6 @@
1
1
  import { tooltipActionEvents } from '../../utils/constants';
2
2
 
3
+ // eslint-disable-next-line import/no-default-export
3
4
  var tooltip_mixin = (tooltipRefName => ({
4
5
  mounted() {
5
6
  /**
@@ -12,11 +13,9 @@ var tooltip_mixin = (tooltipRefName => ({
12
13
  */
13
14
  tooltipActionEvents.forEach(event => this.$on(event, () => this.$refs[tooltipRefName].$emit(event)));
14
15
  },
15
-
16
16
  beforeDestroy() {
17
17
  tooltipActionEvents.forEach(event => this.$off(event));
18
18
  }
19
-
20
19
  }));
21
20
 
22
21
  export default tooltip_mixin;
@@ -14,7 +14,6 @@ var script = {
14
14
  required: false,
15
15
  default: null
16
16
  },
17
-
18
17
  /**
19
18
  * The illustration's URL.
20
19
  */
@@ -23,7 +22,6 @@ var script = {
23
22
  required: false,
24
23
  default: null
25
24
  },
26
-
27
25
  /**
28
26
  * The illustration's height used to prevent content reflow.
29
27
  */
@@ -32,7 +30,6 @@ var script = {
32
30
  required: false,
33
31
  default: null
34
32
  },
35
-
36
33
  /**
37
34
  * The desciption/body text of the empty state.
38
35
  */
@@ -41,7 +38,6 @@ var script = {
41
38
  required: false,
42
39
  default: null
43
40
  },
44
-
45
41
  /**
46
42
  * The primary GlButton's href.
47
43
  */
@@ -50,7 +46,6 @@ var script = {
50
46
  required: false,
51
47
  default: null
52
48
  },
53
-
54
49
  /**
55
50
  * The primary GlButton's text. If falsey, the button is not shown.
56
51
  */
@@ -59,7 +54,6 @@ var script = {
59
54
  required: false,
60
55
  default: null
61
56
  },
62
-
63
57
  /**
64
58
  * The secondary GlButton's href.
65
59
  */
@@ -68,7 +62,6 @@ var script = {
68
62
  required: false,
69
63
  default: null
70
64
  },
71
-
72
65
  /**
73
66
  * The secondary GlButton's text. If falsey, the button is not shown.
74
67
  */
@@ -77,7 +70,6 @@ var script = {
77
70
  required: false,
78
71
  default: null
79
72
  },
80
-
81
73
  /**
82
74
  * Determines whether to render the compact layout.
83
75
  */
@@ -96,19 +88,15 @@ var script = {
96
88
  height() {
97
89
  return this.shouldPreventImageReflow ? this.svgHeight : null;
98
90
  },
99
-
100
91
  shouldPreventImageReflow() {
101
92
  return Boolean(this.svgHeight);
102
93
  },
103
-
104
94
  shouldRenderPrimaryButton() {
105
95
  return Boolean(this.primaryButtonLink && this.primaryButtonText);
106
96
  },
107
-
108
97
  shouldRenderSecondaryButton() {
109
98
  return Boolean(this.secondaryButtonLink && this.secondaryButtonText);
110
99
  }
111
-
112
100
  }
113
101
  };
114
102
 
@@ -7,7 +7,6 @@ var script = {
7
7
  type: Number,
8
8
  required: true
9
9
  },
10
-
11
10
  /**
12
11
  * Controls how long it takes for the animation to complete.
13
12
  */
@@ -16,7 +15,6 @@ var script = {
16
15
  required: false,
17
16
  default: 2000
18
17
  },
19
-
20
18
  /**
21
19
  * Controls the number of decimal places displayed in the output.
22
20
  */
@@ -31,32 +29,25 @@ var script = {
31
29
  default: false
32
30
  }
33
31
  },
34
-
35
32
  data() {
36
33
  return {
37
34
  displayNumber: 0,
38
35
  startTime: null
39
36
  };
40
37
  },
41
-
42
38
  computed: {
43
39
  animatedNumber() {
44
40
  return this.displayNumber.toFixed(this.decimalPlaces);
45
41
  }
46
-
47
42
  },
48
-
49
43
  ready() {
50
44
  this.displayNumber = this.number ? this.number : 0;
51
45
  },
52
-
53
46
  watch: {
54
47
  number() {
55
48
  this.animate();
56
49
  }
57
-
58
50
  },
59
-
60
51
  mounted() {
61
52
  if (this.animateOnMount) {
62
53
  this.animate();
@@ -64,35 +55,28 @@ var script = {
64
55
  this.displayNumber = this.number;
65
56
  }
66
57
  },
67
-
68
58
  methods: {
69
59
  animate() {
70
60
  this.$emit('animating');
71
61
  window.requestAnimationFrame(this.count);
72
62
  },
73
-
74
63
  count(timestamp) {
75
64
  if (!this.startTime) {
76
65
  this.startTime = timestamp;
77
66
  }
78
-
79
67
  const progress = timestamp - this.startTime;
80
-
81
68
  if (progress < this.duration) {
82
69
  if (this.displayNumber !== this.number) {
83
70
  const change = (this.number - this.displayNumber) / (this.duration / 100);
84
71
  this.displayNumber += change;
85
72
  }
86
-
87
73
  window.requestAnimationFrame(this.count);
88
74
  } else {
89
75
  this.displayNumber = this.number; // Ensures that the final number is accurate.
90
-
91
76
  this.startTime = null;
92
77
  this.$emit('animated');
93
78
  }
94
79
  }
95
-
96
80
  }
97
81
  };
98
82
 
@@ -12,7 +12,6 @@ var script = {
12
12
  type: String,
13
13
  required: true
14
14
  },
15
-
16
15
  /**
17
16
  * A list of strings representing the break-words.
18
17
  */
@@ -22,7 +21,6 @@ var script = {
22
21
  default: () => ['/']
23
22
  }
24
23
  },
25
-
26
24
  render(createElement, _ref) {
27
25
  let {
28
26
  props
@@ -37,7 +35,6 @@ var script = {
37
35
  class: 'text-break'
38
36
  }, content);
39
37
  }
40
-
41
38
  };
42
39
 
43
40
  /* script */
@@ -6,7 +6,6 @@ const getObserver = _memoize(options => new IntersectionObserver(entries => {
6
6
  entry.target.$_gl_intersectionHandler(entry);
7
7
  });
8
8
  }, options || {}));
9
-
10
9
  var script = {
11
10
  name: 'GlIntersectionObserver',
12
11
  props: {
@@ -19,16 +18,13 @@ var script = {
19
18
  default: null
20
19
  }
21
20
  },
22
-
23
21
  mounted() {
24
22
  const observer = getObserver(this.options);
25
-
26
23
  this.$el.$_gl_intersectionHandler = entry => {
27
24
  /**
28
25
  * Emitted when the element's visibility changes
29
26
  */
30
27
  this.$emit('update', entry);
31
-
32
28
  if (entry.isIntersecting) {
33
29
  /**
34
30
  * Emitted when the element appears on the page
@@ -41,17 +37,14 @@ var script = {
41
37
  this.$emit('disappear');
42
38
  }
43
39
  };
44
-
45
40
  this.$el.$_gl_intersectionObserver = observer;
46
41
  observer.observe(this.$el);
47
42
  },
48
-
49
43
  destroyed() {
50
44
  this.$el.$_gl_intersectionObserver.unobserve(this.$el);
51
45
  delete this.$el.$_gl_intersectionHandler;
52
46
  delete this.$el.$_gl_intersectionObserver;
53
47
  },
54
-
55
48
  // Expose getObserver method for tests
56
49
  getObserver
57
50
  };
@@ -5,25 +5,21 @@ import { insert, intersperse } from '../../../utils/data_utils';
5
5
  import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
6
6
 
7
7
  //
8
-
9
8
  const containsWhitespaceOnly = vNode => vNode.text.trim() === '';
10
-
11
9
  const isTag = vNode => typeof vNode.tag === 'string';
12
-
13
10
  const filterWhitespaceNodes = filter(vNode => isTag(vNode) || !containsWhitespaceOnly(vNode));
14
11
  const insertAfterSecondLastItem = insert(-1);
15
- const replaceSecondLastItem = fill(-2, -1); // handles the addition of the lastSeparator in these two cases:
12
+ const replaceSecondLastItem = fill(-2, -1);
13
+
14
+ // handles the addition of the lastSeparator in these two cases:
16
15
  // item1, item2, item3 => item1, item2, and item3
17
16
  // item1, item2 => item1 and item2
18
-
19
17
  const addLastSeparator = lastSeparator => items => {
20
18
  if (!lastSeparator) {
21
19
  return items;
22
20
  }
23
-
24
21
  return items.length > 3 ? insertAfterSecondLastItem(lastSeparator, items) : replaceSecondLastItem(lastSeparator, items);
25
22
  };
26
-
27
23
  var script = {
28
24
  functional: true,
29
25
  props: {
@@ -38,7 +34,6 @@ var script = {
38
34
  required: false
39
35
  }
40
36
  },
41
-
42
37
  render(createElement, context) {
43
38
  const {
44
39
  props: {
@@ -51,7 +46,6 @@ var script = {
51
46
  const filterAndSeparate = compose(addLastSeparator(lastSeparator), intersperse(separator), filterWhitespaceNodes);
52
47
  return createElement('span', data, filterAndSeparate(slots().default));
53
48
  }
54
-
55
49
  };
56
50
 
57
51
  /* script */