@gitlab/ui 38.3.0 → 38.5.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 +22 -0
- package/dist/components/base/datepicker/datepicker.js +2 -2
- package/dist/components/base/filtered_search/filtered_search.js +9 -6
- package/dist/components/base/search_box_by_click/search_box_by_click.js +1 -0
- package/dist/utility_classes.css +1 -1
- package/dist/utility_classes.css.map +1 -1
- package/package.json +2 -2
- package/src/components/base/datepicker/datepicker.spec.js +14 -0
- package/src/components/base/datepicker/datepicker.stories.js +1 -1
- package/src/components/base/datepicker/datepicker.vue +2 -2
- package/src/components/base/dropdown/dropdown.stories.js +1 -1
- package/src/components/base/filtered_search/filtered_search.spec.js +19 -0
- package/src/components/base/filtered_search/filtered_search.vue +9 -6
- package/src/components/base/search_box_by_click/search_box_by_click.spec.js +8 -0
- package/src/components/base/search_box_by_click/search_box_by_click.vue +1 -0
- package/src/scss/utilities.scss +10 -0
- package/src/scss/utility-mixins/spacing.scss +6 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "38.
|
|
3
|
+
"version": "38.5.1",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"@babel/preset-env": "^7.10.2",
|
|
89
89
|
"@gitlab/eslint-plugin": "12.0.1",
|
|
90
90
|
"@gitlab/stylelint-config": "4.0.0",
|
|
91
|
-
"@gitlab/svgs": "2.
|
|
91
|
+
"@gitlab/svgs": "2.8.0",
|
|
92
92
|
"@rollup/plugin-commonjs": "^11.1.0",
|
|
93
93
|
"@rollup/plugin-node-resolve": "^7.1.3",
|
|
94
94
|
"@rollup/plugin-replace": "^2.3.2",
|
|
@@ -73,6 +73,20 @@ describe('datepicker component', () => {
|
|
|
73
73
|
expect(Pikaday.prototype.show).toHaveBeenCalled();
|
|
74
74
|
});
|
|
75
75
|
|
|
76
|
+
describe('when `ariaLabel` prop is passed', () => {
|
|
77
|
+
it('configures pikaday with the given label', () => {
|
|
78
|
+
const ariaLabel = 'Meaningful description';
|
|
79
|
+
|
|
80
|
+
mountWithOptions({
|
|
81
|
+
propsData: {
|
|
82
|
+
ariaLabel,
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
expect(pikadayConfig().ariaLabel).toBe(ariaLabel);
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
|
|
76
90
|
describe('when `target` prop is not passed', () => {
|
|
77
91
|
it('sets calendar icon as `trigger` option', () => {
|
|
78
92
|
const wrapper = mountWithOptions();
|
|
@@ -99,7 +99,7 @@ export default {
|
|
|
99
99
|
required: false,
|
|
100
100
|
default: 0,
|
|
101
101
|
},
|
|
102
|
-
|
|
102
|
+
ariaLabel: {
|
|
103
103
|
type: String,
|
|
104
104
|
required: false,
|
|
105
105
|
default: '',
|
|
@@ -244,7 +244,7 @@ export default {
|
|
|
244
244
|
},
|
|
245
245
|
disableDayFn: this.disableDayFn,
|
|
246
246
|
firstDay: this.firstDay,
|
|
247
|
-
|
|
247
|
+
ariaLabel: this.ariaLabel,
|
|
248
248
|
toString: (date) => defaultDateFormatter(date),
|
|
249
249
|
onSelect: this.selected.bind(this),
|
|
250
250
|
onClose: this.closed.bind(this),
|
|
@@ -218,7 +218,7 @@ export const WithHeaderAndFooter = (args, { argTypes }) => ({
|
|
|
218
218
|
<gl-dropdown-item>Fifth item</gl-dropdown-item>
|
|
219
219
|
<gl-dropdown-item>Sixth item</gl-dropdown-item>
|
|
220
220
|
<gl-dropdown-item>Seventh item</gl-dropdown-item>
|
|
221
|
-
<gl-dropdown-item>
|
|
221
|
+
<gl-dropdown-item>Eighth item</gl-dropdown-item>
|
|
222
222
|
<template #footer>
|
|
223
223
|
<gl-dropdown-item>First footer item</gl-dropdown-item>
|
|
224
224
|
<gl-dropdown-item>Second footer item</gl-dropdown-item>
|
|
@@ -730,4 +730,23 @@ describe('Filtered search integration tests', () => {
|
|
|
730
730
|
wrapper.findAllComponents(GlFilteredSearchToken).wrappers.map((cmp) => cmp.props('active'))
|
|
731
731
|
).toEqual([false, false]);
|
|
732
732
|
});
|
|
733
|
+
|
|
734
|
+
it('updates tokens list when value is passed dynamically', async () => {
|
|
735
|
+
mountComponent({ value: ['one'] });
|
|
736
|
+
await nextTick();
|
|
737
|
+
|
|
738
|
+
expect(wrapper.findAllComponents(GlFilteredSearchTerm)).toHaveLength(2);
|
|
739
|
+
|
|
740
|
+
await wrapper.setProps({
|
|
741
|
+
value: ['one two'],
|
|
742
|
+
});
|
|
743
|
+
|
|
744
|
+
const termComponents = wrapper.findAllComponents(GlFilteredSearchTerm).wrappers;
|
|
745
|
+
expect(termComponents).toHaveLength(3);
|
|
746
|
+
expect(termComponents.map((termComponent) => termComponent.props('value'))).toEqual([
|
|
747
|
+
{ data: 'one' },
|
|
748
|
+
{ data: 'two' },
|
|
749
|
+
{ data: '' },
|
|
750
|
+
]);
|
|
751
|
+
});
|
|
733
752
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import { cloneDeep } from 'lodash';
|
|
2
|
+
import { cloneDeep, isEqual } from 'lodash';
|
|
3
3
|
import PortalVue from 'portal-vue';
|
|
4
4
|
import Vue from 'vue';
|
|
5
5
|
import { GlTooltipDirective } from '../../../directives/tooltip';
|
|
@@ -174,11 +174,14 @@ export default {
|
|
|
174
174
|
deep: true,
|
|
175
175
|
immediate: true,
|
|
176
176
|
},
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
177
|
+
value: {
|
|
178
|
+
handler(newValue, oldValue) {
|
|
179
|
+
if (newValue.length && !isEqual(newValue, oldValue)) {
|
|
180
|
+
this.applyNewValue(cloneDeep(newValue));
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
immediate: true,
|
|
184
|
+
},
|
|
182
185
|
},
|
|
183
186
|
|
|
184
187
|
methods: {
|
|
@@ -36,6 +36,14 @@ describe('search box by click component', () => {
|
|
|
36
36
|
expect(wrapper.emitted().input).toEqual([['new value']]);
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
+
it('does not emit an input event when input is updated to the same value', async () => {
|
|
40
|
+
createComponent({ value: 'somevalue' });
|
|
41
|
+
|
|
42
|
+
await wrapper.setProps({ value: 'another value' });
|
|
43
|
+
|
|
44
|
+
expect(wrapper.emitted().input).toBe(undefined);
|
|
45
|
+
});
|
|
46
|
+
|
|
39
47
|
it('does not displays history dropdown by default', () => {
|
|
40
48
|
createComponent();
|
|
41
49
|
expect(wrapper.findComponent({ ref: 'historyDropdown' }).exists()).toBe(false);
|
package/src/scss/utilities.scss
CHANGED
|
@@ -5436,6 +5436,16 @@
|
|
|
5436
5436
|
.gl-ml-auto\! {
|
|
5437
5437
|
margin-left: auto !important;
|
|
5438
5438
|
}
|
|
5439
|
+
.gl-sm-ml-auto {
|
|
5440
|
+
@include gl-media-breakpoint-up(sm) {
|
|
5441
|
+
margin-left: auto;
|
|
5442
|
+
}
|
|
5443
|
+
}
|
|
5444
|
+
.gl-sm-ml-auto\! {
|
|
5445
|
+
@include gl-media-breakpoint-up(sm) {
|
|
5446
|
+
margin-left: auto !important;
|
|
5447
|
+
}
|
|
5448
|
+
}
|
|
5439
5449
|
.gl-ml-0 {
|
|
5440
5450
|
margin-left: 0;
|
|
5441
5451
|
}
|