import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import { createVNode as _createVNode } from "vue";
import { defineComponent, computed } from 'vue';
import useConfigInject from '../_util/hooks/useConfigInject';
import classNames from '../_util/classNames';
export var simpleScrollbarProps = function simpleScrollbarProps() {
  return {
    trigger: {
      type: String,
      default: 'hover'
    },
    xScrollable: {
      type: Boolean,
      default: true
    },
    yScrollable: {
      type: Boolean,
      default: true
    },
    isAlwaysExist: {
      type: Boolean,
      default: true
    } // 滚动条是否始终占据体积
  };
};

var SimpleScrollbar = defineComponent({
  name: 'PfSimpleScrollbar',
  props: simpleScrollbarProps(),
  setup: function setup(props, _ref) {
    var slots = _ref.slots;
    var _useConfigInject = useConfigInject('scrollbar', props),
      prefixCls = _useConfigInject.prefixCls,
      direction = _useConfigInject.direction;
    var simpleScrollbarPrefixCls = "".concat(prefixCls.value, "-simple");
    var mergeCls = computed(function () {
      var _classNames;
      return classNames((_classNames = {}, _defineProperty(_classNames, simpleScrollbarPrefixCls, true), _defineProperty(_classNames, "".concat(simpleScrollbarPrefixCls, "-rtl"), direction.value === 'rtl'), _defineProperty(_classNames, "".concat(simpleScrollbarPrefixCls, "-x"), props.xScrollable), _defineProperty(_classNames, "".concat(simpleScrollbarPrefixCls, "-y"), props.yScrollable), _defineProperty(_classNames, "".concat(simpleScrollbarPrefixCls, "-x-hover"), props.trigger === 'hover' && !props.isAlwaysExist && props.xScrollable), _defineProperty(_classNames, "".concat(simpleScrollbarPrefixCls, "-y-hover"), props.trigger === 'hover' && !props.isAlwaysExist && props.yScrollable), _defineProperty(_classNames, "".concat(simpleScrollbarPrefixCls, "-trigger-hover"), props.trigger === 'hover' && props.isAlwaysExist), _classNames));
    });
    return function () {
      var _slots$default;
      return _createVNode("div", {
        "class": mergeCls.value
      }, [slots === null || slots === void 0 ? void 0 : (_slots$default = slots.default) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots)]);
    };
  }
});
export default SimpleScrollbar;