@gitlab/ui 37.0.0 → 37.1.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/base/drawer/drawer.documentation.js +1 -1
- package/dist/components/base/pagination/pagination.js +1 -0
- package/dist/components/base/path/data.js +2 -1
- package/dist/components/base/path/path.js +5 -4
- package/dist/components/base/tabs/tab/tab.js +4 -0
- package/dist/components/base/tabs/tabs/tabs.documentation.js +2 -14
- package/dist/components/base/tabs/tabs/tabs.js +8 -0
- package/dist/components/charts/legend/legend.js +12 -0
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/documentation/components_documentation.js +0 -2
- package/documentation/documented_stories.js +3 -0
- package/package.json +1 -1
- package/src/components/base/drawer/drawer.documentation.js +1 -1
- package/src/components/base/pagination/pagination.spec.js +3 -0
- package/src/components/base/pagination/pagination.vue +1 -0
- package/src/components/base/path/__snapshots__/path.spec.js.snap +6 -0
- package/src/components/base/path/data.js +1 -0
- package/src/components/base/path/path.scss +6 -1
- package/src/components/base/path/path.spec.js +8 -0
- package/src/components/base/path/path.vue +10 -4
- package/src/components/base/tabs/tab/tab.vue +4 -0
- package/src/components/base/tabs/tabs/tabs.documentation.js +0 -12
- package/src/components/base/tabs/tabs/tabs.md +2 -7
- package/src/components/base/tabs/tabs/tabs.stories.js +221 -161
- package/src/components/base/tabs/tabs/tabs.vue +6 -0
- package/src/components/charts/legend/legend.stories.js +22 -15
- package/src/components/charts/legend/legend.vue +9 -0
- package/dist/components/base/tabs/tab/examples/index.js +0 -13
- package/dist/components/base/tabs/tab/examples/tab.basic.example.js +0 -38
- package/dist/components/base/tabs/tab/tab.documentation.js +0 -18
- package/dist/components/base/tabs/tabs/examples/index.js +0 -60
- package/dist/components/base/tabs/tabs/examples/tabs.basic.example.js +0 -38
- package/dist/components/base/tabs/tabs/examples/tabs.contentless_tab.example.js +0 -38
- package/dist/components/base/tabs/tabs/examples/tabs.counterbadges.example.js +0 -38
- package/dist/components/base/tabs/tabs/examples/tabs.custom_title.example.js +0 -38
- package/dist/components/base/tabs/tabs/examples/tabs.disabled.example.js +0 -38
- package/dist/components/base/tabs/tabs/examples/tabs.justified.example.js +0 -38
- package/dist/components/base/tabs/tabs/examples/tabs.no_tabs.example.js +0 -38
- package/dist/components/base/tabs/tabs/examples/tabs.scrollable.example.js +0 -47
- package/dist/components/base/tabs/tabs/examples/tabs.styles_only.example.js +0 -38
- package/dist/components/charts/legend/examples/index.js +0 -22
- package/dist/components/charts/legend/examples/legend.basic.example.js +0 -93
- package/dist/components/charts/legend/examples/legend.toggled.example.js +0 -100
- package/dist/components/charts/legend/legend.documentation.js +0 -21
- package/src/components/base/tabs/tab/examples/index.js +0 -15
- package/src/components/base/tabs/tab/examples/tab.basic.example.vue +0 -5
- package/src/components/base/tabs/tab/tab.documentation.js +0 -16
- package/src/components/base/tabs/tab/tab.md +0 -3
- package/src/components/base/tabs/tab/tab.stories.js +0 -12
- package/src/components/base/tabs/tabs/examples/index.js +0 -72
- package/src/components/base/tabs/tabs/examples/tabs.basic.example.vue +0 -6
- package/src/components/base/tabs/tabs/examples/tabs.contentless_tab.example.vue +0 -17
- package/src/components/base/tabs/tabs/examples/tabs.counterbadges.example.vue +0 -28
- package/src/components/base/tabs/tabs/examples/tabs.custom_title.example.vue +0 -9
- package/src/components/base/tabs/tabs/examples/tabs.disabled.example.vue +0 -7
- package/src/components/base/tabs/tabs/examples/tabs.justified.example.vue +0 -6
- package/src/components/base/tabs/tabs/examples/tabs.no_tabs.example.vue +0 -8
- package/src/components/base/tabs/tabs/examples/tabs.scrollable.example.vue +0 -20
- package/src/components/base/tabs/tabs/examples/tabs.styles_only.example.vue +0 -22
- package/src/components/charts/legend/examples/index.js +0 -27
- package/src/components/charts/legend/examples/legend.basic.example.vue +0 -55
- package/src/components/charts/legend/examples/legend.toggled.example.vue +0 -60
- package/src/components/charts/legend/legend.documentation.js +0 -19
- package/src/components/charts/legend/legend.md +0 -0
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
2
|
-
|
|
3
|
-
var script = {
|
|
4
|
-
data() {
|
|
5
|
-
return {
|
|
6
|
-
chart: null,
|
|
7
|
-
options: {
|
|
8
|
-
legend: {
|
|
9
|
-
show: false
|
|
10
|
-
},
|
|
11
|
-
xAxis: {
|
|
12
|
-
type: 'category',
|
|
13
|
-
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
|
|
14
|
-
},
|
|
15
|
-
yAxis: {
|
|
16
|
-
type: 'value'
|
|
17
|
-
},
|
|
18
|
-
// Generate the series with generateSeriesData() after
|
|
19
|
-
// https://gitlab.com/gitlab-org/gitlab-ui/-/issues/754
|
|
20
|
-
// gets implemented
|
|
21
|
-
series: [{
|
|
22
|
-
color: '#1f75cb',
|
|
23
|
-
data: [820, 932, 960, 1150, 1290, 1330, 1390],
|
|
24
|
-
name: 'Series 1',
|
|
25
|
-
showSymbol: true,
|
|
26
|
-
type: 'line'
|
|
27
|
-
}, {
|
|
28
|
-
color: '#108548',
|
|
29
|
-
data: [1640, 1864, 1920, 2300, 2580, 2660, 2780],
|
|
30
|
-
name: 'Series 2',
|
|
31
|
-
showSymbol: true,
|
|
32
|
-
type: 'line'
|
|
33
|
-
}]
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
computed: {
|
|
39
|
-
seriesData() {
|
|
40
|
-
return this.options.series.map(series => ({
|
|
41
|
-
type: 'solid',
|
|
42
|
-
name: series.name,
|
|
43
|
-
color: series.color,
|
|
44
|
-
data: series.data
|
|
45
|
-
}));
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
},
|
|
49
|
-
methods: {
|
|
50
|
-
onCreated(chart) {
|
|
51
|
-
this.chart = chart;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
/* script */
|
|
58
|
-
const __vue_script__ = script;
|
|
59
|
-
|
|
60
|
-
/* template */
|
|
61
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('gl-chart',{attrs:{"options":_vm.options},on:{"created":_vm.onCreated}}),_vm._v(" "),(_vm.chart)?_c('gl-chart-legend',{attrs:{"chart":_vm.chart,"series-info":_vm.seriesData}}):_vm._e()],1)};
|
|
62
|
-
var __vue_staticRenderFns__ = [];
|
|
63
|
-
|
|
64
|
-
/* style */
|
|
65
|
-
const __vue_inject_styles__ = undefined;
|
|
66
|
-
/* scoped */
|
|
67
|
-
const __vue_scope_id__ = undefined;
|
|
68
|
-
/* module identifier */
|
|
69
|
-
const __vue_module_identifier__ = undefined;
|
|
70
|
-
/* functional template */
|
|
71
|
-
const __vue_is_functional_template__ = false;
|
|
72
|
-
/* style inject */
|
|
73
|
-
|
|
74
|
-
/* style inject SSR */
|
|
75
|
-
|
|
76
|
-
/* style inject shadow dom */
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const __vue_component__ = __vue_normalize__(
|
|
81
|
-
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
82
|
-
__vue_inject_styles__,
|
|
83
|
-
__vue_script__,
|
|
84
|
-
__vue_scope_id__,
|
|
85
|
-
__vue_is_functional_template__,
|
|
86
|
-
__vue_module_identifier__,
|
|
87
|
-
false,
|
|
88
|
-
undefined,
|
|
89
|
-
undefined,
|
|
90
|
-
undefined
|
|
91
|
-
);
|
|
92
|
-
|
|
93
|
-
export default __vue_component__;
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
2
|
-
|
|
3
|
-
var script = {
|
|
4
|
-
data() {
|
|
5
|
-
return {
|
|
6
|
-
chart: null,
|
|
7
|
-
options: {
|
|
8
|
-
legend: {
|
|
9
|
-
show: false
|
|
10
|
-
},
|
|
11
|
-
xAxis: {
|
|
12
|
-
type: 'category',
|
|
13
|
-
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
|
|
14
|
-
},
|
|
15
|
-
yAxis: {
|
|
16
|
-
type: 'value'
|
|
17
|
-
},
|
|
18
|
-
// Generate the series with generateSeriesData() after
|
|
19
|
-
// https://gitlab.com/gitlab-org/gitlab-ui/-/issues/754
|
|
20
|
-
// gets implemented
|
|
21
|
-
series: [{
|
|
22
|
-
color: '#1f75cb',
|
|
23
|
-
data: [820, 932, 960, 1150, 1290, 1330, 1390],
|
|
24
|
-
name: 'Toggled Series 1',
|
|
25
|
-
showSymbol: true,
|
|
26
|
-
type: 'line'
|
|
27
|
-
}, {
|
|
28
|
-
color: '#108548',
|
|
29
|
-
data: [1640, 1864, 1920, 2300, 2580, 2660, 2780],
|
|
30
|
-
name: 'Series 2',
|
|
31
|
-
showSymbol: true,
|
|
32
|
-
type: 'line'
|
|
33
|
-
}]
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
computed: {
|
|
39
|
-
seriesData() {
|
|
40
|
-
return this.options.series.map(series => ({
|
|
41
|
-
type: 'solid',
|
|
42
|
-
name: series.name,
|
|
43
|
-
color: series.color,
|
|
44
|
-
data: series.data
|
|
45
|
-
}));
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
mounted() {
|
|
51
|
-
this.$nextTick(() => {
|
|
52
|
-
document.querySelector('#js-chart-legend [role=button]').click();
|
|
53
|
-
});
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
methods: {
|
|
57
|
-
onCreated(chart) {
|
|
58
|
-
this.chart = chart;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
/* script */
|
|
65
|
-
const __vue_script__ = script;
|
|
66
|
-
|
|
67
|
-
/* template */
|
|
68
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('gl-chart',{attrs:{"options":_vm.options},on:{"created":_vm.onCreated}}),_vm._v(" "),(_vm.chart)?_c('gl-chart-legend',{attrs:{"id":"js-chart-legend","chart":_vm.chart,"series-info":_vm.seriesData}}):_vm._e()],1)};
|
|
69
|
-
var __vue_staticRenderFns__ = [];
|
|
70
|
-
|
|
71
|
-
/* style */
|
|
72
|
-
const __vue_inject_styles__ = undefined;
|
|
73
|
-
/* scoped */
|
|
74
|
-
const __vue_scope_id__ = undefined;
|
|
75
|
-
/* module identifier */
|
|
76
|
-
const __vue_module_identifier__ = undefined;
|
|
77
|
-
/* functional template */
|
|
78
|
-
const __vue_is_functional_template__ = false;
|
|
79
|
-
/* style inject */
|
|
80
|
-
|
|
81
|
-
/* style inject SSR */
|
|
82
|
-
|
|
83
|
-
/* style inject shadow dom */
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
const __vue_component__ = __vue_normalize__(
|
|
88
|
-
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
89
|
-
__vue_inject_styles__,
|
|
90
|
-
__vue_script__,
|
|
91
|
-
__vue_scope_id__,
|
|
92
|
-
__vue_is_functional_template__,
|
|
93
|
-
__vue_module_identifier__,
|
|
94
|
-
false,
|
|
95
|
-
undefined,
|
|
96
|
-
undefined,
|
|
97
|
-
undefined
|
|
98
|
-
);
|
|
99
|
-
|
|
100
|
-
export default __vue_component__;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import examples from './examples';
|
|
2
|
-
|
|
3
|
-
var description = "";
|
|
4
|
-
|
|
5
|
-
var legend_documentation = {
|
|
6
|
-
description,
|
|
7
|
-
examples,
|
|
8
|
-
propsInfo: {
|
|
9
|
-
averageText: {
|
|
10
|
-
additionalInfo: 'Text for data average (overridden by prop if needed for internationalization)'
|
|
11
|
-
},
|
|
12
|
-
maxText: {
|
|
13
|
-
additionalInfo: 'Text for max amount (overridden by prop if needed for internationalization)'
|
|
14
|
-
},
|
|
15
|
-
layout: {
|
|
16
|
-
additionalInfo: 'Sets the display layout'
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export default legend_documentation;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import examples from './examples';
|
|
2
|
-
import description from './tab.md';
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
description,
|
|
6
|
-
examples,
|
|
7
|
-
bootstrapComponent: 'b-tab',
|
|
8
|
-
followsDesignSystem: true,
|
|
9
|
-
propsInfo: {
|
|
10
|
-
queryParamValue: {
|
|
11
|
-
additionalInfo:
|
|
12
|
-
'Query string parameter value to use when `gl-tabs` `sync-active-tab-with-query-params` prop is set to `true`.',
|
|
13
|
-
type: String,
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { documentedStoriesOf } from '../../../../../documentation/documented_stories';
|
|
2
|
-
|
|
3
|
-
const template = `
|
|
4
|
-
<div>
|
|
5
|
-
<h3>The Tab component should not be used on its own</h3>
|
|
6
|
-
<p><code><gl-tab /></code> can only be used with <code><gl-tabs /></code> as the immediate parent</p>
|
|
7
|
-
</div>
|
|
8
|
-
`;
|
|
9
|
-
|
|
10
|
-
documentedStoriesOf('base/tabs/tab', '').add('default', () => ({
|
|
11
|
-
template,
|
|
12
|
-
}));
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import BasicTabsExample from './tabs.basic.example.vue';
|
|
2
|
-
import ContentlessTabExample from './tabs.contentless_tab.example.vue';
|
|
3
|
-
import TabsWithCounterBadgesExample from './tabs.counterbadges.example.vue';
|
|
4
|
-
import CustomTitleExample from './tabs.custom_title.example.vue';
|
|
5
|
-
import DisabledTabExample from './tabs.disabled.example.vue';
|
|
6
|
-
import JustifiedTabsExample from './tabs.justified.example.vue';
|
|
7
|
-
import NoTabsExample from './tabs.no_tabs.example.vue';
|
|
8
|
-
import TabsScrollableExample from './tabs.scrollable.example.vue';
|
|
9
|
-
import TabsStylesOnlyExample from './tabs.styles_only.example.vue';
|
|
10
|
-
|
|
11
|
-
export default [
|
|
12
|
-
{
|
|
13
|
-
name: 'Basic',
|
|
14
|
-
items: [
|
|
15
|
-
{
|
|
16
|
-
id: 'tabs-basic',
|
|
17
|
-
name: 'Basic',
|
|
18
|
-
description: 'Basic Tabs',
|
|
19
|
-
component: BasicTabsExample,
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
id: 'tabs-disabled',
|
|
23
|
-
name: 'Disabled',
|
|
24
|
-
description: 'Disabled Tab',
|
|
25
|
-
component: DisabledTabExample,
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
id: 'tabs-custom-title',
|
|
29
|
-
name: 'Custom Title',
|
|
30
|
-
description: 'Custom Title Tab',
|
|
31
|
-
component: CustomTitleExample,
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
id: 'tabs-contentless-tab',
|
|
35
|
-
name: 'Contentless Tab',
|
|
36
|
-
description: 'Contentless Tab',
|
|
37
|
-
component: ContentlessTabExample,
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
id: 'tabs-no-tabs',
|
|
41
|
-
name: 'Empty state when no tabs',
|
|
42
|
-
description: 'Empty state/content for when there are no tabs',
|
|
43
|
-
component: NoTabsExample,
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
id: 'tabs-with-counter-badges',
|
|
47
|
-
name: 'Tabs with counter badges',
|
|
48
|
-
component: TabsWithCounterBadgesExample,
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
id: 'tabs-styles-only',
|
|
52
|
-
name: 'Tabs styles only',
|
|
53
|
-
component: TabsStylesOnlyExample,
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
id: 'justified-tabs',
|
|
57
|
-
name: 'Justified tabs',
|
|
58
|
-
component: JustifiedTabsExample,
|
|
59
|
-
},
|
|
60
|
-
],
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
name: 'Scrollable',
|
|
64
|
-
items: [
|
|
65
|
-
{
|
|
66
|
-
id: 'tabs-scrollable',
|
|
67
|
-
name: 'Scrollable tabs with lots of tabs',
|
|
68
|
-
component: TabsScrollableExample,
|
|
69
|
-
},
|
|
70
|
-
],
|
|
71
|
-
},
|
|
72
|
-
];
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<gl-tabs>
|
|
3
|
-
<gl-tab title="Regular tab">
|
|
4
|
-
<p>Regular tab content.</p>
|
|
5
|
-
<p>
|
|
6
|
-
The contentless tab is not selectable, as it has no content. This is useful for displaying
|
|
7
|
-
things that aren't really tabs after the list of tabs.
|
|
8
|
-
</p>
|
|
9
|
-
</gl-tab>
|
|
10
|
-
<gl-tab title="Another tab">
|
|
11
|
-
<p>Another tab's content.</p>
|
|
12
|
-
</gl-tab>
|
|
13
|
-
<template #tabs-end>
|
|
14
|
-
<li class="nav-item align-self-center">Contentless tab</li>
|
|
15
|
-
</template>
|
|
16
|
-
</gl-tabs>
|
|
17
|
-
</template>
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<gl-tabs>
|
|
3
|
-
<gl-tab>
|
|
4
|
-
<template #title>
|
|
5
|
-
<span>Tab</span>
|
|
6
|
-
<gl-badge size="sm" class="gl-tab-counter-badge">500</gl-badge>
|
|
7
|
-
<span class="sr-only">items</span>
|
|
8
|
-
</template>
|
|
9
|
-
Tab panel 1
|
|
10
|
-
</gl-tab>
|
|
11
|
-
<gl-tab>
|
|
12
|
-
<template #title>
|
|
13
|
-
<span>Tab</span>
|
|
14
|
-
<gl-badge size="sm" class="gl-tab-counter-badge">250</gl-badge>
|
|
15
|
-
<span class="sr-only">items</span>
|
|
16
|
-
</template>
|
|
17
|
-
Tab panel 2
|
|
18
|
-
</gl-tab>
|
|
19
|
-
<gl-tab>
|
|
20
|
-
<template #title>
|
|
21
|
-
<span>Tab</span>
|
|
22
|
-
<gl-badge size="sm" class="gl-tab-counter-badge">250</gl-badge>
|
|
23
|
-
<span class="sr-only">items</span>
|
|
24
|
-
</template>
|
|
25
|
-
Tab panel 3
|
|
26
|
-
</gl-tab>
|
|
27
|
-
</gl-tabs>
|
|
28
|
-
</template>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
export default {
|
|
3
|
-
tabs: Array(20)
|
|
4
|
-
.fill(1)
|
|
5
|
-
.map((_, index) => index + 1)
|
|
6
|
-
.map((id) => ({
|
|
7
|
-
id,
|
|
8
|
-
title: `Tab ${id}`,
|
|
9
|
-
content: `Tab panel ${id} content...`,
|
|
10
|
-
})),
|
|
11
|
-
};
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<template>
|
|
15
|
-
<gl-scrollable-tabs>
|
|
16
|
-
<gl-tab v-for="tab in $options.tabs" :key="tab.id" :title="tab.title">
|
|
17
|
-
{{ tab.content }}
|
|
18
|
-
</gl-tab>
|
|
19
|
-
</gl-scrollable-tabs>
|
|
20
|
-
</template>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="tabs gl-tabs">
|
|
3
|
-
<ul role="tablist" class="nav gl-tabs-nav">
|
|
4
|
-
<li role="presentation" class="nav-item">
|
|
5
|
-
<a
|
|
6
|
-
role="tab"
|
|
7
|
-
target="_self"
|
|
8
|
-
href="#"
|
|
9
|
-
class="nav-link gl-tab-nav-item gl-tab-nav-item-active gl-tab-nav-item-active-indigo"
|
|
10
|
-
>Tab 1</a
|
|
11
|
-
>
|
|
12
|
-
</li>
|
|
13
|
-
<li role="presentation" class="nav-item">
|
|
14
|
-
<a role="tab" target="_self" href="#" class="nav-link gl-tab-nav-item">Tab 2</a>
|
|
15
|
-
</li>
|
|
16
|
-
</ul>
|
|
17
|
-
<div class="tab-content gl-tab-content">
|
|
18
|
-
<div role="tabpanel" class="tab-pane active">Tab panel 1</div>
|
|
19
|
-
<div role="tabpanel" class="tab-pane">Tab panel 2</div>
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
22
|
-
</template>
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import LegendBasicExample from './legend.basic.example.vue';
|
|
2
|
-
import LegendToggledExample from './legend.toggled.example.vue';
|
|
3
|
-
|
|
4
|
-
export default [
|
|
5
|
-
{
|
|
6
|
-
name: 'Basic',
|
|
7
|
-
items: [
|
|
8
|
-
{
|
|
9
|
-
id: 'chart-legend-basic',
|
|
10
|
-
name: 'Basic',
|
|
11
|
-
description: 'Basic Chart Legend',
|
|
12
|
-
component: LegendBasicExample,
|
|
13
|
-
},
|
|
14
|
-
],
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
name: 'Toggled',
|
|
18
|
-
items: [
|
|
19
|
-
{
|
|
20
|
-
id: 'chart-legend-toggled',
|
|
21
|
-
name: 'Toggled',
|
|
22
|
-
description: 'Toggled Chart Legend',
|
|
23
|
-
component: LegendToggledExample,
|
|
24
|
-
},
|
|
25
|
-
],
|
|
26
|
-
},
|
|
27
|
-
];
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
export default {
|
|
3
|
-
data() {
|
|
4
|
-
return {
|
|
5
|
-
chart: null,
|
|
6
|
-
options: {
|
|
7
|
-
legend: { show: false },
|
|
8
|
-
xAxis: { type: 'category', data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] },
|
|
9
|
-
yAxis: { type: 'value' },
|
|
10
|
-
// Generate the series with generateSeriesData() after
|
|
11
|
-
// https://gitlab.com/gitlab-org/gitlab-ui/-/issues/754
|
|
12
|
-
// gets implemented
|
|
13
|
-
series: [
|
|
14
|
-
{
|
|
15
|
-
color: '#1f75cb',
|
|
16
|
-
data: [820, 932, 960, 1150, 1290, 1330, 1390],
|
|
17
|
-
name: 'Series 1',
|
|
18
|
-
showSymbol: true,
|
|
19
|
-
type: 'line',
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
color: '#108548',
|
|
23
|
-
data: [1640, 1864, 1920, 2300, 2580, 2660, 2780],
|
|
24
|
-
name: 'Series 2',
|
|
25
|
-
showSymbol: true,
|
|
26
|
-
type: 'line',
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
},
|
|
32
|
-
computed: {
|
|
33
|
-
seriesData() {
|
|
34
|
-
return this.options.series.map((series) => ({
|
|
35
|
-
type: 'solid',
|
|
36
|
-
name: series.name,
|
|
37
|
-
color: series.color,
|
|
38
|
-
data: series.data,
|
|
39
|
-
}));
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
methods: {
|
|
43
|
-
onCreated(chart) {
|
|
44
|
-
this.chart = chart;
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
</script>
|
|
49
|
-
|
|
50
|
-
<template>
|
|
51
|
-
<div>
|
|
52
|
-
<gl-chart :options="options" @created="onCreated" />
|
|
53
|
-
<gl-chart-legend v-if="chart" :chart="chart" :series-info="seriesData" />
|
|
54
|
-
</div>
|
|
55
|
-
</template>
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
export default {
|
|
3
|
-
data() {
|
|
4
|
-
return {
|
|
5
|
-
chart: null,
|
|
6
|
-
options: {
|
|
7
|
-
legend: { show: false },
|
|
8
|
-
xAxis: { type: 'category', data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] },
|
|
9
|
-
yAxis: { type: 'value' },
|
|
10
|
-
// Generate the series with generateSeriesData() after
|
|
11
|
-
// https://gitlab.com/gitlab-org/gitlab-ui/-/issues/754
|
|
12
|
-
// gets implemented
|
|
13
|
-
series: [
|
|
14
|
-
{
|
|
15
|
-
color: '#1f75cb',
|
|
16
|
-
data: [820, 932, 960, 1150, 1290, 1330, 1390],
|
|
17
|
-
name: 'Toggled Series 1',
|
|
18
|
-
showSymbol: true,
|
|
19
|
-
type: 'line',
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
color: '#108548',
|
|
23
|
-
data: [1640, 1864, 1920, 2300, 2580, 2660, 2780],
|
|
24
|
-
name: 'Series 2',
|
|
25
|
-
showSymbol: true,
|
|
26
|
-
type: 'line',
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
},
|
|
32
|
-
computed: {
|
|
33
|
-
seriesData() {
|
|
34
|
-
return this.options.series.map((series) => ({
|
|
35
|
-
type: 'solid',
|
|
36
|
-
name: series.name,
|
|
37
|
-
color: series.color,
|
|
38
|
-
data: series.data,
|
|
39
|
-
}));
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
mounted() {
|
|
43
|
-
this.$nextTick(() => {
|
|
44
|
-
document.querySelector('#js-chart-legend [role=button]').click();
|
|
45
|
-
});
|
|
46
|
-
},
|
|
47
|
-
methods: {
|
|
48
|
-
onCreated(chart) {
|
|
49
|
-
this.chart = chart;
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
};
|
|
53
|
-
</script>
|
|
54
|
-
|
|
55
|
-
<template>
|
|
56
|
-
<div>
|
|
57
|
-
<gl-chart :options="options" @created="onCreated" />
|
|
58
|
-
<gl-chart-legend v-if="chart" id="js-chart-legend" :chart="chart" :series-info="seriesData" />
|
|
59
|
-
</div>
|
|
60
|
-
</template>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import examples from './examples';
|
|
2
|
-
import description from './legend.md';
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
description,
|
|
6
|
-
examples,
|
|
7
|
-
propsInfo: {
|
|
8
|
-
averageText: {
|
|
9
|
-
additionalInfo:
|
|
10
|
-
'Text for data average (overridden by prop if needed for internationalization)',
|
|
11
|
-
},
|
|
12
|
-
maxText: {
|
|
13
|
-
additionalInfo: 'Text for max amount (overridden by prop if needed for internationalization)',
|
|
14
|
-
},
|
|
15
|
-
layout: {
|
|
16
|
-
additionalInfo: 'Sets the display layout',
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
};
|
|
File without changes
|