/*! * * Wijmo Library 5.20221.857 * http://wijmo.com/ * * Copyright(c) GrapeCity, Inc. All rights reserved. * * Licensed under the GrapeCity Commercial License. * sales@wijmo.com * wijmo.com/products/wijmo-5/license/ * */ /** * {@module wijmo.react.grid} * Contains React components for the wijmo.grid module. */ /** * */ export declare var ___keepComment: any; import { ComponentBase } from '@grapecity/wijmo.react.base'; import * as React from 'react'; import * as wjcCore from '@grapecity/wijmo'; import * as wjcGrid from '@grapecity/wijmo.grid'; import * as wjcInteropGrid from '@grapecity/wijmo.interop.grid'; /** * Represents a cell template types enumeration. */ export import CellTemplateType = wjcInteropGrid.GridCellTemplateType; /** * React component for the {@link wijmo.grid.FlexGrid} control. * * The flex-grid component may contain * the following child components: * {@link wijmo.react.grid.detail.FlexGridDetail} * , {@link wijmo.react.grid.filter.FlexGridFilter} * , {@link wijmo.react.grid.immutable.ImmutabilityProvider} * , {@link wijmo.react.grid.FlexGridColumn} * , {@link wijmo.react.grid.FlexGridColumnGroup} * and {@link wijmo.react.grid.FlexGridCellTemplate}. * * The component supports all properties and events of the pure JavaScript {@link wijmo.grid.FlexGrid} control it represents. * * The component includes an initialized event that is raised when the control is initialized after it is added to the page. * You can use this event to perform further initialization in addition to setting properties in JSX. * The signature of the handler function is the same as any other Wijmo event handlers. * * The example below shows how to instantiate and initialize a * {@link wijmo.grid.FlexGrid} control in JSX: * *
<Wj.FlexGrid
 *   autoGenerateColumns={ false }
 *   columns={[
 *     { binding: 'name', header: 'Name' },
 *     { binding: 'sales', header: 'Sales', format: 'c0' },
 *     { binding: 'expenses', header: 'Expenses', format: 'c0' },
 *     { binding: 'active', header: 'Active' },
 *     { binding: 'date', header: 'Date' }
 *   ]}
 *   itemsSource={ this.state.data } />
* * The code sets the autoGenerateColumns property to false, then * sets the columns property, and finally sets the itemsSource * property. This order is important, it prevents the grid from automatically * generating the columns. */ export declare class FlexGrid extends ComponentBase { props: { template?: any; children?: any; isDisabled?: any; tabOrder?: any; newRowAtTop?: any; allowAddNew?: any; allowDelete?: any; allowDragging?: any; allowMerging?: any; allowResizing?: any; allowSorting?: any; allowPinning?: any; autoScroll?: any; autoRowHeights?: any; autoSizeMode?: any; autoGenerateColumns?: any; autoSearch?: any; caseSensitiveSearch?: any; quickAutoSize?: any; bigCheckboxes?: any; childItemsPath?: any; groupHeaderFormat?: any; headersVisibility?: any; showSelectedHeaders?: any; showMarquee?: any; showPlaceholders?: any; itemFormatter?: any; isReadOnly?: any; imeEnabled?: any; mergeManager?: any; selectionMode?: any; showGroups?: any; showSort?: any; showDropDown?: any; showAlternatingRows?: any; showErrors?: any; alternatingRowStep?: any; itemValidator?: any; validateEdits?: any; treeIndent?: any; itemsSource?: any; autoClipboard?: any; expandSelectionOnCopyPaste?: any; frozenRows?: any; frozenColumns?: any; cloneFrozenCells?: any; deferResizing?: any; sortRowIndex?: any; editColumnIndex?: any; stickyHeaders?: any; preserveSelectedState?: any; preserveOutlineState?: any; preserveWhiteSpace?: any; keyActionTab?: any; keyActionEnter?: any; rowHeaderPath?: any; virtualizationThreshold?: any; anchorCursor?: any; lazyRender?: any; refreshOnEdit?: any; copyHeaders?: any; columnGroups?: any; initialized?: any; gotFocus?: any; lostFocus?: any; refreshing?: any; refreshed?: any; invalidInput?: any; beginningEdit?: any; cellEditEnded?: any; cellEditEnding?: any; prepareCellForEdit?: any; formatItem?: any; resizingColumn?: any; resizedColumn?: any; autoSizingColumn?: any; autoSizedColumn?: any; draggingColumn?: any; draggingColumnOver?: any; draggedColumn?: any; sortingColumn?: any; sortedColumn?: any; pinningColumn?: any; pinnedColumn?: any; resizingRow?: any; resizedRow?: any; autoSizingRow?: any; autoSizedRow?: any; draggingRow?: any; draggingRowOver?: any; draggedRow?: any; deletingRow?: any; deletedRow?: any; loadingRows?: any; loadedRows?: any; rowEditStarting?: any; rowEditStarted?: any; rowEditEnding?: any; rowEditEnded?: any; rowAdded?: any; groupCollapsedChanging?: any; groupCollapsedChanged?: any; columnGroupCollapsedChanging?: any; columnGroupCollapsedChanged?: any; itemsSourceChanging?: any; itemsSourceChanged?: any; selectionChanging?: any; selectionChanged?: any; scrollPositionChanged?: any; updatingView?: any; updatedView?: any; updatingLayout?: any; updatedLayout?: any; pasting?: any; pasted?: any; pastingCell?: any; pastedCell?: any; copying?: any; copied?: any; [key: string]: any; }; constructor(props: any); protected _createControl(): any; } /** * React component for the {@link wijmo.grid.Column} class. * * The flex-grid-column component should be contained in * a {@link wijmo.react.grid.FlexGrid} component. * * The flex-grid-column component may contain * a {@link wijmo.react.grid.FlexGridCellTemplate} child component. * * The component supports all properties and events of the pure JavaScript {@link wijmo.grid.Column} class it represents. * * The component includes an initialized event that is raised when the control is initialized after it is added to the page. * You can use this event to perform further initialization in addition to setting properties in JSX. * The signature of the handler function is the same as any other Wijmo event handlers. */ export declare class FlexGridColumn extends ComponentBase { props: { template?: any; children?: any; name?: any; dataMap?: any; dataType?: any; binding?: any; sortMemberPath?: any; format?: any; cellTemplate?: any; header?: any; width?: any; maxLength?: any; minWidth?: any; maxWidth?: any; align?: any; allowDragging?: any; allowSorting?: any; allowResizing?: any; allowMerging?: any; aggregate?: any; isReadOnly?: any; cssClass?: any; cssClassAll?: any; isContentHtml?: any; isSelected?: any; visible?: any; wordWrap?: any; multiLine?: any; mask?: any; inputType?: any; isRequired?: any; showDropDown?: any; dataMapEditor?: any; dropDownCssClass?: any; quickAutoSize?: any; editor?: any; initialized?: any; [key: string]: any; }; _parentProp: string; constructor(props: any); protected _initParent(): void; } /** * React component for the {@link wijmo.grid.ColumnGroup} class. * * The flex-grid-column-group component should be contained in * one of the following components: * {@link wijmo.react.grid.FlexGrid} * or {@link wijmo.react.grid.FlexGridColumnGroup}. * * The flex-grid-column-group component may contain * the following child components: * {@link wijmo.react.grid.FlexGridColumnGroup} * and {@link wijmo.react.grid.FlexGridCellTemplate}. * * The component supports all properties and events of the pure JavaScript {@link wijmo.grid.ColumnGroup} class it represents. * * The component includes an initialized event that is raised when the control is initialized after it is added to the page. * You can use this event to perform further initialization in addition to setting properties in JSX. * The signature of the handler function is the same as any other Wijmo event handlers. */ export declare class FlexGridColumnGroup extends ComponentBase { props: { template?: any; children?: any; name?: any; dataMap?: any; dataType?: any; binding?: any; sortMemberPath?: any; format?: any; cellTemplate?: any; header?: any; width?: any; maxLength?: any; minWidth?: any; maxWidth?: any; align?: any; allowDragging?: any; allowSorting?: any; allowResizing?: any; allowMerging?: any; aggregate?: any; isReadOnly?: any; cssClass?: any; cssClassAll?: any; isContentHtml?: any; isSelected?: any; visible?: any; wordWrap?: any; multiLine?: any; mask?: any; inputType?: any; isRequired?: any; showDropDown?: any; dataMapEditor?: any; dropDownCssClass?: any; quickAutoSize?: any; editor?: any; collapseTo?: any; isCollapsed?: any; initialized?: any; [key: string]: any; }; _parentProp: string; constructor(props: any); } interface ICellTemplateInfoReact extends wjcInteropGrid.ICellTemplateInfo { template: CellTemplateRender; } interface ICellRenderingInfoReact extends wjcInteropGrid.ICellRenderingInfo { templateContext: ICellTemplateInfoReact; } export declare class DirectiveCellFactory extends wjcInteropGrid.DirectiveCellFactoryBase { private readonly _renderedCells; private _isViewUpdated; constructor(gridComponent: ComponentBase, grid: wjcGrid.FlexGrid); protected shouldInstantiate(cellInfo: wjcInteropGrid.ICellRenderingInfo): boolean; protected renderTemplate(cellInfo: ICellRenderingInfoReact, initNew: boolean): void; protected disposeTemplate(cell: HTMLElement, templateCache: wjcInteropGrid.ICellTemplateCache, templateContext: ICellTemplateInfoReact): void; protected clearCell(cell: HTMLElement): void; protected applyImmediately(cellInfo: ICellRenderingInfoReact): void; protected flushPendingEvents(control: wjcCore.Control): void; protected getEditorFocusFlag(): boolean; protected setEditorFocusFlag(value: boolean): void; private _renderCell; private _addRenderedCell; private _removeRenderedCell; private _reRenderCells; private _gridCmpBeforeDidUpdate; private _gridCmpAfterDidUpdate; private _gridCmpRendered; private _gridViewUpdated; } export interface ICellTemplateContext { row: wjcGrid.Row; col: wjcGrid.Column; item: any; value: any; values: any; } export declare type CellTemplateRender = (context: ICellTemplateContext) => any; /** * React component for the {@link FlexGrid} cell templates. * * The FlexGridCellTemplate component defines a template for a certain * cell type in {@link FlexGrid}. The template element must contain a cellType property that * specifies the {@link wijmo.react.grid.CellTemplateType}. Depending on the template's cell type, * the FlexGridCellTemplate element must be a child * of either {@link wijmo.react.grid.FlexGrid} * or {@link wijmo.react.grid.FlexGridColumn} components. * * Column-specific cell templates must be contained in FlexGridColumn * components, and cells that are not column-specific (like row header or top left cells) * must be contained in the FlexGrid component. * * The content of cells is defined using the template render prop, which receives * a render function that should return a virtual element tree representing the cell content. * The function has the context parameter where the data context of each certain cell is * passed. This is an object with the col, row, and item properties, * which refer to the {@link Column}, {@link Row}, and Row.dataItem objects pertaining to the cell. * * For cell types like Group and CellEdit, an additional value * context property containing an unformatted cell value is provided. * * For example, here is a * {@link FlexGrid} control with templates for row header cells and, regular * and column header cells of the Country column: * * ```html * * * context.row.index + 1 } /> * '...' } /> * * * { * return * * {context.col.header} * * } * } * /> * { * return * * {context.item.country} * * } } * /> * * * * ``` * * The FlexGridCellTemplate directive supports the following properties: * *
*
cellType
*
* The CellTemplateType value defining the type of cell to which the template is applied. *
*
autoSizeRows
*
* Indicates whether the cell template will increase grid's default row height * to accomodate cells content. Defaults to true. *
*
cellOverflow
*
* Defines the style.overflow property value for cells. *
*
forceFullEdit
*
* For cell edit templates, indicates whether cell editing forcibly starts in full edit mode, * regardless of how the editing was initiated. In full edit mode pressing cursor keys don't finish editing. * Defaults to true. *
*
* * The cellType attribute takes any of the following enumerated values: * * Cell * * Defines a regular (data) cell template. Must be a child of the {@link wijmo.react.grid.FlexGridColumn} component. * For example, this cell template shows flags in the cells of Country column: * * ```html * * { * return * * {context.item.country} * * } * } * /> * * ``` * * If Group template is not provided for a hierarchical {@link FlexGrid} (that is, one with the childItemsPath property * specified), non-header cells in group rows of * this {@link Column} also use this template. * * CellEdit * * Defines a template for a cell in edit mode. Must be a child of the {@link wijmo.react.grid.FlexGridColumn} component. * This cell type has an additional context.value property. It contains the * original cell value before editing, and the updated value after editing. * * For example, here is a template that uses the Wijmo {@link InputNumber} control as an editor * for the "Sales" column: * ```html * * { * return * context.value = inpNum.value * } /> * } * } * /> * * ``` * * ColumnHeader * * Defines a template for a column header cell. Must be a child of the {@link wijmo.react.grid.FlexGridColumn} component. * For example, this template adds an image to the header of the "Country" column: * * ```html * * { * return * * {context.col.header} * * } * } * /> * * ``` * * RowHeader * * Defines a template for a row header cell. Must be a child of the {@link wijmo.react.grid.FlexGrid} component. * For example, this template shows row indices in the row headers: * * ```html * * context.row.index + 1 } /> * * ``` * * Note that this template is applied to a row header cell, even if it is in a row that is * in edit mode. In order to provide an edit-mode version of a row header cell with alternate * content, define the RowHeaderEdit template. * * RowHeaderEdit * * Defines a template for a row header cell in edit mode. Must be a child of the * {@link wijmo.react.grid.FlexGrid} component. For example, this template shows dots in the header * of rows being edited: * * ```html * * '...' } /> * * ``` * * Use the following RowHeaderEdit template to add the standard edit-mode indicator to cells where * the RowHeader template applies: * * ```html * * '\u270e\ufe0e' } /> * * ``` * * TopLeft * * Defines a template for the top left cell. Must be a child of the {@link wijmo.react.grid.FlexGrid} component. * For example, this template shows a down/right glyph in the top-left cell of the grid: * * ```html * * { * return * } } * /> * * ``` * * GroupHeader * * Defines a template for a group header cell in a {@link GroupRow}. Must be a child of * the {@link wijmo.react.grid.FlexGridColumn} component. * * The context.row property contains an instance of the GroupRow class. If the grouping comes * from {@link CollectionView}, the context.item property references the {@link CollectionViewGroup} object. * * For example, this template uses a checkbox element as an expand/collapse toggle: * * ```html * * { * return * * context.row.isCollapsed = e.target.checked as boolean * } /> * {context.item.name} ({context.item.items.length} items) * * } * } * /> * * ``` * * Group * * Defines a template for a regular cell (not a group header) in a {@link GroupRow}. Must be a child of the * {@link wijmo.react.grid.FlexGridColumn} component. This cell type has an additional context.value * property. In cases where columns have the aggregate property specified, it contains the unformatted * aggregate value. * * For example, this template shows aggregate's value and kind for group row cells in the "Sales" * column: * * ```html * * { * return * Average: {wjcCore.Globalize.formatNumber(context.value, 'N0')} * * } * } * /> * * ``` * * ColumnFooter * * Defines a template for a regular cell in a columnFooters panel. Must be a child of the * {@link wijmo.react.grid.FlexGridColumn} component. This cell type provides an additional context.value * property available for binding that contains an aggregated cell value. * * For example, this template shows aggregate's value and kind for a footer cell in the "Sales" * column: * * ```html * * { * return * Average: {wjcCore.Globalize.formatNumber(context.value, 'N0')} * * } * } * /> * * ``` * * BottomLeft * * Defines a template for the bottom left cells (at the intersection of the row header and column footer cells). * Must be a child of the {@link wijmo.react.grid.FlexGrid} component. * For example, this template shows a sigma glyph in the bottom-left cell of the grid: * * ```html * * Σ} /> * * ``` * * NewCellTemplate * * Defines a cell in a new row template. Must be a child of the {@link wijmo.react.grid.FlexGridColumn} component. * Note that the context.item property is undefined for this type of a cell. * For example, this cell template shows a placeholder in the Date column's cell in the "new row" item: * * ```html * * 'Enter a date here' } /> * * ``` */ export declare class FlexGridCellTemplate extends React.Component { static readonly _CellRenderFuncProp: string; grid: wjcGrid.FlexGrid; column: wjcGrid.Column; ownerControl: wjcGrid.FlexGrid | wjcGrid.Column; cellType: CellTemplateType; readonly cellOverflow: string; readonly autoSizeRows: boolean; readonly forceFullEdit: boolean; readonly valuePaths: Object; readonly template: CellTemplateRender; componentDidMount(): void; componentWillUnmount(): void; componentDidUpdate(prevProps: any): void; render(): any; private _attachToControl; private _detachFromControl; } export {};