import { UpdateTablePropertiesAction } from '../actions/update-table-properties-action';
import { TablePropertiesEventHandler } from './table-properties';
/**
 * Change Event handler for the table properties.
 */
export class TablePropertiesChangeEventHandler extends TablePropertiesEventHandler {
  /**
   * Update the table properties based on the provided data.
   *
   * @param {RTETableExtensionContext} _extensionContext - The table extension context.
   * @param {RTETableBlock} tableBlock - The table block to update
   * @param {RTETablePropertiesType} [data] - The new table properties data
   */
  handle(_extensionContext, tableBlock, data) {
    const action = new UpdateTablePropertiesAction(data);
    // Prevent automatic flushing of the action
    action.isFlushable = false;
    tableBlock.apply(action);
  }
}
