@gitlab/ui 88.6.0 → 89.0.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.
Files changed (40) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/bin/migrate_custom_utils_to_tw.bundled.mjs +1 -0
  3. package/dist/components/base/datepicker/datepicker.js +1 -1
  4. package/dist/index.css +2 -2
  5. package/dist/index.css.map +1 -1
  6. package/dist/index.js +0 -2
  7. package/dist/vendor/bootstrap-vue/src/components/index.js +0 -2
  8. package/dist/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip.js +1 -1
  9. package/dist/vendor/bootstrap-vue/src/constants/components.js +1 -3
  10. package/dist/vendor/bootstrap-vue/src/index.js +0 -3
  11. package/package.json +1 -1
  12. package/src/components/base/datepicker/datepicker.vue +1 -1
  13. package/src/components/base/form/form_checkbox/form_checkbox.scss +3 -3
  14. package/src/index.js +0 -2
  15. package/src/scss/bootstrap.scss +0 -1
  16. package/src/scss/components.scss +0 -1
  17. package/src/vendor/bootstrap-vue/nuxt/index.js +0 -1
  18. package/src/vendor/bootstrap-vue/package.json +0 -1
  19. package/src/vendor/bootstrap-vue/src/components/index.d.ts +0 -1
  20. package/src/vendor/bootstrap-vue/src/components/index.js +0 -2
  21. package/src/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip.js +1 -1
  22. package/src/vendor/bootstrap-vue/src/constants/components.js +0 -2
  23. package/src/vendor/bootstrap-vue/src/index.js +0 -5
  24. package/dist/components/base/carousel/carousel.js +0 -48
  25. package/dist/components/base/carousel/carousel_slide.js +0 -47
  26. package/dist/vendor/bootstrap-vue/src/components/carousel/carousel-slide.js +0 -123
  27. package/dist/vendor/bootstrap-vue/src/components/carousel/carousel.js +0 -617
  28. package/dist/vendor/bootstrap-vue/src/components/carousel/index.js +0 -14
  29. package/src/components/base/carousel/carousel.md +0 -3
  30. package/src/components/base/carousel/carousel.scss +0 -29
  31. package/src/components/base/carousel/carousel.vue +0 -19
  32. package/src/components/base/carousel/carousel_slide.vue +0 -18
  33. package/src/vendor/bootstrap-vue/src/components/carousel/README.md +0 -320
  34. package/src/vendor/bootstrap-vue/src/components/carousel/carousel-slide.js +0 -132
  35. package/src/vendor/bootstrap-vue/src/components/carousel/carousel-slide.spec.js +0 -276
  36. package/src/vendor/bootstrap-vue/src/components/carousel/carousel.js +0 -655
  37. package/src/vendor/bootstrap-vue/src/components/carousel/carousel.spec.js +0 -1069
  38. package/src/vendor/bootstrap-vue/src/components/carousel/index.d.ts +0 -20
  39. package/src/vendor/bootstrap-vue/src/components/carousel/index.js +0 -12
  40. package/src/vendor/bootstrap-vue/src/components/carousel/package.json +0 -185
@@ -1,617 +0,0 @@
1
- import { extend } from '../../vue';
2
- import { NAME_CAROUSEL } from '../../constants/components';
3
- import { IS_BROWSER, HAS_POINTER_EVENT_SUPPORT, HAS_TOUCH_SUPPORT } from '../../constants/env';
4
- import { EVENT_NAME_PAUSED, EVENT_NAME_UNPAUSED, EVENT_NAME_SLIDING_END, EVENT_NAME_SLIDING_START, EVENT_OPTIONS_NO_CAPTURE } from '../../constants/events';
5
- import { CODE_SPACE, CODE_ENTER, CODE_LEFT, CODE_RIGHT } from '../../constants/key-codes';
6
- import { PROP_TYPE_NUMBER, PROP_TYPE_STRING, PROP_TYPE_BOOLEAN, PROP_TYPE_NUMBER_STRING } from '../../constants/props';
7
- import { requestAF, getActiveElement, addClass, removeClass, reflow, selectAll, setAttr } from '../../utils/dom';
8
- import { eventOn, stopEvent, eventOff } from '../../utils/events';
9
- import { isUndefined } from '../../utils/inspect';
10
- import { mathFloor, mathMax, mathMin, mathAbs } from '../../utils/math';
11
- import { makeModelMixin } from '../../utils/model';
12
- import { toInteger } from '../../utils/number';
13
- import { noop } from '../../utils/noop';
14
- import { sortKeys } from '../../utils/object';
15
- import { observeDom } from '../../utils/observe-dom';
16
- import { makePropsConfigurable, makeProp } from '../../utils/props';
17
- import { props as props$1, idMixin } from '../../mixins/id';
18
- import { normalizeSlotMixin } from '../../mixins/normalize-slot';
19
-
20
- // --- Constants ---
21
-
22
- const {
23
- mixin: modelMixin,
24
- props: modelProps,
25
- prop: MODEL_PROP_NAME,
26
- event: MODEL_EVENT_NAME
27
- } = makeModelMixin('value', {
28
- type: PROP_TYPE_NUMBER,
29
- defaultValue: 0
30
- });
31
-
32
- // Slide directional classes
33
- const DIRECTION = {
34
- next: {
35
- dirClass: 'carousel-item-left',
36
- overlayClass: 'carousel-item-next'
37
- },
38
- prev: {
39
- dirClass: 'carousel-item-right',
40
- overlayClass: 'carousel-item-prev'
41
- }
42
- };
43
-
44
- // Fallback Transition duration (with a little buffer) in ms
45
- const TRANS_DURATION = 600 + 50;
46
-
47
- // Time for mouse compat events to fire after touch
48
- const TOUCH_EVENT_COMPAT_WAIT = 500;
49
-
50
- // Number of pixels to consider touch move a swipe
51
- const SWIPE_THRESHOLD = 40;
52
-
53
- // PointerEvent pointer types
54
- const PointerType = {
55
- TOUCH: 'touch',
56
- PEN: 'pen'
57
- };
58
-
59
- // Transition Event names
60
- const TransitionEndEvents = {
61
- WebkitTransition: 'webkitTransitionEnd',
62
- MozTransition: 'transitionend',
63
- OTransition: 'otransitionend oTransitionEnd',
64
- transition: 'transitionend'
65
- };
66
-
67
- // --- Helper methods ---
68
-
69
- // Return the browser specific transitionEnd event name
70
- const getTransitionEndEvent = el => {
71
- for (const name in TransitionEndEvents) {
72
- if (!isUndefined(el.style[name])) {
73
- return TransitionEndEvents[name];
74
- }
75
- }
76
- // Fallback
77
- /* istanbul ignore next */
78
- return null;
79
- };
80
-
81
- // --- Props ---
82
-
83
- const props = makePropsConfigurable(sortKeys({
84
- ...props$1,
85
- ...modelProps,
86
- background: makeProp(PROP_TYPE_STRING),
87
- controls: makeProp(PROP_TYPE_BOOLEAN, false),
88
- // Enable cross-fade animation instead of slide animation
89
- fade: makeProp(PROP_TYPE_BOOLEAN, false),
90
- // Sniffed by carousel-slide
91
- imgHeight: makeProp(PROP_TYPE_NUMBER_STRING),
92
- // Sniffed by carousel-slide
93
- imgWidth: makeProp(PROP_TYPE_NUMBER_STRING),
94
- indicators: makeProp(PROP_TYPE_BOOLEAN, false),
95
- interval: makeProp(PROP_TYPE_NUMBER, 5000),
96
- labelGotoSlide: makeProp(PROP_TYPE_STRING, 'Goto slide'),
97
- labelIndicators: makeProp(PROP_TYPE_STRING, 'Select a slide to display'),
98
- labelNext: makeProp(PROP_TYPE_STRING, 'Next slide'),
99
- labelPrev: makeProp(PROP_TYPE_STRING, 'Previous slide'),
100
- // Disable slide/fade animation
101
- noAnimation: makeProp(PROP_TYPE_BOOLEAN, false),
102
- // Disable pause on hover
103
- noHoverPause: makeProp(PROP_TYPE_BOOLEAN, false),
104
- // Sniffed by carousel-slide
105
- noTouch: makeProp(PROP_TYPE_BOOLEAN, false),
106
- // Disable wrapping/looping when start/end is reached
107
- noWrap: makeProp(PROP_TYPE_BOOLEAN, false)
108
- }), NAME_CAROUSEL);
109
-
110
- // --- Main component ---
111
-
112
- // @vue/component
113
- const BCarousel = /*#__PURE__*/extend({
114
- name: NAME_CAROUSEL,
115
- mixins: [idMixin, modelMixin, normalizeSlotMixin],
116
- provide() {
117
- return {
118
- getBvCarousel: () => this
119
- };
120
- },
121
- props,
122
- data() {
123
- return {
124
- index: this[MODEL_PROP_NAME] || 0,
125
- isSliding: false,
126
- transitionEndEvent: null,
127
- slides: [],
128
- direction: null,
129
- isPaused: !(toInteger(this.interval, 0) > 0),
130
- // Touch event handling values
131
- touchStartX: 0,
132
- touchDeltaX: 0
133
- };
134
- },
135
- computed: {
136
- numSlides() {
137
- return this.slides.length;
138
- }
139
- },
140
- watch: {
141
- [MODEL_PROP_NAME](newValue, oldValue) {
142
- if (newValue !== oldValue) {
143
- this.setSlide(toInteger(newValue, 0));
144
- }
145
- },
146
- interval(newValue, oldValue) {
147
- /* istanbul ignore next */
148
- if (newValue === oldValue) {
149
- return;
150
- }
151
- if (!newValue) {
152
- // Pausing slide show
153
- this.pause(false);
154
- } else {
155
- // Restarting or Changing interval
156
- this.pause(true);
157
- this.start(false);
158
- }
159
- },
160
- isPaused(newValue, oldValue) {
161
- if (newValue !== oldValue) {
162
- this.$emit(newValue ? EVENT_NAME_PAUSED : EVENT_NAME_UNPAUSED);
163
- }
164
- },
165
- index(to, from) {
166
- /* istanbul ignore next */
167
- if (to === from || this.isSliding) {
168
- return;
169
- }
170
- this.doSlide(to, from);
171
- }
172
- },
173
- created() {
174
- // Create private non-reactive props
175
- this.$_interval = null;
176
- this.$_animationTimeout = null;
177
- this.$_touchTimeout = null;
178
- this.$_observer = null;
179
- // Set initial paused state
180
- this.isPaused = !(toInteger(this.interval, 0) > 0);
181
- },
182
- mounted() {
183
- // Cache current browser transitionend event name
184
- this.transitionEndEvent = getTransitionEndEvent(this.$el) || null;
185
- // Get all slides
186
- this.updateSlides();
187
- // Observe child changes so we can update slide list
188
- this.setObserver(true);
189
- },
190
- beforeDestroy() {
191
- this.clearInterval();
192
- this.clearAnimationTimeout();
193
- this.clearTouchTimeout();
194
- this.setObserver(false);
195
- },
196
- methods: {
197
- clearInterval() {
198
- clearInterval(this.$_interval);
199
- this.$_interval = null;
200
- },
201
- clearAnimationTimeout() {
202
- clearTimeout(this.$_animationTimeout);
203
- this.$_animationTimeout = null;
204
- },
205
- clearTouchTimeout() {
206
- clearTimeout(this.$_touchTimeout);
207
- this.$_touchTimeout = null;
208
- },
209
- setObserver() {
210
- let on = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
211
- this.$_observer && this.$_observer.disconnect();
212
- this.$_observer = null;
213
- if (on) {
214
- this.$_observer = observeDom(this.$refs.inner, this.updateSlides.bind(this), {
215
- subtree: false,
216
- childList: true,
217
- attributes: true,
218
- attributeFilter: ['id']
219
- });
220
- }
221
- },
222
- // Set slide
223
- setSlide(slide) {
224
- let direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
225
- // Don't animate when page is not visible
226
- /* istanbul ignore if: difficult to test */
227
- if (IS_BROWSER && document.visibilityState && document.hidden) {
228
- return;
229
- }
230
- const noWrap = this.noWrap;
231
- const numSlides = this.numSlides;
232
- // Make sure we have an integer (you never know!)
233
- slide = mathFloor(slide);
234
- // Don't do anything if nothing to slide to
235
- if (numSlides === 0) {
236
- return;
237
- }
238
- // Don't change slide while transitioning, wait until transition is done
239
- if (this.isSliding) {
240
- // Schedule slide after sliding complete
241
- this.$once(EVENT_NAME_SLIDING_END, () => {
242
- // Wrap in `requestAF()` to allow the slide to properly finish to avoid glitching
243
- requestAF(() => this.setSlide(slide, direction));
244
- });
245
- return;
246
- }
247
- this.direction = direction;
248
- // Set new slide index
249
- // Wrap around if necessary (if no-wrap not enabled)
250
- this.index = slide >= numSlides ? noWrap ? numSlides - 1 : 0 : slide < 0 ? noWrap ? 0 : numSlides - 1 : slide;
251
- // Ensure the v-model is synched up if no-wrap is enabled
252
- // and user tried to slide pass either ends
253
- if (noWrap && this.index !== slide && this.index !== this[MODEL_PROP_NAME]) {
254
- this.$emit(MODEL_EVENT_NAME, this.index);
255
- }
256
- },
257
- // Previous slide
258
- prev() {
259
- this.setSlide(this.index - 1, 'prev');
260
- },
261
- // Next slide
262
- next() {
263
- this.setSlide(this.index + 1, 'next');
264
- },
265
- // Pause auto rotation
266
- pause(event) {
267
- if (!event) {
268
- this.isPaused = true;
269
- }
270
- this.clearInterval();
271
- },
272
- // Start auto rotate slides
273
- start(event) {
274
- if (!event) {
275
- this.isPaused = false;
276
- }
277
- /* istanbul ignore next: most likely will never happen, but just in case */
278
- this.clearInterval();
279
- // Don't start if no interval, or less than 2 slides
280
- if (this.interval && this.numSlides > 1) {
281
- this.$_interval = setInterval(this.next, mathMax(1000, this.interval));
282
- }
283
- },
284
- // Restart auto rotate slides when focus/hover leaves the carousel
285
- /* istanbul ignore next */
286
- restart() {
287
- if (!this.$el.contains(getActiveElement())) {
288
- this.start();
289
- }
290
- },
291
- doSlide(to, from) {
292
- const isCycling = Boolean(this.interval);
293
- // Determine sliding direction
294
- const direction = this.calcDirection(this.direction, from, to);
295
- const overlayClass = direction.overlayClass;
296
- const dirClass = direction.dirClass;
297
- // Determine current and next slides
298
- const currentSlide = this.slides[from];
299
- const nextSlide = this.slides[to];
300
- // Don't do anything if there aren't any slides to slide to
301
- if (!currentSlide || !nextSlide) {
302
- /* istanbul ignore next */
303
- return;
304
- }
305
- // Start animating
306
- this.isSliding = true;
307
- if (isCycling) {
308
- this.pause(false);
309
- }
310
- this.$emit(EVENT_NAME_SLIDING_START, to);
311
- // Update v-model
312
- this.$emit(MODEL_EVENT_NAME, this.index);
313
- if (this.noAnimation) {
314
- addClass(nextSlide, 'active');
315
- removeClass(currentSlide, 'active');
316
- this.isSliding = false;
317
- // Notify ourselves that we're done sliding (slid)
318
- this.$nextTick(() => this.$emit(EVENT_NAME_SLIDING_END, to));
319
- } else {
320
- addClass(nextSlide, overlayClass);
321
- // Trigger a reflow of next slide
322
- reflow(nextSlide);
323
- addClass(currentSlide, dirClass);
324
- addClass(nextSlide, dirClass);
325
- // Transition End handler
326
- let called = false;
327
- /* istanbul ignore next: difficult to test */
328
- const onceTransEnd = () => {
329
- if (called) {
330
- return;
331
- }
332
- called = true;
333
- /* istanbul ignore if: transition events cant be tested in JSDOM */
334
- if (this.transitionEndEvent) {
335
- const events = this.transitionEndEvent.split(/\s+/);
336
- events.forEach(event => eventOff(nextSlide, event, onceTransEnd, EVENT_OPTIONS_NO_CAPTURE));
337
- }
338
- this.clearAnimationTimeout();
339
- removeClass(nextSlide, dirClass);
340
- removeClass(nextSlide, overlayClass);
341
- addClass(nextSlide, 'active');
342
- removeClass(currentSlide, 'active');
343
- removeClass(currentSlide, dirClass);
344
- removeClass(currentSlide, overlayClass);
345
- setAttr(currentSlide, 'aria-current', 'false');
346
- setAttr(nextSlide, 'aria-current', 'true');
347
- setAttr(currentSlide, 'aria-hidden', 'true');
348
- setAttr(nextSlide, 'aria-hidden', 'false');
349
- this.isSliding = false;
350
- this.direction = null;
351
- // Notify ourselves that we're done sliding (slid)
352
- this.$nextTick(() => this.$emit(EVENT_NAME_SLIDING_END, to));
353
- };
354
- // Set up transitionend handler
355
- /* istanbul ignore if: transition events cant be tested in JSDOM */
356
- if (this.transitionEndEvent) {
357
- const events = this.transitionEndEvent.split(/\s+/);
358
- events.forEach(event => eventOn(nextSlide, event, onceTransEnd, EVENT_OPTIONS_NO_CAPTURE));
359
- }
360
- // Fallback to setTimeout()
361
- this.$_animationTimeout = setTimeout(onceTransEnd, TRANS_DURATION);
362
- }
363
- if (isCycling) {
364
- this.start(false);
365
- }
366
- },
367
- // Update slide list
368
- updateSlides() {
369
- this.pause(true);
370
- // Get all slides as DOM elements
371
- this.slides = selectAll('.carousel-item', this.$refs.inner);
372
- const numSlides = this.slides.length;
373
- // Keep slide number in range
374
- const index = mathMax(0, mathMin(mathFloor(this.index), numSlides - 1));
375
- this.slides.forEach((slide, idx) => {
376
- const n = idx + 1;
377
- if (idx === index) {
378
- addClass(slide, 'active');
379
- setAttr(slide, 'aria-current', 'true');
380
- } else {
381
- removeClass(slide, 'active');
382
- setAttr(slide, 'aria-current', 'false');
383
- }
384
- setAttr(slide, 'aria-posinset', String(n));
385
- setAttr(slide, 'aria-setsize', String(numSlides));
386
- });
387
- // Set slide as active
388
- this.setSlide(index);
389
- this.start(this.isPaused);
390
- },
391
- calcDirection() {
392
- let direction = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
393
- let curIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
394
- let nextIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
395
- if (!direction) {
396
- return nextIndex > curIndex ? DIRECTION.next : DIRECTION.prev;
397
- }
398
- return DIRECTION[direction];
399
- },
400
- handleClick(event, fn) {
401
- const keyCode = event.keyCode;
402
- if (event.type === 'click' || keyCode === CODE_SPACE || keyCode === CODE_ENTER) {
403
- stopEvent(event);
404
- fn();
405
- }
406
- },
407
- /* istanbul ignore next: JSDOM doesn't support touch events */
408
- handleSwipe() {
409
- const absDeltaX = mathAbs(this.touchDeltaX);
410
- if (absDeltaX <= SWIPE_THRESHOLD) {
411
- return;
412
- }
413
- const direction = absDeltaX / this.touchDeltaX;
414
- // Reset touch delta X
415
- // https://github.com/twbs/bootstrap/pull/28558
416
- this.touchDeltaX = 0;
417
- if (direction > 0) {
418
- // Swipe left
419
- this.prev();
420
- } else if (direction < 0) {
421
- // Swipe right
422
- this.next();
423
- }
424
- },
425
- /* istanbul ignore next: JSDOM doesn't support touch events */
426
- touchStart(event) {
427
- if (HAS_POINTER_EVENT_SUPPORT && PointerType[event.pointerType.toUpperCase()]) {
428
- this.touchStartX = event.clientX;
429
- } else if (!HAS_POINTER_EVENT_SUPPORT) {
430
- this.touchStartX = event.touches[0].clientX;
431
- }
432
- },
433
- /* istanbul ignore next: JSDOM doesn't support touch events */
434
- touchMove(event) {
435
- // Ensure swiping with one touch and not pinching
436
- if (event.touches && event.touches.length > 1) {
437
- this.touchDeltaX = 0;
438
- } else {
439
- this.touchDeltaX = event.touches[0].clientX - this.touchStartX;
440
- }
441
- },
442
- /* istanbul ignore next: JSDOM doesn't support touch events */
443
- touchEnd(event) {
444
- if (HAS_POINTER_EVENT_SUPPORT && PointerType[event.pointerType.toUpperCase()]) {
445
- this.touchDeltaX = event.clientX - this.touchStartX;
446
- }
447
- this.handleSwipe();
448
- // If it's a touch-enabled device, mouseenter/leave are fired as
449
- // part of the mouse compatibility events on first tap - the carousel
450
- // would stop cycling until user tapped out of it;
451
- // here, we listen for touchend, explicitly pause the carousel
452
- // (as if it's the second time we tap on it, mouseenter compat event
453
- // is NOT fired) and after a timeout (to allow for mouse compatibility
454
- // events to fire) we explicitly restart cycling
455
- this.pause(false);
456
- this.clearTouchTimeout();
457
- this.$_touchTimeout = setTimeout(this.start, TOUCH_EVENT_COMPAT_WAIT + mathMax(1000, this.interval));
458
- }
459
- },
460
- render(h) {
461
- const {
462
- indicators,
463
- background,
464
- noAnimation,
465
- noHoverPause,
466
- noTouch,
467
- index,
468
- isSliding,
469
- pause,
470
- restart,
471
- touchStart,
472
- touchEnd
473
- } = this;
474
- const idInner = this.safeId('__BV_inner_');
475
-
476
- // Wrapper for slides
477
- const $inner = h('div', {
478
- staticClass: 'carousel-inner',
479
- attrs: {
480
- id: idInner,
481
- role: 'list'
482
- },
483
- ref: 'inner'
484
- }, [this.normalizeSlot()]);
485
-
486
- // Prev and next controls
487
- let $controls = h();
488
- if (this.controls) {
489
- const makeControl = (direction, label, handler) => {
490
- const handlerWrapper = event => {
491
- /* istanbul ignore next */
492
- if (!isSliding) {
493
- this.handleClick(event, handler);
494
- } else {
495
- stopEvent(event, {
496
- propagation: false
497
- });
498
- }
499
- };
500
- return h('a', {
501
- staticClass: `carousel-control-${direction}`,
502
- attrs: {
503
- href: '#',
504
- role: 'button',
505
- 'aria-controls': idInner,
506
- 'aria-disabled': isSliding ? 'true' : null
507
- },
508
- on: {
509
- click: handlerWrapper,
510
- keydown: handlerWrapper
511
- }
512
- }, [h('span', {
513
- staticClass: `carousel-control-${direction}-icon`,
514
- attrs: {
515
- 'aria-hidden': 'true'
516
- }
517
- }), h('span', {
518
- class: 'sr-only'
519
- }, [label])]);
520
- };
521
- $controls = [makeControl('prev', this.labelPrev, this.prev), makeControl('next', this.labelNext, this.next)];
522
- }
523
-
524
- // Indicators
525
- const $indicators = h('ol', {
526
- staticClass: 'carousel-indicators',
527
- directives: [{
528
- name: 'show',
529
- value: indicators
530
- }],
531
- attrs: {
532
- id: this.safeId('__BV_indicators_'),
533
- 'aria-hidden': indicators ? 'false' : 'true',
534
- 'aria-label': this.labelIndicators,
535
- 'aria-owns': idInner
536
- }
537
- }, this.slides.map((slide, i) => {
538
- const handler = event => {
539
- this.handleClick(event, () => {
540
- this.setSlide(i);
541
- });
542
- };
543
- return h('li', {
544
- class: {
545
- active: i === index
546
- },
547
- attrs: {
548
- role: 'button',
549
- id: this.safeId(`__BV_indicator_${i + 1}_`),
550
- tabindex: indicators ? '0' : '-1',
551
- 'aria-current': i === index ? 'true' : 'false',
552
- 'aria-label': `${this.labelGotoSlide} ${i + 1}`,
553
- 'aria-describedby': slide.id || null,
554
- 'aria-controls': idInner
555
- },
556
- on: {
557
- click: handler,
558
- keydown: handler
559
- },
560
- key: `slide_${i}`
561
- });
562
- }));
563
- const on = {
564
- mouseenter: noHoverPause ? noop : pause,
565
- mouseleave: noHoverPause ? noop : restart,
566
- focusin: pause,
567
- focusout: restart,
568
- keydown: event => {
569
- /* istanbul ignore next */
570
- if (/input|textarea/i.test(event.target.tagName)) {
571
- return;
572
- }
573
- const {
574
- keyCode
575
- } = event;
576
- if (keyCode === CODE_LEFT || keyCode === CODE_RIGHT) {
577
- stopEvent(event);
578
- this[keyCode === CODE_LEFT ? 'prev' : 'next']();
579
- }
580
- }
581
- };
582
- // Touch support event handlers for environment
583
- if (HAS_TOUCH_SUPPORT && !noTouch) {
584
- // Attach appropriate listeners (prepend event name with '&' for passive mode)
585
- /* istanbul ignore next: JSDOM doesn't support touch events */
586
- if (HAS_POINTER_EVENT_SUPPORT) {
587
- on['&pointerdown'] = touchStart;
588
- on['&pointerup'] = touchEnd;
589
- } else {
590
- on['&touchstart'] = touchStart;
591
- on['&touchmove'] = this.touchMove;
592
- on['&touchend'] = touchEnd;
593
- }
594
- }
595
-
596
- // Return the carousel
597
- return h('div', {
598
- staticClass: 'carousel',
599
- class: {
600
- slide: !noAnimation,
601
- 'carousel-fade': !noAnimation && this.fade,
602
- 'pointer-event': HAS_TOUCH_SUPPORT && HAS_POINTER_EVENT_SUPPORT && !noTouch
603
- },
604
- style: {
605
- background
606
- },
607
- attrs: {
608
- role: 'region',
609
- id: this.safeId(),
610
- 'aria-busy': isSliding ? 'true' : 'false'
611
- },
612
- on
613
- }, [$inner, $controls, $indicators]);
614
- }
615
- });
616
-
617
- export { BCarousel, props };
@@ -1,14 +0,0 @@
1
- import { BCarousel } from './carousel';
2
- export { BCarousel } from './carousel';
3
- import { BCarouselSlide } from './carousel-slide';
4
- export { BCarouselSlide } from './carousel-slide';
5
- import { pluginFactory } from '../../utils/plugins';
6
-
7
- const CarouselPlugin = /*#__PURE*/pluginFactory({
8
- components: {
9
- BCarousel,
10
- BCarouselSlide
11
- }
12
- });
13
-
14
- export { CarouselPlugin };
@@ -1,3 +0,0 @@
1
- The carousel is a slideshow for cycling through a series of content, built with CSS 3D
2
- transforms. It works with a series of images, text, or custom markup. It also includes support
3
- for previous/next controls and indicators.
@@ -1,29 +0,0 @@
1
- .carousel-control-prev,
2
- .carousel-control-next,
3
- .carousel-indicators li {
4
- &:focus {
5
- @include gl-focus;
6
- }
7
- }
8
-
9
- // Make size of focus border on indicator and prev/next button equal to themselves
10
- .carousel-indicators li {
11
- @apply gl-border-t-0 gl-border-b-0;
12
- margin-bottom: 10px;
13
- }
14
-
15
- .carousel-control-prev {
16
- margin-left: 7%;
17
- }
18
-
19
- .carousel-control-next {
20
- margin-right: 7%;
21
- }
22
-
23
- .carousel-control-prev,
24
- .carousel-control-next {
25
- width: auto;
26
- top: 50%;
27
- bottom: auto;
28
- transform: translateY(-50%);
29
- }
@@ -1,19 +0,0 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
- <script>
3
- import { BCarousel } from '../../../vendor/bootstrap-vue/src/components/carousel/carousel';
4
-
5
- export default {
6
- name: 'GlCarousel',
7
- components: {
8
- BCarousel,
9
- },
10
- };
11
- </script>
12
- <template>
13
- <b-carousel v-bind="$attrs" v-on="$listeners">
14
- <!-- eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots -->
15
- <template v-for="slot in Object.keys($slots)" #[slot]>
16
- <slot :name="slot"></slot>
17
- </template>
18
- </b-carousel>
19
- </template>
@@ -1,18 +0,0 @@
1
- <script>
2
- import { BCarouselSlide } from '../../../vendor/bootstrap-vue/src/components/carousel/carousel-slide';
3
-
4
- export default {
5
- name: 'GlCarouselSlide',
6
- components: {
7
- BCarouselSlide,
8
- },
9
- };
10
- </script>
11
- <template>
12
- <b-carousel-slide v-bind="$attrs" v-on="$listeners">
13
- <!-- eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots -->
14
- <template v-for="slot in Object.keys($slots)" #[slot]>
15
- <slot :name="slot"></slot>
16
- </template>
17
- </b-carousel-slide>
18
- </template>