@gitlab/ui 36.7.1 → 37.2.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 +32 -0
- package/dist/components/base/alert/alert.js +1 -11
- package/dist/components/base/card/card.js +1 -1
- package/dist/components/base/drawer/drawer.documentation.js +1 -1
- package/dist/components/base/form/form_input_group/form_input_group.documentation.js +2 -26
- package/dist/components/base/form/form_input_group/form_input_group.js +7 -0
- package/dist/components/base/loading_icon/loading_icon.js +1 -1
- package/dist/components/base/pagination/pagination.js +23 -2
- package/dist/components/base/path/data.js +2 -1
- package/dist/components/base/path/path.js +14 -7
- 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/area/area.documentation.js +1 -7
- package/dist/components/charts/legend/legend.js +12 -0
- package/dist/components/charts/line/line.documentation.js +2 -5
- package/dist/index.css +2 -2
- package/dist/index.css.map +1 -1
- package/dist/utils/stories_utils.js +13 -1
- package/documentation/components_documentation.js +0 -2
- package/documentation/documented_stories.js +6 -0
- package/package.json +2 -2
- 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/drawer/drawer.documentation.js +1 -1
- package/src/components/base/form/form_input_group/form_input_group.documentation.js +0 -28
- package/src/components/base/form/form_input_group/form_input_group.md +0 -4
- package/src/components/base/form/form_input_group/form_input_group.stories.js +84 -62
- package/src/components/base/form/form_input_group/form_input_group.vue +9 -0
- package/src/components/base/icon/icon.stories.js +2 -5
- package/src/components/base/loading_icon/loading_icon.vue +1 -1
- package/src/components/base/pagination/pagination.spec.js +12 -2
- package/src/components/base/pagination/pagination.vue +23 -6
- 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 +20 -0
- package/src/components/base/path/path.vue +18 -7
- 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 +219 -161
- package/src/components/base/tabs/tabs/tabs.vue +6 -0
- 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.stories.js +13 -16
- package/src/components/charts/legend/legend.stories.js +22 -15
- package/src/components/charts/legend/legend.vue +9 -0
- 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/utils/stories_utils.js +6 -0
- package/src/utils/stories_utils.spec.js +18 -0
- package/dist/components/base/form/form_input_group/examples/form_input_group.basic.example.js +0 -38
- package/dist/components/base/form/form_input_group/examples/form_input_group.predefined_options.example.js +0 -54
- package/dist/components/base/form/form_input_group/examples/form_input_group.predefined_reactive.example.js +0 -55
- package/dist/components/base/form/form_input_group/examples/form_input_group.reactive.example.js +0 -48
- package/dist/components/base/form/form_input_group/examples/index.js +0 -27
- 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/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/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/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/src/components/base/form/form_input_group/examples/form_input_group.basic.example.vue +0 -10
- package/src/components/base/form/form_input_group/examples/form_input_group.predefined_options.example.vue +0 -25
- package/src/components/base/form/form_input_group/examples/form_input_group.predefined_reactive.example.vue +0 -32
- package/src/components/base/form/form_input_group/examples/form_input_group.reactive.example.vue +0 -25
- package/src/components/base/form/form_input_group/examples/index.js +0 -32
- 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/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/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
- 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
|
@@ -1,8 +1,34 @@
|
|
|
1
|
-
import { withKnobs, boolean } from '@storybook/addon-knobs';
|
|
2
1
|
import { range } from 'lodash';
|
|
3
|
-
import { documentedStoriesOf } from '../../../../../documentation/documented_stories';
|
|
4
2
|
import { GlTabs, GlTab, GlScrollableTabs } from '../../../../index';
|
|
5
|
-
import
|
|
3
|
+
import readme from './tabs.md';
|
|
4
|
+
|
|
5
|
+
const components = {
|
|
6
|
+
GlTabs,
|
|
7
|
+
GlTab,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const generateProps = ({
|
|
11
|
+
justified,
|
|
12
|
+
actionPrimary = null,
|
|
13
|
+
actionSecondary = null,
|
|
14
|
+
actionTertiary = null,
|
|
15
|
+
} = {}) => ({
|
|
16
|
+
justified,
|
|
17
|
+
actionPrimary,
|
|
18
|
+
actionSecondary,
|
|
19
|
+
actionTertiary,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const wrap = (template) => `
|
|
23
|
+
<gl-tabs
|
|
24
|
+
:justified="justified"
|
|
25
|
+
:action-primary="actionPrimary"
|
|
26
|
+
:action-secondary="actionSecondary"
|
|
27
|
+
:action-tertiary="actionTertiary"
|
|
28
|
+
>
|
|
29
|
+
${template}
|
|
30
|
+
</gl-tabs>
|
|
31
|
+
`;
|
|
6
32
|
|
|
7
33
|
const ScrollableTabsGenerator = {
|
|
8
34
|
components: {
|
|
@@ -33,167 +59,199 @@ const ScrollableTabsGenerator = {
|
|
|
33
59
|
`,
|
|
34
60
|
};
|
|
35
61
|
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
62
|
+
export const Default = (_args, { argTypes }) => ({
|
|
63
|
+
props: Object.keys(argTypes),
|
|
64
|
+
components,
|
|
65
|
+
template: wrap(`
|
|
66
|
+
<gl-tab title="Tab 1">
|
|
67
|
+
Tab panel 1
|
|
68
|
+
</gl-tab>
|
|
69
|
+
<gl-tab title="Tab 2">
|
|
70
|
+
Tab panel 2
|
|
71
|
+
</gl-tab>
|
|
72
|
+
<gl-tab title="Tab 3">
|
|
73
|
+
Tab panel 3
|
|
74
|
+
</gl-tab>
|
|
75
|
+
<gl-tab title="Tab 4">
|
|
76
|
+
Tab panel 4
|
|
77
|
+
</gl-tab>
|
|
78
|
+
<gl-tab title="Tab 5">
|
|
79
|
+
Tab panel 5
|
|
80
|
+
</gl-tab>
|
|
81
|
+
<gl-tab title="Tab 6">
|
|
82
|
+
Tab panel 6
|
|
83
|
+
</gl-tab>
|
|
84
|
+
<gl-tab title="Tab 7">
|
|
85
|
+
Tab panel 7
|
|
86
|
+
</gl-tab>
|
|
87
|
+
<gl-tab title="Tab 8">
|
|
88
|
+
Tab panel 8
|
|
89
|
+
</gl-tab>
|
|
90
|
+
<gl-tab title="Tab 9">
|
|
91
|
+
Tab panel 9
|
|
92
|
+
</gl-tab>
|
|
93
|
+
<gl-tab title="Tab 10">
|
|
94
|
+
Tab panel 10
|
|
95
|
+
</gl-tab>
|
|
96
|
+
<gl-tab title="Tab 11">
|
|
97
|
+
Tab panel 11
|
|
98
|
+
</gl-tab>
|
|
99
|
+
<gl-tab title="Tab 12">
|
|
100
|
+
Tab panel 12
|
|
101
|
+
</gl-tab>
|
|
102
|
+
<gl-tab title="Tab 13" query-param-value="thirteenth">
|
|
103
|
+
Tab panel 13
|
|
104
|
+
</gl-tab>
|
|
105
|
+
<gl-tab title="Tab 14">
|
|
106
|
+
Tab panel 14
|
|
107
|
+
</gl-tab>`),
|
|
108
|
+
});
|
|
109
|
+
Default.args = generateProps();
|
|
110
|
+
|
|
111
|
+
export const ContentlessTab = (_args, { argTypes }) => ({
|
|
112
|
+
props: Object.keys(argTypes),
|
|
113
|
+
components,
|
|
114
|
+
template: wrap(`
|
|
115
|
+
<gl-tab title="Regular tab">
|
|
116
|
+
<p>Regular tab content.</p>
|
|
117
|
+
<p>The contentless tab is not selectable, as it has no content. This is useful for displaying things that aren't really tabs after the list of tabs.</p>
|
|
118
|
+
</gl-tab>
|
|
119
|
+
<gl-tab title="Another tab">
|
|
120
|
+
<p>Another tab's content.</p>
|
|
121
|
+
</gl-tab>
|
|
122
|
+
<template #tabs-end>
|
|
123
|
+
<li class="gl-tab-nav-item">
|
|
124
|
+
Contentless tab
|
|
125
|
+
</li>
|
|
126
|
+
</template>`),
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
export const EmptyState = (_args, { argTypes }) => ({
|
|
130
|
+
props: Object.keys(argTypes),
|
|
131
|
+
components,
|
|
132
|
+
template: wrap(`
|
|
133
|
+
<template #empty>
|
|
134
|
+
This content is only displayed when there are no tabs. Useful for dynamically added/removed tabs.
|
|
135
|
+
</template>`),
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
export const JustifiedTabs = (_args, { argTypes }) => ({
|
|
139
|
+
props: Object.keys(argTypes),
|
|
140
|
+
components,
|
|
141
|
+
template: wrap(`
|
|
142
|
+
<gl-tab title="Tab 1">
|
|
143
|
+
<p>Tab panel 1</p>
|
|
144
|
+
</gl-tab>
|
|
145
|
+
<gl-tab title="Tab 2">
|
|
146
|
+
<p>Tab panel 2</p>
|
|
147
|
+
</gl-tab>`),
|
|
148
|
+
});
|
|
149
|
+
JustifiedTabs.args = generateProps({ justified: true });
|
|
150
|
+
|
|
151
|
+
export const WithCounterBadges = (_args, { argTypes }) => ({
|
|
152
|
+
props: Object.keys(argTypes),
|
|
153
|
+
components,
|
|
154
|
+
template: wrap(`
|
|
155
|
+
<gl-tab>
|
|
156
|
+
<template #title>
|
|
157
|
+
<span>Tab</span>
|
|
158
|
+
<gl-badge size="sm" class="gl-tab-counter-badge">500</gl-badge>
|
|
159
|
+
<span class="sr-only">items</span>
|
|
160
|
+
</template>
|
|
161
|
+
Tab panel 1
|
|
162
|
+
</gl-tab>
|
|
163
|
+
<gl-tab>
|
|
164
|
+
<template #title>
|
|
165
|
+
<span>Tab</span>
|
|
166
|
+
<gl-badge size="sm" class="gl-tab-counter-badge">250</gl-badge>
|
|
167
|
+
<span class="sr-only">items</span>
|
|
168
|
+
</template>
|
|
169
|
+
Tab panel 2
|
|
170
|
+
</gl-tab>
|
|
171
|
+
<gl-tab>
|
|
172
|
+
<template #title>
|
|
173
|
+
<span>Tab</span>
|
|
174
|
+
</template>
|
|
175
|
+
Tab panel 3
|
|
176
|
+
</gl-tab>`),
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
export const WithActions = (_args, { argTypes }) => ({
|
|
180
|
+
props: Object.keys(argTypes),
|
|
181
|
+
components,
|
|
182
|
+
template: wrap(`
|
|
183
|
+
<gl-tab title="Tab 1">
|
|
184
|
+
Tab panel 1
|
|
185
|
+
</gl-tab>`),
|
|
186
|
+
});
|
|
187
|
+
WithActions.args = generateProps({
|
|
188
|
+
actionPrimary: {
|
|
189
|
+
attributes: {
|
|
190
|
+
variant: 'danger',
|
|
191
|
+
},
|
|
192
|
+
text: 'Primary action',
|
|
40
193
|
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
default: boolean('sync-active-tab-with-query-params', false),
|
|
194
|
+
actionSecondary: {
|
|
195
|
+
attributes: {
|
|
196
|
+
variant: 'success',
|
|
45
197
|
},
|
|
198
|
+
text: 'Secondary action',
|
|
199
|
+
},
|
|
200
|
+
actionTertiary: {
|
|
201
|
+
attributes: {
|
|
202
|
+
variant: 'default',
|
|
203
|
+
},
|
|
204
|
+
text: 'Tertiary action',
|
|
46
205
|
},
|
|
47
206
|
});
|
|
48
207
|
|
|
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
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
<gl-tab title="Tab 12">
|
|
89
|
-
Tab panel 12
|
|
90
|
-
</gl-tab>
|
|
91
|
-
<gl-tab title="Tab 13" query-param-value="thirteenth">
|
|
92
|
-
Tab panel 13
|
|
93
|
-
</gl-tab>
|
|
94
|
-
<gl-tab title="Tab 14">
|
|
95
|
-
Tab panel 14
|
|
96
|
-
</gl-tab>
|
|
97
|
-
</gl-tabs>
|
|
98
|
-
`,
|
|
99
|
-
}))
|
|
100
|
-
.add('contentless tab', () => ({
|
|
101
|
-
...createBaseStory(),
|
|
102
|
-
template: `
|
|
103
|
-
<gl-tabs>
|
|
104
|
-
<gl-tab title="Regular tab">
|
|
105
|
-
<p>Regular tab content.</p>
|
|
106
|
-
<p>The contentless tab is not selectable, as it has no content. This is useful for displaying things that aren't really tabs after the list of tabs.</p>
|
|
107
|
-
</gl-tab>
|
|
108
|
-
<gl-tab title="Another tab">
|
|
109
|
-
<p>Another tab's content.</p>
|
|
110
|
-
</gl-tab>
|
|
111
|
-
<template #tabs-end>
|
|
112
|
-
<li class="gl-tab-nav-item">
|
|
113
|
-
Contentless tab
|
|
114
|
-
</li>
|
|
115
|
-
</template>
|
|
116
|
-
</gl-tabs>
|
|
117
|
-
`,
|
|
118
|
-
}))
|
|
119
|
-
.add('empty state', () => ({
|
|
120
|
-
...createBaseStory(),
|
|
121
|
-
template: `
|
|
122
|
-
<gl-tabs>
|
|
123
|
-
<template #empty>
|
|
124
|
-
This content is only displayed when there are no tabs. Useful for dynamically added/removed tabs.
|
|
125
|
-
</template>
|
|
126
|
-
</gl-tabs>
|
|
127
|
-
`,
|
|
128
|
-
}))
|
|
129
|
-
.add('justified tabs', () => ({
|
|
130
|
-
...createBaseStory(),
|
|
131
|
-
template: `
|
|
132
|
-
<gl-tabs justified>
|
|
133
|
-
<gl-tab title="Tab 1">
|
|
134
|
-
<p>Tab panel 1</p>
|
|
135
|
-
</gl-tab>
|
|
136
|
-
<gl-tab title="Tab 2">
|
|
137
|
-
<p>Tab panel 2</p>
|
|
138
|
-
</gl-tab>
|
|
139
|
-
</gl-tabs>
|
|
140
|
-
`,
|
|
141
|
-
}))
|
|
142
|
-
.add('with counter badges', () => ({
|
|
143
|
-
...createBaseStory(),
|
|
144
|
-
template: `
|
|
145
|
-
<gl-tabs>
|
|
146
|
-
<gl-tab>
|
|
147
|
-
<template #title>
|
|
148
|
-
<span>Tab</span>
|
|
149
|
-
<gl-badge size="sm" class="gl-tab-counter-badge">500</gl-badge>
|
|
150
|
-
<span class="sr-only">items</span>
|
|
151
|
-
</template>
|
|
152
|
-
Tab panel 1
|
|
153
|
-
</gl-tab>
|
|
154
|
-
<gl-tab>
|
|
155
|
-
<template #title>
|
|
156
|
-
<span>Tab</span>
|
|
157
|
-
<gl-badge size="sm" class="gl-tab-counter-badge">250</gl-badge>
|
|
158
|
-
<span class="sr-only">items</span>
|
|
159
|
-
</template>
|
|
160
|
-
Tab panel 2
|
|
161
|
-
</gl-tab>
|
|
162
|
-
<gl-tab>
|
|
163
|
-
<template #title>
|
|
164
|
-
<span>Tab</span>
|
|
165
|
-
</template>
|
|
166
|
-
Tab panel 3
|
|
167
|
-
</gl-tab>
|
|
168
|
-
</gl-tabs>
|
|
169
|
-
`,
|
|
170
|
-
}))
|
|
171
|
-
.add('with scroll', () => ({
|
|
172
|
-
...createBaseStory(),
|
|
173
|
-
components: {
|
|
174
|
-
ScrollableTabsGenerator,
|
|
175
|
-
},
|
|
176
|
-
template: '<scrollable-tabs-generator :count="50" />',
|
|
177
|
-
}))
|
|
178
|
-
.add(
|
|
179
|
-
'with scroll and growing',
|
|
180
|
-
() => ({
|
|
181
|
-
...createBaseStory(),
|
|
182
|
-
components: {
|
|
183
|
-
ScrollableTabsGenerator,
|
|
184
|
-
},
|
|
185
|
-
data() {
|
|
186
|
-
return {
|
|
187
|
-
count: 2,
|
|
188
|
-
intervalId: 0,
|
|
189
|
-
};
|
|
190
|
-
},
|
|
191
|
-
mounted() {
|
|
192
|
-
this.intervalId = setInterval(() => {
|
|
193
|
-
this.count += 1;
|
|
194
|
-
}, 2000);
|
|
208
|
+
export const WithScroll = (_args, { argTypes }) => ({
|
|
209
|
+
props: Object.keys(argTypes),
|
|
210
|
+
components: {
|
|
211
|
+
ScrollableTabsGenerator,
|
|
212
|
+
},
|
|
213
|
+
template: '<scrollable-tabs-generator :count="50" />',
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
export const WithScrollAndGrowing = (_args, { argTypes }) => ({
|
|
217
|
+
props: Object.keys(argTypes),
|
|
218
|
+
components: {
|
|
219
|
+
ScrollableTabsGenerator,
|
|
220
|
+
},
|
|
221
|
+
data() {
|
|
222
|
+
return {
|
|
223
|
+
count: 2,
|
|
224
|
+
intervalId: 0,
|
|
225
|
+
};
|
|
226
|
+
},
|
|
227
|
+
mounted() {
|
|
228
|
+
this.intervalId = setInterval(() => {
|
|
229
|
+
this.count += 1;
|
|
230
|
+
}, 2000);
|
|
231
|
+
},
|
|
232
|
+
template: '<scrollable-tabs-generator :count="count" />',
|
|
233
|
+
});
|
|
234
|
+
WithScrollAndGrowing.parameters = {
|
|
235
|
+
storyshots: { disable: true },
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
export default {
|
|
239
|
+
title: 'base/tabs',
|
|
240
|
+
component: GlTabs,
|
|
241
|
+
subcomponents: { GlTab, GlScrollableTabs },
|
|
242
|
+
parameters: {
|
|
243
|
+
bootstrapComponent: 'b-tabs',
|
|
244
|
+
docs: {
|
|
245
|
+
description: {
|
|
246
|
+
component: readme,
|
|
195
247
|
},
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
argTypes: {
|
|
251
|
+
contentClass: { control: { disable: true } },
|
|
252
|
+
navClass: { control: { disable: true } },
|
|
253
|
+
syncActiveTabWithQueryParams: { control: { disable: true } },
|
|
254
|
+
queryParamName: { control: { disable: true } },
|
|
255
|
+
value: { control: { disable: true } },
|
|
256
|
+
},
|
|
257
|
+
};
|
|
@@ -46,11 +46,17 @@ export default {
|
|
|
46
46
|
required: false,
|
|
47
47
|
default: false,
|
|
48
48
|
},
|
|
49
|
+
/**
|
|
50
|
+
* Sync active tab with query string parameters. Allows for deep linking into specific tabs.
|
|
51
|
+
*/
|
|
49
52
|
syncActiveTabWithQueryParams: {
|
|
50
53
|
type: Boolean,
|
|
51
54
|
required: false,
|
|
52
55
|
default: false,
|
|
53
56
|
},
|
|
57
|
+
/**
|
|
58
|
+
* Name to use for query string parameter.
|
|
59
|
+
*/
|
|
54
60
|
queryParamName: {
|
|
55
61
|
type: String,
|
|
56
62
|
required: false,
|
|
@@ -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
|
};
|