'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');
require('../../../../utils/index.cjs');
var canUseDom = require('../../../../utils/dom/canUseDom.cjs');

const defaultContainer = canUseDom.canUseDom() ? window : null;
function useSticky(stickyRef, prefixClsRef) {
  return vue.computed(() => {
    const {
      offsetHeader = 0,
      offsetSummary = 0,
      offsetScroll = 0,
      getContainer = () => defaultContainer
    } = typeof stickyRef.value === "object" ? stickyRef.value : {};
    const container = getContainer() || defaultContainer;
    const isSticky = !!stickyRef.value;
    return {
      isSticky,
      stickyClassName: isSticky ? `${prefixClsRef.value}-sticky-holder` : "",
      offsetHeader,
      offsetSummary,
      offsetScroll,
      container
    };
  });
}

exports.default = useSticky;
//# sourceMappingURL=useSticky.cjs.map
