@trii/components 2.0.68 → 2.0.70
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.
- package/dist/cjs/index.js +10 -10
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +10 -10
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +50 -82
- package/dist/types/components/EventsDialog/EventsDialog.d.ts +17 -82
- package/dist/types/components/EventsDialog/components/ConfirmDeleteDialog/ConfirmDeleteDialog.d.ts +10 -0
- package/dist/types/components/EventsDialog/components/ConfirmDeleteDialog/index.d.ts +1 -0
- package/dist/types/components/EventsDialog/components/DeleteRecurringEventDialog/DeleteRecurringEventDialog.d.ts +9 -0
- package/dist/types/components/EventsDialog/components/DeleteRecurringEventDialog/index.d.ts +1 -0
- package/dist/types/components/EventsDialog/components/EditRecurringEventDialog/EditRecurringEventDialog.d.ts +9 -0
- package/dist/types/components/EventsDialog/components/EditRecurringEventDialog/index.d.ts +1 -0
- package/dist/types/components/EventsDialog/components/LinkContactsSelect/hooks/useLinkContactsSearch.d.ts +17 -0
- package/dist/types/components/EventsDialog/components/index.d.ts +3 -0
- package/dist/types/components/EventsDialog/context/CalendarContext.d.ts +1 -0
- package/dist/types/components/EventsDialog/context/CalendarContextProvider.d.ts +17 -1
- package/dist/types/components/EventsDialog/context/TranslationContext.d.ts +9 -0
- package/dist/types/components/EventsDialog/context/types/CalendarDialogState.d.ts +6 -1
- package/dist/types/components/EventsDialog/hooks/index.d.ts +5 -5
- package/dist/types/components/EventsDialog/hooks/useEvent.d.ts +1 -1
- package/dist/types/components/EventsDialog/hooks/useTask.d.ts +1 -1
- package/dist/types/components/EventsDialog/index.d.ts +21 -6
- package/dist/types/components/EventsDialog/services/calendarApi.d.ts +24 -0
- package/dist/types/components/EventsDialog/services/urls.d.ts +1 -0
- package/dist/types/components/EventsDialog/theme/MuiComponentsConfig.d.ts +3 -0
- package/dist/types/components/EventsDialog/types.d.ts +1 -1
- package/dist/types/components/EventsDialog/utils/googleMapsUtils.d.ts +5 -0
- package/dist/types/components/EventsDialog/utils/keyboardNavigation.d.ts +2 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3,8 +3,6 @@ import { IContact, IBusiness } from '@trii/types/dist/Contacts';
|
|
|
3
3
|
import { SxProps, Theme } from '@mui/material';
|
|
4
4
|
import { IContact as IContact$1, IBusiness as IBusiness$1 } from '@trii/types/dist/Contacts/contacts';
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import { ICalendar } from '@trii/types/dist/Calendar/Calendar';
|
|
7
|
-
import { IEvent } from '@trii/types/dist/Calendar';
|
|
8
6
|
import * as i18next from 'i18next';
|
|
9
7
|
|
|
10
8
|
interface ContactInfoPopupProps {
|
|
@@ -37,42 +35,9 @@ type Mode = 'view' | 'create' | 'edit';
|
|
|
37
35
|
|
|
38
36
|
type DialogType = 'event' | 'task';
|
|
39
37
|
|
|
40
|
-
interface Notification$1 {
|
|
41
|
-
id?: string;
|
|
42
|
-
type: 'minutes' | 'hours' | 'days';
|
|
43
|
-
value: number;
|
|
44
|
-
sendToContact?: boolean;
|
|
45
|
-
}
|
|
46
|
-
interface EventData {
|
|
47
|
-
id?: string;
|
|
48
|
-
title: string;
|
|
49
|
-
details?: string;
|
|
50
|
-
description?: string;
|
|
51
|
-
startAt: string;
|
|
52
|
-
endAt: string;
|
|
53
|
-
allDay: boolean;
|
|
54
|
-
calendarId?: string;
|
|
55
|
-
color?: string;
|
|
56
|
-
location?: string;
|
|
57
|
-
isPrivate?: boolean;
|
|
58
|
-
rule?: string;
|
|
59
|
-
notifications?: Notification$1[];
|
|
60
|
-
relatedContactId?: string;
|
|
61
|
-
sharedWith?: string[];
|
|
62
|
-
}
|
|
63
|
-
interface TaskData {
|
|
64
|
-
id?: string;
|
|
65
|
-
title: string;
|
|
66
|
-
description?: string;
|
|
67
|
-
startAt: string;
|
|
68
|
-
endAt: string;
|
|
69
|
-
calendarId?: string;
|
|
70
|
-
isCompleted?: boolean;
|
|
71
|
-
relatedContactId?: string;
|
|
72
|
-
}
|
|
73
38
|
/**
|
|
74
39
|
* Props para el componente EventsDialog
|
|
75
|
-
*
|
|
40
|
+
* Solo requiere las propiedades esenciales; el resto se maneja internamente mediante APIs
|
|
76
41
|
*/
|
|
77
42
|
interface EventsDialogProps {
|
|
78
43
|
/** Estado de apertura del modal */
|
|
@@ -80,61 +45,35 @@ interface EventsDialogProps {
|
|
|
80
45
|
/** Callback al cerrar el modal */
|
|
81
46
|
onClose: () => void;
|
|
82
47
|
/** URL base de la API */
|
|
83
|
-
baseUrl
|
|
48
|
+
baseUrl: string;
|
|
84
49
|
/** ID del espacio */
|
|
85
|
-
spaceId
|
|
50
|
+
spaceId: string;
|
|
86
51
|
/** Idioma de la interfaz */
|
|
87
52
|
language?: 'en' | 'es';
|
|
88
|
-
/** Estilos personalizados */
|
|
89
|
-
sx?: SxProps<Theme>;
|
|
90
53
|
/** Modo del diálogo: 'create' | 'edit' | 'view' */
|
|
91
54
|
mode?: Mode;
|
|
92
55
|
/** Tipo de diálogo: 'event' | 'task' */
|
|
93
56
|
type?: DialogType;
|
|
94
|
-
/**
|
|
95
|
-
calendars?: ICalendar[];
|
|
96
|
-
/** ID del calendario seleccionado para eventos */
|
|
57
|
+
/** ID del calendario seleccionado para eventos (usado en modo view/edit) */
|
|
97
58
|
eventCalendarId?: string;
|
|
98
|
-
/** ID del calendario seleccionado para tareas */
|
|
59
|
+
/** ID del calendario seleccionado para tareas (usado en modo view/edit) */
|
|
99
60
|
taskCalendarId?: string;
|
|
100
|
-
/** Evento seleccionado para
|
|
101
|
-
selectedEvent?:
|
|
102
|
-
/** Tarea seleccionada para
|
|
103
|
-
selectedTask?: any
|
|
104
|
-
/**
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
|
|
108
|
-
/** Callback al eliminar un evento */
|
|
109
|
-
onDeleteEvent?: (eventId: string) => void | Promise<void>;
|
|
110
|
-
/** Callback al crear una tarea */
|
|
111
|
-
onCreateTask?: (taskData: TaskData) => void | Promise<void>;
|
|
112
|
-
/** Callback al actualizar una tarea */
|
|
113
|
-
onUpdateTask?: (taskId: string, taskData: TaskData) => void | Promise<void>;
|
|
114
|
-
/** Callback al eliminar una tarea */
|
|
115
|
-
onDeleteTask?: (taskId: string) => void | Promise<void>;
|
|
116
|
-
/** Callback al duplicar un elemento */
|
|
117
|
-
onDuplicate?: () => void;
|
|
118
|
-
/** Callback al cambiar el modo a edición */
|
|
119
|
-
onEdit?: () => void;
|
|
120
|
-
/** Callback al cambiar el tipo de diálogo */
|
|
121
|
-
onTypeChange?: (type: DialogType) => void;
|
|
122
|
-
/** Callback al cambiar el calendario seleccionado para eventos */
|
|
123
|
-
onEventCalendarChange?: (calendarId: string) => void;
|
|
124
|
-
/** Callback al cambiar el calendario seleccionado para tareas */
|
|
125
|
-
onTaskCalendarChange?: (calendarId: string) => void;
|
|
126
|
-
/** Ocultar tabs de tipo (evento/tarea) */
|
|
127
|
-
hideTypeTabs?: boolean;
|
|
128
|
-
/** Ocultar botón de eliminar */
|
|
129
|
-
hideDeleteButton?: boolean;
|
|
130
|
-
/** Ocultar botón de editar */
|
|
131
|
-
hideEditButton?: boolean;
|
|
132
|
-
/** Ocultar botón de duplicar */
|
|
133
|
-
hideDuplicateButton?: boolean;
|
|
61
|
+
/** Evento seleccionado para modo edit/view */
|
|
62
|
+
selectedEvent?: any;
|
|
63
|
+
/** Tarea seleccionada para modo edit/view */
|
|
64
|
+
selectedTask?: any;
|
|
65
|
+
/** Estilos personalizados */
|
|
66
|
+
sx?: SxProps<Theme>;
|
|
67
|
+
/** Tabs a ocultar: 'details', 'reminders', 'tasks' */
|
|
68
|
+
hiddenTabs?: boolean;
|
|
134
69
|
}
|
|
135
70
|
/**
|
|
136
71
|
* EventsDialog - Componente para gestión de eventos y tareas
|
|
137
72
|
*
|
|
73
|
+
* Este componente maneja internamente toda la lógica de CRUD de eventos y tareas
|
|
74
|
+
* mediante las APIs. Solo requiere las props esenciales: baseUrl, spaceId, open, onClose.
|
|
75
|
+
* Los calendarios, eventos y tareas se cargan automáticamente desde las APIs.
|
|
76
|
+
*
|
|
138
77
|
* @example
|
|
139
78
|
* ```tsx
|
|
140
79
|
* <EventsDialog
|
|
@@ -145,10 +84,6 @@ interface EventsDialogProps {
|
|
|
145
84
|
* language="es"
|
|
146
85
|
* mode="create"
|
|
147
86
|
* type="event"
|
|
148
|
-
* calendars={myCalendars}
|
|
149
|
-
* onCreateEvent={(data) => createEvent(data)}
|
|
150
|
-
* onUpdateEvent={(id, data) => updateEvent(id, data)}
|
|
151
|
-
* onDeleteEvent={(id) => deleteEvent(id)}
|
|
152
87
|
* />
|
|
153
88
|
* ```
|
|
154
89
|
*/
|
|
@@ -190,6 +125,39 @@ interface Contact {
|
|
|
190
125
|
phone?: string;
|
|
191
126
|
avatarUrl?: string;
|
|
192
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* Datos de un evento
|
|
130
|
+
*/
|
|
131
|
+
interface EventData {
|
|
132
|
+
id?: string;
|
|
133
|
+
title: string;
|
|
134
|
+
details?: string;
|
|
135
|
+
description?: string;
|
|
136
|
+
startAt: string;
|
|
137
|
+
endAt: string;
|
|
138
|
+
allDay: boolean;
|
|
139
|
+
calendarId?: string;
|
|
140
|
+
color?: string;
|
|
141
|
+
location?: string;
|
|
142
|
+
isPrivate?: boolean;
|
|
143
|
+
rule?: string;
|
|
144
|
+
notifications?: Notification[];
|
|
145
|
+
relatedContactId?: string;
|
|
146
|
+
sharedWith?: string[];
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Datos de una tarea
|
|
150
|
+
*/
|
|
151
|
+
interface TaskData {
|
|
152
|
+
id?: string;
|
|
153
|
+
title: string;
|
|
154
|
+
description?: string;
|
|
155
|
+
startAt: string;
|
|
156
|
+
endAt: string;
|
|
157
|
+
calendarId?: string;
|
|
158
|
+
isCompleted?: boolean;
|
|
159
|
+
relatedContactId?: string;
|
|
160
|
+
}
|
|
193
161
|
|
|
194
162
|
declare const i18nInstance: i18next.i18n;
|
|
195
163
|
|
|
@@ -1,45 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ICalendar } from '@trii/types/dist/Calendar/Calendar';
|
|
3
|
-
import { IEvent } from '@trii/types/dist/Calendar';
|
|
4
2
|
import { Mode } from './context/types/Mode';
|
|
5
3
|
import { DialogType } from './context/types/DialogType';
|
|
6
4
|
import { SxProps, Theme } from '@mui/material';
|
|
7
|
-
interface Notification {
|
|
8
|
-
id?: string;
|
|
9
|
-
type: 'minutes' | 'hours' | 'days';
|
|
10
|
-
value: number;
|
|
11
|
-
sendToContact?: boolean;
|
|
12
|
-
}
|
|
13
|
-
export interface EventData {
|
|
14
|
-
id?: string;
|
|
15
|
-
title: string;
|
|
16
|
-
details?: string;
|
|
17
|
-
description?: string;
|
|
18
|
-
startAt: string;
|
|
19
|
-
endAt: string;
|
|
20
|
-
allDay: boolean;
|
|
21
|
-
calendarId?: string;
|
|
22
|
-
color?: string;
|
|
23
|
-
location?: string;
|
|
24
|
-
isPrivate?: boolean;
|
|
25
|
-
rule?: string;
|
|
26
|
-
notifications?: Notification[];
|
|
27
|
-
relatedContactId?: string;
|
|
28
|
-
sharedWith?: string[];
|
|
29
|
-
}
|
|
30
|
-
export interface TaskData {
|
|
31
|
-
id?: string;
|
|
32
|
-
title: string;
|
|
33
|
-
description?: string;
|
|
34
|
-
startAt: string;
|
|
35
|
-
endAt: string;
|
|
36
|
-
calendarId?: string;
|
|
37
|
-
isCompleted?: boolean;
|
|
38
|
-
relatedContactId?: string;
|
|
39
|
-
}
|
|
40
5
|
/**
|
|
41
6
|
* Props para el componente EventsDialog
|
|
42
|
-
*
|
|
7
|
+
* Solo requiere las propiedades esenciales; el resto se maneja internamente mediante APIs
|
|
43
8
|
*/
|
|
44
9
|
export interface EventsDialogProps {
|
|
45
10
|
/** Estado de apertura del modal */
|
|
@@ -47,61 +12,35 @@ export interface EventsDialogProps {
|
|
|
47
12
|
/** Callback al cerrar el modal */
|
|
48
13
|
onClose: () => void;
|
|
49
14
|
/** URL base de la API */
|
|
50
|
-
baseUrl
|
|
15
|
+
baseUrl: string;
|
|
51
16
|
/** ID del espacio */
|
|
52
|
-
spaceId
|
|
17
|
+
spaceId: string;
|
|
53
18
|
/** Idioma de la interfaz */
|
|
54
19
|
language?: 'en' | 'es';
|
|
55
|
-
/** Estilos personalizados */
|
|
56
|
-
sx?: SxProps<Theme>;
|
|
57
20
|
/** Modo del diálogo: 'create' | 'edit' | 'view' */
|
|
58
21
|
mode?: Mode;
|
|
59
22
|
/** Tipo de diálogo: 'event' | 'task' */
|
|
60
23
|
type?: DialogType;
|
|
61
|
-
/**
|
|
62
|
-
calendars?: ICalendar[];
|
|
63
|
-
/** ID del calendario seleccionado para eventos */
|
|
24
|
+
/** ID del calendario seleccionado para eventos (usado en modo view/edit) */
|
|
64
25
|
eventCalendarId?: string;
|
|
65
|
-
/** ID del calendario seleccionado para tareas */
|
|
26
|
+
/** ID del calendario seleccionado para tareas (usado en modo view/edit) */
|
|
66
27
|
taskCalendarId?: string;
|
|
67
|
-
/** Evento seleccionado para
|
|
68
|
-
selectedEvent?:
|
|
69
|
-
/** Tarea seleccionada para
|
|
70
|
-
selectedTask?: any
|
|
71
|
-
/**
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
|
|
75
|
-
/** Callback al eliminar un evento */
|
|
76
|
-
onDeleteEvent?: (eventId: string) => void | Promise<void>;
|
|
77
|
-
/** Callback al crear una tarea */
|
|
78
|
-
onCreateTask?: (taskData: TaskData) => void | Promise<void>;
|
|
79
|
-
/** Callback al actualizar una tarea */
|
|
80
|
-
onUpdateTask?: (taskId: string, taskData: TaskData) => void | Promise<void>;
|
|
81
|
-
/** Callback al eliminar una tarea */
|
|
82
|
-
onDeleteTask?: (taskId: string) => void | Promise<void>;
|
|
83
|
-
/** Callback al duplicar un elemento */
|
|
84
|
-
onDuplicate?: () => void;
|
|
85
|
-
/** Callback al cambiar el modo a edición */
|
|
86
|
-
onEdit?: () => void;
|
|
87
|
-
/** Callback al cambiar el tipo de diálogo */
|
|
88
|
-
onTypeChange?: (type: DialogType) => void;
|
|
89
|
-
/** Callback al cambiar el calendario seleccionado para eventos */
|
|
90
|
-
onEventCalendarChange?: (calendarId: string) => void;
|
|
91
|
-
/** Callback al cambiar el calendario seleccionado para tareas */
|
|
92
|
-
onTaskCalendarChange?: (calendarId: string) => void;
|
|
93
|
-
/** Ocultar tabs de tipo (evento/tarea) */
|
|
94
|
-
hideTypeTabs?: boolean;
|
|
95
|
-
/** Ocultar botón de eliminar */
|
|
96
|
-
hideDeleteButton?: boolean;
|
|
97
|
-
/** Ocultar botón de editar */
|
|
98
|
-
hideEditButton?: boolean;
|
|
99
|
-
/** Ocultar botón de duplicar */
|
|
100
|
-
hideDuplicateButton?: boolean;
|
|
28
|
+
/** Evento seleccionado para modo edit/view */
|
|
29
|
+
selectedEvent?: any;
|
|
30
|
+
/** Tarea seleccionada para modo edit/view */
|
|
31
|
+
selectedTask?: any;
|
|
32
|
+
/** Estilos personalizados */
|
|
33
|
+
sx?: SxProps<Theme>;
|
|
34
|
+
/** Tabs a ocultar: 'details', 'reminders', 'tasks' */
|
|
35
|
+
hiddenTabs?: boolean;
|
|
101
36
|
}
|
|
102
37
|
/**
|
|
103
38
|
* EventsDialog - Componente para gestión de eventos y tareas
|
|
104
39
|
*
|
|
40
|
+
* Este componente maneja internamente toda la lógica de CRUD de eventos y tareas
|
|
41
|
+
* mediante las APIs. Solo requiere las props esenciales: baseUrl, spaceId, open, onClose.
|
|
42
|
+
* Los calendarios, eventos y tareas se cargan automáticamente desde las APIs.
|
|
43
|
+
*
|
|
105
44
|
* @example
|
|
106
45
|
* ```tsx
|
|
107
46
|
* <EventsDialog
|
|
@@ -112,10 +51,6 @@ export interface EventsDialogProps {
|
|
|
112
51
|
* language="es"
|
|
113
52
|
* mode="create"
|
|
114
53
|
* type="event"
|
|
115
|
-
* calendars={myCalendars}
|
|
116
|
-
* onCreateEvent={(data) => createEvent(data)}
|
|
117
|
-
* onUpdateEvent={(id, data) => updateEvent(id, data)}
|
|
118
|
-
* onDeleteEvent={(id) => deleteEvent(id)}
|
|
119
54
|
* />
|
|
120
55
|
* ```
|
|
121
56
|
*/
|
package/dist/types/components/EventsDialog/components/ConfirmDeleteDialog/ConfirmDeleteDialog.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface ConfirmDeleteDialogProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
onConfirm: () => void;
|
|
6
|
+
itemTitle?: string;
|
|
7
|
+
itemType: 'event' | 'task';
|
|
8
|
+
}
|
|
9
|
+
declare const ConfirmDeleteDialog: React.FC<ConfirmDeleteDialogProps>;
|
|
10
|
+
export default ConfirmDeleteDialog;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ConfirmDeleteDialog';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface DeleteRecurringEventDialogProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
onConfirm: (deleteAll: boolean) => void;
|
|
6
|
+
eventTitle?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const DeleteRecurringEventDialog: React.FC<DeleteRecurringEventDialogProps>;
|
|
9
|
+
export default DeleteRecurringEventDialog;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './DeleteRecurringEventDialog';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface EditRecurringEventDialogProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
onConfirm: (editAll: boolean) => void;
|
|
6
|
+
eventTitle?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const EditRecurringEventDialog: React.FC<EditRecurringEventDialogProps>;
|
|
9
|
+
export default EditRecurringEventDialog;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './EditRecurringEventDialog';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { UIEvent } from 'react';
|
|
2
|
+
import { IContact } from '@trii/types/dist/Contacts';
|
|
3
|
+
type ApiContext = {
|
|
4
|
+
baseUrl: string;
|
|
5
|
+
spaceId: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function useLinkContactsSearch(apiContext: ApiContext | null): {
|
|
8
|
+
contactList: IContact[];
|
|
9
|
+
hasSearched: boolean;
|
|
10
|
+
isLoading: boolean;
|
|
11
|
+
isLoadingTimer: boolean;
|
|
12
|
+
isNextPage: boolean;
|
|
13
|
+
handleQueryChanged: (value: string) => void;
|
|
14
|
+
handleScroll: (e: UIEvent<HTMLElement>, currentSearch: string) => void;
|
|
15
|
+
resetSearchState: () => void;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
@@ -11,3 +11,6 @@ export { default as TaskCalendarSelect } from './TaskCalendarSelect';
|
|
|
11
11
|
export { default as AllDayCheckbox } from './AllDayCheckbox';
|
|
12
12
|
export { default as ColorPicker } from './ColorPicker';
|
|
13
13
|
export { default as RecurrenceSelect } from './RecurrenceSelect';
|
|
14
|
+
export { default as ConfirmDeleteDialog } from './ConfirmDeleteDialog';
|
|
15
|
+
export { default as DeleteRecurringEventDialog } from './DeleteRecurringEventDialog';
|
|
16
|
+
export { default as EditRecurringEventDialog } from './EditRecurringEventDialog';
|
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { Mode } from './types/Mode';
|
|
2
3
|
interface Props {
|
|
3
4
|
children: React.ReactNode;
|
|
5
|
+
/** Props opcionales para controlar el diálogo desde fuera */
|
|
6
|
+
externalOpen?: boolean;
|
|
7
|
+
externalOnClose?: () => void;
|
|
8
|
+
externalMode?: Mode;
|
|
9
|
+
externalType?: 'event' | 'task';
|
|
10
|
+
/** ID del calendario para eventos (usado como valor inicial) */
|
|
11
|
+
externalEventCalendarId?: string;
|
|
12
|
+
/** ID del calendario para tareas (usado como valor inicial) */
|
|
13
|
+
externalTaskCalendarId?: string;
|
|
14
|
+
/** Evento seleccionado para modo edit/view */
|
|
15
|
+
externalSelectedEvent?: any;
|
|
16
|
+
/** Tarea seleccionada para modo edit/view */
|
|
17
|
+
externalSelectedTask?: any;
|
|
18
|
+
/** Tabs a ocultar*/
|
|
19
|
+
hiddenTabs?: boolean;
|
|
4
20
|
}
|
|
5
|
-
declare const CalendarContextProvider: ({ children }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
declare const CalendarContextProvider: ({ children, externalOpen, externalOnClose, externalMode, externalType, externalEventCalendarId, externalTaskCalendarId, externalSelectedEvent, externalSelectedTask, hiddenTabs, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
6
22
|
export default CalendarContextProvider;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type TranslationFn = (key: string, ...args: unknown[]) => string;
|
|
3
|
+
interface TranslationProviderProps {
|
|
4
|
+
t: TranslationFn;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const TranslationProvider: ({ t, children }: TranslationProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const useTranslationContext: () => TranslationFn;
|
|
9
|
+
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { default as useField, useFieldInitialState, type UseFieldType } from './useField';
|
|
2
2
|
export { default as useSelect, type UseSelect } from './useSelect';
|
|
3
3
|
export { default as useDialog, useDialogInitialState, type UseDialog } from './useDialog';
|
|
4
|
-
export { default as useEvent, useEventInitialState, type UseEvent, type UseDateState, type UseLinkContact, type UseShareWithUsers,
|
|
4
|
+
export { default as useEvent, useEventInitialState, type UseEvent, type UseDateState, type UseLinkContact, type UseShareWithUsers, } from './useEvent';
|
|
5
|
+
export { type UseNotificationsType } from './useNotifications';
|
|
5
6
|
export { default as useTask, useTaskInitialState, type UseTask } from './useTask';
|
|
6
|
-
export { default as useCalendar, useCalendarInitialState, type UseCalendarType } from './useCalendar';
|
|
7
|
-
export { default as useCalendarEvents, useCalendarEventsInitialState, type UseCalendarEventsType, type CalendarEvent } from './useCalendarEvents';
|
|
8
|
-
export { default as useCalendarTasks, useCalendarTasksInitialState, type UseCalendarTasksType, type CalendarTask } from './useCalendarTasks';
|
|
9
|
-
export { useAppDispatch } from './useAppDispatch';
|
|
7
|
+
export { default as useCalendar, useCalendarInitialState, type UseCalendarType, } from './useCalendar';
|
|
8
|
+
export { default as useCalendarEvents, useCalendarEventsInitialState, type UseCalendarEventsType, type CalendarEvent, } from './useCalendarEvents';
|
|
9
|
+
export { default as useCalendarTasks, useCalendarTasksInitialState, type UseCalendarTasksType, type CalendarTask, } from './useCalendarTasks';
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* EventsDialog - Componente para gestión de eventos y tareas
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Este componente maneja internamente toda la lógica de CRUD mediante APIs.
|
|
5
|
+
* Solo requiere props esenciales: baseUrl, spaceId, open, onClose.
|
|
6
|
+
* Para modo edit/view, también pasa selectedEvent o selectedTask.
|
|
7
|
+
*
|
|
8
|
+
* Uso básico (crear):
|
|
5
9
|
* ```tsx
|
|
6
10
|
* import { EventsDialog } from '@trii/components';
|
|
7
11
|
*
|
|
@@ -13,14 +17,25 @@
|
|
|
13
17
|
* language="es"
|
|
14
18
|
* mode="create"
|
|
15
19
|
* type="event"
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
+
* />
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* Uso para editar:
|
|
24
|
+
* ```tsx
|
|
25
|
+
* <EventsDialog
|
|
26
|
+
* open={isOpen}
|
|
27
|
+
* onClose={handleClose}
|
|
28
|
+
* baseUrl="https://api.trii.app/api/v1"
|
|
29
|
+
* spaceId={spaceId}
|
|
30
|
+
* language="es"
|
|
31
|
+
* mode="edit"
|
|
32
|
+
* type="event"
|
|
33
|
+
* selectedEvent={myEvent}
|
|
34
|
+
* eventCalendarId={myEvent.calendarId}
|
|
20
35
|
* />
|
|
21
36
|
* ```
|
|
22
37
|
*/
|
|
23
38
|
export { default } from './EventsDialog';
|
|
24
39
|
export { default as EventsDialog } from './EventsDialog';
|
|
25
|
-
export type { EventsDialogProps
|
|
40
|
+
export type { EventsDialogProps } from './EventsDialog';
|
|
26
41
|
export * from './types';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IEvent } from '@trii/types/dist/Calendar';
|
|
2
|
+
import { ICalendar } from '@trii/types/dist/Calendar/Calendar';
|
|
3
|
+
import { ITask } from '@trii/types/dist/Calendar';
|
|
4
|
+
import { UserTrii } from '@trii/types/dist/Users';
|
|
5
|
+
import type { AddActivityRequestData, UpdatedActivityRequestData, AddTaskRequestData, AddCalendarRequestData } from '../types';
|
|
6
|
+
type ApiContext = {
|
|
7
|
+
baseUrl: string;
|
|
8
|
+
spaceId: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function fetchUserTrii(ctx: ApiContext): Promise<UserTrii>;
|
|
11
|
+
export declare function fetchActivities(ctx: ApiContext, start: string, end: string): Promise<IEvent[]>;
|
|
12
|
+
export declare function addActivity(ctx: ApiContext, data: AddActivityRequestData): Promise<IEvent>;
|
|
13
|
+
export declare function updateActivity(ctx: ApiContext, data: UpdatedActivityRequestData): Promise<IEvent>;
|
|
14
|
+
export declare function deleteActivity(ctx: ApiContext, activityId: string, originalOccurrenceDate?: Date | string): Promise<void>;
|
|
15
|
+
export declare function endActivity(ctx: ApiContext, activityId: string): Promise<IEvent>;
|
|
16
|
+
export declare function fetchTasks(ctx: ApiContext, calendarId: string): Promise<ITask[]>;
|
|
17
|
+
export declare function addTask(ctx: ApiContext, data: AddTaskRequestData): Promise<ITask>;
|
|
18
|
+
export declare function updateTaskApi(ctx: ApiContext, taskId: string, updatedTask: Record<string, unknown>): Promise<ITask>;
|
|
19
|
+
export declare function deleteTaskApi(ctx: ApiContext, taskId: string): Promise<void>;
|
|
20
|
+
export declare function toggleTaskCompletedApi(ctx: ApiContext, taskId: string, isCompleted: boolean): Promise<ITask>;
|
|
21
|
+
export declare function fetchCalendars(ctx: ApiContext): Promise<ICalendar[]>;
|
|
22
|
+
export declare function addCalendarApi(ctx: ApiContext, data: AddCalendarRequestData): Promise<ICalendar>;
|
|
23
|
+
export declare function updateCalendarApi(ctx: ApiContext, calendarId: string, data: AddCalendarRequestData): Promise<ICalendar>;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-exportaciones de googleMapsLoader para mantener compatibilidad
|
|
3
|
+
* Este archivo actúa como alias para las funciones de Google Maps
|
|
4
|
+
*/
|
|
5
|
+
export { GOOGLE_MAPS_CONFIG, GOOGLE_MAPS_SCRIPT_CONFIG, useGoogleMapsLoader, loadGoogleMapsAsync, getStaticMapUrl, geocodeAddress, } from './googleMapsLoader';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Utilidades para navegación por teclado en el calendario
|
|
3
3
|
*/
|
|
4
|
-
|
|
4
|
+
type View = 'month' | 'week' | 'day' | 'work_week' | 'agenda';
|
|
5
5
|
export interface KeyboardNavigationConfig {
|
|
6
6
|
onNavigate: (action: 'PREV' | 'NEXT' | 'TODAY' | 'DATE', date?: Date) => void;
|
|
7
7
|
onViewChange: (view: View) => void;
|
|
@@ -21,3 +21,4 @@ export declare const getKeyboardShortcutsHelp: () => string;
|
|
|
21
21
|
* Genera los atributos ARIA para el calendario
|
|
22
22
|
*/
|
|
23
23
|
export declare const getCalendarAriaAttributes: (currentView: View, currentDate: Date) => Record<string, string>;
|
|
24
|
+
export {};
|