Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/.docgen/components-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2122,10 +2122,10 @@
},
"CdsCarousel": {
"name": "CdsCarousel",
"description": "O Carousel é um componente que permite a exibição de uma série de conteúdos\n(imagens, textos, cards, etc.) em um formato deslizante.",
"tags": {},
"exportName": "default",
"displayName": "Carousel",
"description": "",
"tags": {},
"props": [
{
"name": "items",
Expand Down Expand Up @@ -2205,7 +2205,7 @@
"description": "Evento emitido quando algum item do carrossel é clicado.",
"type": {
"names": [
"Event"
"any"
]
}
}
Expand Down Expand Up @@ -2233,9 +2233,9 @@
},
"CdsCarouselController": {
"displayName": "CdsCarouselController",
"exportName": "default",
"description": "",
"description": "CarouselControllers são componentes utilizados para controlar a exibição\nde elementos em carrosséis, informando a página atual ou o intervalo de itens sendo exibidos.",
"tags": {},
"exportName": "default",
"props": [
{
"name": "propertyName",
Expand Down
3 changes: 2 additions & 1 deletion docs/components/containers/carousel-controller.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ CarouselControllers são componentes utilizados para controlar a exibição de e

## Uso

```js
```html
<CdsCarouselController
:total="12"
:perPage="4"
property-name="itens"
@click-back="clickBackHandler"
@click-forward="clickForwardHandler"
/>
Expand Down
18 changes: 12 additions & 6 deletions docs/components/display/carousel.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,19 @@ O Carousel é um componente que permite a exibição de uma série de conteúdos

## Uso

```js
```html
<CdsCarousel
variant="green"
size="md"
text="Lorem Ipsum"
@click="carouselClick = true"
/>
:items="items"
@item-click="handleItemClick"
>
<template #default="{ item }">
<CdsImage
:src="item"
width="300"
height="400"
/>
</template>
</CdsCarousel>
```

---
Expand Down
12 changes: 8 additions & 4 deletions src/components/Carousel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ import useIsMobile from '../utils/composables/useIsMobile';
import { ref, computed } from 'vue';
import Icon from './Icon.vue';

/**
* O Carousel é um componente que permite a exibição de uma série de conteúdos
* (imagens, textos, cards, etc.) em um formato deslizante.
*/
defineOptions({ name: 'CdsCarousel' });

const props = defineProps({
Expand Down Expand Up @@ -111,10 +115,10 @@ const props = defineProps({

const emit = defineEmits([
/**
* Evento emitido quando algum item do carrossel é clicado.
* @event item-click
* @type {Event}
*/
* Evento emitido quando algum item do carrossel é clicado.
* @event item-click
* @type {any}
*/
'item-click',
]);

Expand Down
4 changes: 4 additions & 0 deletions src/components/CarouselController.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
</template>

<script>
/**
* CarouselControllers são componentes utilizados para controlar a exibição
* de elementos em carrosséis, informando a página atual ou o intervalo de itens sendo exibidos.
*/
export default {
name: 'CdsCarouselController',
props: {
Expand Down
9 changes: 8 additions & 1 deletion src/tests/DateInput.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, test, expect, beforeEach, vi } from 'vitest';
import { describe, test, expect, beforeEach, afterEach, vi } from 'vitest';
import { mount } from '@vue/test-utils';
import DateInput from '../components/DateInput.vue'; // Ajuste o caminho conforme necessário
import CdsBaseInput from '../components/BaseInput.vue';
Expand All @@ -8,6 +8,9 @@ describe('DateInput', () => {
let wrapper;

beforeEach(() => {
vi.useFakeTimers();
vi.setSystemTime(new Date('2026-02-01T12:00:00Z'));

wrapper = mount(DateInput, {
props: {
label: 'Selecione uma data',
Expand Down Expand Up @@ -93,4 +96,8 @@ describe('DateInput', () => {

expect(wrapper.findComponent(CdsBaseInput).props('floatingLabel')).toBe(true);
});

afterEach(() => {
vi.useRealTimers();
});
});