Skip to content

Commit

Permalink
refactor(VCarousel): tuning pass (#15197)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnleider committed Jun 22, 2022
1 parent 154568a commit 4eadb46
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 279 deletions.
6 changes: 5 additions & 1 deletion packages/docs/src/pages/en/components/carousels.md
Expand Up @@ -14,14 +14,18 @@ related:

The `v-carousel` component is used to display large numbers of visual content on a rotating timer.

<entry />
![carousel Entry](https://cdn.vuetifyjs.com/docs/images/components-temp/v-carousel/v-carousel-entry.png)

---

## Usage

The `v-carousel` component expands upon `v-window` by providing additional features targeted at displaying images.

<example file="v-carousel/usage" />

<entry />

## API

<api-inline />
Expand Down
8 changes: 5 additions & 3 deletions packages/vuetify/src/components/VCarousel/VCarousel.tsx
Expand Up @@ -8,17 +8,17 @@ import { VProgressLinear } from '@/components/VProgressLinear'
import { VWindow } from '@/components/VWindow'

// Composables
import { IconValue } from '@/composables/icons'
import { useLocale } from '@/composables/locale'
import { useProxiedModel } from '@/composables/proxiedModel'
import { IconValue } from '@/composables/icons'

// Utilities
import { convertToUnit, defineComponent, useRender } from '@/util'
import { onMounted, ref, watch } from 'vue'

// Types
import type { PropType } from 'vue'
import type { GroupProvide } from '@/composables/group'
import type { PropType } from 'vue'

export const VCarousel = defineComponent({
name: 'VCarousel',
Expand Down Expand Up @@ -94,8 +94,8 @@ export const VCarousel = defineComponent({
]}
style={{ height: convertToUnit(props.height) }}
continuous
showArrows={ props.showArrows }
mandatory="force"
showArrows={ props.showArrows }
>
{{
default: slots.default,
Expand Down Expand Up @@ -151,5 +151,7 @@ export const VCarousel = defineComponent({
}}
</VWindow>
))

return {}
},
})
5 changes: 1 addition & 4 deletions packages/vuetify/src/components/VCarousel/VCarouselItem.tsx
Expand Up @@ -17,10 +17,7 @@ export const VCarouselItem = defineComponent({
setup (props, { slots, attrs }) {
useRender(() => (
<VWindowItem class="v-carousel-item" value={ props.value }>
<VImg
{ ...attrs }
v-slots={ slots }
/>
<VImg { ...attrs } v-slots={ slots } />
</VWindowItem>
))
},
Expand Down
@@ -0,0 +1,14 @@
/// <reference types="../../../../types/cypress" />

import { VCarousel } from '..'
import { generate } from '@/../cypress/templates'

const props = {}

const stories = {
Default: <VCarousel />,
}
// Tests
describe('VCarousel', () => {
generate({ stories, props, component: VCarousel })
})
208 changes: 0 additions & 208 deletions packages/vuetify/src/components/VCarousel/__tests__/VCarousel.spec.ts

This file was deleted.

@@ -0,0 +1,18 @@
/// <reference types="../../../../types/cypress" />

import { VCarousel, VCarouselItem } from '..'
import { generate } from '@/../cypress/templates'

const props = {}

const stories = {
Default: (
<VCarousel>
<VCarouselItem />
</VCarousel>
),
}
// Tests
describe('VCarouselItem', () => {
generate({ stories, props, component: VCarouselItem })
})

This file was deleted.

This file was deleted.

1 change: 1 addition & 0 deletions packages/vuetify/src/components/VCarousel/_variables.scss
@@ -1,3 +1,4 @@
// VCarousel
$carousel-controls-bg: rgba(var(--v-theme-surface-variant), .3) !default;
$carousel-controls-size: 50px !default;
$carousel-dot-margin: 0 8px !default;
Expand Down

0 comments on commit 4eadb46

Please sign in to comment.