@sap-ux/ui-components
Version:
SAP UI Components Library
222 lines • 4.96 kB
TypeScript
import React from 'react';
import type { UITableProps, UITableState } from './types.js';
import './UITable.scss';
/**
* UITable component
* based on: https://developer.microsoft.com/en-us/fluentui#/controls/web/detailslist
*
* @exports
* @class {UITable}
* @extends {React.Component<UITableProps, UITableState>}
*/
export declare class UITable extends React.Component<UITableProps, UITableState> {
private readonly tableRef;
private inputRefs?;
private readonly selection;
private onDocMousedown;
private activeElement;
private caretPosition;
/**
* Initializes component properties.
*
* @param props
*/
constructor(props: UITableProps);
componentDidMount(): void;
componentWillUnmount(): void;
/**
* On component update.
*
* @param prevProps
* @param prevState
*/
componentDidUpdate(prevProps: UITableProps, prevState: UITableState): void;
/**
* Restores the caret position. Caret position gets lost when validation finds issue in cell.
*/
private _restoreCaretPosition;
private _setTextRefs;
/**
* On render row fields event.
*
* @param props
* @returns {JSX.Element}
*/
private renderRowFields;
/**
* On render field event.
*
* @param props
* @param defaultRender
* @returns {null | JSX.Element}
*/
private _onRenderField;
/**
* On cell activation event.
*
* @param item
* @param rowIndex
* @param ev
*/
private _onCellActivation;
private readonly _onRenderRow;
/**
* On render item column event.
*
* @param {UIDocument} item
* @param {number} index
* @param {UIColumn} column
* @returns {React.ReactNode}
*/
private _onRenderItemColumn;
/**
* On render checkbox event.
*
* @param {IDetailsListCheckboxProps | undefined} props
* @returns {React.ReactElement}
*/
private _onRenderCheckbox;
/**
* On column click event.
*
* @param ev
* @param column
*/
private _onColumnClick;
/**
* On start edit event call.
*
* @param rowIndex
* @param item
* @param column
* @param errorMessage
*/
private startEdit;
private rerenderTable;
private cancelEdit;
/**
* Get the current string value from a cell editor ref.
*
* @param compRef - React ref to the cell editor control
* @param columnControlType - type of the cell editor control
* @returns current string value from the control
*/
private getRefValue;
/**
* On save cell event.
*
* @param cancelEdit
* @param value
*/
private saveCell;
/**
* On mouse down event.
*
* @param e
*/
private onDocumentMousedown;
/**
* On key down event.
*
* @param {React.KeyboardEvent<Element | IDropdown>} e
* @returns {void}
*/
private onKeyDown;
/**
* On ComboBox keydown event call.
*
* @param e
*/
private onComboBoxKeyDownCapture;
/**
* On Edit next cell.
*
* @param key
* @param shiftKey
*/
private editNextCell;
/**
* On Cell click.
*
* @param e
* @param item
* @param rowIndex
* @param column
*/
private _onCellClick;
/**
* Validates passed value for cell and updates "errorMessage" property based on validation result.
*
* @param editedCell Cell to validate
* @param value
*/
private validateCell;
/**
* On Text input change.
*
* @param e
* @param newValue
*/
private onTextInputChange;
private readonly onComboBoxChange;
private readonly onDropdownCellValueChange;
/**
* Gets input ref.
*
* @param rowIndex
* @param column
* @returns { React.RefObject<ITextField | IDropdown | HTMLDivElement> | undefined}
*/
private _getInputRef;
/**
* Renders dropdown.
*
* @param item
* @param rowIndex
* @param column
* @returns {any}
*/
private _renderDropdown;
/**
* Renders combobox.
*
* @param item
* @param rowIndex
* @param column
* @returns {any}
*/
private _renderCombobox;
/**
* Renders date picker.
*
* @param item
* @param rowIndex
* @param column
* @param dateOnly
* @returns {any}
*/
private _renderDatePicker;
/**
* Renders text input.
*
* @param item
* @param rowIndex
* @param column
* @returns {any}
*/
private _renderTextInput;
/**
* On cell render.
*
* @param item
* @param rowIndex
* @param column
* @returns {any}
*/
private _onCellRender;
/**
* @returns {JSX.Element}
*/
render(): JSX.Element;
}
//# sourceMappingURL=UITable.d.ts.map