@gitlab/ui 36.5.1 → 37.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 +39 -0
- package/dist/components/base/alert/alert.js +1 -11
- package/dist/components/base/card/card.js +1 -1
- package/dist/components/base/form/form_radio_group/form_radio_group.documentation.js +2 -48
- package/dist/components/base/form/form_radio_group/form_radio_group.js +22 -2
- package/dist/components/base/pagination/pagination.js +1 -1
- package/dist/components/charts/area/area.documentation.js +1 -7
- package/dist/components/charts/heatmap/heatmap.documentation.js +0 -3
- package/dist/components/charts/line/line.documentation.js +2 -5
- package/dist/components/charts/series_label/series_label.documentation.js +2 -5
- package/dist/index.css +2 -2
- package/dist/index.css.map +1 -1
- package/dist/utility_classes.css +1 -1
- package/dist/utility_classes.css.map +1 -1
- package/dist/utils/stories_utils.js +13 -1
- package/documentation/documented_stories.js +5 -0
- package/package.json +13 -13
- package/scss_to_js/scss_variables.js +1 -0
- package/scss_to_js/scss_variables.json +5 -0
- package/src/components/base/accordion/accordion.stories.js +2 -1
- package/src/components/base/alert/alert.scss +0 -38
- package/src/components/base/alert/alert.spec.js +0 -1
- package/src/components/base/alert/alert.stories.js +0 -8
- package/src/components/base/alert/alert.vue +30 -41
- package/src/components/base/badge/badge.stories.js +4 -24
- package/src/components/base/card/card.vue +2 -2
- package/src/components/base/daterange_picker/daterange_picker.stories.js +10 -35
- package/src/components/base/form/form_radio_group/form_radio_group.documentation.js +0 -48
- package/src/components/base/form/form_radio_group/form_radio_group.md +0 -2
- package/src/components/base/form/form_radio_group/form_radio_group.stories.js +50 -29
- package/src/components/base/form/form_radio_group/form_radio_group.vue +22 -2
- package/src/components/base/icon/icon.stories.js +2 -5
- package/src/components/base/paginated_list/__snapshots__/paginated_list.spec.js.snap +10 -10
- package/src/components/base/pagination/pagination.stories.js +5 -1
- package/src/components/base/pagination/pagination.vue +1 -1
- package/src/components/base/toggle/toggle.stories.js +2 -3
- package/src/components/charts/area/area.documentation.js +0 -5
- package/src/components/charts/area/area.stories.js +127 -127
- package/src/components/charts/bar/bar.stories.js +8 -5
- package/src/components/charts/heatmap/heatmap.documentation.js +0 -2
- package/src/components/charts/heatmap/heatmap.stories.js +58 -44
- package/src/components/charts/line/line.documentation.js +0 -2
- package/src/components/charts/line/line.md +0 -2
- package/src/components/charts/line/line.stories.js +124 -113
- package/src/components/charts/series_label/series_label.documentation.js +0 -2
- package/src/components/charts/series_label/series_label.md +0 -2
- package/src/components/charts/series_label/series_label.stories.js +62 -59
- package/src/scss/utilities.scss +40 -0
- package/src/scss/utility-mixins/border.scss +21 -0
- package/src/scss/variables.scss +2 -0
- package/src/utils/stories_utils.js +6 -0
- package/src/utils/stories_utils.spec.js +18 -0
- package/dist/components/base/form/form_radio_group/examples/form_radio_group.options_array.example.js +0 -59
- package/dist/components/base/form/form_radio_group/examples/form_radio_group.slots.example.js +0 -48
- package/dist/components/base/form/form_radio_group/examples/index.js +0 -17
- package/dist/components/charts/area/examples/area.basic.example.js +0 -45
- package/dist/components/charts/area/examples/area.basic_plus.example.js +0 -53
- package/dist/components/charts/area/examples/index.js +0 -19
- package/dist/components/charts/heatmap/examples/heatmap.custom_options.example.js +0 -79
- package/dist/components/charts/heatmap/examples/heatmap.hourly.example.js +0 -70
- package/dist/components/charts/heatmap/examples/heatmap.responsive.example.js +0 -70
- package/dist/components/charts/heatmap/examples/heatmap.totals.example.js +0 -62
- package/dist/components/charts/heatmap/examples/index.js +0 -31
- package/dist/components/charts/line/examples/index.js +0 -19
- package/dist/components/charts/line/examples/line.basic.example.js +0 -45
- package/dist/components/charts/line/examples/line.series.example.js +0 -53
- package/dist/components/charts/series_label/examples/index.js +0 -13
- package/dist/components/charts/series_label/examples/series_label.basic.example.js +0 -38
- package/src/components/base/form/form_radio_group/examples/form_radio_group.options_array.example.vue +0 -27
- package/src/components/base/form/form_radio_group/examples/form_radio_group.slots.example.vue +0 -21
- package/src/components/base/form/form_radio_group/examples/index.js +0 -20
- package/src/components/charts/area/area.md +0 -1
- package/src/components/charts/area/examples/area.basic.example.vue +0 -14
- package/src/components/charts/area/examples/area.basic_plus.example.vue +0 -25
- package/src/components/charts/area/examples/index.js +0 -22
- package/src/components/charts/heatmap/examples/heatmap.custom_options.example.vue +0 -70
- package/src/components/charts/heatmap/examples/heatmap.hourly.example.vue +0 -62
- package/src/components/charts/heatmap/examples/heatmap.responsive.example.vue +0 -63
- package/src/components/charts/heatmap/examples/heatmap.totals.example.vue +0 -38
- package/src/components/charts/heatmap/examples/index.js +0 -36
- package/src/components/charts/line/examples/index.js +0 -22
- package/src/components/charts/line/examples/line.basic.example.vue +0 -14
- package/src/components/charts/line/examples/line.series.example.vue +0 -25
- package/src/components/charts/series_label/examples/index.js +0 -15
- package/src/components/charts/series_label/examples/series_label.basic.example.vue +0 -3
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import iconSpriteInfo from '@gitlab/svgs/dist/icons.json';
|
|
2
2
|
import { GlIcon } from '../../../index';
|
|
3
3
|
import { iconSizeOptions } from '../../../utils/constants';
|
|
4
|
+
import { disableControls } from '../../../utils/stories_utils';
|
|
4
5
|
import readme from './icon.md';
|
|
5
6
|
|
|
6
7
|
const components = {
|
|
@@ -41,6 +42,7 @@ export default {
|
|
|
41
42
|
storyshots: { disable: true },
|
|
42
43
|
},
|
|
43
44
|
argTypes: {
|
|
45
|
+
...disableControls(['useDeprecatedSizes']),
|
|
44
46
|
name: {
|
|
45
47
|
control: {
|
|
46
48
|
type: 'select',
|
|
@@ -53,10 +55,5 @@ export default {
|
|
|
53
55
|
options: iconSizeOptions,
|
|
54
56
|
},
|
|
55
57
|
},
|
|
56
|
-
useDeprecatedSizes: {
|
|
57
|
-
control: {
|
|
58
|
-
disable: true,
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
58
|
},
|
|
62
59
|
};
|
|
@@ -42,7 +42,7 @@ exports[`Paginated List Pagination renders 1 item on page 7 with page size of 2
|
|
|
42
42
|
limits="[object Object]"
|
|
43
43
|
nexttext="Next"
|
|
44
44
|
perpage="2"
|
|
45
|
-
prevtext="
|
|
45
|
+
prevtext="Previous"
|
|
46
46
|
totalitems="13"
|
|
47
47
|
value="7"
|
|
48
48
|
/>
|
|
@@ -119,7 +119,7 @@ exports[`Paginated List Pagination renders 3 items on page 2 with default page s
|
|
|
119
119
|
limits="[object Object]"
|
|
120
120
|
nexttext="Next"
|
|
121
121
|
perpage="10"
|
|
122
|
-
prevtext="
|
|
122
|
+
prevtext="Previous"
|
|
123
123
|
totalitems="13"
|
|
124
124
|
value="2"
|
|
125
125
|
/>
|
|
@@ -222,7 +222,7 @@ exports[`Paginated List Pagination renders 5 items on page 1 for a page size of
|
|
|
222
222
|
limits="[object Object]"
|
|
223
223
|
nexttext="Next"
|
|
224
224
|
perpage="5"
|
|
225
|
-
prevtext="
|
|
225
|
+
prevtext="Previous"
|
|
226
226
|
totalitems="13"
|
|
227
227
|
value="1"
|
|
228
228
|
/>
|
|
@@ -390,7 +390,7 @@ exports[`Paginated List Pagination renders 10 items for a default page size of 1
|
|
|
390
390
|
limits="[object Object]"
|
|
391
391
|
nexttext="Next"
|
|
392
392
|
perpage="10"
|
|
393
|
-
prevtext="
|
|
393
|
+
prevtext="Previous"
|
|
394
394
|
totalitems="13"
|
|
395
395
|
value="1"
|
|
396
396
|
/>
|
|
@@ -597,7 +597,7 @@ exports[`Paginated List Pagination renders 13 items for a default page size of 2
|
|
|
597
597
|
limits="[object Object]"
|
|
598
598
|
nexttext="Next"
|
|
599
599
|
perpage="20"
|
|
600
|
-
prevtext="
|
|
600
|
+
prevtext="Previous"
|
|
601
601
|
totalitems="13"
|
|
602
602
|
value="1"
|
|
603
603
|
/>
|
|
@@ -717,7 +717,7 @@ exports[`Paginated List Search states renders the list filtered by search result
|
|
|
717
717
|
limits="[object Object]"
|
|
718
718
|
nexttext="Next"
|
|
719
719
|
perpage="10"
|
|
720
|
-
prevtext="
|
|
720
|
+
prevtext="Previous"
|
|
721
721
|
totalitems="2"
|
|
722
722
|
value="1"
|
|
723
723
|
/>
|
|
@@ -837,7 +837,7 @@ exports[`Paginated List Searchless states renders the list with nested items, wh
|
|
|
837
837
|
limits="[object Object]"
|
|
838
838
|
nexttext="Next"
|
|
839
839
|
perpage="10"
|
|
840
|
-
prevtext="
|
|
840
|
+
prevtext="Previous"
|
|
841
841
|
totalitems="2"
|
|
842
842
|
value="1"
|
|
843
843
|
/>
|
|
@@ -888,7 +888,7 @@ exports[`Paginated List props filter filters on default "id" key 1`] = `
|
|
|
888
888
|
limits="[object Object]"
|
|
889
889
|
nexttext="Next"
|
|
890
890
|
perpage="10"
|
|
891
|
-
prevtext="
|
|
891
|
+
prevtext="Previous"
|
|
892
892
|
totalitems="1"
|
|
893
893
|
value="1"
|
|
894
894
|
/>
|
|
@@ -939,7 +939,7 @@ exports[`Paginated List props filter filters on provided "myKey" key 1`] = `
|
|
|
939
939
|
limits="[object Object]"
|
|
940
940
|
nexttext="Next"
|
|
941
941
|
perpage="10"
|
|
942
|
-
prevtext="
|
|
942
|
+
prevtext="Previous"
|
|
943
943
|
totalitems="1"
|
|
944
944
|
value="1"
|
|
945
945
|
/>
|
|
@@ -990,7 +990,7 @@ exports[`Paginated List props filter filters with provided filter function 1`] =
|
|
|
990
990
|
limits="[object Object]"
|
|
991
991
|
nexttext="Next"
|
|
992
992
|
perpage="10"
|
|
993
|
-
prevtext="
|
|
993
|
+
prevtext="Previous"
|
|
994
994
|
totalitems="1"
|
|
995
995
|
value="1"
|
|
996
996
|
/>
|
|
@@ -4,7 +4,11 @@ import GlPagination from './pagination.vue';
|
|
|
4
4
|
|
|
5
5
|
const components = { GlPagination };
|
|
6
6
|
|
|
7
|
-
const generateBaseProps = ({
|
|
7
|
+
const generateBaseProps = ({
|
|
8
|
+
prevText = 'Previous',
|
|
9
|
+
nextText = 'Next',
|
|
10
|
+
disabled = false,
|
|
11
|
+
} = {}) => ({
|
|
8
12
|
prevText,
|
|
9
13
|
nextText,
|
|
10
14
|
disabled,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { GlToggle } from '../../../index';
|
|
2
2
|
import { toggleLabelPosition } from '../../../utils/constants';
|
|
3
|
+
import { disableControls } from '../../../utils/stories_utils';
|
|
3
4
|
import readme from './toggle.md';
|
|
4
5
|
|
|
5
6
|
const defaultValue = (prop) => GlToggle.props[prop].default;
|
|
@@ -53,6 +54,7 @@ export default {
|
|
|
53
54
|
},
|
|
54
55
|
},
|
|
55
56
|
argTypes: {
|
|
57
|
+
...disableControls(['name']),
|
|
56
58
|
labelPosition: {
|
|
57
59
|
control: {
|
|
58
60
|
type: 'select',
|
|
@@ -69,8 +71,5 @@ export default {
|
|
|
69
71
|
type: 'text',
|
|
70
72
|
},
|
|
71
73
|
},
|
|
72
|
-
name: {
|
|
73
|
-
control: { disable: true },
|
|
74
|
-
},
|
|
75
74
|
},
|
|
76
75
|
};
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
import { withKnobs, object, array, boolean } from '@storybook/addon-knobs';
|
|
2
1
|
import { times } from 'lodash';
|
|
3
2
|
import { GlAreaChart } from '../../../charts';
|
|
4
|
-
import { documentedStoriesOf } from '../../../../documentation/documented_stories';
|
|
5
3
|
import { mockAnnotationsSeries, mockAnnotationsConfigs } from '../../../utils/charts/mock_data';
|
|
6
4
|
import { toolbox } from '../../../utils/charts/story_config';
|
|
7
5
|
import { timeSeriesDateFormatter } from '../../../utils/charts/utils';
|
|
8
6
|
import { generateTimeSeries } from '../../../utils/data_utils';
|
|
9
|
-
import
|
|
7
|
+
import { disableControls } from '../../../utils/stories_utils';
|
|
10
8
|
|
|
11
|
-
const components = {
|
|
12
|
-
GlAreaChart,
|
|
13
|
-
};
|
|
14
9
|
const defaultData = [
|
|
15
10
|
{
|
|
16
11
|
name: 'First Series',
|
|
@@ -32,6 +27,7 @@ const defaultOptions = {
|
|
|
32
27
|
type: 'category',
|
|
33
28
|
},
|
|
34
29
|
};
|
|
30
|
+
|
|
35
31
|
const template = `<gl-area-chart
|
|
36
32
|
:data="data"
|
|
37
33
|
:option="option"
|
|
@@ -40,136 +36,140 @@ const template = `<gl-area-chart
|
|
|
40
36
|
:includeLegendAvgMax="includeLegendAvgMax"
|
|
41
37
|
/>`;
|
|
42
38
|
|
|
43
|
-
|
|
39
|
+
const generateProps = ({
|
|
44
40
|
data = defaultData,
|
|
45
41
|
option = defaultOptions,
|
|
46
42
|
thresholds = [],
|
|
47
43
|
annotations = [],
|
|
48
44
|
includeLegendAvgMax = true,
|
|
49
|
-
} = {}) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
45
|
+
} = {}) => ({
|
|
46
|
+
data,
|
|
47
|
+
option,
|
|
48
|
+
thresholds,
|
|
49
|
+
annotations,
|
|
50
|
+
includeLegendAvgMax,
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
const Template = (args, { argTypes }) => ({
|
|
54
|
+
components: {
|
|
55
|
+
GlAreaChart,
|
|
56
|
+
},
|
|
57
|
+
props: Object.keys(argTypes),
|
|
58
|
+
template,
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
export const Default = Template.bind({});
|
|
62
|
+
Default.args = generateProps();
|
|
63
|
+
|
|
64
|
+
export const WithThreshold = Template.bind({});
|
|
65
|
+
WithThreshold.args = generateProps({
|
|
66
|
+
thresholds: [{ threshold: 1200, operator: '>' }],
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
export const WithAnnotationsAsProps = Template.bind({});
|
|
70
|
+
WithAnnotationsAsProps.storyName = 'With annotations as props (recommended)';
|
|
71
|
+
WithAnnotationsAsProps.args = generateProps({
|
|
72
|
+
...mockAnnotationsConfigs,
|
|
73
|
+
data: [
|
|
74
|
+
{
|
|
75
|
+
name: 'Time Series',
|
|
76
|
+
data: generateTimeSeries(),
|
|
56
77
|
},
|
|
57
|
-
|
|
58
|
-
|
|
78
|
+
],
|
|
79
|
+
option: {
|
|
80
|
+
xAxis: {
|
|
81
|
+
type: 'time',
|
|
82
|
+
name: 'Time',
|
|
83
|
+
axisLabel: {
|
|
84
|
+
formatter: timeSeriesDateFormatter,
|
|
85
|
+
},
|
|
59
86
|
},
|
|
60
|
-
|
|
61
|
-
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
export const WithAnnotationsAsOptionSeries = Template.bind({});
|
|
91
|
+
WithAnnotationsAsOptionSeries.args = generateProps({
|
|
92
|
+
data: [
|
|
93
|
+
{
|
|
94
|
+
name: 'Time Series',
|
|
95
|
+
data: generateTimeSeries(),
|
|
62
96
|
},
|
|
63
|
-
|
|
64
|
-
|
|
97
|
+
],
|
|
98
|
+
option: {
|
|
99
|
+
...mockAnnotationsSeries,
|
|
100
|
+
xAxis: {
|
|
101
|
+
type: 'time',
|
|
102
|
+
name: 'Time',
|
|
103
|
+
axisLabel: {
|
|
104
|
+
formatter: timeSeriesDateFormatter,
|
|
105
|
+
},
|
|
65
106
|
},
|
|
66
|
-
}
|
|
67
|
-
}
|
|
107
|
+
},
|
|
108
|
+
});
|
|
68
109
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
.add('with annotations as props (recommended)', () => ({
|
|
84
|
-
props: generateProps({
|
|
85
|
-
...mockAnnotationsConfigs,
|
|
86
|
-
data: [
|
|
87
|
-
{
|
|
88
|
-
name: 'Time Series',
|
|
89
|
-
data: generateTimeSeries(),
|
|
90
|
-
},
|
|
91
|
-
],
|
|
92
|
-
option: {
|
|
93
|
-
xAxis: {
|
|
94
|
-
type: 'time',
|
|
95
|
-
name: 'Time',
|
|
96
|
-
axisLabel: {
|
|
97
|
-
formatter: timeSeriesDateFormatter,
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
}),
|
|
102
|
-
components,
|
|
103
|
-
template,
|
|
104
|
-
}))
|
|
105
|
-
.add('with annotations as option series', () => ({
|
|
106
|
-
props: generateProps({
|
|
107
|
-
data: [
|
|
108
|
-
{
|
|
109
|
-
name: 'Time Series',
|
|
110
|
-
data: generateTimeSeries(),
|
|
111
|
-
},
|
|
112
|
-
],
|
|
113
|
-
option: {
|
|
114
|
-
...mockAnnotationsSeries,
|
|
115
|
-
xAxis: {
|
|
116
|
-
type: 'time',
|
|
117
|
-
name: 'Time',
|
|
118
|
-
axisLabel: {
|
|
119
|
-
formatter: timeSeriesDateFormatter,
|
|
120
|
-
},
|
|
121
|
-
},
|
|
122
|
-
},
|
|
123
|
-
}),
|
|
124
|
-
components,
|
|
125
|
-
template,
|
|
126
|
-
}))
|
|
127
|
-
.add('with zoom and scroll', () => ({
|
|
128
|
-
props: generateProps({
|
|
129
|
-
data: [
|
|
130
|
-
{
|
|
131
|
-
name: 'Time Series',
|
|
132
|
-
data: generateTimeSeries(),
|
|
133
|
-
},
|
|
134
|
-
],
|
|
135
|
-
option: {
|
|
136
|
-
xAxis: {
|
|
137
|
-
type: 'time',
|
|
138
|
-
name: 'Time',
|
|
139
|
-
axisLabel: {
|
|
140
|
-
formatter: timeSeriesDateFormatter,
|
|
141
|
-
},
|
|
142
|
-
},
|
|
143
|
-
dataZoom: [
|
|
144
|
-
{
|
|
145
|
-
startValue: '2018-03-01T00:00:00.000',
|
|
146
|
-
},
|
|
147
|
-
],
|
|
110
|
+
export const WithZoomAndScroll = Template.bind({});
|
|
111
|
+
WithZoomAndScroll.args = generateProps({
|
|
112
|
+
data: [
|
|
113
|
+
{
|
|
114
|
+
name: 'Time Series',
|
|
115
|
+
data: generateTimeSeries(),
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
option: {
|
|
119
|
+
xAxis: {
|
|
120
|
+
type: 'time',
|
|
121
|
+
name: 'Time',
|
|
122
|
+
axisLabel: {
|
|
123
|
+
formatter: timeSeriesDateFormatter,
|
|
148
124
|
},
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
.add('with toolbox', () => ({
|
|
154
|
-
props: generateProps({
|
|
155
|
-
option: {
|
|
156
|
-
xAxis: {
|
|
157
|
-
name: 'Time',
|
|
158
|
-
type: 'category',
|
|
159
|
-
},
|
|
160
|
-
toolbox,
|
|
125
|
+
},
|
|
126
|
+
dataZoom: [
|
|
127
|
+
{
|
|
128
|
+
startValue: '2018-03-01T00:00:00.000',
|
|
161
129
|
},
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
130
|
+
],
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
export const WithToolbox = Template.bind({});
|
|
135
|
+
WithToolbox.args = generateProps({
|
|
136
|
+
option: {
|
|
137
|
+
xAxis: {
|
|
138
|
+
name: 'Time',
|
|
139
|
+
type: 'category',
|
|
140
|
+
},
|
|
141
|
+
toolbox,
|
|
142
|
+
},
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
export const MultSeries = Template.bind({});
|
|
146
|
+
MultSeries.args = generateProps({
|
|
147
|
+
data: times(10, (index) => ({
|
|
148
|
+
name: index,
|
|
149
|
+
data: defaultData[0].data.map(([label, value]) => [label, value * index]),
|
|
150
|
+
})),
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
export default {
|
|
154
|
+
title: 'charts/area-chart',
|
|
155
|
+
component: GlAreaChart,
|
|
156
|
+
parameters: {
|
|
157
|
+
knobs: { disable: true },
|
|
158
|
+
},
|
|
159
|
+
argTypes: {
|
|
160
|
+
...disableControls([
|
|
161
|
+
'showToolbox',
|
|
162
|
+
'toolboxZoomIconPath',
|
|
163
|
+
'toolboxBackIconPath',
|
|
164
|
+
'toolboxRestoreIconPath',
|
|
165
|
+
'toolboxSaveAsImageIconPath',
|
|
166
|
+
'dataSeries',
|
|
167
|
+
'formatTooltipText',
|
|
168
|
+
'legendAverageText',
|
|
169
|
+
'legendMaxText',
|
|
170
|
+
'legendMinText',
|
|
171
|
+
'legendCurrentText',
|
|
172
|
+
'legendLayout',
|
|
173
|
+
]),
|
|
174
|
+
},
|
|
175
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { GlBarChart } from '../../../charts';
|
|
2
|
+
import { disableControls } from '../../../utils/stories_utils';
|
|
2
3
|
import readme from './bar.md';
|
|
3
4
|
|
|
4
5
|
const Template = (args, { argTypes }) => ({
|
|
@@ -49,11 +50,13 @@ export default {
|
|
|
49
50
|
title: 'charts/bar-chart',
|
|
50
51
|
component: GlBarChart,
|
|
51
52
|
argTypes: {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
...disableControls([
|
|
54
|
+
'showToolbox',
|
|
55
|
+
'toolboxZoomIconPath',
|
|
56
|
+
'toolboxBackIconPath',
|
|
57
|
+
'toolboxRestoreIconPath',
|
|
58
|
+
'toolboxSaveAsImageIconPath',
|
|
59
|
+
]),
|
|
57
60
|
},
|
|
58
61
|
parameters: {
|
|
59
62
|
knobs: { disable: true },
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { GlHeatmap } from '../../../charts';
|
|
2
|
-
import { documentedStoriesOf } from '../../../../documentation/documented_stories';
|
|
3
2
|
import { toolbox } from '../../../utils/charts/story_config';
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
const components = {
|
|
7
|
-
GlHeatmap,
|
|
8
|
-
};
|
|
3
|
+
import { disableControls } from '../../../utils/stories_utils';
|
|
9
4
|
|
|
10
5
|
function generateData() {
|
|
11
6
|
let data = [
|
|
@@ -21,46 +16,65 @@ function generateData() {
|
|
|
21
16
|
return data;
|
|
22
17
|
}
|
|
23
18
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
data() {
|
|
27
|
-
return {
|
|
28
|
-
data: generateData(),
|
|
29
|
-
xAxisLabels: ['12', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11'],
|
|
30
|
-
yAxisLabels: ['Sat', 'Fri', 'Thu', 'Wed', 'Tue', 'Mon', 'Sun'],
|
|
31
|
-
xAxisName: 'Hour',
|
|
32
|
-
yAxisName: 'Day',
|
|
33
|
-
};
|
|
34
|
-
},
|
|
35
|
-
components,
|
|
36
|
-
template: `<gl-heatmap
|
|
37
|
-
:data-series="data"
|
|
38
|
-
:x-axis-labels="xAxisLabels"
|
|
39
|
-
:y-axis-labels="yAxisLabels"
|
|
40
|
-
:x-axis-name="xAxisName"
|
|
41
|
-
:y-axis-name="yAxisName"
|
|
42
|
-
/>`,
|
|
43
|
-
}))
|
|
44
|
-
.add('with toolbox', () => ({
|
|
45
|
-
data() {
|
|
46
|
-
return {
|
|
47
|
-
data: generateData(),
|
|
48
|
-
xAxisLabels: ['12', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11'],
|
|
49
|
-
yAxisLabels: ['Sat', 'Fri', 'Thu', 'Wed', 'Tue', 'Mon', 'Sun'],
|
|
50
|
-
xAxisName: 'Hour',
|
|
51
|
-
yAxisName: 'Day',
|
|
52
|
-
option: {
|
|
53
|
-
toolbox,
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
},
|
|
57
|
-
components,
|
|
58
|
-
template: `<gl-heatmap
|
|
19
|
+
const template = `
|
|
20
|
+
<gl-heatmap
|
|
59
21
|
:data-series="data"
|
|
60
22
|
:x-axis-labels="xAxisLabels"
|
|
61
23
|
:y-axis-labels="yAxisLabels"
|
|
62
24
|
:x-axis-name="xAxisName"
|
|
63
25
|
:y-axis-name="yAxisName"
|
|
64
|
-
:options="
|
|
65
|
-
|
|
66
|
-
|
|
26
|
+
:options="options"
|
|
27
|
+
/>
|
|
28
|
+
`;
|
|
29
|
+
|
|
30
|
+
const generateProps = ({
|
|
31
|
+
data = generateData(),
|
|
32
|
+
xAxisLabels = ['12', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11'],
|
|
33
|
+
yAxisLabels = ['Sat', 'Fri', 'Thu', 'Wed', 'Tue', 'Mon', 'Sun'],
|
|
34
|
+
xAxisName = 'Hour',
|
|
35
|
+
yAxisName = 'Day',
|
|
36
|
+
options = {},
|
|
37
|
+
} = {}) => ({
|
|
38
|
+
data,
|
|
39
|
+
xAxisLabels,
|
|
40
|
+
yAxisLabels,
|
|
41
|
+
xAxisName,
|
|
42
|
+
yAxisName,
|
|
43
|
+
options,
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const Template = (args, { argTypes }) => ({
|
|
47
|
+
components: {
|
|
48
|
+
GlHeatmap,
|
|
49
|
+
},
|
|
50
|
+
props: Object.keys(argTypes),
|
|
51
|
+
template,
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
export const Default = Template.bind({});
|
|
55
|
+
Default.args = generateProps();
|
|
56
|
+
|
|
57
|
+
export const WithToolbox = Template.bind({});
|
|
58
|
+
WithToolbox.args = generateProps({ options: { toolbox } });
|
|
59
|
+
|
|
60
|
+
export default {
|
|
61
|
+
title: 'charts/heatmap',
|
|
62
|
+
component: GlHeatmap,
|
|
63
|
+
parameters: {
|
|
64
|
+
knobs: { disable: true },
|
|
65
|
+
},
|
|
66
|
+
argTypes: {
|
|
67
|
+
...disableControls([
|
|
68
|
+
'showToolbox',
|
|
69
|
+
'toolboxZoomIconPath',
|
|
70
|
+
'toolboxBackIconPath',
|
|
71
|
+
'toolboxRestoreIconPath',
|
|
72
|
+
'toolboxSaveAsImageIconPath',
|
|
73
|
+
'dataSeries',
|
|
74
|
+
'formatTooltipText',
|
|
75
|
+
'legendAverageText',
|
|
76
|
+
'legendMaxText',
|
|
77
|
+
'responsive',
|
|
78
|
+
]),
|
|
79
|
+
},
|
|
80
|
+
};
|