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,365 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
========
|
|
3
|
+
Componente base interno para modais de diálogo, alerta e decisão.
|
|
4
|
+
Construído sem dependência de Bootstrap, utilizando Teleport, controle nativo de tecla ESC,
|
|
5
|
+
clique no overlay e estilização compatível com o ModalReserva e Tabler.
|
|
6
|
+
========
|
|
7
|
+
-->
|
|
8
|
+
<template>
|
|
9
|
+
<Teleport to="body">
|
|
10
|
+
<div
|
|
11
|
+
v-if="exibirModal"
|
|
12
|
+
class="modal-overlay"
|
|
13
|
+
@mousedown.self="aoClicarFora"
|
|
14
|
+
>
|
|
15
|
+
<div
|
|
16
|
+
class="modal-card"
|
|
17
|
+
:class="`modal-tamanho-${tamanho}`"
|
|
18
|
+
role="dialog"
|
|
19
|
+
aria-modal="true"
|
|
20
|
+
>
|
|
21
|
+
<div
|
|
22
|
+
v-if="corTopo"
|
|
23
|
+
class="modal-status-topo"
|
|
24
|
+
:class="classeStatusTopo"
|
|
25
|
+
:style="estiloStatusTopo"
|
|
26
|
+
></div>
|
|
27
|
+
|
|
28
|
+
<BotaoFechar
|
|
29
|
+
v-if="mostrarBotaoFechar"
|
|
30
|
+
flutuante
|
|
31
|
+
:desabilitado="carregando"
|
|
32
|
+
@click="cancelarAcao"
|
|
33
|
+
/>
|
|
34
|
+
|
|
35
|
+
<div class="modal-body text-center py-4 px-4">
|
|
36
|
+
<slot name="icone"></slot>
|
|
37
|
+
|
|
38
|
+
<h3 v-if="titulo || slots.titulo" class="modal-titulo-dialogo mb-2">
|
|
39
|
+
<slot name="titulo">{{ titulo }}</slot>
|
|
40
|
+
</h3>
|
|
41
|
+
|
|
42
|
+
<div class="modal-descricao-dialogo">
|
|
43
|
+
<slot>{{ descricao }}</slot>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<div v-if="slots.conteudo" class="mt-3 text-start">
|
|
47
|
+
<slot name="conteudo"></slot>
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
<div v-if="slots.extra" class="mt-3">
|
|
51
|
+
<slot name="extra"></slot>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
<div v-if="!ocultarRodape" class="modal-footer">
|
|
56
|
+
<div class="w-100">
|
|
57
|
+
<div class="row g-2 align-items-center">
|
|
58
|
+
<slot
|
|
59
|
+
name="footer"
|
|
60
|
+
:cancelar="cancelarAcao"
|
|
61
|
+
:confirmar="confirmarAcao"
|
|
62
|
+
>
|
|
63
|
+
<slot
|
|
64
|
+
name="botoes-esquerda"
|
|
65
|
+
:cancelar="cancelarAcao"
|
|
66
|
+
:confirmar="confirmarAcao"
|
|
67
|
+
></slot>
|
|
68
|
+
|
|
69
|
+
<div v-if="mostrarBotaoCancelar" class="col">
|
|
70
|
+
<button
|
|
71
|
+
type="button"
|
|
72
|
+
class="btn w-100 botao-secundario-modal"
|
|
73
|
+
:disabled="carregando"
|
|
74
|
+
@click="cancelarAcao"
|
|
75
|
+
>
|
|
76
|
+
{{ textoCancelar }}
|
|
77
|
+
</button>
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
<slot
|
|
81
|
+
name="botoes-meio"
|
|
82
|
+
:cancelar="cancelarAcao"
|
|
83
|
+
:confirmar="confirmarAcao"
|
|
84
|
+
></slot>
|
|
85
|
+
|
|
86
|
+
<div v-if="mostrarBotaoConfirmar" class="col">
|
|
87
|
+
<button
|
|
88
|
+
type="button"
|
|
89
|
+
class="btn w-100"
|
|
90
|
+
:class="classeBotaoConfirmar"
|
|
91
|
+
:style="estiloBotaoConfirmar"
|
|
92
|
+
:disabled="desabilitarConfirmar || carregando"
|
|
93
|
+
@click="confirmarAcao"
|
|
94
|
+
>
|
|
95
|
+
<span
|
|
96
|
+
v-if="carregando"
|
|
97
|
+
class="spinner-border spinner-border-sm me-2"
|
|
98
|
+
role="status"
|
|
99
|
+
></span>
|
|
100
|
+
{{ textoConfirmar }}
|
|
101
|
+
</button>
|
|
102
|
+
</div>
|
|
103
|
+
|
|
104
|
+
<slot
|
|
105
|
+
name="botoes-direita"
|
|
106
|
+
:cancelar="cancelarAcao"
|
|
107
|
+
:confirmar="confirmarAcao"
|
|
108
|
+
></slot>
|
|
109
|
+
</slot>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
</Teleport>
|
|
116
|
+
</template>
|
|
117
|
+
|
|
118
|
+
<script setup lang="ts">
|
|
119
|
+
import { computed, useSlots, watch, onUnmounted, type Slots } from "vue";
|
|
120
|
+
import BotaoFechar from "../BotaoFechar.vue";
|
|
121
|
+
|
|
122
|
+
// Interface do escopo fornecido aos slots do rodapé
|
|
123
|
+
export interface EscopoRodapeModal {
|
|
124
|
+
cancelar: () => void;
|
|
125
|
+
confirmar: () => void;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// Declaração explícita dos slots para validação do vue-tsc nos componentes filhos
|
|
129
|
+
defineSlots<{
|
|
130
|
+
default?: (props: {}) => any;
|
|
131
|
+
icone?: (props: {}) => any;
|
|
132
|
+
titulo?: (props: {}) => any;
|
|
133
|
+
conteudo?: (props: {}) => any;
|
|
134
|
+
extra?: (props: {}) => any;
|
|
135
|
+
"botoes-esquerda"?: (props: EscopoRodapeModal) => any;
|
|
136
|
+
"botoes-meio"?: (props: EscopoRodapeModal) => any;
|
|
137
|
+
"botoes-direita"?: (props: EscopoRodapeModal) => any;
|
|
138
|
+
footer?: (props: EscopoRodapeModal) => any;
|
|
139
|
+
}>();
|
|
140
|
+
|
|
141
|
+
// Acesso tipado aos slots recebidos pelo componente
|
|
142
|
+
const slots: Slots = useSlots();
|
|
143
|
+
|
|
144
|
+
// Propriedades estruturais repassadas pelos componentes filhos especializados
|
|
145
|
+
const props = defineProps({
|
|
146
|
+
modelValue: { type: Boolean, default: false },
|
|
147
|
+
tamanho: { type: String as () => "sm" | "md" | "lg" | "xl", default: "sm" },
|
|
148
|
+
corTopo: {
|
|
149
|
+
type: String as () => "brand" | "danger" | "success" | "warning" | "info" | "primary" | "",
|
|
150
|
+
default: "brand"
|
|
151
|
+
},
|
|
152
|
+
corBotaoConfirmar: {
|
|
153
|
+
type: String as () => "brand" | "danger" | "success" | "warning" | "info" | "primary",
|
|
154
|
+
default: "brand"
|
|
155
|
+
},
|
|
156
|
+
titulo: { type: String, default: "" },
|
|
157
|
+
descricao: { type: String, default: "" },
|
|
158
|
+
textoCancelar: { type: String, default: "Cancelar" },
|
|
159
|
+
textoConfirmar: { type: String, default: "Confirmar" },
|
|
160
|
+
mostrarBotaoCancelar: { type: Boolean, default: true },
|
|
161
|
+
mostrarBotaoConfirmar: { type: Boolean, default: true },
|
|
162
|
+
mostrarBotaoFechar: { type: Boolean, default: true },
|
|
163
|
+
ocultarRodape: { type: Boolean, default: false },
|
|
164
|
+
fecharAoClicarFora: { type: Boolean, default: true },
|
|
165
|
+
fecharComEsc: { type: Boolean, default: true },
|
|
166
|
+
fecharAoConfirmar: { type: Boolean, default: false },
|
|
167
|
+
desabilitarConfirmar: { type: Boolean, default: false },
|
|
168
|
+
carregando: { type: Boolean, default: false }
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
// Eventos padrões de ciclo de vida e decisão do modal
|
|
172
|
+
const emit = defineEmits(["update:modelValue", "confirmar", "cancelar", "fechar"]);
|
|
173
|
+
|
|
174
|
+
// Controla a visibilidade do modal sincronizada com o v-model
|
|
175
|
+
const exibirModal = computed({
|
|
176
|
+
get: () => props.modelValue,
|
|
177
|
+
set: (valor: boolean) => emit("update:modelValue", valor)
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
// Impede o fechamento ao clicar no fundo escuro se configurado ou se estiver carregando
|
|
181
|
+
const bloquearCliqueFora = computed(() => !props.fecharAoClicarFora || props.carregando);
|
|
182
|
+
|
|
183
|
+
// Impede o fechamento pela tecla ESC se configurado ou se estiver carregando
|
|
184
|
+
const bloquearEsc = computed(() => !props.fecharComEsc || props.carregando);
|
|
185
|
+
|
|
186
|
+
// Define a classe de cor da barra de topo para cores padrão do Tabler
|
|
187
|
+
const classeStatusTopo = computed(() => {
|
|
188
|
+
if (!props.corTopo || props.corTopo === "brand") return "";
|
|
189
|
+
return `bg-${props.corTopo}`;
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
// Aplica a variável CSS --color-brand na barra de topo quando selecionada
|
|
193
|
+
const estiloStatusTopo = computed(() => {
|
|
194
|
+
if (props.corTopo === "brand") {
|
|
195
|
+
return { backgroundColor: "var(--color-brand, var(--tblr-primary, #206bc4))" };
|
|
196
|
+
}
|
|
197
|
+
return {};
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
// Define a classe visual do botão principal de confirmação
|
|
201
|
+
const classeBotaoConfirmar = computed(() => {
|
|
202
|
+
if (props.corBotaoConfirmar === "brand") return "btn-brand-custom text-white";
|
|
203
|
+
return `btn-${props.corBotaoConfirmar}`;
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
// Aplica a cor da marca ao botão principal quando configurado como brand
|
|
207
|
+
const estiloBotaoConfirmar = computed(() => {
|
|
208
|
+
if (props.corBotaoConfirmar === "brand") {
|
|
209
|
+
return {
|
|
210
|
+
backgroundColor: "var(--color-brand, var(--tblr-primary, #206bc4))",
|
|
211
|
+
borderColor: "var(--color-brand, var(--tblr-primary, #206bc4))"
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
return {};
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
// Recebe o evento de teclado, não devolve valor e fecha o modal ao pressionar ESC se permitido
|
|
218
|
+
function aoPressionarTecla(evento: KeyboardEvent) {
|
|
219
|
+
if (evento.key === "Escape" && exibirModal.value && !bloquearEsc.value) {
|
|
220
|
+
cancelarAcao();
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// Observa a abertura do modal para registrar ou remover o listener da tecla ESC
|
|
225
|
+
watch(
|
|
226
|
+
exibirModal,
|
|
227
|
+
(aberto) => {
|
|
228
|
+
if (typeof window === "undefined") return;
|
|
229
|
+
if (aberto) {
|
|
230
|
+
window.addEventListener("keydown", aoPressionarTecla);
|
|
231
|
+
} else {
|
|
232
|
+
window.removeEventListener("keydown", aoPressionarTecla);
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
{ immediate: true }
|
|
236
|
+
);
|
|
237
|
+
|
|
238
|
+
onUnmounted(() => {
|
|
239
|
+
if (typeof window !== "undefined") {
|
|
240
|
+
window.removeEventListener("keydown", aoPressionarTecla);
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
// Não recebe parâmetros, não devolve valor e trata o clique no fundo escuro do modal
|
|
245
|
+
function aoClicarFora() {
|
|
246
|
+
if (bloquearCliqueFora.value) return;
|
|
247
|
+
cancelarAcao();
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// Não recebe parâmetros, não devolve valor e fecha o modal emitindo os eventos de cancelamento
|
|
251
|
+
function cancelarAcao() {
|
|
252
|
+
if (props.carregando) return;
|
|
253
|
+
exibirModal.value = false;
|
|
254
|
+
emit("cancelar");
|
|
255
|
+
emit("fechar");
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// Não recebe parâmetros, não devolve valor e emite o evento de confirmação
|
|
259
|
+
function confirmarAcao() {
|
|
260
|
+
if (props.desabilitarConfirmar || props.carregando) return;
|
|
261
|
+
emit("confirmar");
|
|
262
|
+
if (props.fecharAoConfirmar) {
|
|
263
|
+
exibirModal.value = false;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
</script>
|
|
267
|
+
|
|
268
|
+
<style scoped>
|
|
269
|
+
.modal-overlay {
|
|
270
|
+
position: fixed;
|
|
271
|
+
top: 0;
|
|
272
|
+
left: 0;
|
|
273
|
+
width: 100vw;
|
|
274
|
+
height: 100vh;
|
|
275
|
+
padding: 16px;
|
|
276
|
+
box-sizing: border-box;
|
|
277
|
+
background: rgba(0, 0, 0, 0.4);
|
|
278
|
+
display: flex;
|
|
279
|
+
align-items: center;
|
|
280
|
+
justify-content: center;
|
|
281
|
+
z-index: 1050;
|
|
282
|
+
backdrop-filter: blur(2px);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.modal-card {
|
|
286
|
+
background: var(--bg-modal, var(--bg-primary, var(--tblr-bg-surface, #ffffff)));
|
|
287
|
+
color: var(--text-primary, var(--tblr-body-color, #1e293b));
|
|
288
|
+
width: 100%;
|
|
289
|
+
max-height: calc(100vh - 32px);
|
|
290
|
+
border-radius: 12px;
|
|
291
|
+
box-shadow: var(--shadow-float, 0 10px 25px rgba(0, 0, 0, 0.15));
|
|
292
|
+
border: 1px solid var(--border-light, var(--tblr-border-color, rgba(0, 0, 0, 0.08)));
|
|
293
|
+
display: flex;
|
|
294
|
+
flex-direction: column;
|
|
295
|
+
overflow: hidden;
|
|
296
|
+
position: relative;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.modal-tamanho-sm {
|
|
300
|
+
max-width: 400px;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.modal-tamanho-md {
|
|
304
|
+
max-width: 540px;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.modal-tamanho-lg {
|
|
308
|
+
max-width: 720px;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.modal-tamanho-xl {
|
|
312
|
+
max-width: 1140px;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.modal-status-topo {
|
|
316
|
+
height: 4px;
|
|
317
|
+
width: 100%;
|
|
318
|
+
flex-shrink: 0;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.modal-body {
|
|
322
|
+
background: var(--bg-primary, var(--tblr-bg-surface, #ffffff));
|
|
323
|
+
flex: 1 1 auto;
|
|
324
|
+
min-height: 0;
|
|
325
|
+
overflow-y: auto;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.modal-titulo-dialogo {
|
|
329
|
+
font-size: 18px;
|
|
330
|
+
font-weight: 600;
|
|
331
|
+
color: var(--text-primary, var(--tblr-body-color, #1e293b));
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.modal-descricao-dialogo {
|
|
335
|
+
color: var(--text-secondary, var(--tblr-secondary, #64748b));
|
|
336
|
+
font-size: 14px;
|
|
337
|
+
line-height: 1.5;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.modal-footer {
|
|
341
|
+
padding: 16px 20px;
|
|
342
|
+
border-top: 1px solid var(--border-light, var(--tblr-border-color, #e6e7e9));
|
|
343
|
+
background: var(--bg-secondary, var(--tblr-bg-surface-secondary, #f8fafc));
|
|
344
|
+
flex-shrink: 0;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.botao-secundario-modal {
|
|
348
|
+
background: var(--bg-primary, var(--tblr-bg-surface, #ffffff));
|
|
349
|
+
border: 1px solid var(--border-light, var(--tblr-border-color, #cbd5e1));
|
|
350
|
+
color: var(--text-primary, var(--tblr-body-color, #1e293b));
|
|
351
|
+
font-weight: 600;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.botao-secundario-modal:hover:not(:disabled) {
|
|
355
|
+
background: var(--bg-hover, rgba(0, 0, 0, 0.04));
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.btn-brand-custom {
|
|
359
|
+
font-weight: 600;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
.btn-brand-custom:hover:not(:disabled) {
|
|
363
|
+
filter: brightness(0.92);
|
|
364
|
+
}
|
|
365
|
+
</style>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
========
|
|
3
|
+
Arquivo principal de exportação do módulo de Modais (v-sistec-features/Modals).
|
|
4
|
+
Disponibiliza todos os 9 componentes de modal e o componente BotaoFechar prontos para uso.
|
|
5
|
+
========
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import BotaoFechar from "./components/BotaoFechar.vue";
|
|
9
|
+
import ModalBaseDefault from "./components/ModalBaseDefault.vue";
|
|
10
|
+
import ModalConfirmacao from "./components/ModalConfirmacao.vue";
|
|
11
|
+
import ModalPerigo from "./components/ModalPerigo.vue";
|
|
12
|
+
import ModalSucesso from "./components/ModalSucesso.vue";
|
|
13
|
+
import ModalAviso from "./components/ModalAviso.vue";
|
|
14
|
+
import ModalInformacao from "./components/ModalInformacao.vue";
|
|
15
|
+
import ModalConfirmacaoCheckbox from "./components/ModalConfirmacaoCheckbox.vue";
|
|
16
|
+
import ModalConfirmacaoInput from "./components/ModalConfirmacaoInput.vue";
|
|
17
|
+
import ModalConfirmacaoSimples from "./components/ModalConfirmacaoSimples.vue";
|
|
18
|
+
|
|
19
|
+
export {
|
|
20
|
+
BotaoFechar,
|
|
21
|
+
ModalBaseDefault,
|
|
22
|
+
ModalConfirmacao,
|
|
23
|
+
ModalPerigo,
|
|
24
|
+
ModalSucesso,
|
|
25
|
+
ModalAviso,
|
|
26
|
+
ModalInformacao,
|
|
27
|
+
ModalConfirmacaoCheckbox,
|
|
28
|
+
ModalConfirmacaoInput,
|
|
29
|
+
ModalConfirmacaoSimples
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export default ModalBaseDefault;
|
package/src/core/plugin.ts
CHANGED
|
@@ -1,41 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*
|
|
8
|
-
* até o momento as funções são
|
|
9
|
-
* - importar o css e js do tabler
|
|
10
|
-
* - disponibilizar o tabler globalmente como window.bootstrap
|
|
11
|
-
* (as novas versões do tabler não incluem mais o bootstrap, então isso foi necessário)
|
|
12
|
-
*
|
|
13
|
-
* - futuras funções podem ser adicionadas aqui
|
|
14
|
-
* - como adicionar componentes globais
|
|
15
|
-
* - adicionar diretivas globais
|
|
16
|
-
* - adicionar filtros globais
|
|
17
|
-
* - adicionar mixins globais
|
|
18
|
-
* - adicionar propriedades globais
|
|
19
|
-
*
|
|
20
|
-
* para usar o plugin, basta fazer app.use(SistecPlugin) na aplicação vue
|
|
1
|
+
/*
|
|
2
|
+
==========================================================================
|
|
3
|
+
Plugin principal do Sistec atualizado.
|
|
4
|
+
Realiza a configuração global das dependências na aplicação consumidora
|
|
5
|
+
através de iteração.
|
|
6
|
+
==========================================================================
|
|
21
7
|
*/
|
|
22
8
|
|
|
23
|
-
|
|
9
|
+
import type { App } from 'vue';
|
|
24
10
|
import '@tabler/core/dist/css/tabler.min.css';
|
|
25
|
-
import '@tabler/core/dist/css/tabler-themes.min.css'
|
|
11
|
+
import '@tabler/core/dist/css/tabler-themes.min.css';
|
|
26
12
|
import * as Tabler from '@tabler/core/dist/js/tabler.min.js';
|
|
27
|
-
import vRequired from "v-required"
|
|
28
|
-
import '../assets/v-required-style.css'
|
|
13
|
+
import vRequired from "v-required";
|
|
14
|
+
import '../assets/v-required-style.css';
|
|
29
15
|
import Toast, { type PluginOptions as ToastPluginOptions } from "vue-toastification";
|
|
30
16
|
import "vue-toastification/dist/index.css";
|
|
31
17
|
|
|
18
|
+
|
|
32
19
|
import { DATA_TABLE_CONFIG, type DataTableGlobalConfig } from '@/DatatableVue/config/datatableConfig';
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
20
|
+
|
|
21
|
+
export interface OpcoesSistec {
|
|
22
|
+
dataTable?: DataTableGlobalConfig;
|
|
23
|
+
toast?: ToastPluginOptions;
|
|
36
24
|
}
|
|
37
25
|
|
|
38
|
-
|
|
26
|
+
// Configuração padrão base para mesclar com as opções recebidas pelo plugin
|
|
27
|
+
const opcoesPadraoToast: ToastPluginOptions = {
|
|
39
28
|
transition: "Vue-Toastification__bounce",
|
|
40
29
|
maxToasts: 20,
|
|
41
30
|
newestOnTop: true,
|
|
@@ -43,23 +32,27 @@ const defaultToastOptions: ToastPluginOptions = {
|
|
|
43
32
|
};
|
|
44
33
|
|
|
45
34
|
const SistecPlugin = {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
35
|
+
/*
|
|
36
|
+
Função: install
|
|
37
|
+
Recebe: aplicativo (instância do Vue), opcoes (configurações do usuário)
|
|
38
|
+
Devolve: Nada
|
|
39
|
+
Por que é usada: Injeta os plugins, configurações e varre os objetos de
|
|
40
|
+
componentes e diretivas do Bootstrap para registrá-los um por um no
|
|
41
|
+
escopo global.
|
|
42
|
+
*/
|
|
43
|
+
install: (app: App, opcoes: OpcoesSistec = {}) => {
|
|
49
44
|
(window as any).bootstrap = Tabler;
|
|
50
45
|
|
|
46
|
+
app.directive('required', vRequired);
|
|
51
47
|
|
|
48
|
+
const opcoesFinaisToast = { ...opcoesPadraoToast, ...opcoes.toast };
|
|
49
|
+
app.use(Toast, opcoesFinaisToast);
|
|
52
50
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const finalToastOptions = { ...defaultToastOptions, ...options.toast };
|
|
58
|
-
app.use(Toast, finalToastOptions);
|
|
59
|
-
// CONFIGURAÇÃO DO DATATABLE
|
|
60
|
-
// Se o usuário passou configurações goblais de tabela, fazemos o provide AQUI.
|
|
61
|
-
const tableConfig = options.dataTable || {};
|
|
62
|
-
app.provide(DATA_TABLE_CONFIG, tableConfig);
|
|
51
|
+
const configuracaoTabela = opcoes.dataTable || {};
|
|
52
|
+
app.provide(DATA_TABLE_CONFIG, configuracaoTabela);
|
|
53
|
+
|
|
54
|
+
|
|
63
55
|
}
|
|
64
56
|
};
|
|
57
|
+
|
|
65
58
|
export { SistecPlugin };
|
package/src/types/global.d.ts
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
declare module '@tabler/core/dist/js/tabler.min.js';
|
|
1
|
+
declare module '@tabler/core/dist/js/tabler.min.js';
|
|
2
|
+
/* Para o typescript conseguir ver os components vue e conseguir exportar eles*/
|
|
3
|
+
declare module '*.vue' {
|
|
4
|
+
import type { DefineComponent } from 'vue';
|
|
5
|
+
const component: DefineComponent<{}, {}, any>;
|
|
6
|
+
export default component;
|
|
7
|
+
}
|
package/dist/Pagination.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { ComponentOptionsMixin } from 'vue';
|
|
2
|
-
import { ComponentProvideOptions } from 'vue';
|
|
3
|
-
import { DefineComponent } from 'vue';
|
|
4
|
-
import { PublicProps } from 'vue';
|
|
5
|
-
|
|
6
|
-
export declare const Pagination: DefineComponent<PaginationProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
7
|
-
tradePage: () => any;
|
|
8
|
-
}, string, PublicProps, Readonly<PaginationProps> & Readonly<{
|
|
9
|
-
onTradePage?: (() => any) | undefined;
|
|
10
|
-
}>, {
|
|
11
|
-
page_starts_at: number;
|
|
12
|
-
filtering: boolean;
|
|
13
|
-
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
14
|
-
|
|
15
|
-
declare interface PaginationObject {
|
|
16
|
-
current_page: number;
|
|
17
|
-
count: number;
|
|
18
|
-
limit_per_page: number;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
declare interface PaginationProps {
|
|
22
|
-
pagination: PaginationObject;
|
|
23
|
-
filtering?: boolean;
|
|
24
|
-
page_starts_at?: number;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export { }
|
package/dist/core.d.ts
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { App } from 'vue';
|
|
2
|
-
import { Component } from 'vue';
|
|
3
|
-
import { MaybeRefOrGetter } from 'vue';
|
|
4
|
-
import { PluginOptions } from 'vue-toastification';
|
|
5
|
-
|
|
6
|
-
declare interface ApiProps {
|
|
7
|
-
fetch: Function;
|
|
8
|
-
endpoint: string;
|
|
9
|
-
fetch_name?: string;
|
|
10
|
-
data_key?: string;
|
|
11
|
-
total_key?: string;
|
|
12
|
-
filter_param_name?: string;
|
|
13
|
-
search_param_name?: string;
|
|
14
|
-
page_param_name?: string;
|
|
15
|
-
page_size_param_name?: string;
|
|
16
|
-
add_params?: Record<string, any> | (() => Record<string, any>);
|
|
17
|
-
add_params_keep_page?: Record<string, any> | (() => Record<string, any>);
|
|
18
|
-
silent_params?: Record<string, any> | (() => Record<string, any>);
|
|
19
|
-
deactivate_default_params?: boolean;
|
|
20
|
-
disable_request?: MaybeRefOrGetter<boolean>;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
declare interface BehaviorProps {
|
|
24
|
-
frontend_pagination?: boolean;
|
|
25
|
-
limit_per_page?: number;
|
|
26
|
-
page_starts_at?: number;
|
|
27
|
-
min_loading_delay?: number;
|
|
28
|
-
retry_attempts?: number;
|
|
29
|
-
retry_delay?: number;
|
|
30
|
-
immediate?: boolean;
|
|
31
|
-
storage_id?: string;
|
|
32
|
-
use_column_manager?: boolean;
|
|
33
|
-
show_header_when_empty?: boolean;
|
|
34
|
-
item_key?: string;
|
|
35
|
-
type_loading?: 'placeholder' | 'spiner-table' | 'spiner';
|
|
36
|
-
custom_loading?: Component | null;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
declare interface BodyClass {
|
|
40
|
-
class_content?: string;
|
|
41
|
-
class_container?: string;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
declare type ClassProps = (ColumnManagerClass & PaginationClass & BodyClass & TableClass & FiltersClass);
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* =====================================================
|
|
48
|
-
* Tipagem para classes CSS.
|
|
49
|
-
* Por que é usada: Agrupa as opções de estilização estrutural do datatable.
|
|
50
|
-
* =====================================================
|
|
51
|
-
* **/
|
|
52
|
-
declare interface ColumnManagerClass {
|
|
53
|
-
class_column_manager_dropdown?: string;
|
|
54
|
-
class_column_manager_dropdown_menu?: string;
|
|
55
|
-
class_column_manager_button?: string;
|
|
56
|
-
disable_class_column_manager_default?: boolean;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
declare type DataTableGlobalConfig = Partial<VDataTableProps>;
|
|
60
|
-
|
|
61
|
-
declare interface ExtraFeaturesProps {
|
|
62
|
-
use_checkbox?: boolean;
|
|
63
|
-
deactivate_selected_info?: boolean;
|
|
64
|
-
use_expandable_items?: boolean;
|
|
65
|
-
close_expanded_item_on_expand_new?: boolean;
|
|
66
|
-
scroll_to_expanded_item?: boolean;
|
|
67
|
-
type_animation_expand?: 'fade' | 'expand' | 'none';
|
|
68
|
-
deactivate_animation_expand?: boolean;
|
|
69
|
-
type_button_expand?: 'arrow' | 'plus';
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
declare interface FiltersClass {
|
|
73
|
-
class_filters?: string;
|
|
74
|
-
class_page_size?: string;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
declare interface PaginationClass {
|
|
78
|
-
class_pagination?: string;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
declare interface PaginationProps {
|
|
82
|
-
first_text_page_size?: string;
|
|
83
|
-
second_text_page_size?: string;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
declare interface SearchProps {
|
|
87
|
-
list_filter?: any[];
|
|
88
|
-
placeholder_search?: string;
|
|
89
|
-
disable_search?: boolean;
|
|
90
|
-
deactivate_search_empty?: boolean;
|
|
91
|
-
deactivate_search_on_clear?: boolean;
|
|
92
|
-
custom_frontend_filter?: ((item: any, search: string, filter: string) => boolean) | null;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
declare interface SistecOptions {
|
|
96
|
-
dataTable?: DataTableGlobalConfig;
|
|
97
|
-
toast?: PluginOptions;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export declare const SistecPlugin: {
|
|
101
|
-
install: (app: App, options?: SistecOptions) => void;
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
declare interface TableClass {
|
|
105
|
-
class_table?: string;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
declare interface TeleportsProps {
|
|
109
|
-
search_teleport?: string | HTMLElement | null;
|
|
110
|
-
pagination_teleport?: string | HTMLElement | null;
|
|
111
|
-
extra_actions_teleport?: string | HTMLElement | null;
|
|
112
|
-
column_manager_teleport?: string | HTMLElement | null;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
declare type VDataTableProps = (ApiProps & ClassProps & BehaviorProps & SearchProps & PaginationProps & ExtraFeaturesProps & TeleportsProps);
|
|
116
|
-
|
|
117
|
-
export { }
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Ref } from 'vue';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Um Composable para gerenciar a comunicação entre um iframe e sua janela pai.
|
|
5
|
-
* @param onMessageReceived - Uma função de callback que será executada quando uma mensagem for recebida do pai.
|
|
6
|
-
*/
|
|
7
|
-
export declare function useIframeCommunicator(onMessageReceived?: (event: MessageEvent) => void): {
|
|
8
|
-
isInIframe: Readonly<Ref<boolean, boolean>>;
|
|
9
|
-
sendMessage: (message: any, targetOrigin?: string) => void;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Um composable "tudo-em-um" que configura a comunicação de temas com a janela pai.
|
|
14
|
-
* para usar, bastar importar e chamar useTheme() na raiz do component app do iframe
|
|
15
|
-
*/
|
|
16
|
-
export declare function useTheme(): {
|
|
17
|
-
theme: Readonly<Ref<string, string>>;
|
|
18
|
-
themePalette: Readonly<Ref<string, string>>;
|
|
19
|
-
themePrimary: Readonly<Ref<string, string>>;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export { }
|