@imj_media/tareas 1.6.5 → 1.6.6

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.
@@ -19,5 +19,20 @@ export interface ListadoProgresoFilterDropdownProps {
19
19
  panelSearch: boolean;
20
20
  /** Placeholder del buscador del panel (solo si `panelSearch`). */
21
21
  panelSearchPlaceholder?: string;
22
+ /** Props extra de `Dropdown.field` (p. ej. label en el panel Filtrar del layout). */
23
+ field?: {
24
+ label?: string;
25
+ size?: 'xs' | 'sm' | 'md' | 'lg';
26
+ };
27
+ /** Props extra de `Dropdown.popover` (se fusionan con `{ fullWidth: true }`). */
28
+ popover?: {
29
+ fullWidth?: boolean;
30
+ absolute?: boolean;
31
+ closeOnClickOutside?: boolean;
32
+ popoverZIndex?: number;
33
+ dropdownId?: string;
34
+ };
35
+ /** Muestra acción «Limpiar selección» en el panel (por defecto `false`). */
36
+ showClearSelection?: boolean;
22
37
  }
23
- export declare function ListadoProgresoFilterDropdown({ options, selected, onChange, emptyPlaceholder, header, tagsOverflowPopoverTitle, panelSearch, panelSearchPlaceholder, }: ListadoProgresoFilterDropdownProps): import("react/jsx-runtime").JSX.Element;
38
+ export declare function ListadoProgresoFilterDropdown({ options, selected, onChange, emptyPlaceholder, header, tagsOverflowPopoverTitle, panelSearch, panelSearchPlaceholder, field: fieldOverrides, popover: popoverOverrides, showClearSelection, }: ListadoProgresoFilterDropdownProps): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,4 @@
1
+ import { DropdownOption } from '@imj_media/ui';
1
2
  import { ListadoProgresoRow } from '../api/listadoProgreso.types';
2
3
  /**
3
4
  * Deriva opciones de dropdown (medios/plazas/estados). Convierte selección de plazas a parámetro API.
@@ -1,4 +1,5 @@
1
1
  import { default as React } from 'react';
2
+ import { TConfigs } from '../core/actions/get_tasks_response.action';
2
3
  export interface IFieldFilter {
3
4
  label: string;
4
5
  type: TType;
@@ -12,9 +13,9 @@ interface IFiltersLayoutContext {
12
13
  fields: IFieldFilter[];
13
14
  filters: FiltersContext;
14
15
  defineFields: (fields: IFieldFilter[]) => void;
15
- updateFilters: ({ name, value }: {
16
+ updateFilters: (payload: {
16
17
  name: string;
17
- value: string;
18
+ value: FilterFormValue;
18
19
  }) => void;
19
20
  cleanFilters: () => void;
20
21
  applyFilters: () => void;
@@ -25,11 +26,12 @@ interface IFiltersLayoutContext {
25
26
  interface FiltersContext {
26
27
  justProjects: boolean;
27
28
  owner: IOwner;
28
- [key: string]: any;
29
+ [key: string]: unknown;
29
30
  }
30
31
  interface IOwner {
31
- user: string;
32
- config: string;
32
+ user: number;
33
+ config?: TConfigs | string;
34
+ role?: string;
33
35
  }
34
36
  export interface TFilters {
35
37
  label: string;
@@ -39,9 +41,10 @@ export interface TFilters {
39
41
  id: string | number;
40
42
  name: string;
41
43
  }[];
42
- [key: string]: any;
44
+ [key: string]: unknown;
43
45
  }
44
- type TType = React.HTMLInputTypeAttribute;
46
+ type TType = React.HTMLInputTypeAttribute | 'integrantes-multiselect';
47
+ export type FilterFormValue = string | number | (string | number)[] | null;
45
48
  export declare const FiltersLayoutProvider: ({ children }: {
46
49
  children: React.ReactNode;
47
50
  }) => import("react/jsx-runtime").JSX.Element;
@@ -16,6 +16,10 @@ export interface IFilters {
16
16
  includeAllTasks?: boolean;
17
17
  cancelada?: boolean | number | string;
18
18
  taskType?: string;
19
+ /** Solo cliente / contexto; no se envía al POST listado-kanban-general. */
20
+ assignment?: KanbanAssignmentFilter;
21
+ /** Solo cliente / contexto; filtro por `responsible` en cliente. */
22
+ teamMemberIds?: number[];
19
23
  }
20
24
  interface IOwner {
21
25
  user: number;
@@ -47,9 +51,15 @@ type TDifficulty = 'Muy facil' | 'Facil' | 'Media' | 'Dificil' | 'Muy dificil';
47
51
  type TPriority = 'Sin prioridad' | 'Prioridad Baja' | 'Prioridad Media' | 'Prioridad Alta';
48
52
  type IDependency = 'con' | 'sin' | 'ambas';
49
53
  type TStatus = 'por_hacer' | 'trabajando' | 'completadas';
54
+ export type KanbanAssignmentFilter = 'todas' | 'asignadas' | 'sin_asignar';
50
55
  export interface GetTasksKanbanPage {
51
56
  tasks: TasksKanbanGeneral[];
57
+ /** Total del servidor (sin filtrar por asignación en cliente). */
52
58
  total: number;
59
+ /** Filas crudas de la API en esta página (paginación con filtros en cliente). */
60
+ rawPageCount: number;
61
+ /** True si el filtro de asignación está activo en cliente. */
62
+ clientSideFilterActive?: boolean;
53
63
  }
54
64
  /**
55
65
  * POST `listado-kanban-general`: filas ya normalizadas (sin mapear a card kanban).
@@ -1,10 +1,10 @@
1
1
  import { InfiniteData, UseInfiniteQueryResult } from '@tanstack/react-query';
2
- import { GetTasksKanbanPage } from '../core/actions/get_tasks_response.action';
2
+ import { GetTasksKanbanPage, TConfigs } from '../core/actions/get_tasks_response.action';
3
3
  /** Payload de filtros enviado al POST listado kanban (columnas del tablero general). */
4
4
  export type KanbanListadoFiltersToSend = {
5
5
  owner: {
6
6
  user: number;
7
- config: string;
7
+ config: TConfigs;
8
8
  role?: string;
9
9
  };
10
10
  status?: string;
@@ -0,0 +1,7 @@
1
+ import { UseQueryResult } from '@tanstack/react-query';
2
+ import { KanbanIntegranteFilterOption } from '../utils/kanbanEquiposEncargados';
3
+ export type KanbanEquiposEncargadosQueryData = {
4
+ esEncargado: boolean;
5
+ integrantesOptions: KanbanIntegranteFilterOption[];
6
+ };
7
+ export declare function useKanbanEquiposEncargados(): UseQueryResult<KanbanEquiposEncargadosQueryData>;
@@ -29,5 +29,27 @@
29
29
  * ```
30
30
  */
31
31
  export declare const useGetInputFiltersByPath: (currentPath: string) => {
32
- inputFilters: any[];
32
+ inputFilters: ({
33
+ icon?: import('@imj_media/ui').VisualSlotType;
34
+ label: string;
35
+ keyName?: string;
36
+ value?: string;
37
+ onValueChange?: (value: import('@imj_media/ui').FilterChangeValue) => void;
38
+ options?: import('@imj_media/ui').DropdownOption[];
39
+ placeholder?: string;
40
+ clearText?: string;
41
+ type?: "date" | "multiple" | "group" | "dropdown" | "input" | "textarea" | "dateRange";
42
+ title?: string;
43
+ } | {
44
+ options: any;
45
+ icon?: import('@imj_media/ui').VisualSlotType;
46
+ label: string;
47
+ keyName?: string;
48
+ value?: string;
49
+ onValueChange?: (value: import('@imj_media/ui').FilterChangeValue) => void;
50
+ placeholder?: string;
51
+ clearText?: string;
52
+ type?: "date" | "multiple" | "group" | "dropdown" | "input" | "textarea" | "dateRange";
53
+ title?: string;
54
+ })[];
33
55
  };
@@ -0,0 +1,25 @@
1
+ import { GetTasksKanbanPage } from '../core/actions/get_tasks_response.action';
2
+ import { KanbanIntegranteFilterOption } from './kanbanEquiposEncargados';
3
+ export declare const KANBAN_ASSIGNMENT_FILTER_ID = "assignment";
4
+ export declare const KANBAN_INTEGRANTE_FILTER_ID = "teamMemberIds";
5
+ export type KanbanAssignmentFilterValue = 'todas' | 'asignadas' | 'sin_asignar';
6
+ export declare const KANBAN_ASSIGNMENT_FILTER_DEFAULT: KanbanAssignmentFilterValue;
7
+ /** Convierte la selección del multiselect (números o textos) en IDs de usuario válidos para filtrar. */
8
+ export declare function normalizeKanbanTeamMemberIds(raw: unknown): number[];
9
+ type KanbanFilterField = {
10
+ id: string;
11
+ };
12
+ /** Inyecta filtros de encargado (asignación e integrantes) cuando aplican. */
13
+ export declare function buildKanbanEncargadoFilterFields<T extends KanbanFilterField>(baseFilters: T[], esEncargado: boolean, integrantesOptions?: KanbanIntegranteFilterOption[]): T[];
14
+ export type KanbanListadoClientFilterState = {
15
+ assignment?: unknown;
16
+ teamMemberIds?: unknown;
17
+ };
18
+ export declare function isKanbanListadoClientSideFilterActive(state: KanbanListadoClientFilterState): boolean;
19
+ export declare function applyKanbanListadoClientSideTaskFilters<T extends {
20
+ responsible: number | null;
21
+ }>(tasks: T[], state: KanbanListadoClientFilterState): T[];
22
+ export declare function pickKanbanListadoClientFilterState(filters: Record<string, unknown> | undefined): KanbanListadoClientFilterState;
23
+ /** Total de columna: meta del servidor o conteo filtrado en cliente si aplica. */
24
+ export declare function getKanbanListadoColumnTotal(pages: GetTasksKanbanPage[] | undefined, clientFilters: KanbanListadoClientFilterState): number;
25
+ export {};
@@ -0,0 +1,18 @@
1
+ import { MemberList } from '../modules/teams/infrastructure/interfaces/team';
2
+ /** Equipo con árbol de miembros (populate kanban). */
3
+ export type KanbanEquipoConMiembros = {
4
+ id: number;
5
+ nombre?: string;
6
+ color?: string;
7
+ miembros?: MemberList;
8
+ };
9
+ /** Query string para GET `/api/equipos` (detección de encargado). */
10
+ export declare function buildKanbanEquiposEncargadosQuery(): string;
11
+ /** True si el usuario logueado figura como encargado en algún equipo devuelto. */
12
+ export declare function usuarioEsEncargadoEnEquipos(equipos: KanbanEquipoConMiembros[], userId: number): boolean;
13
+ export type KanbanIntegranteFilterOption = {
14
+ id: number;
15
+ name: string;
16
+ };
17
+ /** Opciones del multiselect «Por integrante de equipo» (miembros de equipos donde el usuario es encargado). */
18
+ export declare function buildKanbanIntegrantesFilterOptions(equipos: KanbanEquipoConMiembros[], userId: number): KanbanIntegranteFilterOption[];
@@ -5,3 +5,13 @@ export declare function canUseKanbanTodasTareasFilter(role: string | undefined |
5
5
  * Evita enviar `config: 'todas'` al listado si el rol no está autorizado (p. ej. manipulación del payload).
6
6
  */
7
7
  export declare function resolveOwnerConfigForKanbanListado(config: string | undefined | null, role: string | undefined | null): TConfigs;
8
+ type FilterWithOptions = {
9
+ id: string;
10
+ options: {
11
+ id: string | number;
12
+ name: string;
13
+ }[];
14
+ };
15
+ /** Añade «Todas las tareas» en «Por responsable» para roles permitidos. */
16
+ export declare function applyKanbanTodasTareasRoleOptions<T extends FilterWithOptions>(filters: T[], userRole: string): T[];
17
+ export {};