@gitlab/ui 49.9.1 → 49.10.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "49.9.1",
3
+ "version": "49.10.1",
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.23.1",
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.6.2",
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",
@@ -149,9 +150,9 @@
149
150
  "stylelint": "14.9.1",
150
151
  "stylelint-config-prettier": "9.0.4",
151
152
  "stylelint-prettier": "2.0.0",
152
- "vue": "2.7.13",
153
+ "vue": "2.7.14",
153
154
  "vue-loader": "^15.8.3",
154
- "vue-template-compiler": "2.7.13",
155
+ "vue-template-compiler": "2.7.14",
155
156
  "vue-test-utils-compat": "^0.0.10"
156
157
  },
157
158
  "release": {
@@ -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().text()).toBe('');
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="startPickerClass">
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="endPickerClass">
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-ml-2"
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>
@@ -355,4 +355,21 @@ describe('Filtered search token', () => {
355
355
  }
356
356
  );
357
357
  });
358
+
359
+ describe('showFriendlyText prop', () => {
360
+ it.each`
361
+ showFriendlyText | operator | text
362
+ ${false} | ${'='} | ${'='}
363
+ ${false} | ${'!='} | ${'!='}
364
+ ${true} | ${'='} | ${'is'}
365
+ ${true} | ${'!='} | ${'is not'}
366
+ `(
367
+ 'displays "$text" when operator="$operator" and showFriendlyText="$showFriendlyText"',
368
+ ({ showFriendlyText, operator, text }) => {
369
+ mountComponent({ value: { operator }, showFriendlyText });
370
+
371
+ expect(findOperatorSegment().text()).toBe(text);
372
+ }
373
+ );
374
+ });
358
375
  });
@@ -376,9 +376,9 @@ export default {
376
376
 
377
377
  <template #option="{ option }">
378
378
  <div class="gl-display-flex">
379
- {{ option.value }}
379
+ {{ showFriendlyText ? option.description : option.value }}
380
380
  <span v-if="option.description" class="gl-filtered-search-token-operator-description">
381
- {{ option.description }}
381
+ {{ showFriendlyText ? option.value : option.description }}
382
382
  </span>
383
383
  </div>
384
384
  </template>
@@ -1,6 +1,6 @@
1
1
  <script>
2
2
  import { BFormCheckboxGroup } from 'bootstrap-vue';
3
- import { formOptionsMixin } from 'bootstrap-vue/src/mixins/form-options';
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 { formOptionsMixin } from 'bootstrap-vue/src/mixins/form-options';
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[0]).toEqual([0]);
345
- expect(wrapper.emitted().input[1]).toEqual([1]);
344
+ expect(wrapper.emitted().input.pop()).toEqual([1]);
346
345
  });
347
346
  });
348
347
  });
@@ -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
@@ -823,6 +823,12 @@
823
823
  gap: $gl-spacing-scale-3;
824
824
  }
825
825
 
826
+ @mixin gl-sm-gap-3 {
827
+ @include gl-media-breakpoint-up(sm) {
828
+ @include gl-gap-3;
829
+ }
830
+ }
831
+
826
832
  @mixin gl-gap-5 {
827
833
  gap: $gl-spacing-scale-5;
828
834
  }