v-sistec-features 1.31.13 → 1.32.0
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/dist/DataAgenda/VDataAgenda.vue.d.ts +915 -0
- package/dist/DataAgenda/components/AgendaMatrix.vue.d.ts +64 -0
- package/dist/DataAgenda/components/AgendaMatrixBase.vue.d.ts +31 -0
- package/dist/DataAgenda/components/AgendaMatrixUnico.vue.d.ts +72 -0
- package/dist/DataAgenda/components/AgendaTabelaHorario.vue.d.ts +32 -0
- package/dist/DataAgenda/components/AgendaVueCal.vue.d.ts +94 -0
- package/dist/DataAgenda/components/BlocoArrastavel.vue.d.ts +37 -0
- package/dist/DataAgenda/components/HeaderCalendario.vue.d.ts +7 -0
- package/dist/DataAgenda/components/HeaderTabela.vue.d.ts +7 -0
- package/dist/DataAgenda/components/ModalDetalhesReserva.vue.d.ts +38 -0
- package/dist/DataAgenda/components/ModalReserva.vue.d.ts +157 -0
- package/dist/DataAgenda/composables/useAgenda.d.ts +24 -0
- package/dist/DataAgenda/composables/useCoresAgenda.d.ts +7 -0
- package/dist/DataAgenda/composables/useGradeCompartilhada.d.ts +23 -0
- package/dist/DataAgenda/composables/useSelecaoArrasto.d.ts +24 -0
- package/dist/DataAgenda/index.d.ts +2 -0
- package/dist/DataPageVue/components/VDataPage.vue.d.ts +50 -0
- package/dist/DataPageVue/index.d.ts +2 -0
- package/dist/DataPageVue/types/v-data-page.d.ts +53 -0
- package/dist/DatatableVue/components/SearchDatatable.vue.d.ts +28 -0
- package/dist/DatatableVue/components/VColumn.vue.d.ts +82 -0
- package/dist/DatatableVue/components/VColumnManager.vue.d.ts +21 -0
- package/dist/DatatableVue/components/VDataTable.vue.d.ts +57 -0
- package/dist/DatatableVue/components/VDataTableLoading.vue.d.ts +17 -0
- package/dist/DatatableVue/components/VOrderingIcon.vue.d.ts +10 -0
- package/dist/DatatableVue/components/VThDataTable.vue.d.ts +14 -0
- package/dist/DatatableVue/composables/useCheckBox.d.ts +11 -0
- package/dist/DatatableVue/composables/useDataTableConfig.d.ts +4 -0
- package/dist/DatatableVue/composables/useDataTableFetch.d.ts +17 -0
- package/dist/DatatableVue/composables/useExpandedItem.d.ts +6 -0
- package/dist/DatatableVue/composables/useImagePreview.d.ts +9 -0
- package/dist/DatatableVue/config/datatableConfig.d.ts +4 -0
- package/dist/DatatableVue/config/datatableDefaults.d.ts +7 -0
- package/dist/DatatableVue/index.d.ts +3 -0
- package/dist/DatatableVue/keys.d.ts +39 -0
- package/dist/DatatableVue/style/svgs.d.ts +20 -0
- package/dist/DatatableVue/types/v-data-table.d.ts +161 -0
- package/dist/Modals/components/BotaoFechar.vue.d.ts +36 -0
- package/dist/Modals/components/ModalAviso.vue.d.ts +184 -0
- package/dist/Modals/components/ModalBaseDefault.vue.d.ts +244 -0
- package/dist/Modals/components/ModalConfirmacao.vue.d.ts +184 -0
- package/dist/Modals/components/ModalConfirmacaoCheckbox.vue.d.ts +195 -0
- package/dist/Modals/components/ModalConfirmacaoInput.vue.d.ts +238 -0
- package/dist/Modals/components/ModalConfirmacaoSimples.vue.d.ts +187 -0
- package/dist/Modals/components/ModalInformacao.vue.d.ts +184 -0
- package/dist/Modals/components/ModalPerigo.vue.d.ts +175 -0
- package/dist/Modals/components/ModalSucesso.vue.d.ts +175 -0
- package/dist/Modals/components/interno/ModalDialogoInterno.vue.d.ts +205 -0
- package/dist/Modals/index.d.ts +12 -0
- package/dist/Modals.js +1361 -0
- package/dist/Pagination/Pagination.vue.d.ts +19 -0
- package/dist/Pagination/index.d.ts +2 -0
- package/dist/{Pagination-f4FVE5TX.js → Pagination-D96eBRod.js} +25 -25
- package/dist/Pagination.js +1 -1
- package/dist/{ar-Bg_10XBG.js → ar-CtSPmWrk.js} +0 -5
- package/dist/{bg-DyIRbFaU.js → bg-DwW4tkzm.js} +0 -5
- package/dist/{bn-DrKXkRvN.js → bn-Df__ccyH.js} +0 -5
- package/dist/{bs-BF8upphm.js → bs-j17x02qr.js} +0 -5
- package/dist/{ca-CGMnsdII.js → ca-B94lUx7c.js} +0 -5
- package/dist/core/index.d.ts +1 -0
- package/dist/core/plugin.d.ts +11 -0
- package/dist/core.js +1 -1
- package/dist/{cs-B-jeNB5o.js → cs-DeDzN7tG.js} +0 -5
- package/dist/{da-BoHemyXx.js → da-DMpC5y8O.js} +0 -5
- package/dist/datatableConfig-E5_08Ch4.js +4 -0
- package/dist/{de-DNAaiTrc.js → de-CCNUZSup.js} +0 -5
- package/dist/{el-Cpg3pI7i.js → el-C2kkX76k.js} +0 -5
- package/dist/{en-gb-KsKdvLmV.js → en-gb-sbYhvlrM.js} +0 -5
- package/dist/{es-COziTcsp.js → es-mNgFJGue.js} +0 -5
- package/dist/{et-BdTtu9t_.js → et-D0ro6m_Z.js} +0 -5
- package/dist/{fa-B1Ebp36t.js → fa-DYekHC6-.js} +0 -5
- package/dist/{fi-b4XodxNE.js → fi-CNexLCO_.js} +0 -5
- package/dist/{fr-BIx4sO6s.js → fr-CUXtdWLj.js} +0 -5
- package/dist/{he-rf_Y5d64.js → he-D4BblsAD.js} +0 -5
- package/dist/{hr-DOuJJGF3.js → hr-1MNJjxDo.js} +0 -5
- package/dist/{hu-DMc8kv_1.js → hu-BiG8mSvH.js} +0 -5
- package/dist/{id-DclBfDY0.js → id-CABEuSQB.js} +0 -5
- package/dist/iframeCommunicator/index.d.ts +2 -0
- package/dist/iframeCommunicator/useIframeCommunicator.d.ts +8 -0
- package/dist/iframeCommunicator/useThemeFromParent.d.ts +9 -0
- package/dist/index.d.ts +3 -140
- package/dist/index.js +1 -1
- package/dist/{is-hPcr999q.js → is-DBUkoxb1.js} +0 -5
- package/dist/{it-Dfz57Ogc.js → it-Am_Oo5d5.js} +0 -5
- package/dist/{ja-Da6Dbgu8.js → ja-C4aaunra.js} +0 -5
- package/dist/{ka-DK-BKZD4.js → ka-CkzS4fNj.js} +0 -5
- package/dist/{kaa-BVd8dKz3.js → kaa-GTw11GU-.js} +0 -5
- package/dist/{kk-eE3-SI4R.js → kk-BRFq2Ctd.js} +0 -5
- package/dist/{ko-CUMtwCHy.js → ko-BbgS6BMk.js} +0 -5
- package/dist/{ky-CCU0MYbD.js → ky-ClK6HL0m.js} +0 -5
- package/dist/{lt-CpbQmiiW.js → lt-BE0ahgri.js} +0 -5
- package/dist/{mn-YYwo93uK.js → mn-C-Ktk8ht.js} +0 -5
- package/dist/{nl-WqtgByJL.js → nl-BiG9OH1y.js} +0 -5
- package/dist/{no-BOG8-aOm.js → no-DVdX7xTS.js} +0 -5
- package/dist/{pl-BH4AyCMF.js → pl-y_N8wVAF.js} +0 -5
- package/dist/plugin-BZB7f-c3.js +3444 -0
- package/dist/{pt-br-siyrXjdv.js → pt-br-Cx8Akpcu.js} +0 -5
- package/dist/{pt-pt-siyrXjdv.js → pt-pt-Cx8Akpcu.js} +0 -5
- package/dist/{ro-C9fU41Qi.js → ro-FfAZHwo1.js} +0 -5
- package/dist/{ru-_d_rl3a5.js → ru-BCE9k5uo.js} +0 -5
- package/dist/{sk-ZT421l3d.js → sk-D-7bEf3b.js} +0 -5
- package/dist/{sl-Ct8Gi5v1.js → sl-DoVrM4Ht.js} +0 -5
- package/dist/{sq-Cw7PWK-V.js → sq-Du8jVeq7.js} +0 -5
- package/dist/{sr-DO-S1wn3.js → sr-DP3yke6-.js} +0 -5
- package/dist/{sv-NXMCPui2.js → sv-C2iGWFqL.js} +0 -5
- package/dist/toast/components/ToastComponent.vue.d.ts +6 -0
- package/dist/toast/index.d.ts +1 -0
- package/dist/toast/useToastStore.d.ts +11 -0
- package/dist/toast.js +2 -2
- package/dist/{tr-BpieMIth.js → tr-CvlANdCR.js} +0 -5
- package/dist/{uk-CqVU4EoZ.js → uk-CxFb8w2s.js} +0 -5
- package/dist/utils/svgFactory.d.ts +8 -0
- package/dist/{uz-CmcB22-w.js → uz-DmJPqTjK.js} +0 -5
- package/dist/{uz-cryl-C_GBVdXl.js → uz-cryl-Dt065WNc.js} +0 -5
- package/dist/v-sistec-features.css +1 -11
- package/dist/vDataAgenda.js +1877 -1885
- package/dist/vDataPage.js +31 -41
- package/dist/vDataTable.js +43 -43
- package/dist/{vi-C9wTd3fG.js → vi-B8R5Ozvj.js} +0 -5
- package/dist/{zh-cn-DY7nkJwf.js → zh-cn-DnUuIcqx.js} +0 -5
- package/dist/{zh-hk-KkazoDdS.js → zh-hk-mDkIkhi9.js} +0 -5
- package/package.json +5 -1
- package/src/DataAgenda/VDataAgenda.vue +233 -77
- package/src/DataAgenda/components/AgendaMatrix.vue +1 -0
- package/src/DataAgenda/components/AgendaMatrixBase.vue +357 -140
- package/src/DataAgenda/components/AgendaMatrixUnico.vue +1 -0
- package/src/DataAgenda/components/AgendaTabelaHorario.vue +489 -316
- package/src/DataAgenda/components/AgendaVueCal.vue +1 -0
- package/src/DataAgenda/index.ts +2 -1
- package/src/Modals/components/BotaoFechar.vue +74 -0
- package/src/Modals/components/ModalAviso.vue +129 -0
- package/src/Modals/components/ModalBaseDefault.vue +374 -0
- package/src/Modals/components/ModalConfirmacao.vue +129 -0
- package/src/Modals/components/ModalConfirmacaoCheckbox.vue +155 -0
- package/src/Modals/components/ModalConfirmacaoInput.vue +200 -0
- package/src/Modals/components/ModalConfirmacaoSimples.vue +306 -0
- package/src/Modals/components/ModalInformacao.vue +129 -0
- package/src/Modals/components/ModalPerigo.vue +123 -0
- package/src/Modals/components/ModalSucesso.vue +123 -0
- package/src/Modals/components/interno/ModalDialogoInterno.vue +365 -0
- package/src/Modals/index.ts +32 -0
- package/src/core/plugin.ts +34 -41
- package/src/types/global.d.ts +7 -1
- package/dist/Pagination.d.ts +0 -27
- package/dist/core.d.ts +0 -117
- package/dist/datatableConfig-BMFlKtgh.js +0 -4
- package/dist/iframeCommunicator.d.ts +0 -22
- package/dist/plugin-BwqrOSD_.js +0 -2097
- package/dist/toast.d.ts +0 -19
- package/dist/vDataAgenda.d.ts +0 -929
- package/dist/vDataPage.d.ts +0 -117
- package/dist/vDataTable.d.ts +0 -294
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
========
|
|
3
|
+
Modal clássico de confirmação de ações positivas (Brand / Primary).
|
|
4
|
+
Ideal para confirmar reservas, envios de formulário ou alterações gerais sem conotação de erro.
|
|
5
|
+
========
|
|
6
|
+
-->
|
|
7
|
+
<template>
|
|
8
|
+
<ModalDialogoInterno
|
|
9
|
+
v-model="exibirModal"
|
|
10
|
+
:tamanho="tamanho"
|
|
11
|
+
:cor-topo="corTema"
|
|
12
|
+
:cor-botao-confirmar="corTema"
|
|
13
|
+
:titulo="titulo"
|
|
14
|
+
:descricao="descricao"
|
|
15
|
+
:texto-cancelar="textoCancelar"
|
|
16
|
+
:texto-confirmar="textoConfirmar"
|
|
17
|
+
:mostrar-botao-cancelar="mostrarBotaoCancelar"
|
|
18
|
+
:mostrar-botao-confirmar="mostrarBotaoConfirmar"
|
|
19
|
+
:mostrar-botao-fechar="mostrarBotaoFechar"
|
|
20
|
+
:fechar-ao-clicar-fora="fecharAoClicarFora"
|
|
21
|
+
:fechar-com-esc="fecharComEsc"
|
|
22
|
+
:fechar-ao-confirmar="fecharAoConfirmar"
|
|
23
|
+
:desabilitar-confirmar="desabilitarConfirmar"
|
|
24
|
+
:carregando="carregando"
|
|
25
|
+
@confirmar="emit('confirmar')"
|
|
26
|
+
@cancelar="emit('cancelar')"
|
|
27
|
+
@fechar="emit('fechar')"
|
|
28
|
+
>
|
|
29
|
+
<template #icone>
|
|
30
|
+
<slot name="icone">
|
|
31
|
+
<IconHelpCircle
|
|
32
|
+
class="icon mb-2 icone-destaque"
|
|
33
|
+
:class="corTema === 'brand' ? '' : `text-${corTema}`"
|
|
34
|
+
:style="corTema === 'brand' ? { color: 'var(--color-brand, var(--tblr-primary))' } : {}"
|
|
35
|
+
stroke-width="1.5"
|
|
36
|
+
/>
|
|
37
|
+
</slot>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<template v-if="slots.titulo" #titulo>
|
|
41
|
+
<slot name="titulo"></slot>
|
|
42
|
+
</template>
|
|
43
|
+
|
|
44
|
+
<template v-if="slots.default" #default>
|
|
45
|
+
<slot></slot>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<template v-if="slots.conteudo" #conteudo>
|
|
49
|
+
<slot name="conteudo"></slot>
|
|
50
|
+
</template>
|
|
51
|
+
|
|
52
|
+
<template v-if="slots.extra" #extra>
|
|
53
|
+
<slot name="extra"></slot>
|
|
54
|
+
</template>
|
|
55
|
+
|
|
56
|
+
<template v-if="slots['botoes-esquerda']" #botoes-esquerda="escopo">
|
|
57
|
+
<slot name="botoes-esquerda" v-bind="escopo"></slot>
|
|
58
|
+
</template>
|
|
59
|
+
|
|
60
|
+
<template v-if="slots['botoes-meio']" #botoes-meio="escopo">
|
|
61
|
+
<slot name="botoes-meio" v-bind="escopo"></slot>
|
|
62
|
+
</template>
|
|
63
|
+
|
|
64
|
+
<template v-if="slots['botoes-direita']" #botoes-direita="escopo">
|
|
65
|
+
<slot name="botoes-direita" v-bind="escopo"></slot>
|
|
66
|
+
</template>
|
|
67
|
+
|
|
68
|
+
<template v-if="slots.footer" #footer="escopo">
|
|
69
|
+
<slot name="footer" v-bind="escopo"></slot>
|
|
70
|
+
</template>
|
|
71
|
+
</ModalDialogoInterno>
|
|
72
|
+
</template>
|
|
73
|
+
|
|
74
|
+
<script setup lang="ts">
|
|
75
|
+
import { computed, useSlots } from "vue";
|
|
76
|
+
import { IconHelpCircle } from "@tabler/icons-vue";
|
|
77
|
+
import ModalDialogoInterno, { type EscopoRodapeModal } from "./interno/ModalDialogoInterno.vue";
|
|
78
|
+
|
|
79
|
+
// Tipagem dos slots aceitos pelo componente
|
|
80
|
+
defineSlots<{
|
|
81
|
+
default?: (props: {}) => any;
|
|
82
|
+
icone?: (props: {}) => any;
|
|
83
|
+
titulo?: (props: {}) => any;
|
|
84
|
+
conteudo?: (props: {}) => any;
|
|
85
|
+
extra?: (props: {}) => any;
|
|
86
|
+
"botoes-esquerda"?: (props: EscopoRodapeModal) => any;
|
|
87
|
+
"botoes-meio"?: (props: EscopoRodapeModal) => any;
|
|
88
|
+
"botoes-direita"?: (props: EscopoRodapeModal) => any;
|
|
89
|
+
footer?: (props: EscopoRodapeModal) => any;
|
|
90
|
+
}>();
|
|
91
|
+
|
|
92
|
+
// Instância de slots para verificação segura no template
|
|
93
|
+
const slots = useSlots();
|
|
94
|
+
|
|
95
|
+
// Propriedades de configuração do modal de confirmação positiva
|
|
96
|
+
const props = defineProps({
|
|
97
|
+
modelValue: { type: Boolean, default: false },
|
|
98
|
+
tamanho: { type: String as () => "sm" | "md" | "lg", default: "sm" },
|
|
99
|
+
corTema: { type: String as () => "brand" | "primary" | "info" | "success", default: "brand" },
|
|
100
|
+
titulo: { type: String, default: "Confirmar ação?" },
|
|
101
|
+
descricao: { type: String, default: "Deseja realmente prosseguir com esta operação?" },
|
|
102
|
+
textoCancelar: { type: String, default: "Cancelar" },
|
|
103
|
+
textoConfirmar: { type: String, default: "Confirmar" },
|
|
104
|
+
mostrarBotaoCancelar: { type: Boolean, default: true },
|
|
105
|
+
mostrarBotaoConfirmar: { type: Boolean, default: true },
|
|
106
|
+
mostrarBotaoFechar: { type: Boolean, default: true },
|
|
107
|
+
fecharAoClicarFora: { type: Boolean, default: true },
|
|
108
|
+
fecharComEsc: { type: Boolean, default: true },
|
|
109
|
+
fecharAoConfirmar: { type: Boolean, default: false },
|
|
110
|
+
desabilitarConfirmar: { type: Boolean, default: false },
|
|
111
|
+
carregando: { type: Boolean, default: false }
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
// Eventos emitidos para o componente pai
|
|
115
|
+
const emit = defineEmits(["update:modelValue", "confirmar", "cancelar", "fechar"]);
|
|
116
|
+
|
|
117
|
+
// Sincroniza o estado de abertura do modal
|
|
118
|
+
const exibirModal = computed({
|
|
119
|
+
get: () => props.modelValue,
|
|
120
|
+
set: (valor: boolean) => emit("update:modelValue", valor)
|
|
121
|
+
});
|
|
122
|
+
</script>
|
|
123
|
+
|
|
124
|
+
<style scoped>
|
|
125
|
+
.icone-destaque {
|
|
126
|
+
width: 3.5rem;
|
|
127
|
+
height: 3.5rem;
|
|
128
|
+
}
|
|
129
|
+
</style>
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
========
|
|
3
|
+
Modal de segurança com trava de confirmação por checkbox.
|
|
4
|
+
Mantém o botão de ação principal desabilitado até que o usuário marque a caixa de verificação,
|
|
5
|
+
resetando o estado automaticamente ao abrir.
|
|
6
|
+
========
|
|
7
|
+
-->
|
|
8
|
+
<template>
|
|
9
|
+
<ModalDialogoInterno
|
|
10
|
+
v-model="exibirModal"
|
|
11
|
+
:tamanho="tamanho"
|
|
12
|
+
:cor-topo="corTema"
|
|
13
|
+
:cor-botao-confirmar="corTema"
|
|
14
|
+
:titulo="titulo"
|
|
15
|
+
:descricao="descricao"
|
|
16
|
+
:texto-cancelar="textoCancelar"
|
|
17
|
+
:texto-confirmar="textoConfirmar"
|
|
18
|
+
:mostrar-botao-cancelar="mostrarBotaoCancelar"
|
|
19
|
+
:mostrar-botao-confirmar="mostrarBotaoConfirmar"
|
|
20
|
+
:mostrar-botao-fechar="mostrarBotaoFechar"
|
|
21
|
+
:fechar-ao-clicar-fora="fecharAoClicarFora"
|
|
22
|
+
:fechar-com-esc="fecharComEsc"
|
|
23
|
+
:fechar-ao-confirmar="fecharAoConfirmar"
|
|
24
|
+
:desabilitar-confirmar="!confirmacaoMarcada || desabilitarConfirmar"
|
|
25
|
+
:carregando="carregando"
|
|
26
|
+
@confirmar="emit('confirmar')"
|
|
27
|
+
@cancelar="emit('cancelar')"
|
|
28
|
+
@fechar="emit('fechar')"
|
|
29
|
+
>
|
|
30
|
+
<template #icone>
|
|
31
|
+
<slot name="icone">
|
|
32
|
+
<IconAlertTriangle
|
|
33
|
+
class="icon mb-2 icone-destaque"
|
|
34
|
+
:class="corTema === 'brand' ? '' : `text-${corTema}`"
|
|
35
|
+
:style="corTema === 'brand' ? { color: 'var(--color-brand, var(--tblr-primary))' } : {}"
|
|
36
|
+
stroke-width="1.5"
|
|
37
|
+
/>
|
|
38
|
+
</slot>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<template v-if="slots.titulo" #titulo>
|
|
42
|
+
<slot name="titulo"></slot>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<template v-if="slots.default" #default>
|
|
46
|
+
<slot></slot>
|
|
47
|
+
</template>
|
|
48
|
+
|
|
49
|
+
<template v-if="slots.conteudo" #conteudo>
|
|
50
|
+
<slot name="conteudo"></slot>
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
<template #extra>
|
|
54
|
+
<div class="mt-2 text-start d-inline-block">
|
|
55
|
+
<label class="form-check mb-0 user-select-none cursor-pointer">
|
|
56
|
+
<input
|
|
57
|
+
v-model="confirmacaoMarcada"
|
|
58
|
+
class="form-check-input"
|
|
59
|
+
type="checkbox"
|
|
60
|
+
:disabled="carregando"
|
|
61
|
+
/>
|
|
62
|
+
<span class="form-check-label">
|
|
63
|
+
<slot name="texto-checkbox">{{ textoCheckbox }}</slot>
|
|
64
|
+
</span>
|
|
65
|
+
</label>
|
|
66
|
+
</div>
|
|
67
|
+
<slot name="extra"></slot>
|
|
68
|
+
</template>
|
|
69
|
+
|
|
70
|
+
<template v-if="slots['botoes-esquerda']" #botoes-esquerda="escopo">
|
|
71
|
+
<slot name="botoes-esquerda" v-bind="escopo"></slot>
|
|
72
|
+
</template>
|
|
73
|
+
|
|
74
|
+
<template v-if="slots['botoes-meio']" #botoes-meio="escopo">
|
|
75
|
+
<slot name="botoes-meio" v-bind="escopo"></slot>
|
|
76
|
+
</template>
|
|
77
|
+
|
|
78
|
+
<template v-if="slots['botoes-direita']" #botoes-direita="escopo">
|
|
79
|
+
<slot name="botoes-direita" v-bind="escopo"></slot>
|
|
80
|
+
</template>
|
|
81
|
+
|
|
82
|
+
<template v-if="slots.footer" #footer="escopo">
|
|
83
|
+
<slot name="footer" v-bind="escopo"></slot>
|
|
84
|
+
</template>
|
|
85
|
+
</ModalDialogoInterno>
|
|
86
|
+
</template>
|
|
87
|
+
|
|
88
|
+
<script setup lang="ts">
|
|
89
|
+
import { ref, computed, watch, useSlots } from "vue";
|
|
90
|
+
import { IconAlertTriangle } from "@tabler/icons-vue";
|
|
91
|
+
import ModalDialogoInterno, { type EscopoRodapeModal } from "./interno/ModalDialogoInterno.vue";
|
|
92
|
+
|
|
93
|
+
// Tipagem dos slots aceitos pelo componente
|
|
94
|
+
defineSlots<{
|
|
95
|
+
default?: (props: {}) => any;
|
|
96
|
+
icone?: (props: {}) => any;
|
|
97
|
+
titulo?: (props: {}) => any;
|
|
98
|
+
conteudo?: (props: {}) => any;
|
|
99
|
+
"texto-checkbox"?: (props: {}) => any;
|
|
100
|
+
extra?: (props: {}) => any;
|
|
101
|
+
"botoes-esquerda"?: (props: EscopoRodapeModal) => any;
|
|
102
|
+
"botoes-meio"?: (props: EscopoRodapeModal) => any;
|
|
103
|
+
"botoes-direita"?: (props: EscopoRodapeModal) => any;
|
|
104
|
+
footer?: (props: EscopoRodapeModal) => any;
|
|
105
|
+
}>();
|
|
106
|
+
|
|
107
|
+
// Instância de slots para verificação segura no template
|
|
108
|
+
const slots = useSlots();
|
|
109
|
+
|
|
110
|
+
// Propriedades de configuração do modal com trava de checkbox
|
|
111
|
+
const props = defineProps({
|
|
112
|
+
modelValue: { type: Boolean, default: false },
|
|
113
|
+
tamanho: { type: String as () => "sm" | "md" | "lg", default: "sm" },
|
|
114
|
+
corTema: { type: String as () => "danger" | "warning" | "brand", default: "danger" },
|
|
115
|
+
titulo: { type: String, default: "Você tem certeza?" },
|
|
116
|
+
descricao: { type: String, default: "Você realmente deseja deletar este item? Esta ação não pode ser desfeita." },
|
|
117
|
+
textoCheckbox: { type: String, default: "Eu entendo que esta ação não pode ser desfeita" },
|
|
118
|
+
textoCancelar: { type: String, default: "Cancelar" },
|
|
119
|
+
textoConfirmar: { type: String, default: "Deletar" },
|
|
120
|
+
mostrarBotaoCancelar: { type: Boolean, default: true },
|
|
121
|
+
mostrarBotaoConfirmar: { type: Boolean, default: true },
|
|
122
|
+
mostrarBotaoFechar: { type: Boolean, default: true },
|
|
123
|
+
fecharAoClicarFora: { type: Boolean, default: false },
|
|
124
|
+
fecharComEsc: { type: Boolean, default: true },
|
|
125
|
+
fecharAoConfirmar: { type: Boolean, default: false },
|
|
126
|
+
desabilitarConfirmar: { type: Boolean, default: false },
|
|
127
|
+
carregando: { type: Boolean, default: false }
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
// Eventos emitidos para o componente pai
|
|
131
|
+
const emit = defineEmits(["update:modelValue", "confirmar", "cancelar", "fechar"]);
|
|
132
|
+
|
|
133
|
+
// Estado reativo que controla se o usuário marcou o checkbox de ciência
|
|
134
|
+
const confirmacaoMarcada = ref(false);
|
|
135
|
+
|
|
136
|
+
// Sincroniza o estado de abertura do modal
|
|
137
|
+
const exibirModal = computed({
|
|
138
|
+
get: () => props.modelValue,
|
|
139
|
+
set: (valor: boolean) => emit("update:modelValue", valor)
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
// Desmarca o checkbox sempre que o modal é reaberto
|
|
143
|
+
watch(exibirModal, (aberto) => {
|
|
144
|
+
if (aberto) {
|
|
145
|
+
confirmacaoMarcada.value = false;
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
</script>
|
|
149
|
+
|
|
150
|
+
<style scoped>
|
|
151
|
+
.icone-destaque {
|
|
152
|
+
width: 3.5rem;
|
|
153
|
+
height: 3.5rem;
|
|
154
|
+
}
|
|
155
|
+
</style>
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
========
|
|
3
|
+
Modal de confirmação com entrada de texto ou justificativa integrada.
|
|
4
|
+
Permite exigir o preenchimento de um motivo ou palavra-chave exata antes de liberar o botão
|
|
5
|
+
de confirmação, emitindo o texto digitado no evento @confirmar.
|
|
6
|
+
========
|
|
7
|
+
-->
|
|
8
|
+
<template>
|
|
9
|
+
<ModalDialogoInterno
|
|
10
|
+
v-model="exibirModal"
|
|
11
|
+
:tamanho="tamanho"
|
|
12
|
+
:cor-topo="corTema"
|
|
13
|
+
:cor-botao-confirmar="corTema"
|
|
14
|
+
:titulo="titulo"
|
|
15
|
+
:descricao="descricao"
|
|
16
|
+
:texto-cancelar="textoCancelar"
|
|
17
|
+
:texto-confirmar="textoConfirmar"
|
|
18
|
+
:mostrar-botao-cancelar="mostrarBotaoCancelar"
|
|
19
|
+
:mostrar-botao-confirmar="mostrarBotaoConfirmar"
|
|
20
|
+
:mostrar-botao-fechar="mostrarBotaoFechar"
|
|
21
|
+
:fechar-ao-clicar-fora="fecharAoClicarFora"
|
|
22
|
+
:fechar-com-esc="fecharComEsc"
|
|
23
|
+
:fechar-ao-confirmar="false"
|
|
24
|
+
:desabilitar-confirmar="botaoDesabilitado"
|
|
25
|
+
:carregando="carregando"
|
|
26
|
+
@confirmar="dispararConfirmacao"
|
|
27
|
+
@cancelar="emit('cancelar')"
|
|
28
|
+
@fechar="emit('fechar')"
|
|
29
|
+
>
|
|
30
|
+
<template #icone>
|
|
31
|
+
<slot name="icone">
|
|
32
|
+
<IconMessageReport
|
|
33
|
+
class="icon mb-2 icone-destaque"
|
|
34
|
+
:class="corTema === 'brand' ? '' : `text-${corTema}`"
|
|
35
|
+
:style="corTema === 'brand' ? { color: 'var(--color-brand, var(--tblr-primary))' } : {}"
|
|
36
|
+
stroke-width="1.5"
|
|
37
|
+
/>
|
|
38
|
+
</slot>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<template v-if="slots.titulo" #titulo>
|
|
42
|
+
<slot name="titulo"></slot>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<template v-if="slots.default" #default>
|
|
46
|
+
<slot></slot>
|
|
47
|
+
</template>
|
|
48
|
+
|
|
49
|
+
<template #conteudo>
|
|
50
|
+
<label v-if="rotuloInput" class="form-label fw-medium">
|
|
51
|
+
{{ rotuloInput }}
|
|
52
|
+
<span v-if="obrigatorio" class="text-danger">*</span>
|
|
53
|
+
</label>
|
|
54
|
+
|
|
55
|
+
<textarea
|
|
56
|
+
v-if="multiplasLinhas"
|
|
57
|
+
v-model="valorTexto"
|
|
58
|
+
class="form-control"
|
|
59
|
+
:rows="linhasTextarea"
|
|
60
|
+
:placeholder="placeholder"
|
|
61
|
+
:disabled="carregando"
|
|
62
|
+
></textarea>
|
|
63
|
+
|
|
64
|
+
<input
|
|
65
|
+
v-else
|
|
66
|
+
v-model="valorTexto"
|
|
67
|
+
type="text"
|
|
68
|
+
class="form-control"
|
|
69
|
+
:placeholder="placeholder"
|
|
70
|
+
:disabled="carregando"
|
|
71
|
+
@keyup.enter="dispararConfirmacao"
|
|
72
|
+
/>
|
|
73
|
+
|
|
74
|
+
<small v-if="palavraChaveConfirmacao" class="form-hint mt-1 d-block">
|
|
75
|
+
Digite <strong>{{ palavraChaveConfirmacao }}</strong> para liberar a confirmação.
|
|
76
|
+
</small>
|
|
77
|
+
|
|
78
|
+
<slot name="conteudo"></slot>
|
|
79
|
+
</template>
|
|
80
|
+
|
|
81
|
+
<template v-if="slots.extra" #extra>
|
|
82
|
+
<slot name="extra"></slot>
|
|
83
|
+
</template>
|
|
84
|
+
|
|
85
|
+
<template v-if="slots['botoes-esquerda']" #botoes-esquerda="escopo">
|
|
86
|
+
<slot name="botoes-esquerda" v-bind="escopo"></slot>
|
|
87
|
+
</template>
|
|
88
|
+
|
|
89
|
+
<template v-if="slots['botoes-meio']" #botoes-meio="escopo">
|
|
90
|
+
<slot name="botoes-meio" v-bind="escopo"></slot>
|
|
91
|
+
</template>
|
|
92
|
+
|
|
93
|
+
<template v-if="slots['botoes-direita']" #botoes-direita="escopo">
|
|
94
|
+
<slot name="botoes-direita" v-bind="escopo"></slot>
|
|
95
|
+
</template>
|
|
96
|
+
|
|
97
|
+
<template v-if="slots.footer" #footer="escopo">
|
|
98
|
+
<slot name="footer" v-bind="escopo"></slot>
|
|
99
|
+
</template>
|
|
100
|
+
</ModalDialogoInterno>
|
|
101
|
+
</template>
|
|
102
|
+
|
|
103
|
+
<script setup lang="ts">
|
|
104
|
+
import { ref, computed, watch, useSlots } from "vue";
|
|
105
|
+
import { IconMessageReport } from "@tabler/icons-vue";
|
|
106
|
+
import ModalDialogoInterno, { type EscopoRodapeModal } from "./interno/ModalDialogoInterno.vue";
|
|
107
|
+
|
|
108
|
+
// Tipagem dos slots aceitos pelo componente
|
|
109
|
+
defineSlots<{
|
|
110
|
+
default?: (props: {}) => any;
|
|
111
|
+
icone?: (props: {}) => any;
|
|
112
|
+
titulo?: (props: {}) => any;
|
|
113
|
+
conteudo?: (props: {}) => any;
|
|
114
|
+
extra?: (props: {}) => any;
|
|
115
|
+
"botoes-esquerda"?: (props: EscopoRodapeModal) => any;
|
|
116
|
+
"botoes-meio"?: (props: EscopoRodapeModal) => any;
|
|
117
|
+
"botoes-direita"?: (props: EscopoRodapeModal) => any;
|
|
118
|
+
footer?: (props: EscopoRodapeModal) => any;
|
|
119
|
+
}>();
|
|
120
|
+
|
|
121
|
+
// Instância de slots para verificação segura no template
|
|
122
|
+
const slots = useSlots();
|
|
123
|
+
|
|
124
|
+
// Propriedades de configuração do input e validações do modal
|
|
125
|
+
const props = defineProps({
|
|
126
|
+
modelValue: { type: Boolean, default: false },
|
|
127
|
+
tamanho: { type: String as () => "sm" | "md" | "lg", default: "sm" },
|
|
128
|
+
corTema: { type: String as () => "brand" | "danger" | "warning" | "primary", default: "brand" },
|
|
129
|
+
titulo: { type: String, default: "Informe o motivo" },
|
|
130
|
+
descricao: { type: String, default: "" },
|
|
131
|
+
rotuloInput: { type: String, default: "" },
|
|
132
|
+
placeholder: { type: String, default: "Digite aqui..." },
|
|
133
|
+
multiplasLinhas: { type: Boolean, default: false },
|
|
134
|
+
linhasTextarea: { type: Number, default: 3 },
|
|
135
|
+
obrigatorio: { type: Boolean, default: true },
|
|
136
|
+
palavraChaveConfirmacao: { type: String, default: "" },
|
|
137
|
+
limparAoAbrir: { type: Boolean, default: true },
|
|
138
|
+
textoCancelar: { type: String, default: "Cancelar" },
|
|
139
|
+
textoConfirmar: { type: String, default: "Confirmar" },
|
|
140
|
+
mostrarBotaoCancelar: { type: Boolean, default: true },
|
|
141
|
+
mostrarBotaoConfirmar: { type: Boolean, default: true },
|
|
142
|
+
mostrarBotaoFechar: { type: Boolean, default: true },
|
|
143
|
+
fecharAoClicarFora: { type: Boolean, default: false },
|
|
144
|
+
fecharComEsc: { type: Boolean, default: true },
|
|
145
|
+
fecharAoConfirmar: { type: Boolean, default: false },
|
|
146
|
+
carregando: { type: Boolean, default: false }
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
// Eventos emitidos (confirmar envia o texto digitado como parâmetro)
|
|
150
|
+
const emit = defineEmits<{
|
|
151
|
+
(e: "update:modelValue", valor: boolean): void;
|
|
152
|
+
(e: "confirmar", textoDigitado: string): void;
|
|
153
|
+
(e: "cancelar"): void;
|
|
154
|
+
(e: "fechar"): void;
|
|
155
|
+
}>();
|
|
156
|
+
|
|
157
|
+
// Armazena o texto digitado pelo usuário no campo do modal
|
|
158
|
+
const valorTexto = ref("");
|
|
159
|
+
|
|
160
|
+
// Controla a visibilidade do modal
|
|
161
|
+
const exibirModal = computed({
|
|
162
|
+
get: () => props.modelValue,
|
|
163
|
+
set: (valor: boolean) => emit("update:modelValue", valor)
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
// Limpa o campo de texto automaticamente ao abrir o modal
|
|
167
|
+
watch(exibirModal, (aberto) => {
|
|
168
|
+
if (aberto && props.limparAoAbrir) {
|
|
169
|
+
valorTexto.value = "";
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
// Valida se o botão principal deve ficar desabilitado conforme as regras do input
|
|
174
|
+
const botaoDesabilitado = computed(() => {
|
|
175
|
+
const textoLimpo = valorTexto.value.trim();
|
|
176
|
+
if (props.palavraChaveConfirmacao) {
|
|
177
|
+
return textoLimpo !== props.palavraChaveConfirmacao;
|
|
178
|
+
}
|
|
179
|
+
if (props.obrigatorio) {
|
|
180
|
+
return textoLimpo.length === 0;
|
|
181
|
+
}
|
|
182
|
+
return false;
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
// Não recebe parâmetros, não devolve valor e emite o evento confirmar passando o texto preenchido
|
|
186
|
+
function dispararConfirmacao() {
|
|
187
|
+
if (botaoDesabilitado.value || props.carregando) return;
|
|
188
|
+
emit("confirmar", valorTexto.value.trim());
|
|
189
|
+
if (props.fecharAoConfirmar) {
|
|
190
|
+
exibirModal.value = false;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
</script>
|
|
194
|
+
|
|
195
|
+
<style scoped>
|
|
196
|
+
.icone-destaque {
|
|
197
|
+
width: 3.5rem;
|
|
198
|
+
height: 3.5rem;
|
|
199
|
+
}
|
|
200
|
+
</style>
|