@gitlab/ui 32.58.0 → 32.59.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 +8 -0
- package/dist/components/base/table/table.documentation.js +1 -5
- package/dist/utility_classes.css +1 -1
- package/dist/utility_classes.css.map +1 -1
- package/documentation/documented_stories.js +1 -0
- package/package.json +1 -1
- package/src/components/base/table/table.documentation.js +0 -3
- package/src/components/base/table/table.stories.js +85 -71
- package/src/scss/utilities.scss +8 -0
- package/src/scss/utility-mixins/typography.scss +4 -0
- package/dist/components/base/table/examples/index.js +0 -19
- package/dist/components/base/table/examples/table.basic.example.js +0 -59
- package/dist/components/base/table/examples/table.custom_fields.example.js +0 -66
- package/src/components/base/table/examples/index.js +0 -22
- package/src/components/base/table/examples/table.basic.example.vue +0 -32
- package/src/components/base/table/examples/table.custom_fields.example.vue +0 -43
package/package.json
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import { withKnobs, boolean, select, text } from '@storybook/addon-knobs';
|
|
2
|
-
import { documentedStoriesOf } from '../../../../documentation/documented_stories';
|
|
3
1
|
import { GlTable } from '../../../../index';
|
|
4
|
-
import { variantOptions } from '../../../utils/constants';
|
|
5
2
|
import readme from './table.md';
|
|
6
3
|
|
|
7
|
-
const components = {
|
|
8
|
-
GlTable,
|
|
9
|
-
};
|
|
10
|
-
|
|
11
4
|
const tableItems = [
|
|
12
5
|
{
|
|
13
6
|
column_one: 'test',
|
|
@@ -23,75 +16,96 @@ const tableItems = [
|
|
|
23
16
|
},
|
|
24
17
|
];
|
|
25
18
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
19
|
+
const generateProps = ({ fixed = false, footClone = false, stacked = false } = {}) => ({
|
|
20
|
+
fixed,
|
|
21
|
+
footClone,
|
|
22
|
+
stacked,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export const Default = (args, { argTypes }) => ({
|
|
26
|
+
props: Object.keys(argTypes),
|
|
27
|
+
template: `
|
|
28
|
+
<gl-table
|
|
29
|
+
:items="$options.items"
|
|
30
|
+
:fields="$options.fields"
|
|
31
|
+
:fixed="fixed"
|
|
32
|
+
:stacked="stacked"
|
|
33
|
+
:foot-clone="footClone"
|
|
34
|
+
hover
|
|
35
|
+
selectable
|
|
36
|
+
selected-variant="primary"
|
|
37
|
+
/>
|
|
38
|
+
`,
|
|
39
|
+
fields: [
|
|
40
|
+
{
|
|
41
|
+
key: 'column_one',
|
|
42
|
+
label: 'Column One',
|
|
43
|
+
variant: 'secondary',
|
|
44
|
+
sortable: false,
|
|
45
|
+
isRowHeader: false,
|
|
35
46
|
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
47
|
+
{
|
|
48
|
+
key: 'col_2',
|
|
49
|
+
label: 'Column 2',
|
|
50
|
+
formatter: (value) => value,
|
|
39
51
|
},
|
|
40
|
-
|
|
52
|
+
],
|
|
53
|
+
items: tableItems,
|
|
54
|
+
});
|
|
55
|
+
Default.args = generateProps();
|
|
41
56
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
documentedStoriesOf('base/table/table', readme)
|
|
46
|
-
.addDecorator(withKnobs)
|
|
47
|
-
.add('default', () => ({
|
|
48
|
-
components,
|
|
49
|
-
props: generateProps(),
|
|
50
|
-
template: `
|
|
51
|
-
<gl-table
|
|
52
|
-
:items="$options.items"
|
|
53
|
-
:fields="$options.fields"
|
|
54
|
-
:fixed="fixed"
|
|
55
|
-
:stacked="stacked"
|
|
56
|
-
:foot-clone="footClone"
|
|
57
|
-
hover
|
|
58
|
-
selectable
|
|
59
|
-
selected-variant="primary"
|
|
60
|
-
/>
|
|
61
|
-
`,
|
|
62
|
-
fields: [
|
|
63
|
-
{
|
|
64
|
-
key: 'column_one',
|
|
65
|
-
label: 'Column One',
|
|
66
|
-
variant: select('variant', variantOptions, variantOptions.secondary),
|
|
67
|
-
sortable: boolean('sortable', false),
|
|
68
|
-
isRowHeader: boolean('isRowHeader', false),
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
key: 'col_2',
|
|
72
|
-
label: 'Column 2',
|
|
73
|
-
formatter: (value) => `${text('formatterExample', '$')}${value}`,
|
|
74
|
-
},
|
|
75
|
-
],
|
|
76
|
-
items: tableItems,
|
|
77
|
-
}))
|
|
78
|
-
.add('empty', () => ({
|
|
79
|
-
components,
|
|
80
|
-
template: `
|
|
57
|
+
export const Empty = (args, { argTypes }) => ({
|
|
58
|
+
props: Object.keys(argTypes),
|
|
59
|
+
template: `
|
|
81
60
|
<gl-table show-empty />
|
|
82
61
|
`,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
62
|
+
});
|
|
63
|
+
Empty.parameters = { controls: { disable: true } };
|
|
64
|
+
|
|
65
|
+
export const WithFilter = (args, { argTypes }) => ({
|
|
66
|
+
props: Object.keys(argTypes),
|
|
67
|
+
template: `<div class="gl-line-height-normal">
|
|
87
68
|
<gl-form-input v-model="filter" placeholder="Type to search" />
|
|
88
69
|
<br />
|
|
89
|
-
<gl-table
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
70
|
+
<gl-table
|
|
71
|
+
:items="$options.items"
|
|
72
|
+
:fields="$options.fields"
|
|
73
|
+
:filter=filter
|
|
74
|
+
:fixed="fixed"
|
|
75
|
+
:stacked="stacked"
|
|
76
|
+
:foot-clone="footClone"
|
|
77
|
+
hover
|
|
78
|
+
selectable
|
|
79
|
+
selected-variant="primary"
|
|
80
|
+
/>
|
|
81
|
+
</div>`,
|
|
82
|
+
items: tableItems,
|
|
83
|
+
data() {
|
|
84
|
+
return {
|
|
85
|
+
filter: null,
|
|
86
|
+
};
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
WithFilter.args = generateProps();
|
|
90
|
+
|
|
91
|
+
export default {
|
|
92
|
+
title: 'base/table/table',
|
|
93
|
+
component: GlTable,
|
|
94
|
+
parameters: {
|
|
95
|
+
bootstrapComponent: 'b-table',
|
|
96
|
+
knobs: { disable: true },
|
|
97
|
+
docs: {
|
|
98
|
+
description: {
|
|
99
|
+
component: readme,
|
|
100
|
+
},
|
|
96
101
|
},
|
|
97
|
-
}
|
|
102
|
+
},
|
|
103
|
+
argTypes: {
|
|
104
|
+
stacked: {
|
|
105
|
+
control: {
|
|
106
|
+
type: 'select',
|
|
107
|
+
options: ['sm', 'md', 'lg', 'xl', true, false],
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
};
|
package/src/scss/utilities.scss
CHANGED
|
@@ -7179,6 +7179,14 @@
|
|
|
7179
7179
|
font-size: $gl-font-size-compact-markdown-h1 !important;
|
|
7180
7180
|
}
|
|
7181
7181
|
|
|
7182
|
+
.gl-reset-font-size {
|
|
7183
|
+
font-size: inherit;
|
|
7184
|
+
}
|
|
7185
|
+
|
|
7186
|
+
.gl-reset-font-size\! {
|
|
7187
|
+
font-size: inherit !important;
|
|
7188
|
+
}
|
|
7189
|
+
|
|
7182
7190
|
.gl-font-weight-100 {
|
|
7183
7191
|
font-weight: 100;
|
|
7184
7192
|
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import component from './table.basic.example';
|
|
2
|
-
import componentCustomFields from './table.custom_fields.example';
|
|
3
|
-
|
|
4
|
-
var index = [{
|
|
5
|
-
name: 'Basic',
|
|
6
|
-
items: [{
|
|
7
|
-
id: 'table-basic',
|
|
8
|
-
name: 'Basic',
|
|
9
|
-
description: 'Basic Table',
|
|
10
|
-
component
|
|
11
|
-
}, {
|
|
12
|
-
id: 'table-custom-fields',
|
|
13
|
-
name: 'Custom Fields',
|
|
14
|
-
description: 'Custom component fields',
|
|
15
|
-
component: componentCustomFields
|
|
16
|
-
}]
|
|
17
|
-
}];
|
|
18
|
-
|
|
19
|
-
export default index;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
2
|
-
|
|
3
|
-
var script = {
|
|
4
|
-
fields: [{
|
|
5
|
-
key: 'column_one',
|
|
6
|
-
label: 'Column One'
|
|
7
|
-
}, {
|
|
8
|
-
key: 'col_2',
|
|
9
|
-
label: 'Column 2'
|
|
10
|
-
}],
|
|
11
|
-
items: [{
|
|
12
|
-
column_one: 'test',
|
|
13
|
-
col_2: 1234
|
|
14
|
-
}, {
|
|
15
|
-
column_one: 'test2',
|
|
16
|
-
col_2: 5678
|
|
17
|
-
}, {
|
|
18
|
-
column_one: 'test3',
|
|
19
|
-
col_2: 9101
|
|
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-table',{attrs:{"items":_vm.$options.items,"fields":_vm.$options.fields}})};
|
|
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__;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
2
|
-
|
|
3
|
-
var script = {
|
|
4
|
-
fields: [{
|
|
5
|
-
key: 'column_one',
|
|
6
|
-
label: 'Column One'
|
|
7
|
-
}, {
|
|
8
|
-
key: 'col_2',
|
|
9
|
-
label: 'Styled Column 2'
|
|
10
|
-
}, {
|
|
11
|
-
key: 'custom_markup',
|
|
12
|
-
label: 'Styled Virtual Column'
|
|
13
|
-
}],
|
|
14
|
-
items: [{
|
|
15
|
-
column_one: 'test',
|
|
16
|
-
col_2: 1234
|
|
17
|
-
}, {
|
|
18
|
-
column_one: 'test2',
|
|
19
|
-
col_2: 5678
|
|
20
|
-
}, {
|
|
21
|
-
column_one: 'test3',
|
|
22
|
-
col_2: 9101
|
|
23
|
-
}]
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
/* script */
|
|
27
|
-
const __vue_script__ = script;
|
|
28
|
-
|
|
29
|
-
/* template */
|
|
30
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-table',{attrs:{"items":_vm.$options.items,"fields":_vm.$options.fields},scopedSlots:_vm._u([{key:"cell(col_2)",fn:function(ref){
|
|
31
|
-
var value = ref.value;
|
|
32
|
-
return [_c('span',{staticClass:"gl-font-weight-bold gl-text-green-500"},[_vm._v(_vm._s(value))])]}},{key:"cell(custom_markup)",fn:function(ref){
|
|
33
|
-
var index = ref.index;
|
|
34
|
-
return [_c('span',{staticClass:"gl-font-style-italic gl-text-red-500"},[_vm._v("Index: "+_vm._s(index + 1))])]}}])})};
|
|
35
|
-
var __vue_staticRenderFns__ = [];
|
|
36
|
-
|
|
37
|
-
/* style */
|
|
38
|
-
const __vue_inject_styles__ = undefined;
|
|
39
|
-
/* scoped */
|
|
40
|
-
const __vue_scope_id__ = undefined;
|
|
41
|
-
/* module identifier */
|
|
42
|
-
const __vue_module_identifier__ = undefined;
|
|
43
|
-
/* functional template */
|
|
44
|
-
const __vue_is_functional_template__ = false;
|
|
45
|
-
/* style inject */
|
|
46
|
-
|
|
47
|
-
/* style inject SSR */
|
|
48
|
-
|
|
49
|
-
/* style inject shadow dom */
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const __vue_component__ = __vue_normalize__(
|
|
54
|
-
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
55
|
-
__vue_inject_styles__,
|
|
56
|
-
__vue_script__,
|
|
57
|
-
__vue_scope_id__,
|
|
58
|
-
__vue_is_functional_template__,
|
|
59
|
-
__vue_module_identifier__,
|
|
60
|
-
false,
|
|
61
|
-
undefined,
|
|
62
|
-
undefined,
|
|
63
|
-
undefined
|
|
64
|
-
);
|
|
65
|
-
|
|
66
|
-
export default __vue_component__;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import component from './table.basic.example.vue';
|
|
2
|
-
import componentCustomFields from './table.custom_fields.example.vue';
|
|
3
|
-
|
|
4
|
-
export default [
|
|
5
|
-
{
|
|
6
|
-
name: 'Basic',
|
|
7
|
-
items: [
|
|
8
|
-
{
|
|
9
|
-
id: 'table-basic',
|
|
10
|
-
name: 'Basic',
|
|
11
|
-
description: 'Basic Table',
|
|
12
|
-
component,
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
id: 'table-custom-fields',
|
|
16
|
-
name: 'Custom Fields',
|
|
17
|
-
description: 'Custom component fields',
|
|
18
|
-
component: componentCustomFields,
|
|
19
|
-
},
|
|
20
|
-
],
|
|
21
|
-
},
|
|
22
|
-
];
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
export default {
|
|
3
|
-
fields: [
|
|
4
|
-
{
|
|
5
|
-
key: 'column_one',
|
|
6
|
-
label: 'Column One',
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
key: 'col_2',
|
|
10
|
-
label: 'Column 2',
|
|
11
|
-
},
|
|
12
|
-
],
|
|
13
|
-
items: [
|
|
14
|
-
{
|
|
15
|
-
column_one: 'test',
|
|
16
|
-
col_2: 1234,
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
column_one: 'test2',
|
|
20
|
-
col_2: 5678,
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
column_one: 'test3',
|
|
24
|
-
col_2: 9101,
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
};
|
|
28
|
-
</script>
|
|
29
|
-
|
|
30
|
-
<template>
|
|
31
|
-
<gl-table :items="$options.items" :fields="$options.fields" />
|
|
32
|
-
</template>
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
export default {
|
|
3
|
-
fields: [
|
|
4
|
-
{
|
|
5
|
-
key: 'column_one',
|
|
6
|
-
label: 'Column One',
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
key: 'col_2',
|
|
10
|
-
label: 'Styled Column 2',
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
key: 'custom_markup',
|
|
14
|
-
label: 'Styled Virtual Column',
|
|
15
|
-
},
|
|
16
|
-
],
|
|
17
|
-
items: [
|
|
18
|
-
{
|
|
19
|
-
column_one: 'test',
|
|
20
|
-
col_2: 1234,
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
column_one: 'test2',
|
|
24
|
-
col_2: 5678,
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
column_one: 'test3',
|
|
28
|
-
col_2: 9101,
|
|
29
|
-
},
|
|
30
|
-
],
|
|
31
|
-
};
|
|
32
|
-
</script>
|
|
33
|
-
|
|
34
|
-
<template>
|
|
35
|
-
<gl-table :items="$options.items" :fields="$options.fields">
|
|
36
|
-
<template #cell(col_2)="{ value }">
|
|
37
|
-
<span class="gl-font-weight-bold gl-text-green-500">{{ value }}</span>
|
|
38
|
-
</template>
|
|
39
|
-
<template #cell(custom_markup)="{ index }">
|
|
40
|
-
<span class="gl-font-style-italic gl-text-red-500">Index: {{ index + 1 }}</span>
|
|
41
|
-
</template>
|
|
42
|
-
</gl-table>
|
|
43
|
-
</template>
|