analytica-frontend-lib
Version:
Repositório público dos componentes utilizados nas plataformas da Analytica Ensino
120 lines • 3.54 kB
TypeScript
import type { CategoryConfig } from '../CheckBoxGroup/index';
export type { CategoryConfig, Item } from '../CheckBoxGroup/index';
/**
* Activity subtype matching backend SIMULATION_SUBTYPE
*/
export declare enum ActivitySubtype {
TAREFA = "TAREFA",
TRABALHO = "TRABALHO",
PROVA = "PROVA"
}
/**
* Activity mode for presencial exams
*/
export declare enum ActivityMode {
ONLINE = "ONLINE",
PRESENCIAL = "PRESENCIAL"
}
/**
* Activity mode options for UI selection
*/
export declare const ACTIVITY_MODE_OPTIONS: ReadonlyArray<{
value: ActivityMode;
label: string;
}>;
/**
* Activity type options for UI selection
*/
export declare const ACTIVITY_TYPE_OPTIONS: ReadonlyArray<{
value: ActivitySubtype;
label: string;
}>;
/**
* Form data structure for sending activity
*/
export interface SendActivityFormData {
/** Activity subtype (Step 1) */
subtype: ActivitySubtype;
/** Activity mode for presencial exams (Step 1, required when subtype is PROVA and enableExamMode is true) */
mode?: ActivityMode;
/** Activity title (Step 1) */
title: string;
/** Notification message (Step 1) */
notification?: string;
/** Array of students to send activity to (Step 2) */
students: Array<{
studentId: string;
userInstitutionId: string;
}>;
/** Start date in YYYY-MM-DD format (Step 3) */
startDate: string;
/** Start time in HH:MM format (Step 3) */
startTime: string;
/** End date in YYYY-MM-DD format (Step 3) */
finalDate: string;
/** End time in HH:MM format (Step 3) */
finalTime: string;
/** Allow retry flag (Step 3) */
canRetry: boolean;
}
/**
* Initial data for pre-filling the modal form
*/
export interface SendActivityModalInitialData {
/** Pre-filled activity title */
title?: string;
/** Pre-filled activity subtype */
subtype?: ActivitySubtype;
/** Pre-filled notification message */
notification?: string;
}
/**
* Modal props
*/
export interface SendActivityModalProps {
/** Controls modal visibility */
isOpen: boolean;
/** Callback when modal is closed */
onClose: () => void;
/** Callback when activity is submitted */
onSubmit: (data: SendActivityFormData) => Promise<void>;
/** Recipient categories configuration (same format as CheckboxGroup) */
categories: CategoryConfig[];
/** Callback when categories change (optional - for controlled state) */
onCategoriesChange?: (categories: CategoryConfig[]) => void;
/** Loading state for submit button */
isLoading?: boolean;
/** Callback when submission fails (optional - if not provided, error propagates) */
onError?: (error: unknown) => void;
/** Initial data to pre-fill the form */
initialData?: SendActivityModalInitialData;
/** Enable "Modo de prova" field (Online/Presencial), required when subtype is PROVA */
enableExamMode?: boolean;
/** Force in-person exam mode: auto-selects PROVA subtype and PRESENCIAL mode */
isInPersonExam?: boolean;
}
/**
* Step validation errors
*/
export interface StepErrors {
subtype?: string;
mode?: string;
title?: string;
students?: string;
startDate?: string;
startTime?: string;
finalDate?: string;
finalTime?: string;
}
/**
* Step state for stepper
*/
export type StepState = 'pending' | 'current' | 'completed';
/**
* Step configuration
*/
export interface StepConfig {
label: string;
state: StepState;
}
//# sourceMappingURL=types.d.ts.map