@gitlab/ui 49.11.2 → 50.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/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ # [50.0.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v49.11.2...v50.0.0) (2022-11-22)
2
+
3
+
4
+ ### Code Refactoring
5
+
6
+ * **charts:** Remove unused ToolboxMixin ([0d486ee](https://gitlab.com/gitlab-org/gitlab-ui/commit/0d486ee1dfcf4bc0f93f2e64f928eff803fe49ee))
7
+
8
+
9
+ ### BREAKING CHANGES
10
+
11
+ * **charts:** - remove ToolboxMixin
12
+ - remove getToolboxConfig in utils/charts/config
13
+
1
14
  ## [49.11.2](https://gitlab.com/gitlab-org/gitlab-ui/compare/v49.11.1...v49.11.2) (2022-11-17)
2
15
 
3
16
 
@@ -4,7 +4,6 @@ import { LEGEND_AVERAGE_TEXT, LEGEND_MAX_TEXT, LEGEND_MIN_TEXT, LEGEND_CURRENT_T
4
4
  import { colorFromDefaultPalette } from '../../../utils/charts/theme';
5
5
  import { seriesHasAnnotations, isDataPointAnnotation } from '../../../utils/charts/utils';
6
6
  import { debounceByAnimationFrame } from '../../../utils/utils';
7
- import { ToolboxMixin } from '../../mixins/toolbox_mixin';
8
7
  import TooltipDefaultFormat from '../../shared_components/charts/tooltip_default_format';
9
8
  import Chart from '../chart/chart';
10
9
  import ChartLegend from '../legend/legend';
@@ -19,7 +18,6 @@ var script = {
19
18
  ChartTooltip,
20
19
  TooltipDefaultFormat
21
20
  },
22
- mixins: [ToolboxMixin],
23
21
  inheritAttrs: false,
24
22
  props: {
25
23
  data: {
@@ -161,7 +159,7 @@ var script = {
161
159
  show: false
162
160
  }
163
161
  };
164
- const mergedOptions = merge({}, defaultChartOptions, defaultAreaChartOptions, this.option, dataZoomAdjustments(this.option.dataZoom), this.toolboxAdjustments);
162
+ const mergedOptions = merge({}, defaultChartOptions, defaultAreaChartOptions, this.option, dataZoomAdjustments(this.option.dataZoom));
165
163
  // All chart options can be merged but series
166
164
  // needs to be handled specially.
167
165
  return mergeSeriesToOptions(mergeAnnotationAxisToOptions(mergedOptions, this.hasAnnotations), this.series);
@@ -5,7 +5,6 @@ import { TOOLTIP_LEFT_OFFSET } from '../../../utils/charts/constants';
5
5
  import { colorFromDefaultPalette } from '../../../utils/charts/theme';
6
6
  import { engineeringNotation } from '../../../utils/number_utils';
7
7
  import { debounceByAnimationFrame, hexToRgba } from '../../../utils/utils';
8
- import { ToolboxMixin } from '../../mixins/toolbox_mixin';
9
8
  import TooltipDefaultFormat from '../../shared_components/charts/tooltip_default_format';
10
9
  import Chart from '../chart/chart';
11
10
  import ChartTooltip from '../tooltip/tooltip';
@@ -61,7 +60,6 @@ var script = {
61
60
  ChartTooltip,
62
61
  TooltipDefaultFormat
63
62
  },
64
- mixins: [ToolboxMixin],
65
63
  inheritAttrs: false,
66
64
  props: {
67
65
  data: {
@@ -149,7 +147,7 @@ var script = {
149
147
  legend: {
150
148
  show: false
151
149
  }
152
- }, this.option, dataZoomAdjustments(this.option.dataZoom), this.toolboxAdjustments);
150
+ }, this.option, dataZoomAdjustments(this.option.dataZoom));
153
151
  // All chart options can be merged but series
154
152
  // needs to be handled specially
155
153
  return mergeSeriesToOptions(mergedOptions, this.series);
@@ -4,7 +4,6 @@ import { CHART_TYPE_LINE, TOOLTIP_LEFT_OFFSET } from '../../../utils/charts/cons
4
4
  import { colorFromDefaultPalette } from '../../../utils/charts/theme';
5
5
  import { columnOptions } from '../../../utils/constants';
6
6
  import { debounceByAnimationFrame } from '../../../utils/utils';
7
- import { ToolboxMixin } from '../../mixins/toolbox_mixin';
8
7
  import TooltipDefaultFormat from '../../shared_components/charts/tooltip_default_format';
9
8
  import Chart from '../chart/chart';
10
9
  import ChartTooltip from '../tooltip/tooltip';
@@ -24,7 +23,6 @@ var script = {
24
23
  ChartTooltip,
25
24
  TooltipDefaultFormat
26
25
  },
27
- mixins: [ToolboxMixin],
28
26
  inheritAttrs: false,
29
27
  props: {
30
28
  bars: {
@@ -173,7 +171,7 @@ var script = {
173
171
  legend: {
174
172
  show: false
175
173
  }
176
- }, this.option, dataZoomAdjustments(this.option.dataZoom), this.toolboxAdjustments);
174
+ }, this.option, dataZoomAdjustments(this.option.dataZoom));
177
175
  // All chart options can be merged but series
178
176
  // needs to be handled specially
179
177
  return mergeSeriesToOptions(mergedOptions, this.series);
@@ -2,7 +2,6 @@ import merge from 'lodash/merge';
2
2
  import { defaultChartOptions, dataZoomAdjustments, mergeSeriesToOptions } from '../../../utils/charts/config';
3
3
  import { colorFromDefaultPalette } from '../../../utils/charts/theme';
4
4
  import { debounceByAnimationFrame } from '../../../utils/utils';
5
- import { ToolboxMixin } from '../../mixins/toolbox_mixin';
6
5
  import TooltipDefaultFormat from '../../shared_components/charts/tooltip_default_format';
7
6
  import Chart from '../chart/chart';
8
7
  import ChartTooltip from '../tooltip/tooltip';
@@ -16,7 +15,6 @@ var script = {
16
15
  ChartTooltip,
17
16
  TooltipDefaultFormat
18
17
  },
19
- mixins: [ToolboxMixin],
20
18
  inheritAttrs: false,
21
19
  props: {
22
20
  data: {
@@ -104,7 +102,7 @@ var script = {
104
102
  legend: {
105
103
  show: false
106
104
  }
107
- }, this.option, dataZoomAdjustments(this.option.dataZoom), this.toolboxAdjustments);
105
+ }, this.option, dataZoomAdjustments(this.option.dataZoom));
108
106
  // All chart options can be merged but series
109
107
  // needs to be handled specially
110
108
  return mergeSeriesToOptions(mergedOptions, this.series);
@@ -3,7 +3,6 @@ import _uniq from 'lodash/uniq';
3
3
  import _isFinite from 'lodash/isFinite';
4
4
  import _merge from 'lodash/merge';
5
5
  import { gaugeNeutralHues, gaugeSafeHues, gaugeWarningHue } from '../../../utils/charts/theme';
6
- import { ToolboxMixin } from '../../mixins/toolbox_mixin';
7
6
  import Chart from '../chart/chart';
8
7
  import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
9
8
 
@@ -64,7 +63,6 @@ var script = {
64
63
  components: {
65
64
  Chart
66
65
  },
67
- mixins: [ToolboxMixin],
68
66
  props: {
69
67
  value: {
70
68
  type: Number,
@@ -115,7 +113,7 @@ var script = {
115
113
  splitNumber: this.splitNumber,
116
114
  axisColor: this.axisColor
117
115
  })
118
- }, this.option, this.toolboxAdjustments);
116
+ }, this.option);
119
117
  return mergedOptions;
120
118
  },
121
119
  validThresholds() {
@@ -4,7 +4,6 @@ import { TOOLTIP_LEFT_OFFSET } from '../../../utils/charts/constants';
4
4
  import { heatmapHues } from '../../../utils/charts/theme';
5
5
  import { engineeringNotation } from '../../../utils/number_utils';
6
6
  import { debounceByAnimationFrame } from '../../../utils/utils';
7
- import { ToolboxMixin } from '../../mixins/toolbox_mixin';
8
7
  import TooltipDefaultFormat from '../../shared_components/charts/tooltip_default_format';
9
8
  import Chart from '../chart/chart';
10
9
  import ChartLegend from '../legend/legend';
@@ -50,7 +49,6 @@ var script = {
50
49
  ChartTooltip,
51
50
  TooltipDefaultFormat
52
51
  },
53
- mixins: [ToolboxMixin],
54
52
  props: {
55
53
  options: {
56
54
  type: Object,
@@ -188,7 +186,7 @@ var script = {
188
186
  }
189
187
  }
190
188
  }
191
- }, this.toolboxAdjustments, this.options);
189
+ }, this.options);
192
190
  },
193
191
  legendStyle() {
194
192
  return {
@@ -4,7 +4,6 @@ import { LEGEND_AVERAGE_TEXT, LEGEND_MAX_TEXT, LEGEND_MIN_TEXT, LEGEND_CURRENT_T
4
4
  import { colorFromDefaultPalette } from '../../../utils/charts/theme';
5
5
  import { seriesHasAnnotations, isDataPointAnnotation } from '../../../utils/charts/utils';
6
6
  import { debounceByAnimationFrame } from '../../../utils/utils';
7
- import { ToolboxMixin } from '../../mixins/toolbox_mixin';
8
7
  import TooltipDefaultFormat from '../../shared_components/charts/tooltip_default_format';
9
8
  import Chart from '../chart/chart';
10
9
  import ChartLegend from '../legend/legend';
@@ -21,7 +20,6 @@ var script = {
21
20
  ChartTooltip,
22
21
  TooltipDefaultFormat
23
22
  },
24
- mixins: [ToolboxMixin],
25
23
  inheritAttrs: false,
26
24
  props: {
27
25
  data: {
@@ -161,7 +159,7 @@ var script = {
161
159
  show: false
162
160
  }
163
161
  };
164
- const mergedOptions = merge({}, defaultChartOptions, defaultLineChartOptions, this.option, dataZoomAdjustments(this.option.dataZoom), this.toolboxAdjustments);
162
+ const mergedOptions = merge({}, defaultChartOptions, defaultLineChartOptions, this.option, dataZoomAdjustments(this.option.dataZoom));
165
163
  // All chart options can be merged but series
166
164
  // needs to be handled specially
167
165
  return mergeSeriesToOptions(mergeAnnotationAxisToOptions(mergedOptions, this.hasAnnotations), this.series);
@@ -4,7 +4,6 @@ import { LEGEND_AVERAGE_TEXT, LEGEND_MAX_TEXT, LEGEND_MIN_TEXT, LEGEND_CURRENT_T
4
4
  import { colorFromDefaultPalette } from '../../../utils/charts/theme';
5
5
  import { columnOptions } from '../../../utils/constants';
6
6
  import { debounceByAnimationFrame } from '../../../utils/utils';
7
- import { ToolboxMixin } from '../../mixins/toolbox_mixin';
8
7
  import TooltipDefaultFormat from '../../shared_components/charts/tooltip_default_format';
9
8
  import Chart from '../chart/chart';
10
9
  import ChartLegend from '../legend/legend';
@@ -25,7 +24,6 @@ var script = {
25
24
  ChartLegend,
26
25
  TooltipDefaultFormat
27
26
  },
28
- mixins: [ToolboxMixin],
29
27
  inheritAttrs: false,
30
28
  props: {
31
29
  bars: {
@@ -229,7 +227,7 @@ var script = {
229
227
  legend: {
230
228
  show: false
231
229
  }
232
- }, this.option, dataZoomAdjustments(this.option.dataZoom), this.toolboxAdjustments);
230
+ }, this.option, dataZoomAdjustments(this.option.dataZoom));
233
231
  // All chart options can be merged but series
234
232
  // needs to be handled specially
235
233
  return mergeSeriesToOptions(mergedOptions, this.series);
@@ -159,38 +159,6 @@ const dataZoomAdjustments = dataZoom => {
159
159
  filterMode: 'weakFilter'
160
160
  }) : [];
161
161
  };
162
- const getToolboxConfig = function () {
163
- let {
164
- restoreIconPath = '',
165
- saveImageIconPath = '',
166
- zoomIconPath = '',
167
- backIconPath = ''
168
- } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
169
- const toolboxConfig = {
170
- toolbox: {
171
- feature: {}
172
- }
173
- };
174
- if (restoreIconPath.length) {
175
- toolboxConfig.toolbox.feature.restore = {
176
- icon: restoreIconPath
177
- };
178
- }
179
- if (saveImageIconPath.length) {
180
- toolboxConfig.toolbox.feature.saveAsImage = {
181
- icon: restoreIconPath
182
- };
183
- }
184
- if (zoomIconPath.length && backIconPath.length) {
185
- toolboxConfig.toolbox.feature.dataZoom = {
186
- icon: {
187
- zoom: zoomIconPath,
188
- back: backIconPath
189
- }
190
- };
191
- }
192
- return toolboxConfig;
193
- };
194
162
 
195
163
  /**
196
164
  * Generate eCharts markArea arrays for thresholds and annotations.
@@ -536,4 +504,4 @@ const getDefaultTooltipContent = function (params) {
536
504
  };
537
505
  };
538
506
 
539
- export { annotationsYAxisCoords, axes, dataZoomAdjustments, defaultAreaOpacity, defaultChartOptions, defaultFontSize, defaultHeight, defaultWidth, generateAnnotationSeries, generateBarSeries, generateLineSeries, getAnnotationsConfig, getDataZoomConfig, getDefaultTooltipContent, getThresholdConfig, getToolboxConfig, grid, gridWithSecondaryYAxis, lineStyle, mergeAnnotationAxisToOptions, mergeSeriesToOptions, parseAnnotations, symbolSize, validRenderers, xAxis, yAxis };
507
+ export { annotationsYAxisCoords, axes, dataZoomAdjustments, defaultAreaOpacity, defaultChartOptions, defaultFontSize, defaultHeight, defaultWidth, generateAnnotationSeries, generateBarSeries, generateLineSeries, getAnnotationsConfig, getDataZoomConfig, getDefaultTooltipContent, getThresholdConfig, grid, gridWithSecondaryYAxis, lineStyle, mergeAnnotationAxisToOptions, mergeSeriesToOptions, parseAnnotations, symbolSize, validRenderers, xAxis, yAxis };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "49.11.2",
3
+ "version": "50.0.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -85,7 +85,7 @@
85
85
  "@babel/preset-env": "^7.20.2",
86
86
  "@gitlab/eslint-plugin": "18.1.0",
87
87
  "@gitlab/stylelint-config": "4.1.0",
88
- "@gitlab/svgs": "3.7.0",
88
+ "@gitlab/svgs": "3.9.0",
89
89
  "@rollup/plugin-commonjs": "^11.1.0",
90
90
  "@rollup/plugin-node-resolve": "^7.1.3",
91
91
  "@rollup/plugin-replace": "^2.3.2",
@@ -111,7 +111,7 @@
111
111
  "babel-preset-vue": "^2.0.2",
112
112
  "bootstrap": "4.5.3",
113
113
  "bootstrap-vue-vue3": "npm:bootstrap-vue@2.23.1",
114
- "cypress": "^11.0.1",
114
+ "cypress": "^11.1.0",
115
115
  "emoji-regex": "^10.0.0",
116
116
  "eslint": "8.27.0",
117
117
  "eslint-import-resolver-jest": "3.0.2",
@@ -155,11 +155,6 @@ export default {
155
155
  component: GlAreaChart,
156
156
  argTypes: {
157
157
  ...disableControls([
158
- 'showToolbox',
159
- 'toolboxZoomIconPath',
160
- 'toolboxBackIconPath',
161
- 'toolboxRestoreIconPath',
162
- 'toolboxSaveAsImageIconPath',
163
158
  'dataSeries',
164
159
  'formatTooltipText',
165
160
  'legendAverageText',
@@ -42,7 +42,6 @@ import {
42
42
  import { colorFromDefaultPalette } from '../../../utils/charts/theme';
43
43
  import { seriesHasAnnotations, isDataPointAnnotation } from '../../../utils/charts/utils';
44
44
  import { debounceByAnimationFrame } from '../../../utils/utils';
45
- import { ToolboxMixin } from '../../mixins/toolbox_mixin';
46
45
  import TooltipDefaultFormat from '../../shared_components/charts/tooltip_default_format.vue';
47
46
  import Chart from '../chart/chart.vue';
48
47
  import ChartLegend from '../legend/legend.vue';
@@ -55,7 +54,6 @@ export default {
55
54
  ChartTooltip,
56
55
  TooltipDefaultFormat,
57
56
  },
58
- mixins: [ToolboxMixin],
59
57
  inheritAttrs: false,
60
58
  props: {
61
59
  data: {
@@ -208,8 +206,7 @@ export default {
208
206
  defaultChartOptions,
209
207
  defaultAreaChartOptions,
210
208
  this.option,
211
- dataZoomAdjustments(this.option.dataZoom),
212
- this.toolboxAdjustments
209
+ dataZoomAdjustments(this.option.dataZoom)
213
210
  );
214
211
  // All chart options can be merged but series
215
212
  // needs to be handled specially.
@@ -1,5 +1,4 @@
1
1
  import { GlBarChart } from '../../../charts';
2
- import { disableControls } from '../../../utils/stories_utils';
3
2
  import readme from './bar.md';
4
3
 
5
4
  const Template = (args, { argTypes }) => ({
@@ -49,15 +48,6 @@ Default.args = generateProps();
49
48
  export default {
50
49
  title: 'charts/bar-chart',
51
50
  component: GlBarChart,
52
- argTypes: {
53
- ...disableControls([
54
- 'showToolbox',
55
- 'toolboxZoomIconPath',
56
- 'toolboxBackIconPath',
57
- 'toolboxRestoreIconPath',
58
- 'toolboxSaveAsImageIconPath',
59
- ]),
60
- },
61
51
  parameters: {
62
52
  docs: {
63
53
  description: {
@@ -7,7 +7,6 @@ import { TOOLTIP_LEFT_OFFSET } from '../../../utils/charts/constants';
7
7
  import { colorFromDefaultPalette } from '../../../utils/charts/theme';
8
8
  import { engineeringNotation } from '../../../utils/number_utils';
9
9
  import { hexToRgba, debounceByAnimationFrame } from '../../../utils/utils';
10
- import { ToolboxMixin } from '../../mixins/toolbox_mixin';
11
10
  import TooltipDefaultFormat from '../../shared_components/charts/tooltip_default_format.vue';
12
11
  import Chart from '../chart/chart.vue';
13
12
  import ChartTooltip from '../tooltip/tooltip.vue';
@@ -62,7 +61,6 @@ export default {
62
61
  ChartTooltip,
63
62
  TooltipDefaultFormat,
64
63
  },
65
- mixins: [ToolboxMixin],
66
64
  inheritAttrs: false,
67
65
  props: {
68
66
  data: {
@@ -156,8 +154,7 @@ export default {
156
154
  },
157
155
  },
158
156
  this.option,
159
- dataZoomAdjustments(this.option.dataZoom),
160
- this.toolboxAdjustments
157
+ dataZoomAdjustments(this.option.dataZoom)
161
158
  );
162
159
  // All chart options can be merged but series
163
160
  // needs to be handled specially
@@ -16,7 +16,6 @@ import { TOOLTIP_LEFT_OFFSET, CHART_TYPE_LINE } from '../../../utils/charts/cons
16
16
  import { colorFromDefaultPalette } from '../../../utils/charts/theme';
17
17
  import { columnOptions } from '../../../utils/constants';
18
18
  import { debounceByAnimationFrame } from '../../../utils/utils';
19
- import { ToolboxMixin } from '../../mixins/toolbox_mixin';
20
19
  import TooltipDefaultFormat from '../../shared_components/charts/tooltip_default_format.vue';
21
20
  import Chart from '../chart/chart.vue';
22
21
  import ChartTooltip from '../tooltip/tooltip.vue';
@@ -35,7 +34,6 @@ export default {
35
34
  ChartTooltip,
36
35
  TooltipDefaultFormat,
37
36
  },
38
- mixins: [ToolboxMixin],
39
37
  inheritAttrs: false,
40
38
  props: {
41
39
  bars: {
@@ -164,8 +162,7 @@ export default {
164
162
  },
165
163
  },
166
164
  this.option,
167
- dataZoomAdjustments(this.option.dataZoom),
168
- this.toolboxAdjustments
165
+ dataZoomAdjustments(this.option.dataZoom)
169
166
  );
170
167
  // All chart options can be merged but series
171
168
  // needs to be handled specially
@@ -8,7 +8,6 @@ import {
8
8
  } from '../../../utils/charts/config';
9
9
  import { colorFromDefaultPalette } from '../../../utils/charts/theme';
10
10
  import { debounceByAnimationFrame } from '../../../utils/utils';
11
- import { ToolboxMixin } from '../../mixins/toolbox_mixin';
12
11
  import TooltipDefaultFormat from '../../shared_components/charts/tooltip_default_format.vue';
13
12
  import Chart from '../chart/chart.vue';
14
13
  import ChartTooltip from '../tooltip/tooltip.vue';
@@ -19,7 +18,6 @@ export default {
19
18
  ChartTooltip,
20
19
  TooltipDefaultFormat,
21
20
  },
22
- mixins: [ToolboxMixin],
23
21
  inheritAttrs: false,
24
22
  props: {
25
23
  data: {
@@ -117,8 +115,7 @@ export default {
117
115
  },
118
116
  },
119
117
  this.option,
120
- dataZoomAdjustments(this.option.dataZoom),
121
- this.toolboxAdjustments
118
+ dataZoomAdjustments(this.option.dataZoom)
122
119
  );
123
120
  // All chart options can be merged but series
124
121
  // needs to be handled specially
@@ -2,7 +2,6 @@
2
2
  <script>
3
3
  import { merge, isFinite, uniq, sortBy } from 'lodash';
4
4
  import { gaugeNeutralHues, gaugeSafeHues, gaugeWarningHue } from '../../../utils/charts/theme';
5
- import { ToolboxMixin } from '../../mixins/toolbox_mixin';
6
5
  import Chart from '../chart/chart.vue';
7
6
 
8
7
  const AXIS_LABEL_FONT_SIZE_PX = 14;
@@ -53,7 +52,6 @@ export default {
53
52
  components: {
54
53
  Chart,
55
54
  },
56
- mixins: [ToolboxMixin],
57
55
  props: {
58
56
  value: {
59
57
  type: Number,
@@ -107,8 +105,7 @@ export default {
107
105
  axisColor: this.axisColor,
108
106
  }),
109
107
  },
110
- this.option,
111
- this.toolboxAdjustments
108
+ this.option
112
109
  );
113
110
 
114
111
  return mergedOptions;
@@ -62,11 +62,6 @@ export default {
62
62
  component: GlHeatmap,
63
63
  argTypes: {
64
64
  ...disableControls([
65
- 'showToolbox',
66
- 'toolboxZoomIconPath',
67
- 'toolboxBackIconPath',
68
- 'toolboxRestoreIconPath',
69
- 'toolboxSaveAsImageIconPath',
70
65
  'dataSeries',
71
66
  'formatTooltipText',
72
67
  'legendAverageText',
@@ -7,7 +7,6 @@ import { TOOLTIP_LEFT_OFFSET } from '../../../utils/charts/constants';
7
7
  import { heatmapHues } from '../../../utils/charts/theme';
8
8
  import { engineeringNotation } from '../../../utils/number_utils';
9
9
  import { debounceByAnimationFrame } from '../../../utils/utils';
10
- import { ToolboxMixin } from '../../mixins/toolbox_mixin';
11
10
  import TooltipDefaultFormat from '../../shared_components/charts/tooltip_default_format.vue';
12
11
  import Chart from '../chart/chart.vue';
13
12
  import ChartLegend from '../legend/legend.vue';
@@ -49,7 +48,6 @@ export default {
49
48
  ChartTooltip,
50
49
  TooltipDefaultFormat,
51
50
  },
52
- mixins: [ToolboxMixin],
53
51
  props: {
54
52
  options: {
55
53
  type: Object,
@@ -188,7 +186,6 @@ export default {
188
186
  },
189
187
  },
190
188
  },
191
- this.toolboxAdjustments,
192
189
  this.options
193
190
  );
194
191
  },
@@ -209,11 +209,6 @@ export default {
209
209
  },
210
210
  argTypes: {
211
211
  ...disableControls([
212
- 'showToolbox',
213
- 'toolboxZoomIconPath',
214
- 'toolboxBackIconPath',
215
- 'toolboxRestoreIconPath',
216
- 'toolboxSaveAsImageIconPath',
217
212
  'formatTooltipText',
218
213
  'legendAverageText',
219
214
  'legendMaxText',
@@ -45,7 +45,6 @@ import {
45
45
  import { colorFromDefaultPalette } from '../../../utils/charts/theme';
46
46
  import { seriesHasAnnotations, isDataPointAnnotation } from '../../../utils/charts/utils';
47
47
  import { debounceByAnimationFrame } from '../../../utils/utils';
48
- import { ToolboxMixin } from '../../mixins/toolbox_mixin';
49
48
  import TooltipDefaultFormat from '../../shared_components/charts/tooltip_default_format.vue';
50
49
  import Chart from '../chart/chart.vue';
51
50
  import ChartLegend from '../legend/legend.vue';
@@ -58,7 +57,6 @@ export default {
58
57
  ChartTooltip,
59
58
  TooltipDefaultFormat,
60
59
  },
61
- mixins: [ToolboxMixin],
62
60
  inheritAttrs: false,
63
61
  props: {
64
62
  data: {
@@ -207,8 +205,7 @@ export default {
207
205
  defaultChartOptions,
208
206
  defaultLineChartOptions,
209
207
  this.option,
210
- dataZoomAdjustments(this.option.dataZoom),
211
- this.toolboxAdjustments
208
+ dataZoomAdjustments(this.option.dataZoom)
212
209
  );
213
210
  // All chart options can be merged but series
214
211
  // needs to be handled specially
@@ -23,7 +23,6 @@ import {
23
23
  import { colorFromDefaultPalette } from '../../../utils/charts/theme';
24
24
  import { columnOptions } from '../../../utils/constants';
25
25
  import { debounceByAnimationFrame } from '../../../utils/utils';
26
- import { ToolboxMixin } from '../../mixins/toolbox_mixin';
27
26
  import TooltipDefaultFormat from '../../shared_components/charts/tooltip_default_format.vue';
28
27
  import Chart from '../chart/chart.vue';
29
28
  import ChartLegend from '../legend/legend.vue';
@@ -44,7 +43,6 @@ export default {
44
43
  ChartLegend,
45
44
  TooltipDefaultFormat,
46
45
  },
47
- mixins: [ToolboxMixin],
48
46
  inheritAttrs: false,
49
47
  props: {
50
48
  bars: {
@@ -224,8 +222,7 @@ export default {
224
222
  },
225
223
  },
226
224
  this.option,
227
- dataZoomAdjustments(this.option.dataZoom),
228
- this.toolboxAdjustments
225
+ dataZoomAdjustments(this.option.dataZoom)
229
226
  );
230
227
  // All chart options can be merged but series
231
228
  // needs to be handled specially
@@ -159,42 +159,6 @@ export const dataZoomAdjustments = (dataZoom) => {
159
159
  return useSlider ? getDataZoomConfig({ filterMode: 'weakFilter' }) : [];
160
160
  };
161
161
 
162
- export const getToolboxConfig = ({
163
- restoreIconPath = '',
164
- saveImageIconPath = '',
165
- zoomIconPath = '',
166
- backIconPath = '',
167
- } = {}) => {
168
- const toolboxConfig = {
169
- toolbox: {
170
- feature: {},
171
- },
172
- };
173
-
174
- if (restoreIconPath.length) {
175
- toolboxConfig.toolbox.feature.restore = {
176
- icon: restoreIconPath,
177
- };
178
- }
179
-
180
- if (saveImageIconPath.length) {
181
- toolboxConfig.toolbox.feature.saveAsImage = {
182
- icon: restoreIconPath,
183
- };
184
- }
185
-
186
- if (zoomIconPath.length && backIconPath.length) {
187
- toolboxConfig.toolbox.feature.dataZoom = {
188
- icon: {
189
- zoom: zoomIconPath,
190
- back: backIconPath,
191
- },
192
- };
193
- }
194
-
195
- return toolboxConfig;
196
- };
197
-
198
162
  /**
199
163
  * Generate eCharts markArea arrays for thresholds and annotations.
200
164
  *
@@ -1,45 +0,0 @@
1
- import { getToolboxConfig } from '../../utils/charts/config';
2
-
3
- /**
4
- * Toolbox mixin for the chart based components
5
- * this allows for the toolbox that echarts already includes to be rendered,
6
- * the mixin also handles the icon customization for the 4 different default
7
- * toolbox options
8
- */
9
- const ToolboxMixin = {
10
- props: {
11
- showToolbox: {
12
- type: Boolean,
13
- required: false,
14
- default: false
15
- },
16
- toolboxZoomIconPath: {
17
- type: String,
18
- required: false
19
- },
20
- toolboxBackIconPath: {
21
- type: String,
22
- required: false
23
- },
24
- toolboxRestoreIconPath: {
25
- type: String,
26
- required: false
27
- },
28
- toolboxSaveAsImageIconPath: {
29
- type: String,
30
- required: false
31
- }
32
- },
33
- computed: {
34
- toolboxAdjustments() {
35
- return this.showToolbox ? getToolboxConfig({
36
- restoreIconPath: this.toolboxRestoreIconPath,
37
- saveImageIconPath: this.toolboxSaveAsImageIconPath,
38
- zoomIconPath: this.toolboxZoomIconPath,
39
- backIconPath: this.toolboxBackIconPath
40
- }) : {};
41
- }
42
- }
43
- };
44
-
45
- export { ToolboxMixin };
@@ -1,46 +0,0 @@
1
- /**
2
- * Toolbox mixin for the chart based components
3
- * this allows for the toolbox that echarts already includes to be rendered,
4
- * the mixin also handles the icon customization for the 4 different default
5
- * toolbox options
6
- */
7
-
8
- import { getToolboxConfig } from '../../utils/charts/config';
9
-
10
- export const ToolboxMixin = {
11
- props: {
12
- showToolbox: {
13
- type: Boolean,
14
- required: false,
15
- default: false,
16
- },
17
- toolboxZoomIconPath: {
18
- type: String,
19
- required: false,
20
- },
21
- toolboxBackIconPath: {
22
- type: String,
23
- required: false,
24
- },
25
- toolboxRestoreIconPath: {
26
- type: String,
27
- required: false,
28
- },
29
- toolboxSaveAsImageIconPath: {
30
- type: String,
31
- required: false,
32
- },
33
- },
34
- computed: {
35
- toolboxAdjustments() {
36
- return this.showToolbox
37
- ? getToolboxConfig({
38
- restoreIconPath: this.toolboxRestoreIconPath,
39
- saveImageIconPath: this.toolboxSaveAsImageIconPath,
40
- zoomIconPath: this.toolboxZoomIconPath,
41
- backIconPath: this.toolboxBackIconPath,
42
- })
43
- : {};
44
- },
45
- },
46
- };