/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2026 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import { Component, TdHTMLAttributes } from 'vue'; import { TABLE_COL_INDEX_ATTRIBUTE, HeaderThElementProps } from '@progress/kendo-vue-data-tools'; import { GridCellProps } from './GridCellProps'; import { GridFooterCellProps } from './GridFooterCellProps'; import { GridFilterCellProps } from './GridFilterCellProps'; import { GridHeaderCellProps } from './GridHeaderCellProps'; /** * Represents the attributes for Grid table cell elements, extending standard HTML td element properties. */ export interface GridTdAttributes extends TdHTMLAttributes { /** * The column index attribute used for grid operations. */ [TABLE_COL_INDEX_ATTRIBUTE]?: number; /** * The unique identifier of the column. */ columnId?: string; /** * The Vue key for the element. */ key?: string | number; } /** * Represents the attributes for Grid header cell elements, extending standard HTML th element properties. */ export interface GridThAttributes extends HeaderThElementProps { /** * The unique identifier of the column. */ columnId: string; /** * The Vue key for the element. */ key?: string | number; } /** * The properties of the default Grid Cell. */ export interface GridCustomCellProps extends GridCellProps { /** * The props and attributes that are applied to the td element by default. */ tdProps?: TdHTMLAttributes | null; /** * The props and attributes that are applied to the second td. Such element is * rendered in very rare cases when we have grouping and sticky columns. */ td2Props?: TdHTMLAttributes | null; } /** * The properties of the footer Grid Cell. */ export interface GridCustomFooterCellProps extends GridFooterCellProps { /** * The props and attributes that are applied to the td element by default. */ tdProps?: TdHTMLAttributes | null; /** * The index of the column that is rendered. */ index?: number; /** * The locked state of the column. */ locked?: boolean; } /** * The properties of the filter Grid Cell. */ export interface GridCustomFilterCellProps extends GridFilterCellProps { /** * The props and attributes that are applied to the th element by default. */ thProps?: GridThAttributes | null; /** * The props and attributes that are applied to the td element by default. */ tdProps?: GridTdAttributes | null; /** * The index of the column. */ index?: number; } /** * The properties of the header Grid Cell. */ export interface GridCustomHeaderCellProps extends GridHeaderCellProps { /** * The props and attributes that are applied to the `th` element by default. The property should be used with the [HeaderThElement](https://www.telerik.com/kendo-vue-ui/components/datatools/api/headerthelement) component as demonstrated in [this example](https://www.telerik.com/kendo-vue-ui/components/grid/cells#toc-group-header-group-footer-header-cell-footer-cell-filter-cell-and-data-cell). */ thProps?: GridThAttributes | null; /** * The index of the column. */ index?: number; } /** * The settings of the cells prop options. */ export interface GridCellsSettings { /** * Custom component for rendering the header cell. * * @example * ```vue * * ``` */ headerCell?: Component | string; /** * Custom component for rendering the filter cell. * * @example * ```vue * * ``` */ filterCell?: Component | string; /** * Custom component for rendering the footer cell. * * @example * ```vue * * ``` */ footerCell?: Component | string; /** * Custom component for rendering the group header cell. * * @example * ```vue * * ``` */ groupHeader?: Component | string; /** * Custom component for rendering the data cell in table layout mode. * * @example * ```vue * * ``` */ data?: Component | string; /** * Custom component for rendering the group footer cell. * * @example * ```vue * * ``` */ groupFooter?: Component | string; /** * Custom cell components for selection columns. * * @example * ```vue * * ``` */ select?: { /** * Custom component for rendering the group header cell in selection columns. * * @example * ```vue * * ``` */ groupHeader?: Component | string; /** * Custom component for rendering the data cell in selection columns. * * @example * ```vue * * ``` */ data?: Component | string; /** * Custom component for rendering the group footer cell in selection columns. * * @example * ```vue * * ``` */ groupFooter?: Component | string; }; /** * Custom cell components for hierarchy columns. * * @example * ```vue * * ``` */ hierarchy?: { /** * Custom component for rendering the group header cell in hierarchy columns. * * @example * ```vue * * ``` */ groupHeader?: Component | string; /** * Custom component for rendering the data cell in hierarchy columns. * * @example * ```vue * * ``` */ data?: Component | string; /** * Custom component for rendering the group footer cell in hierarchy columns. * * @example * ```vue * * ``` */ groupFooter?: Component | string; }; /** * Custom cell components for group columns. * * @example * ```vue * * ``` */ group?: { /** * Custom component for rendering the group header cell in group columns. * * @example * ```vue * * ``` */ groupHeader?: Component | string; /** * Custom component for rendering the data cell in group columns. * * @example * ```vue * * ``` */ data?: Component | string; /** * Custom component for rendering the group footer cell in group columns. * * @example * ```vue * * ``` */ groupFooter?: Component | string; }; /** * Custom cell components for pin columns. * * @example * ```tsx * import { MyPinDataCell } from './MyPinDataCell'; * * ``` */ pin?: { /** * Custom component for rendering the group header cell in pin columns. */ groupHeader?: Component | string; /** * Custom component for rendering the data cell in pin columns. */ data?: Component | string; /** * Custom component for rendering the group footer cell in pin columns. */ groupFooter?: Component | string; }; /** * Custom cell components for edit columns. * * @example * ```vue * * ``` */ edit?: { /** * Custom component for rendering the text edit cell. * * @example * ```vue * * ``` */ text?: Component | string; /** * Custom component for rendering the numeric edit cell. * * @example * ```vue * * ``` */ numeric?: Component | string; /** * Custom component for rendering the boolean edit cell. * * @example * ```vue * * ``` */ boolean?: Component | string; /** * Custom component for rendering the date edit cell. * * @example * ```vue * * ``` */ date?: Component | string; }; }