import { EventEmitter, OnInit, OnChanges, SimpleChanges } from '@angular/core'; import { RealsoftSort } from './sort'; import * as i0 from "@angular/core"; /** * Directive for automatically sorting date columns in a table. * This directive extends the base RealsoftSort functionality * and automatically handles date sorting. * * Usage: * * *
Created Date
*/ export declare class RealsoftDateSort extends RealsoftSort implements OnInit, OnChanges { /** * The data array to be sorted. * When this changes or sort changes, the data will be automatically sorted. */ data: any[]; /** * Event emitted with the sorted data. * This fires whenever the sort changes or the input data changes. */ sortedData: EventEmitter; /** * Expected date format when parsing string dates. * Common formats: 'MM/DD/YYYY', 'DD/MM/YYYY', 'YYYY-MM-DD' * If not specified, uses JavaScript's Date constructor parsing. */ dateFormat?: string; /** * How to handle null/undefined/invalid date values. * 'first' - null values appear first * 'last' - null values appear last */ nullHandling: 'first' | 'last'; /** * Whether to parse ISO string dates automatically. * Useful when dates are stored as ISO strings. */ parseISOStrings: boolean; /** * Custom date parser function. * Allows for custom date parsing logic. */ customParser?: (value: any) => Date | null; /** * Whether to sort immediately when data is provided. * If false, data will only be sorted when user clicks a column header. */ sortOnInit: boolean; ngOnInit(): void; ngOnChanges(changes?: SimpleChanges): void; /** * Performs the actual sorting and emits the result */ private performSort; /** * Compares two date values based on sort direction */ private compareDate; /** * Parses a value into a Date object */ private parseDate; /** * Checks if a string is in ISO date format */ private isISODateString; /** * Parses a date string according to a specific format */ private parseFormattedDate; /** * Helper to get nested object properties using dot notation */ private getNestedProperty; /** * Public method to trigger a re-sort with current settings */ resort(): void; /** * Public method to clear sorting and return original data */ clearSort(): void; /** * Utility method to filter data by date range */ filterByDateRange(startDate: Date | string | number, endDate: Date | string | number): any[]; /** * Utility method to group data by date period */ groupByPeriod(period: 'day' | 'week' | 'month' | 'year'): Map; /** * Gets a string key for grouping by period */ private getDatePeriodKey; /** * Gets the week number for a date */ private getWeekNumber; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; }