@gitlab/ui 32.36.0 → 32.40.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 +28 -0
- package/dist/components/base/carousel/carousel.documentation.js +1 -4
- package/dist/components/base/dropdown/dropdown.js +3 -3
- package/dist/components/base/filtered_search/filtered_search.js +1 -1
- package/dist/components/base/filtered_search/filtered_search_token_segment.js +10 -2
- package/dist/components/base/form/form_input_group/form_input_group.js +6 -1
- package/dist/components/base/markdown/markdown.documentation.js +2 -6
- package/dist/components/base/popover/popover.js +1 -1
- package/dist/components/base/search_box_by_click/search_box_by_click.js +1 -1
- package/dist/components/base/table/constants.js +5 -0
- package/dist/components/base/table/table.js +19 -1
- package/dist/components/charts/bar/bar.js +1 -1
- package/dist/components/charts/sparkline/sparkline.js +1 -1
- package/dist/components/charts/stacked_column/stacked_column.js +1 -1
- package/dist/utility_classes.css +1 -1
- package/dist/utility_classes.css.map +1 -1
- package/dist/utils/constants.js +2 -2
- package/dist/utils/utils.js +12 -2
- package/documentation/documented_stories.js +2 -0
- package/package.json +3 -3
- package/scss_to_js/scss_variables.js +2 -0
- package/scss_to_js/scss_variables.json +11 -1
- package/src/components/base/carousel/carousel.documentation.js +0 -2
- package/src/components/base/carousel/carousel.md +0 -2
- package/src/components/base/carousel/carousel.stories.js +24 -11
- package/src/components/base/dropdown/dropdown.spec.js +6 -9
- package/src/components/base/dropdown/dropdown.stories.js +3 -3
- package/src/components/base/dropdown/dropdown.vue +3 -3
- package/src/components/base/filtered_search/filtered_search.vue +1 -0
- package/src/components/base/filtered_search/filtered_search_token_segment.spec.js +17 -1
- package/src/components/base/filtered_search/filtered_search_token_segment.vue +9 -1
- package/src/components/base/form/form_input_group/form_input_group.spec.js +18 -1
- package/src/components/base/form/form_input_group/form_input_group.vue +6 -1
- package/src/components/base/markdown/markdown.documentation.js +0 -3
- package/src/components/base/markdown/markdown.md +0 -2
- package/src/components/base/markdown/markdown.stories.js +25 -24
- package/src/components/base/popover/popover.spec.js +9 -0
- package/src/components/base/popover/popover.stories.js +37 -12
- package/src/components/base/popover/popover.vue +1 -2
- package/src/components/base/search_box_by_click/search_box_by_click.vue +1 -0
- package/src/components/base/table/constants.js +49 -0
- package/src/components/base/table/table.spec.js +49 -0
- package/src/components/base/table/table.vue +16 -0
- package/src/components/charts/bar/bar.spec.js +0 -15
- package/src/components/charts/bar/bar.vue +3 -2
- package/src/components/charts/sparkline/sparkline.spec.js +21 -27
- package/src/components/charts/sparkline/sparkline.vue +24 -12
- package/src/components/charts/stacked_column/stacked_column.spec.js +11 -1
- package/src/components/charts/stacked_column/stacked_column.vue +5 -8
- package/src/scss/utilities.scss +8 -0
- package/src/scss/utility-mixins/color.scss +4 -0
- package/src/scss/variables.scss +4 -1
- package/src/utils/constants.js +1 -1
- package/src/utils/utils.js +11 -1
- package/dist/components/base/carousel/examples/carousel.basic.example.js +0 -38
- package/dist/components/base/carousel/examples/index.js +0 -13
- package/dist/components/base/markdown/examples/index.js +0 -13
- package/dist/components/base/markdown/examples/markdown.basic.example.js +0 -38
- package/src/components/base/carousel/examples/carousel.basic.example.vue +0 -26
- package/src/components/base/carousel/examples/index.js +0 -15
- package/src/components/base/markdown/examples/index.js +0 -15
- package/src/components/base/markdown/examples/markdown.basic.example.vue +0 -15
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import { logWarning } from '../../../utils/utils';
|
|
3
|
+
import { waitForAnimationFrame } from '../../../utils/test_utils';
|
|
4
|
+
import { glTableLiteWarning } from './constants';
|
|
5
|
+
import Table from './table.vue';
|
|
6
|
+
|
|
7
|
+
jest.mock('../../../utils/utils', () => ({
|
|
8
|
+
isDev: () => true,
|
|
9
|
+
logWarning: jest.fn(),
|
|
10
|
+
}));
|
|
11
|
+
|
|
12
|
+
describe('GlTable', () => {
|
|
13
|
+
const slotsTemplate = {
|
|
14
|
+
empty: `
|
|
15
|
+
<p>Placeholder empty text</p>`,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const factory = ({ props = {}, scopedSlots = {} } = {}) => {
|
|
19
|
+
shallowMount(Table, {
|
|
20
|
+
scopedSlots,
|
|
21
|
+
propsData: props,
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
afterEach(() => {
|
|
26
|
+
logWarning.mockClear();
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('should log a warning when not given any props or slots which qualifies for the usage of GlTable', async () => {
|
|
30
|
+
factory();
|
|
31
|
+
await waitForAnimationFrame();
|
|
32
|
+
|
|
33
|
+
expect(logWarning).toHaveBeenCalledWith(glTableLiteWarning);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('should not log a warning when given a prop which qualifies for the usage of GlTable', async () => {
|
|
37
|
+
factory({ props: { busy: true } });
|
|
38
|
+
await waitForAnimationFrame();
|
|
39
|
+
|
|
40
|
+
expect(logWarning).not.toHaveBeenCalled();
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('should not log a warning when given a slot which qualifies for the usage of GlTable', async () => {
|
|
44
|
+
factory({ scopedSlots: slotsTemplate });
|
|
45
|
+
await waitForAnimationFrame();
|
|
46
|
+
|
|
47
|
+
expect(logWarning).not.toHaveBeenCalled();
|
|
48
|
+
});
|
|
49
|
+
});
|
|
@@ -1,11 +1,27 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { BTable } from 'bootstrap-vue';
|
|
3
|
+
import { logWarning, isDev } from '../../../utils/utils';
|
|
4
|
+
import { tableFullSlots, tableFullProps, glTableLiteWarning } from './constants';
|
|
5
|
+
|
|
6
|
+
const shouldUseFullTable = ({ $attrs, $scopedSlots }) => {
|
|
7
|
+
return (
|
|
8
|
+
tableFullProps.some((prop) => $attrs[prop] !== undefined) ||
|
|
9
|
+
tableFullSlots.some((slot) => $scopedSlots[slot] !== undefined)
|
|
10
|
+
);
|
|
11
|
+
};
|
|
3
12
|
|
|
4
13
|
export default {
|
|
5
14
|
components: {
|
|
6
15
|
BTable,
|
|
7
16
|
},
|
|
8
17
|
inheritAttrs: false,
|
|
18
|
+
mounted() {
|
|
19
|
+
// logWarning will call isDev before logging any message
|
|
20
|
+
// this additional call to isDev is being made to exit the condition early when run in production
|
|
21
|
+
if (isDev() && !shouldUseFullTable(this)) {
|
|
22
|
+
logWarning(glTableLiteWarning);
|
|
23
|
+
}
|
|
24
|
+
},
|
|
9
25
|
};
|
|
10
26
|
</script>
|
|
11
27
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { shallowMount } from '@vue/test-utils';
|
|
2
2
|
import Chart from '../chart/chart.vue';
|
|
3
3
|
import BarChart from './bar.vue';
|
|
4
|
-
import ChartTooltip from '~/components/charts/tooltip/tooltip.vue';
|
|
5
4
|
import TooltipDefaultFormat from '~/components/shared_components/charts/tooltip_default_format.vue';
|
|
6
5
|
|
|
7
6
|
const mockChartInstance = {
|
|
@@ -34,7 +33,6 @@ describe('Bar chart component', () => {
|
|
|
34
33
|
let wrapper;
|
|
35
34
|
|
|
36
35
|
const findChart = () => wrapper.findComponent(Chart);
|
|
37
|
-
const findChartTooltip = () => wrapper.findComponent(ChartTooltip);
|
|
38
36
|
const getOptions = () => findChart().props('options');
|
|
39
37
|
const emitChartCreated = () => findChart().vm.$emit('created', mockChartInstance);
|
|
40
38
|
|
|
@@ -123,19 +121,6 @@ describe('Bar chart component', () => {
|
|
|
123
121
|
);
|
|
124
122
|
});
|
|
125
123
|
});
|
|
126
|
-
|
|
127
|
-
it('render accurate tooltip title and content', () => {
|
|
128
|
-
const expectedTooltipTitle = `${labelParams.value} (${defaultChartProps.yAxisTitle})`;
|
|
129
|
-
|
|
130
|
-
getOptions().yAxis.axisPointer.label.formatter(labelParams);
|
|
131
|
-
return wrapper.vm.$nextTick(() => {
|
|
132
|
-
const tooltipTextContent = findChartTooltip().element.textContent;
|
|
133
|
-
|
|
134
|
-
expect(tooltipTextContent).toContain(expectedTooltipTitle);
|
|
135
|
-
expect(tooltipTextContent).toContain(defaultChartProps.xAxisTitle);
|
|
136
|
-
expect(tooltipTextContent).toContain(labelParams.seriesData[0].data[0]);
|
|
137
|
-
});
|
|
138
|
-
});
|
|
139
124
|
});
|
|
140
125
|
});
|
|
141
126
|
});
|
|
@@ -238,8 +238,9 @@ export default {
|
|
|
238
238
|
:top="tooltipPosition.top"
|
|
239
239
|
:left="tooltipPosition.left"
|
|
240
240
|
>
|
|
241
|
-
|
|
242
|
-
|
|
241
|
+
<template #title>
|
|
242
|
+
<div>{{ tooltipTitle }} ({{ yAxisTitle }})</div>
|
|
243
|
+
</template>
|
|
243
244
|
<tooltip-default-format :tooltip-content="tooltipContent" />
|
|
244
245
|
</chart-tooltip>
|
|
245
246
|
</div>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { shallowMount, createLocalVue } from '@vue/test-utils';
|
|
2
2
|
import Chart from '../chart/chart.vue';
|
|
3
|
-
import ChartTooltip from '../tooltip/tooltip.vue';
|
|
4
3
|
import SparklineChart from './sparkline.vue';
|
|
5
4
|
import { waitForAnimationFrame } from '~/utils/test_utils';
|
|
6
5
|
|
|
@@ -12,18 +11,6 @@ const mockChartInstance = {
|
|
|
12
11
|
resize: mockResize,
|
|
13
12
|
};
|
|
14
13
|
|
|
15
|
-
// echarts need to be mocked to prevent prop-validation in chart-tooltips to fail
|
|
16
|
-
jest.mock('echarts', () => ({
|
|
17
|
-
getInstanceByDom: () => mockChartInstance,
|
|
18
|
-
}));
|
|
19
|
-
|
|
20
|
-
jest.mock('~/utils/charts/theme', () => ({
|
|
21
|
-
sparkline: {
|
|
22
|
-
variants: { foo: 'foo', bar: 'bar' },
|
|
23
|
-
defaultVariant: 'foo',
|
|
24
|
-
},
|
|
25
|
-
}));
|
|
26
|
-
|
|
27
14
|
let triggerResize = () => {};
|
|
28
15
|
jest.mock('~/directives/resize_observer/resize_observer', () => ({
|
|
29
16
|
GlResizeObserverDirective: {
|
|
@@ -35,6 +22,11 @@ jest.mock('~/directives/resize_observer/resize_observer', () => ({
|
|
|
35
22
|
|
|
36
23
|
const localVue = createLocalVue();
|
|
37
24
|
|
|
25
|
+
const ChartToolTipStub = {
|
|
26
|
+
name: 'chart-tooltip-stub',
|
|
27
|
+
template: '<div><slot name="default"></slot><slot name="title"></slot></div>',
|
|
28
|
+
};
|
|
29
|
+
|
|
38
30
|
describe('sparkline chart component', () => {
|
|
39
31
|
let wrapper;
|
|
40
32
|
let componentOptions;
|
|
@@ -46,19 +38,23 @@ describe('sparkline chart component', () => {
|
|
|
46
38
|
variant: null,
|
|
47
39
|
},
|
|
48
40
|
scopedSlots: { latestSeriesEntry: jest.fn() },
|
|
41
|
+
stubs: {
|
|
42
|
+
'chart-tooltip': ChartToolTipStub,
|
|
43
|
+
},
|
|
49
44
|
};
|
|
50
45
|
|
|
51
46
|
wrapper = shallowMount(SparklineChart, componentOptions);
|
|
52
47
|
};
|
|
53
48
|
|
|
54
49
|
// helpers
|
|
50
|
+
const getByTestId = (id) => wrapper.find(`[data-testid="${id}"]`);
|
|
55
51
|
const getChart = () => wrapper.findComponent(Chart);
|
|
56
52
|
|
|
57
|
-
const getTooltip = () => wrapper.findComponent(
|
|
58
|
-
const getTooltipTitle = () =>
|
|
59
|
-
const getTooltipContent = () =>
|
|
53
|
+
const getTooltip = () => wrapper.findComponent(ChartToolTipStub);
|
|
54
|
+
const getTooltipTitle = () => getByTestId('tooltip-title');
|
|
55
|
+
const getTooltipContent = () => getByTestId('tooltip-content');
|
|
60
56
|
|
|
61
|
-
const getLastYValue = () =>
|
|
57
|
+
const getLastYValue = () => getByTestId('last-y-value');
|
|
62
58
|
|
|
63
59
|
const getChartOptions = () => getChart().props('options');
|
|
64
60
|
const getXAxisLabelFormatter = () => {
|
|
@@ -87,7 +83,7 @@ describe('sparkline chart component', () => {
|
|
|
87
83
|
});
|
|
88
84
|
|
|
89
85
|
it('emits `chartCreated`, which passes on the chart instance', () => {
|
|
90
|
-
expect(wrapper.emitted('chartCreated')
|
|
86
|
+
expect(wrapper.emitted('chartCreated')).toHaveLength(1);
|
|
91
87
|
expect(wrapper.emitted('chartCreated')[0][0]).toBe(mockChartInstance);
|
|
92
88
|
});
|
|
93
89
|
|
|
@@ -153,7 +149,7 @@ describe('sparkline chart component', () => {
|
|
|
153
149
|
expect(getTooltip().attributes('show')).toBeFalsy();
|
|
154
150
|
});
|
|
155
151
|
|
|
156
|
-
it('adds the right content to the tooltip', () => {
|
|
152
|
+
it('adds the right content to the tooltip', async () => {
|
|
157
153
|
const xValue = 'foo';
|
|
158
154
|
const yValue = 'bar';
|
|
159
155
|
const mockData = { seriesData: [{ data: [xValue, yValue] }] };
|
|
@@ -163,10 +159,9 @@ describe('sparkline chart component', () => {
|
|
|
163
159
|
expect(getTooltipTitle().text()).toBe('');
|
|
164
160
|
expect(getTooltipContent().text()).toBe('');
|
|
165
161
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
});
|
|
162
|
+
await waitForAnimationFrame();
|
|
163
|
+
expect(getTooltipTitle().text()).toBe(xValue);
|
|
164
|
+
expect(getTooltipContent().text()).toBe(yValue);
|
|
170
165
|
});
|
|
171
166
|
|
|
172
167
|
it(`shows the last entry's y-value per default`, async () => {
|
|
@@ -182,13 +177,12 @@ describe('sparkline chart component', () => {
|
|
|
182
177
|
expect(getLastYValue().text()).toBe(latestEntryYValue);
|
|
183
178
|
});
|
|
184
179
|
|
|
185
|
-
it(`does not show the last entry's y-value if 'showLastYValue' is false`, () => {
|
|
180
|
+
it(`does not show the last entry's y-value if 'showLastYValue' is false`, async () => {
|
|
186
181
|
expect(getLastYValue().exists()).toBe(true);
|
|
187
182
|
|
|
188
183
|
wrapper.setProps({ showLastYValue: false });
|
|
189
184
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
});
|
|
185
|
+
await wrapper.vm.$nextTick();
|
|
186
|
+
expect(getLastYValue().exists()).toBe(false);
|
|
193
187
|
});
|
|
194
188
|
});
|
|
@@ -174,9 +174,13 @@ export default {
|
|
|
174
174
|
</script>
|
|
175
175
|
|
|
176
176
|
<template>
|
|
177
|
-
<div
|
|
177
|
+
<div
|
|
178
|
+
v-resize-observer="handleResize"
|
|
179
|
+
class="gl-display-flex gl-align-items-center"
|
|
180
|
+
@mouseleave="hideTooltip"
|
|
181
|
+
>
|
|
178
182
|
<slot name="default"></slot>
|
|
179
|
-
<div class="flex-grow-1
|
|
183
|
+
<div class="gl-flex-grow-1 gl-relative">
|
|
180
184
|
<chart :height="height" :options="options" @created="onChartCreated" />
|
|
181
185
|
<chart-tooltip
|
|
182
186
|
v-if="chartInstance"
|
|
@@ -187,17 +191,25 @@ export default {
|
|
|
187
191
|
:style="{ pointerEvents: 'none' }"
|
|
188
192
|
placement="top"
|
|
189
193
|
>
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
194
|
+
<template #title>
|
|
195
|
+
<div data-testid="tooltip-title" class="gl-white-space-nowrap">
|
|
196
|
+
{{ tooltip.title }}
|
|
197
|
+
</div>
|
|
198
|
+
</template>
|
|
199
|
+
<template #default>
|
|
200
|
+
<div class="gl-display-flex" data-testid="tooltip-content">
|
|
201
|
+
<span v-if="tooltipLabel" class="gl-pr-6 gl-mr-auto">{{ tooltipLabel }}</span>
|
|
202
|
+
<strong>{{ tooltip.content }}</strong>
|
|
203
|
+
</div>
|
|
204
|
+
</template>
|
|
197
205
|
</chart-tooltip>
|
|
198
206
|
</div>
|
|
199
|
-
<span
|
|
200
|
-
|
|
201
|
-
|
|
207
|
+
<span
|
|
208
|
+
v-if="showLastYValue"
|
|
209
|
+
class="gl-display-inline-flex gl-justify-content-center gl-ml-5"
|
|
210
|
+
data-testid="last-y-value"
|
|
211
|
+
>
|
|
212
|
+
{{ lastYValue }}
|
|
213
|
+
</span>
|
|
202
214
|
</div>
|
|
203
215
|
</template>
|
|
@@ -29,6 +29,15 @@ const defaultChartProps = {
|
|
|
29
29
|
yAxisTitle: 'Commits',
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
+
const ChartTooltipStub = {
|
|
33
|
+
props: ChartTooltip.props,
|
|
34
|
+
template: `
|
|
35
|
+
<div>
|
|
36
|
+
<slot name="title" />
|
|
37
|
+
<slot />
|
|
38
|
+
</div>`,
|
|
39
|
+
};
|
|
40
|
+
|
|
32
41
|
describe('stacked column chart component', () => {
|
|
33
42
|
let wrapper;
|
|
34
43
|
let options;
|
|
@@ -36,7 +45,7 @@ describe('stacked column chart component', () => {
|
|
|
36
45
|
const findChart = () => wrapper.findComponent(Chart);
|
|
37
46
|
const findLegend = () => wrapper.findComponent(ChartLegend);
|
|
38
47
|
const getOptions = () => findChart().props('options');
|
|
39
|
-
const findDataTooltip = () => wrapper.findComponent(
|
|
48
|
+
const findDataTooltip = () => wrapper.findComponent(ChartTooltipStub);
|
|
40
49
|
|
|
41
50
|
const emitChartCreated = () => findChart().vm.$emit('created', mockChartInstance);
|
|
42
51
|
|
|
@@ -45,6 +54,7 @@ describe('stacked column chart component', () => {
|
|
|
45
54
|
propsData: { ...defaultChartProps, ...props },
|
|
46
55
|
stubs: {
|
|
47
56
|
'tooltip-default-format': TooltipDefaultFormat,
|
|
57
|
+
ChartTooltip: ChartTooltipStub,
|
|
48
58
|
},
|
|
49
59
|
slots,
|
|
50
60
|
});
|
|
@@ -308,16 +308,13 @@ export default {
|
|
|
308
308
|
:top="tooltipPosition.top"
|
|
309
309
|
:left="tooltipPosition.left"
|
|
310
310
|
>
|
|
311
|
-
<template
|
|
312
|
-
|
|
313
|
-
<slot slot="title" name="tooltip-title"></slot>
|
|
314
|
-
<slot name="tooltip-content"></slot>
|
|
311
|
+
<template #title>
|
|
312
|
+
<slot name="tooltip-title">{{ tooltipTitle }} ({{ xAxisTitle }})</slot>
|
|
315
313
|
</template>
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
<div slot="title">{{ tooltipTitle }} ({{ xAxisTitle }})</div>
|
|
314
|
+
|
|
315
|
+
<slot name="tooltip-content">
|
|
319
316
|
<tooltip-default-format :tooltip-content="tooltipContent" />
|
|
320
|
-
</
|
|
317
|
+
</slot>
|
|
321
318
|
</chart-tooltip>
|
|
322
319
|
<chart-legend
|
|
323
320
|
v-if="compiledOptions"
|
package/src/scss/utilities.scss
CHANGED
|
@@ -1997,6 +1997,14 @@
|
|
|
1997
1997
|
color: $body-color !important;
|
|
1998
1998
|
}
|
|
1999
1999
|
|
|
2000
|
+
.gl-text-secondary {
|
|
2001
|
+
color: $gl-text-color-secondary;
|
|
2002
|
+
}
|
|
2003
|
+
|
|
2004
|
+
.gl-text-secondary\! {
|
|
2005
|
+
color: $gl-text-color-secondary !important;
|
|
2006
|
+
}
|
|
2007
|
+
|
|
2000
2008
|
.gl-sm-text-body {
|
|
2001
2009
|
@include gl-media-breakpoint-up(sm) {
|
|
2002
2010
|
color: $body-color;
|
package/src/scss/variables.scss
CHANGED
|
@@ -295,6 +295,9 @@ $t-gray-a-08: rgba(#000, 0.08);
|
|
|
295
295
|
$t-gray-a-24: rgba(#000, 0.24);
|
|
296
296
|
|
|
297
297
|
// Text
|
|
298
|
+
$gl-text-color: $gray-900 !default;
|
|
299
|
+
$gl-text-color-secondary: $gray-500 !default;
|
|
300
|
+
|
|
298
301
|
$gl-font-weight-light: 300;
|
|
299
302
|
$gl-font-weight-normal: 400;
|
|
300
303
|
$gl-font-weight-bold: 600;
|
|
@@ -453,7 +456,7 @@ $modal-backdrop-opacity: 0.64;
|
|
|
453
456
|
// Bootstrap overrides
|
|
454
457
|
// these should ideally be moved further up in the file to the compoent-relevant sections
|
|
455
458
|
// but they can wait here for now
|
|
456
|
-
$body-color: $
|
|
459
|
+
$body-color: $gl-text-color !default;
|
|
457
460
|
|
|
458
461
|
$secondary: $gray-50;
|
|
459
462
|
$success: $green-500;
|
package/src/utils/constants.js
CHANGED
|
@@ -115,7 +115,7 @@ export const badgeForButtonOptions = {
|
|
|
115
115
|
[buttonVariantOptions.danger]: badgeVariantOptions.danger,
|
|
116
116
|
};
|
|
117
117
|
|
|
118
|
-
export const
|
|
118
|
+
export const dropdownVariantOptions = {
|
|
119
119
|
default: 'default',
|
|
120
120
|
confirm: 'confirm',
|
|
121
121
|
info: 'info (deprecated)',
|
package/src/utils/utils.js
CHANGED
|
@@ -103,12 +103,22 @@ export function focusFirstFocusableElement(elts) {
|
|
|
103
103
|
if (focusableElt) focusableElt.focus();
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
+
/**
|
|
107
|
+
* Returns true if the current environment is considered a development environment (it's not
|
|
108
|
+
* production or test).
|
|
109
|
+
*
|
|
110
|
+
* @returns {boolean}
|
|
111
|
+
*/
|
|
112
|
+
export function isDev() {
|
|
113
|
+
return !['test', 'production'].includes(process.env.NODE_ENV);
|
|
114
|
+
}
|
|
115
|
+
|
|
106
116
|
/**
|
|
107
117
|
* Prints a warning message to the console in non-test and non-production environments.
|
|
108
118
|
* @param {string} message message to print to the console
|
|
109
119
|
*/
|
|
110
120
|
export function logWarning(message = '') {
|
|
111
|
-
if (message.length &&
|
|
121
|
+
if (message.length && isDev()) {
|
|
112
122
|
console.warn(message); // eslint-disable-line no-console
|
|
113
123
|
}
|
|
114
124
|
}
|
|
@@ -1,38 +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-carousel',{staticStyle:{"text-shadow":"1px 1px 2px #333"},attrs:{"interval":4000,"controls":"","indicators":"","background":"#ababab","img-width":"1024","img-height":"480"}},[_c('gl-carousel-slide',{attrs:{"caption":"First slide","text":"Nulla vitae elit libero, a pharetra augue mollis interdum.","img-src":"https://picsum.photos/1024/480/?image=52"}}),_vm._v(" "),_c('gl-carousel-slide',{attrs:{"img-src":"https://picsum.photos/1024/480/?image=54"}},[_c('h1',[_vm._v("Hello world!")])]),_vm._v(" "),_c('gl-carousel-slide',{attrs:{"img-src":"https://picsum.photos/1024/480/?image=58"}})],1)};
|
|
7
|
-
var __vue_staticRenderFns__ = [];
|
|
8
|
-
|
|
9
|
-
/* style */
|
|
10
|
-
const __vue_inject_styles__ = undefined;
|
|
11
|
-
/* scoped */
|
|
12
|
-
const __vue_scope_id__ = undefined;
|
|
13
|
-
/* module identifier */
|
|
14
|
-
const __vue_module_identifier__ = undefined;
|
|
15
|
-
/* functional template */
|
|
16
|
-
const __vue_is_functional_template__ = false;
|
|
17
|
-
/* style inject */
|
|
18
|
-
|
|
19
|
-
/* style inject SSR */
|
|
20
|
-
|
|
21
|
-
/* style inject shadow dom */
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const __vue_component__ = __vue_normalize__(
|
|
26
|
-
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
27
|
-
__vue_inject_styles__,
|
|
28
|
-
{},
|
|
29
|
-
__vue_scope_id__,
|
|
30
|
-
__vue_is_functional_template__,
|
|
31
|
-
__vue_module_identifier__,
|
|
32
|
-
false,
|
|
33
|
-
undefined,
|
|
34
|
-
undefined,
|
|
35
|
-
undefined
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
export default __vue_component__;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import CarouselBasicExample from './carousel.basic.example';
|
|
2
|
-
|
|
3
|
-
var index = [{
|
|
4
|
-
name: 'Basic',
|
|
5
|
-
items: [{
|
|
6
|
-
id: 'carousel-basic',
|
|
7
|
-
name: 'Basic',
|
|
8
|
-
description: 'Basic Carousel',
|
|
9
|
-
component: CarouselBasicExample
|
|
10
|
-
}]
|
|
11
|
-
}];
|
|
12
|
-
|
|
13
|
-
export default index;
|
|
@@ -1,38 +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-markdown',[_c('h1',[_vm._v("MD Doc h1 • GitLab uses \"GitLab Flavored Markdown\" (GFM)")]),_vm._v(" "),_c('p',[_vm._v("\n MD Doc Paragraph • GitLab uses \"GitLab Flavored Markdown\" (GFM). It extends the standard\n Markdown in a few significant ways to add some useful functionality. You can use GFM in the\n following areas: comments, issues, merge requests, milestones, snippets and more.\n ")]),_vm._v(" "),_c('p',{staticClass:"sm"},[_vm._v("\n MD Doc Small Paragraph • GitLab uses \"GitLab Flavored Markdown\" (GFM). It extends the standard\n Markdown in a few significant ways to add some useful functionality. You can use GFM in the\n following areas: comments, issues, merge requests, milestones, snippets and more.\n ")])])};
|
|
7
|
-
var __vue_staticRenderFns__ = [];
|
|
8
|
-
|
|
9
|
-
/* style */
|
|
10
|
-
const __vue_inject_styles__ = undefined;
|
|
11
|
-
/* scoped */
|
|
12
|
-
const __vue_scope_id__ = undefined;
|
|
13
|
-
/* module identifier */
|
|
14
|
-
const __vue_module_identifier__ = undefined;
|
|
15
|
-
/* functional template */
|
|
16
|
-
const __vue_is_functional_template__ = false;
|
|
17
|
-
/* style inject */
|
|
18
|
-
|
|
19
|
-
/* style inject SSR */
|
|
20
|
-
|
|
21
|
-
/* style inject shadow dom */
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const __vue_component__ = __vue_normalize__(
|
|
26
|
-
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
27
|
-
__vue_inject_styles__,
|
|
28
|
-
{},
|
|
29
|
-
__vue_scope_id__,
|
|
30
|
-
__vue_is_functional_template__,
|
|
31
|
-
__vue_module_identifier__,
|
|
32
|
-
false,
|
|
33
|
-
undefined,
|
|
34
|
-
undefined,
|
|
35
|
-
undefined
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
export default __vue_component__;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<gl-carousel
|
|
3
|
-
:interval="4000"
|
|
4
|
-
controls
|
|
5
|
-
indicators
|
|
6
|
-
background="#ababab"
|
|
7
|
-
img-width="1024"
|
|
8
|
-
img-height="480"
|
|
9
|
-
style="text-shadow: 1px 1px 2px #333"
|
|
10
|
-
>
|
|
11
|
-
<!-- Text slides with image -->
|
|
12
|
-
<gl-carousel-slide
|
|
13
|
-
caption="First slide"
|
|
14
|
-
text="Nulla vitae elit libero, a pharetra augue mollis interdum."
|
|
15
|
-
img-src="https://picsum.photos/1024/480/?image=52"
|
|
16
|
-
/>
|
|
17
|
-
|
|
18
|
-
<!-- Slides with custom text -->
|
|
19
|
-
<gl-carousel-slide img-src="https://picsum.photos/1024/480/?image=54">
|
|
20
|
-
<h1>Hello world!</h1>
|
|
21
|
-
</gl-carousel-slide>
|
|
22
|
-
|
|
23
|
-
<!-- Slides with image only -->
|
|
24
|
-
<gl-carousel-slide img-src="https://picsum.photos/1024/480/?image=58" />
|
|
25
|
-
</gl-carousel>
|
|
26
|
-
</template>
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import CarouselBasicExample from './carousel.basic.example.vue';
|
|
2
|
-
|
|
3
|
-
export default [
|
|
4
|
-
{
|
|
5
|
-
name: 'Basic',
|
|
6
|
-
items: [
|
|
7
|
-
{
|
|
8
|
-
id: 'carousel-basic',
|
|
9
|
-
name: 'Basic',
|
|
10
|
-
description: 'Basic Carousel',
|
|
11
|
-
component: CarouselBasicExample,
|
|
12
|
-
},
|
|
13
|
-
],
|
|
14
|
-
},
|
|
15
|
-
];
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<gl-markdown>
|
|
3
|
-
<h1>MD Doc h1 • GitLab uses "GitLab Flavored Markdown" (GFM)</h1>
|
|
4
|
-
<p>
|
|
5
|
-
MD Doc Paragraph • GitLab uses "GitLab Flavored Markdown" (GFM). It extends the standard
|
|
6
|
-
Markdown in a few significant ways to add some useful functionality. You can use GFM in the
|
|
7
|
-
following areas: comments, issues, merge requests, milestones, snippets and more.
|
|
8
|
-
</p>
|
|
9
|
-
<p class="sm">
|
|
10
|
-
MD Doc Small Paragraph • GitLab uses "GitLab Flavored Markdown" (GFM). It extends the standard
|
|
11
|
-
Markdown in a few significant ways to add some useful functionality. You can use GFM in the
|
|
12
|
-
following areas: comments, issues, merge requests, milestones, snippets and more.
|
|
13
|
-
</p>
|
|
14
|
-
</gl-markdown>
|
|
15
|
-
</template>
|