import ImportRecord from './ImportRecord'; import { ImportConfig } from './MainElement'; import Validator from './Validator'; import { MetricsTracker } from './MetricsTracker'; import Transformer from './Transformer'; import Provider from './Provider'; export declare class ReviewDoneEvent extends Event { readonly records: ImportRecord[]; constructor(records: ImportRecord[]); } export default class ReviewElement extends HTMLElement { private readonly validator; private readonly transformer; private readonly provider; private readonly config; private readonly headers; private records; private readonly rowHeight; private readonly viewportItems; private readonly metricsTracker?; private tooltipManager; private dropdownManager; private typeAheadManager; private keyNavigationManager; private reviewProcessor?; private withContext; private aiTransformer?; private readonly validators; private readonly transformers; private readonly providers; private filteredRecords; private selection; private scrollTicking; private vscrollContainer; private focusedCell; private runDebounced; private resizeHandler; constructor(validator: Validator, transformer: Transformer, provider: Provider, config: ImportConfig, headers: string[], records: (ImportRecord)[], rowHeight?: number, viewportItems?: number, metricsTracker?: MetricsTracker | undefined); connectedCallback(): void; disconnectedCallback(): void; /** * We stored and retrieve the record ID from the row. * We don't use data attributes because they are slower than the ID * * @param row the row to extract the record inbdex from * @returns */ getIndexFromRow(row: HTMLElement): number; /** * Set the focus on the cell at the given row and column index * @param rowIndex The index of the row to focus * @param columnIndex The index of the cell to focus */ setFocus(rowIndex: number, columnIndex: number, config?: { scrollToCell?: boolean; }): void; /** * Refocus the cell that was previously focused */ refocus(config?: { scrollToCell: boolean; }): void; /** * Adds a new empty record and scrolls to it */ private addNewRecord; /** * Check if adding new records is allowed (no search or filtering applied) */ private isAddRecordAllowed; /** * Enable or disable the Add Record button based on current state */ private updateAddRecordButton; private render; private renderRecord; private registerEvents; private refreshSelection; private refreshRecord; private refreshStats; private enableOrDisableButton; /** * Goes through the records and filters them based on the currently selected filters * It also removes all the empty records */ private filterRecords; private getNonEmptyRecords; /** * Updates the count of the find and replace matches */ private updateFindReplaceCount; /** * Updates the top-left cell dimensions to match the first header cell */ private updateTopLeftCell; /** * Sets up the column resizing based for the table in vscroll-container * For each columns a resize handle is added to the header * When the handle is dragged, the column width is updated * The width is stored in memory so that it can be reused when the table is re-rendered */ private setupColumnResizing; /** * Register AI transformation event handlers */ private registerAiTransformEvents; /** * Open the AI transform modal for a specific field */ private openAiTransformModal; /** * Close the AI transform modal */ private closeAiTransformModal; /** * Preview AI transformation */ private previewAiTransformation; /** * Apply AI transformation to all records */ private applyAiTransformation; /** * Reprocess records to update validation and what's displayed in the table * This is used when the user selects a different error filter or changes the search input * But also when multiple records are updated at once. */ reprocessRecords(refreshOnly?: boolean): Promise; refreshRecords(): Promise; }