@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,10 +1,9 @@
|
|
|
1
|
-
import { withKnobs, object, boolean, array } from '@storybook/addon-knobs';
|
|
2
1
|
import { GlLineChart } from '../../../charts';
|
|
3
|
-
import { documentedStoriesOf } from '../../../../documentation/documented_stories';
|
|
4
2
|
import { mockAnnotationsSeries, mockAnnotationsConfigs } from '../../../utils/charts/mock_data';
|
|
5
3
|
import { toolbox } from '../../../utils/charts/story_config';
|
|
6
4
|
import { timeSeriesDateFormatter } from '../../../utils/charts/utils';
|
|
7
5
|
import { generateTimeSeries } from '../../../utils/data_utils';
|
|
6
|
+
import { disableControls } from '../../../utils/stories_utils';
|
|
8
7
|
import readme from './line.md';
|
|
9
8
|
|
|
10
9
|
const components = {
|
|
@@ -50,6 +49,7 @@ const defaultData = [
|
|
|
50
49
|
];
|
|
51
50
|
|
|
52
51
|
const defaultOptions = {
|
|
52
|
+
animation: false,
|
|
53
53
|
xAxis: {
|
|
54
54
|
name: 'Time',
|
|
55
55
|
type: 'category',
|
|
@@ -64,127 +64,138 @@ const template = `<gl-line-chart
|
|
|
64
64
|
:includeLegendAvgMax="includeLegendAvgMax"
|
|
65
65
|
/>`;
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
const generateProps = ({
|
|
68
68
|
data = defaultData,
|
|
69
69
|
option = defaultOptions,
|
|
70
70
|
thresholds = [],
|
|
71
71
|
annotations = [],
|
|
72
72
|
includeLegendAvgMax = true,
|
|
73
|
-
} = {}) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
73
|
+
} = {}) => ({
|
|
74
|
+
includeLegendAvgMax,
|
|
75
|
+
option,
|
|
76
|
+
thresholds,
|
|
77
|
+
annotations,
|
|
78
|
+
data,
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
const Template = (_args, { argTypes }) => ({
|
|
82
|
+
props: Object.keys(argTypes),
|
|
83
|
+
components,
|
|
84
|
+
template,
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
export const Default = Template.bind({});
|
|
88
|
+
Default.args = generateProps();
|
|
89
|
+
|
|
90
|
+
export const WithThreshold = Template.bind({});
|
|
91
|
+
WithThreshold.args = generateProps({
|
|
92
|
+
thresholds: [{ threshold: 1350, operator: '>' }],
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
export const WithAnnotationsAsProps = Template.bind({});
|
|
96
|
+
WithAnnotationsAsProps.storyNane = 'with annotations as props (recommended)';
|
|
97
|
+
WithAnnotationsAsProps.args = generateProps({
|
|
98
|
+
...mockAnnotationsConfigs,
|
|
99
|
+
data: [
|
|
100
|
+
{
|
|
101
|
+
name: 'Time Series',
|
|
102
|
+
data: generateTimeSeries(),
|
|
80
103
|
},
|
|
81
|
-
|
|
82
|
-
|
|
104
|
+
],
|
|
105
|
+
option: {
|
|
106
|
+
animation: false,
|
|
107
|
+
xAxis: {
|
|
108
|
+
type: 'time',
|
|
109
|
+
name: 'Time',
|
|
110
|
+
axisLabel: {
|
|
111
|
+
formatter: timeSeriesDateFormatter,
|
|
112
|
+
},
|
|
83
113
|
},
|
|
84
|
-
|
|
85
|
-
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
export const WithAnnotationsAsOptionSeries = Template.bind({});
|
|
118
|
+
WithAnnotationsAsOptionSeries.args = generateProps({
|
|
119
|
+
data: [
|
|
120
|
+
{
|
|
121
|
+
name: 'Time Series',
|
|
122
|
+
data: generateTimeSeries(),
|
|
86
123
|
},
|
|
87
|
-
|
|
88
|
-
|
|
124
|
+
],
|
|
125
|
+
option: {
|
|
126
|
+
...mockAnnotationsSeries,
|
|
127
|
+
animation: false,
|
|
128
|
+
xAxis: {
|
|
129
|
+
type: 'time',
|
|
130
|
+
name: 'Time',
|
|
131
|
+
axisLabel: {
|
|
132
|
+
formatter: timeSeriesDateFormatter,
|
|
133
|
+
},
|
|
89
134
|
},
|
|
90
|
-
}
|
|
91
|
-
}
|
|
135
|
+
},
|
|
136
|
+
});
|
|
92
137
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
props: generateProps({
|
|
109
|
-
...mockAnnotationsConfigs,
|
|
110
|
-
data: [
|
|
111
|
-
{
|
|
112
|
-
name: 'Time Series',
|
|
113
|
-
data: generateTimeSeries(),
|
|
114
|
-
},
|
|
115
|
-
],
|
|
116
|
-
option: {
|
|
117
|
-
xAxis: {
|
|
118
|
-
type: 'time',
|
|
119
|
-
name: 'Time',
|
|
120
|
-
axisLabel: {
|
|
121
|
-
formatter: timeSeriesDateFormatter,
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
}),
|
|
126
|
-
components,
|
|
127
|
-
template,
|
|
128
|
-
}))
|
|
129
|
-
.add('with annotations as option series', () => ({
|
|
130
|
-
props: generateProps({
|
|
131
|
-
data: [
|
|
132
|
-
{
|
|
133
|
-
name: 'Time Series',
|
|
134
|
-
data: generateTimeSeries(),
|
|
135
|
-
},
|
|
136
|
-
],
|
|
137
|
-
option: {
|
|
138
|
-
...mockAnnotationsSeries,
|
|
139
|
-
xAxis: {
|
|
140
|
-
type: 'time',
|
|
141
|
-
name: 'Time',
|
|
142
|
-
axisLabel: {
|
|
143
|
-
formatter: timeSeriesDateFormatter,
|
|
144
|
-
},
|
|
145
|
-
},
|
|
138
|
+
export const WithZoomAndScroll = Template.bind({});
|
|
139
|
+
WithZoomAndScroll.args = generateProps({
|
|
140
|
+
data: [
|
|
141
|
+
{
|
|
142
|
+
name: 'Time Series',
|
|
143
|
+
data: generateTimeSeries(),
|
|
144
|
+
},
|
|
145
|
+
],
|
|
146
|
+
option: {
|
|
147
|
+
animation: false,
|
|
148
|
+
xAxis: {
|
|
149
|
+
type: 'time',
|
|
150
|
+
name: 'Time',
|
|
151
|
+
axisLabel: {
|
|
152
|
+
formatter: timeSeriesDateFormatter,
|
|
146
153
|
},
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
props: generateProps({
|
|
153
|
-
data: [
|
|
154
|
-
{
|
|
155
|
-
name: 'Time Series',
|
|
156
|
-
data: generateTimeSeries(),
|
|
157
|
-
},
|
|
158
|
-
],
|
|
159
|
-
option: {
|
|
160
|
-
xAxis: {
|
|
161
|
-
type: 'time',
|
|
162
|
-
name: 'Time',
|
|
163
|
-
axisLabel: {
|
|
164
|
-
formatter: timeSeriesDateFormatter,
|
|
165
|
-
},
|
|
166
|
-
},
|
|
167
|
-
dataZoom: [
|
|
168
|
-
{
|
|
169
|
-
type: 'slider',
|
|
170
|
-
startValue: '2018-03-01T00:00:00.000',
|
|
171
|
-
},
|
|
172
|
-
],
|
|
154
|
+
},
|
|
155
|
+
dataZoom: [
|
|
156
|
+
{
|
|
157
|
+
type: 'slider',
|
|
158
|
+
startValue: '2018-03-01T00:00:00.000',
|
|
173
159
|
},
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
160
|
+
],
|
|
161
|
+
},
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
export const WithToolbox = Template.bind({});
|
|
165
|
+
WithToolbox.args = generateProps({
|
|
166
|
+
option: {
|
|
167
|
+
animation: false,
|
|
168
|
+
xAxis: {
|
|
169
|
+
name: 'Time',
|
|
170
|
+
type: 'category',
|
|
171
|
+
},
|
|
172
|
+
toolbox,
|
|
173
|
+
},
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
export default {
|
|
177
|
+
title: 'charts/line-chart',
|
|
178
|
+
component: GlLineChart,
|
|
179
|
+
parameters: {
|
|
180
|
+
docs: {
|
|
181
|
+
description: {
|
|
182
|
+
component: readme,
|
|
186
183
|
},
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
argTypes: {
|
|
187
|
+
...disableControls([
|
|
188
|
+
'showToolbox',
|
|
189
|
+
'toolboxZoomIconPath',
|
|
190
|
+
'toolboxBackIconPath',
|
|
191
|
+
'toolboxRestoreIconPath',
|
|
192
|
+
'toolboxSaveAsImageIconPath',
|
|
193
|
+
'formatTooltipText',
|
|
194
|
+
'legendAverageText',
|
|
195
|
+
'legendMaxText',
|
|
196
|
+
'legendMinText',
|
|
197
|
+
'legendCurrentText',
|
|
198
|
+
'legendLayout',
|
|
199
|
+
]),
|
|
200
|
+
},
|
|
201
|
+
};
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { withKnobs, text } from '@storybook/addon-knobs';
|
|
2
1
|
import { GlChartSeriesLabel } from '../../../charts';
|
|
3
|
-
import { documentedStoriesOf } from '../../../../documentation/documented_stories';
|
|
4
2
|
import { colorPaletteDefault } from '../../../utils/charts/theme';
|
|
5
3
|
import {
|
|
6
4
|
SERIES_NAME,
|
|
@@ -10,67 +8,72 @@ import {
|
|
|
10
8
|
} from '../../../utils/stories_utils';
|
|
11
9
|
import readme from './series_label.md';
|
|
12
10
|
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
color
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
type: {
|
|
22
|
-
default: text('Series Type', type),
|
|
23
|
-
},
|
|
11
|
+
const generateProps = ({
|
|
12
|
+
color = colorPaletteDefault[0],
|
|
13
|
+
type = 'solid',
|
|
14
|
+
text = SERIES_NAME[SERIES_NAME_SHORT],
|
|
15
|
+
} = {}) => ({
|
|
16
|
+
color,
|
|
17
|
+
type,
|
|
18
|
+
text,
|
|
24
19
|
});
|
|
25
20
|
|
|
26
|
-
const template =
|
|
21
|
+
const template = `
|
|
22
|
+
<gl-chart-series-label
|
|
27
23
|
:color="color"
|
|
28
24
|
:type="type"
|
|
29
25
|
>
|
|
30
|
-
{{
|
|
26
|
+
{{ text }}
|
|
31
27
|
</gl-chart-series-label>`;
|
|
32
28
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
29
|
+
const Template = (_args, { argTypes }) => ({
|
|
30
|
+
components: {
|
|
31
|
+
GlChartSeriesLabel,
|
|
32
|
+
},
|
|
33
|
+
props: Object.keys(argTypes),
|
|
34
|
+
template,
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export const Default = Template.bind({});
|
|
38
|
+
Default.args = generateProps({ color: '' });
|
|
39
|
+
|
|
40
|
+
export const WithLongName = Template.bind({});
|
|
41
|
+
WithLongName.args = generateProps({ color: '', text: SERIES_NAME[SERIES_NAME_LONG] });
|
|
42
|
+
|
|
43
|
+
export const WithLongNameWithNoSpaces = Template.bind({});
|
|
44
|
+
WithLongNameWithNoSpaces.args = generateProps({
|
|
45
|
+
color: '',
|
|
46
|
+
text: SERIES_NAME[SERIES_NAME_LONG_WITHOUT_SPACES],
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export const WithColorDashed = Template.bind({});
|
|
50
|
+
WithColorDashed.args = generateProps({ type: 'dashed', text: SERIES_NAME[SERIES_NAME_SHORT] });
|
|
51
|
+
|
|
52
|
+
export const WithColor = Template.bind({});
|
|
53
|
+
WithColor.args = generateProps({ text: SERIES_NAME[SERIES_NAME_SHORT] });
|
|
54
|
+
|
|
55
|
+
export const WithColorAndLongName = Template.bind({});
|
|
56
|
+
WithColorAndLongName.args = generateProps({ text: SERIES_NAME[SERIES_NAME_LONG] });
|
|
57
|
+
|
|
58
|
+
export const WithColorAndLongNameWithNoSpaces = Template.bind({});
|
|
59
|
+
WithColorAndLongNameWithNoSpaces.args = generateProps({
|
|
60
|
+
text: SERIES_NAME[SERIES_NAME_LONG_WITHOUT_SPACES],
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
export default {
|
|
64
|
+
title: 'charts/chart-series-label',
|
|
65
|
+
component: GlChartSeriesLabel,
|
|
66
|
+
parameters: {
|
|
67
|
+
knobs: { disable: true },
|
|
68
|
+
docs: {
|
|
69
|
+
description: {
|
|
70
|
+
component: readme,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
argTypes: {
|
|
75
|
+
color: {
|
|
76
|
+
control: 'color',
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
};
|
package/src/scss/utilities.scss
CHANGED
|
@@ -865,6 +865,46 @@
|
|
|
865
865
|
.gl-bg-chevron-down\! {
|
|
866
866
|
background-image: url($gl-icon-chevron-down) !important
|
|
867
867
|
}
|
|
868
|
+
.gl-border {
|
|
869
|
+
border: solid $gl-border-size-1 $border-color;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
.gl-border\! {
|
|
873
|
+
border: solid $gl-border-size-1 $border-color !important;
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
.gl-border-t {
|
|
877
|
+
border-top: solid $gl-border-size-1 $border-color;
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
.gl-border-t\! {
|
|
881
|
+
border-top: solid $gl-border-size-1 $border-color !important;
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
.gl-border-b {
|
|
885
|
+
border-bottom: solid $gl-border-size-1 $border-color;
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
.gl-border-b\! {
|
|
889
|
+
border-bottom: solid $gl-border-size-1 $border-color !important;
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
.gl-border-l {
|
|
893
|
+
border-left: solid $gl-border-size-1 $border-color;
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
.gl-border-l\! {
|
|
897
|
+
border-left: solid $gl-border-size-1 $border-color !important;
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
.gl-border-r {
|
|
901
|
+
border-right: solid $gl-border-size-1 $border-color;
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
.gl-border-r\! {
|
|
905
|
+
border-right: solid $gl-border-size-1 $border-color !important;
|
|
906
|
+
}
|
|
907
|
+
|
|
868
908
|
.gl-border-none {
|
|
869
909
|
border-style: none;
|
|
870
910
|
}
|
|
@@ -3,6 +3,27 @@
|
|
|
3
3
|
*
|
|
4
4
|
* naming convention: gl-border-{position}-{style}
|
|
5
5
|
*/
|
|
6
|
+
|
|
7
|
+
@mixin gl-border {
|
|
8
|
+
border: solid $gl-border-size-1 $border-color;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@mixin gl-border-t {
|
|
12
|
+
border-top: solid $gl-border-size-1 $border-color;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@mixin gl-border-b {
|
|
16
|
+
border-bottom: solid $gl-border-size-1 $border-color;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@mixin gl-border-l {
|
|
20
|
+
border-left: solid $gl-border-size-1 $border-color;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@mixin gl-border-r {
|
|
24
|
+
border-right: solid $gl-border-size-1 $border-color;
|
|
25
|
+
}
|
|
26
|
+
|
|
6
27
|
@mixin gl-border-none {
|
|
7
28
|
border-style: none;
|
|
8
29
|
}
|
package/src/scss/variables.scss
CHANGED
|
@@ -12,3 +12,9 @@ export const SERIES_NAME = {
|
|
|
12
12
|
[SERIES_NAME_LONG_WITHOUT_SPACES]:
|
|
13
13
|
'Series_name_long._Lorem_ipsum_dolor_sit_amet,_consectetur_adipiscing_elit._Sed_tincidunt_interdum_sapien_ut_blandit._Nulla_fermentum_nisi_id_euismod_vulputate._END',
|
|
14
14
|
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Builds the parameters object disable one or multiple controls.
|
|
18
|
+
*/
|
|
19
|
+
export const disableControls = (controls = []) =>
|
|
20
|
+
Object.fromEntries(controls.map((control) => [control, { control: { disable: true } }]));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { disableControls } from './stories_utils';
|
|
2
|
+
|
|
3
|
+
describe('stories utils', () => {
|
|
4
|
+
describe('disableControls', () => {
|
|
5
|
+
const DISABLE_CONTROL_PARAMETER = { control: { disable: true } };
|
|
6
|
+
|
|
7
|
+
it('returns an empty object if no argument is given', () => {
|
|
8
|
+
expect(disableControls()).toEqual({});
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it('returns parameters object when given an array of strings', () => {
|
|
12
|
+
expect(disableControls(['foo', 'bar'])).toEqual({
|
|
13
|
+
foo: DISABLE_CONTROL_PARAMETER,
|
|
14
|
+
bar: DISABLE_CONTROL_PARAMETER,
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
2
|
-
|
|
3
|
-
var script = {
|
|
4
|
-
data() {
|
|
5
|
-
return {
|
|
6
|
-
selected: 'String option',
|
|
7
|
-
options: ['String option', {
|
|
8
|
-
text: 'Object option',
|
|
9
|
-
value: 'object'
|
|
10
|
-
}, {
|
|
11
|
-
html: '<i>HTML</i> option',
|
|
12
|
-
value: 'html'
|
|
13
|
-
}, {
|
|
14
|
-
text: 'Disabled option',
|
|
15
|
-
value: 'disabledOption',
|
|
16
|
-
disabled: true
|
|
17
|
-
}]
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
/* script */
|
|
24
|
-
const __vue_script__ = script;
|
|
25
|
-
|
|
26
|
-
/* template */
|
|
27
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-form-radio-group',{attrs:{"options":_vm.options},model:{value:(_vm.selected),callback:function ($$v) {_vm.selected=$$v;},expression:"selected"}})};
|
|
28
|
-
var __vue_staticRenderFns__ = [];
|
|
29
|
-
|
|
30
|
-
/* style */
|
|
31
|
-
const __vue_inject_styles__ = undefined;
|
|
32
|
-
/* scoped */
|
|
33
|
-
const __vue_scope_id__ = undefined;
|
|
34
|
-
/* module identifier */
|
|
35
|
-
const __vue_module_identifier__ = undefined;
|
|
36
|
-
/* functional template */
|
|
37
|
-
const __vue_is_functional_template__ = false;
|
|
38
|
-
/* style inject */
|
|
39
|
-
|
|
40
|
-
/* style inject SSR */
|
|
41
|
-
|
|
42
|
-
/* style inject shadow dom */
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const __vue_component__ = __vue_normalize__(
|
|
47
|
-
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
48
|
-
__vue_inject_styles__,
|
|
49
|
-
__vue_script__,
|
|
50
|
-
__vue_scope_id__,
|
|
51
|
-
__vue_is_functional_template__,
|
|
52
|
-
__vue_module_identifier__,
|
|
53
|
-
false,
|
|
54
|
-
undefined,
|
|
55
|
-
undefined,
|
|
56
|
-
undefined
|
|
57
|
-
);
|
|
58
|
-
|
|
59
|
-
export default __vue_component__;
|
package/dist/components/base/form/form_radio_group/examples/form_radio_group.slots.example.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
2
|
-
|
|
3
|
-
var script = {
|
|
4
|
-
data() {
|
|
5
|
-
return {
|
|
6
|
-
selected: 'one'
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
/* script */
|
|
13
|
-
const __vue_script__ = script;
|
|
14
|
-
|
|
15
|
-
/* template */
|
|
16
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-form-radio-group',{model:{value:(_vm.selected),callback:function ($$v) {_vm.selected=$$v;},expression:"selected"}},[_c('gl-form-radio',{attrs:{"value":"one"}},[_vm._v("One")]),_vm._v(" "),_c('gl-form-radio',{attrs:{"value":"two"},scopedSlots:_vm._u([{key:"help",fn:function(){return [_vm._v("Help text")]},proxy:true}])},[_vm._v("\n Two\n ")]),_vm._v(" "),_c('gl-form-radio',{attrs:{"value":"three"}},[_vm._v("Three")]),_vm._v(" "),_c('gl-form-radio',{attrs:{"value":"four","disabled":""}},[_vm._v("Disabled option")])],1)};
|
|
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
|
-
__vue_script__,
|
|
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,17 +0,0 @@
|
|
|
1
|
-
import FormRadioGroupOptionsArray from './form_radio_group.options_array.example';
|
|
2
|
-
import FormRadioGroupSlots from './form_radio_group.slots.example';
|
|
3
|
-
|
|
4
|
-
var index = [{
|
|
5
|
-
name: 'Radio Group',
|
|
6
|
-
items: [{
|
|
7
|
-
id: 'form-radio-group-slots',
|
|
8
|
-
name: 'Form Radio Group using Slots',
|
|
9
|
-
component: FormRadioGroupSlots
|
|
10
|
-
}, {
|
|
11
|
-
id: 'form-radio-group-options-array',
|
|
12
|
-
name: 'Form Radio Group using Options Array',
|
|
13
|
-
component: FormRadioGroupOptionsArray
|
|
14
|
-
}]
|
|
15
|
-
}];
|
|
16
|
-
|
|
17
|
-
export default index;
|