import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
import React, { useCallback, useState } from 'react';
import classNames from 'classnames';
import { Size } from '../../../es/_util/enum';
import { $l } from '../locale-context';
import ObserverNumberField from '../number-field/NumberField';

var QuickJumper = function QuickJumper(props) {
  var prefixCls = props.prefixCls,
      value = props.value,
      onChange = props.onChange,
      disabled = props.disabled,
      gotoButton = props.gotoButton;

  var _useState = useState(false),
      _useState2 = _slicedToArray(_useState, 2),
      focused = _useState2[0],
      setFocused = _useState2[1];

  var handleFocus = useCallback(function () {
    return setFocused(true);
  }, []);
  var handleBlur = useCallback(function () {
    return setFocused(false);
  }, []);
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
    className: "".concat(prefixCls, "-quick-jumper")
  }, $l('Pagination', 'jump_to')), /*#__PURE__*/React.createElement("span", {
    className: classNames("".concat(prefixCls, "-quick-jumper-input"), _defineProperty({}, "".concat(prefixCls, "-quick-jumper-input-focused"), focused))
  }, /*#__PURE__*/React.createElement(ObserverNumberField, {
    value: value,
    disabled: disabled,
    min: 1,
    onChange: onChange,
    onFocus: handleFocus,
    onBlur: handleBlur,
    size: Size.small,
    isFlat: true,
    border: false
  }), $l('Pagination', 'page')), gotoButton);
};

QuickJumper.displayName = 'QuickJumper';
export default QuickJumper;
//# sourceMappingURL=QuickJumper.js.map
