forlogic-core 2.3.3 → 2.3.4
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/action-plans/index.d.ts +14 -103
- package/dist/action-plans/index.esm.js +1 -1
- package/dist/action-plans/index.js +1 -1
- package/dist/action-plans/types.d.ts +361 -551
- package/dist/audit-trail/index.d.ts +8 -103
- package/dist/audit-trail/types.d.ts +173 -567
- package/dist/auth/services/TokenService.d.ts +1 -0
- package/dist/auth/utils/authDebug.d.ts +18 -0
- package/dist/components/ui/combobox.d.ts +2 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/leadership/index.d.ts +12 -103
- package/dist/leadership/types.d.ts +13 -593
- package/dist/places/index.d.ts +8 -104
- package/dist/places/types.d.ts +6 -599
- package/dist/qualiex/hooks/useQualiexReady.d.ts +15 -0
- package/dist/qualiex/services/qualiexApiService.d.ts +18 -0
- package/dist/sign/index.d.ts +8 -104
- package/dist/sign/index.esm.js +1 -1
- package/dist/sign/index.js +1 -1
- package/dist/sign/types.d.ts +46 -596
- package/dist/updates/components/UpdatesBar.d.ts +10 -0
- package/dist/updates/components/UpdatesDialog.d.ts +10 -0
- package/dist/updates/components/UserUpdatesViewer.d.ts +5 -0
- package/dist/updates/hooks/useUserUpdates.d.ts +5 -0
- package/dist/updates/index.d.ts +9 -0
- package/dist/updates/services/userUpdatesApi.d.ts +3 -0
- package/dist/updates/types.d.ts +24 -0
- package/dist/updates/utils/dismissedStore.d.ts +4 -0
- package/package.json +2 -2
|
@@ -1,603 +1,413 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export type LoadingState = 'idle' | 'loading' | 'success' | 'error';
|
|
3
|
-
export type ViewMode = 'table';
|
|
4
|
-
export type SortDirection = 'asc' | 'desc';
|
|
5
|
-
export type ActionType = 'create' | 'update' | 'delete' | 'fetch' | 'export';
|
|
6
1
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* Reflete os campos obrigatórios de qualquer tabela multi-tenant: `id`, `alias` (tenant),
|
|
10
|
-
* timestamps e flags de soft delete (`is_removed`) e ativação (`is_actived`).
|
|
2
|
+
* Status do plano de ação
|
|
3
|
+
* Portado de EQexTaskPlanStatus / EFlcTaskPlanStatus
|
|
11
4
|
*
|
|
12
5
|
* @example
|
|
13
|
-
*
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
6
|
+
* const v = ETaskPlanStatus;
|
|
7
|
+
*/
|
|
8
|
+
export declare enum ETaskPlanStatus {
|
|
9
|
+
waitingStart = 1,
|
|
10
|
+
running = 2,
|
|
11
|
+
effectivenessCheck = 3,
|
|
12
|
+
done = 4,
|
|
13
|
+
suspended = 5,
|
|
14
|
+
canceled = 6
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Prioridade do plano de ação
|
|
18
|
+
* Portado de EQexTaskPlanPriorityType
|
|
20
19
|
*
|
|
21
20
|
* @example
|
|
22
|
-
*
|
|
23
|
-
* function useEntities<T extends BaseEntity>(table: string) {
|
|
24
|
-
* return useQuery<T[]>(['entities', table], () => fetchAll(table));
|
|
25
|
-
* }
|
|
21
|
+
* const v = ETaskPlanPriority;
|
|
26
22
|
*/
|
|
27
|
-
export
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
updated_at: string;
|
|
32
|
-
is_removed: boolean;
|
|
33
|
-
is_actived: boolean;
|
|
23
|
+
export declare enum ETaskPlanPriority {
|
|
24
|
+
low = 0,
|
|
25
|
+
medium = 1,
|
|
26
|
+
high = 2
|
|
34
27
|
}
|
|
35
28
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
29
|
+
* Tipo de associação do plano de ação
|
|
30
|
+
* Portado de EQexTaskPlanAssociationType
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* const v = ETaskPlanAssociationType;
|
|
38
34
|
*/
|
|
39
|
-
export
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
export interface PaginatedResponse<T = unknown> {
|
|
50
|
-
data: T[];
|
|
51
|
-
currentPage: number;
|
|
52
|
-
totalPages: number;
|
|
53
|
-
totalItems: number;
|
|
54
|
-
itemsPerPage: number;
|
|
55
|
-
hasNextPage: boolean;
|
|
56
|
-
hasPreviousPage: boolean;
|
|
57
|
-
}
|
|
58
|
-
export interface SortState {
|
|
59
|
-
field: string;
|
|
60
|
-
direction: SortDirection;
|
|
61
|
-
}
|
|
62
|
-
export interface CrudManager<T extends BaseEntity> {
|
|
63
|
-
entities: T[];
|
|
64
|
-
pagination: PaginatedResponse<T>;
|
|
65
|
-
isLoading: boolean;
|
|
66
|
-
isDeleting: boolean;
|
|
67
|
-
searchTerm: string;
|
|
68
|
-
sortField: string;
|
|
69
|
-
sortDirection: SortDirection;
|
|
70
|
-
currentPage: number;
|
|
71
|
-
itemsPerPage: number;
|
|
72
|
-
handleSearch: (search: string) => void;
|
|
73
|
-
handleSort: (field: string) => void;
|
|
74
|
-
handlePageChange: (page: number) => void;
|
|
75
|
-
handleItemsPerPageChange: (limit: number) => void;
|
|
76
|
-
clearFilters: () => void;
|
|
77
|
-
deleteEntity: (id: string) => void;
|
|
78
|
-
refetch: () => void;
|
|
79
|
-
selectedIds: string[];
|
|
80
|
-
selectItem: (id: string) => void;
|
|
81
|
-
selectAll: () => void;
|
|
82
|
-
clearSelection: () => void;
|
|
83
|
-
isAllSelected: boolean;
|
|
84
|
-
bulkDelete?: (ids: string[]) => Promise<void>;
|
|
85
|
-
isBulkDeleting?: boolean;
|
|
86
|
-
}
|
|
87
|
-
export interface CrudEntity extends BaseEntity {
|
|
35
|
+
export declare enum ETaskPlanAssociationType {
|
|
36
|
+
plan = 2,
|
|
37
|
+
occurrence = 3,
|
|
38
|
+
risk = 4,
|
|
39
|
+
decisions = 5,
|
|
40
|
+
audit = 6,
|
|
41
|
+
strategyExtension = 7,
|
|
42
|
+
standardization = 8,
|
|
43
|
+
supplier = 9,
|
|
44
|
+
auditItems = 10
|
|
88
45
|
}
|
|
89
46
|
/**
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
* Suporta tipagem semântica (`type`), ordenação (default `true`), filtros, busca textual,
|
|
93
|
-
* renderização customizada e larguras controladas.
|
|
47
|
+
* Tipo de progresso
|
|
48
|
+
* Portado de EQexTaskPlanTypeProgress
|
|
94
49
|
*
|
|
95
50
|
* @example
|
|
96
|
-
* const
|
|
97
|
-
* { key: 'title', header: 'Título', type: 'text', searchable: true, weight: 3 },
|
|
98
|
-
* {
|
|
99
|
-
* key: 'status',
|
|
100
|
-
* header: 'Status',
|
|
101
|
-
* type: 'select',
|
|
102
|
-
* options: [
|
|
103
|
-
* { label: 'Pendente', value: 'pending' },
|
|
104
|
-
* { label: 'Concluído', value: 'completed' },
|
|
105
|
-
* ],
|
|
106
|
-
* filterable: true,
|
|
107
|
-
* render: (row) => <StatusBadge status={row.status} />,
|
|
108
|
-
* },
|
|
109
|
-
* {
|
|
110
|
-
* key: 'created_at',
|
|
111
|
-
* header: 'Criado em',
|
|
112
|
-
* type: 'date',
|
|
113
|
-
* sortable: true,
|
|
114
|
-
* render: (row) => formatDatetime(row.created_at),
|
|
115
|
-
* },
|
|
116
|
-
* { key: 'id_user', header: 'Responsável', minWidth: 180 },
|
|
117
|
-
* ];
|
|
51
|
+
* const v = ETaskPlanTypeProgress;
|
|
118
52
|
*/
|
|
119
|
-
export
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
label?: string;
|
|
123
|
-
type?: 'text' | 'number' | 'date' | 'boolean' | 'select' | 'textarea' | 'email' | 'tel';
|
|
124
|
-
required?: boolean;
|
|
125
|
-
/** Coluna é ordenável. Default: true. Use `false` para desabilitar. */
|
|
126
|
-
sortable?: boolean;
|
|
127
|
-
filterable?: boolean;
|
|
128
|
-
searchable?: boolean;
|
|
129
|
-
options?: Array<{
|
|
130
|
-
label: string;
|
|
131
|
-
value: any;
|
|
132
|
-
}>;
|
|
133
|
-
render?: (item: T) => React.ReactNode;
|
|
134
|
-
validation?: (value: any) => string | undefined;
|
|
135
|
-
className?: string;
|
|
136
|
-
/** Minimum width in pixels (only applied in desktop view) */
|
|
137
|
-
minWidth?: number;
|
|
138
|
-
/** Maximum width in pixels for column resize */
|
|
139
|
-
maxWidth?: number;
|
|
140
|
-
/** Flex weight for distributing remaining space (only applied in desktop view) */
|
|
141
|
-
weight?: number;
|
|
142
|
-
/** Fixed width (overrides minWidth and weight) */
|
|
143
|
-
width?: number;
|
|
144
|
-
/** Whether the column can be resized (default: true when enableColumnResize is enabled) */
|
|
145
|
-
resizable?: boolean;
|
|
146
|
-
/** Whether the column can be hidden via column manager (default: true) */
|
|
147
|
-
hideable?: boolean;
|
|
148
|
-
/** Whether the column can be used for grouping (default: false) */
|
|
149
|
-
groupable?: boolean;
|
|
53
|
+
export declare enum ETaskPlanTypeProgress {
|
|
54
|
+
currentProgress = 1,
|
|
55
|
+
cumulativeProgress = 2
|
|
150
56
|
}
|
|
151
57
|
/**
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
* Permite adicionar filtros personalizados (busca, selects, checkboxes, etc)
|
|
155
|
-
* nas páginas CRUD geradas automaticamente.
|
|
156
|
-
*
|
|
157
|
-
* **Tipos de filtro:**
|
|
158
|
-
* - `'search'`: Campo de busca padrão (integrado com `manager.searchTerm`)
|
|
159
|
-
* - `'select'`: Select nativo com opções predefinidas
|
|
160
|
-
* - `'custom'`: Componente React customizado (Select, Checkbox, etc)
|
|
161
|
-
*
|
|
162
|
-
* **Posicionamento:**
|
|
163
|
-
* - Desktop: Filtros aparecem inline na Action Bar (ao lado do botão "Novo")
|
|
164
|
-
* - Mobile: Filtros empilhados verticalmente abaixo do botão "Novo"
|
|
58
|
+
* Relatório individual de progresso
|
|
165
59
|
*
|
|
166
60
|
* @example
|
|
167
|
-
*
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
* // Filtro customizado com Select
|
|
189
|
-
* import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from 'forlogic-core';
|
|
190
|
-
*
|
|
191
|
-
* const filters: CrudFilter[] = [
|
|
192
|
-
* {
|
|
193
|
-
* type: 'custom',
|
|
194
|
-
* component: ({ value, onChange }) => (
|
|
195
|
-
* <Select value={value} onValueChange={onChange}>
|
|
196
|
-
* <SelectTrigger className="w-[180px]">
|
|
197
|
-
* <SelectValue placeholder="Status" />
|
|
198
|
-
* </SelectTrigger>
|
|
199
|
-
* <SelectContent>
|
|
200
|
-
* <SelectItem value="all">Todos</SelectItem>
|
|
201
|
-
* <SelectItem value="active">Ativos</SelectItem>
|
|
202
|
-
* <SelectItem value="inactive">Inativos</SelectItem>
|
|
203
|
-
* </SelectContent>
|
|
204
|
-
* </Select>
|
|
205
|
-
* ),
|
|
206
|
-
* props: { value: statusFilter, onChange: setStatusFilter }
|
|
207
|
-
* }
|
|
208
|
-
* ];
|
|
209
|
-
* ```
|
|
61
|
+
* const value: ActionPlanReport = {} as ActionPlanReport;
|
|
62
|
+
*/
|
|
63
|
+
export interface ActionPlanReport {
|
|
64
|
+
id: string;
|
|
65
|
+
name?: string;
|
|
66
|
+
code?: string;
|
|
67
|
+
percentProgress: number;
|
|
68
|
+
timeProgress: string;
|
|
69
|
+
userId: string;
|
|
70
|
+
userPhotoUrl?: string;
|
|
71
|
+
userName: string;
|
|
72
|
+
userType?: number;
|
|
73
|
+
date: Date | string;
|
|
74
|
+
lastModified?: Date | string;
|
|
75
|
+
status?: ETaskPlanStatus;
|
|
76
|
+
typeProgress?: number;
|
|
77
|
+
comments?: string;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Dados de progresso do plano de ação
|
|
210
81
|
*
|
|
211
82
|
* @example
|
|
212
|
-
*
|
|
213
|
-
* // Múltiplos filtros customizados
|
|
214
|
-
* function ProcessesPage() {
|
|
215
|
-
* const [statusFilter, setStatusFilter] = useState('all');
|
|
216
|
-
* const [typeFilter, setTypeFilter] = useState('all');
|
|
217
|
-
*
|
|
218
|
-
* const filters: CrudFilter[] = [
|
|
219
|
-
* { type: 'search' },
|
|
220
|
-
* {
|
|
221
|
-
* type: 'select',
|
|
222
|
-
* placeholder: 'Status',
|
|
223
|
-
* options: [
|
|
224
|
-
* { label: 'Todos', value: 'all' },
|
|
225
|
-
* { label: 'Ativos', value: 'active' },
|
|
226
|
-
* { label: 'Inativos', value: 'inactive' }
|
|
227
|
-
* ],
|
|
228
|
-
* value: statusFilter,
|
|
229
|
-
* onChange: setStatusFilter
|
|
230
|
-
* },
|
|
231
|
-
* {
|
|
232
|
-
* type: 'custom',
|
|
233
|
-
* component: TypeSelect,
|
|
234
|
-
* props: { value: typeFilter, onChange: setTypeFilter }
|
|
235
|
-
* }
|
|
236
|
-
* ];
|
|
237
|
-
*
|
|
238
|
-
* // Filtrar dados baseado nos filtros customizados
|
|
239
|
-
* const filteredData = useMemo(() => {
|
|
240
|
-
* let data = manager.entities;
|
|
241
|
-
* if (statusFilter !== 'all') {
|
|
242
|
-
* data = data.filter(item => item.status === statusFilter);
|
|
243
|
-
* }
|
|
244
|
-
* if (typeFilter !== 'all') {
|
|
245
|
-
* data = data.filter(item => item.type === typeFilter);
|
|
246
|
-
* }
|
|
247
|
-
* return data;
|
|
248
|
-
* }, [manager.entities, statusFilter, typeFilter]);
|
|
249
|
-
*
|
|
250
|
-
* return <CrudPage manager={{ ...manager, entities: filteredData }} />;
|
|
251
|
-
* }
|
|
252
|
-
* ```
|
|
253
|
-
*
|
|
254
|
-
* @see {@link FilterBar} - Componente que renderiza os filtros
|
|
83
|
+
* const value: ActionPlanProgress = {} as ActionPlanProgress;
|
|
255
84
|
*/
|
|
256
|
-
export interface
|
|
257
|
-
/** Tipo do filtro: 'search' para busca padrão, 'select' para select nativo, 'custom' para componente personalizado */
|
|
258
|
-
type: 'search' | 'select' | 'custom';
|
|
259
|
-
/** Placeholder para select (quando type='select') */
|
|
260
|
-
placeholder?: string;
|
|
261
|
-
/** Opções para select (quando type='select') */
|
|
262
|
-
options?: Array<{
|
|
263
|
-
label: string;
|
|
264
|
-
value: string;
|
|
265
|
-
}>;
|
|
266
|
-
/** Valor atual do filtro (quando type='select') */
|
|
267
|
-
value?: string;
|
|
268
|
-
/** Callback quando o valor muda (quando type='select') */
|
|
269
|
-
onChange?: (value: string) => void;
|
|
270
|
-
/** Componente React customizado (obrigatório quando type='custom') */
|
|
271
|
-
component?: React.ComponentType<any>;
|
|
272
|
-
/** Props passadas para o componente customizado (value, onChange, etc) */
|
|
273
|
-
props?: Record<string, any>;
|
|
274
|
-
/** Função para controlar visibilidade do filtro baseado no estado do manager */
|
|
275
|
-
show?: (manager: CrudManager<any>) => boolean;
|
|
276
|
-
}
|
|
277
|
-
export interface BulkAction<T extends BaseEntity> {
|
|
278
|
-
label: string;
|
|
279
|
-
icon?: React.ComponentType<{
|
|
280
|
-
size?: number;
|
|
281
|
-
className?: string;
|
|
282
|
-
}>;
|
|
283
|
-
variant?: 'default' | 'destructive' | 'outline';
|
|
284
|
-
action: (items: T[]) => void | Promise<void>;
|
|
285
|
-
confirmMessage?: string;
|
|
286
|
-
/** Se a ação está desabilitada */
|
|
287
|
-
disabled?: boolean;
|
|
288
|
-
/** Motivo do bloqueio (exibido em tooltip quando disabled=true) */
|
|
289
|
-
disabledReason?: string;
|
|
290
|
-
}
|
|
291
|
-
export interface CrudPageConfig<T extends CrudEntity> {
|
|
292
|
-
entityName: string;
|
|
293
|
-
entityNamePlural: string;
|
|
294
|
-
filters?: CrudFilter[];
|
|
295
|
-
columns: CrudColumn<T>[];
|
|
296
|
-
cardFields?: Array<{
|
|
297
|
-
key: keyof T;
|
|
298
|
-
label: string;
|
|
299
|
-
render?: (value: any, item: T) => React.ReactNode;
|
|
300
|
-
}>;
|
|
301
|
-
onNew?: () => void;
|
|
302
|
-
onEdit?: (entity: T) => void;
|
|
303
|
-
useCustomRouting?: boolean;
|
|
304
|
-
/** @deprecated Use showNewButton={false} instead */
|
|
305
|
-
hideNewButton?: boolean;
|
|
306
|
-
/** Exibir botão "Novo" (default: true) */
|
|
307
|
-
showNewButton?: boolean;
|
|
308
|
-
/** Texto customizado para o botão "Novo" */
|
|
309
|
-
newButtonLabel?: string;
|
|
310
|
-
newButtonText?: string;
|
|
311
|
-
title?: string;
|
|
312
|
-
searchPlaceholder?: string;
|
|
313
|
-
/** Exibir busca integrada na Action Bar (default: false - usa busca global) */
|
|
314
|
-
showSearch?: boolean;
|
|
315
|
-
/** Exibir Action Bar (default: true) */
|
|
316
|
-
showActionBar?: boolean;
|
|
317
|
-
enableBulkActions?: boolean;
|
|
318
|
-
bulkActions?: BulkAction<T>[];
|
|
319
|
-
customActions?: Array<{
|
|
320
|
-
label: string;
|
|
321
|
-
icon?: React.ComponentType<{
|
|
322
|
-
size?: number;
|
|
323
|
-
className?: string;
|
|
324
|
-
}>;
|
|
325
|
-
variant?: 'default' | 'destructive' | 'outline' | 'ghost';
|
|
326
|
-
action: () => void;
|
|
327
|
-
/** Se a ação está desabilitada */
|
|
328
|
-
disabled?: boolean;
|
|
329
|
-
/** Motivo do bloqueio (exibido em tooltip quando disabled=true) */
|
|
330
|
-
disabledReason?: string;
|
|
331
|
-
}>;
|
|
332
|
-
customRowActions?: (item: T) => Array<{
|
|
333
|
-
icon: any;
|
|
334
|
-
label: string;
|
|
335
|
-
onClick: () => void;
|
|
336
|
-
}>;
|
|
337
|
-
customListView?: (items: T[], manager?: CrudManager<T>) => React.ReactNode;
|
|
338
|
-
/** Colunas ocultas por padrão (antes de qualquer interação do usuário). */
|
|
339
|
-
defaultHiddenColumns?: string[];
|
|
340
|
-
}
|
|
341
|
-
export interface EntityWithId {
|
|
342
|
-
id: string | number;
|
|
343
|
-
}
|
|
344
|
-
export type CreateEntityInput<T extends EntityWithId> = Omit<T, 'id' | 'created_at' | 'updated_at'>;
|
|
345
|
-
export type UpdateEntityInput<T extends EntityWithId> = Partial<CreateEntityInput<T>>;
|
|
346
|
-
export interface GeneratedCrudConfig<T extends EntityWithId> {
|
|
347
|
-
title: string;
|
|
348
|
-
columns: CrudColumn<T>[];
|
|
349
|
-
searchPlaceholder?: string;
|
|
350
|
-
itemsPerPage?: number;
|
|
351
|
-
enableCreate?: boolean;
|
|
352
|
-
enableEdit?: boolean;
|
|
353
|
-
enableDelete?: boolean;
|
|
354
|
-
enableSearch?: boolean;
|
|
355
|
-
enableFilters?: boolean;
|
|
356
|
-
customActions?: Array<{
|
|
357
|
-
label: string;
|
|
358
|
-
icon?: React.ComponentType;
|
|
359
|
-
onClick: (item: T) => void;
|
|
360
|
-
variant?: 'default' | 'destructive' | 'outline';
|
|
361
|
-
}>;
|
|
362
|
-
}
|
|
363
|
-
export interface FormField {
|
|
364
|
-
name: string;
|
|
365
|
-
label: string;
|
|
366
|
-
type: 'text' | 'textarea' | 'select' | 'multiselect' | 'date' | 'datetime-local' | 'number' | 'user-select' | 'group' | 'checkbox' | 'switch' | 'email' | 'password' | 'color' | 'color-picker' | 'icon-picker' | 'custom';
|
|
367
|
-
required?: boolean;
|
|
368
|
-
disabled?: boolean;
|
|
369
|
-
options?: {
|
|
370
|
-
label: string;
|
|
371
|
-
value: string | number;
|
|
372
|
-
}[];
|
|
373
|
-
placeholder?: string;
|
|
374
|
-
component?: React.ComponentType<any>;
|
|
375
|
-
componentProps?: Record<string, any>;
|
|
376
|
-
value?: any;
|
|
377
|
-
defaultValue?: any;
|
|
378
|
-
dependsOn?: string;
|
|
379
|
-
computedValue?: (formData: any) => any;
|
|
380
|
-
validation?: {
|
|
381
|
-
custom?: (value: any, formData?: any) => string | undefined;
|
|
382
|
-
} | ((value: any, formData?: any) => string | undefined);
|
|
383
|
-
layout?: 'horizontal' | 'vertical';
|
|
384
|
-
className?: string;
|
|
385
|
-
fields?: FormField[];
|
|
386
|
-
onValueChange?: (value: any) => void;
|
|
387
|
-
step?: number;
|
|
388
|
-
rows?: number;
|
|
389
|
-
mode?: 'single' | 'multiple';
|
|
390
|
-
columns?: number;
|
|
391
|
-
render?: (props: {
|
|
392
|
-
value: any;
|
|
393
|
-
onChange: (value: any) => void;
|
|
394
|
-
error?: string;
|
|
395
|
-
disabled?: boolean;
|
|
396
|
-
}) => React.ReactNode;
|
|
397
|
-
}
|
|
398
|
-
export interface FormSection {
|
|
85
|
+
export interface ActionPlanProgress {
|
|
399
86
|
id: string;
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
}
|
|
407
|
-
export interface BaseFormConfig<T> {
|
|
408
|
-
title: string;
|
|
409
|
-
sections: FormSection[];
|
|
410
|
-
initialData?: Partial<T>;
|
|
411
|
-
onSubmit: (data: T) => void;
|
|
412
|
-
onCancel: () => void;
|
|
413
|
-
submitButtonText?: string;
|
|
414
|
-
isMobile?: boolean;
|
|
87
|
+
percentProgress: number;
|
|
88
|
+
timeProgress: string;
|
|
89
|
+
hasChildren: boolean;
|
|
90
|
+
idResponsibleUser: string;
|
|
91
|
+
status: ETaskPlanStatus;
|
|
92
|
+
reports: ActionPlanReport[];
|
|
415
93
|
}
|
|
416
|
-
|
|
417
|
-
|
|
94
|
+
/**
|
|
95
|
+
* Plano de ação principal
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* const value: ActionPlan = {} as ActionPlan;
|
|
99
|
+
*/
|
|
100
|
+
export interface ActionPlan {
|
|
101
|
+
id: string;
|
|
102
|
+
code?: string;
|
|
103
|
+
name: string;
|
|
104
|
+
responsibleId?: string;
|
|
105
|
+
responsibleName?: string;
|
|
106
|
+
checkerId?: string;
|
|
107
|
+
checkerName?: string;
|
|
108
|
+
placeId?: string;
|
|
109
|
+
placeName?: string;
|
|
110
|
+
typeId?: string;
|
|
111
|
+
typeName?: string;
|
|
112
|
+
priorityType?: ETaskPlanPriority;
|
|
113
|
+
parentId?: string;
|
|
114
|
+
parentName?: string;
|
|
115
|
+
startDate?: Date | string | null;
|
|
116
|
+
endDate?: Date | string | null;
|
|
117
|
+
duration?: number;
|
|
118
|
+
estimatedCost?: number;
|
|
119
|
+
causeId?: string;
|
|
120
|
+
causeName?: string;
|
|
121
|
+
description?: string;
|
|
122
|
+
justification?: string;
|
|
123
|
+
statusId: ETaskPlanStatus;
|
|
124
|
+
percentProgress?: number;
|
|
125
|
+
progress?: ActionPlanProgress;
|
|
126
|
+
associationType?: ETaskPlanAssociationType;
|
|
127
|
+
associationId?: string;
|
|
128
|
+
actionSource?: string;
|
|
129
|
+
phaseId?: string;
|
|
130
|
+
createdAt?: Date | string;
|
|
131
|
+
updatedAt?: Date | string;
|
|
418
132
|
}
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
133
|
+
/**
|
|
134
|
+
* Configuração de campos obrigatórios/visíveis
|
|
135
|
+
* Portado de IQexRequiredFieldsPlanTask
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* const value: ActionPlanRequiredFields = {} as ActionPlanRequiredFields;
|
|
139
|
+
*/
|
|
140
|
+
export interface ActionPlanRequiredFields {
|
|
141
|
+
responsibleWho?: boolean;
|
|
142
|
+
checkerWho?: boolean;
|
|
143
|
+
place?: boolean;
|
|
144
|
+
planType?: boolean;
|
|
145
|
+
startDate?: boolean;
|
|
146
|
+
endDate?: boolean;
|
|
147
|
+
estimatedCost?: boolean;
|
|
148
|
+
description?: boolean;
|
|
149
|
+
justification?: boolean;
|
|
150
|
+
priority?: boolean;
|
|
151
|
+
responsibleWhoVisible?: boolean;
|
|
152
|
+
checkerWhoVisible?: boolean;
|
|
153
|
+
placeVisible?: boolean;
|
|
154
|
+
planTypeVisible?: boolean;
|
|
155
|
+
startDateVisible?: boolean;
|
|
156
|
+
endDateVisible?: boolean;
|
|
157
|
+
estimatedCostVisible?: boolean;
|
|
158
|
+
descriptionVisible?: boolean;
|
|
159
|
+
justificationVisible?: boolean;
|
|
160
|
+
priorityVisible?: boolean;
|
|
161
|
+
percentProgress?: boolean;
|
|
162
|
+
duration?: boolean;
|
|
163
|
+
descriptionProgress?: boolean;
|
|
164
|
+
value?: boolean;
|
|
165
|
+
descriptionCost?: boolean;
|
|
436
166
|
}
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
167
|
+
/**
|
|
168
|
+
* Permissões para planos de ação
|
|
169
|
+
* Portado de IQexPlansPermissions
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* const value: ActionPlanPermissions = {} as ActionPlanPermissions;
|
|
173
|
+
*/
|
|
174
|
+
export interface ActionPlanPermissions {
|
|
175
|
+
canCreateActionPlans: boolean;
|
|
176
|
+
canEditAllActionPlanOpen: boolean;
|
|
177
|
+
canEditActionPlanOpenOnlyMyPlace?: boolean;
|
|
178
|
+
canEditAllActionPlanClosed: boolean;
|
|
179
|
+
canEditActionPlanClosedOnlyMyPlace?: boolean;
|
|
180
|
+
canEditActionPlanOpenResponsibleChecker: boolean;
|
|
181
|
+
canEditActionPlanClosedResponsibleChecker: boolean;
|
|
182
|
+
canChangeStatusAllActionPlanOpen?: boolean;
|
|
183
|
+
canChangeStatusActionPlanOpenOnlyMyPlace?: boolean;
|
|
184
|
+
canChangeStatusAllActionPlanClosed?: boolean;
|
|
185
|
+
canChangeStatusActionPlanClosedOnlyMyPlace?: boolean;
|
|
186
|
+
canChangeStatusActionPlanOpenResponsibleChecker?: boolean;
|
|
187
|
+
canChangeStatusActionPlanClosedResponsibleChecker?: boolean;
|
|
188
|
+
canManageStatusAndReportAndCostAllActionPlanOpen?: boolean;
|
|
189
|
+
canManageStatusAndReportAndCostAllActionPlanClosed?: boolean;
|
|
190
|
+
canManageStatusAndReportAndCostPlanOpenResponsibleChecker?: boolean;
|
|
191
|
+
canManageStatusAndReportAndCostPlanClosedResponsibleChecker?: boolean;
|
|
192
|
+
canChangePhaseStatus?: boolean;
|
|
193
|
+
canRemove: boolean;
|
|
194
|
+
canRemoveOnlyMyPlace?: boolean;
|
|
195
|
+
isOnlyIssuer: boolean;
|
|
196
|
+
isTeam?: boolean;
|
|
443
197
|
}
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
198
|
+
/**
|
|
199
|
+
* Configuração do formulário de plano de ação
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* const value: ActionPlanFormConfig = {} as ActionPlanFormConfig;
|
|
203
|
+
*/
|
|
204
|
+
export interface ActionPlanFormConfig {
|
|
205
|
+
isCheckerRequired?: boolean;
|
|
206
|
+
allowCheckerResponsibleEquals?: boolean;
|
|
207
|
+
requiredFields?: ActionPlanRequiredFields;
|
|
208
|
+
hiddenFields?: string[];
|
|
209
|
+
visibleFields?: string[];
|
|
210
|
+
disableFields?: boolean;
|
|
211
|
+
allowTaskPlan?: boolean;
|
|
212
|
+
mandatoryAttachment?: boolean;
|
|
213
|
+
hasComments?: boolean;
|
|
214
|
+
typeProgress?: ETaskPlanTypeProgress;
|
|
215
|
+
permissions?: ActionPlanPermissions;
|
|
216
|
+
/** Tabs extras (além de Geral e Progresso) habilitadas */
|
|
217
|
+
enablePredecessors?: boolean;
|
|
218
|
+
enableCosts?: boolean;
|
|
219
|
+
enableAttachments?: boolean;
|
|
220
|
+
enableComments?: boolean;
|
|
221
|
+
enableHistory?: boolean;
|
|
448
222
|
}
|
|
449
|
-
|
|
223
|
+
/**
|
|
224
|
+
* Item de custo do plano de ação
|
|
225
|
+
*
|
|
226
|
+
* @example
|
|
227
|
+
* const value: ActionPlanCost = {} as ActionPlanCost;
|
|
228
|
+
*/
|
|
229
|
+
export interface ActionPlanCost {
|
|
450
230
|
id: string;
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
231
|
+
description: string;
|
|
232
|
+
value: number;
|
|
233
|
+
date?: Date | string;
|
|
234
|
+
userId?: string;
|
|
235
|
+
userName?: string;
|
|
456
236
|
}
|
|
457
|
-
|
|
237
|
+
/**
|
|
238
|
+
* Item predecessor
|
|
239
|
+
*
|
|
240
|
+
* @example
|
|
241
|
+
* const value: ActionPlanPredecessor = {} as ActionPlanPredecessor;
|
|
242
|
+
*/
|
|
243
|
+
export interface ActionPlanPredecessor {
|
|
458
244
|
id: string;
|
|
459
|
-
|
|
460
|
-
|
|
245
|
+
actionPlanId: string;
|
|
246
|
+
predecessorId: string;
|
|
247
|
+
predecessorName: string;
|
|
248
|
+
predecessorCode?: string;
|
|
249
|
+
predecessorStatus?: ETaskPlanStatus;
|
|
250
|
+
predecessorPercentProgress?: number;
|
|
461
251
|
}
|
|
462
|
-
|
|
252
|
+
/**
|
|
253
|
+
* Opção genérica para selects (tipo, causa, etc.)
|
|
254
|
+
*
|
|
255
|
+
* @example
|
|
256
|
+
* const value: ActionPlanOption = {} as ActionPlanOption;
|
|
257
|
+
*/
|
|
258
|
+
export interface ActionPlanOption {
|
|
463
259
|
id: string;
|
|
464
|
-
|
|
465
|
-
alias: string;
|
|
260
|
+
label: string;
|
|
466
261
|
}
|
|
467
|
-
|
|
262
|
+
/**
|
|
263
|
+
* Opção de usuário para combobox
|
|
264
|
+
*
|
|
265
|
+
* @example
|
|
266
|
+
* const value: ActionPlanUser = {} as ActionPlanUser;
|
|
267
|
+
*/
|
|
268
|
+
export interface ActionPlanUser {
|
|
468
269
|
id: string;
|
|
469
|
-
alias: string;
|
|
470
270
|
name: string;
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
export interface AuthState {
|
|
474
|
-
isAuthenticated: boolean;
|
|
475
|
-
isLoading: boolean;
|
|
476
|
-
user: UserInfo | null;
|
|
477
|
-
alias: string | null;
|
|
478
|
-
companies: Company[];
|
|
479
|
-
selectedUnit: SelectedUnit | null;
|
|
480
|
-
userId: string | null;
|
|
481
|
-
userAlias: string | null;
|
|
482
|
-
placeId: string | null;
|
|
483
|
-
placeName: string | null;
|
|
484
|
-
activePlaceId?: string | null;
|
|
485
|
-
activePlaceName?: string | null;
|
|
271
|
+
photoUrl?: string;
|
|
272
|
+
email?: string;
|
|
486
273
|
}
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
274
|
+
/**
|
|
275
|
+
* Opção de local para combo tree
|
|
276
|
+
*
|
|
277
|
+
* @example
|
|
278
|
+
* const value: ActionPlanPlace = {} as ActionPlanPlace;
|
|
279
|
+
*/
|
|
280
|
+
export interface ActionPlanPlace {
|
|
281
|
+
id: string;
|
|
490
282
|
name: string;
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
[key: string]: any;
|
|
494
|
-
}
|
|
495
|
-
export interface AccessTokenPayload {
|
|
496
|
-
default?: string;
|
|
497
|
-
[key: string]: any;
|
|
283
|
+
parentId?: string | null;
|
|
284
|
+
children?: ActionPlanPlace[];
|
|
498
285
|
}
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
286
|
+
/**
|
|
287
|
+
* Comentário individual
|
|
288
|
+
* Portado de IFlcComment
|
|
289
|
+
*
|
|
290
|
+
* @example
|
|
291
|
+
* const value: ActionPlanComment = {} as ActionPlanComment;
|
|
292
|
+
*/
|
|
293
|
+
export interface ActionPlanComment {
|
|
294
|
+
id: string;
|
|
295
|
+
text: string;
|
|
296
|
+
stringText?: string;
|
|
297
|
+
userId: string;
|
|
298
|
+
userName: string;
|
|
503
299
|
userEmail?: string;
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
companyName?: string;
|
|
510
|
-
/** Indica se o usuário está ativo no Qualiex. Default `true` quando ausente. */
|
|
511
|
-
isActive?: boolean;
|
|
300
|
+
userPhotoUrl?: string;
|
|
301
|
+
userType?: number;
|
|
302
|
+
dateCreation: Date | string;
|
|
303
|
+
dateEdited?: Date | string | null;
|
|
304
|
+
isEditing?: boolean;
|
|
512
305
|
}
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
306
|
+
/**
|
|
307
|
+
* Item de histórico / audit trail
|
|
308
|
+
* Portado de IFlcTrail
|
|
309
|
+
*
|
|
310
|
+
* @example
|
|
311
|
+
* const value: ActionPlanHistoryItem = {} as ActionPlanHistoryItem;
|
|
312
|
+
*/
|
|
313
|
+
export interface ActionPlanHistoryItem {
|
|
314
|
+
id: string;
|
|
315
|
+
eventName: string;
|
|
316
|
+
eventDescription?: string;
|
|
317
|
+
translateEvent?: string;
|
|
318
|
+
icon?: string;
|
|
319
|
+
userName: string;
|
|
320
|
+
userEmail?: string;
|
|
321
|
+
userPhotoUrl?: string;
|
|
322
|
+
date: Date | string;
|
|
323
|
+
isMobileRequest?: boolean;
|
|
530
324
|
}
|
|
531
325
|
/**
|
|
532
|
-
*
|
|
533
|
-
*
|
|
326
|
+
* Status do item de anexo
|
|
327
|
+
*
|
|
328
|
+
* @example
|
|
329
|
+
* const v = EAttachmentItemStatus;
|
|
534
330
|
*/
|
|
535
|
-
export
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
nameEs: string;
|
|
331
|
+
export declare enum EAttachmentItemStatus {
|
|
332
|
+
uploading = "uploading",
|
|
333
|
+
waiting = "waiting",
|
|
334
|
+
done = "done",
|
|
335
|
+
error = "error",
|
|
336
|
+
canceled = "canceled",
|
|
337
|
+
duplicateItem = "duplicateItem"
|
|
543
338
|
}
|
|
544
339
|
/**
|
|
545
|
-
*
|
|
546
|
-
*
|
|
340
|
+
* Item de anexo
|
|
341
|
+
* Portado de IFlcAttachmentItem
|
|
547
342
|
*
|
|
548
|
-
*
|
|
549
|
-
*
|
|
343
|
+
* @example
|
|
344
|
+
* const value: ActionPlanAttachment = {} as ActionPlanAttachment;
|
|
550
345
|
*/
|
|
551
|
-
export interface
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
roleId: string;
|
|
561
|
-
roleName: string;
|
|
562
|
-
placeId?: string;
|
|
563
|
-
placeName?: string;
|
|
564
|
-
softwares: number[];
|
|
565
|
-
functionalities: string[];
|
|
566
|
-
isQualitfy?: boolean;
|
|
567
|
-
isMetroex?: boolean;
|
|
346
|
+
export interface ActionPlanAttachment {
|
|
347
|
+
id: string;
|
|
348
|
+
name: string;
|
|
349
|
+
extension: string;
|
|
350
|
+
size: number;
|
|
351
|
+
status: EAttachmentItemStatus;
|
|
352
|
+
progress?: number;
|
|
353
|
+
file?: File;
|
|
354
|
+
url?: string;
|
|
568
355
|
}
|
|
569
356
|
/**
|
|
570
|
-
*
|
|
357
|
+
* Props do componente ActionPlanPage
|
|
358
|
+
*
|
|
359
|
+
* @example
|
|
360
|
+
* const value: ActionPlanPageProps = {} as ActionPlanPageProps;
|
|
571
361
|
*/
|
|
572
|
-
export interface
|
|
573
|
-
/**
|
|
574
|
-
|
|
575
|
-
/** Se
|
|
576
|
-
|
|
577
|
-
/**
|
|
578
|
-
|
|
362
|
+
export interface ActionPlanPageProps {
|
|
363
|
+
/** Dados do plano de ação (null/undefined para novo) */
|
|
364
|
+
actionPlan?: ActionPlan | null;
|
|
365
|
+
/** Se é um novo plano */
|
|
366
|
+
isNew?: boolean;
|
|
367
|
+
/** Configuração do formulário */
|
|
368
|
+
config?: ActionPlanFormConfig;
|
|
369
|
+
/** Loading state */
|
|
370
|
+
isLoading?: boolean;
|
|
371
|
+
users?: ActionPlanUser[];
|
|
372
|
+
places?: ActionPlanPlace[];
|
|
373
|
+
actionTypes?: ActionPlanOption[];
|
|
374
|
+
causes?: ActionPlanOption[];
|
|
375
|
+
/** Lista de ações para "Pertence a" (parentId) */
|
|
376
|
+
parentActions?: ActionPlanOption[];
|
|
377
|
+
progress?: ActionPlanProgress;
|
|
378
|
+
predecessors?: ActionPlanPredecessor[];
|
|
379
|
+
availablePredecessors?: ActionPlanOption[];
|
|
380
|
+
costs?: ActionPlanCost[];
|
|
381
|
+
comments?: ActionPlanComment[];
|
|
382
|
+
history?: ActionPlanHistoryItem[];
|
|
383
|
+
attachments?: ActionPlanAttachment[];
|
|
384
|
+
attachmentsSlot?: React.ReactNode;
|
|
385
|
+
commentsSlot?: React.ReactNode;
|
|
386
|
+
historySlot?: React.ReactNode;
|
|
387
|
+
onSave?: (data: Partial<ActionPlan>) => Promise<any> | void;
|
|
388
|
+
onCancel?: () => void;
|
|
389
|
+
onDelete?: (id: string) => Promise<any> | void;
|
|
390
|
+
onChangeStatus?: (id: string, status: ETaskPlanStatus) => Promise<any> | void;
|
|
391
|
+
onReportProgress?: (data: {
|
|
579
392
|
id: string;
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
description?: string;
|
|
601
|
-
type: 'success' | 'error' | 'warning' | 'info';
|
|
602
|
-
duration?: number;
|
|
393
|
+
percentProgress: number;
|
|
394
|
+
timeProgress: string;
|
|
395
|
+
comments?: string;
|
|
396
|
+
conclude?: boolean;
|
|
397
|
+
}) => Promise<any> | void;
|
|
398
|
+
onEditProgress?: (report: ActionPlanReport) => Promise<any> | void;
|
|
399
|
+
onDeleteProgress?: (reportId: string) => Promise<any> | void;
|
|
400
|
+
onAddPredecessor?: (predecessorId: string) => Promise<any> | void;
|
|
401
|
+
onRemovePredecessor?: (predecessorId: string) => Promise<any> | void;
|
|
402
|
+
onAddCost?: (cost: Omit<ActionPlanCost, 'id'>) => Promise<any> | void;
|
|
403
|
+
onEditCost?: (cost: ActionPlanCost) => Promise<any> | void;
|
|
404
|
+
onDeleteCost?: (costId: string) => Promise<any> | void;
|
|
405
|
+
onAddComment?: (text: string) => Promise<any> | void;
|
|
406
|
+
onEditComment?: (comment: ActionPlanComment) => Promise<any> | void;
|
|
407
|
+
onDeleteComment?: (commentId: string) => Promise<any> | void;
|
|
408
|
+
onUploadAttachment?: (file: File) => Promise<any> | void;
|
|
409
|
+
onDeleteAttachment?: (attachmentId: string) => Promise<any> | void;
|
|
410
|
+
onRenameAttachment?: (attachmentId: string, newName: string) => Promise<any> | void;
|
|
411
|
+
onDownloadAttachment?: (attachmentId: string) => Promise<any> | void;
|
|
412
|
+
onViewAttachment?: (attachmentId: string) => Promise<any> | void;
|
|
603
413
|
}
|