@gitlab/ui 49.11.1 → 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.
Files changed (29) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/components/charts/area/area.js +1 -3
  3. package/dist/components/charts/bar/bar.js +1 -3
  4. package/dist/components/charts/column/column.js +1 -3
  5. package/dist/components/charts/discrete_scatter/discrete_scatter.js +1 -3
  6. package/dist/components/charts/gauge/gauge.js +1 -3
  7. package/dist/components/charts/heatmap/heatmap.js +1 -3
  8. package/dist/components/charts/line/line.js +1 -3
  9. package/dist/components/charts/stacked_column/stacked_column.js +1 -3
  10. package/dist/index.css +1 -1
  11. package/dist/index.css.map +1 -1
  12. package/dist/utils/charts/config.js +1 -33
  13. package/package.json +6 -6
  14. package/src/components/base/drawer/drawer.scss +2 -4
  15. package/src/components/charts/area/area.stories.js +0 -5
  16. package/src/components/charts/area/area.vue +1 -4
  17. package/src/components/charts/bar/bar.stories.js +0 -10
  18. package/src/components/charts/bar/bar.vue +1 -4
  19. package/src/components/charts/column/column.vue +1 -4
  20. package/src/components/charts/discrete_scatter/discrete_scatter.vue +1 -4
  21. package/src/components/charts/gauge/gauge.vue +1 -4
  22. package/src/components/charts/heatmap/heatmap.stories.js +0 -5
  23. package/src/components/charts/heatmap/heatmap.vue +0 -3
  24. package/src/components/charts/line/line.stories.js +0 -5
  25. package/src/components/charts/line/line.vue +1 -4
  26. package/src/components/charts/stacked_column/stacked_column.vue +1 -4
  27. package/src/utils/charts/config.js +0 -36
  28. package/dist/components/mixins/toolbox_mixin.js +0 -45
  29. package/src/components/mixins/toolbox_mixin.js +0 -46
@@ -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.1",
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": "^10.11.0",
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",
@@ -121,9 +121,9 @@
121
121
  "glob": "^7.2.0",
122
122
  "identity-obj-proxy": "^3.0.0",
123
123
  "inquirer-select-directory": "^1.2.0",
124
- "jest": "^29.3.0",
125
- "jest-circus": "29.3.0",
126
- "jest-environment-jsdom": "29.3.0",
124
+ "jest": "^29.3.1",
125
+ "jest-circus": "29.3.1",
126
+ "jest-environment-jsdom": "29.3.1",
127
127
  "markdownlint-cli": "^0.29.0",
128
128
  "mockdate": "^2.0.5",
129
129
  "npm-run-all": "^4.1.5",
@@ -31,8 +31,7 @@ $gl-drawer-scrim-gradient: linear-gradient(to bottom, $transparent-rgba, $white)
31
31
 
32
32
  .gl-drawer-header,
33
33
  .gl-drawer-body > * {
34
- @include gl-px-6;
35
- @include gl-py-5;
34
+ @include gl-p-5;
36
35
  }
37
36
  }
38
37
 
@@ -58,8 +57,7 @@ $gl-drawer-scrim-gradient: linear-gradient(to bottom, $transparent-rgba, $white)
58
57
  @include gl-border-t-solid;
59
58
  @include gl-border-t-gray-100;
60
59
  @include gl-border-t-1;
61
- @include gl-px-6;
62
- @include gl-py-5;
60
+ @include gl-p-5;
63
61
  }
64
62
 
65
63
  .gl-drawer-body-scrim-on-footer {
@@ -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
- };