Skip to content

Audit History Panel

export function createAuditHistoryPanelDock(
panel: HTMLElement,
grid: HTMLRevoGridElement,
placement: AuditHistoryPanelPlacement,
);

Renders the Audit History panel into el for the given RevoGrid element.

The grid must have AuditHistoryPlugin installed.

export function defineAuditHistoryPanel(el: HTMLElement, grid: HTMLRevoGridElement, options: AuditHistoryPanelOptions =;

export type AuditHistoryPanelDateFormatContext = {
mode: 'time' | 'day' | 'filter';
record?: AuditRecord;
};

export type AuditHistoryPanelEvents = {
beforeRecordSelect?: (context: AuditHistoryPanelRecordContext) => boolean | void;
beforeCompareOpen?: (context: AuditHistoryPanelRecordContext) => boolean | void;
beforeJumpToCell?: (context: AuditHistoryPanelJumpContext) => boolean | void;
beforeRestore?: (context: AuditHistoryPanelRestoreContext) => boolean | void;
beforeExport?: (context: AuditHistoryPanelExportContext) => boolean | void;
};

export type AuditHistoryPanelExportContext = {
format: AuditHistoryExportFormat;
};

export type AuditHistoryPanelJumpContext = {
record: AuditRecord;
change: AuditChange;
};

export type AuditHistoryPanelLabels = {
title: string;
liveStatus: string;
recordsSummary: (count: number) => string;
changesSummary: (count: number) => string;
allTab: string;
rowTab: string;
cellTab: string;
tableTab: string;
selectedCell: (rowId: string, column: ColumnProp) => string;
selectedRow: (rowId: string) => string;
export: string;
exportCsv: string;
exportJson: string;
exportCsvTitle: string;
exportJsonTitle: string;
close: string;
openPanel: string;
searchPlaceholder: string;
searchAriaLabel: string;
searchShortcut: string;
userPlaceholder: string;
userAriaLabel: string;
columnAriaLabel: string;
actionAriaLabel: string;
dateFromAriaLabel: string;
dateToAriaLabel: string;
allColumns: string;
allActions: string;
clearFilters: string;
addFilter: string;
removeFilter: (label: string) => string;
noRecords: string;
noComparableRecord: string;
scopedRecordCount: (visibleChanges: number, totalChanges: number) => string;
changedBy: (changedAt: string, user: string) => string;
rowTarget: (rowId: string | undefined, column: ColumnProp | undefined) => string;
cellValues: (oldValue: string, newValue: string) => string;
rowSnapshotAvailable: string;
rowRemoved: string;
restoreCell: string;
restoreRow: string;
restoreTransaction: string;
restoreSnapshot: string;
jumpToCell: string;
revertAll: string;
moreActions: string;
compare: string;
compareTitle: string;
compareBefore: string;
compareAfter: string;
closeCompare: string;
compareEmpty: string;
viewChanges: (count: number) => string;
previousPage: string;
nextPage: string;
pageStatus: (currentPage: number, pageCount: number) => string;
dayToday: string;
dayYesterday: string;
sourceLabels: Record<AuditHistorySource, string>;
actions: Partial<Record<AuditActionType, string>>;
actionVerbs: Partial<Record<AuditActionType, string>>;
};

AuditHistoryPanelLabelsOptions (Extended from index.tsx)

Section titled “AuditHistoryPanelLabelsOptions (Extended from index.tsx)”
export type AuditHistoryPanelLabelsOptions = Partial<Omit<AuditHistoryPanelLabels, 'actions' | 'actionVerbs' | 'sourceLabels'>> & {
actions?: Partial<Record<AuditActionType, string>>;
actionVerbs?: Partial<Record<AuditActionType, string>>;
sourceLabels?: Partial<Record<AuditHistorySource, string>>;
};

export type AuditHistoryPanelHandle = {
destroy: () => void;
setPlacement: (placement: AuditHistoryPanelPlacement) => void;
refresh: () => Promise<void>;
};

export type AuditHistoryPanelOptions = {
pageSize?: number;
allowExport?: boolean;
allowCompare?: boolean | ((context: AuditHistoryPanelRecordContext) => boolean);
allowClose?: boolean;
miniOnClose?: boolean;
restoreActions?: false | AuditRestoreType[] | ((context: AuditHistoryPanelRestoreContext) => boolean);
formatDate?: (value: string, context: AuditHistoryPanelDateFormatContext) => string;
events?: AuditHistoryPanelEvents;
placement?: AuditHistoryPanelPlacement;
tooltips?: false | Partial<Record<AuditHistoryPanelTooltipKey, string | false>>;
labels?: AuditHistoryPanelLabelsOptions;
};

export type AuditHistoryPanelRecordContext = {
record: AuditRecord;
changes: AuditChange[];
};

export type AuditHistoryPanelRestoreContext = {
type: AuditRestoreType;
record?: AuditRecord;
change?: AuditChange;
transactionId?: string;
};

export type AuditHistoryPanelPlacement = 'right' | 'left' | 'top' | 'bottom' | 'none';

export type AuditHistoryPanelTooltipKey =
| 'totalRecords'
| 'totalChanges'
| 'selectedScope'
| 'searchFilter'
| 'userFilter'
| 'columnFilter'
| 'actionFilter'
| 'dateFromFilter'
| 'dateToFilter'
| 'clearFilters';

export function resolveLabels(labels?: AuditHistoryPanelLabelsOptions): AuditHistoryPanelLabels;

export function getAuditActionLabel(labels: AuditHistoryPanelLabels, actionType: AuditActionType): string;

export function getAuditActionVerb(labels: AuditHistoryPanelLabels, actionType: AuditActionType): string;

actionTypes: AuditActionType[];

titleizeActionType: (value: string) => string;

export function createInitialFilters(): AuditPanelFilters;

export function stringifyValue(value: unknown): string;

export function formatTime(value: string, mode: 'compact' | 'day' = 'compact');

export function formatPanelDate(
value: string,
options: AuditHistoryPanelOptions,
context:;

export function getUserLabel(record: AuditRecord);

export function getAvatarLabel(record: AuditRecord);

export function matchesFilters(record: AuditRecord, filters: AuditPanelFilters);

export function getScopedChanges(record: AuditRecord, tab: AuditPanelTab, selected: SelectedAuditTarget): AuditChange[];

export function getRecordSource(type: AuditActionType, record?: AuditRecord): AuditHistorySource;

export function getTargetLabel(record: AuditRecord, changes: AuditChange[], labels: AuditHistoryPanelLabels);

export function getDetailLabel(record: AuditRecord, changes: AuditChange[]);

export function isComparable(record: AuditRecord, changes: AuditChange[]);

export function toTimelineRecord(
record: AuditRecord,
changes: AuditChange[],
labels: AuditHistoryPanelLabels,
options: AuditHistoryPanelOptions =;

export function groupTimelineRecords(records: TimelineRecord[]): TimelineGroup[];

export async function getPlugin(grid: HTMLRevoGridElement): Promise<AuditHistoryPluginRuntime | undefined>;

panelRefreshEvents: readonly ["auditrecord", "auditrecordsloaded", "auditrestore"];

export function canSelectRecord(options: AuditHistoryPanelOptions, context: AuditHistoryPanelRecordContext);

export function canOpenCompare(options: AuditHistoryPanelOptions, context: AuditHistoryPanelRecordContext);

export function canJumpToCell(options: AuditHistoryPanelOptions, context: AuditHistoryPanelJumpContext);

export function canUseRestoreAction(options: AuditHistoryPanelOptions, context: AuditHistoryPanelRestoreContext);

export function canExportAuditHistory(options: AuditHistoryPanelOptions, format: AuditHistoryExportFormat);

export function AuditHistoryTooltip(;

export type AuditPanelTab = 'cell' | 'row' | 'table';

export type SelectedAuditTarget = {
rowId?: string;
column?: ColumnProp;
columnLabel?: ColumnProp;
rowIndex?: number;
rowType?: DimensionRows;
};

export type AuditPanelFilters = {
search: string;
user: string;
column: string;
actionType: '' | AuditActionType;
dateFrom: string;
dateTo: string;
};

export type AuditHistoryPluginRuntime = {
getRecords: () => AuditRecord[];
getCellHistory: (rowId: string, column: ColumnProp) => AuditRecord[];
getRowHistory: (rowId: string) => AuditRecord[];
getStats: () => AuditHistoryStats;
exportRecords: (options?: AuditHistoryExportOptions) => string;
getRowIdentity: (row: DataType | undefined, rowIndex: number, rowType: DimensionRows) => string | undefined;
canRestoreRecord: (context: { type: AuditRestoreType; record?: AuditRecord; change?: AuditChange; transactionId?: string }) => boolean;
restoreCell: (change: AuditChange) => boolean;
restoreRow: (record: AuditRecord) => boolean;
restoreTransaction: (transactionId: string) => boolean;
restoreSnapshot?: (recordOrId: AuditRecord | string) => boolean;
recordEvent?: (input: AuditRecordEventInput) => AuditRecord | undefined;
createSnapshot?: (label: string, options?: AuditSnapshotOptions) => AuditRecord | undefined;
};

export type VisibleAuditRecord = {
record: AuditRecord;
changes: AuditChange[];
};

export type TimelineRecord = VisibleAuditRecord & {
id: string;
source: AuditHistorySource;
verb: string;
userLabel: string;
avatarLabel: string;
avatarIndex?: number;
avatarColor?: string;
targetLabel: string;
detailLabel?: string;
rangeLabel?: string;
changedAtLabel: string;
dayKey: string;
dayLabel: string;
daySubLabel?: string;
accent: boolean;
comparable: boolean;
};

export type TimelineGroup = {
key: string;
label: string;
subLabel?: string;
records: TimelineRecord[];
};

export function AuditHistoryPanel(;

export function CompareDrawer(;

export function Filters(;

export function MiniAuditHistoryPanel(;

export function Pagination(;

export function RecordsList(;

export function Toolbar(;