import { ColumnMode } from '@swimlane/ngx-datatable'; import { CardColumnConfig, TableColumnAction, TableColumnConfig } from './table-column'; import { NdfTableOptions } from './table-options'; import { TableDefaultSortModel, TablePaginationOptions, TableSortOptions } from './types'; /** * Configuration type for the NDF Table component. * Extends `TablePaginationOptions` and provides additional properties * for customizing table behavior, appearance, and data handling. */ export type NdfTableConfig = TablePaginationOptions & { key?: string; /** Indicates if the data is provided directly instead of being fetched. */ isDataProvided?: boolean; /** Options for configuring the table. */ options?: NdfTableOptions; /** Enables horizontal scrollbar if set to true. */ scrollbarH?: boolean; /** Available Column Modes for the table */ columnMode?: ColumnMode | keyof typeof ColumnMode; /** Evaluated string */ rowClass?: string; /** The page provider identifier for fetching data. */ pageProvider: string; /** A mapping of field names to their corresponding values. */ fields: Record; /** Custom URL configuration for fetching data. */ customUrl?: { url: string; method: 'POST' | 'GET'; payload?: Record; }; requestActions?: { /** Action to be executed before submitting the request. */ beforeSubmit?: string; }; /** Quick filter identifier for the table. */ quickFilters?: string; /** Configuration for table columns. */ columns: TableColumnConfig[]; cardColumns?: CardColumnConfig[]; /** Specifies the full width of the table. */ fullWidth?: string; /** Prefix for table-related identifiers. */ prefix?: string; /** Sorting options for the table. */ sortingBy?: TableSortOptions; /** Default sorting configuration for the table. */ defaultSort?: TableDefaultSortModel; /** Custom headers for table requests. */ headers?: Record; /** Query parameters for table requests. */ queryParam?: Record; /** Actions available for table columns. */ tableActions?: TableColumnAction[]; /** Highlights the selected card if set to true. */ highlightSelectedCard?: boolean; /** Determines when to skip aggregation: 'never' or 'onPageChange'. */ skipAggregation?: 'never' | 'onPageChange'; /** Range configuration for the table. */ range?: any; /** Indicates if the table is used on a search page. */ isSearchPage?: any; /** Enables multi-select rows if set to true. */ multiSelectRows?: boolean; /** Enables single-select row if set to true. */ singleSelectRow?: boolean; /** Permission to show/hide row checkbox */ rowCheckboxPermission?: string; /** Adds a custom first row to the table if set to true. */ customFirstRow?: boolean; /** Displays actions as a menu if set to true. */ showActionsAsMenu?: boolean; /** Additional filter parameters for the table. */ filterParams?: Record; /** Format configuration for the table. */ format?: string; /** Available page sizes for the table. */ pageSizes?: { label: string; size: number; }[]; resfreshDataInBackground?: { enable: boolean; time: number; }; /** storage key that identifies this specific table when saving/loading column preferences from local storage. */ preferredColumnsStorageKey?: string; /** Track Row By Prop */ trackByProp?: string; };