Skip to content
Draft
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
248 changes: 196 additions & 52 deletions frontend/index.html

Large diffs are not rendered by default.

234 changes: 119 additions & 115 deletions frontend/src/components/FiltroParaPagina.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ type Props = {
carregando?: boolean
bloqueado?: boolean
naoEmitirQuery?: boolean
umaLinha?: boolean
};
type Emits = {
(e: 'update:formularioSujo', value: boolean): void
Expand Down Expand Up @@ -168,130 +169,133 @@ if (props.autoSubmit) {
>
<form
:aria-busy="pendente"
:class="{ 'flex g1 center': $props.umaLinha }"
@submit.prevent="!carregando && !pendente && onSubmit()"
>
<div
v-for="(linha, linhaIndex) in formulario"
:key="`linha--${linhaIndex}`"
class="flex center g2 flexwrap"
:class="linha.decorador === 'direita' && 'row-reverse'"
>
<hr
v-if="linha.decorador"
class="f1"
>

<div class="f1">
<div
class="flex g2 flexwrap"
:class="linha.class || 'fg999'"
v-for="(linha, linhaIndex) in formulario"
:key="`linha--${linhaIndex}`"
class="flex center g2 flexwrap"
:class="linha.decorador === 'direita' && 'row-reverse'"
>
<hr
v-if="linha.decorador"
class="f1"
>

<div
v-for="(campo, campoNome) in linha.campos"
:key="campoNome"
:class="['f1 align-end', campo.class]"
class="flex g2 flexwrap"
:class="linha.class || 'fg999'"
>
<LabelFromYup
:name="campoNome"
:schema="schema"
class="tc300"
/>

<Field
v-if="campo.tipo === 'checkbox'"
v-slot="{ field: { value }, handleInput }"
:name="campoNome"
:disabled="$props.bloqueado"
:aria-busy="$props.carregando"
:aria-invalid="!!errors[campoNome]"
:aria-errormessage="errors[campoNome] ? `err__${campoNome}` : undefined"
<div
v-for="(campo, campoNome) in linha.campos"
:key="campoNome"
:class="['f1 align-end', campo.class]"
>
<div
class="flex itemscenter"
style="height: 41px"
<LabelFromYup
:name="campoNome"
:schema="schema"
class="tc300"
/>

<Field
v-if="campo.tipo === 'checkbox'"
v-slot="{ field: { value }, handleInput }"
:name="campoNome"
:disabled="$props.bloqueado"
:aria-busy="$props.carregando"
:aria-invalid="!!errors[campoNome]"
:aria-errormessage="errors[campoNome] ? `err__${campoNome}` : undefined"
>
<input
type="checkbox"
class="interruptor"
:checked="value"
:disabled="$props.bloqueado"
:aria-busy="$props.carregando"
@input="(ev) => handleInput(ev.target.checked)"
<div
class="flex itemscenter"
style="height: 41px"
>
</div>
</Field>

<Field
v-else-if="campo.tipo === 'select'"
class="inputtext light mb1"
:name="campoNome"
as="select"
:disabled="$props.bloqueado"
:aria-busy="$props.carregando"
:aria-invalid="!!errors[campoNome]"
:aria-errormessage="errors[campoNome] ? `err__${campoNome}` : undefined"
>
<option :value="null">
-
</option>
<template v-if="campo.opcoes?.length">
<option
v-for="opcao in padronizarOpcoes(campo.opcoes)"
:key="`comunicado-tipo--${campoNome}-${opcao.id}`"
:value="opcao.id"
>
{{ opcao.label }}
<input
type="checkbox"
class="interruptor"
:checked="value"
:disabled="$props.bloqueado"
:aria-busy="$props.carregando"
@input="(ev) => handleInput(ev.target.checked)"
>
</div>
</Field>

<Field
v-else-if="campo.tipo === 'select'"
class="inputtext light mb1"
:name="campoNome"
as="select"
:disabled="$props.bloqueado"
:aria-busy="$props.carregando"
:aria-invalid="!!errors[campoNome]"
:aria-errormessage="errors[campoNome] ? `err__${campoNome}` : undefined"
>
<option :value="null">
-
</option>
</template>
</Field>

<Field
v-else-if="campo.tipo === 'autocomplete'"
v-slot="{ value, handleChange }"
class="inputtext light mb1"
:name="campoNome"
:aria-invalid="!!errors[campoNome]"
:aria-errormessage="errors[campoNome] ? `err__${campoNome}` : undefined"
>
<AutocompleteField2
class="f1 mb1"
:controlador="{ participantes: value, busca: '' }"
:grupo="campo.opcoes"
:label="campo.autocomplete?.label || 'label'"
:apenas-um="campo.autocomplete?.apenasUm"
:readonly="$props.carregando"
@change="ev => handleChange(ev)"
<template v-if="campo.opcoes?.length">
<option
v-for="opcao in padronizarOpcoes(campo.opcoes)"
:key="`comunicado-tipo--${campoNome}-${opcao.id}`"
:value="opcao.id"
>
{{ opcao.label }}
</option>
</template>
</Field>

<Field
v-else-if="campo.tipo === 'autocomplete'"
v-slot="{ value, handleChange }"
class="inputtext light mb1"
:name="campoNome"
:aria-invalid="!!errors[campoNome]"
:aria-errormessage="errors[campoNome] ? `err__${campoNome}` : undefined"
>
<AutocompleteField2
class="f1 mb1"
:controlador="{ participantes: value, busca: '' }"
:grupo="campo.opcoes"
:label="campo.autocomplete?.label || 'label'"
:apenas-um="campo.autocomplete?.apenasUm"
:readonly="$props.carregando"
@change="ev => handleChange(ev)"
/>
</Field>

<Field
v-else-if="campo.tipo === 'numeric'"
class="inputtext light mb1"
:name="campoNome"
type="text"
:disabled="$props.bloqueado"
:aria-busy="$props.carregando"
:aria-invalid="!!errors[campoNome]"
:aria-errormessage="errors[campoNome] ? `err__${campoNome}` : undefined"
inputmode="numeric"
v-bind="campo.atributos"
/>

<Field
v-else
class="inputtext light mb1"
:name="campoNome"
:type="campo.tipo"
:disabled="$props.bloqueado"
:aria-busy="$props.carregando"
:aria-invalid="!!errors[campoNome]"
:aria-errormessage="errors[campoNome] ? `err__${campoNome}` : undefined"
/>

<ErrorMessage
:id="`err__${campoNome}`"
class="error-msg mb1"
:name="campoNome"
/>
</Field>

<Field
v-else-if="campo.tipo === 'numeric'"
class="inputtext light mb1"
:name="campoNome"
type="text"
:disabled="$props.bloqueado"
:aria-busy="$props.carregando"
:aria-invalid="!!errors[campoNome]"
:aria-errormessage="errors[campoNome] ? `err__${campoNome}` : undefined"
inputmode="numeric"
v-bind="campo.atributos"
/>

<Field
v-else
class="inputtext light mb1"
:name="campoNome"
:type="campo.tipo"
:disabled="$props.bloqueado"
:aria-busy="$props.carregando"
:aria-invalid="!!errors[campoNome]"
:aria-errormessage="errors[campoNome] ? `err__${campoNome}` : undefined"
/>

<ErrorMessage
:id="`err__${campoNome}`"
class="error-msg mb1"
:name="campoNome"
/>
</div>
</div>
</div>
</div>
Expand All @@ -302,8 +306,8 @@ if (props.autoSubmit) {
>
<button
type="submit"
class="btn outline bgnone tcprimary mtauto mb1"
:class="[{ loading: carregando }]"
class="btn outline bgnone tcprimary"
:class="[{ loading: carregando }, {'mtauto mb1': !$props.umaLinha}]"
:aria-busy="isSubmitting || carregando"
:aria-disabled="!!Object.keys(errors)?.length"
:aria-invalid="!!Object.keys(errors)?.length"
Expand Down
9 changes: 7 additions & 2 deletions frontend/src/components/MenuSecundario.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script setup>
import { useAuthStore } from '@/stores/auth.store';
import { storeToRefs } from 'pinia';
import { computed, ref } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { useAuthStore } from '@/stores/auth.store';
import TransitionExpand from './TransitionExpand.vue';

const authStore = useAuthStore();
Expand Down Expand Up @@ -148,8 +148,9 @@ function alternarItens(índice) {
class="menu-secundário__item-de-lista"
>
<router-link
:to="rota.href"
:to="rota?.name ? { name: rota.name } : rota.href"
class="menu-secundário__link"
exact-active-class="tamarelo menu-secundário__link-selecionado"
>
<!-- TODO: transformar em função -->
{{ (typeof rota.meta?.títuloParaMenu === 'function'
Expand Down Expand Up @@ -286,4 +287,8 @@ function alternarItens(índice) {

border-bottom: 1px solid @c100;
}

.menu-secundário__link-selecionado {
border-bottom: 4px solid #F7C234;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const props = defineProps<Props>();

const conteudo = computed(() => {
if (!props.schema || !props.chave) {
return props.label || props.chave;
return props.label;
}

const dadosYup = buscarDadosDoYup(props.schema, props.chave)?.spec?.label;
Expand Down
Loading