import { type IdsColorValue } from '../../utils/ids-color-utils/ids-color-utils'; import { WhiteSpaceTypes } from '../ids-text/ids-text'; import type IdsDataGrid from './ids-data-grid'; import { IdsDataGridEditor } from './ids-data-grid-editors'; export declare enum RowIndicatorTypes { Current = "current", New = "new", Modified = "modified", MarkedForDeletion = "marked-for-deletion", Error = "error", Drill = "drill" } export type RowIndicatorSettings = { activeCell?: boolean; rowIndicatorType?: RowIndicatorTypes | '' | null; }; export type IdsDataGridFormatterType = 'alert' | 'badge' | 'button' | 'card' | 'checkbox' | 'color' | 'date' | 'decimal' | 'dropdown' | 'expander' | 'favorite' | 'hyperlink' | 'icon' | 'image' | 'integer' | 'lookup' | 'password' | 'progress' | 'rating' | 'rowNumber' | 'rowReorder' | 'selectionCheckbox' | 'selectionRadio' | 'slider' | 'stepChart' | 'tag' | 'text' | 'textarea' | 'textmask' | 'time' | 'tree'; type IdsDateNumberOptions = Omit & Omit & { localeMatcher?: 'best fit' | 'lookup'; }; export interface IdsDataGridColumnFormatOptions extends IdsDateNumberOptions { style?: 'decimal' | 'currency' | 'percent' | 'unit' | any; locale?: string; /** Sets the group (thousands) separator (to something outside the current locale) */ group?: string; /** Sets Intl.NumberFormat option to use grouping */ useGrouping?: boolean; /** Sets the decimal separator (to something outside the current locale) */ decimal?: string; /** Date format to use for parsing ect */ dateFormat?: string; /** Date format to use for parsing ect (more generic) */ format?: string; /** legacy pattern for date formats */ pattern?: string; /** Tag for the picker that it shows time */ showTime?: boolean; } export interface IdsDataGridColumnGroup { id?: string; name?: string; colspan: number; /** Align the column text to either `left`, `center` or `right` */ align?: string; /** Name of the header icon to use for formatters that support it */ headerIcon?: string; /** Sets the header icon tooltip content */ headerIconTooltip?: string; } export interface IdsDataGridTooltipCallback { columnId?: string; columnData?: any; columnIndex?: number; columnGroupId?: string; columnGroupData?: any; columnGroupIndex?: number; fieldData?: any; grid?: any; isHeaderGroup?: boolean; rowData?: any; rowIndex?: number; text?: string; type?: string; } export interface IdsDataGridDatePickerOptions { /** Option to show today or not (for date type filters) */ showToday?: boolean; /** Option to show apply button or not (for date type filters) */ showApply?: boolean; /** Option to show cancel button or not (for date type filters) */ showCancel?: boolean; /** Option to show clear button or not (for date type filters) */ showClear?: boolean; /** First day of the week (for date type filters) */ firstDayOfWeek?: number; /** Whether or not to show week numbers in the picklist (for date type filters) */ showPicklistWeek?: boolean; /** Whether or not to show a list of months in the picklist (for date type filters) */ showPicklistMonth?: boolean; /** Whether or not to show a list of years in the picklist (for date type filters) */ showPicklistYear?: boolean; /** Show week numbers in front of each week of date picker (for date type filters) */ showWeekNumbers?: boolean; /** Set whether or not to show current time in the time picker dropdowns */ useCurrentTime?: boolean; /** Whether or not the component should be a range picker */ useRange?: boolean; } export interface IdsDataGridTooltipOptions { placement?: 'top' | 'right' | 'bottom' | 'left'; x?: number; y?: number; headerPlacement?: 'top' | 'right' | 'bottom' | 'left'; headerX?: number; headerY?: number; headerIconPlacement?: 'top' | 'right' | 'bottom' | 'left'; headerIconX?: number; headerIconY?: number; filterButtonPlacement?: 'top' | 'right' | 'bottom' | 'left'; filterButtonX?: number; filterButtonY?: number; } export interface IdsDataGridEditorValidation { check: (input: any) => boolean; message: string; /** Validation Message Translation key */ messageId?: string; id: string; } export interface IdsDataGridHeaderTextName { /** The header text for one line */ text: string; /** The font style to use */ emphasis?: 'normal' | 'subtle'; } export interface IdsDataGridRowIndicatorConfig { /** If true, shows an active row indicator icon at the end of the row number cell for the currently active row */ activeRowIndicator?: boolean; /** Name of the indicator to use for formatters that support it */ indicatorField?: string; /** Map of icon names to aria-label strings for row indicator icons */ iconLabel?: Record; } export interface IdsDataGridColumnAttributes { /** The attribute name to add to each cell (e.g., 'data-automation-id') */ name: string; /** The value for the attribute - can be a string or a function that receives row context */ value?: string | ((info: { rowIndex: number; rowData: Record; columnId: string; }) => string); /** Optional prefix to prepend to the value */ prefix?: string; /** Optional suffix to append to the value */ suffix?: string; } export interface IdsDataGridColumn { /** Align the column to either `left`, `center` or `right` */ align?: string; /** Custom attributes to add to each cell in this column */ attributes?: IdsDataGridColumnAttributes[]; /** Sets a custom css-part for styling cell when it's selected */ cellSelectedCssPart?: string | ((args: object) => string); /** Fires for clickable formatters (like button) */ click?: (rowData: Record, columnData: IdsDataGridColumn, event: MouseEvent) => void; /** Get the color dynamically from a function or as text */ color?: IdsColorValue | ((row: number, value: any, column: IdsDataGridColumn, index: Record) => string | undefined); /** Sets a custom css-part for styling the cell */ cssPart?: string | ((args: object) => string); /** Disable the column with a boolean or a dynamic function */ disabled?: boolean | ((row: number, value: any, col: IdsDataGridColumn, item: Record) => boolean); /** Setup an editor */ editor?: { type: 'input' | 'date' | 'time' | 'checkbox' | 'dropdown' | 'datepicker' | 'timepicker' | 'tree' | 'lookup' | 'password' | 'multiselect'; inline?: boolean; /** If true, the editor icon will always be visible */ showEditorIcons?: boolean; editor?: IdsDataGridEditor; editorSettings?: Record; editorValidation?: IdsDataGridEditorValidation; }; /** Column will not be styled as readonly when the readonly property is true */ excludeReadonlyStyling?: boolean; /** If set to false the column will not be exported in exportToExcel functionality */ exportable?: boolean; /** Function to transform values during export */ exportFormatter?: (value: unknown, rowData?: Record) => unknown; /** The columns field in the array to use */ field?: string; /** Separately align the filter row contents to either `left`, `center`, or `right` */ filterAlign?: string; /** Sets the header filter button tooltip content */ filterButtonTooltip?: string; /** Sets the header filter button tooltip css part */ filterButtonTooltipCssPart?: string; /** Column Filter options to show */ filterConditions?: any[]; /** Lets you make a dynamic filter function */ filterFunction?: any; /** Options to pass to the filter */ filterOptions?: { /** The columns unique id */ columnId?: string; /** Define a custom id for the inputs */ customId?: string | ((columnData: IdsDataGridColumn) => string); /** The label in the filter */ label?: string; /** The size of the input field */ size?: string; /** The filter type */ type?: string; /** Disable the filter */ disabled?: boolean; /** Make the filter readonly */ readonly?: boolean; /** Date formation to show (for date type filters) */ format?: string; /** Placeholder to show for empty inputs */ placeholder?: string; /** The interval between minutes (for time type filters) */ minuteInterval?: number; /** The interval between seconds (for time type filters) */ secondInterval?: number; /** Sets the auto select attribute (for time type filters) */ autoselect?: boolean; /** Sets the auto update attribute (for time type filters) */ autoupdate?: boolean; /** If the filter type is "contents" lets you set a blank string to a text value (matched by ID) */ notFilteredItem?: { value: string; label: string; }; /** For filter type input, sets the text to all upper case when typed */ uppercase?: boolean; /** For filter type input, sets the text max lenght when typed */ maxlength?: number; /** Adds the autocomplete attribute to the input element allowing for browser autocomplete */ browserAutocomplete?: string; /** Maximum number of options that can be selected (for multiselect type filters) */ maxOptions?: number; /** Enables typeahead/search functionality (for multiselect type filters) */ typeahead?: boolean; } & IdsDataGridDatePickerOptions; /** Column Filter to use */ filterType?: string | any; /** Options to pass to the formatter */ formatOptions?: IdsDataGridColumnFormatOptions; /** Column Formatter Function or formatter type */ formatter?: IdsDataGridFormatterType | ((rowData: Record, columnData: IdsDataGridColumn, index: number, parentDataGrid: IdsDataGrid) => string); /** Freeze the columns to either the `left` or `right` sides */ frozen?: string; /** Seperately align the header to either `left`, `center` or `right` */ headerAlign?: string; /** Name of the header icon */ headerIcon?: string; /** Sets the header icon tooltip content */ headerIconTooltip?: string; /** Sets the header icon tooltip css part */ headerIconTooltipCssPart?: string; /** Sets the header tooltip content */ headerTooltip?: string; /** Sets the header tooltip css part */ headerTooltipCssPart?: string; /** Allow column hide/show */ hideable?: boolean; /** Set a custom height for the row when this column has content */ height?: number; /** Hide a column to be shown later */ hidden?: boolean; /** Column hide during the runtime */ hiddenAtRuntime?: boolean; /** Enable Href / Link Columns */ href?: string | ((rowData: Record, columnData: IdsDataGridColumn) => string); /** Sets the hyperlink behavior. options: 'default' | 'no-select' | 'de-select' | 'none' */ hyperlinkBehavior?: string; /** Name of the icon too use for formatters that support it */ icon?: string | ((row: number, value: any, column: IdsDataGridColumn, index: Record) => string | undefined); /** The columns unique id */ id: string; /** Set the column to checked or unchecked (filtering) */ isChecked?: (value: boolean) => boolean; /** If column is selected */ isSelected?: boolean; /** Max value of a range */ max?: number; /** Set a max column width for resizing */ maxWidth?: number | string; /** Selector for menu id */ menuId?: string; /** Mininum value of a range */ min?: number; /** Set a min column width for resizing */ minWidth?: number | string; /** The columns name */ name?: string | Array; /** If true, applies the grid-level header opacity value to this column header */ headerOpacity?: boolean; /** If the column should be included in the personalize column list or not */ personalizable?: boolean; /** Make the column readonly with a boolean or a dynamic function */ readonly?: boolean | ((row: number, value: any, col: IdsDataGridColumn, item: Record) => boolean); /** Adds a drag indicator and allows the columns to be moved by dragging */ reorderable?: boolean; /** If true, shows a red asterisk (*) next to the column header text to indicate a required field */ required?: boolean; /** Field indicator type: 'neutral', 'info', 'success', 'caution', 'warning', 'error' */ fieldIndicator?: string | ((row: number, value: any, col: IdsDataGridColumn, item: Record) => string | null); /** Field indicator tooltip message */ fieldIndicatorMessage?: string | ((row: number, value: any, col: IdsDataGridColumn, item: Record) => string | null); /** Allow column resizing */ resizable?: boolean; /** True if the row is activated */ rowActivated?: boolean; /** If a tree or expandable row will set the state of the row */ rowExpanded?: boolean; /** * Settings for row indicator icons displayed in the row number column. * Maps indicator types to their icon and label configuration */ rowIndicatorConfig?: IdsDataGridRowIndicatorConfig; /** True if the row is selected */ rowSelected?: boolean; /** If true, enables automatic rowspan for consecutive repeating values in this column */ rowspan?: boolean; /** Fires for menuId formatters (like button) */ selected?: (rowData: Record, columnData: IdsDataGridColumn, event: CustomEvent) => void; /** Adds expand/collapse icon to a column */ showHeaderExpander?: boolean; /** Get the size dynamically from a function or as text */ size?: string | ((row: number, value: any, column: IdsDataGridColumn, index: Record) => string | undefined); /** Allow column sorting */ sortable?: boolean; /** Suppress the ids-color tooltip */ suppressColorTooltip?: boolean; /** The subsitute text to use (for hyperlink and some formatters) */ text?: string | ((row: number, value: any, column: IdsDataGridColumn, index: Record) => string | undefined); /** Sets the character count to reveal when cell value is masked */ textMaskCharacter?: number; /** Sets the tooltip content */ tooltip?: string | ((options: IdsDataGridTooltipCallback) => string | Promise); /** Sets the tooltip css part */ tooltipCssPart?: string | ((options: IdsDataGridTooltipCallback) => string); /** Sets the tooltip options */ tooltipOptions?: IdsDataGridTooltipOptions | ((options: IdsDataGridTooltipCallback) => IdsDataGridTooltipOptions); /** Pass the type option to formatters that support it */ type?: string; /** If a true will set the text to uppercase */ uppercase?: boolean | 'true' | ((type: 'body-cell' | 'header-cell', col: IdsDataGridColumn, index?: number, value?: any, item?: Record) => boolean); /** When width is 'max-content', controls text measurement: true uses raw values, false (default) uses formatted values */ useValueForSizing?: boolean; /** Set the whitespace css option on the cell */ whiteSpace?: WhiteSpaceTypes; /** Set a column width in pixel or percent */ width?: number | string; /** If true, converts multi-line text to a single line by replacing newlines with spaces */ singleLine?: boolean; } export declare const DEFAULT_COLUMN_MIN_WIDTH = 12; export {};