@gitlab/ui 32.55.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 +29 -0
- package/dist/components/base/table/table.documentation.js +1 -5
- package/dist/index.css.map +1 -1
- 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 +810 -94
- package/src/scss/utility-mixins/sizing.scss +27 -3
- package/src/scss/utility-mixins/spacing.scss +408 -2
- 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
|
+
};
|