import { default as PrimeColumn, ColumnPassThroughOptions } from 'primevue/column'; export interface ColumnFilterMatchModeOptions { [key: string]: string; } export interface ColumnFilterModelType { /** Value of filterModel */ value: any; /** Match mode of filterModel */ matchMode: string; } export interface ColumnLoadingOptions { /** Cell index */ cellIndex: number; /** Whether the cell is first */ cellFirst: boolean; /** Whether the cell is last */ cellLast: boolean; /** Whether the cell is even */ cellEven: boolean; /** Whether the cell is odd */ cellOdd: boolean; /** Column instance */ column: any; /** Column field */ field: string; } export interface ColumnProps { /** * Identifier of a column if field property is not defined. */ columnKey?: string; /** * Property represented by the column. */ field?: string | ((data: any) => any); /** * Property name to use in sorting, defaults to field. */ sortField?: string | ((data: any) => any); /** * Property name to use in filtering, defaults to field. */ filterField?: string | ((data: any) => any); /** * Type of data. Its value is related to PrimeVue.filterMatchModeOptions config. */ dataType?: string; /** * Defines if a column is sortable. * @default false */ sortable?: boolean; /** * Header content of the column. */ header?: string; /** * Footer content of the column. */ footer?: string; /** * Inline style of header, body and footer cells. */ style?: any; /** * Style class of header, body and footer cells. */ class?: any; /** * Inline style of the column header. */ headerStyle?: any; /** * Style class of the column header. */ headerClass?: any; /** * Inline style of the column body. */ bodyStyle?: any; /** * Style class of the column body. */ bodyClass?: any; /** * Inline style of the column footer. */ footerStyle?: any; /** * Style class of the column footer. */ footerClass?: any; /** * Whether to display the filter overlay. * @default true */ showFilterMenu?: boolean; /** * When enabled, match all and match any operator selector is displayed. * @default true */ showFilterOperator?: boolean; /** * Displays a button to clear the column filtering. * @default false */ showClearButton?: boolean; /** * Displays a button to apply the column filtering. * @default true */ showApplyButton?: boolean; /** * Whether to show the match modes selector. * @default true */ showFilterMatchModes?: boolean; /** * When enabled, a button is displayed to add more rules. * @default true */ showAddButton?: boolean; /** * An array of label-value pairs to override the global match mode options. */ filterMatchModeOptions?: ColumnFilterMatchModeOptions[]; /** * Maximum number of constraints for a column filter. * @default 2 */ maxConstraints?: number; /** * Whether to exclude from global filtering or not. * @default false */ excludeGlobalFilter?: boolean; /** * Inline style of the column filter header in row filter display. */ filterHeaderStyle?: any; /** * Style class of the column filter header in row filter display. */ filterHeaderClass?: any; /** * Inline style of the column filter overlay. */ filterMenuStyle?: any; /** * Style class of the column filter overlay. */ filterMenuClass?: any; /** * Defines column based selection mode. */ selectionMode?: "single" | "multiple"; /** * Displays an icon to toggle row expansion. * @default false */ expander?: boolean; /** * Number of columns to span for grouping. */ colspan?: number; /** * Number of rows to span for grouping. */ rowspan?: number; /** * Whether this column displays an icon to reorder the rows. * @default false */ rowReorder?: boolean; /** * Icon of the drag handle to reorder rows. */ rowReorderIcon?: string; /** * Defines if the column itself can be reordered with dragging. * @default false */ reorderableColumn?: boolean; /** * When enabled, column displays row editor controls. * @default false */ rowEditor?: boolean; /** * Whether the column is fixed in horizontal scrolling. * @default false */ frozen?: boolean; /** * Position of a frozen column, valid values are left and right. * @default "left" */ alignFrozen?: "left" | "right"; /** * Whether the column is included in data export. * @default false */ exportable?: boolean; /** * Custom export header of the column to be exported as CSV. */ exportHeader?: string; /** * Custom export footer of the column to be exported as CSV. */ exportFooter?: string; /** * Defines the filtering algorithm to use when searching the options. */ filterMatchMode?: string; /** * Whether the column is rendered. * @default false */ hidden?: boolean; /** * It generates scoped CSS variables using design tokens for the component. */ dt?: any; /** * Used to pass attributes to DOM elements inside the component. */ pt?: ColumnPassThroughOptions; /** * Used to configure passthrough(pt) options of the component. */ ptOptions?: any; /** * When enabled, it removes component related styles in the core. * @default false */ unstyled?: boolean; } /** * Slots definition for Column component */ export interface ColumnSlots { /** * Custom body template for DataTable. * @arg {object} scope * @arg {any} scope.data - Row data * @arg {any} scope.node - Row node data * @arg {any} scope.column - Column node * @arg {string} scope.field - Column field * @arg {number} scope.index - Row index * @arg {boolean} scope.frozenRow - Whether the row is frozen * @arg {Function} scope.editorInitCallback - Editor init callback function * @arg {Function} scope.rowTogglerCallback - Row toggler callback function */ body?: (scope: { data: any; node: any; column: any; field: string; index: number; frozenRow: boolean; editorInitCallback: (event: Event) => void; rowTogglerCallback: (event: Event) => void; }) => any; /** * Custom body template for TreeTable. * @arg {object} scope * @arg {any} scope.data - Row data * @arg {any} scope.node - Row node data * @arg {any} scope.column - Column node * @arg {string} scope.field - Column field * @arg {number} scope.index - Row index * @arg {boolean} scope.frozenRow - Whether the row is frozen * @arg {Function} scope.editorInitCallback - Editor init callback function * @arg {Function} scope.rowTogglerCallback - Row toggler callback function */ node?: (scope: { data: any; node: any; column: any; field: string; index: number; frozenRow: boolean; editorInitCallback: (event: Event) => void; rowTogglerCallback: (event: Event) => void; }) => any; /** * Custom header template. * @arg {object} scope * @arg {any} scope.column - Column node */ header?: (scope: { column: any; }) => any; /** * Custom footer template. * @arg {object} scope * @arg {any} scope.column - Column node */ footer?: (scope: { column: any; }) => any; /** * Custom editor template. * @arg {object} scope * @arg {any} scope.data - Row data * @arg {any} scope.column - Column node * @arg {string} scope.field - Column field * @arg {number} scope.index - Row index * @arg {boolean} scope.frozenRow - Whether the row is frozen * @arg {Function} scope.editorSaveCallback - Callback to save edited value * @arg {Function} scope.editorCancelCallback - Callback to cancel editing */ editor?: (scope: { data: any; column: any; field: string; index: number; frozenRow: boolean; editorSaveCallback: (event: Event) => void; editorCancelCallback: (event: Event) => void; }) => any; /** * Custom filter template. * @arg {object} scope * @arg {string} scope.field - Column field * @arg {ColumnFilterModelType} scope.filterModel - Filter metadata * @arg {Function} scope.filterCallback - Callback function * @arg {Function} scope.applyFilter - Callback function (closes the overlay) */ filter?: (scope: { field: string; filterModel: ColumnFilterModelType; filterCallback: () => void; applyFilter: () => void; }) => any; /** * Custom filter header template. * @arg {object} scope * @arg {string} scope.field - Column field * @arg {ColumnFilterModelType} scope.filterModel - Filter metadata * @arg {Function} scope.filterCallback - Callback function */ filterheader?: (scope: { field: string; filterModel: ColumnFilterModelType; filterCallback: () => void; }) => any; /** * Custom filter footer template. * @arg {object} scope * @arg {string} scope.field - Column field * @arg {ColumnFilterModelType} scope.filterModel - Filter metadata * @arg {Function} scope.filterCallback - Callback function */ filterfooter?: (scope: { field: string; filterModel: ColumnFilterModelType; filterCallback: () => void; }) => any; /** * Custom filter clear template. * @arg {object} scope * @arg {string} scope.field - Column field * @arg {ColumnFilterModelType} scope.filterModel - Filter metadata * @arg {Function} scope.filterCallback - Callback function */ filterclear?: (scope: { field: string; filterModel: ColumnFilterModelType; filterCallback: () => void; }) => any; /** * Custom filter apply template. * @arg {object} scope * @arg {string} scope.field - Column field * @arg {ColumnFilterModelType} scope.filterModel - Filter metadata * @arg {Function} scope.filterCallback - Callback function */ filterapply?: (scope: { field: string; filterModel: ColumnFilterModelType; filterCallback: () => void; }) => any; /** * Custom loading template. * @arg {object} scope * @arg {any} scope.data - Row data * @arg {any} scope.column - Column node * @arg {string} scope.field - Column field * @arg {number} scope.index - Row index * @arg {boolean} scope.frozenRow - Whether the row is frozen * @arg {ColumnLoadingOptions} scope.loadingOptions - Loading options */ loading?: (scope: { data: any; column: any; field: string; index: number; frozenRow: boolean; loadingOptions: ColumnLoadingOptions; }) => any; /** * Custom row toggler icon template. * @arg {object} scope * @arg {string} scope.class - Style class of the row toggler icon * @arg {boolean} scope.rowExpanded - Current row expanded state */ rowtogglericon?: (scope: { class: string; rowExpanded: boolean; }) => any; /** * Custom row toggler icon template (alias). * @arg {object} scope * @arg {string} scope.class - Style class of the row toggler icon * @arg {boolean} scope.rowExpanded - Current row expanded state */ rowtoggleicon?: (scope: { class: string; rowExpanded: boolean; }) => any; /** * Custom row checkbox icon template. * @arg {object} scope * @arg {boolean} scope.checked - Current check state */ rowcheckboxicon?: (scope: { checked: boolean; }) => any; /** Custom row editor init icon template. */ roweditoriniticon?: () => any; /** Custom row editor save icon template. */ roweditorsaveicon?: () => any; /** Custom row editor cancel icon template. */ roweditorcancelicon?: () => any; /** Custom filter icon template. */ filtericon?: () => any; /** Custom filter clear icon template. */ filterclearicon?: () => any; /** Custom filter remove icon template. */ filterremoveicon?: () => any; /** Custom filter add icon template. */ filteraddicon?: () => any; /** * Custom sort icon template. * @arg {object} scope * @arg {string} scope.class - Style class of the sort icon * @arg {boolean} scope.sorted - Current sort state * @arg {number} scope.sortOrder - Current sort order state */ sorticon?: (scope: { class: string; sorted: boolean; sortOrder: number; }) => any; /** * Custom header checkbox icon template. * @arg {object} scope * @arg {boolean} scope.checked - Current check state */ headercheckboxicon?: (scope: { checked: boolean; }) => any; /** Custom row reorder icon template. */ rowreordericon?: () => any; /** Custom node toggler icon template. */ nodetogglericon?: () => any; /** Custom node toggler icon template (alias). */ nodetoggleicon?: () => any; } export default PrimeColumn;