import { GridOptions as LegacyGridOptions } from '@ag-grid-community/core'; import { CSSVarTokenMap } from '@genesislcap/foundation-ui'; import { GridOptions } from 'ag-grid-community'; import type { GridProGenesisDatasourceErrorEvent } from './grid-pro-genesis-datasource/grid-pro-genesis-datasource.types'; import { gridProErrorNames } from './grid-pro.definitions'; /** * All official AG CSS variables * @public */ export declare enum AgGridCSSVars { foregroundColor = "--ag-foreground-color", dataColor = "--ag-data-color", secondaryForegroundColor = "--ag-secondary-foreground-color", headerForegroundColor = "--ag-header-foreground-color", disabledForegroundColor = "--ag-disabled-foreground-color", backgroundColor = "--ag-background-color", headerBackgroundColor = "--ag-header-background-color", subheaderBackgroundColor = "--ag-subheader-background-color", subheaderToolbarBackgroundColor = "--ag-subheader-toolbar-background-color", controlPanelBackgroundColor = "--ag-control-panel-background-color", selectedRowBackgroundColor = "--ag-selected-row-background-color", oddRowBackgroundColor = "--ag-odd-row-background-color", rowHoverColor = "--ag-row-hover-color", rangeSelectionBorderColor = "--ag-range-selection-border-color", rangeSelectionBackgroundColor = "--ag-range-selection-background-color", selectedTabUnderlineColor = "--ag-selected-tab-underline-color", rangeSelectionChartCategoryBackgroundColor = "--ag-range-selection-chart-category-background-color", rangeSelectionChartBackgroundColor = "--ag-range-selection-chart-background-color", headerCellHoverBackgroundColor = "--ag-header-cell-hover-background-color", headerCellMovingBackgroundColor = "--ag-header-cell-moving-background-color", chipBackgroundColor = "--ag-chip-background-color", borderColor = "--ag-border-color", secondaryBorderColor = "--ag-secondary-border-color", rowBorderColor = "--ag-row-border-color", headerColumnSeparatorColor = "--ag-header-column-separator-color", headerColumnResizeHandleColor = "--ag-header-column-resize-handle-color", inputBorderColor = "--ag-input-border-color", inputDisabledBorderColor = "--ag-input-disabled-border-color", inputDisabledBackgroundColor = "--ag-input-disabled-background-color", checkboxBackgroundColor = "--ag-checkbox-background-color", checkboxCheckedColor = "--ag-checkbox-checked-color", checkboxUncheckedColor = "--ag-checkbox-unchecked-color", checkboxIndeterminateColor = "--ag-checkbox-indeterminate-color", toggleButtonOffBorderColor = "--ag-toggle-button-off-border-color", toggleButtonOffBackgroundColor = "--ag-toggle-button-off-background-color", toggleButtonOnBorderColor = "--ag-toggle-button-on-border-color", toggleButtonOnBackgroundColor = "--ag-toggle-button-on-background-color", toggleButtonSwitchBackgroundColor = "--ag-toggle-button-switch-background-color", toggleButtonSwitchBorderColor = "--ag-toggle-button-switch-border-color", minichartSelectedChartColor = "--ag-minichart-selected-chart-color", minichartSelectedPageColor = "--ag-minichart-selected-page-color", modalOverlayBackgroundColor = "--ag-modal-overlay-background-color", inputFocusBoxShadow = "--ag-input-focus-box-shadow", inputFocusBorderColor = "--ag-input-focus-border-color" } /** * The available Grid Pro themes. * @public */ export declare enum AgGridTheme { alpine = "ag-theme-alpine", alpineDark = "ag-theme-alpine-dark", balham = "ag-theme-balham", balhamDark = "ag-theme-balham-dark", material = "ag-theme-material" } /** * Generates the class name for a given Grid Pro theme name. * @param themeName - the Grid Pro theme name * @returns the class name for the Grid Pro token map * @public * @example The result of this will be a class name that is applied to the grid part of GridPro template (actual content of the class comes from agThemeTokenMapCSS): * ```html * * ``` */ export declare const agThemeTokenMapClassname: (themeName: string) => string; /** * Generates the id name for custom Grid Pro fonts. * @param themeName - the Grid Pro theme name * @returns the id name for the Grid Pro fonts * @public * @example The result of this is used in the id of style tag: * ```html * * ``` */ export declare const agThemeFontsId: (themeName: string) => string; /** * Generates the CSS for a given GridPro theme name and token map * @param themeName - the GridPro theme name * @param tokenMap - a map of CSS variables {@link @genesislcap/grid-pro#AgGridCSSVars} and custom token values * @returns the CSS for the Grid Pro token map * @public * @example * ```ts * export const agThemeGenesisRapidTokens = { * backgroundColor: create('rapid-ag-background-color').withDefault((elem: HTMLElement) => * baseLayerLuminance.getValueFor(elem) === StandardLuminance.LightMode * ? lightColors.backgroundSwatch * : darkColors.backgroundSwatch * ), * foregroundColor: create('rapid-ag-foreground-color').withDefault((elem: HTMLElement) => * baseLayerLuminance.getValueFor(elem) === StandardLuminance.LightMode * ? lightColors.foregroundSwatch * : darkColors.foregroundSwatch * ), * }; * export const agThemeGenesisRapidTokenMap: CSSVarTokenMap = { * [AgGridCSSVars.backgroundColor]: agThemeGenesisRapidTokens.backgroundColor, * [AgGridCSSVars.foregroundColor]: agThemeGenesisRapidTokens.foregroundColor, * }; * ``` */ export declare const agThemeTokenMapCSS: (themeName: string, tokenMap: CSSVarTokenMap) => import("@microsoft/fast-element").ElementStyles; /** * Grid Pro Components type, used to define the custom components that will be registered in the grid * @public */ export type GridComponents = { [componentName: string]: any; }; /** * The available Grid Pro Renderer Types * @public */ export declare enum GridProRendererTypes { action = "action", actionsMenu = "actionsMenu", boolean = "boolean", editable = "editable", icon = "icon", text = "text",// TODO: textField :( select = "select", statusPill = "statusPill", dateEditor = "dateEditor", selectEditor = "selectEditor", numberEditor = "numberEditor", stringEditor = "stringEditor", multiselectEditor = "multiselectEditor" } /** * The available Grid Pro Status Bar Types * @public * @remarks * These status bar components require AG Grid Enterprise module to be enabled. * Status bar components will only be displayed if the Enterprise module is available. * @see https://www.ag-grid.com/javascript-data-grid/component-status-bar/ */ export declare enum GridProStatusBarTypes { labelValue = "labelValue", pagination = "pagination", loadMore = "loadMore", reload = "reload", rowCount = "rowCount" } /** * Event fired when grid is ready * @public * @deprecated - Use `Events.EVENT_GRID_READY` from `@ag-grid-community/core` instead * @privateRemarks * This will be removed when we do the AG Upgrade. */ export declare const GRID_READY_EVENT = "onGridReady"; /** * Key used to store currently edited column when it being synced with server side data * @public */ export declare const EDITED_COLUMN_FIELD = "__editedColumn"; /** * Key used to store error details (column, message) when inline edit fails sync with server side data * @public */ export declare const ERROR_COLUMN_FIELD = "__errorColumn"; /** * Grid options config used to configure grids across the application * @public */ export type GridOptionsConfig = GridOptions | LegacyGridOptions; /** * Default grid options * @public */ export declare const defaultGridOptionsConfig: GridOptionsConfig; /** * Grid options config used to inject into grids in application * @internal */ export declare const GridOptionsConfig: import("@microsoft/fast-foundation").InterfaceSymbol; /** * The available Grid Pro header case types * @public */ export declare enum GridProCaseType { camelCase = "camelCase", capitalCase = "capitalCase", dotCase = "dotCase", headerCase = "headerCase", noCase = "noCase", paramCase = "paramCase", pascalCase = "pascalCase", pathCase = "pathCase", sentenceCase = "sentenceCase", snakeCase = "snakeCase" } /** * Grid Pro Event Listeners * @internal */ export type GridProEventsListeners = [string, (event: Event) => void][]; /** * Grid Pro Error Types * @public */ export type GridProErrorTypes = keyof typeof gridProErrorNames; /** * Grid Pro Error Item * @public */ export interface GridProErrorItem { detail: GridProErrorItemDetailType; type: GridProErrorTypes; } /** * Grid Pro possible error events * @public */ export type GridProErrorEvent = GridProGenesisDatasourceErrorEvent | CustomEvent>; /** * @remarks - Helper type to untype (`never`) non-function properties from GridOptions * @internal */ type UntypeNonFunctions = { [K in keyof T]: T[K] extends (...args: any[]) => any ? T[K] : never; }; /** * @remarks - Helper type to get only functions from GridOptions * @internal */ type OnlyFunctions = { [K in keyof T as T[K] extends never ? never : K]: T[K]; }; /** * Grid Pro Events and Callbacks * @remarks - This type is used to define the events and callbacks that can be passed to the grid * @public */ export type GridProEventsAndCallbacks = OnlyFunctions>; /** * Configuration options for load more status bar component * @public */ export interface GridProStatusBarLoadMoreConfig { /** * Custom callback function to execute when the action is triggered. * If not provided, the component will use the default datasource behavior. */ onLoadMore?: () => void; /** * Custom appearance for the button. * @remarks Options: 'accent', 'lightweight', 'neutral', 'outline', 'stealth' */ appearance?: string; /** * Custom tooltip text that appears on hover. * @remarks Default is 'Load More'. */ tooltip?: string; } /** * Configuration options for reload status bar component * @public */ export interface GridProStatusBarReloadConfig { /** * Custom callback function to execute when the action is triggered. * If not provided, the component will use the default datasource behavior. */ onReload?: () => void; /** * Custom FontAwesome icon name (without 'fa-' prefix). * @remarks Default is 'refresh'. */ icon?: string; /** * Custom tooltip text that appears on hover. * @remarks Default is 'Reload'. */ tooltip?: string; } /** * Configuration options for the grid status bar components * @public * @remarks * This requires AG Grid Enterprise module to be enabled. * Status bar components will only be displayed if the Enterprise module is available. * @see https://www.ag-grid.com/javascript-data-grid/component-status-bar/ */ export interface GridProStatusBarConfig { /** * Enable row count status bar component. * @remarks Default is false. */ rows?: boolean; /** * Enable max rows status bar component. * @remarks Default is false. */ maxRows?: boolean; /** * Configure load more button status bar component. * @remarks Can be boolean for simple enable/disable or object for detailed configuration. */ loadMore?: boolean | GridProStatusBarLoadMoreConfig; /** * Configure reload button status bar component. * @remarks Can be boolean for simple enable/disable or object for detailed configuration. */ reload?: boolean | GridProStatusBarReloadConfig; /** * Enable aggregation status bar component. * @remarks Default is true. Shows aggregation values for selected columns. */ aggregation?: boolean; } /** * Default status bar configuration * @public */ export declare const DEFAULT_STATUS_BAR_CONFIG: GridProStatusBarConfig; /** * Configuration for the label-value status bar component * @public */ export interface GridProStatusBarLabelConfig { /** * The label text to display */ label: string; /** * The value to display */ value: any; /** * Whether to hide the status bar component * @remarks Default is false. */ hide?: boolean; } export {}; //# sourceMappingURL=grid-pro.types.d.ts.map