Correções visuais.
This commit is contained in:
parent
bdf5be845a
commit
2349a41465
@ -368,6 +368,14 @@
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
/* Agrupa botões dentro de um dos lados de `.modal-actions--spread` — usado
|
||||
quando um lado (ex.: "Excluir") precisa ficar isolado de vários botões do
|
||||
outro lado (ex.: "Fechar"/"Salvar alterações"), não só um botão por lado. */
|
||||
.modal-actions__group {
|
||||
display: flex;
|
||||
gap: var(--space-3);
|
||||
}
|
||||
|
||||
/* Modal de "Mais informações" (ver static/js/ajuda-aplicacao.js) — único,
|
||||
criado sob demanda e reaproveitado por todas as aplicações da página. */
|
||||
.ajuda-modal__card {
|
||||
|
||||
@ -111,6 +111,30 @@
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
/* Botão "borracha" no fim do cabeçalho do histórico — limpa de uma vez todos
|
||||
os filtros por coluna (ver criarFiltroColuna) e volta a ordenação pro
|
||||
padrão (mais recente primeiro). Reaproveita o mesmo visual de botão de
|
||||
ícone do funil (.ips-col-filter__btn), só um pouco maior por ficar sozinho
|
||||
na célula, sem texto ao lado. */
|
||||
.ips-list-reset-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
padding: 0;
|
||||
border: none;
|
||||
background: none;
|
||||
color: var(--text-muted);
|
||||
cursor: pointer;
|
||||
border-radius: var(--radius-sm);
|
||||
}
|
||||
|
||||
.ips-list-reset-btn:hover {
|
||||
color: var(--text-primary);
|
||||
background: var(--bg-canvas);
|
||||
}
|
||||
|
||||
.ips-col-filter__popup {
|
||||
position: absolute;
|
||||
top: calc(100% + 6px);
|
||||
|
||||
@ -2469,9 +2469,13 @@ document.addEventListener("DOMContentLoaded", async () => {
|
||||
);
|
||||
}
|
||||
|
||||
function renderItens() {
|
||||
function valoresVisiveis() {
|
||||
const termo = searchInput.value.trim().toLowerCase();
|
||||
const visiveis = valoresDistintos().filter((v) => labelValorFiltroLista(campo, v).toLowerCase().includes(termo));
|
||||
return valoresDistintos().filter((v) => labelValorFiltroLista(campo, v).toLowerCase().includes(termo));
|
||||
}
|
||||
|
||||
function renderItens() {
|
||||
const visiveis = valoresVisiveis();
|
||||
box.innerHTML = visiveis.length
|
||||
? visiveis
|
||||
.map(
|
||||
@ -2515,9 +2519,22 @@ document.addEventListener("DOMContentLoaded", async () => {
|
||||
|
||||
searchInput.addEventListener("input", renderItens);
|
||||
|
||||
// Enter no campo de busca restringe a seleção aos valores que batem com o
|
||||
// termo digitado (igual marcar só eles manualmente) e já aplica — sem
|
||||
// isso, digitar um código e teclar Enter só clicava em "Aplicar" com a
|
||||
// seleção que já estava marcada (o popup abre com "Selecionar todos"
|
||||
// ligado por padrão), então não filtrava nada na prática; era preciso
|
||||
// desmarcar/marcar os checkboxes na mão antes de aplicar.
|
||||
searchInput.addEventListener("keydown", (event) => {
|
||||
if (event.key !== "Enter") return;
|
||||
event.preventDefault();
|
||||
const visiveis = valoresVisiveis();
|
||||
if (visiveis.length) marcados = new Set(visiveis);
|
||||
aplicarBtn.click();
|
||||
});
|
||||
|
||||
selectAllInput.addEventListener("change", () => {
|
||||
const termo = searchInput.value.trim().toLowerCase();
|
||||
const visiveis = valoresDistintos().filter((v) => labelValorFiltroLista(campo, v).toLowerCase().includes(termo));
|
||||
const visiveis = valoresVisiveis();
|
||||
if (selectAllInput.checked) visiveis.forEach((v) => marcados.add(v));
|
||||
else visiveis.forEach((v) => marcados.delete(v));
|
||||
renderItens();
|
||||
@ -2553,11 +2570,24 @@ document.addEventListener("DOMContentLoaded", async () => {
|
||||
renderList();
|
||||
});
|
||||
|
||||
filtrosColuna.push({ fechar });
|
||||
filtrosColuna.push({ fechar, atualizarBotaoAtivo });
|
||||
}
|
||||
|
||||
["codigo_empresa", "nome_operadora", "status", "criado_por"].forEach(criarFiltroColuna);
|
||||
|
||||
const listResetBtn = document.getElementById("ips-list-reset-btn");
|
||||
if (listResetBtn) {
|
||||
listResetBtn.addEventListener("click", () => {
|
||||
fecharTodosOsFiltrosColuna();
|
||||
listSortKey = "criado_em";
|
||||
listSortDir = -1;
|
||||
listFiltros = { codigo_empresa: null, nome_operadora: null, status: null, criado_por: null };
|
||||
filtrosColuna.forEach((f) => f.atualizarBotaoAtivo());
|
||||
listPage = 1;
|
||||
renderList();
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener("click", (event) => {
|
||||
if (!event.target.closest(".ips-col-filter")) fecharTodosOsFiltrosColuna();
|
||||
});
|
||||
|
||||
@ -4,6 +4,12 @@ const PID_WIDGET_TYPES = {
|
||||
description: "Próximos compromissos da sua agenda pessoal.",
|
||||
href: "calendario-individual.html",
|
||||
linkLabel: "Ver calendário completo",
|
||||
// Mesmo gate usado pra esconder o item "Calendário Individual" da sidebar
|
||||
// (data-section="calendario-individual", pidApplyAccessVisibility em
|
||||
// access.js) — sem isso, um perfil sem esse módulo habilitado ainda
|
||||
// conseguia adicionar o widget (e, por ele, chegar ao calendário
|
||||
// completo) mesmo com o link do menu corretamente escondido.
|
||||
visibleIf: (me) => !!(me.permissoes_efetivas?.["calendario-individual"]?.enabled),
|
||||
},
|
||||
"links-favoritos": {
|
||||
label: "Links Favoritos",
|
||||
|
||||
@ -335,7 +335,11 @@
|
||||
<th data-sort="status">Status <span class="ips-sort-icon">↕</span></th>
|
||||
<th data-sort="criado_por">Criado por <span class="ips-sort-icon">↕</span></th>
|
||||
<th data-sort="criado_em">Data <span class="ips-sort-icon">↕</span></th>
|
||||
<th></th>
|
||||
<th>
|
||||
<button type="button" class="ips-list-reset-btn" id="ips-list-reset-btn" title="Limpar filtros e ordenação" aria-label="Limpar filtros e ordenação">
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M20 20H8l-5.5-5.5a2 2 0 0 1 0-2.8l9-9a2 2 0 0 1 2.8 0l6.2 6.2a2 2 0 0 1 0 2.8L13 19" stroke-linejoin="round"/><path d="M8.5 12.5l6 6" stroke-linecap="round"/></svg>
|
||||
</button>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="ips-list-body"></tbody>
|
||||
@ -679,15 +683,19 @@
|
||||
</div>
|
||||
|
||||
<p class="modal-error" id="ips-regracad-error"></p>
|
||||
<div class="modal-actions">
|
||||
<div class="modal-actions modal-actions--spread">
|
||||
<div class="modal-actions__group">
|
||||
<button type="button" class="btn-danger-outline" id="ips-regracad-excluir-btn" hidden>Excluir regra</button>
|
||||
</div>
|
||||
<div class="modal-actions__group">
|
||||
<button type="button" class="btn-outline" id="ips-regracad-fechar-btn">Fechar</button>
|
||||
<button type="button" class="btn-outline" id="ips-regracad-novo-cancelar-btn" hidden>Cancelar</button>
|
||||
<button type="button" class="btn-danger-outline" id="ips-regracad-excluir-btn" hidden>Excluir regra</button>
|
||||
<button type="button" class="btn-solid" id="ips-regracad-salvar-btn" hidden>Salvar alterações</button>
|
||||
<button type="button" class="btn-solid" id="ips-regracad-criar-btn" hidden>Criar regra</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="modal-overlay" id="manage-account-modal" hidden>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user