@imj_media/tareas 1.6.5 → 1.6.7

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
+ /** Filtro encargado: `POST listado-kanban-general` (`responsable.id`). */
20
+ assignment?: KanbanAssignmentFilter;
21
+ /** Filtro encargado: IDs de usuario responsable (`responsable.id`). */
22
+ teamMemberIds?: number[];
19
23
  }
20
24
  interface IOwner {
21
25
  user: number;
@@ -47,8 +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';
55
+ /** Subconjunto de `IFilters` enviado al POST cuando los filtros de encargado están activos. */
56
+ export type KanbanEncargadoListadoRequestFields = {
57
+ assignment?: Exclude<KanbanAssignmentFilter, 'todas'>;
58
+ teamMemberIds?: number[];
59
+ };
50
60
  export interface GetTasksKanbanPage {
51
61
  tasks: TasksKanbanGeneral[];
62
+ /** Total del servidor (`meta.pagination.total`, incluye filtros de encargado). */
52
63
  total: number;
53
64
  }
54
65
  /**
@@ -1,13 +1,15 @@
1
1
  import { InfiniteData, UseInfiniteQueryResult } from '@tanstack/react-query';
2
- import { GetTasksKanbanPage } from '../core/actions/get_tasks_response.action';
2
+ import { GetTasksKanbanPage, KanbanAssignmentFilter, 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;
11
+ assignment?: KanbanAssignmentFilter;
12
+ teamMemberIds?: number[];
11
13
  [key: string]: unknown;
12
14
  };
13
15
  export type KanbanListadoInfiniteQueryResult = UseInfiniteQueryResult<InfiniteData<GetTasksKanbanPage, unknown>, Error>;
@@ -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,23 @@
1
+ import { GetTasksKanbanPage, KanbanAssignmentFilter, KanbanEncargadoListadoRequestFields } 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 declare const KANBAN_ASSIGNMENT_FILTER_DEFAULT: KanbanAssignmentFilter;
6
+ /** Convierte la selección del multiselect (números o textos) en IDs de usuario válidos para filtrar. */
7
+ export declare function normalizeKanbanTeamMemberIds(raw: unknown): number[];
8
+ type KanbanEncargadoListadoRequestInput = {
9
+ assignment?: KanbanAssignmentFilter | unknown;
10
+ teamMemberIds?: number[] | unknown;
11
+ };
12
+ /** Campos de encargado listos para el cuerpo `data` del POST listado (omite defaults inactivos). */
13
+ export declare function buildKanbanEncargadoListadoRequestFields(filters: KanbanEncargadoListadoRequestInput): KanbanEncargadoListadoRequestFields;
14
+ type KanbanFilterField = {
15
+ id: string;
16
+ };
17
+ /** Inyecta filtros de encargado (asignación e integrantes) cuando aplican. */
18
+ export declare function buildKanbanEncargadoFilterFields<T extends KanbanFilterField>(baseFilters: T[], esEncargado: boolean, integrantesOptions?: KanbanIntegranteFilterOption[]): T[];
19
+ /** Total de columna desde `meta.pagination.total` del servidor (primera página del infinite query). */
20
+ export declare function getKanbanListadoColumnTotal(pages: GetTasksKanbanPage[] | undefined): number;
21
+ /** Quita filtros de encargado de params legacy (`GET listado_tareas?justProjects`). */
22
+ export declare function omitKanbanEncargadoFiltersFromLegacyParams<T extends Record<string, unknown>>(params: T): T;
23
+ 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 {};