PageSourceSearch

https://carregamento3bs.lovable.app/assets/TarefasListaPage-T9NP7jtd.js

js carregamento3bs.lovable.app collected 2026-10-03 05:36:14 UTC 6,430 bytes, 1 lines download raw bytes

1import{u as le,r as t,j as e}from"./react-vendor-BorBU4Bs.js";import{a as ne,cP as ie,cL as ce,cT as de,cU as ue,cV as q,B as z,A as xe,P as pe,K as O,M as k,X as me,I as he,S as c,d,f as u,g as x,h as o,cQ as je,N as fe,O as ge,Q as M,U as n,V as ve,W as l,cN as Ne,cR as Se,n as T,bt as Ce,cS as Me}from"./index-DkhxOMdR.js";import{P as Te}from"./PageHeader-BP8oDBUm.js";import{T as be}from"./TarefaDialog-eYlhX88q.js";import{L as we}from"./lock-BwzBHx05.js";import"./radix-vendor-CazrR58L.js";import"./charts-vendor-BxJanGhU.js";import"./query-vendor-dlntIC_S.js";import"./supabase-vendor-BxTHC7hl.js";import"./xlsx-vendor-DOnNs5_d.js";import"./qr-vendor-Ca1-Dxvv.js";import"./checkbox-Dl2yzLyD.js";import"./link-2-Wg6M4xyo.js";import"./message-square-aRjlxNvT.js";const r="__all__";function ye(){const y=le(),{isReadonly:F}=ne(),{status:b,tipos:A,projetos:w,setores:_,pessoas:P}=ie(),{data:B=[],isLoading:D}=ce(),{data:R=[]}=de(),{data:i}=ue(),[L,H]=t.useState(""),[j,Q]=t.useState(r),[f,U]=t.useState(r),[g,$]=t.useState(r),[v,K]=t.useState(r),[N,W]=t.useState(r),[S,X]=t.useState(r),[G,E]=t.useState(!1),[J,I]=t.useState(null),Y=t.useMemo(()=>new Map(b.map(s=>[s.id,s])),[b]),Z=t.useMemo(()=>new Map(A.map(s=>[s.id,s.nome])),[A]),ee=t.useMemo(()=>new Map(w.map(s=>[s.id,s.nome])),[w]),se=t.useMemo(()=>new Map(_.map(s=>[s.id,s.nome])),[_]),ae=t.useMemo(()=>new Map(P.map(s=>[s.id,s.full_name??""])),[P]),re=t.useMemo(()=>new Map(R.map(s=>[s.id,s])),[R]),V=t.useMemo(()=>{const s=L.trim().toLowerCase();return B.filter(a=>j!==r&&a.status_id!==j||f!==r&&a.prioridade!==f||g!==r&&a.projeto_id!==g||v!==r&&a.setor_id!==v||N!==r&&a.responsavel_id!==N||S!==r&&!((i==null?void 0:i.get(a.id))??[]).includes(S)?!1:s?a.titulo.toLowerCase().includes(s)||(a.codigo??"").toLowerCase().includes(s)||(a.descricao??"").toLowerCase().includes(s):!0).sort((a,p)=>{const m=q[a.prioridade]??9,h=q[p.prioridade]??9;return m!==h?m-h:(a.prazo??"9999").localeCompare(p.prazo??"9999")})},[B,L,j,f,g,v,N,S,i]),te=()=>{I(null),E(!0)},oe=s=>{I(s),E(!0)};return e.jsxs("div",{children:[e.jsxs(z,{variant:"ghost",size:"sm",className:"mb-3",onClick:()=>y("/tarefas"),children:[e.jsx(xe,{className:"h-4 w-4 mr-1"})," Voltar"]}),e.jsx(Te,{title:"Lista de Tarefas",description:`${V.length} tarefa(s)`,action:F?void 0:e.jsxs(z,{onClick:te,children:[e.jsx(pe,{className:"h-4 w-4 mr-1"})," Nova tarefa"]})}),e.jsx(O,{className:"mb-4",children:e.jsxs(k,{className:"p-4 grid grid-cols-1 md:grid-cols-3 lg:grid-cols-7 gap-3",children:[e.jsxs("div",{className:"relative lg:col-span-2",children:[e.jsx(me,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(he,{className:"pl-8",placeholder:"Buscar por código, título...",value:L,onChange:s=>H(s.target.value)})]}),e.jsxs(c,{value:j,onValueChange:Q,children:[e.jsx(d,{children:e.jsx(u,{placeholder:"Status"})}),e.jsxs(x,{children:[e.jsx(o,{value:r,children:"Todos os status"}),b.map(s=>e.jsx(o,{value:s.id,children:s.nome},s.id))]})]}),e.jsxs(c,{value:f,onValueChange:U,children:[e.jsx(d,{children:e.jsx(u,{placeholder:"Prioridade"})}),e.jsxs(x,{children:[e.jsx(o,{value:r,children:"Todas prioridades"}),je.map(s=>e.jsx(o,{value:s.value,children:s.label},s.value))]})]}),e.jsxs(c,{value:g,onValueChange:$,children:[e.jsx(d,{children:e.jsx(u,{placeholder:"Projeto"})}),e.jsxs(x,{children:[e.jsx(o,{value:r,children:"Todos projetos"}),w.map(s=>e.jsx(o,{value:s.id,children:s.nome},s.id))]})]}),e.jsxs(c,{value:v,onValueChange:K,children:[e.jsx(d,{children:e.jsx(u,{placeholder:"Setor"})}),e.jsxs(x,{children:[e.jsx(o,{value:r,children:"Todos setores"}),_.map(s=>e.jsx(o,{value:s.id,children:s.nome},s.id))]})]}),e.jsxs(c,{value:N,onValueChange:W,children:[e.jsx(d,{children:e.jsx(u,{placeholder:"Responsável"})}),e.jsxs(x,{children:[e.jsx(o,{value:r,children:"Todos responsáveis"}),P.map(s=>e.jsx(o,{value:s.id,children:s.full_name??s.id},s.id))]})]}),e.jsxs(c,{value:S,onValueChange:X,children:[e.jsx(d,{children:e.jsx(u,{placeholder:"Etiqueta"})}),e.jsxs(x,{children:[e.jsx(o,{value:r,children:"Todas etiquetas"}),R.map(s=>e.jsx(o,{value:s.id,children:s.nome},s.id))]})]})]})}),e.jsx(O,{children:e.jsx(k,{className:"p-0 overflow-x-auto",children:e.jsxs(fe,{children:[e.jsx(ge,{children:e.jsxs(M,{children:[e.jsx(n,{children:"Código"}),e.jsx(n,{children:"Título"}),e.jsx(n,{children:"Tipo"}),e.jsx(n,{children:"Status"}),e.jsx(n,{children:"Prioridade"}),e.jsx(n,{children:"Responsável"}),e.jsx(n,{children:"Projeto / Setor responsável"}),e.jsx(n,{children:"Prazo"})]})}),e.jsxs(ve,{children:[D&&e.jsx(M,{children:e.jsx(l,{colSpan:8,className:"text-center text-muted-foreground py-8",children:"Carregando..."})}),!D&&V.length===0&&e.jsx(M,{children:e.jsx(l,{colSpan:8,className:"text-center text-muted-foreground py-8",children:"Nenhuma tarefa encontrada."})}),V.map(s=>{const a=Y.get(s.status_id??""),p=Ne({prazo:s.prazo,statusCategoria:a==null?void 0:a.categoria}),m=Se(s.prioridade);return e.jsxs(M,{className:"cursor-pointer",onClick:()=>oe(s),children:[e.jsx(l,{className:"font-mono text-xs",children:s.codigo??"—"}),e.jsxs(l,{className:"font-medium max-w-[320px]",children:[e.jsx("span",{className:"block truncate",children:s.titulo}),e.jsxs("span",{className:"flex flex-wrap items-center gap-1 mt-1",children:[s.bloqueada&&e.jsxs(T,{variant:"destructive",className:"text-[10px] gap-1",children:[e.jsx(we,{className:"h-2.5 w-2.5"})," Bloqueada"]}),((i==null?void 0:i.get(s.id))??[]).map(h=>{const C=re.get(h);return C?e.jsx(T,{variant:"outline",className:"text-[10px]",style:{borderColor:C.cor,color:C.cor},children:C.nome},h):null})]})]}),e.jsx(l,{className:"text-xs text-muted-foreground",children:Z.get(s.tipo_id??"")??"—"}),e.jsx(l,{children:e.jsx(T,{variant:"outline",style:a!=null&&a.cor?{borderColor:a.cor,color:a.cor}:void 0,children:(a==null?void 0:a.nome)??"—"})}),e.jsx(l,{children:e.jsx(T,{className:m.cor,children:m.label})}),e.jsx(l,{className:"text-xs",children:ae.get(s.responsavel_id??"")||"—"}),e.jsxs(l,{className:"text-xs text-muted-foreground",children:[ee.get(s.projeto_id??"")??"—",s.setor_id&&e.jsx("span",{className:"block",children:se.get(s.setor_id)})]}),e.jsx(l,{className:`text-xs ${p?"text-destructive font-semibold":""}`,children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[p&&e.jsx(Ce,{className:"h-3 w-3"}),Me(s.prazo)]})})]},s.id)})]})]})})}),e.jsx(be,{open:G,onOpenChange:E,tarefa:J})]})}
1export{ye as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.