import { EventEmitter } from "../../stencil-public-runtime"; import { IcDataTableDataType, IcDataTableColumnObject, IcDataTableDensityOptions, IcDataTableRowHeights, IcDataTableSortOrderOptions, IcDataTableTruncationTypes, IcDensityUpdateEventDetail, IcSortEventDetail } from "./ic-data-table.types"; import { IcPaginationBarOptions, IcThemeMode } from "../../utils/types"; import "../../../../web-components/src/components/ic-typography/ic-typography"; import "../../../../web-components/src/components/ic-loading-indicator/ic-loading-indicator"; import "../../../../web-components/src/components/ic-button/ic-button"; import "../../../../web-components/src/components/ic-link/ic-link"; import "../../../../web-components/src/components/ic-empty-state/ic-empty-state"; import "../../../../web-components/src/components/ic-checkbox/ic-checkbox"; import "../../../../web-components/src/components/ic-tooltip/ic-tooltip"; import "../../../../web-components/src/components/ic-pagination-bar/ic-pagination-bar"; import "../../../../web-components/src/components/ic-pagination/ic-pagination"; import "../../../../web-components/src/components/ic-pagination-item/ic-pagination-item"; import "../../../../web-components/src/components/ic-text-field/ic-text-field"; /** * @slot empty-state - Content is slotted below the table header when there is no data and the table is not loading. * @slot {COLUMN_KEY}-{ROW_INDEX}[-icon] - Each cell should have its own slot, named using the column tag and the row index, allowing for custom elements to be displayed. Include `-icon` at the end for that cell's icon slot. * @slot {COLUMN_KEY}-column-icon - The icon slot for a column header. * @slot title-bar - A custom ic-data-table-title-bar can be slotted above the column headers to display additional information about the table. * @slot pagination-bar - A custom ic-pagination-bar can be slotted below the data to provide enhanced control over how the data is interacted with when being fetched externally. */ export declare class DataTable { private DENSITY_HEIGHT_MULTIPLIER; private DENSITY_PADDING_HEIGHT_DIFF; private SORT_ICONS; private hasLoadedForOneSecond; private loadingIndicator?; private loadingOverlay?; private timerStarted; private resizeObserver; private SHOW_HIDE_STRING; private SHOW_HIDE_CSS_CLASS; private TOOLTIP_STRING; private TOOLTIP; private TEXT_WRAP_STRING; private TEXT_WRAP_CLASS; private dataUpdated; private columnsUpdated; private tableSorted; private rowHeightSet; private initialLoad; private icPageChangeEvent; private itemsPerPageChange; private DATA_ROW_HEIGHT_STRING; private ROW_HEIGHT_CSS_VARIABLE; private LINE_CLAMP_CSS_VARIABLE; private previousItemsPerPage; private DEFAULT_LINE_HEIGHT; private densityUpdate; private previousPaginationPage; private truncationPatternUpdated; private isNewDebounceDelaySet; private headerResizeObserver; private prevTableContainerWidth; private IC_TOOLTIP_STRING; private SHOW_TRUNC_TOOLTIP_STRING; private CELL_DESCRIPTION_STRING; private CELL_CONTAINER_WITH_DESCRIPTION_STRING; private CELL_TEXT_WRAPPER_STRING; private IC_TYPOGRAPHY_STRING; private organisedData?; private rowIdCounter; private createRowId; el: HTMLIcDataTableElement; fromRow: number; previousRowsPerPage: number; rowsPerPage: number; scrollable: boolean; scrollOffset: number; selectedRows: IcDataTableDataType[]; selectedIcRowIds: string[]; sortedColumn: string; sortedColumnOrder: IcDataTableSortOrderOptions; toRow: number; currentRowHeight: number; debounceDelay: number; /** * The title for the table only visible to screen readers. */ caption: string; /** * Determines whether the column header should be truncated and display a tooltip. Default is `false`. */ columnHeaderTruncation: boolean; headerTruncationChangeHandler(): void; /** * The column headers for the table. */ columns: IcDataTableColumnObject[]; columnsChangeHandler(): void; /** * The row content for the table. */ data?: IcDataTableDataType[]; /** * If `true`, the built in sort functionality will be disabled. For example, if rows will already be sorted from an external source. */ disableAutoSort?: boolean; /** * Set the density of the table including font and padding. */ density: IcDataTableDensityOptions; /** * Applies a border to the table container. */ embedded: boolean; /** * Sets the row height on all rows in the table that aren't set using the `variableRowHeight` method. */ globalRowHeight: IcDataTableRowHeights; /** * Sets the table height. Can be set to `auto` or a specific value in `px`, `rem`, or `%`. */ height?: string; /** * If `true`, column headers will not be visible. */ hideColumnHeaders?: boolean; /** * When set to `true`, the full table will show a loading state, featuring a radial indicator. */ loading: boolean; /** * Sets the props for the circular loading indicator used in the loading state. */ loadingOptions?: { description?: string; label?: string; labelDuration?: number; max?: number; min?: number; progress?: number; monochrome?: boolean; overlay?: boolean; }; /** * Sets the maximum width of the data table. Can be set in `px`, `rem`, or `%`. */ maxWidth?: string; /** * Sets the minimum width of the data table. Can be set in `px`, `rem`, or `%`. */ minWidth?: string; /** * The minimum amount of time the `loading` state displays for before showing the data. Used to prevent flashing in the component. */ minimumLoadingDisplayDuration: number; /** * Sets the props for the built-in pagination bar. If the `pagination-bar` slot is used then this prop is ignored. */ paginationBarOptions: IcPaginationBarOptions; /** * If `true`, a checkbox column will be displayed to the left of the table which allows multiple rows to be selected. */ rowSelection: boolean; /** * If `true`, adds a pagination bar to the bottom of the table. */ showPagination?: boolean; /** * If `true`, allows table columns to be sorted using applied sort buttons. */ sortable?: boolean; /** * Sets the order columns will be sorted in and allows for 'default' sorts to be added. */ sortOptions: { sortOrders: IcDataTableSortOrderOptions[]; defaultColumn?: string; }; /** * If `true`, column headers will remain at the top of the table when scrolling vertically. */ stickyColumnHeaders: boolean; /** * If `true`, row headers will remain to the left when scrolling horizontally. */ stickyRowHeaders: boolean; /** * Sets the layout of the table */ tableLayout?: "fixed" | "auto"; /** * Sets the theme color to the dark or light theme color. "inherit" will set the color based on the system settings or ic-theme component. */ theme?: IcThemeMode; /** * Sets the method used to truncate long text in cells where textWrap is `false`. The `tooltip` truncation pattern allows the overflowing text to be seen in a tooltip. The `show-hide` truncation pattern allows the overflowing text to be shown and hidden using the ic-typography "See more"/"See less" buttons. */ truncationPattern?: IcDataTableTruncationTypes; /** * If `true`, the table displays a linear loading indicator below the header row to indicate an updating state. */ updating: boolean; /** * Sets the props for the linear loading indicator used in the updating state. */ updatingOptions?: { description?: string; max?: number; min?: number; progress?: number; monochrome?: boolean; }; /** * Allows for custom setting of row heights on individual rows based on an individual value from the `data` prop and the row index. * If the function returns `null`, that row's height will be set to the `globalRowHeight` property. */ variableRowHeight?: (params: { [key: string]: any; index: number; }) => IcDataTableRowHeights | null; /** * Sets the table width. Can be set to `auto` or a specific value in `px`, `rem`, or `%`. */ width?: string; /** * Emitted when the `globalRowHeight` or `variableRowHeight` properties change in the data table. */ icRowHeightChange: EventEmitter; /** * Emitted when all rows are selected or deselected in the data table via the "select all" checkbox. */ icSelectAllRows: EventEmitter; /** * Emitted when the selected row changes in the data table. */ icSelectedRowChange: EventEmitter<{ row: IcDataTableDataType | null; selectedRows: IcDataTableDataType[]; icRowId: string | null; selectedIcRowIds: string[]; }>; /** * Emitted when the columns have finished loading after being updated or initially rendered. */ icColumnsLoaded: EventEmitter; /** * Emitted when the data has finished loading after being updated or initially rendered. */ icDataLoaded: EventEmitter; /** * Emitted when a column sort button is clicked. */ icSortChange: EventEmitter; disconnectedCallback(): void; componentWillLoad(): void; componentDidLoad(): void; componentDidUpdate(): void; componentDidRender(): void; private runHeaderResizeObserver; private headerResizeCallback; private handleResize; private getRowHeight; private truncateUpdatedData; private truncateTableSorted; private truncateRowHeightSet; private truncateItemsPerPageChange; private truncatePageChange; private truncateDensityUpdate; private typographyScrollHeightExceedsContainerHeight; private cellContainerMinusLineHeightIsGreaterThanTruncWrapperScrollHeight; private truncatePatternUpdated; private updateSetRowHeight; private createShowHideTruncation; private getLines; private truncate; private addTooltipTruncation; private addShowHideTruncationIfNeeded; private addShowHideTruncation; private dataTruncation; private getTruncWrapper; private getShowHideButton; handleTypographyTruncationExpandToggle({ detail, }: CustomEvent<{ expanded: boolean; typographyEl: HTMLIcTypographyElement; }>): void; handlePageChange({ detail, target }: CustomEvent<{ value: number; }>): void; handleItemsPerPageChange({ detail, target, }: CustomEvent<{ value: number; }>): void; handleDensityChange(ev: CustomEvent): void; loadingHandler(): void; truncationPatternHandler(): void; dataHandler(): Promise; densityHandler(): Promise; private removeTextWrap; private getCellContainer; private deleteTextWrapDataKey; private resetSingleShowHideTruncation; private resetAllShowHideTruncation; rowHeightChangeHandler(newValue: number, oldValue: number): void; /** * Resets the `globalRowHeight` prop to number or auto and sets the `variableRowHeight` prop to `null`. */ resetRowHeights(rowHeight?: number | "auto"): Promise; private showLoadingIndicator; private startLoadingTimer; private isObject; private notDefaultDensity; private getCellContent; private getCellAlignment; private getCellOptions; private createUpdatingIndicator; private setRowHeight; private setTruncationClass; private getColumnWidth; private getCalculatedRowHeight; private getSlottedActionElement; private adjustWidthForActionElement; private createCellContent; private createCells; private createColumnHeaders; private onRowClick; private selectAllRows; private createRows; private getObjectValue; private getSortButtonLabel; private getComparison; private getSortFunction; private sortRows; /** Gets all `ic-typography`elements within the data table, excluding column headers and cell descriptions */ private getTypographyElements; private getTooltip; private updateTruncationTooltip; private updateScrollOffset; private updateRowHeightForDescriptions; private getDescriptionHeight; /** Method to update the row heights on cells with descriptions and tooltip truncation */ private updateCellHeightsWithDescriptions; private regenerateTooltip; private setTableDimensions; private removeTooltip; private addLineClampCSS; private createTruncationTooltip; private fixCellTooltip; private fixCellOverflow; private fixCellTooltips; private renderTableBody; private renderLoadingIndicator; private renderAriaLiveLoading; private renderEmptyState; render(): any; }