@gitlab/ui 49.9.1 → 49.10.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 +12 -0
- package/dist/components/base/daterange_picker/daterange_picker.js +11 -1
- package/dist/components/base/form/form_checkbox/form_checkbox_group.js +1 -1
- package/dist/components/base/form/form_radio_group/form_radio_group.js +1 -1
- package/dist/components/base/popover/popover.js +1 -6
- package/dist/index.css +2 -2
- package/dist/index.css.map +1 -1
- package/dist/utility_classes.css +1 -1
- package/dist/utility_classes.css.map +1 -1
- package/package.json +4 -3
- package/src/components/base/daterange_picker/daterange_picker.scss +0 -7
- package/src/components/base/daterange_picker/daterange_picker.spec.js +12 -2
- package/src/components/base/daterange_picker/daterange_picker.vue +23 -12
- package/src/components/base/form/form_checkbox/form_checkbox_group.vue +1 -1
- package/src/components/base/form/form_radio_group/form_radio_group.vue +1 -1
- package/src/components/base/popover/popover.vue +0 -6
- package/src/components/base/tabs/tabs/tabs.spec.js +1 -2
- package/src/scss/utilities.scss +22 -0
- package/src/scss/utility-mixins/flex.scss +6 -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": "49.
|
|
3
|
+
"version": "49.10.0",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"@popperjs/core": "^2.11.2",
|
|
63
|
-
"bootstrap-vue": "2.
|
|
63
|
+
"bootstrap-vue": "2.20.1",
|
|
64
64
|
"dompurify": "^2.4.1",
|
|
65
65
|
"echarts": "^5.3.2",
|
|
66
66
|
"iframe-resizer": "^4.3.2",
|
|
@@ -109,7 +109,8 @@
|
|
|
109
109
|
"babel-plugin-lodash": "^3.3.4",
|
|
110
110
|
"babel-plugin-require-context-hook": "^1.0.0",
|
|
111
111
|
"babel-preset-vue": "^2.0.2",
|
|
112
|
-
"bootstrap": "4.
|
|
112
|
+
"bootstrap": "4.5.3",
|
|
113
|
+
"bootstrap-vue-vue3": "npm:bootstrap-vue@2.23.1",
|
|
113
114
|
"cypress": "^10.11.0",
|
|
114
115
|
"emoji-regex": "^10.0.0",
|
|
115
116
|
"eslint": "8.27.0",
|
|
@@ -5,16 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
label {
|
|
7
7
|
@include gl-font-weight-bold;
|
|
8
|
-
@include gl-mr-2;
|
|
9
|
-
@include gl-ml-2;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
> div:first-of-type label {
|
|
13
|
-
@include gl-ml-0;
|
|
14
8
|
}
|
|
15
9
|
|
|
16
10
|
.gl-datepicker-input {
|
|
17
|
-
@include gl-w-full;
|
|
18
11
|
@include gl-border-gray-100;
|
|
19
12
|
@include gl-text-gray-900;
|
|
20
13
|
}
|
|
@@ -248,7 +248,7 @@ describe('Daterange Picker', () => {
|
|
|
248
248
|
it('does not show default slot or tooltip icon by default', () => {
|
|
249
249
|
factory();
|
|
250
250
|
|
|
251
|
-
expect(findDateRangeIndicator().
|
|
251
|
+
expect(findDateRangeIndicator().exists()).toBe(false);
|
|
252
252
|
expect(findTooltipIcon().exists()).toBe(false);
|
|
253
253
|
});
|
|
254
254
|
|
|
@@ -271,9 +271,19 @@ describe('Daterange Picker', () => {
|
|
|
271
271
|
});
|
|
272
272
|
|
|
273
273
|
it('adds the indicator class when provided', () => {
|
|
274
|
-
factory({ dateRangeIndicatorClass });
|
|
274
|
+
factory({ dateRangeIndicatorClass }, slots);
|
|
275
275
|
|
|
276
276
|
expect(wrapper.find(`.${dateRangeIndicatorClass}`).exists()).toBe(true);
|
|
277
277
|
});
|
|
278
278
|
});
|
|
279
|
+
|
|
280
|
+
it.each`
|
|
281
|
+
prop | value | testid
|
|
282
|
+
${'startPickerClass'} | ${'gl-text-blue-500'} | ${'daterange-picker-start-container'}
|
|
283
|
+
${'endPickerClass'} | ${'gl-text-red-500'} | ${'daterange-picker-end-container'}
|
|
284
|
+
`('adds the provided $value class to $testid', ({ prop, value, testid }) => {
|
|
285
|
+
factory({ [prop]: value });
|
|
286
|
+
|
|
287
|
+
expect(wrapper.find(`[data-testid="${testid}"]`).classes()).toContain(value);
|
|
288
|
+
});
|
|
279
289
|
});
|
|
@@ -4,6 +4,14 @@ import { getDayDifference, getDateInPast, getDateInFuture } from '../../../utils
|
|
|
4
4
|
import GlDatepicker from '../datepicker/datepicker.vue';
|
|
5
5
|
import GlIcon from '../icon/icon.vue';
|
|
6
6
|
|
|
7
|
+
const CONTAINER_CLASSES = [
|
|
8
|
+
'gl-display-flex',
|
|
9
|
+
'gl-align-items-baseline',
|
|
10
|
+
'gl-flex-wrap',
|
|
11
|
+
'gl-sm-flex-wrap-nowrap',
|
|
12
|
+
'gl-sm-gap-3',
|
|
13
|
+
];
|
|
14
|
+
|
|
7
15
|
export default {
|
|
8
16
|
components: {
|
|
9
17
|
GlDatepicker,
|
|
@@ -165,6 +173,15 @@ export default {
|
|
|
165
173
|
const numberOfDays = getDayDifference(this.startDate, this.endDate);
|
|
166
174
|
return this.sameDaySelection ? numberOfDays + 1 : numberOfDays;
|
|
167
175
|
},
|
|
176
|
+
startContainerClasses() {
|
|
177
|
+
return [this.startPickerClass, ...CONTAINER_CLASSES];
|
|
178
|
+
},
|
|
179
|
+
endContainerClasses() {
|
|
180
|
+
return [this.endPickerClass, ...CONTAINER_CLASSES];
|
|
181
|
+
},
|
|
182
|
+
showIndicator() {
|
|
183
|
+
return Boolean(this.$scopedSlots.default || this.tooltip);
|
|
184
|
+
},
|
|
168
185
|
},
|
|
169
186
|
watch: {
|
|
170
187
|
value(val) {
|
|
@@ -229,8 +246,8 @@ export default {
|
|
|
229
246
|
</script>
|
|
230
247
|
|
|
231
248
|
<template>
|
|
232
|
-
<div class="gl-daterange-picker">
|
|
233
|
-
<div :class="
|
|
249
|
+
<div class="gl-daterange-picker gl-gap-5 gl-display-flex">
|
|
250
|
+
<div :class="startContainerClasses" data-testid="daterange-picker-start-container">
|
|
234
251
|
<label :class="labelClass">{{ fromLabel }}</label>
|
|
235
252
|
|
|
236
253
|
<gl-datepicker
|
|
@@ -248,7 +265,7 @@ export default {
|
|
|
248
265
|
@close="onStartPickerClose"
|
|
249
266
|
/>
|
|
250
267
|
</div>
|
|
251
|
-
<div :class="
|
|
268
|
+
<div :class="endContainerClasses" data-testid="daterange-picker-end-container">
|
|
252
269
|
<label :class="labelClass">{{ toLabel }}</label>
|
|
253
270
|
<gl-datepicker
|
|
254
271
|
:key="numericStartTime"
|
|
@@ -269,20 +286,14 @@ export default {
|
|
|
269
286
|
/>
|
|
270
287
|
</div>
|
|
271
288
|
<div
|
|
289
|
+
v-if="showIndicator"
|
|
272
290
|
:class="dateRangeIndicatorClass"
|
|
273
291
|
data-testid="daterange-picker-indicator"
|
|
274
|
-
class="gl-display-flex gl-flex-direction-row gl-align-items-center gl-text-gray-500 gl-
|
|
292
|
+
class="gl-display-flex gl-flex-direction-row gl-align-items-center gl-text-gray-500 gl-gap-3"
|
|
275
293
|
>
|
|
276
294
|
<!-- @slot Content to display for days selected. The value is -1 when no date range is selected.-->
|
|
277
295
|
<slot v-bind="{ daysSelected: numberOfDays }"></slot>
|
|
278
|
-
<gl-icon
|
|
279
|
-
v-if="tooltip"
|
|
280
|
-
v-gl-tooltip
|
|
281
|
-
name="information-o"
|
|
282
|
-
:title="tooltip"
|
|
283
|
-
:size="16"
|
|
284
|
-
class="gl-ml-2"
|
|
285
|
-
/>
|
|
296
|
+
<gl-icon v-if="tooltip" v-gl-tooltip name="information-o" :title="tooltip" :size="16" />
|
|
286
297
|
</div>
|
|
287
298
|
</div>
|
|
288
299
|
</template>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { BFormCheckboxGroup } from 'bootstrap-vue';
|
|
3
|
-
import
|
|
3
|
+
import formOptionsMixin from 'bootstrap-vue/src/mixins/form-options';
|
|
4
4
|
import { SafeHtmlDirective as SafeHtml } from '../../../../directives/safe_html/safe_html';
|
|
5
5
|
import GlFormCheckbox from './form_checkbox.vue';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { BFormRadioGroup } from 'bootstrap-vue';
|
|
3
|
-
import
|
|
3
|
+
import formOptionsMixin from 'bootstrap-vue/src/mixins/form-options';
|
|
4
4
|
import { SafeHtmlDirective as SafeHtml } from '../../../../directives/safe_html/safe_html';
|
|
5
5
|
import GlFormRadio from '../form_radio/form_radio.vue';
|
|
6
6
|
|
|
@@ -45,11 +45,6 @@ export default {
|
|
|
45
45
|
required: false,
|
|
46
46
|
default: popoverPlacements.top,
|
|
47
47
|
},
|
|
48
|
-
boundaryPadding: {
|
|
49
|
-
type: [Number, String],
|
|
50
|
-
required: false,
|
|
51
|
-
default: 5,
|
|
52
|
-
},
|
|
53
48
|
},
|
|
54
49
|
computed: {
|
|
55
50
|
customClass() {
|
|
@@ -79,7 +74,6 @@ export default {
|
|
|
79
74
|
:triggers="triggers"
|
|
80
75
|
:title="title"
|
|
81
76
|
:placement="placement"
|
|
82
|
-
:boundary-padding="boundaryPadding"
|
|
83
77
|
v-bind="$attrs"
|
|
84
78
|
v-on="$listeners"
|
|
85
79
|
>
|
|
@@ -341,8 +341,7 @@ describe('tabs component', () => {
|
|
|
341
341
|
await nextTick();
|
|
342
342
|
await nextTick();
|
|
343
343
|
|
|
344
|
-
expect(wrapper.emitted().input
|
|
345
|
-
expect(wrapper.emitted().input[1]).toEqual([1]);
|
|
344
|
+
expect(wrapper.emitted().input.pop()).toEqual([1]);
|
|
346
345
|
});
|
|
347
346
|
});
|
|
348
347
|
});
|
package/src/scss/utilities.scss
CHANGED
|
@@ -3256,6 +3256,18 @@
|
|
|
3256
3256
|
flex-wrap: nowrap !important;
|
|
3257
3257
|
}
|
|
3258
3258
|
|
|
3259
|
+
.gl-sm-flex-wrap-nowrap {
|
|
3260
|
+
@include gl-media-breakpoint-up(sm) {
|
|
3261
|
+
flex-wrap: nowrap;
|
|
3262
|
+
}
|
|
3263
|
+
}
|
|
3264
|
+
|
|
3265
|
+
.gl-sm-flex-wrap-nowrap\! {
|
|
3266
|
+
@include gl-media-breakpoint-up(sm) {
|
|
3267
|
+
flex-wrap: nowrap !important;
|
|
3268
|
+
}
|
|
3269
|
+
}
|
|
3270
|
+
|
|
3259
3271
|
.gl-flex-nowrap {
|
|
3260
3272
|
flex-wrap: nowrap;
|
|
3261
3273
|
}
|
|
@@ -6312,6 +6324,16 @@
|
|
|
6312
6324
|
.gl-gap-3\! {
|
|
6313
6325
|
gap: $gl-spacing-scale-3 !important;
|
|
6314
6326
|
}
|
|
6327
|
+
.gl-sm-gap-3 {
|
|
6328
|
+
@include gl-media-breakpoint-up(sm) {
|
|
6329
|
+
gap: $gl-spacing-scale-3;
|
|
6330
|
+
}
|
|
6331
|
+
}
|
|
6332
|
+
.gl-sm-gap-3\! {
|
|
6333
|
+
@include gl-media-breakpoint-up(sm) {
|
|
6334
|
+
gap: $gl-spacing-scale-3 !important;
|
|
6335
|
+
}
|
|
6336
|
+
}
|
|
6315
6337
|
.gl-gap-5 {
|
|
6316
6338
|
gap: $gl-spacing-scale-5;
|
|
6317
6339
|
}
|
|
@@ -122,6 +122,12 @@
|
|
|
122
122
|
flex-wrap: nowrap;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
+
@mixin gl-sm-flex-wrap-nowrap {
|
|
126
|
+
@include gl-media-breakpoint-up(sm) {
|
|
127
|
+
@include gl-flex-wrap-nowrap;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
125
131
|
/**
|
|
126
132
|
* `gl-flex-nowrap` is deprecated; use `gl-flex-wrap-nowrap` instead.
|
|
127
133
|
* TODO: delete `gl-flex-wrap-nowrap` utility class, see
|