@gitlab/ui 32.23.0 → 32.24.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 +7 -0
- package/dist/components/charts/bar/bar.documentation.js +2 -5
- package/dist/utility_classes.css +1 -1
- package/dist/utility_classes.css.map +1 -1
- package/documentation/documented_stories.js +1 -0
- package/package.json +1 -1
- package/src/components/charts/bar/bar.documentation.js +0 -2
- package/src/components/charts/bar/bar.md +0 -2
- package/src/components/charts/bar/bar.stories.js +35 -58
- package/src/scss/utilities.scss +8 -0
- package/src/scss/utility-mixins/sizing.scss +4 -0
- package/dist/components/charts/bar/examples/bar.basic.example.js +0 -42
- package/dist/components/charts/bar/examples/bar.long_labels.example.js +0 -55
- package/dist/components/charts/bar/examples/bar.multiple_series.example.js +0 -48
- package/dist/components/charts/bar/examples/bar.negative_values.example.js +0 -43
- package/dist/components/charts/bar/examples/index.js +0 -28
- package/src/components/charts/bar/examples/bar.basic.example.vue +0 -14
- package/src/components/charts/bar/examples/bar.long_labels.example.vue +0 -26
- package/src/components/charts/bar/examples/bar.multiple_series.example.vue +0 -22
- package/src/components/charts/bar/examples/bar.negative_values.example.vue +0 -15
- package/src/components/charts/bar/examples/index.js +0 -33
package/package.json
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
import { withKnobs, object, text } from '@storybook/addon-knobs';
|
|
2
1
|
import { GlBarChart } from '../../../../charts';
|
|
3
|
-
import { documentedStoriesOf } from '../../../../documentation/documented_stories';
|
|
4
|
-
import { toolbox } from '../../../utils/charts/story_config';
|
|
5
2
|
import readme from './bar.md';
|
|
6
3
|
|
|
7
|
-
const
|
|
8
|
-
GlBarChart,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const template = `<gl-bar-chart
|
|
4
|
+
const Template = (args, { argTypes }) => ({
|
|
5
|
+
components: { GlBarChart },
|
|
6
|
+
props: Object.keys(argTypes),
|
|
7
|
+
template: `<gl-bar-chart
|
|
12
8
|
:data="data"
|
|
13
9
|
:option="option"
|
|
14
10
|
:y-axis-title="yAxisTitle"
|
|
15
11
|
:x-axis-title="xAxisTitle"
|
|
16
12
|
:x-axis-type="xAxisType"
|
|
17
|
-
|
|
13
|
+
/>`,
|
|
14
|
+
});
|
|
18
15
|
|
|
19
16
|
const mockData = {
|
|
20
17
|
Office: [
|
|
@@ -31,59 +28,39 @@ const mockData = {
|
|
|
31
28
|
],
|
|
32
29
|
};
|
|
33
30
|
|
|
34
|
-
|
|
31
|
+
const generateProps = ({
|
|
35
32
|
data = mockData,
|
|
36
33
|
option = {},
|
|
37
34
|
xAxisTitle = 'Pushes per day',
|
|
38
35
|
yAxisTitle = 'User',
|
|
39
36
|
xAxisType = 'value',
|
|
40
|
-
} = {}) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
},
|
|
48
|
-
yAxisTitle: {
|
|
49
|
-
default: text('Y Axis Title', yAxisTitle),
|
|
50
|
-
},
|
|
51
|
-
xAxisTitle: {
|
|
52
|
-
default: text('X Axis Title', xAxisTitle),
|
|
53
|
-
},
|
|
54
|
-
xAxisType: {
|
|
55
|
-
default: text('X Axis Type', xAxisType),
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
}
|
|
37
|
+
} = {}) => ({
|
|
38
|
+
data,
|
|
39
|
+
option,
|
|
40
|
+
xAxisTitle,
|
|
41
|
+
yAxisTitle,
|
|
42
|
+
xAxisType,
|
|
43
|
+
});
|
|
59
44
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
components,
|
|
79
|
-
template,
|
|
80
|
-
}))
|
|
81
|
-
.add('with toolbox', () => ({
|
|
82
|
-
props: generateProps({
|
|
83
|
-
option: {
|
|
84
|
-
toolbox,
|
|
45
|
+
export const Default = Template.bind({});
|
|
46
|
+
Default.args = generateProps();
|
|
47
|
+
|
|
48
|
+
export default {
|
|
49
|
+
title: 'charts/bar-chart',
|
|
50
|
+
component: GlBarChart,
|
|
51
|
+
argTypes: {
|
|
52
|
+
showToolbox: { control: { disable: true } },
|
|
53
|
+
toolboxZoomIconPath: { control: { disable: true } },
|
|
54
|
+
toolboxBackIconPath: { control: { disable: true } },
|
|
55
|
+
toolboxRestoreIconPath: { control: { disable: true } },
|
|
56
|
+
toolboxSaveAsImageIconPath: { control: { disable: true } },
|
|
57
|
+
},
|
|
58
|
+
parameters: {
|
|
59
|
+
knobs: { disable: true },
|
|
60
|
+
docs: {
|
|
61
|
+
description: {
|
|
62
|
+
component: readme,
|
|
85
63
|
},
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}));
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
};
|
package/src/scss/utilities.scss
CHANGED
|
@@ -69,6 +69,10 @@
|
|
|
69
69
|
width: 12.5%;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
@mixin gl-w-5p {
|
|
73
|
+
width: 5%;
|
|
74
|
+
}
|
|
75
|
+
|
|
72
76
|
// In the future, any percentage-based classes should follow this convention per the conversation at https://gitlab.com/gitlab-org/gitlab-ui/-/merge_requests/1884#note_459949588
|
|
73
77
|
@mixin gl-w-10p {
|
|
74
78
|
width: 10%;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
2
|
-
|
|
3
|
-
/* script */
|
|
4
|
-
|
|
5
|
-
/* template */
|
|
6
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-bar-chart',{attrs:{"data":{
|
|
7
|
-
Full: [
|
|
8
|
-
[78, 'Andrew Baines Bernard'],
|
|
9
|
-
[123, 'Angela Martin'] ],
|
|
10
|
-
},"option":{},"y-axis-title":"People","x-axis-title":"Percentage","x-axis-type":"value"}})};
|
|
11
|
-
var __vue_staticRenderFns__ = [];
|
|
12
|
-
|
|
13
|
-
/* style */
|
|
14
|
-
const __vue_inject_styles__ = undefined;
|
|
15
|
-
/* scoped */
|
|
16
|
-
const __vue_scope_id__ = undefined;
|
|
17
|
-
/* module identifier */
|
|
18
|
-
const __vue_module_identifier__ = undefined;
|
|
19
|
-
/* functional template */
|
|
20
|
-
const __vue_is_functional_template__ = false;
|
|
21
|
-
/* style inject */
|
|
22
|
-
|
|
23
|
-
/* style inject SSR */
|
|
24
|
-
|
|
25
|
-
/* style inject shadow dom */
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const __vue_component__ = __vue_normalize__(
|
|
30
|
-
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
31
|
-
__vue_inject_styles__,
|
|
32
|
-
{},
|
|
33
|
-
__vue_scope_id__,
|
|
34
|
-
__vue_is_functional_template__,
|
|
35
|
-
__vue_module_identifier__,
|
|
36
|
-
false,
|
|
37
|
-
undefined,
|
|
38
|
-
undefined,
|
|
39
|
-
undefined
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
export default __vue_component__;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
2
|
-
|
|
3
|
-
/* script */
|
|
4
|
-
|
|
5
|
-
/* template */
|
|
6
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-bar-chart',{attrs:{"data":{
|
|
7
|
-
Office: [
|
|
8
|
-
[100, 'Jim Halpert'],
|
|
9
|
-
[210, 'Dwight Kurt Schrute'],
|
|
10
|
-
[300, 'Pam Beesly'],
|
|
11
|
-
[340, 'Ryan Howard'],
|
|
12
|
-
[130, 'Kelly Rajnigandha Kapoor'],
|
|
13
|
-
[50, 'Scranton Strangler'],
|
|
14
|
-
[90, 'Michael Gary Scott'],
|
|
15
|
-
[-10, 'Andrew Baines Bernard'],
|
|
16
|
-
[50, 'Stanley Hudson'],
|
|
17
|
-
[30, 'Erin Hannon'],
|
|
18
|
-
[50, 'Creed Bratton'],
|
|
19
|
-
[90, 'Oscar'],
|
|
20
|
-
[10, 'Kevin Malone'],
|
|
21
|
-
[50, 'Angela Martin'],
|
|
22
|
-
[30, 'Toby Flenderson'] ],
|
|
23
|
-
},"y-axis-title":"People","x-axis-title":"Percentage","x-axis-type":"value"}})};
|
|
24
|
-
var __vue_staticRenderFns__ = [];
|
|
25
|
-
|
|
26
|
-
/* style */
|
|
27
|
-
const __vue_inject_styles__ = undefined;
|
|
28
|
-
/* scoped */
|
|
29
|
-
const __vue_scope_id__ = undefined;
|
|
30
|
-
/* module identifier */
|
|
31
|
-
const __vue_module_identifier__ = undefined;
|
|
32
|
-
/* functional template */
|
|
33
|
-
const __vue_is_functional_template__ = false;
|
|
34
|
-
/* style inject */
|
|
35
|
-
|
|
36
|
-
/* style inject SSR */
|
|
37
|
-
|
|
38
|
-
/* style inject shadow dom */
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const __vue_component__ = __vue_normalize__(
|
|
43
|
-
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
44
|
-
__vue_inject_styles__,
|
|
45
|
-
{},
|
|
46
|
-
__vue_scope_id__,
|
|
47
|
-
__vue_is_functional_template__,
|
|
48
|
-
__vue_module_identifier__,
|
|
49
|
-
false,
|
|
50
|
-
undefined,
|
|
51
|
-
undefined,
|
|
52
|
-
undefined
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
export default __vue_component__;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
2
|
-
|
|
3
|
-
/* script */
|
|
4
|
-
|
|
5
|
-
/* template */
|
|
6
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-bar-chart',{attrs:{"data":{
|
|
7
|
-
Office: [
|
|
8
|
-
[78, 'Andrew Baines Bernard'],
|
|
9
|
-
[123, 'Angela Martin'] ],
|
|
10
|
-
ModernFamily: [
|
|
11
|
-
[39, 'Phil Dunphy'],
|
|
12
|
-
[4, 'Luke Dunphy'] ],
|
|
13
|
-
Friends: [
|
|
14
|
-
[239, 'Chandler Muriel Bing'],
|
|
15
|
-
[92, 'Joseph Francis Tribbiani'] ],
|
|
16
|
-
},"option":{},"y-axis-title":"People","x-axis-title":"Percentage","x-axis-type":"value"}})};
|
|
17
|
-
var __vue_staticRenderFns__ = [];
|
|
18
|
-
|
|
19
|
-
/* style */
|
|
20
|
-
const __vue_inject_styles__ = undefined;
|
|
21
|
-
/* scoped */
|
|
22
|
-
const __vue_scope_id__ = undefined;
|
|
23
|
-
/* module identifier */
|
|
24
|
-
const __vue_module_identifier__ = undefined;
|
|
25
|
-
/* functional template */
|
|
26
|
-
const __vue_is_functional_template__ = false;
|
|
27
|
-
/* style inject */
|
|
28
|
-
|
|
29
|
-
/* style inject SSR */
|
|
30
|
-
|
|
31
|
-
/* style inject shadow dom */
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const __vue_component__ = __vue_normalize__(
|
|
36
|
-
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
37
|
-
__vue_inject_styles__,
|
|
38
|
-
{},
|
|
39
|
-
__vue_scope_id__,
|
|
40
|
-
__vue_is_functional_template__,
|
|
41
|
-
__vue_module_identifier__,
|
|
42
|
-
false,
|
|
43
|
-
undefined,
|
|
44
|
-
undefined,
|
|
45
|
-
undefined
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
export default __vue_component__;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
2
|
-
|
|
3
|
-
/* script */
|
|
4
|
-
|
|
5
|
-
/* template */
|
|
6
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-bar-chart',{attrs:{"data":{
|
|
7
|
-
Full: [
|
|
8
|
-
[-78, 'Jim Halpert'],
|
|
9
|
-
[123, 'Kelly Rajnigandha Kapoor'],
|
|
10
|
-
[-10, 'Michael Gary Scott'] ],
|
|
11
|
-
},"option":{},"y-axis-title":"People","x-axis-title":"Percentage","x-axis-type":"value"}})};
|
|
12
|
-
var __vue_staticRenderFns__ = [];
|
|
13
|
-
|
|
14
|
-
/* style */
|
|
15
|
-
const __vue_inject_styles__ = undefined;
|
|
16
|
-
/* scoped */
|
|
17
|
-
const __vue_scope_id__ = undefined;
|
|
18
|
-
/* module identifier */
|
|
19
|
-
const __vue_module_identifier__ = undefined;
|
|
20
|
-
/* functional template */
|
|
21
|
-
const __vue_is_functional_template__ = false;
|
|
22
|
-
/* style inject */
|
|
23
|
-
|
|
24
|
-
/* style inject SSR */
|
|
25
|
-
|
|
26
|
-
/* style inject shadow dom */
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const __vue_component__ = __vue_normalize__(
|
|
31
|
-
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
32
|
-
__vue_inject_styles__,
|
|
33
|
-
{},
|
|
34
|
-
__vue_scope_id__,
|
|
35
|
-
__vue_is_functional_template__,
|
|
36
|
-
__vue_module_identifier__,
|
|
37
|
-
false,
|
|
38
|
-
undefined,
|
|
39
|
-
undefined,
|
|
40
|
-
undefined
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
export default __vue_component__;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import BarChartBasicExample from './bar.basic.example';
|
|
2
|
-
import BarChartLongLablesExample from './bar.long_labels.example';
|
|
3
|
-
import BarChartMultipleSeriesExample from './bar.multiple_series.example';
|
|
4
|
-
import BarChartNegativeValuesExample from './bar.negative_values.example';
|
|
5
|
-
|
|
6
|
-
var index = [{
|
|
7
|
-
name: 'Basic',
|
|
8
|
-
items: [{
|
|
9
|
-
id: 'bar-basic',
|
|
10
|
-
name: 'Basic',
|
|
11
|
-
description: 'Basic Bar Chart',
|
|
12
|
-
component: BarChartBasicExample
|
|
13
|
-
}, {
|
|
14
|
-
id: 'bar-negative-labels',
|
|
15
|
-
name: 'Negative values',
|
|
16
|
-
component: BarChartNegativeValuesExample
|
|
17
|
-
}, {
|
|
18
|
-
id: 'bar-long-labels',
|
|
19
|
-
name: 'Long labels with negative values',
|
|
20
|
-
component: BarChartLongLablesExample
|
|
21
|
-
}, {
|
|
22
|
-
id: 'bar-multiple-series',
|
|
23
|
-
name: 'Multiple Series Bar Chart',
|
|
24
|
-
component: BarChartMultipleSeriesExample
|
|
25
|
-
}]
|
|
26
|
-
}];
|
|
27
|
-
|
|
28
|
-
export default index;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<gl-bar-chart
|
|
3
|
-
:data="{
|
|
4
|
-
Office: [
|
|
5
|
-
[100, 'Jim Halpert'],
|
|
6
|
-
[210, 'Dwight Kurt Schrute'],
|
|
7
|
-
[300, 'Pam Beesly'],
|
|
8
|
-
[340, 'Ryan Howard'],
|
|
9
|
-
[130, 'Kelly Rajnigandha Kapoor'],
|
|
10
|
-
[50, 'Scranton Strangler'],
|
|
11
|
-
[90, 'Michael Gary Scott'],
|
|
12
|
-
[-10, 'Andrew Baines Bernard'],
|
|
13
|
-
[50, 'Stanley Hudson'],
|
|
14
|
-
[30, 'Erin Hannon'],
|
|
15
|
-
[50, 'Creed Bratton'],
|
|
16
|
-
[90, 'Oscar'],
|
|
17
|
-
[10, 'Kevin Malone'],
|
|
18
|
-
[50, 'Angela Martin'],
|
|
19
|
-
[30, 'Toby Flenderson'],
|
|
20
|
-
],
|
|
21
|
-
}"
|
|
22
|
-
y-axis-title="People"
|
|
23
|
-
x-axis-title="Percentage"
|
|
24
|
-
x-axis-type="value"
|
|
25
|
-
/>
|
|
26
|
-
</template>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<gl-bar-chart
|
|
3
|
-
:data="{
|
|
4
|
-
Office: [
|
|
5
|
-
[78, 'Andrew Baines Bernard'],
|
|
6
|
-
[123, 'Angela Martin'],
|
|
7
|
-
],
|
|
8
|
-
ModernFamily: [
|
|
9
|
-
[39, 'Phil Dunphy'],
|
|
10
|
-
[4, 'Luke Dunphy'],
|
|
11
|
-
],
|
|
12
|
-
Friends: [
|
|
13
|
-
[239, 'Chandler Muriel Bing'],
|
|
14
|
-
[92, 'Joseph Francis Tribbiani'],
|
|
15
|
-
],
|
|
16
|
-
}"
|
|
17
|
-
:option="{}"
|
|
18
|
-
y-axis-title="People"
|
|
19
|
-
x-axis-title="Percentage"
|
|
20
|
-
x-axis-type="value"
|
|
21
|
-
/>
|
|
22
|
-
</template>
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<gl-bar-chart
|
|
3
|
-
:data="{
|
|
4
|
-
Full: [
|
|
5
|
-
[-78, 'Jim Halpert'],
|
|
6
|
-
[123, 'Kelly Rajnigandha Kapoor'],
|
|
7
|
-
[-10, 'Michael Gary Scott'],
|
|
8
|
-
],
|
|
9
|
-
}"
|
|
10
|
-
:option="{}"
|
|
11
|
-
y-axis-title="People"
|
|
12
|
-
x-axis-title="Percentage"
|
|
13
|
-
x-axis-type="value"
|
|
14
|
-
/>
|
|
15
|
-
</template>
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import BarChartBasicExample from './bar.basic.example.vue';
|
|
2
|
-
import BarChartLongLablesExample from './bar.long_labels.example.vue';
|
|
3
|
-
import BarChartMultipleSeriesExample from './bar.multiple_series.example.vue';
|
|
4
|
-
import BarChartNegativeValuesExample from './bar.negative_values.example.vue';
|
|
5
|
-
|
|
6
|
-
export default [
|
|
7
|
-
{
|
|
8
|
-
name: 'Basic',
|
|
9
|
-
items: [
|
|
10
|
-
{
|
|
11
|
-
id: 'bar-basic',
|
|
12
|
-
name: 'Basic',
|
|
13
|
-
description: 'Basic Bar Chart',
|
|
14
|
-
component: BarChartBasicExample,
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
id: 'bar-negative-labels',
|
|
18
|
-
name: 'Negative values',
|
|
19
|
-
component: BarChartNegativeValuesExample,
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
id: 'bar-long-labels',
|
|
23
|
-
name: 'Long labels with negative values',
|
|
24
|
-
component: BarChartLongLablesExample,
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
id: 'bar-multiple-series',
|
|
28
|
-
name: 'Multiple Series Bar Chart',
|
|
29
|
-
component: BarChartMultipleSeriesExample,
|
|
30
|
-
},
|
|
31
|
-
],
|
|
32
|
-
},
|
|
33
|
-
];
|