"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.scrollbarProps = exports.default = void 0;
var _vue = require("vue");
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _BaseScrollbar = require("./BaseScrollbar");
var scrollbarProps = {
  trigger: String,
  xScrollable: Boolean,
  onScroll: Function
};
exports.scrollbarProps = scrollbarProps;
var Scrollbar = (0, _vue.defineComponent)({
  name: 'PfScrollbar',
  props: scrollbarProps,
  setup: function setup() {
    var scrollbarInstRef = (0, _vue.ref)(null);
    var scrollContainer = (0, _vue.computed)(function () {
      var _scrollbarInstRef$val;
      return (_scrollbarInstRef$val = scrollbarInstRef.value) === null || _scrollbarInstRef$val === void 0 ? void 0 : _scrollbarInstRef$val.containerRef;
    });
    var exposedMethods = {
      scrollTo: function scrollTo() {
        var _scrollbarInstRef$val2;
        (_scrollbarInstRef$val2 = scrollbarInstRef.value) === null || _scrollbarInstRef$val2 === void 0 ? void 0 : _scrollbarInstRef$val2.scrollTo(arguments.length <= 0 ? undefined : arguments[0], arguments.length <= 1 ? undefined : arguments[1]);
      },
      scrollBy: function scrollBy() {
        var _scrollbarInstRef$val3;
        (_scrollbarInstRef$val3 = scrollbarInstRef.value) === null || _scrollbarInstRef$val3 === void 0 ? void 0 : _scrollbarInstRef$val3.scrollBy(arguments.length <= 0 ? undefined : arguments[0], arguments.length <= 1 ? undefined : arguments[1]);
      }
    };
    return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, exposedMethods), {}, {
      scrollbarInstRef: scrollbarInstRef,
      scrollContainer: scrollContainer
    });
  },
  render: function render() {
    return (0, _vue.createVNode)(_BaseScrollbar.Scrollbar, (0, _objectSpread2.default)({
      "ref": "scrollbarInstRef"
    }, this.$props), this.$slots);
  }
});
var _default = Scrollbar;
exports.default = _default;