@gitlab/ui 33.0.0 → 33.0.1
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/datepicker/datepicker.js +4 -1
- package/dist/components/base/dropdown/dropdown.js +4 -4
- package/dist/components/base/filtered_search/filtered_search.js +5 -2
- package/dist/components/base/filtered_search/filtered_search_token.js +12 -8
- package/dist/components/base/filtered_search/filtered_search_token_segment.js +6 -5
- package/dist/components/base/form/form_checkbox_tree/models/node.js +9 -8
- package/dist/components/base/form/form_checkbox_tree/models/tree.js +21 -10
- package/dist/components/base/form/form_input/form_input.js +14 -4
- package/dist/components/base/form/form_textarea/form_textarea.js +14 -4
- package/dist/components/base/infinite_scroll/infinite_scroll.documentation.js +2 -33
- package/dist/components/base/infinite_scroll/infinite_scroll.js +21 -3
- package/dist/components/base/pagination/pagination.js +2 -1
- package/dist/components/base/path/path.js +6 -5
- package/dist/components/base/segmented_control/segmented_control.js +9 -4
- package/dist/components/base/skeleton_loader/skeleton_loader.js +6 -4
- package/dist/components/base/sorting/sorting_item.js +6 -5
- package/dist/components/base/table/table.js +5 -4
- package/dist/components/base/tabs/tabs/scrollable_tabs.js +6 -5
- package/dist/components/base/toast/toast.js +2 -1
- package/dist/components/base/token_selector/token_container.js +2 -1
- package/dist/components/base/token_selector/token_selector.js +2 -1
- package/dist/components/charts/bar/bar.js +2 -1
- package/dist/components/charts/column/column.documentation.js +1 -7
- package/dist/components/charts/column/column.js +17 -14
- package/dist/components/charts/gauge/gauge.js +45 -42
- package/dist/components/charts/sparkline/sparkline.js +6 -4
- package/dist/components/charts/stacked_column/stacked_column.js +17 -14
- package/dist/components/utilities/friendly_wrap/friendly_wrap.js +4 -3
- package/dist/components/utilities/sprintf/sprintf.js +4 -2
- package/dist/directives/hover_load/hover_load.js +5 -3
- package/dist/directives/outside/outside.js +12 -8
- package/dist/directives/resize_observer/examples/resize_observer.basic.example.js +7 -6
- package/dist/directives/resize_observer/resize_observer.js +12 -8
- package/dist/directives/safe_link/safe_link.js +12 -6
- package/dist/index.css +1 -1
- 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/charts/config.js +95 -72
- package/dist/utils/charts/story_config.js +4 -2
- package/dist/utils/charts/theme.js +106 -103
- package/dist/utils/charts/utils.js +14 -6
- package/dist/utils/number_utils.js +14 -5
- package/dist/utils/use_mock_intersection_observer.js +31 -11
- package/dist/utils/utils.js +15 -4
- package/dist/utils/validation_utils.js +3 -1
- package/documentation/documented_stories.js +2 -0
- package/package.json +13 -12
- package/src/components/base/infinite_scroll/infinite_scroll.documentation.js +0 -38
- package/src/components/base/infinite_scroll/infinite_scroll.md +0 -4
- package/src/components/base/infinite_scroll/infinite_scroll.stories.js +49 -24
- package/src/components/base/infinite_scroll/infinite_scroll.vue +18 -0
- package/src/components/base/search_box_by_click/search_box_by_click.scss +4 -0
- package/src/components/base/search_box_by_type/search_box_by_type.scss +4 -0
- package/src/components/charts/column/column.documentation.js +0 -5
- package/src/components/charts/column/column.stories.js +61 -88
- package/src/scss/utilities.scss +8 -0
- package/src/scss/utility-mixins/sizing.scss +4 -0
- package/dist/components/charts/column/examples/column.basic.example.js +0 -49
- package/dist/components/charts/column/examples/index.js +0 -13
- package/src/components/charts/column/column.md +0 -1
- package/src/components/charts/column/examples/column.basic.example.vue +0 -22
- package/src/components/charts/column/examples/index.js +0 -15
package/dist/utils/utils.js
CHANGED
|
@@ -2,7 +2,11 @@ import { COMMA, labelColorOptions, focusableTags } from './constants';
|
|
|
2
2
|
|
|
3
3
|
function debounceByAnimationFrame(fn) {
|
|
4
4
|
let requestId;
|
|
5
|
-
return function debounced(
|
|
5
|
+
return function debounced() {
|
|
6
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
7
|
+
args[_key] = arguments[_key];
|
|
8
|
+
}
|
|
9
|
+
|
|
6
10
|
if (requestId) {
|
|
7
11
|
window.cancelAnimationFrame(requestId);
|
|
8
12
|
}
|
|
@@ -12,7 +16,11 @@ function debounceByAnimationFrame(fn) {
|
|
|
12
16
|
}
|
|
13
17
|
function throttle(fn) {
|
|
14
18
|
let frameId = null;
|
|
15
|
-
return (
|
|
19
|
+
return function () {
|
|
20
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
21
|
+
args[_key2] = arguments[_key2];
|
|
22
|
+
}
|
|
23
|
+
|
|
16
24
|
if (frameId) {
|
|
17
25
|
return;
|
|
18
26
|
}
|
|
@@ -34,7 +42,8 @@ function rgbFromString(color, sub) {
|
|
|
34
42
|
const [r, g, b] = rgb.map(i => parseInt(i, 10));
|
|
35
43
|
return [r, g, b];
|
|
36
44
|
}
|
|
37
|
-
function hexToRgba(hex
|
|
45
|
+
function hexToRgba(hex) {
|
|
46
|
+
let opacity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
38
47
|
const [r, g, b] = rgbFromHex(hex);
|
|
39
48
|
return `rgba(${r}, ${g}, ${b}, ${opacity})`;
|
|
40
49
|
}
|
|
@@ -103,7 +112,9 @@ function isDev() {
|
|
|
103
112
|
* @param {string} message message to print to the console
|
|
104
113
|
*/
|
|
105
114
|
|
|
106
|
-
function logWarning(
|
|
115
|
+
function logWarning() {
|
|
116
|
+
let message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
117
|
+
|
|
107
118
|
if (message.length && isDev()) {
|
|
108
119
|
console.warn(message); // eslint-disable-line no-console
|
|
109
120
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// Creates out of validation configurations from .documentation.js files and creates a readable string out of it
|
|
2
|
-
const getValidationInfoText = (
|
|
2
|
+
const getValidationInfoText = function () {
|
|
3
|
+
let validation = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
4
|
+
|
|
3
5
|
switch (validation.type) {
|
|
4
6
|
case 'range':
|
|
5
7
|
return `${validation.min}-${validation.max}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "33.0.
|
|
3
|
+
"version": "33.0.1",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
74
|
"@gitlab/svgs": "^1.116.0 || ^2.0.0",
|
|
75
|
-
"emoji-regex": ">=10.0.0",
|
|
76
75
|
"bootstrap": "4.5.3",
|
|
76
|
+
"emoji-regex": ">=10.0.0",
|
|
77
77
|
"pikaday": "^1.8.0",
|
|
78
78
|
"vue": "^2.6.10"
|
|
79
79
|
},
|
|
@@ -85,20 +85,20 @@
|
|
|
85
85
|
"@babel/core": "^7.10.2",
|
|
86
86
|
"@babel/preset-env": "^7.10.2",
|
|
87
87
|
"@gitlab/eslint-plugin": "10.0.1",
|
|
88
|
-
"@gitlab/stylelint-config": "
|
|
88
|
+
"@gitlab/stylelint-config": "3.0.0",
|
|
89
89
|
"@gitlab/svgs": "2.2.0",
|
|
90
90
|
"@rollup/plugin-commonjs": "^11.1.0",
|
|
91
91
|
"@rollup/plugin-node-resolve": "^7.1.3",
|
|
92
92
|
"@rollup/plugin-replace": "^2.3.2",
|
|
93
|
-
"@storybook/addon-a11y": "6.4.
|
|
94
|
-
"@storybook/addon-docs": "6.4.
|
|
95
|
-
"@storybook/addon-essentials": "6.4.
|
|
93
|
+
"@storybook/addon-a11y": "6.4.14",
|
|
94
|
+
"@storybook/addon-docs": "6.4.14",
|
|
95
|
+
"@storybook/addon-essentials": "6.4.14",
|
|
96
96
|
"@storybook/addon-knobs": "6.4.0",
|
|
97
|
-
"@storybook/addon-storyshots": "6.4.
|
|
98
|
-
"@storybook/addon-storyshots-puppeteer": "6.4.
|
|
99
|
-
"@storybook/addon-viewport": "6.4.
|
|
100
|
-
"@storybook/theming": "6.4.
|
|
101
|
-
"@storybook/vue": "6.4.
|
|
97
|
+
"@storybook/addon-storyshots": "6.4.14",
|
|
98
|
+
"@storybook/addon-storyshots-puppeteer": "6.4.14",
|
|
99
|
+
"@storybook/addon-viewport": "6.4.14",
|
|
100
|
+
"@storybook/theming": "6.4.14",
|
|
101
|
+
"@storybook/vue": "6.4.14",
|
|
102
102
|
"@vue/test-utils": "1.3.0",
|
|
103
103
|
"autoprefixer": "^9.7.6",
|
|
104
104
|
"babel-jest": "^26.6.3",
|
|
@@ -145,8 +145,9 @@
|
|
|
145
145
|
"sass-true": "^5.0.0",
|
|
146
146
|
"start-server-and-test": "^1.10.6",
|
|
147
147
|
"storybook-readme": "5.0.9",
|
|
148
|
+
"stylelint": "13.9.0",
|
|
148
149
|
"stylelint-config-prettier": "9.0.3",
|
|
149
|
-
"stylelint-prettier": "
|
|
150
|
+
"stylelint-prettier": "2.0.0",
|
|
150
151
|
"vue": "^2.6.11",
|
|
151
152
|
"vue-jest": "4.0.0-rc.0",
|
|
152
153
|
"vue-loader": "^15.8.3",
|
|
@@ -1,44 +1,6 @@
|
|
|
1
|
-
import examples from './examples';
|
|
2
1
|
import description from './infinite_scroll.md';
|
|
3
2
|
|
|
4
3
|
export default {
|
|
5
4
|
followsDesignSystem: true,
|
|
6
5
|
description,
|
|
7
|
-
examples,
|
|
8
|
-
propsInfo: {
|
|
9
|
-
totalItems: {
|
|
10
|
-
additionalInfo: 'Total number of items available',
|
|
11
|
-
},
|
|
12
|
-
fetchedItems: {
|
|
13
|
-
additionalInfo: 'Numbers of items fetched before scrolling',
|
|
14
|
-
},
|
|
15
|
-
maxListHeight: {
|
|
16
|
-
additionalInfo: 'Max height of the list before the scrollbar appears',
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
events: [
|
|
20
|
-
{
|
|
21
|
-
event: '@topReached',
|
|
22
|
-
description: 'Emitted when item container is scrolled to the top',
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
event: '@bottomReached',
|
|
26
|
-
description: 'Emitted when item container is scrolled to the bottom',
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
slots: [
|
|
30
|
-
{
|
|
31
|
-
name: 'default',
|
|
32
|
-
description: 'Footer of the list, appears below the items',
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
name: 'header',
|
|
36
|
-
description: 'Header of the list, appears above the items',
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
{
|
|
40
|
-
name: 'items',
|
|
41
|
-
description: 'List of items',
|
|
42
|
-
},
|
|
43
|
-
],
|
|
44
6
|
};
|
|
@@ -1,14 +1,42 @@
|
|
|
1
|
-
import { documentedStoriesOf } from '../../../../documentation/documented_stories';
|
|
2
1
|
import { setStoryTimeout } from '../../../utils/test_utils';
|
|
2
|
+
import { GlInfiniteScroll } from '../../../../index';
|
|
3
3
|
import readme from './infinite_scroll.md';
|
|
4
4
|
|
|
5
5
|
const ITEMS_BATCH_SIZE = 20;
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
const template = `
|
|
8
|
+
<gl-infinite-scroll
|
|
9
|
+
:max-list-height="285"
|
|
10
|
+
:fetched-items="fetchedItems"
|
|
11
|
+
@bottomReached="bottomReached"
|
|
12
|
+
>
|
|
13
|
+
<template #items>
|
|
14
|
+
<ul class="list-group list-group-flushed list-unstyled">
|
|
15
|
+
<li v-for="item in fetchedItems" :key="item" class="list-group-item">Item #{{ item }}</li>
|
|
16
|
+
</ul>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<template #default>
|
|
20
|
+
<div class="gl-mt-3">
|
|
21
|
+
<gl-loading-icon v-if="isLoading" />
|
|
22
|
+
<span v-else>{{ fetchedItems }} items loaded</span>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
</gl-infinite-scroll>
|
|
26
|
+
`;
|
|
27
|
+
|
|
28
|
+
const generateProps = ({ isLoading = false, fetchedItems = ITEMS_BATCH_SIZE } = {}) => ({
|
|
29
|
+
isLoading,
|
|
30
|
+
fetchedItems,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const Template = (args, { argTypes }) => ({
|
|
34
|
+
components: {
|
|
35
|
+
GlInfiniteScroll,
|
|
36
|
+
},
|
|
37
|
+
props: Object.keys(argTypes),
|
|
8
38
|
data() {
|
|
9
39
|
return {
|
|
10
|
-
isLoading: false,
|
|
11
|
-
fetchedItems: ITEMS_BATCH_SIZE,
|
|
12
40
|
loadTimer: null,
|
|
13
41
|
};
|
|
14
42
|
},
|
|
@@ -22,24 +50,21 @@ documentedStoriesOf('base/infinite-scroll', readme).add('default', () => ({
|
|
|
22
50
|
}, 500);
|
|
23
51
|
},
|
|
24
52
|
},
|
|
25
|
-
template
|
|
26
|
-
|
|
27
|
-
:max-list-height="285"
|
|
28
|
-
:fetched-items="fetchedItems"
|
|
29
|
-
@bottomReached="bottomReached"
|
|
30
|
-
>
|
|
31
|
-
<template #items>
|
|
32
|
-
<ul class="list-group list-group-flushed list-unstyled">
|
|
33
|
-
<li v-for="item in fetchedItems" :key="item" class="list-group-item">Item #{{ item }}</li>
|
|
34
|
-
</ul>
|
|
35
|
-
</template>
|
|
53
|
+
template,
|
|
54
|
+
});
|
|
36
55
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
56
|
+
export const Default = Template.bind({});
|
|
57
|
+
Default.args = generateProps();
|
|
58
|
+
|
|
59
|
+
export default {
|
|
60
|
+
title: 'base/infinite-scroll',
|
|
61
|
+
component: GlInfiniteScroll,
|
|
62
|
+
parameters: {
|
|
63
|
+
knobs: { disable: true },
|
|
64
|
+
docs: {
|
|
65
|
+
description: {
|
|
66
|
+
component: readme,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
};
|
|
@@ -10,15 +10,24 @@ export const adjustScrollGap = 5;
|
|
|
10
10
|
|
|
11
11
|
export default {
|
|
12
12
|
props: {
|
|
13
|
+
/**
|
|
14
|
+
* Total number of items available
|
|
15
|
+
*/
|
|
13
16
|
totalItems: {
|
|
14
17
|
type: Number,
|
|
15
18
|
required: false,
|
|
16
19
|
default: 0,
|
|
17
20
|
},
|
|
21
|
+
/**
|
|
22
|
+
* Numbers of items fetched before scrolling
|
|
23
|
+
*/
|
|
18
24
|
fetchedItems: {
|
|
19
25
|
type: Number,
|
|
20
26
|
required: true,
|
|
21
27
|
},
|
|
28
|
+
/**
|
|
29
|
+
* Max height of the list before the scrollbar appears
|
|
30
|
+
*/
|
|
22
31
|
maxListHeight: {
|
|
23
32
|
type: Number,
|
|
24
33
|
required: false,
|
|
@@ -111,9 +120,15 @@ export default {
|
|
|
111
120
|
},
|
|
112
121
|
|
|
113
122
|
topReached: throttle(function topReachedThrottled() {
|
|
123
|
+
/**
|
|
124
|
+
* Emitted when item container is scrolled to the top
|
|
125
|
+
*/
|
|
114
126
|
this.$emit('topReached');
|
|
115
127
|
}, throttleDuration),
|
|
116
128
|
bottomReached: throttle(function bottomReachedThrottled() {
|
|
129
|
+
/**
|
|
130
|
+
* Emitted when item container is scrolled to the bottom
|
|
131
|
+
*/
|
|
117
132
|
this.$emit('bottomReached');
|
|
118
133
|
}, throttleDuration),
|
|
119
134
|
itemsListHeight() {
|
|
@@ -135,6 +150,7 @@ export default {
|
|
|
135
150
|
|
|
136
151
|
<template>
|
|
137
152
|
<div>
|
|
153
|
+
<!-- @slot Header of the list, appears above the items -->
|
|
138
154
|
<slot name="header"></slot>
|
|
139
155
|
<div
|
|
140
156
|
ref="infiniteContainer"
|
|
@@ -144,9 +160,11 @@ export default {
|
|
|
144
160
|
@scroll="handleScroll"
|
|
145
161
|
v-on="$listeners"
|
|
146
162
|
>
|
|
163
|
+
<!-- @slot List of items -->
|
|
147
164
|
<slot name="items"></slot>
|
|
148
165
|
</div>
|
|
149
166
|
<p class="gl-infinite-scroll-legend">
|
|
167
|
+
<!-- @slot Footer of the list, appears below the items -->
|
|
150
168
|
<slot :fetched-items="fetchedItems" :total-items="totalItems">
|
|
151
169
|
{{ legendText }}
|
|
152
170
|
</slot>
|
|
@@ -27,6 +27,10 @@ $gl-search-box-by-type-input-padding: 3.5 * $grid-size;
|
|
|
27
27
|
@include gl-h-7;
|
|
28
28
|
@include gl-pr-7;
|
|
29
29
|
padding-left: $gl-search-box-by-type-input-padding;
|
|
30
|
+
|
|
31
|
+
&::-webkit-search-cancel-button {
|
|
32
|
+
@include gl-display-none;
|
|
33
|
+
}
|
|
30
34
|
}
|
|
31
35
|
|
|
32
36
|
.gl-search-box-by-type-right-icons {
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { withKnobs, object, text } from '@storybook/addon-knobs';
|
|
2
1
|
import { GlColumnChart } from '../../../../charts';
|
|
3
|
-
import { documentedStoriesOf } from '../../../../documentation/documented_stories';
|
|
4
2
|
import {
|
|
5
3
|
mockDefaultLineData,
|
|
6
4
|
mockDefaultBarData,
|
|
@@ -8,11 +6,6 @@ import {
|
|
|
8
6
|
mockSecondaryTrendlineData,
|
|
9
7
|
} from '../../../utils/charts/mock_data';
|
|
10
8
|
import { toolbox } from '../../../utils/charts/story_config';
|
|
11
|
-
import readme from './column.md';
|
|
12
|
-
|
|
13
|
-
const components = {
|
|
14
|
-
GlColumnChart,
|
|
15
|
-
};
|
|
16
9
|
|
|
17
10
|
const template = `
|
|
18
11
|
<gl-column-chart
|
|
@@ -27,7 +20,7 @@ const template = `
|
|
|
27
20
|
/>
|
|
28
21
|
`;
|
|
29
22
|
|
|
30
|
-
|
|
23
|
+
const generateProps = ({
|
|
31
24
|
bars = mockDefaultBarData,
|
|
32
25
|
lines = [],
|
|
33
26
|
option = {},
|
|
@@ -36,85 +29,65 @@ function generateProps({
|
|
|
36
29
|
xAxisType = 'category',
|
|
37
30
|
secondaryData = [],
|
|
38
31
|
secondaryDataTitle = '',
|
|
39
|
-
} = {}) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
option: {
|
|
51
|
-
default: object('Echart Options', option),
|
|
52
|
-
},
|
|
53
|
-
yAxisTitle: {
|
|
54
|
-
default: text('Y Axis Title', yAxisTitle),
|
|
55
|
-
},
|
|
56
|
-
secondaryDataTitle: {
|
|
57
|
-
default: text('Secondary Y Axis Title', secondaryDataTitle),
|
|
58
|
-
},
|
|
59
|
-
xAxisTitle: {
|
|
60
|
-
default: text('X Axis Title', xAxisTitle),
|
|
61
|
-
},
|
|
62
|
-
xAxisType: {
|
|
63
|
-
default: text('X Axis Type', xAxisType),
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
}
|
|
32
|
+
} = {}) => ({
|
|
33
|
+
bars,
|
|
34
|
+
lines,
|
|
35
|
+
option,
|
|
36
|
+
yAxisTitle,
|
|
37
|
+
xAxisTitle,
|
|
38
|
+
xAxisType,
|
|
39
|
+
secondaryData,
|
|
40
|
+
secondaryDataTitle,
|
|
41
|
+
});
|
|
67
42
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
.
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
},
|
|
90
|
-
}),
|
|
91
|
-
components,
|
|
92
|
-
template,
|
|
93
|
-
}))
|
|
94
|
-
.add('with toolbox', () => ({
|
|
95
|
-
props: generateProps({
|
|
96
|
-
option: {
|
|
97
|
-
toolbox,
|
|
43
|
+
const Template = (args, { argTypes }) => ({
|
|
44
|
+
components: { GlColumnChart },
|
|
45
|
+
props: Object.keys(argTypes),
|
|
46
|
+
template,
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export const Default = Template.bind({});
|
|
50
|
+
Default.args = generateProps();
|
|
51
|
+
|
|
52
|
+
export const WithLineSeries = Template.bind({});
|
|
53
|
+
WithLineSeries.args = generateProps({
|
|
54
|
+
lines: mockDefaultLineData,
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
export const WithZoomAndScroll = Template.bind({});
|
|
58
|
+
WithZoomAndScroll.args = generateProps({
|
|
59
|
+
option: {
|
|
60
|
+
dataZoom: [
|
|
61
|
+
{
|
|
62
|
+
type: 'slider',
|
|
63
|
+
startValue: 1,
|
|
98
64
|
},
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
export const WithToolbox = Template.bind({});
|
|
70
|
+
WithToolbox.args = generateProps({
|
|
71
|
+
option: {
|
|
72
|
+
toolbox,
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
export const SecondaryYAxis = Template.bind({});
|
|
77
|
+
SecondaryYAxis.args = generateProps({
|
|
78
|
+
legend: true,
|
|
79
|
+
secondaryData: mockSecondaryBarData,
|
|
80
|
+
secondaryDataTitle: 'New bar data',
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
export const SecondaryYAxisLine = Template.bind({});
|
|
84
|
+
SecondaryYAxisLine.args = generateProps({
|
|
85
|
+
legend: true,
|
|
86
|
+
secondaryData: mockSecondaryTrendlineData,
|
|
87
|
+
secondaryDataTitle: 'New line data',
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
export default {
|
|
91
|
+
title: 'charts/column-chart',
|
|
92
|
+
component: GlColumnChart,
|
|
93
|
+
};
|
package/src/scss/utilities.scss
CHANGED
|
@@ -4335,6 +4335,14 @@
|
|
|
4335
4335
|
min-width: $gl-spacing-scale-8 !important;
|
|
4336
4336
|
}
|
|
4337
4337
|
|
|
4338
|
+
.gl-min-w-9 {
|
|
4339
|
+
min-width: $gl-spacing-scale-9;
|
|
4340
|
+
}
|
|
4341
|
+
|
|
4342
|
+
.gl-min-w-9\! {
|
|
4343
|
+
min-width: $gl-spacing-scale-9 !important;
|
|
4344
|
+
}
|
|
4345
|
+
|
|
4338
4346
|
.gl-min-w-10 {
|
|
4339
4347
|
min-width: $gl-spacing-scale-10;
|
|
4340
4348
|
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
2
|
-
|
|
3
|
-
/* script */
|
|
4
|
-
|
|
5
|
-
/* template */
|
|
6
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-column-chart',{attrs:{"bars":[
|
|
7
|
-
{
|
|
8
|
-
name: 'Full',
|
|
9
|
-
data: [
|
|
10
|
-
['Joe', 1220],
|
|
11
|
-
['Sarah', 932],
|
|
12
|
-
['Tom', 901],
|
|
13
|
-
['Mary', 934],
|
|
14
|
-
['Mike', 1290],
|
|
15
|
-
['Ben', 1330],
|
|
16
|
-
['Jane', 1320] ],
|
|
17
|
-
} ],"option":{},"y-axis-title":"Pushes by day","x-axis-title":"User","x-axis-type":"category"}})};
|
|
18
|
-
var __vue_staticRenderFns__ = [];
|
|
19
|
-
|
|
20
|
-
/* style */
|
|
21
|
-
const __vue_inject_styles__ = undefined;
|
|
22
|
-
/* scoped */
|
|
23
|
-
const __vue_scope_id__ = undefined;
|
|
24
|
-
/* module identifier */
|
|
25
|
-
const __vue_module_identifier__ = undefined;
|
|
26
|
-
/* functional template */
|
|
27
|
-
const __vue_is_functional_template__ = false;
|
|
28
|
-
/* style inject */
|
|
29
|
-
|
|
30
|
-
/* style inject SSR */
|
|
31
|
-
|
|
32
|
-
/* style inject shadow dom */
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const __vue_component__ = __vue_normalize__(
|
|
37
|
-
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
38
|
-
__vue_inject_styles__,
|
|
39
|
-
{},
|
|
40
|
-
__vue_scope_id__,
|
|
41
|
-
__vue_is_functional_template__,
|
|
42
|
-
__vue_module_identifier__,
|
|
43
|
-
false,
|
|
44
|
-
undefined,
|
|
45
|
-
undefined,
|
|
46
|
-
undefined
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
export default __vue_component__;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import ColumnChartBasicExample from './column.basic.example';
|
|
2
|
-
|
|
3
|
-
var index = [{
|
|
4
|
-
name: 'Basic',
|
|
5
|
-
items: [{
|
|
6
|
-
id: 'column-basic',
|
|
7
|
-
name: 'Basic',
|
|
8
|
-
description: 'Basic Column Chart',
|
|
9
|
-
component: ColumnChartBasicExample
|
|
10
|
-
}]
|
|
11
|
-
}];
|
|
12
|
-
|
|
13
|
-
export default index;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
### Column Chart
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<gl-column-chart
|
|
3
|
-
:bars="[
|
|
4
|
-
{
|
|
5
|
-
name: 'Full',
|
|
6
|
-
data: [
|
|
7
|
-
['Joe', 1220],
|
|
8
|
-
['Sarah', 932],
|
|
9
|
-
['Tom', 901],
|
|
10
|
-
['Mary', 934],
|
|
11
|
-
['Mike', 1290],
|
|
12
|
-
['Ben', 1330],
|
|
13
|
-
['Jane', 1320],
|
|
14
|
-
],
|
|
15
|
-
},
|
|
16
|
-
]"
|
|
17
|
-
:option="{}"
|
|
18
|
-
y-axis-title="Pushes by day"
|
|
19
|
-
x-axis-title="User"
|
|
20
|
-
x-axis-type="category"
|
|
21
|
-
/>
|
|
22
|
-
</template>
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import ColumnChartBasicExample from './column.basic.example.vue';
|
|
2
|
-
|
|
3
|
-
export default [
|
|
4
|
-
{
|
|
5
|
-
name: 'Basic',
|
|
6
|
-
items: [
|
|
7
|
-
{
|
|
8
|
-
id: 'column-basic',
|
|
9
|
-
name: 'Basic',
|
|
10
|
-
description: 'Basic Column Chart',
|
|
11
|
-
component: ColumnChartBasicExample,
|
|
12
|
-
},
|
|
13
|
-
],
|
|
14
|
-
},
|
|
15
|
-
];
|