mirror of
https://github.com/felipegcoutinho/openmonetis.git
synced 2026-05-09 11:01:45 +00:00
feat(lancamentos): filtros de status e anexo; feedback visual de fatura paga
- Novos filtros no drawer: somente pagos, somente não pagos, com anexo - Filtros de tipo/condição/pagamento agora usam slugs na URL (sem acentos) - Coluna de liquidação: lançamentos de cartão com fatura paga exibem ícone verde com tooltip — diferenciando do estado pendente - EstabelecimentoInput: popover respeita largura do input ao abrir - slugify extraído para shared/utils/string.ts - INVOICE_PAYMENT_CATEGORY_NAME adicionado em categories/constants.ts - SETTLED_FILTER_VALUES adicionado em transactions/constants.ts - establishment-logo.tsx removido (não utilizado) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -38,6 +38,13 @@ export function EstabelecimentoInput({
|
||||
}: EstabelecimentoInputProps) {
|
||||
const [open, setOpen] = React.useState(false);
|
||||
const [searchValue, setSearchValue] = React.useState("");
|
||||
const [width, setWidth] = React.useState<number | undefined>();
|
||||
const containerRef = React.useRef<HTMLDivElement>(null);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (!open || !containerRef.current) return;
|
||||
setWidth(containerRef.current.offsetWidth);
|
||||
}, [open]);
|
||||
|
||||
const handleSelect = (selectedValue: string) => {
|
||||
onChange(selectedValue);
|
||||
@@ -50,7 +57,6 @@ export function EstabelecimentoInput({
|
||||
onChange(newValue);
|
||||
setSearchValue(newValue);
|
||||
|
||||
// Open popover when user types and there are suggestions
|
||||
if (newValue.length > 0 && estabelecimentos.length > 0) {
|
||||
setOpen(true);
|
||||
}
|
||||
@@ -68,7 +74,7 @@ export function EstabelecimentoInput({
|
||||
return (
|
||||
<Popover open={open} onOpenChange={setOpen} modal>
|
||||
<PopoverTrigger asChild>
|
||||
<div className="relative">
|
||||
<div ref={containerRef} className="relative w-full">
|
||||
<Input
|
||||
id={id}
|
||||
value={value}
|
||||
@@ -86,7 +92,8 @@ export function EstabelecimentoInput({
|
||||
</PopoverTrigger>
|
||||
{estabelecimentos.length > 0 && (
|
||||
<PopoverContent
|
||||
className="p-0 w-[--radix-popover-trigger-width]"
|
||||
className="p-0"
|
||||
style={width ? { width } : undefined}
|
||||
align="start"
|
||||
onOpenAutoFocus={(e) => e.preventDefault()}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user