text: "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  var tslib_1 = require("tslib");
  var React = require("react");
  var Utilities_1 = require("../../Utilities");
  var Button_1 = require("../../Button");
  var GridCell = /** @class */ (function (_super) {
      tslib_1.__extends(GridCell, _super);
      function GridCell() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this._onClick = function () {
              var _a = _this.props, onClick = _a.onClick, disabled = _a.disabled, item = _a.item;
              if (onClick && !disabled) {
                  onClick(item);
              }
          };
          _this._onMouseEnter = function (ev) {
              var _a = _this.props, onHover = _a.onHover, disabled = _a.disabled, item = _a.item, onMouseEnter = _a.onMouseEnter;
              var didUpdateOnEnter = onMouseEnter && onMouseEnter(ev);
              if (!didUpdateOnEnter && onHover && !disabled) {
                  onHover(item);
              }
          };
          _this._onMouseMove = function (ev) {
              var _a = _this.props, onHover = _a.onHover, disabled = _a.disabled, item = _a.item, onMouseMove = _a.onMouseMove;
              var didUpdateOnMove = onMouseMove && onMouseMove(ev);
              if (!didUpdateOnMove && onHover && !disabled) {
                  onHover(item);
              }
          };
          _this._onMouseLeave = function (ev) {
              var _a = _this.props, onHover = _a.onHover, disabled = _a.disabled, onMouseLeave = _a.onMouseLeave;
              var didUpdateOnLeave = onMouseLeave && onMouseLeave(ev);
              if (!didUpdateOnLeave && onHover && !disabled) {
                  onHover();
              }
          };
          _this._onFocus = function () {
              var _a = _this.props, onFocus = _a.onFocus, disabled = _a.disabled, item = _a.item;
              if (onFocus && !disabled) {
                  onFocus(item);
              }
          };
          return _this;
      }
      GridCell.prototype.render = function () {
          var _a = this.props, item = _a.item, id = _a.id, className = _a.className, role = _a.role, selected = _a.selected, disabled = _a.disabled, onRenderItem = _a.onRenderItem, cellDisabledStyle = _a.cellDisabledStyle, cellIsSelectedStyle = _a.cellIsSelectedStyle, index = _a.index, label = _a.label, getClassNames = _a.getClassNames;
          return (React.createElement(Button_1.CommandButton, { id: id, "data-index": index, "data-is-focusable": true, disabled: disabled, className: Utilities_1.css(className, (_b = {},
                  _b['' + cellIsSelectedStyle] = selected,
                  _b['' + cellDisabledStyle] = disabled,
                  _b)), onClick: this._onClick, onMouseEnter: this._onMouseEnter, onMouseMove: this._onMouseMove, onMouseLeave: this._onMouseLeave, onFocus: this._onFocus, role: role, "aria-selected": selected, ariaLabel: label, title: label, getClassNames: getClassNames }, onRenderItem(item)));
          var _b;
      };
      GridCell.defaultProps = {
          disabled: false,
          id: Utilities_1.getId('gridCell')
      };
      return GridCell;
  }(React.Component));
  exports.GridCell = GridCell;
  //# sourceMappingURL=GridCell.js.map