Skip to content

Commit

Permalink
Merge branch 'main' into fix/node-version-in-test-workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelGondi authored Jan 23, 2025
2 parents c59e199 + 2f07c28 commit 783ae8e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sysvale/cuida",
"version": "3.77.1",
"version": "3.78.1",
"description": "A design system built by Sysvale, using storybook and Vue components",
"repository": {
"type": "git",
Expand Down
25 changes: 23 additions & 2 deletions src/components/Modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
:text="cancelButtonText"
secondary
:disabled="disableCancelButton"
@click="!disableCancelButton ? closeHandle() : false"
@click="!disableCancelButton ? cancelHandle() : false"
/>

<cds-button
Expand Down Expand Up @@ -155,6 +155,13 @@ export default {
type: Boolean,
default: false,
},
/**
* Controla a ação de fechar o modal ao clicar no botão de cancelar.
*/
noCloseCancelButton: {
type: Boolean,
default: false,
},
/**
* Controla a exibição do botão de fechar do modal.
*/
Expand Down Expand Up @@ -218,7 +225,7 @@ export default {
return {
innerValue: false,
tmp: '',
}
};
},

computed: {
Expand Down Expand Up @@ -263,6 +270,20 @@ export default {
}
this.$emit('ok', true);
},

cancelHandle() {
/**
* Evento que indica se o botão de cancelamento do modal foi clicado.
* @event cancel
* @type {Event}
*/
if (!this.noCloseCancelButton) {
this.innerValue = !this.innerValue;
this.$emit('close', true);
this.$emit('update:modelValue', false);
}
this.$emit('cancel');
},
},
};
</script>
Expand Down
3 changes: 3 additions & 0 deletions src/stories/components/Modal.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ export const Template = (args) => ({
<cds-modal
v-bind="args"
v-model="showModal"
@ok="console.info('evento ok emitido!')"
@cancel="console.info('evento cancelar emitido!')"
@close="console.info('evento de fechamento de modal emitido!')"
>
<span>
Mussum Ipsum, cacilds vidis litro abertis. A ordem dos tratores não altera o pão duris.Tá deprimidis,
Expand Down

0 comments on commit 783ae8e

Please sign in to comment.