@gitlab/ui 32.45.0 → 32.48.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 +28 -0
- package/config.js +15 -3
- package/dist/components/base/avatar_labeled/avatar_labeled.documentation.js +2 -9
- package/dist/components/base/avatars_inline/avatars_inline.documentation.js +2 -5
- package/dist/components/base/form/form_combobox/form_combobox.documentation.js +2 -9
- package/dist/components/base/form/form_combobox/form_combobox.js +5 -0
- package/dist/components/base/form/form_group/form_group.js +11 -1
- package/dist/components/base/form/input_group_text/input_group_text.documentation.js +1 -5
- package/dist/components/base/label/label.documentation.js +2 -9
- package/dist/components/base/label/label.js +23 -1
- package/dist/components/base/skeleton_loader/skeleton_loader.documentation.js +2 -28
- package/dist/components/base/skeleton_loader/skeleton_loader.js +30 -0
- package/dist/components/charts/discrete_scatter/discrete_scatter.documentation.js +1 -7
- package/dist/components/charts/gauge/gauge.documentation.js +2 -6
- package/dist/components/charts/stacked_column/stacked_column.documentation.js +2 -5
- package/dist/components/charts/tooltip/tooltip.documentation.js +1 -5
- package/dist/components/utilities/intersperse/intersperse.documentation.js +2 -5
- package/dist/config.js +15 -3
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/documentation/documented_stories.js +11 -0
- package/package.json +1 -1
- package/src/components/base/avatar_labeled/avatar_labeled.documentation.js +0 -9
- package/src/components/base/avatar_labeled/avatar_labeled.md +2 -5
- package/src/components/base/avatar_labeled/avatar_labeled.stories.js +68 -62
- package/src/components/base/avatar_labeled/avatar_labeled.vue +1 -0
- package/src/components/base/avatars_inline/avatars_inline.documentation.js +0 -2
- package/src/components/base/avatars_inline/avatars_inline.md +1 -3
- package/src/components/base/avatars_inline/avatars_inline.stories.js +49 -44
- package/src/components/base/form/form_combobox/form_combobox.documentation.js +0 -8
- package/src/components/base/form/form_combobox/form_combobox.md +0 -2
- package/src/components/base/form/form_combobox/form_combobox.stories.js +30 -30
- package/src/components/base/form/form_combobox/form_combobox.vue +4 -0
- package/src/components/base/form/form_group/form_group.scss +4 -0
- package/src/components/base/form/form_group/form_group.spec.js +66 -64
- package/src/components/base/form/form_group/form_group.stories.js +36 -13
- package/src/components/base/form/form_group/form_group.vue +15 -2
- package/src/components/base/form/input_group_text/input_group_text.documentation.js +0 -3
- package/src/components/base/form/input_group_text/input_group_text.stories.js +24 -18
- package/src/components/base/label/label.documentation.js +2 -12
- package/src/components/base/label/label.md +2 -7
- package/src/components/base/label/label.stories.js +66 -92
- package/src/components/base/label/label.vue +22 -2
- package/src/components/base/skeleton_loader/skeleton_loader.documentation.js +0 -27
- package/src/components/base/skeleton_loader/skeleton_loader.md +0 -2
- package/src/components/base/skeleton_loader/skeleton_loader.stories.js +23 -9
- package/src/components/base/skeleton_loader/skeleton_loader.vue +24 -0
- package/src/components/charts/discrete_scatter/discrete_scatter.documentation.js +0 -5
- package/src/components/charts/discrete_scatter/discrete_scatter.stories.js +34 -46
- package/src/components/charts/gauge/gauge.documentation.js +0 -3
- package/src/components/charts/gauge/gauge.md +0 -2
- package/src/components/charts/gauge/gauge.stories.js +70 -86
- package/src/components/charts/stacked_column/stacked_column.documentation.js +0 -2
- package/src/components/charts/stacked_column/stacked_column.md +0 -2
- package/src/components/charts/stacked_column/stacked_column.stories.js +74 -99
- package/src/components/charts/tooltip/tooltip.documentation.js +0 -3
- package/src/components/charts/tooltip/tooltip.stories.js +59 -44
- package/src/components/utilities/intersperse/intersperse.documentation.js +0 -2
- package/src/components/utilities/intersperse/intersperse.md +0 -2
- package/src/components/utilities/intersperse/intersperse.stories.js +38 -38
- package/dist/components/base/avatar_labeled/examples/avatar.labeled.example.js +0 -38
- package/dist/components/base/avatar_labeled/examples/avatar.labeled_badges.example.js +0 -38
- package/dist/components/base/avatar_labeled/examples/avatar.labeled_links.example.js +0 -38
- package/dist/components/base/avatar_labeled/examples/avatar.labeled_tooltip.example.js +0 -38
- package/dist/components/base/avatar_labeled/examples/index.js +0 -31
- package/dist/components/base/avatars_inline/examples/avatars.inline.example.js +0 -58
- package/dist/components/base/avatars_inline/examples/avatars.inline_large.example.js +0 -58
- package/dist/components/base/avatars_inline/examples/avatars.inline_links_and_tooltips.example.js +0 -70
- package/dist/components/base/avatars_inline/examples/avatars.inline_links_and_tooltips_badge.example.js +0 -70
- package/dist/components/base/avatars_inline/examples/index.js +0 -31
- package/dist/components/base/form/form_combobox/examples/form_combobox.basic.example.js +0 -50
- package/dist/components/base/form/form_combobox/examples/index.js +0 -13
- package/dist/components/base/form/input_group_text/examples/index.js +0 -13
- package/dist/components/base/form/input_group_text/examples/input_group_text.basic.example.js +0 -38
- package/dist/components/base/label/examples/index.js +0 -19
- package/dist/components/base/label/examples/label.basic.example.js +0 -38
- package/dist/components/base/label/examples/label.scoped.example.js +0 -38
- package/dist/components/base/skeleton_loader/examples/ci_header_skeleton.basic.example.js +0 -38
- package/dist/components/base/skeleton_loader/examples/default_skeleton.basic.example.js +0 -38
- package/dist/components/base/skeleton_loader/examples/default_skeleton_custom_props.basic.example.js +0 -38
- package/dist/components/base/skeleton_loader/examples/index.js +0 -37
- package/dist/components/base/skeleton_loader/examples/issue_card_skeleton.basic.example.js +0 -38
- package/dist/components/base/skeleton_loader/examples/job_log_skeleton.basic.example.js +0 -38
- package/dist/components/charts/discrete_scatter/examples/discrete_scatter.basic.example.js +0 -51
- package/dist/components/charts/discrete_scatter/examples/index.js +0 -13
- package/dist/components/charts/gauge/examples/gauge.basic.example.js +0 -38
- package/dist/components/charts/gauge/examples/gauge.no_thresholds.example.js +0 -38
- package/dist/components/charts/gauge/examples/gauge.no_value.example.js +0 -38
- package/dist/components/charts/gauge/examples/gauge.with_text.example.js +0 -38
- package/dist/components/charts/gauge/examples/index.js +0 -31
- package/dist/components/charts/stacked_column/examples/index.js +0 -13
- package/dist/components/charts/stacked_column/examples/stacked_column.basic.example.js +0 -46
- package/dist/components/charts/tooltip/examples/chart_tooltip.basic.example.js +0 -54
- package/dist/components/charts/tooltip/examples/index.js +0 -13
- package/dist/components/utilities/intersperse/examples/index.js +0 -31
- package/dist/components/utilities/intersperse/examples/intersperse.custom_last_separator.example.js +0 -38
- package/dist/components/utilities/intersperse/examples/intersperse.custom_last_separator_two_items.example.js +0 -38
- package/dist/components/utilities/intersperse/examples/intersperse.custom_separator.example.js +0 -38
- package/dist/components/utilities/intersperse/examples/intersperse.default.example.js +0 -38
- package/src/components/base/avatar_labeled/examples/avatar.labeled.example.vue +0 -8
- package/src/components/base/avatar_labeled/examples/avatar.labeled_badges.example.vue +0 -17
- package/src/components/base/avatar_labeled/examples/avatar.labeled_links.example.vue +0 -10
- package/src/components/base/avatar_labeled/examples/avatar.labeled_tooltip.example.vue +0 -10
- package/src/components/base/avatar_labeled/examples/index.js +0 -36
- package/src/components/base/avatars_inline/examples/avatars.inline.example.vue +0 -18
- package/src/components/base/avatars_inline/examples/avatars.inline_large.example.vue +0 -18
- package/src/components/base/avatars_inline/examples/avatars.inline_links_and_tooltips.example.vue +0 -24
- package/src/components/base/avatars_inline/examples/avatars.inline_links_and_tooltips_badge.example.vue +0 -31
- package/src/components/base/avatars_inline/examples/index.js +0 -36
- package/src/components/base/form/form_combobox/examples/form_combobox.basic.example.vue +0 -31
- package/src/components/base/form/form_combobox/examples/index.js +0 -15
- package/src/components/base/form/input_group_text/examples/index.js +0 -15
- package/src/components/base/form/input_group_text/examples/input_group_text.basic.example.vue +0 -3
- package/src/components/base/label/examples/index.js +0 -22
- package/src/components/base/label/examples/label.basic.example.vue +0 -3
- package/src/components/base/label/examples/label.scoped.example.vue +0 -3
- package/src/components/base/skeleton_loader/examples/ci_header_skeleton.basic.example.vue +0 -10
- package/src/components/base/skeleton_loader/examples/default_skeleton.basic.example.vue +0 -3
- package/src/components/base/skeleton_loader/examples/default_skeleton_custom_props.basic.example.vue +0 -9
- package/src/components/base/skeleton_loader/examples/index.js +0 -44
- package/src/components/base/skeleton_loader/examples/issue_card_skeleton.basic.example.vue +0 -26
- package/src/components/base/skeleton_loader/examples/job_log_skeleton.basic.example.vue +0 -13
- package/src/components/charts/discrete_scatter/discrete_scatter.md +0 -1
- package/src/components/charts/discrete_scatter/examples/discrete_scatter.basic.example.vue +0 -31
- package/src/components/charts/discrete_scatter/examples/index.js +0 -15
- package/src/components/charts/gauge/examples/gauge.basic.example.vue +0 -5
- package/src/components/charts/gauge/examples/gauge.no_thresholds.example.vue +0 -5
- package/src/components/charts/gauge/examples/gauge.no_value.example.vue +0 -5
- package/src/components/charts/gauge/examples/gauge.with_text.example.vue +0 -12
- package/src/components/charts/gauge/examples/index.js +0 -36
- package/src/components/charts/stacked_column/examples/index.js +0 -15
- package/src/components/charts/stacked_column/examples/stacked_column.basic.example.vue +0 -18
- package/src/components/charts/tooltip/examples/chart_tooltip.basic.example.vue +0 -32
- package/src/components/charts/tooltip/examples/index.js +0 -15
- package/src/components/utilities/intersperse/examples/index.js +0 -36
- package/src/components/utilities/intersperse/examples/intersperse.custom_last_separator.example.vue +0 -7
- package/src/components/utilities/intersperse/examples/intersperse.custom_last_separator_two_items.example.vue +0 -6
- package/src/components/utilities/intersperse/examples/intersperse.custom_separator.example.vue +0 -7
- package/src/components/utilities/intersperse/examples/intersperse.default.example.vue +0 -7
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import { withKnobs, object, text } from '@storybook/addon-knobs';
|
|
2
1
|
import { GlDiscreteScatterChart } from '../../../../charts';
|
|
3
|
-
import { documentedStoriesOf } from '../../../../documentation/documented_stories';
|
|
4
|
-
import readme from './discrete_scatter.md';
|
|
5
2
|
|
|
6
|
-
const
|
|
7
|
-
GlDiscreteScatterChart,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const template = `
|
|
3
|
+
const Template = (args, { argTypes }) => ({
|
|
4
|
+
components: { GlDiscreteScatterChart },
|
|
5
|
+
props: Object.keys(argTypes),
|
|
6
|
+
template: `
|
|
11
7
|
<gl-discrete-scatter-chart
|
|
12
8
|
:data="data"
|
|
13
9
|
:option="option"
|
|
@@ -15,9 +11,10 @@ const template = `
|
|
|
15
11
|
:x-axis-title="xAxisTitle"
|
|
16
12
|
data-testid="discrete-scatter-chart"
|
|
17
13
|
/>
|
|
18
|
-
|
|
14
|
+
`,
|
|
15
|
+
});
|
|
19
16
|
|
|
20
|
-
|
|
17
|
+
const generateProps = ({
|
|
21
18
|
data = [
|
|
22
19
|
{
|
|
23
20
|
type: 'scatter',
|
|
@@ -35,41 +32,32 @@ function generateProps({
|
|
|
35
32
|
option = {},
|
|
36
33
|
yAxisTitle = 'Pushes per day',
|
|
37
34
|
xAxisTitle = 'Date',
|
|
38
|
-
} = {}) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
default: text('Y Axis Title', yAxisTitle),
|
|
48
|
-
},
|
|
49
|
-
xAxisTitle: {
|
|
50
|
-
default: text('X Axis Title', xAxisTitle),
|
|
51
|
-
},
|
|
52
|
-
};
|
|
53
|
-
}
|
|
35
|
+
} = {}) => ({
|
|
36
|
+
data,
|
|
37
|
+
option,
|
|
38
|
+
yAxisTitle,
|
|
39
|
+
xAxisTitle,
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export const Default = Template.bind({});
|
|
43
|
+
Default.args = generateProps();
|
|
54
44
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
.add('with zoom and scroll', () => ({
|
|
63
|
-
props: generateProps({
|
|
64
|
-
option: {
|
|
65
|
-
dataZoom: [
|
|
66
|
-
{
|
|
67
|
-
type: 'slider',
|
|
68
|
-
startValue: 1,
|
|
69
|
-
},
|
|
70
|
-
],
|
|
45
|
+
export const WithZoomAndScroll = Template.bind({});
|
|
46
|
+
WithZoomAndScroll.args = generateProps({
|
|
47
|
+
option: {
|
|
48
|
+
dataZoom: [
|
|
49
|
+
{
|
|
50
|
+
type: 'slider',
|
|
51
|
+
startValue: 1,
|
|
71
52
|
},
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
export default {
|
|
58
|
+
title: 'charts/discrete-scatter-chart',
|
|
59
|
+
component: GlDiscreteScatterChart,
|
|
60
|
+
parameters: {
|
|
61
|
+
knobs: { disable: true },
|
|
62
|
+
},
|
|
63
|
+
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { withKnobs, object, number, text as textKnob, array } from '@storybook/addon-knobs';
|
|
2
|
-
import { documentedStoriesOf } from '../../../../documentation/documented_stories';
|
|
3
1
|
import { toolbox } from '../../../utils/charts/story_config';
|
|
4
2
|
import readme from './gauge.md';
|
|
5
3
|
import GlGauge from './gauge.vue';
|
|
@@ -16,7 +14,7 @@ const template = `
|
|
|
16
14
|
/>
|
|
17
15
|
`;
|
|
18
16
|
|
|
19
|
-
|
|
17
|
+
const generateProps = ({
|
|
20
18
|
value = 48,
|
|
21
19
|
min = 0,
|
|
22
20
|
max = 100,
|
|
@@ -24,88 +22,74 @@ function generateProps({
|
|
|
24
22
|
option = {},
|
|
25
23
|
thresholds = [38, 82],
|
|
26
24
|
splitNumber = 10,
|
|
27
|
-
} = {}) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
default: array('Thresholds', thresholds),
|
|
43
|
-
},
|
|
44
|
-
text: {
|
|
45
|
-
default: textKnob('Detail Text', text),
|
|
46
|
-
},
|
|
47
|
-
splitNumber: {
|
|
48
|
-
default: number('Split Number', splitNumber),
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
}
|
|
25
|
+
} = {}) => ({
|
|
26
|
+
option,
|
|
27
|
+
value,
|
|
28
|
+
min,
|
|
29
|
+
max,
|
|
30
|
+
thresholds,
|
|
31
|
+
text,
|
|
32
|
+
splitNumber,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const Template = (args, { argTypes }) => ({
|
|
36
|
+
components: { GlGauge },
|
|
37
|
+
props: Object.keys(argTypes),
|
|
38
|
+
template,
|
|
39
|
+
});
|
|
52
40
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
props: generateProps({
|
|
105
|
-
option: {
|
|
106
|
-
toolbox,
|
|
41
|
+
export const Default = Template.bind({});
|
|
42
|
+
Default.args = generateProps();
|
|
43
|
+
|
|
44
|
+
export const OneThreshold = Template.bind({});
|
|
45
|
+
OneThreshold.args = generateProps({
|
|
46
|
+
value: 65,
|
|
47
|
+
thresholds: [85],
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export const TwoThresholds = Template.bind({});
|
|
51
|
+
TwoThresholds.args = generateProps({
|
|
52
|
+
value: 90,
|
|
53
|
+
thresholds: [60, 85],
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
export const NoThresholds = Template.bind({});
|
|
57
|
+
NoThresholds.args = generateProps({
|
|
58
|
+
value: 90,
|
|
59
|
+
thresholds: [],
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
export const WithCustomDetailText = Template.bind({});
|
|
63
|
+
WithCustomDetailText.args = generateProps({
|
|
64
|
+
value: 90,
|
|
65
|
+
text: '90Mbps',
|
|
66
|
+
thresholds: [60, 85],
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
export const WithNaNValues = Template.bind({});
|
|
70
|
+
WithNaNValues.args = generateProps({
|
|
71
|
+
min: 'not a number value',
|
|
72
|
+
max: 'not a number value',
|
|
73
|
+
value: 'not a number value',
|
|
74
|
+
thresholds: [60, 85],
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
export const WithToolbox = Template.bind({});
|
|
78
|
+
WithToolbox.args = generateProps({
|
|
79
|
+
option: {
|
|
80
|
+
toolbox,
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
export default {
|
|
85
|
+
title: 'charts/gauge-chart',
|
|
86
|
+
component: GlGauge,
|
|
87
|
+
parameters: {
|
|
88
|
+
knobs: { disable: true },
|
|
89
|
+
docs: {
|
|
90
|
+
description: {
|
|
91
|
+
component: readme,
|
|
107
92
|
},
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}));
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
};
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { withKnobs, object, text, array, select } from '@storybook/addon-knobs';
|
|
2
1
|
import { GlStackedColumnChart } from '../../../../charts';
|
|
3
|
-
import { documentedStoriesOf } from '../../../../documentation/documented_stories';
|
|
4
2
|
import {
|
|
5
3
|
mockDefaultStackedLineData,
|
|
6
4
|
mockDefaultStackedBarData,
|
|
@@ -10,10 +8,6 @@ import { toolbox } from '../../../utils/charts/story_config';
|
|
|
10
8
|
import { columnOptions } from '../../../utils/constants';
|
|
11
9
|
import readme from './stacked_column.md';
|
|
12
10
|
|
|
13
|
-
const components = {
|
|
14
|
-
GlStackedColumnChart,
|
|
15
|
-
};
|
|
16
|
-
|
|
17
11
|
const template = `
|
|
18
12
|
<gl-stacked-column-chart
|
|
19
13
|
:bars="bars"
|
|
@@ -31,7 +25,7 @@ const template = `
|
|
|
31
25
|
|
|
32
26
|
const mockSecondaryDataTitle = 'Merges';
|
|
33
27
|
|
|
34
|
-
|
|
28
|
+
const generateProps = ({
|
|
35
29
|
bars = mockDefaultStackedBarData,
|
|
36
30
|
lines = [],
|
|
37
31
|
option = {},
|
|
@@ -42,98 +36,79 @@ function generateProps({
|
|
|
42
36
|
presentation = columnOptions.stacked,
|
|
43
37
|
secondaryData = [],
|
|
44
38
|
secondaryDataTitle = '',
|
|
45
|
-
} = {}) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
default: select('presentation', columnOptions, presentation),
|
|
58
|
-
},
|
|
59
|
-
groupBy: {
|
|
60
|
-
default: array('Group By', groupBy),
|
|
61
|
-
},
|
|
62
|
-
xAxisType: {
|
|
63
|
-
default: text('X Axis Type', xAxisType),
|
|
64
|
-
},
|
|
65
|
-
xAxisTitle: {
|
|
66
|
-
default: text('X Axis Title', xAxisTitle),
|
|
67
|
-
},
|
|
68
|
-
yAxisTitle: {
|
|
69
|
-
default: text('Y Axis Title', yAxisTitle),
|
|
70
|
-
},
|
|
71
|
-
secondaryDataTitle: {
|
|
72
|
-
default: text('Secondary Data Title', secondaryDataTitle),
|
|
73
|
-
},
|
|
74
|
-
secondaryData: {
|
|
75
|
-
default: object('Secondary Data', secondaryData),
|
|
76
|
-
},
|
|
77
|
-
};
|
|
78
|
-
}
|
|
39
|
+
} = {}) => ({
|
|
40
|
+
bars,
|
|
41
|
+
lines,
|
|
42
|
+
option,
|
|
43
|
+
presentation,
|
|
44
|
+
groupBy,
|
|
45
|
+
xAxisType,
|
|
46
|
+
xAxisTitle,
|
|
47
|
+
yAxisTitle,
|
|
48
|
+
secondaryDataTitle,
|
|
49
|
+
secondaryData,
|
|
50
|
+
});
|
|
79
51
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
.
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
.
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
startValue: 1,
|
|
108
|
-
},
|
|
109
|
-
],
|
|
52
|
+
const Template = (args, { argTypes }) => ({
|
|
53
|
+
components: { GlStackedColumnChart },
|
|
54
|
+
props: Object.keys(argTypes),
|
|
55
|
+
template,
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
export const Stacked = Template.bind({});
|
|
59
|
+
Stacked.args = generateProps();
|
|
60
|
+
|
|
61
|
+
export const Tiled = Template.bind({});
|
|
62
|
+
Tiled.args = generateProps({ presentation: columnOptions.tiled });
|
|
63
|
+
|
|
64
|
+
export const StackedWithLineData = Template.bind({});
|
|
65
|
+
StackedWithLineData.args = generateProps({ lines: mockDefaultStackedLineData });
|
|
66
|
+
|
|
67
|
+
export const TiledWithLineData = Template.bind({});
|
|
68
|
+
TiledWithLineData.args = generateProps({
|
|
69
|
+
presentation: columnOptions.tiled,
|
|
70
|
+
lines: mockDefaultStackedLineData,
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
export const WithZoomAndScroll = Template.bind({});
|
|
74
|
+
WithZoomAndScroll.args = generateProps({
|
|
75
|
+
option: {
|
|
76
|
+
dataZoom: [
|
|
77
|
+
{
|
|
78
|
+
startValue: 1,
|
|
110
79
|
},
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
export const WithToolbox = Template.bind({});
|
|
85
|
+
WithToolbox.args = generateProps({
|
|
86
|
+
option: {
|
|
87
|
+
toolbox,
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
export const SecondaryYAxis = Template.bind({});
|
|
92
|
+
SecondaryYAxis.args = generateProps({
|
|
93
|
+
secondaryData: mockSecondaryData,
|
|
94
|
+
secondaryDataTitle: mockSecondaryDataTitle,
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
export const SecondaryYAxisLine = Template.bind({});
|
|
98
|
+
SecondaryYAxisLine.args = generateProps({
|
|
99
|
+
secondaryData: [{ ...mockSecondaryData[0], type: 'line' }],
|
|
100
|
+
secondaryDataTitle: mockSecondaryDataTitle,
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
export default {
|
|
104
|
+
title: 'charts/stacked-column-chart',
|
|
105
|
+
component: GlStackedColumnChart,
|
|
106
|
+
parameters: {
|
|
107
|
+
knobs: { disable: true },
|
|
108
|
+
docs: {
|
|
109
|
+
description: {
|
|
110
|
+
component: readme,
|
|
119
111
|
},
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}))
|
|
124
|
-
.add('secondary Y axis', () => ({
|
|
125
|
-
props: generateProps({
|
|
126
|
-
secondaryData: mockSecondaryData,
|
|
127
|
-
secondaryDataTitle: mockSecondaryDataTitle,
|
|
128
|
-
}),
|
|
129
|
-
components,
|
|
130
|
-
template,
|
|
131
|
-
}))
|
|
132
|
-
.add('secondary Y axis line', () => ({
|
|
133
|
-
props: generateProps({
|
|
134
|
-
secondaryData: [{ ...mockSecondaryData[0], type: 'line' }],
|
|
135
|
-
secondaryDataTitle: mockSecondaryDataTitle,
|
|
136
|
-
}),
|
|
137
|
-
components,
|
|
138
|
-
template,
|
|
139
|
-
}));
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { GlChart, GlChartTooltip, GlChartSeriesLabel } from '../../../../charts';
|
|
2
|
-
import { documentedStoriesOf } from '../../../../documentation/documented_stories';
|
|
3
2
|
import {
|
|
4
3
|
SERIES_NAME,
|
|
5
4
|
SERIES_NAME_LONG,
|
|
6
5
|
SERIES_NAME_LONG_WITHOUT_SPACES,
|
|
7
6
|
} from '../../../utils/stories_utils';
|
|
8
|
-
|
|
9
7
|
import readme from './tooltip.md';
|
|
10
8
|
|
|
11
9
|
const components = {
|
|
@@ -33,10 +31,9 @@ const baseStoryOptions = {
|
|
|
33
31
|
},
|
|
34
32
|
};
|
|
35
33
|
|
|
36
|
-
const getStoryOptions = (tooltipContent) => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
template: `<div class="position-relative">
|
|
34
|
+
const getStoryOptions = (tooltipContent) => ({
|
|
35
|
+
...baseStoryOptions,
|
|
36
|
+
template: `<div class="position-relative">
|
|
40
37
|
<gl-chart
|
|
41
38
|
:options="options"
|
|
42
39
|
:height="100"
|
|
@@ -57,43 +54,61 @@ const getStoryOptions = (tooltipContent) => {
|
|
|
57
54
|
${tooltipContent}
|
|
58
55
|
</gl-chart-tooltip>
|
|
59
56
|
</div>`,
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
export const Default = (args, { argTypes }) => ({
|
|
60
|
+
props: Object.keys(argTypes),
|
|
61
|
+
...getStoryOptions('Example Content'),
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
export const WithLongSeriesLabel = (args, { argTypes }) => ({
|
|
65
|
+
props: Object.keys(argTypes),
|
|
66
|
+
...getStoryOptions(`
|
|
67
|
+
<gl-chart-series-label color="#1F78D1">${SERIES_NAME[SERIES_NAME_LONG]}</gl-chart-series-label>
|
|
68
|
+
`),
|
|
69
|
+
});
|
|
62
70
|
|
|
63
|
-
|
|
64
|
-
.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
)
|
|
70
|
-
.add('with long series label with no spaces', () =>
|
|
71
|
-
getStoryOptions(`
|
|
72
|
-
<gl-chart-series-label color="#1F78D1">${SERIES_NAME[SERIES_NAME_LONG_WITHOUT_SPACES]}</gl-chart-series-label>
|
|
73
|
-
`)
|
|
74
|
-
)
|
|
71
|
+
export const WithLongSeriesLabelWithNoSpaces = (args, { argTypes }) => ({
|
|
72
|
+
props: Object.keys(argTypes),
|
|
73
|
+
...getStoryOptions(`
|
|
74
|
+
<gl-chart-series-label color="#1F78D1">${SERIES_NAME[SERIES_NAME_LONG_WITHOUT_SPACES]}</gl-chart-series-label>
|
|
75
|
+
`),
|
|
76
|
+
});
|
|
75
77
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
78
|
+
export const TitleProp = (args, { argTypes }) => ({
|
|
79
|
+
props: Object.keys(argTypes),
|
|
80
|
+
...baseStoryOptions,
|
|
81
|
+
template: `
|
|
82
|
+
<div class="position-relative">
|
|
83
|
+
<gl-chart
|
|
84
|
+
:options="options"
|
|
85
|
+
:height="100"
|
|
86
|
+
@created="onCreated"
|
|
87
|
+
/>
|
|
88
|
+
<gl-chart-tooltip
|
|
89
|
+
v-if="chart"
|
|
90
|
+
:chart="chart"
|
|
91
|
+
:show="showTooltip"
|
|
92
|
+
:top="top"
|
|
93
|
+
:left="left"
|
|
94
|
+
title="Title from prop"
|
|
95
|
+
>
|
|
96
|
+
Example content
|
|
97
|
+
</gl-chart-tooltip>
|
|
98
|
+
</div>`,
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
export default {
|
|
102
|
+
title: 'charts/chart-tooltip',
|
|
103
|
+
component: GlChartTooltip,
|
|
104
|
+
parameters: {
|
|
105
|
+
bootstrapComponent: 'b-popover',
|
|
106
|
+
knobs: { disable: true },
|
|
107
|
+
controls: { disable: true },
|
|
108
|
+
docs: {
|
|
109
|
+
description: {
|
|
110
|
+
component: readme,
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
};
|