import { BasePlugin } from '../base'; export declare const PLUGIN_KEY = "manualColumnMove"; export declare const PLUGIN_PRIORITY = 120; /** * @plugin ManualColumnMove * @class ManualColumnMove * * @description * This plugin allows to change columns order. * * API: * - `moveColumn` - move single column to the new position. * - `moveColumns` - move many columns (as an array of indexes) to the new position. * - `dragColumn` - drag single column to the new position. * - `dragColumns` - drag many columns (as an array of indexes) to the new position. * * [Documentation](@/guides/columns/column-moving/column-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 columns. * - guideline - line which shows where columns has been moved. * * @class ManualColumnMove * @plugin ManualColumnMove */ export declare class ManualColumnMove 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; /** * 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 ManualColumnMove#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: * - [`manualColumnMove`](@/api/options.md#manualcolumnmove) */ updatePlugin(): void; /** * Disables the plugin functionality for this Handsontable instance. */ disablePlugin(): void; /** * Moves a single column. * * @param {number} column Visual column index to be moved. * @param {number} finalIndex Visual column index, being a start index for the moved columns. 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/columns/column-moving/column-moving.md#drag-and-move-actions-of-manualcolumnmove-plugin). * @fires Hooks#beforeColumnMove * @fires Hooks#afterColumnMove * @returns {boolean} */ moveColumn(column: number, finalIndex: number): boolean; /** * Moves a multiple columns. * * @param {Array} columns Array of visual column indexes to be moved. * @param {number} finalIndex Visual column index, being a start index for the moved columns. 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/columns/column-moving/column-moving.md#drag-and-move-actions-of-manualcolumnmove-plugin). * @fires Hooks#beforeColumnMove * @fires Hooks#afterColumnMove * @returns {boolean} */ moveColumns(columns: number[], finalIndex: number): boolean; /** * Drag a single column to drop index position. * * @param {number} column Visual column index to be dragged. * @param {number} dropIndex Visual column index, being a drop index for the moved columns. Points to where we are going to drop the moved elements. * To check visualization of drop index please take a look at [documentation](@/guides/columns/column-moving/column-moving.md#drag-and-move-actions-of-manualcolumnmove-plugin). * @fires Hooks#beforeColumnMove * @fires Hooks#afterColumnMove * @returns {boolean} */ dragColumn(column: number, dropIndex: number): boolean; /** * Drag multiple columns to drop index position. * * @param {Array} columns Array of visual column indexes to be dragged. * @param {number} dropIndex Visual column index, being a drop index for the moved columns. Points to where we are going to drop the moved elements. * To check visualization of drop index please take a look at [documentation](@/guides/columns/column-moving/column-moving.md#drag-and-move-actions-of-manualcolumnmove-plugin). * @fires Hooks#beforeColumnMove * @fires Hooks#afterColumnMove * @returns {boolean} */ dragColumns(columns: number[], dropIndex: number): boolean; /** * Indicates if it's possible to move columns 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} movedColumns Array of visual column indexes to be moved. * @param {number} finalIndex Visual column index, being a start index for the moved columns. 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/columns/column-moving/column-moving.md#drag-and-move-actions-of-manualcolumnmove-plugin). * @returns {boolean} */ isMovePossible(movedColumns: number[], finalIndex: number): boolean; /** * Indicates if order of columns was changed. * * @private * @param {Array} movedColumns Array of visual column indexes to be moved. * @param {number} finalIndex Visual column index, being a start index for the moved columns. 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/columns/column-moving/column-moving.md#drag-and-move-actions-of-manualcolumnmove-plugin). * @returns {boolean} */ isColumnOrderChanged(movedColumns: number[], finalIndex: number): boolean; /** * Count the final column index from the drop index. * * @private * @param {Array} movedColumns Array of visual column indexes to be moved. * @param {number} dropIndex Visual column index, being a drop index for the moved columns. * @returns {number} Visual column index, being a start index for the moved columns. */ countFinalIndex(movedColumns: number[], dropIndex: number): number; /** * Gets the sum of the widths of columns in the provided range. * * @private * @param {number} fromColumn Visual column index. * @param {number} toColumn Visual column index. * @returns {number} */ getColumnsWidth(fromColumn: number, toColumn: number): number; /** * Loads initial settings when state was saved (e.g. via hooks) or when plugin was initialized as an array. * * @private */ moveBySettingsOrLoad(): void; /** * Checks if the provided column is in the fixedColumnsTop section. * * @private * @param {number} column Visual column index to check. * @returns {boolean} */ isFixedColumnsStart(column: number): boolean; /** * Prepares an array of indexes based on actual selection. * * @private * @param {number} start The start index. * @param {number} end The end index. * @returns {Array} */ prepareColumnsToMoving(start: number, end: number): 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; }