import { BasePlugin } from '../base'; export declare const PLUGIN_KEY = "manualRowMove"; export declare const PLUGIN_PRIORITY = 140; /** * @plugin ManualRowMove * @class ManualRowMove * * @description * This plugin allows to change rows order. * * API: * - `moveRow` - move single row to the new position. * - `moveRows` - move many rows (as an array of indexes) to the new position. * - `dragRow` - drag single row to the new position. * - `dragRows` - drag many rows (as an array of indexes) to the new position. * * [Documentation](@/guides/rows/row-moving/row-moving.md) explain differences between drag and move actions. Please keep in mind that if you want apply visual changes, * you have to call manually the `render` method on the instance of Handsontable. * * The plugin creates additional components to make moving possibly using user interface: * - backlight - highlight of selected rows. * - guideline - line which shows where rows has been moved. * * @class ManualRowMove * @plugin ManualRowMove */ export declare class ManualRowMove extends BasePlugin { #private; /** * Returns the plugin key used to identify this plugin in Handsontable settings. */ static get PLUGIN_KEY(): string; /** * Returns the priority order used to determine the order in which plugins are initialized. */ static get PLUGIN_PRIORITY(): number; /** * Returns the list of settings keys observed by the plugin for configuration changes. */ static get SETTING_KEYS(): string[]; /** * Checks if the plugin is enabled in the handsontable settings. This method is executed in {@link Hooks#beforeInit} * hook and if it returns `true` then the {@link ManualRowMove#enablePlugin} method is called. * When [[Options#dataProvider]] is a complete server-backed configuration, the DataProvider plugin blocks this plugin from enabling. * * @returns {boolean} */ isEnabled(): boolean; /** * Enables the plugin functionality for this Handsontable instance. */ enablePlugin(): void; /** * Updates the plugin's state. * * This method is executed when [`updateSettings()`](@/api/core.md#updatesettings) is invoked with any of the following configuration options: * - [`manualRowMove`](@/api/options.md#manualrowmove) */ updatePlugin(): void; /** * Disables the plugin functionality for this Handsontable instance. */ disablePlugin(): void; /** * Moves a single row. * * To see the outcome, rerender your grid by calling [`render()`](@/api/core.md#render). * * @param {number} row Visual row index to be moved. * @param {number} finalIndex Visual row index, being a start index for the moved rows. Points to where the elements will be placed after the moving action. * To check the visualization of the final index, please take a look at [documentation](@/guides/rows/row-moving/row-moving.md#drag-and-move-actions-of-manualrowmove-plugin). * @fires Hooks#beforeRowMove * @fires Hooks#afterRowMove * @returns {boolean} */ moveRow(row: number, finalIndex: number): boolean; /** * Moves multiple rows. * * To see the outcome, rerender your grid by calling [`render()`](@/api/core.md#render). * * @param {Array} rows Array of visual row indexes to be moved. * @param {number} finalIndex Visual row index, being a start index for the moved rows. Points to where the elements will be placed after the moving action. * To check the visualization of the final index, please take a look at [documentation](@/guides/rows/row-moving/row-moving.md#drag-and-move-actions-of-manualrowmove-plugin). * @fires Hooks#beforeRowMove * @fires Hooks#afterRowMove * @returns {boolean} */ moveRows(rows: number[], finalIndex: number): boolean; /** * Drag a single row to drop index position. * * @param {number} row Visual row index to be dragged. * @param {number} dropIndex Visual row index, being a drop index for the moved rows. Points to where we are going to drop the moved elements. * To check visualization of drop index please take a look at [documentation](@/guides/rows/row-moving/row-moving.md#drag-and-move-actions-of-manualrowmove-plugin). * @fires Hooks#beforeRowMove * @fires Hooks#afterRowMove * @returns {boolean} */ dragRow(row: number, dropIndex: number): boolean; /** * Drag multiple rows to drop index position. * * @param {Array} rows Array of visual row indexes to be dragged. * @param {number} dropIndex Visual row index, being a drop index for the moved rows. Points to where we are going to drop the moved elements. * To check visualization of drop index please take a look at [documentation](@/guides/rows/row-moving/row-moving.md#drag-and-move-actions-of-manualrowmove-plugin). * @fires Hooks#beforeRowMove * @fires Hooks#afterRowMove * @returns {boolean} */ dragRows(rows: number[], dropIndex: number): boolean; /** * Indicates if it's possible to move rows to the desired position. Some of the actions aren't possible, i.e. You can’t move more than one element to the last position. * * @param {Array} movedRows Array of visual row indexes to be moved. * @param {number} finalIndex Visual row index, being a start index for the moved rows. Points to where the elements will be placed after the moving action. * To check the visualization of the final index, please take a look at [documentation](@/guides/rows/row-moving/row-moving.md#drag-and-move-actions-of-manualrowmove-plugin). * @returns {boolean} */ isMovePossible(movedRows: number[], finalIndex: number): boolean; /** * Indicates if order of rows was changed. * * @private * @param {Array} movedRows Array of visual row indexes to be moved. * @param {number} finalIndex Visual row index, being a start index for the moved rows. Points to where the elements will be placed after the moving action. * To check the visualization of the final index, please take a look at [documentation](@/guides/rows/row-moving/row-moving.md#drag-and-move-actions-of-manualrowmove-plugin). * @returns {boolean} */ isRowOrderChanged(movedRows: number[], finalIndex: number): boolean; /** * Count the final row index from the drop index. * * @private * @param {Array} movedRows Array of visual row indexes to be moved. * @param {number} dropIndex Visual row index, being a drop index for the moved rows. * @returns {number} Visual row index, being a start index for the moved rows. */ countFinalIndex(movedRows: number[], dropIndex: number): number; /** * Gets the sum of the heights of rows in the provided range. * * @private * @param {number} fromRow Visual row index. * @param {number} toRow Visual row index. * @returns {number} */ getRowsHeight(fromRow: number, toRow: number): number; /** * Moves rows when the plugin was initialized as an array of row positions. * * @private */ moveBySettingsOrLoad(): void; /** * Checks if the provided row is in the fixedRowsTop section. * * @private * @param {number} row Visual row index to check. * @returns {boolean} */ isFixedRowTop(row: number): boolean; /** * Checks if the provided row is in the fixedRowsBottom section. * * @private * @param {number} row Visual row index to check. * @returns {boolean} */ isFixedRowBottom(row: number): boolean; /** * Prepares an array of indexes based on actual selection. * * @private * @returns {Array} */ prepareRowsToMoving(): number[]; /** * Update the UI visual position. * * @private */ refreshPositions(): void; /** * Binds the events used by the plugin. * * @private */ registerEvents(): void; /** * Unbinds the events used by the plugin. * * @private */ unregisterEvents(): void; /** * Builds the plugin's UI. * * @private */ buildPluginUI(): void; /** * Destroys the plugin instance. */ destroy(): void; }