"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.TableDragAndDropState = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _mobx = require("mobx");
var _CollectionDragAndDropState = require("./CollectionDragAndDropState");
class TableDragAndDropState {
  constructor(params) {
    (0, _defineProperty2.default)(this, "tableState", void 0);
    (0, _defineProperty2.default)(this, "dragAndDrop", void 0);
    this.tableState = params.tableState;
    this.dragAndDrop = new _CollectionDragAndDropState.CollectionDragAndDropState({
      state: params.tableState.toolbar,
      container: params.tableState.toolbar.container,
      a11yContainer: params.modalsContainerRef
    });
    (0, _mobx.makeObservable)(this, {
      init: _mobx.action
    });
  }
  get dnd() {
    return this.dragAndDrop.dnd;
  }
  getStickyColumnsCount({
    stickyColumns,
    horizontalScroll
  }) {
    const {
      dragAndDrop
    } = this;
    return horizontalScroll && !dragAndDrop.dnd.isDisabled ? stickyColumns + 1 : stickyColumns;
  }
  init() {
    const {
      dragAndDrop
    } = this;
    return dragAndDrop.init();
  }
}
exports.TableDragAndDropState = TableDragAndDropState;
//# sourceMappingURL=TableDragAndDropState.js.map