import { DateService } from "@hmcts/opal-frontend-common/services/date-service"; import { IAbstractFormBaseFormErrorSummaryMessage } from "@hmcts/opal-frontend-common/components/abstract/interfaces"; import { AbstractReportSummaryListDateFilter } from "@hmcts/opal-frontend-common/components/abstract/abstract-report-summary-list-base/types"; import * as i0 from "@angular/core"; interface IAbstractReportSummaryListDateFieldIds { days: string; dateFrom: string; dateTo: string; } interface IAbstractReportSummaryListDateFormats { input: string; output: string; } interface IAbstractReportSummaryListDateValidationMessages { customDaysRequired: string; dateRangeRequired: string; invalidDate: string; futureDate: string; dateFromAfterDateTo: string; } interface IAbstractReportSummaryListFilterState { dateFilter: AbstractReportSummaryListDateFilter; days: string; dateFrom: string; dateTo: string; } interface IAbstractReportSummaryListQueryState { fromDate: string | null; toDate: string | null; } type AbstractReportSummaryListDateFilter$1 = 'last7Days' | 'customDays' | 'dateRange'; export declare abstract class AbstractReportSummaryListBaseComponent { protected readonly dateService: DateService; protected readonly fieldErrors: import("@angular/core").WritableSignal>; protected abstract readonly dateValidationMessages: IAbstractReportSummaryListDateValidationMessages; protected readonly dateFormats: IAbstractReportSummaryListDateFormats; readonly dateFilterLast7Days = "last7Days"; readonly dateFilterCustomDays = "customDays"; readonly dateFilterDateRange = "dateRange"; readonly dateFilter: import("@angular/core").WritableSignal; readonly errorSummaryMessages: import("@angular/core").Signal; /** * Builds the default report query for the last 7 days. * * @param dateService - The date service used to calculate and format the date range. * @param dateFormats - The input and output date formats used by the consuming application. * @returns A report query state with a last 7 days date range. */ static getDefaultReportQuery(dateService: DateService, dateFormats?: IAbstractReportSummaryListDateFormats): IAbstractReportSummaryListQueryState; /** * Builds a report query from the selected report filter state. * * @param filters - The selected report filter state. * @param dateService - The date service used to calculate and format date values. * @param dateFormats - The input and output date formats used by the consuming application. * @returns A report query state suitable for report instance API requests. */ static getReportQueryFromFilters(filters: IAbstractReportSummaryListFilterState, dateService: DateService, dateFormats?: IAbstractReportSummaryListDateFormats): IAbstractReportSummaryListQueryState; /** * Gets the display status for a report instance. * * @param status - The report instance status code. * @param records - The number of records in the report instance, where available. * @param displayName - The API-provided status display name, where available. * @returns The display status for the report instance. */ static getReportInstanceDisplayStatus(status: string, records?: number | null, displayName?: string | null): string; /** * Converts a report status code into title case display text. * * @param status - The report status code to convert. * @returns A display-friendly status value. */ static toReportDisplayStatus(status: string): string; /** * Builds the default report query for the current component instance. * * @returns A report query state with a last 7 days date range. */ protected getDefaultReportQuery(): IAbstractReportSummaryListQueryState; /** * Builds a report query from the selected report filter state for the current component instance. * * @param filters - The selected report filter state. * @returns A report query state suitable for report instance API requests. */ protected getReportQueryFromFilters(filters: IAbstractReportSummaryListFilterState): IAbstractReportSummaryListQueryState; /** * Reads the consuming application's report filter form into a normalized filter state object. * * @param filtersForm - The consuming application's report filter form to read from. * @returns A normalized report filter state. */ protected abstract getFiltersFromForm(filtersForm: TFilterForm): IAbstractReportSummaryListFilterState; /** * Clears consuming application form fields that do not apply to the selected date filter. * * @param filtersForm - The consuming application's report filter form to update. * @param dateFilter - The selected date filter. */ protected abstract clearInactiveDateFilterFields(filtersForm: TFilterForm, dateFilter: AbstractReportSummaryListDateFilter$1 | null): void; /** * Builds validation messages for the active report date filter fields. * * @param filters - The selected report filter state. * @param fieldIds - The field ids used by the consuming application template. * @returns A field error map keyed by field id. */ protected buildReportDateFieldErrors(filters: IAbstractReportSummaryListFilterState, fieldIds: IAbstractReportSummaryListDateFieldIds): Record; /** * Builds validation messages for the custom days report date filter. * * @param filters - The selected report filter state. * @param fieldIds - The field ids used by the consuming application template. * @returns A field error map keyed by field id. */ protected buildCustomDaysFieldErrors(filters: IAbstractReportSummaryListFilterState, fieldIds: IAbstractReportSummaryListDateFieldIds): Record; /** * Builds validation messages for the date range report date filter. * * @param filters - The selected report filter state. * @param fieldIds - The field ids used by the consuming application template. * @returns A field error map keyed by field id. */ protected buildDateRangeFieldErrors(filters: IAbstractReportSummaryListFilterState, fieldIds: IAbstractReportSummaryListDateFieldIds): Record; /** * Adds a validation message when no date range boundary has been entered. * * @param errors - The field error map to update. * @param filters - The selected report filter state. * @param fieldIds - The field ids used by the consuming application template. */ protected addRequiredDateRangeError(errors: Record, filters: IAbstractReportSummaryListFilterState, fieldIds: IAbstractReportSummaryListDateFieldIds): void; /** * Adds validation messages for date values with an invalid format. * * @param errors - The field error map to update. * @param filters - The selected report filter state. * @param fieldIds - The field ids used by the consuming application template. */ protected addDateFormatErrors(errors: Record, filters: IAbstractReportSummaryListFilterState, fieldIds: IAbstractReportSummaryListDateFieldIds): void; /** * Adds validation messages for date values in the future. * * @param errors - The field error map to update. * @param filters - The selected report filter state. * @param fieldIds - The field ids used by the consuming application template. */ protected addFutureDateErrors(errors: Record, filters: IAbstractReportSummaryListFilterState, fieldIds: IAbstractReportSummaryListDateFieldIds): void; /** * Adds a validation message when date from is after date to. * * @param errors - The field error map to update. * @param filters - The selected report filter state. * @param fieldIds - The field ids used by the consuming application template. */ protected addDateOrderError(errors: Record, filters: IAbstractReportSummaryListFilterState, fieldIds: IAbstractReportSummaryListDateFieldIds): void; /** * Checks whether a report date string is invalid. * * @param value - The date value to validate. * @returns True when the date value is invalid, otherwise false. */ protected isReportDateInvalid(value: string): boolean; /** * Checks whether a report date string is in the future. * * @param value - The date value to validate. * @returns True when the date value is valid and in the future, otherwise false. */ protected isReportDateInFuture(value: string): boolean; /** * Checks whether the report date from value is after the report date to value. * * @param dateFrom - The start date value. * @param dateTo - The end date value. * @returns True when both dates are valid and date from is after date to, otherwise false. */ protected isReportDateFromAfterDateTo(dateFrom: string, dateTo: string): boolean; /** * Returns the current validation message for a field. * * @param fieldId - The field id to get an error for. * @returns The field error message, or null when there is no error. */ getFieldError(fieldId: string): string | null; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵcmp: i0.ɵɵComponentDeclaration, "ng-component", never, {}, {}, never, never, true, never>; }